CN101409108B - Average abrasion method and controller using the same - Google Patents

Average abrasion method and controller using the same Download PDF

Info

Publication number
CN101409108B
CN101409108B CN2007101629881A CN200710162988A CN101409108B CN 101409108 B CN101409108 B CN 101409108B CN 2007101629881 A CN2007101629881 A CN 2007101629881A CN 200710162988 A CN200710162988 A CN 200710162988A CN 101409108 B CN101409108 B CN 101409108B
Authority
CN
China
Prior art keywords
block
erasing
zone
hot
spare area
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN2007101629881A
Other languages
Chinese (zh)
Other versions
CN101409108A (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.)
Phison Electronics Corp
Original Assignee
Phison Electronics Corp
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 Phison Electronics Corp filed Critical Phison Electronics Corp
Priority to CN2007101629881A priority Critical patent/CN101409108B/en
Publication of CN101409108A publication Critical patent/CN101409108A/en
Application granted granted Critical
Publication of CN101409108B publication Critical patent/CN101409108B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention provides an average wear method used for a nonvolatile memory, wherein, a volatile memory is substantially divided into a plurality of blocks, which are at least grouped into a data area, a spare area, a replacement area and a transient area. The method includes the steps of: extracting blocks according to different purposes in block extraction from the spare area and executing loss adjustment procedure.

Description

The controller of average abrasion method and use the method
Technical field
The invention relates to a kind of average abrasion method, and particularly relevant for a kind of average abrasion method of nonvolatile memory and controller that uses the method for being used for.
Background technology
Digital camera, mobile phone camera and MP3 are very rapid in growth over the years, make the consumer also increase rapidly to the demand of Storage Media, because flash memory (Flash Memory) has that data are non-volatile, power saving, volume is little and the characteristic of no mechanical structure etc., be fit to portable applications, the most suitable being used on the battery-powered product of this class Portable.Except the portable product built-in storage needed, for circumscribed products such as mini memory card and carry-on dish, everyone may have a plurality of carry-on dish and mini memory card simultaneously, so market scale is bigger than those equipment.Therefore, the flash memory industry becomes a ring quite popular in the electronic industry in recent years.
Though flash memory has the advantage that still can preserve data after can writing, can erasing and cut off the power supply.Yet the number of times of erasing of flash memory block is limited, and for example memory block is erased and will be worn and torn after 10,000 times.When memory block wearing and tearing cause the obvious degeneration of the use loss of part of storage volume or performance, can cause user's storage data loss or can't storage data etc. adverse effect.
The wearing and tearing of flash memory block are depended in each block by the program (program) or the number of times of erasing.Just, if a block is only by program (perhaps writing) once, during then not by program again, then the wearing and tearing of this block will be relatively low, otherwise, if a block by program repeatedly when erasing, then the wearing and tearing of this block will be relatively high.For example, when the main frame of access memory block repeatedly used the identity logic block address to write data, then the block of the same, physical in the flash memory can repeatedly be write and be erased.
When some block was worn that simultaneously other block does not does not relatively wear and tear, the existence of the block that generally speaking weares and teares can reduce the performance of flash memory.Except the degeneration of the performance of wearing and tearing block own, when unworn block was not enough to storage data, the performance of flash memory integral body also can reduce.Just, when flash memory took place to surpass the wearing and tearing block of door number, even still have other block not wear and tear, right, this flash memory can be judged to and can't re-use.When the block that do not wear and tear in fact is regarded as using, will be for causing the actual waste of resource.
In order to increase the life-span of flash memory, can use the block of flash memory as far as possible fifty-fifty.In general, the block of flash memory can be divided into data field and spare area, the method of tradition average abrasion is block in the data field and the block in the spare area to be exchanged in logic during a period of time in the every execution of flash memory sequentially, can be exchanged to the spare area in the hope of the feasible less block of number of times of erasing and use for program (or writing).Yet, this kind is in order with block in the data field and the cocommutative mode of block logic in the spare area, what can't guarantee to exchange is the less block of number of times of erasing, if what exchanged is that the more a plurality of blocks of number of times of erasing quicken its wearing and tearing all the better, so the effect of average abrasion is limited.
Base this, having needs a kind of average abrasion method of development, to prolong the life-span of flash memory effectively.
Summary of the invention
The invention provides a kind of average abrasion method that is used for nonvolatile memory, it is the wearing and tearing of average memory block effectively, to prolong the serviceable life of storer.
The invention provides a kind of controller, it can carry out the average abrasion method that is used for nonvolatile memory, and the wearing and tearing of average memory block effectively thus are to prolong the serviceable life of storer.
The present invention proposes a kind of average abrasion method that is used for nonvolatile memory, wherein this nonvolatile memory is divided into a plurality of blocks in fact and those blocks are grouped into data field, spare area, replacement district and transient state district at least, this average abrasion method comprises: a. distinguishes a hot-zone in this spare area, with at least one the many relatively block of number of times of erasing among the block that is marked at this spare area; B. when extraction is used for first block in this replacement district from this spare area, if move this first block when the number of times of erasing of the block of the number of times of erasing≤this hot-zone of this first block adds first threshold value to this replacement district, if the number of times of erasing of the block of the number of times of erasing>this hot-zone of this first block move block in this hot-zone when adding this first threshold value one of them to this replacement district and this first block is labeled as the block of this hot-zone; And c. carries out consume adjustment program, wherein this consume adjustment program comprises: one of them of this at least one block in this hot-zone moved to this data field, simultaneously the 3rd block of this data field is moved to this spare area and the 3rd block is labeled as the block of this hot-zone, wherein the 3rd block is the block that has the number of times of erasing relatively less among this data field.
In one embodiment of this invention, above-mentioned average abrasion method also comprises: extract second block that is used for the transient state district from the spare area, wherein second block is the block that has the number of times of erasing relatively less among the spare area.
In one embodiment of this invention, above-mentioned average abrasion method also comprises: then count value is added 1 when the intermediate value of maximum erase number of times and the minimum number of times of erasing among the number of times of erasing of the number of times of erasing>all blocks of the block of hot-zone adds second threshold value; And when count value during, then execution in step c and replacement count value greater than the 3rd threshold value.
In one embodiment of this invention, above-mentioned average abrasion method also comprises: when execution writes or erases instruction, then count value is added 1; And when count value during, then execution in step c and replacement count value greater than the 3rd threshold value.
In one embodiment of this invention, above-mentioned average abrasion method also comprises: execution in step c then when the intermediate value of maximum erase number of times and the minimum number of times of erasing among the number of times of erasing of the number of times of erasing>all blocks of the block of hot-zone adds the 4th threshold value.
In one embodiment of this invention, above-mentioned average abrasion method also comprises with random fashion execution in step c.
In one embodiment of this invention, above-mentioned average abrasion method also comprise at least one block at least one zone of setting up the corresponding data district erase frequency table, spare blocks erase frequency table, replace block frequency table and the transient state block frequency table of erasing of erasing, it is respectively in order to the number of times of erasing of the block in recorded data zone, spare area, replacement district and transient state district.
In one embodiment of this invention, above-mentioned to set up at least one the data block frequency table of erasing be to set up with counterlogic physics mapping table, and wherein at least one block frequency table of erasing is that counterlogic physics mapping table comes the number of times of erasing of the block of recorded data zone respectively.
In one embodiment of this invention, above-mentioned average abrasion method comprises that also the execution host side writes instruction normally and comes completing steps c.
The invention provides a kind of controller, it is applicable to storage device, the nonvolatile memory of this storage device is divided into a plurality of blocks in fact and those blocks are grouped into data field, spare area, replacement district and transient state district at least, this controller comprises: non-volatile memory interface, in order to this nonvolatile memory of access; And memory management module, in order to manage this nonvolatile memory, wherein this memory management module can be carried out average abrasion method, this average abrasion method comprises: a. distinguishes a hot-zone in this spare area, with at least one the many relatively block of number of times of erasing among the block that is marked at this spare area; B. when extraction is used for first block in this replacement district from this spare area, if move this first block when the number of times of erasing of the block of the number of times of erasing≤this hot-zone of this first block adds first threshold value to this replacement district, if the number of times of erasing of the block of the number of times of erasing>this hot-zone of this first block move block in this hot-zone when adding this first threshold value one of them to this replacement district and this first block is labeled as the block of this hot-zone; And c. carries out consume adjustment program, wherein this consume adjustment program comprises: one of them of this at least one block in this hot-zone moved to this data field, simultaneously the 3rd block of this data field is moved to this spare area and the 3rd block is labeled as the block of this hot-zone, wherein the 3rd block is the block that has the number of times of erasing relatively less among this data field.
In one embodiment of this invention, above-mentioned average abrasion method also comprises: extract second block that is used for the transient state district from the spare area, wherein second block is the block that has the number of times of erasing relatively less among the spare area.
In one embodiment of this invention, above-mentioned average abrasion method also comprises: then count value is added 1 when the intermediate value of maximum erase number of times and the minimum number of times of erasing among the number of times of erasing of the number of times of erasing>all blocks of the block of hot-zone adds second threshold value; And when count value during, then execution in step c and replacement count value greater than the 3rd threshold value.
In one embodiment of this invention, above-mentioned average abrasion method also comprises: when execution writes or erases instruction, then count value is added 1; And when count value during, then execution in step c and replacement count value greater than the 3rd threshold value.
In one embodiment of this invention, above-mentioned average abrasion method also comprises: execution in step c then when the intermediate value of maximum erase number of times and the minimum number of times of erasing among the number of times of erasing of the number of times of erasing>all blocks of the block of hot-zone adds the 4th threshold value.
In one embodiment of this invention, above-mentioned average abrasion method also comprises with random fashion execution in step c.
In one embodiment of this invention, above-mentioned average abrasion method comprises that also the execution host side writes instruction normally and comes completing steps c.
In one embodiment of this invention, above-mentioned average abrasion method also comprises when erasing or write block, increases the number of times of erasing of the block of erasing.
The present invention proposes a kind of average abrasion method that is used for nonvolatile memory, wherein this nonvolatile memory is divided into a plurality of blocks in fact and those blocks are grouped into data field, spare area and replacement district at least, this average abrasion method comprises: a. distinguishes a hot-zone in this spare area, with at least one the many relatively block of number of times of erasing among the block that is marked at this spare area; B. extract second block that is used for this transient state district from this spare area, wherein this second block is the block that has the number of times of erasing relatively less among this spare area; And c. carries out consume adjustment program, wherein this consume adjustment program comprises that with this at least one block in this hot-zone one of them move to this data field, simultaneously the 3rd block of this data field is moved to this spare area and the 3rd block is labeled as the block of this hot-zone, wherein the 3rd block is the block that has the number of times of erasing relatively less among this data field.
In one embodiment of this invention, also comprise: when extraction is used for first block in this replacement district from this spare area, if move first block when number of times of erasing of the block of the number of times≤hot-zone of erasing of first block adds first threshold value to replacing the district, if the number of times of erasing of the block of the number of times>hot-zone of erasing of first block is moved one of them block of extremely replacing the district and first block being labeled as the hot-zone of the block in the hot-zone when adding first threshold value.
In one embodiment of this invention, above-mentioned average abrasion method also comprises: then count value is added 1 when the intermediate value of maximum erase number of times and the minimum number of times of erasing among the number of times of erasing of the number of times>block of erasing of the block of hot-zone adds second threshold value; And when count value during, then execution in step c and replacement count value greater than the 3rd threshold value.
In one embodiment of this invention, above-mentioned average abrasion method also comprises: when execution writes or erases instruction, then count value is added 1; And when count value during, then execution in step c and replacement count value greater than the 3rd threshold value.
In one embodiment of this invention, above-mentioned average abrasion method also comprises: execution in step c then when the intermediate value of maximum erase number of times and the minimum number of times of erasing among the number of times of erasing of the number of times>block of erasing of the block of hot-zone adds the 4th threshold value.
The invention provides a kind of controller, it is applicable to storage device, the nonvolatile memory of this storage device is divided into a plurality of blocks in fact and those blocks are grouped into data field, spare area and replacement district at least, this controller comprises: non-volatile memory interface, in order to this nonvolatile memory of access; Memory buffer is in order to storage data temporarily; Microprocessing unit is in order to control the overall operation of this controller; And memory management module, in order to manage this nonvolatile memory, wherein this memory management module can be carried out average abrasion method, this average abrasion method comprises: a. distinguishes a hot-zone in this spare area, with at least one the many relatively block of number of times of erasing among the block that is marked at this spare area; B. extract second block that is used for this transient state district from this spare area, wherein this second block is the block that has the number of times of erasing relatively less among this spare area; And c. carries out consume adjustment program, wherein this consume adjustment program comprises that with this at least one block in this hot-zone one of them move to this data field, simultaneously the 3rd block of this data field is moved to this spare area and the 3rd block is labeled as the block of this hot-zone, wherein the 3rd block is the block that has the number of times of erasing relatively less among this data field.
In one embodiment of this invention, above-mentioned average abrasion method also comprises: when extraction is used for first block in this replacement district from this spare area, if move first block when number of times of erasing of the block of the number of times≤hot-zone of erasing of first block adds first threshold value to replacing the district, if the number of times of erasing of the block of the number of times>hot-zone of erasing of first block is moved one of them block of extremely replacing the district and first block being labeled as the hot-zone of the block in the hot-zone when adding first threshold value.
In one embodiment of this invention, above-mentioned average abrasion method also comprises: then count value is added 1 when the intermediate value of maximum erase number of times and the minimum number of times of erasing among the number of times of erasing of the number of times>block of erasing of the block of hot-zone adds second threshold value; And when count value during, then execution in step c and replacement count value greater than the 3rd threshold value.
In one embodiment of this invention, above-mentioned average abrasion method also comprises: when execution writes or erases instruction, then count value is added 1; And when count value during, then execution in step c and replacement count value greater than the 3rd threshold value.
The invention provides a kind of average abrasion method that is used for nonvolatile memory, wherein nonvolatile memory is divided into a plurality of blocks in fact and this a little blocks are grouped into data field, spare area, replacement district and transient state district at least, this average abrasion method comprises: a. distinguishes the hot-zone in the spare area, with at least one the many relatively block of number of times of erasing among the block that is marked at the spare area; B. from the spare area, extract first block that is used to replace the district; C. the number of times comparison particular value of erasing with the hot-zone is the Rule of judgment of counting; And d. is when count value during greater than the 3rd threshold value, carry out consume adjustment program, wherein this consume adjustment program comprises that with this at least one block in this hot-zone one of them move to this data field, simultaneously the 3rd block of this data field is moved to this spare area and the 3rd block is labeled as the block of this hot-zone, wherein the 3rd block is the block that has the number of times of erasing relatively less among this data field.
In one embodiment of this invention, above-mentioned Rule of judgment comprises: then count value is added 1 when the number of times>particular value of erasing of the block of hot-zone adds second threshold value.
In one embodiment of this invention, above-mentioned particular value is the intermediate value of maximum erase number of times and the minimum number of times of erasing among the number of times of erasing of block.
In one embodiment of this invention, above-mentioned average abrasion method also comprise at least one block at least one zone of setting up the corresponding data district erase frequency table, spare blocks erase frequency table, replace block frequency table and the transient state block frequency table of erasing of erasing, it is respectively in order to the number of times of erasing of the block in recorded data zone, spare area, replacement district and transient state district.
The present invention proposes a kind of average abrasion method, and it can in time on average use memory block, and the wearing and tearing of average memory block thus are to prolong the serviceable life of storer.
For above-mentioned feature and advantage of the present invention can be become apparent, preferred embodiment cited below particularly, and cooperate appended graphicly, be described in detail below.
Description of drawings
Figure 1A illustrates the main frame that uses the non-volatile memory storage device according to first embodiment of the invention.
Figure 1B is the detailed block diagram that illustrates the device of non-volatile memory storage shown in Figure 1A.
Fig. 1 C is the calcspar that illustrates controller according to another embodiment of the present invention.
Fig. 2 A and 2B are the detailed block diagram that illustrates nonvolatile memory 124 and running thereof according to first embodiment of the invention.
Fig. 3 is the process flow diagram that illustrates average abrasion method according to first embodiment of the invention.
Fig. 4 A illustrates the erase synoptic diagram of frequency table of logical physical mapping table and block according to first embodiment of the invention.
Fig. 4 B illustrates the erase synoptic diagram of frequency table of spare block table and spare blocks according to first embodiment of the invention.
Fig. 4 C illustrates according to first embodiment of the invention to replace block table and replace the erase synoptic diagram of frequency table of block.
Fig. 4 D illustrates the erase synoptic diagram of frequency table of transient state block table and transient state block according to first embodiment of the invention.
Fig. 5 is the process flow diagram that illustrates average abrasion method according to second embodiment of the invention.
Fig. 6 is the process flow diagram that illustrates average abrasion method according to third embodiment of the invention.
Fig. 7 is the process flow diagram that illustrates average abrasion method according to fourth embodiment of the invention.
Fig. 8 is the applicable schematic representation of apparatus of average abrasion method that illustrates the embodiment of the invention.
[main element label declaration]
100: main frame
102: microprocessor
104: random access memory
106: input/output device
108: system bus
110: data transmission interface
120: the non-volatile memory storage device
122: controller
122a: memory management module
122b: non-volatile memory interface
122c: host computer transmission interface
122d: memory buffer
122e: program storage
122f: error correction module
122g: power management module
122h: microprocessing unit
124: nonvolatile memory
124-0,124-1,124-2,124-N: block
202: system region
204: the data field
206: the spare area
208: replace the district
210: the transient state district
M, C, T: block
S1310, S1310 ', S1310 ", S1320, S1320 ': step
S301, S303, S305, S307, S309, S311, S313, S315, S317, S319, S321, S323, S317 ', S323 ': step
401: logical physical mapping table
402: the block frequency table of erasing
403: spare block table
404: the spare blocks frequency table of erasing
405: replace block table
406: replace the block frequency table of erasing
407: the transient state block table
408: the transient state block frequency table of erasing
The 802:USB flash disc
804: digital camera
The 804a:SD card
The 804b:MMC card
The 804c:CF card
804d: memory stick
806: solid state hard disc
Embodiment
Generally speaking nonvolatile memory storage system comprises nonvolatile memory and controller (control chip).Usually nonvolatile memory storage system can be used with host computer system, so that host computer system can write to data nonvolatile memory storage system or reading of data from nonvolatile memory storage system.In addition, nonvolatile memory storage system also being arranged is to comprise embedded non-volatile memory and can be executed on the host computer system with substantially as the software of the controller of this embedded flash memory.
[first embodiment]
Figure 1A illustrates the main frame that uses the non-volatile memory storage device according to first embodiment of the invention.
Please refer to Figure 1A, main frame 100 generally comprise microprocessor 102, random access memory (randomaccess memory, RAM) 104, I/O (input/output, I/O) device 106, system bus 108 and data transmission interface 110.It must be appreciated that main frame 100 can also comprise other element, for example display equipment or network equipment etc.
Main frame 100 can be systems such as computing machine, digital camera, video camera, communicator, audio player or video player.Generally speaking, but main frame 100 can be any system of storage data substantially.
Non-volatile memory storage device 120 is to electrically connect by data transmission interface 110 other element with main frame 100 in embodiments of the present invention.Data can be write to non-volatile memory storage device 120 or reading of data from non-volatile memory storage device 120 by microprocessor 102, random access memory 104 with the processing of input/output device 106.
Figure 1B is the detailed block diagram that illustrates the device of non-volatile memory storage shown in Figure 1A.
Please refer to Figure 1B, non-volatile memory storage device 120 generally comprises controller 122 and nonvolatile memory 124.
Controller 122 is in order to the overall operation of control non-volatile memory storage device 120, for example storage of data, reads and erases etc.Controller 122 comprises memory management module 122a, memory buffer 122d, microprocessing unit 122h and non-volatile memory interface 122b.
Memory management module 122a for example carries out average abrasion (wear leveling) method, bad block management, safeguards mapping table (mapping table) etc. in order to managing non-volatile memory 124.
Non-volatile memory interface 122b is in order to access nonvolatile memory 124, and just main frame 100 data desiring to write to can be converted to 124 receptible forms of nonvolatile memory via non-volatile memory interface 122b.
Memory buffer 122d is in order to stocking system data (for example mapping table) temporarily or data that main frame read or write.In the present embodiment, memory buffer 122d be static RAM (static random access memory, SRAM).Yet, it must be appreciated that the invention is not restricted to this, dynamic RAM (DRAM), reluctance type storer (MRAM), Ovonics unified memory (PRAM) or other storer that is fit to also can be applicable to the present invention.
Microprocessing unit 122h is in order to the overall operation of control controller 122.
Nonvolatile memory 124 is in order to storage data.Nonvolatile memory 124 is a flash memory in this enforcement, and more particularly, nonvolatile memory 124 is multilayer storage unit (Multi Level Cell, MLC) anti-(NAND) flash memory that reaches.But it must be appreciated, the invention is not restricted to this, for example nonvolatile memory 124 also can be individual layer storage unit (Single Level Cell, SLC) the anti-flash memory that reaches.
In another embodiment of the present invention, controller also comprises host computer transmission interface 122c, program storage 122e, error correction module 122f and power management module 122g (shown in Fig. 1 C 122 ').
Host computer transmission interface 122c in order to main frame 100 communications, host computer transmission interface 122c can be USB interface, IEEE 1394 interfaces, SATA interface, PCI Express interface, MS interface, MMC interface, SD interface, CF interface or ide interface.
Program storage 122e is in order to the performed procedure code in order to control non-volatile memory storage device 120 of store controller.
Error correction module 122f checks and proofreaies and correct the data that main frame reads or writes in order to miscount correcting code (error correcting code).
Power management module 122g is in order to the power supply of managing non-volatile memory storage device 120.
Nonvolatile memory 124 is divided into a plurality of physical blocks (physicalblock) 124-0 to 124-N usually in fact, followingly for convenience of description abbreviates physical blocks as block.Generally speaking, block is the least unit of erasing in flash memory.That is each block contains the storage unit of being erased in the lump of minimal amount.Each block can be divided into several pages or leaves (page) usually.Page or leaf is generally the minimum unit of program (program), but what will specify is in some different flash memory design, and minimum program unit also can be a sector (sector) size, a plurality of sectors are promptly arranged in one page and is the minimum unit of program with a sector.In other words, page or leaf is for writing the minimum unit of data or reading of data.Each page or leaf generally includes user data field D and redundant area R.The user data field is in order to storing user's data, and redundant area is in order to the data of stocking system (for example, above-mentioned ECC code).
Be sector (sector) size corresponding to disc driver, generally speaking, user data field D is generally 512 bytes, and redundant area R is generally 16 bytes.Just, one page is a sector.Yet, can also form one page in a plurality of sectors, for example one page comprises 4 sectors.Generally speaking, block can be formed for example 64 pages, 128 pages, 256 pages etc. by the page or leaf of arbitrary number.Block 124-0 to 124-N can be grouped into several zones (zone) usually, and coming diode-capacitor storage with the zone is to operate independently of one another with the parallel degree of increase operation execution and the complexity of streamlining management in a way.
When some block of nonvolatile memory 124 during by program constantly (for example repeatedly write and erase), these a little blocks generally speaking can be more not by the block of program constantly quick-wearing more.Wearing and tearing for the block in the average nonvolatile memory 124 effectively, can automatically reduce use by average abrasion method proposed by the invention and be used not by the block of persister by the block of persister, prolong the life-span of nonvolatile memory 124 thus.
Below will be and cooperate the running of graphic detailed description nonvolatile memory according to the present invention.It must be appreciated that using speech such as " extraction ", " moving ", " exchange " to operate flash memory block in the following description is in logic notion.That is to say that the physical location of flash memory block is not changed, but in logic flash memory block is operated.
Fig. 2 A and 2B are the detailed block diagram that illustrates nonvolatile memory 124 and running thereof.
Please refer to Fig. 2 A, in embodiments of the present invention, for program efficiently (promptly write and erase) nonvolatile memory 124, the block 124-1 to 124-N of nonvolatile memory 124 can logically be grouped into system region 202, data field 204 and spare area 206.In general, the block that belongs to data field 204 in the nonvolatile memory 124 can account for more than 90%, remaining system region 202 and the spare area 206 of being only.
Block in the system region 202 is in order to the register system data, and system data for example is about the number of pages of the number of regions of nonvolatile memory 124, block counts that each is regional, each block, logical physical mapping table etc.
Block in the data field 204 is in order to store user's data, in general is exactly the operated pairing block of logical block addresses of main frame 100.
Therefore block in the spare area 206 is in order to the block in the replacement data district 204, and the block in spare area 206 be the block of sky, i.e. no record data or be labeled as invalid data useless.Specifically, because if will be when writing Data Position and write data once more, the operation that execution is earlier erased.Yet the flash memory unit of writing is a page or leaf as previously mentioned, and the unit of erasing is a block.A unit of erasing is greater than the unit that writes, and this expression be if will carry out the block erase operation for use, just can carry out after must be first active page in the block of desiring to erase being copied to other block.Therefore, when writing new data among the block M that desires in data field 204, to have write Data Position, generally can in spare area 206, extract a block C, after then the valid data among the block M being copied to block C and new data being write block C, move to the spare area 206 after block M erased and simultaneously block C is moved to the data field 204.It must be appreciated that moving to the spare area 206 after block M is erased, simultaneously block C to be moved to the data field 204 be in logic block M to be associated with spare area 206 and block C is associated with data field 204.Wherein those skilled in the art's logical relation that all can understand block in the data field 204 can be safeguarded by logical physical mapping table.
In embodiments of the present invention, in order to use nonvolatile memory 124 more efficiently, block 124-1 to 124-N logically also is divided into replacement district 208 and transient state district 210.
Please refer to Fig. 2 B, replacing district 208 is in order to temporarily to deposit the block of the block of preparing replacement data district 204.More specifically, when the block C of above-mentioned spare area 206 is extracted the block M that replaces data field 204, new data can be gone into to block C in embodiments of the present invention, but can at once the valid data among the block M not moved to block C and the block M that erases.Therefore this is because it is invalid that the valid data among the block M might become in next operation, at once the valid data among the block M moved to physical blocks C and can be caused meaningless moving.In embodiments of the present invention, the block C that can will write new data temporarily is associated as and replaces the district, and in the mapping of logical block addresses and physical blocks address, can write down the situation that a plurality of physical blocks address corresponds to a logical block addresses, just the content integration of block M and block C gets up to be only the content of institute's mapping logical blocks, promotes the service efficiency of block thus.The relation of these mother and child blocks (block M and block C) can be decided according to the size of memory buffer 122d in the controller 122, is to do in fact with five groups in embodiments of the present invention.
The function in transient state district 210 is similar with replacement district 208.As mentioned above, be to use the MLC nand flash memory in embodiments of the present invention.Can comprise 4 sectors in 1 page of this MLC nand flash memory, the sector of 4 512 bytes promptly be arranged, altogether 2K bytes in 1 page.As mentioned above, flash memory is to be unit with the page or leaf writing fashionable, and therefore at every turn necessary 4 sectors of program under the situation of using the MLC nand flash memory can be caused the waste of resource thus when writing small amount of data.In embodiments of the present invention, transient state district 210 is in order to temporarily to deposit this type of low volume data.Specifically, when the data of desiring to write the block C that replaces district 208 during, can from spare area 206, extract a block T as mentioned above, then this small amount of data be write to block T and block T is associated as transient state district 210 for the small amount of data of a discontented page or leaf.Afterwards, when the follow-up data volume that writes enough writes one page, again these a little data are write to block C, and then block T is erased and from transient state district 210, move to the spare area 206.
What deserves to be mentioned is, the logic enantiomorphic relationship of above-mentioned block during the running of non-volatile memory storage device can be in memory buffer 122d continuous updating, and for example a little information are recorded in the block of system region 202 with this after the non-volatile memory storage device finishes running or the certain number of times of every operation.Wherein these a little logic enantiomorphic relationship can be come record with logical physical mapping table, spare block table, replacement block table and transient state block table, and these a little forms will describe in detail at following cooperation Fig. 4 A-4D.
In general, the block that exchanges between data field 204 and spare area 206 through regular meeting is called the dynamic data block.In embodiments of the present invention, the design of use replacing district 208 and transient state district 210 be for the use that makes the dynamic data block more efficient.In addition, in data field 204, often there are some data to write the back and just do not change for a long time, for example have 100 first MP3 songs to be the music that the user likes in the data field 204, never go again after writing to change.The block that stores these type of data is called the static data block.The static data block is owing to seldom change, so its number of times of erasing can be low relatively.In the invention process, the memory management module 122a of controller 122 can carry out average abrasion method, with the wearing and tearing of average block 124-1 to 124-N effectively.
Fig. 3 is the process flow diagram that illustrates the performed average abrasion method of above-mentioned controller 122, uses memory block to reach the purpose of average abrasion when it is used for the program storage block fifty-fifty.Average abrasion method of the present invention comprises according to different purposes to extract block (step S1310) and carry out consume adjustment program (step S1320) from the spare area according to different Rule of judgment.Below will cooperate Fig. 3 to describe average abrasion method in detail.
Please refer to Fig. 3,, must write down the number of times of erasing of nonvolatile memory 124 intra block 124-1 to 124-N for the wearing and tearing of average block.In step S301, when initialization non-volatile memory storage device 120, can set up or load at least one data block frequency table, the spare blocks frequency table, of erasing of erasing and replace block frequency table and the transient state block frequency table of erasing of erasing.Specifically, then can not rebulid when erasing frequency table,, then it is loaded among the memory buffer 122d of controller 122 if store this in the system region 202 when erasing frequency table if the system region 202 of nonvolatile memory 124 stores this.
Fig. 4 A illustrates the erase synoptic diagram of frequency table of logical physical mapping table and block according to the embodiment of the invention.Fig. 4 B illustrates the erase synoptic diagram of frequency table of spare block table and spare blocks according to the embodiment of the invention.Fig. 4 C illustrates according to the embodiment of the invention to replace block table and replace the erase synoptic diagram of frequency table of block.Fig. 4 D illustrates the erase synoptic diagram of frequency table of transient state block table and transient state block according to the embodiment of the invention.
Please refer to Fig. 4 A, the position of logical physical mapping table 401 is logical block addresses (logical blockaddress, LBA), value in address LBA for this reason corresponds to nonvolatile memory 124 internal physical block address (physical block address, PBA), the block of data field 204 just.Base this, set up one with the form of logical physical mapping epiphase with the dimension size, be called the block frequency table 402 of erasing, this form is in order to write down the number of times of erasing of the PBA of correspondence in all logical physical mapping tables.For instance, the value of the 3rd address LBA 2 is 100 in the logical physical mapping table 401, and the value of the 3rd position of frequency table 402 is 50 and block is erased, and represent that then LBA 2 corresponds to physical blocks 100, and the number of times of erasing of physical blocks 100 is 50.What deserves to be mentioned is, as mentioned above for convenient management, generally the physical blocks of nonvolatile memory can be divided into several zones (Zone), therefore in fact logical physical mapping table can be set up according to the number in zone.For example, physical blocks is divided into 8 when regional, then can sets up 8 logical physical mapping tables.In the present invention, also can be according to the block that the number of logical physical mapping table the is set up similar number frequency table of erasing.For convenience of description, be to be example in the present embodiment with a zone.
In the invention process, when the block in the main frame 100 continuous access logical physical mapping tables 401, controller 122 frequency table of can the real-time update block erasing, and can erase and write in the busy time of block, scan whole block the erase block of least number of times of frequency table 402 and record of erasing.When nonvolatile memory 124 being divided under N the regional situation as above-mentioned, controller 122 can write down the erase number of times of erasing of block of the minimum number of times of erasing of tool in the frequency table 402 of N data block respectively, each minimum that is relatively write down from N data block erased frequency table 402 number of times of erasing again, record has the block of the minimum number of times of erasing then.
Please refer to Fig. 4 B, spare block table 403 is that record is associated with the block of spare area 206, and the spare blocks frequency table 404 of erasing then is the number of times of erasing that writes down the block in each spare area 206 according to spare block table 403.For example, if during first location records 110 of spare block table 403, and spare blocks is when erasing first location records 55 of frequency table 404, and expression block 110 belongs to spare area 206 at present and its number of times of erasing is 55.
Please refer to Fig. 4 C, replacing block table 405 is that record is associated with the block of replacing district 208, and replacing the block frequency table 406 of erasing then is to write down the number of times of erasing that each replaces the block in the district 208 according to replacing block table 405.For example, if when replacing first location records 120 of block table 405, and when replacing block and erasing first location records 60 of frequency table 406, expression block 120 belongs at present replaces district 208 and its number of times of erasing is 60.
Please refer to Fig. 4 D, similarly, transient state block table 407 is that record belongs to the block in transient state district 210, and the transient state block frequency table 408 of erasing then is the number of times of erasing that writes down the block in each transient state district 210 according to transient state block table 407.For example, if during first location records 130 of transient state block table 407, and the transient state block is when erasing first location records 40 of frequency table 408, and expression block 130 belongs to transient state district 210 at present and its number of times of erasing is 40.
What deserves to be mentioned is, during the running of non-volatile memory storage device when erasing block, the then above-mentioned frequency table of erasing can be in memory buffer 122d continuous updating, and for example can a little information be recorded in the block of system region 202 with this after non-volatile memory storage device 120 finishes running or the certain number of times of every operation, this backup operation is to avoid losing these a little block table of having upgraded and erasing frequency table because of undesired outage.
Refer again to Fig. 3, in step S303, can in spare area 206, distinguish a hot-zone 206a, the many relatively block of number of times of erasing among the block with mark spare area 206.Specifically, the block of number of times more than relative of erasing searched and write down to the spare block table that can set up or load according to step S301 and the spare blocks frequency table of erasing.At this, it must be appreciated that so-called many relatively number of times of erasing mean have the maximum or more number of times of erasing among specific several blocks, for example the block table of the more number of times of erasing is shown in the block of number of times more than the wear leveling number of times of the block of spare area of erasing in the spare area among the block of spare area.Because the block in the spare area 206 is extracted block as an alternative through regular meeting, so the purpose of mark hot-zone 206a is to wish not extract as far as possible the more block of number of times of erasing in the spare area 206.What deserves to be mentioned is that though in embodiments of the present invention, hot-zone 206a only indicates a block that the number of times of erasing is more, in another embodiment of the present invention, the more block of the signable a plurality of number of times of erasing of hot-zone 206a, for example 2 or 3.
When desire is carried trivial (when being the program storage block) from spare area 206, can judge that in step S305 the block that desire is extracted is to be used for replacing district 208 or transient state district 210.That is to say, in average abrasion method, can judge that when from spare area 206, carrying trivial the block that desire is extracted is to be used for general data to use (replacing district 208) or temporary transient storage data to use (transient state district 210).Specifically, can be to be used to replace district 208 or transient state district 210 and different extraction Rule of judgment is arranged according to the block that is extracted in embodiments of the present invention.
If judge that in step S305 the block that desire is extracted is to be used for replacing the district at 208 o'clock, then can from spare area 206, extract in order in step S307 block (the following block that this extraction is used for replacing district 208 is called first block) and can judge whether to satisfy the condition of EC1≤(ECH+P1) at step S309, wherein EC1 represents that the number of times of erasing, the ECH of first block represent that erase number of times and the P1 of the block among the 206a of hot-zone represent first threshold value.Particularly, first threshold value is the number that determines according to the average abrasion effect that expection reaches, and in the present embodiment, first threshold value can be any number of 10~50, and wherein the best is 20.In addition, in another embodiment of the present invention, if indicate when surpassing a block among the 206a of hot-zone, ECH represents it is the number of times of erasing of arbitrary block in the 206a of hot-zone.
If when in step S309, judging EC1≤(ECH+P1), then in step S311, first block can be moved to replacing district 208.Specifically, so-called moving can produce first block and related the related of first block and spare area 206 of cancelling simultaneously of replacing district 208 in step S311.If when in step S309, judging EC1>(ECH+P1), then in step S313, can distinguish 208 block to replace first block as moving with the block of hot-zone 206a to replacing.Specifically, the block that can produce in step S313 among the 206a of hot-zone is distinguished 208 the related block of cancelling the related of block in the hot-zone and spare area 206 simultaneously and afterwards first block being labeled as hot-zone 206a with replacing.
In addition, in another embodiment of the present invention,, then can come to exchange with arbitrary block among the 206a of hot-zone with first block if indicate among the 206a of hot-zone when surpassing a block.
If judging the block that is extracted in step S305 is when being used for transient state district 210, then in step S315, can be chosen in the few relatively block of number of times of erasing among the block of spare area 206 (the following block that this extraction is used for transient state district 210 is called second block) and moves to transient state district 210.Just, cancel related the related of second block and transient state district 210 that produce simultaneously of second block and spare area 206.At this, it must be appreciated that so-called few relatively number of times of erasing means have the minimum or less number of times of erasing among specific several blocks, for example the block table of the less number of times of erasing is shown in the block of wear leveling number of times that the number of times of erasing in the spare area is less than the block of spare area among the block of spare area.
In average abrasion method, from the spare area, extract and also comprise the block and start and carry out consume adjustment program (step S1320) except that the different purposes of above-mentioned foundation.In the present embodiment, can compare the Rule of judgment that a particular value is a counting with the number of times of erasing of hot-zone.Specifically, after from spare area 206, extracting block, judge whether to satisfy ECH>(ECL+ECS)/2+P2 condition (step S317).Wherein ECL and ECS represent data field 204, spare area 206 respectively, replace in all blocks in district 208 and the transient state district 210 maximum number of times and the minimum number of times of erasing of erasing, but need according to different designs, also only wherein specific data field of choosing or block define maximum and minimum erase number of times ECL and ESC, and P2 represents second threshold value.In embodiments of the present invention, second threshold value is the number that determines according to the average abrasion effect that expection reaches, in the present embodiment second threshold value be to make value that (ECL+ECS)/2+P2 calculated than ECL with the average big of ECS but the positive count littler than ECL.If in step S317, judge when satisfying ECH>(ECL+ECS)/2+P2, then in step S319, count value can be added 1 accumulative total in memory buffer 122d.
In another embodiment of the present invention, the condition that increases count value also when execution writes or erases just this count value add 1 accumulative total and in memory buffer 122d, (do not illustrate).
In step S321, can judge that whether count value is greater than the 3rd threshold value.Wherein the 3rd threshold value is the number that determines according to the average abrasion effect that expection reaches.In the present embodiment, the 3rd threshold value can be a positive count, and wherein the 3rd threshold value is 10 in the present embodiment.If judging count value in step S321 is during greater than the 3rd threshold value, then in step S323, can among data field 204, selects to have the few relatively block of number of times (hereinafter referred to as the 3rd block) of erasing and come block exchange and replacement count value (for example resetting to 0) with hot-zone 206a.Just, what produce block and data field 204 among the 206a of hot-zone relatedly cancels the related of block among the 206a of hot-zone and spare area 206 simultaneously, and produces the 3rd block and the related of spare area 206 and the block that the 3rd block is labeled as hot-zone 206a is cancelled simultaneously related (promptly the consuming the adjustment program) of the 3rd block and data field 204.
In addition, have among another embodiment of a plurality of blocks at hot-zone 206a, then the 3rd block can exchange with blocks arbitrary or the relative number of times of erasing of tool among the 206a of hot-zone more.
In another embodiment of the present invention,, then can select to have the block of corresponding maximum LBA as the 3rd block if in step S323, also comprise when having the block of the minimum number of times of erasing of a plurality of tools among the block of data field 204.
In another embodiment of the present invention, if in step S323, also comprise when having the block of the minimum number of times of erasing of a plurality of tools among the block of data field 204, then can select to have corresponding minimum LBA or arbitrarily at random the block of LBA as the 3rd block.
What deserves to be mentioned is that in another embodiment of the present invention, the execution of step S323 is to write instruction normally by controller 122 execution main frames 100 to finish.Specifically, in the present embodiment, when execution in step S323, controller 122 can be carried out and write instruction, and the data of desiring to write are null set, carry out the instruction that generally writes of the mode of above-mentioned generation mother and child blocks thus and replace block and the 3rd block of hot-zone 206a.
[second embodiment]
The erase record of number of times of running of the hardware structure of second embodiment of the invention, nonvolatile memory and block is to be same as first embodiment (as Figure 1A~1B, 2A~2B, 4A~4D), therefore in this no longer repeat specification.Second embodiment and first embodiment institute difference are that second embodiment only extracts the block that is used to replace the district and set rule in average abrasion method.
Fig. 5 is according to the process flow diagram that illustrates average abrasion in second embodiment of the invention.Please refer to Fig. 5, process flow diagram shown in Figure 5 and its difference of process flow diagram shown in Figure 3 are that the step S1310 ' of Fig. 5 is only for the block extraction setting extracting rule that is used to replace district 208.The extracting rule that is used to replace the block in district 208 at second embodiment is to be same as Fig. 3 with other step of carrying out the consume adjustment, in this no longer repeat specification.
[the 3rd embodiment]
The erase record of number of times of running of the hardware structure of third embodiment of the invention, nonvolatile memory and block is to be same as first embodiment (as Figure 1A~1B, 2A~2B, 4A~4D), therefore in this no longer repeat specification.The 3rd embodiment and first embodiment institute difference are that second embodiment only extracts the setting rule to the block that is used for the transient state district in average abrasion method.
Fig. 6 is according to the process flow diagram that illustrates average abrasion in third embodiment of the invention.Please refer to Fig. 6, process flow diagram shown in Figure 6 and its difference of process flow diagram shown in Figure 3 are the step S1310 of Fig. 6 " only extract and set extracting rule for the block that is used for transient state district 210.The extracting rule and other step of carrying out the consume adjustment that are used for the block in transient state district 210 at the 3rd embodiment are to be same as Fig. 3, in this no longer repeat specification.
[the 4th embodiment]
The erase record of number of times of running of the hardware structure of fourth embodiment of the invention, nonvolatile memory and block is to be same as first embodiment (as Figure 1A~1B, 2A~2B, 4A~4D), therefore in this no longer repeat specification.The 4th embodiment and first embodiment institute difference are that the 4th embodiment simplifies the step that starts adjustment consume program in average abrasion method.
Fig. 7 is according to the process flow diagram that illustrates average abrasion in fourth embodiment of the invention.Please refer to Fig. 7, process flow diagram shown in Figure 6 and its difference of process flow diagram shown in Figure 3 are that the step S317-S323 of Fig. 3 merging originally is reduced to step S1320 ' in Fig. 7, and in addition other step is same as Fig. 3, in this no longer repeat specification.Step S1320 ' comprises and judges whether to satisfy ECH>(ECL+ECS)/2+P2 ' condition (the step S317 ' of Fig. 7) and if start during ECH>(ECL+ECS)/2+P2 ' and carry out above-mentioned consume and adjust program (the step S323 ' of Fig. 7).Wherein P2 ' represents the 4th threshold value.In the present invention, the 4th threshold value is the number that determines according to the average abrasion effect that expection reaches.
Embodiment that what deserves to be mentioned is above-mentioned Fig. 3, Fig. 5, Fig. 6 and Fig. 7 starts down and execution consume adjustment program with specified conditions.Yet, in another embodiment of the present invention, can also random fashion start and execution consume adjustment program (not illustrating).
Be to be applicable to nonvolatile memory according to average abrasion method proposed by the invention, therefore average abrasion method proposed by the invention can be used various with the device of nonvolatile memory as Storage Media.USB flash disc 802 for example shown in Figure 8, digital camera (video camera) 804 employed SD card 804a, mmc card 804b, CF card 804c and memory stick (memory stick) 804d and solid state hard disc 806 etc.Especially solid state hard disc 806 more needs good average abrasion method.
In sum, the average abrasion method wearing and tearing of average memory intra block effectively that are used for nonvolatile memory proposed by the invention prolong life-span of storer thus.Moreover the number of times difference of always erasing of always the erase number of times and the classic method of average abrasion method proposed by the invention not quite can't increase and causes the burden of additionally erasing, however the number of times of erasing that method of the present invention more can the average memory block than classic method.
Though the present invention discloses as above with preferred embodiment; right its is not in order to limit the present invention; any those skilled in the art; without departing from the spirit and scope of the present invention; when can doing a little change and retouching, so protection scope of the present invention is as the criterion when looking appended the claim scope person of defining.

Claims (29)

1. average abrasion method that is used for nonvolatile memory, wherein this nonvolatile memory is divided into a plurality of blocks in fact and those blocks are grouped into data field, spare area, replacement district and transient state district at least, and this average abrasion method comprises:
A. in this spare area, distinguish a hot-zone, with at least one the many relatively block of number of times of erasing among the block that is marked at this spare area;
B. when extraction is used for first block in this replacement district from this spare area, if move this first block when the number of times of erasing of the block of the number of times of erasing≤this hot-zone of this first block adds first threshold value to this replacement district, if the number of times of erasing of the block of the number of times of erasing>this hot-zone of this first block move block in this hot-zone when adding this first threshold value one of them to this replacement district and this first block is labeled as the block of this hot-zone; And
C. carry out consume adjustment program, wherein this consume adjustment program comprises:
One of them of this at least one block in this hot-zone moved to this data field, simultaneously the 3rd block of this data field is moved to this spare area and the 3rd block is labeled as the block of this hot-zone, wherein the 3rd block is the block that has the number of times of erasing relatively less among this data field.
2. the average abrasion method that is used for nonvolatile memory according to claim 1 also comprises:
Extract second block that is used for this transient state district from this spare area, wherein this second block is the block that has the number of times of erasing relatively less among this spare area.
3. the average abrasion method that is used for nonvolatile memory according to claim 1 also comprises:
When adding second threshold value, the intermediate value of maximum erase number of times and the minimum number of times of erasing among the number of times of erasing of the number of times of erasing>those blocks of the block of this hot-zone then count value is added 1; And
When this count value during greater than the 3rd threshold value, then execution in step c and this count value of resetting.
4. the average abrasion method that is used for nonvolatile memory according to claim 1 also comprises:
When execution writes or erases instruction, then count value is added 1; And
When this count value during greater than the 3rd threshold value, then execution in step c and this count value of resetting.
5. the average abrasion method that is used for nonvolatile memory according to claim 1 also comprises:
Execution in step c then when the intermediate value of maximum erase number of times and the minimum number of times of erasing among the number of times of erasing of the number of times of erasing>those blocks of the block of this hot-zone adds the 4th threshold value.
6. the average abrasion method that is used for nonvolatile memory according to claim 1 also comprises:
With random fashion execution in step c.
7. the average abrasion method that is used for nonvolatile memory according to claim 1, also comprise foundation at least one block at least one zone that should the data field erase frequency table, spare blocks erase frequency table, replace block frequency table and the transient state block frequency table of erasing of erasing, it is respectively in order to the number of times of erasing of the block that writes down this data field, this spare area, this replacement district and this transient state district.
8. the average abrasion method that is used for nonvolatile memory according to claim 7, wherein setting up this at least one block frequency table of erasing is to set up with counterlogic physics mapping table, and wherein this at least one block frequency table of erasing is to should logical physical mapping table writing down the number of times of erasing of the block of this data field respectively.
9. the average abrasion method that is used for nonvolatile memory according to claim 1 comprises also that wherein the execution host side writes instruction normally and comes completing steps c.
10. controller, it is applicable to storage device, and the nonvolatile memory of this storage device is divided into a plurality of blocks in fact and those blocks are grouped into data field, spare area, replacement district and transient state district at least, and this controller comprises:
Non-volatile memory interface is in order to this nonvolatile memory of access; And
Memory management module, in order to manage this nonvolatile memory, wherein this memory management module can be carried out average abrasion method, and this average abrasion method comprises:
A. in this spare area, distinguish a hot-zone, with at least one the many relatively block of number of times of erasing among the block that is marked at this spare area;
B. when extraction is used for first block in this replacement district from this spare area, if move this first block when the number of times of erasing of the block of the number of times of erasing≤this hot-zone of this first block adds first threshold value to this replacement district, if the number of times of erasing of the block of the number of times of erasing>this hot-zone of this first block move block in this hot-zone when adding this first threshold value one of them to this replacement district and this first block is labeled as the block of this hot-zone; And
C. carry out consume adjustment program, wherein this consume adjustment program comprises: one of them of this at least one block in this hot-zone moved to this data field, simultaneously the 3rd block of this data field is moved to this spare area and the 3rd block is labeled as the block of this hot-zone, wherein the 3rd block is the block that has the number of times of erasing relatively less among this data field.
11. controller according to claim 10, wherein this average abrasion method also comprises:
Extract second block that is used for this transient state district from this spare area, wherein this second block is the block that has the number of times of erasing relatively less among this spare area.
12. controller according to claim 10, wherein this average abrasion method also comprises:
When adding second threshold value, the intermediate value of maximum erase number of times and the minimum number of times of erasing among the number of times of erasing of the number of times of erasing>those blocks of the block of this hot-zone then count value is added 1; And
When this count value during greater than the 3rd threshold value, then execution in step c and this count value of resetting.
13. controller according to claim 10, wherein this average abrasion method also comprises:
When execution writes or erases instruction, then count value is added 1; And
When this count value during greater than the 3rd threshold value, then execution in step c and this count value of resetting.
14. controller according to claim 10, wherein this average abrasion method also comprises:
Execution in step c then when the intermediate value of maximum erase number of times and the minimum number of times of erasing among the number of times of erasing of the number of times of erasing>those blocks of the block of this hot-zone adds the 4th threshold value.
15. controller according to claim 10, wherein this average abrasion method also comprises:
With random fashion execution in step c.
16. controller according to claim 10, wherein this average abrasion method comprises that also the execution host side writes instruction normally and comes completing steps c.
17. an average abrasion method that is used for nonvolatile memory, wherein this nonvolatile memory is divided into a plurality of blocks in fact and those blocks are grouped into data field, spare area, replacement district and transient state district at least, and this average abrasion method comprises:
A. in this spare area, distinguish a hot-zone, with at least one the many relatively block of number of times of erasing among the block that is marked at this spare area;
B. extract second block that is used for this transient state district from this spare area, wherein this second block is the block that has the number of times of erasing relatively less among this spare area; And
C. carry out consume adjustment program, wherein this consume adjustment program comprises that with this at least one block in this hot-zone one of them move to this data field, simultaneously the 3rd block of this data field is moved to this spare area and the 3rd block is labeled as the block of this hot-zone, wherein the 3rd block is the block that has the number of times of erasing relatively less among this data field.
18. the average abrasion method that is used for nonvolatile memory according to claim 17 also comprises:
When extraction is used for first block in this replacement district from this spare area, if move this first block when the number of times of erasing of the block of the number of times of erasing≤this hot-zone of this first block adds first threshold value to this replacement district, if the number of times of erasing of the block of the number of times of erasing>this hot-zone of this first block move block in this hot-zone when adding this first threshold value one of them to this replacement district and this first block is labeled as the block of this hot-zone.
19. the average abrasion method that is used for nonvolatile memory according to claim 17 also comprises:
When adding second threshold value, the intermediate value of maximum erase number of times and the minimum number of times of erasing among the number of times of erasing of the number of times of erasing>those blocks of the block of this hot-zone then count value is added 1; And
When this count value during greater than the 3rd threshold value, then execution in step c and this count value of resetting.
20. the average abrasion method that is used for nonvolatile memory according to claim 17 also comprises:
When execution writes or erases instruction, then count value is added 1; And
When this count value during greater than the 3rd threshold value, then execution in step c and this count value of resetting.
21. the average abrasion method that is used for nonvolatile memory according to claim 17 also comprises:
Execution in step c then when the intermediate value of maximum erase number of times and the minimum number of times of erasing among the number of times of erasing of the number of times of erasing>those blocks of the block of this hot-zone adds the 4th threshold value.
22. a controller, it is applicable to storage device, and the nonvolatile memory of this storage device is divided into a plurality of blocks in fact and those blocks are grouped into data field, spare area, replacement district and transient state district at least, and this controller comprises:
Non-volatile memory interface is in order to this nonvolatile memory of access;
Memory buffer is in order to storage data temporarily;
Microprocessing unit is in order to control the overall operation of this controller; And
Memory management module, in order to manage this nonvolatile memory, wherein this memory management module can be carried out average abrasion method, and this average abrasion method comprises:
A. in this spare area, distinguish a hot-zone, with at least one the many relatively block of number of times of erasing among the block that is marked at this spare area;
B. extract second block that is used for this transient state district from this spare area, wherein this second block is the block that has the number of times of erasing relatively less among this spare area; And
C. carry out consume adjustment program, wherein this consume adjustment program comprises that with this at least one block in this hot-zone one of them move to this data field, simultaneously the 3rd block of this data field is moved to this spare area and the 3rd block is labeled as the block of this hot-zone, wherein the 3rd block is the block that has the number of times of erasing relatively less among this data field.
23. controller according to claim 22, wherein this average abrasion method also comprises:
When extraction is used for first block in this replacement district from this spare area, if move this first block when the number of times of erasing of the block of the number of times of erasing≤this hot-zone of this first block adds first threshold value to this replacement district, if the number of times of erasing of the block of the number of times of erasing>this hot-zone of this first block move block in this hot-zone when adding this first threshold value one of them to this replacement district and this first block is labeled as the block of this hot-zone.
24. controller according to claim 22, wherein this average abrasion method also comprises:
When adding second threshold value, the intermediate value of maximum erase number of times and the minimum number of times of erasing among the number of times of erasing of the number of times of erasing>those blocks of the block of this hot-zone then count value is added 1; And
When this count value during greater than the 3rd threshold value, then execution in step c and this count value of resetting.
25. controller according to claim 22, wherein this average abrasion method also comprises:
When execution writes or erases instruction, then count value is added 1; And
When this count value during greater than the 3rd threshold value, then execution in step c and this count value of resetting.
26. an average abrasion method that is used for nonvolatile memory, wherein non-this volatile memory are divided into a plurality of blocks in fact and those blocks are grouped into data field, spare area, replacement district and transient state district at least, this average abrasion method comprises:
A. in this spare area, distinguish a hot-zone, with at least one the many relatively block of number of times of erasing among the block that is marked at this spare area;
B. from this spare area, extract first block that is used for this replacement district;
C. the number of times comparison particular value of erasing with this hot-zone is the Rule of judgment of counting; And
D. when this count value during greater than the 3rd threshold value, carry out consume adjustment program, wherein this consume adjustment program comprises that with this at least one block in this hot-zone one of them move to this data field, simultaneously the 3rd block of this data field is moved to this spare area and the 3rd block is labeled as the block of this hot-zone, wherein the 3rd block is the block that has the number of times of erasing relatively less among this data field.
27. the average abrasion method that is used for nonvolatile memory according to claim 26, wherein this Rule of judgment comprises:
When the number of times of erasing of the block of this hot-zone>then count value is added 1 when this particular value adds second threshold value.
28. the average abrasion method that is used for nonvolatile memory according to claim 26, wherein this particular value is the intermediate value of maximum erase number of times and the minimum number of times of erasing among the number of times of erasing of those blocks.
29. the average abrasion method that is used for nonvolatile memory according to claim 26, wherein this average abrasion method comprises that also foundation replaces block frequency table and the transient state block frequency table of erasing of erasing at least one block at least one zone that should data field frequency table, spare blocks frequency table, of erasing of erasing, and it is respectively in order to the number of times of erasing of the block that writes down this data field, this spare area, this replacement district and this transient state district.
CN2007101629881A 2007-10-09 2007-10-09 Average abrasion method and controller using the same Active CN101409108B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2007101629881A CN101409108B (en) 2007-10-09 2007-10-09 Average abrasion method and controller using the same

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2007101629881A CN101409108B (en) 2007-10-09 2007-10-09 Average abrasion method and controller using the same

Publications (2)

Publication Number Publication Date
CN101409108A CN101409108A (en) 2009-04-15
CN101409108B true CN101409108B (en) 2011-04-13

Family

ID=40572073

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2007101629881A Active CN101409108B (en) 2007-10-09 2007-10-09 Average abrasion method and controller using the same

Country Status (1)

Country Link
CN (1) CN101409108B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI409819B (en) 2009-03-03 2013-09-21 Silicon Motion Inc Method of evenly using a plurality of blocks of a flash memory, and associated memory device and controller thereof
CN101989458B (en) * 2009-07-31 2013-10-30 慧帝科技(深圳)有限公司 Method and memory device for averagely using plurality of blocks of flash memory, and controller
FR2977047B1 (en) * 2011-06-22 2013-08-16 Starchip METHOD FOR MANAGING ENDURANCE OF NONVOLATILE MEMORIES
US9116792B2 (en) * 2012-05-18 2015-08-25 Silicon Motion, Inc. Data storage device and method for flash block management
TWI515736B (en) * 2013-07-25 2016-01-01 慧榮科技股份有限公司 Data storage device and flash memory control method
CN105022695A (en) * 2014-04-21 2015-11-04 群联电子股份有限公司 Data storage method, memorizer control circuit unit and memorizer storage device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO1994023432A1 (en) * 1993-03-26 1994-10-13 Cirrus Logic, Inc. Flashmemory mass storage architecture
US6230233B1 (en) * 1991-09-13 2001-05-08 Sandisk Corporation Wear leveling techniques for flash EEPROM systems
CN1441440A (en) * 2002-02-27 2003-09-10 微软公司 Regulating system and method for obtaining uniform wear in flash storage device
CN1698036A (en) * 2002-10-28 2005-11-16 桑迪士克股份有限公司 Tracking the least frequently erased blocks in non-volatile memory systems
CN1701308A (en) * 2002-10-28 2005-11-23 桑迪士克股份有限公司 Maintaining erase counts in non-volatile storage systems
CN1720590A (en) * 2002-10-28 2006-01-11 桑迪士克股份有限公司 Automated wear leveling in non-volatile storage systems

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6230233B1 (en) * 1991-09-13 2001-05-08 Sandisk Corporation Wear leveling techniques for flash EEPROM systems
WO1994023432A1 (en) * 1993-03-26 1994-10-13 Cirrus Logic, Inc. Flashmemory mass storage architecture
CN1441440A (en) * 2002-02-27 2003-09-10 微软公司 Regulating system and method for obtaining uniform wear in flash storage device
CN1698036A (en) * 2002-10-28 2005-11-16 桑迪士克股份有限公司 Tracking the least frequently erased blocks in non-volatile memory systems
CN1701308A (en) * 2002-10-28 2005-11-23 桑迪士克股份有限公司 Maintaining erase counts in non-volatile storage systems
CN1720590A (en) * 2002-10-28 2006-01-11 桑迪士克股份有限公司 Automated wear leveling in non-volatile storage systems

Also Published As

Publication number Publication date
CN101409108A (en) 2009-04-15

Similar Documents

Publication Publication Date Title
CN101419834B (en) Average abrasion method and controller using the method
CN101483067B (en) Flash memory data writing method and flash memory controller
CN101414282B (en) Average abrasion method and controller using the same
CN101464834B (en) Flash memory data write-in method and controller using the same
CN102135942B (en) Method for realizing wear-leveling in storage equipment as well as the storage equipment
CN101634967B (en) Block management method for flash memory, storage system and controller
CN101640069B (en) Average wear method and average wear system for flash memory
CN101499315B (en) Average abrasion method of flash memory and its controller
CN101625897B (en) Data write-in method, storage system and controller used for quick flash memory
CN101571832B (en) Data writing method, quick flashing memory system using same and a controller thereof
CN101409108B (en) Average abrasion method and controller using the same
CN101556555B (en) Block managing method for flash memory as well as controller and storage system thereof
CN101630233B (en) Data access method used for flash memory, storage system and controller
CN101408864B (en) Data protection method for current failure and controller using the same
CN101667157A (en) Flash memory data transmission method, flash memory storage system and controller
CN101425338B (en) Writing method for nonvolatile memory and controller using the method
CN101661431B (en) Block management method for flash memory, flash storage system and controller
CN101527169A (en) Data write-in method for flash memory and controller thereof
CN102890655A (en) Memory storage device, memory controller and valid data recognition method thereof
CN101625661B (en) Data management method, storage system and controller used for flash memory
CN101859278B (en) Data storage method and storage system for flash memory
CN101727397B (en) Block management and change method, flash memory storage system and controller thereof
CN101882111B (en) Data access method, storage system and controller for flash memory
CN101661432B (en) Flash memory block management method, flash memory storage system and controller
CN101788954B (en) Block management method for flash memory, memory system and controller thereof

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant