Method and device for reducing abnormal power failure recovery time of solid state disk and related components

By recording the source data storage location after the first programming of each layer of QLC flash memory, and using log information to restore the source data for secondary programming during abnormal power failure recovery, the problem of long recovery time of abnormal power failure and storage space occupation of solid state hard disk is solved, and data migration speed and overall performance are improved.

CN120220774APending Publication Date: 2025-06-27SUZHOU UNIONMEMORY INFORMATION SYST LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510319310.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-18
Publication Date
2025-06-27

AI Technical Summary

Technical Problem

When the existing solid-state drives recover abnormally, they occupy effective storage space, extend the data recovery time, and require in-depth error correction operations during the data transfer process, resulting in a significant reduction in the data transfer speed.

Method used

After the first programming of each layer of QLC flash memory is completed, the source data storage location of the layer's program once is recorded and the generated log information is saved in the nonvolatile storage medium. During abnormal power-down recovery, the log information saved last two times is read from the nonvolatile storage medium, the source data of the write layer that has not completed the secondary programming, and the secondary programming is performed based on these source data.

Benefits of technology

By reading the last two log information, the source data of the last two complete write layers is reduced, and the amount of invalid data is filled and the number of programming data is moved only once, which improves the utilization of storage space, shortens the recovery time, and avoids data re-moval, thereby improving the overall performance and user experience of the solid-state drive.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120220774A_ABST
    Figure CN120220774A_ABST
Patent Text Reader

Abstract

The invention discloses a method and a device for reducing abnormal power failure recovery time of a solid state disk and a related component, and the method comprises the following steps: after first programming of each layer of a QLC flash memory is completed, recording a source data storage position of one-time programming of the layer; generating log information from the source data storage position and storing the log information in a nonvolatile storage medium; when the abnormal power failure is recovered, the log information stored for the last two times is read from the nonvolatile storage medium; and recovering the source data of the write-in layer which is not subjected to secondary programming according to the last two stored log information, and carrying out secondary programming on the write-in layer according to the source data. According to the method, by reading the last two log information, the source data of the last two complete write-in layers can be recovered, and the secondary programming of the unstable layer can be continued by utilizing the source data information, so that the filling amount of invalid data is reduced, and the movement of only one-time programming data is completed. The utilization rate of the storage space is improved, the recovery time is shortened, and data re-migration is avoided.
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 drives, and particularly to a method, device, and related components for reducing the abnormal power-off recovery time of solid-state drives. Background Art

[0002] With the continuous development of storage technology, QLC (Quad-Level Cell) NAND flash, as a high-density storage solution, has gradually been widely used in the field of solid-state drives (SSDs). QLC NAND cells represent four different data states (i.e., four-bit data) by storing four different levels of charge amounts, thus achieving a higher storage capacity than traditional SLC (Single-Level Cell) and MLC (Multi-Level Cell). However, this high-density storage method also brings more complex voltage distribution problems.

[0003] The voltage distribution of QLC NAND cells is more complex than that of SLC and MLC, mainly because it requires more precise control of the charge amount to distinguish four different data states. Therefore, QLC NAND usually requires two programming operations during data storage to ensure that the data can be accurately stored and correctly read in subsequent processes. This requirement for two programming operations poses certain challenges to the efficiency and reliability of data storage in QLC NAND.

[0004] To avoid the risks that may be brought by directly writing host data into the QLC area, the industry usually adopts a compromise strategy: first write the data into the SLC area, and then migrate it from the SLC area to the QLC area. Although this strategy can improve the reliability of data storage to a certain extent, it also increases the complexity and time cost of data migration.

[0005] In addition, the mutual influence between adjacent WordLines needs to be considered during the programming of QLC NAND. To eliminate this influence, the two programming operations need to be staggered between two groups of WordLines (i.e., two layers). Although this staggered programming method helps to reduce the interference between adjacent WordLines, it also increases the number of unstable WordLines. In the event of a sudden power-off or other emergencies, these unstable WordLines may have an adverse impact on subsequent data writing and reading operations.

[0006] To address this situation, QLC SSDs typically need to fill a large amount of invalid data on subsequent empty WordLines to isolate and eliminate the potential impact of the previous unstable WordLines. However, this approach not only occupies effective storage space but also prolongs the data recovery time. More seriously, a large number of remaining unstable WordLines during subsequent data migration will significantly reduce the data migration speed due to the need for in-depth error correction operations, thus affecting the overall performance and user experience of the SSD. Summary of the Invention

[0007] The objective of the present invention is to provide a method, device, and related components for reducing the abnormal power-off recovery time of a solid-state drive, aiming to solve problems such as the existing abnormal power-off recovery method of a solid-state drive occupying effective storage space and prolonging the data recovery time.

[0008] In a first aspect, an embodiment of the present invention provides a method for reducing the abnormal power-off recovery time of a solid-state drive, including:

[0009] After the first programming of each layer of the QLC flash memory is completed, record the storage location of the source data of the first programming of this layer;

[0010] Generate log information from the storage location of the source data and save it to a non-volatile storage medium;

[0011] During abnormal power-off recovery, read the last two saved log information from the non-volatile storage medium;

[0012] Restore the source data of the write layer where the secondary programming is not completed according to the last two saved log information and perform secondary programming on the write layer according to the source data.

[0013] In a second aspect, an embodiment of the present invention provides a device for reducing the abnormal power-off recovery time of a solid-state drive, including:

[0014] A recording unit, configured to record the storage location of the source data of the first programming of each layer after the first programming of each layer of the QLC flash memory is completed;

[0015] A saving unit, configured to generate log information from the storage location of the source data and save it to a non-volatile storage medium;

[0016] A reading unit, configured to read the last two saved log information from the non-volatile storage medium during abnormal power-off recovery;

[0017] A restoring unit, configured to restore the source data of the write layer where the secondary programming is not completed according to the last two saved log information and perform secondary programming on the write layer according to the source data.

[0018] In a third aspect, an embodiment of the present invention further provides a solid-state drive, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the method for reducing the abnormal power-off recovery time of the solid-state drive described in the first aspect above is implemented.

[0019] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for reducing the abnormal power-off recovery time of the solid-state drive described in the first aspect above is implemented.

[0020] The present invention discloses a method, device, and related components for reducing the abnormal power-off recovery time of a solid-state drive. The method includes: after the first programming of each layer of the QLC flash memory is completed, recording the storage location of the source data of the first programming of the layer; generating log information from the storage location of the source data and saving it in a non-volatile storage medium; during abnormal power-off recovery, reading the last two saved log information from the non-volatile storage medium; restoring the source data of the write layer where the secondary programming is not completed according to the last two saved log information and performing secondary programming on the write layer according to the source data. By reading the last two log information, the present invention can restore the source data of the last two complete write layers. Using these source data information, the secondary programming of the unstable layer can be continued, thereby reducing the amount of invalid data filled in and the relocation of data that has only been programmed once. This not only improves the utilization rate of the storage space, but also reduces the recovery time, and at the same time avoids data relocation, thereby improving the data relocation speed and further improving the overall performance and user experience of the solid-state drive. Embodiments of the present invention also provide a device for reducing the abnormal power-off recovery time of a solid-state drive, a computer-readable storage medium, and a solid-state drive, which have the above beneficial effects and will not be elaborated here. Description of the Drawings

[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0022] Figure 1 It is a schematic diagram of the recovery of abnormal power-off during the first programming of the prior art;

[0023] Figure 2 It is a schematic diagram of the recovery of abnormal power-off during the secondary programming of the prior art;

[0024] Figure 3 It is a schematic flowchart of the method for reducing the abnormal power-off recovery time of the solid-state drive in this embodiment;

[0025] Figure 4 Another flowchart diagram of the method for reducing the abnormal power-off recovery time of the solid-state drive in this embodiment;

[0026] Figure 5 A schematic diagram of the storage location of the source data in this embodiment;

[0027] Figure 6 A schematic diagram of the recovery from abnormal power-off during the first programming in this embodiment;

[0028] Figure 7 A schematic diagram of the recovery from abnormal power-off during the second programming in this embodiment;

[0029] Figure 8 A schematic block diagram of the device for reducing the abnormal power-off recovery time of the solid-state drive in this embodiment. Detailed implementation manners

[0030] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

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

[0032] 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 this 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 the plural forms.

[0033] It should be further understood that the term "and / or" used in this specification of the present invention and the appended claims refers to any combination and all possible combinations of one or more of the related listed items, and includes these combinations.

[0034] Please refer to Figure 1 and Figure 2 , Figure 1 and Figure 2Schematic diagrams of power-on recovery after abnormal power-off during the first programming and the second programming are respectively given without QLC programming source information. In this scenario, the data in the last layer (i.e., layer 1 in Figure 1 ), and part of the data in the penultimate layer (i.e., the second and third programming units of layer 0 in Figure 2 ) cannot be read normally because the second programming is not completed. In addition, the source information of these data is not clear, so the second programming cannot be performed. According to the QLC requirements, at least one layer of invalid data needs to be filled before programming can be resumed on the current block (i.e., A and B in Figure 1 and A and B in Figure 2 ), and the data of the previous first programming also needs to be re-addressed and moved again. This not only wastes storage space but also increases the recovery time.

[0035] To solve the above problems, in this embodiment, after the first writing of each layer of the QLC NAND, the location where the QLC source data is located is recorded, so that during the abnormal power-off recovery process, this embodiment can restore the source data of the last two complete written layers by reading the log information of the last two times, and then use this source data information to continue the second programming of the unstable layer (the layer where the second programming is not completed), thereby reducing the amount of invalid data filled.

[0036] Specifically, please refer to Figure 3 and Figure 4 , this embodiment provides a method for reducing the abnormal power-off recovery time of a solid-state drive, including:

[0037] S101: After the first programming of each layer of the QLC flash memory is completed, record the storage location of the source data of the first programming of this layer;

[0038] In this embodiment, each layer in the QLC block is written twice (each layer consists of multiple programming units, and the data used for the two writes of each programming unit in the layer needs to be exactly the same. The data of the programming unit that has only been programmed once or has inconsistent data for the two writes cannot be read normally). Assume that the three adjacent layers are N - 1, N, and N + 1 respectively. The programming process of layer N: first perform the first programming of layer N; then perform the second programming of layer N - 1; then perform the first programming of layer N + 1; and then perform the second programming of layer N.

[0039] Further, please refer to Figure 5 , A and B represent the QLC blocks being written, and C and D are the storage blocks for the source data used for writing A and B, where A - 0 in the 0th programming unit (C - 0) of C represents the 0th programming unit of A.

[0040] After a programming operation is completed for Layer 0 of A and B, this embodiment records the storage locations of the source data for one programming operation of Layer 0. Specifically, the storage locations of the source data for each programming unit A-0, A-1, A-2, and A-3 within Layer 0 of A are C-0, D-2, D-3, and C-6 respectively, while the storage locations of the source data for each programming unit B-0, B-1, B-2, and B-3 within Layer 0 of B are D-1, C-3, C-5, and D-7 respectively.

[0041] S102: Generate log information from the storage locations of the source data and save it to a non-volatile storage medium;

[0042] Specifically, after recording the storage locations of the source data for one programming operation of this layer, generate log information from the storage locations of the source data in an alternating top-down and left-right manner and save it to a non-volatile storage medium.

[0043] For example, after recording that the storage locations of the source data for each programming unit A-0, A-1, A-2, and A-3 within Layer 0 of A are C-0, D-2, D-3, and C-6 respectively, while the storage locations of the source data for each programming unit B-0, B-1, B-2, and B-3 within Layer 0 of B are D-1, C-3, C-5, and D-7 respectively, generate log information in an alternating top-down and left-right manner for the programming units of A and B, thereby obtaining the log information C-0, D-1, D-2, C-3, D-3, C-5, C-6, and D-7.

[0044] Generate logs in a top-down order to ensure that log entries are arranged in the programming order, facilitating quick positioning of the latest valid log during abnormal power-off recovery. Scattered storage reduces the fragmentation degree of the storage medium, improves the log reading speed, and thus shortens the recovery time.

[0045] Furthermore, only the storage locations of the source data for the last two programming operations are retained in the non-volatile storage medium (such as NAND).

[0046] For QLC NAND, the two programming operations need to be staggered and written to two layers (such as Layer 0 in A and Layer 0 in B). Retaining only the last two logs can cover all possible power-off scenarios (power-off during one programming operation or power-off during two programming operations). There is no need to store earlier historical logs, avoiding redundant data from occupying valuable NAND space.

[0047] S103: During abnormal power-off recovery, read the last two saved log information from the non-volatile storage medium;

[0048] S104: Recover the source data of the write layer for the unfinished second programming operation based on the last two saved log information and perform a second programming operation on the write layer according to the source data.

[0049] Specifically, restoring the source data of the write layer with incomplete secondary programming according to the last two saved log messages and performing secondary programming on the write layer includes:

[0050] Obtain the last programmed cell written in the QLC block to get the last programmed cell;

[0051] Determine whether the last programmed cell is at the last position of the current layer;

[0052] If the last programmed cell is at the last position of the current layer, then determine whether the current layer is the first layer (i.e., Figure 4 the judgment in

[0053] whether N is equal to 0);

[0054] If the current layer is the first layer, execute a one-time programming power-down recovery process;

[0055] If the current layer is not the first layer, execute a secondary programming power-down recovery process;

[0056]

[0057] If the last programmed cell is not at the last position of the current layer, execute a one-time programming power-down recovery process. By checking whether the last programmed cell is at the end of the current layer and whether the current layer is the first layer, it is possible to quickly distinguish whether the power-down occurred during the one-time programming stage. Without traversing all layers or logs, directly select the recovery strategy based on the current layer position and the status of the programmed cell, shortening the recovery time. If the last programmed cell is at the end of the layer and not the first layer, it means that the secondary programming has been partially completed. The source data can be directly restored using the log and the completed area can be skipped, without filling in invalid data, avoiding additional space waste. If the last programmed cell has not reached the end of the layer or the current layer is the first layer, invalid data needs to be filled in the last layer and the layer below it.

[0058]

[0059]

[0060]

[0061]

[0062] Furthermore, the one-time programming power-down recovery process includes:

[0058] Fill invalid data into the unwritten programmed cells in the current layer;

[0059] Determine whether the current layer is the first layer;

[0060] If the current layer is the first layer, fill invalid data into the next layer of the current layer;

[0061] If the current layer is not the first layer, restore the source data of the one-time programming of the layer above the current layer according to the last two saved log messages, and perform secondary programming on the layer above according to the source data of the one-time programming of the layer above.

[0062] Fill the unwritten programming units in the current layer with invalid data to meet the stability requirements of QLC NAND and prevent the interference of uncompleted programming data on subsequent writes to this block. Secondly, if the current layer is the first layer (without an upper layer), fill the layer below it with invalid data. This design avoids the cross-layer interference caused by the lack of an upper layer to recover in the first layer, ensuring that subsequent writes can proceed normally. Additionally, if the current layer is not the first layer, directly use the last two log messages to recover the source data of the upper layer, skipping the data migration step and saving time and space.

[0063] Further, after performing secondary programming on the upper layer based on the source data of a single programming of the upper layer, it includes:

[0064] Determine whether the current layer is the last layer;

[0065] If the current layer is not the last layer, fill the layer below the current layer with invalid data.

[0066] Filling with invalid data makes the layer below writable, preventing the interference of unstable data remaining due to uncompleted single programming on subsequent write operations.

[0067] In a specific application scenario, please refer to Figure 6 , obtain the last written programming unit of the QLC block, and get that the last programming unit is programming unit 6 (A-6 and B-6) of layer 1. Then fill the unwritten programming units 7 (A-7 and B-7) of layer 1 with invalid data, and then read the log information of layer 0 from the non-volatile storage medium to obtain the source data storage locations of layer 0 (i.e., C-0, D-1, D-2, C-3, D-3, C-5, C-6, and D-7); then complete the secondary programming of layer 0 (i.e., each programming unit in A and B) according to the source data storage locations of layer 0; then fill the entire layer 2 with invalid data. After filling layer 2 with invalid data, programming can then be performed in layer 3.

[0068] In this embodiment, the power failure recovery process for secondary programming includes:

[0069] Read each programming unit of the upper layer of the current layer;

[0070] Determine whether any programming unit is successfully read;

[0071] If any programming unit is successfully read, obtain the last correctly read position of the upper layer;

[0072] Set the position of the secondary programming of the upper layer to the position after skipping the maximum concurrent write units of the solid-state drive from the last correctly read position to obtain the programming position;

[0073] Restore the source data of the previous layer's first programming according to the last two saved log messages, and perform secondary programming on the previous layer from the programming position based on the source data of the previous layer's first programming;

[0074] If no programming unit is successfully read, restore the source data of the first programming of the previous layer of the current layer according to the last two saved log messages, and perform secondary programming on the previous layer based on the source data of the first programming of the previous layer.

[0075] By reading each programming unit of the previous layer, quickly determine which parts have completed secondary programming. If there are unreadable units, it means that a power failure occurred during secondary programming, and the completed areas need to be skipped. Continue programming after skipping the maximum number of concurrent write units of the solid-state drive (SSD) from the last correctly read position, avoiding repeated processing of completed units and reducing redundant operations. Secondly, if no programming unit is successfully read, it means that a power failure occurred at the beginning of secondary programming, and the source data is directly restored using the log and programming starts from the beginning.

[0076] After performing secondary programming on the previous layer based on the source data of the previous layer's first programming, it includes:

[0077] Determine whether the current layer is the last layer;

[0078] If the current layer is not the last layer, fill invalid data in the next layer of the current layer.

[0079] Filling invalid data makes the next layer writable, preventing unstable data remaining due to incomplete first programming from interfering with subsequent write operations.

[0080] In a specific application scenario, please refer to Figure 7 , read each programming unit of the previous layer (layer 0) of the current layer (layer 1), then determine that a programming unit is successfully read, then obtain the last correctly read position (A-1 and B-1) of the previous layer, and then set the secondary programming position of the previous layer (layer 0) to the position (A-3 and B-3) after skipping the maximum number of concurrent write units of the solid-state drive from the last correctly read position (A-1 and B-1) to obtain the programming position; then continue to read the log information of layer 0 from the non-volatile storage medium to obtain the source data storage position of layer 0 (i.e., C-0, D-1, D-2, C-3, D-3, C-5, C-6, and D-7); then complete the secondary programming of A-3 and B-3 according to the source data storage position of layer 0. Then normal programming can start from layer 2.

[0081] In some embodiments, the log information is divided into multiple stripes, similar to data stripes in RAID. Each stripe is distributed across different storage locations, which can be different blocks, pages of NAND flash, or different physical storage areas. For example, the log is divided into a certain size (such as 4KB per page) and stored sequentially on different physical pages, so that the log data is stored dispersedly, reducing the risk of all logs being damaged due to local failures.

[0082] Then, parity check or more complex check algorithms (such as distributed parity check in RAID 5) are used to generate check information for the log data. Taking simple parity check as an example, the parity check value of each stripe of log data is calculated and stored in a dedicated check area. If a more complex algorithm, such as double parity check in RAID 6, is used, the fault tolerance ability can be further improved, but the calculation complexity and storage overhead will increase.

[0083] In addition to striped storage and check information storage, a certain proportion of redundant log copies can also be set. These copies can be stored in different physical locations, independent of the original log data and check information. When part of the log is damaged, the redundant copies can be used as backup data for recovery.

[0084] When recovery is needed, the log information and check information are first read. The integrity of the log information is checked through a check algorithm (such as parity check calculation). If the calculated check value is inconsistent with the stored check value, it is determined that this part of the log is damaged.

[0085] When log damage is detected, recovery is performed according to the settings of the RAID-like mechanism. If parity check is used, the log data and check information of other normal stripes can be used to reconstruct the damaged log stripe through the inverse operation of parity check. If there are redundant copies, the redundant copies are preferentially used for recovery because their data accuracy is higher.

[0086] After the log is recovered, according to the original QLC write method based on the log, the key data is recovered using the recovered log information. After recovery, the integrity of the recovered data is verified again, and methods such as CRC check code or hash value can be used to ensure that the recovered data is accurate. If the verification fails, the log recovery process is checked again.

[0087] In this embodiment, after the first write of each layer of QLC NAND is completed, the storage location of the source data is saved, which can effectively reduce the filling amount of invalid data during the abnormal power-off and power-on reconstruction process, and at the same time can improve the space utilization rate of NAND and reduce the recovery time.

[0088] Please refer to Figure 8 , this embodiment provides a device 200 for reducing the abnormal power-off recovery time of a solid-state drive, including:

[0089] A recording unit 201, configured to record the source data storage location of a first programming of each layer of the QLC flash memory after the first programming of each layer is completed;

[0090] A saving unit 202, configured to generate log information from the source data storage location and save the log information into a non-volatile storage medium;

[0091] A reading unit 203, configured to read the last two saved log information from the non-volatile storage medium during abnormal power failure recovery;

[0092] A recovery unit 204, configured to recover the source data of the writing layer with uncompleted secondary programming according to the last two saved log information and perform secondary programming on the writing layer according to the source data.

[0093] Further, only the source data storage locations of the most recent two programings are retained in the non-volatile storage medium.

[0094] Further, the recovery unit 204 includes:

[0095] An obtaining subunit, configured to obtain the programming unit last written in the QLC block to obtain the last programming unit;

[0096] A position judging subunit, configured to judge whether the last programming unit is at the last position of the current layer;

[0097] A first judging subunit, configured to judge whether the current layer is the first layer if the last programming unit is at the last position of the current layer;

[0098] A first execution subunit, configured to execute a first programming power failure recovery process if the current layer is the first layer;

[0099] A second execution subunit, configured to execute a secondary programming power failure recovery process if the current layer is not the first layer;

[0100] A third execution subunit, configured to execute a first programming power failure recovery process if the last programming unit is not at the last position of the current layer.

[0101] Further, the first programming power failure recovery process includes:

[0102] A first filling subunit, configured to fill invalid data into the unwritten programming units of the current layer;

[0103] A second judging subunit, configured to judge whether the current layer is the first layer;

[0104] A second filling subunit, configured to fill invalid data into the next layer of the current layer if the current layer is the first layer;

[0105] The first programming subunit is configured to, if the current layer is not the first layer, restore the source data of a first programming of the layer above the current layer according to the last two saved log messages, and perform a second programming on the layer above according to the source data of the first programming of the layer above.

[0106] Further, the first programming subunit includes:

[0107] The third judgment subunit is configured to judge whether the current layer is the last layer;

[0108] The third filling subunit is configured to, if the current layer is not the last layer, fill invalid data into the layer below the current layer.

[0109] Further, the second programming power failure recovery process includes:

[0110] The unit reading subunit is configured to read each programming unit of the layer above the current layer;

[0111] The reading judgment subunit is configured to judge whether a programming unit is successfully read;

[0112] The position obtaining subunit is configured to, if a programming unit is successfully read, obtain the last correctly read position of the layer above;

[0113] The skipping subunit is configured to set the position of the second programming of the layer above to the position after skipping the maximum concurrent write unit number of the solid-state drive from the last correctly read position to obtain the programming position;

[0114] Restore the source data of the first programming of the layer above according to the last two saved log messages, and perform a second programming on the layer above from the programming position according to the source data of the first programming of the layer above;

[0115] The second programming subunit is configured to, if no programming unit is successfully read, restore the source data of the first programming of the layer above the current layer according to the last two saved log messages, and perform a second programming on the layer above according to the source data of the first programming of the layer above.

[0116] Further, the second programming subunit includes:

[0117] The fourth judgment subunit is configured to judge whether the current layer is the last layer;

[0118] The fourth filling subunit, if the current layer is not the last layer, fills invalid data into the layer below the current layer.

[0119] Those skilled in the art can clearly understand that for the convenience and conciseness of description, the specific working processes of the above-mentioned devices and units can refer to the corresponding processes in the foregoing method embodiments, and will not be described herein again.

[0120] The present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed, the method provided in the above embodiments can be implemented. The storage medium may include: various media such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disc, which can store program codes.

[0121] The present invention also provides a solid-state drive, which may include a memory and a processor. When the processor calls the computer program stored in the memory, the method provided in the above embodiments can be implemented. Of course, the computer device may also include various network interfaces, power supplies, and other components.

[0122] The embodiments in the specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The same or similar parts among the embodiments can be referred to each other. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple. For the relevant parts, refer to the description of the method part. It should be noted that for those of ordinary skill in the art in this technical field, without departing from the principle of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the protection scope of the claims of the present invention.

[0123] It should also be noted that in this specification, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion.

[0124] Including, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. Without more limitations, the element defined by the statement "including one..." does not exclude the existence of other identical elements in the process, method, article or device including the said element.

Claims

1. A method for reducing the recovery time of a solid state hard disk from abnormal power failure, characterized in that: include: After the first programming of each layer of the QLC flash memory is completed, the source data storage location of the first programming of the layer is recorded; Generating log information at the source data storage location and saving it in a non-volatile storage medium; When recovering from an abnormal power failure, reading the last two saved log information from the non-volatile storage medium; The source data of the writing layer that has not completed secondary programming is restored according to the log information saved for the last two times, and the writing layer is secondary programmed according to the source data.

2. The method for reducing the recovery time of abnormal power failure of a solid state drive according to claim 1, characterized in that: The non-volatile storage medium only retains the source data storage locations programmed twice most recently.

3. The method for reducing the recovery time of abnormal power failure of a solid state drive according to claim 1, characterized in that: The method of restoring the source data of the writing layer that has not completed the secondary programming according to the log information saved for the last two times and performing secondary programming on the writing layer according to the source data includes: Get the last programming unit written into the QLC block to obtain the last programming unit; Determining whether the last programming unit is at the last position of the current layer; If the last programming unit is at the last position of the current layer, determining whether the current layer is the first layer; If the current layer is the first layer, a programming power-off recovery process is performed once; If the current layer is not the first layer, executing the secondary programming power-off recovery process; If the last programming unit is not at the last position of the current layer, a programming power-off recovery process is performed once.

4. The method for reducing the recovery time of abnormal power failure of a solid state drive according to claim 3, characterized in that: The one-time programming power-off recovery process includes: Filling invalid data in unwritten programming units of the current layer; Determine whether the current layer is the first layer; If the current layer is the first layer, filling invalid data in the next layer of the current layer; If the current layer is not the first layer, the source data of the one-time programming of the previous layer of the current layer is restored according to the log information saved twice last, and the previous layer is reprogrammed according to the source data of the one-time programming of the previous layer.

5. The method for reducing the recovery time of abnormal power failure of a solid state drive according to claim 4, characterized in that: The method further comprises: performing secondary programming on the upper layer according to the source data of the primary programming of the upper layer; Determine whether the current layer is the last layer; If the current layer is not the last layer, invalid data is filled in the next layer of the current layer.

6. The method for reducing the recovery time of abnormal power failure of a solid state drive according to claim 3, characterized in that: The secondary programming power-off recovery process includes: Reading each programming unit of a layer above the current layer; Determine whether a programming unit is read successfully; If a programming unit is read successfully, the last correctly read position of the previous layer is obtained; The position of the secondary programming of the previous layer is set to the position after skipping the maximum number of concurrent write units of the solid state drive from the last correctly read position to obtain the programming position; Recovering the source data of the one-time programming of the upper layer according to the last two saved log information, and performing secondary programming on the upper layer from the programming position according to the source data of the one-time programming of the upper layer; If no programming unit is read successfully, the source data of the first programming of the previous layer of the current layer is restored according to the last two saved log information, and the previous layer is reprogrammed according to the source data of the first programming of the previous layer.

7. The method for reducing the recovery time of abnormal power failure of a solid state drive according to claim 6, characterized in that: The method further comprises: performing secondary programming on the upper layer according to the source data of the primary programming of the upper layer; Determine whether the current layer is the last layer; If the current layer is not the last layer, invalid data is filled in the next layer of the current layer.

8. A device for reducing the recovery time of abnormal power failure of a solid state hard disk, characterized in that: include: A recording unit, used for recording a source data storage location of a first programming of each layer of the QLC flash memory after the first programming of the layer is completed; A storage unit, used to generate log information of the source data storage location and save it in a non-volatile storage medium; A reading unit, used to read the last two saved log information from the non-volatile storage medium when recovering from abnormal power failure; The recovery unit is used to recover the source data of the writing layer that has not completed the secondary programming according to the log information saved for the last two times and perform secondary programming on the writing layer according to the source data.

9. A solid state drive comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the method for reducing the recovery time of abnormal power failure of a solid state drive according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the processor executes the method for reducing the recovery time of abnormal power failure of a solid state drive according to any one of claims 1 to 7.