CN103425546A - General high-efficient reliable Nor Flash data memory management method - Google Patents

General high-efficient reliable Nor Flash data memory management method Download PDF

Info

Publication number
CN103425546A
CN103425546A CN2013103527341A CN201310352734A CN103425546A CN 103425546 A CN103425546 A CN 103425546A CN 2013103527341 A CN2013103527341 A CN 2013103527341A CN 201310352734 A CN201310352734 A CN 201310352734A CN 103425546 A CN103425546 A CN 103425546A
Authority
CN
China
Prior art keywords
mdr
data
file
storage
flash
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN2013103527341A
Other languages
Chinese (zh)
Inventor
蒋长献
陆寒熹
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NANJING LINYANG ELECTRIC POWER TECHNOLOGY CO LTD
JIANGSU LINYANG ELECTRONICS CO Ltd
Original Assignee
NANJING LINYANG ELECTRIC POWER TECHNOLOGY CO LTD
JIANGSU LINYANG ELECTRONICS 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 NANJING LINYANG ELECTRIC POWER TECHNOLOGY CO LTD, JIANGSU LINYANG ELECTRONICS CO Ltd filed Critical NANJING LINYANG ELECTRIC POWER TECHNOLOGY CO LTD
Priority to CN2013103527341A priority Critical patent/CN103425546A/en
Publication of CN103425546A publication Critical patent/CN103425546A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention relates to a general high-efficient reliable Nor Flash data memory management method, which is used for data memory management of various embedded devices using Nor Flash as a data memory medium. The Nor Flash is divided into two areas, namely a memory management area and a user data area. User data is described in the form of files, management information related to the files is stored in an MDR (Memory Data Register) form of the memory management area, and user data content is stored in the user data area. The MDR form of the memory management area adopts a double-backup structure with CRC (Cyclic Redundancy Check), and the information of each user file in the MDR form has independent CRC. The user data file memory adopts a sliding memory management mode, and rollback times can be set. When data is corrupted, the data can be rolled back to the last correct content. The high efficiency and the high reliability of operation of each file are ensured, the data can also uniformly utilize space, and therefore the service life of the Nor Flash is furthest prolonged.

Description

The Nor Flash data storage and management method that a kind of Universal efficient is highly reliable
Technical field
The present invention relates to use Nor Flash as a kind of Universal efficient of data storage medium, highly reliable data storage and management method.
Background technology
At present, along with the development of electronic technology, embedded system is being controlled the electronic product widespread uses such as class, consumer, communication class more and more, and embedded technology is also more and more combined closely with people's life.The Flash storer is a kind of non-volatile solid state memory, and it is complete nonvolatile memory, and reliable data cut-off protection can be provided; And it can write online, access speed is fast, is a kind of high reliability, highdensity solid storage device, current, and various Flash storeies become topmost memory device in embedded system gradually.
Very high to data storage security and reliability requirement, on the exigent embedded device in the aspects such as cost and power consumption, Nor Flash has a wide range of applications simultaneously.Randomness due to the distribution of bad piece of Nand Flash, and the uncertainty of bad piece and instability make it use the support that must introduce file system, but file system need to take many system resources space, in cost, power consumption, field that reliability requirement is higher, the introducing of file system will cause the sharply increase of cost.
Nor Flash only has erasing and writing life 100,000 times, when using Nor Flash as storage medium, how to guarantee reliability and the erasing and writing life of data, normally used method, the characteristics for data to be stored, design, avoid frequent erasable the same area targetedly, causes because of the life problems loss of data, in addition, be aided with polylith Flash chip and backup each other, prevent from causing loss of data because of system exception in erasable process.This method does not possess reusability, and cost is relatively high simultaneously.Each new equipment all needs to redesign storage scheme, and new design each time all can bring new unreliable factor, need to again accumulate operating experience, for exploitation, the maintenance of embedded device, need to pay extra fringe cost.
Summary of the invention
The objective of the invention is when adopting Nor Flash as storage medium in embedded device, the problem that the data storage management cost is high, do not possess reusability, propose the highly reliable Nor Flash data storage and management method of a kind of Universal efficient.
Technical scheme of the present invention is:
The Nor Flash data storage and management method that a kind of Universal efficient is highly reliable, it is divided into the Liang Ge district by Nor Flash, comprise storage administration district and user data area, set up the MDR table in described storage administration district, user data is described in the mode of file, the management information that file is relevant is stored in storage administration district MDR table, and user data content is stored in user data area.
The MDR table in storage administration of the present invention district adopts the double copies structure with CRC check, and in the MDR table, each user file information has independent CRC check, if one of them MDR shows all or part of corrupted data, can repair by other MDR table.
In user data area of the present invention, for each user data content, adopt slip storage administration mode, set up continuous subscriber data file storage space, according to sliding window size, the circulation storage, while each time the renewal of data content being preserved, all will select next slip address to be preserved, when the subscriber data file storage space is used completely, be circulated to first address and preserved, preserved to next one slip address successively.
In the present invention, when the user creates a data file, will in the MDR table, increase a file record, the CRC check of content include file name, file size, creation-time, data storage start address and file record; When the user deletes a data file, corresponding file record in the MDR table will be deleted; While upgrading the MDR table, first upgrade main MDR table, then upgrade backup MDR table.
In the present invention, when the user data area content is damaged, will roll back to the last correct content, the rollback number of times can be set.
Beneficial effect of the present invention:
Method of the present invention has reusability, has reduced exploitation, the maintenance cost of new product; Simultaneously, take into account efficient, high reliability, the erasable equilibrium of flash, there is very high application and popularization value.
The memory management method that the present invention proposes, to the establishment of data file, delete, open, the reading and writing operation, method is simple, execution efficiency is high, user interface part only consists of these five operations, simple, easy-to-use.This method has taken into full account in system and has occurred that the data under any abnormal conditions recover (reparation) automatically, has fully represented efficient, highly reliable characteristics.Simultaneously, this memory management method has deeply abstraction, irrelevant with concrete application, is a kind of general data storage and management method, goes for different embedded device field of data storage, has very high practicality and promotional value.
 
The accompanying drawing explanation
Fig. 1 is storage administration structural representation of the present invention.
Fig. 2 is data file visioning procedure figure of the present invention.
Fig. 3 is that data file of the present invention is opened process flow diagram.
Fig. 4 is that data file of the present invention is read process flow diagram.
Fig. 5 is that data file of the present invention is write process flow diagram.
Fig. 6 is that data file of the present invention is deleted process flow diagram.
 
Embodiment
Below in conjunction with drawings and Examples, the present invention is further illustrated.
As shown in Fig. 1-6, a kind of general Nor Flash data storage and management method, the method does not rely on concrete application scenario, can adapt to different embedded devices, the storage demand of different data format, possesses reusability.
This memory management method, be divided into the Liang Ge district by Nor Flash, storage administration district and user data area.User's data are described in the mode of file, and different data sets, describe with different files.Each file is identified by unique filename.The management information that file is relevant, be stored in " storage administration district ", and file content is stored in " user data area ".
" storage administration district " consists of the active and standby two parts MDR tables that carry CRC check, and the MDR table consists of all user file information recordings, and the MDR table carries CRC check, and each file record has independent CRC check; If any one MDR table damages, will show by other MDR to repair the MDR table of damage.If the MDR table is normal, only certain file record damages, and can repair the file record of current damage by corresponding record in other MDR table equally.The CRC algorithm adopts CRC16-CCITT, and generator polynomial is x16+x12+x5+1.
When the user creates or deletes a file, will upgrade the MDR table in storage administration district, the renewal operation of user to the data file, do not relate to and upgrade the MDR table.When the user creates a data file, a file information recording will be added in the MDR table, and this document information recording comprises: the CRC check code of filename, file size, storage space start address, creation-time and this record; When deleting a file, will from the MDR table, delete the fileinfo record of corresponding this filename; To the renewal operation of MDR table, first upgrade main MDR table, then upgrade backup MDR table.
The content of subscriber data file, be stored in the user data area of Nor Flash.When creating this document, according to MDR table content, distribute to storage space start address of current file.The storage of user data content, adopt slip storage administration mode, according to sliding window size, and the circulation storage.While each time the renewal of data content being preserved, all will select next slip address to be preserved.Make the erasable probability equilibrium in each sector of flash, extended to greatest extent the serviceable life of flash.
The content territory of data file, be comprised of file header and data, and file header is partly for the final updating time of storing current content, the CRC check that adds up update times, file content.When each up-to-date is preserved, the change final updating time, the accumulative total update times adds 1, recalculates the CRC check of file content, according to upgrading the cumulative number calculating memory addresses, carries out the Flash write operation, preserves file.The memory address computing method:
Address=file storage start address+(the sliding window size that accumulative total update times % slides and stores) * file size.
During user's read data files, by filename, obtain the storage space start address from the MDR table, according to the sliding window size of the storage of sliding, read successively the file header of each slip memory point, find out the effectively record of (CRC check is correct) up-to-date (accumulative total update times maximum).If certain measuring point is damaged, auto back is rolled into to the last correct content, according to accumulative total update times inverted order, read successively, until find a up-to-date effective document record, the worst situation of subscriber data file is to lose certain content of once upgrading, and can not cause the All Files content all to be lost, the sliding window size of storage but the rollback number of times slides, can need to be set according to application.
The read-write operation of content data file, do not need extra addressing algorithm, is direct address, and read operation, according to the given off-set value of user, is directly read; Write operation, all standing of first level address is erasable, and memory usage is extremely low and efficiency is higher.
Embodiment mono-:
Nor Flash is divided into to the Liang Ge district, storage administration district and user data area, front four sectors are the storage administration district, remaining space is as user data area.The storage administration district comprises active and standby two parts of MDR table, and main MDR epi-position is in first, second sector, and backup MDR epi-position is in the 3rd, the 4th sector.512 bytes between every sector null.
The MDR table consists of gauge outfit and fileinfo record, and gauge outfit is fixed as 32 bytes, and gauge outfit comprises: file record number, whole MDR show CRC check; Every the file recorded information comprises: filename, file size, creation-time, storage start address, CRC check, the length of file record information is fixed as 26 bytes.
When the user creates a new data file, retrieve main MDR table, if (main MDR table damages, retrieval backup MDR table, if backup MDR table is normal, now will backs up MDR table content and be covered to main MDR table, repair the main MDR table damaged), apply for space size according to the user, obtain a storage start address, upgrade active and standby MDR table simultaneously.
When the user needs the reading and writing content data file, the filename at first provided according to the user, retrieval MDR table, find corresponding fileinfo record; The start address of storage from the fileinfo record, according to the sliding window size of the storage of sliding (in the present embodiment, sliding window size gets 5), read successively the file header of each memory point, find out up-to-date data recording, if latest document content CRC check mistake, rollback automatically, continue to find time new record file, until the file content CRC check found is correct, take this file as up-to-date benchmark, and the underproof file record of CRC check will be dropped, but maximum rollback number of times is 5.After file content is revised, carry out while preserving operation, the final updating time in the updating file head, accumulative total update times add 1, recalculate CRC check, and then calculating memory addresses, carry out the Flash write operation, completes file content and preserve.
When the user deletes a file operation, retrieval MDR table, find corresponding record, from the MDR table, deletes this record, upgrades MDR gauge outfit (file record number, CRC check), first upgrades main MDR table, and then upgrade backup MDR table.
The part that the present invention does not relate to all prior art that maybe can adopt same as the prior art is realized.

Claims (5)

1. the Nor Flash data storage and management method that Universal efficient is highly reliable, it is characterized in that it is divided into the Liang Ge district by Nor Flash, comprise storage administration district and user data area, set up the MDR table in described storage administration district, user data is described in the mode of file, the management information that file is relevant is stored in storage administration district MDR table, and user data content is stored in user data area.
2. the highly reliable Nor Flash data storage and management method of Universal efficient according to claim 1, the MDR table that it is characterized in that the storage administration district adopts the double copies structure with CRC check, in the MDR table, each user file information has independent CRC check, if one of them MDR shows all or part of corrupted data, can repair by other MDR table.
3. the highly reliable Nor Flash data storage and management method of Universal efficient according to claim 1, it is characterized in that in user data area, for each user data content, adopt slip storage administration mode, set up continuous subscriber data file storage space, according to sliding window size, the circulation storage, while each time the renewal of data content being preserved, all will select next slip address to be preserved, when the subscriber data file storage space is used completely, be circulated to first address and preserved, to next one slip address, preserved successively.
4. the highly reliable Nor Flash data storage and management method according to the described Universal efficient of one of claim 1-3, it is characterized in that when the user creates a data file, will in the MDR table, increase a file record, the CRC check of content include file name, file size, creation-time, data storage start address and file record; When the user deletes a data file, corresponding file record in the MDR table will be deleted; While upgrading the MDR table, first upgrade main MDR table, then upgrade backup MDR table.
5. the highly reliable Nor Flash data storage and management method of Universal efficient according to claim 1 is characterized in that: when the user data area content is damaged, will roll back to the last correct content, the rollback number of times can be set.
CN2013103527341A 2013-08-14 2013-08-14 General high-efficient reliable Nor Flash data memory management method Pending CN103425546A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2013103527341A CN103425546A (en) 2013-08-14 2013-08-14 General high-efficient reliable Nor Flash data memory management method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2013103527341A CN103425546A (en) 2013-08-14 2013-08-14 General high-efficient reliable Nor Flash data memory management method

Publications (1)

Publication Number Publication Date
CN103425546A true CN103425546A (en) 2013-12-04

Family

ID=49650333

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2013103527341A Pending CN103425546A (en) 2013-08-14 2013-08-14 General high-efficient reliable Nor Flash data memory management method

Country Status (1)

Country Link
CN (1) CN103425546A (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
CN107908364A (en) * 2017-11-13 2018-04-13 中国电子科技集团公司第三十研究所 A kind of embedded file system based on norflash
CN112269549A (en) * 2020-11-20 2021-01-26 石家庄科林电气股份有限公司 Flash memory management method of light embedded system
CN113220234A (en) * 2021-05-17 2021-08-06 南京林洋电力科技有限公司 Terminal data storage management method and manager
CN114721602A (en) * 2022-06-09 2022-07-08 泉州华中科技大学智能制造研究院 Nor Flash rolling storage method and device based on FreeRTOS

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101140586A (en) * 2007-09-30 2008-03-12 浙江大学 Method for building file systems on NAND flash memory in embedded system
US20080082727A1 (en) * 2006-09-29 2008-04-03 Wang Hongyu Jeffrey Header blocks for flash memory writes
CN101477534A (en) * 2008-12-24 2009-07-08 北京中星微电子有限公司 File management method and apparatus for implementing balance abrasion of flash memory
CN101609464A (en) * 2009-06-22 2009-12-23 浙江大学 The balanced erase implementation method that is fit to embedded Flash file system
CN101650680A (en) * 2009-07-27 2010-02-17 浪潮电子信息产业股份有限公司 Continuous data protection method based on continuous snapshots
CN102081577A (en) * 2011-01-12 2011-06-01 厦门雅迅网络股份有限公司 Data storage structure of Flash memory and data manipulation mode thereof

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080082727A1 (en) * 2006-09-29 2008-04-03 Wang Hongyu Jeffrey Header blocks for flash memory writes
CN101140586A (en) * 2007-09-30 2008-03-12 浙江大学 Method for building file systems on NAND flash memory in embedded system
CN101477534A (en) * 2008-12-24 2009-07-08 北京中星微电子有限公司 File management method and apparatus for implementing balance abrasion of flash memory
CN101609464A (en) * 2009-06-22 2009-12-23 浙江大学 The balanced erase implementation method that is fit to embedded Flash file system
CN101650680A (en) * 2009-07-27 2010-02-17 浪潮电子信息产业股份有限公司 Continuous data protection method based on continuous snapshots
CN102081577A (en) * 2011-01-12 2011-06-01 厦门雅迅网络股份有限公司 Data storage structure of Flash memory and data manipulation mode thereof

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
王健: "基于NAND Flash的嵌入式文件系统的设计与实现", 《中国优秀硕士学位论文全文数据库(信息科技辑)》 *

Cited By (8)

* 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
CN107908364A (en) * 2017-11-13 2018-04-13 中国电子科技集团公司第三十研究所 A kind of embedded file system based on norflash
CN107908364B (en) * 2017-11-13 2020-10-23 中国电子科技集团公司第三十研究所 Embedded file system based on norflash
CN112269549A (en) * 2020-11-20 2021-01-26 石家庄科林电气股份有限公司 Flash memory management method of light embedded system
CN113220234A (en) * 2021-05-17 2021-08-06 南京林洋电力科技有限公司 Terminal data storage management method and manager
CN113220234B (en) * 2021-05-17 2022-10-21 南京林洋电力科技有限公司 Terminal data storage management method and manager
CN114721602A (en) * 2022-06-09 2022-07-08 泉州华中科技大学智能制造研究院 Nor Flash rolling storage method and device based on FreeRTOS
CN114721602B (en) * 2022-06-09 2022-08-23 泉州华中科技大学智能制造研究院 Nor Flash rolling storage method and device based on FreeRTOS

Similar Documents

Publication Publication Date Title
CN106407050B (en) Data storage method
US9817588B2 (en) Memory device and operating method of same
US9547589B2 (en) Endurance translation layer (ETL) and diversion of temp files for reduced flash wear of a super-endurance solid-state drive
US8959280B2 (en) Super-endurance solid-state drive with endurance translation layer (ETL) and diversion of temp files for reduced flash wear
JP5675954B2 (en) Detection of irregular parity distribution via metadata tag
TWI467376B (en) Data protecting method, and memory controll and memory storage device using the same
US7657701B2 (en) System and method of flash memory wear leveling using distributed write cycles
US20150186224A1 (en) Data storage device and flash memory control method
CN101494085B (en) Prevent nonvolatile memory from method and the controller thereof of interference occurring to read
CN106462493B (en) The mitigation of solid-state memory damage
CN102157202B (en) Method and controller for preventing nonvolatile memory from occurring read interference
CN101782875B (en) Storage unit and data storage method
US20140281315A1 (en) Mass storage device and method of operating the same to back up data stored in volatile memory
TW201403318A (en) Super-endurance solid-state drive with endurance translation layer and diversion of temp files for reduced flash wear
CN102081577A (en) Data storage structure of Flash memory and data manipulation mode thereof
CN103425546A (en) General high-efficient reliable Nor Flash data memory management method
CN104765568A (en) Data storing method, storage control circuit unit and a storage storing device
US9424131B2 (en) Spatially decoupled redundancy schemes for a solid state drive (SSD)
CN104317671A (en) Power-down data storage and recovery algorithm prolonging service life of non-volatile memory
CN103377143A (en) Memorizer management method, memorizer controller and memorizer memory device
CN105468544A (en) Method and apparatus for realizing power-failure-proof file system, and power-failure-proof file system
JP2010079485A (en) Semiconductor recording device
US20150339066A1 (en) Non-volatile complement data cache
CN103176920A (en) Nor flash power down protection method and Nor flash power down protection device
CN102789813B (en) Method and device for controlling use of non-least significant bit page in storage 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
CB02 Change of applicant information

Address after: Qidong City, Jiangsu province 226200 Nantong City Lin Yang Lu No. 666

Applicant after: JIANGSU LINYANG ENERGY CO., LTD.

Applicant after: Nanjing Linyang Electric Power Technology Co.,Ltd.

Address before: 210019, the 2 floor of Metro Science Park, No. 69 Olympic Sports Avenue, Jianye District, Jiangsu, Nanjing Province, China, 5

Applicant before: Jiangsu Linyang Electronics Co., Ltd.

Applicant before: Nanjing Linyang Electric Power Technology Co.,Ltd.

COR Change of bibliographic data
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20131204