CN102222044B - The method for writing data of storer and data memory device - Google Patents

The method for writing data of storer and data memory device Download PDF

Info

Publication number
CN102222044B
CN102222044B CN201010148297.8A CN201010148297A CN102222044B CN 102222044 B CN102222044 B CN 102222044B CN 201010148297 A CN201010148297 A CN 201010148297A CN 102222044 B CN102222044 B CN 102222044B
Authority
CN
China
Prior art keywords
block
data
purge
blank
boundary value
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
CN201010148297.8A
Other languages
Chinese (zh)
Other versions
CN102222044A (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.)
Silicon Motion Inc
Original Assignee
Silicon Motion 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 Silicon Motion Inc filed Critical Silicon Motion Inc
Priority to CN201010148297.8A priority Critical patent/CN102222044B/en
Publication of CN102222044A publication Critical patent/CN102222044A/en
Application granted granted Critical
Publication of CN102222044B publication Critical patent/CN102222044B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

The present invention relates to a kind of method for writing data and data memory device of storer, this storer comprises a data field and a clear area, and this data field comprises multiple block of storage data, and this clear area comprises the multiple blank block of non-storage data; First, the write order for write data being write to one first block of this storer is received from a main frame; Then, the one first blank block with checkout time is the earliest chosen from this clear area; Then, check whether that the number of purge of this first blank block is less than or equal to a first boundary value; When the number of purge of this first blank block is less than or equal to this first boundary value, these write data are write this first blank block; Finally, remove the data that this first block stores, enter this clear area to change this first block into blank block juxtaposition.The present invention can make the frequency of utilization of each block of storer impartial, and number of purge is comparatively average, to extend the tenure of use of storer.

Description

The method for writing data of storer and data memory device
Technical field
The present invention relates to memory technology field, more particularly, relate to a kind of method for writing data and data memory device of storer.
Background technology
Flash memory (flash memory) comprises multiple block (block), and each block comprises multiple page (page) for data storing.In addition, each block of flash memory corresponds to different addresses respectively.When the data of main frame for access flash memory, main frame can send access command to the controller of flash memory, and this access command comprises the address of block of institute for accessing.Such as, when flash memory self-controller receives write order, just according to the instruction of controller by some page of the block corresponding to data storing to writing address.When flash memory self-controller receives reading order, just according to the instruction of controller from reading some page of sense data of block corresponding to address and return data to controller.
After multiple pages of a block of flash memory are all written into data, this block just cannot be written into data again.Therefore, multiple blocks of flash memory can be roughly divided into data field and clear area (spare pool) twoth district, and the block of data field is the block of storage data, and the block of clear area is the block of non-storage data.When main frame for write data to corresponding to when being positioned at the address of a block of data field, because this block cannot be written into more new data again, controller just have to obtain a blank block from clear area, the address of this blank block is changed into the address of this block, then will more new data transcription enter to this blank block.Now block is originally out of use, and controller is just erased the data of this block, inserts in clear area so that block is converted to blank block.
In general, when controller to choose from clear area a blank block for write more new data time, controller uses method of first-in, first-out (first-in first-out, FIFO).That is controller can by the time blank block the earliest choosing deleted data in clear area.Fig. 2 is the process flow diagram of known method for writing data 200.First, controller from host receives write order (step 202).Suppose that write data are write to one first block of flash memory by this write order request controller.Due to this first block storage data, write data cannot be write this first block by controller again.Therefore, controller must obtain a target empty white area block to replace this first block storage data from the clear area of flash memory.According to method of first-in, first-out, the time one first blank block (step 204) being the earliest eliminated data chosen by controller by clear area.Then, controller is using this first blank block as target empty white area block (step 206).Then, these write data are write this target empty white area block (step 218) by controller.Now, this target empty white area block sound stores write data and instead of the status of the first block, and is placed into data field.The first block is originally useless because storing legacy data.Therefore, the data of this first block removed by controller, to change this first block into a blank block (step 220), and this first block inserted clear area, use to wait until in the future.
Figure 1A is the data field 110 of flash memory and the schematic diagram of block in clear area 120.Tentation data district 110 comprise block 111,112,11K, 11P, 11Y, 11Z, respectively there is the number of purge of 3,5,15,6,17,10 times.Clear area 120 comprise blank block 121,122,123,124,12X, respectively there is the number of purge of 7,11,30,9,12 times.Suppose that controller receives a write order, for the block 11K by more new data write data field 110.Because block 11K cannot re-write data, therefore the more new data of data dump time blank block 121 storage data block 11K the earliest chosen by controller by clear area 120 according to method of first-in, first-out.Data field 110 is placed into, as shown in Figure 1B after block 121 storage data.And become blank block after the deleted data of block 11K and be placed into clear area 120, and its number of purge increases to 16 times, as shown in Figure 1B.Then, suppose that controller receives a write order, for the block 11P by more new data write data field 110.Because block 11P cannot re-write data, therefore the more new data of data dump time blank block 122 storage data block 11P the earliest chosen by controller by clear area 120 according to method of first-in, first-out.Data field 110 is placed into, as shown in Figure 1 C after block 122 storage data.And become blank block after the deleted data of block 11P and be placed into clear area 120, and its number of purge increases to 7 times, as shown in Figure 1 C.
But the method for writing data 200 of Fig. 2 has defect and exists.Due to controller when choosing the target empty white area block for the more new data of storage data block only according to method of first-in, first-out (step 204), controller can not judge the number of purge size of target empty white area block.Therefore, when the number of purge of target empty white area block is very large, one re-uses this target empty white area block stores more new data the number of purge of this target empty white area block can be made to increase fast, and this block of advanced wear is until cannot storage data.Fig. 3 A is the data field 110 of former Fig. 1 C and the schematic diagram of multiple block in clear area 120.In Fig. 3 A, suppose that controller receives a write order, for the block 111 by more new data write data field 110.Because block 111 cannot re-write data, therefore the more new data of data dump time blank block 123 storage data block 111 the earliest chosen by controller by clear area 120 according to method of first-in, first-out.Data field 110 is placed into, as shown in Figure 3 B after block 123 storage data.And become blank block after the deleted data of block 111 and be placed into clear area 120, and its number of purge increases to 4 times, as shown in Figure 3 B.The number of purge of blank block 123 reaches 30, be but still applied to store more new data rearmounted enter data field 110, when block 123 once again deleted data time, the number of purge of block 123 can be made to increase, and wear and tear ahead of time.Generally speaking, the blank block that controller must use number of purge lower when choosing target empty white area block as far as possible, avoids the blank block using number of purge very high, to make the frequency of utilization of each block impartial, thus extends the tenure of use of storer.Therefore, in order to solve the above problems, need a kind of new method for writing data.
Summary of the invention
The technical problem to be solved in the present invention is, above-mentioned controller some particular block when choosing target empty white area block for prior art has high number of purge with the defect making wearing and tearing larger, provides a kind of method for writing data and data memory device of storer.
One of the technical solution adopted for the present invention to solve the technical problems is: the method for writing data constructing a kind of storer, this storer comprises a data field and a clear area (spare pool), this data field comprises multiple block of storage data, and this clear area comprises the multiple blank block of non-storage data; First, the write order for write data being write to one first block of this storer is received from a main frame; Then, the one first blank block with checkout time is the earliest chosen from this clear area; Then, check whether that the number of purge of this first blank block is less than or equal to a first boundary value; When the number of purge of this first blank block is less than or equal to this first boundary value, these write data are write this first blank block; Finally, remove the data that this first block stores, enter this clear area to change this first block into blank block juxtaposition.
The method for writing data of storer of the present invention, wherein the method more comprises:
When the number of purge of this first blank block is greater than this first boundary value, in this clear area, search the one second blank block that number of purge is less than or equal to this first boundary value;
These write data are write this second blank block; And
Remove the data that this first block stores, enter this clear area to change this first block into blank block juxtaposition.
The method for writing data of storer of the present invention, wherein the method more comprises:
When cannot by this clear area in search number of purge be less than or equal to this second blank block of this first boundary value time, carry out a wearing and tearing average program one second block in this data field to be converted to one the 3rd blank block of this clear area;
These write data are write the 3rd blank block; And
Remove the data that this first block stores, enter this clear area to change this first block into blank block juxtaposition;
Wherein the number of purge of the 3rd blank block is less than or equal to this first boundary value.
The method for writing data of storer of the present invention, wherein the carrying out of this wearing and tearing average program more comprises:
This second block that number of purge is less than this first boundary value is searched in this data field;
One the 4th blank block that number of purge is greater than one second boundary value is searched in this clear area;
Data stored by this second block are write the 4th blank block; And
Remove the data of this second block, enter this clear area to change this second block for the 3rd blank block juxtaposition;
Wherein this second boundary value is greater than this first boundary value.
The method for writing data of storer of the present invention, wherein the carrying out of this wearing and tearing average program more comprises:
This second block that number of purge is less than this first boundary value is searched in this data field;
One the 4th blank block that number of purge is maximum is searched in this clear area;
Data stored by this second block are write the 4th blank block; And
Remove the data of this second block, enter this clear area to change this second block for the 3rd blank block juxtaposition;
Wherein this second boundary value is greater than this first boundary value.
The method for writing data of storer of the present invention, wherein the step that obtains of this second block comprises:
When this data field do not have number of purge be less than the block of this first boundary value time, the number of purge of all block of this data field is deducted a pre-determined number; And
Again this second block that number of purge is less than this first boundary value is found from this data field.
The method for writing data of storer of the present invention, wherein this pre-determined number equals this first boundary value.
Two of the technical solution adopted for the present invention to solve the technical problems is: construct a kind of data memory device, this data memory device comprises a storer and a controller, this storer comprises a data field and a clear area (spare pool), wherein this data field comprises multiple block of storage data, and this clear area comprises the multiple blank block of non-storage data; This controller receives the write order for write data being write to one first block of this storer from a main frame, the one first blank block with checkout time is the earliest chosen from this clear area, check whether that the number of purge of this first blank block is less than or equal to a first boundary value, and when the number of purge of this first blank block is less than or equal to this first boundary value, these write data are write this first blank block, and the data removing the storage of this first block enter this clear area to change this first block into blank block juxtaposition.
Data memory device of the present invention, wherein when the number of purge of this first blank block is greater than this first boundary value, the one second blank block that number of purge is less than or equal to this first boundary value searched by this controller in this clear area, these write data are write this second blank block, and the data removing the storage of this first block enter this clear area to change this first block into blank block juxtaposition.
Data memory device of the present invention, wherein when cannot by this clear area in search number of purge be less than or equal to this second blank block of this first boundary value time, this controller carries out a wearing and tearing average program one second block in this data field to be converted to one the 3rd blank block of this clear area, these write data are write the 3rd blank block, and the data removing the storage of this first block enter this clear area to change this first block into blank block juxtaposition, wherein the number of purge of the 3rd blank block is less than or equal to this first boundary value.
Data memory device of the present invention, wherein this second block that number of purge is less than this first boundary value searched by this controller in this data field, one the 4th blank block that number of purge is greater than one second boundary value is searched in this clear area, data stored by this second block are write the 4th blank block, and the data removing this second block enter this clear area to change this second block for the 3rd blank block juxtaposition, to carry out this wearing and tearing average program, wherein this second boundary value is greater than this first boundary value.
Data memory device of the present invention, wherein this second block that number of purge is less than this first boundary value searched by this controller in this data field, one the 4th blank block that number of purge is maximum is searched in this clear area, data stored by this second block are write the 4th blank block, and the data removing this second block enter this clear area to change this second block for the 3rd blank block juxtaposition, to carry out this wearing and tearing average program, wherein this second boundary value is greater than this first boundary value.
Data memory device of the present invention, wherein when this data field do not have number of purge be less than the block of this first boundary value time, the number of purge of all block of this data field is deducted a pre-determined number by this controller, and again to find this second block that number of purge is less than this first boundary value from this data field, to obtain this second block.
Implement method for writing data and the data memory device of storer of the present invention, there is following beneficial effect: controller can be avoided using the very high blank block of number of purge as target empty white area block to store more new data, to make the frequency of utilization of each block of storer impartial, thus make the number of purge of each block comparatively average, to extend the tenure of use of storer.Therefore, data memory device of the present invention can avoid some particular block in known techniques to have the situation of high number of purge, thus promotes the usefulness of data memory device.
Accompanying drawing explanation
Below in conjunction with drawings and Examples, the invention will be further described, in accompanying drawing:
Figure 1A is by the first schematic diagram of the prior art method of writing data into memory;
Figure 1B is by the second schematic diagram of the prior art method of writing data into memory;
Fig. 1 C is by the 3rd schematic diagram of the prior art method of writing data into memory;
Fig. 2 is the process flow diagram of known method for writing data;
Fig. 3 A is the first schematic diagram of the shortcoming of display data writing method;
Fig. 3 B is the second schematic diagram of the shortcoming of display data writing method;
Fig. 4 is the block diagram according to data memory device of the present invention;
Fig. 5 is the process flow diagram according to method for writing data of the present invention;
Fig. 6 A is that controller carries out the first schematic diagram of data write according to the present invention;
Fig. 6 B is that controller carries out the second schematic diagram of data write according to the present invention;
Fig. 6 C is that controller carries out the 3rd schematic diagram of data write according to the present invention;
Fig. 7 A is that controller carries out the first schematic diagram of wearing and tearing average motion according to the present invention;
Fig. 7 B is that controller carries out the first schematic diagram of wearing and tearing average motion according to the present invention;
Fig. 7 C is that controller carries out the second schematic diagram of wearing and tearing average motion according to the present invention.
[primary clustering symbol description]
402 ~ controller;
404 ~ storer;
406 ~ main frame;
408 ~ data memory device;
410 ~ data field;
420 ~ clear area;
411-41Z ~ block;
421-42X ~ blank block.
Embodiment
Fig. 4 is the block diagram according to data memory device 408 of the present invention.Data memory device 408 is coupled to a main frame 406, comprises controller 402 and storer 404.In an embodiment, storer 404 is a flash memory.Storer 404 comprises multiple block can storage data.The block of storer 404 can be divided into two groups.The block of data field 410 be storage data block 411,412 ..., 41Z.The block of clear area 420 be non-storage data blank block 421,422 ..., 42X.Controller 402 from host 406 receive access command, then the data of foundation access command access memory 404.
When controller 402 receives a write order by main frame 406, block corresponding in storer 404 is found out in the address that controller 402 can comprise according to write order.If this block is arranged in the block of data field 410, then because this block storage data, more more new data cannot be write this block.Now, controller 402 just by obtaining a blank block in clear area 420, can write the more new data of block for storing wish originally.But, controller 402 is by the method choosing blank block in clear area 420, except choosing except checkout time blank block the earliest according to method of first-in, first-out, also need the number of purge of the blank block be selected (erase count) to compare with a first boundary value, wherein this number of purge represents the number of times of the deleted data of the first blank block.
If the number of purge of the blank block be selected is less than or equal to first boundary value, the blank block be selected just can become suitable target empty white area block, for storing originally for the more new data of write block.If the number of purge of the blank block be selected is greater than first boundary value, controller then separately by finding the blank block of number of purge less than or equal to first boundary value in clear area 420 as target empty white area block, must write the more new data of block for storing wish originally.So, when each controller 402 performs write order, be all the blank block that in clear area 420, number of purge is less in order to store the blank block of write data.Therefore, controller can be avoided using the very high blank block of number of purge as target empty white area block to store more new data, to make the frequency of utilization of each block of storer 404 impartial, thus make the number of purge of each block comparatively average, to extend the tenure of use of storer 404.Therefore, data memory device 408 of the present invention can avoid some particular block in known techniques to have the situation of high number of purge, thus promotes the usefulness of data memory device 408.
Fig. 5 is the process flow diagram according to method for writing data 500 of the present invention.First, controller 402 from host 406 receives a write order (step 502).Suppose that write data are write to a writing address by this write order request controller 402, wherein this writing address corresponds to one first block of the data field 410 of storer 404.Due to this first block storage data, therefore write data directly cannot be write this first block by controller 402.Therefore, controller 402 obtains a blank block to store the former write data for write the first block in clear area 420.First, controller 402 according to method of first-in, first-out by choosing the time one first blank block (step 504) being the earliest eliminated data in clear area 420.Then, controller 402 by the number of purge of this first blank block compared with a first boundary value (step 506).If the number of purge of this first blank block is less than or equal to this first boundary value (step 506), then controller 402 can directly using this first blank block as supplying to substitute this first block to store target empty white area block (step 508) of write data.Then, these write data are write this first blank block (step 510) by controller 402, and the logical address of this first blank block are set to the logical address of this first block.The first blank block that the first block now storing legacy data has been stored new data replaced, therefore the data (step 512) of this first block removed by controller 402, enter in clear area 420 into blank block juxtaposition to change this first block.
When controller 402 by the number of purge of this first blank block compared with first boundary value time (step 506), if the number of purge of this first blank block is greater than this first boundary value, then this first blank block is not suitable as the target empty white area block storing write data.Therefore, controller 402 must by selecting target empty white area block in clear area 420 else.Now, the one second blank block (step 514) that number of purge is less than or equal to this first boundary value searched by controller 402 in clear area 420.If controller 402 is successfully by the second blank block finding number of purge to be less than or equal to this first boundary value in the multiple blank block of clear area 420, then this second blank block directly can substitute this first block to store target empty white area block (step 518) of write data as supplying.Then, these write data are write this second blank block (step 510) by controller 402, and the logical address of this second blank block are set to the logical address of this first block.The second blank block that the first block now storing legacy data has been stored new data replaced, therefore the data (step 512) of this first block removed by controller 402, enter in clear area 420 into blank block juxtaposition to change this first block.
Fig. 6 A is the data field 410 of flash memory and the schematic diagram of block in clear area 420.Tentation data district 410 comprise block 411,412,41K, 41P, 41Y, 41Z, respectively there is the number of purge of 3,5,15,6,17,10 times.Clear area 420 comprises blank block 421,422,423,424,425, respectively has the number of purge of 7,11,30,9,12 times, and blank block 421,422,423,424,425 deletes the time of data sequentially by early arranging to evening.Suppose that controller 402 receives a write order, for the block 41K by more new data write data field 410.Because block 41K cannot re-write data, therefore the time blank block 421 being the earliest eliminated data chosen by controller 402 by clear area 420 according to method 500.Suppose that first boundary value is 10.Number of purge due to the blank block 421 be selected is 7, this number of purge 7 is less than first boundary value 10, meet the screening conditions of target empty white area block, therefore controller 402 selects blank block 421 as target empty white area block, for the more new data of storage data block 41K.Then, blank block 421 stores and is more placed into data field 410 after new data, as shown in Figure 6B.And after the deleted data of block 41K, become blank block, and be placed into clear area 420, and its number of purge increases to 16 times, as shown in Figure 6B.
Then, suppose that controller 420 receives a write order, for the block 41P by more new data write data field 410.Because block 41P cannot re-write data, therefore the time blank block 422 being the earliest eliminated data chosen by controller 402 by clear area 420 according to method 500.Number of purge due to the blank block 422 be selected is 11, this number of purge 11 is greater than first boundary value 10 and does not meet the screening conditions of target empty white area block, and therefore controller 402 must choose other blank block separately as target empty white area block in clear area 420.The number of purge of follow-up blank block 423 is 30, and this number of purge 30 is greater than first boundary value 10 equally and does not meet the screening conditions of target empty white area block.The number of purge of blank block 424 follow-up is again 9, this number of purge 9 meets the screening conditions of target empty white area block because being less than first boundary value 10, therefore controller 402 can select clear area block 424 as target empty white area block, for the more new data of storage data block 41P.Data field 410 is placed into, as shown in Figure 6 C after blank block 424 storage data.And after the deleted data of block 41P, become blank block, be placed into clear area 420, and its number of purge increases to 7 times, as shown in Figure 6 C.
Step 520 ~ 528 in the method for writing data 500 of Fig. 5 are called average (wear-leveling) program of wearing and tearing.In step 514, the second blank block that number of purge is less than or equal to this first boundary value searched by controller 402 in clear area 420.But if the number of purge of all blank block in clear area 420 is all greater than first boundary value, then controller 402 cannot by finding the second applicable blank block (step 516) in clear area 420.But write data still need to be stored to a target empty white area block, just can complete the execution of write order.Now, controller 402 carries out wearing and tearing average program the block in data field 410 to be converted to the blank block of clear area 420, to write data as target empty white area block for storing.First, one second block (step 520) that number of purge is less than this first boundary value searched by controller 402 from data field 410.Then, one the 3rd blank block that number of purge is greater than one second boundary value searched by controller 402 from clear area 420, exchange (step 522) for the second block, wherein this second boundary value is greater than this first boundary value.In an embodiment, controller 402 searches the maximum blank block of number of purge as the 3rd blank block in clear area 420.
Then, the data that this second block stores are write the 3rd blank block (step 524) by controller 402, and the logical address of the 3rd blank block are set to the logical address of this second block.The 3rd blank block that now the second block has been eliminated number of times larger replaced, and controller 402 then just can remove the data of this second block, to change this second block into one the 4th blank block (step 526).Number of purge due to the 4th blank block is that the number of purge of the second block adds one, must be less than or equal to first boundary value, therefore meet the screening conditions of target empty white area block.Therefore, controller 402 is then just using the 4th blank block as supplying to substitute this first block to store target empty white area block (step 528) of write data.Then, these write data are write the 4th blank block (step 510) by controller 402, and the logical address of the 4th blank block are set to the logical address of this first block.The 4th blank block that the first block now storing legacy data has been stored new data replaced, therefore the data (step 512) of this first block removed by controller 402, enter in clear area 420 into blank block juxtaposition to change this first block.
Fig. 7 A, Fig. 7 B and Fig. 7 C are that controller carries out the schematic diagram of wearing and tearing average motion according to the present invention.Tentation data district 710 comprise block 711,712,713,714,71Z, respectively there is the number of purge of 16,18,12,7,8 times.Clear area 720 comprises blank block 721,722,723,724,725, respectively has the number of purge of 12,11,30,32,20 times, and the time of the deleted data of blank block 721,722,723,724,725 is sequentially by early arranging to evening.In Fig. 7 A, suppose that controller 402 receives a write order, for the block 71Z by more new data write data field 710.Cannot re-write data because block 71Z stores data, therefore controller 402 chooses a target empty white area block according to method 500 by clear area 420, for the more new data stored for write block 71Z.Suppose that first boundary value is 10, and the second boundary value is 30.Because the number of purge of blank block 721 ~ 725 is all greater than first boundary value 10, be therefore all not suitable as target empty white area block.This Time Controller 402 just carries out wearing and tearing average program according to step 520 ~ 528 of Fig. 5.First controller 402 is searched the block 714 with the number of purge 7 being less than first boundary value 10 by data field 710, and searches the blank block 724 of the number of purge 32 had higher than the second boundary value 30 by clear area 720.Then, controller 402 with the data of blank block 724 storage data block 714, and inserts clear area 720 after block 714 deletes data, and its number of purge increases to 8 times.This Time Controller 402 mat is carried out wearing and tearing average program and completes the exchange of block 724 and 714, as shown in Figure 7 B.
Now in clear area 720, the number of purge 8 of an existing blank block 714 is less than first boundary value 10, thus blank block 714 meets the screening conditions of target empty white area block.Therefore, controller 402 selects blank block 714 as target empty white area block, for the more new data of storage data block 71Z.Then, blank block 714 stores and is more placed into data field 710 after new data, as seen in figure 7 c.And after the deleted data of block 71Z, become blank block, and be placed into clear area 720, and its number of purge increases to 9 times, as seen in figure 7 c.
Finally, in time carrying out wearing and tearing the step 522 of average motion, controller 402 possibly cannot search in data field 410 number of purge be less than first boundary value the second block.Now, represent that the number of purge of block all in data field 410 is all greater than first boundary value.For making flow process proceed, the number of purge of all block in the data field 410 of storer 404 is deducted a numerical value by controller, thus the number of purge of all block is diminished.In an embodiment, this numerical value is the half of the boundary value of number of purge.After the number of purge of the block of data field 410 all diminishes, controller 402 just can find the second block that number of purge is less than first boundary value again from data field 410, exchange for the 3rd blank block.
Although the present invention discloses as above with preferred embodiment; so itself and be not used to limit the present invention; any those who familiarize themselves with the technology; without departing from the spirit and scope of the present invention; when doing a little change and retouching, therefore protection scope of the present invention is when being as the criterion depending on the accompanying claim person of defining.

Claims (11)

1. a method for writing data for storer, wherein this storer comprises a data field and a clear area, and this data field comprises multiple block of storage data, and this clear area comprises the multiple blank block of non-storage data, and it is characterized in that, the method comprises:
The write order for write data being write to one first block of this storer is received from a main frame;
The one first blank block with checkout time is the earliest chosen from this clear area;
Check whether that the number of purge of this first blank block is less than or equal to a first boundary value;
When the number of purge of this first blank block is less than or equal to this first boundary value, these write data are write this first blank block; And remove the data of this first block storage, enter this clear area to change this first block into blank block juxtaposition;
When cannot by this clear area in search number of purge be less than or equal to a second blank block of this first boundary value time, carry out a wearing and tearing average program one second block in this data field to be converted to one the 3rd blank block of this clear area; These write data are write the 3rd blank block; And remove the data of this first block storage, enter this clear area to change this first block into blank block juxtaposition; Wherein the number of purge of the 3rd blank block is less than or equal to this first boundary value.
2. the method for writing data of storer according to claim 1, is characterized in that, wherein the method more comprises:
When the number of purge of this first blank block is greater than this first boundary value, in this clear area, search the second blank block that number of purge is less than or equal to this first boundary value;
These write data are write this second blank block; And
Remove the data that this first block stores, enter this clear area to change this first block into blank block juxtaposition.
3. the method for writing data of storer according to claim 2, is characterized in that, wherein the carrying out of this wearing and tearing average program more comprises:
This second block that number of purge is less than this first boundary value is searched in this data field;
One the 4th blank block that number of purge is greater than one second boundary value is searched in this clear area;
Data stored by this second block are write the 4th blank block; And
Remove the data of this second block, enter this clear area to change this second block for the 3rd blank block juxtaposition;
Wherein this second boundary value is greater than this first boundary value.
4. the method for writing data of storer according to claim 3, is characterized in that, wherein the carrying out of this wearing and tearing average program more comprises:
This second block that number of purge is less than this first boundary value is searched in this data field;
One the 4th blank block that number of purge is maximum is searched in this clear area;
Data stored by this second block are write the 4th blank block; And
Remove the data of this second block, enter this clear area to change this second block for the 3rd blank block juxtaposition;
Wherein this second boundary value is greater than this first boundary value.
5. the method for writing data of storer according to claim 3, is characterized in that, wherein the step that obtains of this second block comprises:
When this data field do not have number of purge be less than the block of this first boundary value time, the number of purge of all block of this data field is deducted a pre-determined number; And
Again this second block that number of purge is less than this first boundary value is found from this data field.
6. the method for writing data of storer according to claim 5, is characterized in that, wherein this pre-determined number equals this first boundary value.
7. a data memory device, is characterized in that, comprising:
One storer, comprises a data field and a clear area, and wherein this data field comprises multiple block of storage data, and this clear area comprises the multiple blank block of non-storage data; And
One controller, the write order for write data being write to one first block of this storer is received from a main frame, the one first blank block with checkout time is the earliest chosen from this clear area, check whether that the number of purge of this first blank block is less than or equal to a first boundary value, and when the number of purge of this first blank block is less than or equal to this first boundary value, these write data are write this first blank block, and the data removing the storage of this first block enter this clear area to change this first block into blank block juxtaposition,
When cannot by this clear area in search number of purge be less than or equal to a second blank block of this first boundary value time, this controller carries out a wearing and tearing average program one second block in this data field to be converted to one the 3rd blank block of this clear area, these write data are write the 3rd blank block, and the data removing the storage of this first block enter this clear area to change this first block into blank block juxtaposition, wherein the number of purge of the 3rd blank block is less than or equal to this first boundary value.
8. data memory device according to claim 7, it is characterized in that, wherein when the number of purge of this first blank block is greater than this first boundary value, the second blank block that number of purge is less than or equal to this first boundary value searched by this controller in this clear area, these write data are write this second blank block, and the data removing the storage of this first block enter this clear area to change this first block into blank block juxtaposition.
9. data memory device according to claim 8, it is characterized in that, wherein this second block that number of purge is less than this first boundary value searched by this controller in this data field, one the 4th blank block that number of purge is greater than one second boundary value is searched in this clear area, data stored by this second block are write the 4th blank block, and the data removing this second block enter this clear area to change this second block for the 3rd blank block juxtaposition, to carry out this wearing and tearing average program, wherein this second boundary value is greater than this first boundary value.
10. data memory device according to claim 9, it is characterized in that, wherein this second block that number of purge is less than this first boundary value searched by this controller in this data field, one the 4th blank block that number of purge is maximum is searched in this clear area, data stored by this second block are write the 4th blank block, and the data removing this second block enter this clear area to change this second block for the 3rd blank block juxtaposition, to carry out this wearing and tearing average program, wherein this second boundary value is greater than this first boundary value.
11. data memory devices according to claim 9, it is characterized in that, wherein when this data field do not have number of purge be less than the block of this first boundary value time, the number of purge of all block of this data field is deducted a pre-determined number by this controller, and again to find this second block that number of purge is less than this first boundary value from this data field, to obtain this second block.
CN201010148297.8A 2010-04-16 2010-04-16 The method for writing data of storer and data memory device Active CN102222044B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201010148297.8A CN102222044B (en) 2010-04-16 2010-04-16 The method for writing data of storer and data memory device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201010148297.8A CN102222044B (en) 2010-04-16 2010-04-16 The method for writing data of storer and data memory device

Publications (2)

Publication Number Publication Date
CN102222044A CN102222044A (en) 2011-10-19
CN102222044B true CN102222044B (en) 2015-09-02

Family

ID=44778600

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201010148297.8A Active CN102222044B (en) 2010-04-16 2010-04-16 The method for writing data of storer and data memory device

Country Status (1)

Country Link
CN (1) CN102222044B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11188461B2 (en) * 2019-06-19 2021-11-30 Micron Technology, Inc. Garbage collection adapted to memory device life expectancy

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH10320984A (en) * 1997-05-15 1998-12-04 Sharp Corp Memory device
US7467253B2 (en) * 2006-04-13 2008-12-16 Sandisk Corporation Cycle count storage systems
CN101369252A (en) * 2008-09-16 2009-02-18 浙江大学 Method for static data loss equalization based on NAND flash memory file system
CN101582052A (en) * 2008-05-15 2009-11-18 慧国(上海)软件科技有限公司 Memory module and method for performing wear-leveling of memory module
CN101622608A (en) * 2007-12-28 2010-01-06 株式会社东芝 Memory system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20100013485A (en) * 2008-07-31 2010-02-10 삼성전자주식회사 Memory device and method of wear leveling

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH10320984A (en) * 1997-05-15 1998-12-04 Sharp Corp Memory device
US7467253B2 (en) * 2006-04-13 2008-12-16 Sandisk Corporation Cycle count storage systems
CN101622608A (en) * 2007-12-28 2010-01-06 株式会社东芝 Memory system
CN101582052A (en) * 2008-05-15 2009-11-18 慧国(上海)软件科技有限公司 Memory module and method for performing wear-leveling of memory module
CN101369252A (en) * 2008-09-16 2009-02-18 浙江大学 Method for static data loss equalization based on NAND flash memory file system

Also Published As

Publication number Publication date
CN102222044A (en) 2011-10-19

Similar Documents

Publication Publication Date Title
CN104008061B (en) Method for recovering internal storage and device
CN100552646C (en) Use memory device and the operation method of nonvolatile memory as high-speed cache
CN106598878B (en) Solid state disk cold and hot data separation method
CN104461393B (en) Mixed mapping method of flash memory
TWI398770B (en) Data accessing method for flash memory and storage system and controller using the same
CN101169751B (en) System with flash memory device and data recovery method thereof
JP4948793B2 (en) Flash memory system including bad block manager
US8386699B2 (en) Method for giving program commands to flash memory for writing data according to a sequence, and controller and storage system using the same
CN102508788B (en) SSD (solid state drive) and SSD garbage collection method and device
US8510502B2 (en) Data writing method, and memory controller and memory storage apparatus using the same
CN109671458A (en) The method of management flash memory module and relevant flash controller
US20090265505A1 (en) Data writing method, and flash storage system and controller using the same
US20100042774A1 (en) Block management method for flash memory, and storage system and controller using the same
CN101908368A (en) Electronic storage device and operation method thereof
US20140129763A1 (en) Data writing method, memory controller, and memory storage apparatus
CN104598386B (en) By following the trail of and reusing solid-state drive block using two level map index
CN101872644A (en) Electronic storage device and storage method thereof
US20100287330A1 (en) Method for writing data into flash memory
CN109582593A (en) A kind of FTL address mapping method and data read-write method based on calculating
CN106598493A (en) Solid state disk address mapping table management method
CN105988719B (en) Storage device and its method for handling data
US8762685B2 (en) Data writing method, memory controller and memory storage apparatus
CN102567221A (en) Data management method, memory controller and memory storage device
US8209464B2 (en) Management method, management apparatus, and controller for memory data access
CN102222044B (en) The method for writing data of storer and data memory device

Legal Events

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