SSD garbage collection acceleration method and device, computer equipment and storage medium

By copying the summary page to RAM in the SSD and judging the data validity, the problem of low garbage collection efficiency in SSDs without DRAM is solved, and more efficient data handling and performance optimization is achieved.

CN119292534APending Publication Date: 2025-01-10SHENZHEN YILIAN INFORMATION SYST CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411417251.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-11
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

In SSDs without DRAM, the GC is inefficient because the location of valid data cannot be confirmed during the garbage collection process, and the summary page needs to be read from NAND, resulting in an increase in waiting time.

Method used

By copying part of the summary page of the data block to be transferred to RAM, and determining whether the data is valid based on the physical address of the summary page. If it is valid, it will be transported to avoid reading all summary pages from NAND during the GC process, reducing waiting time.

Benefits of technology

It improves the efficiency of garbage collection, reduces the waiting time, reduces the number of reads to NAND, and optimizes the performance of SSD.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119292534A_ABST
    Figure CN119292534A_ABST
Patent Text Reader

Abstract

The invention relates to an SSD garbage collection acceleration method and device, computer equipment and a storage medium, and the method comprises the following steps: receiving a GC command, and determining a to-be-carried data block based on the GC command; copying a part of the abstract page of the data block to be carried into an RAM (Random Access Memory); based on the first physical address of the abstract page, judging whether the moved data in the to-be-moved data block is valid data or not; and if the moving data in the to-be-carried data block is valid data, carrying the to-be-carried data block to a new physical block. According to the method, part of abstract page data is copied into the RAM, so that the occupation of the RAM when the SSD performs GC is reduced, and meanwhile, whether the moved data in the to-be-moved data block is valid data or not is judged based on the first physical addresses of the abstract pages. And if the data is valid data, the to-be-carried data block is carried to the new physical block, so that all abstract pages are prevented from being read from the NAND in the GC process, the waiting time is reduced, and the GC efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of solid-state storage devices, and in particular to an SSD garbage collection acceleration method, device, computer equipment and storage medium. Background Art

[0002] As a new type of storage medium, SSD (Solid State Drive) uses NAND particles as data storage and has been widely used in mainstream application products in various fields such as PCs, notebooks, and servers. In order to improve the performance of GC (Garbage collection) in SSD, the LPA (Logical Page Address) of several data pages is written into a summary page. When performing GC, you only need to read the summary page to obtain the LPA of all data pages in the summary page and confirm the location of all valid data pages in the summary area, so as to reduce the time spent on reading invalid data during the GC process. For SSDs without DRAM, the RAM space cannot accommodate all the summary page data of the data blocks to be moved during the GC process. It is necessary to read the summary page corresponding to the current move position from NAND during the GC process. When waiting to read the summary page from NAND, the move process will be blocked because the location of the valid data cannot be confirmed, resulting in low GC efficiency of the SSD. Summary of the invention

[0003] The purpose of the present invention is to overcome the deficiencies of the prior art and provide an SSD garbage collection acceleration method, device, computer equipment and storage medium.

[0004] In order to solve the above technical problems, the present invention adopts the following technical solutions:

[0005] The present invention is achieved through the following technical solutions:

[0006] In a first aspect, this embodiment provides a method for accelerating SSD garbage collection, including the following steps:

[0007] Accepting a GC command, and determining a data block to be transferred based on the GC command;

[0008] Copying part of the summary page of the data block to be transferred into RAM;

[0009] Based on the first physical address of the summary page, determining whether the moved data in the to-be-moved data block is valid data;

[0010] If the moved data in the data block to be moved is valid data, the data block to be moved is moved to a new physical block.

[0011] Furthermore, the step of copying a partial summary of the data block to be transferred into the RAM includes:

[0012] Determine the second physical addresses of all summary pages in the data block to be moved;

[0013] reading all of the second physical addresses into the HMB to construct a plurality of summary areas;

[0014] Traversing all the summary areas to obtain target summary page data;

[0015] The target summary page data is copied from the HMB to the RAM based on DMA.

[0016] Further, the step of reading the second physical address into the HMB to construct a plurality of summary areas includes:

[0017] Calculating the total space size required to store the second physical address, that is, the first storage space;

[0018] Determining whether the available storage space in the HMB is equal to the first storage space;

[0019] If the storage space is equal to the first storage space, allocating a second storage space for the second physical address in the available storage space based on a preset allocation strategy;

[0020] A plurality of the summary areas are constructed in the second storage space based on the continuity of the second physical addresses.

[0021] Further, the step of allocating the second storage space for all the second physical addresses in the available storage space based on a preset allocation strategy includes:

[0022] determining a range of all second physical addresses;

[0023] Based on the preset allocation strategy, calculating the third storage space required for each of the second physical addresses;

[0024] Based on the range of all the second physical addresses and the third storage space, a second storage space is allocated in the available space for each of the second physical addresses.

[0025] Furthermore, the step of traversing the plurality of summary areas to obtain target summary page data includes:

[0026] Reading a third physical address of the summary area currently traversed;

[0027] reading initial summary page data based on the third physical address;

[0028] Determining the integrity of the initial summary page data;

[0029] If so, the target summary page data is generated.

[0030] Furthermore, the step of judging the integrity of the initial summary page data includes:

[0031] Calculating the initial summary page data to obtain an initial check value;

[0032] Determining whether the initial check value is equal to the target check value;

[0033] If the initial check value is equal to the target check value, the initial summary page data passes the verification.

[0034] Furthermore, the step of judging whether the moved data in the to-be-moved data block is valid data based on the first physical address of the summary page includes:

[0035] Querying a mapping table based on the first physical address to obtain a fourth physical address;

[0036] Determining whether the first physical address is equal to a fourth physical address;

[0037] If the first physical address is equal to the fourth physical address, the moved data is determined to be valid data.

[0038] In a second aspect, this embodiment provides an SSD garbage collection acceleration device, including: an acquisition unit, a transport unit, a judgment unit, and an execution unit;

[0039] The acquisition unit is used to receive a GC command and determine the data block to be transferred based on the GC command;

[0040] The transport unit is used to copy part of the summary pages of the data block to be transported into the RAM;

[0041] The judging unit is used to judge whether the moved data in the to-be-moved data block is valid data based on the first physical address of the summary page;

[0042] The execution unit is used to move the data block to be moved to a new physical block.

[0043] In a third aspect, this embodiment provides a computer device, which includes a memory and a processor, wherein a computer program is stored on the processor, and when the processor executes the computer program, the SSD garbage collection acceleration method as described in any one of claims 1-7 is implemented.

[0044] In a fourth aspect, this embodiment provides a storage medium, wherein the storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the SSD garbage collection acceleration method as described in any one of claims 1-7 can be implemented.

[0045] Compared with the prior art, the present invention has the following advantages: by copying part of the summary page data to the RAM, the RAM occupation during the GC of the SSD is reduced, and at the same time, based on the first physical address of these summary pages, it is determined whether the moved data in the data block to be moved is valid data. If it is valid data, the data block to be moved is moved to a new physical block, avoiding reading all summary pages from the NAND during the GC process, thereby reducing the waiting time and improving the efficiency of GC.

[0046] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the following preferred embodiments are specifically cited and described in detail as follows. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 A schematic diagram of a flow chart of an SSD garbage collection acceleration method provided by an embodiment of the present invention;

[0048] Figure 2 A schematic diagram of a flow chart of executing step S2 in the SSD garbage collection acceleration method provided by an embodiment of the present invention;

[0049] Figure 3 A schematic diagram of a flow chart of executing step S22 in the SSD garbage collection acceleration method provided by an embodiment of the present invention;

[0050] Figure 4 A schematic diagram of a flow chart of executing step S223 in the SSD garbage collection acceleration method provided by an embodiment of the present invention;

[0051] Figure 5 A schematic diagram of a flow chart of executing step S23 in the SSD garbage collection acceleration method provided by an embodiment of the present invention;

[0052] Figure 6 A schematic diagram of a flow chart of executing step S233 in the SSD garbage collection acceleration method provided by an embodiment of the present invention;

[0053] Figure 7 A schematic diagram of a flow chart of executing step S3 in the SSD garbage collection acceleration method provided by an embodiment of the present invention;

[0054] Figure 8 A schematic block diagram of an SSD garbage collection acceleration device provided by an embodiment of the present invention;

[0055] Fig. 9 A schematic block diagram of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0056] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions 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.

[0057] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.

[0058] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0059] It should be further understood that the term "and / or" used in the present description and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0060] See also Figure 1 In the specific embodiment shown, the present invention discloses a method for accelerating SSD garbage collection, comprising the following steps:

[0061] Step S1, accepting a GC command, and determining a data block to be transferred based on the GC command;

[0062] Specifically, when the SSD performs garbage collection, it will first receive a GC command. Based on this command, the SSD will begin to analyze the usage, data validity, wear degree, and other information of each flash block. Based on the analysis results, the SSD will select flash blocks that contain a large amount of invalid data (that is, data that has been deleted or overwritten) as the data blocks to be moved. When there are many data blocks to be moved, the SSD will prioritize the data blocks to be moved based on factors such as the invalidity, fragmentation, or write amplification of the data blocks. Before moving the data blocks, the SSD will record relevant information such as the moving plan, the location of the target data blocks, and the order of moving.

[0063] Through the above steps, the data blocks to be processed can be accurately selected, the garbage collection process can be optimized, and the efficiency of garbage collection in the SSD can be improved.

[0064] Step S2, copying part of the summary page of the data block to be transferred into RAM;

[0065] It should be noted that the summary page (also called metadata page, mapping table or index page) is a special page in the SSD used to represent the status (such as valid, invalid, deleted, etc.) and location information of each data page in the storage data block. The SSD can quickly access and manage the data in the data block through the summary page to achieve fast mapping and access of data.

[0066] Specifically, the SSD reads the selected summary pages from the flash memory and copies them to the RAM. In the RAM, the SSD determines which data pages are valid through the summary pages and plans the transfer path. The SSD transfers the valid data pages to the new flash memory blocks and updates the relevant mapping information. After completing the data transfer, the original data blocks are marked.

[0067] Through the above steps, the summary page is copied to RAM, the number of flash memory reads is reduced and the data processing process is optimized, thereby improving the GC performance of the SSD and reducing flash memory wear.

[0068] Step S3, based on the first physical address of the summary page, determining whether the moved data in the to-be-moved data block is valid data;

[0069] It should be noted that the summary page usually contains the validity flag of the data stored in the SSD and the mapping relationship between the logical address and the physical address of the data. With this information, the SSD can quickly determine which data pages are valid and which are invalid, so as to relocate the valid data pages to a new physical location.

[0070] Specifically, the first physical address of each page in the data block is found through the information in the summary page, and the validity flag or other identifier in the summary page is compared with the physical address range of the data block to be moved to quickly identify the status of each data page in the data block. For pages marked as valid data, they are marked and prepared to be moved to the new physical block. For invalid data, no processing is done.

[0071] Through the above steps, it is determined whether the moved data in the data block to be moved is valid data based on the first physical address of the summary page, thereby reducing unnecessary write operations, thereby reducing write amplification, optimizing the garbage collection mechanism, and improving the overall performance and service life of the SSD.

[0072] Step S4: if the data to be moved in the data block to be moved is valid data, the data block to be moved is moved to a new physical block.

[0073] Specifically, a new physical block is allocated from the free space in the SSD to store the valid data to be moved. The valid data pages in the data block to be moved are moved one by one to the newly allocated physical block. During the moving process, the data is decompressed, decrypted, and processed; after the moving is completed, the SSD mapping table is updated, the physical address of the original data page is updated to the new address, and the original data page is marked as invalid or erasable.

[0074] Through the above steps, the GC process is optimized, unnecessary erase and rewrite operations are reduced, thereby reducing the write amplification factor and improving the GC efficiency of the SSD.

[0075] Through steps S1 to S4, part of the summary page data is copied to the RAM, which reduces the RAM occupation when the SSD performs GC. At the same time, based on the first physical address of these summary pages, it is determined whether the moved data in the data block to be moved is valid data. If it is valid data, the data block to be moved is moved to a new physical block, avoiding reading all summary pages from NAND during the GC process, thereby reducing waiting time and improving GC efficiency.

[0076] See also Figure 2 , the step of copying the partial summary of the data block to be transferred into the RAM comprises:

[0077] Step S21, determining the second physical addresses of all summary pages in the data block to be moved;

[0078] Step S22, reading all the second physical addresses into the HMB to construct a plurality of summary areas;

[0079] Step S23, traversing all the summary areas to obtain target summary page data;

[0080] Step S24, based on DMA, the target summary page data is copied from the HMB to the RAM. Through steps S21 to S24, based on the physical addresses of all summary pages of the data block to be transferred, the physical addresses of all summary pages are read into the HMB (Host Memory Buffer). Then, the SSD traverses these summary pages, finds the target summary page data, and uses DMA (Direct Memory Access) technology to copy these data from the HMB to the RAM, which speeds up the data transmission speed, reduces the transfer of invalid data, and improves the GC efficiency of the SSD.

[0081] In one embodiment, see Figure 3 , the step of reading the second physical address into the HMB to construct a plurality of summary areas comprises:

[0082] Step S221, calculating the total space size required to store the second physical address, that is, the first storage space;

[0083] Step S222, determining whether the available storage space in the HMB is equal to the first storage space;

[0084] Step S223, if the storage space is equal to the first storage space, allocating a second storage space for the second physical address in the available storage space based on a preset allocation strategy;

[0085] Step S224: construct a plurality of summary areas in the second storage space based on the continuity of the second physical address.

[0086] Through steps S221 to S224, pre-calculating the space and checking the availability of HMB can avoid space waste or overflow, improve the use efficiency of HMB, and constructing a summary area in HMB can speed up the access and processing speed of summary pages. The summary area is constructed based on the continuity of the second physical address, which speeds up the subsequent data access and processing speed, improves the GC efficiency of the SSD, and thus improves the read and write performance of the SSD.

[0087] In one embodiment, see Figure 4 The step of allocating the second storage space for all the second physical addresses in the available storage space based on a preset allocation strategy comprises:

[0088] Step S2231, determining the range of all second physical addresses;

[0089] Step S2232, calculating the third storage space required for each second physical address based on the preset allocation strategy;

[0090] Step S2233: Allocate a second storage space in the available space for each second physical address based on the range of all the second physical addresses and the third storage space.

[0091] Through step S2231 to step S2233, the storage space required for all second physical addresses is calculated and allocated in the HMB, thereby avoiding space waste and overflow, and speeding up the processing of summary page data, thereby improving the GC efficiency in the SSD. Appropriate storage space is allocated to each summary page, ensuring the integrity and accessibility of the data.

[0092] In one embodiment, see Figure 5The step of traversing the plurality of summary areas to obtain target summary page data includes:

[0093] Step S231, reading the third physical address of the summary area currently traversed;

[0094] Step S232, reading initial summary page data based on the third physical address;

[0095] Step S233, judging the integrity of the initial summary page data;

[0096] Step S234: If yes, generate the target summary page data.

[0097] Through steps S231 to S234, the summary area is traversed and target summary page data is generated, which speeds up garbage collection. The summary page data is verified to ensure that the summary page data read from the HMB is complete and reliable, thereby avoiding data corruption or loss.

[0098] In one embodiment, see Figure 6 The step of judging the integrity of the initial summary page data includes:

[0099] Step S2331, calculating the initial summary page data to obtain an initial check value;

[0100] Step S2332, determining whether the initial check value is equal to the target check value;

[0101] Step S2333: If the initial check value is equal to the target check value, the initial summary page data passes the verification.

[0102] Through steps S2331 to S233, the checksum is calculated and compared to verify the integrity of the initial summary page data, improve the reliability of the data, and ensure that only correct data is used for garbage collection, thereby improving the GC efficiency of the SSD.

[0103] In one embodiment, see Figure 7 The step of judging whether the moved data in the to-be-moved data block is valid data based on the first physical address of the summary page comprises:

[0104] Step S31, querying a mapping table based on the first physical address to obtain a fourth physical address;

[0105] Step S32, determining whether the first physical address is equal to a fourth physical address;

[0106] Step S33: if the first physical address is equal to the fourth physical address, then the moved data is determined to be valid data.

[0107] Through steps S31 to 33, it is possible to ensure that only valid data blocks are transferred, and invalid or erroneous data can be avoided from being transferred, thus saving time and storage resources, thereby improving the accuracy of data transfer, and reducing unnecessary data copying and deletion during garbage collection and data migration, optimizing the GC process of the SSD, and thus improving the GC efficiency of the SSD.

[0108] See also Figure 8 , the present invention also discloses an SSD garbage collection acceleration device, comprising: an acquisition unit 10, a transport unit 20, a judgment unit 30 and an execution unit 10;

[0109] The acquisition unit is used to receive a GC command and determine the data block to be transferred based on the GC command;

[0110] The transport unit is used to copy part of the summary pages of the data block to be transported into the RAM;

[0111] The judging unit is used to judge whether the moved data in the to-be-moved data block is valid data based on the first physical address of the summary page;

[0112] The execution unit is used to move the data block to be moved to a new physical block.

[0113] It should be noted that those skilled in the art can clearly understand that the specific implementation process of the above-mentioned SSD data protection device and each unit can refer to the corresponding description in the above-mentioned method embodiment, and for the convenience and simplicity of description, it will not be repeated here.

[0114] The above can be implemented in the form of a computer program, which can be used in Figure 7 Runs on the computer device shown.

[0115] See also Fig. 9 , Fig. 9 is a schematic block diagram of a computer device provided in an embodiment of the present application; the computer device 500 may be a terminal or a server, wherein the terminal may be an electronic device with communication functions such as a smart phone, a tablet computer, a laptop computer, a desktop computer, a personal digital assistant, and a wearable device. The server may be an independent server or a server cluster composed of multiple servers.

[0116] See also Fig. 9 The computer device 500 includes a processor 502 , a memory and a network interface 505 connected via a system bus 501 , wherein the memory may include a non-volatile storage medium 503 and an internal memory 504 .

[0117] The non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032. The computer program 5032 includes program instructions, which, when executed, can cause the processor 502 to execute the SSD data protection method: accepting a GC command, determining a data block to be moved based on the GC command; copying a portion of a summary page of the data block to be moved to a RAM; judging whether the moved data in the data block to be moved is valid data based on the first physical address of the summary page; and if the moved data in the data block to be moved is valid data, moving the data block to be moved to a new physical block.

[0118] The processor 502 is used to provide computing and control capabilities to support the operation of the entire computer device 500 .

[0119] The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute an SSD garbage collection acceleration method.

[0120] The network interface 505 is used to communicate with other devices over the network. Fig. 9 The structure shown in the figure is merely a block diagram of a portion of the structure related to the solution of the present application, and does not constitute a limitation on the computer device 500 to which the solution of the present application is applied. The specific computer device 500 may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0121] The processor 502 is used to run the computer program 5032 stored in the memory to implement the following steps:

[0122] Step S1, accepting a GC command, and determining a data block to be transferred based on the GC command;

[0123] Step S2, copying part of the summary page of the data block to be transferred into RAM;

[0124] Step S3, based on the first physical address of the summary page, determining whether the moved data in the to-be-moved data block is valid data;

[0125] Step S4: if the data to be moved in the data block to be moved is valid data, the data block to be moved is moved to a new physical block.

[0126] It should be understood that in the embodiment of the present application, the processor 502 may be a central processing unit (CPU), and the processor 502 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0127] It can be understood by those skilled in the art that all or part of the processes in the method for implementing the above embodiment can be completed by instructing the relevant hardware through a computer program. The computer program includes program instructions, and the computer program can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the embodiment of the above method.

[0128] Therefore, the present invention also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program, wherein the computer program includes program instructions, and the program instructions, when executed by a processor, can implement the above-mentioned SSD garbage collection acceleration method. The storage medium stores a computer program, wherein the computer program includes program instructions, and the program instructions, when executed by a processor, can implement the above-mentioned method. The program instructions include the following steps:

[0129] Step S1, accepting a GC command, and determining a data block to be transferred based on the GC command;

[0130] Step S2, copying part of the summary page of the data block to be transferred into RAM;

[0131] Step S3, based on the first physical address of the summary page, determining whether the moved data in the to-be-moved data block is valid data;

[0132] Step S4: if the data to be moved in the data block to be moved is valid data, the data block to be moved is moved to a new physical block.

[0133] The storage medium may be a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disk, etc., which are computer-readable storage media that can store program codes.

[0134] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0135] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of each unit is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.

[0136] The steps in the method of the embodiment of the present invention can be adjusted in order, combined and deleted according to actual needs. The units in the device of the embodiment of the present invention can be combined, divided and deleted according to actual needs. In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0137] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, terminal, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention.

[0138] The above embodiments are preferred implementation schemes of the present invention. In addition, the present invention may also be implemented in other ways. Any obvious replacement without departing from the concept of the present technical solution is within the protection scope of the present invention.

Claims

1. The SSD garbage collection acceleration method is characterized by: The following steps are involved: Accepting a GC command, and determining a data block to be transferred based on the GC command; Copying part of the summary page of the data block to be transferred into RAM; Based on the first physical address of the summary page, determining whether the moved data in the to-be-moved data block is valid data; If the moved data in the data block to be moved is valid data, the data block to be moved is moved to a new physical block.

2. The SSD garbage collection acceleration method according to claim 1, characterized in that: The step of copying the partial summary of the data block to be transferred into the RAM comprises: Determine the second physical addresses of all summary pages in the data block to be moved; reading all of the second physical addresses into the HMB to construct a plurality of summary areas; Traversing all the summary areas to obtain target summary page data; The target summary page data is copied from the HMB to the RAM based on DMA.

3. The SSD garbage collection acceleration method according to claim 2, characterized in that: The step of reading the second physical address into the HMB to construct a plurality of summary areas comprises: Calculating the total space size required to store the second physical address, that is, the first storage space; Determining whether the available storage space in the HMB is equal to the first storage space; If the storage space is equal to the first storage space, allocating a second storage space for the second physical address in the available storage space based on a preset allocation strategy; A plurality of the summary areas are constructed in the second storage space based on the continuity of the second physical addresses.

4. The SSD garbage collection acceleration method according to claim 3, characterized in that: The step of allocating the second storage space for all the second physical addresses in the available storage space based on a preset allocation strategy comprises: determining a range of all second physical addresses; Based on the preset allocation strategy, calculating the third storage space required for each of the second physical addresses; Based on the range of all the second physical addresses and the third storage space, a second storage space is allocated in the available space for each of the second physical addresses.

5. The SSD garbage collection acceleration method according to claim 2, characterized in that: The step of traversing the plurality of summary areas to obtain target summary page data comprises: Reading a third physical address of the summary area currently traversed; reading initial summary page data based on the third physical address; Determining the integrity of the initial summary page data; If so, the target summary page data is generated.

6. The SSD garbage collection acceleration method according to claim 5, characterized in that: The step of judging the integrity of the initial summary page data comprises: Calculating the initial summary page data to obtain an initial check value; Determining whether the initial check value is equal to the target check value; If the initial check value is equal to the target check value, the initial summary page data passes the verification.

7. The SSD garbage collection acceleration method according to claim 1, characterized in that: The step of judging whether the moved data in the to-be-moved data block is valid data based on the first physical address of the summary page comprises: Querying a mapping table based on the first physical address to obtain a fourth physical address; Determining whether the first physical address is equal to a fourth physical address; If the first physical address is equal to the fourth physical address, the moved data is determined to be valid data.

8. The SSD garbage collection acceleration device is characterized by: include: Acquisition unit, transport unit, judgment unit and execution unit; The acquisition unit is used to receive a GC command and determine the data block to be transferred based on the GC command; The transport unit is used to copy part of the summary pages of the data block to be transported into the RAM; The judging unit is used to judge whether the moved data in the to-be-moved data block is valid data based on the first physical address of the summary page; The execution unit is used to move the data block to be moved to a new physical block.

9. A computer device, characterized in that: The computer device includes a memory and a processor, a computer program is stored on the processor, and when the processor executes the computer program, the SSD garbage collection acceleration method according to any one of claims 1 to 7 is implemented.

10. A storage medium, characterized in that: The storage medium stores a computer program, which includes program instructions. When the program instructions are executed by a processor, the SSD garbage collection acceleration method according to any one of claims 1 to 7 can be implemented.

Citation Information

Cited By

  • Garbage collection test method and device, electronic equipment and storage medium

    CN120653205A