CN112433958B - Garbage recycling method, system and device of solid state disk and storage medium thereof - Google Patents

Garbage recycling method, system and device of solid state disk and storage medium thereof Download PDF

Info

Publication number
CN112433958B
CN112433958B CN202011283849.6A CN202011283849A CN112433958B CN 112433958 B CN112433958 B CN 112433958B CN 202011283849 A CN202011283849 A CN 202011283849A CN 112433958 B CN112433958 B CN 112433958B
Authority
CN
China
Prior art keywords
data
garbage collection
data volume
host
solid state
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011283849.6A
Other languages
Chinese (zh)
Other versions
CN112433958A (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.)
Hefei Kangxinwei Storage Technology Co Ltd
Original Assignee
Hefei Kangxinwei Storage 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 Hefei Kangxinwei Storage Technology Co Ltd filed Critical Hefei Kangxinwei Storage Technology Co Ltd
Priority to CN202011283849.6A priority Critical patent/CN112433958B/en
Publication of CN112433958A publication Critical patent/CN112433958A/en
Application granted granted Critical
Publication of CN112433958B publication Critical patent/CN112433958B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/10Providing a specific technical effect
    • G06F2212/1016Performance improvement
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/21Employing a record carrier using a specific recording technology
    • G06F2212/214Solid state disk
    • 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)
  • Memory System (AREA)
  • Signal Processing For Digital Recording And Reproducing (AREA)

Abstract

The invention provides a garbage recycling method, a system, a device and a storage medium thereof for a solid state disk, wherein the garbage recycling method for the solid state disk comprises the following steps: s10, selecting one storage block in the solid state disk to carry out garbage collection; s20, counting a first data volume of write data in garbage collection; s30, judging whether the first data volume is equal to a preset first threshold value: if the data volume is equal to the first threshold value, suspending garbage collection, performing data writing operation of the host, and counting a second data volume of the data written by the host; s40, judging whether the second data volume is equal to a preset second threshold value: and if the data is equal to the second threshold, suspending the host data writing operation and jumping to the step S20 again for garbage collection. The invention disperses the operation of writing data by the host in the gaps of each processing step of garbage collection under the condition of not changing the normal processing step of garbage collection of the solid state disk, thereby greatly improving the stability of the performance of writing data by the host.

Description

Garbage recycling method, system and device of solid state disk and storage medium thereof
Technical Field
The invention relates to the field of data storage, in particular to a garbage recycling method, a garbage recycling system, a garbage recycling device and a garbage recycling storage medium of a solid state disk.
Background
Solid State Drives (SSD) are currently popular high performance memories, and are suitable for hard disks made of Solid State electronic memory chip arrays. The NAND FLASH has advantages of large capacity, fast rewriting speed, etc. because its interior uses a nonlinear macro cell mode, it is more suitable for storage of a large amount of data, and therefore the storage medium of SSD mostly uses NAND FLASH.
The data of the NAND FLASH is stored in a memory cell (memory cell) in a bit manner, and generally, only one bit can be stored in one memory cell. The memory cells are connected into bit lines (bit lines) in units of 8 or 16, the lines are further grouped into pages (pages), and a plurality of pages form a memory block (block). Specifically, a plurality of memory blocks on one flash are determined as required.
The NAND FLASH reads and writes data (program) in units of pages, and erases data (erase) in units of memory blocks. Before reading and writing data, the data needs to be erased. When the SSD is in use, it reads and writes data to the same logical location multiple times, and the data in the old physical location is invalid. Over time, valid data and invalid data may exist on a certain memory block of the SSD at the same time, and thus, the data on the memory block cannot be directly erased, and the physical location of the invalid data cannot be directly used for writing new data. By doing so, the NAND FLASH of the SSD will be used up quickly. Therefore, garbage Collection (Garbage Collection) is required to be performed on the NAND FLASH, and a certain storage block is set to be only used for storing invalid data in the valid data set in the NAND FLASH, so that the storage block storing the invalid data can be subjected to data erasure, and the storage block after the data erasure can be subjected to new data reading and writing operations again.
While garbage collection is running, the SSD also executes write commands of the Host (Host) at the same time. Both the write data of the garbage collection and the write data of the host occupy the bandwidth of the NAND FLASH, but the total bandwidth of the NAND FLASH is a fixed value, which affects the host write data speed of the SSD. The host data writing speed is an important performance index for evaluating the SSD, so that the proportion relation between the garbage collection data writing speed and the host data writing speed needs to be balanced to be stable in order to ensure the stable host data writing speed.
Currently, garbage collection of SSD generally has the following steps: selecting an effective source storage block, searching effective data on the source storage block, reading the effective data, writing the effective data into a new storage block, and erasing invalid data of the source storage block.
Generally, the SSD stabilizes a ratio of write data garbage collected to a data amount of host write data, so as to stabilize host write data performance. However, since garbage collection has multiple steps, if the buffer in the SSD is large, the time of each step is long, which may cause the speed of writing data by the host to be deteriorated when the steps other than garbage collection writing data are executed, and seriously affect the stability of the performance of writing data by the host.
Disclosure of Invention
In view of the above drawbacks of the prior art, an object of the present invention is to provide a garbage collection method, system, device and storage medium for solid state disk, which are used to solve the problem in the prior art that the write data performance of a host is greatly affected by garbage collection of an SSD.
In order to achieve the above and other related objects, the present invention provides a garbage recycling method for a solid state disk, including: s10, selecting one storage block in the solid state disk to carry out garbage collection; s20, counting a first data volume of write data in garbage collection; clearing the first data volume before counting; s30, judging whether the first data volume is equal to a preset first threshold value: if the data volume is equal to the first threshold value, suspending garbage collection, performing data writing operation of the host, and counting a second data volume of the data written by the host; clearing the second data volume before counting; s40, judging whether the second data volume is equal to a preset second threshold value: and if the data is equal to the second threshold, suspending the host data writing operation, and jumping to the step S20 again for garbage collection.
In one embodiment of the present invention, the first threshold and the second threshold are proportional; and the proportional relationship between the first threshold and the second threshold is related to the effective data amount in the memory block which is performing garbage collection.
In an embodiment of the invention, the step S20 of counting the first data amount of the processing data in garbage collection includes: judging the current garbage recovery processing step; counting the data volume of actual write data in garbage collection; clearing the data volume of the actual write data before counting; calculating a first data amount according to the processing step and the data amount of actually written data: the first data quantity = data quantity of actual write data × weight coefficient; wherein the weight coefficients are related to the processing steps.
In an embodiment of the present invention, the weight coefficient is calculated according to the following formula:
Figure BDA0002781680980000021
Figure BDA0002781680980000022
wherein i represents the number of processing steps for garbage collection; s. the i A weight coefficient representing the processing step i; t is a unit of i Indicates the time required for the garbage collection processing step i to perform the processing.
In an embodiment of the invention, the step S30 is to determine whether the first data amount is equal to a preset first threshold: if the data quantity is equal to the first threshold value, the garbage collection is suspended, the data writing operation of the host is carried out, and meanwhile, the step of counting the second data quantity of the data written by the host further comprises the following steps: if the first data volume is smaller than the first threshold value, judging whether the garbage recycling processing of the selected storage block is finished: and if the processing is finished, selecting the next storage block in the solid state disk to carry out garbage collection and counting the first data volume.
The invention also discloses a garbage recycling system of the solid state disk, which is characterized in that: the method comprises the following steps: the selection module is used for selecting the storage blocks of the solid state disk to carry out garbage collection; the statistical module is used for counting a first data volume of processing data in garbage recovery and a second data volume of host write data; the judging module is used for judging the relation between the first data volume and a preset first threshold value and the relation between the second data volume and a second threshold value; and the control module is used for controlling garbage collection of the storage blocks and the operation of writing data by the host.
In an embodiment of the present invention, the statistical module includes: the judgment submodule is used for judging the processing step of the current garbage recovery; the statistical submodule is used for counting the data volume of actual write data in garbage recovery; and the calculating submodule is used for calculating the first data volume according to the processing step and the data volume of the actually written data.
In an embodiment of the invention, the calculating submodule calculates the first data size according to the following manner: the first data quantity = data quantity of actual write data × weight coefficient; wherein the weight coefficient is:
Figure BDA0002781680980000031
i represents the number of processing steps for garbage collection; s. the i A weight coefficient representing the processing step i; t is i Represents the time required for the processing step i of collecting garbage to perform the processing.
The invention also discloses a garbage recycling device of the solid state disk, which comprises: a memory for storing a computer program; a processor for executing the computer program to implement the steps of the garbage collection method for the solid state disk as described above.
Further, the present invention also discloses a computer readable storage medium, on which a computer program is stored, the computer program being executed by a processor to implement the steps of the garbage collection method for a solid state disk as described above.
As described above, the present invention discloses a garbage collection method, system, device and storage medium for a solid state disk, which reasonably distributes the operation of garbage-collected write data and write data of a host without changing the normal garbage collection processing steps of the solid state disk, that is, the data volume of the garbage-collected write data and the write data of the host is proportional, thus fully utilizing the bandwidth of NAND FLASH and greatly improving the stability of the write data performance of the host. Furthermore, the invention takes the ratio of the time of processing required by each step in garbage collection to the total processing time of garbage collection as a weight coefficient, and disperses the operation of writing data by the host in the gaps of each processing step of garbage collection, so that the writing performance of the host is stable in each processing step of garbage collection, and the problem that the writing data of the host is blocked due to the overlarge writing data amount in a certain step in garbage collection is avoided.
Drawings
Fig. 1 is a schematic flow chart illustrating a garbage collection method for a solid-state disk according to an embodiment of the present invention.
Fig. 2 is a schematic structural diagram of a garbage recycling system of a solid-state drive according to an embodiment of the present invention.
Description of the element reference numerals
100. Garbage recycling system of solid state disk
110. Selection module
120. Statistical module
121. Judgment submodule
122. Statistics submodule
123. Computation submodule
130. Judging module
140. Control module
S10-S40 steps
Detailed Description
The embodiments of the present invention are described below with reference to specific embodiments, and other advantages and effects of the present invention will be easily understood by those skilled in the art from the disclosure of the present specification. The invention is capable of other and different embodiments and of being practiced or of being carried out in various ways, and its several details are capable of modification in various respects, all without departing from the spirit and scope of the present invention. It is to be noted that the features in the following embodiments and examples may be combined with each other without conflict.
It should be noted that the drawings provided in the following embodiments are only for illustrating the basic idea of the present invention, and the components related to the present invention are only shown in the drawings rather than drawn according to the number, shape and size of the components in actual implementation, and the type, quantity and proportion of the components in actual implementation may be changed freely, and the layout of the components may be more complicated.
Referring to fig. 1 and fig. 2, the present invention provides a garbage collection method, system, device and storage medium for a solid state disk, which reasonably integrates the host write data process into the write data gaps of each processing step of garbage collection according to the statistical data amount of write data of the garbage-collected write data host and the weight coefficient related to the time required for processing each step in the garbage collection and the total processing time of the garbage collection, thereby increasing the stability of write data of the host.
In one embodiment of the method of manufacturing the optical fiber,
as shown in fig. 1, the present embodiment discloses a garbage collection method for a solid state disk, which specifically includes:
s10, selecting a storage block in the solid state disk to carry out garbage collection;
garbage collection of the solid state disk is processed by taking a storage block as a unit. Therefore, in the garbage collection method of this embodiment, it is first required to arbitrarily select one storage block for garbage collection processing. And determining the proportional relation of the data volumes of the current host write data and the garbage collection write data according to the effective data volume in the storage block selected for garbage collection. And a first threshold value and a second threshold value are preset according to the proportional relation. Namely, the ratio relation of the data volume of the current host writing data and the garbage collection writing data is R, and the data volume threshold of the writing data of the garbage collection in the period is G, namely the first threshold is G; then the threshold for the amount of data that the host writes data in the cycle, i.e., the second threshold, is GR. Assuming that R =1/2 and the first threshold G =256, then the second threshold is 128.
S20, counting a first data volume of the processed data in garbage collection; clearing the first data volume before counting;
judging the current garbage recovery processing step;
counting the data volume actually processed in garbage recovery; clearing the actually processed data volume before counting;
a first data amount is calculated based on the processing step and the data amount actually processed.
There are many ways to recycle the garbage of SSD, and different garbage recycling methods can be divided into multiple steps. Therefore, in this embodiment, in order to reasonably distribute the host write data process into the steps of each processing of SSD garbage collection, the ratio of the time required for processing in each step in garbage collection to the total processing time of garbage collection is selected as a weight coefficient, that is:
Figure BDA0002781680980000051
wherein i represents the number of processing steps for garbage collection; s i A weight coefficient representing the processing step i; t is i Indicates the time required for the garbage collection processing step i to perform the processing. Therefore, the garbage collection method for improving the performance of the host write data is not limited by the actual garbage collection processing method and the actual garbage collection processing steps, and the stability of the host write data is realized in a real sense.
Further, the first amount of data = amount of data actually processed × weight coefficient.
Assuming a fixed hard diskThe garbage recycling comprises 4 steps: write data (program), step 1, step 2, and step 3. Through experiments, the time for each part of data of garbage recovery to pass through the program is Tp, and the time for each part of data to pass through the step 1, the step 2 and the step 3 is T1, T2 and T3 respectively. Then, a piece of data passes through the program for the total time
Figure BDA0002781680980000052
Similarly, the total time for completion is equivalent to the time for step 1, step 2 and step 3
Figure BDA0002781680980000053
Figure BDA0002781680980000054
And &>
Figure BDA0002781680980000055
Therefore, the weight coefficient of each step is respectively
Figure BDA0002781680980000056
Figure BDA0002781680980000057
And &>
Figure BDA0002781680980000058
One part of data, the first data amount is increased by the program
Figure BDA0002781680980000059
After step 1, the first data quantity is increased->
Figure BDA00027816809800000510
Via step 2, a first data quantity is increased +>
Figure BDA00027816809800000511
After step 3, the first data quantity is increased->
Figure BDA00027816809800000512
S30, judging whether the first data volume is equal to a preset first threshold value: if the data volume is equal to the first threshold value, performing data writing operation of the host, and counting a second data volume of the data written by the host; clearing the second data volume before counting;
and when the counted first data volume C is equal to the first threshold G, switching to host write data, and counting the second data volume of the host write data. Where the second amount of data is the actual amount of data that the host writes to the data.
When the counted first data amount C is smaller than the first threshold G, it should be further determined whether the garbage collection processing of the selected storage block is completed:
if not, continuing to carry out garbage recycling treatment on the selected storage block;
and if the write data is completed, selecting the next storage block for garbage collection, and counting the first data volume of the write data subjected to garbage collection. It should be noted that even if the next memory block is selected for garbage collection, the value of the first data amount is not cleared, but is accumulated in one cycle, and is cleared only when the next cycle is entered.
S40, judging whether the second data volume is equal to a preset second threshold value GR: and if the data is equal to the second threshold, suspending the host data writing operation and jumping to the step S20 again for garbage collection.
As long as the terminal is running, the operation of writing data by the host is not stopped. Therefore, the garbage collection method for the solid state disk of the embodiment is continuously operated in a circulating manner. In this embodiment, one cycle is a process from step S10 to step S40, that is, a write data operation of garbage collection and a host write data operation are completed, where a first data amount of the garbage collection write data operation is a first threshold G, and a second data amount of the host write data operation is a second threshold GR. That is, when the first data amount increases to the first threshold G, the operation of writing data to the host is switched; and when the second data volume of the host data writing operation reaches GR, switching back to garbage collection again to finish a cycle.
In order to better explain the garbage collection method of the solid state disk in this embodiment, assume that a source storage block is selected for current garbage collection, and through calculation, the proportional relation R between the data amount of current host write data and garbage collection write data is 1/2. Setting a first threshold G of garbage collection write data in a period as 256, and switching to a host write data operation when a first data volume C of garbage collection reaches G; the second threshold for the host's write data in the cycle is GR =128, and when the second amount of data for the host write data reaches 128, the garbage collection is switched.
Assume that the current garbage collection algorithm has 3 steps: program, read, and search valid data. The time proportion relation of Tp, tr and Ts is 4:1:3. then the weight coefficient of the program
Figure BDA0002781680980000061
Weight coefficient for read>
Figure BDA0002781680980000062
Weight coefficient of search valid data
Figure BDA0002781680980000063
Suppose that 2048 data are currently garbage-collected, and the data respectively pass through three steps of search valid data, read and program. Then 2048 xs is increased as 2048 data passes through the step program p =1024= (256 × 4), then in practice, every 512 copies of data go through the program, the first data C will reach G (256), and the host will switch to write data, and a cycle will be completed when 128 data volumes are written. After 4 cycles, 2048 copies of data go through the garbage collection procedure, and the host writes data 4 times, for a total of 512 copies of data.
Similarly, after 1 cycle, 2048 parts of data are read in the garbage recovery step, and the host writes data for 1 time, so that 128 parts of data are written in total; after 3 cycles, 2048 copies of data go through the garbage collection step search valid data, and the host writing is also performed 3 times, and 384 copies of data are written in total.
2048 parts of data are recycled in a garbage mode, 8 cycles are needed, and the data size of data written by the host is 1024 parts of data. That is, the host write data is divided into 8 times, which are shared among the various steps of garbage collection.
The steps of the above method are divided for clarity of description, and may be combined into one step or split some steps, and the steps are decomposed into multiple steps, so long as the same logical relationship is included, which are within the scope of the present invention; it is within the scope of the present invention to add insignificant modifications to the algorithms or processes or to introduce insignificant design changes to the core design without changing the algorithms or processes.
As shown in fig. 2, in another embodiment, a garbage recycling system 100 for solid state disks is disclosed, which includes:
a selecting module 110, configured to select a storage block of the solid state disk for garbage collection;
the statistical module 120 is configured to count a first data volume of the processed data and a second data volume of the host write data in garbage collection; in the whole garbage collection process, statistics of the first data volume and the second data volume are not accumulated, and in each period, zero clearing operation needs to be performed on the first data volume and the second data volume. The specific time point of the zero clearing operation is not limited, and the time point can be at the beginning of a garbage collection operation cycle, in the middle of steps or at the end of the cycle, as long as the statistics of the data volume of garbage collection write data and host write data can be smoothly realized.
A determining module 130, configured to determine a relationship between the first data amount and a preset first threshold, and a relationship between the second data amount and a second threshold; that is, it is determined whether the first data amount is equal to the first threshold value and the second data amount is equal to the second threshold value.
A control module 140, configured to control garbage collection of the memory block and host write data operation:
when the first data volume is smaller than a first threshold value, performing data writing operation of garbage collection;
when the first data volume is equal to a first threshold value, suspending the data writing operation of garbage collection and starting the data writing operation of the host;
when the second data volume is smaller than a second threshold value, performing host data writing operation;
and when the second data volume is equal to the second threshold, suspending the host data writing operation and starting the data writing operation of garbage collection of the next cycle.
Wherein, the statistic module 120 includes:
a judgment submodule 121, configured to judge a processing step of currently recycling the garbage;
the statistics submodule 122 is configured to count a data amount of actually written data in garbage collection;
the calculation submodule 123 is configured to calculate the first data amount according to the processing step and the data amount of the actually written data.
Further, the calculating submodule 124 calculates the first data amount as follows: first data volume = data volume of actual write data x weight coefficient; the weight coefficients are:
Figure BDA0002781680980000071
wherein i represents the number of processing steps for garbage collection; s i A weight coefficient representing the processing step i; t is i Indicates the time required for the garbage collection processing step i to perform the processing.
It should be noted that, in order to highlight the innovative part of the present invention, a module which is not so closely related to solve the technical problem proposed by the present invention is not introduced in the present embodiment, but this does not indicate that no other module exists in the present embodiment.
In addition, it is clear to those skilled in the art that, for convenience and simplicity of description, the specific working process of the system described above may refer to the corresponding process in the foregoing method embodiment, and details are not described herein again. In the embodiments provided in the present invention, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical division, and in actual implementation, there may be other divisions, for example, multiple modules or components may be combined or integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical modules, may be located in one position, or may be distributed on a plurality of network modules. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing module, or each of the modules may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a form of hardware or a form of a software functional unit.
The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention, which is substantially or partly contributed by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a variety of media that can store program codes, such as a usb disk, a removable hard disk, a read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
In summary, the present invention discloses a garbage collection method, system, device and storage medium for a solid state disk, which reasonably distributes the operations of garbage-collected write data and write data of a host without changing the normal garbage collection processing steps of the solid state disk, that is, the data volumes of the garbage-collected write data and the write data of the host are in proportion, so as to fully utilize the bandwidth of NAND FLASH and greatly improve the stability of the write data performance of the host. Furthermore, the invention takes the ratio of the time of processing required by each step in garbage collection to the total processing time of garbage collection as a weight coefficient, and disperses the operation of writing data by the host in the gaps of each processing step of garbage collection, so that the writing performance of the host is stable in each processing step of garbage collection, and the problem that the writing data of the host is blocked by the excessive writing data in a certain step in garbage collection is avoided. Therefore, the invention effectively overcomes various defects in the prior art and has high industrial utilization value.
The foregoing embodiments are merely illustrative of the principles and utilities of the present invention and are not intended to limit the invention. Those skilled in the art can modify or change the above-described embodiments without departing from the spirit and scope of the present invention. Accordingly, it is intended that all equivalent modifications or changes which can be made by those skilled in the art without departing from the spirit and technical spirit of the present invention be covered by the claims of the present invention.

Claims (5)

1. The garbage recycling method of the solid state disk is characterized by comprising the following steps:
s10, selecting one storage block in the solid state disk to carry out garbage recycling treatment;
s20, judging the processing step of the current garbage collection, counting the data volume of actual write data in the garbage collection, and calculating a first data volume according to the processing step and the data volume of the actual write data, wherein the first data volume = the data volume of the actual write data and a weight coefficient, the data volume of the actual write data is cleared before counting, the weight coefficient is related to the processing step, the first data volume is cleared before counting, and the weight coefficient is calculated according to the following formula:
Figure FDA0004051310010000011
i =1, \8230;, n; wherein i represents the number of processing steps for garbage collection; s. the i A weight coefficient representing the processing step i; t is i The time required for the treatment in the treatment step i for garbage collection is represented;
s30, judging whether the first data volume is equal to a preset first threshold value or not, if so, suspending garbage collection, performing data writing operation of the host, and counting a second data volume of the data written by the host, wherein the second data volume is cleared before counting;
s40, judging whether the second data volume is equal to a preset second threshold value: and if the data size is equal to the second threshold, suspending the host data writing operation, and jumping to the step S20 again for garbage collection, wherein the first threshold and the second threshold are proportional, and the proportional relation of the first threshold and the second threshold is related to the effective data amount in the memory block undergoing garbage collection.
2. The garbage collection method of the solid state disk of claim 1, wherein: the step S30 is to determine whether the first data amount is equal to a preset first threshold: if the data quantity is equal to the first threshold value, the garbage collection is suspended, the data writing operation of the host is carried out, and meanwhile, the step of counting the second data quantity of the data written by the host further comprises the following steps:
if the first data volume is smaller than the first threshold value, judging whether the garbage recycling of the selected storage block is finished:
and if the processing is finished, selecting the next storage block in the solid state disk to perform garbage collection and count the first data volume.
3. The utility model provides a rubbish recovery system of solid state hard drives which characterized in that: the method comprises the following steps:
the selection module is used for selecting the storage blocks of the solid state disk to carry out garbage collection; the statistical module is used for counting a first data volume of processing data and a second data volume of host write data in garbage recovery, and the statistical module comprises: the system comprises a judgment submodule and a calculation submodule, wherein the judgment submodule is used for judging the processing step of the current garbage recovery, the calculation submodule is used for calculating the data volume of actual write data in the garbage recovery, the calculation submodule is used for calculating a first data volume according to the processing step and the data volume of the actual write data, and the calculation submodule calculates the first data volume according to the following mode: first data volume = data volume of actual write data x weight coefficient; wherein the weight coefficient is:
Figure FDA0004051310010000021
i =1, \8230;, n; i represents the number of processing steps for garbage collection; s. the i A weight coefficient representing the processing step i; t is a unit of i The time required for the treatment in the treatment step i for garbage collection is represented;
the judging module is used for judging the relation between the first data volume and a preset first threshold value and the relation between the second data volume and a second threshold value, wherein the first threshold value and the second threshold value are proportional, and the proportional relation between the first threshold value and the second threshold value is related to the effective data volume in the storage block which is subjected to garbage collection;
and the control module is used for controlling the garbage collection of the storage block and the data writing operation of the host.
4. The utility model provides a rubbish recovery unit of solid state hard drives which characterized in that: the method comprises the following steps:
a memory for storing a computer program;
a processor for executing the computer program to implement the steps of the garbage collection method of the solid state disk according to any one of claims 1 to 2.
5. A computer-readable storage medium characterized by: the computer readable storage medium has stored thereon a computer program, which is executed by a processor to implement the steps of the garbage collection method for the solid state disk according to any one of claims 1-2.
CN202011283849.6A 2020-11-17 2020-11-17 Garbage recycling method, system and device of solid state disk and storage medium thereof Active CN112433958B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011283849.6A CN112433958B (en) 2020-11-17 2020-11-17 Garbage recycling method, system and device of solid state disk and storage medium thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011283849.6A CN112433958B (en) 2020-11-17 2020-11-17 Garbage recycling method, system and device of solid state disk and storage medium thereof

Publications (2)

Publication Number Publication Date
CN112433958A CN112433958A (en) 2021-03-02
CN112433958B true CN112433958B (en) 2023-04-14

Family

ID=74700262

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011283849.6A Active CN112433958B (en) 2020-11-17 2020-11-17 Garbage recycling method, system and device of solid state disk and storage medium thereof

Country Status (1)

Country Link
CN (1) CN112433958B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113190469B (en) * 2021-05-13 2023-04-14 合肥康芯威存储技术有限公司 Memory, data writing method and storage system
CN113885793B (en) * 2021-09-08 2024-04-19 深圳市硅格半导体有限公司 Writing speed control method, device, equipment and computer program product

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109783020A (en) * 2018-12-28 2019-05-21 西安交通大学 A kind of rubbish recovering method based on SSD-SMR mixing key assignments storage system
CN111708713A (en) * 2020-05-20 2020-09-25 杭州电子科技大学 Intelligent garbage recycling and scheduling method for solid state disk

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101046755B (en) * 2006-03-28 2011-06-15 郭明南 System and method of computer automatic memory management
US9703527B2 (en) * 2012-12-31 2017-07-11 Sandisk Technologies Llc Storage device and method for reallocating storage device resources based on an estimated fill level of a host buffer
TWI653533B (en) * 2017-03-07 2019-03-11 慧榮科技股份有限公司 Data storage device and method of operation thereof
CN109977032A (en) * 2017-12-28 2019-07-05 北京忆恒创源科技有限公司 Junk data recycling and control method and its device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109783020A (en) * 2018-12-28 2019-05-21 西安交通大学 A kind of rubbish recovering method based on SSD-SMR mixing key assignments storage system
CN111708713A (en) * 2020-05-20 2020-09-25 杭州电子科技大学 Intelligent garbage recycling and scheduling method for solid state disk

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于页面写相关的闪存转换层策略;陈金忠等;《通信学报》;20130625(第06期);全文 *

Also Published As

Publication number Publication date
CN112433958A (en) 2021-03-02

Similar Documents

Publication Publication Date Title
US20220100377A1 (en) Memory system and method of controlling memory system
US8296539B2 (en) Method and apparatus for performing wear leveling in memory
US9846641B2 (en) Variability aware wear leveling
CN112433958B (en) Garbage recycling method, system and device of solid state disk and storage medium thereof
TWI512467B (en) Methods for maintaining a storage mapping table and apparatuses using the same
CN103425595A (en) Data storage device and method for flash block management
CN110851079B (en) Adaptive storage device loss balancing method and system
KR20200037882A (en) Memory device with dynamic cache management
CN110673789B (en) Metadata storage management method, device, equipment and storage medium of solid state disk
CN112445429B (en) Management method and system for physical blocks of solid state disk
CN109144885A (en) The rubbish recovering method and solid storage device of solid storage device
CN108461107A (en) Read threshold value tracking and device
TWI450271B (en) Method for managing a plurality of blocks of a flash memory, and associated memory device and controller thereof
TW202032547A (en) Write control method, associated data storage device and controller thereof
CN107229580A (en) Sequential stream detection method and apparatus
TW201633134A (en) Methods for maintaining a storage mapping table and apparatuses using the same
CN109426436A (en) Rubbish recovering method and device based on variable length bulk
CN114442946B (en) Physical block management method and solid state disk
CN112181274A (en) Large block organization method for improving performance stability of storage device and storage device thereof
TWI417889B (en) Write timeout methods for a flash memory and memory device using the same
CN210402325U (en) NAND flash memory garbage collection circuit based on block sequence table
CN112181276B (en) Large-block construction and distribution method for improving service quality of storage device and storage device thereof
CN107168892A (en) The wiring method and device of a kind of data
CN107688435A (en) IO flows adjusting method and device
Chen et al. Enabling the duo-phase data management to realize longevity bit-alterable flash memory

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
GR01 Patent grant
GR01 Patent grant