Power-off protection method, system and storage medium
By using custom NVMe Admin commands in the RAID controller to identify and select NVMe SSD for data persistence storage, the problems of high hardware costs and limited reliability in the prior art are solved, and low-cost and high-reliability power-down protection is achieved.
Patent Information
- Application Number
- CN202510712209.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-30
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2045-05-30
AI Technical Summary
In the prior art, the power-down protection solution of RAID controllers is expensive in hardware and has limited component reliability. The supercapacitor group needs large capacity to supply power. NAND Flash is prone to failure, resulting in data loss and system inconsistency.
Send custom NVMe Admin commands to the NVMe SSD through the RAID controller, identify and select target NVMe SSDs with power-down protection capabilities, and use its persistent memory area to store data, eliminating dependence on supercapacitors and exclusive NAND flash memory.
Reduces the overall deployment cost of power-down protection, improves system reliability and data security, simplifies hardware design and system integration, and reduces the risk of data loss.
Smart Images

Figure CN120260646B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of data storage, and particularly to a power-off protection method, system, and storage medium. Background Art
[0002] In modern storage systems, the Redundant Array of Independent Disks (RAID) controller, as the core component for data storage management, plays a crucial role in ensuring data integrity and system reliability with its power-off data protection function. In critical business scenarios (such as financial transaction systems, medical information systems, etc.), a sudden power outage may lead to the loss of cached data that has not been completed for disk writing, thereby causing serious consequences such as data inconsistency and RAID array crashes, which poses strict requirements on the disaster recovery capabilities of storage systems.
[0003] In the prior art, a power-off protection solution based on hardware redundancy is usually adopted: when an abnormal power-off is detected, the RAID controller provides temporary power supply through an integrated large-capacity supercapacitor bank to migrate the data to be written in the Dynamic Random Access Memory (DRAM) to the on-board NAND Flash non-volatile memory for persistent storage. After the system resumes power supply, the controller executes the data write-back process to reload the data temporarily stored in the NAND Flash into the cache and complete the final hard disk writing operation.
[0004] However, this technical solution has significant defects: (1) high hardware costs, as the supercapacitor bank needs to have sufficient capacity to maintain the power supply for the entire data dump process, and its procurement cost increases exponentially with the capacity requirement; (2) component reliability limitations, NAND Flash is limited by the physical write / erase cycle (P / E Cycle) and is prone to storage unit failures in frequent power-off scenarios. Summary of the Invention
[0005] Embodiments of this application provide a power-off protection method, system, and storage medium, which can reduce the overall deployment cost of power-off protection and improve the reliability of components.
[0006] The technical solution of the embodiments of this application is implemented as follows:
[0007] In a first aspect, embodiments of this application provide a power-off protection method, and the method includes: the RAID controller sends a first command to at least one candidate NVMe SSD, and the first command is configured based on the information of the data to be stored by the RAID controller in the case of power-off.
[0008] The RAID controller receives a second command sent by the candidate NVMe SSD based on the first command; the second command is used to indicate whether the candidate NVMe SSD has the ability to migrate data with power loss protection;
[0009] The RAID controller parses the second command to obtain a parsing result;
[0010] In the event of a power loss, the RAID controller selects a target NVMe SSD from the at least one candidate NVMe SSD, and the target NVMe SSD is used to store the data to be stored;
[0011] Configure the SSD register based on the information of the data to be stored;
[0012] Based on the configuration of the SSD register, store the data to be stored in the persistent memory area of the target NVMe SSD;
[0013] In response to the end of storing the data to be stored in the persistent memory area of the target NVMe SSD, send a notification message to the target NVMe SSD, and the notification message is used to indicate that the candidate NVMe SSD stores the data to be stored in the NAND flash of the target NVMe SSD.
[0014] In some embodiments, the operation code of the first command is used to indicate whether it has the characteristic of migrating data with power loss protection;
[0015] The first field of the first command is used to indicate the size of the data to be stored.
[0016] In some embodiments, the status code of the second command is used to indicate whether the candidate NVMe SSD has the characteristic of migrating data with power loss protection;
[0017] The second field of the second command is used to indicate whether the candidate NVMe SSD with the characteristic of migrating data with power loss protection has the ability to migrate data with power loss protection.
[0018] In some embodiments, in response to the end of storing the data to be stored in the persistent memory area of the target NVMe SSD, the method further includes:
[0019] The RAID controller modifies the configuration of the SSD register to indicate the end of data backup.
[0020] In some embodiments, before storing the data to be stored in the persistent memory area of the target NVMe SSD based on the configuration of the SSD register, the method further includes:
[0021] The RAID controller sends a backup message to the target NVMe SSD; the backup message is used to instruct the target NVMe SSD to perform data backup, and the backup message includes the size of the data to be stored.
[0022] In some embodiments, the SSD register at least includes a third field, a fourth field, and a fifth field for indicating data backup enable; the configuring the SSD register based on the information of the data to be stored includes:
[0023] Configuring the third field based on the size of the data to be stored in the information of the data to be stored;
[0024] Configuring the fourth field based on the process of storing the data to be stored in the persistent memory area of the target NVMe SSD.
[0025] In some embodiments, the method further includes:
[0026] The NVMe SSD polls to read the configuration of the SSD register;
[0027] In response to the fourth field indicating that the RAID controller has started backing up the data to be stored, the NVMe SSD reads the third field;
[0028] The NVMe SSD determines a backup time threshold based on the third field and the bandwidth of the PCIe high-speed link between the target NVMe SSD and the RAID controller.
[0029] In some embodiments, if the fourth field does not indicate the end of data backup within the backup time threshold, it is determined that the storage of the data to be stored in the target NVMe SSD fails.
[0030] In some embodiments, in response to the fourth field indicating the end of data backup, the method further includes:
[0031] The target NVMe SSD stores the data to be stored from the persistent memory area to the NAND flash of the target NVMe SSD through the ONFI high-speed interface.
[0032] In a second aspect, an embodiment of the present application provides a power failure protection system, the power failure protection system at least includes a solid-state drive controller, and the solid-state drive controller includes:
[0033] A sending module, configured to send a first command to at least one candidate NVMe SSD, where the first command is configured based on the information of the data to be stored by the RAID controller in the case of power failure;
[0034] A receiving module, configured to receive a second command sent by the candidate NVMe SSD based on the first command; the second command is used to indicate whether the candidate NVMe SSD has the ability to migrate data with power-off protection.
[0035] A parsing module, configured to parse the second command to obtain a parsing result.
[0036] A selection module, configured to, when a power-off occurs, the RAID controller selects a target NVMe SSD from the at least one candidate NVMe SSD, and the target NVMe SSD is used to store the data to be stored.
[0037] A configuration module, configured to configure the SSD register based on the information of the data to be stored.
[0038] A data backup module, configured to store the data to be stored in the persistent memory area of the target NVMe SSD based on the configuration of the SSD register.
[0039] The sending module is further configured to, in response to the end of storing the data to be stored in the persistent memory area of the target NVMe SSD, send a notification message to the target NVMe SSD, and the notification message is used to instruct the candidate NVMe SSD to store the data to be stored in the NAND flash of the target NVMe SSD.
[0040] In some embodiments, the opcode of the first command is used to indicate whether it has the characteristic of migrating data with power-off protection.
[0041] The first field of the first command is used to indicate the size of the data to be stored.
[0042] In some embodiments, the status code of the second command is used to indicate whether the candidate NVMe SSD has the characteristic of migrating data with power-off protection.
[0043] The second field of the second command is used to indicate whether the candidate NVMe SSD with the characteristic of migrating data with power-off protection has the ability to migrate data with power-off protection.
[0044] In some embodiments, in response to the end of storing the data to be stored in the persistent memory area of the target NVMe SSD, the configuration module is further configured to modify the configuration of the SSD register to indicate the end of data backup.
[0045] In some embodiments, the sending module is further configured to send a backup message to the target NVMe SSD; the backup message is used to instruct the target NVMe SSD to perform data backup, and the backup message includes the size of the data to be stored.
[0046] In some embodiments, the SSD register at least includes a third field, a fourth field, and a fifth field for indicating data backup enable;
[0047] The configuration module is specifically configured to configure the third field based on the size of the data to be stored in the information of the data to be stored;
[0048] Configure the fourth field based on the process of storing the data to be stored in the persistent memory area of the target NVMe SSD.
[0049] In some embodiments, the power-off protection system further includes a target NVMe SSD, and the target NVMe SSD includes:
[0050] A reading module, configured to poll and read the configuration of the SSD register, and read the third field in response to the fourth field indicating that the backup of the data to be stored has been started;
[0051] A determining module, configured to determine a backup time threshold based on the third field and the bandwidth of the PCIe high-speed link between the target NVMe SSD and the RAID controller.
[0052] In some embodiments, the determining module is further configured to determine that the storage of the data to be stored in the target NVMe SSD fails if the fourth field does not indicate the end of data backup within the backup time threshold.
[0053] In some embodiments, the target NVMe SSD further includes:
[0054] A storage module, configured to store the data to be stored from the persistent memory area to the NAND flash of the target NVMe SSD through the ONFI high-speed interface in response to the fourth field indicating the end of data backup.
[0055] In a third aspect, an embodiment of the present application provides a power-off protection system, and the power-off protection system includes:
[0056] A processor and a memory communicatively connected to the processor; wherein,
[0057] The processor memory stores instructions executable by the processor, and when the instructions are executed by the processor, the processor is enabled to execute the above-mentioned power-off protection method.
[0058] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium storing executable instructions, which, when executed by a processor, implement the above-mentioned power-off protection method.
[0059] In a fifth aspect, an embodiment of the present application provides a computer program product, where the computer program product includes a computer program / instructions, and when the computer program / instructions are executed by a processor, the above-mentioned power-off protection method is implemented.
[0060] The power-off protection method provided by the embodiments of the present application includes: the RAID controller sends a first command to at least one candidate NVMe SSD, and the first command is configured based on the information of the data to be stored by the RAID controller in the case of power-off; the RAID controller receives a second command sent by the candidate NVMe SSD based on the first command; the second command is used to indicate whether the candidate NVMe SSD has the power-off protection data migration ability; the RAID controller parses the second command to obtain a parsing result; in the case of power-off, the RAID controller selects a target NVMe SSD from the at least one candidate NVMe SSD, and the target NVMe SSD is used to store the data to be stored; configures the SSD register based on the information of the data to be stored; stores the data to be stored in the persistent memory area of the target NVMe SSD based on the configuration of the SSD register; in response to the end of storing the data to be stored in the persistent memory area of the target NVMe SSD, sends a notification message to the target NVMe SSD, and the notification message is used to instruct the candidate NVMe SSD to store the data to be stored in the NAND flash of the target NVMe SSD. In the embodiments of the present application, the first command is a custom NVMe Admin command, and the custom NVMe Admin command is used to identify whether the NVMe SSD has the power-off protection offload ability, so that data backup is more flexible. In the embodiments of the present application, the RAID controller can quickly back up data to the PMR area of the NVMe SSD in the case of power-off, reducing the risk of data loss and improving the reliability of the system. By using the PMR characteristics of the NVMe SSD device, the efficient and persistent storage of key data in the RAID controller is realized, enhancing the security and integrity of the data. The power-off protection method provided by the embodiments of the present application does not require super point-in, eliminates the dependence on super capacitors and dedicated NAND flash, reduces the hardware requirements for power-off protection, simplifies the hardware design and capacitance management of the RAID controller, and thus effectively reduces the overall deployment cost. The embodiments of the present application mainly rely on the system firmware to implement power-off protection, without additional hardware modifications, simplifying the hardware design and system integration process, making the maintenance and upgrade of the system more convenient and easy to integrate into the existing storage system. Description of the Drawings
[0061] Figure 1 is a schematic diagram of a processing flow of the power-off protection method provided by the embodiments of the present application;
[0062] Figure 2 is a schematic diagram of the structure of the submission queue entry corresponding to the first command provided by the embodiments of the present application;
[0063] Figure 3 It is a schematic diagram of the detailed processing flow of a power-off protection method provided by an embodiment of the present application;
[0064] Figure 4 It is a schematic architecture diagram of a power-off protection system for implementing the power-off protection method provided by an embodiment of the present application;
[0065] Figure 5 It is a schematic diagram of the composition structure of a power-off protection system provided by an embodiment of the present application;
[0066] Figure 6 It is another schematic diagram of the structure of the power-off protection system provided by an embodiment of the present application. Detailed implementation manners
[0067] In order to make the objectives, technical solutions, and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be construed as limiting the present application. All other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the scope of protection of the present application.
[0068] In the following description, reference is made to "some embodiments", which describe a subset of all possible embodiments. However, it can be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments, and can be combined with each other without conflict.
[0069] In the following description, the terms "first / second" are only used to distinguish similar objects and do not represent a specific order for the objects. It can be understood that "first / second" can be interchanged with a specific order or sequence when permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0070] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0071] It should be understood that in various embodiments of the present application, the magnitude of the sequence number of each implementation process does not mean the order of execution. The order of execution of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
[0072] A schematic diagram of a processing flow of the power-off protection method provided by an embodiment of the present application, as Figure 1 shown, includes at least the following steps:
[0073] Step S101, the RAID controller sends a first command to at least one candidate NVMe SSD, and the first command is configured based on information about data to be stored by the RAID controller in the event of a power failure.
[0074] In some embodiments, the RAID controller may send a first command to multiple candidate NVMe SSDs during the initialization phase; among them, the candidate NVMe SSDs may be NVMe SSDs attached to the RAID controller. Information about data to be stored by the RAID controller in the event of a power failure may be the size of the data to be stored in the event of a power failure.
[0075] In some embodiments, the first command may be a custom NVMe Admin command; the opcode of the first command is used to indicate whether the RAID controller has the power failure protection data migration feature, and the value corresponding to the opcode is Coh. The first field of the first command is used to indicate the size of the data to be stored; among them, the first field may be SQEDword12; as an example, bits 00 to 06 of SQE Dword12 are used to indicate the size of the data to be stored, and the unit may be MB, and bits 07 to 31 of SQE Dword12 are reserved bit positions.
[0076] In some embodiments, the schematic diagram of the structure of the submission queue entry (SQE) corresponding to the first command is as Figure 2 shown, bits 01:00 are 00b, indicating no data transfer; bit 07 is 1b, indicating a custom NVMe Admin command; bits 06:02 indicate that the size of the data to be stored is 10000b; the opcode is C0h; Command is Powerloss Offload Command (power failure protection instruction).
[0077] Among them, NVMe (Non-Volatile Memory Express) is a non-volatile memory host controller interface specification. The communication protocol based on the PCIe interface is designed specifically for SSDs to provide high-speed and low-latency storage access.
[0078] In the embodiments of the present application, by using a custom NVMe Admin command to identify whether an NVMe SSD has the power failure protection offload ability, data backup becomes more flexible.
[0079] Step S102, the RAID controller receives a second command sent by the candidate NVMe SSD based on the first command.
[0080] In some embodiments, the first command and the second command can be transmitted between the RAID controller and the candidate NVMe SSD via a PCIe high-speed link.
[0081] Step S103: The RAID controller parses the second command to obtain a parsing result.
[0082] In some embodiments, for each candidate NVMe SSD, after receiving the first command, the candidate NVMe SSD parses the first command. Specifically, it parses the Opcode of the first command. When it is parsed that the Opcode indicates the offload feature, it further parses the size of the data to be stored in SQE Dword 12 of the first command, and compares the size of the data to be stored with the size of its own persistent memory region (PMR). In one scenario, if the size of the PMR of the candidate NVMe SSD is greater than or equal to the size of the data to be stored, it indicates that the candidate NVMe SSD has the offload ability. At this time, the status code of the second command can be "00h", indicating that the candidate NVMe SSD has the offload feature; the 0th to 1st bits of Dword0 of the second command can be "01b", indicating that the candidate NVMe SSD has the offload ability. In another scenario, if the size of the PMR of the candidate NVMe SSD is less than the size of the data to be stored, it indicates that the candidate NVMe SSD does not have the offload ability. At this time, the status code of the second command can be "00h", indicating that the candidate NVMe SSD has the offload feature; the 0th to 1st bits of Dword0 of the second command can be "00b", indicating that the candidate NVMe SSD does not have the offload ability.
[0083] In some other embodiments, for each candidate NVMe SSD, after receiving the first command, the candidate NVMe SSD parses the first command. Specifically, it parses the Opcode of the first command. When it is parsed that the Opcode indicates no offload feature, there is no need to further parse the size of the data to be stored in SQE Dword 12 of the first command. At this time, the status code of the second command can be "01h", indicating that the candidate NVMe SSD has the offload feature, or it represents an invalid command opcode.
[0084] Step S104, in the event of a power failure, the RAID controller selects a target NVMe SSD from the at least one candidate NVMe SSDs, and the target NVMe SSD is used to store the data to be stored.
[0085] In some embodiments, the RAID controller selects, from the candidate NVMe SSDs with power failure protection data migration capability according to the parsing result for each candidate NVMe SSD, one as the target NVMe SSD for storing the data to be stored.
[0086] As an example, the RAID controller may randomly select one from the candidate NVMe SSDs with power failure protection data migration capability as the target NVMe SSD. The RAID controller may also randomly select one from the candidate NVMe SSDs with power failure protection data migration capability in the order of the identifiers of the candidate NVMe SSDs.
[0087] Step S105, configure the SSD register based on the information of the data to be stored.
[0088] In some embodiments, the RAID controller configures the SSD register based on the size of the data to be stored included in the information of the data to be stored.
[0089] In some embodiments, the SSD register may be a Vendor-customized register. The SSD register includes at least a third field, a fourth field, and a fifth field for indicating data backup enable. In the embodiments of the present application, a data backup communication mechanism is designed through the Vendor-customized register, making the data backup communication mechanism simpler and more efficient.
[0090] In some embodiments, the specific time limit process of configuring the SSD register based on the information of the data to be stored may include: configuring the third field based on the size of the data to be stored in the information of the data to be stored; configuring the fourth field based on the process of storing the data to be stored in the persistent memory area of the target NVMe SSD. Among them, the third field may be Backup Size, which is used to indicate the amount of backup data, with the unit of MB, and the third field occupies 1 bit in size. The fourth field may be the Poweroff Backup Flag, and the fourth field occupies 1 bit in size; the fourth field may be one of the data backup end flag and the data backup start flag. As an example, the data backup start flag may be represented as "0xAA", and the data backup end flag may be represented as "0x55". The fifth field is used to indicate data backup enable, and the fifth field occupies 1 bit in size; during the initialization phase, the RAID controller enables data backup, and the target NVMe SSD determines whether to back up the data of the RAID controller during the next abnormal power-off through the fifth field; if data backup is not enabled, the power-off protection offload function is turned off.
[0091] In some embodiments, the SSD register may further include a reserved field with a size of 1 bit, which is used for subsequent function expansion.
[0092] Step S106, store the data to be stored in the persistent memory area of the target NVMe SSD based on the configuration of the SSD register.
[0093] In some embodiments, the RAID controller first sends a backup message to the target NVMe SSD; the backup message is used to instruct the target NVMe SSD to perform data backup, and the backup message includes the size of the data to be stored. Then, the RAID controller stores the data to be stored in the persistent memory area of the target NVMe SSD.
[0094] In some embodiments, after the target NVMe SSD receives the backup message, the target NVMe SSD polls to read the configuration of the SSD register; in response to the fourth field indicating that the RAID controller has started backing up the data to be stored, the NVMe SSD reads the third field; the target NVMe SSD determines a backup time threshold based on the third field and the bandwidth of the PCIe high-speed link between the target NVMe SSD and the RAID controller. Specifically, the size of the data to be stored indicated by the third field can be divided by the bandwidth of the PCIe high-speed link to obtain a candidate time threshold. The backup time threshold is obtained by multiplying the candidate time threshold by a preset coefficient. Wherein, the preset coefficient can be flexibly set according to the actual application scenario; as an example, the preset coefficient can be 1.5 or 2. In response to the fourth field not indicating the end of data backup within the backup time threshold, it is determined that the storage of the data to be stored to the target NVMe SSD fails. In response to the fourth field indicating the end of data backup within the backup time threshold, the RAID controller modifies the configuration of the SSD register to indicate the end of data backup, then it is determined that the storage of the data to be stored to the target NVMe SSD is successful, and the target NVMe SSD stores the data to be stored from the persistent memory area to the NAND flash of the target NVMe SSD through the ONFI high-speed interface.
[0095] In the embodiments of the present application, the RAID controller can quickly back up data to the PMR area of the NVMe SSD in the case of power failure, reducing the risk of data loss and improving the reliability of the system. By using the PMR feature of the NVMe SSD device, efficient persistent storage of key data in the RAID controller is achieved, enhancing the security and integrity of the data. The power-off protection method provided by the embodiments of the present application does not require super point-in, eliminating the dependence on super capacitors and dedicated NAND flash memories, reducing the hardware requirements for power-off protection, simplifying the hardware design and capacitor management of the RAID controller, thereby effectively reducing the overall deployment cost. The embodiments of the present application mainly rely on system firmware to implement power-off protection, without additional hardware modifications, simplifying the hardware design and system integration process, making the maintenance and upgrade of the system more convenient and easy to integrate into existing storage systems.
[0096] A detailed processing flow diagram of a power-off protection method provided by an embodiment of the present application is shown as Figure 3 shown, and at least includes the following steps:
[0097] Step S201, the RAID controller powers off abnormally, and the RAID controller modifies the third field and the fourth field of the Vendor register.
[0098] In some embodiments, the RAID controller modifies the fourth field (Poweroff BackupFlag) of the Vendor register to "0xAA", indicating the start of data backup. The RAID controller modifies the third field (BackupSize) of the Vendor register to the actual amount of backed-up data.
[0099] Step S202, the NVMe SSD polls and reads the Vendor register. If the fourth field indicates the start of data backup, the NVMe SSD reads the third field to obtain the amount of backed-up data and calculates the backup time threshold.
[0100] In some embodiments, the NVMe SSD determines the backup time threshold based on the third field and the bandwidth of the PCIe high-speed link between the target NVMe SSD and the RAID controller.
[0101] Step S203, after the data backup ends, the RAID controller modifies the fourth field of the Vendor register.
[0102] In some embodiments, the RAID controller modifies the fourth field (Poweroff BackupFlag) of the Vendor register to "0x55", indicating the end of data backup.
[0103] Step S204, the NVMe SSD polls and reads the Vendor register. If the fourth field indicates the end of data backup, the NVMe SSD writes the data in the PMR area to the NAND flash of the NVMe SSD.
[0104] In some embodiments, the NVMe SSD can write the data in the PMR area to the NAND flash of the NVMe SSD through the ONFI interface.
[0105] A schematic diagram of an architecture of a power-off protection system for implementing the power-off protection method provided in the embodiments of the present application is shown as Figure 4 shown, and at least includes:
[0106] RAID controller 301, NVMe SSD 302, power monitoring module 303, non-super capacitor 304, cache 305, NVMe controller 306, NVMe SSD PMR 307, and NAND 308.
[0107] The RAID controller 301 is responsible for managing and coordinating the RAID array composed of multiple physical hard disks (HDD / SSD), and realizes high availability, high performance, or fault tolerance of data through technologies such as data redundancy, striping, or distributed storage.
[0108] NVMe SSD 302, a solid-state drive based on the NVMe interface, is used to store data.
[0109] The power monitoring module 303 is used to monitor the power status of the RAID controller 301 and the cache 305; when an abnormal power failure occurs, it starts the abnormal power failure protection handler.
[0110] The non-supercapacitor 304 is used to provide power to the RAID controller 301 and the cache 305 for a short period of time when an abnormal power failure occurs in the RAID system, allowing the RAID controller 301 to have enough time to store the data in the cache 305 into the NVMe SSD PMR 307 area. The power supply time provided by the non-supercapacitor 304 is usually from a few milliseconds to more than a dozen milliseconds. Compared with supercapacitors, the non-supercapacitor 304 has a smaller capacity and a correspondingly extremely low cost.
[0111] In some embodiments, the non-supercapacitor 304 can also be referred to as a normal capacitor.
[0112] The cache 305 is used to temporarily store frequently accessed RAID data blocks, improve data access speed, reduce access latency, reduce hard disk I / O operations, and extend the service life of physical hard disks. When an abnormal power failure occurs in the RAID system, the critical data in the cache 305 needs to be saved to a non-volatile storage medium to avoid data loss.
[0113] The NVMe controller 306 is used to communicate with and manage the connected NVMe drive, convert data read and write instructions into a command set that the NVMe SSD can understand, and send the command set to the corresponding NVMe SSD for execution.
[0114] The NVMe SSD PMR 307 is a persistent storage area within the NVMe SSD and is used to store the data in the cache 305 in the event of a power failure in the RAID system. Since the data in this area can still be retained after a power failure, it provides a more reliable data protection mechanism than traditional volatile caches.
[0115] NAND 308 is a non-volatile storage medium that stores metadata that needs to be persisted and is usually connected to the SSD controller using the ONFI interface. Among them, ONFI (Open NAND Flash Interface) is an open NAND flash interface, an open standard organization composed of multiple NAND flash manufacturers and related technology companies, aiming to develop standardized specifications for the NAND flash interface. The ONFI specification defines the physical characteristics, electrical characteristics, operation commands, functions, and performance parameters of NAND flash chips to ensure compatibility and interoperability between NAND flash memories produced by different manufacturers.
[0116] The power-off protection system provided by the embodiment of the present invention can utilize the PMR feature of the downstream NVMe SSD device to achieve efficient and persistent storage of key data in the cache of the RAID controller, eliminate the dependence on supercapacitors and dedicated NAND flash memories, effectively reduce the system cost, simplify the hardware design, and enhance the reliability of the system.
[0117] A schematic structural diagram of a power-off protection system provided by an embodiment of the present application is shown in Figure 5 As shown, it includes at least a solid-state drive controller 500, and the solid-state drive controller 500 includes:
[0118] A sending module 501, configured to send a first command to at least one candidate NVMe SSD, and the NVMe Admin command is configured based on the information of the data to be stored in the case of power-off of the redundant array of independent disks (RAID) controller;
[0119] A receiving module 502, configured to receive a second command sent by the candidate NVMe SSD based on the first command; the second command is used to indicate whether the candidate NVMe SSD has the ability to migrate power-off protection data;
[0120] An analysis module 503, configured to analyze the second command to obtain an analysis result;
[0121] A selection module 504, configured to, in the case of power-off, the RAID controller selects a target NVMe SSD from the at least one candidate NVMe SSD, and the target NVMe SSD is used to store the data to be stored;
[0122] A configuration module 505, configured to configure the SSD register based on the information of the data to be stored;
[0123] A data backup module 506, configured to store the data to be stored in the persistent memory area of the target NVMe SSD based on the configuration of the SSD register;
[0124] The sending module 501 is further configured to, in response to the end of storing the data to be stored in the persistent memory area of the target NVMe SSD, send a notification message to the target NVMe SSD, and the notification message is used to instruct the candidate NVMe SSD to store the data to be stored in the NAND flash memory of the target NVMe SSD.
[0125] In some embodiments, the operation code of the first command is used to indicate whether it has the feature of migrating power-off protection data; the first field of the first command is used to indicate the size of the data to be stored.
[0126] In some embodiments, the status code of the second command is used to indicate whether the candidate NVMe SSD has the power-off protection data migration feature; the second field of the second command is used to indicate whether the candidate NVMe SSD with the power-off protection data migration feature has the power-off protection data migration ability.
[0127] In some embodiments, in response to the end of storing the data to be stored in the persistent memory area of the target NVMe SSD, the configuration module 505 is further configured to modify the configuration of the SSD register to indicate the end of data backup.
[0128] In some embodiments, the sending module 501 is further configured to send a backup message to the target NVMe SSD; the backup message is used to instruct the target NVMe SSD to perform data backup, and the backup message includes the size of the data to be stored.
[0129] In some embodiments, the SSD register includes at least a third field, a fourth field, and a fifth field for indicating data backup enablement;
[0130] The configuration module 505 is specifically configured to configure the third field based on the size of the data to be stored in the information of the data to be stored;
[0131] Configure the fourth field based on the process of storing the data to be stored in the persistent memory area of the target NVMe SSD.
[0132] In some embodiments, the power-off protection system further includes a target NVMe SSD, and the target NVMe SSD includes:
[0133] A reading module, configured to poll and read the configuration of the SSD register, and in response to the fourth field indicating that the backup of the data to be stored has been started by the RAID controller, read the third field;
[0134] A determining module, configured to determine a backup time threshold based on the third field and the bandwidth of the PCIe high-speed link between the target NVMe SSD and the RAID controller.
[0135] In some embodiments, the determining module is further configured to determine that the storage of the data to be stored in the target NVMe SSD fails in response to the fourth field not indicating the end of data backup within the backup time threshold.
[0136] In some embodiments, the target NVMe SSD further includes: a storage module, configured to store the data to be stored from the persistent memory area to the NAND flash of the target NVMe SSD through an ONFI high-speed interface in response to the fourth field indicating the end of data backup.
[0137] An embodiment of the present application further provides a power failure protection system, including: a processor and a memory communicatively connected to the processor; wherein, the processor memory stores instructions executable by the processor, and when the instructions are executed by the processor, the processor can execute the power failure protection method provided in the above embodiments of the present application.
[0138] Another structural schematic diagram of the power failure protection system provided by the embodiment of the present application is shown in Figure 6 As shown, it includes: a processor 410 and a memory 450 communicatively connected to the processor 410. The power failure protection system further includes a bus 440; each module of the power failure protection system is coupled together through the bus 440. Among them, there can be multiple processors. It can be understood that the bus 440 is used to implement the connection and communication between these modules. In addition to the data bus, the bus 440 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clear illustration, in Figure 6 all kinds of buses are labeled as bus 440.
[0139] The processor 410 has the ability to process signals, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware models, etc. Among them, the general-purpose processor can be a microprocessor or any conventional processor, etc.
[0140] The memory 450 stores executable instructions for implementing the power failure protection method provided by the embodiment of the present application; the memory 450 can be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memories, hard disk drives, optical disc drives, etc. The memory 450 optionally includes one or more storage devices physically located far from the processor core 410.
[0141] In some embodiments, the memory 450 is capable of storing data to support various operations. Examples of such data include programs, modules, and data structures, or subsets or supersets thereof.
[0142] In some embodiments, the power failure protection system may further include:
[0143] The operating system 451 includes system programs for processing various basic system services and performing hardware-related tasks, such as the framework layer, the core library layer, the driver layer, etc., for implementing various basic services and processing hardware-based tasks.
[0144] The network communication module 452 is used to reach other computing devices via one or more (wired or wireless) network interfaces 420. Exemplary network interfaces 420 include: Bluetooth, Wi-Fi (Wireless Fidelity), and USB (Universal Serial Bus), etc.
[0145] An embodiment of the present application provides a computer-readable storage medium storing executable instructions, where the executable instructions, when executed by a processor, will trigger the processor to execute the power-off protection method provided by the embodiment of the present application. For example, as Figures 1 to 3 shown in the power-off protection method.
[0146] In some embodiments, the computer-readable storage medium may be a ferroelectric random access memory (FRAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a flash memory, a magnetic surface memory, an optical disc, or a CD-ROM, etc.; or it may be various devices including one or any combination of the above memories.
[0147] In some embodiments, the executable instructions may be in the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including being deployed as an independent program or being deployed as a module, model, subroutine, or other unit suitable for use in a computing environment.
[0148] As an example, the executable instructions may be deployed to be executed on one computing device, or on multiple computing devices located at one location, or alternatively, on multiple computing devices distributed at multiple locations and interconnected by a communication network.
[0149] An embodiment of the present application provides a computer program product, the computer program product includes a computer program / instructions, and when the computer program / instructions are executed by a processor, the power-off protection method described in the present application is implemented.
[0150] The above is only an embodiment of the present application and is not intended to limit the protection scope of the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and scope of the present application are all included in the protection scope of the present application.
Claims
1. A power-down protection method, characterized in that, The method includes: An independent disk redundant array (RAID) controller sends a first command to at least one candidate non-volatile memory express (NVMe) solid state drive (SSD), where the first command is configured based on information about data to be stored in the event of a power failure of the RAID controller; The RAID controller receives a second command sent by the candidate NVMe SSD based on the first command; the second command is used to indicate whether the candidate NVMe SSD has the ability to migrate data for power failure protection; The RAID controller parses the second command to obtain a parsing result; In the event of a power failure, the RAID controller selects a target NVMe SSD from the at least one candidate NVMe SSD, and the target NVMe SSD is used to store the data to be stored; Configure the SSD register based on the information about the data to be stored; Store the data to be stored in the persistent memory area of the target NVMe SSD based on the configuration of the SSD register; In response to the end of storing the data to be stored in the persistent memory area of the target NVMe SSD, send a notification message to the target NVMe SSD, where the notification message is used to instruct the candidate NVMe SSD to store the data to be stored in the NAND flash memory of the target NVMe SSD.
2. The method according to claim 1, characterized in that The operation code of the first command is used to indicate whether it has the feature of migrating data for power failure protection; The first field of the first command is used to indicate the size of the data to be stored; 3. The method according to claim 1, characterized in that, The status code of the second command is used to indicate whether the candidate NVMe SSD has the feature of migrating data for power failure protection; The second field of the second command is used to indicate whether the candidate NVMe SSD with the feature of migrating data for power failure protection has the ability to migrate data for power failure protection; 4. The method according to claim 1, characterized in that In response to the end of storing the data to be stored in the persistent memory area of the target NVMe SSD, the method further includes: The RAID controller modifies the configuration of the SSD register to indicate the end of data backup; 5. The method according to claim 1, characterized in that, Before storing the data to be stored in the persistent memory area of the target NVMe SSD based on the configuration of the SSD register, the method further includes: The RAID controller sends a backup message to the target NVMe SSD; the backup message is used to instruct the target NVMe SSD to perform data backup, and the backup message includes the size of the data to be stored; 6. The method according to claim 1, characterized in that, The SSD register at least includes a third field, a fourth field, and a fifth field for indicating data backup enable; configuring the SSD register based on the information about the data to be stored includes: Configuring the third field based on the size of the data to be stored in the information about the data to be stored; Configuring the fourth field based on the process of storing the data to be stored in the persistent memory area of the target NVMe SSD; 7. The method according to claim 6, wherein The method further includes: The target NVMe SSD polls and reads the configuration of the SSD register; In response to the fourth field indicating that the RAID controller has started backing up the data to be stored, the target NVMe SSD reads the third field; The target NVMe SSD determines a backup time threshold based on the third field and the bandwidth of the PCIe high-speed link between the target NVMe SSD and the RAID controller.
8. The method according to claim 7, characterized in that, In response to the fourth field not indicating the end of data backup within the backup time threshold, it is determined that the attempt to store the data to be stored in the target NVMe SSD has failed.
9. The method according to claim 7, wherein In response to the fourth field indicating the end of data backup, the method further includes: The target NVMe SSD stores the data to be stored from the persistent memory area to the NAND flash of the target NVMe SSD through the ONFI high-speed interface.
10. A power-down protection system, characterized in that, The power-off protection system at least includes a solid-state drive controller, and the solid-state drive controller includes: A sending module, configured to send a first command to at least one candidate NVMe SSD, where the first command is configured based on information about the data to be stored by an independent disk redundant array (RAID) controller in the event of a power-off; A receiving module, configured to receive a second command sent by the candidate NVMe SSD based on the first command; the second command is used to indicate whether the candidate NVMe SSD has the ability to migrate data for power-off protection; An analysis module, configured to analyze the second command to obtain an analysis result; A selection module, configured to, in the event of a power-off, the RAID controller selects a target NVMe SSD from the at least one candidate NVMe SSD, and the target NVMe SSD is used to store the data to be stored; A configuration module, configured to configure the SSD register based on the information about the data to be stored; A data backup module, configured to store the data to be stored in the persistent memory area of the target NVMe SSD based on the configuration of the SSD register; The sending module is further configured to, in response to the end of storing the data to be stored in the persistent memory area of the target NVMe SSD, send a notification message to the target NVMe SSD, where the notification message is used to instruct the candidate NVMe SSD to store the data to be stored in the NAND flash of the target NVMe SSD.
11. The power-off protection system according to claim 10, wherein The operation code of the first command is used to indicate whether it has the feature of migrating data for power-off protection; The first field of the first command is used to indicate the size of the data to be stored.
12. The power-off protection system according to claim 10, wherein The status code of the second command is used to indicate whether the candidate NVMe SSD has the feature of migrating data for power-off protection; The second field of the second command is used to indicate whether the candidate NVMe SSD with the feature of migrating data for power-off protection has the ability to migrate data for power-off protection.
13. The power-off protection system according to claim 10, characterized in that, In response to the end of storing the data to be stored in the persistent memory area of the target NVMe SSD, the configuration module is further configured to modify the configuration of the SSD register to indicate the end of data backup.
14. The power-off protection system according to claim 10, wherein the sending module is further configured to send a backup message to the target NVMe SSD; the backup message is used to instruct the target NVMe SSD to perform data backup, and the backup message includes the size of the data to be stored.
15. The power-down protection system according to claim 10, characterized in that, The SSD register at least includes a third field, a fourth field, and a fifth field for indicating data backup enable; The configuration module is specifically configured to configure the third field based on the size of the data to be stored in the information of the data to be stored; Configure the fourth field based on the process of storing the data to be stored in the persistent memory area of the target NVMe SSD.
16. The power-down protection system according to claim 15, wherein The power-off protection system further includes a target NVMe SSD, and the target NVMe SSD includes: a reading module, configured to poll and read the configuration of the SSD register, and in response to the fourth field indicating that the backup of the data to be stored has been started by the RAID controller, read the third field; a determining module, configured to determine a backup time threshold based on the third field and the bandwidth of the PCIe high-speed link between the target NVMe SSD and the RAID controller.
17. The power-down protection system according to claim 16, wherein, The determining module is further configured to determine that the storage of the data to be stored in the target NVMe SSD fails if the fourth field does not indicate the end of data backup within the backup time threshold.
18. The power-off protection system according to claim 16, characterized in that, The target NVMe SSD further includes: a storage module, configured to store the data to be stored from the persistent memory area to the NAND flash of the target NVMe SSD through an ONFI high-speed interface in response to the fourth field indicating the end of data backup.
19. A power-down protection system, characterized in that, The power-off protection system includes: a processor and a memory communicatively connected to the processor; wherein the processor memory stores instructions executable by the processor, and when the instructions are executed by the processor, the processor is enabled to execute the power-off protection method according to any one of claims 1 to 9.
20. A computer-readable storage medium, characterized in that, Stores executable instructions, which are used to implement the power-off protection method according to any one of claims 1 to 9 when executed by a processor.
21. A computer program product, characterized in that, The computer program product includes computer programs / instructions, and when the computer programs / instructions are executed by a processor, the power-off protection method according to any one of claims 1 to 9 is implemented.
Citation Information
Patent Citations
SSD storage method, device and system based on data characteristics
CN108664218A
Determination of power-off duration of nvme SSD
US20220206821A1