CN107301132A - A kind of flash memory garbage reclamation optimization method - Google Patents

A kind of flash memory garbage reclamation optimization method Download PDF

Info

Publication number
CN107301132A
CN107301132A CN201710434596.XA CN201710434596A CN107301132A CN 107301132 A CN107301132 A CN 107301132A CN 201710434596 A CN201710434596 A CN 201710434596A CN 107301132 A CN107301132 A CN 107301132A
Authority
CN
China
Prior art keywords
valid data
flash memory
correcting code
data
error correcting
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.)
Pending
Application number
CN201710434596.XA
Other languages
Chinese (zh)
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.)
Huazhong University of Science and Technology
Original Assignee
Huazhong University of Science and Technology
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 Huazhong University of Science and Technology filed Critical Huazhong University of Science and Technology
Priority to CN201710434596.XA priority Critical patent/CN107301132A/en
Publication of CN107301132A publication Critical patent/CN107301132A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0253Garbage collection, i.e. reclamation of unreferenced memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • G06F11/10Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
    • G06F11/1008Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's in individual solid state devices
    • G06F11/1012Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's in individual solid state devices using codes or arrangements adapted for a specific type of error

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

The invention discloses a kind of garbage reclamation optimization method of flash memory storage, including:Pair determine reclaim dirty piece in valid data carry out error correcting code error correction threshold test, and judge whether the valid data mistake reaches the error correction threshold value of its error correcting code, the valid data of error correcting code error correction threshold value are not up to mistake, valid data are write direct in flash memory by register;The valid data of error correcting code error correction threshold value have been reached to mistake, first valid data read back controller, then writes in flash memory;Confirm that all valid data migrations of garbage reclamation are completed, by dirty piece of erasing.The invention also discloses the application of the garbage reclamation optimization method, and use the storage device and terminal of this method progress garbage reclamation.The present invention can improve garbage reclamation efficiency on the premise of flash memory storage reliability is ensured, the time required to effectively reducing garbage reclamation, so as to improve the overall I/O performances of system.

Description

A kind of flash memory garbage reclamation optimization method
Technical field
The invention belongs to solid-state disk technical field of memory, and in particular to a kind of garbage reclamation optimization method of flash memory storage.
Background technology
Garbage reclamation is the removing necessary method of invalid data, whole life of this process in solid-state disk in solid-state disc system Can continually occur in the life cycle.Garbage reclamation is reclaimed primarily directed to the valid data in dirty piece to be recycled, is removed dirty Before block, specifically, need to be transferred to valid data therein into other clear positions of flash memory, then could be by dirty piece of erasing.
The method of existing Data Migration, is that first the data of active page are read back controller, is then then written to NAND sudden strains of a muscle In depositing.That is, the data in dirty piece are required for first reading into device processed, general, in addition it is also necessary to these data are compiled again Code, then could write flash memory.But this rubbish recovering method needs to take a substantial amount of time, can also choke system I/O, be The solid-state disc system by storage medium of flash memory is badly in need of the performance bottleneck broken through at present.
In the prior art, CN201180041989 discloses a kind of pre-emptive rubbish recovering method, the core skill of this method Art is to determine after garbage reclamation amount, judges size of the yield compared to recovery threshold value, rubbish is carried out according to the size of yield Rubbish reclaimer operation.Although this method can solve to need the problem of quantity of refuse reclaimed overloads, for ensureing data storage For the demand of reliability, benefited without any.In another prior art CN201510671242, a kind of base is disclosed In the solid-state disk rubbish recovering method of data lifetime, the core technology of this method is, sets incremental according to application requirement Time series, according to the expected existence time limit of data to be written, selects different modes to carry out garbage reclamation.The purpose master of this method It is the writing speed for ensureing solid-state disk, reduces the access expense that data moving belt comes, the data storage for solid-state disk can Effective solution is not proposed by property.
The content of the invention
For the disadvantages described above or Improvement requirement of prior art, the invention provides a kind of flash memory garbage reclamation optimization method And its application, it is proposed that a kind of adaptive rubbish recovering method, the optimization method of the technology of the present invention is ensureing solid-state disk data On the premise of the reliability of storage, the time required to reducing garbage reclamation, system I/O performances are improved.
To achieve the above object, according to one aspect of the present invention there is provided a kind of flash memory garbage reclamation optimization method, its It is characterised by, including,
Pair determine reclaim dirty piece in valid data carry out error correcting code error correction threshold test;
Judge whether the valid data mistake reaches the error correction threshold value of its error correcting code;
The valid data of error correcting code error correction threshold value are not up to mistake, are led to the valid data using copy-back instructions Register is crossed to write direct in flash memory;The valid data of error correcting code error correction threshold value have been reached to mistake, first the valid data have been read Controller is returned, then is write in flash memory.
In technical solution of the present invention, the mistake of valid data to be recycled in dirty piece to be recycled is detected first, determines that it is The no maximum error correcting capability for reaching error code, that is, carry out error correcting code error correction threshold test.Error correcting code threshold value is not up to for mistake Instructed in valid data, technical solution of the present invention using copy-back, by register, first valid data are stored in and deposited Device, then place data into flash memory.It also is located in flash memory due to be recycled dirty piece, by this method, it is not necessary to from flash memory Middle taking-up valid data are that direct transfer of the valid data in flash memory can be achieved, and greatly save the time of garbage reclamation.It is right The valid data of error correcting code threshold value have been reached in mistake, the maximum error correction of error correcting code has been reached, it is therefore desirable to will be effective Data are first read back controller, are re-started after error correcting code coding, then write in flash memory.The method of technical solution of the present invention, passes through The wrong size in valid data page is detected, whether misjudgment reaches the error correction threshold value of its error correcting code, so as to take two kinds of sides Formula is reclaimed to the valid data in dirty piece, on the one hand ensure that the accuracy of reclaimed valid data, on the other hand The time of garbage reclamation is saved.
It is preferred as one of technical solution of the present invention, error correcting code error correction is carried out to each valid data page in dirty piece respectively Threshold test, with the reliability for the valid data for ensureing to write flash memory.
It is a lasting process that valid data in dirty piece, which are reclaimed, for the valid data specifically reclaimed each time, all Need to carry out threshold test.Specifically, for each data page to be recycled, error correcting code error correction threshold value is all carried out to it Whether detection, error correcting code error correction threshold value is reached according to mistake, to determine the recovery for selecting which kind of mode to carry out valid data.Its In, because the characteristics of copy-back instructs cumulative error, most proceeding by when valid data are reclaimed i.e. to whole Data page carries out the detection of error correcting code error correction threshold value, judges whether the error in data in valid data page reaches error correcting code error correction Maximum capacity.When recovery to the valid data that mistake is not reaching to error correcting code error correction threshold value, directly by digital independent To the register in the same packet of flash memory, then the data read in register are write to the blank page selected.Reached for mistake The valid data of error correcting code error correction threshold value have been arrived, it is necessary to send into controller and carry out re-encoding process, flash memory could be write.This Plant way of recycling, it can be ensured that the reliability of the valid data reclaimed every time.
It is preferred as one of technical solution of the present invention, time of the valid data of error correcting code error correction threshold value is not up to mistake Receipts processing is specifically included,
The register that the mistake is not up in the valid data of error correcting code error correction threshold value write-in flash memory;
Valid data in register are moved on the blank page of flash memory.
It is preferred as one of technical solution of the present invention, having for error correcting code error correction threshold value is not up to by register pair mistake When effect data are migrated, error correcting code error correction threshold test is carried out to it at any time.
The valid data of error correcting code error correction threshold value are not up to for mistake, technical solution of the present invention, which is mainly, uses copy- Back instructions carry out the migration of data.The instruction can on the premise of data are not taken out, realize data from a Hash memory pages to The transfer process of another Hash memory pages.This process is mainly what is realized by register.Register is to be located at flash memory internal A part, be a kind of high speed depositing element of limited storage capacity, they can be used to temporary instruction, data and ground Location.It is directly to carry out Data Migration using register in packet because copy-back is operated, can not utilizes and entangle in this process Error code (ECC, Error Correction Code) completes error correction to data, thus can cause after the completion of Data Migration in data Mistake adds up, and eventually exceeds the correction capability of error correcting code, and then influence the reliability of whole system.Therefore, returned in each rubbish Before receipts start to migrate valid data, error correcting code error correction threshold value is carried out to the data for reclaiming each active page in block and examined Survey, i.e., error detection is carried out to the effective page data for preparing migration first, whether misjudgment reaches ECC maximum error correction energy Power.
It is preferred as one of technical solution of the present invention, time of the valid data of error correcting code error correction threshold value has been reached to mistake Receipts processing is specifically included,
The valid data that the mistake has reached error correcting code error correction threshold value are read in into controller;
Valid data feeding encoder in controller is subjected to error correcting code coding;
Send the valid data encoded by error correcting code back to controller;
Judge whether the valid data in dirty piece are all collected into controller, if it is, will be effective in controller In the free block of data write-in flash memory.
Valid data to having reached error correcting code error correction threshold value, if directly carried out using copy-back instructions to data Transfer, mistake has reached the error correction threshold value of error correcting code, it is impossible to ensure the data reliability of write-in flash memory.Therefore need to enter it Row error correcting code is re-encoded, it is ensured that it has self-correction ability, and flash memory is then write again.In particular it is necessary to which mistake is reached The valid data of error correcting code error correction threshold value read in controller, i.e., by the data buffer area (buffer) of its writing controller, carry out After error correcting code re-encoding, then the valid data by re-encoding are read back controller, then write flash memory.In addition, in dirty piece Valid data write-in flash memory is carried out several times, therefore after the completion of a valid data transfer, in order to ensure data record The reliability of process to be recycled dirty piece, it is necessary to be detected, the valid data in dirty piece of confirmation have all been completed after transfer, The valid data in the data buffer area (buffer) of controller are write in flash memory again.
It is preferred as one of technical solution of the present invention, after the valid data write-in flash memory, judge effective in dirty piece Whether data all write flash memory, if so, dirty piece of erasing.
Valid data in confirming dirty piece, which are reclaimed, to be fully completed, it is necessary to to be erased dirty piece before dirty piece is wiped Detected, confirm that valid data therein are recovered completely, the valid data in only dirty piece are confirmed after all reclaiming, It can be wiped.
According to another aspect of the present invention, there is provided the flash memory rubbish described in a kind of any one of application claim 1~6 Reclaim the rubbish recovering method of optimization method, it is characterised in that including,
S1 determines to carry out dirty piece of garbage reclamation;
S2 carries out error correcting code error correction threshold test to valid data current in dirty piece;
S3 judges whether valid data mistake current in dirty piece reaches the error correction threshold value of error correcting code, if reaching, goes to step S6, otherwise, goes to step S4;
S4 perform copy-back orders, by flash memory be grouped in register progress Data Migration;
S5 judges whether valid data migration terminates, if terminating, goes to step S11, otherwise, goes to step S2;
S6 the valid data in dirty piece are read back controller data buffer zone in;
S7 carries out error correcting code coding to data;
Data are sent back in data buffer zone after S8 codings;
S9 judges that valid data are collected into whether data buffer zone is fully completed in dirty piece, if completing, goes to step S10, no Then, S6 is gone to step;
S10 writes the valid data of collection in the free block of flash memory;
All valid data migrations of S11 garbage reclamations are completed, by dirty piece of erasing.
The rubbish recovering method of technical solution of the present invention, it is determined that after dirty piece of the rubbish to be reclaimed, first to be recycled effective Data carry out error correcting code error correction threshold test, and the data of error correcting code error correction threshold value are not up to for mistake, can directly be used Copy-back instructions carry out Data Migration.Like this, the valid data of error correcting code error correction threshold value are not reaching to for mistake Recovery can be done directly in a flash memory, greatly save the time of garbage reclamation.Error correcting code error correction has been reached for mistake The data of threshold value, then the data buffer area (buffer) for the controller that needs to be read back and after being re-encoded to it, then write Flash memory.Specifically, it is exactly the buffer area (buffer) of controller that first valid data to be recycled read back, then by significant figure Re-encoded according to being taken out being put into encoder.Valid data by re-encoding come back to controller cache area (buffer), then it can write in blank flash block.On the one hand this method can be instructed by copy-back and improved The efficiency of garbage reclamation, on the other hand can also be by reaching that the valid data page of error correcting code error correction threshold value is compiled again to mistake Code is to ensure the reliability of data, so as to ensure the reliability of solid-state disk data storage on the whole, reduces garbage reclamation and is taken Between, system I/O performances are improved, the reliability of solid-state disk data storage can also be further improved.
According to another aspect of the present invention, there is provided the flash memory rubbish described in a kind of any one of application claim 1~6 Reclaim the garbage retrieving system of optimization method, it is characterised in that including,
Dirty piece of judge module, for determine to be reclaimed dirty piece;
Error correcting code error correction threshold detection module, is examined for carrying out error correcting code error correction threshold value to the currently active data in dirty piece Survey;
Data Migration module, including the first Data Migration module and the second Data Migration module, first Data Migration Module, for by the valid data of the error correction threshold value of not up to error correcting code, by flash memory be grouped in register carry out data and move Move;The second Data Migration module, the valid data of the error correction threshold value for being up to error correcting code, first reads back valid data Controller, then write in flash memory;
Valid data judge module, for judging whether also there are valid data in dirty piece;
Module is wiped, for wiping dirty piece.
According to another aspect of the present invention there is provided a kind of storage device, wherein a plurality of instruction that is stored with, the instruction Suitable for being loaded by processor and being performed:
S1 determines to be reclaimed dirty piece;
S2 carries out error correcting code error correction threshold test to the currently active data in dirty piece;
S3 writes direct the valid data of not up to error correcting code error correction threshold value in flash memory by register;It will reach The valid data of error correcting code error correction threshold value, first read back controller, then writes in flash memory;
S4 judges whether also there are valid data in dirty piece, if so, return to step S2;
S5 wipes dirty piece.
According to another aspect of the present invention, there is provided a kind of terminal, it is characterised in that including:
Processor, is adapted for carrying out each instruction;
Storage device, suitable for storing a plurality of instruction, wherein the instruction is applied to be loaded and performed by processor:
S1 determines to be reclaimed dirty piece;
S2 carries out error correcting code error correction threshold test to the currently active data in dirty piece;
S3 writes direct the valid data of not up to error correcting code error correction threshold value in flash memory by register;It will reach The valid data of error correcting code error correction threshold value, first read back controller, then writes in flash memory;
S4 judges whether also there are valid data in dirty piece, if so, return to step S2;
S5 wipes dirty piece.
In general, by the contemplated above technical scheme of the present invention compared with prior art, it can obtain down and show Beneficial effect:
(1) the garbage reclamation optimization method of technical solution of the present invention, can effectively improve the efficiency of garbage reclamation, will be dirty Before valid data write-in flash memory in block, error correcting code error correction threshold test is first carried out to it, is ensureing flash memory storage reliability On the premise of, take garbage reclamation copy-back mode to carry out Data Migration, the data of active page in dirty piece are directly existed Moved in packet by the register in packet in other data block, reduce the biography of the traditional Data Migration of garbage reclamation Defeated delay, effectively increases the efficiency of garbage reclamation, and then improve the overall I/O performances of system.
(2) the garbage reclamation optimization method of technical solution of the present invention, employs error correcting code error correction threshold test mechanism, is returning Whether ECC error correction threshold value is detected first is reached to data before receiving valid data, once copy-back operations cause valid data Mistake is cumulative when reaching ECC maximum error correcting capabilities, that is, changes data record mode, be changed into the traditional Data Migration side of garbage reclamation Formula.This mechanism ensure that the mistake that data occur is no more than ECC maximum error correcting capability, it is ensured that the reliability of flash memory storage.
Brief description of the drawings
Fig. 1 is the flow chart of the garbage reclamation optimization method of the flash memory storage of the embodiment of the present invention;
Fig. 2 is the garbage reclamation Data Migration structured flowchart of the embodiment of the present invention.
Embodiment
In order to make the purpose , technical scheme and advantage of the present invention be clearer, it is right below in conjunction with drawings and Examples The present invention is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, and It is not used in the restriction present invention.As long as in addition, technical characteristic involved in each embodiment of invention described below Not constituting conflict each other can just be mutually combined.
The purpose of technical solution of the present invention is to provide a kind of error correcting code (ECC) error correction threshold test mechanism, rubbish is returned The Data Migration of receipts is to carry out judgement decision-making using Direct Transfer in flash memory or using traditional Data Migration mode.
In garbage reclamation Data Migration, the mistake occurred first according to the valid data in dirty piece carries out ECC error correction threshold Value detection, judges whether mistake occurred has reached the maximum capacity of ECC error correction, if it has been reached, then using rubbish Reclaim in traditional Data Migration mode, the data buffer of controller that the valid data in dirty piece are read back, data are carried out ECC is encoded, and data are sent back to after data buffer and judge that valid data are collected into whether buffer is fully completed in dirty piece, is completed The valid data of collection are write to free block other in flash memory afterwards;If the mistake occurred is not up to the maximum energy of ECC error correction Power, then directly carry out Data Migration using copy-back orders in flash memory.
Data Migration is operated generally by copy-back and completed, and it is a kind of high-level command that solid-state disc system is provided, The data between same packet (plane) interior different pieces of information block are supported, Data Migration is completed by the register in packet.It is logical Cross this order, it is possible to reduce data data buffer in flash media and controller transmission in conventional rubbish removal process Process, reduces transmission delay, improves the efficiency of garbage reclamation, and then lift the performance of whole system.However, due to copy- Back operations are that Data Migration is carried out in packet, and it can not complete the error correction of data using error control coding (ECC), enter During row Data Migration, mistake in data can be caused to add up, eventually exceed ECC correction capability, influence whole system Reliability.On the other hand, as copy-back and write/erase etc. operate the loss to memory cell, the original bit of flash memory The bit error rate (RBER) can more and more higher.In order to ensure the security of data, it is necessary to using error control coding (ECC) come to data Carry out error-detection error-correction.But the error correcting capability of error control coding is limited, when the original bit bit error rate (RBER) exceedes certain During one threshold value, error control coding error correction will can not meet the reliability requirement of data storage.Therefore, how to ensure that data deposit It is a very good problem to study that the garbage reclamation of flash memory storage, which is optimized, on the premise of storage reliability.Help to reduce The time required to garbage reclamation, system I/O performances are improved.
When directly carrying out Data Migration in flash memory using copy-back orders, it is possible to moved in all valid data The cumulative maximum error correcting capability for reaching ECC of mistake that data occur before completing is moved, can not now continue to use copy-back Order is migrated to data, and needs to carry out Data Migration using the traditional Data Migration mode of garbage reclamation, so adopting When carrying out Data Migration with copy-back orders, ECC error correction threshold dector needs at any time to detect it, misjudgment ECC maximum error correcting capability whether is reached, the reliability of flash memory storage has both been ensure that, the efficiency of garbage reclamation is improved again.Entirely After the valid data migration in portion is completed, dirty piece is wiped.
As shown in figure 1, the garbage reclamation optimization method of the flash memory storage of the embodiment of the present invention comprises the following steps:
(1) garbage reclamation determines to be reclaimed dirty piece.Solid-state disk is after use after a while, and it is many invalid to produce Data., it is necessary to first determine the position at the dirty piece of place of rubbish in solid-state disk before these invalid datas are removed.Specifically, It is to determine the position for dirty piece of rubbish for needing to remove in flash memory.
(2) error correcting code (ECC) error correction threshold test is carried out to valid data current in dirty piece.Determine dirty piece of place of rubbish , it is necessary to further be detected to this dirty piece behind position.In general, the data content in dirty piece is not all to need to remove , need to dump to the other positions of solid-state disk for some of which valid data.In the embodiment of technical solution of the present invention, Before transfer storage valid data, valid data have been carried out with the error correction threshold test of error correcting code.The error correction threshold value of error correcting code It is limited, an error correcting code can only carry out error correction to a range of mistake.Specifically, the reality of technical solution of the present invention Apply in example and error correcting code error correction threshold test is carried out to valid data, be to confirm the mistake in the valid data, if reach The error correction scope of its error correcting code.
(3) judge whether valid data mistake current in dirty piece reaches ECC error correction threshold value (ECC maximum error correction energy Power), if reaching, turn (6), otherwise, turn (4).The error correction threshold value of error correcting code has been reached for the classification in step (2), i.e. mistake Or the error correction threshold value of error correcting code is not reaching to, in the embodiment of technical solution of the present invention, at different methods Reason.Garbage reclamation of the prior art and dirty piece of removing, the method for use are that the valid data in dirty piece first read back in flash memory Controller, then it taken out from controller to feeding encoder and carries out error correcting code coding, it is effective by what is re-encoded Data are re-fed into controller, and flash memory is then write again.As shown in Figure 2.For whether reaching the error correction threshold value of error correcting code, to effective The recovery of data is exactly the valid data to being not up to error correcting code error correction threshold value in different ways, in simple terms, and this is had Effect data are write direct in flash memory by register;Valid data to having reached error correcting code error correction threshold value, first by the significant figure According to the controller that reads back, then write in flash memory.
(4) perform copy-back orders, by flash memory be grouped in register progress Data Migration.Copy-back orders It is a kind of high-level command that solid-state disc system is provided, supports the data between same packet (plane) interior different pieces of information block, lead to The register crossed in packet completes Data Migration.The valid data of error correcting code error correction threshold value, the present invention are not reaching to for mistake In the method for technical scheme, it is write direct into register to be cleaned dirty piece, sudden strain of a muscle is then write direct by register Other clear areas in depositing.Because register is inherently located in flash memory, therefore is not reaching to error correcting code error correction threshold for mistake The valid data of value, can just complete the transfer of valid data, it is not necessary to read and be restored again into a flash memory, effective to improve Organic efficiency in dirty piece with small data, optimizes whole garbage collection procedure, further, optimizes the storage of flash memory System.
(5) judge whether valid data migration terminates, if terminating, turn (11), otherwise, turn (2).Utilizing copy-back , it is necessary to be detected at any time during progress Data Migration.In dirty piece of detection Data Migration is carried out using copy-back Whether valid data migration completes, if it is not complete, then proceeding Data Migration, until entering line number using copy-back It is fully completed according to the valid data migration of migration.This part valid data belongs to a part for the valid data of all migrations, If all migration is completed for valid data in dirty piece, the recovery section in garbage collection procedure just calculates completion, just can be with Carry out dirty piece of erasing work of next step.
(6) valid data in dirty piece are read back in the data buffer of controller.In technical solution of the present invention, to mistake The valid data of error correcting code error correction threshold value have been reached, have been reclaimed according to the method described above.Because the mistake of this part valid data The error correction threshold value of error correcting code is reached, in order to ensure the accuracy of valid data, it is necessary to be re-encoded to it.Controller Buffer be a data buffer structure being located at outside flash memory, valid data to be recycled need to be introduced into controller Buffer, then takes out from buffer, into encoder re-encoding.By the valid data of re-encoding, backtracking to control In device buffer processed, now the error correcting code of valid data have passed through re-encoding, will in the range of its corrigendum of mistake in error correcting code The valid data write the blank page of flash memory.
(7) error correcting code (ECC) is carried out to data to encode.The significant figure of its error correcting code error correction threshold value has been reached for mistake According to if being directly deposited into flash memory, it is clear that the accumulation of error rate can cause the accuracy of valid data in whole system to drop It is low, it is therefore desirable to error correcting code re-encoding process is carried out to it.The process of re-encoding, exactly in order to reduce error rate so that effectively Number of errors in data is less than the error correction threshold value of error correcting code, optimizes the self-correction ability of valid data.
(8) data are sent back in the buffer of controller after encoding.The valid data re-encoded by error correcting code, pass through original Road returns to controller buffer, then writes the blank page area of flash memory from controller buffer, is finally completed returning for valid data Knock off work.
(9) judge that valid data are collected into whether buffer is fully completed in dirty piece, if completing, turn (10), otherwise, turn (6).For the valid data in dirty piece to be recycled, it is necessary to clearly it is following some.First, the valid data in dirty piece, which are reclaimed, is point Repeatedly carry out, a part therein is reclaimed every time.Second, entangled for the data currently reclaimed, it is necessary to carry out error correcting code to it Different modes are selected to be reclaimed after wrong threshold test.3rd, it is necessary to remaining in dirty piece after the completion of a data record Whether part is detected completed with the valid data recovery confirmed in whole dirty piece.In the embodiment of technical solution of the present invention It is preferred that after the valid data whole screening in dirty piece is finished, the valid data of error correcting code threshold value are reached for mistake, by again First it is centrally stored in controller buffer after coding, then batch writes the blank page area of flash memory.In technical solution of the present invention In another preferred embodiment, the data that controller buffer is collected into can also be respectively written into the blank page area of flash memory.
(10) valid data of collection are write to free block other in flash memory.There are substantial amounts of data in flash memory, for The valid data reclaimed from dirty piece, are written into a free page area.
(11) all valid data migrations of garbage reclamation are completed, by dirty piece of erasing.By technical solution of the present invention embodiment Above-mentioned steps, the valid data in dirty piece, which are reclaimed, to be completed, can be by dirty piece of erasing.
(12) this garbage reclamation is completed.
As it will be easily appreciated by one skilled in the art that the foregoing is merely illustrative of the preferred embodiments of the present invention, it is not used to The limitation present invention, any modifications, equivalent substitutions and improvements made within the spirit and principles of the invention etc., it all should include Within protection scope of the present invention.

Claims (10)

1. a kind of flash memory garbage reclamation optimization method, it is characterised in that including,
Pair determine reclaim dirty piece in valid data carry out error correcting code error correction threshold test;
Judge whether the valid data mistake reaches the error correction threshold value of its error correcting code;
The valid data of error correcting code error correction threshold value are not up to mistake, using copy-back instructions by the valid data by posting Storage is write direct in flash memory;The valid data of error correcting code error correction threshold value have been reached to mistake, first the valid data read back control Device processed, then write in flash memory.
2. a kind of flash memory garbage reclamation optimization method according to claim 1, wherein, respectively to each significant figure in dirty piece Error correcting code error correction threshold test is carried out according to page, with the reliability for the valid data for ensureing to write flash memory.
3. a kind of flash memory garbage reclamation optimization method according to claim 1 or 2, wherein, error correcting code is not up to mistake The recycling of the valid data of error correction threshold value is specifically included,
The register that the mistake is not up in the valid data of error correcting code error correction threshold value reading flash memory;
Valid data in register are transferred on the blank page of flash memory.
4. a kind of flash memory garbage reclamation optimization method according to any one of claims 1 to 3, wherein, pass through register pair When the valid data that mistake is not up to error correcting code error correction threshold value are migrated, error correcting code error correction threshold test is carried out to it at any time.
5. according to a kind of flash memory garbage reclamation optimization method according to any one of claims 1 to 4, wherein, mistake has been reached Recycling to the valid data of error correcting code error correction threshold value is specifically included,
The valid data that the mistake has reached error correcting code error correction threshold value are read in into controller;
Valid data feeding encoder in controller is subjected to error correcting code coding;
Send the valid data encoded by error correcting code back to controller;
Judge whether the valid data in dirty piece are all collected into controller, if it is, by the valid data in controller In the free block for writing flash memory.
6. according to a kind of flash memory garbage reclamation optimization method according to any one of claims 1 to 5, wherein, the significant figure After write-in flash memory, judge whether the valid data in dirty piece all write flash memory, if so, dirty piece of erasing.
7. the rubbish recovering method of the flash memory garbage reclamation optimization method described in application any one of claim 1~6, its feature exists In, including,
S1 determines to carry out dirty piece of garbage reclamation;
S2 carries out error correcting code error correction threshold test to valid data current in dirty piece;
S3 judges whether valid data mistake current in dirty piece reaches the error correction threshold value of error correcting code, if reaching, goes to step S6, no Then, S4 is gone to step;
S4 perform copy-back orders, by flash memory be grouped in register progress Data Migration;
S5 judges whether valid data migration terminates, if terminating, goes to step S11, otherwise, goes to step S2;
S6 the valid data in dirty piece are read back controller data buffer zone in;
S7 carries out error correcting code coding to data;
Data are sent back in data buffer zone after S8 codings;
S9 judges that valid data are collected into whether data buffer zone is fully completed in dirty piece, if completing, goes to step S10, otherwise, turns Step S6;
S10 writes the valid data of collection in the free block of flash memory;
All valid data migrations of S11 garbage reclamations are completed, by dirty piece of erasing.
8. the garbage retrieving system of the flash memory garbage reclamation optimization method described in application any one of claim 1~6, its feature exists In, including,
Dirty piece of judge module, for determine to be reclaimed dirty piece;
Error correcting code error correction threshold detection module, for carrying out error correcting code error correction threshold test to the currently active data in dirty piece;
Data Migration module, including the first Data Migration module and the second Data Migration module, the first Data Migration module, For by the valid data of the error correction threshold value of not up to error correcting code, by flash memory be grouped in register carry out Data Migration;Institute The second Data Migration module is stated, the valid data of the error correction threshold value for being up to error correcting code first read back valid data control Device, then write in flash memory;
Valid data judge module, for judging whether also there are valid data in dirty piece;
Module is wiped, for wiping dirty piece.
9. a kind of storage device, wherein a plurality of instruction that is stored with, the instruction is applied to be loaded and performed by processor:
S1 determines to be reclaimed dirty piece;
S2 carries out error correcting code error correction threshold test to the currently active data in dirty piece;
S3 by the valid data of the error correction threshold value of not up to error correcting code, by flash memory be grouped in register carry out Data Migration; The valid data of the error correction threshold value of error correcting code are up to, first valid data read back controller, then writes in flash memory;
S4 judges whether also there are valid data in dirty piece, if so, return to step S2;
S5 wipes dirty piece.
10. a kind of terminal, it is characterised in that including:
Processor, is adapted for carrying out each instruction;
Storage device, suitable for storing a plurality of instruction, wherein the instruction is applied to be loaded and performed by processor:
S1 determines to be reclaimed dirty piece;
S2 carries out error correcting code error correction threshold test to the currently active data in dirty piece;
S3 by the valid data of the error correction threshold value of not up to error correcting code, by flash memory be grouped in register carry out Data Migration; The valid data of the error correction threshold value of error correcting code are up to, first valid data read back controller, then writes in flash memory;
S4 judges whether also there are valid data in dirty piece, if so, return to step S2;
S5 wipes dirty piece.
CN201710434596.XA 2017-06-09 2017-06-09 A kind of flash memory garbage reclamation optimization method Pending CN107301132A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710434596.XA CN107301132A (en) 2017-06-09 2017-06-09 A kind of flash memory garbage reclamation optimization method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710434596.XA CN107301132A (en) 2017-06-09 2017-06-09 A kind of flash memory garbage reclamation optimization method

Publications (1)

Publication Number Publication Date
CN107301132A true CN107301132A (en) 2017-10-27

Family

ID=60134673

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710434596.XA Pending CN107301132A (en) 2017-06-09 2017-06-09 A kind of flash memory garbage reclamation optimization method

Country Status (1)

Country Link
CN (1) CN107301132A (en)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108415853A (en) * 2018-03-15 2018-08-17 深圳市江波龙电子有限公司 A kind of method, apparatus and storage device of garbage reclamation
CN109388343A (en) * 2018-09-26 2019-02-26 深圳市德名利电子有限公司 A kind of date storage method and memory
CN110931072A (en) * 2019-11-28 2020-03-27 深信服科技股份有限公司 Bad track scanning method, device, equipment and storage medium
CN111090595A (en) * 2019-11-19 2020-05-01 中国航空工业集团公司西安航空计算技术研究所 NAND FLASH garbage recovery balance optimization method
CN111324551A (en) * 2018-12-13 2020-06-23 爱思开海力士有限公司 Data storage device and operation method thereof
CN111367697A (en) * 2018-12-25 2020-07-03 北京兆易创新科技股份有限公司 Error processing method and device
CN112486415A (en) * 2020-11-30 2021-03-12 北京泽石科技有限公司 Garbage recycling method and device of storage device
TWI740454B (en) * 2020-04-14 2021-09-21 慧榮科技股份有限公司 Method and apparatus for accessing to data in response to a power-supply event
US11342008B2 (en) 2020-04-14 2022-05-24 Silicon Motion, Inc. Method and apparatus for accessing to data in response to power-supply event
CN117033268A (en) * 2023-10-09 2023-11-10 苏州元脑智能科技有限公司 SSD controller, data processing method, device and storage medium
CN117278176A (en) * 2023-11-23 2023-12-22 中科亿海微电子科技(苏州)有限公司 FPGA configuration file generation device and method with error correction function

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101634938A (en) * 2009-08-20 2010-01-27 成都市华为赛门铁克科技有限公司 Data migration method and data migration device of solid state disk and solid state disk
CN101923448A (en) * 2010-02-08 2010-12-22 安凯(广州)微电子技术有限公司 Method for reading and writing conversion layer of NAND flash memory
CN102279809A (en) * 2011-08-10 2011-12-14 郏惠忠 Method for redirecting write in and garbage recycling in solid hard disk
CN103218274A (en) * 2013-03-15 2013-07-24 华为技术有限公司 Failure accumulation preventing method and solid state disk
CN103336744A (en) * 2013-06-20 2013-10-02 华中科技大学 Garbage recovery method for solid-state storage device and system for garbage recovery method
CN105022695A (en) * 2014-04-21 2015-11-04 群联电子股份有限公司 Data storage method, memorizer control circuit unit and memorizer storage device
US20160092304A1 (en) * 2014-09-30 2016-03-31 Emc Corporation Method and system for improving flash storage utilization by predicting bad m-pages
CN106502583A (en) * 2016-10-12 2017-03-15 记忆科技(深圳)有限公司 A kind of method for reducing solid state hard disc operating lag
CN106547491A (en) * 2016-11-22 2017-03-29 郑州云海信息技术有限公司 The method and system of data-moving in a kind of solid state hard disc
CN106776109A (en) * 2016-12-26 2017-05-31 湖南国科微电子股份有限公司 Solid state hard disc read error detection means and reading can not entangle the detection method of error reason

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101634938A (en) * 2009-08-20 2010-01-27 成都市华为赛门铁克科技有限公司 Data migration method and data migration device of solid state disk and solid state disk
CN101923448A (en) * 2010-02-08 2010-12-22 安凯(广州)微电子技术有限公司 Method for reading and writing conversion layer of NAND flash memory
CN102279809A (en) * 2011-08-10 2011-12-14 郏惠忠 Method for redirecting write in and garbage recycling in solid hard disk
CN103218274A (en) * 2013-03-15 2013-07-24 华为技术有限公司 Failure accumulation preventing method and solid state disk
CN103336744A (en) * 2013-06-20 2013-10-02 华中科技大学 Garbage recovery method for solid-state storage device and system for garbage recovery method
CN105022695A (en) * 2014-04-21 2015-11-04 群联电子股份有限公司 Data storage method, memorizer control circuit unit and memorizer storage device
US20160092304A1 (en) * 2014-09-30 2016-03-31 Emc Corporation Method and system for improving flash storage utilization by predicting bad m-pages
CN106502583A (en) * 2016-10-12 2017-03-15 记忆科技(深圳)有限公司 A kind of method for reducing solid state hard disc operating lag
CN106547491A (en) * 2016-11-22 2017-03-29 郑州云海信息技术有限公司 The method and system of data-moving in a kind of solid state hard disc
CN106776109A (en) * 2016-12-26 2017-05-31 湖南国科微电子股份有限公司 Solid state hard disc read error detection means and reading can not entangle the detection method of error reason

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108415853A (en) * 2018-03-15 2018-08-17 深圳市江波龙电子有限公司 A kind of method, apparatus and storage device of garbage reclamation
CN109388343A (en) * 2018-09-26 2019-02-26 深圳市德名利电子有限公司 A kind of date storage method and memory
CN111324551B (en) * 2018-12-13 2023-04-07 爱思开海力士有限公司 Data storage device and operation method thereof
CN111324551A (en) * 2018-12-13 2020-06-23 爱思开海力士有限公司 Data storage device and operation method thereof
CN111367697A (en) * 2018-12-25 2020-07-03 北京兆易创新科技股份有限公司 Error processing method and device
CN111090595A (en) * 2019-11-19 2020-05-01 中国航空工业集团公司西安航空计算技术研究所 NAND FLASH garbage recovery balance optimization method
CN111090595B (en) * 2019-11-19 2022-12-20 中国航空工业集团公司西安航空计算技术研究所 NAND FLASH garbage recovery balanced optimization method
CN110931072B (en) * 2019-11-28 2022-03-22 深信服科技股份有限公司 Bad track scanning method, device, equipment and storage medium
CN110931072A (en) * 2019-11-28 2020-03-27 深信服科技股份有限公司 Bad track scanning method, device, equipment and storage medium
TWI740454B (en) * 2020-04-14 2021-09-21 慧榮科技股份有限公司 Method and apparatus for accessing to data in response to a power-supply event
US11342008B2 (en) 2020-04-14 2022-05-24 Silicon Motion, Inc. Method and apparatus for accessing to data in response to power-supply event
US11664056B2 (en) 2020-04-14 2023-05-30 Silicon Motion, Inc. Method and apparatus for accessing to data in response to power-supply event
CN112486415A (en) * 2020-11-30 2021-03-12 北京泽石科技有限公司 Garbage recycling method and device of storage device
CN112486415B (en) * 2020-11-30 2024-05-24 北京泽石科技有限公司 Garbage collection method and device for storage device
CN117033268A (en) * 2023-10-09 2023-11-10 苏州元脑智能科技有限公司 SSD controller, data processing method, device and storage medium
CN117033268B (en) * 2023-10-09 2024-02-09 苏州元脑智能科技有限公司 SSD controller, data processing method, device and storage medium
CN117278176A (en) * 2023-11-23 2023-12-22 中科亿海微电子科技(苏州)有限公司 FPGA configuration file generation device and method with error correction function

Similar Documents

Publication Publication Date Title
CN107301132A (en) A kind of flash memory garbage reclamation optimization method
CN102012867B (en) Data storage system
CN104584135B (en) Read to clean the flash memory of algorithm using target
CN106598878B (en) Solid state disk cold and hot data separation method
CN103377010B (en) The system and method for managing the unreliable memory in data-storage system
JP4812739B2 (en) Non-volatile data storage device static data area detection method, wear leveling method, data unit merging method and device
CN106776376B (en) Buffer storage supervisory method, memorizer control circuit unit and storage device
TWI587136B (en) Flash memory system and managing and collection methods for flash memory with invalid page information thereof
CN103488583A (en) High-performance reliable solid-state disk realizing method
US8996791B2 (en) Flash memory device, memory control device, memory control method, and storage system
CN104866429B (en) Storage management method, memorizer control circuit unit and memory storage apparatus
CN106170773A (en) On naked core, the selectivity of buffer-type nonvolatile memory returns and copies
CN104484283B (en) A kind of method for reducing solid state disk write amplification
CN105528301A (en) NAND Flash memory garbage collection method
CN110471788A (en) The data structure that asynchronous power loss influences
CN105260325A (en) Method for collecting garbage blocks in solid state disks
US20130060991A1 (en) Solid state drive and garbage collection control method thereof
CN107221351B (en) Optimization processing method of error correcting code in solid-state disk system and application thereof
CN111538618A (en) Apparatus and techniques for one-time parity check
CN106649132A (en) Solid-state drive junk recovery method
CN102063266A (en) Nonvolatile memory controller and method for writing data to nonvolatile memory
CN107391300A (en) A kind of method and system for improving flash data memory reliability
Chen et al. Enabling sub-blocks erase management to boost the performance of 3D NAND flash memory
CN103577342A (en) Method for managing data stored in flash memory and related memory device and controller
CN109710541A (en) For the optimization method of NAND Flash main control chip Greedy garbage reclamation

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20171027

RJ01 Rejection of invention patent application after publication