CN101751340B - 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
CN101751340B
CN101751340B CN 200810179294 CN200810179294A CN101751340B CN 101751340 B CN101751340 B CN 101751340B CN 200810179294 CN200810179294 CN 200810179294 CN 200810179294 A CN200810179294 A CN 200810179294A CN 101751340 B CN101751340 B CN 101751340B
Authority
CN
China
Prior art keywords
data
video recording
message unit
writing
data block
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
CN 200810179294
Other languages
Chinese (zh)
Other versions
CN101751340A (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

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, refer to especially a kind of method for writing data that prolongs the data storage device life-span.
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 only has the number of times that reduces the average write operation in each sector of memory device, could prolong the serviceable life of memory device.The 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 short key factor in storage 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, writes to solve above-mentioned video recording system in the process of video recording data, because the 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:
At nonvolatile memory the message unit corresponding with each data block in the memory device is set; Sequential loop is searched be used to the data block that writes on the message unit of nonvolatile memory; According to the order of each message unit, the video recording data sequentially are written in each corresponding data block.
Preferably, the described setting message unit corresponding with each data block in the memory device is:
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 set 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 corresponding 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 for playing 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, by the judgement of attribute, prevent the effectively problem of video recording data that covers.
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, the below provides preferred embodiment and is described with reference to the accompanying drawings.
Referring to Fig. 1, comprising:
Step 11: the message unit corresponding with each data block in the memory device is set at 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 such as the some data blocks in SD card or the CF card, if each unit is comprised of n bit, the respectively situation that takies of definition status identification data block and the size information of data block.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: for subsequent use
Nonvolatile memory can use Fram or EPROM etc., and memory device can use the 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_BLOCK_SIZE, the 1st superblock (super block) that piece is the data field wherein, and other piece is 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: record some attributes of this data block, convenient inquiry; Video recording data: record concrete video file data.
If the data block size 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 be used to the data block that writes 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:
The capacity (Bytes) of SD card data block total number TotalBlkcnt=SD card/data block size;
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 first, owing to having put down in writing the attribute information of each data block in each message unit, such as the vacant or expired attribute informations such as invalid video recording data, write first fashionable, system can write the video recording data from data block corresponding to first message unit, and after writing 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 set 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 corresponding data block of each message unit, and will be used for the record a video attribute of next message unit of last data block institute corresponding informance unit of data of record and be set to sky.
Step 13: according to the order of each message unit, the data of will recording a video sequentially are written in each data block;
Obtained each block of information in step 12, according to data block corresponding to each block of information, because message unit and data block all are sequential loop structures, so sequential loop writes the video recording data.
Certainly, can also in data block, write the video recording data first, and after writing the video recording data, change is for the attribute of the next message unit of last data block institute corresponding informance unit of record video recording data again.
When reading out data, sequential search the first attribute is empty message unit in each message unit first, and the corresponding data block of this message unit is the data head of video recording data.If in PC, then must process 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 corresponding 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.Such as alerting signal or the prompting information that whether continues to write.
The above describes in detail and writes the record a video process of data and the structure of file system, for when PC equipment uses this document system, has 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 arranged in every equipment, wherein recorded 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 simultaneously coupling ID, and add 1, then it is stored in respectively among the E2PROM 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, by matching identification relatively judge whether most recently used card of SD card, 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 mate, will return this state, equipment will be pointed out warning, finally by the mode (format is processed) of manual intervention, reach coupling.
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 only have a file section in equipment.
When this document system is formatd, at first nonvolatile memory File information is all emptied (namely being labeled as vacant), then be empty 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, by the judgement of attribute, prevent the effectively problem of video recording data that covers.
For the method for setting forth in the embodiment of the invention, within the spirit and principles in the present invention all, any modification of doing, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (5)

1. a method for writing data that prolongs the data storage device life-span is characterized in that, comprising:
At nonvolatile memory the message unit corresponding with each data block in the memory device is set, comprise in the wherein said message unit whether expression institute corresponding data piece is attribute empty, that have invalid video recording data or the effective video recording of existence data, wherein, described when looking for first, described looking for: the first unit of finding out described each message unit, described search non-first the time, described looking for: find out attribute and be empty message unit; Sequential loop is searched be used to the data block that writes on the message unit of nonvolatile memory; According to the order of each message unit, the video recording data sequentially are written in each corresponding data block.
2. method for writing data according to claim 1 is characterized in that,
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 set to sky.
3. method for writing data according to claim 1 is characterized in that, after described the searching, write video recording and also comprise before the data:
The attribute that judgement will write the corresponding message unit of each data block of video recording data if be valid data, then sends warning message to the user.
4. method for writing data according to claim 1 is characterized in that, comprises in the described data block:
Be used for playing video recording data directory and the video recording data of video recording data.
5. 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 CN101751340A (en) 2010-06-23
CN101751340B true 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)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104699412B (en) * 2013-12-09 2019-01-01 厦门雅迅网络股份有限公司 A kind of disk deterioration balance method
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
CN107329703B (en) * 2017-06-30 2020-12-04 武汉日新科技照明有限公司 Dynamic storage method, device and system
CN107591179B (en) * 2017-09-11 2020-09-15 中国科学院上海微系统与信息技术研究所 Circuit structure and method for expanding operation times of memory

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1393781A (en) * 2001-07-03 2003-01-29 联想(北京)有限公司 Method for managing flash memory files
CN1821978A (en) * 2006-01-16 2006-08-23 深圳创维-Rgb电子有限公司 Method for operating data in non-volatile storage in embedded system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1393781A (en) * 2001-07-03 2003-01-29 联想(北京)有限公司 Method for managing flash memory files
CN1821978A (en) * 2006-01-16 2006-08-23 深圳创维-Rgb电子有限公司 Method for operating data in non-volatile storage in embedded system

Also Published As

Publication number Publication date
CN101751340A (en) 2010-06-23

Similar Documents

Publication Publication Date Title
CN1307554C (en) Data recorder and method for recording data in flash memory
US8161225B2 (en) Semiconductor memory card, access device and method
CN101014929B (en) Systems, methods and apparatus for memory management using NVRAM
CN1734624B (en) System and method for optical media information storage life tracking
CN101706822B (en) Method and device for improving speed of mounting journal file system
CN101751340B (en) Data write method for improving service life of data storage equipment
CN101238431A (en) Mass data storage system
US20030076764A1 (en) File control method
CN102171663A (en) Managing storage of cached content
KR20070104874A (en) Storage device
CN103226965B (en) Based on the audio/video data access method of time bitmap
CN104346357A (en) File accessing method and system for embedded terminal
CN109496292B (en) Disk management method, disk management device and electronic equipment
CN101872639B (en) Method and device for storing and retrieving image data on digital hard disk video recorder
CN104699416A (en) Data storage system and data storage method
KR100703680B1 (en) Flash file system
CN102243884B (en) Method for storing streaming media data and apparatus thereof
CN110673800A (en) Data operation method, device and equipment of file system and readable storage medium
CN102508855A (en) Method and device for quickly clearing data in storage medium
CN100543748C (en) A kind of method and system of utilizing file allocation table to carry out the file tracking
WO2008136563A1 (en) Method of storing meta-data and system for storing meta-data
CN111124303A (en) Data storage method, device and system
CN101241469B (en) Method and device for storing and reading data in embedded system
US7120766B2 (en) Apparatus and method to initialize information disposed in an information storage and retrieval system
US8595426B2 (en) Handling commands within a write-once read-many storage device configuration

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.