CN105072372B - FAT file system self-repairing method in DVR terminal - Google Patents

FAT file system self-repairing method in DVR terminal Download PDF

Info

Publication number
CN105072372B
CN105072372B CN201510457894.1A CN201510457894A CN105072372B CN 105072372 B CN105072372 B CN 105072372B CN 201510457894 A CN201510457894 A CN 201510457894A CN 105072372 B CN105072372 B CN 105072372B
Authority
CN
China
Prior art keywords
file
mistake
file system
cluster
fat
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.)
Active
Application number
CN201510457894.1A
Other languages
Chinese (zh)
Other versions
CN105072372A (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.)
CHENGDU YIMENG HENGXIN TECHNOLOGY Co Ltd
Original Assignee
CHENGDU YIMENG HENGXIN TECHNOLOGY 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 CHENGDU YIMENG HENGXIN TECHNOLOGY Co Ltd filed Critical CHENGDU YIMENG HENGXIN TECHNOLOGY Co Ltd
Priority to CN201510457894.1A priority Critical patent/CN105072372B/en
Publication of CN105072372A publication Critical patent/CN105072372A/en
Application granted granted Critical
Publication of CN105072372B publication Critical patent/CN105072372B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses the FAT file system self-repairing methods in a kind of DVR terminal, comprising the following steps: S1:DVR terminal can trigger the detection and reparation to FAT file system under certain condition, enter step S2;S2: detection and reparation, including following sub-step: S21: detection FAT file system then obtains the recovery scenario of the mistake when finding some mistake from configuration: if (1) recovery scenario is to be automatically repaired, enabling is automatically repaired logic;(2) if recovery scenario is not repair the mistake but need to alarm, warning message is recorded, alarm is issued in due course, then skips the mistake;(3) if recovery scenario is not repair the mistake, the mistake is skipped;S22: circulation step S21.The invention enables the repair processes of entire FAT file system to be automatically performed, and after triggering automatic detection and rehabilitation, is able to detect that mistake, and can be automatically repaired the mistake, guarantees the normal operation of equipment, do not need manually to provide decision.

Description

FAT file system self-repairing method in DVR terminal
Technical field
The present invention relates to the FAT file system self-repairing methods in a kind of DVR terminal.
Background technique
DVR:Digital Video Recorder, i.e. digital video recorder.It records a video relative to traditional analog video Machine, uses HD recording, therefore commonly referred to as hard disk video recorder, also referred to as DVR.It is a set of progress image storage processing Computer system has and carries out long-time video recording, recording, the long-range function of monitoring and control to image/voice.
It is responsible for management in operating system and the software mechanism of storage file information is known as file management system, abbreviation file system System.Specifically, it is responsible for the subregion in management storage equipment (SD card, disk etc.), file is established for user, be stored in, read, Modification, dump file cancel file etc. when user does not use.Common file systems such as NTFS, FAT, EXT etc..
FAT file system is a kind of file system invented by Microsoft, uses for MS-DOS, is currently used primarily in USB flash disk, SD In the mobile storage such as card.
The prior art completes the reparation of FAT file system by following three kinds of schemes:
Technology 1: the included dosfsck implementing procedure of embedded Linux;
Advantage: can directly use, easy to operate;
Disadvantage: entire repair process requires manual intervention, and cannot be automatically performed.
Technology 2: the fix tool that open source scheme d osfstools is provided;
Advantage: can directly use after transplanting, easy to operate;
Disadvantage: entire repair process requires manual intervention, and cannot be automatically performed.
Other fix tools under technology 3:windows system;
Advantage: the type of error that can be automatically repaired is more;
Disadvantage: can not directly use in DVR terminal, storage equipment need to be connected in windows system.
But currently existing scheme due to its towards user there is uncertainty, therefore FAT file system cannot be automatically performed Repair process, centre need manually to provide decision.And be integrated to video data itself some characteristics and specific user it is specific Automatic correcting strategy may be implemented in demand.
Since power-off or other fortuitous events lead to the data file in FAT file system when the error occurs, it should can It detects the generation of its mistake, and the mistake can be repaired, guarantee the normal operation of equipment.Also, this reparation is preferably automatic , do not need manpower intervention.
Summary of the invention
It is an object of the invention to overcome the deficiencies of the prior art and provide in a kind of DVR terminal for not needing manual intervention FAT file system self-repairing method.
The purpose of the present invention is achieved through the following technical solutions: the FAT file system in DVR terminal is automatically repaired Method, it the following steps are included:
S1:DVR terminal can trigger the detection and reparation to FAT file system under certain condition, enter step S2;
S2: detection and reparation, including following sub-step:
S21: detection FAT file system then obtains the recovery scenario of the mistake when finding some mistake from configuration:
(1) if recovery scenario is to be automatically repaired, enabling is automatically repaired logic;
(2) if recovery scenario is not repair the mistake but need to alarm, warning message is recorded, issues alarm in due course, Then the mistake is skipped;
(3) if recovery scenario is not repair the mistake, the mistake is skipped;
S22: circulation step S21, the mistake until not finding file system again.
DVR terminal described in step S1 is set out the triggering item of detection and reparation to FAT file system under certain condition Part includes:
(1) the every starting n times of terminal will start one-time detection and reparation;
(2) when running last time, there is mistake in FAT file system, then needs to detect when this starts.
Described to the detection and reparation of FAT file system is occurred when terminal starts.
The logic that is automatically repaired includes:
(1) if FAT table includes invalid cluster number, which is revised as EOF;
(2) if the cluster chain of file contains circulation, which will be truncated;
(3) if the cluster of damage read error occurs, these clusters will be marked as bad cluster, and from the file comprising them Middle deletion;
(4) if " " and " .. " is identified as non-catalogue, the two entries are deleted;
(5) if the size field of file is not 0, it is revised as 0 automatically;
(6) if file " " is not directed toward current directory, start pointer field will be corrected for current directory;
(7) if file " .. " is not directed toward parent directory, start pointer field will be corrected for parent directory;
(8) if the beginning cluster number of file is illegal, this document will be truncated;
(9) if contained in file damage or not and the cluster that distributes, this document will be truncated;
(10) if the value of the file size and file size field calculated by document cluster chain is inconsistent, this document will be by Truncation;
(11) the identical cluster of multiple file-sharings, in addition to first file, alternative document will be truncated;
(12) cluster be identified as using but do not possessed by any file, they will be identified as free cluster.
The logic that is automatically repaired includes:
(1) entry that a large amount of mistake is contained under file then deletes this catalogue more than the percentage of configuration;
(2) there is the filename of mistake, then renamed automatically according to the temporal information in file header;
(3) there is duplicate entry under file, then renamed automatically according to the temporal information in file header;
(4) there is any long filenames mistake, then the long filenames of deletion error, then according to short filename and file Head information Rename file.
The beneficial effects of the present invention are:
1. the invention enables the repair processes of entire FAT file system to be automatically performed, detects and repair automatically in triggering After multiple, it is able to detect that the mistake for causing the data file in FAT file system to occur due to power-off or other fortuitous events, And it can be automatically repaired the mistake, guarantee the normal operation of equipment, does not need manually to provide decision.
2. and user can configure the item for needing the item being automatically repaired and needs to alarm according to particular demands.
Detailed description of the invention
Fig. 1 is the method for the present invention flow chart.
Specific embodiment
Technical solution of the present invention is described in further detail with reference to the accompanying drawing: as shown in Figure 1, the FAT text in DVR terminal Part system self-repairing method, it the following steps are included:
S1:DVR terminal can trigger the detection and reparation to FAT file system under certain condition, enter step S2;
S2: detection and reparation, including following sub-step:
S21: detection FAT file system then obtains the recovery scenario of the mistake when finding some mistake from configuration:
(1) if recovery scenario is to be automatically repaired, enabling is automatically repaired logic;
(2) if recovery scenario is not repair the mistake but need to alarm, warning message is recorded, issues alarm in due course, Then the mistake is skipped;
(3) if recovery scenario is not repair the mistake, the mistake is skipped;
S22: circulation step S21, the mistake until not finding file system again.
DVR terminal described in step S1 is set out the triggering item of detection and reparation to FAT file system under certain condition Part includes:
(1) the every starting n times of terminal will start one-time detection and reparation;
(2) when running last time, there is mistake in FAT file system, then needs to detect when this starts.
Described to the detection and reparation of FAT file system is occurred when terminal starts.
The logic that is automatically repaired includes:
(1) if FAT table includes invalid cluster number, which is revised as EOF;
(2) if the cluster chain of file contains circulation, which will be truncated;
(3) if the cluster of damage read error occurs, these clusters will be marked as bad cluster, and from the file comprising them Middle deletion;
(4) if " " and " .. " is identified as non-catalogue, the two entries are deleted;
(5) if the size field of file is not 0, it is revised as 0 automatically;
(6) if file " " is not directed toward current directory, start pointer field will be corrected for current directory;
(7) if file " .. " is not directed toward parent directory, start pointer field will be corrected for parent directory;
(8) if the beginning cluster number of file is illegal, this document will be truncated;
(9) if contained in file damage or not and the cluster that distributes, this document will be truncated;
(10) if the value of the file size and file size field calculated by document cluster chain is inconsistent, this document will be by Truncation;
(11) the identical cluster of multiple file-sharings, in addition to first file, alternative document will be truncated;
(12) cluster be identified as using but do not possessed by any file, they will be identified as free cluster.
The logic that is automatically repaired includes:
(1) entry that a large amount of mistake is contained under file then deletes this catalogue more than the percentage of configuration;
(2) there is the filename of mistake, then renamed automatically according to the temporal information in file header;
(3) there is duplicate entry under file, then renamed automatically according to the temporal information in file header;
(4) there is any long filenames mistake, then the long filenames of deletion error, then according to short filename and file Head information Rename file.

Claims (4)

  1. FAT file system self-repairing method in 1.DVR terminal, it is characterised in that: it the following steps are included:
    S1:DVR terminal can trigger the detection and reparation to FAT file system under certain condition, enter step S2;
    S2: detection and reparation, including following sub-step:
    S21: detection FAT file system then obtains the recovery scenario of the mistake when finding some mistake from configuration:
    (1) if recovery scenario is to be automatically repaired, enabling is automatically repaired logic;
    (2) if recovery scenario is not repair the mistake but need to alarm, warning message is recorded, issues alarm in due course, then Skip the mistake;
    (3) if recovery scenario is not repair the mistake, the mistake is skipped;
    S22: circulation step S21, the mistake until not finding file system again;
    The logic that is automatically repaired includes:
    (1) if FAT table includes invalid cluster number, which is revised as EOF;
    (2) if the cluster chain of file contains circulation, which will be truncated;
    (3) if the cluster of damage read error occurs, these clusters will be marked as bad cluster, and delete from the file comprising them It removes;
    (4) if " " and " .. " is identified as non-catalogue, the two entries are deleted;
    (5) if the size field of file is not 0, it is revised as 0 automatically;
    (6) if file " " is not directed toward current directory, start pointer field will be corrected for current directory;
    (7) if file " .. " is not directed toward parent directory, start pointer field will be corrected for parent directory;
    (8) if the beginning cluster number of file is illegal, this document will be truncated;
    (9) if contained in file damage or not and the cluster that distributes, this document will be truncated;
    (10) if the value of the file size and file size field calculated by document cluster chain is inconsistent, this document will be cut It is disconnected;
    (11) the identical cluster of multiple file-sharings, in addition to first file, alternative document will be truncated;
    (12) cluster be identified as using but do not possessed by any file, they will be identified as free cluster.
  2. 2. the FAT file system self-repairing method in DVR terminal according to claim 1, it is characterised in that: step S1 The set out under certain condition trigger condition of detection and reparation to FAT file system of the DVR terminal includes:
    (1) the every starting n times of terminal will start one-time detection and reparation;
    (2) when running last time, there is mistake in FAT file system, then needs to detect when this starts.
  3. 3. the FAT file system self-repairing method in DVR terminal according to claim 1, it is characterised in that: described Detection and reparation to FAT file system are occurred when terminal starting.
  4. 4. the FAT file system self-repairing method in DVR terminal according to claim 1, it is characterised in that: described Being automatically repaired logic includes:
    (1) entry that a large amount of mistake is contained under file then deletes this catalogue more than the percentage of configuration;
    (2) there is the filename of mistake, then renamed automatically according to the temporal information in file header;
    (3) there is duplicate entry under file, then renamed automatically according to the temporal information in file header;
    (4) there is any long filenames mistake, then the long filenames of deletion error, then believed according to short filename and file header Cease Rename file.
CN201510457894.1A 2015-07-30 2015-07-30 FAT file system self-repairing method in DVR terminal Active CN105072372B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510457894.1A CN105072372B (en) 2015-07-30 2015-07-30 FAT file system self-repairing method in DVR terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510457894.1A CN105072372B (en) 2015-07-30 2015-07-30 FAT file system self-repairing method in DVR terminal

Publications (2)

Publication Number Publication Date
CN105072372A CN105072372A (en) 2015-11-18
CN105072372B true CN105072372B (en) 2019-03-19

Family

ID=54501641

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510457894.1A Active CN105072372B (en) 2015-07-30 2015-07-30 FAT file system self-repairing method in DVR terminal

Country Status (1)

Country Link
CN (1) CN105072372B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112579179A (en) * 2019-09-30 2021-03-30 合肥杰发科技有限公司 Partition mounting method of embedded system
CN113806119B (en) * 2020-06-17 2024-05-31 浙江宇视科技有限公司 Memory card processing method, device, equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1460210A (en) * 2001-04-25 2003-12-03 成津C&C株式会社 Apparatus and method for protecting failure of computer operating system
CN102314490A (en) * 2011-08-16 2012-01-11 晨星软件研发(深圳)有限公司 Method and device for recovering Linux FAT (File Allocation Table) file system
CN104063187A (en) * 2014-07-08 2014-09-24 珠海安联锐视科技股份有限公司 Hard disk file system suitable for security application and operation method thereof

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070128899A1 (en) * 2003-01-12 2007-06-07 Yaron Mayer System and method for improving the efficiency, comfort, and/or reliability in Operating Systems, such as for example Windows
CN104216997A (en) * 2014-09-10 2014-12-17 珠海市君天电子科技有限公司 Method and device for repairing terminal equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1460210A (en) * 2001-04-25 2003-12-03 成津C&C株式会社 Apparatus and method for protecting failure of computer operating system
CN102314490A (en) * 2011-08-16 2012-01-11 晨星软件研发(深圳)有限公司 Method and device for recovering Linux FAT (File Allocation Table) file system
CN104063187A (en) * 2014-07-08 2014-09-24 珠海安联锐视科技股份有限公司 Hard disk file system suitable for security application and operation method thereof

Also Published As

Publication number Publication date
CN105072372A (en) 2015-11-18

Similar Documents

Publication Publication Date Title
US8418003B2 (en) Log collecting apparatus, program, method, and system
AU2010347733B2 (en) Systems and methods for garbage collection in deduplicated data systems
US9715447B2 (en) Method for adaptively managing a solid state drive, and associated apparatus and associated computer program product
CN104811645B (en) A kind of embedded Video data storage method
CN104063447A (en) Monitoring video file restoring method
US20140280387A1 (en) System and method for expanding storage space of network device
US20190087283A1 (en) Aircraft aerial photography data backup method, apparatus and device, and computer readable storage medium
CN103942126B (en) Electronic equipment and its data back up method
US20150227544A1 (en) Efficient data storage utilization and recycling by gradual data degradation
CN104461925A (en) Automatic correcting method and device for aligning storage device addresses
CN105072372B (en) FAT file system self-repairing method in DVR terminal
CN103713972A (en) Incremental backup system and method
CN203260027U (en) Backup device and data backup system
CN110704257A (en) Solid state disk, quality monitoring method and device thereof and computer readable storage medium
CN105095418B (en) A kind of method and apparatus of processing write requests
CN104978241B (en) A kind of data reconstruction method and device of COW type file systems
CN103984622A (en) Method and device for managing logs for Linux-based GPON ONU (Gigabit Passive Optical Network Optical Unit) equipment
TW201516655A (en) System and method for recovering distributed file system
WO2018177193A1 (en) Software upgrade method and device
US20180349230A1 (en) Context aware data backup
CN107291909B (en) Data processing method and system
KR101111400B1 (en) Apparatus and method for recovering the data of embeded system
CN102141964A (en) Method and device for repeatedly using magnetic tape
CN103902663A (en) File synchronization method and device
US20130007521A1 (en) Synchronous test control system and method using testing device

Legal Events

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