Test method and device for power failure protection function of solid state disk and computer equipment
By using DriveMaster software to write test scripts, simulating signal pull-high and pull-low and combining various reset operations, the problem of low detection efficiency of solid-state drive power loss protection function was solved. Comprehensive user data integrity checks and robustness tests in complex scenarios were achieved, ensuring data security.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN YILIAN INFORMATION SYST CO LTD
- Filing Date
- 2021-12-27
- Publication Date
- 2026-08-04
AI Technical Summary
Existing technologies for solid-state drive (SSD) power-loss protection functions suffer from low detection efficiency, lack automation capabilities, fail to comprehensively detect user data integrity, and cannot assess the robustness of power-loss protection functions in complex scenarios.
Using Ulink's DriveMaster software, test scripts were written to simulate signal pull-high and pull-low and control the signal duration. Combined with various reset and reset operations, the test scripts were used to control the abnormal power outage and check the data structure differences in the solid-state drive.
It enables efficient and comprehensive detection of the SSD's power-loss protection function, preventing data loss and system damage caused by malfunction.
Smart Images

Figure CN114420194B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of solid-state drive (SSD) testing technology, and in particular to a testing method, apparatus, computer equipment, and storage medium for the power-loss protection function of a solid-state drive. Background Technology
[0002] Currently, with the development of technology and the advent of the big data era, data storage has become increasingly important. Therefore, the power-loss protection function of solid-state drives (SSDs) has become particularly crucial, but robustness testing of this function remains lacking.
[0003] Currently, testing power-loss protection functions in an operating system (Windows / Linux) environment is inefficient. The testing process requires manual operation: starting the system, waiting for it to boot, pressing the power button until shutdown, and then restarting to check for system corruption and file loss. The test results can only check the integrity of operating system-related files (whether the system can boot normally), but cannot check the integrity of user data. The testing process cannot be automated, and using relays for timed power-offs cannot effectively preserve failure scenarios in a timely manner, nor can it intelligently determine success or failure.
[0004] Currently, traditional SSD power-loss protection functions generally employ two methods for detection: Method 1 involves manually entering the operating system and pressing the power button for an extended period to artificially induce an abnormal power outage, then restarting to confirm system functionality. Method 2 uses a relay, connecting a wire from the laptop's power button to a relay to simulate manual pressing and automate the process. However, Method 1 has a long testing cycle, requiring manual waiting for the system to boot, and can only observe whether the system can be accessed to determine if critical system startup files are corrupted, but cannot check the integrity of user data areas. Method 2 can automate the power-on and shutdown process, but anomalies during unattended operation may be masked by repeated relay pressing, making it impossible to accurately intercept failures. Summary of the Invention
[0005] Therefore, it is necessary to provide a test method, apparatus, computer equipment, and storage medium for the power-loss protection function of a solid-state drive (SSD) to address the aforementioned technical problems.
[0006] A test method for the power-loss protection function of a solid-state drive, the method comprising:
[0007] Get a test request for the solid-state drive's power-loss protection function;
[0008] Write a test script using DriveMaster software based on the test request;
[0009] The test script is run to control the power failure protection function to be turned on and off, and to write data of a specific format to the entire solid-state drive.
[0010] The power-off protection function is activated by simulating the pulling down of relevant signals and controlling the duration of the signals within a certain range;
[0011] The test script controls an abnormal power outage, and after power is restored, the data structure within the solid-state drive is checked.
[0012] In one embodiment, after the step of activating the power-down protection function by simulating the pulling down of a relevant signal and controlling the duration of the signal within a certain range, the method further includes:
[0013] It performs various reset and reset operations in a loop;
[0014] The test script controls an abnormal power outage, and after power is restored, the data structure within the solid-state drive is checked.
[0015] In one embodiment, the steps of performing various reset and reset operations in the loop include:
[0016] The reset and reset operations include normal shutdown procedures, abnormal power failure procedures, functional layer reset, host bus adapter reset, PCIe reset, and subsystem reset.
[0017] In one embodiment, the step of controlling an abnormal power outage via the test script and checking the data format within the solid-state drive after power is restored further includes:
[0018] Compare the internal data after power-on with the data previously written to the entire disk to see if there are any differences in format.
[0019] A testing device for the power-loss protection function of a solid-state drive, the device comprising:
[0020] The acquisition module is used to acquire test requests for the power-loss protection function of the solid-state drive.
[0021] A script writing module, which is used to write test scripts using DriveMaster software according to the test request;
[0022] The data writing module is used to run the test script to control the power failure protection function to be turned on and off, and to write data in a specific form to the entire solid-state drive.
[0023] A signal simulation module is used to enable the power failure protection function by simulating the pulling down of relevant signals and controlling the duration of the signals within a certain range.
[0024] The data inspection module is used to control an abnormal power outage through the test script and check the form of the data in the solid-state drive after power is restored.
[0025] In one embodiment, the apparatus further includes a cycle test module, the cycle test module being used for:
[0026] It performs various reset and reset operations in a loop;
[0027] The test script controls an abnormal power outage, and after power is restored, the data structure within the solid-state drive is checked.
[0028] In one embodiment, the loop test module is further configured to:
[0029] The reset and reset operations include normal shutdown procedures, abnormal power failure procedures, functional layer reset, host bus adapter reset, PCIe reset, and subsystem reset.
[0030] In one embodiment, the data inspection module is further configured to:
[0031] Compare the internal data after power-on with the data previously written to the entire disk to see if there are any differences in format.
[0032] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of any of the methods described above.
[0033] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the above methods.
[0034] The aforementioned test method, apparatus, computer equipment, and storage medium for the power-loss protection function of a solid-state drive (SSD) involve: acquiring a test request for the SSD's power-loss protection function; writing a test script using DriveMaster software based on the test request; running the test script to control the activation and deactivation of the power-loss protection function and writing data of a specific format to the entire SSD; activating the power-loss protection function by simulating the pulling down of relevant signals and controlling the duration of the signals within a certain range; controlling an abnormal power outage using the test script; and checking the format of the data in the SSD after power is restored. This invention can efficiently and comprehensively verify whether the abnormal power-loss function is functioning correctly, using a more scientific and comprehensive method to detect this functional module, thereby avoiding data loss and system damage caused by abnormalities in this function during end-user use. Attached Figure Description
[0035] Figure 1This is a flowchart illustrating a test method for the power-loss protection function of a solid-state drive in one embodiment.
[0036] Figure 2 This is a flowchart illustrating a test method for the power-loss protection function of a solid-state drive in another embodiment;
[0037] Figure 3 This is a flowchart illustrating a test method for the power-loss protection function of a solid-state drive in another embodiment.
[0038] Figure 4 This is a structural block diagram of a test device for the power-loss protection function of a solid-state drive in one embodiment.
[0039] Figure 5 A structural block diagram of a test device for solid-state drive power-loss protection function in another embodiment;
[0040] Figure 6 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0041] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0042] Currently, testing power-down protection functions in operating system (Windows / Linux) environments is inefficient. The testing process requires manual operation: starting the system, waiting for it to boot, pressing the power button until shutdown, and then restarting to check for system corruption and file loss. Test results can only verify the integrity of operating system-related files (whether the system can boot normally), but cannot check the integrity of user data. The testing process cannot be automated, and using relay-based timed power-downs cannot effectively preserve failure scenarios or intelligently determine success or failure. Due to these reasons, current power-down protection function testing generally has a limited sample size. Furthermore, given the increasing variety of customized production models, it cannot cover power-down protection function testing under different signal, noise, and timing scenarios on different platforms. Robustness testing of power-down protection functions remains a gap (i.e., it cannot test the actual effectiveness of power-down protection functions in complex scenarios).
[0043] Based on relevant specifications, when the power-loss protection function is enabled, after the relevant mechanism triggers this function, the SSD must stop executing any commands issued by the host and begin migrating data from its volatile storage device to non-volatile storage device, and can record the number of successful migrations. When the triggering mechanism is canceled, the SSD needs to be able to communicate normally with the host to store data.
[0044] Based on this, this patent invention provides a method that uses Ulink's DriveMaster software to write test scripts to enable and disable the power-loss protection function, simulates the raising and lowering of relevant signals and controls the signal duration within a certain range (simulating signal latency caused by different platforms due to signal compatibility, noise processing, etc.), and performs full disk read and write on the SSD after various power-loss resets when the signal is enabled low to verify the actual effectiveness of the function.
[0045] In one embodiment, such as Figure 1 As shown, a test method for the power-loss protection function of a solid-state drive is provided, the method including:
[0046] Step 102: Obtain the test request for the solid-state drive's power-loss protection function;
[0047] Step 104: Write a test script using DriveMaster software based on the test request;
[0048] Step 106: Run the test script to control the power failure protection function to be turned on and off, and write specific data to the entire solid-state drive;
[0049] Step 108: Activate the power failure protection function by simulating the pulling down of relevant signals and controlling the duration of the signals within a certain range;
[0050] Step 110: Control an abnormal power outage using a test script, and check the data format within the solid-state drive after power is restored.
[0051] In this embodiment, a test method for the power-loss protection function of a solid-state drive is provided. The test method uses DriveMaster software from Ulink to write test scripts to enable and disable the power-loss protection function. It simulates the raising and lowering of relevant signals and controls the duration of the signals within a certain range (simulating signal latency caused by different platforms due to signal compatibility, noise processing, etc.). At the same time, under the condition of enabling the signal by pulling it low, it performs a full read and write operation on the SSD after various power-loss resets to verify the actual effectiveness of the function.
[0052] In one embodiment, the step of controlling an abnormal power outage through a test script and checking the form of the data in the solid-state drive after power is restored also includes: comparing the form of the internal data after power is restored with the form of the data previously written to the entire disk to see if there is any difference.
[0053] In one specific embodiment, refer to Figure 3 The process described in the first half is tested in the following specific environment:
[0054] Hardware requirements:
[0055] SSD under test: SSD that supports power loss protection.
[0056] Computer: Laptop (with dual hard drive bays) or desktop computer.
[0057] Adapter board: Ulink M.2 dedicated PSPA adapter board.
[0058] Software requirements:
[0059] Operating system: Windows 10.
[0060] Test software: Ulink DriveMaster 2015NVMe.
[0061] Test script: A self-written DriveMaster test script.
[0062] The specific testing process is as follows: 1. After powering on, check if the SSD supports the basic check function. 2. Check the default state. 3. Check the commands related to enabling, disabling, and obtaining status. 4. Write specific data to the entire disk. 5. Enable the power-down protection function. 6. Trigger the corresponding pin signal to pull low (active low) and maintain it for a period of time (randomly traversing within the specified range). 7. Script controls abnormal power-down. 8. Power on again and compare the data inside the SSD with the data written in step 4 to see if there are any differences.
[0063] In this embodiment, a test request for the solid-state drive's power-loss protection function is obtained; a test script is written using DriveMaster software based on the test request; the test script is run to control the power-loss protection function to be turned on and off, and specific data is written to the entire solid-state drive; the power-loss protection function is turned on by simulating the pulling down of relevant signals and controlling the duration of the signals within a certain range; an abnormal power outage is controlled by the test script, and the data format in the solid-state drive is checked after power is restored. This solution can efficiently and comprehensively verify whether the abnormal power-loss function is normal, and detect this functional module in a more scientific and comprehensive way, thereby avoiding data loss and system damage caused by the abnormality of this function during end-user use.
[0064] In one embodiment, such as Figure 2 As shown, a test method for the power-loss protection function of a solid-state drive is provided, and the method further includes:
[0065] Step 202: Activate the power failure protection function by simulating the pulling down of relevant signals and controlling the duration of the signals within a certain range;
[0066] Step 204 involves repeatedly performing various reset and resetting operations;
[0067] Step 206, Reset and reset operations include normal shutdown procedure, abnormal power failure procedure, functional layer reset, host bus adapter reset, PCIe reset and subsystem reset;
[0068] Step 208: Control an abnormal power outage using a test script, and after power is restored, compare the internal data after power restoration with the data previously written to the entire disk to see if there are any differences in format.
[0069] In one specific embodiment, refer to Figure 3 The process described in the latter half is tested in the following specific environment:
[0070] Hardware requirements:
[0071] SSD under test: SSD that supports power loss protection.
[0072] Computer: Laptop (with dual hard drive bays) or desktop computer.
[0073] Adapter board: Ulink M.2 dedicated PSPA adapter board.
[0074] Software requirements:
[0075] Operating system: Windows 10.
[0076] Test software: Ulink DriveMaster 2015NVMe.
[0077] Test script: A self-written DriveMaster test script.
[0078] The specific testing process is as follows: 1. After powering on, check if the SSD abnormal reset compatibility check function is enabled. 2. Issue a command to enable this function (if supported but disabled). 3. Write specific data to the entire disk. 4. Trigger the corresponding pin signal to go low (active low) and maintain it for a period of time (randomly traversing within the specified range). 5. Traverse various reset / reset cycles. 6. Script controls an abnormal power outage. 7. Power on again and compare the data inside the SSD with the data written in step 3 to see if there are any differences.
[0079] Each cycle of testing includes different resets such as normal shutdown, abnormal power failure, PCIE function reset, NVMe subsystem reset, HBA reset, and Perst.
[0080] It should be understood that, although Figure 1-3The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 1-3 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.
[0081] In one embodiment, such as Figure 4 As shown, a test device 400 for solid-state drive power-loss protection function is provided, the device comprising:
[0082] Acquisition module 401, the acquisition module is used to acquire test requests for the power loss protection function of solid-state drives;
[0083] Script writing module 402, the script writing module is used to write test scripts using DriveMaster software according to the test request;
[0084] The data writing module 403 is used to run the test script to control the opening and closing of the power failure protection function and to write data in a specific form to the entire solid-state drive.
[0085] The signal simulation module 404 is used to enable the power failure protection function by simulating the low pull of relevant signals and controlling the duration of the signals within a certain range.
[0086] The data inspection module 405 is used to check the data format in the solid-state drive after an abnormal power outage controlled by the test script and the power is restored.
[0087] In one embodiment, such as Figure 5 As shown, a test device 400 for the power-loss protection function of a solid-state drive is provided. This device further includes a cycle test module 406, used for:
[0088] It performs various reset and reset operations in a loop;
[0089] The test script controls an abnormal power outage, and after power is restored, the data structure within the solid-state drive is checked.
[0090] In one embodiment, the loop test module 406 is further configured to:
[0091] The reset and reset operations include normal shutdown procedures, abnormal power failure procedures, functional layer reset, host bus adapter reset, PCIe reset, and subsystem reset.
[0092] In one embodiment, the data inspection module 405 is further configured to:
[0093] Compare the internal data after power-on with the data previously written to the entire disk to see if there are any differences in format.
[0094] For specific limitations on the testing equipment for the power-loss protection function of solid-state drives, please refer to the limitations on the testing method for the power-loss protection function of solid-state drives mentioned above, which will not be repeated here.
[0095] In one embodiment, a computer device is provided, the internal structure of which can be shown as follows: Figure 6 As shown, the computer device includes a processor, memory, and a network interface connected via a device bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores operating devices, computer programs, and a database. The internal memory provides an environment for the operation of the operating devices and computer programs stored in the non-volatile storage medium. The network interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements a test method for a solid-state drive's power-loss protection function.
[0096] Those skilled in the art will understand that Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0097] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps in the various method embodiments described above.
[0098] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the various method embodiments described above.
[0099] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0100] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0101] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A test method for the power-loss protection function of a solid-state drive, characterized in that, The method includes: Get a test request for the solid-state drive's power-loss protection function; Write a test script using DriveMaster software based on the test request; The test script is run to control the power failure protection function to be turned on and off, and to write data of a specific format to the entire solid-state drive. The power-off protection function is activated by simulating the pulling down of relevant signals and controlling the duration of the signals within a certain range; The system performs various reset and reset operations in a loop, including normal shutdown process, abnormal power failure process, functional layer reset, host bus adapter reset, PCIe reset, and subsystem reset. The test script controls an abnormal power outage, and after power is restored, the data structure within the solid-state drive is checked.
2. The test method for the power-loss protection function of a solid-state drive according to any one of claims 1, characterized in that, The step of controlling an abnormal power outage through the test script and checking the data format in the solid-state drive after power is restored also includes: Compare the internal data after power-on with the data previously written to the entire disk to see if there are any differences in format.
3. A testing device for the power-loss protection function of a solid-state drive, characterized in that, The device includes: The acquisition module is used to acquire test requests for the power-loss protection function of the solid-state drive. A script writing module, which is used to write test scripts using DriveMaster software according to the test request; The data writing module is used to run the test script to control the power failure protection function to be turned on and off, and to write data in a specific form to the entire solid-state drive. A signal simulation module is used to enable the power failure protection function by simulating the pulling down of relevant signals and controlling the duration of the signals within a certain range. The loop test module is used to perform various reset and reset operations in a loop, including normal shutdown process, abnormal power failure process, functional layer reset, host bus adapter reset, PCIe reset, and subsystem reset. The data inspection module is used to control an abnormal power outage through the test script and check the form of the data in the solid-state drive after power is restored.
4. The testing device for the power-loss protection function of a solid-state drive according to any one of claims 3, characterized in that, The data inspection module is also used for: Compare the internal data after power-on with the data previously written to the entire disk to see if there are any differences in format.
5. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 2.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 2.