CN103456360A - Management method and device for nonvolatile memory (NVM) - Google Patents

Management method and device for nonvolatile memory (NVM) Download PDF

Info

Publication number
CN103456360A
CN103456360A CN2013104190994A CN201310419099A CN103456360A CN 103456360 A CN103456360 A CN 103456360A CN 2013104190994 A CN2013104190994 A CN 2013104190994A CN 201310419099 A CN201310419099 A CN 201310419099A CN 103456360 A CN103456360 A CN 103456360A
Authority
CN
China
Prior art keywords
page
data
look
physical
physical page
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
CN2013104190994A
Other languages
Chinese (zh)
Other versions
CN103456360B (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.)
KT MICRO Inc
Beijing KT Micro Ltd
Original Assignee
KT MICRO Inc
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 KT MICRO Inc filed Critical KT MICRO Inc
Priority to CN201310419099.4A priority Critical patent/CN103456360B/en
Publication of CN103456360A publication Critical patent/CN103456360A/en
Application granted granted Critical
Publication of CN103456360B publication Critical patent/CN103456360B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

The invention relates to a management method and device for a nonvolatile memory (NVM). The NVM comprises a plurality of physical pages divided into data pages and idle pages, wherein each physical page comprises a page head and a data area. The method comprises the steps: establishing a data page lookup table and an idle page lookup table in a memory through scanning page head information of all the physical pages; setting an idle page pointer, wherein the idle page pointer points to a physical page number in the idle page lookup table; during the writing operation of a target data page, writing the page head and data into an idle page corresponding to the physical page number pointed by the idle page pointer according to the idle page lookup table, erasing the data page corresponding to the physical page number of the target data page according to the data page lookup table, exchanging the physical page number of the target data page in the data page lookup table and the physical page number of the idle page pointed by the idle page pointer in the idle page lookup table, and configuring a next physical page number pointed by the idle page pointer in the idle page lookup table. The management method and device can be used for improving the data writing efficiency and prolonging the service life of the NVM.

Description

The management method of nonvolatile memory and device
Technical field
The present invention relates to memory area, relate in particular to a kind of management method and device of nonvolatile memory.
Background technology
In today of social high speed development, nonvolatile memory (Nonvolatile memory, be called for short: use NVM) is seen everywhere, and closely bound up with life, common NVM has, (Electrically Erasable Programmable Read-Only Memory is called for short: EEPROM) and flash memory (Flash Memory, abbreviation: FLASH) EEPROM (Electrically Erasable Programmable Read Only Memo).Such as, the smart card that the every field such as public transport, social security, bank, electric power, identification are all used all has been widely used NVM.Therefore, guarantee that in NVM, the data efficient safe storage just seems particularly important.Smart card in the course of the work, if outage or other unpredictable mistakes occur, causes smart card to be wiped or the termination of data writing process exception, will make data writing incorrect, like this with regard to serious threat data integrity and security.Therefore need to there is a solution to complete the power-off protection problem of data.
Current, solving the power-off protection problem is generally to adopt backup area to complete, that is, at a backup area of memory block application, the user more flow process of new data is as follows:
Step 1, wipe backup area;
Step 2, write legacy data to backup area;
Step 3, write backup area sign;
Step 4, wipe former data field;
Step 5, write new data to former data field;
Step 6, write backup area and empty sign.
Complete data security by above-mentioned this method and write, like this, can guarantee data or right with regard to all writing, or just not write data, not there will be other situations, thereby guaranteed the integrality of data.But utilize this method, security update one secondary data need to be write 4 times and wipe twice, the efficiency that causes writing data is lower.And, often to write a secondary data and just need to write a backup area and wipe a backup area, the number of times of erasable backup area will be a lot, will greatly reduce the life-span of NVM.
Summary of the invention
The invention provides a kind of management method and device of nonvolatile memory, in order to realize improving the efficiency of writing data, the life-span of improving NVM.
The invention provides a kind of management method of nonvolatile memory, described nonvolatile memory comprises a plurality of Physical Page, and described Physical Page is divided into data page and free page, and each Physical Page comprises top margin and data field, and described method comprises:
Set up data page look-up table and free page look-up table by the page header that scans whole Physical Page in internal memory, wherein, described data page look-up table is for setting up the mapping from the logical page number (LPN) of described data page to the physical page number of described data page, described free page look-up table, for storing the physical page number of described free page, arranges a free page pointer that points to a physical page number in described free page look-up table;
When carrying out the write operation of target data page, write top margin and data according to described free page look-up table in the free page corresponding in the physical page number of described free page pointed, data page corresponding to physical page number of wiping described target data page according to described data page look-up table, the physical page number of the free page of free page pointed described in the physical page number of target data page described in described data page look-up table and described free page look-up table is exchanged, configure the next physical page number of the described free page look-up table of described free page pointed.
The present invention also provides a kind of management devices of nonvolatile memory, and described nonvolatile memory comprises a plurality of Physical Page, and described Physical Page is divided into data page and free page, and each Physical Page comprises top margin and data field, and described device comprises:
Look-up table is set up module, for the page header by the whole Physical Page of scanning, set up data page look-up table and free page look-up table in internal memory, wherein, described data page look-up table is for setting up the mapping from the logical page number (LPN) of described data page to the physical page number of described data page, and described free page look-up table is for storing the physical page number of described free page;
Pointer arranges module, for a free page pointer that points to a physical page number of described free page look-up table is set;
The first data writing module, for when carrying out the write operation of target data page, write top margin and data according to described free page look-up table in the free page corresponding in the physical page number of described free page pointed, data page corresponding to physical page number of wiping described target data page according to described data page look-up table, the physical page number of the free page of free page pointed described in the physical page number of target data page described in described data page look-up table and described free page look-up table is exchanged, control the next physical page number of the described free page look-up table of described free page pointed.
In the present invention, carry out write operation and only need to carry out once page write operation and page erase operation once to NVM, need to write 4 times and wipe twice NVM with respect to carrying out a write operation in prior art, greatly save the running time, improve the efficiency of writing data.Because the number of operations to NVM has reduced, improved the life-span of NVM.
The accompanying drawing explanation
The schematic flow sheet of the management method embodiment that Fig. 1 is NVM of the present invention;
A principle schematic of writing data instance in the management method embodiment that Fig. 2 is NVM of the present invention;
The structural representation of the management devices embodiment that Fig. 3 is nonvolatile memory of the present invention.
Embodiment
Below in conjunction with specification drawings and specific embodiments, the invention will be further described.
The management method embodiment of NVM
In the present embodiment, this NVM comprises a plurality of Physical Page, and a plurality of Physical Page are divided into data page and free page, and each Physical Page comprises top margin and data field.
As shown in Figure 1, be the schematic flow sheet of the management method embodiment of NVM of the present invention, the method can comprise the steps:
Step 11, by the page header that scans whole Physical Page, set up data page look-up table and free page look-up table in internal memory;
Wherein, the data page look-up table is for setting up the mapping from the logical page number (LPN) of data page to the physical page number of data page, and the free page look-up table is for storing the physical page number of free page; Preferably, this step is carried out when system powers on; Inside save as volatile memory;
Step 12, a free page pointer that points to a physical page number in the free page look-up table is set;
Step 13, when carrying out the write operation of target data page, write top margin and data according to the free page look-up table in the free page corresponding in the physical page number of free page pointed, wipe the data page corresponding to physical page number of target data page according to the data page look-up table, the physical page number of the free page that in the physical page number of target data page in the data page look-up table and free page look-up table, idle page pointer points to is exchanged to the next physical page number of configuration free page pointed free page look-up table.
In step 13, the logical page number (LPN) that is input as the target data page of write operation.While writing data, according to the free page pointer, search the physical page number that the free page look-up table obtains free page, calculate top margin, then according to the physical page number of free page, find free page in NVM, data and top margin are write in free page; Next, find the physical page number of target data page according to the data page look-up table, find the data page corresponding to physical page number of this target data page in NVM, then this data page is wiped.
In step 13, search time that free page look-up table and data page look-up table spend with respect to writing data and wipe the time that data spend and can ignore in NVM in internal memory.
In the present embodiment, carry out write operation and only need to carry out once page write operation and page erase operation once to NVM, need to write 4 times and wipe twice NVM with respect to carrying out a write operation in prior art, greatly save the running time, improve the efficiency of writing data.Because the number of operations to NVM has reduced, improved the life-span of NVM.
In addition, owing to having adopted the free page pointer to realize free page rotary press system, even each NVM data write, all focus on same logical address, the probability that each Physical Page is written into data is
Figure BDA0000382003260000041
the quantity that N is free page, be equivalent to the life-span of NVM has been improved to N+1 doubly, thus the life-span of greatly having improved NVM.
Further, in step 11, when data page look-up table and free page look-up table are set up in execution, while according to page header, judging the improper end of write operation last time, the execute exception handling procedure.Further, exception handler can comprise following two kinds of situations:
Situation 1, according to page header, judge in writing the process of data or power down in the process of obliterated data, the Physical Page that will write the Physical Page of partial data or wipe partial data is wiped as free page, then the physical page number of this free page is stored in the free page look-up table, thereby by the integrality with the assurance data by incomplete data erase.
Situation 2, according to page header judge after writing data, wipe before power down, will write the Physical Page of new data as data page, set up the mapping of the logical page number (LPN) of this data page to the physical page number of this data page in the data page look-up table, the Physical Page of not wiping is wiped as free page,, the physical page number of this free page is stored in the free page look-up table.
Alternatively, in step 11, during the page header of whole Physical Page of scan N VM, can adopt the mode of sequential scanning to read the page header of whole Physical Page or adopt the mode of random non-sequential scanning to read the page header of whole Physical Page.When the mode that adopts sequential scanning reads the page header of whole Physical Page, the idle Physical Page look-up table obtained is always inserted look-up table to the physical page number of free page according to a definite sequence, and like this, some Physical Page may always first have been used and write data; For fear of this situation, in step 12, for the free page pointer distributes a random number, make the free page pointer point at random a physical page number in the free page look-up table, like this, can choose randomly a Physical Page data writing from free page according to this free page pointer in step 13.
Alternatively, when carrying out the write operation of target data page, Physical Page corresponding to physical page number of judging the target data page according to the data page look-up table is blank page, in the direct Physical Page corresponding in the physical page number of target data page, write data, until after all having write once, then perform step 13 to all data pages.Wherein blank page means that this Physical Page never write data.
Alternatively, in order to save memory headroom, the data page look-up table be take the physical page number that the logical page number (LPN) of data page is the index stores data page, sets up in this way the mapping from the logical page number (LPN) of data page to the physical page number of data page.Now, in actual implementation procedure, also data page look-up table and free page look-up table can be synthesized to a table, and needn't be placed on separately two memory modules.
Alternatively, in the present embodiment, when carrying out the read operation of target data page, the reading out data the Physical Page corresponding from the physical page number of target data page according to the data page look-up table.The logical page number (LPN) that is input as the target data page of this step and page offset address.Particularly, the logical page number (LPN) that is input as the target data page of read operation and page offset address, the logical page number (LPN) of target data page is delivered to the data page look-up table, obtain the physical page number of target data page, according to the physical page number of target data page and page offset address, go in NVM to read the data in data page corresponding to the physical page number of target data page.
Alternatively, when the write operation that carries out the target data page or read operation, if be input as the logical address of target data page, the present embodiment can also comprise the steps: that the logical address according to the target data page calculates logical page number (LPN) and the page offset address of target data page.Particularly, the business's of logical page number (LPN)=(logical address/logical page (LPAGE) length) integral part, logical page (LPAGE) length=Physical Page length-Physical Page top margin length.For example: if Physical Page length is 256-byte, Physical Page top margin length is 8-byte, and logical page (LPAGE) length is 248-byte.
Describe the course of work of the present embodiment in detail below by an instantiation.
As shown in Figure 2, for a principle schematic of writing data instance in the management method embodiment of NVM of the present invention, NVM comprises 12 Physical Page: Physical Page 0-11, wherein 8 Physical Page are initialized to data page, 4 Physical Page are initialized to free page, and the addressing mode of NVM is physical page number+page offset address.Each NVM Physical Page comprises top margin and data field, and the length of top margin is 8 bytes, and the length of data field equals logical page (LPAGE) length.Wherein, top margin comprises logical page number (LPN), idle marker, meter digital, the first error-detecging code EDC1, trough RFU and the second error-detecging code EDC2; Wherein, the first error-detecging code EDC1 is used for the data except the second error-detecging code EDC2 to top margin and carries out error detection, the second error-detecging code EDC-2 is for carrying out error detection to the data of data field, meter digital is for writing and counted page according to logical page number (LPN), same logical page number (LPN) is carried out to write operation one time, this meter digital is once counted, and according to meter digital, can judge that the data of which Physical Page are up-to-date.For example: meter digital adopts 2 bit cycle counts, counting sequence is: 00-01-10-11-00, if corresponding two Physical Page of same logical page number (LPN), the meter digital of these two Physical Page is respectively 00 and 01, the data of the Physical Page that can to determine meter digital be 01 are up-to-date, and the data of the Physical Page that meter digital is 00 are old.
When system powers on, sequential scanning NVM sets up data page look-up table and free page look-up table in internal memory, wherein, and physical page number corresponding to sequential storage logical page (LPAGE) 0-7 in the data page look-up table, physical page number corresponding to storage free page 0-3 in the free page look-up table.The free page pointer points to the physical page number of free page 1 correspondence at random.For example: by the top margin of scanning Physical Page 5, obtaining its corresponding logical page number (LPN) is 0, fills in physical page number 5 in the form that is 0 in the data page look-up table index.Alternatively, during the top margin of the some Physical Page in scan N VM, adopt the first error-detecging code EDC1 to carry out error detection to top margin, if check out the top margin mistake, enter exception handler.Exception handler is specially: judge the power down in the process of data writing or obliterated data of this Physical Page, this Physical Page is erased to free page and the physical page number of this Physical Page is stored in the free page look-up table.
The write operation carried out is: write 3344 in logical page (LPAGE) 5, this write operation be input as logical address and data 3344, concrete execution step is as follows:
Step 21, according to the free page look-up table, obtain the corresponding physical page number 0 of free page 1 of free page pointed, output physical page number 0;
Step 22, according to logical address calculate logical page number (LPN) 5 and the page offset address;
Step 23, according to the data page look-up table, obtain the corresponding physical page number 7 of logical page number (LPN) 5, output physical page number 7;
Step 24, calculate new top margin, according to the page offset address, data 3344 and new top margin are write in the Physical Page 0 of physical page number 0 correspondence; Wherein, the meter digital in new top margin equals meter digital in the top margin of Physical Page 7+1.
Step 25, wipe the Physical Page 7 of physical page number 7 correspondences;
Step 26, renewal data page look-up table, be updated to 0 by the physical page number of logical page (LPAGE) 5 correspondences;
Step 27, renewal free page look-up table, be updated to 7 by the physical page number of free page 1 correspondence;
The physical page number of step 28, distribution free page pointed free page 2 correspondences.
If write data perform step 24 process in the data that write in causing Physical Page 0 of power down imperfect, in next time, power on while setting up the data page look-up table, just there will be two physical page number is the situation of physical page number 0 and 7 corresponding logical page number (LPN)s 5, now, can judge that by the EDC1 in the top margin of Physical Page 0 and 7 and EDC2 the data in Physical Page 0 are wrong respectively, and the data in Physical Page 7 are correct, then, by the data erase in Physical Page 0, physical page number 0 is stored in the free page look-up table, physical page number 7 is stored in the data page look-up table, thereby guarantee the integrality of data.
If in execution of step 24, power down before execution step 25, be that data in Physical Page 0 and 7 are all complete, but the data in Physical Page 0 are up-to-date, in next time, power on while setting up the data page look-up table, also there will be two physical page number is the situation of physical page number 0 and 7 corresponding logical page number (LPN)s 5, now, at first judge that by the EDC1 in the top margin of Physical Page 0 and 7 and EDC2 the data in Physical Page 0 and 7 are all correct, then, judge that according to the meter digital in top margin the data in Physical Page 0 are up-to-date, data in Physical Page 7 are old, finally by the data erase in Physical Page 7, deposit physical page number 7 in the free page look-up table, physical page number 0 is deposited in the data page look-up table, thereby guarantee that on the basis guaranteed data integrity data are up-to-date.
If be that in the process of obliterated data, the data of power down in causing Physical Page 7 are not wiped totally in execution step 25, in next time, power on while setting up the data page look-up table, also may occur that two physical page number are the situation of physical page number 0 and 7 corresponding logical page number (LPN)s 5, now, can judge that by the EDC1 in the top margin of Physical Page 0 and 7 and EDC2 the data in Physical Page 0 are correct respectively, and the data in Physical Page 7 are wrong, then, by the data erase in Physical Page 7, physical page number 7 is stored in the free page look-up table, physical page number 0 is stored in the data page look-up table, thereby guarantee the integrality of data.
While reading the data of logical page (LPAGE) 5 in schematic diagram shown in Fig. 2, according to logical address, calculate logical page number (LPN) 5 and page offset address, logical page number (LPN) 5 is delivered to the data page look-up table, obtain corresponding physical page number 7, according to physical page number 7 and page offset address, go in NVM to read the data in Physical Page 7.
The management devices embodiment of NVM
In the present embodiment, NVM can comprise a plurality of Physical Page, and a plurality of Physical Page are divided into data page and free page, and each Physical Page comprises top margin and data field.
As shown in Figure 3, be the structural representation of the management devices embodiment of nonvolatile memory of the present invention, this device can comprise that look-up table is set up module 32, pointer arranges module 33 and the first data writing module 34.
Wherein, look-up table is set up module 32 for scanning the page header of whole Physical Page, set up data page look-up table and free page look-up table in internal memory, wherein, the data page look-up table is for setting up the mapping from the logical page number (LPN) of data page to the physical page number of data page, and the free page look-up table is for storing the physical page number of free page.Preferably, look-up table is set up module 32 and is scanned when system powers on, because these two look-up tables are that the page header according to NVM re-establishes when powering at every turn, so they leave in the internal memory of volatile memory.Pointer arranges module 33 for a free page pointer that points to a physical page number of free page look-up table is set.The first data writing module 34 is for when carrying out the write operation of target data page, according to write top margin and data in the not busy page look-up table free page corresponding in the physical page number of free page pointed, wipe the data page corresponding to physical page number of target data page according to the data page look-up table, the physical page number of the free page that in the physical page number of target data page in the data page look-up table and free page look-up table, idle page pointer points to is exchanged, control the next physical page number of free page pointed free page look-up table.
In the first data writing module 34, the logical page number (LPN) that is input as the target data page of write operation.The first data writing module 34 is when writing data, search the free page look-up table according to logical page number (LPN), obtain the physical page number of free page, find free page according to the physical page number of this free page in NVM, then data and top margin are write in free page, then search the data page look-up table according to logical page number (LPN), obtain the physical page number with the target data page, then by the physical page number of target data page, corresponding data page is wiped.Search time that free page look-up table and data page look-up table spend with respect to writing data and wipe the time that data spend and can ignore in NVM in internal memory.
Alternatively, the mode that this device can adopt software, hardware circuit or software and hardware circuit to combine realizes.
The course of work of the present embodiment is as follows: when NVM powers on, look-up table is set up module 32 by the page header of the whole Physical Page of scanning, set up data page look-up table and free page look-up table in internal memory, wherein, the data page look-up table is for setting up the mapping from the logical page number (LPN) of data page to the physical page number of data page, the free page look-up table is for storing the physical page number of free page, and pointer arranges module 33 a free page pointer that points to a physical page number in the free page look-up table is set.When carrying out the write operation of target data page, write data page corresponding to physical page number that top margin and data based data page look-up table are wiped the target data page in the first data writing module 34 free page corresponding in the physical page number of free page pointed according to the free page look-up table, then the physical page number of the free page that in the physical page number of target data page in the data page look-up table and free page look-up table, idle page pointer points to is exchanged, finally control the next physical page number of free page pointed free page look-up table.
In the present embodiment, often write a secondary data, only need 34 couples of NVM of the first data writing module to carry out once page write operation and page erase operation once, need to write 4 times and wipe twice NVM with respect to carrying out a write operation in prior art, greatly save the running time, improved the efficiency of writing data.Because the number of operations to NVM has reduced, also improved the life-span of NVM.
Further, the present embodiment can also comprise abnormality processing module 35, set up module 32 with look-up table and be connected, and while for set up information that module 32 provides according to look-up table, judging the improper end of write operation last time, the execute exception handling procedure.Further, abnormality processing module 35 can comprise the first power down process unit 351 and the second power down process unit 352, wherein, power down in the process of writing data or the process in obliterated data is judged for the information of setting up module 35 according to look-up table and providing in the first power down process unit 351, and the Physical Page that will write the Physical Page of partial data or wipe partial data is wiped and the physical page number of this Physical Page is stored in the free page look-up table; The second power down process unit 352 for the information of setting up module 32 according to look-up table and providing judge after writing data, wipe before power down, in the data page look-up table, set up the mapping of the logical page number (LPN) of the Physical Page of preserving new data to physical page number, the Physical Page of preserving legacy data is wiped and the physical page number of this Physical Page is stored in the free page look-up table.
For example: the top margin of Physical Page comprises logical page number (LPN), idle marker, meter digital, the first error-detecging code and the second error-detecging code; Wherein, the first error-detecging code is used for the data except the second error-detecging code to top margin and carries out error detection, and the second error-detecging code is for the data of data field are carried out to error detection, and meter digital is for writing and counted page according to logical page number (LPN).After look-up table is set up module 32 scanning top margins, judge that according to the first error-detecging code in top margin whether top margin is correct, if top margin mistake, the physical page number of this Physical Page is sent to abnormality processing module 35, abnormality processing module 35 is judged the power down in the process of writing data or wiping data of Physical Page corresponding to this physical page number, wipe Physical Page corresponding to this physical page number, this physical page number is stored in the free page look-up table.When look-up table is set up module 32 and is set up the data page look-up table, if there is the top margin of the corresponding logical page number (LPN)s of two physical page number and Physical Page corresponding to two physical page number correct situation all, look-up table is set up module 32 can offer abnormality processing module 35 by two physical page number, abnormality processing module 35 is according to these two physical page number, obtain top margin and the data of corresponding Physical Page, can judge that according to the EDC2 in top margin whether the data in the data field of Physical Page are correct, the error in data of another Physical Page if the data in the data field of a Physical Page are correct, can judge that according to the meter digital in top margin the data in which Physical Page are new, if store the error in data of the Physical Page of new data, can judge power down in writing the process of data, if store the error in data of the Physical Page of legacy data, can judge power down in the process of wiping data, no matter be power down or power down in the process of wiping data in writing the process of data, the Physical Page of abnormality processing module 35 obliterated data mistakes also stores physical page number in the free page look-up table into, by data, the physical page number of correct Physical Page stores in the data page look-up table, if the data in two Physical Page are all correct, can judge that according to the meter digital in top margin the data in which Physical Page are new, the physical page number that stores the Physical Page of new data is stored in the data page look-up table, wipe the Physical Page that stores legacy data and physical page number is stored in free page.
Alternatively, when look-up table is set up the page header of the whole Physical Page of module 32 scanning, can adopt the mode of sequential scanning to read the page header of whole Physical Page or adopt the mode of random non-sequential scanning to read the page header of whole Physical Page.When scan module 31 adopts the mode of sequential scanning to read the page header of whole Physical Page, the idle Physical Page look-up table obtained is always inserted look-up table to the physical page number of free page according to a definite sequence, like this, some Physical Page may always first have been used and write data; For fear of this situation, pointer arranges module 33 can comprise random number generation unit 331 and pointer setting unit 332, and wherein, random number generation unit 331 is for generating random number; Pointer setting unit 332, for random number being distributed to the free page pointer, makes the free page pointer point at random a physical page number in the free page look-up table; Like this, the first data writing module 34 can be chosen a Physical Page data writing randomly according to this free page pointer from free page.
Alternatively, the present embodiment can also comprise the second data writing module 36, for when carrying out the write operation of target data page, judge that according to the data page look-up table target data page is as blank page, write data in the target data page, until after all having write once, then carry out write operation by the first data writing module 34 to all data pages.Wherein, blank page means that this Physical Page never write data.
Alternatively, in order to save memory headroom, the data page look-up table be take the physical page number that the logical page number (LPN) of data page is the index stores data page, sets up in this way the mapping from the logical page number (LPN) of data page to the physical page number of data page.Alternatively, in actual implementation procedure, also data page look-up table and free page look-up table can be synthesized to a table.
Alternatively, the present embodiment can also comprise data read through model 37, for when carrying out the read operation of target data page, according to data page look-up table reading out data from the target data page.
Alternatively, when the write operation that carries out the target data page or read operation, if be input as the logical address of target data page, the present embodiment can also comprise computing module 38, with the first data writing module 34, the second data writing module 36, with data read through model 37, be connected, for the logical address according to the target data page, calculate logical page number (LPN) and the page offset address of target data page.Particularly, the business's of logical page number (LPN)=(logical address/logical page (LPAGE) length) integral part, logical page (LPAGE) length=Physical Page length-Physical Page top margin length.For example: if Physical Page length is 256-byte, Physical Page top margin length is 8-byte, and logical page (LPAGE) length is 248-byte.
Finally it should be noted that: above embodiment is only unrestricted in order to technical scheme of the present invention to be described, although with reference to preferred embodiment, the present invention is had been described in detail, those of ordinary skill in the art is to be understood that, can modify or be equal to replacement technical scheme of the present invention, and not break away from the spirit and scope of technical solution of the present invention.

Claims (10)

1. the management method of a nonvolatile memory, is characterized in that, described nonvolatile memory comprises a plurality of Physical Page, and described Physical Page is divided into data page and free page, and each Physical Page comprises top margin and data field, and described method comprises:
Set up data page look-up table and free page look-up table by the page header that scans whole Physical Page in internal memory, wherein, described data page look-up table is for setting up the mapping from the logical page number (LPN) of described data page to the physical page number of described data page, described free page look-up table, for storing the physical page number of described free page, arranges a free page pointer that points to a physical page number in described free page look-up table;
When carrying out the write operation of target data page, write top margin and data according to described free page look-up table in the free page corresponding in the physical page number of described free page pointed, data page corresponding to physical page number of wiping described target data page according to described data page look-up table, the physical page number of the free page of free page pointed described in the physical page number of target data page described in described data page look-up table and described free page look-up table is exchanged, configure the next physical page number of the described free page look-up table of described free page pointed.
2. method according to claim 1, is characterized in that, also comprises:
Carry out described while setting up data page look-up table and free page look-up table, while according to page header, judging the improper end of write operation last time, the execute exception handling procedure.
3. method according to claim 2, is characterized in that, described exception handler comprises:
According to page header, judge in writing the process of data or power down in the process of obliterated data, the Physical Page that will write the Physical Page of partial data or wipe partial data is wiped and the physical page number of this Physical Page is stored in the free page look-up table;
According to page header judge after writing data, wipe before power down, in the data page look-up table, set up the mapping of the logical page number (LPN) of the Physical Page of preserving new data to physical page number, the Physical Page of preserving legacy data is wiped and the physical page number of this Physical Page is stored in the free page look-up table.
4. method according to claim 1, is characterized in that, the described free page pointer that a physical page number in the described free page look-up table of sensing is set is specially:
For described free page pointer distributes a random number, make the random physical page number of pointing in described free page look-up table of described free page pointer.
5. method according to claim 1, is characterized in that, also comprises:
When carrying out the write operation of target data page, data page corresponding to the physical page number of judging described target data page according to described data page look-up table is blank page, in the physical page number of described target data page, in corresponding data page, writes data.
6. the management devices of a nonvolatile memory, is characterized in that, described nonvolatile memory comprises a plurality of Physical Page, and described Physical Page is divided into data page and free page, and each Physical Page comprises top margin and data field, and described device comprises:
Look-up table is set up module, for the page header by the whole Physical Page of scanning, set up data page look-up table and free page look-up table in internal memory, wherein, described data page look-up table is for setting up the mapping from the logical page number (LPN) of described data page to the physical page number of described data page, and described free page look-up table is for storing the physical page number of described free page;
Pointer arranges module, for a free page pointer that points to a physical page number of described free page look-up table is set;
The first data writing module, for when carrying out the write operation of target data page, write top margin and data according to described free page look-up table in the free page corresponding in the physical page number of described free page pointed, data page corresponding to physical page number of wiping described target data page according to described data page look-up table, the physical page number of the free page of free page pointed described in the physical page number of target data page described in described data page look-up table and described free page look-up table is exchanged, control the next physical page number of the described free page look-up table of described free page pointed.
7. device according to claim 6, is characterized in that, also comprises:
The abnormality processing module, while for set up information that module provides according to described look-up table, judging the improper end of write operation last time, the execute exception handling procedure.
8. device according to claim 7, is characterized in that, described abnormality processing module comprises:
The first power down process unit, judge power down in the process of writing data or the process in obliterated data for set up the information that module provides according to described look-up table, the Physical Page that will write the Physical Page of partial data or wipe partial data is wiped and the physical page number of this Physical Page is stored in the free page look-up table;
The second power down process unit, for set up the information that module provides according to described look-up table, judge after writing data, wipe before power down, in the data page look-up table, set up the mapping of the logical page number (LPN) of the Physical Page of preserving new data to physical page number, the Physical Page of preserving legacy data is wiped and the physical page number of this Physical Page is stored in the free page look-up table.
9. device according to claim 6, is characterized in that, described pointer arranges module and comprises:
The random number generation unit, for generating random number;
The pointer control module, for described random number being distributed to described free page pointer, make the random physical page number of pointing in described free page look-up table of described free page pointer.
10. device according to claim 6, is characterized in that, also comprises:
The second data writing module, for when carrying out the write operation of target data page, data page corresponding to the physical page number of judging described target data page according to described data page look-up table is blank page, in the physical page number of described target data page, in corresponding data page, writes data.
CN201310419099.4A 2013-09-13 2013-09-13 The management method of nonvolatile memory and device Active CN103456360B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310419099.4A CN103456360B (en) 2013-09-13 2013-09-13 The management method of nonvolatile memory and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310419099.4A CN103456360B (en) 2013-09-13 2013-09-13 The management method of nonvolatile memory and device

Publications (2)

Publication Number Publication Date
CN103456360A true CN103456360A (en) 2013-12-18
CN103456360B CN103456360B (en) 2016-08-17

Family

ID=49738637

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310419099.4A Active CN103456360B (en) 2013-09-13 2013-09-13 The management method of nonvolatile memory and device

Country Status (1)

Country Link
CN (1) CN103456360B (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104090732A (en) * 2014-07-21 2014-10-08 昆腾微电子股份有限公司 Nonvolatile memory management method and device
CN105468304A (en) * 2015-11-26 2016-04-06 恒宝股份有限公司 Native memory card and management method thereof
CN110427285A (en) * 2019-08-06 2019-11-08 北京中电华大电子设计有限责任公司 A kind of high performance smart card mirror image guard method and data structure
CN111913890A (en) * 2020-08-13 2020-11-10 北京万协通信息技术有限公司 Non-volatile memory random read-write method based on security module
CN112148203A (en) * 2019-06-27 2020-12-29 龙芯中科技术有限公司 Memory management method, memory management device, electronic equipment and storage medium
CN112181732A (en) * 2020-10-29 2021-01-05 第四范式(北京)技术有限公司 Recovery method and recovery system of parameter server node
CN114035749A (en) * 2018-01-12 2022-02-11 珠海极海半导体有限公司 Electronic equipment and Flash memory
CN116661704A (en) * 2023-07-07 2023-08-29 深圳宏芯宇电子股份有限公司 Storage device data reading and writing method, storage device and storage controller

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW200511011A (en) * 2003-09-09 2005-03-16 Renesas Tech Corp Non-volatile memory control device capable of recovering data even when data writing is interrupted
CN1635579A (en) * 2003-12-31 2005-07-06 深圳市朗科科技有限公司 Data operating method in flash memory medium
US20070268754A1 (en) * 2000-01-06 2007-11-22 Super Talent Electronics Inc. Recycling Partially-Stale Flash Blocks Using a Sliding Window for Multi-Level-Cell (MLC) Flash Memory
CN101300554A (en) * 2005-11-03 2008-11-05 英特尔公司 Recovering from a non-volatile memory failure

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070268754A1 (en) * 2000-01-06 2007-11-22 Super Talent Electronics Inc. Recycling Partially-Stale Flash Blocks Using a Sliding Window for Multi-Level-Cell (MLC) Flash Memory
TW200511011A (en) * 2003-09-09 2005-03-16 Renesas Tech Corp Non-volatile memory control device capable of recovering data even when data writing is interrupted
CN1635579A (en) * 2003-12-31 2005-07-06 深圳市朗科科技有限公司 Data operating method in flash memory medium
CN101300554A (en) * 2005-11-03 2008-11-05 英特尔公司 Recovering from a non-volatile memory failure

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104090732A (en) * 2014-07-21 2014-10-08 昆腾微电子股份有限公司 Nonvolatile memory management method and device
CN105468304A (en) * 2015-11-26 2016-04-06 恒宝股份有限公司 Native memory card and management method thereof
CN114035749A (en) * 2018-01-12 2022-02-11 珠海极海半导体有限公司 Electronic equipment and Flash memory
CN112148203A (en) * 2019-06-27 2020-12-29 龙芯中科技术有限公司 Memory management method, memory management device, electronic equipment and storage medium
CN112148203B (en) * 2019-06-27 2023-12-05 龙芯中科技术股份有限公司 Memory management method, device, electronic equipment and storage medium
CN110427285A (en) * 2019-08-06 2019-11-08 北京中电华大电子设计有限责任公司 A kind of high performance smart card mirror image guard method and data structure
CN110427285B (en) * 2019-08-06 2023-05-09 北京中电华大电子设计有限责任公司 High-performance smart card mirror image protection method
CN111913890A (en) * 2020-08-13 2020-11-10 北京万协通信息技术有限公司 Non-volatile memory random read-write method based on security module
CN111913890B (en) * 2020-08-13 2024-06-11 北京万协通信息技术有限公司 Random read-write method of nonvolatile memory based on security module
CN112181732A (en) * 2020-10-29 2021-01-05 第四范式(北京)技术有限公司 Recovery method and recovery system of parameter server node
CN116661704A (en) * 2023-07-07 2023-08-29 深圳宏芯宇电子股份有限公司 Storage device data reading and writing method, storage device and storage controller
CN116661704B (en) * 2023-07-07 2024-03-08 深圳宏芯宇电子股份有限公司 Storage device data reading and writing method, storage device and storage controller

Also Published As

Publication number Publication date
CN103456360B (en) 2016-08-17

Similar Documents

Publication Publication Date Title
CN103456360A (en) Management method and device for nonvolatile memory (NVM)
CN104750625B (en) Data memory device and method for controlling flash memory
CN103955431B (en) Data management method and apparatus in flash memory storage device
CN109783017B (en) Storage device bad block processing method and device and storage device
CN101656106B (en) Method for writing data into EEPROM and device thereof
CN105740163A (en) Nand Flash bad block management method
CN102063380B (en) Method and device for writing data in non-volatile memory
CN109800180A (en) Method and storage system for address of cache
CN104090732A (en) Nonvolatile memory management method and device
CN104360958A (en) Bad block management system and bad block management method based on block reservation area replacement
CN109977034A (en) Data memory device and non-volatile formula memory operating method
CN108475230B (en) Storage system and system garbage recycling method
US20120278535A1 (en) Data writing method, memory controller, and memory storage apparatus
CN106775436B (en) Data access method, memorizer control circuit unit and memory
CN103996412A (en) Power-fail protection method applied to intelligent-card nonvolatile memories
CN103440205A (en) Method and device for storing data of set top box
CN101963912A (en) Implementation method for storing and checking hardware configuration information of system
CN104765695A (en) NAND FLASH bad block management system and method
CN109508142A (en) Data storage device and its operating method
US20130179626A1 (en) Data processing method, memory controller and memory storage apparatus
CN108280032A (en) Data storage device and flash memory control method
CN102902626B (en) Block management method, Memory Controller and memorizer memory devices
CN107678686B (en) Method for realizing FT L function of flash memory based on hardware and data storage device thereof
CN106484308B (en) Data guard method, memorizer control circuit unit and memorizer memory devices
CN103544118B (en) Memorizer memory devices, its Memory Controller and method for writing data

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: 100195 Haidian District, North Hollywood Road, No. 23, North Park, Central Park, building No. 4, No.

Applicant after: KT MICRO, Inc.

Address before: 100195 Haidian District, North Hollywood Road, No. 23, North Park, Central Park, building No. 4, No.

Applicant before: Beijing Kunteng electronic Limited by Share Ltd.

Address after: 100195 Haidian District, North Hollywood Road, No. 23, North Park, Central Park, building No. 4, No.

Applicant after: Beijing Kunteng electronic Limited by Share Ltd.

Address before: 100195 Haidian District, North Hollywood Road, No. 23, North Park, Central Park, building No. 4, No.

Applicant before: KT MICRO Inc. (BEIJING)

COR Change of bibliographic data
C14 Grant of patent or utility model
GR01 Patent grant