CN101751340A - Data write method for improving service life of data storage equipment - Google Patents

Data write method for improving service life of data storage equipment Download PDF

Info

Publication number
CN101751340A
CN101751340A CN 200810179294 CN200810179294A CN101751340A CN 101751340 A CN101751340 A CN 101751340A CN 200810179294 CN200810179294 CN 200810179294 CN 200810179294 A CN200810179294 A CN 200810179294A CN 101751340 A CN101751340 A CN 101751340A
Authority
CN
China
Prior art keywords
data
video recording
data block
writing
message unit
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 200810179294
Other languages
Chinese (zh)
Other versions
CN101751340B (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.)
Streamax Technology Co Ltd
Original Assignee
SHENZHEN STREAMING VIDEO 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 SHENZHEN STREAMING VIDEO TECHNOLOGY Co Ltd filed Critical SHENZHEN STREAMING VIDEO TECHNOLOGY Co Ltd
Priority to CN 200810179294 priority Critical patent/CN101751340B/en
Publication of CN101751340A publication Critical patent/CN101751340A/en
Application granted granted Critical
Publication of CN101751340B publication Critical patent/CN101751340B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Television Signal Processing For Recording (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)
  • Read Only Memory (AREA)

Abstract

The invention discloses a data write method for improving the service life of data storage equipment, which includes the following steps: setting information units corresponding to the data blocks in the storage equipment on a nonvolatile memory; circularly searching the data blocks used for writing data in sequence on the information units of the nonvolatile memory; and according to the sequence of the information units, writing the record data to the corresponding data blocks in sequence, setting attributes in all the information units, which indicate that whether the corresponding data blocks are empty and whether the data blocks have invalid record data or have valid record data, judging the attributes of the information units corresponding to the data blocks to which the record data is to be written, and if the attributes indicate that the corresponding data blocks have valid data, sending out alarm information to the user. The nonvolatile memory is an Fram or EPROM and the storage equipment is an SD card or CF card. Through the method, the record data are sequentially stored in the data blocks and the data blocks evenly store the record data, thus avoiding the problem of service life reduction of the storage equipment caused by frequency data read and write operations.

Description

A kind of method for writing data that prolongs the data storage device life-span
Technical field
The present invention relates to field of computer technology, be meant a kind of method for writing data that prolongs the data storage device life-span especially.
Background technology
In safety-protection system, the general greatest problem that faces based on the video recording system of memory device is exactly the life-span of memory device.Because the number of times of writing of some memory device all is conditional, for example: the SD card is based on the FLASH structure, and it writes number of times is conditional, therefore has only the number of times of minimizing to the average write operation in each sector of memory device, could prolong the serviceable life of memory device.Universal document systems such as at present general video recording system employing FAT32 are stored the video recording data.For general file system, it is very inhomogeneous to each the regional access frequency in the memory device, and the number of times that its block of information is wiped free of and rewrites is just very frequent, causes storage short key factor in serviceable life and Here it is.And file system is absolutely necessary concerning storage system, solves the frequent rewriting to file system information area, and can make the preservation of can cutting off the power supply of these information, just becomes focus.
Summary of the invention
In view of this, the invention reside in provides a kind of method for writing data that prolongs the data storage device life-span, to solve in the process that above-mentioned video recording system writes the video recording data, because read-write zone is inhomogeneous, causes short problem of memory device life-span.
For addressing the above problem, the invention provides a kind of method for writing data that prolongs the data storage device life-span, comprising:
Each data block information corresponding unit in setting and the memory device on nonvolatile memory; Sequential loop is searched the data block that is used to write on the message unit of nonvolatile memory; According to the order of each message unit, the data of will recording a video are written in corresponding each data block in proper order.
Preferably, each data block information corresponding unit is in described setting and the memory device:
Set up the one-to-one relationship of each data block and message unit, whether expression institute corresponding data piece is set in each message unit is attribute empty, that have invalid video recording data or the effective video recording of existence data.
Preferably, described when looking for first, described looking for: the first unit of finding out described each message unit;
Described search or write the video recording data after, also comprise: the attribute of next message unit that will put down in writing last data block institute corresponding informance unit of the data of recording a video is changed to sky.
Preferably, described search non-first the time, described looking for: find out attribute and be empty message unit.
Preferably, after described the searching, also comprise before writing the video recording data:
The attribute that judgement will write the pairing message unit of each data block of video recording data if be valid data, then sends warning message to the user.
Preferably, comprise in the described data block:
Be used to play the video recording data directory and the video recording data of video recording data.
Preferably, described nonvolatile memory is Fram or EPROM, and described memory device is SD card or CF card.
Method of the present invention, sequential storage video recording data in each data block are evenly stored the video recording data, the problem that the memory device life-span of avoiding local read-write frequently to cause reduces in each data block; By the attribute of message unit, can easy-to-look-up empty data block, before writing the video recording data,, prevent the effectively problem of video recording data that covers by the judgement of attribute.
Description of drawings
Fig. 1 is the process flow diagram among the embodiment;
Fig. 2 is the structural drawing of message unit among the embodiment;
Fig. 3 is the structural drawing of data block among the embodiment.
Embodiment
For clearly demonstrating the scheme among the present invention, provide preferred embodiment below and be described with reference to the accompanying drawings.
Referring to Fig. 1, comprising:
Step 11: each data block information corresponding unit in setting and the memory device on nonvolatile memory;
The structure of message unit as shown in Figure 1, the block of information of the file system of storing in equipment is divided into several message units (cell), each unit has represented it corresponding to memory device, the situation that takies as the some data blocks in SD card or the CF card, if each unit is made up of n bit, the situation that takies of definition status identification data block and the size information of data block respectively.For example use the example of 2 bits as follows:
00: vacant
01: the video recording data that alerting signal is invalid
10: the alerting signal data of effectively recording a video
11: standby
Nonvolatile memory can use Fram or EPROM etc., and memory device can use memory devices such as hard disk, SD card, the block data structure on the memory device, and referring to Fig. 3,
The SD card is divided into several pieces, and the capacity of each piece is FRAMFS_BLOCKSIZE, the 1st superblock (super block) that piece is the data field wherein, and other piece is a file data blocks.
Each data block is corresponding one by one with each message unit, and data block comprises data field superblock and file data blocks,
Data field superblock: some essential informations that are used for register system
File data blocks: be used for record video recording data, its structure comprises video recording data directory and video recording data two parts.Video recording data directory: write down some attributes of this data block, convenient inquiry; Video recording data: write down concrete video file data.
If the size of data block is FRAMFS_BLOCK_SIZE, the index of video recording data is FRAMFS_INDEX_SIZE, and the big or small FRAMFS_DATA_SIZE of the data of recording a video so is:
FRAMFS_DATA_SIZE
=FRAMFS_BLOCK_SIZE-FRAMFS_INDEX_SIZE
Step 12: sequential loop is searched the data block that is used to write on the message unit of nonvolatile memory;
The actual capacity of file system can generate according to FRAM and SD card; If the message unit of file system information area size is cellinfosize bits, then the size in SD card respective file system information district: sd_size=(N+1) * cellinfosize (bits)
Wherein:
Capacity (the Bytes)/data block size of SD card data block total number TotalBlkcnt=SD card;
The file data blocks piece is counted N=TotalBlkcnt-1;
System is the actual capacity of sd_size and FRAM the most relatively, is as the criterion with wherein minimum value, and the size in the maximum information district that the system of obtaining takies: info_size, and obtain the actual capacity of file system:
(info_size/cellinfosize) * data block size (bytes)
When writing the video recording data to each data block of memory device, sequential loop is searched the data block that can be used for writing from each message unit earlier, owing to put down in writing the attribute information of each data block in each message unit, for example vacant or expired attribute informations such as invalid video recording data, write fashionable first, system can write the video recording data from the data block of first message unit correspondence, and after having write the video recording data, the attribute of the next message unit of last data block institute corresponding informance unit of record video recording data is changed to sky.
N (N>1) inferior write fashionable, system's order in each message unit is sought attribute and is empty message unit, size order according to the video recording data is selected the pairing data block of each message unit, and the attribute of next message unit that will be used to put down in writing last data block institute corresponding informance unit of video recording data is changed to sky.
Step 13: according to the order of each message unit, the data of will recording a video are written in each data block in proper order;
Obtained each block of information in step 12, according to the data block of each block of information correspondence, because message unit and data block all are sequential loop structures, so sequential loop writes the video recording data.
Certainly, can also write earlier the video recording data in data block, and after having write the video recording data, change is used to put down in writing the attribute of next message unit of last data block institute corresponding informance unit of data of recording a video again.
When reading of data, sequential search first attribute is empty message unit in each message unit earlier, and the pairing data block of this message unit is the data head of video recording data.If in PC, then must handle the video recording data according to passage, channel information is stored in the video recording data directory in each data block.
The method of embodiment also comprises: after searching, write before the video recording data, the attribute of the pairing message unit of each data block that judgement will write the video recording data if be valid data, then sends warning message to the user.As alerting signal or the prompting information that whether continues to write.
Describe in detail above and write the record a video process of data and the structure of file system, during for use this document system on PC equipment, have matching relationship between nonvolatile memory and the memory device, for example: have following matching relationship when FRAM and SD card coupling:
In Framfs (FRAM FILE SYSTEM) file system, because the SD card is movably, so the differentiation of the coupling in file system information area and file data district is absolutely necessary.Because FRAM is fixed on the pcb board card, so the coupling of FRAM and SD card can think the coupling of equipment and SD card, can pass through 2 grades of match patterns, that is: the pattern that combines of device id and matching identification;
Device id: a slice E2PROM is all arranged in every equipment, wherein write down the sequence number (device id) of every equipment.
Matching identification: when each formatted file system, system adds 1 with matching identification.Equipment is at every turn after formaing file system, device id can be write in the variable of the memory device ID in the superblock of SD card, from E2PROM, read coupling ID simultaneously, and add 1, then it is stored among the E2PROM respectively and the superblock of SD card in be used for the variable of memory device ID.Behind system boot, can whether be used for this equipment by the SD card of relatively judging to device id, whether the SD card of relatively judging by matching identification is the most recently used card, has so just accomplished the coupling of file system information area and data field.
FRAM and the unmatched processing of SD card: after start, system software will call the Mount function, in the Mount function, to compare FRAM and whether the SD card mates, if do not match, will return this state, equipment will be pointed out warning, finally, reach coupling by the mode (format is handled) of manual intervention.
In Framfs file system of the present invention, if use the system of unmanned plane interactive interface (GUI), need in equipment, not inquire about the video recording data, therefore, recording channel and time just become nonsensical in file system, and this just is equivalent to have only a file section in equipment.
When this document system is formatd, at first fileinfo in the nonvolatile memory is all emptied (promptly being labeled as vacant), be empty then with the data block attribute in the memory device, and fill in superblock.
Method of the present invention, sequential storage video recording data in each data block are evenly stored the video recording data, the problem that the memory device life-span of avoiding local read-write frequently to cause reduces in each data block; By the attribute of message unit, can easy-to-look-up empty data block, before writing the video recording data,, prevent the effectively problem of video recording data that covers by the judgement of attribute.
For the method for being set forth in the embodiment of the invention, within the spirit and principles in the present invention all, any modification of being done, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (7)

1. a method for writing data that prolongs the data storage device life-span is characterized in that, comprising:
Each data block information corresponding unit in setting and the memory device on nonvolatile memory; Sequential loop is searched the data block that is used to write on the message unit of nonvolatile memory; According to the order of each message unit, the data of will recording a video are written in corresponding each data block in proper order.
2. method for writing data according to claim 1 is characterized in that, each data block information corresponding unit is in described setting and the memory device:
Set up the one-to-one relationship of each data block and message unit, whether expression institute corresponding data piece is set in each message unit is attribute empty, that have invalid video recording data or the effective video recording of existence data.
3. method for writing data according to claim 2 is characterized in that, and is described when looking for first, described looking for: the first unit of finding out described each message unit;
Described search or write the video recording data after, also comprise: the attribute of next message unit that will put down in writing last data block institute corresponding informance unit of the data of recording a video is changed to sky.
4. method for writing data according to claim 3 is characterized in that, described search non-first the time, described looking for: find out attribute and be empty message unit.
5. method for writing data according to claim 4 is characterized in that, after described the searching, write video recording and also comprise before the data:
The attribute that judgement will write the pairing message unit of each data block of video recording data if be valid data, then sends warning message to the user.
6. method for writing data according to claim 1 is characterized in that, comprises in the described data block:
Be used to play the video recording data directory and the video recording data of video recording data.
7. method for writing data according to claim 1 is characterized in that, described nonvolatile memory is Fram or EPROM, and described memory device is SD card or CF card.
CN 200810179294 2008-12-16 2008-12-16 Data write method for improving service life of data storage equipment Active CN101751340B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 200810179294 CN101751340B (en) 2008-12-16 2008-12-16 Data write method for improving service life of data storage equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 200810179294 CN101751340B (en) 2008-12-16 2008-12-16 Data write method for improving service life of data storage equipment

Publications (2)

Publication Number Publication Date
CN101751340A true CN101751340A (en) 2010-06-23
CN101751340B CN101751340B (en) 2013-03-06

Family

ID=42478345

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 200810179294 Active CN101751340B (en) 2008-12-16 2008-12-16 Data write method for improving service life of data storage equipment

Country Status (1)

Country Link
CN (1) CN101751340B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104699412A (en) * 2013-12-09 2015-06-10 厦门雅迅网络股份有限公司 Method for balancing magnetic disc abrasion
CN105721839A (en) * 2016-04-27 2016-06-29 王正作 Efficient unmanned aerial vehicle video transmission method
CN103617008B (en) * 2013-12-11 2017-01-04 成都亿盟恒信科技有限公司 Double SD card multimedia file storage system of Vehicular video monitoring terminal and method
CN107329703A (en) * 2017-06-30 2017-11-07 武汉日新科技照明有限公司 Dynamic storage method, apparatus and system
CN107591179A (en) * 2017-09-11 2018-01-16 中国科学院上海微系统与信息技术研究所 A kind of circuit structure and method of extended menory number of operations

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1186728C (en) * 2001-07-03 2005-01-26 联想(北京)有限公司 Method for managing flash memory files
CN100389406C (en) * 2006-01-16 2008-05-21 深圳创维数字技术股份有限公司 Method for operating data in non-volatile storage in embedded system

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104699412A (en) * 2013-12-09 2015-06-10 厦门雅迅网络股份有限公司 Method for balancing magnetic disc abrasion
CN103617008B (en) * 2013-12-11 2017-01-04 成都亿盟恒信科技有限公司 Double SD card multimedia file storage system of Vehicular video monitoring terminal and method
CN105721839A (en) * 2016-04-27 2016-06-29 王正作 Efficient unmanned aerial vehicle video transmission method
CN107329703A (en) * 2017-06-30 2017-11-07 武汉日新科技照明有限公司 Dynamic storage method, apparatus and system
CN107591179A (en) * 2017-09-11 2018-01-16 中国科学院上海微系统与信息技术研究所 A kind of circuit structure and method of extended menory number of operations
CN107591179B (en) * 2017-09-11 2020-09-15 中国科学院上海微系统与信息技术研究所 Circuit structure and method for expanding operation times of memory

Also Published As

Publication number Publication date
CN101751340B (en) 2013-03-06

Similar Documents

Publication Publication Date Title
CN1307554C (en) Data recorder and method for recording data in flash memory
CN101014929B (en) Systems, methods and apparatus for memory management using NVRAM
US8161225B2 (en) Semiconductor memory card, access device and method
CN1307555C (en) Data storage device
CN101706822B (en) Method and device for improving speed of mounting journal file system
CN103024329B (en) A kind of memory management method of monitoring video
CN112486852B (en) Solid state disk and address mapping method thereof
EP1496437A1 (en) Data storing apparatus
CN101238431A (en) Mass data storage system
CN101751340B (en) Data write method for improving service life of data storage equipment
CN106844583B (en) Optimization method for establishing FAT file system on NOR Flash
CN102227729A (en) Storage device presenting to hosts only files compatible with defined host capability
CN101627373A (en) Memory device performance enhancement through pre-erase mechanism
CN102934094A (en) Hierarchical allocation for file system storage device
CN103257831A (en) Reading-writing control method of storage and corresponding storage
CN104346357A (en) File accessing method and system for embedded terminal
CN101916290B (en) Managing method of internal memory database and device
CN103226965B (en) Based on the audio/video data access method of time bitmap
CN107678981A (en) Data processing method and device
CN102298543A (en) Memory management method and memory management device
CN102243884B (en) Method for storing streaming media data and apparatus thereof
KR20010037155A (en) Flash file system
CN100578650C (en) Data processing method for novel intelligent tape unit
CN109407971A (en) The method and device of staging disk lock
CN100543748C (en) A kind of method and system of utilizing file allocation table to carry out the file tracking

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
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: Data write method for improving service life of data storage equipment

Effective date of registration: 20140318

Granted publication date: 20130306

Pledgee: Shenzhen SME credit financing guarantee Group Co., Ltd.

Pledgor: Shenzhen Streaming Video Technology Co., Ltd.

Registration number: 2014990000174

PLDC Enforcement, change and cancellation of contracts on pledge of patent right or utility model
PC01 Cancellation of the registration of the contract for pledge of patent right

Date of cancellation: 20150528

Granted publication date: 20130306

Pledgee: Shenzhen SME credit financing guarantee Group Co., Ltd.

Pledgor: Shenzhen Streaming Video Technology Co., Ltd.

Registration number: 2014990000174

PLDC Enforcement, change and cancellation of contracts on pledge of patent right or utility model
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: Data write method for improving service life of data storage equipment

Effective date of registration: 20150603

Granted publication date: 20130306

Pledgee: Shenzhen SME financing Company limited by guarantee

Pledgor: Shenzhen Streaming Video Technology Co., Ltd.

Registration number: 2015990000430

PLDC Enforcement, change and cancellation of contracts on pledge of patent right or utility model
C56 Change in the name or address of the patentee

Owner name: SHENZHEN STREAMAX TECHNOLOGY CO., LTD.

Free format text: FORMER NAME: SHENZHEN RUIMING TECHNOLOGY CO., LTD.

CP03 Change of name, title or address

Address after: Nanshan District Xueyuan Road in Shenzhen city of Guangdong province 518000 No. 1001 Nanshan Chi Park building B1 building 21-23

Patentee after: STREAMAX TECHNOLOGY CO., LTD.

Address before: 518057, No. 5, building three, two software park, central science and technology zone, Nanshan District hi tech Zone, Guangdong, Shenzhen

Patentee before: Shenzhen Streaming Video Technology Co., Ltd.

PC01 Cancellation of the registration of the contract for pledge of patent right

Date of cancellation: 20160718

Granted publication date: 20130306

Pledgee: Shenzhen SME financing Company limited by guarantee

Pledgor: STREAMAX TECHNOLOGY CO., LTD.

Registration number: 2015990000430

PLDC Enforcement, change and cancellation of contracts on pledge of patent right or utility model
PM01 Change of the registration of the contract for pledge of patent right

Change date: 20160718

Registration number: 2015990000430

Pledgor after: STREAMAX TECHNOLOGY CO., LTD.

Pledgor before: Shenzhen Streaming Video Technology Co., Ltd.