A method of verifying unsafe shutdowns based on ssd power cycle hybrid testing

By using an automated method based on hybrid testing of SSD power outages and restarts, the problem of low efficiency in verifying the unsafe_shutdowns parameter was solved, achieving efficient and automated parameter verification and SSD reliability verification, thus reducing manpower and time costs.

CN115565590BActive Publication Date: 2026-03-10SHANDONG SINOCHIP SEMICON CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-21
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

In existing technologies, the verification of the unsafe_shutdowns parameter mainly relies on manual operation, which is inefficient and difficult to guarantee correctness when counting large amounts, resulting in high human and time costs.

Method used

An automated method based on SSD power outage and restart hybrid testing is adopted. Using Python scripts and communication devices, the correctness of the unsafe_shutdowns parameter value is automatically calculated by randomly issuing power outage or restart commands. Combined with power outage and restart test scenarios, fully automated verification is achieved.

Benefits of technology

It improves the verification efficiency of the unsafe_shutdowns parameter, reduces manpower and time costs, ensures the correctness of the parameter under different power-down and restart methods, and realizes the reliability verification of SSD disks and automatic judgment of SMART parameter values.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115565590B_ABST
    Figure CN115565590B_ABST
Patent Text Reader

Abstract

A method for verifying unsafe_shutdowns based on ssd power-off restart hybrid test, the control machine carries out power-off, restart test scene to nvme ssd, the python script of control machine issues admin command to obtain the initial value of unsafe_shutdowns in smart log, then carries out power-off, restart test, reacquires the parameter value of unsafe_shutdowns after each power-on, and views whether unsafe_shutdowns is consistent with the number of different breaks through calculation.This application verifies the parameter value of unsafe_shutdowns based on power-off, restart hybrid test, and achieves two goals at one time, which verifies the reliability of ssd disk and the correctness of smart parameter value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of SSD hard drive testing, specifically to a method for verifying unsafe_shutdowns based on a hybrid test of SSD power failure and restart. Background Technology

[0002] Because SMART information helps understand the health status of a solid-state drive (SSD), the SMART log parameters contain some key indicators that can help us analyze whether there are any problems with the disk. Therefore, it is necessary to perform correctness tests on some important parameters.

[0003] unsafe_shutdowns is a parameter in the smart log, which is the number of unsafe shutdowns (abnormal power outage count). The correctness of this parameter was verified in a mixed test of power outages and restarts.

[0004] Previously, verifying the correctness of unsafe_shutdowns was mainly done manually, which was inefficient and limited in the number of verifications, making it ineffective for verifying the correctness of large transaction counts. Furthermore, it required separate verification, incurring additional manpower and time costs. Summary of the Invention

[0005] In order to overcome the shortcomings of the above technologies, this invention provides a method that verifies both the reliability of the SSD and the correctness of the SMART parameter values.

[0006] The technical solution adopted by this invention to overcome its technical problems is:

[0007] A method for verifying unsafe_shutdowns based on a hybrid test of SSD power failure and restart includes the following steps:

[0008] a) Set up a PC as a test machine and insert the NVMe SSD into the test machine;

[0009] b) The test machine detects the NVMe SSD insertion status. If the test machine can recognize the NVMe SSD after powering on, proceed to step b). If the test machine cannot recognize the NVMe SSD after powering on, return to step a).

[0010] c) Set up a PC as the control unit, and connect the control unit to the test machine through a communication device;

[0011] d) The controller sends a power-on signal to the control device, and the control device powers on the test machine.

[0012] e) The controller is set to a total of n rounds of power failure testing, with i tests per round. A Python script is deployed in the controller, and the controller sends an admin command to the test machine through the Python script to obtain the initial value F0 of unsafe_shutdowns in the smart log.

[0013] f) The controller randomly sends positive disconnect, abnormal disconnect, or restart commands to the test machine to power down or restart the test machine. The controller records the number of positive disconnect commands P0 and the number of restart commands R0.

[0014] g) The controller sends a power-on signal to the control device, and the control device controls the test machine to power on. After the test machine is powered on, the controller sends the admin command to the test machine through a Python script to obtain the value of the unsafe_shutdowns parameter F1 in the smart log.

[0015] h) Check if the number of abnormal shutdowns calculated by the controller is equal to the current value of the unsafe_shutdowns parameter. If they are equal, proceed to step i). If they are not equal, determine that the value of unsafe_shutdowns is incorrect and the test fails.

[0016] i) The controller calculates whether the current value of the unsafe_shutdowns parameter is equal to the number of disconnections recorded in the communication device. If they are equal, the test passes; if they are not equal, the unsafe_shutdowns value is recorded incorrectly and the test fails.

[0017] Furthermore, the aforementioned control device is a relay, the power supply of the testing machine is connected to the relay, and the control unit is connected to the control terminal of the relay.

[0018] Furthermore, the aforementioned communication device is an RS232 communication device.

[0019] Furthermore, in step f), the control machine randomly sends positive disconnection, abnormal disconnection, and restart commands to the test machine via a Python script.

[0020] Furthermore, in step h), it is calculated whether i-R0-P0 is equal to F1-F0. If they are equal, step i) is executed. If they are not equal, it is determined that the value of unsafe_shutdowns is incorrect and the test fails.

[0021] The beneficial effects of this invention are: low environmental requirements, low resource consumption, and convenient deployment for testing. The Python script fully automates the testing, automatically calculating the `unsafe_shutdowns` test result, freeing up manual testing, and automatically determining the correctness of the value, saving manpower and time costs and improving testing efficiency. The `unsafe_shutdowns` parameter verification is based on a hybrid power-off and restart test, achieving two goals at once: verifying the reliability of the NVMe SSD while simultaneously verifying the correctness of the `unsafe_shutdowns` parameter value in SMART, reducing additional manpower investment. It fully considers the impact of different power-off and restart methods on the parameter count, effectively ensuring the correctness of the parameter by testing different scenarios. Attached Figure Description

[0022] Figure 1 This is a flowchart of the method of the present invention. Detailed Implementation

[0023] The following is in conjunction with the appendix Figure 1 The present invention will be further described below.

[0024] A method for verifying unsafe_shutdowns based on a hybrid test of SSD power failure and restart includes the following steps:

[0025] a) Set up a PC as a test machine and insert the NVMe SSD into the test machine.

[0026] b) The test machine checks the NVMe SSD insertion status. If the test machine can recognize the NVMe SSD after powering on, proceed to step b). If the test machine cannot recognize the NVMe SSD after powering on, return to step a).

[0027] c) Set up a PC as the control unit, which is connected to the test machine via a communication device.

[0028] d) The controller sends a power-on signal to the control device, and the control device powers on the test machine.

[0029] e) The control machine is set to a total of n rounds for power outage testing, with i tests per round. A Python script is deployed in the control machine, and the control machine sends the admin command to the test machine through the Python script to obtain the initial value F0 of unsafe_shutdowns in the smart log.

[0030] f) The controller randomly sends positive disconnect, abnormal disconnect, or restart commands to the test machine to power down or restart the test machine. The controller records the number of positive disconnect commands P0 and the number of restart commands R0.

[0031] g) The controller sends a power-on signal to the control device, which then powers on the test machine. After the test machine is powered on, the controller sends an admin command to the test machine via a Python script to obtain the value F1 of the unsafe_shutdowns parameter in the smart log.

[0032] h) Check if the number of abnormal shutdowns calculated by the controller is equal to the current value of the unsafe_shutdowns parameter, that is, whether i-R0-P0 is equal to F1-F0. If they are equal, proceed to step i). If they are not equal, it is determined that the value of unsafe_shutdowns is incorrect and the test fails.

[0033] i) The controller calculates whether the current unsafe_shutdowns parameter value (F1-F0) is equal to the number of disconnections recorded in the communication device. If they are equal, the test passes; if they are not equal, the unsafe_shutdowns value is recorded incorrectly and the test fails.

[0034] In a power-off and restart test scenario involving an NVMe SSD, the control machine's Python script issues an "admin" command to retrieve the initial value of `unsafe_shutdowns` from the SMART log. Then, it performs power-off and restart tests, retrieving the `unsafe_shutdowns` parameter value after each power-on. The system calculates and checks whether `unsafe_shutdowns` matches the number of abnormal power outages. This invention verifies the `unsafe_shutdowns` parameter value using a hybrid power-off and restart test, and it passes. This achieves two goals simultaneously: verifying both the reliability of the SSD and the correctness of the SMART parameter value.

[0035] This invention verifies the correctness of counting the unsafe_shutdowns parameter in the smart log based on a hybrid test of SSD power failure and restart. The ingenious design of the test steps and calculation method greatly improves the efficiency and quality of verifying the health status of NVMe SSDs, achieving high-efficiency verification.

[0036] Preferably, the control device is a relay, the power supply of the testing machine is connected to the relay, and the control unit is connected to the control terminal of the relay.

[0037] Preferably, the communication device is an RS232 communication device.

[0038] Preferably, in step f), the control machine randomly sends positive disconnection, abnormal disconnection, and restart commands to the test machine via a Python script.

[0039] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method of verifying unsafe shutdowns based on ssd power cycle hybrid testing, the method comprising: It comprises the following steps: a) Set a PC as a test machine, and insert the nvme ssd into the test machine; b) The test machine detects the insertion state of the nvme ssd, if the test machine can recognize the nvme ssd after starting, step b) is executed, if the test machine cannot recognize the nvme ssd after starting, step a) is returned to execute; c) Set a PC as a control machine, and connect the control machine to the test machine through a communication device; d) The control machine generates a start signal to the control device, and the control device controls the test machine to power on; e) The control machine sets the total number of power-off tests as n rounds, and the number of tests in each round as i times, deploys a python script in the control machine, and sends an admin command to the test machine through the python script to obtain the initial value F0 of unsafe_shutdowns in the smart log; f) The control machine randomly sends a normal power-off or abnormal power-off or restart command to the test machine, so that the test machine is powered off or restarted, and the control machine records the number of normal power-off times P0 and the number of restart times R0; g) The control machine generates a start signal to the control device, and the control device controls the test machine to power on, after the test machine is powered on, the control machine sends an admin command to the test machine through the python script to obtain the parameter value F1 of unsafe_shutdowns in the smart log; h) The control machine calculates whether the number of abnormal power-off times is equal to the current unsafe_shutdowns parameter value, if they are equal, step i) is executed, if they are not equal, it is judged that the unsafe_shutdowns value is incorrect, and the test fails; i) The control machine calculates whether the current unsafe_shutdowns parameter value is equal to the number of abnormal power-off times recorded in the communication device, if they are equal, the test passes, if they are not equal, it is judged that the unsafe_shutdowns value is recorded incorrectly, and the test fails; The calculation in step h) is equal to if so, step i) is performed, if not, the unsafe_shutdowns value is shown incorrectly, the test fails.

2. The method of verifying unsafe shutdowns based on ssd power cycle hybrid testing of claim 1, wherein: The control device is a relay, and the power supply of the test machine is connected to the relay, and the control machine is connected to the control end of the relay.

3. The method of verifying unsafe shutdowns based on ssd power cycle hybrid testing of claim 1, wherein: The communication device is an RS232 communication device.

4. The method of verifying unsafe shutdowns based on ssd power cycle hybrid testing of claim 1, wherein: In step f), the control machine randomly sends a normal power-off, abnormal power-off or restart command to the test machine through the python script.

Citation Information

Patent Citations

  • SSD abnormal power failure test method and device, computer device and storage medium

    CN109524049A

  • AEP memory AC test method based on random power-off of power manager

    CN110008070A