CN101887750A - Method for storing dynamic data by using Flash memory - Google Patents

Method for storing dynamic data by using Flash memory Download PDF

Info

Publication number
CN101887750A
CN101887750A CN2009101069785A CN200910106978A CN101887750A CN 101887750 A CN101887750 A CN 101887750A CN 2009101069785 A CN2009101069785 A CN 2009101069785A CN 200910106978 A CN200910106978 A CN 200910106978A CN 101887750 A CN101887750 A CN 101887750A
Authority
CN
China
Prior art keywords
district
data storage
dynamic data
flash
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.)
Pending
Application number
CN2009101069785A
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.)
Konka Group Co Ltd
Original Assignee
Konka Group 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 Konka Group Co Ltd filed Critical Konka Group Co Ltd
Priority to CN2009101069785A priority Critical patent/CN101887750A/en
Publication of CN101887750A publication Critical patent/CN101887750A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention discloses a method for storing dynamic data by using a Flash memory, which comprises the following steps of: setting at least one block of the Flash memory as a dynamic data storing area; and dividing the dynamic data storing area into a basic information area and a daily record area, wherein the basic information area is used for storing the data before being modified; the daily record area is used for recording a data modification operation log; and the operation log records the modification information of the data content. The method can prolong the service life of the Flash memory and improve the working stability and the safety of the Flash memory.

Description

A kind of Flash of utilization storer carries out the method for dynamic data storage
Technical field
The present invention relates to a kind of date storage method, particularly relate to the method that a kind of Flash of utilization storer carries out dynamic data storage.
Background technology
Information-storing device when Flash and E2PROM are the most frequently used outage of embedded device.Because driving circuit is simple, employed Flash is NOR type Flash basically in embedded system.NOR Flash has the advantage of capacity big (2M-64M), lack (erasable 100,000 times), erasable speed (the about 2s/64K of erasable speed) and will write data and shortcoming such as must wipe earlier slowly serviceable life but also exist.And E2PROM has long service life (erasable 1,000,000 times), the advantage of erasable speed fast (a few tens of milliseconds rank), but capacity less (several K are to tens K) is arranged, the unit capacity price higher shortcoming that compares.
Because Flash and E2PROM physical characteristics have very big-difference, both employed fields are different, and Flash generally is used for program code stored and does not need frequently to wipe data updated (as system's basic configuration information etc.); E2PROM then is used for storing the dynamic data that need frequently wipe, each status information of program when at every turn operating as recording user.In order to simplify circuit design, reduce hardware cost in embedded system, Flash commonly used substitutes E2PROM and stores dynamic data.
When prior art was stored dynamic data with alternative E2PROM, method commonly used was as follows:
From certain block (Block) of Flash, open up a space (being generally 4-16K) and do the dynamic data storage district, and set up the memory mapping of the internal memory of corresponding size as the dynamic data storage district;
In the device initialize process data in dynamic data storage district are read in the memory mapping;
Set up a background task and carry out the wiping and the write operation in dynamic data storage district.
When need are revised certain location conten in dynamic data storage district with operation, revise the content of relevant position in the memory mapping earlier; Initiating a message allows background task that the Flash district data at place, dynamic data storage district are all wiped again, and again full content in the memory mapping is written to the dynamic data storage district again;
When needs were read the data in dynamic data storage district, directly rdma read reflection relevant position data just could.
Utilize the backstage erasable, the relatively good operating speed problem that has solved when the alternative E2PROM of Flash stores dynamic data of prior art.
Yet prior art has following defective:
1. greatly reduce the serviceable life of Flash.Will be certain bit " 1 " be rewritten as " 0 " time can directly write, but will be certain bit " 0 " be rewritten as " 1 " just must carry out wiping earlier the operation of writing again, and Flash to wipe with block (block) be unit, the life-span of Flash also is to depend on erasing times.The frequent Flash that carries out wipes, and obviously greatly reduces the serviceable life of equipment.
2. greatly reduce equipment work stability and security.Write owing to when the information of modification, must wipe again earlier, and erase process is topmost time-consuming process, has accounted for 95% left and right sides time of whole information correction process.The Block that wipes a 64K needs about 1.5 seconds, and the Block that writes a 64K is less than 50 milliseconds.If sudden power in revising information process like this, very big may be exactly also to be in the erase process, and the information of outage back memory mapping is all lost, in Flash also because erase process has been lost full detail.Cause the information dropout in all dynamic data storage districts like this and can't recover, made setting can't normally carry out work.In addition, carry out because the erase process of Flash needs CPU to send a large amount of corresponding driving sequential, frequent erase process has taken cpu resource greatly and then may influence other system works, has reduced the operational efficiency and the security of total system.
Summary of the invention
The purpose of this invention is to provide the method that a kind of Flash of utilization storer carries out dynamic data storage, it can improve Flash storer serviceable life, job stability and security.
For solving technical matters of the present invention, the present invention discloses the method that a kind of Flash of utilization storer carries out dynamic data storage, its at least one block with described Flash storer is made as the dynamic data storage district, described dynamic data storage zoning is divided into a Back ground Information district and a log record district, described Back ground Information district is used to store revises preceding data to data, described log record district is used to write down the retouching operation that data are carried out, described operation log recording to the modification information of data content.
As a kind of improvement of said method, described Flash memory block is provided with two dynamic data storage districts, and described two dynamic data storage districts are mirror image each other.
Compared to prior art, method of the present invention repeatedly writes by once wiping, and makes can to carry out hundreds and thousands of times write operations, the serviceable life of having improved Flash greatly after wiping once; And when revising information, only need write, speed is fast, has reduced the occupancy of CPU, has improved the total system performance; at every turn Simultaneously, the way that has adopted two dynamic data storage district to set up data image realizes recovering the function of the data of losing because of outage, has improved the data security in the process of reconstruction.
Description of drawings
Fig. 1 is the process flow diagram that system boot is set up Back ground Information district and Data Detection recovery.
Fig. 2 is a process flow diagram of setting up Back ground Information district and log record district.
Fig. 3 is the program flow diagram that the dynamic data storage district is revised by system.
Embodiment
Analyze the Flash principle of work as can be known, actual to the block erase process be a process that these all contents of Block storage space is changed to " 1 ".Wipe finish after all positions all be " 1 ", at this moment can internal memory is direct to be changed to " 0 " to the optional position content as operating; In actual applications, the size of a block of Flash is generally 64K, and the required size that is used for storing the space of dynamic data generally is no more than 32K; The size of the each data content that need revise is several to dozens of bytes just.So just can note each retouching operation as keeping a diary the content that just needs modification of each record.
Among the present invention, utilize Flash to substitute the method that E2PROM (suppose size for 32K) carries out dynamic data storage to be: determine earlier among the Flash that block that 2 sizes are 64K is respectively initiatively the attitude data storage area and from dynamic data storage area, 32K was the Back ground Information district in dynamic data storage district before each dynamic data storage device was divided, and then 32K is the operation log recording district in dynamic data storage district.The Back ground Information district is used for storage data is carried out preoperative raw data, and the operation log recording district then is used to write down the retouching operation daily record that this raw data is carried out, and the content that changes that promptly is modified is that the form with daily record is recorded in log area.This journal format comprises offset, data length and data content and data logging action version.When initialization next time, system can calculate current data according to the raw data in Back ground Information district and the Operation Log in log record district.
See also Fig. 1, the flow process that system boot is set up Back ground Information district and Data Detection recovery is: the memory mapping district that sets up 32K earlier; Read the most preceding zone bit and the last zone bit of attitude data storage area initiatively and judge this most preceding zone bit and whether last zone bit is effective status, thereby judge initiatively whether the data of attitude data storage area are effective; If initiatively the data of attitude data storage area are invalid, the corresponding zone bit that then continues to read from dynamic data storage area is judged, if the result who judges is for denying, illustrate that then this system never used, by default system initialization memory mapping district is set, if the result who judges is for being, then from the content replication of dynamic data storage area to active attitude data storage area, carry out next step operation; If initiatively the data of attitude data storage area are effective, then the memory mapping district is arrived in the content replication in Back ground Information district in the active attitude data storage area, and travel through whole log record district, in memory mapping, operate according to this according to Operation Log information according to the time order and function order and revise the data content that data have obtained final state; Call the Back ground Information district at last and the log record district sets up flow process, and the data content of the final state that obtains in the memory mapping is write the Back ground Information district.
See also Fig. 2, the flow process of setting up in Back ground Information district and log record district is: the whole district of wiping the dynamic data storage district; Write the most preceding zone bit in dynamic data storage district, with the reference position in sign dynamic data storage district; Data in the memory mapping district are written to the Back ground Information district; Write the last zone bit in dynamic data storage district; It is the reference position in log record district that but the current writing position in log record district is set.So be provided with finish after, that can set up the dynamic data storage district sets up Back ground Information district and log record district.
See also Fig. 3, the process that system makes amendment to the data of dynamic area is: the content of revising relevant position, memory mapping district earlier; Obtain the information such as offset, data length and data content of the content of revising; Information such as offset, data length and data content according to the modification content generate an Operation Log information; But the information such as current writing position in log record district and remaining space size that obtain also judge in view of the above whether the log record district has enough spaces to write this Operation Log information; If then write this Operation Log information to the log record district; If not, then call the Back ground Information district and the log record district sets up flow process, refresh the dynamic data storage district.
Compared to prior art, method of the present invention repeatedly writes by once wiping, so that can carry out hundreds and thousands of times write operation, the service life of greatly having improved Flash after wiping once; And when revising information, only need to write, speed is fast, has reduced the occupancy of CPU, has improved whole systematic function; at every turn Simultaneously, the way that has adopted two dynamic data storage district to set up data image realizes recovering the function because of the outage missing data, has improved the Information Security in the process of reconstruction.
In addition, those skilled in the art also can do other variation in spirit of the present invention, such as, also can adopt single action attitude data memory block. The variation that these are done according to spirit of the present invention all should be included in the claimed range of the present invention

Claims (6)

1. method of utilizing the Flash storer to carry out dynamic data storage, it is characterized in that, at least one block of described Flash storer is made as the dynamic data storage district, described dynamic data storage zoning is divided into a Back ground Information district and a log record district, described Back ground Information district is used to store revises preceding data to data, described log record district is used to write down the Operation Log that data are carried out, described operation log recording to the modification information of data content.
2. the Flash of utilization storer according to claim 1 carries out the method for dynamic data storage, it is characterized in that, described Flash memory block is provided with two dynamic data storage districts, and described two dynamic data storage districts are mirror image each other.
3. the Flash of utilization storer according to claim 1 carries out the method for dynamic data storage, it is characterized in that, described Operation Log is by the data-bias position, data length, and data content, data logging action version is formed.
4. the Flash of utilization storer according to claim 1 carries out the method for dynamic data storage, it is characterized in that, the flow process of setting up in described Back ground Information district and log record district is: the whole district of wiping the dynamic data storage district; Write the most preceding zone bit in dynamic data storage district, with the reference position in sign dynamic data storage district; Data in the memory mapping district are written to the Back ground Information district; Write the last zone bit in dynamic data storage district; It is the reference position in log record district that but the current writing position in log record district is set.
5. the Flash of utilization storer according to claim 1 carries out the method for dynamic data storage, it is characterized in that, the process that the data of dynamic area are made amendment is: the content of revising relevant position, memory mapping district earlier; Obtain offset, data length and the data content of the content of revising; Offset, data length and data content according to the modification content generate an Operation Log information; But obtain current writing position in log record district and remaining space size and judge in view of the above whether the log record district has enough spaces to write this Operation Log information; If then write this Operation Log information to the log record district; If not, then call the Back ground Information district and the log record district sets up flow process, refresh the dynamic data storage district.
6. the Flash of utilization storer according to claim 1 carries out the method for dynamic data storage, it is characterized in that, the flow process that system boot is set up the Back ground Information district is: the memory mapping district that sets up the dynamic data storage district earlier; The memory mapping district is arrived in the content replication in Back ground Information district in the dynamic data storage district, and travel through whole log record district, in memory mapping, operate according to this according to Operation Log information according to the time order and function order and revise the data content that data have obtained final state; Call the Back ground Information district at last and the log record district sets up flow process, and the data content of the final state that obtains in the memory mapping is write the Back ground Information district.
CN2009101069785A 2009-05-15 2009-05-15 Method for storing dynamic data by using Flash memory Pending CN101887750A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2009101069785A CN101887750A (en) 2009-05-15 2009-05-15 Method for storing dynamic data by using Flash memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2009101069785A CN101887750A (en) 2009-05-15 2009-05-15 Method for storing dynamic data by using Flash memory

Publications (1)

Publication Number Publication Date
CN101887750A true CN101887750A (en) 2010-11-17

Family

ID=43073619

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2009101069785A Pending CN101887750A (en) 2009-05-15 2009-05-15 Method for storing dynamic data by using Flash memory

Country Status (1)

Country Link
CN (1) CN101887750A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102981944A (en) * 2012-12-12 2013-03-20 青岛海信宽带多媒体技术有限公司 Log storage method based on file system
CN103324493A (en) * 2012-03-20 2013-09-25 安凯(广州)微电子技术有限公司 Method and system for increasing booting speed of system based on NAND FLASH
CN105302679A (en) * 2015-11-03 2016-02-03 惠州Tcl移动通信有限公司 Detection method and system for intelligent terminal storage stability
WO2016165597A1 (en) * 2015-04-16 2016-10-20 中兴通讯股份有限公司 Processing method and device for data storage

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW515948B (en) * 1999-12-20 2003-01-01 Jian-Tsz Hou Content securing method of non-volatile storage device and architecture thereof
CN101101572A (en) * 2007-08-10 2008-01-09 北京海尔集成电路设计有限公司 Method, device and apparatus for processing data recording of NOR type flash memory
CN101140536A (en) * 2007-05-21 2008-03-12 中兴通讯股份有限公司 Snapshot system supporting cascades snapshot and snapshot processing method thereof

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW515948B (en) * 1999-12-20 2003-01-01 Jian-Tsz Hou Content securing method of non-volatile storage device and architecture thereof
CN101140536A (en) * 2007-05-21 2008-03-12 中兴通讯股份有限公司 Snapshot system supporting cascades snapshot and snapshot processing method thereof
CN101101572A (en) * 2007-08-10 2008-01-09 北京海尔集成电路设计有限公司 Method, device and apparatus for processing data recording of NOR type flash memory

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103324493A (en) * 2012-03-20 2013-09-25 安凯(广州)微电子技术有限公司 Method and system for increasing booting speed of system based on NAND FLASH
CN103324493B (en) * 2012-03-20 2016-10-05 安凯(广州)微电子技术有限公司 System boot accelerating method based on NAND FLASH and system
CN102981944A (en) * 2012-12-12 2013-03-20 青岛海信宽带多媒体技术有限公司 Log storage method based on file system
CN102981944B (en) * 2012-12-12 2016-04-20 青岛海信宽带多媒体技术有限公司 A kind of log storing method based on file system
WO2016165597A1 (en) * 2015-04-16 2016-10-20 中兴通讯股份有限公司 Processing method and device for data storage
CN105302679A (en) * 2015-11-03 2016-02-03 惠州Tcl移动通信有限公司 Detection method and system for intelligent terminal storage stability
CN105302679B (en) * 2015-11-03 2019-04-30 惠州Tcl移动通信有限公司 A kind of detection method and system of intelligent terminal storage stability

Similar Documents

Publication Publication Date Title
CN101515276B (en) Method for write operation of file data, and recovery method and recovery system for file data
CN103577121B (en) A kind of highly reliable linear file access method based on Nand Flash
JP6759459B2 (en) Physical Media Aware Spatial Join Journal Processing and Replay
US9817588B2 (en) Memory device and operating method of same
US8909851B2 (en) Storage control system with change logging mechanism and method of operation thereof
CN1331063C (en) On-line data backup method based on data volume snapshot
CN101425041B (en) Optimizing method for establishing FAT file systems on NAND FLASH memory
US8411519B2 (en) Selective retirement of blocks
US20150186224A1 (en) Data storage device and flash memory control method
CN102508785B (en) A kind of abrasion equilibrium method and device
CN100449549C (en) Method for building file systems on NAND flash memory in embedded system
US20130326117A1 (en) Apparatus, system, and method for grouping data stored on an array of solid-state storage elements
CN100389406C (en) Method for operating data in non-volatile storage in embedded system
US9009396B2 (en) Physically addressed solid state disk employing magnetic random access memory (MRAM)
JP2008508596A (en) System, method, computer readable medium, and apparatus for memory management using NVRAM
DE102013106242A1 (en) Semiconductor drive with conversion layer (ETL) and redirection of temporary files to reduce the wear of flash memory
CN103488578A (en) Vmd application/driver
CN100533408C (en) Flashmemory safety read-write method
CN103577574A (en) High-reliability linear file system based on nand flash
CN102063380B (en) Method and device for writing data in non-volatile memory
CN101963891A (en) Method and device for data storage and processing, solid-state drive system and data processing system
CN102662856A (en) Solid state disk and access method
CN103996412A (en) Power-fail protection method applied to intelligent-card nonvolatile memories
CN109669889B (en) Light Nor Flash control method and device
CN104937562A (en) Non-volatile memory write mechanism

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
AD01 Patent right deemed abandoned

Effective date of abandoning: 20101117

C20 Patent right or utility model deemed to be abandoned or is abandoned