Method, device and equipment for testing power state conversion function of solid state disk and medium

By writing data in the solid-state drive and detecting the power status during the read, write, and trim operations, the problem of insufficient testing of the power status conversion function of the NVME solid-state drive in the existing technology is solved, and automatic testing and testing of the power conversion function are realized. Improved robustness.

CN118588144APending Publication Date: 2024-09-03CHENGDU BIWIN STORAGE TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410635983.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-22
Publication Date
2024-09-03

AI Technical Summary

Technical Problem

The existing technology lacks effective testing of the power state transition characteristics of NVME solid-state drives, resulting in the inability to ensure normal switching between low power consumption and working states.

Method used

Provides a method for testing the power state conversion function of a solid state drive by writing preset data in the test disk and detecting the power state during read, write and trim operations to determine whether the power conversion function is normal, including writing data to the verification area , turn on the automatic power state transition function, determine the low power consumption state, perform write, read and trim operations, compare data consistency, and repeat the test to ensure the accuracy of the results.

Benefits of technology

It realizes the automatic test of the normality of the power conversion function of the solid state drive, improves the robustness of the solid state drive and ensures its stable switching between different states.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118588144A
    Figure CN118588144A
Patent Text Reader

Abstract

The invention provides a solid state disk power state conversion function test method, device and equipment and a medium, and relates to the technical field of storage device testing, the method comprises the following steps: writing preset data into a verification area of a test disk; starting an automatic power state conversion function of the test disc, and standing the test disc; executing a write operation on a non-verification area of the test disk; if the first power supply state is in a working state, after standing the test disk, executing a read operation on a non-verification area of the test disk; if the second power supply state is in the working state, after the test disc is placed in a standing mode, trim operation is executed on a non-verification area of the test disc; if the third power supply state is in the working state, reading verification data; if the verification data is consistent with the preset data, determining that the test result of the test disk is passing the test; and repeatedly executing the above steps, and if all test results are that the test is passed, determining that the automatic power conversion function of the test disc is normal. The invention realizes the function of automatically testing the power conversion of the solid state disk.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of storage device testing, and in particular to a method, device, equipment and medium for testing a power state conversion function of a solid state hard disk. Background Art

[0002] In order to achieve power saving effect, non-volatile solid-state drive (NVME SSD) needs to switch to low power consumption state when not in working state, and switch to working state when working. In the prior art, when testing solid-state drives, there is a lack of testing on the power state transition characteristics of NVME solid-state drives. Summary of the invention

[0003] In view of this, the purpose of the present invention is to overcome the deficiencies in the prior art and provide a method, device, equipment and medium for testing the power state transition function of a solid state hard disk, aiming to automatically test the power state transition function of a solid state hard disk. The present invention provides the following technical solutions:

[0004] In a first aspect, the present invention provides a solid state drive testing method, the method comprising:

[0005] S1, writing preset data into the verification area of ​​the test disk;

[0006] S2, turning on the automatic power state conversion function of the test disk, and after the test disk is left to stand for a preset time, determining whether the test disk is in a low power consumption state;

[0007] S3, if it is in compliance, performing a write operation on the non-verification area of ​​the test disk, and obtaining a first power state of the test disk during the write operation, and determining whether the first power state is in a working state;

[0008] S4, if yes, then let the test disk stand for a preset time, and then determine whether the test disk is in a low power consumption state;

[0009] S5. If yes, perform a read operation on the non-verification area of ​​the test disk, obtain the second power state of the test disk during the read operation, and determine whether the second power state is in a working state;

[0010] S6, if yes, then let the test disk stand for a preset time, and then determine whether the test disk is in a low power consumption state;

[0011] S7, if yes, perform a trim operation on the non-verification area of ​​the test disc, obtain the third power state of the test disc during the trim operation, and determine whether the third power state is in a working state;

[0012] S8. If yes, read the verification data from the verification area, and determine whether the verification data is consistent with the preset data;

[0013] S9, if they are consistent, determining that the test result of the test disk is passed;

[0014] S10, repeatedly executing S1 to S9, the number of repetitions is a first preset number of times, and if the test results are all passed, it is determined that the automatic power conversion function of the test disk is normal.

[0015] In one embodiment, after the test disk is left to stand for a preset time, determining whether the test disk is in a low power consumption state includes: repeatedly acquiring a fourth power state of the test disk during the standing process, the number of repetitions being a second preset number of times, and the interval between each acquisition being a preset interval time; if each of the fourth power states is a low power consumption state, then determining that the test disk is in a low power consumption state.

[0016] In one embodiment, performing a write operation on the non-verification area of ​​the test disk and obtaining a first power state of the test disk during the write operation includes: performing a write operation on the non-verification area of ​​the test disk for a preset write time, and then obtaining the first power state of the test disk.

[0017] In one embodiment, performing a read operation on the non-verification area of ​​the test disk and obtaining the second power state of the test disk during the read operation includes: performing a read operation on the non-verification area of ​​the test disk for a preset read time, and then obtaining the second power state of the test disk.

[0018] In one embodiment, performing a trim operation on the non-verification area of ​​the test disk and obtaining the third power state of the test disk includes: performing a trim operation on the non-verification area of ​​the test disk, and obtaining the third power state of the test disk after a preset trim time.

[0019] In one embodiment, determining whether the verification data is consistent with the preset data includes: respectively calculating a hash value of the verification data and a hash value of the preset data, and determining whether they are equal; if they are equal, determining that the verification data is consistent with the preset data.

[0020] In one embodiment, the method also includes: the method also includes: if the first power state is in a low power consumption state, or the second power state is in a low power consumption state, or the third power state is in a low power consumption state, or the fourth power state is in a working state, then it is determined that the power conversion function of the test disk is abnormal.

[0021] In a second aspect, the present invention provides a solid state hard disk power state conversion function test device, the device comprising:

[0022] A data writing module, used for writing preset data into the verification area of ​​the test disk;

[0023] A standstill module, used to enable the automatic power state conversion function of the test disk, and after the test disk is left to stand for a preset time, determine whether the test disk is in a low power consumption state;

[0024] A first verification module, configured to, if yes, perform a write operation on a non-verification area of ​​the test disk, and obtain a first power state of the test disk during the write operation to determine whether the first power state is in a working state;

[0025] The static module is further used to determine whether the test disk is in a low power consumption state after the test disk is static for a preset time.

[0026] a second verification module, configured to, if yes, perform a read operation on the non-verification area of ​​the test disk, and obtain a second power state of the test disk during the read operation to determine whether the second power state is in a working state;

[0027] The static module is further used to determine whether the test disk is in a low power consumption state after the test disk is static for a preset time.

[0028] A third verification module is used to perform a trim operation on the non-verification area of ​​the test disk, and obtain a third power state of the test disk during the trim operation to determine whether the third power state is in a working state;

[0029] The static module is further configured to read verification data from the verification area and determine whether the verification data is consistent with the preset data;

[0030] A judgment module, used for determining that the test result of the test disk is passed if they are consistent;

[0031] The control module is used to repeatedly execute S1 to S9, the number of repetitions is a first preset number, and if the test results are all passed, it is determined that the automatic power conversion function of the test disk is normal.

[0032] In a third aspect, the present invention provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program runs on the processor, the solid-state hard disk power state transition function test method described in the first aspect is executed.

[0033] In a fourth aspect, the present invention provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the solid-state hard disk power state transition function testing method described in the first aspect.

[0034] The present invention provides a method, device, equipment and medium for testing the power state conversion function of a solid-state hard disk, the method comprising: S1, writing preset data into a verification area of ​​a test disk; S2, turning on the automatic power state conversion function of the test disk, and after the test disk is left to stand for a preset time, judging whether the test disk is in a low power state; S3, if so, performing a write operation on a non-verification area of ​​the test disk, and obtaining a first power state of the test disk during the write operation, and judging whether the first power state is in a working state; S4, if so, after the test disk is left to stand for a preset time, judging whether the test disk is in a low power state; S5, if so, performing a read operation on the non-verification area of ​​the test disk, and obtaining a second power state of the test disk during the read operation. state, judging whether the second power state is in working state; S6, if so, after the test disk is left to stand for a preset time, judging whether the test disk is in low power consumption state; S7, if so, performing trim operation on the non-verification area of ​​the test disk, and obtaining the third power state of the test disk during the trim operation, judging whether the third power state is in working state; S8, if so, reading verification data from the verification area, and judging whether the verification data is consistent with the preset data; S9, if consistent, determining that the test result of the test disk is a pass test; S10, repeating S1 to S9, the number of repetitions is the first preset number of times, if the test results are all pass tests, determining that the automatic power conversion function of the test disk is normal. The present invention writes a preset data in the test disk, and detects the power state of the test disk during the read, write and trim operations, and determines whether the power conversion function of the test disk is normal according to whether the data before and after each power state and the verification test changes, thereby realizing automatic testing of the power conversion function of the solid-state hard disk and improving the robustness of the solid-state hard disk.

[0035] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and understandable, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0037] Figure 1 A schematic diagram of a process of testing a power state conversion function of a solid state hard disk provided by an embodiment of the present invention is shown;

[0038] Figure 2 A structural schematic diagram of a solid state hard disk power state conversion function test device provided by an embodiment of the present invention is shown;

[0039] Figure 3 A schematic structural diagram of an electronic device provided by an embodiment of the present invention is shown.

[0040] Description of main component symbols:

[0041] 200-solid state hard disk power state conversion function test device; 210-data writing module; 220-static module; 230-first verification module; 240-second verification module; 250-third verification module; 260-judgment module; 270-control module; 300-electronic device; 301-transceiver; 302-processor; 303-memory. DETAILED DESCRIPTION

[0042] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.

[0043] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

[0044] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein in the specification of the template are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.

[0045] Example 1

[0046] The present invention provides a method for testing a solid state drive. Figure 1 , the method includes steps S1 to S10.

[0047] Step S1: writing preset data into the verification area of ​​the test disk.

[0048] In this embodiment, the preset data is sequentially written into the verification area of ​​the test disk by a flexible I / O tester (FIO), wherein the preset data is data of a preset capacity size, and the verification area is any free area in the test disk, and during the writing process, the test disk is in a working state.

[0049] It should be noted that before writing the preset data to the verification area of ​​the test disk, the user also needs to enable the automatic power state transition (Active State Power Management, ASPM) function in the "Advanced" option of the BIOS, and set the PCIe link option to L1 and L1.1&L1.2 to put the test disk into a low power consumption state.

[0050] Step S2: turning on the automatic power state conversion function of the test disk, and after the test disk is left to stand for a preset time, determining whether the test disk is in a low power consumption state.

[0051] It should be noted that the test disk can automatically jump to a low power consumption state when no input or output command is received.

[0052] In this embodiment, the preset time is much longer than the state switching time of the test disk, and the state switching time is the time for the test disk to jump from the low power state to the working state, or the time for the test disk to jump from the working state to the low power state. Before starting the test, the test disk is first left to stand for a preset time, such as 30 seconds, so that the test disk enters the low power state, and the power state of the test disk during the standing process is obtained to determine whether the test disk has really entered the low power state.

[0053] In one embodiment, after the test disk is left to stand for a preset time, determining whether the test disk is in a low power consumption state includes: repeatedly acquiring a fourth power state of the test disk during the standing process, the number of repetitions being a second preset number of times, and the interval between each acquisition being a preset interval time; if each of the fourth power states is a low power consumption state, then determining that the test disk is in a low power consumption state.

[0054] In this embodiment, the test disk is left to stand for a preset time, and during the standing period, the power state of the test disk is obtained at regular intervals, and whether the test disk has truly entered the low power state is determined based on the power states obtained multiple times. For example, the test disk is left to stand for 30 seconds, and during the standing period, the power state of the test disk is obtained every 10 seconds, and the power state is obtained three times in total. If the three power states all indicate the low power state, it is determined that the test disk has entered the low power state, that is, it meets the preset conditions.

[0055] Step S3: If yes, perform a write operation on the non-verification area of ​​the test disk, obtain a first power state of the test disk during the write operation, and determine whether the first power state is in a working state.

[0056] In this embodiment, the test disk is written by the FIO tool, and the power state of the test disk during the write operation is used to determine whether the test disk is switched from the low power state to the working state. If the test disk is switched to the working state, it is determined that the power conversion function of the test disk is normal during the write operation, and the subsequent test steps can be continued; if the power state of the test disk is still in the low power state, it can be determined that the power conversion function of the test disk is abnormal.

[0057] In one embodiment, performing a write operation on the non-verification area of ​​the test disk and obtaining a first power state of the test disk during the write operation includes: performing a write operation on the non-verification area of ​​the test disk for a preset write time, and then obtaining the first power state of the test disk.

[0058] In this embodiment, by setting a preset write time, it can be ensured that the first power state obtained is the power state during the write operation. The preset write time is less than the execution time of the write operation. For example, if the execution time of the write operation is 2 minutes, the first power state of the test disk is obtained 5 seconds after the write operation is performed on the test disk.

[0059] Step S4: If yes, then after the test disk is left to stand for a preset time, it is determined whether the test disk is in a low power consumption state.

[0060] In this embodiment, if the first power state is the working state, it is determined that the power conversion function of the test disk is normal during the writing operation. The test disk is left to stand so that the power state of the test disk is switched to a low power consumption state.

[0061] Step S5: If yes, perform a read operation on the non-verification area of ​​the test disc, obtain the second power state of the test disc during the read operation, and determine whether the second power state is in a working state.

[0062] In this embodiment, a read operation is performed on the test disk through the FIO tool, and according to the power state of the test disk during the read operation, it is determined whether the test disk is switched from a low power consumption state to a working state.

[0063] In one embodiment, performing a read operation on the non-verification area of ​​the test disk and obtaining the second power state of the test disk during the read operation includes: performing a read operation on the non-verification area of ​​the test disk for a preset read time, and then obtaining the second power state of the test disk.

[0064] In this embodiment, by setting a preset read time, it can be ensured that the acquired second power state is the power state during the read operation, wherein the preset read time is less than the execution time of the read operation.

[0065] Step S6: If yes, then after the test disk is left to stand for a preset time, it is determined whether the test disk is in a low power consumption state.

[0066] In this embodiment, if the second power state is the working state, it is determined that the power conversion function of the test disk is normal during the reading operation. The test disk is left to stand still so that the power state of the test disk is switched to the low power state, and then the subsequent test is continued.

[0067] Step S7: If yes, a trim operation is performed on the non-verification area of ​​the test disc, and the third power state of the test disc during the trim operation is obtained to determine whether the third power state is in a working state.

[0068] In this embodiment, a trim operation is performed on the test disk through the FIO tool, and according to the power state of the test disk during the trim operation, it is determined whether the test disk is switched from a low power consumption state to a working state.

[0069] In one embodiment, performing a trim operation on the non-verification area of ​​the test disk and obtaining the third power state of the test disk includes: performing a trim operation on the non-verification area of ​​the test disk, and obtaining the third power state of the test disk after a preset trim time.

[0070] In this embodiment, by setting a preset trim time, it can be ensured that the third power state obtained is the power state during the read operation. The preset trim time is less than the execution time of the read operation.

[0071] Step S8: If yes, read the verification data from the verification area, and determine whether the verification data is consistent with the preset data.

[0072] In this embodiment, if the third power state is the working state, it is determined that the power conversion function of the test disk is normal during the reading operation. After the test disk is tested above, the preset data stored in the verification area is the verification data. After the test process, if the preset data pre-stored in the verification area changes, it can be determined that the power conversion function of the test disk is abnormal.

[0073] In one embodiment, determining whether the verification data is consistent with the preset data includes: respectively calculating a hash value of the verification data and a hash value of the preset data, and determining whether they are equal; if they are equal, determining that the verification data is consistent with the preset data.

[0074] In this embodiment, by comparing the hash value of the verification data and the hash value of the preset data, it can be determined whether the data are consistent.

[0075] Step S9: If they are consistent, it is determined that the test result of the test disk is passed.

[0076] In this embodiment, if the verification data is consistent with the preset data, it can be determined that there is no abnormality in the power conversion function of the test disk in this round of testing, that is, the test disk passes the first round of testing.

[0077] Step S10: Repeating steps S1 to S9 for a first preset number of times. If the test results are all passed, it is determined that the power conversion function of the test disk is normal.

[0078] In this embodiment, the above test steps are repeated for a first preset number of times, such as 50 times. If each test result is a pass, it can be determined that the power conversion function of the test disk is normal. It should be noted that by repeatedly testing multiple times, contingency can be eliminated and the accuracy of the test results can be improved.

[0079] In one embodiment, the method also includes: if the first power state is in a low power consumption state, or the second power state is in a low power consumption state, or the third power state is in a low power consumption state, or the fourth power state is in a working state, then it is determined that the power conversion function of the test disk is abnormal.

[0080] The method for testing the power state transition function of a solid-state hard disk provided by an embodiment of the present invention comprises: S1, writing preset data into a verification area of ​​a test disk; S2, turning on the automatic power state transition function of the test disk, and after the test disk is left to stand for a preset time, determining whether the test disk is in a low power state; S3, if so, performing a write operation on a non-verification area of ​​the test disk, and obtaining a first power state of the test disk during the write operation, and determining whether the first power state is in a working state; S4, if so, after the test disk is left to stand for a preset time, determining whether the test disk is in a low power state; S5, if so, performing a read operation on the non-verification area of ​​the test disk, and obtaining a second power state of the test disk during the read operation, and determining whether the first power state is in a working state. S6, if yes, then after the test disk is left to stand for a preset time, determine whether the test disk is in a low power consumption state; S7, if yes, then perform a trim operation on the non-verification area of ​​the test disk, and obtain the third power state of the test disk during the trim operation, and determine whether the third power state is in a working state; S8, if yes, then read the verification data from the verification area, and determine whether the verification data is consistent with the preset data; S9, if consistent, determine that the test result of the test disk is a pass test; S10, repeat S1 to S9, the number of repetitions is the first preset number of times, if the test results are all pass tests, then determine that the automatic power conversion function of the test disk is normal. The present invention writes a preset data in the test disk, detects the power state of the test disk during the read, write and trim operations, and determines whether the power conversion function of the test disk is normal according to whether the data before and after each power state and the verification test changes, thereby realizing automatic testing of the power conversion function of the solid-state hard disk and improving the robustness of the solid-state hard disk.

[0081] Example 2

[0082] The present invention provides a device for testing the power state conversion function of a solid state hard disk. Figure 2 , the solid state hard disk power state conversion function testing device 200 comprises:

[0083] The data writing module 210 is used to write the preset data into the verification area of ​​the test disk;

[0084] The standstill module 220 is used to enable the automatic power state conversion function of the test disk, and after the test disk is left to stand for a preset time, determine whether the test disk is in a low power consumption state;

[0085] A first verification module 230, configured to, if yes, perform a write operation on the non-verification area of ​​the test disk, and obtain a first power state of the test disk during the write operation to determine whether the first power state is in a working state;

[0086] The standstill module 220 is further used to determine whether the test disk is in a low power consumption state after the test disk is left to stand for a preset time.

[0087] A second verification module 240 is configured to, if yes, perform a read operation on the non-verification area of ​​the test disk, obtain a second power state of the test disk during the read operation, and determine whether the second power state is in a working state;

[0088] The standstill module 220 is further used to determine whether the test disk is in a low power consumption state after the test disk is left to stand for a preset time.

[0089] A third verification module 250, configured to, if yes, perform a trim operation on the non-verification area of ​​the test disk, and obtain a third power state of the test disk during the trim operation to determine whether the third power state is in a working state;

[0090] The static module 220 is further configured to read verification data from the verification area and determine whether the verification data is consistent with the preset data;

[0091] A judgment module 260 is used to determine that the test result of the test disk is passed if they are consistent;

[0092] The control module 270 is used to repeatedly execute S1 to S9, the number of repetitions is a first preset number of times, and if the test results are all passed, it is determined that the automatic power conversion function of the test disk is normal.

[0093] The solid state drive testing device provided in the embodiment of the present invention can execute the solid state drive power state conversion function testing method provided in the above method embodiment 1, which will not be described again here to avoid repetition.

[0094] The solid-state hard disk power state conversion function test device provided by the embodiment of the present invention writes a preset data in the test disk and detects the power state of the test disk during the read, write and trim operations. According to each power state and whether the data changes before and after the verification test, it determines whether the power conversion function of the test disk is normal, thereby realizing automatic testing of the solid-state hard disk power conversion function and improving the robustness of the solid-state hard disk.

[0095] Example 3

[0096] In addition, an embodiment of the present invention provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program runs on the processor, the solid-state hard disk power state transition function test method provided in Example 1 is executed.

[0097] For details, see Figure 3 The electronic device 300 includes: a transceiver 301, a bus interface and a processor 302, wherein the processor 302 is used for S1, writing preset data into the verification area of ​​the test disk; S2, turning on the automatic power state conversion function of the test disk, and after the test disk is left to stand for a preset time, determining whether the test disk is in a low power state; S3, if yes, performing a write operation on the non-verification area of ​​the test disk, and obtaining the first power state of the test disk during the write operation, and determining whether the first power state is in a working state; S4, if yes, after the test disk is left to stand for a preset time, determining whether the test disk is in a low power state; S5, if yes, performing a read operation on the non-verification area of ​​the test disk, and obtaining the second power state of the test disk during the read operation. source state, determine whether the second power state is in a working state; S6, if so, let the test disk stand for a preset time, and determine whether the test disk is in a low power state; S7, if so, perform a trim operation on the non-verification area of ​​the test disk, and obtain the third power state of the test disk during the trim operation, and determine whether the third power state is in a working state; S8, if so, read verification data from the verification area, and determine whether the verification data is consistent with the preset data; S9, if they are consistent, determine that the test result of the test disk is a pass test; S10, repeat S1 to S9, the number of repetitions is a first preset number of times, and if the test results are all pass tests, determine that the automatic power conversion function of the test disk is normal.

[0098] In the embodiment of the present invention, the electronic device 300 further includes a memory 303. Figure 3 In the embodiment, the bus architecture may include any number of interconnected buses and bridges, specifically linking various circuits of one or more processors represented by processor 302 and memory represented by memory 303. The bus architecture may also link various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides an interface. The transceiver 301 may be a plurality of components, i.e., including a transmitter and a receiver, providing a unit for communicating with various other devices on a transmission medium. The processor 302 is responsible for managing the bus architecture and general processing, and the memory 303 may store data used by the processor 302 when performing operations.

[0099] The electronic device 300 provided in the embodiment of the present invention can execute the solid state hard disk power state conversion function testing method provided in the above method embodiment 1, which will not be described again here to avoid repetition.

[0100] Example 4

[0101] In addition, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the solid-state hard disk power state transition function testing method provided in Example 1 is implemented.

[0102] In this embodiment, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0103] The computer-readable storage medium provided in this embodiment can implement the solid-state hard disk power state transition function testing method provided in Example 1, and will not be described again here to avoid repetition.

[0104] In all examples shown and described herein, any specific values ​​should be interpreted as merely exemplary and not as limiting, and thus other examples of the exemplary embodiments may have different values.

[0105] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.

[0106] The above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the present invention. It should be pointed out that for ordinary technicians in this field, several modifications and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention.

Claims

1. A method for testing the power state transition function of a solid state drive. It is characterized in that The method comprises: S1, writing preset data into the verification area of ​​the test disk; S2, turning on the automatic power state conversion function of the test disk, and after the test disk is left to stand for a preset time, determining whether the test disk is in a low power consumption state; S3, if yes, perform a write operation on the non-verification area of ​​the test disk, obtain a first power state of the test disk during the write operation, and determine whether the first power state is in a working state; S4, if yes, then let the test disk stand for a preset time, and then determine whether the test disk is in a low power consumption state; S5. If yes, perform a read operation on the non-verification area of ​​the test disk, obtain the second power state of the test disk during the read operation, and determine whether the second power state is in a working state; S6, if yes, then let the test disk stand for a preset time, and then determine whether the test disk is in a low power consumption state; S7, if yes, perform a trim operation on the non-verification area of ​​the test disc, obtain the third power state of the test disc during the trim operation, and determine whether the third power state is in a working state; S8. If yes, read the verification data from the verification area, and determine whether the verification data is consistent with the preset data; S9, if they are consistent, determining that the test result of the test disk is passed; S10, repeatedly executing S1 to S9, the number of repetitions is a first preset number of times, and if the test results are all passed, it is determined that the automatic power conversion function of the test disk is normal.

2. The method for testing the power state transition function of a solid state hard disk according to claim 1, It is characterized in that After the test disk is left to stand for a preset time, determining whether the test disk is in a low power consumption state includes: Repeatedly acquiring the fourth power state of the test disk during the static process, the number of repetitions being a second preset number of times, and the interval between each acquisition being a preset interval time; If all the fourth power states are low power consumption states, it is determined that the test disk is in a low power consumption state.

3. The method for testing the power state transition function of a solid state hard disk according to claim 2, It is characterized in that The performing a write operation on the non-verification area of ​​the test disk and obtaining a first power state of the test disk during the write operation includes: A write operation is performed on the non-verification area of ​​the test disk for a preset write time, and then a first power state of the test disk is obtained.

4. The method for testing the power state transition function of a solid state hard disk according to claim 2, It is characterized in that The performing a read operation on the non-verification area of ​​the test disk and acquiring a second power state of the test disk during the read operation includes: A read operation is performed on the non-verification area of ​​the test disk, and after a preset read time, a second power state of the test disk is acquired.

5. The method for testing the power state transition function of a solid state hard disk according to claim 2, It is characterized in that The performing a trim operation on the non-verification area of ​​the test disk and acquiring a third power state of the test disk includes: A trim operation is performed on the non-verification area of ​​the test disk, and after a preset trim time, a third power state of the test disk is acquired.

6. The method for testing the power state transition function of a solid state hard disk according to claim 5, It is characterized in that The determining whether the verification data is consistent with the preset data includes: Calculating the hash value of the verification data and the hash value of the preset data respectively, and determining whether they are equal; If they are equal, it is determined that the verification data is consistent with the preset data.

7. The method for testing the power state transition function of a solid state hard disk according to any one of claims 1 to 6, It is characterized in that The method further comprises: If the first power state is in a low power state, or the second power state is in a low power state, or the third power state is in a low power state, or the fourth power state is in a working state, it is determined that the power conversion function of the test disk is abnormal.

8. A solid state hard disk power state conversion function test device, It is characterized in that The device comprises: A data writing module, used for writing preset data into the verification area of ​​the test disk; A standstill module, used to enable the automatic power state conversion function of the test disk, and after the test disk is left to stand for a preset time, determine whether the test disk is in a low power consumption state; A first verification module, configured to, if yes, perform a write operation on a non-verification area of ​​the test disk, and obtain a first power state of the test disk during the write operation to determine whether the first power state is in a working state; The static module is further used to determine whether the test disk is in a low power consumption state after the test disk is static for a preset time. a second verification module, configured to, if yes, perform a read operation on the non-verification area of ​​the test disk, and obtain a second power state of the test disk during the read operation to determine whether the second power state is in a working state; The static module is further used to determine whether the test disk is in a low power consumption state after the test disk is static for a preset time. A third verification module is used to perform a trim operation on the non-verification area of ​​the test disk, and obtain a third power state of the test disk during the trim operation to determine whether the third power state is in a working state; The static module is further configured to read verification data from the verification area and determine whether the verification data is consistent with the preset data; A judgment module, used for determining that the test result of the test disk is passed if they are consistent; The control module is used to repeatedly execute S1 to S9, the number of repetitions is a first preset number, and if the test results are all passed, it is determined that the automatic power conversion function of the test disk is normal.

9. An electronic device, It is characterized in that It comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is run on the processor, the solid-state hard disk power state conversion function test method described in any one of claims 1 to 7 is executed.

10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the solid-state hard disk power state transition function testing method according to any one of claims 1 to 7 is implemented.