Garbage recycling method, device and equipment for solid state disk and readable storage medium

By estimating and migrating the remaining survival time of effective data in solid-state drives, the problem of write amplification effect in solid-state drive garbage collection is solved, the garbage collection probability and data transfer amount of target data blocks are reduced, and the performance and service life of the hard disk are improved.

CN119226186AInactive Publication Date: 2024-12-31SICHUAN YUNHAI XINKE MICROELECTRONICS TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411775054.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-05
Publication Date
2024-12-31
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The garbage collection method of solid-state drives in the prior art lacks a mature solution, resulting in the target data block becoming the source data block again due to excessive failure data, which increases the write amplification effect and affects the performance and service life of the solid-state drive.

Method used

By estimating the remaining survival time of valid data, determining the duration interval, and migrating it to the target data block according to the one-to-one relationship, reducing the probability of garbage collection of valid data with a longer remaining survival time, and due to the remaining The expiration time of effective data with short survival time is close, reducing the amount of effective data that needs to be moved and reducing the write amplification effect.

Benefits of technology

It effectively reduces the write amplification effect of solid-state drives, improves performance and extends service life. By migrating the remaining valid data with similar survival time to the same target data block, the difference in survival time is avoided and the impact on the target data block is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119226186A_ABST
    Figure CN119226186A_ABST
Patent Text Reader

Abstract

The invention discloses a garbage collection method, device and equipment for a solid state disk and a readable storage medium, and belongs to the field of solid state disks. The residual survival duration of effective data can be determined, and then a target data block corresponding to a duration interval where the residual survival duration of the effective data is located is determined; then, the valid data can be migrated to the target data block, on one hand, the probability of garbage collection of the target data block storing the valid data with the longer remaining survival duration is reduced, and on the other hand, the probability of garbage collection of the target data block storing the valid data with the shorter remaining survival duration is reduced even if garbage collection is carried out on the target data block storing the valid data with the shorter remaining survival duration. And the failure time of the effective data in the solid state disk is close, so that the effective data needing to be moved is less, and the write amplification effect of the solid state disk is also reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of solid state hard disks, and in particular to a garbage collection method, device, equipment and readable storage medium for solid state hard disks. Background Art

[0002] Garbage collection is an indispensable key function of SSD (Solid - State Drive). Garbage collection can migrate valid data in data blocks with less valid data (source data blocks) in the SSD to other data blocks (target data blocks) and erase the data in the source data blocks, thereby integrating the fragmented data of "data blocks with less valid data" to achieve the purpose of reducing fragmentation and maintaining free space.

[0003] However, the related technology lacks a mature garbage collection method for solid-state drives, which results in the target data block during garbage collection being likely to be re-identified as a source data block "due to too much invalid data" and requiring a large amount of valid data to be migrated, increasing the write amplification effect of the solid-state drive.

[0004] Therefore, how to provide a solution to the above technical problems is a problem that those skilled in the art need to solve at present. Summary of the invention

[0005] The purpose of the present invention is to provide a garbage collection method, device, equipment and readable storage medium for a solid-state hard disk, which can determine the remaining life span of valid data, and then determine the target data block corresponding to the time interval in which the remaining life span of the valid data is located. Then, the valid data can be migrated to the target data block. On the one hand, the probability of garbage collection of the target data block "storing valid data with a longer remaining life span" is reduced. On the other hand, even if the target data block "storing valid data with a shorter remaining life span" is garbage collected, since the expiration time of the valid data inside it is relatively close, less valid data needs to be moved, which also reduces the write amplification effect of the solid-state hard disk.

[0006] In order to solve the above technical problems, the present invention provides a garbage collection method for a solid state hard disk, comprising:

[0007] For any valid data in the source data block to be garbage collected, estimate the remaining survival time of the valid data, where the remaining survival time is: the time required for the valid data to become invalid data;

[0008] Determine the duration interval of the remaining survival time, and determine the target data block corresponding to the duration interval of the remaining survival time according to the first corresponding relationship, wherein the first corresponding relationship is: a one-to-one corresponding relationship between the duration interval and the target data block;

[0009] Migrating the valid data to the target data block;

[0010] After each valid data in the source data block is migrated, the data in the source data block is erased.

[0011] On the other hand, for any valid data in the source data block to be garbage collected, estimating the remaining survival time of the valid data includes:

[0012] For any valid data in the source data block to be garbage collected, determine the update period of the valid data according to the specified parameters of the logical block address to which the valid data belongs, wherein the specified parameters include the first write time, the most recent update time and the cumulative number of updates of the data;

[0013] The remaining survival time of the valid data is determined according to the most recent update time, the update cycle and the current time.

[0014] On the other hand, for any valid data in the source data block to be garbage collected, determining the update period of the valid data according to the specified parameters of the logical block address to which the valid data belongs includes:

[0015] For any valid data in the source data block to be garbage collected, if the cumulative update times of the logical block address to which the valid data belongs is greater than zero, then according to the specified parameters of the logical block address to which the valid data belongs, the update period of the valid data is determined by a first relational expression;

[0016] The first relational expression includes:

[0017] P=(T up -T write ) / N;

[0018] Among them, P is the update period, T up is the last updated time, T write is the first writing time of the data, and N is the cumulative number of updates;

[0019] For any valid data in the source data block to be garbage collected, if the cumulative update times of the logical block address to which the valid data belongs is equal to zero, a fixed constant period is determined as the update period of the valid data.

[0020] On the other hand, determining the remaining survival time of the valid data according to the most recent update time, the update cycle, and the current time includes:

[0021] Determine the remaining survival time of the valid data by a second relational expression according to the most recent update time, the update cycle and the current time;

[0022] The second relational expression includes:

[0023] ;

[0024] Among them, P is the update period, T up is the last updated time, T s is the remaining survival time, T cur is the current time.

[0025] On the other hand, for any valid data in the source data block to be garbage collected, if the cumulative update times of the logical block address to which the valid data belongs is equal to zero, a fixed constant period is determined as the update period of the valid data, including:

[0026] For any valid data in the source data block to be garbage collected, if the cumulative update times of the logical block address to which the valid data belongs is zero, the update cycle with the largest value in the history of the solid state drive is used as the update cycle of the valid data.

[0027] On the other hand, the remaining survival time is determined to be in the following time intervals:

[0028] According to a number of preset thresholds and the remaining survival time, the duration interval in which the remaining survival time is located is determined by a threshold judgment method, wherein the number of duration intervals is equal to the number of preset thresholds plus one.

[0029] On the other hand, for any valid data in the source data block to be garbage collected, before estimating the remaining survival time of the valid data, the garbage collection method of the solid state drive further includes:

[0030] Several blank data blocks in the solid state drive are determined as target data blocks for the current round of garbage collection.

[0031] In order to solve the above technical problems, the present invention further provides a garbage collection device for a solid state hard disk, comprising:

[0032] An estimation module is used to estimate the remaining survival time of any valid data in the source data block to be garbage collected, wherein the remaining survival time is: the time required for the valid data to become invalid data;

[0033] A determination module, used to determine the duration interval of the remaining survival time, and determine the target data block corresponding to the duration interval of the remaining survival time according to a first corresponding relationship, wherein the first corresponding relationship is a one-to-one corresponding relationship between the duration interval and the target data block;

[0034] A migration module, used for migrating the valid data to the target data block;

[0035] The erasing module is used to erase the data in the source data block after each valid data in the source data block has been migrated.

[0036] In order to solve the above technical problems, the present invention also provides a garbage collection device for a solid state hard disk, comprising:

[0037] Memory for storing computer programs;

[0038] The processor is used to implement the steps of the garbage collection method for the solid state hard disk as described above when executing the computer program.

[0039] In order to solve the above technical problem, the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the garbage collection method of the solid state hard disk as described above are implemented.

[0040] Beneficial effect: The present invention provides a garbage collection method for a solid-state hard disk. Considering that valid data with similar remaining survival time is migrated to the same target data block, it can prevent the remaining survival time of valid data in the same target data block from being significantly different, thereby preventing valid data with shorter remaining survival time from affecting valid data with longer remaining survival time in the target data block. Therefore, the present invention can determine the remaining survival time of the valid data, and then determine the target data block corresponding to the time interval in which the remaining survival time of the valid data is located. Then, the valid data can be migrated to the target data block. On the one hand, the probability of garbage collection of the target data block "storing valid data with longer remaining survival time" is reduced. On the other hand, even if the target data block "storing valid data with shorter remaining survival time" is garbage collected, since the expiration time of the valid data inside it is relatively close, less valid data needs to be moved, which reduces the write amplification effect of the solid-state hard disk.

[0041] The present invention also provides a garbage collection device, equipment and computer-readable storage medium for a solid state hard disk, which have the same beneficial effects as the above garbage collection method for a solid state hard disk. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the relevant technologies and the drawings required for use in the embodiments are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0043] Figure 1A schematic flow chart of a garbage collection method for a solid state hard disk provided by the present invention;

[0044] Figure 2 A structural schematic diagram of a garbage collection device for a solid state hard disk provided by the present invention;

[0045] Figure 3 A structural schematic diagram of a garbage collection device for a solid state hard disk provided by the present invention. DETAILED DESCRIPTION

[0046] The core of the present invention is to provide a garbage collection method, device, equipment and readable storage medium for a solid-state hard disk, which can determine the remaining survival time of valid data, and then determine the target data block corresponding to the time interval in which the remaining survival time of the valid data is located. Then, the valid data can be migrated to the target data block. On the one hand, the probability of garbage collection of the target data block "storing valid data with a longer remaining survival time" is reduced. On the other hand, even if the target data block "storing valid data with a shorter remaining survival time" is garbage collected, since the expiration time of the valid data inside it is relatively close, less valid data needs to be moved, which reduces the write amplification effect of the solid-state hard disk.

[0047] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0048] Please refer to Figure 1 , Figure 1 A schematic flow chart of a garbage collection method for a solid state hard disk provided by the present invention, the garbage collection method for the solid state hard disk comprising:

[0049] S101: for any valid data in the source data block to be garbage collected, estimate the remaining survival time of the valid data, wherein the remaining survival time is: the time required for the valid data to become invalid data;

[0050] Specifically, taking into account the technical problems in the above background technology, and in combination with the consideration that: migrating valid data with similar remaining survival time to the same target data block can prevent obvious differences in the remaining survival time of the valid data in the same target data block, thereby preventing the valid data with shorter remaining survival time from affecting the valid data with longer remaining survival time in the target data block. Therefore, in an embodiment of the present invention, for each valid data in the source data block to be garbage collected, each valid data with similar remaining survival time is migrated to the same target data block, so that the survival time of the data in each target data block is similar. Therefore, in this step, the remaining survival time of the valid data can be first estimated for any valid data in the source data block to be garbage collected, so as to use it as the data basis for subsequent steps.

[0051] S102: Determine the duration interval of the remaining survival time, and determine the target data block corresponding to the duration interval of the remaining survival time according to a first corresponding relationship, wherein the first corresponding relationship is a one-to-one corresponding relationship between the duration interval and the target data block;

[0052] Specifically, after estimating the remaining survival time of the valid data, in order to migrate the valid data with similar remaining survival time to the same target data block, the embodiment of the present invention determines the duration interval of the remaining survival time, and determines the target data block through a one-to-one correspondence between the constructed duration interval and the target data block, thereby achieving the purpose of "migrating the valid data with similar remaining survival time to the same target data block". Therefore, in this step, the duration interval of the remaining survival time can be determined, and the target data block corresponding to the duration interval of the remaining survival time can be determined according to the first correspondence.

[0053] S103: Migrate valid data to the target data block;

[0054] Specifically, after the target data block of the valid data is determined, the valid data can be migrated to the target data block, thereby completing the migration of the valid data.

[0055] S104: After all valid data in the source data block are migrated, the data in the source data block is erased.

[0056] Specifically, after all valid data in the source data block are migrated, since there is still invalid data in the source data block, the data in the source data block may be erased in order to release the space occupied by the invalid data in the source data block.

[0057] Specifically, after the above processing, on the one hand, the probability of garbage collection of the target data block "storing valid data with a longer remaining survival time" is reduced; on the other hand, even if the target data block "storing valid data with a shorter remaining survival time" is garbage collected, since the expiration time of the valid data inside it is relatively close, less valid data needs to be moved, which reduces the write amplification effect of the SSD, which is beneficial to improving the performance of the SSD and extending its service life.

[0058] The present invention provides a garbage collection method for a solid-state hard disk. Considering that valid data with similar remaining survival time is migrated to the same target data block, it is possible to prevent the remaining survival time of valid data in the same target data block from being significantly different, thereby preventing the valid data with shorter remaining survival time from affecting the valid data with longer remaining survival time in the target data block. Therefore, the present invention can determine the remaining survival time of the valid data, and then determine the target data block corresponding to the time interval in which the remaining survival time of the valid data is located. Then, the valid data can be migrated to the target data block. On the one hand, the probability of garbage collection of the target data block "storing valid data with longer remaining survival time" is reduced. On the other hand, even if the target data block "storing valid data with shorter remaining survival time" is garbage collected, since the expiration time of the valid data inside it is relatively close, less valid data needs to be moved, which reduces the write amplification effect of the solid-state hard disk.

[0059] Based on the above embodiments:

[0060] As an optional embodiment, for any valid data in the source data block to be garbage collected, estimating the remaining survival time of the valid data includes:

[0061] For any valid data in the source data block to be garbage collected, the update period of the valid data is determined according to the specified parameters of the logical block address to which the valid data belongs, wherein the specified parameters include the first write time, the most recent update time and the cumulative number of updates of the data;

[0062] The remaining lifetime of valid data is determined based on the last update time, update cycle, and current time.

[0063] Specifically, considering that the main reason why valid data becomes invalid data comes from the data update action, that is, when the valid data is updated, the valid data will generate new valid data at other locations of the solid-state hard disk, and the old valid data will become invalid data. Therefore, the remaining survival time of the valid data can be accurately determined by the update cycle of the valid data, and the update cycle of the valid data is related to the "characteristics of the LBA (Logical Block Addressing) to which the valid data belongs". Therefore, in the embodiment of the present invention, the update cycle of the valid data can be first determined according to the specified parameters of the logical block address to which the valid data belongs, and then the remaining survival time of the valid data can be determined according to the most recent update time, the update cycle and the current time.

[0064] As an optional embodiment, for any valid data in the source data block to be garbage collected, determining the update period of the valid data according to the specified parameters of the logical block address to which the valid data belongs includes:

[0065] For any valid data in the source data block to be garbage collected, if the cumulative update times of the logical block address to which the valid data belongs is greater than zero, then according to the specified parameters of the logical block address to which the valid data belongs, the update period of the valid data is determined by a first relational expression;

[0066] The first relation includes:

[0067] P=(T up -T write ) / N;

[0068] Among them, P is the update period, T up is the last updated time, T write is the first writing time of the data, and N is the cumulative number of updates;

[0069] For any valid data in the source data block to be garbage collected, if the cumulative update times of the logical block address to which the valid data belongs is equal to zero, a fixed constant period is determined as the update period of the valid data.

[0070] Specifically, considering that the time length between the two update actions with the largest span of valid data (that is, the time length between the first write time and the most recent update time) is divided by the cumulative number of updates of the valid data, the update cycle of the valid data can be roughly characterized. Therefore, in the embodiment of the present invention, for the valid data belonging to the "logical block address with a cumulative number of updates greater than zero", the update cycle of the valid data can be determined by the first relationship.

[0071] Specifically, for valid data belonging to "logical block addresses with cumulative update times equal to zero", the embodiments of the present invention can also determine a fixed constant period for the valid data, so as to perform subsequent prediction of the remaining survival time.

[0072] As an optional embodiment, determining the remaining survival time of valid data according to the most recent update time, the update cycle, and the current time includes:

[0073] According to the most recent update time, update cycle and current time, the remaining survival time of the valid data is determined by the second relational expression;

[0074] The second relationship includes:

[0075] ;

[0076] Among them, P is the update period, T up is the last updated time, T s is the remaining survival time, T cur is the current time.

[0077] Specifically, considering that valid data “not reaching the update cycle from the last update time” is likely to be turned into invalid data by the data update action when the last update time reaches the update cycle, the embodiment of the present invention can use the time from the current time to “the time from the last update time to the update cycle” as the remaining survival time for the case “not reaching the update cycle from the last update time”;

[0078] Among them, considering that for the valid data "the time from the last update to the update cycle has been reached", it means that it has not become invalid data due to being updated at the time "the time from the last update to the update cycle has been reached". In this case, the valid data is unlikely to become invalid data due to being updated in the short term. Therefore, the embodiment of the present invention can set the remaining survival time of this type of valid data to infinity.

[0079] As an optional embodiment, for any valid data in the source data block to be garbage collected, if the cumulative update times of the logical block address to which the valid data belongs is equal to zero, a fixed constant period is determined as the update period of the valid data, including:

[0080] For any valid data in the source data block to be garbage collected, if the cumulative update times of the logical block address to which the valid data belongs is equal to zero, the update cycle with the largest value that has ever appeared in the history of the solid state drive is used as the update cycle of the valid data.

[0081] Specifically, considering that "the update cycle with the largest value in the history of the solid-state hard disk" is more reliable and reasonable as the update cycle of "valid data of the cumulative update times of the logical block address", the cumulative update times of the logical block address can be used in the embodiment of the present invention.

[0082] Of course, in addition to this specific method, "for any valid data in the source data block to be garbage collected, if the cumulative update times of the logical block address to which the valid data belongs is equal to zero, determine a fixed constant period as the update period of the valid data" can also be other methods, such as a preset update period with a larger value can be used as the update period of this type of valid data, etc. The embodiments of the present invention are not limited here.

[0083] As an optional embodiment, determining the duration interval of the remaining survival duration includes:

[0084] According to a number of preset thresholds and the remaining survival time, the duration interval in which the remaining survival time is located is determined by a threshold judgment method, wherein the number of duration intervals is equal to the number of preset thresholds plus one.

[0085] Specifically, the threshold judgment method has the advantages of being fast and efficient. The number of preset thresholds is one less than the number of time intervals that can be divided. For example, two time intervals can be divided by one preset threshold, that is, the remaining survival time greater than the preset threshold is used as one time interval, and the remaining survival time less than the preset threshold is used as another time interval. The division of time intervals with other numbers of preset thresholds is similar, and the embodiments of the present invention are not limited here.

[0086] Of course, in addition to the threshold determination method, the duration interval of the remaining survival duration may also be determined by other methods, which are not limited in the embodiment of the present invention.

[0087] As an optional embodiment, for any valid data in the source data block to be garbage collected, before estimating the remaining survival time of the valid data, the garbage collection method of the solid state drive further includes:

[0088] Several blank data blocks in the solid state drive are determined as target data blocks for the current round of garbage collection.

[0089] Specifically, the garbage collection in the embodiment of the present invention can be divided into rounds, a single round includes garbage collection tasks for multiple source data blocks, and a single round includes several (consistent with the number of time intervals) target data blocks. In order to ensure that after the garbage collection work of this round is completed, the remaining survival time of each data in the target data block is similar, the embodiment of the present invention can determine several blank data blocks in the solid-state hard disk as the target data blocks for the current round of garbage collection, and then estimate the remaining survival time of any valid data in any source data block to be garbage collected in the current round. In this way, it can be ensured that the data in the target data block comes from the migrated valid data with similar remaining survival time, which can further reduce the write amplification effect.

[0090] Please refer to Figure 2 , Figure 2 A structural schematic diagram of a garbage collection device for a solid state hard disk provided by the present invention, the garbage collection device for the solid state hard disk comprises:

[0091] The estimation module 21 is used to estimate the remaining survival time of any valid data in the source data block to be garbage collected, wherein the remaining survival time is: the time required for the valid data to become invalid data;

[0092] The determination module 22 is used to determine the duration interval of the remaining survival time, and determine the target data block corresponding to the duration interval of the remaining survival time according to the first corresponding relationship, wherein the first corresponding relationship is: a one-to-one corresponding relationship between the duration interval and the target data block;

[0093] A migration module 23, used to migrate valid data to a target data block;

[0094] The erasing module 24 is used to erase the data in the source data block after each valid data in the source data block has been migrated.

[0095] For an introduction to the garbage collection device for a solid state hard disk provided in an embodiment of the present invention, please refer to the aforementioned embodiment of the garbage collection method for a solid state hard disk, and the embodiment of the present invention will not be described in detail here.

[0096] Please refer to Figure 3 , Figure 3 A structural schematic diagram of a garbage collection device for a solid state hard disk provided by the present invention, the garbage collection device for the solid state hard disk comprises:

[0097] A memory 31, used for storing computer programs;

[0098] The processor 32 is used to implement the steps of the garbage collection method for the solid state drive in the above-mentioned embodiment when executing the computer program.

[0099] For an introduction to the garbage collection device of the solid state hard disk provided in the embodiment of the present invention, please refer to the aforementioned embodiment of the garbage collection method of the solid state hard disk, and the embodiment of the present invention will not be repeated here.

[0100] The present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the garbage collection method for a solid state hard disk in the aforementioned embodiment are implemented.

[0101] For an introduction to the computer-readable storage medium provided in an embodiment of the present invention, please refer to the aforementioned embodiment of the garbage collection method for a solid-state hard disk, and the embodiment of the present invention will not be described in detail here.

[0102] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same and similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should also be noted that in this specification, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the term "include", "comprise" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements includes not only those elements, but also includes other elements that are not explicitly listed, or also includes elements inherent to such process, method, article or equipment. In the absence of more restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or equipment including the element.

[0103] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A garbage collection method for a solid state hard disk, characterized in that: include: For any valid data in the source data block to be garbage collected, estimate the remaining survival time of the valid data, where the remaining survival time is: the time required for the valid data to become invalid data; Determine the duration interval of the remaining survival time, and determine the target data block corresponding to the duration interval of the remaining survival time according to the first corresponding relationship, wherein the first corresponding relationship is: a one-to-one corresponding relationship between the duration interval and the target data block; Migrating the valid data to the target data block; After each valid data in the source data block is migrated, the data in the source data block is erased.

2. The garbage collection method for a solid state hard disk according to claim 1, characterized in that: For any valid data in the source data block to be garbage collected, estimating the remaining survival time of the valid data includes: For any valid data in the source data block to be garbage collected, determine the update period of the valid data according to the specified parameters of the logical block address to which the valid data belongs, wherein the specified parameters include the first write time, the most recent update time and the cumulative number of updates of the data; The remaining survival time of the valid data is determined according to the most recent update time, the update cycle and the current time.

3. The garbage collection method for a solid state hard disk according to claim 2, characterized in that: For any valid data in the source data block to be garbage collected, determining the update period of the valid data according to the specified parameters of the logical block address to which the valid data belongs includes: For any valid data in the source data block to be garbage collected, if the cumulative update times of the logical block address to which the valid data belongs is greater than zero, then according to the specified parameters of the logical block address to which the valid data belongs, the update period of the valid data is determined by a first relational expression; The first relational expression includes: P=(T up -T write ) / N; Among them, P is the update period, T up is the last updated time, T write is the first writing time of the data, and N is the cumulative number of updates; For any valid data in the source data block to be garbage collected, if the cumulative update times of the logical block address to which the valid data belongs is equal to zero, a fixed constant period is determined as the update period of the valid data.

4. The garbage collection method for a solid state hard disk according to claim 2, characterized in that: Determining the remaining survival time of the valid data according to the most recent update time, the update cycle, and the current time includes: Determine the remaining survival time of the valid data by a second relational expression according to the most recent update time, the update cycle and the current time; The second relational expression includes: ; Among them, P is the update period, T up is the last updated time, T s is the remaining survival time, T cur is the current time.

5. The garbage collection method for a solid state hard disk according to claim 3, characterized in that: For any valid data in the source data block to be garbage collected, if the cumulative update times of the logical block address to which the valid data belongs is equal to zero, a fixed constant period is determined as the update period of the valid data, including: For any valid data in the source data block to be garbage collected, if the cumulative update times of the logical block address to which the valid data belongs is zero, the update cycle with the largest value in the history of the solid state drive is used as the update cycle of the valid data.

6. The garbage collection method for a solid state hard disk according to claim 1, characterized in that: Determine the remaining survival time in the time interval including: According to a number of preset thresholds and the remaining survival time, the duration interval in which the remaining survival time is located is determined by a threshold judgment method, wherein the number of duration intervals is equal to the number of preset thresholds plus one.

7. The garbage collection method for a solid state hard disk according to any one of claims 1 to 6, characterized in that: For any valid data in the source data block to be garbage collected, before estimating the remaining survival time of the valid data, the garbage collection method of the solid state drive further includes: Several blank data blocks in the solid state drive are determined as target data blocks for the current round of garbage collection.

8. A garbage collection device for a solid state hard disk, characterized in that: include: An estimation module is used to estimate the remaining survival time of any valid data in the source data block to be garbage collected, wherein the remaining survival time is: the time required for the valid data to become invalid data; A determination module, used to determine the duration interval of the remaining survival time, and determine the target data block corresponding to the duration interval of the remaining survival time according to a first corresponding relationship, wherein the first corresponding relationship is a one-to-one corresponding relationship between the duration interval and the target data block; A migration module, used for migrating the valid data to the target data block; The erasing module is used to erase the data in the source data block after each valid data in the source data block has been migrated.

9. A garbage collection device for a solid state hard disk, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the garbage collection method for a solid state hard disk as claimed in any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the garbage collection method for a solid state hard disk as claimed in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Data management method and apparatus exerting concurrent characteristic in flash memory device

    CN107515728A

  • Solid state disk garbage collection method and device based on multi-core CPU

    CN111045956A