Summary of the invention
The technical problem to be solved in the present invention is that in view of the above drawbacks of the prior art, providing a kind of whole based on intelligence
The file format and data power down restorative procedure and system at end, it is intended to improve falling for existing file format and data through the invention
Electric reparation mode reduces the loss of data that power down generates, and improves data remediation efficiency, provides conveniently for user.
The technical proposal for solving the technical problem of the invention is as follows:
A kind of file format and data power down restorative procedure based on intelligent terminal, wherein include the following steps:
Power loss event occurs for S1, the system for detecting intelligent terminal;
S2, check whether data backup area, decision-making system file format damage occur, if so, according to the pre-stored data
File format properties and file configuration information to be repaired carry out corresponding file format reparation and operate and save;
S3, further determine whether system file data damage occurs, if so, carrying out according to pre-stored file journalization
Corresponding data reparation is operated and is saved.
The file format and data power down restorative procedure based on intelligent terminal, wherein the file format properties
It include: the multimedia file of TS format, the multimedia file of AVI format, the multimedia file of mp4 format, wheelpath/ODB
Data.
The file format and data power down restorative procedure based on intelligent terminal, wherein the step S2 is specifically wrapped
Include step:
If S21, detecting that the file format properties currently damaged are the multimedia file of TS/AVI format, more matchmakers are read
Configuration parameter when body document recording carries out corresponding file format reparation and operates and save;
If S22, detecting that the file format properties currently damaged are the multimedia file of mp4 format, multimedia is read
Configuration parameter and preset Fixed Time Interval when document recording carry out corresponding file format reparation and save;
If S23, detecting that the file format properties currently damaged are wheelpath data/ODB data, according to pre-stored
Data safety index carry out corresponding file format reparation and save.
The file format and data power down restorative procedure based on intelligent terminal, wherein the step S3 is specifically wrapped
It includes:
Magnetic if file data damage occur in S31, the system of detecting, before reading pre-stored file journalization backtracking power down
Disk write operation;
S32, it operates and saves according to the corresponding data reparation of backtracking result progress.
The file format and data power down restorative procedure based on intelligent terminal, wherein the step S3 further includes
Following steps:
If power loss event occurs for S33, the system for detecting intelligent terminal, the intelligent terminal is closed within a preset time
Screen, completed using the remaining capacity in the intelligent terminal capacitor to the current write operation of disk.
A kind of file format and data power down repair system based on intelligent terminal, wherein include:
Power loss event occurs for detection of power loss module, the system for detecting intelligent terminal;
File format repairs preserving module, for checking whether data backup area, decision-making system file format damage occur,
If so, file format properties according to the pre-stored data and file configuration information to be repaired carry out corresponding file format reparation behaviour
Make and saves;
File data repairs preserving module, for further determining whether system file data damage occurs, if so, root
It operates and saves according to the pre-stored corresponding data reparation of file journalization progress.
The file format and data power down repair system based on intelligent terminal, wherein the file format properties
It include: the multimedia file of TS format, the multimedia file of AVI format, the multimedia file of mp4 format, wheelpath/ODB
Data.
The file format and data power down repair system based on intelligent terminal, wherein the file format reparation
Preserving module specifically includes:
First format recovery unit, if for detecting that the file format properties currently damaged are more matchmakers of TS/AVI format
Body file, then configuration parameter when reading multimedia document recording carry out corresponding file format reparation and operate and save;
Second format recovery unit, if for detecting that the file format properties currently damaged are the multimedia of mp4 format
File, then configuration parameter and preset Fixed Time Interval when reading multimedia document recording carry out corresponding file format
It repairs and saves;
Third format recovery unit, if for detecting that the file format properties currently damaged are wheelpath data/ODB
Data then carry out corresponding file format reparation according to pre-stored data safety index and save.
The file format and data power down repair system based on intelligent terminal, wherein the file data reparation
Preserving module specifically includes:
File journalization trace unit, if reading pre-stored file for detecting that file data damage occurs in system
The disk write operation before power down is recalled in log;
Data repair unit, for operating and saving according to the corresponding data reparation of backtracking result progress.
The file format and data power down repair system based on intelligent terminal, wherein the file data reparation
Preserving module further include:
Capacitor cell is increased, if power loss event occurs for the system for detecting intelligent terminal, is closed within a preset time
The screen for closing the intelligent terminal completes the current write operation to disk using the remaining capacity in the intelligent terminal capacitor.
A kind of file format and data power down restorative procedure and system based on intelligent terminal provided by the present invention, it is described
Method specifically includes: power loss event occurs for the system for detecting intelligent terminal;Check whether data backup area, decision-making system occur
File format damage, if so, file format properties according to the pre-stored data and file configuration information to be repaired carry out accordingly
File format reparation is operated and is saved;Further determine whether system file data damage occurs, if so, according to pre-stored
File journalization carry out corresponding data reparation and operate and save.The present invention is directed to the reparation of file format and loses data
The improvement of two parts progress is recovered, what wherein the reparation of file format was backed up before rebuilds file according to relevant configuration information
Head information and index information;The reparation for losing data shows as the modification for file system and disk drive.The present invention avoids
The clear operation of the system repair of script reduces loss of data when accident occurs, improves data remediation efficiency,
It provides users with the convenient.
Specific embodiment
The invention discloses a kind of file format based on intelligent terminal and data power down restorative procedure and systems, to make this
The objects, technical solutions and advantages of invention are clearer, clear, as follows in conjunction with drawings and embodiments to of the invention further detailed
It describes in detail bright.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.
Referring to Figure 1, Fig. 1 is the preferable reality the present invention is based on the file format of intelligent terminal and data power down restorative procedure
Apply the flow chart of example.File format and data power down restorative procedure shown in FIG. 1 based on intelligent terminal, comprising:
Step S101, power loss event occurs for the system for detecting intelligent terminal.
Intelligent terminal in Application Example of the present invention includes car networking, intelligent vehicle device, rearview mirror, smart phone, individual soldier
Equipment of enforcing the law etc..When unexpected power loss event occurs for the intelligent terminal, often the file format of storage and data are produced
Raw damage.Such as, for multimedia file, the damage of recorded file caused by unexpected power down, which is primarily referred to as File header information, not to be had
It saves, thus needs to repair File header information.
Step S102, check whether data backup area, decision-making system file format damage occur, if so, according to preparatory
The file format properties of storage and file configuration information to be repaired carry out corresponding file format reparation and operate and save.
In embodiments of the present invention, the step S102 specifically includes step:
If S21, detecting that the file format properties currently damaged are the multimedia file of TS/AVI format, more matchmakers are read
Configuration parameter when body document recording carries out corresponding file format reparation and operates and save;
If S22, detecting that the file format properties currently damaged are the multimedia file of mp4 format, multimedia is read
Configuration parameter and preset Fixed Time Interval when document recording carry out corresponding file format reparation and save;
If S23, detecting that the file format properties currently damaged are wheelpath data/ODB data, according to pre-stored
Data safety index carry out corresponding file format reparation and save.
That is, the file reparation of the embodiment of the present invention includes two parts: the reparation of file format and recovering for loss data.
What wherein the reparation of file format was backed up before rebuilds File header information and index information according to relevant configuration information;It loses
The reparation of data shows as the modification for file system and disk drive.File format reparation guarantees to restore after accident
Scene, but file format reparation is only done, often there is the loss of long period in data at this moment, such as in the primary of Android
Under scene, after the 1080P video of recording does format recovery, loss of data is even up to more than ten seconds, for actual accident scene
Reduction can not play critically important effect, therefore improvement is optimized for file format reparation in the embodiment of the present invention.Change
It is as follows into principle:
The reparation of file format is mainly backed up by critical data and is realized, the selection of critical data is according to currently used
Scene determines.For some simple data orga-nizational format such as wheelpaths, ODB data etc. are not needed, it is only necessary to be carried out
The Information Security operation that next part is related to, so that it may meet the requirements;But for the multimedia file that automobile data recorder is recorded
For it is then entirely different, for different encapsulation format, required critical data is also not quite identical when reconstruction, such as TS/AVI
Configuration parameter when format only needs to record is all right, and for mp4 format, other than configuration parameter, it is also necessary to according to
Fixed Time Interval carrys out archive index data, otherwise will recalculate, and not only operate cumbersome when repairing, it is also possible to
Lead to reconstruction failure.Therefore, the embodiment of the present invention be system is powered down occur after, according to the standby of the feature of file format and needs
Part data restore missing documents information, complete the reparation operation of file.
On the other hand, the operation scenario of backup critical data frequent for needs, it is likely that just exist when power down occurs
The update for carrying out Backup Data, will lead to the damage of Backup Data in this way.File caused by being damaged in order to avoid Backup Data
Repairing failure, the embodiment of the present invention need to safeguard two parts of Backup Datas, so as to wherein one be damaged after can also repair text
Part.
Step S103, further determine whether system file data damage occurs, if so, according to pre-stored file day
Will carries out corresponding data reparation and operates and save.
In the embodiment of the present invention, the step 103 specifically includes step:
Magnetic if file data damage occur in S31, the system of detecting, before reading pre-stored file journalization backtracking power down
Disk write operation;
S32, it operates and saves according to the corresponding data reparation of backtracking result progress;
If power loss event occurs for S33, the system for detecting intelligent terminal, the intelligent terminal is closed within a preset time
Screen, completed using the remaining capacity in the intelligent terminal capacitor to the current write operation of disk.
During file read-write, in order to improve efficiency and extend the service life of disk, often subtract as far as possible
Few disk write operation, at this moment having mass data, there is no really write-in disks, and are kept on memory, and when unexpected power down is interior
Deposit data is lost, it is therefore necessary to the data brush in memory periodically be entered disk, the data lost when reducing unexpected power down.
An important component of the file system as operating system, type very abundant.What intelligent terminal was pre-stored
The write activity of entire disk can be completely recorded on some region of disk by Journal File System, and accident is occurring
By the disk write operation before back jump tracking power down after power down, it can preferably restore the file to be saved when power down, reach
Repair the purpose of file data.
Further, the embodiment of the present invention also provides after system detection to power down, by closing screen, camera shooting rapidly
Then the more module of the power consumptions such as mould group, communication module group completes the write operation to disk using the remaining capacity in capacitor, this
Sample can reduce the read-write frequency to disk, extend the disk read-write service life.
Automobile data recorder or Enforcement Monitoring Facility need continual progress video record operation, these equipment are in order to more preferable
Versatility use with the better FAT file system of PC compatibility, the format of record is also general MP4, these
Configuration is such as overboard when system accident power-off, and generation sharp impacts etc., data are restored can be extremely difficult, and simple improves is led to
Crossing is to reduce the size of disk write cache to reduce the data of loss, but thus need more frequent disk write operation, significantly
The service life of disk is reduced, more satisfactory cache size is consistent with the page size of disk, excellent by the configuration on software
Change the data that can guarantee only to lose current cache page when power down.But be in this way it is far from being enough, especially written document head believe
Power down when breath, for video file, no File header information can not be played, and the head information of certain formats such as MP4
It is difficult to restore, is equivalent to the total data for being lost a video record period, the critical data before accident can not be given for change, seriously
The analysis and processing of influence accident.By a series of control operations backup area is written in data before power down by this patent, in system
When detecting that power down occurs, Backup Data is stored on disk using system residual electricity, it can be complete after powering on next time
Cause of accident is analyzed in record data before whole recovery accident, help.
Based on the above embodiment, the present invention also provides a kind of file format based on intelligent terminal and data power down reparation systems
System, as shown in Figure 2, comprising:
Power loss event occurs for detection of power loss module 100, the system for detecting intelligent terminal;As detailed above.
File format repairs preserving module 200, for checking whether data backup area, decision-making system file format damage occur
It is bad, it is repaired if so, file format properties according to the pre-stored data and file configuration information to be repaired carry out corresponding file format
It is multiple to operate and save;As detailed above.
File data repairs preserving module 300, for further determining whether system file data damage occurs, if so,
Then corresponding data reparation is carried out according to pre-stored file journalization to operate and save;As detailed above.
Further, the file format properties include: the multimedia file of TS format, AVI format multimedia file,
Wheelpath/ODB data.
Further, the file format is repaired preserving module 200 and is specifically included:
First format recovery unit, if for detecting that the file format properties currently damaged are more matchmakers of TS/AVI format
Body file, then configuration parameter when reading multimedia document recording carry out corresponding file format reparation and operate and save;Specifically
As described above.
Second format recovery unit, if for detecting that the file format properties currently damaged are the multimedia of mp4 format
File, then configuration parameter and preset Fixed Time Interval when reading multimedia document recording carry out corresponding file format
It repairs and saves;As detailed above.
Third format recovery unit, if for detecting that the file format properties currently damaged are wheelpath data/ODB
Data then carry out corresponding file format reparation according to pre-stored data safety index and save;As detailed above.
Further, the file data is repaired preserving module 300 and is specifically included:
File journalization trace unit, if reading pre-stored file for detecting that file data damage occurs in system
The disk write operation before power down is recalled in log;As detailed above.
Data repair unit, for operating and saving according to the corresponding data reparation of backtracking result progress;Specifically such as
It is upper described.
Capacitor cell is increased, if power loss event occurs for the system for detecting intelligent terminal, is closed within a preset time
The screen for closing the intelligent terminal completes the current write operation to disk using the remaining capacity in the intelligent terminal capacitor;
As detailed above.
In conclusion a kind of file format and data power down restorative procedure based on intelligent terminal provided by the present invention and
System, the method specifically include: power loss event occurs for the system for detecting intelligent terminal;It checks data backup area, determine system
Whether system there is file format damage, if so, file format properties according to the pre-stored data and file configuration information to be repaired
Corresponding file format reparation is carried out to operate and save;Further determine whether system file data damage occurs, if so,
It operates and saves according to the pre-stored corresponding data reparation of file journalization progress.The present invention for file format reparation and
The improvement for recovering two parts progress of data is lost, what wherein the reparation of file format was backed up before believes according to relevant configuration
Breath rebuilds File header information and index information;The reparation for losing data shows as the modification for file system and disk drive.
The invention avoids the clear operations of the system repair of script, reduce loss of data when accident occurs, improve number
According to remediation efficiency, provide users with the convenient.
It should be understood that the application of the present invention is not limited to the above for those of ordinary skills can
With improvement or transformation based on the above description, all these modifications and variations all should belong to the guarantor of appended claims of the present invention
Protect range.