Abnormal power-down processing method and apparatus, device, medium and product

By saving and detecting the low-level formatting status value during abnormal power failure, the data loss and performance degradation caused by the interruption of the low-level formatting process are solved, and fast recovery is achieved and the read and write performance of the solid-state drive is improved.

WO2025194825A1PCT designated stage Publication Date: 2025-09-25INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/133961
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-03-19
Filing Date
2024-11-22
Publication Date
2025-09-25

AI Technical Summary

Technical Problem

When an abnormal power outage occurs during the low-level formatting process of the solid-state drive, the low-level formatting process is interrupted, resulting in data loss and reduced read and write performance, and the formatted effect cannot be directly displayed.

Method used

The low-level formatting status value is saved in the event of an abnormal power failure, and each module detects the status after power-on to determine whether to continue or complete the corresponding low-level formatting process, avoiding repeated metadata recovery and directly presenting the formatted effect.

Benefits of technology

It reduces the power-on recovery time, improves the read and write performance of the solid-state drive, and ensures that it can still be loaded and used normally after an abnormal power outage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024133961_25092025_PF_FP_ABST
    Figure CN2024133961_25092025_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of storage, and provides an abnormal power-down processing method and apparatus, a device, a medium and a product. The method comprises: when abnormal power-down occurs in a solid-state disk in a low-level formatting process, storing the value of a low-level formatting state, processed by a low-level formatting procedure, at the abnormal power-down; in power-on and loading driving processes, each module of the solid-state disk measuring the value of the low-level formatting state; and when the value of the low-level formatting state at the abnormal power-down represents that a log manager module is executing or has completed the low-level formatting procedure, not continuing to complete the low-level formatting procedure corresponding to the log manager module. In the power-on and loading driving processes of the solid-state disk, the log manager module does not continue to complete the corresponding low-level formatting procedure, shortening the recovery time of the power-on procedure and further directly presenting the formatted effect after the power-on and loading driving processes of the solid-state disk, and thus improving the read-write performance of the solid-state disk.
Need to check novelty before this filing date? Find Prior Art

Description

Abnormal power failure processing method, device, equipment, medium and product

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims priority to the Chinese patent application filed with the China Patent Office on March 19, 2024, with application number 202410313486.8, and application name “A method, device, equipment, medium and product for handling abnormal power failure”, all contents of which are incorporated by reference into this application. Technical Field

[0003] The present application relates to the field of storage technology, and in particular to a method, device, equipment, medium and product for handling abnormal power failure. Background Art

[0004] In the event of an abnormal power outage, the energy storage capacitor in the SSD (Solid State Drive) will continue to power the SSD. Before the energy storage capacitor is exhausted, the incomplete write cache buffer and all metadata in the DDR (Double Data Rate SDRAM) will be flushed to the computer's flash memory device (Nand-flash). The energy storage capacitor can generally provide continuous power for 50-100ms. In order to ensure that the above-mentioned SSD power-off process can be completed during the abnormal power-off process, the abnormal power-off scenario needs to be considered in any scenario. Otherwise, if the abnormal power-off process of the SSD fails to be processed, data will be lost, and it may not be loaded and used normally when powered on again.

[0005] If an SSD encounters an abnormal power outage during the low-level formatting process, the low-level formatting process will be interrupted and the abnormal power outage process will be processed. However, because the low-level formatting process is a complex process, involving the L2P table (Logical to Physical Table) in DDR and the erasure of data in the computer's flash memory device, different low-level initialization processes will affect the recovery time of the SSD power-on process. Furthermore, the formatted effect cannot be directly displayed after the SSD is powered on and the driver is loaded, which affects the read and write performance of the SSD. Summary of the Invention

[0006] In view of this, the present application provides a method, device, equipment, medium and product for handling abnormal power failure.

[0007] In a first aspect of an embodiment of the present application, a method for handling abnormal power failure is provided, the method comprising:

[0008] When the solid-state drive experiences an abnormal power failure during low-level formatting, the low-level formatting state value at the time of the abnormal power failure in the low-level formatting process is saved;

[0009] When the SSD is powered on and driver loading is executed, each module of the SSD detects the value of the low-level format status;

[0010] When the value of the low-level format state at abnormal power failure indicates that the log manager module is executing or completing the low-level format process, the low-level format process corresponding to the log manager module is not continued to be completed.

[0011] In one embodiment, the method further comprises:

[0012] Before the solid-state drive performs low-level formatting, creating a first block;

[0013] The first block lists and stores a plurality of low-level formatting status values ​​included in the low-level formatting process, wherein the value of each low-level formatting status is used to represent a processing status of each module in recording the low-level formatting process.

[0014] In one embodiment, the values ​​of multiple low-level formatting states are used to represent any of the following states: low-level initialization idle, erasing information related to the L2P table and trim table in the first-level table, completing erasing information related to the L2P table and trim table in the first-level table, saving the first-level table, completing saving the first-level table, erasing the target block, completing erasing the target block, erasing the L2P table and trim table, completing erasing the L2P table and trim table, and low-level initialization completed.

[0015] In one embodiment, a solid-state drive includes at least a log manager module, a write manager module, and a data manager module. When the value of the low-level formatting state during abnormal power failure indicates that the log manager module is executing or completing a low-level formatting process, and before continuing to complete the low-level formatting process corresponding to the log manager module, the solid-state drive further includes:

[0016] During the process of the solid-state drive executing driver loading, each module determines whether to continue to complete the low-level formatting process corresponding to each module based on the value of the low-level formatting status, so that the solid-state drive presents the effect after the low-level formatting;

[0017] When the low-level formatting state is abnormally powered off, the value indicates that: when the write manager module is executing or completing the low-level formatting process, the low-level formatting process corresponding to the write manager module is continued to be completed;

[0018] When the value of the low-level format state at abnormal power failure indicates that the data manager module is executing or completing the low-level format process, the low-level format process corresponding to the data manager module is not continued to be completed.

[0019] In one embodiment, when the value of the low-level formatting state at the time of abnormal power failure indicates that the log manager module is executing or completing the low-level formatting process, the low-level formatting process corresponding to the log manager module is not continued to be completed, including:

[0020] The log manager module receives a request to execute driver loading and detects a value of a low-level formatting state in a low-level formatting process;

[0021] When it is detected that the value of the low-level formatting state in the low-level formatting process during abnormal power failure indicates that: information related to the L2P table and the trim table in the first-level table is being erased or the first-level table is being saved, the process of restoring the L2P table and the trim table in the power-on recovery process of the solid-state drive is not executed, the driver loading of the log manager module is executed normally, and the value of the low-level formatting state is set to indicate that the first-level table is saved. The formatting completion information of the log manager module is fed back to the write manager module of the solid-state drive, so that the write manager module of the solid-state drive continues to complete the corresponding low-level formatting process, so that the solid-state drive presents the effect after the low-level formatting;

[0022] When it is detected that the value of the low-level formatting status in the low-level formatting process is represented by the following at the time of abnormal power failure: except for completing the erasure of the information related to the L2P table and the trim table in the first-level table or completing the saving of other values ​​​​outside the first-level table, the driver loading of the log manager module is executed normally, and the log manager module formatting completion information is directly fed back to the write manager module of the solid-state hard disk, so that the write manager module of the solid-state hard disk continues to complete the corresponding low-level formatting process, so that the solid-state hard disk presents the effect after low-level formatting.

[0023] In one embodiment, after the log manager module feeds back the formatting completion information to the write manager module of the solid-state drive, the method further includes:

[0024] The write manager module receives the log manager module formatting completion information fed back by the log manager module;

[0025] Detecting the value of the low-level formatting state in the low-level formatting process at abnormal power failure;

[0026] When the low-level formatting state in the low-level formatting process is detected at the time of abnormal power failure, the value indicates that: when the first-level table is saved or the target block is being erased, the target block in the solid-state drive is erased and the metadata related to the target block is reset;

[0027] Updating the low-level formatting status value to indicate that the target block has been erased, and feeding back formatting completion information of the write manager module to the data manager module of the solid-state drive;

[0028] When it is detected that the value of the low-level formatting status in the low-level formatting process is represented by an abnormal power failure: except for the value of completing the saving of the first-level table or erasing the target block, the driver loading of the write manager module is executed normally, and the formatting completion information of the write manager module is fed back to the data manager module of the solid-state drive.

[0029] In one embodiment, after the write manager module feeds back the formatting completion information to the data manager module of the solid state drive, the method further includes:

[0030] The data manager module receives the write manager module formatting completion information fed back by the write manager module, and detects the value of the low-level formatting state in the low-level formatting process when the power is abnormally off;

[0031] When it is detected that the value of the low-level formatting status in the low-level formatting process at the time of abnormal power failure indicates: erasing the L2P table and trim table, completing erasing the L2P table and trim table, completing low-level initialization, or completing erasing the target block, the value of the low-level formatting status is updated to indicate that the low-level formatting is idle, and the driver loading of the data manager module is executed normally, and the formatting completion information of the data manager module is fed back to the host.

[0032] In one embodiment, the method further comprises:

[0033] After the host receives the formatting completion information from the data manager module, it determines that the low-level formatting is completed;

[0034] In the absence of abnormal power failure on the solid-state drive, the low-level formatting effect is completed by the data manager module and the write manager module;

[0035] When the solid-state drive experiences an abnormal power outage and then powers on again, the log manager module completes the low-level formatting process.

[0036] In one embodiment, when an abnormal power failure occurs during low-level formatting of the solid-state drive, saving the value of the low-level formatting state in the low-level formatting process at the time of the abnormal power failure includes:

[0037] Each module updates the low-level formatting status value in real time during the low-level formatting process;

[0038] When an abnormal power failure occurs during the low-level formatting process, the most recently updated low-level formatting status value is saved in the solid-state drive.

[0039] In one embodiment, the method further comprises:

[0040] When executing the low-level formatting process on each module of the solid-state drive, abnormal power failure detection is added;

[0041] When an abnormal power failure occurs, each module exits the low-level formatting process currently being processed and executes the power-off process of the solid-state drive.

[0042] In one embodiment, when an abnormal power failure occurs during low-level formatting of the solid-state drive, the value of the low-level formatting state at the time of the abnormal power failure in the low-level formatting process is saved, including:

[0043] Call the energy storage capacitor in the solid-state drive;

[0044] When the energy storage capacitor supplies power to the solid state drive, the value of the low-level formatting state in the low-level formatting process at the time of abnormal power failure is flushed to the computer flash memory device of the solid state drive.

[0045] In a second aspect of an embodiment of the present application, a device for handling abnormal power failure is provided, the device comprising:

[0046] a saving module configured to save the value of the low-level formatting state in the low-level formatting process at the time of abnormal power failure when an abnormal power failure occurs during the low-level formatting process of the solid-state hard disk;

[0047] a detection module configured to detect the low-level formatting status value of each module of the solid-state drive during the process of powering on the solid-state drive and executing driver loading;

[0048] The first execution module is configured to not continue to complete the low-level formatting process corresponding to the log manager module when the low-level formatting state represents a value of the low-level formatting state at abnormal power failure: the log manager module is executing or completing the low-level formatting process.

[0049] According to a third aspect of an embodiment of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the method of the first aspect.

[0050] According to a fourth aspect of the embodiments of the present application, a computer program product is provided, including a computer program, which, when executed by a processor, implements the abnormal power-off processing method of the first aspect.

[0051] According to a fifth aspect of the embodiments of the present application, a computer non-volatile readable medium is provided, on which a computer program / instruction is stored. When the computer program / instruction is executed by a processor, the method of the first aspect is implemented.

[0052] Beneficial effects of this application:

[0053] The embodiments of the present application provide a method, apparatus, device, medium, and product for handling abnormal power failures. When an abnormal power failure occurs during low-level formatting of a solid-state drive, the method can save the value of the low-level formatting status processed by the low-level formatting process at the time of the abnormal power failure. Furthermore, when the solid-state drive is powered on and driver loading is performed, each module within the solid-state drive detects the saved value of the low-level formatting status. When the value of the low-level formatting status at the time of the abnormal power failure indicates that the log manager module is executing or completing the low-level formatting process, the low-level formatting process corresponding to the log manager module is not continued.

[0054] By saving the value of the low-level formatting state and detecting the saved value of the low-level formatting state during the process of the solid-state hard disk executing driver loading in the power-on process, the low-level formatting state at the time of abnormal power failure is determined, and when the value of the low-level formatting state at the time of abnormal power failure indicates that the log manager module is executing or completing the low-level formatting process, the low-level formatting process corresponding to the log manager module is not continued. When the value of the saved low-level formatting state indicates that the log manager module is executing or completing the low-level formatting process during the process of the solid-state hard disk power-on driver loading, the low-level formatting process corresponding to the log manager module is not continued, thereby reducing the recovery time of the power-on process, further allowing the solid-state hard disk to directly present the formatted effect after powering on and executing driver loading, thereby improving the read and write performance of the solid-state hard disk. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] The drawings that constitute a part of this application are used to provide further understanding of this application. The illustrative embodiments of this application and their descriptions are used to explain this application and do not constitute improper limitations on this application.

[0056] In order to more clearly illustrate the technical solution of the present application, the following is a brief introduction to the drawings required for the description of the present application. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0057] FIG1 is a flow chart of a method for handling abnormal power failure provided by some embodiments of the present application;

[0058] FIG2 is a structural diagram of a solid-state drive provided in some embodiments of the present application;

[0059] FIG3 is a schematic diagram of a framework of an abnormal power failure processing device provided in some embodiments of the present application. DETAILED DESCRIPTION

[0060] It should be noted that, unless there is any conflict, the embodiments and features in the embodiments of this application can be combined with each other.

[0061] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0062] Enterprise-class SSDs typically employ a write cache mechanism, which is a contiguous area of ​​memory within the SSD. Computer flash memory devices perform read and write operations in units of pages. A typical SLC (Single-Level Cell) page size is 16KiB, and a TLC (Trinary-Level Cell) page size is 48KiB. Thus, the SSD receives user data and stores it sequentially in the cache (usually at a 4KiB granularity) according to a specific rule. When the total amount of user data reaches a preset upper limit (e.g., a preset integer multiple of the TLC page size), the user data in a block in the cache is flushed to the computer flash memory device.

[0063] In reality, a cache is a continuous memory space divided into pages, each of which can be considered a write cache buffer. Furthermore, SSDs require metadata for proper operation. Metadata, which is also the SSD's system data, resides in DDR during operation, such as the L2P table. When the SSD is powered off, the write cache buffer (which has stored user data but is not yet full) and all metadata in DDR must be flushed to the computer's flash memory device. When the SSD is powered on again, the metadata must be read from the computer's flash memory device and restored to DDR.

[0064] The purpose of the NVMe (Non-Volatile Memory Express, a non-volatile memory standard, is a specification for solid-state drives using PCI-E channels) formatting operation is to erase user data on the solid-state drive and modify some configuration parameters of the solid-state drive (such as metadata, etc.). It is divided into high-level formatting and low-level formatting. High-level formatting only needs to erase the L2P table and does not need to erase user data on the computer flash memory device, and the execution speed is faster; low-level formatting requires securely erasing all user data on the solid-state drive, so it will not only erase the L2P table, but also all user data on the computer flash memory device and the write cache buffer. Erasing a computer flash memory device is a long and time-consuming operation, which is related to the capacity of the solid-state drive, and is usually S-level time-consuming;

[0065] In the event of an abnormal power outage, the energy storage capacitor in the SSD (Solid State Drive) will continue to power the SSD. Before the energy storage capacitor is exhausted, the incomplete write cache buffer and all metadata in the DDR (Double Data Rate SDRAM) will be flushed to the computer flash memory device (Nand). The energy storage capacitor can generally provide power continuously for 50-100ms. In order to ensure that the above-mentioned SSD power-off process can be completed during the abnormal power-off process, the abnormal power-off scenario needs to be considered in any scenario. Otherwise, if the abnormal power-off process of the SSD fails to be processed, data will be lost, and it may not be loaded and used normally when powered on again.

[0066] If an SSD encounters an abnormal power outage during the low-level formatting process, the low-level formatting process will be interrupted and the abnormal power outage process will be processed. However, because the low-level formatting process is a complex process, involving the L2P table (Logical to Physical Table) in DDR and the erasure of data in the computer's flash memory device, different low-level initialization processes will affect the recovery time of the SSD power-on process. Furthermore, the formatted effect cannot be directly displayed after the SSD is powered on and the driver is loaded, which affects the read and write performance of the SSD.

[0067] Based on this, the present application proposes a method for handling abnormal power failure, which can solve the above technical problems.

[0068] FIG1 is a flow chart of a method for handling abnormal power failure provided in some embodiments of the present application. As shown in FIG1 , this embodiment provides a method for handling abnormal power failure, the method comprising:

[0069] In step S101, when an abnormal power failure occurs during low-level formatting of the solid-state hard disk, the value of the low-level formatting state in the low-level formatting process at the time of the abnormal power failure is saved;

[0070] In step S102, when the solid state drive is powered on and driver loading is performed, each module of the solid state drive detects the value of the low-level format state;

[0071] In step S103, when the value of the low-level formatting state at the time of abnormal power failure indicates that the log manager module is executing or completing the low-level formatting process, the low-level formatting process corresponding to the log manager module is not continued.

[0072] First, in step S101, when an abnormal power failure occurs during the low-level formatting process of the solid-state drive, the value of the low-level formatting state in the low-level formatting process at the time of the abnormal power failure is saved. In an embodiment of the present application, the solid-state drive will start to perform low-level formatting after receiving the low-level formatting process sent by the host. The low-level formatting process includes multiple steps. When an abnormal power failure occurs during the low-level formatting process of the solid-state drive, the low-level formatting will be interrupted and give way to the power-off process in the abnormal power failure process. At this time, the solid-state drive is powered by the energy storage capacitor provided by the solid-state drive, and the value of the low-level formatting state processed by the low-level formatting process at the time of the abnormal power failure is saved. The low-level formatting state is used to indicate which step the current low-level formatting process is executed to. Different low-level formatting state values ​​can be set in advance. The value of the low-level formatting state at the time of the abnormal power failure is saved in the computer flash memory device of the solid-state drive, thereby ensuring that the value of the low-level formatting state at the time of the abnormal power failure is not cleared.

[0073] The following is a detailed description of the various modules included in the solid-state drive and the various steps of the low-level formatting process. Figure 2 is a structural diagram of the solid-state drive provided in some embodiments of the present application. As shown in Figure 2, the solid-state drive includes a journal manager module (JM, Journal Manager), a data manager module (Data Manager module, Data Manager), a write manager module (Write Manager module, Write Manager), and a computer flash memory device.

[0074] Among them, the data manager module is the front-end firmware core of the solid-state drive facing the host (running on the CPU hardware core), which is mainly responsible for responding to read and write commands such as reading and writing of user data sent by the host, as well as A data manager module in commands such as formatting and power on and off. In the write process, after the data manager module moves the user data from the host memory to the write cache buffer in the solid-state drive memory, it will update the content of the L2P table as the cache entry index (cache entry index) according to the LBA. This index is equivalent to the serial number of the write cache buffer. When the solid-state drive read process hits the cache, the corresponding write cache buffer can be found through the cache entry index (cache entry index) in the L2P, and the data in the buffer can be returned to the host;

[0075] The write manager module is a firmware core (running on the CPU hardware core) responsible for flushing data from the write cache buffer to the computer's flash memory device. After the user data is flushed to the computer's flash memory device, the write manager module updates the cache entry index in the L2P table with the computer's flash memory device address. When the SSD reads data, it retrieves the computer's flash memory device address based on the LBA by looking up the L2P table. It then reads the user data from the computer's flash memory device and returns it to the host.

[0076] Furthermore, because the write manager module is designed for computer flash memory devices, it is also responsible for managing the device's blocks, including allocating free blocks and erasing used blocks. All block information is recorded in the target block information (Block Info). This target block information is also a form of metadata that resides in the DDR and is primarily updated and maintained by the write manager module.

[0077] The log manager module is responsible for managing the SSD metadata, performing runtime and power-off saving of metadata, as well as power-on recovery. Updates to the L2P table by the data manager module and the write manager module will cause changes to the L2P table, and notify the log manager module of the specific changes in the L2P table. The log manager module will then use the runtime saving mechanism to rewrite the L2P table. During the power-off process, the log manager module will save the L2P table and other metadata snapshots generated by runtime saving that have not yet been rewritten to the computer's flash memory device, which usually takes about 15ms or less. When the SSD is powered on again, the log manager module reads the L2P table and other metadata from the computer's flash memory device and restores them to the SSD's DDR.

[0078] The steps of the low-level formatting process for a solid-state drive include:

[0079] First, after the SSD receives the low-level formatting process sent by the host and passes it to the data manager module, it will clear the contents of the first-level table. The first-level table is a mapping table from JM_L2P to the computer flash memory device address generated after the log manager module writes metadata such as the L2P table to the computer flash memory device according to the 16KB snapshot size.

[0080] After the log manager module completes the formatting process, it notifies the write manager module of the completion. After receiving the formatting completion message from the log manager module, the write manager module begins to erase all computer flash memory devices containing user data and notifies the log manager module to perform runtime saving of target block info changes.

[0081] After the write manager module has erased all computer flash memory devices containing user data, it notifies the data manager module that formatting is complete. After receiving the formatting completion message from the write manager module, the data manager module begins to erase metadata such as the L2P table in the DDR. After the erasure is complete, it notifies the host that the entire formatting process is complete and begins to receive new read and write requests.

[0082] Furthermore, in step S102, when the solid-state drive is powered on and driver loading is performed, each module of the solid-state drive detects the value of the low-level formatting state. In the embodiment of the present application, after the low-level formatting state of the solid-state drive at the time of abnormal power failure is processed by the low-level formatting process, the solid-state drive is powered on again. At this time, each module included in the solid-state drive will perform driver loading in sequence. During the driver loading process, each module of the solid-state drive sequentially detects the saved low-level formatting state value at the time of abnormal power failure to determine which step the low-level initialization process has reached at the time of abnormal power failure, and determines whether each module has completed the corresponding low-level initialization step.

[0083] Finally, in step S103, when the value of the low-level formatting state at the time of abnormal power failure indicates that the log manager module is executing or completing the low-level formatting process, the low-level formatting process corresponding to the log manager module is not continued. In an embodiment of the present application, due to an abnormal power outage during the low-level formatting process, the low-level formatting process needs to give way to the power-off process of the abnormal power outage. The power-off process will flush the incomplete write cache (write cache buffer) and all metadata in the DDR (including the L2P table, trim table, etc.) to the computer flash memory device of the solid-state drive. After powering on again, the deleted metadata will be read out from the computer flash memory device and restored to the DDR. At this time, when powering on again, due to the introduction of the value of the low-level formatting state at the time of the abnormal power outage, it can be determined when power is re-on that the low-level formatting process was being executed at the time of the abnormal power outage. Therefore, the value of the low-level formatting state at the time of the abnormal power outage indicates that when the log manager module is executing or completing the low-level formatting process, the metadata (including the L2P table, trim table, etc.) has been cleared, and thus the low-level formatting process corresponding to the log manager module will not continue to be executed.

[0084] Specifically, if low-level initialization is not performed, the log manager module restores metadata such as the L2P table upon power-up by first reading the first-level table and then reading the computer's flash memory device. At this point, the log manager module clears the first-level table, including the JM_L2P information related to user data in the first-level table. After the SSD formatting process is completed, the SSD needs to continue the low-level initialization process and is powered on again. Since the Log Manager Module_L2P related to user data has been cleared, metadata such as the L2P table is no longer restored during the power-up process. The L2P table defaults to the initial DDR value of zero.

[0085] In addition, after the SSD is powered on again after an abnormal power outage, the low-level formatting effect is completed by the log manager module. Since the log manager module no longer restores metadata such as the L2P table to the DDR, when the SSD is read again, because the L2P table is empty, only empty data can be returned to the host user, thereby achieving the formatting effect and improving the read and write performance of the SSD.

[0086] Through the above embodiment, when an abnormal power failure occurs during the low-level formatting process of the solid-state hard disk, the value of the low-level formatting status processed by the low-level formatting process at the time of the abnormal power failure can be saved, and when the solid-state hard disk is powered on and the driver loading is performed, each module located in the solid-state hard disk detects the saved low-level formatting status value. When the value of the low-level formatting status at the time of the abnormal power failure indicates that the log manager module is executing or completing the low-level formatting process, the low-level formatting process corresponding to the log manager module is not continued to be completed.

[0087] By saving the value of the low-level formatting state and detecting the saved value of the low-level formatting state during the process of the solid-state hard disk executing driver loading in the power-on process, the low-level formatting state at the time of abnormal power failure is determined, and when the value of the low-level formatting state at the time of abnormal power failure indicates that the log manager module is executing or completing the low-level formatting process, the low-level formatting process corresponding to the log manager module is not continued to be completed. In the process of the solid-state hard disk powering on and driver loading, when the value of the saved low-level formatting state indicates that the log manager module is executing or completing the low-level formatting process, the low-level formatting process corresponding to the log manager module is not continued to be executed. Specifically, because metadata such as the L2P table and the trim table in the cache are not restored, the subsequent data manager module does not need to delete the metadata, which will reduce the recovery time of the power-on process. This saved time can be used for the write manager module to execute the low-level formatting process during the driver loading process, further allowing the solid-state hard disk to directly present the formatted effect after the driver loading is executed on power, thereby improving the read and write performance of the solid-state hard disk.

[0088] Optionally, the method further comprises:

[0089] Before the solid-state drive performs low-level formatting, creating a first block;

[0090] The first block lists and stores a plurality of low-level formatting status values ​​included in the low-level formatting process, wherein the value of each low-level formatting status is used to represent a processing status of each module in recording the low-level formatting process.

[0091] Specifically, in an embodiment of the present application, before the solid-state drive performs low-level formatting, it is necessary to create a first block (e.g., a Super Block) in the computer flash memory device of the solid-state drive. The first block will not be cleared during the low-level initialization process. The first block is managed by the control manager module, and multiple low-level formatting status values ​​are listed in the first block to indicate which step of the low-level initialization process is different.

[0092] Through the above embodiment, before the low-level formatting is executed, the low-level formatting states corresponding to different steps of the low-level formatting process can be listed in the first block and stored in the computer flash memory device of the solid-state drive. This facilitates each module to read the low-level formatting values ​​in the first block when it is powered on again after an abnormal power failure, and to know which step the low-level initialization was at when the abnormal power failure occurred.

[0093] Optionally, multiple low-level formatting state values ​​are used to represent any of the following states: low-level initialization idle, erasing information related to the L2P table and trim table in the first-level table, completing erasing information related to the L2P table and trim table in the first-level table, saving the first-level table, completing saving the first-level table, erasing the target block, completing erasing the target block, erasing the L2P table and trim table, completing erasing the L2P table and trim table, and low-level initialization completed.

[0094] Specifically, in an embodiment of the present application, the values ​​of multiple low-level formatting states can represent any of the following states: low-level initialization idle, erasing information related to the L2P table and trim table in the first-level table, completing erasing information related to the L2P table and trim table in the first-level table, saving the first-level table, completing saving the first-level table, erasing the target block, completing erasing the target block, erasing the L2P table and trim table, completing erasing the L2P table and trim table, and low-level initialization completed.

[0095] Specifically, when enumerating multiple low-level formatting states, the values ​​corresponding to the multiple low-level formatting states can be enumerated by using the typedef keyword to record the state nodes of the low-level formatting at different steps. The typedef keyword is as follows:

[0096] Among them, format_process_state represents the low-level formatting state. Different values ​​of the low-level formatting state in "{}" are used to represent the processing state of each module record in the low-level formatting process, including the following values:

[0097] FORMAT_IDLE=0 means low-level initialization idle;

[0098] ERASE_L2P_AND_TRIM_FIRST_TABLE_ING indicates that the information related to the L2P table and trim table in the first-level table is being erased;

[0099] ERASE_L2P_AND_TRIM_FIRST_TABLE_CPL indicates that the information related to the L2P table and trim table in the first-level table has been erased;

[0100] SAVE_ALL_FIRST_TABLE_ING indicates that the first-level table is being saved;

[0101] SAVE_ALL_FIRST_TABLE_CPL means that the first-level table is saved.

[0102] The above four low-level formatting states represent the steps performed by the log manager module.

[0103] ERASE_TLC_SUPER_BLOCK_ING indicates that the target block is being erased, where the target block is each block containing user data in the computer flash memory device;

[0104] ERASE_TLC_SUPER_BLOCK_CPL indicates that erasing of the target block is completed;

[0105] The above two low-level formatting states represent the steps performed by the write manager module.

[0106] ERASE_L2P_AND_TRIM_TABLE_ING indicates that the L2P table and trim table are being erased;

[0107] ERASE_L2P_AND_TRIM_TABLE_CPL indicates that the erasure of L2P table and trim table is completed;

[0108] The above two low-level formatting states represent the steps performed by the data manager module.

[0109] According to the above embodiment, by pre-listing the various states and corresponding values ​​included in the low-level formatting process in the first block, each module can read the low-level formatting values ​​in the first block when it is powered on again after an abnormal power failure, and know which step the low-level initialization was at when the abnormal power failure occurred.

[0110] Optionally, the solid-state drive includes at least a log manager module, a write manager module, and a data manager module, and before step S103, further includes:

[0111] During the process of the solid-state drive executing driver loading, each module determines whether to continue to complete the low-level formatting process corresponding to each module based on the value of the low-level formatting status, so that the solid-state drive presents the effect after the low-level formatting;

[0112] When the low-level formatting state is abnormally powered off, the value indicates that: when the write manager module is executing or completing the low-level formatting process, the low-level formatting process corresponding to the write manager module is continued to be completed;

[0113] When the value of the low-level format state at abnormal power failure indicates that the data manager module is executing or completing the low-level format process, the low-level format process corresponding to the data manager module is not continued to be completed.

[0114] Specifically, in the embodiment of the present application, during the process of executing driver loading on the solid-state hard disk, since the power-on order of each module is different, each module will sequentially detect the value of the low-level formatting status in the first block, and determine whether to continue to complete the low-level formatting steps corresponding to each module based on the value of the low-level formatting status during abnormal power failure, so that the solid-state hard disk can present the effect after low-level formatting.

[0115] The low-level formatting effect is manifested in two ways in the embodiments of this application: The first is achieved by the data manager module and the write manager module. When a user accesses data from a computer flash memory device, the data manager module executes the low-level formatting process, clearing the metadata in the cache, such as the L2P table, resulting in empty data being returned to the user. The second is achieved by the log manager module. If the power is abnormally cut off and then turned on again during the low-level formatting process, the metadata recovery process after powering on will not be executed. Therefore, the L2P table will remain empty. In this case, when the user accesses the computer flash memory device, the data returned to the user will also be empty.

[0116] When the value of the low-level formatting state at abnormal power failure indicates that the write manager module is executing or completing the low-level formatting process, the low-level formatting process corresponding to the write manager module continues to be completed, including clearing user data on the computer flash memory device.

[0117] When the value of the low-level formatting status during abnormal power failure indicates that: when the data manager module is executing or completing the low-level formatting process, the metadata such as the L2P table and trim table contained in the cache have been cleared during the abnormal power failure, and therefore the low-level formatting process corresponding to the data manager module will not be completed.

[0118] Through the above embodiment, when power is turned on again after an abnormal power outage, each module of the solid-state drive can sequentially detect the value of the low-level formatting status at the time of the abnormal power outage in the order in which they were powered on, and determine which step the low-level formatting process has reached based on the value of the low-level formatting status at the time of the abnormal power outage. Based on different execution steps, it is determined whether to execute the low-level formatting process corresponding to each module, thereby flexibly continuing the low-level initialization process.

[0119] Optionally, step S103 includes:

[0120] The log manager module receives a request to execute driver loading and detects a value of a low-level formatting state in a low-level formatting process;

[0121] When it is detected that the value of the low-level formatting state in the low-level formatting process during abnormal power failure indicates that: information related to the L2P table and the trim table in the first-level table is being erased or the first-level table is being saved, the process of restoring the L2P table and the trim table in the power-on recovery process of the solid-state drive is not executed, the driver loading of the log manager module is executed normally, and the value of the low-level formatting state is set to indicate that the first-level table is saved. The formatting completion information of the log manager module is fed back to the write manager module of the solid-state drive, so that the write manager module of the solid-state drive continues to complete the corresponding low-level formatting process, so that the solid-state drive presents the effect after the low-level formatting;

[0122] When it is detected that the value of the low-level formatting status in the low-level formatting process is represented by the following at the time of abnormal power failure: except for completing the erasure of the information related to the L2P table and the trim table in the first-level table or completing the saving of other values ​​​​outside the first-level table, the driver loading of the log manager module is executed normally, and the log manager module formatting completion information is directly fed back to the write manager module of the solid-state hard disk, so that the write manager module of the solid-state hard disk continues to complete the corresponding low-level formatting process, so that the solid-state hard disk presents the effect after low-level formatting.

[0123] Specifically, in the embodiment of the present application, when the power is turned on again after an abnormal power failure, the log manager module detects the value of the low-level formatting status processed by the low-level formatting process when requesting to execute driver loading. When it is detected that the value of the low-level formatting status processed by the low-level formatting process at the time of abnormal power failure indicates that: the information related to the L2P table and the trim table in the first-level table is being erased or the first-level table is being saved, that is, when the value of the low-level formatting status at the time of abnormal power failure is ERASE_L2P_AND_TRIM_FIRST_TABLE_ING or SAVE_ALL_FIRST_TABLE_ING, it indicates that when the power is turned off abnormally, the log manager module is executing the steps in the corresponding low-level initialization process, but the abnormal failure After power-on, the metadata in the cache is cleared. Therefore, after power-on again, the process of restoring the L2P table and trim table in the power-on recovery process of the solid-state drive is no longer executed, and the driver loading of the log manager module is executed normally, and the value of the low-level formatting status is set to indicate that the first-level table is saved, that is, SAVE_ALL_FIRST_TABLE_CPL, and the log manager module formatting completion information is fed back to the write manager module of the solid-state drive, wherein the log manager module formatting completion information indicates that the log manager module has completed the steps in the corresponding low-level formatting process, so that the write manager module of the solid-state drive continues to complete the corresponding low-level formatting process, so that the solid-state drive presents the effect after low-level formatting.

[0124] When the log manager module detects that the value representation of the low-level formatting status processed by the low-level formatting process during abnormal power failure is: when other values ​​other than erasing the information related to the L2P table and the trim table in the first-level table or completing saving the first-level table are completed, that is, when the values ​​other than ERASE_L2P_AND_TRIM_FIRST_TABLE_ING or SAVE_ALL_FIRST_TABLE_ING are completed, the driver loading of the log manager module is executed normally, and the formatting completion information of the log manager module is directly fed back to the write manager module of the solid-state drive, so that the write manager module of the solid-state drive continues to complete the corresponding low-level formatting process, so that the solid-state drive presents the effect after low-level formatting.

[0125] Through the above embodiment, when power is turned on again after an abnormal power outage, during the process of the log manager module executing driver loading, based on the value of the low-level formatting status processed by the saved low-level formatting process at the time of the abnormal power outage, it is determined whether to directly feedback the log manager module formatting completion information or to set the value of the low-level formatting status to indicate that the first-level table has been saved and then feedback the log manager module formatting completion. However, in either case, after powering on again, the log manager will not continue to complete the steps of the corresponding low-level formatting process, thereby reducing the recovery time of the power-on process. The saved time can be used for the write manager module to execute the low-level formatting process during the driver loading process, so that the solid-state hard disk can directly present the formatted effect after powering on and executing driver loading, thereby improving the read and write performance of the solid-state hard disk.

[0126] It should be noted that after powering on again, the log manager module cannot resume the operations of erasing the L2P table and trimming the table type JM_L2P, as well as rewriting the entire first-level table. This is because the log manager module has not yet rebuilt the management data structure of each SLC block of the computer flash memory device, and therefore has not opened an open block. More importantly, even if an open block is opened, the SLC block will be flushed, causing changes in metadata such as the block occupancy status information (SLC block info). However, if an abnormal power outage occurs, even if an emergency exit is made and the power-on completion is returned to the front end, the host may not receive the driver loading request and will not initiate the power-off process, and the capacitor will be exhausted. This will lead to the risk of block (SLC block) duplication when powering on again.

[0127] Optionally, after feeding back the formatting completion information of the log manager module to the write manager module of the solid-state drive, the method further includes:

[0128] The write manager module receives the log manager module formatting completion information fed back by the log manager module;

[0129] Detecting the value of the low-level formatting state in the low-level formatting process at abnormal power failure;

[0130] When the low-level formatting state in the low-level formatting process is detected at the time of abnormal power failure, the value indicates that: when the first-level table is saved or the target block is being erased, the target block in the solid-state drive is erased and the metadata related to the target block is reset;

[0131] Updating the low-level formatting status value to indicate that the target block has been erased, and feeding back formatting completion information of the write manager module to the data manager module of the solid-state drive;

[0132] When it is detected that the value of the low-level formatting status in the low-level formatting process is represented by an abnormal power failure: except for the value of completing the saving of the first-level table or erasing the target block, the driver loading of the write manager module is executed normally, and the formatting completion information of the write manager module is fed back to the data manager module of the solid-state drive.

[0133] Specifically, in an embodiment of the present application, when the log manager module completes the corresponding driver loading, the write manager module receives the log manager module formatting completion information fed back by the log manager module. At this time, the write manager module starts to execute the driver loading process. During the driver loading process, the value of the low-level formatting status processed by the low-level formatting process at the time of abnormal power failure is detected. When it is detected that the value of the low-level formatting status processed by the low-level formatting process at the time of abnormal power failure indicates that the first-level table has been saved or the target block is being erased, that is, when the value of the low-level formatting status at the time of abnormal power failure is SAVE_ALL_FIRST_TABLE_CPL or ERASE_TLC_SUPER_BLOCK_ING, it indicates that at the time of the abnormal power failure, the write manager module was executing the corresponding step in the low-level formatting process but was not completed. Therefore, during the driver loading process after power is turned on again, the target block in the solid-state drive is erased and the metadata related to the target block (such as block info) is reset. After the low-level formatting corresponding to the write manager module is completed, the value of the low-level formatting status is updated to indicate that the erasure of the target block is completed, and the write manager module formatting completion information is fed back to the data manager module of the solid-state drive.

[0134] When the write manager module detects that the low-level formatting status of the low-level formatting process is represented by a value other than completing the saving of the first-level table or erasing the target block at the time of abnormal power failure, it means that the write manager module has completed the corresponding steps of the low-level formatting process before the abnormal power failure. After powering on again, the driver loading of the write manager module is executed normally, and the formatting completion information of the write manager module is directly fed back to the data manager module of the solid-state drive.

[0135] Through the above embodiment, the write manager module can determine whether to continue to complete the corresponding steps of the low-level initialization process corresponding to the write manager module during the driver loading process when power is restored after an abnormal power outage based on the value of the low-level formatting state at the time of the abnormal power outage. This eliminates the need to re-execute the low-level initialization process, thereby improving the processing efficiency of the low-level initialization process after an abnormal power outage.

[0136] Optionally, after feeding back the formatting completion information of the write manager module to the data manager module of the solid state drive, the method further includes:

[0137] The data manager module receives the write manager module formatting completion information fed back by the write manager module, and detects the value of the low-level formatting state in the low-level formatting process when the power is abnormally off;

[0138] When it is detected that the value of the low-level formatting status in the low-level formatting process at the time of abnormal power failure indicates: erasing the L2P table and trim table, completing erasing the L2P table and trim table, completing low-level initialization, or completing erasing the target block, the value of the low-level formatting status is updated to indicate that the low-level formatting is idle, and the driver loading of the data manager module is executed normally, and the formatting completion information of the data manager module is fed back to the host.

[0139] Specifically, in an embodiment of the present application, when the write manager module completes the corresponding driver loading, the data manager module receives the data manager module formatting completion information fed back by the write manager module. At this time, the data manager module starts to execute the driver loading process. During the driver loading process, the value of the low-level formatting status processed by the low-level formatting process at the time of abnormal power failure is detected. When the data manager module detects that the value of the low-level formatting status processed by the low-level formatting process at the time of abnormal power failure indicates that: the L2P table and trim table are being erased, the L2P table and trim table are being erased, or the low-level initialization is completed, or the target block is erased, that is, ERASE_L2P_AND_TRIM_TABLE_ING or FORMAT_CPL or ERASE_TLC_SUPER_BLOCK_CPL, it means that all steps corresponding to the low-level formatting process have been executed. At this time, the data manager module updates the value of the low-level formatting status to indicate that the low-level formatting is idle, that is, FORMAT_IDLE, and executes the driver loading of the data manager module normally, and feeds back the data manager module formatting completion information to the host.

[0140] Through the above embodiment, the data manager module can determine whether the low-level formatting process before the abnormal power failure is completed based on the value of the low-level formatting status at the time of abnormal power failure during the driver loading process. After determining that the low-level formatting process has been completed, the low-level formatting status value is updated and fed back to the host, thereby improving the processing efficiency of low-level formatting when encountering an abnormal power failure.

[0141] Optionally, the method further comprises:

[0142] After the host receives the formatting completion information from the data manager module, it determines that the low-level formatting is completed;

[0143] In the absence of abnormal power failure on the solid-state drive, the low-level formatting effect is completed by the data manager module and the write manager module;

[0144] When the solid-state drive experiences an abnormal power outage and then powers on again, the log manager module completes the low-level formatting process.

[0145] Specifically, in the embodiment of the present application, after the host receives the formatting completion information from the data manager module, it can confirm that all steps of the low-level formatting process of the solid-state drive have been completed. At this time, it is necessary to further reflect the effect of the low-level formatting. In the embodiment of the present application, the reflection of the effect of the low-level formatting is divided into two situations:

[0146] When the SSD does not experience an abnormal power outage, the low-level formatting effect is completed by the data manager module and the write manager module. When the user reads the data from the SSD, the metadata in the SSD cache and the user data stored in the computer's flash memory device have been cleared, so what is returned to the user is empty data.

[0147] When the SSD experiences an abnormal power outage and then powers on again, the low-level formatting effect is completed by the log manager module. When the user reads the data from the SSD, the metadata in the SSD cache has been cleared. At this time, although the user data stored in the back-end computer flash memory device still exists, since the metadata has been cleared, the data returned to the user is also empty.

[0148] Through the above embodiments, after the low-level formatting is completed, different low-level formatting effects can be achieved based on whether an abnormal power failure occurs during the low-level formatting process.

[0149] Optionally, step S101 includes:

[0150] Each module updates the low-level formatting status value in real time during the low-level formatting process;

[0151] When an abnormal power failure occurs during the low-level formatting process, the most recently updated low-level formatting status value is saved in the solid-state drive.

[0152] Specifically, in the embodiment of the present application, during the low-level formatting process of each module of the solid-state drive, regardless of whether an abnormal power outage occurs, each module needs to update the value of the low-level initialization state in the first block in real time when the module completes or is executing the steps in the corresponding low-level formatting process, and when an abnormal power outage occurs during the low-level formatting process, the most recently updated low-level formatting state value is saved in the solid-state drive.

[0153] Through the above embodiment, when each model completes or is executing a step in the corresponding low-level formatting process, the value of the low-level initialization status is updated. This facilitates rapid acquisition of the progress of the low-level initialization process before the abnormal power failure when an abnormal power failure occurs, and facilitates subsequent continuation of the low-level initialization process based on the value of the low-level initialization status.

[0154] Optionally, the method further comprises:

[0155] When executing the low-level formatting process on each module of the solid-state drive, abnormal power failure detection is added;

[0156] When an abnormal power failure occurs, each module exits the low-level formatting process currently being processed and executes the power-off process of the solid-state drive.

[0157] Specifically, in the embodiment of the present application, when executing the low-level formatting process for each module of the solid-state hard disk, abnormal power failure detection is added. When an abnormal power failure occurs, each module exits the step of the low-level formatting process currently being processed, saves the value of the low-level initialization state at the time of the abnormal power failure, and executes the power-off process of the solid-state hard disk.

[0158] Through the above embodiment, it is possible to detect in real time whether an abnormal power outage occurs during the low-level formatting process of the solid-state hard disk, so that when an abnormal power outage occurs, the value of the low-level initialization state at the time of the abnormal power outage can be urgently saved, and the power-off process of the solid-state hard disk can be executed, so as to facilitate the continuation of the low-level initialization process according to the value of the low-level initialization state after the power is subsequently turned on again.

[0159] Optionally, when an abnormal power failure occurs during low-level formatting of the solid-state drive, the value of the low-level formatting state at the time of the abnormal power failure in the low-level formatting process is saved, including:

[0160] Call the energy storage capacitor in the solid-state drive;

[0161] When the energy storage capacitor supplies power to the solid state drive, the value of the low-level formatting state in the low-level formatting process at the time of abnormal power failure is flushed to the computer flash memory device of the solid state drive.

[0162] Specifically, when an abnormal power outage occurs during the low-level formatting process of the solid-state hard disk, it is necessary to immediately save the value of the low-level formatting status processed by the low-level formatting process at the time of the abnormal power outage in the power-off process of the abnormal power outage. To this end, a saving step can be added to the power-off process, and the energy storage capacitor provided in the solid-state hard disk is called to supply power for the power-off process of the abnormal power outage. When the energy storage capacitor supplies power to the solid-state hard disk, the value of the low-level formatting status processed by the low-level formatting process at the time of the abnormal power outage is flushed to the computer flash memory device of the solid-state hard disk.

[0163] Through the above embodiment, the step corresponding to saving the value of the low-formatting status processed by the low-level formatting process at the time of abnormal power failure can be added to the power-off process, and the power-off process is powered by the energy storage capacitor in the solid-state drive, so that when the power is subsequently turned on again, each module of the solid-state drive can read and detect the saved value of the low-formatting status processed by the low-level formatting process at the time of abnormal power failure.

[0164] Optionally, in an embodiment of the present application, in order to more accurately record the execution status of the low-level formatting process at the time of abnormal power failure, the first value, the second value, and the third value of the low-level formatting process at the time of abnormal power failure can be set in the first block based on the process of the write manager module erasing the user data in the computer flash memory device of the solid-state drive. The first value can be used to record the latest erased position of the write manager module in the process of erasing the user data in the computer flash memory device of the solid-state drive, the second value can be used to record the amount of user data that was not erased by the write manager module in the process of erasing the user data in the computer flash memory device of the solid-state drive, and the third value can be used to record the location of the user data that was not erased by the write manager module in the process of erasing the user data in the computer flash memory device of the solid-state drive. When power is restored after the abnormal power failure, the write manager module can quickly obtain the execution status of the low-level formatting process before the abnormal power failure based on the first value, the second value, and the third value, thereby improving the efficiency of completing the low-level formatting process after driver loading.

[0165] Optionally, in the embodiment of the present application, during the process of performing low-level formatting after powering on again after an abnormal power outage, if an abnormal power outage occurs again, the abnormal power outage is handled in the same manner as the above-mentioned processing flow.

[0166] In summary, since power is restored to the effect after low-level formatting after powering on again after an abnormal power outage, the log manager module will not restore metadata such as the L2P table and trim table, which will save a few seconds of recovery time when powering on again (for example, an 8T disk can save at least 4s of recovery time, and a large capacity will save even longer). In addition, the tolerance time for driver loading is at least 60s. Therefore, it is advisable to continue the low-level formatting process during driver loading. If an abnormal power outage occurs during the recovery process of low-level formatting, the next power-on will continue the process according to the value of the low-level formatting status at the time of the abnormal power outage. After the driver loading is completed, the read and write processes of the solid-state drive can obtain the best performance after the low-level formatting process.

[0167] FIG3 is a schematic diagram of a framework of an abnormal power failure processing device provided by some embodiments of the present application. As shown in FIG3 , the abnormal power failure processing device provided by this embodiment includes:

[0168] The saving module 11 is configured to save the value of the low-level formatting state in the low-level formatting process at the time of abnormal power failure when an abnormal power failure occurs during the low-level formatting process of the solid-state hard disk;

[0169] The detection module 12 is configured to detect the low-level formatting status value of each module of the solid-state drive during the process of powering on the solid-state drive and performing driver loading;

[0170] The first execution module 13 is configured to not continue to complete the low-level formatting process corresponding to the log manager module when the low-level formatting state at abnormal power failure represents that the log manager module is executing or completing the low-level formatting process.

[0171] Optionally, the device further comprises:

[0172] A creation module configured to create a first block before the solid-state drive performs a low-level format;

[0173] The enumeration module is configured to enumerate and save multiple low-level formatting status values ​​included in the low-level formatting process in the first block, wherein the value of each low-level formatting status is used to represent the processing status of each module in recording the low-level formatting process.

[0174] The values ​​of multiple low-level formatting states are used to represent any of the following states: low-level initialization idle, erasing information related to the L2P table and trim table in the first-level table, completing erasing information related to the L2P table and trim table in the first-level table, saving the first-level table, completing saving the first-level table, erasing the target block, completing erasing the target block, erasing the L2P table and trim table, completing erasing the L2P table and trim table, and low-level initialization completed.

[0175] Optionally, the solid-state drive includes at least a log manager module, a write manager module, and a data manager module, and the device further includes:

[0176] a judgment module configured to judge, during the process of the solid-state drive executing driver loading, whether to continue to complete the low-level formatting process corresponding to each module based on the value of the low-level formatting state, so that the solid-state drive presents the effect after the low-level formatting;

[0177] The second execution module is configured to, when the value of the low-level formatting state at the time of abnormal power failure indicates that: when the write manager module is executing or completing the low-level formatting process, continue to complete the low-level formatting process corresponding to the write manager module;

[0178] The third execution module is configured to not continue to complete the low-level formatting process corresponding to the data manager module when the value of the low-level formatting state at abnormal power failure indicates that the data manager module is executing or completing the low-level formatting process.

[0179] Optionally, the first execution module 13 includes:

[0180] The first detection unit is configured to receive a request for executing driver loading from the log manager module and detect a value of a low-level formatting state in a low-level formatting process;

[0181] The first execution unit is configured to, when detecting that a value of a low-level formatting state in a low-level formatting process indicates that information related to an L2P table and a trim table in a first-level table is being erased or that the first-level table is being saved, not execute a process of restoring the L2P table and the trim table in a power-on recovery process of the solid-state drive, execute driver loading of the log manager module normally, set the value of the low-level formatting state to indicate that the first-level table is saved, and feed back formatting completion information of the log manager module to a write manager module of the solid-state drive, so that the write manager module of the solid-state drive continues to complete the corresponding low-level formatting process, so that the solid-state drive presents the effect after the low-level formatting;

[0182] The second execution unit is configured to, when detecting the value representation of the low-level formatting status in the low-level formatting process at the time of abnormal power failure: except for completing the erasure of the information related to the L2P table and the trim table in the first-level table or completing the preservation of other values ​​other than the first-level table, normally execute the driver loading of the log manager module, and directly feed back the log manager module formatting completion information to the write manager module of the solid-state hard disk, so that the write manager module of the solid-state hard disk continues to complete the corresponding low-level formatting process, so that the solid-state hard disk presents the effect after low-level formatting.

[0183] Optionally, the device further comprises:

[0184] a receiving module configured to, after feeding back the log manager module formatting completion information to the write manager module of the solid state drive, receive the log manager module formatting completion information fed back by the log manager module;

[0185] A second detection unit is configured to detect a value of a low-level formatting state in a low-level formatting process when power is abnormally lost;

[0186] The third execution unit is configured to, when detecting that the low-level formatting state in the low-level formatting process is at a value representation of abnormal power failure: when the first-level table is completed or the target block is being erased, erase the target block in the solid-state drive and reset metadata related to the target block;

[0187] A first updating unit is configured to update the low-level formatting state value to indicate that the erasing of the target block is completed, and feed back formatting completion information of the write manager module to the data manager module of the solid-state drive;

[0188] The fourth execution unit is configured to, when detecting the value representation of the low-level formatting status in the low-level formatting process at the time of abnormal power failure: except for the value of completing the saving of the first-level table or erasing the target block, normally execute the driver loading of the write manager module and feed back the formatting completion information of the write manager module to the data manager module of the solid-state drive.

[0189] Optionally, the device further comprises:

[0190] a third detection unit configured to, after feeding back the write manager module formatting completion information to the data manager module of the solid-state drive, cause the data manager module to receive the write manager module formatting completion information fed back by the write manager module, and detect a value of a low-level formatting state in a low-level formatting process at the time of abnormal power failure;

[0191] The fifth execution unit is configured to update the value of the low-level formatting status to indicate that the low-level formatting is idle, and execute the driver loading of the data manager module normally, and feed back the data manager module formatting completion information to the host when it is detected that the low-level formatting status in the low-level formatting process has a value indicating that the L2P table and the trim table are being erased, the erasure of the L2P table and the trim table is completed, the low-level initialization is completed, or the erasure of the target block is completed.

[0192] Optionally, the device further comprises:

[0193] a determining unit configured to determine that the low-level formatting is completed after the host receives the formatting completion information from the data manager module;

[0194] A first low-level formatting effect completing unit is configured to complete the low-level formatting effect by the data manager module and the write manager module when there is no abnormal power failure on the solid-state hard disk;

[0195] The second low-level formatting effect completing unit is configured to complete the low-level formatting effect by the log manager module when the solid-state hard disk experiences abnormal power failure and then powers on again.

[0196] Optionally, the saving module 11 includes:

[0197] The second updating unit is configured to update the value of the low-level formatting state in real time when each module is performing the low-level formatting;

[0198] The saving unit is configured to save the value of the most recently updated low-level formatting state in the solid-state hard disk when an abnormal power failure occurs during the low-level formatting process.

[0199] Optionally, the device further comprises:

[0200] a fourth detection unit configured to add abnormal power failure detection when each module of the solid-state drive performs a low-level formatting process;

[0201] The sixth execution unit is configured to, when an abnormal power failure occurs, cause each module to exit the low-level formatting process currently being processed and execute the power-off process of the solid-state drive.

[0202] Optionally, the saving module 11 includes:

[0203] The calling module is configured to call the energy storage capacitor in the solid-state drive;

[0204] The flashing module is configured to flash the low-level formatting state value in the low-level formatting process at the time of abnormal power failure to the computer flash memory device of the solid-state drive when the energy storage capacitor supplies power to the solid-state drive.

[0205] Based on the same inventive concept, other embodiments of the present application further provide an electronic device, comprising a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the abnormal power-off processing method as described in any of the above embodiments.

[0206] Based on the same inventive concept, some other embodiments of the present application further provide a computer program product, including a computer program, which is executed by a processor to implement the abnormal power-off processing method described in any of the above embodiments.

[0207] Based on the same inventive concept, other embodiments of the present application further provide a computer non-volatile readable medium on which a computer program is stored, wherein when the program is executed by a processor, the abnormal power-off processing method as described in any of the above embodiments is implemented.

[0208] As for the device, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0209] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0210] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, devices, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0211] The present application embodiment is described with reference to the flow chart and / or block diagram of the method, terminal device (system), and computer program product according to the embodiment of the present application. It should be understood that each process and / or box in the flow chart and / or block diagram and the combination of the process and / or box in the flow chart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing terminal device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device produce a device for realizing the function specified in one process or multiple processes and / or one box or multiple boxes of the flow chart.

[0212] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.

[0213] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce computer-implemented processing, so that the instructions executed on the computer or other programmable terminal device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.

[0214] Although preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they become aware of the basic inventive concepts. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.

[0215] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only 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 "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or terminal device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or terminal device that includes the element.

[0216] The above is a detailed introduction to the abnormal power-off processing method, device, equipment, medium and product provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, based on the ideas of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A method for handling abnormal power failure, characterized in that: The method comprises: When an abnormal power failure occurs on the solid-state hard disk during low-level formatting, saving the value of the low-level formatting state in the low-level formatting process at the time of the abnormal power failure; During the process of powering on the solid state drive and executing driver loading, each module of the solid state drive detects the value of the low-level formatting state; When the value of the low-level formatting state at abnormal power failure indicates that the log manager module is executing or completing the low-level formatting process, the low-level formatting process corresponding to the log manager module is not continued.

2. The abnormal power failure processing method according to claim 1, characterized in that: The method further comprises: Before executing the low-level formatting on the solid-state drive, creating a first block; Multiple low-level formatting status values ​​included in the low-level formatting process are listed and saved in the first block, wherein each low-level formatting status value is configured to represent a processing status of each module recording the low-level formatting process.

3. The abnormal power failure processing method according to claim 2, characterized in that: The values ​​of the multiple low-level formatting states are configured to represent any of the following states: low-level initialization idle, erasing information related to the L2P table and the trim table in the first-level table, completing erasing information related to the L2P table and the trim table in the first-level table, saving the first-level table, completing saving the first-level table, erasing the target block, completing erasing the target block, erasing the L2P table and the trim table, completing erasing the L2P table and the trim table, and low-level initialization completed.

4. The abnormal power failure processing method according to claim 1, characterized in that: The solid-state drive includes at least a log manager module, a write manager module, and a data manager module. When the value of the low-level formatting state during abnormal power failure indicates that the log manager module is executing or completing a low-level formatting process, and before continuing to complete the low-level formatting process corresponding to the log manager module, the solid-state drive further includes: During the process of executing driver loading on the solid-state hard disk, each module determines whether to continue to complete the low-level formatting process corresponding to each module based on the value of the low-level formatting state, so that the solid-state hard disk presents the effect after the low-level formatting; When the value of the low-level formatting state at abnormal power failure indicates that: when the write manager module is executing or completing the low-level formatting process, the low-level formatting process corresponding to the write manager module is continued to be completed; When the value of the low-level formatting state at abnormal power failure indicates that the data manager module is executing or completing the low-level formatting process, the low-level formatting process corresponding to the data manager module is not continued to be completed.

5. The abnormal power failure processing method according to claim 3, characterized in that: The value of the low-level formatting state during abnormal power failure indicates that when the log manager module is executing or completing the low-level formatting process, the low-level formatting process corresponding to the log manager module is not continued to be completed, including: The log manager module receives the request to execute the driver loading, and detects the value of the low-level formatting state in the low-level formatting process; When it is detected that the value of the low-level formatting state in the low-level formatting process during abnormal power failure indicates that: when the information related to the L2P table and the trim table in the first-level table is being erased or the first-level table is being saved, the process of restoring the L2P table and the trim table in the power-on recovery process of the solid-state drive is not executed, the driver loading of the log manager module is performed normally, and the value of the low-level formatting state is set to indicate that the saving of the first-level table is completed, and the log manager module formatting completion information is fed back to the write manager module of the solid-state drive, so that the write manager module of the solid-state drive continues to complete the corresponding low-level formatting process, so that the solid-state drive presents the effect after the low formatting; When it is detected that the value of the low-level formatting status in the low-level formatting process is represented by: except for the completion of erasing the information related to the L2P table and the trim table in the first-level table or the completion of saving other values ​​​​other than the first-level table, the driver loading of the log manager module is executed normally, and the formatting completion information of the log manager module is directly fed back to the write manager module of the solid-state hard disk, so that the write manager module of the solid-state hard disk continues to complete the corresponding low-level formatting process, so that the solid-state hard disk presents the effect after low-level formatting.

6. The abnormal power failure processing method according to claim 5, characterized in that: After feeding back the log manager module formatting completion information to the write manager module of the solid state drive, the method further includes: The write manager module receives the log manager module formatting completion information fed back by the log manager module; detecting a value of a low-level formatting state in the low-level formatting process when power is abnormally lost; When it is detected that the value of the low-level formatting state in the low-level formatting process at the time of abnormal power failure indicates that: when the first-level table is saved or the target block is being erased, the target block in the solid-state drive is erased and metadata related to the target block is reset; Updating the low-level formatting status value to indicate that erasing of the target block is completed, and feeding back formatting completion information of the write manager module to the data manager module of the solid-state drive; When it is detected that the value of the low-level formatting status in the low-level formatting process at the time of abnormal power failure is: except for the value of completing the saving of the first-level table or the value of erasing the target block, the driver loading of the write manager module is executed normally, and the write manager module formatting completion information is fed back to the data manager module of the solid state drive.

7. The abnormal power failure processing method according to claim 6, characterized in that: After feeding back the formatting completion information of the write manager module to the data manager module of the solid state drive, the method further includes: The data manager module receives the write manager module formatting completion information fed back by the write manager module, and detects the value of the low-level formatting state in the low-level formatting process at the time of abnormal power failure; When it is detected that the value of the low-level formatting status in the low-level formatting process during abnormal power failure represents: erasing the L2P table and trim table, completing erasing the L2P table and trim table, completing low-level initialization, or completing erasing the target block, the value of the low-level formatting status is updated to represent that the low-level formatting is idle, and the driver loading of the data manager module is performed normally, and the data manager module formatting completion information is fed back to the host.

8. The abnormal power failure processing method according to claim 7, characterized in that: The method further comprises: After the host receives the formatting completion information from the data manager module, determining that the low-level formatting is completed; In the case that there is no abnormal power failure on the solid state drive, the effect of the low-level formatting is completed by the data manager module and the write manager module; When the solid state drive experiences an abnormal power outage and is then powered on again, the low-level formatting effect is completed by the log manager module.

9. The abnormal power failure processing method according to claim 1, characterized in that: When an abnormal power failure occurs during low-level formatting of the solid-state hard disk, saving the value of the low-level formatting state in the low-level formatting process at the time of the abnormal power failure includes: Each module of the solid-state drive updates the value of the low-level formatting status in real time during the process of executing the low-level formatting; When an abnormal power failure occurs during the low-level formatting process, the value of the most recently updated low-level formatting state is saved in the solid-state hard disk.

10. The abnormal power failure processing method according to claim 1, characterized in that: The method further comprises: When each module of the solid-state hard disk executes the low-level formatting process, abnormal power failure detection is added; When an abnormal power failure occurs, each module exits the low-level formatting process currently being processed and executes the power-off process of the solid-state hard disk.

11. The abnormal power failure processing method according to claim 1, characterized in that: When an abnormal power failure occurs during low-level formatting of the solid-state hard disk, saving the value of the low-level formatting state in the low-level formatting process at the time of the abnormal power failure includes: Calling the energy storage capacitor in the solid-state hard disk; When the energy storage capacitor supplies power to the solid state drive, the value of the low-level formatting state in the low-level formatting process at the time of abnormal power failure is flushed to the computer flash memory device of the solid state drive.

12. The abnormal power failure processing method according to claim 4, characterized in that: The process of continuing to complete the low-level formatting corresponding to the write manager module includes: Clears user data on the computer's flash memory device, which is the solid-state drive.

13. The abnormal power failure processing method according to claim 2, characterized in that: The first block is not cleared during the low-level formatting process.

14. The abnormal power failure processing method according to claim 7, characterized in that: The low-level initialization idle, erasing the information related to the L2P table and the trim table in the first-level table, completing erasing the information related to the L2P table and the trim table in the first-level table, saving the first-level table, and completing saving the first-level table represent the steps performed by the log manager module.

15. The abnormal power failure processing method according to claim 7, characterized in that: The erasing of the target block and the completion of erasing the target block represent steps performed by the write manager module.

16. The abnormal power failure processing method according to claim 7, characterized in that: The erasing of the L2P table and the trim table and the completion of erasing the L2P table and the trim table represent steps performed by the data management module.

17. An abnormal power failure processing device, characterized in that: The device comprises: a saving module configured to save the value of the low-level formatting state in the low-level formatting process at the time of abnormal power failure when an abnormal power failure occurs during the low-level formatting process of the solid-state hard disk; a detection module configured to detect the value of the low-level formatting state of each module of the solid-state drive during the process of powering on the solid-state drive and performing driver loading; The first execution module is configured to not continue to complete the low-level formatting process corresponding to the log manager module when the value of the low-level formatting state at abnormal power failure indicates that the log manager module is executing or completing the low-level formatting process.

18. An electronic device, characterized in that: The system comprises a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the abnormal power failure processing method according to any one of claims 1 to 16.

19. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the abnormal power failure processing method according to any one of claims 1 to 16 is implemented.

20. A non-volatile computer readable medium, characterized in that: A computer program is stored thereon, wherein when the computer program is executed by a processor, the abnormal power failure processing method according to any one of claims 1 to 16 is implemented.

Citation Information

Patent Citations

  • Recording method of log, recovering method of log and log manager

    CN103744939A

  • Quick reconstruction mechanism for metadata cache on basis of metadata log

    CN103902479A

  • Method, system and device for shortening SSD power-on recovery time and storage medium

    CN110647295A

  • Abnormal power failure processing method, device, equipment, medium and product

    CN117931091A

  • Method for auto-formatting a hard disk drive for a computer system

    US5269018A