CN1822174A - Method for protecting hardware key information area in embedded device - Google Patents

Method for protecting hardware key information area in embedded device Download PDF

Info

Publication number
CN1822174A
CN1822174A CN 200510061933 CN200510061933A CN1822174A CN 1822174 A CN1822174 A CN 1822174A CN 200510061933 CN200510061933 CN 200510061933 CN 200510061933 A CN200510061933 A CN 200510061933A CN 1822174 A CN1822174 A CN 1822174A
Authority
CN
China
Prior art keywords
file
hard disk
audio
key message
video data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN 200510061933
Other languages
Chinese (zh)
Other versions
CN100383881C (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.)
Hangzhou Hikvision Digital Technology Co Ltd
Original Assignee
Hangzhou Hikvision Digital 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 Hangzhou Hikvision Digital Technology Co Ltd filed Critical Hangzhou Hikvision Digital Technology Co Ltd
Priority to CNB2005100619332A priority Critical patent/CN100383881C/en
Publication of CN1822174A publication Critical patent/CN1822174A/en
Application granted granted Critical
Publication of CN100383881C publication Critical patent/CN100383881C/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Signal Processing For Digital Recording And Reproducing (AREA)
  • Management Or Editing Of Information On Record Carriers (AREA)

Abstract

This invention relates to a protection method for hard disk key information region in an inserted device including the following steps: 1, partitioning a disk and formatting, 2, pre-setting up files, setting up index files and N audio and video data files, the lengths of the files are 0 bytes and the length of the index files is corrected, 3, freezing and protecting the key information region of the disk when recording, 31, when writing every disk, comparing the destination address of the disk and the address sphere of a key information region, if it is in the sphere, then the disk drive program returns back the mistake directly, 32, all read/write operations to the index files and audio and video data files will not refresh the directory entry and FAT table.

Description

The guard method in hard disk key message district in a kind of embedded device
Technical field
The invention belongs to areas of information technology,, provide the guard method in hard disk key message district in a kind of embedded device at the characteristics of embedded hard disc video recorder at the hard disk identifying recording layer.
Background technology
In digitizing audio-video monitoring field, along with evolution of embedded technology, embedded digital hard disc video recorder (EDVR, Embedded DigitalVideo Recorder) improvement of essence has been arranged in each side such as performance, function, applicability, maintainability, stability, therefore its application is also more and more wider, develops into various application places such as traffic, public security, electric power, vehicle-carried mobile, mining from initial financial field.Along with the variation of applied environment, complicated, the reliability and the failover capability of embedded digital hard disc video recorder are had higher requirement.
The fault that common embedded hard disc video recorder can't normally be recorded a video mainly is that " soft error " that boot sector, partitions of file table, the file directory item of the hard disk that causes owing to reasons such as system exception power down lost or reason such as imperfect causes causes, and because " hard error " that hardware reasons such as disc physical damage, magnetic head damage, drive motor or control system fault cause is relatively more rare.
As everyone knows, adopt the EDVR hard disk of FAT32 file system generally to form (1 to a plurality of subregions) by Master boot sector, reserve sector and subregion, each subregion is made up of 4 parts such as partition boot sector, FAT table (File allocation table, file allocation table), file directory item (File directory table), file data districts again.Master boot sector is positioned at 1 sector, 00 road of hard disk, has comprised important informations such as hard disk praameter and partition table, in case partition table is destroyed, and mistake such as will cause that subregion is lost; Each subregion comprises the retaining space of 1 partition boot sector and 31 sectors, and back to back is the FAT list area, and the file directory item then can be distributed in subregion Anywhere.Common data file is made up of FAT watch chain, three parts of directory entry and data field, in case FAT shows, directory entry is destroyed, and mistake such as will cause that file corruption or file are lost.Hard disk is minimum operating unit (a general sector-size is 512 bytes) with the sector, all there is the address of a linearity each sector of hard disk, be called LBA address (Logical Block Address, LBA (Logical Block Addressing)), therefore logically we can see linear continuous space to hard disk.For example, Master boot sector is positioned at 1 sector, 00 road of hard disk, and corresponding LBA address is 0x0000H.For simplicity, we call hard disk key message district to the Master boot sector of hard disk and partition boot sector, FAT table, file directory item etc.
In traditional FAT32 file system, read/write operation to an ordinary file, except the data of read/write file, all need to upgrade directory entry and FAT table, directory entry includes important informations such as filename, file attribute, document creation time, last access time of file, the last modification time of file, file first bunch number, file size, and the FAT table is deposited bunch number chained list information of file.Because hard disk all is that unit carries out read/write operation with the sector, if so when the FAT of updating file table or directory entry owing to reasons such as powered-off fault cause the write operation of hard disk by aborted, just be easy to cause whole sectors of data destroyed, cause one even a plurality of file to be lost or status error.Because embedded hard disc video recorder hard disk is used to write down real-time audio, video data, therefore very frequent to the write operation of hard disk, constantly revise directory entry or FAT table content, under the applied environment of various complexity, be easy to because a variety of causes causes " soft error " of hard disk.
Summary of the invention
The guard method in hard disk key message district in a kind of embedded device that the objective of the invention is to overcome above-mentioned deficiency and provide; key message district to hard disk carries out freeze protection; thereby improve the reliability of FAT32 file system in the embedded hard disc video recorder, avoid the generation of " soft error ".The freeze key block of information is exactly in the embedded hard disc video recorder, need write during except the initialization hard disk these key message districts, and all the other do not carry out write operation to these key message districts during to the read/write operation of hard disk.
The technical scheme that realizes the object of the invention is: the guard method in hard disk key message district in this embedded device mainly comprises the steps:
1), fdisk and format: with the hard disk of a P GB capacity, be divided into L subregion, and format each fdisk;
2), pre-create file:
(21), according to the size (the big or small MMB of each data file) of the capacity and the audio, video data file of subregion, determine the audio, video data total number of files N that a subregion can be created;
(22), on this subregion, create index file and N audio, video data file, file size is 0 byte;
(23), the index file length created of change step (22), N each length of audio, video data file is M MB, is total data district file allocation hard drive space, index file was the audio, video data file then before this; In allocation space, the content of FAT32 system corresponding renewal FAT table and directory entry;
(24), repeating step (21), (22), (23) pre-create file to L subregion and all finish;
Key message district to hard disk when 3), embedded device is recorded a video carries out freeze protection: (described key message district is meant Master boot sector, partition boot sector, FAT table, the directory entry of hard disk)
(31), in the hard drive program, write down the address realm in the key message district of each subregion of hard disk, when each hard disk " write operation ", to compare the address realm in the hard disk destination address of this operation and key message district, if within this scope, then the hard drive program is directly returned mistake;
(32), set I/O function read ()/write () of FAT32 file system, make all not upgrade directory entry and FAT table to the read/write operation of index file and audio, video data file.
Realize that technical scheme of the present invention can also be further perfect.In pre-creating the file process, create 2 index files, the content of 2 index files is identical, when document retrieval or playback, if some index file verifications make mistakes, then enables the index file of another one backup.In step (22), after total data district document creation was finished, the shared hard drive space of the directory entry of these files was continuous, and was positioned at after the FAT table.
The effect that the present invention is useful is: can significantly reduce the maintenance that the embedded hard disc video recorder hard disk " soft fault " that causes owing to reasons such as powered-off faults causes, improve the reliability of hard disk and even whole embedded hard disc video recorder.
Description of drawings
Fig. 1 is a workflow diagram of the present invention;
Fig. 2 is that embodiment of the invention fdisk is formed synoptic diagram;
Fig. 3 is that the key message district and the data field file of embodiment of the invention hard disk formed synoptic diagram.
Embodiment
Below in conjunction with accompanying drawing and example, hard disk key message district's guard method of embedded hard disc video recorder of the present invention is further elaborated.
When the technical solution adopted in the present invention comprises fdisk and formats, pre-creates file, embedded hard disc video-recorder recording to the key message district freeze protection process of hard disk.
Fdisk and formatting procedure:
At first according to the hard disk size subregion, minimumly be divided into 1 subregion.For example: hard disk (the WDC WD800BB-00DKA0 of 1 western number 80GB of company, total sector number: 156301488, system shows the hard disk total volume: 74.5GB), can be divided into 4 subregions that capacity is identical as required, each partition size is 20GB (as shown in Figure 2), and the address space that subregion 1 takies is 0x8000-0x4A7A67FFF.Format then.After fdisk and the format, the content of Master boot sector and partition boot sector will can not change.
For each fdisk, it is as follows to pre-create the file process:
(21) according to the size of the capacity and the audio, video data file of subregion, determine the audio, video data total number of files that a subregion can be created.For example: the size of each audio, video data file is 128MB, can set up audio, video data file (the actual audio, video data file of setting up 147 128MB) and 2 1.15MB index files of 149 128MB concerning the subregion of 1 20GB.The index file size is calculated by following formula: file header+(file index+file fragment index) * number of files, wherein, file header is 512Bytes, file index length is 16Bytes, file fragment index length is 8192Bytes, so index file size=512+8208 * N, N are the numbers of audio, video data file.Because index file takes up space very little than the 128MB data file, 1000 shared hard drive spaces of 128MB data file are 128GB, its corresponding 2 index file total lengths have only 16MB, so, generally speaking, can be earlier according to the available partition size calculating can create 128MB fixed size file number, correspondingly set up 1-2 data file less, remaining space is left index file for and is got final product.
(22) in the FAT32 file system, directory entry can be distributed in subregion Anywhere.In order to simplify the program of protection directory entry, must make the directory entry of these files be distributed in the zone that follows the FAT table closely continuously.Detailed process is: create 2 index files and 147 audio, video data files, file size is 0 byte, and is each audio, video data reference number of a document since 0, and its sequence number is included in the filename.After total data district document creation was finished, the shared hard drive space of the directory entry of these files was continuous, and was positioned at after the FAT table.
(23) be total data district file allocation hard drive space.2 index files before this, file size is 1.15MB.The content of 2 index files is identical.Its effect is when document retrieval or playback, if some index file verifications make mistakes, then enables the index file of another one backup.Index file video-audio frequency data file start time, concluding time, video segment size, information such as file sequence number (title), audio, video data file status, file sequence number (title) is pressed the natural number serial number, and the audio, video data file status does not comprise and writes down, writes down, writing down three kinds.Be the audio, video data file then, file size is 128MB.In the process of allocation space, the content of the corresponding renewal of FAT32 file system FAT table and directory entry.The building-block of logic of subregion 1 after the establishment file is finished as shown in Figure 3 in this example.
(24) repeating step (21), (22), (23) pre-create file to 4 subregions and all finish.
During the embedded hard disc video-recorder recording key message district of hard disk being carried out freeze protection comprises the steps:
(31) owing to causing accident, reasons such as interference write the operation of key message district in order to prevent, we have write down the address realm in the key message district of each subregion of hard disk in the hard drive program, for example: as shown in Figure 3, subregion 1 key message regional address scope is 0x8000--0x95F800.When each hard disk " write operation ", compare the address realm in the hard disk destination address of this operation and key message district, if within this scope, then the hard drive program is directly returned mistake, to prevent to destroy the key message district.
(32) in the FAT32 file system, the FAT table only needs to upgrade when interpolation/deleted file, change file size.In the embedded hard disc video recorder, after hard disk initialization was finished, we no longer added/delete any file, did not also change the length of any file, guaranteed that like this FAT table does not need to upgrade, thereby reached the purpose of protection FAT table.In the FAT32 file system, a directory entry is made up of information such as filename, file attribute, creation-time, last access time, last modification time, file first bunch number, file sizes.Usually, the read operation to a file needs to upgrade ' last access time '; Write operation then needs to upgrade ' last modification time ', if the length of file changes, then needs simultaneously to upgrade ' file size '.And in the embedded hard disc video recorder; we also are indifferent to ' last access time ', ' the last modification time ' of file; the temporal information of audio, video data segment all is recorded among 2 index files; and file length is constant except that initialization procedure; therefore we have revised I/O function read ()/write () of FAT32 file system; make all not upgrade directory entry and FAT table, reach the purpose in hard disk key message district in the protection embedded device the read/write operation of index file and audio, video data file.

Claims (4)

1, the guard method in hard disk key message district in a kind of embedded device is characterized in that: mainly comprise the steps:
1), fdisk and format: with the hard disk of a P GB capacity, be divided into L subregion, and format each fdisk;
2), pre-create file:
(21), according to the size of the capacity and the audio, video data file of subregion, determine the audio, video data total number of files N that a subregion can be created:
(22), on this subregion, create index file and N audio, video data file, file size is 0 byte;
(23), the index file length created of change step (22), N each length of audio, video data file is M MB, is total data district file allocation hard drive space, index file was the audio, video data file then before this; In allocation space, the content of FAT32 system corresponding renewal FAT table and directory entry;
(24), repeating step (21), (22), (23) pre-create file to L subregion and all finish;
Key message district to hard disk when 3), embedded device is recorded a video carries out freeze protection:
(31), in the hard drive program, write down the address realm in the key message district of each subregion of hard disk, when each hard disk " write operation ", to compare the address realm in the hard disk destination address of this operation and key message district, if within this scope, then the hard drive program is directly returned mistake;
(32), set I/O function read ()/write () of FAT32 file system, make all not upgrade directory entry and FAT table to the read/write operation of index file and audio, video data file.
2, the guard method in hard disk key message district in the embedded device according to claim 1; it is characterized in that: create 2 index files; the content of 2 index files is identical; when document retrieval or playback; if some index file verifications make mistakes, then enable the index file of another one backup.
3, the guard method in hard disk key message district in the embedded device according to claim 1; it is characterized in that: in step (22); after total data district document creation was finished, the shared hard drive space of the directory entry of these files was continuous, and was positioned at after the FAT table.
4, the guard method in hard disk key message district in the embedded device according to claim 1 is characterized in that: described key message district is meant Master boot sector, partition boot sector, FAT table, the directory entry of hard disk.
CNB2005100619332A 2005-12-08 2005-12-08 Method for protecting hardware key information area in embedded device Active CN100383881C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2005100619332A CN100383881C (en) 2005-12-08 2005-12-08 Method for protecting hardware key information area in embedded device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2005100619332A CN100383881C (en) 2005-12-08 2005-12-08 Method for protecting hardware key information area in embedded device

Publications (2)

Publication Number Publication Date
CN1822174A true CN1822174A (en) 2006-08-23
CN100383881C CN100383881C (en) 2008-04-23

Family

ID=36923452

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2005100619332A Active CN100383881C (en) 2005-12-08 2005-12-08 Method for protecting hardware key information area in embedded device

Country Status (1)

Country Link
CN (1) CN100383881C (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101315674B (en) * 2007-05-31 2010-11-03 深圳市江波龙电子有限公司 Method for protecting and reading issued data of memory card
CN102075621A (en) * 2010-12-23 2011-05-25 上海闻泰电子科技有限公司 Method for safely storing multimedia messages of mobile phone and performing power-off protection
CN102193857A (en) * 2011-05-21 2011-09-21 浙江工业大学 Method for quantitatively testing abnormal state of file allocation table (FAT) file system in embedded system
CN101582044B (en) * 2009-06-15 2012-07-04 中兴通讯股份有限公司 Key information area maintenance method of file system and device
CN104268088A (en) * 2014-09-15 2015-01-07 郑州天迈科技股份有限公司 Vehicle DVR (Digital Video Recorder) hard disk data storage method
CN105229618A (en) * 2013-05-30 2016-01-06 三菱电机株式会社 Data harmonization assisting system and data harmonization support method
CN109062989A (en) * 2018-07-03 2018-12-21 深圳市慧视通科技股份有限公司 A kind of vehicle-mounted monitoring date storage method
CN110471623A (en) * 2019-07-31 2019-11-19 深圳市博实结科技有限公司 Fixed disk file wiring method, device, computer equipment and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100476761C (en) * 2002-05-20 2009-04-08 邵通 Device and method of realizing hard disk safety isolation
KR100564573B1 (en) * 2003-08-29 2006-03-29 삼성전자주식회사 Method for protecting data in data storage system and disc drive using the same
CN1595517A (en) * 2003-09-10 2005-03-16 西安三茗科技有限责任公司 A method for locking hard disk partition safely
CN1287300C (en) * 2004-04-08 2006-11-29 王启祥 Attribute setup method for computer hard disk zoning, and its appliance

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101315674B (en) * 2007-05-31 2010-11-03 深圳市江波龙电子有限公司 Method for protecting and reading issued data of memory card
CN101582044B (en) * 2009-06-15 2012-07-04 中兴通讯股份有限公司 Key information area maintenance method of file system and device
CN102075621B (en) * 2010-12-23 2015-10-07 上海闻泰电子科技有限公司 A kind of safe storage cell phone multimedia message also carries out the method for power down protection
CN102075621A (en) * 2010-12-23 2011-05-25 上海闻泰电子科技有限公司 Method for safely storing multimedia messages of mobile phone and performing power-off protection
CN102193857A (en) * 2011-05-21 2011-09-21 浙江工业大学 Method for quantitatively testing abnormal state of file allocation table (FAT) file system in embedded system
CN102193857B (en) * 2011-05-21 2014-12-03 浙江工业大学 Method for quantitatively testing abnormal state of file allocation table (FAT) file system in embedded system
CN105229618A (en) * 2013-05-30 2016-01-06 三菱电机株式会社 Data harmonization assisting system and data harmonization support method
CN104268088A (en) * 2014-09-15 2015-01-07 郑州天迈科技股份有限公司 Vehicle DVR (Digital Video Recorder) hard disk data storage method
CN104268088B (en) * 2014-09-15 2018-11-16 郑州天迈科技股份有限公司 Vehicle-mounted DVR hard disc data storage method
CN109062989A (en) * 2018-07-03 2018-12-21 深圳市慧视通科技股份有限公司 A kind of vehicle-mounted monitoring date storage method
CN109062989B (en) * 2018-07-03 2022-05-17 深圳市慧视通科技股份有限公司 Vehicle-mounted monitoring data storage method
CN110471623A (en) * 2019-07-31 2019-11-19 深圳市博实结科技有限公司 Fixed disk file wiring method, device, computer equipment and storage medium
CN110471623B (en) * 2019-07-31 2023-12-29 深圳市博实结科技股份有限公司 Hard disk file writing method, device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN100383881C (en) 2008-04-23

Similar Documents

Publication Publication Date Title
US10860259B1 (en) Multi-tiered storage system for blockchain
CN100383881C (en) Method for protecting hardware key information area in embedded device
CN100578470C (en) Audio/video data access method and device based on raw device
EP1805589B1 (en) Tape emulating disk based storage and method with automatically resized emulated tape capacity
US8892817B2 (en) Storage device with inline address indirection metadata storage
US8019925B1 (en) Methods and structure for dynamically mapped mass storage device
US7965465B2 (en) Techniques for storing shingle blocks in a cache memory using a data storage device
CN1750164A (en) Digital hard disc recorder file managing method for preventing file fragment production
US20110015778A1 (en) Data cartridge and tape library including flash memory
CN102136290A (en) Method for storing embedded real-time video files
US20110314205A1 (en) Storage system
US7747810B2 (en) Address assigning method, disk drive, and data writing method
US20150193473A1 (en) Database Storage System based on Optical Disk and Method Using the System
WO2005066787A1 (en) Information recording medium
CN1831953A (en) Cassette tape and recording system
JP4221959B2 (en) Bridge file system, computer system, data management method and recording medium using bridge file system
JP5517224B2 (en) Storage device
US10725970B2 (en) Block storage device with optional deduplication
CN101034416A (en) Method for file seek track using file allocation table and system frame thereof
JP2008269520A (en) Recorder and recording method
KR20190061549A (en) File system and method of storing files based on the file system
JP4079244B2 (en) Reorganization processing method for write-once type storage media volume
JP3725375B2 (en) Data reorganization method in storage media library
US11455255B1 (en) Read performance of log-structured file system (LFS)-based storage systems that support copy-on-write (COW) snapshotting
JP2001043662A (en) Disk medium managing 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
C14 Grant of patent or utility model
GR01 Patent grant
C56 Change in the name or address of the patentee

Owner name: HANGZHOU HIKVISION DIGITAL TECHNOLOGY CO., LTD.

Free format text: FORMER NAME OR ADDRESS: HAIKANG WEISHI DIGITAL TECHNIQUE CO LTD, HANGZHOU

CP01 Change in the name or title of a patent holder

Address after: Xihu District Hangzhou City, Zhejiang Province, Ma Cheng Road, No. 36

Patentee after: Hangzhou Hikvision Digital Technology Co., Ltd.

Address before: Xihu District Hangzhou City, Zhejiang Province, Ma Cheng Road, No. 36

Patentee before: Haikang Weishi Digital Technique Co., Ltd., Hangzhou