Summary of the invention
The technical problem to be solved in the present invention is, for the drawbacks described above of prior art, it is provided that a kind of whole based on intelligence
The file format of end and data power down restorative procedure and system, it is intended to improve falling of existing file form and data by the present invention
Electricity reparation pattern, reduces the loss of data that power down produces, and improves data remediation efficiency, provides the user conveniently.
It is as follows that the present invention solves the technical scheme that technical problem used:
A kind of file format based on intelligent terminal and data power down restorative procedure, wherein, comprise the steps:
S1, the system generation power loss event of intelligent terminal detected;
Whether S2, inspection data backup district, decision-making system occur that file format is damaged, the most then according to the file prestored
The attribute of a configuration and file configuration information to be repaired carry out corresponding file format reparation and operate and preserve;
Whether S3, further decision-making system occur that file data damages, the most then carry out accordingly according to the file journalization of pre-stored
Data reparation operate and preserve.
Described file format based on intelligent terminal and data power down restorative procedure, wherein, described file format properties
Including: the multimedia file of TS form, the multimedia file of AVI format, the multimedia file of mp4 form, wheelpath/ODB
Data.
Described file format based on intelligent terminal and data power down restorative procedure, wherein, described step S2 is specifically wrapped
Include step:
If S21 detects the multimedia file that file format properties is TS/AVI form of current damage, then read multimedia literary composition
Configuration parameter when part is recorded carries out corresponding file format reparation and operates and preserve;
If S22 detects the multimedia file that file format properties is mp4 form of current damage, then read multimedia file
Configuration parameter and default Fixed Time Interval during recording carry out corresponding file format reparation and preserve;
If the file format properties that S23 detects current damage is wheelpath data/ODB data, then according to the number of pre-stored
Carry out corresponding file format reparation according to safety index and preserve.
Described file format based on intelligent terminal and data power down restorative procedure, wherein, described step S3 is specifically wrapped
Include:
If S31 detects that system occurs that file data damages, then read the disk write before the file journalization backtracking power down of pre-stored
Enter operation;
S32, carry out corresponding data reparation according to described backtracking result and operate and preserve.
Described file format based on intelligent terminal and data power down restorative procedure, wherein, described step S3 also includes
Following steps:
If S33 detects the system generation power loss event of intelligent terminal, then in Preset Time, close the screen of described intelligent terminal
Curtain, utilizes the remaining capacity in described intelligent terminal's electric capacity to complete the current write operation to disk.
A kind of file format based on intelligent terminal and data power down repair system, wherein, including:
Detection of power loss module, for detecting the system generation power loss event of intelligent terminal;
File format reparation preserves module, is used for checking whether data backup district, decision-making system occur that file format is damaged, if
It is then to carry out corresponding file format reparation behaviour according to the file format properties prestored and file configuration information to be repaired
Make and preserve;
File data reparation preserves module, whether occurs that file data damages for further decision-making system, the most then according to pre-
The file journalization of storage carries out corresponding data reparation and operates and preserve.
Described file format based on intelligent terminal and data power down repair system, wherein, described file format properties
Including: the multimedia file of TS form, the multimedia file of AVI format, the multimedia file of mp4 form, wheelpath/ODB
Data.
Described file format based on intelligent terminal and data power down repair system, wherein, described file format reparation
Preservation module specifically includes:
First format recovery unit, if for the multimedia that file format properties the is TS/AVI form literary composition current damage being detected
Part, then configuration parameter when reading multimedia document recording carries out corresponding file format reparation and operates and preserve;
Second format recovery unit, if for the multimedia file that file format properties is mp4 form current damage being detected,
Then read multimedia document recording time configuration parameter and default Fixed Time Interval carry out corresponding file format reparation,
And preserve;
3rd format recovery unit, if being wheelpath data/ODB number for the file format properties of current damage being detected
According to, then carry out corresponding file format reparation according to the data safety index of pre-stored and preserve.
Described file format based on intelligent terminal and data power down repair system, wherein, described file data reparation
Preservation module specifically includes:
File journalization trace unit, if for detecting that system occurs that file data damages, then reading the file journalization of pre-stored
Disk write operation before backtracking power down;
Data repair unit, operate for carrying out corresponding data reparation according to described backtracking result and preserve.
Described file format based on intelligent terminal and data power down repair system, wherein, described file data reparation
Preserve module also to include:
Add HI-C cell, if for system generation power loss event intelligent terminal being detected, then in Preset Time, close institute
State the screen of intelligent terminal, utilize the remaining capacity in described intelligent terminal's electric capacity to complete the current write operation to disk.
A kind of file format based on intelligent terminal provided by the present invention and data power down restorative procedure and system, described
Method specifically includes: the system generation power loss event of intelligent terminal detected;Check whether data backup district, decision-making system occur
File format is damaged, the most then file format properties and file configuration information to be repaired according to prestoring are carried out accordingly
File format reparation operates and preserves;Whether decision-making system occurs that file data damages, the most then according to pre-stored further
File journalization carry out corresponding data reparation and operate and preserve.The present invention is directed to the reparation of file format and lose data
Recovering the improvement that two parts are carried out, wherein repairing of file format rebuilds file by back up before according to relevant configuration information
Header and index information;The reparation losing data shows as the amendment for file system and disk drive.The present invention avoids
The clear operation of system repair originally, decreases loss of data when accident occurs, improves data remediation efficiency,
Provide users with the convenient.
Detailed description of the invention
The invention discloses a kind of file format based on intelligent terminal and data power down restorative procedure and system, for making this
Purpose, technical scheme and the advantage of invention are clearer, clear and definite, and the embodiment that develops simultaneously referring to the drawings is the most detailed to the present invention
Describe in detail bright.Should be appreciated that specific embodiment described herein, only in order to explain the present invention, is not intended to limit the present invention.
Refer to the preferable reality that Fig. 1, Fig. 1 are present invention file format based on intelligent terminal and data power down restorative procedure
Execute the flow chart of example.File format based on intelligent terminal shown in Fig. 1 and data power down restorative procedure, including:
Step S101, the system generation power loss event of intelligent terminal detected.
Intelligent terminal in Application Example of the present invention includes that car is networked, intelligent vehicle machine, rearview mirror, smart mobile phone, individual soldier
Law enforcement equipment etc..When described intelligent terminal occurs unexpected power loss event, often file format and data to storage are produced
Raw damage.As, for multimedia file, the recorded file damage that unexpected power down causes is primarily referred to as File header information not to be had
Preserve, so that File header information is repaired.
Whether step S102, inspection data backup district, decision-making system occur that file format is damaged, the most then according in advance
File format properties and the file configuration information to be repaired of storage carry out corresponding file format reparation and operate and preserve.
In embodiments of the present invention, described step S102 specifically includes step:
If S21 detects the multimedia file that file format properties is TS/AVI form of current damage, then read multimedia literary composition
Configuration parameter when part is recorded carries out corresponding file format reparation and operates and preserve;
If S22 detects the multimedia file that file format properties is mp4 form of current damage, then read multimedia file
Configuration parameter and default Fixed Time Interval during recording carry out corresponding file format reparation and preserve;
If the file format properties that S23 detects current damage is wheelpath data/ODB data, then according to the number of pre-stored
Carry out corresponding file format reparation according to safety index and preserve.
That is, the file reparation of the embodiment of the present invention comprises two parts: the reparation of file format and lose recovering of data.
Wherein repairing of file format rebuilds File header information and index information by back up before according to relevant configuration information;Lose
The reparation of data shows as the amendment for file system and disk drive.File format reparation ensures can reduce after accident
Scene, but only do file format reparation, often there is the loss of long period in data at this moment, such as primary at Android
Under scene, after the 1080P video of recording does format recovery, loss of data is even up to tens seconds, for actual accident scene
Reduction can not play critically important effect, and therefore the embodiment of the present invention is optimized improvement for file format reparation.Change
Enter principle as follows:
Reparation for file format is mainly realized by critical data backup, and the selection of critical data is according to currently used scene
Determine.For some simple data orga-nizational format such as wheelpaths, ODB data etc. are not required to, it is only necessary to carry out next
The Information Security operation that part relates to, it is possible to meet requirement;But for the multimedia file that drive recorder is recorded
The most entirely different, for different encapsulation format, critical data required during reconstruction is the most not quite identical, such as TS/AVI form
Have only to configuration parameter when recording all right, and for mp4 form, in addition to configuration parameter, in addition it is also necessary to according to fixing
Time interval carrys out archive index data, otherwise will recalculate when repairing, and not only operate cumbersome, it is also possible to cause
Reconstruction failure.Therefore, the embodiment of the present invention is after system power failure occurs, according to feature and the backup number of needs of file format
According to recovering missing documents information, complete the reparation operation of file.
On the other hand, for needing the operation scenario of frequent backup critical data, it is likely that just exist when power down occurs
Carry out the renewal of Backup Data, so may result in the damage of Backup Data.In order to avoid Backup Data damages the file caused
Repairing failure, the embodiment of the present invention needs to safeguard two parts of Backup Datas, in order to wherein one damaged after can also repair literary composition
Part.
Whether step S103, further decision-making system occur that file data damages, the most then according to the file day of pre-stored
Will carries out corresponding data reparation and operates and preserve.
In the embodiment of the present invention, described step 103 specifically includes step:
If S31 detects that system occurs that file data damages, then read the disk write before the file journalization backtracking power down of pre-stored
Enter operation;
S32, carry out corresponding data reparation according to described backtracking result and operate and preserve;
If S33 detects the system generation power loss event of intelligent terminal, then in Preset Time, close the screen of described intelligent terminal
Curtain, utilizes the remaining capacity in described intelligent terminal's electric capacity to complete the current write operation to disk.
During file read-write, in order to improve efficiency and extend the service life of disk, subtract the most as far as possible
Few disk write operation, at this moment has mass data not have real write disk, and is kept on internal memory, interior during unexpected power down
Deposit data is lost, it is therefore necessary to periodically the data brush in internal memory is entered disk, the data lost during to reduce unexpected power down.
File system is as an important component part of operating system, and kind is the abundantest.Intelligent terminal's pre-stored
Journal File System can occur surprisingly by record complete for the write activity of whole disk on certain region of disk
By the disk write operation before back jump tracking power down after power down, it is possible to preferably recover file to be preserved during power down, reach
Repair the purpose of file data.
Further, the embodiment of the present invention is additionally provided in after system detects power down, by closing rapidly screen, shooting
The module that the power consumption such as module, communication module group is relatively more, then utilizes the remaining capacity in electric capacity to complete the write operation to disk, this
Sample can reduce the read-write frequency to disk, extends the disk read-write life-span.
Drive recorder or Enforcement Monitoring Facility need continual to carry out video record operation, and these equipment are in order to more preferably
Versatility have employed and the compatible preferably FAT file system of PC, the form of record is also general MP4, these
Configuration is the most overboard when system accident power-off, and sharp impacts etc. occurs, and data are recovered can be extremely difficult, and a simple improvement is led to
Cross the size being to reduce disk write cache to reduce the data of loss, but thus need disk write operation frequently, significantly
Reducing the service life of disk, more satisfactory cache size is consistent with the page size of disk, excellent by the configuration on software
Change the data only losing current cache page when ensure that power down.But it is so far from being enough, especially believes at written document head
Power down during breath, for video file, does not has File header information to play, and the header of some form such as MP4
Being difficult to recover, be equivalent to lost the total data in a video record cycle, the critical data before accident cannot be given for change, seriously
Affect analysis and the process of accident.This patent operates the data write backup area by before power down, in system by a series of control
Detect when power down occurs, utilize system residual electricity to be saved on disk by Backup Data, just can be complete after powering on next time
The whole record data before recovery accident, help to analyze cause of accident.
Based on above-described embodiment, the present invention also provides for a kind of file format based on intelligent terminal and data power down reparation system
System, as in figure 2 it is shown, include:
Detection of power loss module 100, for detecting the system generation power loss event of intelligent terminal;As detailed above.
File format reparation preserves module 200, is used for checking whether data backup district, decision-making system occur that file format is damaged
Bad, the most then file format properties and file configuration information to be repaired according to prestoring carry out corresponding file format and repair
Multiple operation also preserves;As detailed above.
File data reparation preserves module 300, whether occurs that file data damages, if so, for further decision-making system
Then carry out corresponding data reparation according to the file journalization of pre-stored to operate and preserve;As detailed above.
Further, described file format properties includes: the multimedia file of TS form, the multimedia file of AVI format,
Wheelpath/ODB data.
Further, described file format reparation preservation module 200 specifically includes:
First format recovery unit, if for the multimedia that file format properties the is TS/AVI form literary composition current damage being detected
Part, then configuration parameter when reading multimedia document recording carries out corresponding file format reparation and operates and preserve;The most as above
Described.
Second format recovery unit, if for the multimedia that file format properties is mp4 form current damage being detected
File, then configuration parameter and default Fixed Time Interval when reading multimedia document recording carry out corresponding file format
Repair and preserve;As detailed above.
3rd format recovery unit, if being wheelpath data/ODB for the file format properties of current damage being detected
Data, then carry out corresponding file format reparation according to the data safety index of pre-stored and preserve;As detailed above.
Further, described file data reparation preservation module 300 specifically includes:
File journalization trace unit, if for detecting that system occurs that file data damages, then reading the file journalization of pre-stored
Disk write operation before backtracking power down;As detailed above.
Data repair unit, operate for carrying out corresponding data reparation according to described backtracking result and preserve;The most such as
Upper described.
Add HI-C cell, if for system generation power loss event intelligent terminal being detected, then close in Preset Time
Close the screen of described intelligent terminal, utilize the remaining capacity in described intelligent terminal's electric capacity to complete the current write operation to disk;
As detailed above.
In sum, a kind of file format based on intelligent terminal provided by the present invention and data power down restorative procedure and
System, described method specifically includes: the system generation power loss event of intelligent terminal detected;Check data backup district, judge system
Whether system occurs that file format is damaged, the most then according to the file format properties prestored and file configuration information to be repaired
Carry out corresponding file format reparation to operate and preserve;Whether decision-making system occurs that file data damages, the most further
File journalization according to pre-stored carries out corresponding data reparation and operates and preserve.The present invention is directed to file format reparation and
Losing the improvement that two parts are carried out of recovering of data, wherein repairing of file format is believed according to relevant configuration by back up before
Breath rebuilds File header information and index information;The reparation losing data shows as the amendment for file system and disk drive.
Present invention, avoiding the clear operation of system repair originally, decrease loss of data when accident occurs, improve number
According to remediation efficiency, provide users with the convenient.
It should be appreciated that the application of the present invention is not limited to above-mentioned citing, for those of ordinary skills, can
To be improved according to the above description or to convert, all these modifications and variations all should belong to the guarantor of claims of the present invention
Protect scope.