[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN107092563A - A kind of rubbish recovering method and device - Google Patents

A kind of rubbish recovering method and device Download PDF

Info

Publication number
CN107092563A
CN107092563A CN201710261056.6A CN201710261056A CN107092563A CN 107092563 A CN107092563 A CN 107092563A CN 201710261056 A CN201710261056 A CN 201710261056A CN 107092563 A CN107092563 A CN 107092563A
Authority
CN
China
Prior art keywords
chained list
sector
lun
garbage reclamation
block
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201710261056.6A
Other languages
Chinese (zh)
Other versions
CN107092563B (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.)
New H3C Information Technologies Co Ltd
Original Assignee
Unis Huashan Information Technologies 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 Unis Huashan Information Technologies Co Ltd filed Critical Unis Huashan Information Technologies Co Ltd
Priority to CN201710261056.6A priority Critical patent/CN107092563B/en
Publication of CN107092563A publication Critical patent/CN107092563A/en
Application granted granted Critical
Publication of CN107092563B publication Critical patent/CN107092563B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Memory System (AREA)

Abstract

The application provides a kind of rubbish recovering method and device, and methods described includes:When the data of target sector in the SSD need modification, the target sector is designated invalidated sector;Wherein, the sector for not being designated invalidated sector in page belonging to the target sector is effective sector, and the data of effective sector can be read;When the SSD needs to carry out garbage reclamation, according to the quantity order from less to more of the effective sector included in each piece in the SSD to each piece of progress garbage reclamation.The write-in amplification that garbage reclamation is brought can be reduced using the embodiment of the present application, and then, it is possible to reduce SSD P/E number, improves SSD service life.

Description

A kind of rubbish recovering method and device
Technical field
The application is related to technical field of data processing, more particularly to a kind of rubbish recovering method and device.
Background technology
SSD (Solid State Drives, solid state hard disc) is the hard disk being made using solid-state electronic storage chip array, SSD is used as storage medium using NAND (with non-) FLASH (flash memory).
The content of the invention
The application provides a kind of rubbish recovering method and device, to reduce SSD P/E number, improves the SSD use longevity Life.
According to the first aspect of the embodiment of the present application there is provided a kind of rubbish recovering method, applied to SSD, this method includes:
When the data of target sector in the SSD need modification, the target sector is designated invalidated sector;Its In, the sector for not being designated invalidated sector in page belonging to the target sector is effective sector, and the data of effective sector can be read;
When the SSD need carry out garbage reclamation when, according to the effective sector included in each piece in the SSD quantity from Many orders are arrived less to each piece of progress garbage reclamation.
According to the second aspect of the embodiment of the present application there is provided a kind of garbage recovery device, applied to SSD, the device includes:
Unit is identified, for when the data of target sector in the SSD need modification, the target sector to be designated Invalidated sector;Wherein, the sector for not being designated invalidated sector in page belonging to the target sector is effective sector, effective sector Data can be read;
Garbage reclamation unit, for when the SSD needs to carry out garbage reclamation, according to being included in each piece in the SSD Effective sector quantity order from less to more to each piece of progress garbage reclamation.
Using the embodiment of the present application, when the data of target sector in SSD need modification, it is invalid that target sector is designated Sector;When SSD needs to carry out garbage reclamation, according to quantity from less to more suitable of the effective sector included in SSD each piece Each piece of progress garbage reclamation of ordered pair, so as to reduce the write-in amplification that garbage reclamation is brought, improve is increased by garbage reclamation Free space, and then, it is possible to reduce SSD P/E number, improve SSD service life.
Brief description of the drawings
Fig. 1 is a kind of schematic flow sheet for rubbish recovering method that the embodiment of the present application is provided;
Fig. 2 is a kind of structural representation for garbage recovery device that the embodiment of the present application is provided;
Fig. 3 is the structural representation for another garbage recovery device that the embodiment of the present application is provided;
Fig. 4 is the structural representation for another garbage recovery device that the embodiment of the present application is provided.
Embodiment
In order that those skilled in the art more fully understand the technical scheme in the embodiment of the present application, and make the application real Applying the above-mentioned purpose of example, feature and advantage can be more obvious understandable, below in conjunction with the accompanying drawings to technical side in the embodiment of the present application Case is described in further detail.
The least unit of NAND FLASH write-ins is page, constitutes a page by gathering enough 4 sectors, writes together;NAND The least unit of FLASH erasings is block, and a block can include multiple pages.
When there is data to need modification in any page in NAND FLASH, this page of meeting is identified as invalid page (in this page Data turn into invalid data), and application page space size carries out data write-in on other pieces.Wherein, it is not labeled as nothing The page imitated and used is properly termed as active page.
For example, it is assumed that the page 1 in block 1 includes sector a~d, if the data of the sector a in the page 1 in block 1 need modification, Then need the page 1 in block 1 being labeled as invalid page, and by amended sector a data, and the sector in page 1 in block 1 The data stored in b~d are written in other pieces of a page together.
GC (Garbage Collection, garbage reclamation) is to answer effective page data in a block in NAND FLASH Make another free block (block being not used by) inner, then this block is wiped completely.Wherein, SSD P/E (Program/ Erase Cycles, program/erase number of times) number of times determine SSD life-span.
For example, when needing to carry out GC to block 1, it is necessary to first by the data duplication of active page in block 1 to another free block (being assumed to be block 2) is inner, then wipes block 1 completely.
Fig. 1 is referred to, a kind of schematic flow sheet of the rubbish recovering method provided for the embodiment of the present application, wherein, the rubbish Rubbish recovery method can apply to SSD, such as SSD hard disks or SSD chips, as shown in figure 1, the rubbish recovering method can include Following steps:
Step 101, when the data of target sector in SSD need modification when, target sector is designated invalidated sector;Its In, the sector for not being designated invalidated sector in page belonging to the target sector is effective sector, and the data of effective sector can be read.
In the embodiment of the present application, target sector is simultaneously not specific to a certain fixed sector, but may refer to any block bag in SSD Any sector in any page included, the embodiment of the present application is subsequently no longer repeated.
In the embodiment of the present application, when the data of target sector in SSD need modification, SSD directly will not fan the target Page belonging to area is designated invalid page, and the target sector can be only designated to invalidated sector, its in page belonging to the target sector Its sector is still as effective sector, and the data of effective sector can be read.
For example, it is assumed that the page 1 in block 1 includes sector a~d, if the sector a of the page 1 in block 1 data need modification, Sector a can be designated invalidated sector (data be invalid data) in invalidated sector by SSD, and the sector of the page 1 in block 1 B~d is still that the data in effective sector, sector b~d can normally be read.
In the embodiment of the present application, for the amended data in target sector, can first it be cached into SSD internal memory, Such as DDR (Double Data Rate) internal memory, and when the data cached in SSD internal memory gather enough a page space size, will The data of SSD memory cache are written in new page.
Still by taking above-mentioned example as an example, it is assumed that the sector a of the page 1 in block 1 data AAAA needs to be revised as A1A2, then SSD Sector a can be designated invalidated sector, and A1A2 is cached in internal memory, and the data in internal memory gather enough a page sky Between size when, in the page that the data in internal memory are written to new block, such as page 1 of write-in block 2.
It can be seen that, in the embodiment of the present application, by the way that data management least unit is refined as into sector by page, when need carry out During data modification, per N, the data of (N is the quantity for the sector that a page includes) individual sector need just to need write-in one during modification The data of individual page, compared with the data of each sector need to change the implementation for the data for being required to write a page, are reduced Write-in amplification.
Step 102, when need to SSD carry out garbage reclamation when, according to the quantity of the effective sector included in SSD each piece Order from less to more.
In the embodiment of the present application, when the free space in SSD reaches default free space threshold value, SSD can be by right The mode of the block progress garbage reclamation used lifts SSD free space.
And in view of when effectively sector is more in the block for needing to carry out garbage reclamation, by carrying out garbage reclamation to the block Increased free space can be less.
As an example it is assumed that block 1 includes 100 sectors altogether, and 100 sectors include 80 effective sectors, then when , it is necessary to which the valid data in block 1 are read when needing to carry out block 1 garbage reclamation, and it is written in a new free block (false It is set to block 2), then the data in block 1 are wiped.Wherein, because block 1 includes 80 effective sectors (assuming that each page includes 4 Individual sector), therefore, 80 sectors (i.e. 20 pages) are had in block 2 and are written into data, and then, this time garbage reclamation increases newly 20 sectors of free space (i.e. 5 pages).
As an example it is assumed that block 1 includes 100 sectors altogether, and 100 sectors are effective sector, then work as needs , it is necessary to which the valid data in block 1 are read when carrying out garbage reclamation to block 1, and it is written in a new free block and (is assumed to be Block 2), then the data in block 1 are wiped.Wherein, due in block 1 all sectors be effective sector, therefore, block 2 can be write It is full, and then, this time garbage reclamation will not increase new free space.
Thus, in the embodiment of the present application, when SSD needs to carry out garbage reclamation, SSD can be according to including in each piece The order of the quantity of effective sector from less to more carries out garbage reclamation to each piece, to maximize the income of garbage reclamation, as far as possible Lifting passes through the increased amount of available space of garbage reclamation, and then, it is possible to reduce SSD P/E number, improves SSD service life.
In the one of embodiment of the application, SSD can include one or more particles, and (a NAND FLASH is one Individual particle), each particle is divided into multiple LUN (Logic Unit, logic unit);
In this embodiment, for any LUN, when the object block in the LUN writes full data, according to effective in object block Object block is added in corresponding use chained list by the quantity of sector;Wherein, the LUN is mounted with multiple use chained lists, and difference makes Belong to different effective number of sectors intervals with the quantity of effective sector in the block in chained list, difference is corresponding effectively using chained list Number of sectors interval non-overlapping copies;
Correspondingly, in this embodiment, the above-mentioned quantity according to the effective sector included in SSD each piece is from less to more Order can include to each piece of progress garbage reclamation:
It is interval according to the corresponding effective number of sectors of each use chained list for any LUN, according to effective sector quantity from It is few that garbage reclamation is carried out to the block in each use chained list successively to many orders.
In this embodiment, object block and the block of a certain fixation is not specific to, but may refer in SSD in any LUN Any block, the embodiment of the present application is subsequently no longer repeated.
In this embodiment, in order to improve data management efficiency in SSD, data management will be carried out to SSD by LUN.
In this embodiment, can be the multiple use chained lists of the LUN carries, the target in the LUN for any LUN When block writes full data, SSD can be interval according to effective number of sectors belonging to effective number of sectors in the object block, by the target Block is added in corresponding use chained list;Wherein, difference belongs to different using the quantity of effectively sector in the blocks in chained list and had Imitate number of sectors interval, difference uses the interval non-overlapping copies of the corresponding effective number of sectors of chained list.
In a kind of embodiment of the embodiment, object block is added to pair according to the quantity of effective sector in object block In the use chained list answered, including:
When effective number of sectors in object block is more than or equal to threshold value threshold [i], and less than threshold value threshold When [i+1], object block is added to using chained list pUsedList [i];
Wherein, i >=0, threshold value threshold [0] is equal to 0, threshold value threshold [i+1] > threshold values threshold [i]
As an example it is assumed that LUN1 is mounted with 4 using chained list (using chained list 0~3), wherein, it is corresponding using chained list 0 Effective number of sectors interval for [0,20), using the corresponding effective number of sectors interval of chained list 1 for [20,50), use 3 pairs of chained list The effective number of sectors interval answered for [50,90), using the corresponding effective number of sectors interval of chained list 4 for [90,201) (assuming that A block in LUN1 includes 200 sectors altogether), i.e. threshold value threshold [0] is 0, and threshold value threshold [1] is 20, threshold Value threshold [2] is 50, and threshold value threshold [3] is 90, and threshold value threshold [4] is 201, when object block writes full number According to when, if the quantity of effective sector is less than 20, SSD and can be added to object block using in chained list 1 in object block;If target Effective number of sectors is more than or equal to 20 in block, and less than 50, then object block can be added to using in chained list 2 by SSD;If target Effective number of sectors is more than or equal to 50 in block, and less than 90, then object block can be added to using in chained list 3 by SSD;If target Effective number of sectors is more than or equal to 90 in block, then object block can be added to using in chained list 4 by SSD.
In this embodiment,, can be according to each use chained list correspondence when needing to carry out garbage reclamation for any LUN Effective number of sectors it is interval, rubbish is carried out to the block in each use chained list successively according to the order of effective sector from less to more and returned Receive.
Still by taking above-mentioned example as an example, when SSD need to LUN1 carry out garbage reclamation when, SSD can according to using chained list 0, Garbage reclamation is carried out to the block in each use chained list successively using chained list 1, using chained list 2, using the order of chained list 3, i.e., it is first right Garbage reclamation is carried out using the block in chained list 0, and after garbage reclamation is completed using the block in chained list 0, then to using chain Block in table 1 carries out garbage reclamation ... by that analogy, finally to carrying out garbage reclamation using the block in chained list 3.
Further, in this embodiment, it is contemplated that effective in object block after object block is added in use chained list Number of sectors may change, for example, when the data for having new sector in object block need modification, meeting in the object block The new invalidated sector of increase, correspondingly, the quantity of invalidated sector can be reduced, now, and SSD needs to use where the adjustment object block Chained list.
Correspondingly, in this embodiment, the above-mentioned quantity according to effective sector in object block adds object block corresponding After in chained list, it can also include:
It is currently located when the quantity of effective sector in object block is reduced and is less than using the corresponding effective number of sectors of chained list When interval, effective number of sectors belonging to the quantity of effective sector after being reduced according to object block is interval to be transferred to object block pair The use chained list answered.
For example, still by taking above-mentioned example as an example, it is assumed that when the object block in LUN1 just writes full data, the number of effective sector Measure as 100, then the object block can be added to using in chained list 3 by SSD;Assuming that a certain moment, object block is due to data modification Cause effective number of sectors to be reduced to 80, then SSD needs to delete the object block from using in chained list 3, and be added to and use chain In table 2;Assuming that effectively number of sectors is reduced to 40 in another moment afterwards, object block, then SSD is needed the object block from using Delete, and be added to using in chained list 1 in chained list 2.
Further, in this embodiment, multiple use chained lists of any of the above-described LUN carries can be multiple different brackets Use chained list, and using chained list higher grade, it is more using effective number of sectors of the block in chained list.
Fewer in view of effective sector in block, increased free space is more during to block progress garbage reclamation, Jin Erneng SSD P/E number is more effectively reduced, SSD service life is improved, therefore, when needing to carry out garbage reclamation, ensured In the case that SSD has enough free spaces, the block not more to effective number of sectors that can try one's best carries out garbage reclamation.
Correspondingly, in a kind of embodiment of the embodiment, for any LUN, returned when needs carry out rubbish to the LUN In the time receiving, the garbage reclamation grade of the LUN can be determined according to the quantity of free block in the LUN;Wherein, in LUN free block number Amount and LUN garbage reclamation grade are negatively correlated.
Correspondingly, in this embodiment, it is above-mentioned interval according to the corresponding effective number of sectors of each use chained list, according to having Imitate the order of the quantity of sector from less to more and garbage reclamation is carried out to the block in each use chained list successively, including:
Determine that target uses chained list grade according to the garbage reclamation grade of the LUN;Wherein, garbage reclamation higher grade, institute The target of determination is using chained list higher grade;
By grade less than or equal to the mesh that target is defined as needing to carry out garbage reclamation using the use chained list of chained list grade Mark uses chained list;
It is according to each target interval using the corresponding effective number of sectors of chained list, according to effective sector quantity from less to more Order uses the block in chained list to carry out garbage reclamation each target successively.
In this embodiment, when any LUN needs to carry out garbage reclamation, idle number of blocks is more in the LUN, in fact The quantity that border carries out the block of garbage reclamation can be relatively fewer, and therefore, SSD can be carried out in the LUN of garbage reclamation as needed The quantity of free block determines the corresponding garbage reclamation grades (GC_LEVEL) of the LUN;Wherein, the quantity of free block is more in LUN, Its corresponding garbage reclamation grade can be lower.
For example, for LUN1, it is assumed that when the quantity of free block in the LUN is less than 20, it is necessary to carry out rubbish to the LUN Rubbish is reclaimed, then when the quantity of free block in LUN1 is less than 20, and SSD can be determined according to the actual quantity of free block in LUN1 LUN1 garbage reclamation grade, for example, when free block in LUN1 quantity for [15,20) when, determine LUN1 garbage reclamation etc. Level is grade 0;When free block in LUN1 quantity for [10,15) when, determine LUN1 garbage reclamation grade be grade 1;When In LUN1 the quantity of free block for [5,10) when, determine LUN1 garbage reclamation grade be grade 2;When the number of free block in LUN1 Measure for [0,5) when, determine LUN1 garbage reclamation grade be grade 3.
In this embodiment, can be according to the garbage reclamation of the LUN after SSD determines LUN garbage reclamation grade Grade determines that target uses chained list grade, and grade is defined as into need using the use chained list of chained list grade less than or equal to target The target for carrying out garbage reclamation uses chained list.Wherein, garbage reclamation higher grade, and target is using chained list higher grade;Use Chained list higher grade, more using effective number of sectors of the block in chained list.
As an example it is assumed that using block in chained list 0~3 effective number of sectors be incremented by (i.e. using in chained list 1 block it is effective Number of sectors is higher than effective number of sectors using block in chained list 0, and less than effective number of sectors using block in chained list 2, and It is less than the quantity using effective sector in chained list 3 using effective number of sectors of block in chained list 2), use the use of chained list 0~3 The garbage reclamation grade that chained list grade is followed successively by 0~3, LUN is also 0~3;, can be with then when LUN garbage reclamation grade is 0 It is 0 using chained list grade to determine target, i.e., only need to using the block progress garbage reclamation in chained list 0, (i.e. target uses chained list To use chained list 0);When LUN garbage reclamation grade is 1, it may be determined that target is 1 using chained list grade, that is, is needed to making Garbage reclamation is carried out with chained list 1 and using block in chained list 0 (i.e. target is to use chained list 0~1 using chained list);…;When LUN rubbish Rubbish reclaim grade be 3 when, it may be determined that target using chained list grade be 3, that is, need to using chained list 3, using chained list 2, use Chained list 1 and using chained list 0 (i.e. target using chained list be use chained list 0~3) in block progress garbage reclamation.
In this embodiment, SSD determine need carry out garbage reclamation target use chained list after, can be according to each Target is interval using the corresponding effective number of sectors of chained list, according to the quantity order from less to more of effective sector successively to each mesh Mark carries out garbage reclamation using the block in chained list.
For example, it is assumed that target uses chained list including the use of chained list 0~2, wherein, use the use chained list grade of chained list 0~2 Respectively 0~2 (i.e. incremented by successively using effective number of sectors of the block in chained list 0~2), then SSD can be first to using chained list 0 In block carry out garbage reclamation, and after using the block in chained list 0 to complete garbage reclamation, then to being entered using the block in chained list 1 Row garbage reclamation.
It can be seen that, pass through above-mentioned embodiment, it is ensured that the block for carrying out garbage reclamation is essentially all that effective sector is compared Few block, when carrying out garbage reclamation to such block, it is only necessary to the data in less effective sector are moved, so as to reduce rubbish Rubbish reclaims the write-in amplification brought;Meanwhile, block is ranked up according to the quantity of effective sector by using the form of chained list, kept away Exempt to search on a large scale during garbage reclamation, improved treatment effeciency.
What deserves to be explained is, in the embodiment of the present application, this can be added to according to each piece using the order of block in chained list It is ranked up, when there is new block to be added to this using chained list, can be directly added using order of the time in chained list after arriving first Enter to the afterbody using chained list;Or, using block in chained list order can also according to effective number of sectors in each piece from it is few to Many orders are ranked up, when there is new block to be added to this using chained list, according to the quantity of effective sector in the block by the block Insert corresponding position.
Correspondingly, when SSD using the block in chained list to carrying out garbage reclamation, it can be added according to using each piece in chained list This carries out garbage reclamation successively using order of the order of chained list after arriving first, can also be according to using effective in each piece in chained list The order of the quantity of sector from less to more carries out garbage reclamation successively.
In addition, in the embodiment of the present application, in order to improve the flexibility of data processing, above-mentioned use chained list can be two-way Chained list (or being double linked list).
Further, in the embodiment of the present application, when systems are functioning properly, above-mentioned use chained list is stored in the interior of SSD Deposit in (such as DDR internal memories);Only need to operate DDR internal memories when needing to read, update or change using chained list.
When system power failure, above-mentioned use chained list can be preserved to NAND FLASH SLC (Single-Level Cell, single layer cell) space, and after the use chained list is preserved to above-mentioned SLC spaces, just carry out power-down operation.
Wherein, to achieve these goals, a bulky capacitor is increased in systems, it is above-mentioned to maintain during system power failure Using the write-in of chained list, when system exception power down, it is powered by the bulky capacitor, to guarantee to use above-mentioned in time Chained list is written to SLC spaces.
When system is re-powered, chained list will be used to read into DDR internal memories from above-mentioned SLC spaces again.
It should be appreciated that being carried out above by the progress LUN divisions of each particles of SSD, and by using the form of chained list The realization of garbage reclamation is only to realize a kind of specific example of garbage reclamation in the embodiment of the present application, rather than the application is protected The restriction of scope is protected, in the embodiment of the present application, can also be directly according to the quantity of each piece of effective sector in SSD in SSD Each piece is ranked up, and carries out garbage reclamation according to the order of effective number of sectors from less to more, or, can be each to SSD Grain carries out LUN divisions, but for each LUN, can be ranked up block all in the LUN according to the quantity of effective sector, And garbage reclamation is carried out according to the order of effective number of sectors from less to more, it is implemented does not repeat herein.
By above description as can be seen that the embodiment of the present application provide technical scheme in, when target sector in SSD When data need modification, target sector is designated invalidated sector;When SSD needs to carry out garbage reclamation, according to each piece in SSD In the order of the quantity of effective sector that includes from less to more to each piece of progress garbage reclamation, brought so as to reduce garbage reclamation Write-in amplification, improve by the increased free space of garbage reclamation, and then, it is possible to reduce SSD P/E number, raising SSD Service life.
Fig. 2 is referred to, a kind of structural representation of the garbage recovery device provided for the embodiment of the present application, wherein, the rubbish The SSD that rubbish retracting device can apply in above method embodiment, as shown in Fig. 2 the garbage recovery device can include:
Unit 210 is identified, for when the data of target sector in the SSD need modification, the target sector to be marked Know for invalidated sector;Wherein, the sector for not being designated invalidated sector in page belonging to the target sector is effective sector, effectively fan The data in area can be read;
Garbage reclamation unit 220, for when the SSD needs to carry out garbage reclamation, being wrapped according in each piece in the SSD The order of the quantity of the effective sector contained from less to more is to each piece of progress garbage reclamation.
In an alternative embodiment, the SSD includes one or more particles;Each particle is divided into multiple LUN;
Correspondingly, please also refer to Fig. 3, the structural representation of another garbage recovery device provided for the embodiment of the present application Figure, as shown in figure 3, on the basis of garbage recovery device shown in Fig. 2, garbage recovery device also includes shown in Fig. 3:
Chained list administrative unit 230, for for any LUN, when the object block in the LUN writes full data, according to described The object block is added in corresponding use chained list by the quantity of effective sector in object block;Wherein, the LUN is mounted with multiple Using chained list, difference belongs to different effective number of sectors intervals using the quantity of effectively sector in the block in chained list, and difference makes With the interval non-overlapping copies of the corresponding effective number of sectors of chained list;
The garbage reclamation unit 220, specifically for for any LUN, according to the corresponding effective sector of each use chained list Quantity is interval, and garbage reclamation is carried out to the block in each use chained list successively according to the quantity order from less to more of effective sector.
In an alternative embodiment, the chained list administrative unit 230, specifically for when effective sector number in the object block Amount is more than or equal to threshold value threshold [i], and during less than threshold value threshold [i+1], the object block is added to and used Chained list pUsedList [i];
Wherein, i >=0, threshold value threshold [0] is equal to 0, threshold value threshold [i+1] > threshold values threshold [i].
In an alternative embodiment, the chained list administrative unit 230, is additionally operable to work as in the object block the effectively quantity of sector Reduce and be less than be currently located using the corresponding effective number of sectors of chained list it is interval when, it is effective after being reduced according to the object block The object block is transferred to corresponding use chained list by effective number of sectors interval belonging to the quantity of sector.
In an alternative embodiment, any LUN is mounted with multiple different grades of use chained lists, using chained list higher grade, It is more using effective number of sectors of the block in chained list;
Correspondingly, please also refer to Fig. 4, the structural representation of another garbage recovery device provided for the embodiment of the present application Figure, as shown in figure 4, on the basis of garbage recovery device shown in Fig. 3, garbage recovery device also includes shown in Fig. 4:
Determining unit 240, it is hollow according to the LUN when needing to carry out garbage reclamation to the LUN for for any LUN The quantity of not busy block determines the garbage reclamation grade of the LUN;Wherein, the quantity of free block and LUN garbage reclamation grade are negative in LUN It is related;
The garbage reclamation unit 220, specifically for determining that target uses chained list etc. according to the garbage reclamation grade of the LUN Level, and by grade less than or equal to the mesh that the target is defined as needing to carry out garbage reclamation using the use chained list of chained list grade Mark uses chained list;Wherein, garbage reclamation higher grade, and identified target is using chained list higher grade;Used according to each target The corresponding effective number of sectors of chained list is interval, and chain is used to each target successively according to the quantity order from less to more of effective sector Block in table carries out garbage reclamation.
The function of unit and the implementation process of effect specifically refer to correspondence step in the above method in said apparatus Implementation process, will not be repeated here.
For device embodiment, because it corresponds essentially to embodiment of the method, so related part is real referring to method Apply the part explanation of example.Device embodiment described above is only schematical, wherein described be used as separating component The unit of explanation can be or may not be physically separate, and the part shown as unit can be or can also It is not physical location, you can with positioned at a place, or can also be distributed on multiple NEs.Can be according to reality Selection some or all of module therein is needed to realize the purpose of application scheme.Those of ordinary skill in the art are not paying In the case of going out creative work, you can to understand and implement.
As seen from the above-described embodiment, when the data of target sector in SSD need modification, it is invalid that target sector is designated Sector;When SSD needs to carry out garbage reclamation, according to quantity from less to more suitable of the effective sector included in SSD each piece Each piece of progress garbage reclamation of ordered pair, so as to reduce the write-in amplification that garbage reclamation is brought, improve is increased by garbage reclamation Free space, and then, it is possible to reduce SSD P/E number, improve SSD service life.
Those skilled in the art will readily occur to its of the application after considering specification and putting into practice invention disclosed herein Its embodiment.The application is intended to any modification, purposes or the adaptations of the application, these modifications, purposes or Person's adaptations follow the general principle of the application and including the undocumented common knowledge in the art of the application Or conventional techniques.Description and embodiments are considered only as exemplary, and the true scope of the application and spirit are by following Claim is pointed out.
It should be appreciated that the precision architecture that the application is not limited to be described above and is shown in the drawings, and And various modifications and changes can be being carried out without departing from the scope.Scope of the present application is only limited by appended claim.

Claims (10)

1. a kind of rubbish recovering method, applied to solid-state hard disk SSD, it is characterised in that this method includes:
When the data of target sector in the SSD need modification, the target sector is designated invalidated sector;Wherein, institute State and be not designated the sector of invalidated sector in page belonging to target sector for effective sector, the data of effective sector can be read;
When the SSD needs to carry out garbage reclamation, according to the effective sector included in each piece in the SSD quantity from it is few to Many orders are to each piece of progress garbage reclamation.
2. according to the method described in claim 1, it is characterised in that the SSD includes one or more particles;Each particle is drawn It is divided into multiple logic unit LUN;
Methods described also includes:
, will according to the quantity of effective sector in the object block when the object block in the LUN writes full data for any LUN The object block is added in corresponding use chained list;Wherein, the LUN is mounted with multiple use chained lists, and difference is used in chained list Block in the quantity of effectively sector belong to that different effective number of sectors is interval, difference uses the corresponding effective number of sectors of chained list Interval non-overlapping copies;
The order of the quantity according to the effective sector included in each piece in the SSD from less to more carries out rubbish to each piece and returned Receive, including:
It is interval according to the corresponding effective number of sectors of each use chained list for any LUN, according to effective sector quantity from it is few to Many orders carry out garbage reclamation to the block in each use chained list successively.
3. method according to claim 2, it is characterised in that the quantity according to effective sector in the object block will The object block is added in corresponding use chained list, including:
When effective number of sectors in the object block is more than or equal to threshold value threshold [i], and less than threshold value threshold When [i+1], the object block is added to using chained list pUsedList [i];
Wherein, i >=0, threshold value threshold [0] is equal to 0, threshold value threshold [i+1] > threshold values threshold [i].
4. according to the method in claim 2 or 3, it is characterised in that the number according to effective sector in the object block After the object block is added in corresponding use chained list by amount, in addition to:
It is currently located when the quantity of effective sector in the object block is reduced and is less than using the corresponding effective number of sectors of chained list When interval, effective number of sectors belonging to the quantity of effective sector after being reduced according to the object block is interval by the object block It is transferred to corresponding use chained list.
5. method according to claim 2, it is characterised in that any LUN is mounted with multiple different grades of use chained lists, It is using chained list higher grade, it is more using effective number of sectors of the block in chained list;
Methods described also includes:
For any LUN, when needing to carry out garbage reclamation to the LUN, the LUN is determined according to the quantity of free block in the LUN Garbage reclamation grade;Wherein, the quantity of free block and LUN garbage reclamation grade are negatively correlated in LUN;
It is described interval according to the corresponding effective number of sectors of each use chained list, according to the quantity order from less to more of effective sector Garbage reclamation is carried out to the block in each use chained list successively, including:
Determine that target uses chained list grade according to the garbage reclamation grade of the LUN, and grade is made less than or equal to the target The target for being defined as needing to carry out garbage reclamation with the use chained list of chained list grade uses chained list;Wherein, garbage reclamation grade is got over Height, identified target is using chained list higher grade;
It is interval using the corresponding effective number of sectors of chained list according to each target, according to the quantity order from less to more of effective sector The block in chained list is used to carry out garbage reclamation each target successively.
6. a kind of garbage recovery device, applied to solid-state hard disk SSD, it is characterised in that the device includes:
Unit is identified, for when the data of target sector in the SSD need modification, it is invalid that the target sector is designated Sector;Wherein, the sector for not being designated invalidated sector in page belonging to the target sector is effective sector, the data of effective sector It can be read;
Garbage reclamation unit, for when the SSD needs to carry out garbage reclamation, according to having for being included in each piece in the SSD The order of the quantity of sector from less to more is imitated to each piece of progress garbage reclamation.
7. device according to claim 6, it is characterised in that the SSD includes one or more particles;Each particle is drawn It is divided into multiple logic unit LUN;
Described device also includes:
Chained list administrative unit, for for any LUN, when the object block in the LUN writes full data, according in the object block The object block is added in corresponding use chained list by the quantity of effective sector;Wherein, the LUN is mounted with multiple use chains Table, difference belongs to different effective number of sectors intervals using the quantity of effectively sector in the block in chained list, and difference uses chained list The corresponding interval non-overlapping copies of effective number of sectors;
The garbage reclamation unit, specifically for for any LUN, according to the corresponding effective number of sectors area of each use chained list Between, garbage reclamation is carried out to the block in each use chained list successively according to the quantity order from less to more of effective sector.
8. device according to claim 7, it is characterised in that
The chained list administrative unit, specifically for being more than or equal to threshold value when effective number of sectors in the object block Threshold [i], and during less than threshold value threshold [i+1], the object block is added to using chained list pUsedList [i];
Wherein, i >=0, threshold value threshold [0] is equal to 0, threshold value threshold [i+1] > threshold values threshold [i].
9. the device according to claim 7 or 8, it is characterised in that
The chained list administrative unit, is additionally operable to use when the quantity of effectively sector in the object block reduces and is less than to be currently located When the corresponding effective number of sectors of chained list is interval, effective fan belonging to the quantity of effective sector after being reduced according to the object block The object block is transferred to corresponding use chained list by area quantity interval.
10. device according to claim 7, it is characterised in that any LUN is mounted with multiple different grades of use chains Table, it is using chained list higher grade, it is more using effective number of sectors of the block in chained list;
Described device also includes:
Determining unit, for for any LUN, when needing to carry out garbage reclamation to the LUN, according to free block in the LUN Quantity determines the garbage reclamation grade of the LUN;Wherein, the quantity of free block and LUN garbage reclamation grade are negatively correlated in LUN;
The garbage reclamation unit, specifically for determining that target uses chained list grade according to the garbage reclamation grade of the LUN, and will Grade is used less than or equal to the target that the target is defined as needing to carry out garbage reclamation using the use chained list of chained list grade Chained list;Wherein, garbage reclamation higher grade, and identified target is using chained list higher grade;Chained list pair is used according to each target Effective number of sectors for answering is interval, and each target is used in chained list successively according to the quantity order from less to more of effective sector Block carries out garbage reclamation.
CN201710261056.6A 2017-04-20 2017-04-20 Garbage recovery method and device Active CN107092563B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710261056.6A CN107092563B (en) 2017-04-20 2017-04-20 Garbage recovery method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710261056.6A CN107092563B (en) 2017-04-20 2017-04-20 Garbage recovery method and device

Publications (2)

Publication Number Publication Date
CN107092563A true CN107092563A (en) 2017-08-25
CN107092563B CN107092563B (en) 2021-02-26

Family

ID=59637500

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710261056.6A Active CN107092563B (en) 2017-04-20 2017-04-20 Garbage recovery method and device

Country Status (1)

Country Link
CN (1) CN107092563B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109343796A (en) * 2018-09-21 2019-02-15 新华三技术有限公司 A kind of data processing method and device
CN109508140A (en) * 2017-09-15 2019-03-22 阿里巴巴集团控股有限公司 Storage resource management method, apparatus, electronic equipment and electronic equipment, system
CN110362500A (en) * 2019-06-03 2019-10-22 深圳市金泰克半导体有限公司 A kind of solid state hard disk rubbish recovering method, device, solid state hard disk and storage medium
CN111930301A (en) * 2020-06-29 2020-11-13 深圳佰维存储科技股份有限公司 Garbage recycling optimization method and device, storage medium and electronic equipment
WO2022120527A1 (en) * 2020-12-07 2022-06-16 Micron Technology, Inc. Techniques for accessing managed nand
CN115904264A (en) * 2023-03-13 2023-04-04 浪潮电子信息产业股份有限公司 Method, device and medium for recovering garbage data of blocks in storage system

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1815629A (en) * 2005-11-25 2006-08-09 康佳集团股份有限公司 Dirty block recovery method for flash memory device
CN101075211A (en) * 2007-06-08 2007-11-21 马彩艳 Flash memory management based on sector access
CN101097551A (en) * 2006-08-23 2008-01-02 晶天电子(深圳)有限公司 Electronic data flash memory card with flash memory controller
US20080282024A1 (en) * 2007-05-09 2008-11-13 Sudeep Biswas Management of erase operations in storage devices based on flash memories
CN101408864A (en) * 2007-10-09 2009-04-15 群联电子股份有限公司 Data protection method for current failure and controller using the same
CN102004706A (en) * 2009-09-01 2011-04-06 联芯科技有限公司 Flash erasing power-fail protection method based on FTL(Flash Translation Layer)
CN102073592A (en) * 2009-11-19 2011-05-25 中兴通讯股份有限公司 Quick read-write method and device for flash memory
CN102339255A (en) * 2010-07-16 2012-02-01 安凯(广州)微电子技术有限公司 Nand writing balance processing method
CN103412826A (en) * 2013-07-18 2013-11-27 记忆科技(深圳)有限公司 Garbage collection method and system of solid state disk
CN104750620A (en) * 2015-04-23 2015-07-01 四川师范大学 Memory migration method and device
US20160299722A1 (en) * 2015-04-13 2016-10-13 Samsung Electronics Co., Ltd. Data storage and operating method thereof
US20170060448A1 (en) * 2015-08-26 2017-03-02 OCZ Storage Solutions Inc. Systems, solid-state mass storage devices, and methods for host-assisted garbage collection

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1815629A (en) * 2005-11-25 2006-08-09 康佳集团股份有限公司 Dirty block recovery method for flash memory device
CN101097551A (en) * 2006-08-23 2008-01-02 晶天电子(深圳)有限公司 Electronic data flash memory card with flash memory controller
US20080282024A1 (en) * 2007-05-09 2008-11-13 Sudeep Biswas Management of erase operations in storage devices based on flash memories
CN101075211A (en) * 2007-06-08 2007-11-21 马彩艳 Flash memory management based on sector access
CN101408864A (en) * 2007-10-09 2009-04-15 群联电子股份有限公司 Data protection method for current failure and controller using the same
CN102004706A (en) * 2009-09-01 2011-04-06 联芯科技有限公司 Flash erasing power-fail protection method based on FTL(Flash Translation Layer)
CN102073592A (en) * 2009-11-19 2011-05-25 中兴通讯股份有限公司 Quick read-write method and device for flash memory
CN102339255A (en) * 2010-07-16 2012-02-01 安凯(广州)微电子技术有限公司 Nand writing balance processing method
CN103412826A (en) * 2013-07-18 2013-11-27 记忆科技(深圳)有限公司 Garbage collection method and system of solid state disk
US20160299722A1 (en) * 2015-04-13 2016-10-13 Samsung Electronics Co., Ltd. Data storage and operating method thereof
CN104750620A (en) * 2015-04-23 2015-07-01 四川师范大学 Memory migration method and device
US20170060448A1 (en) * 2015-08-26 2017-03-02 OCZ Storage Solutions Inc. Systems, solid-state mass storage devices, and methods for host-assisted garbage collection

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
胡萍: "NAND闪存垃圾回收策略改进", 《铜仁学院学报》 *

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109508140A (en) * 2017-09-15 2019-03-22 阿里巴巴集团控股有限公司 Storage resource management method, apparatus, electronic equipment and electronic equipment, system
CN109508140B (en) * 2017-09-15 2022-04-05 阿里巴巴集团控股有限公司 Storage resource management method and device, electronic equipment and system
CN109343796A (en) * 2018-09-21 2019-02-15 新华三技术有限公司 A kind of data processing method and device
CN109343796B (en) * 2018-09-21 2022-03-01 新华三技术有限公司 Data processing method and device
CN110362500A (en) * 2019-06-03 2019-10-22 深圳市金泰克半导体有限公司 A kind of solid state hard disk rubbish recovering method, device, solid state hard disk and storage medium
CN111930301A (en) * 2020-06-29 2020-11-13 深圳佰维存储科技股份有限公司 Garbage recycling optimization method and device, storage medium and electronic equipment
WO2022120527A1 (en) * 2020-12-07 2022-06-16 Micron Technology, Inc. Techniques for accessing managed nand
US12124367B2 (en) 2020-12-07 2024-10-22 Micron Technology, Inc. Techniques for accessing managed NAND
CN115904264A (en) * 2023-03-13 2023-04-04 浪潮电子信息产业股份有限公司 Method, device and medium for recovering garbage data of blocks in storage system

Also Published As

Publication number Publication date
CN107092563B (en) 2021-02-26

Similar Documents

Publication Publication Date Title
CN107092563A (en) A kind of rubbish recovering method and device
KR101852668B1 (en) Address mapping
US8886990B2 (en) Block management schemes in hybrid SLC/MLC memory
US20200097403A1 (en) Recency based victim block selection for garbage collection in a solid state device (ssd)
US20120290779A1 (en) Data management in solid-state storage devices and tiered storage systems
US20140122774A1 (en) Method for Managing Data of Solid State Storage with Data Attributes
US20140379973A1 (en) Garbage collection management in memories
RU2319227C2 (en) Recording method with double logging and data carrier for use with the method
CN1698036A (en) Tracking the least frequently erased blocks in non-volatile memory systems
CN1701309A (en) Wear leveling in non-volatile storage systems
CN1701390A (en) Tracking the most frequently erased blocks in non-volatile memory systems
DE102013106242A1 (en) Semiconductor drive with conversion layer (ETL) and redirection of temporary files to reduce the wear of flash memory
CN107003809A (en) A kind of method and storage device of storage device data storage
CN101419573A (en) Storage management method, system and storage apparatus
CN104598386B (en) By following the trail of and reusing solid-state drive block using two level map index
US11334480B2 (en) Data storage device and non-volatile memory control method
CN107544754A (en) A kind of garbage reclamation method and device
CN111610930B (en) Data storage device and non-volatile memory control method
CN108733318A (en) A kind of wiring method of TLC NAND FLASH solid state disks
CN112347001B (en) Verification method and device for flash memory garbage collection and electronic equipment
TWI713032B (en) Data storage device and control method for non-volatile memory
CN103744615A (en) Dynamic compensation receiver and dynamic compensation receiving method
US11132140B1 (en) Processing map metadata updates to reduce client I/O variability and device time to ready (TTR)
CN111324284B (en) Memory device
CN112527692B (en) Data storage device and non-volatile memory control method

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 310052 11th Floor, 466 Changhe Road, Binjiang District, Hangzhou City, Zhejiang Province

Applicant after: Xinhua Sanxin Information Technology Co., Ltd.

Address before: 310052 11th Floor, 466 Changhe Road, Binjiang District, Hangzhou City, Zhejiang Province

Applicant before: Huashan Information Technology Co., Ltd.

GR01 Patent grant
GR01 Patent grant