CN118152301A - Solid state disk garbage recycling method capable of achieving self-adaptive learning - Google Patents

Solid state disk garbage recycling method capable of achieving self-adaptive learning Download PDF

Info

Publication number
CN118152301A
CN118152301A CN202410564830.0A CN202410564830A CN118152301A CN 118152301 A CN118152301 A CN 118152301A CN 202410564830 A CN202410564830 A CN 202410564830A CN 118152301 A CN118152301 A CN 118152301A
Authority
CN
China
Prior art keywords
block
garbage collection
solid state
state disk
blocks
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
CN202410564830.0A
Other languages
Chinese (zh)
Other versions
CN118152301B (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.)
Jiangsu Huacun Electronic Technology Co Ltd
Original Assignee
Jiangsu Huacun Electronic Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jiangsu Huacun Electronic Technology Co Ltd filed Critical Jiangsu Huacun Electronic Technology Co Ltd
Priority to CN202410564830.0A priority Critical patent/CN118152301B/en
Publication of CN118152301A publication Critical patent/CN118152301A/en
Application granted granted Critical
Publication of CN118152301B publication Critical patent/CN118152301B/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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3037Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a memory, e.g. virtual memory, cache
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3055Monitoring arrangements for monitoring the status of the computing system or of the computing system component, e.g. monitoring if the computing system is on, off, available, not available
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3058Monitoring arrangements for monitoring environmental properties or parameters of the computing system or of the computing system component, e.g. monitoring of power, currents, temperature, humidity, position, vibrations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3065Monitoring arrangements determined by the means or processing involved in reporting the monitored data
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Digital Magnetic Recording (AREA)

Abstract

The invention discloses a solid state disk garbage recycling method for self-adaptive learning, which comprises the following steps: s1, monitoring the internal state of a solid state disk in real time; s2, adaptively matching with an optimal garbage collection strategy; the step S1 comprises the following steps: a. and recording the distribution of effective data X and ineffective data Y of each Block in the solid state disk and the average proportion of all blocks X/Y in real time. The invention integrates various mechanisms such as garbage collection, wear balance, data protection, block UECC, residual available space and the like, designs a garbage collection strategy capable of self-adaptive learning, can realize automatic switching strategy under different Host read-write scenes, finds out the object most suitable for garbage collection under different conditions, greatly reduces write amplification and prolongs the service life of the solid state disk.

Description

Solid state disk garbage recycling method capable of achieving self-adaptive learning
Technical Field
The invention relates to the technical field of solid state disk storage, in particular to a solid state disk garbage recycling method for self-adaptive learning.
Background
When garbage collection and wear balance are carried out, multiple factors need to be considered, firstly, the object to be garbage collected is selected, and the write amplification of the whole solid state disk can be directly influenced, so that the service life is influenced. The other is to uniformly formulate a strategy for garbage collection and wear balance, but the strategy is always a single strategy, different Host read-write scenes cannot be dealt with, the defect that the performance is poor in some scenes can appear in some scenes, the factor to be considered in the second aspect is that the performance is kept consistent in the garbage collection process, in the prior art, in order to keep the Host writing quantity matched with the garbage collection releasing quantity when objects with larger differentiation are selected, the strength and the speed of garbage collection can be adjusted in real time according to the selected objects, and the fluctuation of the read-write performance of the solid state disk and the signal quality degradation can be caused.
Disclosure of Invention
The invention aims to provide a solid state disk garbage collection method for self-adaptive learning, which aims to solve the problems in the background technology.
In order to achieve the above purpose, the present invention provides the following technical solutions: a solid state disk garbage recycling method for self-adaptive learning comprises the following steps:
s1, monitoring the internal state of a solid state disk in real time;
s2, adaptively matching with an optimal garbage collection strategy;
The step S1 comprises the following steps:
a. recording the distribution of effective data X and ineffective data Y of each Block in the solid state disk and the average proportion of all blocks X/Y in real time;
b. Recording the total erasing times of each Block in the solid state disk in real time in the using process and the average erasing times of all the blocks;
c. Recording flash read error times of each Block in the solid state disk in real time in a reading process;
d. Recording the use sequence of each Block in the solid state disk in real time in the writing process;
e. and counting the number of consumed blocks in the solid state disk in the using process in real time.
As a further improvement of the present invention, the step S2 includes the steps of:
f. finding a Block with the minimum X/Y value in all blocks by using a greedy algorithm;
g. f, finding a Block with the X/Y ratio smaller than the average value in the step f, and continuously checking other states of the Block;
h. judging the distance from the writing sequence of the Block to the latest Block;
i. Judging the erasing times of the Block;
j. The Block to be used for garbage recovery is searched again, and the searching formula is as follows:
Wherein, Coefficients are selected for garbage collection objects, the smaller the coefficients, the more suitable for garbage collection objects are represented,/>Is the ratio of X/Y in a Block,/>For the number of erasures a Block has undergone,/>For the write sequence of a Block and the distance of the latest write Block,/>For all Block numbers,/>For the number of idle blocks,/>For the weights calculated according to the write order of the Block,/>A weight calculated from the remaining space;
k. judging the erasing times of the Block again;
l, re-searching the Block to be recycled, wherein the searching formula is as follows:
Wherein, For the maximum erase count of all blocks,/>For the difference between the maximum erase count and the minimum erase count of all blocks,/>Is the Block abrasion frequency range/>Is a monotonically increasing function of (1);
m, finding a Block with the ratio of X/Y equal to the average value in the step f, and continuously checking other states of the Block;
n, judging the writing sequence of the Block again;
o, judging the erasing times of the Block for the third time;
and p, searching the Block to be recycled for the third time, wherein the searching formula is as follows:
q, judging the writing sequence of the Block for the third time;
r, excluding a certain number of blocks which are written recently, and searching the blocks with the smallest X/Y ratio in all the blocks in the front by using a greedy algorithm to be used as a garbage recycling object;
s, directly using Block as a garbage collection object;
t, after finding the garbage recycling object, the strength of garbage recycling needs to be formulated, and the following formula is used:
representing the strength of garbage collection of the selected object, and writing 1 unit garbage collection writing/>, by Host Number of units,/>Representing the strength of garbage collection of last selected object,/>Representing the strength of garbage collection of the last selected object, representing the X/Y ratio of the selected object,/>, andFor setting bottoming parameter,/>The weight assigned to each partial element during filtering is the greater the weight, which means that the current/> is calculatedThe more dominant the middle.
As a further improvement of the invention, the number consumed in the using process of the Block in the step e reaches the standard of triggering garbage collection to execute the step f, and the steps a, b, c and d cannot be executed.
As a further improvement of the invention, the minimum X/Y value found in step f is compared to the average ratio:
the X/Y value is less than the average proportion, and the step g is executed;
X/Y value = average ratio, step m is performed;
X/Y value > average ratio, step q is performed.
As a further improvement of the invention, the number of read errors (Ecc Cnt) of the Block found in the step g is not less than the set condition, the step s is executed, and the number of read errors (Ecc Cnt) is less than the set condition, the step h is executed;
and (3) setting the condition that the number of times (Ecc Cnt) of read errors of the Block found in the step m is not less than the preset condition, executing the step s, and executing the step n when the number of times (Ecc Cnt) of read errors is less than the preset condition.
As a further improvement of the invention, the distance between the writing sequence of the Block in the step h and the latest Block is more than or equal to a set condition, the step i is executed, and the step k is executed if the distance is less than the set condition;
executing the step o, wherein the distance from the writing sequence of the Block to the latest Block in the step n is more than or equal to the set condition, and is smaller than the execution p;
and in the step q, the distance between the writing sequence of the Block and the latest Block is more than or equal to the set condition, and the step s is executed and is smaller than the execution r.
As a further improvement of the invention, the average erasing times of the erasing times (Erase Cnt) in the step i is less than or equal to the average erasing times of all blocks, and the step s is executed, and the step j is not executed;
Step l is executed for the average erasing times (Erase Cnt) of all blocks in the step k, and step j is not executed;
And (3) in the step o, the average erasing times of the erasing times (Erase Cnt) are less than or equal to the average erasing times of all blocks, and step s is executed, and step p is not executed.
As a further improvement of the present invention, step t is performed after steps j, l, p, r and s are completed.
As a further improvement of the present invention, no calculation is performed when X/Y of the smallest Block in the step f is zero.
Compared with the prior art, the invention has the beneficial effects that:
According to the method, a negative feedback closed loop mechanism is designed, on the basis of filtering the precursor garbage collection force, the performance curve is prevented from shaking due to the fact that mutation is avoided, in addition, aiming at the problem that whether similar garbage collection force can be kept balanced or not is adopted for objects with larger differentiation, the OP of the solid state disk is flexibly adjusted, a certain OP is temporarily consumed to replace the Host writing speed, the problem that the Host writing speed cannot suddenly decrease is solved, before negative feedback bottoming, objects with effective data lower than the average level are found through the feedback mechanism to be used for garbage collection, more free space than the Host writing amount is released, and therefore normal OP is converted, the cost of the OP is flexibly adjusted inside the solid state disk to replace stability of the whole performance, better signal quality is obtained, automatic switching strategies under different Host reading and writing scenes can be achieved, the object which is most suitable for garbage collection under different conditions is found, writing amplification is greatly reduced, and the service life of the solid state disk is prolonged.
Drawings
FIG. 1 is a flow chart of step S1 of the present invention;
Fig. 2 is a flowchart of step S2 of the present invention.
Detailed Description
In order to make the technical problems, technical schemes and beneficial effects to be solved more clear, the invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
It will be understood that when an element is referred to as being "mounted," "connected," or "disposed" on another element, it can be directly on the other element or be indirectly on the other element. It is to be understood that the terms "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," and the like indicate or are based on the orientation or positional relationship shown in the drawings, merely to facilitate describing the present invention and simplify the description, and do not indicate or imply that the devices or elements referred to must have the orientation specific to the specification, be constructed and operated in the specific orientation, and thus should not be construed as limiting the present invention.
As a further refinement of the present invention, the terms "first," "second," "third," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more such feature.
The invention relates to a method for manufacturing a semiconductor device.
Examples
Referring to fig. 1-2, the present invention provides a technical solution: a solid state disk garbage recycling method for self-adaptive learning comprises the following steps:
S1, monitoring the internal state of a solid state disk in real time:
a. and recording the distribution of effective data X and ineffective data Y of each Block in the solid state disk and the average proportion of all blocks X/Y in real time.
B. And recording the total erasing times of each Block in the solid state disk in real time in the using process and the average erasing times of all the blocks.
C. And recording the times of flash memory read errors (Ecc) of each Block in the solid state disk in real time in the read process.
D. and recording the use sequence of each Block in the solid state disk in real time in the writing process.
E. counting the number of blocks consumed in the using process of the solid state disk in real time, wherein the number of blocks consumed in the using process of the blocks reaches the standard of triggering garbage collection to execute the step f, and the steps a, b, c and d cannot be executed;
When the residual idle Block is larger than the set condition, the solid state disk has enough capacity for Host writing, and is not used for garbage collection, and when the residual idle Block is smaller than the set condition, the solid state disk has not much capacity for Host writing, and at the moment, a garbage collection mechanism is started, so that enough idle space is timely released for Host writing.
S2, adaptively matching an optimal garbage collection strategy:
f. With the continuous writing of Host to the solid state disk, the distribution of effective data and ineffective data in each flash memory Block is random, not only the proportion of effective/ineffective data is relied on, in order to reduce the write amplification, the solid state disk has longer service life, but also the mechanisms of wear balance, data protection, read refreshing and the like are comprehensively considered to find out the most reasonable garbage recycling object, a greedy algorithm is used, the Block with the minimum X/Y value (except for 0 proportion) is found out in all blocks, and the X/Y value of the Block is compared with the average proportion:
the X/Y value is less than the average proportion, and the step g is executed;
X/Y value = average ratio, step m is performed;
The X/Y value is larger than the average proportion, and the step q is executed;
g. In the step f, a Block with the X/Y ratio smaller than the average value is found, other states of the Block are continuously checked, whether the Block needs to be read and refreshed or not is firstly evaluated, the number of times (Ecc Cnt) of read errors of the Block is not less than a set condition, the step s is executed, the Block is immediately selected as a garbage collection object, the number of times (Ecc Cnt) of read errors is less than the set condition, the step h is executed, and other attributes are continuously evaluated.
H. Judging the distance between the writing sequence of the Block and the latest Block, wherein the distance between the writing sequence of the Block and the latest Block is more than or equal to a set condition, which indicates that the Block possibly needs to be Data protected (Data protection), executing the step i, and executing the step k if the distance is less than the preset condition.
I. Judging the erasing times of the blocks, wherein the erasing times (Erase Cnt) are less than or equal to the average erasing times of all the blocks, executing the step s, and executing the step j.
J. The Block to be used for garbage recovery is searched again, and the searching formula is as follows:
Wherein, Coefficients are selected for garbage collection objects, the smaller the coefficients, the more suitable for garbage collection objects are represented,/>Is the ratio of X/Y in a Block,/>For the number of erasures a Block has undergone,/>For the write sequence of a Block and the distance of the latest write Block,/>For all Block numbers,/>For the number of idle blocks,/>For the weights calculated according to the write order of the Block,/>A weight calculated from the remaining space;
Then executing the step t;
Block of minimum valid/invalid data ratio found using greedy algorithm has the following properties: the Block effective Data proportion is minimum, the Block writing sequence is far from the latest writing distance, the Block writing sequence is suitable for being used as a garbage recycling object, the Erase Cnt is large, the Block writing sequence is not suitable for being used as a wear balance object, the Block is estimated to be unsuitable for being used as the object of the garbage recycling based on the comprehensive consideration of the attributes, the Block is stored as Hot Data, the Host has high possibility of continuing to rewrite the Block next, the natural release space is realized, the writing amplification is not increased, the optimal garbage recycling object is required to be found again, the formula in the step j is used, the effective/ineffective Data proportion, the erasing times and the writing sequence are comprehensively considered, the adjustable weight is realized on the Data proportion according to the residual space, the attribute weight of the release space is improved when the residual space is small, and the weight of the wear balance is improved when the residual space is large, so that the optimal garbage recycling object is determined.
K. Judging the erasing times of the blocks again, executing the step l of the average erasing times of the erasing times (Erase Cnt) which are less than or equal to all the blocks, and executing the step j.
L, re-searching the Block to be recycled, wherein the searching formula is as follows:
Wherein, For the maximum erase count of all blocks,/>For the difference between the maximum erase count and the minimum erase count of all blocks,/>Is the Block abrasion frequency range/>Is a monotonically increasing function of (1);
Then executing the step t;
Block of minimum valid/invalid data ratio found using greedy algorithm has the following properties: the Block effective Data proportion is minimum, the Block effective Data proportion is suitable as a garbage recycling object, erase Cnt is smaller, the Block effective Data proportion is not suitable as a wear balance object, but the Block writing sequence is relatively strong from the latest writing distance, the Block effective Data proportion is not suitable as a Data protection object, the Block effective Data proportion is presumed to be the object of the garbage recycling, the Block effective Data proportion is stored as Hot Data, and is the Data just written by the Host, at the moment, the read-write action of the Host is to continuously write the Hot Data to a certain partition of the solid state disk, and the other partitions are stored as cold Data, in the case, the writing sequence is not the limiting condition for selecting the garbage recycling object, the formula in the step l is consulted, whether the erasing times of all the blocks in the solid state disk are uniformly distributed is analyzed, if the distribution is uniform, the weight of the effective/ineffective Data proportion is lifted, if the distribution is not uniform, the weight of the balance is lifted, meanwhile, the residual space factor is also required to be considered, if the residual space is small, the weight is lifted, the weight of the residual space is increased, and the wear balance is determined if the residual space is more than the best.
M, finding a Block with the X/Y ratio approximately equal to the average value in the step f, continuously checking other states of the Block, setting the condition that the number of read errors (Ecc Cnt) of the Block is not less than the set condition, executing the step s, and executing the step n that the number of read errors (Ecc Cnt) is less than the set condition.
And n, judging the writing sequence of the Block again, wherein the distance between the writing sequence of the Block and the latest Block is more than or equal to the set condition, and executing the step o, which is smaller than the execution p.
And o, judging the erasing times of the blocks for the third time, wherein the average erasing times of the erasing times (Erase Cnt) are less than or equal to the average erasing times of all the blocks, and executing the step s, and if not, executing the step p.
And p, searching the Block to be recycled for the third time, wherein the searching formula is as follows:
Then executing the step t;
Block of minimum valid/invalid data ratio found using greedy algorithm has the following properties: the effective data proportion of the Block is minimum, but is very close to the average effective data proportion, and other attributes cannot be compatible with the mechanisms of wear balance and data protection selection objects, so that it is presumed that no Clod Data is needed in a disk at this time, the Host read-write behavior should be that full-disk data is read and written randomly, therefore, the wear balance should not become a limiting condition for selecting garbage collection objects under the Host read-write behavior, the proportion of effective/invalid data is considered with emphasis by referring to the formula in the step p, meanwhile, the writing of the Block is referred to, the attribute weight of the release space is increased if the residual space is small, and the weight of the wear balance is increased if the residual space is large, so that the optimal garbage collection object is determined.
Q, judging the writing sequence of the Block for the third time, wherein the distance between the writing sequence of the Block and the latest Block is more than or equal to the set condition execution step s, and is less than the execution r.
R, excluding a certain number of blocks which are written newly, searching the blocks with the minimum X/Y ratio in all the previous blocks by using a greedy algorithm to serve as objects for garbage collection, executing S17, in one possible example, removing the blocks with the minimum effective/invalid Data ratio which are found by using the greedy algorithm, wherein the effective/invalid Data ratio is larger than the average effective Data ratio set when the solid state disk leaves the factory, indicating that a large number of Bad blocks are generated in the using process of the solid state disk, ensuring that the left OP is insufficient, timely releasing the use space to be mainly considered, even if part of performance is reduced, if the blocks which are written just by Host meet the condition with the minimum effective Data ratio, indicating that the blocks which are written just are Hot Data, and in the rest of the greedy algorithm, searching the blocks with the minimum effective/invalid ratio as objects for garbage collection;
step t is then performed.
S, directly using Block as a garbage collection object;
step t is then performed.
T, after finding the garbage recycling object, the strength of garbage recycling needs to be formulated, and the following formula is used:
representing the strength of garbage collection of the selected object, and writing 1 unit garbage collection writing/>, by Host Number of units,/>Representing the strength of garbage collection of last selected object,/>Representing the strength of garbage collection of the last selected object, representing the X/Y ratio of the selected object,/>, andFor setting bottoming parameter,/>The weight assigned to each partial element during filtering is the greater the weight, which means that the current/> is calculatedThe more dominant the middle;
After selecting the best garbage collection object, in the process of executing garbage collection, the read-write performance of the solid state disk is stable, QOS (Quality of Service) needs to be considered with emphasis, as shown in the formula in step t, firstly, determining that the current write speed to reach the Host is in an equilibrium state with the speed of garbage collection release space according to the effective data proportion of the currently selected Block, and writing a unit according to the Host, wherein the garbage collection write is needed The method is implemented in a unit mode, but only in this way, the method is likely to cause that the Host writing speed is changed along with mutation due to the mutation of the effective data proportion of the currently selected Block, and the requirement of data stability is not met, so that the speed of garbage collection needs to be implemented in combination with the preamble, the mutation of the Host writing speed caused by the current garbage collection is avoided, the specific method is that the speed of the preceding speed garbage collection is filtered, and finally the speed of the current garbage collection and the preamble speed are in a stable state, in addition, as shown in a formula of step t, negative feedback is needed to be added to the speed of the current garbage collection according to the residual space of the solid state disk, the effect of closed loop control is achieved, and the method is characterized in that when the residual idle Block quantity/>Is greater than the set valueAt the time, it is stated that there is enough space available for Host writing, the speed of performing garbage collection can be slightly slower, when the number of idle blocks remaining/>Less than the set value/>When the method is used, the blocks for Host writing are insufficient, at the moment, the garbage collection speed needs to be increased, the residual free space is smaller, the garbage collection speed is increased sharply, and the solid state disk is prevented from being fully written and cannot be used any more.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus.
Although embodiments of the present invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made therein without departing from the principles and spirit of the invention, the scope of which is defined in the appended claims and their equivalents.

Claims (9)

1. A self-adaptive learning solid state disk garbage collection method is characterized in that: the recovery method comprises the following steps:
s1, monitoring the internal state of a solid state disk in real time;
s2, adaptively matching with an optimal garbage collection strategy;
The step S1 comprises the following steps:
a. recording the distribution of effective data X and ineffective data Y of each Block in the solid state disk and the average proportion of all blocks X/Y in real time;
b. Recording the total erasing times of each Block in the solid state disk in real time in the using process and the average erasing times of all the blocks;
c. Recording flash read error times of each Block in the solid state disk in real time in a reading process;
d. Recording the use sequence of each Block in the solid state disk in real time in the writing process;
e. and counting the number of consumed blocks in the solid state disk in the using process in real time.
2. The self-adaptive learning solid state disk garbage collection method according to claim 1, wherein the method comprises the following steps: the step S2 comprises the following steps:
f. finding a Block with the minimum X/Y value in all blocks by using a greedy algorithm;
g. f, finding a Block with the X/Y ratio smaller than the average value in the step f, and continuously checking other states of the Block;
h. judging the distance from the writing sequence of the Block to the latest Block;
i. Judging the erasing times of the Block;
j. The Block to be used for garbage recovery is searched again, and the searching formula is as follows:
Wherein, Coefficients are selected for garbage collection objects, the smaller the coefficients, the more suitable for garbage collection objects are represented,/>Is the ratio of X/Y in a Block,/>For the number of erasures a Block has undergone,/>For the write sequence of a Block and the distance of the latest write Block,/>For all Block numbers,/>For the number of idle blocks,/>For the weights calculated according to the write order of the Block,/>A weight calculated from the remaining space;
k. judging the erasing times of the Block again;
l, re-searching the Block to be recycled, wherein the searching formula is as follows:
Wherein, For the maximum erase count of all blocks,/>For the difference between the maximum erase count and the minimum erase count of all blocks,/>Is the Block abrasion frequency range/>Is a monotonically increasing function of (1);
m, finding a Block with the ratio of X/Y equal to the average value in the step f, and continuously checking other states of the Block;
n, judging the writing sequence of the Block again;
o, judging the erasing times of the Block for the third time;
and p, searching the Block to be recycled for the third time, wherein the searching formula is as follows:
q, judging the writing sequence of the Block for the third time;
r, excluding the latest written blocks, and searching the blocks with the smallest X/Y ratio from all the previous blocks by using a greedy algorithm to be used as the object of garbage recovery;
s, directly using Block as a garbage collection object;
t, after finding the garbage recycling object, the strength of garbage recycling needs to be formulated, and the following formula is used:
representing the strength of garbage collection of the selected object, and writing 1 unit garbage collection writing/>, by Host A number of units of the total number of units,Representing the strength of garbage collection of last selected object,/>Representing the strength of garbage collection of the last selected object, representing the X/Y ratio of the selected object,/>, andFor setting bottoming parameter,/>The weight assigned to each partial element during filtering is the greater the weight, which means that the current/> is calculatedThe more dominant the middle.
3. The self-adaptive learning solid state disk garbage collection method according to claim 2, characterized by comprising the following steps: and f, the number consumed in the using process of the Block in the step e reaches the standard of triggering garbage collection, and the steps a, b, c and d cannot be executed.
4. The self-adaptive learning solid state disk garbage collection method according to claim 1, wherein the method comprises the following steps: the minimum X/Y value found in step f is compared with the average ratio:
the X/Y value is less than the average proportion, and the step g is executed;
X/Y value = average ratio, step m is performed;
X/Y value > average ratio, step q is performed.
5. The self-adaptive learning solid state disk garbage collection method according to claim 1, wherein the method comprises the following steps: the number of read errors (Ecc Cnt) of the Block found in the step g is not less than the set condition, the step s is executed, and the number of read errors (Ecc Cnt) is less than the set condition, and the step h is executed;
and (3) setting the condition that the number of times (Ecc Cnt) of read errors of the Block found in the step m is not less than the preset condition, executing the step s, and executing the step n when the number of times (Ecc Cnt) of read errors is less than the preset condition.
6. The self-adaptive learning solid state disk garbage collection method according to claim 2, characterized by comprising the following steps: the distance between the writing sequence of the Block in the step h and the latest Block is more than or equal to a set condition, and the step i is executed, and if the distance is less than the set condition, the step k is executed;
executing the step o, wherein the distance from the writing sequence of the Block to the latest Block in the step n is more than or equal to the set condition, and is smaller than the execution p;
and in the step q, the distance between the writing sequence of the Block and the latest Block is more than or equal to the set condition, and the step s is executed and is smaller than the execution r.
7. The self-adaptive learning solid state disk garbage collection method according to claim 1, wherein the method comprises the following steps: step s is executed for the average erasing times (Erase Cnt) of all blocks in the step i, and step j is not executed;
Step l is executed for the average erasing times (Erase Cnt) of all blocks in the step k, and step j is not executed;
And (3) in the step o, the average erasing times of the erasing times (Erase Cnt) are less than or equal to the average erasing times of all blocks, and step s is executed, and step p is not executed.
8. The self-adaptive learning solid state disk garbage collection method according to claim 1, wherein the method comprises the following steps: step t is performed after steps j, l, p, r and s are completed.
9. The self-adaptive learning solid state disk garbage collection method according to claim 1, wherein the method comprises the following steps: and (3) in the step f, the X/Y of the minimum Block is zero, and no calculation is performed.
CN202410564830.0A 2024-05-09 2024-05-09 Solid state disk garbage recycling method capable of achieving self-adaptive learning Active CN118152301B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410564830.0A CN118152301B (en) 2024-05-09 2024-05-09 Solid state disk garbage recycling method capable of achieving self-adaptive learning

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410564830.0A CN118152301B (en) 2024-05-09 2024-05-09 Solid state disk garbage recycling method capable of achieving self-adaptive learning

Publications (2)

Publication Number Publication Date
CN118152301A true CN118152301A (en) 2024-06-07
CN118152301B CN118152301B (en) 2024-08-02

Family

ID=91293308

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410564830.0A Active CN118152301B (en) 2024-05-09 2024-05-09 Solid state disk garbage recycling method capable of achieving self-adaptive learning

Country Status (1)

Country Link
CN (1) CN118152301B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106775474A (en) * 2016-12-16 2017-05-31 郑州云海信息技术有限公司 A kind of Nand Flash abrasion equilibrium methods, device and memory
CN108628758A (en) * 2018-03-14 2018-10-09 深圳忆联信息系统有限公司 A kind of method and solid state disk of selection garbage reclamation object block
CN112433676A (en) * 2020-11-24 2021-03-02 合肥康芯威存储技术有限公司 Garbage recycling method and system for solid state disk
CN114185492A (en) * 2021-12-14 2022-03-15 福建师范大学 Solid state disk garbage recycling algorithm based on reinforcement learning
WO2024078012A1 (en) * 2022-10-11 2024-04-18 华为技术有限公司 Solid-state drive configuration method, garbage collection method and related device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106775474A (en) * 2016-12-16 2017-05-31 郑州云海信息技术有限公司 A kind of Nand Flash abrasion equilibrium methods, device and memory
CN108628758A (en) * 2018-03-14 2018-10-09 深圳忆联信息系统有限公司 A kind of method and solid state disk of selection garbage reclamation object block
CN112433676A (en) * 2020-11-24 2021-03-02 合肥康芯威存储技术有限公司 Garbage recycling method and system for solid state disk
CN114185492A (en) * 2021-12-14 2022-03-15 福建师范大学 Solid state disk garbage recycling algorithm based on reinforcement learning
WO2024078012A1 (en) * 2022-10-11 2024-04-18 华为技术有限公司 Solid-state drive configuration method, garbage collection method and related device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
王伟能;马建设;倪凯;潘龙法;赵懿;王仲超;王鸿钧;: "固态硬盘中的写放大系数分析", 记录媒体技术, no. 02, 20 May 2010 (2010-05-20) *

Also Published As

Publication number Publication date
CN118152301B (en) 2024-08-02

Similar Documents

Publication Publication Date Title
US20200097403A1 (en) Recency based victim block selection for garbage collection in a solid state device (ssd)
JP3810738B2 (en) Adaptive pre-fetching of data on disk
KR100881669B1 (en) Method for detecting of static data area and for wear-leveling and for merging data unit of non-volatile data storage and apparatus thereof
KR101454817B1 (en) Semiconductor memory devices and wear leveling methods thereof
US20140122774A1 (en) Method for Managing Data of Solid State Storage with Data Attributes
CN108762664B (en) Solid state disk page-level cache region management method
US20120072670A1 (en) Method for coupling sub-lun load measuring metadata size to storage tier utilization in dynamic storage tiering
CN108108128A (en) A kind of abrasion equilibrium method and SSD for mixing SSD
US20120239851A1 (en) Prioritized erasure of data blocks in a flash storage device
CN111427969B (en) Data replacement method of hierarchical storage system
CN101458956A (en) Memory apparatus and method of evenly using the blocks of a flash memory
CN110888600B (en) Buffer area management method for NAND flash memory
CN102203749B (en) Writing method and device of solid state driver under multi-level cache
CN111580754B (en) Write-friendly flash memory solid-state disk cache management method
CN108845957B (en) Replacement and write-back self-adaptive buffer area management method
CN110532200B (en) Memory system based on hybrid memory architecture
CN110795363B (en) Hot page prediction method and page scheduling method of storage medium
CN106874213A (en) A kind of solid state hard disc dsc data recognition methods for merging various machine learning algorithms
CN112347001B (en) Verification method and device for flash memory garbage collection and electronic equipment
US8954646B2 (en) Method for managing a plurality of blocks of a flash memory, and associated memory device and controller thereof
CN118152301B (en) Solid state disk garbage recycling method capable of achieving self-adaptive learning
CN112328171A (en) Data distribution prediction method, data equalization method, device and storage medium
CN108647157A (en) A kind of mapping management process and solid state disk based on phase transition storage
CN114333951A (en) Method and device for re-reading flash memory
US20110138110A1 (en) Method and control unit for performing storage management upon storage apparatus and related storage apparatus

Legal Events

Date Code Title Description
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant