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

By optimizing the solid-state drive garbage collection algorithm, selecting the source super block and performing preset sub-tasks, the problem of low SSD garbage collection efficiency is solved, and the writing speed and user experience are improved.

CN119396742APending Publication Date: 2025-02-07MEMORIGHT (WUHAN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411270612.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-11
Publication Date
2025-02-07

AI Technical Summary

Technical Problem

The garbage collection efficiency of existing solid-state drives is low, resulting in slow write speed, large latency and poor user experience.

Method used

By selecting the source super block in solid-state drive garbage collection, performing preset sub-tasks to move valid data, and erasing the block when the source super block is invalid, the garbage collection algorithm process is optimized, step waiting is reduced, and CPU usage is improved.

Benefits of technology

Improves garbage collection efficiency, optimizes host write speed limit, reduces write delay, and improves the write speed and user experience of solid-state drives.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119396742A_ABST
    Figure CN119396742A_ABST
Patent Text Reader

Abstract

The invention discloses a solid state disk garbage collection acceleration method and device, equipment and a storage medium. The method comprises the following steps: selecting a source super block in solid state disk garbage collection; executing a preset subtask, and moving effective data in the source super block; when the source super block does not have the effective data, the source super block is erased, the process of a garbage collection algorithm can be optimized, waiting between steps can be reduced, it can be guaranteed that each flash memory die is in a working state as much as possible, the CPU utilization rate is increased, and therefore the garbage collection efficiency is improved, and in some delay-sensitive application scenes, the effective data of the source super block can be saved. The speed limit of host writing can be optimized, the writing delay is reduced, the speed and efficiency of solid state disk garbage collection acceleration are improved, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] A solid state drive (SSD) is a storage device that uses a NAND Flash array as a storage medium. The characteristics of NAND Flash include:

[0003] 1. Each storage block needs to be erased before writing;

[0004] 2. Each storage page within a block can only be written sequentially.

[0005] Therefore, when all blocks of the SSD are full, garbage collection is required to move valid data on some blocks to new blocks, and then erase them before they can be used to write new data again.

[0006] In a solid-state drive, junk data comes from the host repeatedly writing to the same logical address. When data at the same logical address is written repeatedly, the previously written location becomes junk data.

[0007] Garbage collection is an important module in the design of solid-state drives. Its function is to select the super block with the least valid data (source super block) before all the physical blocks of the solid-state drive are about to be filled, find the valid data in the super block, move the valid data to the free super block, and then erase the source super block, thereby freeing up the space occupied by the garbage data on the source super block.

[0008] In the existing mainstream technical solutions, the garbage collection algorithm generally runs according to the following steps:

[0009] 1. Select the super block with the least valid data as the source super block for garbage collection.

[0010] 2. Search for N valid data in batches.

[0011] 3. Read the batch of valid data found in step 2 back to the master control.

[0012] 4. The valid data read in step 3 is rewritten into the flash memory. After being written to the new location, the corresponding location in the source super block automatically becomes garbage data.

[0013] 5. Repeat steps 2 to 4 until there is no valid data in the source super block.

[0014] 6. Erase the source super block.

[0015] In order to ensure that the SSD always has available space for the host to write or for garbage collection to write data, the SSD firmware will generally limit the speed of processing host write commands during the garbage collection process. Then there is a positive correlation between the efficiency of garbage collection and the write rate of the SSD. The higher the efficiency of garbage collection, the higher the write rate of the host when the disk is full, and the lower the write latency.

[0016] 1. In the existing garbage collection scheme, steps 2 to 4 described above are usually executed in sequence and serially, and the logic is simple. However, since each step depends on the completion of the previous step to run, for example, step 4 needs to wait until the data reading of step 3 is completed before it can be executed, there is a certain waste of CPU time and the efficiency is not high.

[0017] 2. Due to the low efficiency of garbage collection, when the disk is full, the host may have problems such as too low write speed and too long write delay, resulting in a poor user experience. Summary of the invention

[0018] The main purpose of the present invention is to provide a solid-state hard disk garbage collection acceleration method, device, equipment and storage medium, aiming to solve the technical problems in the prior art of low solid-state hard disk garbage collection efficiency, low write speed, excessive delay, and poor user experience.

[0019] In a first aspect, the present invention provides a solid state drive garbage collection acceleration method, the solid state drive garbage collection acceleration method comprising the following steps:

[0020] Select source superblocks for SSD garbage collection;

[0021] Execute a preset subtask to move valid data in the source super block;

[0022] When the valid data does not exist in the source super block, the source super block is erased.

[0023] Optionally, selecting a source super block in garbage collection of the solid state drive includes:

[0024] A super block with the least valid data in garbage collection of the solid state drive is selected, and the super block is used as a source super block for garbage collection.

[0025] Optionally, the executing a preset subtask to move valid data in the source super block includes:

[0026] Execute a preset first subtask to search for valid data in the source super block;

[0027] Execute a preset second subtask to read the valid data in the source super block;

[0028] Execute a preset third subtask to rewrite the valid data in the source super block;

[0029] Move valid data in the source super block.

[0030] Optionally, the performing of the preset first subtask to search for valid data in the source super block includes:

[0031] Execute a preset first subtask, read the physical address from the source super block to the logical address table P2L table, and obtain the logical page address LPA information of the source super block;

[0032] Traverse the P2L table according to a preset length to obtain an initial physical page address PPA0 corresponding to the LPA information;

[0033] According to the LPA information, query the logical address to the physical address table L2P table to obtain the first physical page address PPA1;

[0034] When the PPA1 is the same as the PPA0, it is determined that the current data is valid data, and the LPA information, the PPA1 and the PPA0 are filled into the data node and inserted into the tail of the read queue.

[0035] Optionally, the executing a preset second subtask to read the valid data in the source super block includes:

[0036] Execute the preset second subtask to determine whether the current read queue is empty;

[0037] When the current read queue is not empty, taking out a first node from the current read queue, initiating a read request of the PPA corresponding to the first node, and inserting the first node into the tail of the write queue;

[0038] The nodes in the current read queue are read repeatedly until a preset single read quantity is reached.

[0039] Optionally, the performing of a preset third subtask to rewrite the valid data in the source super block includes:

[0040] Execute the preset third subtask to determine whether the current write queue is empty;

[0041] When the current write queue is not empty and the head node data of the current write queue has been read, the head node is taken out, a write request corresponding to the current LPA information is initiated, and the read target data is written to the target super block;

[0042] The head node is repeatedly taken out from the current write queue until a preset single write quantity is reached.

[0043] Optionally, when the valid data does not exist in the source super block, erasing the source super block includes:

[0044] Repeatedly executing the preset subtask until there is no valid data in the source super block;

[0045] When the valid data does not exist in the source super block, the source super block is erased.

[0046] In a second aspect, to achieve the above-mentioned purpose, the present invention further proposes a solid state hard disk garbage collection acceleration device, the solid state hard disk garbage collection acceleration device comprising:

[0047] A selection module is used to select source superblocks in SSD garbage collection;

[0048] An execution module, used for executing a preset subtask to move valid data in the source super block;

[0049] The erasing module is used to erase the source super block when the valid data does not exist in the source super block.

[0050] In the third aspect, to achieve the above-mentioned purpose, the present invention also proposes a solid-state hard disk garbage collection acceleration device, which includes: a memory, a processor, and a solid-state hard disk garbage collection acceleration program stored on the memory and executable on the processor, and the solid-state hard disk garbage collection acceleration program is configured to implement the steps of the solid-state hard disk garbage collection acceleration method as described above.

[0051] In a fourth aspect, in order to achieve the above-mentioned purpose, the present invention also proposes a storage medium, on which a solid-state hard disk garbage collection acceleration program is stored, and when the solid-state hard disk garbage collection acceleration program is executed by a processor, the steps of the solid-state hard disk garbage collection acceleration method described above are implemented.

[0052] The solid-state hard disk garbage collection acceleration method proposed in the present invention selects a source super block in the solid-state hard disk garbage collection; executes a preset subtask to move valid data in the source super block; and when the source super block does not have the valid data, erases the source super block. This can optimize the process of the garbage collection algorithm, reduce the waiting between steps, and ensure that each flash memory die is in a working state as much as possible, thereby improving the CPU utilization rate and thus improving the garbage collection efficiency. In certain delay-sensitive application scenarios, the speed limit for host writes can be optimized to reduce write delays, thereby improving the speed and efficiency of solid-state hard disk garbage collection acceleration and improving user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] Figure 1 A schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present invention;

[0054] Figure 2 It is a flowchart of a first embodiment of a solid state drive garbage collection acceleration method of the present invention;

[0055] Figure 3 It is a flow chart of a second embodiment of a solid state drive garbage collection acceleration method of the present invention;

[0056] Figure 4 It is a flowchart of a third embodiment of a solid state drive garbage collection acceleration method of the present invention;

[0057] Figure 5 It is a schematic diagram of the search subtask process in the solid state drive garbage collection acceleration method of the present invention;

[0058] Figure 6 It is a schematic diagram of the reading subtask process in the solid state hard disk garbage collection acceleration method of the present invention;

[0059] Figure 7 It is a schematic diagram of the rewriting subtask process in the solid state drive garbage collection acceleration method of the present invention;

[0060] Figure 8 It is a flowchart of a fourth embodiment of a solid state drive garbage collection acceleration method according to the present invention;

[0061] Fig. 9 It is a functional module diagram of the first embodiment of the solid state drive garbage collection acceleration device of the present invention.

[0062] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0063] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0064] The solution of the embodiment of the present invention is mainly: by selecting the source super block in the solid-state hard disk garbage collection; executing the preset subtask to move the valid data in the source super block; when the valid data does not exist in the source super block, erasing the source super block, it is possible to optimize the process of the garbage collection algorithm, reduce the waiting between steps, and ensure that each flash memory die is in a working state as much as possible, improve the CPU utilization rate, and thus improve the garbage collection efficiency. In certain delay-sensitive application scenarios, the speed limit for host writes can be optimized, the write delay can be reduced, the speed and efficiency of the solid-state hard disk garbage collection acceleration can be increased, the user experience is improved, and the technical problems of low solid-state hard disk garbage collection efficiency, low write speed, and excessive delay in the prior art, which lead to poor user experience, are solved.

[0065] Reference Figure 1 , Figure 1 The figure is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present invention.

[0066] like Figure 1 As shown, the device may include: a processor 1001, such as a CPU, a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a Wi-Fi interface). The memory 1005 may be a high-speed RAM memory, or it may be a stable memory (Non-Volatile Memory), such as a disk memory. The memory 1005 may optionally be a storage device independent of the aforementioned processor 1001.

[0067] Those skilled in the art will understand that Figure 1 The device structure shown in the figure does not constitute a limitation of the device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0068] like Figure 1 As shown, the memory 1005 as a storage medium may include an operating device, a network communication module, a user interface module, and a solid state drive garbage collection acceleration program.

[0069] The device of the present invention calls the solid state drive garbage collection acceleration program stored in the memory 1005 through the processor 1001, and performs the following operations:

[0070] Select source superblocks for SSD garbage collection;

[0071] Execute a preset subtask to move valid data in the source super block;

[0072] When the valid data does not exist in the source super block, the source super block is erased.

[0073] The device of the present invention calls the solid state drive garbage collection acceleration program stored in the memory 1005 through the processor 1001, and also performs the following operations:

[0074] A super block with the least valid data in garbage collection of the solid state drive is selected, and the super block is used as a source super block for garbage collection.

[0075] The device of the present invention calls the solid state drive garbage collection acceleration program stored in the memory 1005 through the processor 1001, and also performs the following operations:

[0076] Execute a preset first subtask to search for valid data in the source super block;

[0077] Execute a preset second subtask to read the valid data in the source super block;

[0078] Execute a preset third subtask to rewrite the valid data in the source super block;

[0079] Move valid data in the source super block.

[0080] The device of the present invention calls the solid state drive garbage collection acceleration program stored in the memory 1005 through the processor 1001, and also performs the following operations:

[0081] Execute a preset first subtask, read the physical address from the source super block to the logical address table P2L table, and obtain the logical page address LPA information of the source super block;

[0082] Traverse the P2L table according to a preset length to obtain an initial physical page address PPA0 corresponding to the LPA information;

[0083] According to the LPA information, query the logical address to the physical address table L2P table to obtain the first physical page address PPA1;

[0084] When the PPA1 is the same as the PPA0, it is determined that the current data is valid data, and the LPA information, the PPA1 and the PPA0 are filled into the data node and inserted into the tail of the read queue.

[0085] The device of the present invention calls the solid state drive garbage collection acceleration program stored in the memory 1005 through the processor 1001, and also performs the following operations:

[0086] Execute the preset second subtask to determine whether the current read queue is empty;

[0087] When the current read queue is not empty, taking out a first node from the current read queue, initiating a read request of the PPA corresponding to the first node, and inserting the first node into the tail of the write queue;

[0088] The nodes in the current read queue are read repeatedly until a preset single read quantity is reached.

[0089] The device of the present invention calls the solid state drive garbage collection acceleration program stored in the memory 1005 through the processor 1001, and also performs the following operations:

[0090] Execute the preset third subtask to determine whether the current write queue is empty;

[0091] When the current write queue is not empty and the head node data of the current write queue has been read, the head node is taken out, a write request corresponding to the current LPA information is initiated, and the read target data is written to the target super block;

[0092] The head node is repeatedly taken out from the current write queue until a preset single write quantity is reached.

[0093] The device of the present invention calls the solid state drive garbage collection acceleration program stored in the memory 1005 through the processor 1001, and also performs the following operations:

[0094] Repeatedly executing the preset subtask until there is no valid data in the source super block;

[0095] When the valid data does not exist in the source super block, the source super block is erased.

[0096] Through the above scheme, this embodiment selects the source super block in the solid-state hard disk garbage collection; executes the preset subtask to move the valid data in the source super block; when the valid data does not exist in the source super block, erases the source super block, which can optimize the process of the garbage collection algorithm, reduce the waiting between steps, and can ensure that each flash memory die is in a working state as much as possible, improve the CPU utilization rate, thereby improving the garbage collection efficiency. In some delay-sensitive application scenarios, the speed limit for host writes can be optimized, the write delay can be reduced, the speed and efficiency of the solid-state hard disk garbage collection acceleration are improved, and the user experience is improved.

[0097] Based on the above hardware structure, an embodiment of a solid state drive garbage collection acceleration method of the present invention is proposed.

[0098] Reference Figure 2 , Figure 2It is a flowchart of the first embodiment of the solid state drive garbage collection acceleration method of the present invention.

[0099] In a first embodiment, the solid state drive garbage collection acceleration method comprises the following steps:

[0100] Step S10: Select a source super block in solid state drive garbage collection.

[0101] It should be noted that garbage collection is a very important function in the design of solid-state drives. Its working efficiency is directly related to the response rate of the solid-state drive to the read and write commands of the host during operation. In view of the fact that the existing technical solutions do not fully utilize the main control computing resources and flash memory bandwidth, this embodiment aims to improve the execution efficiency of the garbage collection algorithm by optimizing the design of the garbage collection algorithm. First, the source super block can be selected from the garbage collection of the solid-state drive.

[0102] Step S20: Execute a preset subtask to move valid data in the source super block.

[0103] It should be understood that after executing the preset subtask, it can be determined whether there is still valid data in the source super block.

[0104] Step S30: When the valid data does not exist in the source super block, erase the source super block.

[0105] It can be understood that when the valid data does not exist in the source super block, the source super block can be erased.

[0106] Through the above scheme, this embodiment selects the source super block in the solid-state hard disk garbage collection; executes the preset subtask to move the valid data in the source super block; when the valid data does not exist in the source super block, erases the source super block, which can optimize the process of the garbage collection algorithm, reduce the waiting between steps, and can ensure that each flash memory die is in a working state as much as possible, improve the CPU utilization rate, thereby improving the garbage collection efficiency. In some delay-sensitive application scenarios, the speed limit for host writes can be optimized, the write delay can be reduced, the speed and efficiency of the solid-state hard disk garbage collection acceleration are improved, and the user experience is improved.

[0107] Further, Figure 3 FIG. 2 is a flow chart of a second embodiment of a solid state drive garbage collection acceleration method according to the present invention. Figure 3 As shown, a second embodiment of the solid state drive garbage collection acceleration method of the present invention is proposed based on the first embodiment. In this embodiment, the step S10 specifically includes the following steps:

[0108] Step S11: selecting a super block with the least valid data in garbage collection of the solid state drive, and using the super block as a source super block for garbage collection.

[0109] It should be noted that the source super block in the solid state drive garbage collection process is selected by selecting the super block with the least valid data in the solid state drive garbage collection, and then using the super block as the source super block for garbage collection.

[0110] Through the above scheme, this embodiment selects the super block with the least valid data in the solid-state hard disk garbage collection and uses the super block as the source super block for garbage collection. This can optimize the process of the garbage collection algorithm, reduce the waiting between steps, improve the speed and efficiency of the solid-state hard disk garbage collection acceleration, and enhance the user experience.

[0111] Further, Figure 4 FIG. 4 is a flow chart of a third embodiment of a solid state drive garbage collection acceleration method according to the present invention. Figure 4 As shown, a third embodiment of the solid state drive garbage collection acceleration method of the present invention is proposed based on the first embodiment. In this embodiment, the step S20 specifically includes the following steps:

[0112] Step S21, executing a preset first subtask to search for valid data in the source super block.

[0113] It should be noted that the preset first subtask is a preset valid data search subtask, and executing the preset first subtask can search for valid data in the source super block.

[0114] Furthermore, the step S21 specifically includes the following steps:

[0115] Execute a preset first subtask, read the physical address from the source super block to the logical address table P2L table, and obtain the logical page address LPA information of the source super block;

[0116] Traverse the P2L table according to a preset length to obtain an initial physical page address PPA0 corresponding to the LPA information;

[0117] According to the LPA information, query the logical address to the physical address table L2P table to obtain the first physical page address PPA1;

[0118] When the PPA1 is the same as the PPA0, it is determined that the current data is valid data, and the LPA information, the PPA1 and the PPA0 are filled into the data node and inserted into the tail of the read queue.

[0119] In the specific implementation, see Figure 5 , Figure 5 FIG. 1 is a schematic diagram of the search subtask process in the solid state drive garbage collection acceleration method of the present invention. Figure 5 As shown, find valid data. The specific process is as follows:

[0120] a. Read the P2L table from the source super block to obtain the LPA information on the super block.

[0121] b. According to a certain length, traverse the P2L table to obtain the LPA and the corresponding PPA0.

[0122] c. Query the L2P table based on the obtained LPA. If the PPA1 found is the same as PPA0, then the data is valid. Fill the LPA and PPA into the data node and insert it to the end of the read queue.

[0123] Step S22: Execute a preset second subtask to read the valid data in the source super block.

[0124] It can be understood that the preset second subtask is a preset valid data reading subtask, and executing the preset second subtask can read the valid data in the source super block.

[0125] Furthermore, the step S22 specifically includes the following steps:

[0126] Execute the preset second subtask to determine whether the current read queue is empty;

[0127] When the current read queue is not empty, taking out a first node from the current read queue, initiating a read request of the PPA corresponding to the first node, and inserting the first node into the tail of the write queue;

[0128] The nodes in the current read queue are read repeatedly until a preset single read quantity is reached.

[0129] In the specific implementation, see Figure 6 , Figure 6 FIG. 1 is a flowchart of a read subtask in the solid state drive garbage collection acceleration method of the present invention. Figure 6 As shown, read valid data, the specific process is as follows:

[0130] a. If the read queue is not empty, take the first node from the read queue, initiate a read request for the PPA, and insert the node into the tail of the write queue.

[0131] b. Repeat step a until the preset single reading quantity is reached.

[0132] Step S23, executing a preset third subtask to rewrite the valid data in the source super block.

[0133] It should be understood that the preset third subtask is a preset valid data rewriting subtask, and executing the preset third subtask can rewrite the valid data in the source super block.

[0134] Furthermore, the step S23 specifically includes the following steps:

[0135] Execute the preset third subtask to determine whether the current write queue is empty;

[0136] When the current write queue is not empty and the head node data of the current write queue has been read, the head node is taken out, a write request corresponding to the current LPA information is initiated, and the read target data is written to the target super block;

[0137] The head node is repeatedly taken out from the current write queue until a preset single write quantity is reached.

[0138] In the specific implementation, see Figure 7 , Figure 7 FIG. 1 is a schematic diagram of a rewriting subtask process in the solid state drive garbage collection acceleration method of the present invention. Figure 7 As shown, rewrite the valid data. The specific process is as follows:

[0139] a. If the write queue is not empty and the data of the head node of the write queue has been read, the head node is taken out and a write request is initiated to the LPA to write the read data to the target super block

[0140] b. Repeat the steps to take out the head node from the current write queue until the preset single write quantity is reached.

[0141] Step S24: Move the valid data in the source super block.

[0142] It is understandable that after executing the three preset subtasks, the valid data in the source super block can be moved.

[0143] Through the above scheme, this embodiment executes the preset first subtask to search for valid data in the source super block; executes the preset second subtask to read the valid data in the source super block; executes the preset third subtask to rewrite the valid data in the source super block; and moves the valid data in the source super block, which can optimize the process of the garbage collection algorithm, reduce the waiting between steps, and can ensure that each flash memory die is in working condition as much as possible, improve CPU utilization, and thus improve garbage collection efficiency.

[0144] Further, Figure 8 FIG. 4 is a flow chart of a fourth embodiment of a solid state drive garbage collection acceleration method according to the present invention. Figure 8 As shown, a fourth embodiment of the solid state drive garbage collection acceleration method of the present invention is proposed based on the first embodiment. In this embodiment, step S30 specifically includes the following steps:

[0145] Step S31, repeatedly executing the preset subtask until there is no valid data in the source super block.

[0146] It should be noted that the three subtasks are repeatedly executed, that is, the preset subtasks are repeatedly executed, until there is no valid data in the source super block.

[0147] Step S32: When the valid data does not exist in the source super block, erase the source super block.

[0148] It can be understood that when the valid data does not exist in the source super block, the source super block can be erased.

[0149] Through the above scheme, this embodiment repeatedly executes the preset subtask until there is no valid data in the source super block; when the valid data does not exist in the source super block, the source super block is erased, which can optimize the process of the garbage collection algorithm, reduce the waiting between steps, and ensure that each flash memory die is in a working state as much as possible, thereby improving the CPU utilization rate and improving the garbage collection efficiency. In some delay-sensitive application scenarios, the speed limit for host writes can be optimized, the write delay can be reduced, the speed and efficiency of solid-state hard disk garbage collection acceleration can be improved, and the user experience can be improved.

[0150] Accordingly, the present invention further provides a solid state hard disk garbage collection acceleration device.

[0151] Reference Fig. 9 , Fig. 9 It is a functional module diagram of the first embodiment of the solid state drive garbage collection acceleration device of the present invention.

[0152] In a first embodiment of the solid state hard disk garbage collection acceleration device of the present invention, the solid state hard disk garbage collection acceleration device comprises:

[0153] The selection module 10 is used to select a source super block in garbage collection of the solid state drive.

[0154] The execution module 20 is used to execute a preset subtask to move the valid data in the source super block.

[0155] The erasing module 30 is configured to erase the source super block when the valid data does not exist in the source super block.

[0156] The selection module 10 is further used to select a super block with the least valid data in garbage collection of the solid state drive, and use the super block as a source super block for garbage collection.

[0157] The execution module 20 is also used to execute a preset first subtask to search for valid data in the source super block; execute a preset second subtask to read the valid data in the source super block; execute a preset third subtask to rewrite the valid data in the source super block; and move the valid data in the source super block.

[0158] The execution module 20 is also used to execute a preset first subtask, read the physical address from the source super block to the logical address table P2L table, and obtain the logical page address LPA information of the source super block; traverse the P2L table according to the preset length to obtain the initial physical page address PPA0 corresponding to the LPA information; query the logical address to the physical address table L2P table according to the LPA information to obtain the first physical page address PPA1; when the PPA1 is the same as the PPA0, determine that the current data is valid data, and fill the LPA information, the PPA1 and the PPA0 into the data node, and insert them into the tail of the read queue.

[0159] The execution module 20 is also used to execute a preset second subtask, determine whether the current read queue is empty; when the current read queue is not empty, take out the first node from the current read queue, initiate a read request for the PPA corresponding to the first node, and insert the first node into the tail of the write queue; repeatedly read the nodes in the current read queue until the preset single read quantity is reached.

[0160] The execution module 20 is also used to execute the preset third subtask, determining whether the current write queue is empty; when the current write queue is not empty and the head node data of the current write queue has been read, taking out the head node, initiating a corresponding write request for the current LPA information, and writing the read target data to the target super block; repeatedly taking out the head node from the current write queue until the preset single write quantity is reached.

[0161] The erasing module 30 is further configured to repeatedly execute the preset subtask until the source super block does not contain any valid data; when the source super block does not contain any valid data, the source super block is erased.

[0162] Among them, the steps implemented by each functional module of the solid-state hard disk garbage collection acceleration device can refer to the various embodiments of the solid-state hard disk garbage collection acceleration method of the present invention, and will not be repeated here.

[0163] In addition, an embodiment of the present invention further provides a storage medium, on which a solid state drive garbage collection acceleration program is stored. When the solid state drive garbage collection acceleration program is executed by a processor, the following operations are implemented:

[0164] Select source superblocks for SSD garbage collection;

[0165] Execute a preset subtask to move valid data in the source super block;

[0166] When the valid data does not exist in the source super block, the source super block is erased.

[0167] Furthermore, when the solid state drive garbage collection acceleration program is executed by the processor, the following operations are also implemented:

[0168] A super block with the least valid data in garbage collection of the solid state drive is selected, and the super block is used as a source super block for garbage collection.

[0169] Furthermore, when the solid state drive garbage collection acceleration program is executed by the processor, the following operations are also implemented:

[0170] Execute a preset first subtask to search for valid data in the source super block;

[0171] Execute a preset second subtask to read the valid data in the source super block;

[0172] Execute a preset third subtask to rewrite the valid data in the source super block;

[0173] Move valid data in the source super block.

[0174] Furthermore, when the solid state drive garbage collection acceleration program is executed by the processor, the following operations are also implemented:

[0175] Execute a preset first subtask, read the physical address from the source super block to the logical address table P2L table, and obtain the logical page address LPA information of the source super block;

[0176] Traverse the P2L table according to a preset length to obtain an initial physical page address PPA0 corresponding to the LPA information;

[0177] According to the LPA information, query the logical address to the physical address table L2P table to obtain the first physical page address PPA1;

[0178] When the PPA1 is the same as the PPA0, it is determined that the current data is valid data, and the LPA information, the PPA1 and the PPA0 are filled into the data node and inserted into the tail of the read queue.

[0179] Furthermore, when the solid state drive garbage collection acceleration program is executed by the processor, the following operations are also implemented:

[0180] Execute the preset second subtask to determine whether the current read queue is empty;

[0181] When the current read queue is not empty, taking out a first node from the current read queue, initiating a read request of the PPA corresponding to the first node, and inserting the first node into the tail of the write queue;

[0182] The nodes in the current read queue are read repeatedly until a preset single read quantity is reached.

[0183] Furthermore, when the solid state drive garbage collection acceleration program is executed by the processor, the following operations are also implemented:

[0184] Execute the preset third subtask to determine whether the current write queue is empty;

[0185] When the current write queue is not empty and the head node data of the current write queue has been read, the head node is taken out, a write request corresponding to the current LPA information is initiated, and the read target data is written to the target super block;

[0186] The head node is repeatedly taken out from the current write queue until a preset single write quantity is reached.

[0187] Furthermore, when the solid state drive garbage collection acceleration program is executed by the processor, the following operations are also implemented:

[0188] Repeatedly executing the preset subtask until there is no valid data in the source super block;

[0189] When the valid data does not exist in the source super block, the source super block is erased.

[0190] Those skilled in the art will appreciate that all or part of the steps in the above-mentioned implementation method can be accomplished by instructing related hardware through a program, and the program is stored in a storage medium, including a number of instructions for enabling a device (which may be a single-chip microcomputer, chip, etc.) or a processor to execute all or part of the steps of the method described in each implementation method of the present application; and the aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program codes.

[0191] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0192] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0193] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A solid state hard disk garbage collection acceleration method, characterized in that: The solid state drive garbage collection acceleration method comprises: Select source superblocks for SSD garbage collection; Execute a preset subtask to move valid data in the source super block; When the valid data does not exist in the source super block, the source super block is erased.

2. The solid state drive garbage collection acceleration method according to claim 1, characterized in that: The selecting of the source super block in the solid state drive garbage collection comprises: A super block with the least valid data in garbage collection of the solid state drive is selected, and the super block is used as a source super block for garbage collection.

3. The solid state drive garbage collection acceleration method according to claim 1, characterized in that: The executing of the preset subtask to move the valid data in the source super block includes: Execute a preset first subtask to search for valid data in the source super block; Execute a preset second subtask to read the valid data in the source super block; Execute a preset third subtask to rewrite the valid data in the source super block; Move valid data in the source super block.

4. The solid state drive garbage collection acceleration method as claimed in claim 3, characterized in that: The performing of the preset first subtask to search for valid data in the source super block includes: Execute a preset first subtask, read the physical address from the source super block to the logical address table P2L table, and obtain the logical page address LPA information of the source super block; Traverse the P2L table according to a preset length to obtain an initial physical page address PPA0 corresponding to the LPA information; According to the LPA information, query the logical address to the physical address table L2P table to obtain the first physical page address PPA1; When the PPA1 is the same as the PPA0, it is determined that the current data is valid data, and the LPA information, the PPA1 and the PPA0 are filled into the data node and inserted into the tail of the read queue.

5. The solid state drive garbage collection acceleration method as claimed in claim 3, characterized in that: The performing of the preset second subtask to read the valid data in the source super block includes: Execute the preset second subtask to determine whether the current read queue is empty; When the current read queue is not empty, taking out a first node from the current read queue, initiating a read request of the PPA corresponding to the first node, and inserting the first node into the tail of the write queue; The nodes in the current read queue are read repeatedly until a preset single read quantity is reached.

6. The solid state drive garbage collection acceleration method as claimed in claim 3, characterized in that: The performing of the preset third subtask to rewrite the valid data in the source super block includes: Execute the preset third subtask to determine whether the current write queue is empty; When the current write queue is not empty and the head node data of the current write queue has been read, the head node is taken out, a write request corresponding to the current LPA information is initiated, and the read target data is written to the target super block; The head node is repeatedly taken out from the current write queue until a preset single write quantity is reached.

7. The solid state drive garbage collection acceleration method according to claim 1, characterized in that: When the valid data does not exist in the source super block, erasing the source super block comprises: Repeatedly executing the preset subtask until there is no valid data in the source super block; When the valid data does not exist in the source super block, the source super block is erased.

8. A solid state hard disk garbage collection acceleration device, characterized in that: The solid state hard disk garbage collection acceleration device comprises: A selection module is used to select source superblocks in SSD garbage collection; An execution module, used for executing a preset subtask to move valid data in the source super block; The erasing module is used to erase the source super block when the valid data does not exist in the source super block.

9. A solid state hard disk garbage collection acceleration device, characterized in that: The solid-state hard disk garbage collection acceleration device includes: a memory, a processor, and a solid-state hard disk garbage collection acceleration program stored on the memory and executable on the processor, wherein the solid-state hard disk garbage collection acceleration program is configured to implement the steps of the solid-state hard disk garbage collection acceleration method as described in any one of claims 1 to 7.

10. A storage medium, characterized in that: The storage medium stores a solid state drive garbage collection acceleration program, which, when executed by a processor, implements the steps of the solid state drive garbage collection acceleration method as described in any one of claims 1 to 7.