CN102981966A - Data storage method with Flash storage blocks evenly assigned - Google Patents
Data storage method with Flash storage blocks evenly assigned Download PDFInfo
- Publication number
- CN102981966A CN102981966A CN2012104436699A CN201210443669A CN102981966A CN 102981966 A CN102981966 A CN 102981966A CN 2012104436699 A CN2012104436699 A CN 2012104436699A CN 201210443669 A CN201210443669 A CN 201210443669A CN 102981966 A CN102981966 A CN 102981966A
- Authority
- CN
- China
- Prior art keywords
- storage block
- storage
- block
- time
- data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Landscapes
- Techniques For Improving Reliability Of Storages (AREA)
- Read Only Memory (AREA)
Abstract
The invention discloses a data storage method with Flash storage blocks evenly assigned. The data storage method with the Flash storage blocks evenly assigned comprises a storage process when a data storage request exists. The process comprises the following steps of searching a corresponding logic block and a storage block according to a logic address in a data storage request and using the corresponding logic block and the storage block as storage source storage blocks; obtaining a present time and the erasing time which symbolizes the last time when the current time and symbol storage source storage blocks carry out erasing operation, and calculating a time difference between the present time and the erasing time; using the storage source storage block as a storage purpose storage block when the calculated time difference is larger than a first set time difference; selecting a storage block with low use frequency from an alignment of the usable storage blocks as the storage purpose storage block when the calculated time difference is not larger than the first set time difference; and mapping the storage purpose storage block with the logic block. According to the data storage method, the problem that some storage blocks are over-used while some storage blocks cannot be fully used is solved, and the service life of a Flash storage is prolonged.
Description
Technical field
The present invention relates to data storage technology, specifically, relate to the method for storage data in Flash, more particularly, relate to the date storage method of the balanced Flash of distribution storage block.
Background technology
The Flash storer is different from the I/O operation of conventional hard, and it is read and write take the position or page or leaf is the unit, but erase operation must be take storage block (also being physical block block) as the unit.The common capacity of storage block of Flash is larger, and the erasing times of storage block is limited, and for example, norFlash is 100,000 times, and nandflash is 1,000,000 times.When the data of read-write storage block, common way be address with storage block as physical address, shine upon by logical address and physical address and to visit storage block.Therefore, the data of same type will be stored in the storage block of same physical address.Because dissimilar Data Update speed is different, as easy as rolling off a log the phenomenon that some storage block reading frequency is high, some storage block reading frequency is low appears.Limit by the memory block erasing number of times, if certain or some storage block read-write frequencies is higher, then this class piece will frequently be wiped and use and exhaust very soon.Simultaneously, the storage block utilization factor that those data reading frequencies of storing are lower is lower, it is low to wipe frequency, thereby it is seriously unbalanced to cause storage block to use, and has reduced the whole service life of Flash storer.
For improving serviceable life, prior art has a kind of method, that the data in the Flash storer are saved in the internal memory, the change major part of data is carried out in internal memory, only when being necessary very much, just write data in the Flash storage block, reduce the erasing times of Flash storage block with this, and then improve serviceable life.But existing, this method uses limitation, seem helpless for the higher situation of storage promptness, such as, the system registry data information that the storage promptness is high, write frequency is high is used the method and still can't fundamentally be solved each storage block low problem in the inhomogeneous serviceable life that causes of use of Flash storer.
Summary of the invention
The present invention is directed to Flash storer in the prior art uses the inhomogeneous serviceable life that causes low problem because of each storage block a kind of date storage method of the balanced Flash of distribution storage block is provided, efficiently solve the problem that the part storage block is excessively used, the part storage block can not take full advantage of, improved the serviceable life of Flash storer.
For achieving the above object, the present invention adopts following technical proposals to be achieved:
A kind of balanced date storage method that distributes the Flash storage block, described method comprises the storing process when having data storage request, this process comprises the steps:
A1, search corresponding logical block and the storage block corresponding with logical block according to the logical address in the data storage request, as the source of storage storage block;
A2, obtain the erasing time that current time and sign storage source storage block are carried out erase operation for the last time, the mistiming of calculating both, and make comparisons with the first setting-up time is poor;
A3, when poor greater than the first setting-up time in the mistiming of calculating, will store the source storage block as the storage purpose storage block, the data that will store write to the storage purpose storage block;
A4, be not more than the first setting-up time when poor in the mistiming of calculating, from available storage block formation, select the storage block of a low frequency of utilization as the storage purpose storage block, the data that will store write in this storage purpose storage block, simultaneously the logical block among this storage purpose storage block and the step a are shone upon.
Aforesaid method, each storage block in the Flash storer is provided with history and wipes the total degree record, in described step a4, from available storage block formation, select a history to wipe total degree and wipe total degree than the history of described storage source storage block and be less than first and set the storage block of erasing times as the storage purpose storage block.
Aforesaid method, be convenient follow-up judgement and use, each storage block in the Flash storer is provided with the erasing time record that the last piece shifts erasing times record afterwards and carries out for the last time erase operation, in described step a3, the data that will store write to after the storage purpose storage block, the history of this storage purpose storage block is wiped total degree and the last piece erasing times after shifting add respectively 1, and be updated to the time of current data writing its last erasing time of carrying out erase operation; In described step a4, the data that will store write to after the storage purpose storage block, the history of this storage purpose storage block is wiped total degree add 1, its the last piece is shifted erasing times afterwards put 1, and be updated to the time of current data writing its last erasing time of carrying out erase operation.
Aforesaid method, be the serviceable life of equilibrium criterion storage efficiency and storage block, in described step a4, be not more than the first setting-up time when poor in the mistiming of calculating, judge first whether the erasing times of storage block the last piece in storage source after shifting sets erasing times greater than second; When being not more than the second setting erasing times, will store the source storage block as the storage purpose storage block, when setting erasing times greater than second, from available storage block formation, select the storage block of a low frequency of utilization as the storage purpose storage block.
Aforesaid method, for realizing the further balance in data storage efficiency and storage block serviceable life, erasing times after storage block the last piece in described storage source shifts is during greater than the setting erasing times, at first should storage source storage block join protected formation, every adding is protected formation once, and its protected number of times adds 1; Then, judge that whether the protected number of times of this storage source storage block is greater than setting the protection number of times; When being not more than setting protection number of times, will store the source storage block as the storage purpose storage block, greater than setting protection number of times the time, from available storage block formation, select the storage block of a low frequency of utilization as the storage purpose storage block.
Aforesaid method for making things convenient for the lasting application of method, also comprises the steps: after described step a4
A5, after the storage block of selecting a low frequency of utilization from available storage block formation is as the storage purpose storage block, storage source storage block among the step a1 is added in the available storage block formation, and history that should storage source storage block is wiped total degree and is added 1, its the last piece is shifted erasing times afterwards set to 0, its last erasing time of carrying out erase operation is updated to the current time that is added to available storage block formation.
Aforesaid method is distributed for further the Flash storage block being carried out equilibrium, and described method also comprises the static store data handling procedure, and this process comprises the steps:
B1, obtain a Flash storage block in the use as the process source storage block, obtain the erasing time that current time and sign process source storage block are carried out erase operation for the last time, the mistiming of calculating both, and make comparisons with the second setting-up time is poor;
B2, when poor greater than the second setting-up time in the mistiming of calculating, the data in the storage block of determination processing source are the static store data, select the storage block of a high frequency of utilization as the processing intent storage block from available storage block formation;
B3, the data in the process source storage block are written in the processing intent storage block, and the logical block that the processing intent storage block is corresponding with the process source storage block shines upon, simultaneously the process source storage block is joined in the available storage block formation.
Aforesaid method, follow-up use for ease of method, in described step b3, after being written to the data in the process source storage block in the processing intent storage block, the history of this processing intent storage block is wiped total degree add 1, its the last piece is shifted erasing times afterwards put 1, and be updated to the time of current data writing its last erasing time of carrying out erase operation; After joining the process source storage block in the available storage block formation, the history of this process source storage block is wiped total degree add 1, its the last piece is shifted erasing times afterwards set to 0, its last erasing time of carrying out erase operation is updated to the current time that is added to available storage block formation.
Aforesaid method, for realizing data storage efficiency and the storage block further balance in serviceable life, also comprise step b20 between described step b1 and step b2: erasing times and the 3rd setting erasing times after the last piece of process source storage block is shifted are made comparisons;
In described step b2, when the erasing times after the last piece of process source storage block shifts was poor greater than the second setting-up time less than the mistiming of the 3rd setting erasing times and calculating, the data in the storage block of determination processing source were the static store data.
Aforesaid method, concrete, in described step b2, from available storage block formation, select a history wipe total degree than the history of described process source storage block wipe total degree more than the 4th storage block of setting erasing times as the processing intent storage block, come the quite slow static store data of storage update speed.
Compared with prior art, advantage of the present invention and good effect are: the present invention is when carrying out the data storage, the erasing time of carrying out recently erase operation according to storage block is judged the frequency of utilization of this storage block, when its frequency of utilization is higher, select a lower storage block of frequency of utilization to store data, come the erasing times of a plurality of storage blocks of balance by the frequency of utilization of dynamic adjustments storage block, and then improve the serviceable life of whole Flash storer.
After reading the specific embodiment of the present invention by reference to the accompanying drawings, other characteristics of the present invention and advantage will become clearer.
Description of drawings
Fig. 1 is the process flow diagram of first embodiment of date storage method of the balanced Flash of distribution of the present invention storage block;
Fig. 2 is the mapping structure synoptic diagram between logical address and the storage block among Fig. 1 embodiment;
Fig. 3 is the process flow diagram of the storing process when having request of data among second embodiment of date storage method of the balanced Flash of distribution of the present invention storage block;
Fig. 4 is the process flow diagram of static store data handling procedure among Fig. 3 embodiment.
Embodiment
Below in conjunction with the drawings and specific embodiments technical scheme of the present invention is described in further detail.
Please refer to Fig. 1, this Figure 1 shows that the process flow diagram of first embodiment of date storage method of the balanced Flash of distribution of the present invention storage block.
As shown in Figure 1, to store the process of data as follows for this embodiment:
Step 101: flow process begins.
Step 102: request is stored data in the Flash storage block.
Step 103: search corresponding storage block as storage source storage block according to logical address.
Shown in the logical address of Fig. 2 and the mapping structure synoptic diagram between the storage block, characteristics according to the Flash storer, the address of each storage block (physical block) among the Flash is as the physical address of Flash, corresponding logical block one by one separately, and the address of the logical address of logical block actual use when to be the user carry out read-write operation to the Flash storer.In this embodiment, the size of each logical block LB1 to LBn is 16k, and corresponding logical address is from 0x00000000 until 0xFFFFFFFF.In this n logical block, each logical block correspondence a storage block, for example, logical block LB1 is corresponding with storage block PB1, logical block LB2 is corresponding with storage block PB3, and logical block LB3 is corresponding with storage block PBn, all logical blocks and represent with the corresponding relation of the storage block form with mapping table.When request was stored data in the Flash storage block, the user can determine logical address space according to the size of data, then according to scope and the number of logical address computational logic piece; Again then, find corresponding storage block according to the address mapping relation of logical block and physical block, with this storage block as storage source storage block.Follow-up step illustrates that take a storage source storage block as example the actual storage block that writes of how to confirm data is with the utilization factor of balanced storage block.
Step 104: obtain the current time.
Current time can obtain by reading the Flash storage place system of systems time.
Step 105: obtain the erasing time that storage source storage block is carried out erase operation for the last time.
Because the erase operation of Flash storer is take storage block as the unit, at every turn again during data writing, all can be with whole memory block erasing, and then write new data.This embodiment is provided with the erasing time record for each storage block, the time that the record storage block is carried out erase operation, and after having wiped, upgrade this erasing time at every turn, judge the write frequency of storage block to utilize this erasing time, and then determine whether the transfer that to carry out the data storage.
Step 106: the storage source storage block that the current time that calculation procedure 104 obtains and step 105 obtain is carried out the mistiming in the erasing time of erase operation for the last time, and compares with the first setting-up time is poor.
Wherein, the poor value that arranges as required for the user of the first setting-up time, the size of this value is not construed as limiting, and can set according to actual conditions.
Step 107: whether the mistiming that determining step 106 calculates is poor greater than the first setting-up time.If, execution in step 108; Otherwise, go to step 109.
Step 108: poor greater than the first setting-up time if current time and storage source storage block are carried out the difference in erasing time of erase operation for the last time, illustrate that this storage block do not carry out erase operation within nearest a period of time, judge that its read-write frequency within the scope of accepting, can continue data writing.Therefore, directly should storage source storage block as the storage purpose storage block, then, execution in step 111.
Step 109: to be not more than the first setting-up time poor if current time and storage source storage block are carried out the difference in the erasing time of erase operation for the last time, illustrate that this storage block recently carrying out at least erase operation within a period of time, then judge this storage block to wipe frequency higher, also be that its data of storing are to need the dynamic datas that often upgrade.Therefore, reach very soon its serviceable life for avoiding this storage block frequently to be wiped, in the case, from available storage block formation, select the storage block of low frequency of utilization as the storage purpose storage block, then, execution in step 110.
Here, the class storage block of the storage block in the available storage block formation for wiping, can data writing.And, when selecting the storage block of low frequency of utilization, can adopt following method to realize:
Wipe the total degree record for each storage block arranges a history, be used for recording this storage block from bringing into use all performed so far erasing times summations, and this can not wipe out when being recorded in erase block memory.Then, from available storage block formation, select a history to wipe total degree and wipe total degree than the history of storage source storage block and be less than the first storage block of setting erasing times, with this storage block replacement storage source storage block and use as the storage purpose storage block.Wherein, first set erasing times also be the user as required and a value that arranges, the size of this value is not construed as limiting, and can set according to actual conditions.
Need to prove, except adopting said method, can also adopt additive method to judge the height of storage block frequency of utilization, for example, calculate the erasing times in a certain period, and then try to achieve the frequency of wiping in this section period, this selective erase frequency is wiped frequency as a whole and as judging storage block frequency of utilization basis for estimation just.Present embodiment is not construed as limiting concrete determination methods and process.
Step 110: after the storage block that will newly select, hang down frequency of utilization is as the storage purpose storage block, for data to be written correctly are written in this storage block, storage purpose storage block and logical block need to be re-started the address mapping, and preserve this mapping relations.Like this, in the situation of wiping the frequency permission, during later at every turn to appointment logical address data writing, these data will directly write in the new storage purpose storage block.Then, execution in step 111.
Step 111: after having determined the storage purpose storage block, the data that will store write in the storage purpose storage block.
This embodiment is in data storage procedure, and (the Flash Physical layer) efficiently solves the Flash storage block and uses unbalanced problem, has avoided some storage block to suffer excessive use, thereby has significantly improved the whole service life of Flash storer from bottom.
For the Flash memory stores data, the serviceable life of Flash is no doubt important, need to consider wiping life-span and balanced distribution of storage block when the storage data.On the other hand, its read-write efficiency also is an important indicator weighing memory performance.So how serviceable life and the read-write efficiency of balance storage block also are the problems that needs primary study and solution.The below will specifically describe with second embodiment shown in Fig. 3 and Fig. 4 the solution of this balance.
At first, data structure to applied Flash storage block among this embodiment is made a brief description: for making things convenient for the management of storage block, this embodiment is that each storage block among the Flash is provided with header data in the initiation region, be used for some records of store storage piece, comprise that foregoing history wipes the total degree record, the last piece shift (factor data shift storage and so that storage block from using state transitions to be upstate, or from can state transitions be the use state) afterwards erasing times record, the last erasing time record of carrying out erase operation can also record the information such as ID of physical I D and the corresponding logical block of this storage block.These header data can not deleted in the memory block erasing process, but the user can upgrade modification.
Secondly, to the transfer of meeting generation storage block, also have namely that the Flash storage block balanced is distributed, make brief description the opportunity of balance serviceable life and read-write efficiency: have two this opportunity, one is described when having data storage request such as Fig. 1 embodiment, in this process, if find that the data that storage block corresponding to the logical block of request stored in the past may be dynamic data (often upgrading the data that write), then attempt to seek a lower storage block of frequency of utilization and come the unloading data; Be by setting up a static data detecting process, if find static data (often not upgrading the data that write) in this process, then considering this data conversion storage in the higher storage block of frequency of utilization another opportunity.The below will be respectively with shown in Fig. 3 process flow diagram and Fig. 4 process flow diagram, describes this embodiment balance serviceable life and read-write efficiency in detail and the detailed process of carrying out the data storage.
Please refer to shown in Fig. 3 have request of data the time the process flow diagram of storing process, detailed process is as follows:
Step 301: during request of data, search storage source storage block in storage, obtain the erasing time that current operation time and storage source storage block are carried out erase operation for the last time, calculate two mistimings, and with the poor comparison of the first setting-up time.
This process is identical to step 106 with the step 102 of Fig. 1 embodiment, can be with reference to the content of above-mentioned corresponding steps.
Step 302: judge whether the mistiming of calculating is poor greater than the first setting-up time.If go to step 311; Otherwise, execution in step 303.
Step 303: be not more than the first setting-up time when poor in the mistiming of calculating, obtain the erasing times of storage block the last piece in storage source after shifting, and with second set erasing times and make comparisons.
Wherein, second set erasing times also be the user as required and a value that arranges, the size of this value is not construed as limiting, and can set according to actual conditions.
Step 304: judge that storage block the last piece in storage source shifts erasing times afterwards and whether sets erasing times greater than second.If, execution in step 305; If not, go to step 311.
The starting point that this step is set is: be not more than the first setting-up time when poor in the erasing time that storage source storage block is carried out erase operation for the last time, illustrate that storage source storage block carrying out erase operation at least 1 time in nearest certain hour section.Wipe the higher storage block of frequency and carry out data conversion storage if directly should storage source storage block regard as, because data conversion storage need to be selected new storage block, carry out the operating process such as the address is shone upon, modification storage block header data, will certainly cause the read or write speed of data to descend, especially frequently carry out the words of data conversion storage, have a strong impact on read-write efficiency, cause the data memory property to descend.Utilize storage block for taking into account data read-write efficiency and balanced the distribution, be not more than the first setting-up time when poor in the erasing time that storage source storage block is carried out erase operation for the last time, adopt again other restrictive conditions to be further qualified.This step namely is from this angle, utilizes the erasing times of storage block the last piece in storage source after shifting to do further to judge, only when erasing times is set erasing times greater than second, judges whether to carry out the transfer storage of data again.
Step 305: when the erasing times after storage source the last piece of storage block shifts is set erasing times greater than second, will store the source storage block and join protected formation, and protected number of times is added 1.
When the erasing times after storage source the last piece of storage block shifts is set erasing times greater than second, it is higher to illustrate that this source storage block is wiped frequency recently, but also may have it only is after the last piece shifts the higher frequency of wiping have been arranged, and can not representing it fully, to wipe frequency necessarily very high.Be further balance read-write efficiency and serviceable life; when the erasing times of this embodiment after storage source the last piece of storage block shifts set erasing times greater than second; this storage source storage block is wiped the storage block of frequency as doubtful height, remake further protection and judge.Specifically, be that this storage block is joined protected formation, and set up a timer for it the once protected formation of adding, protected number of times is added 1.
Step 306: judge that whether the protected number of times of storage source storage block is greater than setting the protection number of times.If, execution in step 307; If not, go to step 311.
Step 307: if the protected number of times of storage source storage block is greater than setting the protection number of times; judge that this storage block has been subject to excessive use; need to carry out data conversion storage, will from available storage block formation, select the storage block of low frequency of utilization as the storage purpose storage block.
Step 308: storage purpose storage block and logical block are re-started the address mapping.
Step 309: the data that will store write in the storage purpose storage block.
Above-mentioned steps 307 to the specific implementation process of step 309 can be with reference to step 109 among figure 1 embodiment to the description of step 111.
Step 310: the relative recording of updated stored purpose storage block.Then, go to step 313.
For follow-up use, when the storage purpose storage block that logical block has remapped new, the relative recording that needs updated stored purpose storage block, also namely upgrade each record in its header data, specifically, comprise: the history of this storage purpose storage block is wiped total degree add 1(and represent and wiped 1 time), erasing times after the last piece transfer is put 1(represent to have carried out the piece transfer, and write 1 secondary data, wiped 1 time), and be updated to time of current data writing its last erasing time of carrying out erase operation; Simultaneously, the ID that to revise its corresponding logical block ID be current new logical block.
And, after the new storage block replacement storage source storage block of selection realizes data conversion storage as the storage purpose storage block, storage source storage block is added in the available storage block formation, in order to follow-up use; Simultaneously, the history of this storage source storage block is wiped total degree add 1, the erasing times after its last piece is shifted sets to 0, and its last erasing time of carrying out erase operation is updated to the current time that is added to available storage block formation.
Step 311: this step is transferred by above-mentioned steps 302,304 and 306; specifically; that difference in current time and the erasing time of the last execution erase operation of the storage source storage block erasing times after poor or storage source the last piece of storage block shifts greater than the first setting-up time is not more than the second protected number of times of setting erasing times or storage source storage block and is not more than and sets when protecting number of times; judge that the read-write frequency of storage source storage block within the scope of accepting, can continue data writing.Therefore, should storage source storage block as the storage purpose storage block, the data that will store write in the storage purpose storage block.
Step 312: updated stored purpose storage block, also namely store the relative recording of source storage block.
For follow-up use, when writing data into storage source storage block, also need to upgrade the record in its header data, specifically comprise: the history of this storage block is wiped total degree add 1(and represent and wiped 1 time), its the last piece is shifted erasing times afterwards put 1, and be updated to the time of current data writing its last erasing time of carrying out erase operation.
Step 313: the Stored Procedure when having request of data finishes.
Please refer to again Fig. 4, this embodiment to the static store data process, take the idiographic flow of serviceable life of taking into account storer and read-write efficiency as:
Step 401: the static store data flow begins.
Step 402: from the storage block formation of using, obtain a storage block as the process source storage block.
Step 403: obtain the erasing time that current time and process source storage block are carried out erase operation for the last time, the mistiming of calculating both, and make comparisons with the second setting-up time is poor.
Here, poor and aforementioned the first setting-up time of the second setting-up time is poor similar, also is the value that the user arranges as required, and the size of this value is not construed as limiting, and can set according to actual conditions.Preferably, the second setting-up time is poor is poor 100 times of the first setting-up time.
Step 404: the last piece that obtains the process source storage block shifts erasing times afterwards, and compares with the 3rd setting erasing times.
Wherein, the 3rd sets erasing times and aforementioned first, second, and to set erasing times similar, also be the user as required and a value of setting, the size of this value is not construed as limiting, and can set according to actual conditions.
Step 405: whether the mistiming of calculating in the determining step 403 is poor greater than the second setting-up time, and whether the erasing times in the step 404 sets erasing times less than the 3rd.If two judged results are and are, execution in step 406; Otherwise the data of storing in the storage block of determination processing source are not static datas, and the frequency of utilization of storage block can also accept, and then do not need this storage block is carried out data conversion storage, go to step 402, continue next storage block is judged processing.
Step 406: when the mistiming of calculating in step 403, the erasing times in the poor and step 404 was set erasing times less than the 3rd greater than the second setting-up time, data in the storage block of determination processing source are the static store data, therefore there is the not high possibility of this storage block frequency of utilization, need to carries out data conversion storage.
Step 407: when carrying out unloading, from available storage block formation, select the storage block of high frequency of utilization as the processing intent storage block.
Specifically, can select a history to wipe total degree from available storage block formation wipes total degree than the history of process source storage block and sets the storage block of erasing times as the processing intent storage block more than the 4th.Wherein, the 4th set erasing times also be the user as required and a value that arranges.
And, when selecting such storage block, can be from the storage block formation at random or order select, choose the storage block that satisfies condition namely as the processing intent storage block; Perhaps, wiping the descending order of total degree according to history from the storage block formation selects, can guarantee that like this choosing the highest storage block of access times stores static data, reduce to greatest extent to wiping at this of storage block here, to improve its serviceable life.
As described in the storage block of selecting low frequency of utilization among Fig. 1 embodiment, be not limited to the storage block that adopts said method to select high frequency of utilization, can also adopt that the method for judging selective erase efficient is selected etc.
Step 408: the data in the process source storage block are written in the processing intent storage block.
Step 409: the logical block that the processing intent storage block is corresponding with the process source storage block shines upon, and upgrades the relative recording of processing intent storage block.
The why and how of mapping is referring to noted earlier.And the renewal of the relative recording of processing intent storage block is comprised: the history of this processing intent storage block is wiped total degree adds 1, its the last piece is shifted erasing times afterwards put 1, and be updated to the time of current data writing its last erasing time of carrying out erase operation; Simultaneously, the ID that to revise its corresponding logical block ID be current new logical block.
Step 410: the process source storage block is joined in the available storage block formation, and upgrade the relative recording of process source storage block.
Specifically, be the history of this process source storage block to be wiped total degree add 1, the erasing times after its last piece is shifted sets to 0, and its last erasing time of carrying out erase operation is updated to the current time that is added to available storage block formation.
Step 411: flow process finishes.
This embodiment is when judging whether to carry out the unloading of static data, two Rule of judgment have been adopted, one is that the mistiming is poor greater than the second setting-up time, another is that erasing times is set erasing times less than the 3rd, but being not limited to this two Rule of judgment, can only be one of them Rule of judgment, perhaps, adopt more Rule of judgment, can be according to the serviceable life of Flash and the equilibrium relation choose reasonable between the read-write efficiency.
Above embodiment is only in order to illustrating technical scheme of the present invention, but not limits it; Although with reference to previous embodiment the present invention is had been described in detail, for the person of ordinary skill of the art, still can make amendment to the technical scheme that previous embodiment is put down in writing, perhaps part technical characterictic wherein is equal to replacement; And these modifications or replacement do not make the essence of appropriate technical solution break away from the spirit and scope of the present invention's technical scheme required for protection.
Claims (10)
1. a balanced date storage method that distributes the Flash storage block is characterized in that described method comprises the storing process when having data storage request, and this process comprises the steps:
A1, search corresponding logical block and the storage block corresponding with logical block according to the logical address in the data storage request, as the source of storage storage block;
A2, obtain the erasing time that current time and sign storage source storage block are carried out erase operation for the last time, the mistiming of calculating both, and make comparisons with the first setting-up time is poor;
A3, when poor greater than the first setting-up time in the mistiming of calculating, will store the source storage block as the storage purpose storage block, the data that will store write to the storage purpose storage block;
A4, be not more than the first setting-up time when poor in the mistiming of calculating, from available storage block formation, select the storage block of a low frequency of utilization as the storage purpose storage block, the data that will store write in this storage purpose storage block, simultaneously the logical block among this storage purpose storage block and the step a are shone upon.
2. method according to claim 1, it is characterized in that, each storage block in the Flash storer is provided with history and wipes the total degree record, in described step a4, from available storage block formation, select a history to wipe total degree and wipe total degree than the history of described storage source storage block and be less than first and set the storage block of erasing times as the storage purpose storage block.
3. method according to claim 2, it is characterized in that, each storage block in the Flash storer is provided with the erasing time record that the last piece shifts erasing times record afterwards and carries out for the last time erase operation, in described step a3, the data that will store write to after the storage purpose storage block, the history of this storage purpose storage block is wiped total degree and the last piece erasing times after shifting add respectively 1, and be updated to the time of current data writing its last erasing time of carrying out erase operation; In described step a4, the data that will store write to after the storage purpose storage block, the history of this storage purpose storage block is wiped total degree add 1, its the last piece is shifted erasing times afterwards put 1, and be updated to the time of current data writing its last erasing time of carrying out erase operation.
4. method according to claim 3, it is characterized in that, in described step a4, be not more than the first setting-up time when poor in the mistiming of calculating, judge first whether the erasing times of storage block the last piece in storage source after shifting sets erasing times greater than second; When being not more than the second setting erasing times, will store the source storage block as the storage purpose storage block, when setting erasing times greater than second, from available storage block formation, select the storage block of a low frequency of utilization as the storage purpose storage block.
5. method according to claim 4, it is characterized in that the erasing times after storage block the last piece in described storage source shifts at first should storage source storage block join protected formation during greater than the setting erasing times, every adding is protected formation once, and its protected number of times adds 1; Then, judge that whether the protected number of times of this storage source storage block is greater than setting the protection number of times; When being not more than setting protection number of times, will store the source storage block as the storage purpose storage block, greater than setting protection number of times the time, from available storage block formation, select the storage block of a low frequency of utilization as the storage purpose storage block.
6. each described method in 5 according to claim 3 is characterized in that, also comprises the steps: after described step a4
A5, after the storage block of selecting a low frequency of utilization from available storage block formation is as the storage purpose storage block, storage source storage block among the step a1 is added in the available storage block formation, and history that should storage source storage block is wiped total degree and is added 1, its the last piece is shifted erasing times afterwards set to 0, its last erasing time of carrying out erase operation is updated to the current time that is added to available storage block formation.
7. each described method in 5 according to claim 3 is characterized in that described method also comprises the static store data handling procedure, and this process comprises the steps:
B1, obtain a Flash storage block in the use as the process source storage block, obtain the erasing time that current time and sign process source storage block are carried out erase operation for the last time, the mistiming of calculating both, and make comparisons with the second setting-up time is poor;
B2, when poor greater than the second setting-up time in the mistiming of calculating, the data in the storage block of determination processing source are the static store data, select the storage block of a high frequency of utilization as the processing intent storage block from available storage block formation;
B3, the data in the process source storage block are written in the processing intent storage block, and the logical block that the processing intent storage block is corresponding with the process source storage block shines upon, simultaneously the process source storage block is joined in the available storage block formation.
8. method according to claim 7, it is characterized in that, in described step b3, after being written to the data in the process source storage block in the processing intent storage block, the history of this processing intent storage block is wiped total degree add 1, its the last piece is shifted erasing times afterwards put 1, and be updated to the time of current data writing its last erasing time of carrying out erase operation; After joining the process source storage block in the available storage block formation, the history of this process source storage block is wiped total degree add 1, its the last piece is shifted erasing times afterwards set to 0, its last erasing time of carrying out erase operation is updated to the current time that is added to available storage block formation.
9. method according to claim 7 is characterized in that, also comprises step b20 between described step b1 and step b2: the erasing times and the 3rd after the last piece transfer of process source storage block is set erasing times make comparisons;
In described step b2, when the erasing times after the last piece of process source storage block shifts was poor greater than the second setting-up time less than the mistiming of the 3rd setting erasing times and calculating, the data in the storage block of determination processing source were the static store data.
10. method according to claim 7, it is characterized in that, in described step b2, from available storage block formation, select a history to wipe total degree and wipe total degree than the history of described process source storage block and set the storage block of erasing times as the processing intent storage block more than the 4th.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210443669.9A CN102981966B (en) | 2012-11-09 | 2012-11-09 | A kind of date storage method of equilibrium assignment Flash storage block |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210443669.9A CN102981966B (en) | 2012-11-09 | 2012-11-09 | A kind of date storage method of equilibrium assignment Flash storage block |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102981966A true CN102981966A (en) | 2013-03-20 |
CN102981966B CN102981966B (en) | 2016-04-06 |
Family
ID=47856018
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201210443669.9A Active CN102981966B (en) | 2012-11-09 | 2012-11-09 | A kind of date storage method of equilibrium assignment Flash storage block |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102981966B (en) |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104063186A (en) * | 2014-06-30 | 2014-09-24 | 成都万维图新信息技术有限公司 | Data access method of electronic equipment |
CN105045537A (en) * | 2015-08-04 | 2015-11-11 | 国网浙江兰溪市供电公司 | Erasing and writing method for parameter data of ammeter, method for searching power line parameters in storage device of ammeter and ammeter |
CN106354718A (en) * | 2015-07-13 | 2017-01-25 | 中国移动通信集团公司 | File management method and device of subscriber identity module |
CN107258000A (en) * | 2015-03-25 | 2017-10-17 | 英特尔公司 | Method and apparatus for performing data manipulation in memory devices |
WO2018033036A1 (en) * | 2016-08-19 | 2018-02-22 | 深圳大普微电子科技有限公司 | Solid state hard disk and data access method for use with solid state hard disk |
WO2018214013A1 (en) * | 2017-05-23 | 2018-11-29 | 深圳大学 | Data writing method and device based on three-dimensional flash memory |
CN111767007A (en) * | 2019-04-01 | 2020-10-13 | 慧荣科技股份有限公司 | Write management mechanism for flash memory |
WO2021233187A1 (en) * | 2020-05-18 | 2021-11-25 | 中科寒武纪科技股份有限公司 | Method and device for allocating storage addresses for data in memory |
CN114546267A (en) * | 2022-02-14 | 2022-05-27 | 深圳源创存储科技有限公司 | Solid state disk based on big data calculation and solid state disk system |
CN114860624A (en) * | 2022-05-23 | 2022-08-05 | 深圳市芯存科技有限公司 | Data erasing method and system based on Nandflash chip |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101226504A (en) * | 2008-01-25 | 2008-07-23 | 炬力集成电路设计有限公司 | Method and apparatus for preventing memory from damage |
US20100077266A1 (en) * | 2008-04-24 | 2010-03-25 | Shinichi Kanno | Memory system and control method thereof |
US7913032B1 (en) * | 2007-04-25 | 2011-03-22 | Apple Inc. | Initiating memory wear leveling |
-
2012
- 2012-11-09 CN CN201210443669.9A patent/CN102981966B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7913032B1 (en) * | 2007-04-25 | 2011-03-22 | Apple Inc. | Initiating memory wear leveling |
CN101226504A (en) * | 2008-01-25 | 2008-07-23 | 炬力集成电路设计有限公司 | Method and apparatus for preventing memory from damage |
US20100077266A1 (en) * | 2008-04-24 | 2010-03-25 | Shinichi Kanno | Memory system and control method thereof |
Non-Patent Citations (1)
Title |
---|
NEAL MIELKE: "Flash EEPROM Threshold Instabilities due to Charge Trapping During Program/Erase Cycling", 《IEEE TRANSACTIONS ON DEVICE AND MATERIALS RELIABILITY》 * |
Cited By (16)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104063186A (en) * | 2014-06-30 | 2014-09-24 | 成都万维图新信息技术有限公司 | Data access method of electronic equipment |
CN104063186B (en) * | 2014-06-30 | 2016-04-06 | 成都万维图新信息技术有限公司 | A kind of data access method of electronic equipment |
CN107258000A (en) * | 2015-03-25 | 2017-10-17 | 英特尔公司 | Method and apparatus for performing data manipulation in memory devices |
CN107258000B (en) * | 2015-03-25 | 2021-12-03 | 英特尔公司 | Method and apparatus for performing data operations within a memory device |
CN106354718A (en) * | 2015-07-13 | 2017-01-25 | 中国移动通信集团公司 | File management method and device of subscriber identity module |
CN106354718B (en) * | 2015-07-13 | 2021-05-25 | 中国移动通信集团公司 | File management method and device of user identification module |
CN105045537A (en) * | 2015-08-04 | 2015-11-11 | 国网浙江兰溪市供电公司 | Erasing and writing method for parameter data of ammeter, method for searching power line parameters in storage device of ammeter and ammeter |
US10810127B2 (en) | 2016-08-19 | 2020-10-20 | Shenzhen Dapu Microelectronics Co., Ltd. | Solid-state hard disk and data access method for use with solid-state hard disk |
WO2018033036A1 (en) * | 2016-08-19 | 2018-02-22 | 深圳大普微电子科技有限公司 | Solid state hard disk and data access method for use with solid state hard disk |
WO2018214013A1 (en) * | 2017-05-23 | 2018-11-29 | 深圳大学 | Data writing method and device based on three-dimensional flash memory |
CN111767007A (en) * | 2019-04-01 | 2020-10-13 | 慧荣科技股份有限公司 | Write management mechanism for flash memory |
CN111767007B (en) * | 2019-04-01 | 2023-12-22 | 慧荣科技股份有限公司 | Write management mechanism for flash memory |
WO2021233187A1 (en) * | 2020-05-18 | 2021-11-25 | 中科寒武纪科技股份有限公司 | Method and device for allocating storage addresses for data in memory |
CN114546267A (en) * | 2022-02-14 | 2022-05-27 | 深圳源创存储科技有限公司 | Solid state disk based on big data calculation and solid state disk system |
CN114860624A (en) * | 2022-05-23 | 2022-08-05 | 深圳市芯存科技有限公司 | Data erasing method and system based on Nandflash chip |
CN114860624B (en) * | 2022-05-23 | 2023-04-28 | 深圳市芯存科技有限公司 | Data erasing method and system based on Nandflash chip |
Also Published As
Publication number | Publication date |
---|---|
CN102981966B (en) | 2016-04-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102981966A (en) | Data storage method with Flash storage blocks evenly assigned | |
CN105074673B (en) | Garbage collection priority-based for data-storage system | |
JP5943095B2 (en) | Data migration for composite non-volatile storage | |
CN103092766B (en) | A kind of loss equalizing implementation method for NAND FLASH | |
US8195971B2 (en) | Solid state disk and method of managing power supply thereof and terminal including the same | |
CN102646069B (en) | Method for prolonging service life of solid-state disk | |
CN101354681B (en) | Memory system, abrasion equilibrium method and apparatus of non-volatile memory | |
CN103559138B (en) | Solid state hard disc and space management thereof | |
CN101382918B (en) | NAND flash memory optimizing and managing method based on data interchange zone | |
CN105718206B (en) | The flash translation layer (FTL) and its implementation of RAID can be perceived | |
CN102768645B (en) | The solid state hard disc forecasting method of hybrid cache and solid-state hard disk SSD | |
CN102737715B (en) | For the method for power fail safeguard of data of NOR flash memory | |
CN103425600A (en) | Address mapping method for flash translation layer of solid state drive | |
US9411719B2 (en) | Memory system including nonvolatile and volatile memory and operating method thereof | |
CN104899154B (en) | The page management method hosted is mixed based on embedded system | |
CN109582593A (en) | A kind of FTL address mapping method and data read-write method based on calculating | |
CN102572330A (en) | Method for reading, writing and erasing data of liquid crystal television Flash chip | |
CN101763309A (en) | Nonvolatile storage device, information recording system, and information recording method | |
CN101719099A (en) | Method and device for reducing write amplification of solid state disk | |
CN102214143A (en) | Method and device for managing multilayer unit flash memory, and storage equipment | |
CN102981969A (en) | Method for deleting repeated data and solid hard disc thereof | |
CN103309815A (en) | Method and system for increasing available capacity and service life of solid state disc | |
CN107817945A (en) | Data reading method and system of hybrid memory structure | |
US20150205538A1 (en) | Storage apparatus and method for selecting storage area where data is written | |
CN101154447B (en) | Flash memory and its 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 |