Power-on reconstruction method and device and solid-state hard disk

By applying for bad page cache for Superblock and marking bad pages when the solid-state drive loses power abnormally, and reading and writing valid data, the problem of data loss caused by abnormal power failure is solved, and data security and power-on recovery time are shortened.

CN113296694BActive Publication Date: 2025-10-03ALIBABA GROUP HOLDING LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202011268545.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-13
Publication Date
2025-10-03
Estimated Expiration
2040-11-13

AI Technical Summary

Technical Problem

When a solid-state drive experiences an abnormal power outage, how can we ensure the security of written data while shortening the power-on recovery time to avoid data loss and write amplification caused by the abnormal power outage?

Method used

When the SSD experiences an abnormal power outage, a bad page cache is requested for the large Superblock where the abnormal power outage occurred. Uncorrectable error pages are marked as bad pages, and valid data is read and written to the flash memory. Data security is ensured through bad page bitmap management and checkpoint information.

Benefits of technology

During the power-on reconstruction process, only valid data associated with the bad page needs to be moved to ensure data security, while reducing power-on recovery time, lowering write amplification, and improving data stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113296694B_ABST
    Figure CN113296694B_ABST
Patent Text Reader

Abstract

The present application discloses a power-on reconstruction method and apparatus, and a solid-state drive. By marking a page with an uncorrectable error during an abnormal power-off process as a bad page in an embodiment of the present application, during the power-on reconstruction process, for a large block (Super block) that has experienced an abnormal power-off, only valid data in the page associated with the bad page needs to be moved. This reduces power-on recovery time and write amplification while ensuring data security.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to, but is not limited to, storage technology, and in particular to a power-on reconstruction method and device and a solid-state hard drive. Background Art

[0002] Consumer-grade solid-state drives (SSDs) lack capacitor protection. If an abnormal power loss (an unsafe power loss) occurs while writing data on the SSD, and if an uncorrectable error (unecc error) occurs within the same word-line page as a result of the power loss, the data in that word-line page will become unstable. The valid data in that word-line page must be moved as quickly as possible to prevent data loss. For example, in NAND Flash, a word-line page is a page contained within a word line in the NAND Flash array.

[0003] In the related art, after the SSD rebuild table is completed, it is necessary to move all valid data of the entire super block where the power loss occurred, and then mark the rebuild completed. Otherwise, new super blocks will be continuously opened after back-to-back abnormal power outages. This will result in no free blocks being available. In other words, moving all valid data of the entire super block will increase the SSD power-on rebuild recovery time. Among them, the super block is a stripe (also called a logical block) composed of blocks with the same block ID in the flash translation layer (FTL) large block mapping. How to ensure that all valid data that needs to be moved in the SSD is not affected by the power loss, that is, to ensure the security of the written data, and to reduce the SSD power-on rebuild recovery time, is an urgent problem that needs to be solved. Summary of the Invention

[0004] The present application provides a method and device for implementing power-on reconstruction and a solid-state hard disk, which can ensure the security of written data while shortening the power-on recovery time.

[0005] An embodiment of the present invention provides a power-on reconstruction method, comprising:

[0006] During the power-on recovery process of an abnormal power failure of the solid-state drive (SSD), a bad page cache is requested for the large Superblock that experienced the abnormal power failure, and pages with uncorrectable errors in the Superblock are marked as bad pages.

[0007] The marked bad page and valid data in pages related to the bad page are read and written into the flash memory of the SSD.

[0008] In an exemplary embodiment, before the SSD is powered on again after an abnormal power failure, the method further includes:

[0009] When the SSD is initialized, a bad page buffer for storing a bad page bitmap is allocated in units of the Super block;

[0010] The allocated bad page cache is divided into bad page bitmap areas corresponding to several super blocks. Each bad page bitmap area is used to record the quality of the corresponding page in a bitmap manner.

[0011] In an exemplary embodiment, applying for a bad page cache for a Super Block that experiences abnormal power failure and marking a page in the Super Block that has an uncorrectable error as a bad page includes:

[0012] Applying for the bad page cache for the Super Block that experiences abnormal power failure;

[0013] Update the page with uncorrectable error to the bad page bitmap corresponding to the Super block where it is located, and set the abnormal power-off flag in the block information corresponding to the page;

[0014] Update the corresponding bad page bitmap to the requested bad page cache.

[0015] In an exemplary embodiment, before marking the abnormal power failure flag in the block information corresponding to the Super Block where the abnormal power failure occurs, the method further includes:

[0016] Read the most recently written checkpoint information and the last written page;

[0017] If the uncorrectable error occurs in the last written page, continue to execute the step of applying for a bad page cache for the Superblock where the abnormal power failure occurs; wherein the checkpoint information includes a mapping table, block information, and a bad page bitmap.

[0018] In an exemplary embodiment, setting the abnormal power failure flag in the block information corresponding to the Super Block where the abnormal power failure occurs includes:

[0019] If the abnormal power failure flag of the Super block has been set, obtain the bad page bitmap corresponding to the Super block and update the faulty page;

[0020] If the abnormal power failure flag of the Super block is not set, apply for a new bad page cache, update the Super block identifier, and change the state to used; set the abnormal power failure flag in the block information of the Super block where the page is located.

[0021] In an exemplary embodiment, before reading the valid data in the bad page and the pages related to the bad page and writing them into the SSD flash memory, the method further includes:

[0022] It is determined that valid data exists in the bad page and pages related to the bad page.

[0023] In an exemplary embodiment, determining whether valid data exists in a bad page and a page related to the bad page includes:

[0024] Rebuilding the mapping table after the SSD is powered on;

[0025] After the mapping table is rebuilt, the word line page related to the bad page is read, and the mapping table is checked based on the logical block address LBA information recorded in the metadata to determine whether there is valid data.

[0026] In an exemplary embodiment, reading the valid data in the bad page and pages related to the bad page and writing the valid data into the SSD flash memory includes:

[0027] After the SSD is powered on and the bad page cache is updated, reading valid data in a page associated with the word line where the bad page is located;

[0028] The read valid data is written into the SSD flash memory.

[0029] In an exemplary embodiment, writing the read valid data into the SSD flash memory includes:

[0030] Write the read valid data into the current Super block;

[0031] If the current Super block is full, a new Super block is opened to continue writing.

[0032] In an exemplary embodiment, when the Super Block where the abnormal power failure occurs is full, the method further includes:

[0033] Detecting the remaining available amount of the bad page cache, and when the remaining available amount reaches a preset threshold, moving the valid data in the Super Block where the abnormal power failure occurs;

[0034] After the effective data is moved, the Super block where the abnormal power failure occurs is erased;

[0035] Clear the abnormal power-off flag of the erased Super block, reclaim the bad page cache requested by the Super block where the abnormal power-off occurs, and update the bad page management information.

[0036] An embodiment of the present application further provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute any of the above-mentioned methods for implementing power-on reconstruction.

[0037] An embodiment of the present application further provides a device for implementing power-on reconstruction, including a memory and a processor, wherein the memory stores the following instructions that can be executed by the processor: used to execute the steps of any of the above-mentioned methods for implementing power-on reconstruction.

[0038] The embodiment of the present application further provides a power-on reconstruction device, comprising: an application module and a processing module; wherein,

[0039] The application module is configured to apply for a bad page cache for the Super Block that has experienced an abnormal power failure during a power-on recovery process of the SSD to which the module belongs, and mark the page with an uncorrectable error in the Super Block as a bad page;

[0040] The processing module is configured to read the marked bad page and valid data in the page related to the bad page and write the data into the SSD flash memory.

[0041] In an exemplary embodiment, a pre-processing module is further included, configured to:

[0042] When the SSD to which it belongs is initialized, a bad page cache for storing the bad page bitmap is allocated in units of the Super block; the allocated bad page cache is divided into bad page bitmap areas corresponding to several Super blocks respectively, and each bad page bitmap area is used to record the quality of the corresponding page in a bitmap manner.

[0043] In an exemplary embodiment, the application module is specifically configured as follows:

[0044] Applying for the bad page cache for the Super Block that experiences abnormal power failure;

[0045] Update the page with uncorrectable error to the bad page bitmap corresponding to the Super block where it is located, and set the abnormal power-off flag in the block information corresponding to the page;

[0046] Update the corresponding bad page bitmap to the requested bad page cache.

[0047] In an exemplary embodiment, the application module is further configured to:

[0048] Read the checkpoint information of the most recent safe write and read the last written page; if the last written page has the uncorrectable error, continue to execute the step of applying for a bad page cache for the Super Block that has experienced abnormal power failure; wherein the checkpoint information includes a mapping table, block information, and a bad page bitmap.

[0049] In an exemplary embodiment, the setting module is specifically configured to:

[0050] If the abnormal power failure flag of the Super block has been set, obtain the bad page bitmap corresponding to the Super block and update the faulty page;

[0051] If the abnormal power failure flag of the Super block is not set, apply for a new bad page cache, update the Super block identifier, and change the state to used; set the abnormal power failure flag in the block information of the Super block where the page is located.

[0052] In an exemplary embodiment, the processing module is specifically configured to:

[0053] After the SSD is powered on and the bad page cache is updated, valid data in a page related to the word line where the bad page is located is read; and the read valid data is written into the SSD flash memory.

[0054] In an exemplary embodiment, the processing module is further configured to:

[0055] Determine that valid data exists in the bad page and pages related to the bad page, continue to read the valid data in the bad page and pages related to the bad page, and write the read valid data into the SSD flash memory according to the position of the current write point of the SSD.

[0056] In an exemplary embodiment, the processing module writes the read valid data into the SSD flash memory, including:

[0057] The read valid data is written into the current Super block; if the current Super block is full, a new Super block is opened to continue writing.

[0058] In an exemplary embodiment, the processing module is further configured to:

[0059] When the Super Block where the abnormal power failure occurs is full, the remaining available amount of the bad page cache is detected. When the remaining available amount reaches a preset threshold, the valid data in the Super Block where the abnormal power failure occurs is moved;

[0060] After the effective data is moved, the Super block where the abnormal power failure occurs is erased;

[0061] Clear the abnormal power-off flag of the erased Super block, reclaim the bad page cache requested by the Super block where the abnormal power-off occurs, and update the bad page management information.

[0062] An embodiment of the present application further provides a solid-state hard disk, comprising any of the power-on reconstruction devices described above.

[0063] In the embodiment of the present application, pages that have uncorrectable errors during an abnormal power failure and their associated pages are marked as bad pages. Thus, during the power-on reconstruction process, for the block that has experienced the abnormal power failure, only valid data in the pages associated with the bad page needs to be moved. This ensures data security, reduces power-on recovery time, and reduces write amplification.

[0064] In an exemplary embodiment, when a block experiences abnormal power failure, the FTL encounters a page associated with the badpage during a subsequent write process and fills the page with invalid (dummy) data to avoid writing valid data into the unstable page.

[0065] In an exemplary embodiment, the bad page is added to the checkpoint of the SSD. In this way, when the SSD is powered on, it is ensured that the reconstruction strategy that relies on the SSD can obtain the latest bad page.

[0066] Other features and advantages of the present invention will be described in the following description, and in part will become apparent from the description, or will be understood by practicing the present invention. The purposes and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0067] The accompanying drawings are used to provide a further understanding of the technical solution of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the technical solution of the present application and do not constitute a limitation on the technical solution of the present application.

[0068] Figure 1 This is a flowchart of the power-on reconstruction method in an embodiment of the present application;

[0069] Figure 2 This is a schematic diagram of the process of implementing power-on reconstruction in an embodiment of the present application;

[0070] Figure 3 This is a schematic diagram of bad page management in an embodiment of the present application;

[0071] Figure 4 Schematic diagram of the SSD bad page flush strategy in an embodiment of the present application;

[0072] Figure 5 A schematic diagram of the implementation process of an embodiment of the present application for achieving effective data migration;

[0073] Figure 6 Schematic diagram of the structure of the power-on reconstruction device in an embodiment of the present application. DETAILED DESCRIPTION

[0074] To make the purpose, technical solutions and advantages of this application more clear, the embodiments of this application will be described in detail below with reference to the accompanying drawings. It should be noted that, unless there is a conflict, the embodiments and features in the embodiments of this application can be combined with each other in any way.

[0075] In a typical configuration of the present application, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.

[0076] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.

[0077] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include non-transitory media such as modulated data signals and carrier waves.

[0078] The steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions. Also, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be performed in an order different from that shown here.

[0079] SSDs without capacitor protection, such as open-channel SSDs (OCSSDs), can experience data write anomalies during an abnormal power outage. Writing to a data block will no longer occur, and instead the entire block's valid data will be moved away before being erased. The data can then be reused. The inventors of this application discovered that this approach requires that all valid data in the block that experienced the uncorrectable error after the abnormal power outage be moved before marking the rebuild complete. This significantly increases power-on recovery time, increases write amplification (WA), and accelerates wear of SSD flash memory, such as Nand Flash (a type of flash memory).

[0080] Therefore, the embodiment of the present application provides a power-on reconstruction method, such as Figure 1 As shown, combined Figure 2 The schematic diagram of the process of implementing power-on reconstruction in the embodiment of the present application shown includes:

[0081] Step 100: During the power-on recovery process of an abnormal power failure of the SSD, a bad page cache is requested for the superblock where the abnormal power failure occurred, and pages with uncorrectable errors in the superblock are marked as bad pages.

[0082] In this step, the page with uncorrectable error in the Super Block where abnormal power failure occurred is marked as a bad page, and a bad page cache is applied for it. This prepares for the subsequent migration of only valid data in the page associated with the bad page for the Super Block where abnormal power failure occurred.

[0083] In an exemplary embodiment, before step 100, the following steps may also be included:

[0084] During SSD initialization, a bad page buffer for storing a bad page bitmap is allocated in units of Super blocks. For example, the bad page buffer can be a continuous memory space such as Double Data Rate (DDR) storage space.

[0085] The allocated bad page buffer is divided into bad page bitmap areas corresponding to several super blocks. Each bad page bitmap area is used to record the quality of the corresponding super page in a bitmap manner, for example: 0 represents a good page, and 1 represents a bad page. Figure 3 As shown, Figure 3 This is a schematic diagram of badpage management in an embodiment of the present application.

[0086] In one exemplary embodiment, several Super Block Bad Page Buffers may be included, and a power loss tag may be added to the block info to indicate whether an abnormal power loss has occurred. Block info is primarily used to record Super Block-related information, such as the write / erase count (pec), valid page count (vpc), next block ID (next block id), previous block ID (pre block id), type (type), and read count (read cnt).

[0087] In one exemplary embodiment, step 100 may include:

[0088] Apply for bad page buffer for the Super block that has abnormal power failure;

[0089] Update the page with the unecc error to the bad page bitmap corresponding to the super block where it is located, and set the power loss flag in the super block info corresponding to the page to 1;

[0090] Update the bad page bitmap to the requested bad page buffer.

[0091] Here, for the page with the unecc error, the power loss flag in the corresponding Super block info is set, the page with the unecc error is updated to the bad page bitmap corresponding to the Super block where it is located, and the bad page bitmap is updated to the applied bad page buffer.

[0092] In an exemplary embodiment, when the SSD is powered on and restored, before marking the power loss flag bit in the block info corresponding to the super block where the power loss occurs, the following steps may be further performed:

[0093] Read the most recently written checkpoint information, including mapping tables such as the Logical to Physical Address Table (L2P), block info, badpage bitmap, and system information, and read the last written page. If the last written page has a UNECC error, continue to step 100.

[0094] It should be noted that in this embodiment of the present application, after the SSD is powered on and rebuilt, the latest checkpoint is flushed. The latest checkpoint includes the latest bad page buffer, that is, the bad page is added to the SSD's checkpoint. During SSD runtime, the checkpoint has its own flushing and recycling strategy, ensuring that as long as an available checkpoint is found during power-on and rebuild, the latest bad page buffer can be read. Figure 4 Schematic diagram of the SSD bad page flush strategy in the embodiment of the present application, as shown in FIG. Figure 4As shown in the figure, the mapping table, journal information, block information, and bad page buffer are written (Flush) into the NAND flash as a check point.

[0095] In an exemplary embodiment, setting a power loss flag in block info corresponding to a super block where power loss occurs may include:

[0096] If the power loss flag of the Super block has been set, it means that the Super block has experienced abnormal power failure before. Then, the process further includes: obtaining the bad page bitmap corresponding to the Super block, updating the bad page bitmap corresponding to the error page, and setting the bad page bitmap corresponding to the error page to be marked as a bad page.

[0097] If the power loss flag of the Super block is not set, apply for a new bad page buffer, update the Super block ID, and change the status to used; set the power loss flag in the blockinfo of the Super block where the page is located to 1.

[0098] Here, whether a new bad page buffer needs to be applied is determined based on whether the power loss flag of the Super block has been set.

[0099] Step 101: Read the marked bad page and valid data in the pages related to the bad page and write them into the SSD flash memory.

[0100] This step, based on the mark in step 100, only moves the valid data in the page associated with the bad page to the SSD flash memory for the Super block that has experienced abnormal power failure.

[0101] In an exemplary embodiment, this step may include:

[0102] After the SSD is powered on and the bad page buffer is updated, the valid data in the page related to the word-line where the bad page is located is read;

[0103] Write the read valid data into the SSD flash memory.

[0104] Here, the valid data in the bad page can be read by determining the amount of data to be read based on the amount of data written each time. Generally, writing one page stripe (i.e., all Die pages corresponding to the same page number) at a time is more efficient. Therefore, the valid data corresponding to one page stripe is read at a time.

[0105] In the embodiment of the present application, only the valid data in the bad page of the Super block where the abnormal power failure occurs is moved, ensuring the security of the data written in the bad page; the valid data in the good page of the Super block where the abnormal power failure occurs will not be moved, and the Super block where the abnormal power failure occurs will continue to write data.

[0106] In an exemplary embodiment, before step 101, the following steps may also be included:

[0107] Determine whether there is valid data in the bad page and pages related to the bad page. If it is determined that there is valid data in the bad page and pages related to the bad page, proceed to step 101.

[0108] Step 101 may include: reading valid data in a bad page, and writing the read valid data into an SSD flash memory such as Nand Flash according to the position of a current write point of the SSD.

[0109] Here, before writing valid data into the SSD flash memory, it is confirmed that valid data exists in the bad page and pages related to the bad page.

[0110] In an exemplary embodiment, determining whether valid data exists in a bad page and pages related to the bad page may include:

[0111] Rebuild the mapping table after the SSD is powered on;

[0112] After the mapping table is rebuilt, the word-line page associated with the bad page is read. The mapping table is then checked against the logical block address (LBA) information recorded in the metadata to determine whether the current data is valid. In other words, if the LBA information recorded in the metadata matches that in the mapping table, valid data is present; otherwise, no valid data is present. Meta refers to additional information associated with the data, such as the data's write timestamp and LBA information.

[0113] Here, how to determine whether there is valid data in the bad page and the pages related to the bad page according to the mapping table is given.

[0114] In an exemplary embodiment, writing the read valid data into an SSD flash memory such as Nand Flash may include:

[0115] Write the valid data read into the current Super block. If the Super block is full, open a new Super block to continue writing to prevent the valid data in the word-line page from being lost due to abnormal power failure.

[0116] Here, when writing the read valid data into the SSD flash memory, attention will be paid to whether the Super block is full to prevent the valid data in the word-line page from being lost due to abnormal power failure.

[0117] In an exemplary embodiment, a Super Block that experiences an abnormal power failure can continue to be used if the word-line where the bad page is located is not fully written, that is, there is a good page in the word-line page range associated with the bad page that can be written to data. In this case, the word-line page is also called an unclosed word-line page. When the page within the word-line page range is subsequently written (that is, the FTL is writing the remaining pages), invalid data (pad dummy) such as invalid data with no practical meaning needs to be filled in to prevent data loss due to the influence of abnormal power failure after writing valid data. When all valid data in the bad page is read and written, the power-on rebuild process ends.

[0118] The power-on reconstruction method provided by the embodiments of the present application allows write operations to continue after the power-on reconstruction of a Super Block that has experienced power loss, without the need to open a new block to complete the write operation. This ensures the security of the written data and shortens the power-on recovery time.

[0119] In an exemplary embodiment, when the Super Block where abnormal power failure occurs is full, the following steps are further included:

[0120] Detect the remaining available number of bad page buffers. When the remaining available number reaches a preset threshold, move the valid data in the super block where the abnormal power failure occurred.

[0121] After the effective data is moved, the Super block where the abnormal power failure occurred is erased;

[0122] Clear the power loss flag of the erased Super block, reclaim the bad page buffer requested by the Super block that has experienced abnormal power failure, update the bad page management information, and clear the bad page information to indicate that all are normal pages. The Super block is restored to normal use.

[0123] Here, it is further proposed that when the Super block where abnormal power failure occurs is full, the Super block where abnormal power failure occurs will be erased and the bad page buffer requested by the Super block where abnormal power failure occurs will be recovered after the valid data in the Super block where abnormal power failure occurs is moved, thereby ensuring the reuse of resources.

[0124] It should be noted that the normal power-on recovery process includes the reconstruction process of the mapping table, block info table, etc. In the embodiment of the present application, when the normal power-on recovery is completed and the valid data in the bad page and its associated pages are moved away, the power-on recovery can be considered to be completed.

[0125] By marking the page where unecc occurs during an abnormal power failure as a bad page in the embodiment of the present application, during the power-on reconstruction process, for the block where the abnormal power failure occurs, only valid data in the page associated with the bad page needs to be moved. This ensures data security, reduces power-on recovery time, and reduces write amplification.

[0126] Furthermore, in the embodiment of the present application, when a block experiences abnormal power failure, the FTL encounters a page associated with the bad page during a subsequent write process and fills the page with dummy data, thereby avoiding writing valid data into the unstable page.

[0127] Furthermore, the bad page in the embodiment of the present application is added to the check point of the SSD. In this way, when the SSD is powered on, it is ensured that the reconstruction strategy relying on the SSD can obtain the latest bad page.

[0128] The present application also provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute any of the above power-on reconstruction methods.

[0129] The present application further provides a power-on reconstruction device, comprising a memory and a processor, wherein the memory stores the following instructions executable by the processor: for executing the steps of any one of the above-mentioned power-on reconstruction methods.

[0130] Figure 5 This is a schematic diagram of the implementation process of the embodiment of the present application to achieve effective data migration, such as Figure 5 As shown, the bad page on the SSD in this embodiment is applied to SSD products without capacitor protection, including:

[0131] Step 500: When the SSD is initialized, a bad page buffer is allocated in units of Super blocks, and a power loss flag is added to the blockinfo information.

[0132] The allocation of bad page buffers may include bad page buffers of several super blocks; and a power loss tag indicating whether power loss occurs will be added to the block info.

[0133] For example, assume a super block contains 2304 super pages. The status of each super page is represented by a single bit. For example, a bit of 0 indicates a good super page, while a bit of 1 indicates a bad super page. Therefore, the bad page buffer size of this super block is 288 bytes. A 16KB Nand plane page can store the bad page buffers of 56 super blocks. These allocated bad page buffers are recycled, initially in the free state and then changed to the used state after being requested. When the number of free bad page buffers (free bad page buffers) decreases to the preset threshold, the used bad page buffers (used bad page buffers) need to be released one by one, and the valid data of the Supper block corresponding to the bad page buffer in the used state is moved to another Super block. Then, the Supper block with the valid data moved away is erased. After the erasure is successful, the power loss tag of the block info is cleared, the bad page buffer is initialized to all 0s, and the state of the bad page buffer is changed back to free.

[0134] When the SSD is powered on and restored, it reads the most recently written checkpoint information, including the mapping table, block info, bad page bitmap, and system information. It also reads the last written page. If a unecc error occurs in the last written page, the page error information is updated in the bad page bitmap corresponding to the super block. The power loss flag in the super block info for that page is set to 1.

[0135] It should be noted that if the power loss tag of the Super block has been set, it means that the Super block has experienced abnormal power failure before. In this case, the process also includes: obtaining the bad page bitmap corresponding to the Super block, updating the erroneous page, and setting the bad page bitmap corresponding to the erroneous page, such as marking it as a bad page.

[0136] If the power loss tag of the Super block is not set, apply for a new bad page buffer, update the Super block id, change the status to used; set the power loss flag in the Super block info where the page is located to 1.

[0137] Step 501: During the power-on recovery process after an abnormal power failure of the SSD, apply for free bad page buffer, update the bad page buffer according to the page with the unecc error, read the valid data in the word-line page and rewrite it to the current Super block.

[0138] After the SSD is powered on and the bad page buffer is updated, the valid data in the page related to the word-line where the bad page is located is read; the read valid data is written to the SSD Nand flash.

[0139] In one embodiment, the mapping table is rebuilt after the SSD is powered on. After the mapping table is rebuilt, the word-line page related to the bad page is read, and the mapping table is checked based on the LBA information recorded in the Meta to determine whether the current data is valid. If the LBA information recorded in the Meta is consistent with that in the mapping table, it is determined to be valid data, and the valid data is read and written to the current Super block. If the Super block is full, a new block is opened to continue writing to prevent the valid data in the word-line page from being lost due to abnormal power failure.

[0140] It should be noted that after the unstable data is rewritten, the current Super Block can continue to be used. If the page being written is within the word-line page range associated with the bad page, dummy data is required to prevent data loss due to an abnormal power outage after writing valid data. When all valid data in the bad page is read and written, the power-on rebuild process ends.

[0141] Step 502: The Bad page buffer is flushed to the Nand flash according to the check point policy.

[0142] In this embodiment of the present application, the bad page buffer is added to the checkpoint. Therefore, after the SSD is powered on and rebuilt, the latest checkpoint is flushed. The latest checkpoint includes the latest bad page buffer, meaning that the bad page is added to the SSD's checkpoint. During SSD runtime, the checkpoint has its own flushing and recycling strategy, ensuring that the latest bad page buffer can be read as long as an available checkpoint is found during power-on and rebuild.

[0143] Figure 6 FIG. 1 is a schematic diagram of the structure of the power-on reconstruction device in an embodiment of the present application. Figure 5 As shown, it at least includes: an application module and a processing module; wherein,

[0144] The application module is configured to apply for bad page cache for the Super Block that experienced abnormal power failure during the power-on recovery process of the SSD to which it belongs, and mark the pages with uncorrectable errors in the Super Block as bad pages;

[0145] The processing module is configured to read the marked bad page and valid data in the page related to the bad page and write the valid data into the SSD flash memory.

[0146] In an exemplary embodiment, the apparatus for implementing power-on recovery in the embodiment of the present application may further include: a pre-processing module configured to:

[0147] During SSD initialization, a bad page buffer is allocated per super block to store bad page bitmaps. The allocated bad page buffer is divided into several bad page bitmap areas corresponding to each super block. Each bad page bitmap area uses a bitmap to record the quality of the corresponding super page. This area can include several super block bad page buffers. A power loss flag is added to the block info to indicate whether an abnormal power outage has occurred.

[0148] In an exemplary embodiment, the application module is specifically configured as follows:

[0149] Apply for bad page buffer for the Super block that has abnormal power failure;

[0150] Update the page with the unecc error to the bad page bitmap corresponding to the super block where it is located, and set the power loss flag in the super block info corresponding to the page to 1;

[0151] Update the bad page bitmap to the requested bad page buffer.

[0152] In an exemplary embodiment, the application module is further configured to:

[0153] Read the most recently written checkpoint information; read the last written page and determine whether the last written page has a unecc error.

[0154] In an exemplary embodiment, marking the power loss flag bit in the block info corresponding to the super block where power loss occurs in the setting module may include:

[0155] If the power loss tag of the Super block has been set, it means that the Super block has experienced abnormal power failure before. Then, obtain the bad page bitmap corresponding to the Super block and update the error page. Set the bad page bitmap corresponding to the error page, such as marking it as a bad page.

[0156] If the power loss tag of the Super block is not set, apply for a new bad page buffer, update the Super block id, change the status to used; set the power loss flag in the Super block info where the page is located to 1.

[0157] In an exemplary embodiment, the processing module is specifically configured to:

[0158] After the SSD is powered on and the bad page buffer is updated, the valid data in the page related to the word-line where the bad page is located is read; the read valid data is written to the SSD flash memory.

[0159] In the embodiment of the device for implementing power-on recovery of the present application, only the valid data in the bad page of the Superblock where the abnormal power failure occurred is moved, thereby ensuring the security of the data written in the bad page; the valid data in the good page of the Superblock where the abnormal power failure occurred will not be moved, and the Superblock where the abnormal power failure occurred will continue to write data.

[0160] In an exemplary embodiment, the processing module is further configured to: determine whether there is valid data in the bad page and the pages related to the bad page; if it is determined that there is valid data in the bad page and the pages related to the bad page, continue to read the valid data in the bad page and the pages related to the bad page, and write the read valid data into the SSD flash memory such as Nand Flash according to the position of the current write point of the SSD.

[0161] In an exemplary embodiment, determining whether valid data exists in the bad page and pages related to the bad page in the processing module may include:

[0162] Rebuild the mapping table after the SSD is powered on;

[0163] After the mapping table is rebuilt, the word-line page related to the bad page is read. The mapping table is then checked based on the LBA information recorded in the meta to determine whether the current data is valid. In other words, if the LBA information recorded in the meta is consistent with that in the mapping table, it is determined that valid data exists; otherwise, it is determined that no valid data exists.

[0164] In an exemplary embodiment, writing the read valid data into an SSD flash memory such as NandFlash in the processing module may include:

[0165] Write the valid data read into the current Super block. If the Super block is full, open a new Super block to continue writing to prevent the valid data in the word-line page from being lost due to abnormal power failure.

[0166] The power-on reconstruction device provided in the embodiments of the present application allows write operations to continue after the power-on reconstruction of a Super Block that has experienced power loss, without the need to open a new block to complete the write operation. This ensures the security of the written data and shortens the power-on recovery time.

[0167] In an exemplary embodiment, when the Super Block where abnormal power failure occurs is full, the processing module may be further configured to:

[0168] Detect the remaining available number of bad page buffers. When the remaining available number reaches a preset threshold, move the valid data in the super block where the abnormal power failure occurred.

[0169] After the effective data is moved, the Super block where the abnormal power failure occurred is erased;

[0170] Clear the power loss flag of the erased Super block, reclaim the bad page buffer requested by the Super block that has experienced abnormal power failure, update the bad page management information, and clear the bad page information to indicate that all are normal pages. The Super block is restored to normal use.

[0171] By marking the page where unecc occurs during an abnormal power failure as a bad page in the embodiment of the present application, during the power-on reconstruction process, for the block where the abnormal power failure occurs, only valid data in the page associated with the bad page needs to be moved. This ensures data security, reduces power-on recovery time, and reduces write amplification.

[0172] Furthermore, in the embodiment of the present application, when a block experiences abnormal power failure, the FTL encounters a page associated with the bad page during a subsequent write process and fills the page with dummy data, thereby avoiding writing valid data into the unstable page.

[0173] Furthermore, the bad page in the embodiment of the present application is added to the check point of the SSD. In this way, when the SSD is powered on, it is ensured that the reconstruction strategy relying on the SSD can obtain the latest bad page.

[0174] An embodiment of the present application also provides a solid-state hard disk, comprising any of the above-mentioned power-on reconstruction devices.

[0175] Although the embodiments disclosed in this application are as described above, the contents described are merely embodiments adopted to facilitate understanding of this application and are not intended to limit this application. Any person skilled in the art to which this application belongs may make any modifications and changes in the form and details of the implementation without departing from the spirit and scope disclosed in this application. However, the scope of patent protection of this application shall still be based on the scope defined by the attached claims.

Claims

1. A power-on reconstruction method, comprising: During the power-on recovery process of an abnormal power failure of the solid-state drive (SSD), a bad page cache is requested for the large super block that has experienced the abnormal power failure, and pages with uncorrectable errors in the super block are marked as bad pages. Reading valid data from a marked bad page and a page related to the bad page and writing the data into a flash memory of the SSD, wherein the page related to the bad page is a page related to a word line where the bad page is located; Before the SSD is powered on again after an abnormal power failure, the method further includes: allocating a bad page cache for storing a bad page bitmap in units of the super block during SSD initialization; dividing the allocated bad page cache into bad page bitmap areas corresponding to a plurality of super blocks, each bad page bitmap area being used to record the quality of the corresponding page in a bitmap manner; The method further includes: if the word-line where the bad page is located is not fully written, invalid data needs to be filled when writing to a page within the word-line page range.

2. The power-on reconstruction method according to claim 1, wherein: The step of applying for a bad page cache for the Super Block that experiences abnormal power failure and marking the page with an uncorrectable error in the Super Block as a bad page includes: Applying for the bad page cache for the Super Block that experiences abnormal power failure; Update the page with uncorrectable error to the bad page bitmap corresponding to the Super block where it is located, and set the abnormal power failure flag in the block information corresponding to the page; Update the corresponding bad page bitmap to the requested bad page cache.

3. The power-on reconstruction method according to claim 2, wherein: Setting the abnormal power-off flag bit in the block information corresponding to the page includes: If the abnormal power failure flag of the Super block has been set, obtain the bad page bitmap corresponding to the Super block and update the faulty page; If the abnormal power failure flag of the Super block is not set, apply for a new bad page cache, update the Super block identifier, and change the state to used; set the abnormal power failure flag in the block information of the Super block where the page is located.

4. The power-on reconstruction method according to claim 1 , before reading the valid data in the bad page and pages related to the bad page and writing them into the SSD flash memory, further comprising: It is determined whether valid data exists in the bad page and pages related to the bad page, and it is determined that valid data exists in the bad page and pages related to the bad page.

5. The power-on reconstruction method according to claim 4, wherein: The determining whether there is valid data in the bad page and the pages related to the bad page includes: Rebuilding the mapping table after the SSD is powered on; After the mapping table is rebuilt, the page related to the bad page is read, and the mapping table is checked based on the logical block address LBA information recorded in the metadata to determine whether there is valid data.

6. The power-on reconstruction method according to claim 1 or 4, wherein: The reading of valid data from the bad page and pages related to the bad page and writing the data into the SSD flash memory includes: After the SSD is powered on and the bad page cache is updated, reading valid data from a page related to the word line where the bad page is located; The read valid data is written into the SSD flash memory.

7. The power-on reconstruction method according to claim 1, wherein: Writing the read valid data into the SSD flash memory includes: Write the read valid data into the current Super block; If the current Super block is full, a new Super block is opened to continue writing.

8. The power-on reconstruction method according to claim 1, further comprising: Detecting the remaining available amount of the bad page cache, and when the remaining available amount reaches a preset threshold, moving the valid data in the Super Block where the abnormal power failure occurs; After the effective data is moved, the Super block where the abnormal power failure occurs is erased; Clear the abnormal power-off flag of the erased Super block, reclaim the bad page cache applied for by the Super block where the abnormal power-off occurs, and update the bad page management information. 9 . A computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute the power-on reconstruction method according to claim 1 .

10. A device for implementing power-on reconstruction, comprising a memory and a processor, wherein: The memory stores the following instructions that can be executed by the processor: used to execute the steps of the power-on reconstruction method according to any one of claims 1 to 8.

11. A power-on reconstruction device, comprising: Application module, processing module; among them, an application module configured to apply for a bad page cache for the Super Block that experienced the abnormal power failure during a power-on recovery process of the SSD to which the application module belongs, and mark a page in the Super Block that has an uncorrectable error as a bad page, wherein the page associated with the bad page is a page associated with the word line where the bad page is located; a processing module configured to read the marked bad page and valid data in pages related to the bad page and write the data into the SSD flash memory; The device also includes a pre-processing module configured to: allocate a bad page cache for storing a bad page bitmap in units of the super block when the SSD to which the device belongs is initialized; divide the allocated bad page cache into bad page bitmap areas corresponding to a plurality of super blocks, each bad page bitmap area being used to record the quality of the corresponding page in a bitmap manner; The processing module is further configured to fill invalid data when writing to a page within the word-linepage range if the word-line where the bad page is located is not fully written.

12. The power-on reconstruction device according to claim 11, wherein: The application module is specifically configured as follows: Applying for the bad page cache for the Super Block that experiences abnormal power failure; Update the page with uncorrectable error to the bad page bitmap corresponding to the Super block where it is located, and set the abnormal power-off flag in the block information corresponding to the page; Update the corresponding bad page bitmap to the requested bad page cache.

13. The power-on reconstruction device according to claim 12, wherein the setting module is specifically configured to: If the abnormal power failure flag of the Super block has been set, obtain the bad page bitmap corresponding to the Super block and update the faulty page; If the abnormal power failure flag of the Super block is not set, apply for a new bad page cache, update the Super block identifier, and change the state to used; set the abnormal power failure flag in the block information of the Super block where the page is located.

14. The power-on reconstruction device according to claim 11, wherein the processing module is specifically configured to: After the SSD is powered on and the bad page cache is updated, valid data in a page related to the word line where the bad page is located is read; and the read valid data is written into the SSD flash memory.

15. The power-on reconstruction device according to claim 14, wherein the processing module is further configured to: Determine that valid data exists in the bad page and pages related to the bad page, continue to read the valid data in the bad page and pages related to the bad page, and write the read valid data into the SSD flash memory according to the position of the current write point of the SSD.

16. The power-on reconstruction device according to claim 11, wherein: Writing the read valid data into the SSD flash memory in the processing module includes: The read valid data is written into the current Super block; if the current Super block is full, a new Super block is opened to continue writing.

17. The power-on reconstruction device according to claim 11, wherein the processing module is further configured to: when the Super Block where the abnormal power failure occurred is full, detect the remaining available amount of the bad page cache, and when the remaining available amount reaches a preset threshold, move the valid data in the Super Block where the abnormal power failure occurred; After the effective data is moved, the Super block where the abnormal power failure occurs is erased; Clear the abnormal power-off flag of the erased Super block, reclaim the bad page cache applied for by the Super block where the abnormal power-off occurs, and update the bad page management information.

18. A solid state hard disk comprising the power-on reconstruction device according to any one of claims 11 to 17.

Citation Information

Patent Citations

  • Method and system for establishing RAID in SSD

    CN105573681A

  • NAND flash memory invalid data recovery power-down protection method

    CN107992431A

  • Bad block table establishment method and related device

    CN108804045A

  • A method for handle data block errors of a solid state hard disk

    CN109460371A