CN101706783A - Method and device for checking and repairing files in embedded equipment - Google Patents

Method and device for checking and repairing files in embedded equipment Download PDF

Info

Publication number
CN101706783A
CN101706783A CN200910109629A CN200910109629A CN101706783A CN 101706783 A CN101706783 A CN 101706783A CN 200910109629 A CN200910109629 A CN 200910109629A CN 200910109629 A CN200910109629 A CN 200910109629A CN 101706783 A CN101706783 A CN 101706783A
Authority
CN
China
Prior art keywords
file
information
files
equipment
current operation
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.)
Pending
Application number
CN200910109629A
Other languages
Chinese (zh)
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.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN200910109629A priority Critical patent/CN101706783A/en
Publication of CN101706783A publication Critical patent/CN101706783A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention discloses a method and a device for checking and repairing files in embedded equipment. Basic information of a current operated file is stored in a log of the equipment or a partion of a transactional function file system; if the data in the current operated file is modified, the recorded information is about to be updated; and when the files are checked and repaired, a system does not need scanning all data information of the file system, and files which are abnormally closed finally and possibly go wrong in the last running are detected, so the detection is greatly quickened. Meanwhile, the normal starting of the file system can be ensured. The method and the device are particularly suitable for the embedded equipment in which the system independently runs in a low-capacity recordable storage device, a high-capacity external storage medium is used to record more and larger files, and the files are not modified frequently.

Description

A kind of files in embedded equipment detects restorative procedure and device
Technical field
The present invention relates to the file system technology in the embedded device, relate in particular to a kind of detection recovery technique of makeing mistakes of non-Journaling File System.
Background technology
In some embedded device, need to use exterior storage medium (hard disk or flash memory) to carry out the access of data.Generally different according to actual needs, can select different types of file system to carry out the management of storage medium data.Very important when the data of needs storage, must guarantee correctness, in the time of reliability and restorability, can select the file system that has daily record or transaction functionality for use, such as XFS, file system such as EXT3, ReiserFS and JFS; When the importance of data is not so high, low volume data losing systematic influence little time the once in a while such as the storage of media file, can be selected the file system of FAT32 or other better performances, and these systems can not have the daily record transaction functionality.For example: in the terminal device of global eyes, the video recording that camera is recorded generally is stored in the hard disk, video file is generally bigger, if the video file video data has the damage of one or two frame, as long as video can also normal play, concerning the supervisory function bit of equipment, can not produce considerable influence, so just there is no need the extra performance of usage log file system consumption.Use the such file system of FAT32, if when equipment when memory device writes data, the unexpected power down of system data in the system cache just might occur and in time not flush in the storage medium and go, thereby cause partial data to be lost.If what damage is the file system critical data, such as Archive sit information, blocks of files bunch recorded information etc. just can not normally be discerned this document system when system restarts, and cause whole storage medium normally not read.This situation just must be considered the reparation that detects to file system data.The reparation of generic-document system all is to adopt the scan full hard disk filesystem information in the prior art, the way of makeing mistakes and revising, bigger at the storage medium capacity, under the processing power condition of limited of the more or equipment of storage file itself, just need probably to consume a large amount of time, sometimes be insupportable, detect and repair, can bring the user relatively poor experience such as carrying out file system when the device start.
Summary of the invention
The technical matters that the present invention mainly solves is, provides a kind of files in embedded equipment fast and effectively to detect restorative procedure and device, reduces the detection repair time of files in embedded equipment system, and user experience preferably is provided.
For solving the problems of the technologies described above, the invention provides a kind of files in embedded equipment and detect restorative procedure, comprise following processing procedure:
When in the equipment operation file data being operated, the essential information of current operation file is stored in the daily record or transaction functionality file partition of equipment;
When the data in the current operation file are made amendment, upgrade the information of the current operation file of above-mentioned storage;
Utilize the information of the operation file of above-mentioned storage to carry out the detection and the reparation of file data.
Further, also comprise to the file data detection with after repairing: the relevant information that will repair file reports.
Further, in the information processing of the current operation file of described renewal, also comprise following processing procedure:, then empty the information of the current operation file of storage if current operation file is normally closed.
Preferably, the daily record of described equipment or transaction functionality file partition are arranged in the erasable equipment of low capacity of equipment, and described operation file data are arranged in the high capacity exterior storage medium.
The present invention also provides a kind of files in embedded equipment to detect prosthetic device, comprising:
The operation file information memory cell is arranged in the daily record or transaction functionality file partition of equipment, is used for when equipment operation is operated file data, and storage is with the essential information of current operation file;
The operation file information updating unit is used for upgrading the information of the current operation file of storing in the described operation file information memory cell when the data of current operation file are made amendment;
Detect and the reparation unit, the information that is used for utilizing described operation file information memory cell to write down is carried out file data detection and reparation.
Further, comprise that also information reports the unit, be used to report the relevant information of repairing file.
Further, comprise that also information empties processing unit, be used for when current operation file is normally closed, emptying the information of the current operation file of storing in the described operation file information memory cell.
Preferably, the daily record of described equipment or transaction functionality file partition are arranged in the erasable memory device of low capacity of equipment, and described operation file data are arranged in the high capacity exterior storage medium.
The invention has the beneficial effects as follows: system does not need all data messages of scanning document system, only need be in service to last time, normally do not close the file that may make mistakes at last, and detect, accelerated detection time greatly.Simultaneously, also can guarantee the normal startup of file system.The present invention is particularly suitable for system's isolated operation in the erasable memory device of low capacity, and uses the high capacity exterior storage medium to write down more big file, and in the embedded device that can frequently not make amendment.
Description of drawings
Fig. 1 is that the embodiment of the invention one files in embedded equipment detects the restorative procedure processing flow chart;
Fig. 2 is that the embodiment of the invention two files in embedded equipment detect prosthetic device embodiment schematic diagram.
Embodiment
In conjunction with the accompanying drawings the present invention is described in further detail below by embodiment.
Embodiment one:
With reference to the accompanying drawings 1, be example with a kind of global eyes terminal device.In this global eyes terminal device, be provided with an erasable storage unit of low capacity, for example: 64MFLASH storage operating system and application program, and usage log or transaction functionality file system, as the XFS Journaling File System; Simultaneously, use large-capacity storage media, for example:, use FAT32 file system management hard disc data with the video file that the hard-disc storage camera of a 320G is recorded.During equipment operation, have several video recording processes simultaneously and write the video recording data to hard disk.
This embodiment mainly may further comprise the steps:
Step 11: in the FLASH of global eyes, the file information storage that needs are detected is in the XFS of this FLASH Journaling File System.Can adopt document form to deposit above-mentioned information, promptly create a fileinfo log file, be used for storing the fileinfo that needs detection.In the XFS Journaling File System, increase a fileinfo posting field, the fileinfo log file is left in this posting field.At least a in the following parameter of this document record video file: filename, file path, file attribute, file size, file starting cluster, the end of file bunch, the information such as starting cluster that file is read and write.
Step 12: after global eye equipment starts, elder generation's this log file of initialization, the relevant information of the current operation file of this log file dynamic memory. preparing to record a video when recording, can on hard disk, open or create video file, at this moment, at first in log file, the filename of record this document, file path information, after opening file, calling interface again, obtain the starting cluster of this document, ending cluster, bunch position of current operation is recorded in the log file. then, begin to record a video and record, write video file. for conserve storage, can in equipment running process, judge whether the video file of being write can close timely, and before closing, call the interface of refresh data to disk, for the video file of normally closing, can fall log file corresponding file information deletion among the FLASH, expression this document is normal process.
Step 13: when needs detected reparation, for example: the equipment after the abnormal power-down was restarted; Mistake appears in file system, during the reading and writing of files failure; Carry file system or alternative document system relevant interface occur when wrong or the like can utilizing above-mentioned log file to detect reparation under the situation.Restarting with abnormal power-down equipment is example, when equipment is restarted, loads before the hard disk FAT32 file system data, carry out file system and detect.Application program is opened the fileinfo log file that is recorded on the FLASH, and the fileinfo of operating when moved all last time in the reading and recording is loaded in the internal memory.At first, read file system superblock information, obtain the file system Global Information, read two FAT tables of FAT1 and FAT2, use wherein correct one, detect bunch chain value of FAT list item record one by one, if exceed the normal range of file system, then should revise this FAT list item value.Then, from file system root directory, file or folder under the catalogue is scanned one by one, and compare with the TOC level name and the filename of file to be detected, find the corresponding file position, the folder of the All Files on this document level and this document are detected.When file or folder is detected, read all essential informations of Archive sit, and each bunch detected.To the attribute of file logging, size, skew, information such as bunch chain are found unmatched situation, it are revised consistent.Such as, file size is bigger than bunch chain size of file reality, and the revised file size is a bunch chain size so.Find that perhaps bunch chain content is unusual, then abandon make mistakes bunch, Free up Memory, and the information such as FAT list item of revised file make the filesystem information unanimity.
Step 14: file system reports application program to the fileinfo of revising after detecting and finishing, and comprises the filename of makeing mistakes, file size, and Error Locations etc. reload the FAT32 file system, and the initialization files recording areas reenters step 12.
Above detection repair process mechanism also can be applied in the miscellaneous equipment.For example in set-top box advertisement machine equipment, use FLASH storage operating system and application program, use media informations such as dismountable hard-disc storage advertisement, in advertisement machine new medium hard disk is installed, carry out under the situation of medium download or power-off restarting, the situation that the file of file system may occur damaging also can use said method to detect reparation.
Embodiment two:
With reference to the accompanying drawings 2, files in embedded equipment of the present invention detects prosthetic device, and device comprises:
Operation file information memory cell 21 is arranged in the daily record or transaction functionality file partition of equipment, is used for when equipment operation is operated file data, and storage is with the essential information of current operation file; Wherein the information of the current operation file of storage comprises at least a following parameter in the operation file information memory cell 21: filename, file attribute, file starting cluster, ending cluster, bunch position of current operation, file path, file size.
Operation file information updating unit 22 is used for upgrading the information of the current operation file that writes down in the described operation file information memory cell when the data of current operation file are made amendment;
Information empties processing unit 23, is used for emptying the information of the current operation file that writes down in the described operation file information memory cell when current operation file is normally closed;
Detect and reparation unit 24, be used for when equipment is restarted, carry out file data detection and reparation by reading the information that writes down in the described operation file information memory cell.
Information reports unit 25, is used to report the relevant information of repairing file.
In the erasable memory device of low capacity that the daily record or the transaction functionality file partition of equipment can be arranged on equipment in the present embodiment, the operation file data are arranged on the high capacity exterior storage medium.
Above content be in conjunction with concrete embodiment to further describing that the present invention did, can not assert that concrete enforcement of the present invention is confined to these explanations.For the general technical staff of the technical field of the invention, without departing from the inventive concept of the premise, can also make some simple deduction or replace, all should be considered as belonging to protection scope of the present invention.

Claims (12)

1. a files in embedded equipment detects restorative procedure, it is characterized in that described method comprises following processing procedure:
When in the equipment operation file data being operated, the essential information of current operation file is stored in the daily record or transaction functionality file partition of equipment;
When the data in the current operation file are made amendment, upgrade the information of the current operation file of above-mentioned storage;
Utilize the information of the operation file of above-mentioned storage to carry out the detection and the reparation of file data.
2. files in embedded equipment according to claim 1 detects restorative procedure, it is characterized in that, also comprise after file data is detected and repairs: the relevant information that will repair file reports.
3. files in embedded equipment according to claim 1 detects restorative procedure, it is characterized in that, in the information processing of the current operation file of described renewal, also comprise following processing procedure:, then empty the information of the current operation file of storage if current operation file is normally closed.
4. detect restorative procedure according to each described files in embedded equipment of claim 1-3, it is characterized in that the information of the current operation file of described record comprises at least a following parameter: filename, file attribute, file starting cluster, ending cluster, bunch position of current operation, file path, file size.
5. files in embedded equipment according to claim 4 detects restorative procedure, it is characterized in that, described essential information with current operation file is stored in the daily record of equipment or the transaction functionality file partition and is specially:
In the daily record of equipment or transaction functionality file partition, increase the fileinfo posting field;
The information of current operation file of record is left in the described fileinfo posting field with document form.
6. files in embedded equipment according to claim 5 detects restorative procedure, it is characterized in that, the daily record of described equipment or transaction functionality file partition are arranged in the erasable equipment of low capacity of equipment, and described operation file data are arranged in the high capacity exterior storage medium.
7. detect restorative procedure according to each described files in embedded equipment of claim 1-3, it is characterized in that, when equipment is restarted, the described information of the operation file of above-mentioned storage of utilizing is carried out the detection and the reparation of file data, be specially: read described canned data last time, in service to last time, normally do not close the file that may make mistakes at last, detect and repair.
8. a files in embedded equipment detects prosthetic device, it is characterized in that described device comprises:
The operation file information memory cell is arranged in the daily record or transaction functionality file partition of equipment, is used for when equipment operation is operated file data, and storage is with the essential information of current operation file;
The operation file information updating unit is used for upgrading the information of the current operation file of storing in the described operation file information memory cell when the data of current operation file are made amendment;
Detect and the reparation unit, the information that is used for utilizing described operation file information memory cell to write down is carried out file data detection and reparation.
9. files in embedded equipment according to claim 8 detects prosthetic device, it is characterized in that, comprises that also information reports the unit, is used to report the relevant information of repairing file.
10. files in embedded equipment according to claim 8 detects prosthetic device, it is characterized in that, comprise that also information empties processing unit, be used for when current operation file is normally closed, emptying the information of the current operation file of storing in the described operation file information memory cell.
11. each described files in embedded equipment detects prosthetic device according to Claim 8-10, it is characterized in that the information of the current operation file of storing in the described operation file information memory cell comprises at least a following parameter: filename, file attribute, file starting cluster, ending cluster, bunch position of current operation, file path, file size.
12. files in embedded equipment according to claim 11 detects prosthetic device, it is characterized in that, the daily record of described equipment or transaction functionality file partition are arranged in the erasable memory device of low capacity of equipment, and described operation file data are arranged in the high capacity exterior storage medium.
CN200910109629A 2009-11-16 2009-11-16 Method and device for checking and repairing files in embedded equipment Pending CN101706783A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN200910109629A CN101706783A (en) 2009-11-16 2009-11-16 Method and device for checking and repairing files in embedded equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN200910109629A CN101706783A (en) 2009-11-16 2009-11-16 Method and device for checking and repairing files in embedded equipment

Publications (1)

Publication Number Publication Date
CN101706783A true CN101706783A (en) 2010-05-12

Family

ID=42377009

Family Applications (1)

Application Number Title Priority Date Filing Date
CN200910109629A Pending CN101706783A (en) 2009-11-16 2009-11-16 Method and device for checking and repairing files in embedded equipment

Country Status (1)

Country Link
CN (1) CN101706783A (en)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102226893A (en) * 2011-05-21 2011-10-26 浙江工业大学 FAT (file allocation table) file system repairing method in embedded system
CN103064752A (en) * 2011-09-27 2013-04-24 奇智软件(北京)有限公司 Method and device of repairing document
CN103092719A (en) * 2011-10-28 2013-05-08 浙江大华技术股份有限公司 Power-off protection method for file system
TWI461904B (en) * 2011-08-16 2014-11-21 Mstar Semiconductor Inc Recovery method and device for linux using fat file system
CN104657236A (en) * 2015-03-11 2015-05-27 深圳市新岸通讯技术有限公司 Embedded Linux file system based on 32-bit MCU (microprogrammable control unit) and operating method thereof
CN105025306A (en) * 2015-06-30 2015-11-04 中国农业大学 Video storage method and system based on virtual management distributed file system
CN109344135A (en) * 2018-10-18 2019-02-15 中国海洋石油集团有限公司 A kind of parallel seismic processing job scheduling method of the file lock of automatic load balancing
CN111813748A (en) * 2020-07-10 2020-10-23 济南浪潮数据技术有限公司 File system mounting method and device, electronic equipment and storage medium
CN112214247A (en) * 2019-07-12 2021-01-12 华为技术有限公司 System starting method and related equipment
CN113742127A (en) * 2021-09-16 2021-12-03 重庆大学 Fault recovery method for bare flash memory file system
CN113806119A (en) * 2020-06-17 2021-12-17 浙江宇视科技有限公司 Memory card processing method, device, equipment and storage medium

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102226893B (en) * 2011-05-21 2013-01-23 浙江工业大学 FAT (file allocation table) file system repairing method in embedded system
CN102226893A (en) * 2011-05-21 2011-10-26 浙江工业大学 FAT (file allocation table) file system repairing method in embedded system
TWI461904B (en) * 2011-08-16 2014-11-21 Mstar Semiconductor Inc Recovery method and device for linux using fat file system
CN103064752A (en) * 2011-09-27 2013-04-24 奇智软件(北京)有限公司 Method and device of repairing document
CN103092719B (en) * 2011-10-28 2016-09-07 浙江大华技术股份有限公司 A kind of power-off protection method of file system
CN103092719A (en) * 2011-10-28 2013-05-08 浙江大华技术股份有限公司 Power-off protection method for file system
CN104657236A (en) * 2015-03-11 2015-05-27 深圳市新岸通讯技术有限公司 Embedded Linux file system based on 32-bit MCU (microprogrammable control unit) and operating method thereof
CN105025306B (en) * 2015-06-30 2018-05-11 中国农业大学 Video storage method and system based on virtual management distributed file system
CN105025306A (en) * 2015-06-30 2015-11-04 中国农业大学 Video storage method and system based on virtual management distributed file system
CN109344135A (en) * 2018-10-18 2019-02-15 中国海洋石油集团有限公司 A kind of parallel seismic processing job scheduling method of the file lock of automatic load balancing
CN112214247A (en) * 2019-07-12 2021-01-12 华为技术有限公司 System starting method and related equipment
CN112214247B (en) * 2019-07-12 2022-05-17 华为技术有限公司 System starting method and related equipment
US11868631B2 (en) 2019-07-12 2024-01-09 Huawei Technologies Co., Ltd. System startup method and related device
CN113806119A (en) * 2020-06-17 2021-12-17 浙江宇视科技有限公司 Memory card processing method, device, equipment and storage medium
CN111813748A (en) * 2020-07-10 2020-10-23 济南浪潮数据技术有限公司 File system mounting method and device, electronic equipment and storage medium
CN111813748B (en) * 2020-07-10 2022-06-07 济南浪潮数据技术有限公司 File system mounting method and device, electronic equipment and storage medium
CN113742127A (en) * 2021-09-16 2021-12-03 重庆大学 Fault recovery method for bare flash memory file system

Similar Documents

Publication Publication Date Title
CN101706783A (en) Method and device for checking and repairing files in embedded equipment
US8032707B2 (en) Managing cache data and metadata
CN103577121B (en) A kind of highly reliable linear file access method based on Nand Flash
EP2329360B1 (en) Managing cache data and metadata
CN101477482B (en) Method for recovering flash memory data at power-off of built-in Linux system
CN102033786B (en) Method for repairing consistency of copies in object storage system
CN100474271C (en) Multi-level buffering type memory system and method therefor
CN103577574A (en) High-reliability linear file system based on nand flash
CN106227621B (en) The data back up method and system of logic-based volume management simplification volume
CN104050056A (en) File system backup of multi-storage-medium device
CN102955720A (en) Method for improving stability of EXT (extended) file system
CN101963891A (en) Method and device for data storage and processing, solid-state drive system and data processing system
CN107918568B (en) Method for preventing Linux system from failing to restart
CN101187887B (en) Storage device with temporary data protection function and the method
CN101980203A (en) Embedded file system for high-definition media
CN105468544B (en) Method and device for realizing power-down prevention file system and power-down prevention file system
CN102262568A (en) Power-down prevention Linux system startup method
CN112035294B (en) Security log file system and implementation method and medium thereof
CN104239438A (en) File information storage method and file information read-write method based on separate storage
CN102262543A (en) Power-failure resistant method for starting Linux system
CN102226893B (en) FAT (file allocation table) file system repairing method in embedded system
US20070043968A1 (en) Disk array rebuild disruption resumption handling method and system
CN103559119A (en) File operation request processing method and device
US20050262033A1 (en) Data recording apparatus, data recording method, program for implementing the method, and program recording medium
CN102419995A (en) Information access device and information access method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20100512