CN102222044A - Data writing method of memory and data storage device - Google Patents

Data writing method of memory and data storage device Download PDF

Info

Publication number
CN102222044A
CN102222044A CN2010101482978A CN201010148297A CN102222044A CN 102222044 A CN102222044 A CN 102222044A CN 2010101482978 A CN2010101482978 A CN 2010101482978A CN 201010148297 A CN201010148297 A CN 201010148297A CN 102222044 A CN102222044 A CN 102222044A
Authority
CN
China
Prior art keywords
block
data
blank
purge
clear 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.)
Granted
Application number
CN2010101482978A
Other languages
Chinese (zh)
Other versions
CN102222044B (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

Images

Abstract

The invention relates to a data writing method of a memory and a data storage device. The memory comprises a data area and a blank area, wherein the data area comprises a plurality of data blocks in which data is stored already, and the blank area comprises a plurality of blank blocks without data stored therein. The method comprises the following steps of: firstly, receiving a writing command to write a write datum in a first data block of the memory from a host; secondly, selecting a first blank block having the earliest clearing time from the blank area; thirdly, checking whether the clearing count of the first blank block is smaller than or equal to a first critical value; when the clearing count of the first blank block is smaller than or equal to the first critical value, writing the write datum in the first blank block; and finally, clearing away the data stored in the first data block to transform the first data block into a blank block and adding the same to the blank area. The method in the invention can ensure that the use frequency of each block of the memory is equalized and the clearing count is more averaged so as to prolong the service life of the memory.

Description

The method for writing data of storer and data memory device
Technical field
The present invention relates to the 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 a plurality of blocks (block), and each block comprises that a plurality of pages or leaves (page) are for data storing.In addition, each block of flash memory corresponds to different addresses respectively.When main frame was desired the data of access flash memory, main frame can send access command to the controller of flash memory, this access command comprise desire the address of the block of access.For example, when the flash memory self-controller receives write command, just according to the indication of controller with data storing to some page or leaf that writes the pairing block in address.When the flash memory self-controller is received reading order, just according to the indication of controller from some page sense data of the block that reads the address correspondence and return data to controller.
After a plurality of pages or leaves of a block of flash memory all were written into data, this block just can't be written into data once more.Therefore, a plurality of blocks of flash memory can roughly be divided into data field and clear area (spare pool) two districts, and the block of data field is the block of storage data, and the block of clear area is the block of storage data not.When main frame desires to write data to corresponding to the address of a block that is positioned at the data field time, because this block can't be written into more new data again, controller just have to be obtained a blank block from the clear area, change the address of this blank block the address of this block into, more the new data transcription is gone into to this blank block again.This moment, block originally was out of use, and just the erase data of this block of controller are inserted in the clear area so that block is converted to blank block.
In general, when controller is chosen a blank block when writing more new data from the clear area, the controller uses advanced go out earlier method (first-in first-out, FIFO).That is controller can be by the time of choosing deleted data in the clear area blank block the earliest.Fig. 2 is the process flow diagram of known method for writing data 200.At first, controller receives a write command (step 202) from main frame.Suppose that this write command requirement controller will write one first block that data write to flash memory.Because this first block is storage data, controller can't write this first block with writing data again.Therefore, controller must be obtained a target empty white area piece from the clear area of flash memory to replace this first block storage data.According to method of first-in, first-out, controller is chosen the time one first blank block (step 204) the earliest that is eliminated data by the clear area.Then, controller with this first blank block as a target empty white area piece (step 206).Then, controller writes data with this and writes this target empty white area piece (step 218).At this moment, this target empty white area piece sound has stored the status that writes data and replaced first block, and is placed into the data field.First block originally is useless because of storing legacy data.Therefore, controller is removed the data of this first block, is a blank block (step 220) to change this first block, and this first block is inserted the clear area, uses to wait until in the future.
Figure 1A is the synoptic diagram of block in data field 110 and the clear area 120 of flash memory.Tentation data district 110 comprises block 111,112,11K, 11P, 11Y, 11Z, respectively has 3,5,15,6,17,10 times number of purge.Clear area 120 comprises blank block 121,122,123,124,12X, respectively has 7,11,30,9,12 times number of purge.Suppose that controller receives a write command, desire more new data writes the block 11K of data field 110.Because block 11K can't write data again, so controller is chosen the more new data of data dump time blank block 121 storage data block 11K the earliest by clear area 120 according to method of first-in, first-out.Be placed into data field 110 behind block 121 storage datas, shown in 1B figure.Be placed into clear area 120 and become blank block after the deleted data of block 11K, and its number of purge increases to 16 times, shown in 1B figure.Then, suppose that controller receives a write command, desire more new data writes the block 11P of data field 110.Because block 11P can't write data again, so controller is chosen the more new data of data dump time blank block 122 storage data block 11P the earliest by clear area 120 according to method of first-in, first-out.Be placed into data field 110 behind block 122 storage datas, shown in Fig. 1 C.Be placed into clear area 120 and become blank block after the deleted data of block 11P, and its number of purge increases to 7 times, shown in Fig. 1 C.
Yet the method for writing data 200 of Fig. 2 has defective and exists.Because only according to method of first-in, first-out (step 204), can not judge the number of purge size of target empty white area piece by controller when the piece of the target empty white area of the more new data of choosing confession storage data block for controller.Therefore, when the number of purge of target empty white area piece was very big, one re-uses this target empty white area piece stored more that new data can make the number of purge of this target empty white area piece increase fast, and this block that weares and teares in advance is until can't storage data.Fig. 3 A is the synoptic diagram of a plurality of blocks in data field 110 and the clear area 120 of former Fig. 1 C.In Fig. 3 A, suppose that controller receives a write command, desire more new data writes the block 111 of data field 110.Because block 111 can't write data again, so controller is chosen the more new data of data dump time blank block 123 storage data blocks 111 the earliest by clear area 120 according to method of first-in, first-out.Be placed into data field 110 behind block 123 storage datas, shown in Fig. 3 B.Be placed into clear area 120 and become blank block after the block 111 deleted data, and its number of purge increases to 4 times, shown in Fig. 3 B.The number of purge of blank block 123 has reached 30, is but still stored more the new data postposition by utilization and goes into data field 110, when block 123 once again during deleted data, the number of purge of block 123 is increased, and wearing and tearing ahead of time.Generally speaking, controller must use the lower blank block of number of purge as far as possible when choosing target empty white area piece, avoids the blank block that uses number of purge very high, so that the frequency of utilization equalization of each block, thereby prolongs 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, have high number of purge so that the bigger defective of wearing and tearing at above-mentioned controller some particular block when choosing target empty white area piece of prior art, a kind of method for writing data and data memory device of storer is provided.
One of the technical solution adopted for the present invention to solve the technical problems is: the method for writing data of constructing a kind of storer, this storer comprises a data field and a clear area (spare pool), this data field comprises a plurality of block of storage data, and this clear area comprises the not a plurality of blank block of storage data; At first, receive desire from a main frame and write the write command that data write to one first block of this storer one; Then, this clear area is chosen and is had one first blank block of checkout time the earliest certainly; Then, check that whether 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, this is write data write this first blank block; At last, remove the data that this first block stores, so that to change this first block be blank block and insert this clear area.
The method for writing data of storer of the present invention, wherein this method more comprises:
When the number of purge of this first blank block during, search the one second blank block that number of purge is less than or equal to this first threshold certainly in this clear area greater than this first boundary value;
This is write data write this second blank block; And
Remove the data that this first block stores, so that to change this first block be blank block and insert this clear area.
The method for writing data of storer of the present invention, wherein this method more comprises:
Search number of purge in can't be when being less than or equal to this second blank block of this first threshold, carry out a wearing and tearing average program one second block in this data field is converted to one the 3rd blank block of this clear area by this clear area;
This is write data write the 3rd blank block; And
Remove the data that this first block stores, so that to change this first block be blank block and insert this clear area;
Wherein the number of purge of the 3rd blank block is less than or equal to this first threshold.
The method for writing data of storer of the present invention, wherein the carrying out of this wearing and tearing average program more comprises:
In this data field, search number of purge this second block less than this first boundary value;
In this clear area, search the one four blank block of number of purge greater than one second boundary value;
The data that this second block is stored write the 4th blank block; And
Remove the data of this second block, be the 3rd blank block and insert this clear area to change this second block;
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:
In this data field, search number of purge this second block less than this first boundary value;
In this clear area, search one the 4th blank block of number of purge maximum;
The data that this second block is stored write the 4th blank block; And
Remove the data of this second block, be the 3rd blank block and insert this clear area to change this second block;
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 does not have number of purge less than the block of this first boundary value, the number of purge of all block of this data field is deducted a pre-determined number; And
Again seek number of purge this second block less than this first boundary value 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 a plurality of block of storage data, and this clear area comprises the not a plurality of blank block of storage data; This controller receives desire from a main frame and writes the write command that data write to one first block of this storer with one, choose from this clear area and to have one first blank block of checkout time the earliest, check that whether 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, this is write data write this first blank block, and remove data that this first block stores so that to change this first block be blank block and insert this clear area.
Data memory device of the present invention, wherein when the number of purge of this first blank block during greater than this first boundary value, this controller is searched the one second blank block that number of purge is less than or equal to this first threshold in this clear area, this is write data write this second blank block, and remove data that this first block stores so that to change this first block be blank block and insert this clear area.
Data memory device of the present invention, wherein search number of purge in can't be when being less than or equal to this second blank block of this first threshold by this clear area, this controller carries out a wearing and tearing average program one second block in this data field is converted to one the 3rd blank block of this clear area, this is write data write the 3rd blank block, and remove data that this first block stores so that to change this first block be blank block and insert this clear area, wherein the number of purge of the 3rd blank block is less than or equal to this first threshold.
Data memory device of the present invention, wherein this controller is searched number of purge this second block less than this first boundary value in this data field, in this clear area, search the one four blank block of number of purge greater than one second boundary value, the data that this second block is stored write the 4th blank block, and the data of removing this second block are to change this second block for the 3rd blank block and insert this clear area, 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 controller is searched number of purge this second block less than this first boundary value in this data field, in this clear area, search one the 4th blank block of number of purge maximum, the data that this second block is stored write the 4th blank block, and the data of removing this second block are to change this second block for the 3rd blank block and insert this clear area, 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 does not have number of purge less than the block of this first boundary value, this controller deducts a pre-determined number with the number of purge of all block of this data field, and this data field is sought number of purge this second block less than this first boundary value again certainly, to obtain this second block.
Implement the method for writing data and the data memory device of storer of the present invention, have following beneficial effect: controller can avoid using the very high blank block of number of purge as target empty white area piece to store more new data, so that the frequency of utilization equalization of each block of storer, thereby make the number of purge of each block comparatively average, to prolong the tenure of use of storer.Therefore, data memory device of the present invention can avoid that some particular block has the situation of high number of purge in the known techniques, thereby promotes the usefulness of data memory device.
Description of drawings
The invention will be further described below in conjunction with drawings and Examples, in the accompanying drawing:
Figure 1A is first synoptic diagram with the prior art method of writing data into memory;
Figure 1B is second synoptic diagram with the prior art method of writing data into memory;
Fig. 1 C is the 3rd synoptic diagram with 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 first synoptic diagram of the shortcoming of video data wiring method;
Fig. 3 B is second synoptic diagram of the shortcoming of video data wiring 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 first synoptic diagram that data write according to the present invention;
Fig. 6 B is that controller carries out second synoptic diagram that data write according to the present invention;
Fig. 6 C is that controller carries out the 3rd synoptic diagram that data write according to the present invention;
Fig. 7 A is first synoptic diagram that controller weares and teares and on average moves according to the present invention;
Fig. 7 B is first synoptic diagram that controller weares and teares and on average moves according to the present invention;
Fig. 7 C is second synoptic diagram that controller weares and teares and on average moves 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.But storer 404 comprises a plurality of block storage datas.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 not storage data blank block 421,422 ..., 42X.402 of controllers receive access commands from main frame 406, again according to the data of access command access memory 404.
When controller 402 received a write command by main frame 406, controller 402 can be found out pairing block in storer 404 according to the address that write command comprises.If this block is arranged in the block of data field 410,, can't be again new data be more write this block then because this block storage data.At this moment, controller 402 just can be by obtaining a blank block, for storing the more new data of originally desiring to write block in the clear area 420.Yet, controller 402 is by the method for choosing blank block in the clear area 420, except the foundation method of first-in, first-out is chosen checkout time blank block the earliest, also the number of purge (erase count) of the blank block that need will be selected compares with a first boundary value, and wherein this number of purge is represented the number of times of the deleted data of the first blank block.
If the number of purge of the blank block that is selected is less than or equal to first boundary value, the blank block that is selected just can become suitable target empty white area piece, for storing the more new data of originally desiring to write block.If the number of purge of the blank block that is selected is greater than first boundary value, controller then must be separately by seeking blank block that number of purge is less than or equal to first boundary value in the clear area 420 as target empty white area piece, for storing the more new data of originally desiring to write block.So, when each controller 402 was carried out write command, the blank block that writes data in order to storage all was the less blank block of number of purge in the clear area 420.Therefore, controller can avoid using the very high blank block of number of purge as target empty white area piece to store more new data, so that the frequency of utilization equalization of each block of storer 404, thereby make the number of purge of each block comparatively average, to prolong the tenure of use of storer 404.Therefore, data memory device 408 of the present invention can avoid that some particular block has the situation of high number of purge in the known techniques, thereby 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.At first, controller 402 receives a write command (step 502) from main frame 406.Suppose that this write command requirement controller 402 will write data and write to one and write the address, wherein this writes one first block of address corresponding to the data field 410 of storer 404.Because this first block is storage data, so controller 402 can't directly write this first block with writing data.Therefore, controller 402 is obtained a blank block to store the former data that write of desiring to write first block in clear area 420.At first, controller 402 according to method of first-in, first-out by choosing the time one first blank block (step 504) the earliest that is eliminated data in the clear area 420.Then, controller 402 is with the number of purge of this first blank block compare 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 substitute this first block writes data with storage a target empty white area piece (step 508) with this first blank block as confession.Then, controller 402 writes data with this and writes this first blank block (step 510), and the logical address of this first blank block is made as the logical address of this first block.The first blank block that first block that store legacy data this moment has been stored new data replaces, therefore controller 402 is removed the data (step 512) of these first block, so that to change this first block be blank block and insert in the clear area 420.
When controller 402 is compared the number of purge of this first blank block with first boundary value (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 and stores the target empty white area piece that writes data.Therefore, controller 402 must be by alternative target empty white area piece in the clear area 420.At this moment, controller 402 is searched the one second blank block (step 514) that number of purge is less than or equal to this first threshold in clear area 420.If controller 402 successfully finds number of purge to be less than or equal to the second blank block of this first threshold in a plurality of blank block by clear area 420, then this second blank block can be directly as the target empty white area piece (step 518) that writes data for alternative this first block with storage.Then, controller 402 writes data with this and writes this second blank block (step 510), and the logical address of this second blank block is made as the logical address of this first block.The second blank block that first block that store legacy data this moment has been stored new data replaces, therefore controller 402 is removed the data (step 512) of these first block, so that to change this first block be blank block and insert in the clear area 420.
Fig. 6 A is the synoptic diagram of block in data field 410 and the clear area 420 of flash memory.Tentation data district 410 comprises block 411,412,41K, 41P, 41Y, 41Z, respectively has 3,5,15,6,17,10 times number of purge.Clear area 420 comprises blank block 421,422,423,424,425, respectively has 7,11,30,9,12 times number of purge, and the time of blank block 421,422,423,424,425 deleted datas is in regular turn by early arranging to evening.Suppose that controller 402 receives a write command, desire more new data writes the block 41K of data field 410.Because block 41K can't write data again, so controller 402 is chosen the time blank block 421 the earliest that is eliminated data according to method 500 by clear area 420.Suppose that first boundary value is 10.Because the number of purge of the blank block 421 that is selected is 7, this number of purge 7 is less than first boundary value 10, the screening conditions that meet target empty white area piece, so controller 402 selects blank block 421 as target empty white area piece, for the more new data of storage data block 41K.Then, blank block 421 stores more and is placed into data field 410 behind the new data, shown in Fig. 6 B.And become blank block after the deleted data of block 41K, and be placed into clear area 420, and its number of purge increases to 16 times, shown in Fig. 6 B.
Then, suppose that controller 420 receives a write command, desire more new data writes the block 41P of data field 410.Because block 41P can't write data again, so controller 402 is chosen the time blank block 422 the earliest that is eliminated data according to method 500 by clear area 420.Because the number of purge of the blank block 422 that is selected is 11, this number of purge 11 does not meet the screening conditions of target empty white area piece greater than first boundary value 10, so controller 402 must be chosen other blank block separately as target empty white area piece in clear area 420.The number of purge of follow-up blank block 423 is 30, these number of purge 30 same screening conditions that do not meet target empty white area piece greater than first boundary value 10.The number of purge of follow-up more blank block 424 is 9, this number of purge 9 is because of meeting the screening conditions of target empty white area piece less than first boundary value 10, therefore controller 402 can select clear area piece 424 as target empty white area piece, for the more new data of storage data block 41P.Be placed into data field 410 behind blank block 424 storage datas, shown in Fig. 6 C.And become blank block after the deleted data of block 41P, be placed into clear area 420, and its number of purge increases to 7 times, shown in Fig. 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, controller 402 is searched the second blank block that number of purge is less than or equal to this first threshold in clear area 420.Yet if the number of purge of all blank blocks in the clear area 420 is all greater than first boundary value, controller 402 can't be by finding the second suitable blank block (step 516) in the clear area 420.Yet, write data and still need be stored to a target empty white area piece, just can finish the execution of write command.At this moment, controller 402 weares and teares average program the block in the data field 410 is converted to the blank block of clear area 420, to write data as target empty white area piece for storing.At first, controller 402 410 is searched one second block (step 520) of number of purge less than this first boundary value from the data field.Then, 420 search number of purge are greater than one the 3rd blank block of one second boundary value from the clear area for controller 402, and for exchanging (step 522) with second block, wherein this second boundary value is greater than this first boundary value.In an embodiment, controller 402 is searched the blank block of number of purge maximum as the 3rd blank block in clear area 420.
Then, controller 402 writes the 3rd blank block (step 524) with the data that this second block stores, and the logical address of the 3rd blank block is made as the logical address of this second block.Second block was eliminated the 3rd bigger blank block of number of times and replaced this moment, and controller 402 then just can be removed the data of this second block, is one the 4th blank block (step 526) to change this second block.Add one because the number of purge of the 4th blank block is the number of purge of second block, must be less than or equal to first boundary value, therefore meet the screening conditions of target empty white area piece.Therefore, controller 402 then just substitutes this first block writes data with storage target empty white area piece (step 528) with the 4th blank block as confession.Then, controller 402 writes data with this and writes the 4th blank block (step 510), and the logical address of the 4th blank block is made as the logical address of this first block.The 4th blank block that first block that store legacy data this moment has been stored new data replaces, therefore controller 402 is removed the data (step 512) of these first block, so that to change this first block be blank block and insert in the clear area 420.
Fig. 7 A, Fig. 7 B, and Fig. 7 C be controller according to the wear and tear synoptic diagram of average action of the present invention.Tentation data district 710 comprises block 711,712,713,714,71Z, respectively has 16,18,12,7,8 times number of purge.Clear area 720 comprises blank block 721,722,723,724,725, respectively has 12,11,30,32,20 times number of purge, and the time of blank block 721,722,723,724,725 deleted data is in regular turn by early arranging to evening.In Fig. 7 A, suppose that controller 402 receives a write command, desire more new data writes the block 71Z of data field 710.Because block 71Z stores data and can't write data again, so controller 402 chooses a target empty white area piece according to method 500 by clear area 420, desires to write the more new data of block 71Z for storage.Suppose that first boundary value is 10, and second boundary value is 30.Because the number of purge of blank block 721~725 all greater than first boundary value 10, therefore all is not suitable as target empty white area piece.This moment, controller 402 was just carried out the wearing and tearing average program according to step 520~528 of Fig. 5.Controller 402 at first searches the block 714 that has less than the number of purge 7 of first boundary value 10 by data field 710, and searches the blank block 724 with the number of purge 32 that is higher than second boundary value 30 by clear area 720.Then, controller 402 is with the data of blank block 724 storage data blocks 714, and inserts clear area 720 behind block 714 deleted datas, and its number of purge increases to 8 times.This moment controller 402 mat carry out the wearing and tearing average program and finish the exchange of block 724 and 714, shown in Fig. 7 B.
The number of purge 8 that have a blank block 714 in the clear area 720 this moment is less than first boundary value 10, thereby blank block 714 meets the screening conditions of target empty white area piece.Therefore, controller 402 selects blank block 714 as target empty white area piece, for the more new data of storage data block 71Z.Then, blank block 714 stores more and is placed into data field 710 behind the new data, shown in Fig. 7 C.And become blank block after the deleted data of block 71Z, and be placed into clear area 720, and its number of purge increases to 9 times, shown in Fig. 7 C.
At last, when the step 522 of the average action of wearing and tearing, controller 402 may be in the data field 410 search number of purge less than first boundary value second block.At this moment, represent that the number of purge of block all in the data field 410 is all greater than first boundary value.For flow process is proceeded, controller deducts a numerical value with the number of purge of all block in the data field 410 of storer 404, thereby the number of purge of all block is diminished.In an embodiment, this numerical value is half of boundary value of number of purge.After the number of purge of the block of data field 410 all diminished, controller 402 just can be from the data field 410 be sought second block of number of purge less than first boundary value again, for exchanging with the 3rd blank block.
Though the present invention discloses as above with preferred embodiment; right its is not in order 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 can doing a little change and retouching, so protection scope of the present invention is as the criterion when looking accompanying the claim person of defining.

Claims (13)

1. the method for writing data of a storer, wherein this storer comprises a data field and a clear area, and this data field comprises a plurality of block of storage data, and this clear area comprises the not a plurality of blank block of storage data, it is characterized in that this method comprises:
Receive desire from a main frame and write the write command that data write to one first block of this storer one;
Choose from this clear area and to have one first blank block of checkout time the earliest;
Check that whether 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, this is write data write this first blank block; And
Remove the data that this first block stores, so that to change this first block be blank block and insert this clear area.
2. the method for writing data of storer according to claim 1 is characterized in that, wherein this method more comprises:
When the number of purge of this first blank block during, search the one second blank block that number of purge is less than or equal to this first threshold certainly in this clear area greater than this first boundary value;
This is write data write this second blank block; And
Remove the data that this first block stores, so that to change this first block be blank block and insert this clear area.
3. the method for writing data of storer according to claim 2 is characterized in that, wherein this method more comprises:
Search number of purge in can't be when being less than or equal to this second blank block of this first threshold, carry out a wearing and tearing average program one second block in this data field is converted to one the 3rd blank block of this clear area by this clear area;
This is write data write the 3rd blank block; And
Remove the data that this first block stores, so that to change this first block be blank block and insert this clear area;
Wherein the number of purge of the 3rd blank block is less than or equal to this first threshold.
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:
In this data field, search number of purge this second block less than this first boundary value;
In this clear area, search the one four blank block of number of purge greater than one second boundary value;
The data that this second block is stored write the 4th blank block; And
Remove the data of this second block, be the 3rd blank block and insert this clear area to change this second block;
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 carrying out of this wearing and tearing average program more comprises:
In this data field, search number of purge this second block less than this first boundary value;
In this clear area, search one the 4th blank block of number of purge maximum;
The data that this second block is stored write the 4th blank block; And
Remove the data of this second block, be the 3rd blank block and insert this clear area to change this second block;
Wherein this second boundary value is greater than this first boundary value.
6. the method for writing data of storer according to claim 4 is characterized in that, wherein the step that obtains of this second block comprises:
When this data field does not have number of purge less than the block of this first boundary value, the number of purge of all block of this data field is deducted a pre-determined number; And
Again seek number of purge this second block less than this first boundary value from this data field.
7. the method for writing data of storer according to claim 6 is characterized in that, wherein this pre-determined number equals this first boundary value.
8. 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 a plurality of block of storage data, and this clear area comprises the not a plurality of blank block of storage data; And
One controller, receive desire from a main frame and write the write command that data write to one first block of this storer one, choose from this clear area and to have one first blank block of checkout time the earliest, check that whether 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, this is write data write this first blank block, and remove data that this first block stores so that to change this first block be blank block and insert this clear area.
9. data memory device according to claim 8, it is characterized in that, wherein when the number of purge of this first blank block during greater than this first boundary value, this controller is searched the one second blank block that number of purge is less than or equal to this first threshold in this clear area, this is write data write this second blank block, and remove data that this first block stores so that to change this first block be blank block and insert this clear area.
10. data memory device according to claim 9, it is characterized in that, wherein search number of purge in can't be when being less than or equal to this second blank block of this first threshold by this clear area, this controller carries out a wearing and tearing average program one second block in this data field is converted to one the 3rd blank block of this clear area, this is write data write the 3rd blank block, and remove data that this first block stores so that to change this first block be blank block and insert this clear area, wherein the number of purge of the 3rd blank block is less than or equal to this first threshold.
11. data memory device according to claim 10, it is characterized in that, wherein this controller is searched number of purge this second block less than this first boundary value in this data field, in this clear area, search the one four blank block of number of purge greater than one second boundary value, the data that this second block is stored write the 4th blank block, and the data of removing this second block are to change this second block for the 3rd blank block and insert this clear area, to carry out this wearing and tearing average program, wherein this second boundary value is greater than this first boundary value.
12. data memory device according to claim 10, it is characterized in that, wherein this controller is searched number of purge this second block less than this first boundary value in this data field, in this clear area, search one the 4th blank block of number of purge maximum, the data that this second block is stored write the 4th blank block, and the data of removing this second block are to change this second block for the 3rd blank block and insert this clear area, to carry out this wearing and tearing average program, wherein this second boundary value is greater than this first boundary value.
13. data memory device according to claim 11, it is characterized in that, wherein when this data field does not have number of purge less than the block of this first boundary value, this controller deducts a pre-determined number with the number of purge of all block of this data field, and this data field is sought number of purge this second block less than this first boundary value again certainly, 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 true CN102222044A (en) 2011-10-19
CN102222044B 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)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112115070A (en) * 2019-06-19 2020-12-22 美光科技公司 Garbage data collection adaptive to life expectancy of memory devices

Citations (6)

* 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
US20100027335A1 (en) * 2008-07-31 2010-02-04 Samsung Electronics Co., Ltd. Memory device and wear leveling method

Patent Citations (6)

* 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
US20100027335A1 (en) * 2008-07-31 2010-02-04 Samsung Electronics Co., Ltd. Memory device and wear leveling method
CN101369252A (en) * 2008-09-16 2009-02-18 浙江大学 Method for static data loss equalization based on NAND flash memory file system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112115070A (en) * 2019-06-19 2020-12-22 美光科技公司 Garbage data collection adaptive to life expectancy of memory devices

Also Published As

Publication number Publication date
CN102222044B (en) 2015-09-02

Similar Documents

Publication Publication Date Title
CN101458956B (en) Memory flash memory apparatus, memory flash memory apparatus method and method of evenly using the blocks of a flash memory
CN106598878B (en) Solid state disk cold and hot data separation method
CN102508788B (en) SSD (solid state drive) and SSD garbage collection method and device
US8843691B2 (en) Prioritized erasure of data blocks in a flash storage device
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
CN101676886B (en) Flash memory device and method for writing data thereto
US20120290769A1 (en) Flash memory device, memory control device, memory control method, and storage system
CN105589811A (en) Data storage device and operating method
CN101908368A (en) Electronic storage device and operation method thereof
CN106469122B (en) Valid data merging method, Memory Controller and memorizer memory devices
CN109542358A (en) A kind of cold and hot data separation method of solid state hard disk, device and equipment
CN101494086B (en) Memory device, controller and switching method for flash memory
CN106227471A (en) Solid state hard disc and the data access method being applied to solid state hard disc
CN103136121A (en) Cache management method for solid-state disc
CN104598386B (en) By following the trail of and reusing solid-state drive block using two level map index
US8521947B2 (en) Method for writing data into flash memory
CN109671458A (en) The method of management flash memory module and relevant flash controller
CN101556555B (en) Block managing method for flash memory as well as controller and storage system thereof
CN107608625A (en) A kind of method for lifting solid storage device reading performance
US9507723B2 (en) Method for dynamically adjusting a cache buffer of a solid state drive
CN101324899B (en) Method for rapidly writing NAND type FLASH
US20150205538A1 (en) Storage apparatus and method for selecting storage area where data is written
CN101894077B (en) Data storage method and system
CN105653466A (en) Data storage device and flash memory control method

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