Physical block recovery method and device based on QLC solid state disk and computer equipment
By creating queues to be recycled and recording write point locations in QLC solid-state drives, the problem that traditional VPC table schemes cannot manage multiple programming NAND physical blocks is solved, and the reasonable retention and release of physical blocks is achieved, which improves storage stability and efficiency.
Patent Information
- Application Number
- CN202411123239.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-15
- Publication Date
- 2024-11-26
AI Technical Summary
Traditional VPC table solutions cannot effectively manage NAND physical blocks programmed multiple times, resulting in improper recycling of physical blocks in QLC solid-state drives, affecting storage stability and data reading capabilities.
In QLC solid-state drive, create queues to be recycled based on the original VPC table, record and compare the write point positions, traverse the queue after the last programming, release and delete the corresponding physical blocks, and ensure that the physical blocks are properly retained during multiple programming. and release.
By creating queues to be recycled and recording write point locations, physical blocks can be properly retained or released correctly, improving the physical block management efficiency and storage stability of QLC solid-state drives.
Smart Images

Figure CN119025040A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of solid-state hard disks, and in particular to a physical block recovery method, device, computer equipment and storage medium based on a QLC solid-state hard disk. Background Art
[0002] SSD (Solid State Drive) is widely used in various occasions. At present, it has gradually replaced the traditional HDD (Mechanical Hard Drive) in the PC market, providing users with a better experience in terms of reliability and performance. With the evolution of NAND technology, it has evolved from the early 1bit / cell (SLC) to 2bit / cell (MLC), 3bit / cell (TLC), and 4bit / cell (QLC). Its storage data capacity is getting larger and larger, but due to the increase in the number of bits per cell, its programming model is becoming more and more complex. Typical NAND such as SLC / MLC / TLC only needs one programming to complete data storage, and then it can be read normally, while QLC requires multiple programming to truly complete data storage for subsequent data reading due to its complex NAND Cell voltage distribution. In addition, since the influence between adjacent Wordlines needs to be eliminated, this multiple programming needs to be interleaved between multiple Wordlines, so there are a large number of Wordlines in an unstable state. Since it cannot be read out, the corresponding data needs to be cached in other places where it can be read correctly. For consumer-grade SSDs with limited memory and power conservation capabilities, SLC is generally used to cache this data, which is called Wordline cache.
[0003] At present, in traditional solutions, a VPC table (Valid Page Count Table) is generally used to manage data blocks. The VPC table is organized by physical blocks, and each physical block maintains a count, which represents the logical page data of the valid data in the block. When valid data is written to a physical block, the valid logical page data count corresponding to the physical block is increased. When the logical page address data is written to other physical blocks, the VPC count of the physical block originally mapped to the logical page address is reduced. When the physical block has been programmed and the VPC count is 0, it means that there is no valid data in the physical block and it can be recycled. However, in NAND that requires multiple programming, even if there is no valid data in the physical block, it may still be necessary to read data from the physical block for subsequent multiple programming. The traditional VPC table solution can no longer meet the requirements of multiple programming NAND for physical block management. Summary of the invention
[0004] Based on this, it is necessary to provide a physical block recovery method, device, computer equipment and storage medium based on QLC solid state drive to address the above technical problems.
[0005] A physical block recovery method based on a QLC solid state drive, the method comprising:
[0006] Obtain physical block recycling requests based on QLC SSDs and create a queue to be recycled based on the original VPC table;
[0007] When the VPC count corresponding to a physical block is 0, the physical block is added to the queue to be recycled together with the location where the current data is written;
[0008] After the physical block completes the last QLC programming, the queue to be recycled is traversed to determine whether the write position corresponding to the physical block in the queue to be recycled has completed the last programming;
[0009] If the last programming is completed, the physical block is released and deleted from the queue to be recycled.
[0010] In one embodiment, the method further comprises:
[0011] When writing data of each logical page, a new physical page address PPA1 is assigned;
[0012] It is determined whether the physical page address PPA1 needs to be programmed multiple times. If it needs to be programmed multiple times, only the first programming is processed at this time and the VPC count is not modified.
[0013] In one embodiment, the method further comprises:
[0014] When processing the last programming of the data of each logical page, the VPC count of the physical block where the old mapping is located is reduced by 1;
[0015] Point the mapping of the logical page address to the newly allocated physical page address PPA1;
[0016] Increase the VPC count of the physical block where the physical page address PPA1 is located by 1;
[0017] The queue to be recycled is traversed, and each of the write locations corresponding to the physical blocks in the queue nodes is determined to determine whether the last programming has been completed.
[0018] In one embodiment, after the step of traversing the queue to be recycled and determining one by one whether the write position corresponding to the physical block in the queue node has completed the last programming, the step further includes:
[0019] If the last programming has been completed, the physical block is released and deleted from the queue to be recycled, and the next node in the queue to be recycled is traversed;
[0020] If the last programming is not completed, since the queue nodes are arranged in the order of the write points, it is considered that the corresponding write positions of the subsequent physical blocks have not completed the last programming, and the processing ends.
[0021] A physical block recovery device based on a QLC solid state drive, the device comprising:
[0022] A queue creation module, the queue creation module is used to obtain a physical block recycling request based on the QLC solid state drive, and create a queue to be recycled based on the original VPC table;
[0023] A queue writing module, wherein when the VPC count corresponding to a physical block is 0, the queue writing module is used to add the physical block and the location where the current data is written to the queue to be recycled;
[0024] A judgment module, the judgment module is used to traverse the queue to be recycled after the physical block completes the last QLC programming, and judge whether the write position corresponding to the physical block in the queue to be recycled has completed the last programming;
[0025] A recycling module is used to release the physical block and delete the physical block from a queue to be recycled if the last programming has been completed.
[0026] In one embodiment, the device is further used for:
[0027] When writing data of each logical page, a new physical page address PPA1 is assigned;
[0028] It is determined whether the physical page address PPA1 needs to be programmed multiple times. If it needs to be programmed multiple times, only the first programming is processed at this time and the VPC count is not modified.
[0029] In one embodiment, the device is further used for:
[0030] When processing the last programming of the data of each logical page, the VPC count of the physical block where the old mapping is located is reduced by 1;
[0031] Point the mapping of the logical page address to the newly allocated physical page address PPA1;
[0032] Increase the VPC count of the physical block where the physical page address PPA1 is located by 1;
[0033] The queue to be recycled is traversed, and each of the write locations corresponding to the physical blocks in the queue nodes is determined to determine whether the last programming has been completed.
[0034] In one embodiment, the device is further used for:
[0035] If the last programming has been completed, the physical block is released and deleted from the queue to be recycled, and the next node in the queue to be recycled is traversed;
[0036] If the last programming is not completed, since the queue nodes are arranged in the order of the write points, it is considered that the corresponding write positions of the subsequent physical blocks have not completed the last programming, and the processing ends.
[0037] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any one of the above methods when executing the computer program.
[0038] A computer-readable storage medium stores a computer program, wherein the computer program implements the steps of any one of the above methods when executed by a processor.
[0039] The physical block recovery method, device, computer equipment and storage medium based on QLC solid state drive create a queue to be recovered based on the original VPC table by obtaining a physical block recovery request based on QLC solid state drive; when there is a physical block corresponding to a VPC count of 0, the physical block is added to the queue to be recovered together with the location where the current data is written; after the physical block completes the last QLC programming, the queue to be recovered is traversed to determine whether the write location corresponding to the physical block in the queue to be recovered has completed the last programming; if the last programming has been completed, the physical block is released and deleted from the queue to be recovered. The present invention creates a queue to be recovered based on the original VPC table, and by recording and comparing the write point positions, the physical block can be correctly and reasonably retained or released when multiple programming is required. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 It is a flowchart of a physical block recycling method based on a QLC solid state drive in one embodiment;
[0041] Figure 2 A schematic diagram of a flow chart of data writing processing after the present invention is introduced in one embodiment;
[0042] Figure 3 It is a flowchart of a physical block recycling method based on a QLC solid state drive in another embodiment;
[0043] Figure 4 A schematic diagram of a flow chart of the last programming process in multiple programmings after the present invention is introduced in one embodiment;
[0044] Figure 5 A schematic diagram of a flow chart for determining whether a physical block can be recycled after the present invention is introduced in an embodiment;
[0045] Figure 6 It is a structural block diagram of a physical block recycling device based on a QLC solid state drive in one embodiment;
[0046] Figure 7 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0047] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0048] In one embodiment, Figure 1 As shown, a physical block recovery method based on a QLC solid state drive is provided, the method comprising:
[0049] Step 102, obtaining a physical block recycling request based on a QLC solid state drive, and creating a queue to be recycled based on the original VPC table;
[0050] Step 104: when the VPC count corresponding to a physical block is 0, the physical block and the location where the current data is written are added to the queue to be recycled;
[0051] Step 106, after the physical block completes the last QLC programming, the queue to be recycled is traversed to determine whether the write position corresponding to the physical block in the queue to be recycled has completed the last programming;
[0052] Step 108: If the last programming has been completed, the physical block is released and deleted from the queue to be recycled.
[0053] In this embodiment, a physical block recovery method based on a QLC solid-state drive is provided, and a queue of blocks to be recovered is added based on the traditional VPC table (Valid Page Count Table). Specifically, when the VPC count of a physical block is 0, this physical block is added to the queue to be recovered together with the current write position. Subsequently, each time the last programming of the QLC is completed, the queue to be recovered is traversed to determine whether the write position corresponding to the physical block in the queue has been completed for the last time. If it has been completed, the physical block is released and deleted from the queue to be recovered, otherwise it is not processed.
[0054] In one embodiment, the method further includes: when writing data of each logical page, allocating a new physical page address PPA1; determining whether the physical page address PPA1 needs to be programmed multiple times, and if so, only processing the first programming at this time without modifying the VPC count.
[0055] Specifically, refer to Figure 2 As shown in the flowchart of the data writing process after the present invention is introduced, when writing data of one logical page, a new physical page address PPA1 is allocated.
[0056] Determine whether the physical page address needs to be programmed multiple times. If not, the process is the same as the traditional VPC solution. The VPC count of the physical block where the old mapping is located is subtracted by 1, the mapping of the logical page address points to the newly allocated physical page address PPA1, and the VPC count of the physical block where PPA1 is located is increased by 1. The process ends. If PPA1 needs to be programmed multiple times, only the first programming is processed at this time, and the VPC count is not modified, and the process ends.
[0057] In the above embodiment, a physical block recycling request based on a QLC solid state drive is obtained, and a queue to be recycled is created based on the original VPC table; when there is a physical block corresponding to a VPC count of 0, the physical block is added to the queue to be recycled together with the location where the current data is written; after the physical block completes the last QLC programming, the queue to be recycled is traversed to determine whether the write location corresponding to the physical block in the queue to be recycled has completed the last programming; if the last programming has been completed, the physical block is released and deleted from the queue to be recycled. The present invention creates a queue to be recycled based on the original VPC table, and by recording and comparing the write point locations, the physical block can be correctly and reasonably retained or released when multiple programming is required.
[0058] In one embodiment, Figure 3 As shown, a physical block recovery method based on a QLC solid state drive is provided, and the method also includes:
[0059] Step 302, when processing the last programming of the data of each logical page, the VPC count of the physical block where the old mapping is located is reduced by 1;
[0060] Step 304, mapping the logical page address to the newly allocated physical page address PPA1;
[0061] Step 306, increase the VPC count of the physical block where the physical page address PPA1 is located by 1;
[0062] Step 308, traverse the queue to be recycled, and determine one by one whether the write position corresponding to the physical block in the queue node has completed the last programming;
[0063] Step 310, if the last programming has been completed, the physical block is released and deleted from the queue to be recycled, and the next node in the queue to be recycled is traversed;
[0064] Step 312, if the last programming has not been completed, since the queue nodes are arranged in the order of the write points, it is considered that the corresponding write positions of the subsequent physical blocks have not completed the last programming, and the processing ends.
[0065] In this embodiment, a physical block recovery method based on a QLC solid state drive is proposed. For details, please refer to Figure 4 The flowchart of the last programming process in the multiple programming after the introduction of the present invention is shown as follows:
[0066] 4.1. When processing the last programming of data of a logical page, the VPC count of the physical block where the old mapping is located is reduced by 1.
[0067] 4.2. Map the logical page address to the newly allocated physical page address PPA1.
[0068] 4.3. Increase the VPC count of the physical block where PPA1 is located by 1.
[0069] 4.4. Traverse the queue to be recycled and determine the write position corresponding to the physical block in the queue node one by one to see whether the last programming has been completed.
[0070] 4.5. If the last programming has been completed, the physical block is released and deleted from the queue to be recycled, and the next node in the queue to be recycled is traversed.
[0071] 4.6. If the last programming is not completed, since the queue nodes are arranged in the order of the write points, it is considered that the corresponding write positions of the subsequent physical blocks have not completed the last programming, and the processing ends.
[0072] In one embodiment, reference Figure 5 As shown, it is a schematic diagram of the flow chart of judging whether a physical block can be recycled after the present invention is introduced, specifically:
[0073] When the physical block is programmed and the VPC count is equal to 0, the physical block number and the current write point position are added to the queue to be recycled. Otherwise, it is considered that there is still data reference to the physical block and it cannot be recycled.
[0074] In this embodiment, the proposed method for reclaiming physical blocks of a multi-programmed solid-state drive can enable the physical blocks to be correctly and reasonably retained or released when multi-programming is required by recording and comparing write point positions.
[0075] It should be understood that although Figure 1-Figure 5The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1-Figure 5 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0076] In one embodiment, Figure 6 As shown, a physical block recovery device 600 based on a QLC solid state drive is provided, and the device includes:
[0077] A queue creation module 601, which is used to obtain a physical block recycling request based on a QLC solid state drive and create a queue to be recycled based on the original VPC table;
[0078] A queue writing module 602, wherein when the VPC count corresponding to a physical block is 0, the queue writing module is used to add the physical block and the location where the current data is written to the queue to be recycled;
[0079] A judgment module 603, which is used to traverse the queue to be recycled after the physical block completes the last QLC programming, and judge whether the write position corresponding to the physical block in the queue to be recycled has completed the last programming;
[0080] The recycling module 604 is used to release the physical block and delete the physical block from the queue to be recycled if the last programming has been completed.
[0081] In one embodiment, the device is also used to:
[0082] When writing data of each logical page, a new physical page address PPA1 is assigned;
[0083] It is determined whether the physical page address PPA1 needs to be programmed multiple times. If it needs to be programmed multiple times, only the first programming is processed at this time and the VPC count is not modified.
[0084] In one embodiment, the device is also used to:
[0085] When processing the last programming of the data of each logical page, the VPC count of the physical block where the old mapping is located is reduced by 1;
[0086] Point the mapping of the logical page address to the newly allocated physical page address PPA1;
[0087] Increase the VPC count of the physical block where the physical page address PPA1 is located by 1;
[0088] The queue to be recycled is traversed, and each of the write locations corresponding to the physical blocks in the queue nodes is determined to determine whether the last programming has been completed.
[0089] In one embodiment, the device is also used to:
[0090] If the last programming has been completed, the physical block is released and deleted from the queue to be recycled, and the next node in the queue to be recycled is traversed;
[0091] If the last programming is not completed, since the queue nodes are arranged in the order of the write points, it is considered that the corresponding write positions of the subsequent physical blocks have not completed the last programming, and the processing ends.
[0092] For the specific limitations of the physical block recovery device based on the QLC solid state drive, please refer to the limitations of the physical block recovery method based on the QLC solid state drive above, which will not be repeated here.
[0093] In one embodiment, a computer device is provided, whose internal structure diagram can be as follows: Figure 7 As shown. The computer device includes a processor, a memory and a network interface connected through a device bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating device, a computer program and a database. The internal memory provides an environment for the operation of the operating device and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a physical block recovery method based on a QLC solid state drive is implemented.
[0094] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0095] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the steps in the above method embodiments when executing the computer program.
[0096] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0097] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in the present application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0098] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0099] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A physical block recovery method based on a QLC solid state drive, the method comprising: Obtain physical block recycling requests based on QLC SSDs and create a queue to be recycled based on the original VPC table; When the VPC count corresponding to a physical block is 0, the physical block is added to the queue to be recycled together with the location where the current data is written; After the physical block completes the last QLC programming, the queue to be recycled is traversed to determine whether the write position corresponding to the physical block in the queue to be recycled has completed the last programming; If the last programming is completed, the physical block is released and deleted from the queue to be recycled.
2. The physical block recovery method based on QLC solid state drive according to claim 1, characterized in that: The method further comprises: When writing data of each logical page, a new physical page address PPA1 is assigned; It is determined whether the physical page address PPA1 needs to be programmed multiple times. If it needs to be programmed multiple times, only the first programming is processed at this time and the VPC count is not modified.
3. The physical block recovery method based on QLC solid state drive according to claim 1 or 2, characterized in that: The method further comprises: When processing the last programming of the data of each logical page, the VPC count of the physical block where the old mapping is located is reduced by 1; Point the mapping of the logical page address to the newly allocated physical page address PPA1; Increase the VPC count of the physical block where the physical page address PPA1 is located by 1; The queue to be recycled is traversed, and each of the write locations corresponding to the physical blocks in the queue nodes is determined to determine whether the last programming has been completed.
4. The physical block recovery method based on QLC solid state drive according to claim 3 is characterized in that: After the step of traversing the queue to be recycled and determining one by one whether the write position corresponding to the physical block in the queue node has completed the last programming, the following step is further included: If the last programming has been completed, the physical block is released and deleted from the queue to be recycled, and the next node in the queue to be recycled is traversed; If the last programming is not completed, since the queue nodes are arranged in the order of the write points, it is considered that the corresponding write positions of the subsequent physical blocks have not completed the last programming, and the processing ends.
5. A physical block recovery device based on a QLC solid state drive, characterized in that: The device comprises: A queue creation module, the queue creation module is used to obtain a physical block recycling request based on the QLC solid state drive, and create a queue to be recycled based on the original VPC table; A queue writing module, wherein when the VPC count corresponding to a physical block is 0, the queue writing module is used to add the physical block and the location where the current data is written to the queue to be recycled; A judgment module, the judgment module is used to traverse the queue to be recycled after the physical block completes the last QLC programming, and judge whether the write position corresponding to the physical block in the queue to be recycled has completed the last programming; A recycling module is used to release the physical block and delete the physical block from a queue to be recycled if the last programming has been completed.
6. The physical block recovery device based on QLC solid state drive according to claim 5, characterized in that: The device is also used for: When writing data of each logical page, a new physical page address PPA1 is assigned; It is determined whether the physical page address PPA1 needs to be programmed multiple times. If it needs to be programmed multiple times, only the first programming is processed at this time and the VPC count is not modified.
7. The physical block recovery device based on QLC solid state drive according to claim 5 or 6, characterized in that: The device is also used for: When processing the last programming of the data of each logical page, the VPC count of the physical block where the old mapping is located is reduced by 1; Point the mapping of the logical page address to the newly allocated physical page address PPA1; Increase the VPC count of the physical block where the physical page address PPA1 is located by 1; The queue to be recycled is traversed, and each of the write locations corresponding to the physical blocks in the queue nodes is determined to determine whether the last programming has been completed.
8. The physical block recovery device based on QLC solid state drive according to claim 7, characterized in that: The device is also used for: If the last programming has been completed, the physical block is released and deleted from the queue to be recycled, and the next node in the queue to be recycled is traversed; If the last programming is not completed, since the queue nodes are arranged in the order of the write points, it is considered that the corresponding write positions of the subsequent physical blocks have not completed the last programming, and the processing ends.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 4 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.
