Garbage recycling method, device and equipment suitable for FDP and medium

Through the garbage collection method based on RUH linked list in the FDP environment, dynamic adjustment is used to solve the problems of low garbage collection performance and high resource consumption in the existing technology, and more efficient storage performance and system stability are achieved.

CN120123259AActive Publication Date: 2025-06-10INSPUR SUZHOU INTELLIGENT TECH CO LTD

Patent Information

Application Number
CN202510199669.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-21
Publication Date
2025-06-10
Estimated Expiration
2045-02-21

AI Technical Summary

Technical Problem

When the prior art performs garbage collection in the FDP environment, it is easy to cause write amplification and random write performance to decline, and the overhead is high, resulting in low storage space utilization, difficult garbage collection, and affecting system stability.

Method used

When FDP is turned on and the number of idle virtual blocks in the SSD disk meets the preset garbage collection water level line conditions, the number of valid data frames corresponding to the low water level virtual blocks is judged in turn based on the RUH link list, and garbage collection is performed using the flow control ratio until the preset conditions are met to optimize the garbage collection process.

Benefits of technology

By dynamically adjusting the water level line and flow control ratio of garbage collection, the efficiency and resource utilization of garbage collection are optimized, unnecessary resource consumption is reduced, and storage performance and system stability are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120123259A_ABST
    Figure CN120123259A_ABST
Patent Text Reader

Abstract

The invention discloses a garbage collection method, device and equipment suitable for FDP and a medium, and relates to the technical field of storage technologies. Whether the number of the source virtual blocks corresponding to the low-effective-data-frame-number water level virtual blocks in the RUH linked list is larger than a certain number or not is judged in turn; under different conditions, different garbage collection strategies are adopted, and then different garbage collection results are obtained, so that the technical problems that the performance such as write reduction, write amplification and random write is prone to being affected, the overhead is large, the utilization rate of the storage space is low, the garbage collection difficulty is large, and the stability is poor are solved; according to the method, the distribution of the data on the SSD disk is more effectively managed, garbage collection is started at a proper time, operation is only carried out on the source virtual blocks really needing to be collected, dynamic adjustment is carried out according to the number of the source virtual blocks and the number of the target virtual blocks, and garbage collection is more flexible and efficient.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of storage technologies, and in particular, to a garbage collection method, apparatus, device, and medium applicable to a FDP (Flexible Data Placement). Background Art

[0002] If an SSD (Solid State Drive) supports FDP (Flexible Data Placement), there will be many RUH (Reclaim Unit Handle) in the same reclaim group. For continuously isolated RUH, it is required that the reclaim unit data of different RUH cannot be mixed into the same reclaim unit during the garbage collection process.

[0003] In related technologies, a relatively common method is to divide garbage collection into multiple streams, and the data of each stream is only reclaimed by its own garbage collection manager; it is also possible to establish a virtual address based on the storage parameters of the SSD, and then obtain the corresponding mapping relationship, and during garbage collection, data migration is performed according to the mapping relationship.

[0004] However, in related technologies, when garbage collection is divided into multiple streams, since a large number of blocks are opened simultaneously, the water level line during recovery is very high, which in turn affects write amplification and random write performance; when garbage collection is performed by establishing a virtual address based on SSD storage parameters, in the case of a large address space or frequent changes in the mapping relationship, the overhead of establishing and maintaining the mapping relationship is large, resulting in memory fragmentation problems, reducing the utilization rate of the storage space, increasing the difficulty of garbage collection, and there is an urgent need for improvement. Summary of the Invention

[0005] This application provides a garbage collection method, apparatus, device, and medium applicable to FDP, so as to at least solve the technical problems in related technologies that performance such as write reduction, write amplification, and random write is easily affected, and the overhead is large, resulting in a low utilization rate of the storage space, a large difficulty in garbage collection, and being not conducive to maintaining and keeping the stability of the system.

[0006] The present application provides a garbage collection method applicable to FDP, including: when FDP is enabled and the number of free virtual blocks in the SSD disk meets the preset garbage collection water level line condition, based on at least one RUH linked list in the SSD disk, alternately determining whether the first source quantity of the source virtual block corresponding to at least one virtual block with a low water level of the number of valid data frames in the at least one RUH linked list is greater than a preset quantity; if the first source quantity is greater than the preset quantity, based on the virtual block with a low water level of the number of valid data frames, initiating garbage collection on at least one source virtual block in at least one RUH using a flow control ratio until the first destination quantity of the destination virtual block meets the first preset destination collection condition, so as to obtain the first garbage collection result of the SSD disk; if the first source quantity is less than or equal to the preset quantity, based on the virtual block with a low water level of the number of valid data frames, counting the second source quantity of the source virtual blocks in the list of virtual blocks with a low water level of the number of valid data frames corresponding to the at least one RUH, and when the second source quantity is greater than the second destination quantity of the destination virtual block, initiating garbage collection on the at least one source virtual block using the flow control ratio until the second destination quantity meets the second preset destination collection condition, and / or the at least one source virtual block meets the preset source collection condition, so as to obtain the second garbage collection result of the SSD disk.

[0007] The present application further provides a garbage collection device applicable to FDP, including: a first determination module, configured to alternately determine whether the first source quantity of the source virtual block corresponding to at least one virtual block with a low water level of the number of valid data frames in the at least one RUH linked list is greater than a preset quantity when FDP is enabled and the number of free virtual blocks in the SSD disk meets the preset garbage collection water level line condition, based on at least one RUH linked list in the SSD disk; a first generation module, configured to, when the first source quantity is greater than the preset quantity, initiate garbage collection on at least one source virtual block in at least one RUH using a flow control ratio based on the virtual block with a low water level of the number of valid data frames until the first destination quantity of the destination virtual block meets the first preset destination collection condition, so as to obtain the first garbage collection result of the SSD disk; a second generation module, configured to, when the first source quantity is less than or equal to the preset quantity, count the second source quantity of the source virtual blocks in the list of virtual blocks with a low water level of the number of valid data frames corresponding to the at least one RUH based on the virtual block with a low water level of the number of valid data frames, and when the second source quantity is greater than the second destination quantity of the destination virtual block, initiate garbage collection on the at least one source virtual block using the flow control ratio until the second destination quantity meets the second preset destination collection condition, and / or the at least one source virtual block meets the preset source collection condition, so as to obtain the second garbage collection result of the SSD disk.

[0008] The present application also provides an electronic device, including: a memory for storing a computer program; a processor for implementing the steps of any of the above garbage collection methods applicable to FDP when executing the computer program.

[0009] The present application also provides a computer-readable storage medium storing a computer program therein, wherein the computer program implements the steps of any of the above garbage collection methods applicable to FDP when executed by a processor.

[0010] The present application also provides a computer program product including a computer program, which implements the steps of any of the above garbage collection methods applicable to FDP when executed by a processor.

[0011] Through the present application, when FDP is enabled and the number of free virtual blocks in the SSD disk meets a certain garbage collection water level condition, based on the RUH linked list, it is possible to alternately determine whether the first source quantity of the source virtual block corresponding to the virtual block with a low water level of the valid data frame quantity is greater than a certain preset quantity, and when it is greater, perform garbage collection using the flow control ratio until a first certain target recovery condition is met, thereby obtaining a first garbage collection result; and when it is less than or equal to, count the second source quantity of the source virtual block, and when it is greater than a second target quantity, perform garbage collection using the flow control ratio until a second certain target recovery condition is met, and / or the source virtual block meets a certain source recovery condition, thereby obtaining a second garbage collection result. Therefore, it is possible to solve technical problems such as the performance of write reduction, write amplification, and random write being easily affected, with large overheads, resulting in low utilization rate of storage space, difficult garbage collection, and being unfavorable for maintaining and keeping the stability of the system, and achieve the technical effect of starting garbage collection at an appropriate time through FDP, releasing unnecessary space, and only operating on those source virtual blocks that truly need to be recycled, reducing unnecessary resource consumption, and dynamically adjusting according to the quantities of source virtual blocks and destination virtual blocks, making garbage collection more flexible and efficient. Description of the Drawings

[0012] To more clearly illustrate the embodiments of the present application, the following will briefly introduce the drawings required for use in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0013] Figure 1 It is a flowchart of a garbage collection method applicable to FDP provided by an embodiment of the present application;

[0014] Figure 2 It is a schematic block diagram of adding a linked list provided by an embodiment of the present application;

[0015] Figure 3 A block diagram of the source virtual block and the destination virtual block provided by an embodiment of the present application;

[0016] Figure 4 A flowchart of inserting a low water level virtual block list of valid data frames provided by an embodiment of the present application;

[0017] Figure 5 A flowchart of garbage collection provided by an embodiment of the present application;

[0018] Figure 6 A block diagram of a garbage collection device applicable to FDP provided by an embodiment of the present application.

[0019] Reference numerals:

[0020] Among them, 10 - a garbage collection device applicable to FDP; 100 - a first judgment module, 200 - a first generation module, 300 - a second generation module. Detailed implementation manners

[0021] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

[0022] It should be noted that in the description of the present application, the terms "include", "comprise" or any other variant thereof are intended to cover a non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements but also includes other elements not explicitly listed, or further includes elements inherent to such process, method, article or device. The terms "first", "second", etc. in the present application are used to distinguish similar objects and are not used to describe a specific order or sequence.

[0023] In order to enable those skilled in the art in the technical field of the present application to better understand the solutions of the present application, the present application will be further described in detail below in conjunction with the accompanying drawings and specific implementation manners.

[0024] The embodiments of the present application provide a garbage collection method applicable to FDP. In combination with the execution process of the garbage collection method applicable to FDP, the method will be described in detail.

[0025] Specifically, Figure 1 A flowchart of a garbage collection method applicable to FDP provided by an embodiment of the present application.

[0026] AsFigure 1 As shown, the garbage collection method applicable to FDP includes the following steps:

[0027] In step S101, when FDP is turned on and the number of free virtual blocks in the SSD disk meets the preset garbage collection waterline condition, based on at least one RUH linked list in the SSD disk, it is determined in turn whether the first source number of the source virtual block corresponding to at least one low-water-mark virtual block with a valid data frame number in at least one RUH linked list is greater than the preset number.

[0028] It is understandable that in the embodiment of the present application, FDP can be used to optimize the data placement and garbage collection efficiency of the SSD. The garbage collection of the SSD is to recycle the blocks where invalid data is located and erase them for reuse. Further, in the embodiment of the present application, when the free virtual blocks in the SSD disk meet certain garbage collection waterline conditions, garbage collection will be initiated. Among them, the certain garbage collection waterline conditions can be set by technicians in this field according to actual conditions, and this application does not make specific restrictions.

[0029] In addition, in the embodiment of the present application, the RUH linked list can be a structure of a certain management block, or a list of certain maintenance blocks to be recycled, which can be set by a person skilled in the art according to actual conditions, and the present application does not impose any specific restrictions. Each RUH linked list may correspond to different block states or attributes, such as blocks with different degrees of wear, or blocks with different priorities. At least one RUH linked list may include one RUH linked list, or may include multiple RUH linked lists, which can be set by a person skilled in the art according to actual conditions, and the present application does not impose any specific restrictions.

[0030] In addition, it should be noted that the embodiment of the present application requires a more accurate judgment of the reserved space, so before garbage collection, the bad blocks of the virtual blocks can be replaced first, that is, when a block in a virtual block becomes a bad block, the blocks of the same lun and the same plane are found in the failed virtual block to fill it. The virtual blocks that cannot be filled will be classified as failed virtual blocks, and the number of blocks of all virtual blocks is sufficient. Because the embodiment of the present application uses less computing power, a more accurate estimation of the reserved space is required. If there is no virtual block bad block replacement strategy, the average value can be used for estimation, but the accuracy of source selection will be affected.

[0031] As a possible implementation manner, when the FDP is enabled and there are a sufficient number of free virtual blocks in the SSD disk to meet a certain garbage collection water level condition, the embodiments of the present application can recycle the space of the free virtual blocks for reallocation to new data writes. Specifically, the embodiments of the present application can first determine the first source quantity of the source virtual blocks corresponding to the low water level virtual blocks of the valid data frames in the RUH linked list in the SSD disk, and then alternately determine whether the first source quantity is greater than a certain quantity, and take different measures in different situations. The certain quantity can be set by those skilled in the art according to the actual situation, and the present application does not make specific limitations.

[0032] For example, when the FDP is enabled in the embodiments of the present application and it is detected that the number of free virtual blocks in the SSD disk is 20 and meets a certain garbage collection water level condition, when it is detected that there are 16 low water level virtual blocks of valid data frames greater than a certain quantity (such as 15, the present application does not make specific limitations) in the RUH linked list A, garbage collection can be immediately triggered to migrate the valid data and then erase the block. Then, the linked list B is polled. If there are only 3 low water level virtual blocks of valid data frames, it skips to the next linked list to ensure efficient resource utilization.

[0033] By monitoring the low water level virtual blocks in the RUH linked list, the embodiments of the present application can more effectively identify which blocks contain less valid data, so as to preferentially perform garbage collection on these blocks, reduce the data migration amount during the garbage collection process, improve the overall efficiency, and release the free space in the SSD through timely garbage collection, reduce fragmentation, thereby optimizing the read and write performance, reducing the risk of read and write errors and data loss caused by data fragmentation, and can more effectively utilize the storage space of the SSD.

[0034] Optionally, in an embodiment of the present application, before alternately determining whether the first source quantity of the source virtual blocks corresponding to at least one low water level virtual block of valid data frames in at least one RUH linked list in the SSD disk is greater than a preset quantity, it further includes: calculating the total data frame of the used virtual blocks according to the quantity of the used virtual blocks in the SSD disk and the data frame quantity corresponding to the used virtual blocks; calculating the total valid data frame of the used virtual blocks according to the amount of data written in the SSD disk; calculating the average occupancy rate of the valid data frames of the used virtual blocks based on the total data frame and the total valid data frame; obtaining the low water level virtual blocks of the valid data frames based on the average occupancy rate of the valid data frames and the used virtual blocks; constructing a used virtual block linked list corresponding to the used virtual blocks based on the low water level virtual blocks of the valid data frames.

[0035] As a possible implementation, before determining whether the first source quantity of the source virtual block corresponding to the low water level virtual block of the valid data frame quantity is greater than a preset quantity in the embodiments of the present application, the total data frame quantity may be calculated first according to the quantity of used virtual blocks and the data frame quantity corresponding to the used virtual blocks, and then the total valid data frame quantity may be calculated according to the written data quantity. Furthermore, the average occupancy rate of the valid data frames of the used virtual blocks may be calculated, and the low water level virtual block of the valid data frame quantity may be obtained by using the average occupancy rate of the valid data frames, and then the linked list of the used virtual blocks may be constructed.

[0036] Among them, the total data frame quantity in one block in the embodiments of the present application may be understood as including the quantity of valid data frames and the total quantity of invalid data frames; the total data frame quantity of multiple added data frames may be understood as the total data frame quantity; the total quantity of multiple added valid data frames may be understood as the total valid data frame quantity, and the present application does not make specific limitations.

[0037] Exemplarily, in the embodiments of the present application, since the quantity of all virtual blocks is fixed, the data frame quantity in each virtual block is also fixed. Furthermore, the total data frame quantity may be calculated according to the quantity of used virtual blocks and the data frame quantity of each virtual block, and its expression may be but is not limited to:

[0038] Total data frame quantity = Quantity of used virtual blocks * Data frame quantity of each virtual block,

[0039] Furthermore, in the embodiments of the present application, the total valid data frame quantity may be calculated according to the written data quantity, so as to calculate the average occupancy rate of the valid data frames, and its expression may be but is not limited to:

[0040] Average occupancy rate of valid data frames = Total valid data frame quantity / Total data frame quantity,

[0041] It can be seen from the above formula that there must be used virtual blocks in the embodiments of the present application whose occupancy rate of valid data frames is lower than the average value. These virtual blocks with occupancy rates lower than the average value are recorded as low water level virtual blocks of the valid data frame quantity. Furthermore, as Figure 2 shown, in the embodiments of the present application, a timer is used to poll and check all virtual blocks of the entire SSD, and all low water level virtual blocks of the valid data frame quantity are put into the corresponding RUH linked list to obtain the linked list of used virtual blocks.

[0042] Among them, the total time for the timer to poll the entire linked list of virtual blocks in one circle should be less than the time to write full one destination virtual block. It can be understood that in the embodiments of the present application, in the case of continuous circulation, the time for one round is not too long. If the destination virtual block is not filled up, there is enough time to turn back. As long as there is enough recyclable quantity in the current RUH in the next round and recycling can be performed, this virtual block will not waste space. Furthermore, the performance of the SSD is optimized and the overall resource utilization rate is improved.

[0043] The embodiments of the present application can more accurately identify which virtual blocks contain less valid data by calculating the average value of the valid data frame occupancy rate, so as to give priority to garbage collection of these blocks, thereby reducing unnecessary data migration, improving the efficiency and specificity of garbage collection, optimizing SSD performance, extending the service life of the SSD, and improving overall resource utilization.

[0044] Optionally, in one embodiment of the present application, before judging in turn whether the first source quantity of the source virtual block corresponding to at least one low-water mark virtual block with valid data frame quantity in at least one RUH linked list is greater than a preset quantity based on at least one RUH linked list in the SSD disk, it also includes: generating a RUH linked list corresponding to at least one virtual block based on at least one virtual block in the SSD disk and the average occupancy rate of valid data frames.

[0045] In the actual implementation process, the embodiment of the present application can add an RUH information to the structure that records each virtual block information in the SSD disk when the FDP is turned on. When each virtual block is turned on, the RUH where it is located is recorded in the virtual block information, and a linked list header is established for each RUH, and then based on the average value of the valid data frame occupancy rate, the RUH linked list corresponding to each virtual block is generated.

[0046] The embodiment of the present application can generate a RUH linked list to make data management in the SSD disk more orderly and efficient, and through the average value of the valid data frame occupancy rate, the generated RUH linked list can ensure the reasonable allocation and utilization of storage resources, thereby helping to avoid waste of storage space, improve the overall storage efficiency of the SSD disk, reduce data access latency, and improve the response speed of the system.

[0047] Optionally, in one embodiment of the present application, before initiating garbage collection for at least one source virtual block using the flow control ratio, it also includes: calculating a third source number of source virtual blocks and a third destination number of destination virtual blocks when performing garbage collection based on the number of low-water mark virtual blocks with valid data frames; calculating an initial flow control ratio for garbage collection of at least one RUH based on the third source number and the third destination number; and recalculating the initial flow control ratio based on the actual garbage collection write ratio based on the write data of the destination virtual block and the actual sum of valid data frames of the source virtual block to obtain the flow control ratio.

[0048] In some embodiments, before initiating garbage collection, the embodiments of the present application may first calculate the third source number of the source virtual blocks and the third destination number of the destination virtual blocks during garbage collection, then calculate the initial flow control ratio, and then recalculate the initial flow control ratio to obtain the flow control ratio.

[0049] Exemplarily, in order to prevent the depletion of free virtual blocks during the garbage collection process, the embodiments of the present application need to perform traffic control on garbage collection writes and host writes, ensure that garbage collection writes and host writes are carried out in a certain proportion, and ensure the maximum performance for host writes without exhausting the blocks. This can not only ensure the performance of the SSD, but also increase performance stability and extend the lifespan of the disk.

[0050] Further, when each RUH starts garbage collection in the embodiments of the present application, the total number of virtual blocks to be recycled (which can be understood as the third source quantity of the source virtual blocks) can be calculated, that is, the minimum number of virtual blocks that can be released during this recycling process (which can be understood as the third source quantity - the third destination quantity) and the maximum number of virtual blocks required to carry this data (which can be understood as the third destination quantity of the destination virtual blocks) are known. Then, an initial flow control ratio (which can be understood as the ratio of the number of garbage collection writes to the total number of writes) can be calculated. Its calculation formula can be but is not limited to:

[0051] The number of garbage collection writes / The total number of writes = The third destination quantity / The third source quantity,

[0052] wherein, in the embodiments of the present application, the total number of writes = The number of host writes + The number of garbage collection writes.

[0053] Combined with Figure 3 As shown, when 4 source virtual blocks are recycled to 3 destination virtual blocks in the embodiments of the present application, the ratio of host writes to garbage collection should be 1:3, and then the allocation ratio of garbage collection and host writes can be calculated; it can be understood that in the embodiments of the present application, a certain amount of data written must have a certain number of host writes and a certain number of garbage collection writes. When one side reaches the limit, the other needs to wait, so as to ensure relatively stable write performance.

[0054] In addition, it should be noted that during the garbage collection process in the embodiments of the present application, the host writes may also move the data in the source virtual blocks. Therefore, when a certain amount of data is written to each destination virtual block, check the sum of the actual data written to the current destination virtual block and the actual valid data frames of the current source virtual block. If the sum of the actual valid data frames decreases to a certain extent, the proportion of garbage collection writes can be appropriately reduced, and the initial flow control ratio can be recalculated to obtain the flow control ratio.

[0055] Optionally, in an embodiment of the present application, based on the sum of the written data of the target virtual block and the actual valid data frames of the source virtual block, the initial flow control ratio is recalculated using the actual garbage collection write ratio, including: determining whether the number of idle virtual blocks is within the first condition interval in the preset garbage collection water level condition; if the number of idle virtual blocks is within the first condition interval, based on the written data, the sum of the actual valid data frames, and the actual garbage collection write ratio, the initial flow control ratio is recalculated using the first calculation condition; if the number of idle virtual blocks is not within the first condition interval, determining whether the number of idle virtual blocks is within the second condition interval in the preset garbage collection water level condition; if the number of idle virtual blocks is within the second condition interval, based on the written data, the sum of the actual valid data frames, and the actual garbage collection write ratio, the initial flow control ratio is recalculated using the second calculation condition; if the number of idle virtual blocks is not within the second condition interval, determining whether the number of idle virtual blocks is within the third condition interval in the preset garbage collection water level condition; if the number of idle virtual blocks is within the third condition interval, based on the written data, the sum of the actual valid data frames, and the actual garbage collection write ratio, the initial flow control ratio is recalculated using the third calculation condition, where the first condition interval, the second condition interval, and the third condition interval are mutually exclusive, and their union is the preset garbage collection water level condition.

[0056] It can be understood that the embodiment of the present application can divide a certain garbage collection water level condition into a first condition interval, a second condition interval, and a third condition interval, and these three condition intervals are mutually exclusive. The specific division method can be set by those skilled in the art according to the actual situation, and the present application does not make specific limitations.

[0057] In some embodiments, when the number of idle virtual blocks is within the first condition interval, the embodiment of the present application can recalculate the initial flow control ratio using the first calculation condition.

[0058] Exemplarily, in order to make the overall performance of the SSD more stable, the embodiment of the present application can set a certain garbage collection water level higher than the garbage collection steady state. Therefore, when just meeting the certain garbage collection water level condition, according to the initial flow control ratio, the ratio of garbage collection writes can be appropriately reduced to make the decline in random write performance smoother. It can be understood that when the number of idle virtual blocks is within the first condition interval, the embodiment of the present application adjusts the ratio of garbage collection writes to 60% to 79% of the initial flow control ratio, that is, recalculates the initial flow control ratio using the first calculation condition. Among them, the first calculation condition can be set by those skilled in the art according to the actual situation, and the present application does not make specific limitations.

[0059] In some embodiments, when the number of idle virtual blocks does not fall within the first conditional range but falls within the second conditional range, the present application embodiment may recalculate the initial flow control ratio using the second calculation condition.

[0060] Exemplarily, when the number of idle virtual blocks falls within the second conditional range, the present application embodiment may adjust the proportion of garbage collection to 80%-99% of the initial flow control ratio, that is, recalculate the initial flow control ratio using the second calculation condition. Among them, the second calculation condition can be set by those skilled in the art according to the actual situation, and the present application does not make specific limitations.

[0061] In some embodiments, when the number of idle virtual blocks does not fall within the first conditional range or the second conditional range but falls within the third conditional range, the present application embodiment may recalculate the initial flow control ratio using the third calculation condition.

[0062] Exemplarily, when the number of idle virtual blocks falls within the third conditional range, the present application embodiment may recalculate the initial flow control ratio using the third calculation condition. Among them, the third calculation condition can be set by those skilled in the art according to the actual situation, and the present application does not make specific limitations.

[0063] The embodiment of the present application can more precisely control the data flow during garbage collection, avoid the system performance degradation or data migration conflict caused by excessive traffic during garbage collection, and maintain a more stable operating state.

[0064] In step S102, if the number of the first sources is greater than the preset number, then based on the virtual blocks with low water level of the valid data frame quantity, garbage collection is initiated for at least one source virtual block in at least one RUH using the flow control ratio until the first target quantity of the target virtual block meets the first preset target recovery condition, so as to obtain the first garbage collection result of the SSD disk.

[0065] In some embodiments, when the number of the first sources is greater than a certain number, the present application embodiment may initiate garbage collection for at least one source virtual block in at least one RUH according to the virtual blocks with low water level of the valid data frame quantity and using the flow control ratio. This garbage collection process will continue until the first target quantity of the target virtual block meets the first certain target recovery condition, and after the garbage collection is completed, the first garbage collection result of the SSD disk is obtained. Among them, the certain number and the first certain target recovery condition can be set by those skilled in the art according to the actual situation, and the present application does not make specific limitations.

[0066] Exemplarily, when the FDP is enabled in the embodiments of the present application and the number of idle virtual blocks in the SSD disk meets the preset garbage collection water level condition, starting from the 0th RUH, it is judged in turn. If the number of low water level virtual blocks of valid data frames in the linked list exceeds 15 (this value can be adjusted according to the number of RUs, and the present application does not make specific limitations), garbage collection is directly initiated for this RUH, and at most 10 target virtual blocks are recycled. Then switch to the next one until the garbage collection of all RUs is successful, thereby obtaining the first garbage collection result of the SSD disk.

[0067] In the embodiments of the present application, through garbage collection, the space occupied by the low water level virtual blocks of valid data frames can be released, flexibly coping with different storage scenarios and data distributions, thereby optimizing the utilization of storage resources, and further ensuring that the SSD disk has sufficient free space to cope with future data writing requirements, improving data access speed, and further enhancing the user experience.

[0068] Optionally, in an embodiment of the present application, garbage collection is initiated for at least one source virtual block using a flow control ratio, including: obtaining low water level virtual blocks of valid data frames that meet preset conditions in at least one RUH; based on the low water level virtual blocks of valid data frames that meet the preset conditions, initiating garbage collection for at least one source virtual block using the flow control ratio.

[0069] As a possible implementation manner, the embodiments of the present application can first obtain the low water level virtual blocks of valid data frames that meet certain conditions in the RUH, and then initiate garbage collection for at least one source virtual block using the flow control ratio. Among them, the certain conditions can be set by those skilled in the art according to the actual situation, and the present application does not make specific limitations.

[0070] Exemplarily, in the garbage collection process of the embodiments of the present application, the recycling starts from the one with the smallest number of valid data frames in the current RUH. After each source virtual block is recycled, the one with the smallest number of valid data frames in the current RUH is found and recycled continuously until the garbage collection is completed.

[0071] In the embodiments of the present application, by screening the low water level virtual blocks of valid data frames that meet certain conditions as the recycling targets, the source virtual blocks that truly need garbage collection can be more accurately located, thereby reducing unnecessary recycling operations, improving the overall efficiency of garbage collection, and controlling the speed of garbage collection by controlling the flow control ratio to ensure that the SSD disk can still maintain stable performance output during garbage collection, and further extending the life of the SSD disk and enhancing the user experience.

[0072] Optionally, in an embodiment of the present application, before counting the second source quantity of the source virtual blocks in the low water level virtual block list of the valid data frame quantity corresponding to at least one RUH based on the low water level of the valid data frame quantity, the following steps are further included: checking the linked list of used virtual blocks in at least one RUH according to a preset polling rule, and determining whether the initial low water level virtual block list of the valid data frame quantity corresponding to at least one RUH meets a preset condition; if the initial low water level virtual block list of the valid data frame quantity does not meet the preset condition, updating the initial low water level virtual block list of the valid data frame quantity based on the valid data frame quantity of the used virtual blocks in the linked list of used virtual blocks until the initial low water level virtual block list of the valid data frame quantity meets the preset condition, and obtaining the low water level virtual block list of the valid data frame quantity based on the updated initial low water level virtual block list of the valid data frame quantity; if the initial low water level virtual block list of the valid data frame quantity meets the preset condition, obtaining the low water level virtual block list of the valid data frame quantity based on the initial low water level virtual block list of the valid data frame quantity.

[0073] It can be understood that the low water level virtual block list of the valid data frame quantity in the embodiment of the present application can be understood as applying an array space for each RUH to record the serial numbers of the low water level virtual blocks of the valid data frame quantity in the current RUH that meet at most 10 (the list size can be specifically set by those skilled in the art according to the actual situation, and the present application does not make specific limitations), and then the low water level virtual block list of the valid data frame quantity that meets certain conditions can be obtained. The maximum quantity can be adjusted according to the total number of RUs in each RG, and the present application does not make specific limitations.

[0074] Those skilled in the art understand that the embodiment of the present application can check the linked list of used virtual blocks in the RUH according to a certain polling rule, and determine whether the initial low water level virtual block list of the valid data frame quantity meets certain conditions.

[0075] Further, in some embodiments, when the initial low water level virtual block list of the valid data frame quantity in the embodiment of the present application does not meet certain conditions, the initial low water level virtual block list of the valid data frame quantity is updated based on the valid data frame quantity of the used virtual blocks in the linked list of used virtual blocks until the preset conditions are met, and then the low water level virtual block list of the valid data frame quantity is obtained.

[0076] In some embodiments, when the initial low water level virtual block list of the valid data frame quantity in the embodiment of the present application meets certain conditions, the low water level virtual block list of the valid data frame quantity is obtained based on the initial low water level virtual block list of the valid data frame quantity.

[0077] Exemplarily, the process of inserting the low water level virtual block list of the valid data frame quantity in the embodiment of the present application is as Figure 4 shown, and its main content is:

[0078] Step S401: Determine whether the linked list is empty. If it is not empty, execute Step S402; otherwise, execute Step S413.

[0079] Step S402: Select a virtual block.

[0080] Step S403: Set m to the last position of the low-water mark virtual block list for the number of valid data frames.

[0081] Step S404: Determine whether the current virtual block is smaller than the value of list m. If it is smaller, execute Step S405; otherwise, execute Step S406.

[0082] Step S405: Determine whether m == 0. If it is equal, execute Step S408; otherwise, execute Step S407.

[0083] Step S406: Determine whether (m + 1) <= the size of the block list - 1. If it is less than or equal, execute Step S407; otherwise, execute Step S409.

[0084] Step S407: m - 1.

[0085] Step S408: Update the m-th position to the current virtual block.

[0086] Step S409: Select the next in the linked list.

[0087] Step S410: Shift the virtual blocks after m.

[0088] Step S411: Determine whether m == the size of the block list - 1. If it is equal, execute Step S410; otherwise, execute Step S409.

[0089] Step S412: Determine whether the head of the list is reached. If the head of the list is reached, execute Step S413; otherwise, execute Step S403.

[0090] Step S413: End.

[0091] In summary, in the embodiment of the present application, the used virtual block linked list of the current RUH is used for polling check. If the list position in this RUH is not filled yet, the virtual block with a low water level of the valid data frame quantity is inserted into this list, and these virtual blocks are inserted and sorted according to the size of the valid data frame quantity. If 10 list positions are filled, compare with the virtual block with the largest valid data frame quantity among these 10 list positions. If the current virtual block is smaller than the virtual block filled in the list, then compare with the virtual block with a smaller valid data frame quantity in the list until the requirement of this virtual block is found, and the virtual block with a larger valid data frame quantity is squeezed out. Finally, several virtual blocks with the lowest low water level of the valid data frame quantity in each RUH are selected, and then a list of virtual blocks with a low water level of the valid data frame quantity is obtained.

[0092] In the embodiment of the present application, the used virtual block linked list is regularly checked according to a certain polling rule to ensure that the data in the initial list of virtual blocks with a low water level of the valid data frame quantity is up-to-date and accurate, avoiding mistakes in garbage collection decisions caused by outdated or incorrect data. In addition, the garbage collection strategy can be optimized to improve the utilization rate of storage resources.

[0093] In step S103, if the first source quantity is less than or equal to the preset quantity, the second source quantity of the source virtual blocks in the list of virtual blocks with a low water level of the valid data frame quantity corresponding to at least one RUH is counted based on the virtual blocks with a low water level of the valid data frame quantity. When the second source quantity is greater than the second destination quantity of the destination virtual block, garbage collection is initiated for at least one source virtual block using the flow control ratio until the second destination quantity meets the second preset destination recovery condition, and / or at least one source virtual block meets the preset source recovery condition, so as to obtain the second garbage collection result of the SSD disk.

[0094] In some embodiments, when the first source quantity is less than or equal to a certain quantity, in the embodiment of the present application, the second source quantity of the source virtual blocks corresponding to the virtual blocks with a low water level of the valid data frame quantity can be counted, and when the second source quantity is greater than the second destination quantity of the destination virtual block, garbage collection is initiated for at least one source virtual block using the flow control ratio until any one of the following conditions is met, the garbage collection of the current RUH is stopped, and the next RUH is started to switch, so as to obtain the second garbage collection result of the SSD disk.

[0095] Condition 1: The second destination quantity meets the second certain destination recovery condition, where the second certain destination recovery condition can be set by those skilled in the art according to the actual situation, and the present application does not make specific limitations.

[0096] It can be understood that in the embodiment of the present application, when the destination virtual block is full, the number of destination virtual blocks is reduced by one, and it is judged whether the number of destination virtual blocks is 0. When it is 0, a switch is made until the garbage collection of all RUH is completed, and then the second garbage collection result is obtained.

[0097] Condition 2: At least one source virtual block satisfies certain source recycling conditions, where the certain source recycling conditions can be set by those skilled in the art according to the actual situation, and the present application does not make specific limitations.

[0098] It can be understood that in each embodiment of the present application, after the current source virtual block is written, it is possible to re-determine whether there is still a virtual block with a low water level of the effective data frame number in the current RUH. If not, a switch is made.

[0099] Exemplarily, when the number of the first sources is less than 15 in the embodiments of the present application, it is determined whether the second source number of the source virtual block is greater than the second destination number of the destination virtual block, and in the case where the second source number is greater than the second destination number, garbage collection is initiated for the current RUH. The judgment algorithm is as Figure 5 , and the main content is:

[0100] Step S501: Turn on the FDP and the number of free virtual blocks satisfies certain garbage collection water level conditions.

[0101] Step S502: Set the current RUH to 0.

[0102] Step S503: Accumulate the number of effective data frames in the list and calculate the destination virtual block.

[0103] Step S504: Determine whether the number of destination virtual blocks < the number of source virtual blocks. If less, execute Step S505; otherwise, execute Step S510.

[0104] Step S505: Recycle the virtual block with the lowest number of effective data frames in the RUH.

[0105] Step S506: Determine whether the destination virtual block is full. If full, execute Step S507; otherwise, execute Step S509.

[0106] Step S507: Determine whether the free virtual blocks are promoted to the garbage collection stop water level. If reached, execute Step S501; otherwise, execute Step S508.

[0107] Step S508: Determine whether the destination virtual blocks in the current RUH are exhausted. If exhausted, execute Step S510; otherwise, execute Step S503.

[0108] Step S509: Determine whether there are still virtual blocks in the list. If there are, execute Step S505; otherwise, execute Step S510.

[0109] Step S510: Switch to the next RUH.

[0110] In summary, in the embodiment of the present application, the second source quantity of the source virtual blocks in the low-water virtual block list of the current valid data frame quantity is counted, the valid data frame numbers of these source virtual blocks are accumulated, the total valid data frame number is calculated, and then the total valid data frame number is divided by the number of data frames of a single virtual block to obtain the second destination quantity of the destination virtual block. If the second source quantity is greater than the second destination quantity, garbage collection can be initiated (to prevent waste, the excess that cannot fill a destination virtual block is not recycled continuously, and the result is rounded down), and its calculation formula can be but is not limited to:

[0111] The number of destination virtual blocks = sum (the valid data frame numbers of the source virtual blocks) / the number of data frames of a single virtual block,

[0112] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases, the former is a better implementation method.

[0113] The embodiment of the present application also provides a garbage collection device applicable to FDP.

[0114] Figure 6 It is a block diagram of a garbage collection device applicable to FDP provided according to the embodiment of the present application.

[0115] As Figure 6 shown, the garbage collection device 10 applicable to FDP includes: a first judgment module 100, a first generation module 200, and a second generation module 300.

[0116] Among them, the first judgment module 100 is configured to, when FDP is enabled and the number of free virtual blocks in the SSD disk meets the preset garbage collection water level condition, based on at least one RUH linked list in the SSD disk, alternately judge whether the first source quantity of the source virtual blocks corresponding to at least one low-water virtual block of the valid data frame quantity in at least one RUH linked list is greater than a preset quantity.

[0117] The first generation module 200 is configured to, when the first source quantity is greater than the preset quantity, based on the low-water virtual block of the valid data frame quantity, initiate garbage collection on at least one source virtual block in at least one RUH by using a flow control ratio until the first destination quantity of the destination virtual block meets the first preset destination recycling condition to obtain the first garbage collection result of the SSD disk.

[0118] A second generation module 300, configured to, when the first source quantity is less than or equal to a preset quantity, based on the low water level virtual blocks of the valid data frame quantity of at least one RUH, count the second source quantity of the source virtual blocks in the low water level virtual block list of the valid data frame quantity corresponding to at least one RUH, and when the second source quantity is greater than the second destination quantity of the destination virtual block, initiate garbage collection on at least one source virtual block by using a flow control ratio until the second destination quantity meets a second preset destination recovery condition, and / or at least one source virtual block meets a preset source recovery condition, so as to obtain a second garbage collection result of the SSD disk.

[0119] Optionally, in an embodiment of the present application, it further includes: a first calculation module, a second calculation module, a third calculation module, an acquisition module, and a construction module.

[0120] Wherein, the first calculation module is configured to calculate the total data frame of the used virtual blocks according to the quantity of the used virtual blocks in the SSD disk and the data frame quantity corresponding to the used virtual blocks before successively determining whether the first source quantity of the source virtual blocks corresponding to at least one low water level virtual block of the valid data frame quantity in at least one RUH linked list is greater than a preset quantity based on at least one RUH linked list in the SSD disk.

[0121] The second calculation module is configured to calculate the total valid data frame of the used virtual blocks according to the written data volume in the SSD disk.

[0122] The third calculation module is configured to calculate the average occupancy rate of the valid data frames of the used virtual blocks based on the total data frame and the total valid data frame.

[0123] The acquisition module is configured to acquire the low water level virtual blocks of the valid data frame quantity based on the average occupancy rate of the valid data frames and the used virtual blocks.

[0124] The construction module is configured to construct a used virtual block linked list corresponding to the used virtual blocks based on the low water level virtual blocks of the valid data frame quantity.

[0125] Optionally, in an embodiment of the present application, it further includes: a third generation module.

[0126] Wherein, the third generation module is configured to generate at least one RUH linked list corresponding to at least one virtual block based on at least one virtual block in the SSD disk and the average occupancy rate of the valid data frames before successively determining whether the first source quantity of the source virtual blocks corresponding to at least one low water level virtual block of the valid data frame quantity in at least one RUH linked list is greater than a preset quantity based on at least one RUH linked list in the SSD disk.

[0127] Optionally, in an embodiment of the present application, it further includes: a second judgment module, an update module, and a fourth generation module.

[0128] Among them, the second judgment module is used to check the linked list of used virtual blocks in at least one RUH according to a preset polling rule and judge whether the initial low-water virtual block list corresponding to at least one RUH meets the preset conditions before counting the second source quantity of the source virtual blocks in the low-water virtual block list corresponding to the effective data frame quantity of at least one RUH based on the low-water virtual block of the effective data frame quantity.

[0129] The update module is used to update the initial low-water virtual block list corresponding to the effective data frame quantity based on the effective data frame quantity of the used virtual blocks in the linked list of used virtual blocks until the initial low-water virtual block list corresponding to the effective data frame quantity meets the preset conditions, and obtain the low-water virtual block list corresponding to the effective data frame quantity based on the updated initial low-water virtual block list corresponding to the effective data frame quantity when the initial low-water virtual block list corresponding to the effective data frame quantity does not meet the preset conditions.

[0130] The fourth generation module is used to obtain the low-water virtual block list corresponding to the effective data frame quantity based on the initial low-water virtual block list corresponding to the effective data frame quantity when the initial low-water virtual block list corresponding to the effective data frame quantity meets the preset conditions.

[0131] Optionally, in an embodiment of the present application, it further includes: a fourth calculation module, a fifth calculation module, and a fifth generation module.

[0132] Among them, the fourth calculation module is used to calculate the third source quantity of the source virtual blocks and the third destination quantity of the destination virtual blocks during garbage collection based on the low-water virtual block of the effective data frame quantity before initiating garbage collection on at least one source virtual block using the flow control ratio.

[0133] The fifth calculation module is used to calculate the initial flow control ratio for garbage collection of at least one RUH based on the third source quantity and the third destination quantity.

[0134] The fifth generation module is used to recalculate the initial flow control ratio using the actual garbage collection write occupancy ratio based on the sum of the written data of the destination virtual blocks and the actual effective data frame quantity of the source virtual blocks to obtain the flow control ratio.

[0135] Optionally, in an embodiment of the present application, the fifth calculation module includes: a first judgment unit, a first calculation unit, a second judgment unit, a second calculation unit, a third judgment unit, and a third calculation unit.

[0136] Among them, the first judgment unit is used to judge whether the quantity of idle virtual blocks is within the first condition interval in the preset garbage collection water level line conditions.

[0137] A first calculation unit, configured to recalculate an initial flow control ratio based on write data, the total sum of actual valid data frames, and the actual garbage collection write ratio using a first calculation condition when the number of idle virtual blocks is within a first condition range.

[0138] A second determination unit, configured to determine whether the number of idle virtual blocks is within a second condition range in a preset garbage collection water level condition when the number of idle virtual blocks is not within the first condition range.

[0139] A second calculation unit, configured to recalculate an initial flow control ratio based on write data, the total sum of actual valid data frames, and the actual garbage collection write ratio using a second calculation condition when the number of idle virtual blocks is within the second condition range.

[0140] A third determination unit, configured to determine whether the number of idle virtual blocks is within a third condition range in a preset garbage collection water level condition when the number of idle virtual blocks is not within the second condition range.

[0141] A third calculation unit, configured to recalculate an initial flow control ratio based on write data, the total sum of actual valid data frames, and the actual garbage collection write ratio using a third calculation condition when the number of idle virtual blocks is within the third condition range, where the first condition range, the second condition range, and the third condition range are mutually exclusive, and their union is the preset garbage collection water level condition.

[0142] Optionally, in an embodiment of the present application, the first generation module 200 includes: an acquisition unit and a triggering unit.

[0143] Wherein, the acquisition unit is configured to acquire low water level virtual blocks of valid data frames that meet preset conditions in at least one RUH.

[0144] The triggering unit is configured to trigger garbage collection on at least one source virtual block using a flow control ratio based on the low water level virtual blocks of valid data frames that meet the preset conditions.

[0145] For the description of the features in the corresponding embodiments of the garbage collection device applicable to FDP, reference can be made to the relevant descriptions in the corresponding embodiments of the garbage collection method applicable to FDP, which will not be elaborated here one by one.

[0146] An embodiment of the present application further provides an electronic device, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any of the above embodiments of the garbage collection method applicable to FDP.

[0147] Embodiments of the present application also provide a computer-readable storage medium storing a computer program, where the computer program is configured to execute the steps in any of the above embodiments of the garbage collection method applicable to FDP when running.

[0148] In an exemplary embodiment, the above computer-readable storage medium may include but is not limited to: various media such as USB flash drives, read-only memories (ROMs), random access memories (RAMs), external hard drives, magnetic disks, or optical discs that can store computer programs.

[0149] Embodiments of the present application also provide a computer program product. The above computer program product includes a computer program, and when the computer program is executed by a processor, it implements the steps in any of the above embodiments of the garbage collection method applicable to FDP.

[0150] Embodiments of the present application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, it implements the steps in any of the above embodiments of the garbage collection method applicable to FDP.

[0151] Those skilled in the art can further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the components and steps of each example have been generally described according to their functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Skilled professionals can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.

[0152] The above has introduced in detail a garbage collection method applicable to FDP provided by the present application. Specific examples are used herein to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the protection scope of the claims of the present application.

Claims

1. A garbage collection method suitable for FDP, characterized in that: The following steps are involved: When flexible data placement FDP is enabled and the number of free virtual blocks in the solid state drive SSD disk meets the preset garbage collection waterline condition, based on at least one recycling unit handle RUH linked list in the SSD disk, it is determined in turn whether the first source number of the source virtual block corresponding to at least one virtual block with a low watermark of the number of valid data frames in the at least one RUH linked list is greater than the preset number; If the first source quantity is greater than the preset quantity, based on the low watermark virtual block of the valid data frame quantity, garbage collection is initiated for at least one source virtual block in at least one RUH using a flow control ratio until a first destination quantity of the destination virtual block meets a first preset destination collection condition, so as to obtain a first garbage collection result of the SSD disk; If the first source quantity is less than or equal to the preset quantity, then based on the low-water mark virtual block statistics of the valid data frame quantity, a second source quantity of the source virtual blocks in the low-water mark virtual block list of the valid data frame quantity corresponding to the at least one RUH is counted, and when the second source quantity is greater than the second destination quantity of the destination virtual block, garbage collection is initiated for the at least one source virtual block using the flow control ratio until the second destination quantity meets the second preset destination recovery condition, and / or the at least one source virtual block meets the preset source recovery condition, so as to obtain a second garbage collection result of the SSD disk.

2. The method according to claim 1, characterized in that: Before determining in turn whether the first source quantity of the source virtual block corresponding to the low watermark virtual block of at least one valid data frame quantity in the at least one RUH linked list is greater than a preset quantity based on the at least one RUH linked list in the SSD disk, the method further includes: Calculate the sum of the data frames of the used virtual blocks according to the number of used virtual blocks in the SSD disk and the number of data frames corresponding to the used virtual blocks; Calculate the total number of valid data frames of the used virtual blocks according to the amount of data written in the SSD disk; Calculating an average occupancy rate of valid data frames of the used virtual blocks based on the data frame sum and the valid data frame sum; Based on the average occupancy rate of the valid data frames and the used virtual blocks, obtaining the virtual blocks with low watermark of the number of valid data frames; Based on the low-water mark virtual block of the valid data frame quantity, a used virtual block linked list corresponding to the used virtual block is constructed.

3. The method according to claim 2, characterized in that Before determining in turn whether the first source quantity of the source virtual block corresponding to the low watermark virtual block of at least one valid data frame quantity in the at least one RUH linked list is greater than a preset quantity based on the at least one RUH linked list in the SSD disk, the method further includes: Based on at least one virtual block in the SSD disk and the average occupancy rate of the valid data frame, a RUH linked list corresponding to the at least one virtual block is generated.

4. The method according to claim 2, characterized in that: Before counting the second source number of the source virtual blocks in the virtual block list with low water mark of the number of valid data frames corresponding to the at least one RUH based on the virtual block with low water mark of the number of valid data frames, the method further includes: Checking the used virtual block linked list in the at least one RUH according to a preset polling rule, and determining whether the low-watermark virtual block list corresponding to the initial valid data frame quantity of the at least one RUH meets a preset condition; If the initial valid data frame number low water level virtual block list does not meet the preset condition, then updating the initial valid data frame number low water level virtual block list based on the number of valid data frames of used virtual blocks in the used virtual block linked list until the initial valid data frame number low water level virtual block list meets the preset condition, and obtaining the valid data frame number low water level virtual block list based on the updated initial valid data frame number low water level virtual block list; If the initial valid data frame quantity low water mark virtual block list meets the preset condition, the valid data frame quantity low water mark virtual block list is obtained based on the initial valid data frame quantity low water mark virtual block list.

5. The method according to claim 1, characterized in that Before initiating garbage collection on the at least one source virtual block using the flow control ratio, the method further includes: Based on the virtual block with a low water mark of the number of valid data frames, calculating a third source number of the source virtual block and a third destination number of the destination virtual block when performing garbage collection; Calculating an initial flow control ratio of the at least one RUH for garbage collection based on the third source quantity and the third destination quantity; Based on the write data of the destination virtual block and the sum of the actual valid data frames of the source virtual block, the initial flow control ratio is recalculated using the actual garbage collection write ratio to obtain the flow control ratio.

6. The method according to claim 5, characterized in that The recalculating the initial flow control ratio based on the written data of the destination virtual block and the sum of the actual valid data frames of the source virtual block and using the actual garbage collection write ratio includes: Determine whether the number of free virtual blocks is within a first condition interval of the preset garbage collection waterline condition; If the number of free virtual blocks is within the first condition interval, recalculating the initial flow control ratio using the first calculation condition based on the write data, the actual total number of valid data frames, and the actual garbage collection write ratio; If the number of free virtual blocks is not within the first condition interval, determining whether the number of free virtual blocks is within a second condition interval of the preset garbage collection waterline condition; If the number of free virtual blocks is within the second condition interval, recalculating the initial flow control ratio using a second calculation condition based on the write data, the actual total number of valid data frames, and the actual garbage collection write ratio; If the number of free virtual blocks is not within the second condition interval, determining whether the number of free virtual blocks is within a third condition interval in the preset garbage collection waterline condition; If the number of free virtual blocks is within the third conditional interval, the initial flow control ratio is recalculated using the third calculation condition based on the write data, the actual total of valid data frames, and the actual garbage collection write ratio, wherein the first conditional interval, the second conditional interval, and the third conditional interval are mutually exclusive, and their union is the preset garbage collection waterline condition.

7. The method according to claim 1, characterized in that The initiating garbage collection on the at least one source virtual block by using the flow control ratio includes: Obtaining a low-watermark virtual block of the number of valid data frames that meets a preset condition in the at least one RUH; Based on the preset condition of the low-water mark virtual block of the number of valid data frames, garbage collection is initiated on the at least one source virtual block using the flow control ratio.

8. A garbage collection device suitable for FDP, characterized in that: include: A first judgment module is used to judge in turn whether the first source quantity of the source virtual block corresponding to at least one virtual block with a low water mark of the number of valid data frames in the at least one RUH chain list is greater than the preset quantity, based on at least one RUH chain list in the SSD disk, when the FDP is turned on and the number of free virtual blocks in the SSD disk meets the preset garbage collection water mark condition; A first generating module is used to initiate garbage collection on at least one source virtual block in at least one RUH by using a flow control ratio based on the low watermark virtual block of the valid data frame quantity when the first source quantity is greater than the preset quantity, until a first destination quantity of the destination virtual block meets a first preset destination recycling condition, so as to obtain a first garbage collection result of the SSD disk; A second generation module is used to count the second source quantity of the source virtual blocks in the list of low water mark virtual blocks of the number of valid data frames corresponding to the at least one RUH based on the low water mark virtual block of the number of valid data frames when the first source quantity is less than or equal to the preset quantity, and to initiate garbage collection for the at least one source virtual block by using the flow control ratio when the second source quantity is greater than the second destination quantity of the destination virtual block until the second destination quantity meets the second preset destination collection condition, and / or the at least one source virtual block meets the preset source collection condition, so as to obtain a second garbage collection result of the SSD disk.

9. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the garbage collection method applicable to FDP as described in any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: The program is executed by a processor to implement the garbage collection method applicable to FDP as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Memory system and method for operating the same

    CN110716879A

  • Adjustment method for free physical block water line and storage device

    CN116974481A

  • Solid state disk garbage collection method, device and equipment and readable storage medium

    CN119046178A

  • Managing trim operations in a flash memory system

    US20130275660A1

  • Memory space management

    US20180032440A1

Cited By

  • Solid state disk wear leveling method and device, electronic equipment and storage medium

    CN120723168A

  • Scheduling method and device of NVMe solid state disk, data processor and equipment

    CN121070287A