CN110008179A - File memory method, automobile data recorder and readable storage medium storing program for executing - Google Patents

File memory method, automobile data recorder and readable storage medium storing program for executing Download PDF

Info

Publication number
CN110008179A
CN110008179A CN201910262672.2A CN201910262672A CN110008179A CN 110008179 A CN110008179 A CN 110008179A CN 201910262672 A CN201910262672 A CN 201910262672A CN 110008179 A CN110008179 A CN 110008179A
Authority
CN
China
Prior art keywords
file
predistribution
size
recorded
files
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910262672.2A
Other languages
Chinese (zh)
Other versions
CN110008179B (en
Inventor
高涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Chuangwei Automobile Intelligent Co Ltd
Original Assignee
Shenzhen Chuangwei Automobile Intelligent Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Chuangwei Automobile Intelligent Co Ltd filed Critical Shenzhen Chuangwei Automobile Intelligent Co Ltd
Priority to CN201910262672.2A priority Critical patent/CN110008179B/en
Publication of CN110008179A publication Critical patent/CN110008179A/en
Application granted granted Critical
Publication of CN110008179B publication Critical patent/CN110008179B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • GPHYSICS
    • G07CHECKING-DEVICES
    • G07CTIME OR ATTENDANCE REGISTERS; REGISTERING OR INDICATING THE WORKING OF MACHINES; GENERATING RANDOM NUMBERS; VOTING OR LOTTERY APPARATUS; ARRANGEMENTS, SYSTEMS OR APPARATUS FOR CHECKING NOT PROVIDED FOR ELSEWHERE
    • G07C5/00Registering or indicating the working of vehicles
    • G07C5/08Registering or indicating performance data other than driving, working, idle, or waiting time, with or without registering driving, working, idle or waiting time
    • G07C5/0841Registering performance data
    • G07C5/085Registering performance data using electronic data carriers
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Signal Processing For Digital Recording And Reproducing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a kind of file memory methods of automobile data recorder, comprising steps of obtaining pre-recorded video size, and a file are selected from local storage, using the file size currently selected as the first memory capacity;First memory capacity and pre-recorded video size are subtracted each other, the first saved differences are obtained;When first saved differences are greater than 0, selected All Files are deleted, and create the predistribution file that size is first saved differences and the predistribution file that size is pre-recorded video size.The invention also discloses a kind of automobile data recorder and readable storage medium storing program for executing.The present invention can make full use of memory space when file stores, and will not generate fragmentation.

Description

File memory method, automobile data recorder and readable storage medium storing program for executing
Technical field
The present invention relates to the file memory method of mobile unit field more particularly to automobile data recorder, automobile data recorder and Readable storage medium storing program for executing.
Background technique
Automobile data recorder is the audio recorded vehicle driving on the way, the instrument of video related data, the core of automobile data recorder The heart is data storage, but since the data space of automobile data recorder is limited, when storage record video data reaches certain pre- If the video data of trailer record can cover the video data recorded at first, and this data cover can generate a large amount of storages when value Fragment causes waste of storage space, and will affect video record so as to cause unit exception.
Summary of the invention
File memory method, automobile data recorder and the readable storage medium storing program for executing of a kind of automobile data recorder proposed by the present invention, purport The fragmentation generated when solving the problems, such as that automobile data recorder data store causes waste of storage space and video that can not record.
To achieve the above object, the present invention provides a kind of file memory method of automobile data recorder, and the method includes steps It is rapid:
Pre-recorded video size is obtained, and selects a file from local storage, the file currently selected is big It is small to be used as the first memory capacity;
First memory capacity and pre-recorded video size are subtracted each other, the first saved differences are obtained;
When first saved differences are greater than 0, selected All Files are deleted, and creates size and is deposited for described first The predistribution file and size that store up difference are the predistribution file of pre-recorded video size.
Optionally, described that a file is selected from local storage, using the file size currently selected as first The step of memory capacity includes:
It determines in local storage with the presence or absence of predistribution file;
If so, selecting a predistribution file from all predistribution files, and the predistribution file that will currently select Size is as the first memory capacity;
If it is not, then selecting a recorded file from all recorded files, and the recorded file size currently selected is made For the first memory capacity.
Optionally, described the step of first memory capacity is subtracted each other with pre-recorded video size, obtains the first saved differences Later, further includes:
When there is predistribution file and the first saved differences less than 0 in local storage, all predistribution files are judged In whether there is non-selected predistribution file;
When non-selected predistribution file is not present in all predistribution files, according to the recording text in local storage Part and all predistribution files store pre-recorded video;
When in all predistribution files there are when non-selected predistribution file, from the continuous selection of all predistribution file relays Next predistribution file, and the predistribution file size of selection is added in first memory capacity to update the first storage Capacity, to execute step: the first memory capacity and pre-recorded video size being subtracted each other, the first saved differences are obtained.
Optionally, before the step of whether there is non-selected predistribution file in all predistribution files of judgement, Further include:
When there is predistribution file and the first saved differences less than 0 in local storage, all predistribution files are judged Whether the sum of size is greater than or equal to prerecording file size;
If so, thening follow the steps: judging in all predistribution files with the presence or absence of non-selected predistribution file;
If it is not, thening follow the steps: according in local storage recorded file and all predistribution files to prerecording regard Frequency is stored.
Optionally, the recorded file according in local storage and all predistribution files carry out pre-recorded video The step of storage includes:
A recorded file is selected from all recorded files, and by the recorded file size of selection and the first saved differences It is added, obtains the second saved differences;
When second saved differences are greater than 0, all predistribution files and selected all recorded files are deleted, And create the predistribution file that size is second saved differences and the predistribution file that size is pre-recorded video size.
Optionally, it is described from all recorded files select a recorded file, and by the recorded file size of selection with After the step of first saved differences are added, and obtain the second saved differences, further includes:
When second saved differences are less than 0, continue to select next recorded file from all recorded files, and will Second saved differences execute when the second saved differences are greater than 0 from the recorded file size for adding selection: deleting all pre- points With file and selected all recorded files, and create predistribution file that size is second saved differences and big The small predistribution file for pre-recorded video size.
Optionally, described the step of first memory capacity is subtracted each other with pre-recorded video size, obtains the first saved differences Later, further includes:
When in local storage there is no file and the first saved differences is pre-allocated less than 0, from all recorded files Continue to select next recorded file, and by the first saved differences from the recorded file size for adding selection, until the first storage is poor It when value is greater than 0, executes: deleting selected All Files, and create the predistribution file that size is first saved differences And size is the predistribution file of pre-recorded video size.
Optionally, before the step of acquisition pre-recorded video size, further includes:
Obtain the default recording duration and default recording resolution ratio of pre-recorded video;
Pre-recorded video size is calculated according to the default recording time and default resolution ratio of recording.
In addition, to achieve the above object, the present invention also provides a kind of automobile data recorder, the automobile data recorder includes: to deposit Reservoir, processor and it is stored in the computer program that can be run on the memory and on the processor, the calculating Machine program realizes the file memory method of automobile data recorder as described above when being executed by the processor.
In addition, to achieve the above object, the present invention also provides a kind of readable storage medium storing program for executing, being deposited on the readable storage medium storing program for executing Computer program is contained, the computer program realizes the file storage of automobile data recorder as described above when being executed by processor The step of method.
The present invention selects a file by obtaining pre-recorded video size from local storage, will currently select The file size selected is as the first memory capacity;First memory capacity and pre-recorded video size are subtracted each other, the first storage is obtained Difference;When first saved differences are greater than 0, selected All Files are deleted, and creating size is first storage The predistribution file and size of difference are the predistribution file of pre-recorded video size.The present invention can solve fragmentation Problem, and memory space is made full use of, it can avoid the waste of memory space.
Detailed description of the invention
Fig. 1 is the hardware structural diagram for the automobile data recorder that the embodiment of the present invention is related to;
Fig. 2 is the flow diagram of the file memory method first embodiment of automobile data recorder of the present invention;
Fig. 3 is the flow diagram of the 5th embodiment of file memory method of automobile data recorder of the present invention.
Specific embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
Fig. 1 is please referred to, Fig. 1 is the hardware structural diagram of automobile data recorder provided by the present invention.The driving recording Instrument may include the components such as processor 10 and memory 20.In the automobile data recorder, the processor 10 respectively with institute The connection of memory 20 is stated, is stored with computer program on the memory 20, the computer program is held by processor 10 simultaneously Row, when the computer program executes the step of realization following methods embodiment.
Processor 10 is the control centre of automobile data recorder, utilizes various interfaces and the entire automobile data recorder of connection Various pieces, by running or execute the software program and/or module that are stored in memory 20, and call and be stored in Data in reservoir 20 execute the various functions and processing data of automobile data recorder, to carry out whole prison to automobile data recorder Control.Processor 10 may include one or more processing units;Optionally, processor 10 can integrate application processor and modulation /demodulation Processor, wherein the main processing operation system of application processor, user interface and application program etc., modem processor master Handle wireless communication.It is understood that above-mentioned modem processor can not also be integrated into processor 10.
Memory 20 can be used for storing software program and various data.Memory 20 can mainly include storing program area The storage data area and, wherein storing program area can application program needed for storage program area, at least one function (for example obtain Take pre-recorded video size) etc.;Storage data area may include database, and storage data area can be stored is created according to using for system Data or information for building etc..In addition, memory 20 may include high-speed random access memory, it can also include non-volatile deposit Reservoir, for example, at least a disk memory, flush memory device or other volatile solid-state parts.
Although Fig. 1 is not shown, above-mentioned automobile data recorder can also include circuit control module, for connecting to power supply, Guarantee the normal work of other component;It can also include communication module, can be connect by network with external communications equipment.Communicate mould Block can receive the request of external communications equipment sending, can also send request, instruction and information to the external communications equipment. The external communications equipment can be user terminal or other systems server etc..
It will be understood by those skilled in the art that automobile data recorder structure shown in Fig. 1 is not constituted to automobile data recorder Restriction, may include perhaps combining certain components or different component layouts than illustrating more or fewer components.
Based on above-mentioned hardware configuration, each embodiment of the method for the present invention is proposed.
Referring to figure 2., Fig. 2 is the flow diagram of the file memory method first embodiment of automobile data recorder of the present invention, In this embodiment, which comprises
Step S10 obtains pre-recorded video size, and a file is selected from local storage, will currently select File size as the first memory capacity;
It include that predistribution file and/or non-predistribution file (are recorded in the local storage of the present embodiment automobile data recorder File), it additionally may include other operating files or media file needed for automobile data recorder, it can be pre- in local storage First creation predistribution file, predistribution file are the empty files of not stored data, and the available size of each predistribution file can be with It is identical to can also be different, for example, creation size is the predistribution file of 60M;Predistribution file of different sizes can also be created; Or the predistribution file of creation is also possible to the multiple of 60M, such as creation size is the more of 60M, 120M, 180M, 300M etc. A predistribution file of different sizes.In addition, predistribution file size can also be with the pre-set prerecording of automobile data recorder Video resolution and/or playing duration are related, for example, 1080P one minute play time pre-recorded video size be 120M, The pre-recorded video size of one minute play time of 720P is 60M.
It should be noted that initial all predistribution files in automobile data recorder local storage, when predistribution file After being stored in data, predistribution file type is changed into non-predistribution file type, and non-predistribution file is that stored recording has regarded The file of frequency evidence can also be referred to as recorded file.Pre-recorded video is the video data that will be recorded, and can obtain prerecording Video data size selects a file from local storage, and this document can be predistribution file or recorded file, will The predistribution file or recorded file size selected is as the first memory capacity.It optionally, can also be by other media files As file selectable in this secondary memory.
Step S20 subtracts each other the first memory capacity and pre-recorded video size, obtains the first saved differences;
By subtracting each other the first memory capacity and pre-recorded video size in the present embodiment, the first saved differences are obtained, are divided It is pre- whether the size of predistribution file or the recorded file size of selection for analysing selection known to the first saved differences can satisfy Recorded video size.
Step S30 deletes selected All Files, and create size as institute when first saved differences are greater than 0 The predistribution file and size of stating the first saved differences are the predistribution file of pre-recorded video size.
In the present embodiment when a file of selection, the difference of the file size and pre-recorded video size of selection is greater than When 0, illustrate that the file size currently selected can satisfy pre-recorded video size, and there are also extra memory spaces.When depositing In extra memory space, the file of the selection can be split, delete selected All Files first, will stored Space releases, and creating predistribution file that size is the first saved differences and size is pre-recorded video size Pre-allocate file, wherein can be used for storing other pre-recorded video data with the predistribution file that the first saved differences create;With The predistribution file of pre-recorded video size creation is for storing the video data that will currently record.With saved differences creation Predistribution file can also continue to thus avoid the waste of memory space for storing other pre-recorded video data, and Fragmentation, which will not be generated, influences video record.
Further, the first embodiment of the file memory method based on automobile data recorder of the present invention proposes present invention driving The second embodiment of the file memory method of recorder selects one in the present embodiment from local storage in step S10 File includes: using the file size currently selected as the step of the first memory capacity
Step S100 is determined in local storage with the presence or absence of predistribution file;If so, thening follow the steps S110;If it is not, Then follow the steps S120.
Step S110 selects a predistribution file from all predistribution files, and the predistribution currently selected is literary Part size is as the first memory capacity;
Step S120 selects a recorded file, and the recorded file size that will currently select from all recorded files As the first memory capacity.
It is preferential to use predistribution file in the present embodiment middle rolling car recorder when storing video data.In video data Before recording, the doubly linked list in local storage can be first traversed, predistribution file is searched.Wherein doubly linked list is that a kind of chain type is deposited Storage structure, it can connect a series of memories not contacted, and can easily access its predecessor node and subsequent Node.It include several file nodes in doubly linked list, when traversing doubly linked list every time since first file node, each It is differentiated in file node comprising video record time, recording duration, recording in file type, file size, file name, file Rate etc..Wherein file type is divided into predistribution file and non-predistribution file (recorded file), and file size refers to that file is available Memory capacity size.
The doubly linked list in local storage is traversed in the present embodiment first, is determining that it is literary that local storage has predistribution When part, a predistribution file is chosen from all predistribution files, doubly linked list can be traversed according to prerecording file size Find the predistribution file for meeting current prerecording file size, usually from first file node begin stepping through until find with The identical first predistribution file of prerecording file size, using the predistribution file selected as the first memory capacity;If Predistribution file identical with prerecording file size is not found, can choose the first predistribution file traversed, by this The predistribution file selected is as the first memory capacity.Or when selection pre-allocates file, directly select first traversed A predistribution file, it is preferential using pre- when storing video data using the predistribution file selected as the first memory capacity Distribution file can extend the holding time of recorded file.
The doubly linked list traversed in local storage in the present embodiment illustrates to pre-allocate when not finding predistribution file File is used, and when determining local storage there is no file is pre-allocated, a recording is chosen from all recorded files File can traverse doubly linked list according to prerecording file size and find the recorded file for meeting current prerecording file size, Usually begin stepping through from first file node until finding first recorded file identical with prerecording file size, by this The recorded file selected is as the first memory capacity, if not finding recorded file identical with prerecording file size, Ke Yixuan First recorded file traversed is selected, using the recorded file selected as the first memory capacity.Or text is recorded in selection When part, first recorded file traversed is directly selected, using the recorded file selected as the first memory capacity.Or In all recorded files press one recorded file of the sequential selection of recording time from morning to night, using the recorded file selected as First memory capacity, temporally sequential selection recorded file from morning to night can be by the video data of recording time relatively late The time of preservation is more long.
Further, the second embodiment of the file memory method based on automobile data recorder of the present invention proposes present invention driving The 3rd embodiment of the file memory method of recorder, in the present embodiment, after step S20, further includes:
Step S41 judges all pre- when there is predistribution file and the first saved differences less than 0 in local storage It distributes and whether there is non-selected predistribution file in file;
Step S42, when non-selected predistribution file is not present in all predistribution files, according in local storage Recorded file and all predistribution files pre-recorded video is stored;
Step S43, when in all predistribution files there are when non-selected predistribution file, from all predistribution files Continue to select next predistribution file, and the predistribution file size of selection is added in first memory capacity to update First memory capacity, to return to step S20.
In the present embodiment when in local storage exist predistribution file, and select predistribution file size with pre-record When the first saved differences that video size processed is subtracted each other are less than 0, illustrate that the predistribution file size currently selected is not able to satisfy Pre-recorded video size then needs to judge in all predistribution files with the presence or absence of non-selected predistribution file.When all pre- When there is no non-selected predistribution file in distribution file, indicate that predistribution file all in current local storage is all selected It selected, and is still unable to satisfy the requirement that the first saved differences are greater than 0 at this time, needed using recorded file, according to being locally stored Recorded file in device and so predistribution file stores pre-recorded video data.
When having non-selected predistribution file in all predistribution files, indicate to still have in local storage at this time The predistribution file of unselected mistake can traverse bi-directional list, and selection is currently after the predistribution affiliated file node of file File is pre-allocated, and obtains the predistribution file size, which is added in the first memory capacity to update Then first memory capacity executes step S20, to continue to analyze the first saved differences.
When there is predistribution file and the first saved differences less than 0 in local storage in the present embodiment, by judging Have in predistribution file whether there are also non-selected predistribution files, when there are non-selected predistribution in all predistribution files When file, continues to select next predistribution file, and the first memory capacity is added in the predistribution file size of selection, continue Analyze the first saved differences.By analyzing the first saved differences, pre-record it is known that whether the file size of selection can satisfy Video size processed.When non-selected predistribution file is not present in all predistribution files, illustrate not can be used pre- Distribute file, can according in local storage recorded file and all predistribution files pre-recorded video is stored, it is logical Cross the storage that recorded file and all predistribution files are combined and can satisfy pre-recorded video.
Further, judge in step S41 in all predistribution files with the presence or absence of the step of non-selected predistribution file Before rapid, further includes:
Step S401 judges all pre- when there is predistribution file and the first saved differences less than 0 in local storage Distribute whether the sum of file size is greater than or equal to prerecording file size;If: it thens follow the steps and judges all pre- points in S41 With the step of whether there is non-selected predistribution file in file;If not: thening follow the steps in S42 according in local storage Recorded file and all predistribution files the step of pre-recorded video is stored.
In the present embodiment when there is predistribution file and the first saved differences less than 0 in local storage, can first it sentence Whether the sum of all predistribution file sizes of breaking meet prerecording file size, if all predistribution file sizes are greater than or equal to Pre-recorded video file size, pre-recorded video data can be stored by only using predistribution file;If all predistribution files Size is less than pre-recorded video size, needs using all predistribution files and part recorded file storage pre-recorded video number According to.It is preferential to reuse record when the predistribution file that not can be used using predistribution file in video data storage File processed can make the holding time of recorded file more long.Furthermore by carrying out all pre-allocating the sum of file in advance Compare, saved the time compared, improves the division speed of file storage.
In the present embodiment when there is predistribution file in local storage and the first saved differences are equal to 0, illustrate to select Predistribution file size be equal to pre-recorded video size, the predistribution file size currently selected just can satisfy prerecording Video size directly can store pre-recorded video data using the predistribution file of selection.
Further, after step S20, further includes:
S201, when in local storage there is no file and the first saved differences is pre-allocated less than 0, from all recordings texts Continue to select next recorded file in part, and by the first saved differences from plus selection recorded file size, deposit until first It when storing up difference greater than 0, executes in step S30 and deletes selected All Files, and creating size is first saved differences Predistribution file and size be pre-recorded video size predistribution file the step of.
It, can be from all records when there is no when predistribution file, then using recorded file in local storage in the present embodiment A recorded file is selected by preset rules in file processed, it is preferable that can be selected according to the sequence of recording time from morning to night Select, in addition it is also possible to according to from evening to early or at random selected, later can by selected recorded file size in advance Recorded file size subtracts each other to obtain the first saved differences, when the first saved differences are less than 0, continues to select from all recorded files Next recorded file is selected, then according to the first saved differences of next update of selection, carries out the judgement of the first saved differences, When the first saved differences are greater than 0, all predistribution files and selected all recorded files are deleted, and create size Predistribution file and size for second saved differences are the predistribution file of pre-recorded video size.The size of creation It can be used for storing other pre-recorded video data for the predistribution file of second saved differences, the size of creation is prerecording The predistribution file of video size can be used for storing the video data that will currently record, by creating new predistribution file not It only can store pre-recorded video data, and extra memory space released and is used to store other pre-recorded videos, avoid The waste of memory space, and fragmentation will not be generated influence video record.
Further, the 3rd embodiment of the file memory method based on automobile data recorder of the present invention proposes present invention driving The fourth embodiment of the file memory method of recorder, in the present embodiment, according to the recording in local storage in step S42 The step of file and all predistribution files store pre-recorded video include:
Step S421: selecting a recorded file from all recorded files, and by the recorded file size of selection and the One saved differences are added, and obtain the second saved differences;
Step S422: when second saved differences are greater than 0, all predistribution files and selected all are deleted Recorded file, and creating predistribution file that size is second saved differences and size is the pre- of pre-recorded video size Distribute file.
In the present embodiment when the sum of all predistribution file storage sizes are not able to satisfy pre-recorded video data, need to make It include recording time and file size etc. in each recorded file with part recorded file, it can be from all recorded files A recorded file is selected referring to above-described embodiment, such as is selected by the sequence of recording time from morning to night, by the recording text of selection Part size is added with the first saved differences, available second saved differences.The second saved differences are analyzed, when the second saved differences When greater than 0, all predistribution files and selected all recorded files can be deleted, and creating size is the second storage The predistribution file and size of difference are the predistribution file of pre-recorded video size, wherein creation size is that the second storage is poor The predistribution file of value can be used for storing other pre-recorded video data, and creation size is the predistribution text of pre-recorded video size Part can be used for storing the currently video data by recording.It not only can be that can store to pre-record by creating new predistribution file Video data processed, and extra memory space is released and is used to store other pre-recorded videos, avoid the wave of memory space Take, and fragmentation will not be generated to influence video record.
Further, after step S421, further includes:
Step S423 continues to select next recording from all recorded files when second saved differences are less than 0 File, and the second saved differences are executed into deletion when the second saved differences are greater than 0 from the recorded file size for adding selection All predistribution files and selected all recorded files, and create the predistribution text that size is second saved differences Part and size are the predistribution file of pre-recorded video size.
In the present embodiment when the second saved differences are less than 0, illustrate first recorded file size of selection with it is all pre- The sum of distribution file size is not able to satisfy pre-recorded video size of data, it is preferable that when can press recording in all recorded files Between sequence from morning to night continue to select next recorded file, by the recorded file size of the selection and the second saved differences phase Add, when the second saved differences are greater than 0, deletes all predistribution files and selected all recorded files, and create Size be second saved differences predistribution file and size be pre-recorded video size predistribution file.Wherein create Building the predistribution file that size is the second saved differences can be used for storing other pre-recorded video data, and creation size is prerecording The predistribution file of video size can be used for storing the currently video data by recording.By creating new predistribution file not only It can be that can store pre-recorded video data, and extra memory space is released and is used to store other pre-recorded videos, The waste of memory space is avoided, and fragmentation will not be generated to influence video record.
Further, after step S421, further includes:
When the second saved differences are equal to 0, all predistribution files and selected all recorded files are deleted, and create Build the predistribution file that size is pre-recorded video size.
When the sum of all predistribution file sizes and selected recorded file size are equal to prerecording text in the present embodiment Part size illustrates that the size of all predistribution files and selected recorded file is just met for pre-recorded video data, deletes All predistribution files and selected all recorded files, and the predistribution file that size is pre-recorded video size is created, For storing pre-recorded video data.
Further, referring to figure 3., the first embodiment of the file memory method based on automobile data recorder of the present invention proposes 5th embodiment of the file memory method of automobile data recorder of the present invention, in the present embodiment, before step S10, further includes:
Step S101 obtains the default recording duration and default recording resolution ratio of pre-recorded video;
Step S102 calculates pre-recorded video size according to the default recording time and default resolution ratio of recording.
The present embodiment middle rolling car recorder can preset recording time and record resolution ratio, and recording duration may be configured as 1min, 3min, 5min etc., recording resolution ratio may be configured as 720P, 1080P etc..Same resolution ratio difference records duration institute The memory space accounted for is directly proportional to duration is recorded, for example, being set as 1min for duration is recorded, records resolution ratio and is set as 720P, The memory space for recording the video data occupancy of 1min, 720P is up to 60M;Record the video data occupancy of 3min, 720P Memory space is up to 180M;The memory space for recording the video data occupancy of 5min, 720P is up to 300M.When same recording The memory space that long resolution ratio 1080P is occupied is twice of resolution ratio 720P, such as is set as 1min for duration is recorded, and records and divides Resolution is set as 1080P, and the memory space for recording the video data occupancy of 1min, 1080P is up to 120M;Recording 3min, The memory space that the video data of 1080P occupies is up to 360M;Record the memory space that the video data of 5min, 1080P occupy It is up to 600M.Pre-recorded video can be calculated by obtaining the pre-set recording duration of automobile data recorder and recording resolution ratio Size of data, by obtaining pre-recorded video size of data, the video data for that will store finds suitable storage location.
The present invention also proposes a kind of computer readable storage medium, is stored thereon with computer program.The computer can Reading storage medium can be the memory in the terminal of Fig. 1, be also possible to such as ROM (Read-Only Memory, read-only storage Device)/RAM (Random Access Memory, random access memory), magnetic disk, at least one of CD, the computer Readable storage medium storing program for executing includes that some instructions are used so that a terminal device with processor (can be mobile phone, computer, clothes Business device, terminal or the network equipment etc.) execute method described in each embodiment of the present invention.
In the present invention, term " first " " second " " third " " the 4th " " the 5th " is only used for the purpose of description, and cannot It is interpreted as indication or suggestion relative importance, for the ordinary skill in the art, can be understood as the case may be The concrete meaning of above-mentioned term in the present invention.
In the description of this specification, reference term " one embodiment ", " some embodiments ", " example ", " specifically show The description of example " or " some examples " etc. means specific features, structure, material or spy described in conjunction with this embodiment or example Point is included at least one embodiment or example of the invention.In the present specification, schematic expression of the above terms are not It must be directed to identical embodiment or example.Moreover, particular features, structures, materials, or characteristics described can be in office It can be combined in any suitable manner in one or more embodiment or examples.In addition, without conflicting with each other, the skill of this field Art personnel can tie the feature of different embodiments or examples described in this specification and different embodiments or examples It closes and combines.
Although the embodiments of the present invention has been shown and described above, the scope of protection of the invention is not limited thereto, It is understood that above-described embodiment is exemplary, it is not considered as limiting the invention, the ordinary skill people of this field Member can be changed above-described embodiment, modify and replace within the scope of the invention, these variations, modification and replacement are all answered It is included within the scope of the present invention.Therefore, protection scope of the present invention should be subject to the protection scope of claim.

Claims (10)

1. a kind of file memory method of automobile data recorder, which is characterized in that the method includes the steps:
Pre-recorded video size is obtained, and selects a file from local storage, the file size currently selected is made For the first memory capacity;
First memory capacity and pre-recorded video size are subtracted each other, the first saved differences are obtained;
When first saved differences are greater than 0, selected All Files are deleted, and creating size is that first storage is poor The predistribution file and size of value are the predistribution file of pre-recorded video size.
2. the file memory method of automobile data recorder as described in claim 1, which is characterized in that described from local storage A file is selected, includes: using the file size currently selected as the step of the first memory capacity
It determines in local storage with the presence or absence of predistribution file;
If so, selecting a predistribution file from all predistribution files, and the predistribution file size that will currently select As the first memory capacity;
If it is not, then selecting a recorded file from all recorded files, and using the recorded file size currently selected as the One memory capacity.
3. the file memory method of automobile data recorder as claimed in claim 2, which is characterized in that described by the first memory capacity After the step of subtracting each other with pre-recorded video size, obtain the first saved differences, further includes:
When in local storage exist predistribution file and the first saved differences less than 0 when, judge be in all predistribution files It is no that there are non-selected predistribution files;
When in all predistribution files be not present non-selected predistribution file when, according in local storage recorded file and All predistribution files store pre-recorded video;
When in all predistribution files there are when non-selected predistribution file, it is next from the continuous selection of all predistribution file relays A predistribution file, and the predistribution file size of selection is added in first memory capacity to update the first storage and hold Amount, to execute step: the first memory capacity and pre-recorded video size being subtracted each other, the first saved differences are obtained.
4. the file memory method of automobile data recorder as claimed in claim 3, which is characterized in that all predistribution of judgement Before the step of whether there is non-selected predistribution file in file, further includes:
When there is predistribution file and the first saved differences less than 0 in local storage, all predistribution file sizes are judged The sum of whether be greater than or equal to prerecording file size;
If so, thening follow the steps: judging in all predistribution files with the presence or absence of non-selected predistribution file;
If it is not, thening follow the steps: according in local storage recorded file and all predistribution files to pre-recorded video into Row storage.
5. the file memory method of automobile data recorder as described in claim 3 or 4, which is characterized in that described to be deposited according to local The step of recorded file and all predistribution files in reservoir store pre-recorded video include:
A recorded file is selected from all recorded files, and by the recorded file size of selection and the first saved differences phase Add, obtains the second saved differences;
When second saved differences are greater than 0, all predistribution files and selected all recorded files are deleted, and create Build the predistribution file that size is second saved differences and the predistribution file that size is pre-recorded video size.
6. the file memory method of automobile data recorder as claimed in claim 5, which is characterized in that described from all recorded files One recorded file of middle selection, and the recorded file size of selection is added with the first saved differences, obtain the second saved differences The step of after, further includes:
When second saved differences are less than 0, continue to select next recorded file from all recorded files, and by second Saved differences execute when the second saved differences are greater than 0 from the recorded file size for adding selection: deleting all predistribution texts Part and selected all recorded files, and create predistribution file that size is second saved differences and size is The predistribution file of pre-recorded video size.
7. the file memory method of automobile data recorder as claimed in claim 2, which is characterized in that described by the first memory capacity After the step of subtracting each other with pre-recorded video size, obtain the first saved differences, further includes:
When in local storage there is no file and the first saved differences is pre-allocated less than 0, continue from all recorded files Next recorded file is selected, and by the first saved differences from the recorded file size for adding selection, until the first saved differences are big When 0, execute: delete selected All Files, and create size be first saved differences predistribution file and Size is the predistribution file of pre-recorded video size.
8. such as the file memory method of the described in any item automobile data recorders in claim 1-4,6,7, which is characterized in that described to obtain Before the step of taking pre-recorded video size, further includes:
Obtain the default recording duration and default recording resolution ratio of pre-recorded video;
Pre-recorded video size is calculated according to the default recording time and default resolution ratio of recording.
9. a kind of automobile data recorder, which is characterized in that the automobile data recorder includes: memory, processor and is stored in institute The computer program that can be run on memory and on the processor is stated, when the computer program is executed by the processor The step of realizing the file memory method such as the described in any item automobile data recorders of claim 1-8.
10. a kind of readable storage medium storing program for executing, which is characterized in that be stored with computer program, the meter on the readable storage medium storing program for executing The file memory method such as automobile data recorder of any of claims 1-8 is realized when calculation machine program is executed by processor The step of.
CN201910262672.2A 2019-04-02 2019-04-02 File storage method, automobile data recorder and readable storage medium Active CN110008179B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910262672.2A CN110008179B (en) 2019-04-02 2019-04-02 File storage method, automobile data recorder and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910262672.2A CN110008179B (en) 2019-04-02 2019-04-02 File storage method, automobile data recorder and readable storage medium

Publications (2)

Publication Number Publication Date
CN110008179A true CN110008179A (en) 2019-07-12
CN110008179B CN110008179B (en) 2023-06-16

Family

ID=67169856

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910262672.2A Active CN110008179B (en) 2019-04-02 2019-04-02 File storage method, automobile data recorder and readable storage medium

Country Status (1)

Country Link
CN (1) CN110008179B (en)

Citations (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030002864A1 (en) * 2001-06-15 2003-01-02 Stmicroelectronics S.A. Process and device for managing the memory space of a hard disk, in particular for a receiver of satellite digital television signals
CN1504895A (en) * 2000-02-28 2004-06-16 ���չ�˾ File control method
JP2005192096A (en) * 2003-12-26 2005-07-14 Casio Comput Co Ltd Image pickup device, method for recording video file, and program
WO2010108343A1 (en) * 2009-03-21 2010-09-30 中兴通讯股份有限公司 Method and device for recording mobile multimedia broadcast program
CN102096722A (en) * 2011-03-21 2011-06-15 成都市华为赛门铁克科技有限公司 File storage method and device
CN102508784A (en) * 2011-11-02 2012-06-20 杭州海康威视数字技术股份有限公司 Data storage method of flash memory card in video monitoring equipment, and system thereof
WO2013111187A1 (en) * 2012-01-25 2013-08-01 Hitachi, Ltd. Single instantiation method using file clone and file storage system utilizing the same
US20150071599A1 (en) * 2013-09-12 2015-03-12 International Business Machines Corporation Storage space savings via partial digital stream deletion
CN104699815A (en) * 2015-03-24 2015-06-10 北京嘀嘀无限科技发展有限公司 Data processing method and system
CN105677742A (en) * 2015-12-30 2016-06-15 深圳市瑞驰信息技术有限公司 Method and apparatus for storing files
CN105681714A (en) * 2016-02-26 2016-06-15 北京金山安全软件有限公司 Video shooting method and device and electronic equipment
CN106027934A (en) * 2016-07-13 2016-10-12 深圳市爱培科技术股份有限公司 Vehicle driving video storing method and system based on rearview mirror
CN106294603A (en) * 2016-07-29 2017-01-04 北京奇虎科技有限公司 File memory method and device
CN106599292A (en) * 2016-12-26 2017-04-26 东方网力科技股份有限公司 Method and system for storing real-time video data and image data
US20170208052A1 (en) * 2016-01-19 2017-07-20 Hope Bay Technologies, Inc Hybrid cloud file system and cloud based storage system having such file system therein
CN106970812A (en) * 2017-03-31 2017-07-21 广东欧珀移动通信有限公司 upgrade file processing, device and terminal
CN107122133A (en) * 2017-04-24 2017-09-01 珠海全志科技股份有限公司 Date storage method and device
CN107302676A (en) * 2017-07-28 2017-10-27 建荣半导体(深圳)有限公司 A kind of videotape storage means, system, chip, storage device and drive recorder
CN107609014A (en) * 2017-08-02 2018-01-19 深圳市爱培科技术股份有限公司 A kind of drive recorder and its video storage method, storage medium
CN107741828A (en) * 2017-09-19 2018-02-27 维沃移动通信有限公司 A kind of memory space fill method and mobile terminal
CN107861836A (en) * 2016-09-22 2018-03-30 法乐第(北京)网络科技有限公司 Drive recorder data back up method and device
CN107885458A (en) * 2017-09-28 2018-04-06 努比亚技术有限公司 A kind of method for sorting of disk fragmentses, terminal and computer-readable recording medium
CN108073361A (en) * 2017-12-08 2018-05-25 佛山市章扬科技有限公司 A kind of method and device of automatic recording audio and video
CN108668096A (en) * 2018-05-18 2018-10-16 京东方科技集团股份有限公司 Management method, device and the video recording equipment of video data

Patent Citations (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1504895A (en) * 2000-02-28 2004-06-16 ���չ�˾ File control method
US20030002864A1 (en) * 2001-06-15 2003-01-02 Stmicroelectronics S.A. Process and device for managing the memory space of a hard disk, in particular for a receiver of satellite digital television signals
JP2005192096A (en) * 2003-12-26 2005-07-14 Casio Comput Co Ltd Image pickup device, method for recording video file, and program
WO2010108343A1 (en) * 2009-03-21 2010-09-30 中兴通讯股份有限公司 Method and device for recording mobile multimedia broadcast program
CN102096722A (en) * 2011-03-21 2011-06-15 成都市华为赛门铁克科技有限公司 File storage method and device
CN102508784A (en) * 2011-11-02 2012-06-20 杭州海康威视数字技术股份有限公司 Data storage method of flash memory card in video monitoring equipment, and system thereof
WO2013111187A1 (en) * 2012-01-25 2013-08-01 Hitachi, Ltd. Single instantiation method using file clone and file storage system utilizing the same
US20150071599A1 (en) * 2013-09-12 2015-03-12 International Business Machines Corporation Storage space savings via partial digital stream deletion
CN104699815A (en) * 2015-03-24 2015-06-10 北京嘀嘀无限科技发展有限公司 Data processing method and system
CN105677742A (en) * 2015-12-30 2016-06-15 深圳市瑞驰信息技术有限公司 Method and apparatus for storing files
US20170208052A1 (en) * 2016-01-19 2017-07-20 Hope Bay Technologies, Inc Hybrid cloud file system and cloud based storage system having such file system therein
CN105681714A (en) * 2016-02-26 2016-06-15 北京金山安全软件有限公司 Video shooting method and device and electronic equipment
CN106027934A (en) * 2016-07-13 2016-10-12 深圳市爱培科技术股份有限公司 Vehicle driving video storing method and system based on rearview mirror
CN106294603A (en) * 2016-07-29 2017-01-04 北京奇虎科技有限公司 File memory method and device
CN107861836A (en) * 2016-09-22 2018-03-30 法乐第(北京)网络科技有限公司 Drive recorder data back up method and device
CN106599292A (en) * 2016-12-26 2017-04-26 东方网力科技股份有限公司 Method and system for storing real-time video data and image data
CN106970812A (en) * 2017-03-31 2017-07-21 广东欧珀移动通信有限公司 upgrade file processing, device and terminal
CN107122133A (en) * 2017-04-24 2017-09-01 珠海全志科技股份有限公司 Date storage method and device
CN107302676A (en) * 2017-07-28 2017-10-27 建荣半导体(深圳)有限公司 A kind of videotape storage means, system, chip, storage device and drive recorder
CN107609014A (en) * 2017-08-02 2018-01-19 深圳市爱培科技术股份有限公司 A kind of drive recorder and its video storage method, storage medium
CN107741828A (en) * 2017-09-19 2018-02-27 维沃移动通信有限公司 A kind of memory space fill method and mobile terminal
CN107885458A (en) * 2017-09-28 2018-04-06 努比亚技术有限公司 A kind of method for sorting of disk fragmentses, terminal and computer-readable recording medium
CN108073361A (en) * 2017-12-08 2018-05-25 佛山市章扬科技有限公司 A kind of method and device of automatic recording audio and video
CN108668096A (en) * 2018-05-18 2018-10-16 京东方科技集团股份有限公司 Management method, device and the video recording equipment of video data

Also Published As

Publication number Publication date
CN110008179B (en) 2023-06-16

Similar Documents

Publication Publication Date Title
CN110554834B (en) File system data access method and file system
CN106776368A (en) Buffer memory management method, apparatus and system during a kind of digital independent
CN111797172B (en) Data migration method, device, equipment, distributed system and storage medium
CN108924582A (en) Video recording method, computer readable storage medium and recording and broadcasting system
CN109542578A (en) A kind of display methods of list interface, device, equipment and storage medium
CN102917249A (en) IPTV reservation system and reservation plan adding method based on same
CN108268211A (en) A kind of data processing method and device
CN105912698A (en) Deletion method and system of data file in disk
US20180343486A1 (en) Program Recording Method and Device, and Set Top Box
JPH1155645A (en) Multimedia distribution operation management system
CN110704450A (en) Method and device for realizing data processing, computer storage medium and terminal
JP2007293619A (en) Server device, information sharing system, program, and recording medium
CN113885798A (en) Data operation method, device, equipment and medium
CN110008179A (en) File memory method, automobile data recorder and readable storage medium storing program for executing
Polimenis The design of a file system that supports multimedia
CN109298977A (en) A kind of virtual machine business quick recovery method, system, device and storage medium
CN116663042A (en) Access control method, device, equipment and storage medium of multi-user-level directory
CN102137122B (en) Method and device for downloading data
CN106527891B (en) A kind of edit object selection method and relevant apparatus
JP2005293561A (en) Information processing system, information processing apparatus and management server, information processing system control program, information processing apparatus control program and management server control program, information processing method, information processing system control method, and information processing apparatus control method and management server control method
CN100422957C (en) Data transmission/reception system, data transmission/reception method, and recording/reproduction device
CN106802812A (en) A kind of method of load document, device and electronic equipment
Wirag Modeling of adaptable multimedia documents
CN116127932A (en) Business report generation method, equipment and medium
EP1213652B1 (en) Disk medium managing method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant