CN102981966B - A kind of date storage method of equilibrium assignment Flash storage block - Google Patents

A kind of date storage method of equilibrium assignment Flash storage block Download PDF

Info

Publication number
CN102981966B
CN102981966B CN201210443669.9A CN201210443669A CN102981966B CN 102981966 B CN102981966 B CN 102981966B CN 201210443669 A CN201210443669 A CN 201210443669A CN 102981966 B CN102981966 B CN 102981966B
Authority
CN
China
Prior art keywords
storage
storage block
block
erasing
time
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201210443669.9A
Other languages
Chinese (zh)
Other versions
CN102981966A (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.)
Hisense Broadband Multimedia Technology Co Ltd
Original Assignee
Hisense Broadband Multimedia Technology Co Ltd
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 Hisense Broadband Multimedia Technology Co Ltd filed Critical Hisense Broadband Multimedia Technology Co Ltd
Priority to CN201210443669.9A priority Critical patent/CN102981966B/en
Publication of CN102981966A publication Critical patent/CN102981966A/en
Application granted granted Critical
Publication of CN102981966B publication Critical patent/CN102981966B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a kind of date storage method of equilibrium assignment Flash storage block, comprise storing process when there is data storage request, this process comprises the steps: to search corresponding logical block and storage block according to the logical address in data storage request, as storage source storage block; Obtain current time and indicate that storage source storage block performs the erasing time of erase operation for the last time, the mistiming of both calculating; When the mistiming calculated is greater than the first setting-up time difference, using storage source storage block as storage purpose storage block; When the mistiming calculated is not more than the first setting-up time difference, from available storage block queue, selects the storage block of a low frequency of utilization as storage purpose storage block, this storage purpose storage block and logical block are mapped.Apply method of the present invention and efficiently solve the problem that part of storage block excessively uses, part of storage block can not make full use of, improve the serviceable life of flash storage.

Description

A kind of date storage method of equilibrium assignment Flash storage block
Technical field
The present invention relates to data storage technology, specifically, relate to the method storing data in Flash, more particularly, relate to the date storage method of equilibrium assignment Flash storage block.
Background technology
Flash storage operates different from the I/O of conventional hard, and its read-write is with position or page for unit, but erase operation must with storage block (also i.e. physical block block) for unit.The usual capacity of storage block of Flash is comparatively large, and the erasing times of storage block is limited, and such as, norFlash is 100,000 times, and nandflash is 1,000,000 times.When reading and writing the data of storage block, common way is using the address of storage block as physical address, carries out mapping visit storage block by logical address and physical address.Therefore, the data of identical 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 logly there is some phenomenon that storage block reading frequency is high, some storage block reading frequency is low.Limitting by memory block erasing number of times, if certain or some storage block read-write frequencies is higher, then this kind of piece will be frequently erased and use and exhaust very soon.Meanwhile, the storage block utilization factor that the digital independent frequency that those store is lower is lower, erasing frequency is low, thus it is seriously unbalanced to cause storage block to use, and reduces the whole service life of flash storage.
For improving serviceable life, prior art has a kind of method, that the data in flash storage are saved in internal memory, the change major part of data is carried out in internal memory, only just write data into when being necessary very much in Flash storage block, reduce the erasing times of Flash storage block with this, and then improve serviceable life.But there is use limitation in this method, the situation storing promptness higher is seemed helpless, such as, store the system registry data information that promptness is high, write frequency is high, application the method still fundamentally cannot solve the problem that each storage block of flash storage uses the uneven serviceable life caused low.
Summary of the invention
The present invention is directed to problem that flash storage in prior art uses the uneven serviceable life caused low because of each storage block and provide a kind of date storage method of equilibrium assignment Flash storage block, efficiently solve the problem that part of storage block excessively uses, part of storage block can not make full use of, improve the serviceable life of flash storage.
For achieving the above object, the present invention adopts following technical proposals to be achieved:
A date storage method for equilibrium assignment Flash storage block, described method comprises storing process when there is 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 data storage request, as storage source storage block;
A2, acquisition current time and mark storage source storage block perform the erasing time of erase operation for the last time, the mistiming of both calculating, and make comparisons with the first setting-up time difference;
A3, calculate mistiming be greater than first setting-up time difference time, using storage source storage block as storage purpose storage block, the data that will store write to storage purpose storage block;
A4, calculate mistiming be not more than first setting-up time difference time, from available storage block queue, select the storage block of a low frequency of utilization as storage purpose storage block, the data that will store write in this storage purpose storage block, are mapped by the logical block in this storage purpose storage block and step a simultaneously.
Method as above, each storage block in flash storage is provided with history erasing total degree record, in described step a4, from available storage block queue, a history erasing total degree is selected to be less than the storage block of the first setting erasing times as storage purpose storage block than the history erasing total degree of described storage source storage block.
Method as above, for convenience of follow-up judgement and use, each storage block in flash storage is provided with the erasing times record after the transfer of the last block and performs the erasing time record of erase operation for the last time, in described step a3, after the data that will store write to storage purpose storage block, erasing times after the history of this storage purpose storage block erasing total degree and the transfer of the last block is added 1 respectively, and the erasing time it being performed for the last time erase operation is updated to the time of current write data; In described step a4, after the data that will store write to storage purpose storage block, the history of this storage purpose storage block erasing total degree is added 1, erasing times after its last block transfer is put 1, and the erasing time it being performed for the last time erase operation is updated to the time of current write data.
Method as above, for the serviceable life of equilibrium criterion storage efficiency and storage block, in described step a4, when the mistiming calculated is not more than the first setting-up time difference, first judge whether the erasing times after the last block transfer of storage source storage block is greater than the second setting erasing times; When being not more than the second setting erasing times, using storage source storage block as storage purpose storage block, when being greater than the second setting erasing times, from available storage block queue, select the storage block of a low frequency of utilization as storage purpose storage block.
Method as above, for realizing the further balance of data storage efficiency and storage block serviceable life, when erasing times after the last block transfer of described storage source storage block is greater than setting erasing times, first this storage source storage block is joined protected queue, often add once protected queue, its protected number of times adds 1; Then, judge whether this storage source protected number of times of storage block is greater than setting protection number of times; When being not more than setting protection number of times, using storage source storage block as storage purpose storage block, when being greater than setting protection number of times, from available storage block queue, select the storage block of a low frequency of utilization as storage purpose storage block.
Method as above, for convenience of the lasting application of method, also comprises the steps: after described step a4
A5, select from available storage block queue the storage block of a low frequency of utilization as storage purpose storage block after, storage source storage block in step a1 is added in available storage block queue, and the history of this storage source storage block erasing total degree is added 1, erasing times after its last block transfer set to 0, the erasing time it being performed for the last time erase operation is updated to the current time being added to available storage block queue.
Method as above, for carrying out equilibrium assignment to Flash storage block further, described method also comprises static store data handling procedure, and this process comprises the steps:
A Flash storage block during b1, acquisition use, as process source storage block, obtains current time and indicates that process source storage block performs the erasing time of erase operation for the last time, the mistiming of both calculating, and make comparisons with the second setting-up time difference;
B2, when the mistiming calculated is greater than the second setting-up time difference, the data in the storage block of determination processing source are static store data, select the storage block of a high frequency of utilization as processing intent storage block from available storage block queue;
B3, the data in process source storage block to be written in processing intent storage block, and the logical block that processing intent storage block is corresponding with process source storage block is mapped, the source of process storage block is joined in available storage block queue simultaneously.
Method as above, for ease of the follow-up use of method, in described step b3, after data in the storage block of process source are written in processing intent storage block, the history of this processing intent storage block erasing total degree is added 1, erasing times after its last block transfer is put 1, and the erasing time it being performed for the last time erase operation is updated to the time of current write data; After process source storage block is joined in available storage block queue, the history of this process source storage block erasing total degree is added 1, erasing times after its last block transfer set to 0, the erasing time it being performed for the last time erase operation is updated to the current time being added to available storage block queue.
Method as above, for realizing the further balance of data storage efficiency and storage block serviceable life, between described step b1 and step b2, also comprise step b20: the erasing times and the 3rd after the last block transfer of process source storage block is set erasing times and makes comparisons;
In described step b2, the erasing times after the last block transfer processing source storage block be less than the 3rd setting erasing times and the mistiming calculated is greater than the second setting-up time difference time, the data in the storage block of determination processing source are static store data.
Method as above, concrete, in described step b2, from available storage block queue, select a history erasing total degree to set the storage block of erasing times as processing intent storage block than the history erasing total degree of described process source storage block more than the 4th, carry out the static store data that storage update speed is quite slow.
Compared with prior art, advantage of the present invention and good effect are: the present invention is when carrying out data and storing, the erasing time performing erase operation recently according to storage block judges the frequency of utilization of this storage block, when its frequency of utilization is higher, the storage block selecting frequency of utilization lower stores data, balanced the erasing times of multiple storage block by the frequency of utilization of dynamic adjustments storage block, and then improve the serviceable life of whole flash storage.
After reading the specific embodiment of the present invention by reference to the accompanying drawings, the other features and advantages of the invention will become clearly.
Accompanying drawing explanation
Fig. 1 is the process flow diagram of date storage method first embodiment of equilibrium assignment Flash storage block of the present invention;
Fig. 2 is the mapping structure schematic diagram in Fig. 1 embodiment between logical address and storage block;
Fig. 3 is the process flow diagram of storing process when there is request of data in date storage method second embodiment of equilibrium assignment Flash storage block of the present invention;
Fig. 4 is the process flow diagram of static store data handling procedure in 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 date storage method first embodiment of equilibrium assignment Flash storage block of the present invention.
As shown in Figure 1, the process of this embodiment storage data is as follows:
Step 101: flow process starts.
Step 102: ask to store data in Flash storage block.
Step 103: search corresponding storage block as storage source storage block according to logical address.
As shown in the mapping structure schematic diagram between the logical address of Fig. 2 and storage block, according to the feature of flash storage, the address of each storage block (physical block) in Flash is as the physical address of Flash, respective one_to_one corresponding a logical block, and the address of the logical address of logical block is user actual use when read-write operation carries out to flash storage.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 correspond to a storage block, such as, 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 representing with the form of mapping table with the corresponding relation of storage block.When asking to store data in Flash storage block, user can according to the size determination logical address space of data, then according to scope and the number of logical address computational logic block; Subsequently, find corresponding storage block according to logical block to the address mapping relation of physical block, using this storage block as storage source storage block.Follow-up step stores source storage block for one, illustrates and how to determine that the storage block of the actual write of data is with the utilization factor of balanced storage block.
Step 104: obtain current time.
Current time can store place system system time by reading Flash obtains.
Step 105: obtain the erasing time that storage source storage block performs erase operation for the last time.
Because the erase operation of flash storage is unit with storage block, when re-writing data, all by whole memory block erasing, and then new data can be write at every turn.This embodiment is that each storage block is provided with erasing time record, record storage block performs the time of erase operation, and upgrade this erasing time after having wiped at every turn, with the write frequency utilizing this erasing time to judge storage block, and then determine whether the transfer that needs to carry out data storage.
Step 106: the current time that calculation procedure 104 obtains and the storage source storage block that step 105 obtains perform the mistiming in the erasing time of erase operation for the last time, and compare with the first setting-up time difference.
Wherein, the value that the first setting-up time difference is arranged as required for user, the size of this value is not construed as limiting, and can set according to actual conditions.
Step 107: it is poor whether the mistiming that determining step 106 calculates is greater than the first setting-up time.If so, step 108 is performed; Otherwise, go to step 109.
Step 108: if to be greater than the first setting-up time poor for current time and the difference storing source storage block and perform for the last time the erasing time of erase operation, illustrate and do not perform erase operation within this storage block nearest a period of time, judge that its read-write frequency is within the scope accepted, can continue to write data.Therefore, directly using this storage source storage block as storage purpose storage block, then, perform step 111.
Step 109: if to be not more than the first setting-up time poor for current time and the difference storing source storage block and perform for the last time the erasing time of erase operation, illustrate that this storage block performed at least erase operation within nearest a period of time, then judge that the erasing frequency of this storage block is higher, also namely its data stored are the dynamic datas needing often to upgrade.Therefore, reach its serviceable life very soon for avoiding this storage block to be frequently erased, in the case, from available storage block queue, select the storage block of low frequency of utilization as storage purpose storage block, then, perform step 110.
Here, the storage block in available storage block queue is a class storage block of wiping, can write data.And, when selecting the storage block of low frequency of utilization, following method can be adopted realize:
For each storage block arranges a history erasing total degree record, be used for recording this storage block from bringing into use all erasing times summations performed so far, and can not wipe out when this is recorded in erase block memory.Then, from available storage block queue, select a history erasing total degree to be less than the storage block of the first setting erasing times than the history erasing total degree of storage source storage block, replace storage source storage block by this storage block and use as storage purpose storage block.Wherein, the first setting erasing times is also user's value arranged as required, and the size of this value is not construed as limiting, and can set according to actual conditions.
It should be noted that, except adopting said method, additive method can also be adopted to judge the height of storage block frequency of utilization, such as, calculate the erasing times in certain a period of time, and then the erasing frequency of trying to achieve in this period, this selective erase frequency is wiped as a whole frequency and as judge storage block frequency of utilization height basis for estimation.The present embodiment is not construed as limiting concrete determination methods and process.
Step 110: using the storage block of that newly select, low frequency of utilization as after storage purpose storage block, for data to be written are correctly written in this storage block, need storage purpose storage block and logical block to re-start address maps, and preserve this mapping relations.Like this, when wiping frequency and allowing, later each to when specifying logical address to write data, these data will directly write in new storage purpose storage block.Then, step 111 is performed.
Step 111: after determining storage purpose storage block, the data that will store write in storage purpose storage block.
This embodiment is in data storage procedure, and from bottom, (the Flash Physical layer), efficiently solves Flash storage block and use unbalanced problem, avoids some storage block and suffers excessive use, thus significantly improve the whole service life of flash storage.
Store data for flash storage, the serviceable life of Flash is no doubt important, needs erasing life-span and the equilibrium assignment of considering storage block when storing data.On the other hand, its read-write efficiency is also the important indicator weighing memory performance.So how balancing serviceable life and the read-write efficiency of storage block, is also the problem needing primary study and solution.The solution of this balance will be specifically described below with the embodiment of second shown in Fig. 3 and Fig. 4.
First, one brief description is done to the data structure of the Flash storage block applied in this embodiment: for convenience of the management of storage block, this embodiment is that each storage block in Flash is provided with header data in initiation region, be used for some records of store storage block, comprise foregoing history erasing total degree record, (factor data transfer stores and makes storage block be upstate from using state transfer in the last block transfer, or from can state transfer for using state) after erasing times record, the erasing time record of last execution erase operation, the information such as the physical I D of this storage block and the ID of corresponding logical block can also be recorded.These header data can not be deleted in memory block erasing process, but user can carry out renewal amendment.
Secondly, to can occur storage block transfer, also namely exist and be briefly described on Flash storage block equilibrium assignment, balance serviceable life and opportunity of read-write efficiency: this opportunity has two, one be as described in Fig. 1 embodiment when there is data storage request, in this process, if find that the data that the storage block that the logical block of request is corresponding stored in the past may be dynamic data (often upgrading the data of write), then the storage block of attempting searching frequency of utilization lower carrys out unloading data; Another opportunity is by setting up a static data detecting process, if find static data (infrequently upgrading the data of write) in this process, then considers this data conversion storage in the higher storage block of frequency of utilization.Below will respectively with shown in Fig. 3 process flow diagram and Fig. 4 process flow diagram, describe this embodiment balance serviceable life and read-write efficiency in detail and carry out the detailed process of data storage.
Please refer to shown in Fig. 3 there is request of data time the process flow diagram of storing process, detailed process is as follows:
Step 301: when storing request of data, search storage source storage block, acquisition current operating temporal and the source of storage storage block perform the erasing time of erase operation for the last time, calculate two mistimings, and compare with the first setting-up time difference.
This process is identical to step 106 with the step 102 of Fig. 1 embodiment, can with reference to the content of above-mentioned corresponding steps.
Step 302: judge whether the mistiming calculated is greater than the first setting-up time poor.If so, 311 are gone to step; Otherwise, perform step 303.
Step 303: when the calculated mistiming is not more than the first setting-up time difference, obtains the erasing times after the last block transfer of storage source storage block, and sets erasing times make comparisons with second.
Wherein, the second setting erasing times is also user's value arranged as required, and the size of this value is not construed as limiting, and can set according to actual conditions.
Step 304: judge whether the erasing times after the last block transfer of storage source storage block is greater than the second setting erasing times.If so, step 305 is performed; If not, 311 are gone to step.
The starting point arranging this step is: when the erasing time that the source of storage storage block performs erase operation is for the last time not more than the first setting-up time difference, illustrate that storage source storage block performed at least 1 erase operation in nearest certain hour section.If directly this storage source storage block regarded as the higher storage block of erasing frequency and carry out data conversion storage, because data conversion storage needs to select new storage block, carries out address maps, revises the operating process such as storage block header data, the read or write speed of data will certainly be caused to decline, especially the words of data conversion storage are frequently carried out, have a strong impact on read-write efficiency, cause data memory property to decline.For taking into account data read-write efficiency and equilibrium assignment utilizes storage block, when the erasing time that the source of storage storage block performs erase operation is for the last time not more than the first setting-up time difference, then other restrictive conditions are adopted to be further qualified.Namely this step is from this angle, utilizes the erasing times after the last block transfer of storage source storage block to do to judge further, only when erasing times is greater than the second setting erasing times, then judges whether that the transfer needing to carry out data stores.
Step 305: when the erasing times after the last block transfer of the source of storage storage block is greater than the second setting erasing times, storage source storage block is joined protected queue, and protected number of times is added 1.
When erasing times after the last block transfer of the source of storage storage block is greater than the second setting erasing times, illustrate that this source storage block wipes frequency recently higher, but also may there is it is only just had higher erasing frequency after the last block transfer, can not represent its erasing frequency completely necessarily very high.For balancing read-write efficiency and serviceable life further; when the erasing times of this embodiment after the last block transfer of the source of storage storage block is greater than the second setting erasing times; using the storage block of this storage source storage block as doubtful height erasing frequency, remake and protect judgement further.Specifically, be that this storage block is joined protected queue, and set up a timer for it, do not add once protected queue, protected number of times is added 1.
Step 306: judge whether the protected number of times of storage source storage block is greater than setting protection number of times.If so, step 307 is performed; If not, 311 are gone to step.
Step 307: if the protected number of times of the source of storage storage block is greater than setting protection number of times; judge that this storage block receives excessive use; need to carry out data conversion storage, select the storage block of low frequency of utilization as storage purpose storage block using from available storage block queue.
Step 308: storage purpose storage block and logical block are re-started address maps.
Step 309: the data that will store write in storage purpose storage block.
The specific implementation process of above-mentioned steps 307 to step 309 can with reference to step 109 in figure 1 embodiment to the description of step 111.
Step 310: the relative recording upgrading storage purpose storage block.Then, 313 are gone to step.
In order to follow-up use, when logical block has remapped new storage purpose storage block, need the relative recording upgrading storage purpose storage block, also each record in its header data is namely upgraded, specifically, comprise: the history of this storage purpose storage block erasing total degree is added 1(and represents and erase 1 time), erasing times after the last block transfer is put 1(and represent that performing block shifts, and be written with 1 secondary data, erase 1 time), and is updated to the time of current write data its last erasing time performing erase operation; Meanwhile, the logical block ID revised corresponding to it is the ID of current new logical block.
And, replace selecting new storage block after storage source storage block realizes data conversion storage as storage purpose storage block, storage source storage block being added in available storage block queue, in order to follow-up use; Meanwhile, the history of this storage source storage block erasing total degree is added 1, the erasing times after its last block transfer is set to 0, and the erasing time it being performed for the last time erase operation is updated to the current time being added to available storage block queue.
Step 311: this step is transferred by above-mentioned steps 302,304 and 306; specifically; that the protected number of times being not more than the second setting erasing times or the source of storage storage block in current time and the difference in erasing time of the last execution erase operation the storing source storage block erasing times be greater than after poor or the source of the storage storage block the last time block of the first setting-up time shifts is not more than and sets when protecting number of times; the read-write frequency of determining storage source storage block, within the scope accepted, can continue to write data.Therefore, using this storage source storage block as storage purpose storage block, the data that will store write in storage purpose storage block.
Step 312: upgrade storage purpose storage block, also namely store the relative recording of source storage block.
In order to 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 erasing total degree is added 1(and represents and erase 1 time), erasing times after its last block transfer is put 1, and the erasing time it being performed for the last time erase operation is updated to the time of current write data.
Step 313: Stored Procedure when there is request of data terminates.
Please refer to Fig. 4 again, this embodiment process static store data, with the idiographic flow in the serviceable life and read-write efficiency of taking into account storer be:
Step 401: static store data flow starts.
Step 402: obtain a storage block as process source storage block from the storage block queue used.
Step 403: acquisition current time and process source storage block perform the erasing time of erase operation for the last time, the mistiming of both calculating, and make comparisons with the second setting-up time difference.
Here, the second setting-up time difference is similar with aforementioned first setting-up time difference, and be also user's value arranged as required, the size of this value is not construed as limiting, and can set according to actual conditions.Preferably, the second setting-up time difference is 100 times of the first setting-up time difference.
Step 404: obtain the erasing times after the last block transfer of process source storage block, and set erasing times compare with the 3rd.
Wherein, it is similar that the 3rd setting erasing times and aforementioned first, second set erasing times, and be also user's value arranged as required, the size of this value is not construed as limiting, and can set according to actual conditions.
Step 405: it is poor whether the mistiming calculated in determining step 403 is greater than the second setting-up time, and whether the erasing times in step 404 is less than the 3rd setting erasing times.If two judged results are and are, perform step 406; Otherwise the data stored in the storage block of determination processing source are not static datas, and the frequency of utilization of storage block can also accept, then do not need to carry out data conversion storage to this storage block, go to step 402, continue to carry out judgement process to next storage block.
Step 406: the mistiming calculated in step 403 is greater than the second setting-up time poor and erasing times in step 404 when being less than the 3rd setting erasing times, data in the storage block of determination processing source are static store data, therefore there is the possibility that this storage block frequency of utilization is not high, need to carry out data conversion storage.
Step 407: when carrying out unloading, selects the storage block of high frequency of utilization as processing intent storage block from available storage block queue.
Specifically, a history erasing total degree can be selected from available storage block queue to set the storage block of erasing times as processing intent storage block than the history erasing total degree of process source storage block more than the 4th.Wherein, the 4th setting erasing times is also user's value arranged as required.
And, when selecting such storage block, can from storage block queue at random or order select, choose the storage block that satisfies condition namely as processing intent storage block; Or, select according to the order that history erasing total degree is descending from storage block queue, such can guarantee choose the highest storage block of access times to store static data, reduce to greatest extent to storage block here in this erasing, to improve its serviceable life.
As select low frequency of utilization in Fig. 1 embodiment storage block as described in, be not limited to and adopt said method to select the storage block of high frequency of utilization, can also adopt and judge that the method for selective erase efficiency is selected etc.
Step 408: the data in the storage block of process source are written in processing intent storage block.
Step 409: the logical block that processing intent storage block is corresponding with process source storage block maps, and the relative recording of update process object storage block.
The why and how mapped is see noted earlier.And the renewal of the relative recording of processing intent storage block is comprised: the history of this processing intent storage block erasing total degree is added 1, erasing times after its last block transfer is put 1, and the erasing time it being performed for the last time erase operation is updated to the time of current write data; Meanwhile, the logical block ID revised corresponding to it is the ID of current new logical block.
Step 410: process source storage block is joined in available storage block queue, and the relative recording of update process source storage block.
Specifically, be that the history of this process source storage block erasing total degree is added 1, the erasing times after its last block transfer set to 0, the erasing time it being performed for the last time erase operation is updated to the current time being added to available storage block queue.
Step 411: flow process terminates.
This embodiment is when judging whether the unloading carrying out static data, have employed two Rule of judgment, one is that to be greater than the second setting-up time the mistiming poor, another is that erasing times is less than the 3rd setting erasing times, but being not limited to this two Rule of judgment, can be only one of them Rule of judgment, or, adopt more Rule of judgment, can according to the equilibrium relation choose reasonable between the serviceable life of Flash and read-write efficiency.
Above embodiment only in order to technical scheme of the present invention to be described, but not is limited; Although with reference to previous embodiment to invention has been detailed description, for the person of ordinary skill of the art, still can modify to the technical scheme described in previous embodiment, or equivalent replacement is carried out to wherein portion of techniques feature; And these amendments or replacement, do not make the essence of appropriate technical solution depart from the spirit and scope of the present invention's technical scheme required for protection.

Claims (9)

1. a date storage method for equilibrium assignment Flash storage block, is characterized in that, described method comprises storing process when there is 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 data storage request, as storage source storage block;
A2, acquisition current time and mark storage source storage block perform the erasing time of erase operation for the last time, the mistiming of both calculating, and make comparisons with the first setting-up time difference;
A3, calculate mistiming be greater than first setting-up time difference time, using storage source storage block as storage purpose storage block, the data that will store write to storage purpose storage block;
A4, when the mistiming calculated is not more than the first setting-up time difference, first judge the last block of storage source storage block shift after erasing times whether be greater than the second setting erasing times; When being not more than the second setting erasing times, using storage source storage block as storage purpose storage block, when being greater than the second setting erasing times, from available storage block queue, select the storage block of a low frequency of utilization as storage purpose storage block; The data that will store write in this storage purpose storage block, are mapped by the logical block in this storage purpose storage block and step a1 simultaneously.
2. method according to claim 1, it is characterized in that, each storage block in flash storage is provided with history erasing total degree record, in described step a4, from available storage block queue, a history erasing total degree is selected to be less than the storage block of the first setting erasing times as storage purpose storage block than the history erasing total degree of described storage source storage block.
3. method according to claim 2, it is characterized in that, each storage block in flash storage is provided with the erasing times record after the transfer of the last block and performs the erasing time record of erase operation for the last time, in described step a3, after the data that will store write to storage purpose storage block, erasing times after the history of this storage purpose storage block erasing total degree and the transfer of the last block is added 1 respectively, and the erasing time it being performed for the last time erase operation is updated to the time of current write data; In described step a4, after the data that will store write to storage purpose storage block, the history of this storage purpose storage block erasing total degree is added 1, erasing times after its last block transfer is put 1, and the erasing time it being performed for the last time erase operation is updated to the time of current write data.
4. method according to claim 1, it is characterized in that, when erasing times after the last block transfer of described storage source storage block is greater than the second setting erasing times, first this storage source storage block is joined protected queue, often add once protected queue, its protected number of times adds 1; Then, judge whether this storage source protected number of times of storage block is greater than setting protection number of times; When being not more than setting protection number of times, using storage source storage block as storage purpose storage block, when being greater than setting protection number of times, from available storage block queue, select the storage block of a low frequency of utilization as storage purpose storage block.
5. the method according to claim 3 or 4, is characterized in that, also comprises the steps: after described step a4
A5, select from available storage block queue the storage block of a low frequency of utilization as storage purpose storage block after, storage source storage block in step a1 is added in available storage block queue, and the history of this storage source storage block erasing total degree is added 1, erasing times after its last block transfer set to 0, the erasing time it being performed for the last time erase operation is updated to the current time being added to available storage block queue.
6. the method according to claim 3 or 4, is characterized in that, described method also comprises static store data handling procedure, and this process comprises the steps:
A Flash storage block during b1, acquisition use, as process source storage block, obtains current time and indicates that process source storage block performs the erasing time of erase operation for the last time, the mistiming of both calculating, and make comparisons with the second setting-up time difference;
B2, when the mistiming calculated is greater than the second setting-up time difference, the data in the storage block of determination processing source are static store data, select the storage block of a high frequency of utilization as processing intent storage block from available storage block queue;
B3, the data in process source storage block to be written in processing intent storage block, and the logical block that processing intent storage block is corresponding with process source storage block is mapped, the source of process storage block is joined in available storage block queue simultaneously.
7. method according to claim 6, it is characterized in that, in described step b3, after data in the storage block of process source are written in processing intent storage block, the history of this processing intent storage block erasing total degree is added 1, erasing times after its last block transfer is put 1, and the erasing time it being performed for the last time erase operation is updated to the time of current write data; After process source storage block is joined in available storage block queue, the history of this process source storage block erasing total degree is added 1, erasing times after its last block transfer set to 0, the erasing time it being performed for the last time erase operation is updated to the current time being added to available storage block queue.
8. method according to claim 6, is characterized in that, between described step b1 and step b2, also comprise step b20: the erasing times and the 3rd after the last block transfer of process source storage block is set erasing times and makes comparisons;
In described step b2, the erasing times after the last block transfer processing source storage block be less than the 3rd setting erasing times and the mistiming calculated is greater than the second setting-up time difference time, the data in the storage block of determination processing source are static store data.
9. method according to claim 6, it is characterized in that, in described step b2, from available storage block queue, a history erasing total degree is selected to set the storage block of erasing times as processing intent storage block than the history erasing total degree of described process source storage block more than the 4th.
CN201210443669.9A 2012-11-09 2012-11-09 A kind of date storage method of equilibrium assignment Flash storage block Active CN102981966B (en)

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 CN102981966A (en) 2013-03-20
CN102981966B true 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)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104063186B (en) * 2014-06-30 2016-04-06 成都万维图新信息技术有限公司 A kind of data access method of electronic equipment
US9922695B2 (en) * 2015-03-25 2018-03-20 Intel Corporation Apparatus and method for page copying within sections of a memory
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
CN106227471A (en) * 2016-08-19 2016-12-14 深圳大普微电子科技有限公司 Solid state hard disc and the data access method being applied to solid state hard disc
WO2018214013A1 (en) * 2017-05-23 2018-11-29 深圳大学 Data writing method and device based on three-dimensional flash memory
TWI718516B (en) * 2019-04-01 2021-02-11 慧榮科技股份有限公司 Write mangement for protecting erased blocks in flash memory
US20230214322A1 (en) * 2020-05-18 2023-07-06 Cambricon (Xi'an) Semiconductor Co., Ltd. Method and device for allocating storage addresses for data in memory
CN114546267B (en) * 2022-02-14 2022-11-18 深圳源创存储科技有限公司 Solid state disk based on big data calculation and solid state disk system
CN114860624B (en) * 2022-05-23 2023-04-28 深圳市芯存科技有限公司 Data erasing method and system based on Nandflash chip

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101226504A (en) * 2008-01-25 2008-07-23 炬力集成电路设计有限公司 Method and apparatus for preventing memory from damage
US7913032B1 (en) * 2007-04-25 2011-03-22 Apple Inc. Initiating memory wear leveling

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4439569B2 (en) * 2008-04-24 2010-03-24 株式会社東芝 Memory system

Patent Citations (2)

* Cited by examiner, † Cited by third party
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

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Flash EEPROM Threshold Instabilities due to Charge Trapping During Program/Erase Cycling;Neal Mielke;《IEEE TRANSACTIONS ON DEVICE AND MATERIALS RELIABILITY》;20040930;第4卷(第3期);第335-344页 *

Also Published As

Publication number Publication date
CN102981966A (en) 2013-03-20

Similar Documents

Publication Publication Date Title
CN102981966B (en) A kind of date storage method of equilibrium assignment Flash storage block
TWI398770B (en) Data accessing method for flash memory and storage system and controller using the same
CN103092766A (en) Balanced loss achievement method for NAND FLASH
CN103559138B (en) Solid state hard disc and space management thereof
CN105718206B (en) The flash translation layer (FTL) and its implementation of RAID can be perceived
US8131911B2 (en) Data writing method, and flash storage system and controller using the same
US20100050007A1 (en) Solid state disk and method of managing power supply thereof and terminal including the same
US8296501B2 (en) Memory management method for non-volatile memory and controller using the same
CN110114758A (en) The specific aim of memory is removed
CN105242871A (en) Data writing method and apparatus
CN106598484A (en) Data storage method, flash memory chip and storage device
CN104516471B (en) Method and device for managing power supply of storage system
US20140129758A1 (en) Wear leveling in flash memory devices with trim commands
CN101640069B (en) Average wear method and average wear system for flash memory
US20100268865A1 (en) Static Wear Leveling
CN105095116A (en) Cache replacing method, cache controller and processor
CN101625897B (en) Data write-in method, storage system and controller used for quick flash memory
CN102981971B (en) A kind of phase transition storage loss equalizing method of quick response
CN102572330A (en) Method for reading, writing and erasing data of liquid crystal television Flash chip
CN109582593A (en) A kind of FTL address mapping method and data read-write method based on calculating
CN107491272B (en) Data migration method, device, equipment and storage medium
CN106354658B (en) A method of it reducing mapping table memory source in mixed-use developments algorithm and occupies
CN110673789B (en) Metadata storage management method, device, equipment and storage medium of solid state disk
CN104978148A (en) Data writing method and device and data reading method and device
TW202001565A (en) Method for managing flash memory module and associated flash memory controller and electronic device

Legal Events

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