Abnormal power failure test method, system and device for solid state hard disk
By generating and executing power-down protocol messages, the solid-state drive is controlled for power-down, which solves the problem of high cost for abnormal power-down testing of solid-state drives and achieves low-cost and efficient one-to-many testing efficiency.
Patent Information
- Application Number
- CN202410744647.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-11
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2044-06-11
AI Technical Summary
The existing abnormal power-down test of solid-state drives has the problem of high test costs. As the number of supported solid-state drives increases, the demand for equipment and the cost also increase significantly.
By obtaining the configuration policy, the power-down protocol message is generated, and when the test script reaches the preset power-down test point, the solid-state drive under test is controlled for power-down, and its current status is queried to obtain the abnormal power-down test results to achieve a For power-down testing of multiple SSDs, there is no need to add more devices.
It reduces the test cost, improves the test efficiency, avoids the cost increase caused by the increase of equipment, and realizes low-cost and efficient solid-state drive power-down strategy control.
Smart Images

Figure CN118312372B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of hard disk testing, and in particular to a solid state hard disk abnormal power failure testing method, a solid state hard disk abnormal power failure testing system, a solid state hard disk abnormal power failure testing device, a machine-readable storage medium and an electronic device. Background Art
[0002] Solid-state drives (SSDs) have surpassed mechanical disks in performance with their faster reading speeds, lower power consumption, longer service life, and lower chance of failure, and are widely used in all walks of life.
[0003] In order to provide the market with high-quality SSDs, comprehensive product testing is necessary. Abnormal power failure means that the SSD is powered off without receiving a power failure notification from the host. Abnormal power failure can lead to data loss, and in severe cases, it can also lead to file damage or even the SSD failing to start normally. Therefore, power failure testing is the top priority in SSD reliability testing.
[0004] As the application scenarios of SSDs increase, the scope of power-off testing also increases accordingly. Various manufacturers are exploring various one-to-many power-off control methods and devices. For example, some whole-machine power-off platforms can support one-to-many testing, but the cost is relatively high. There are also one-to-many power-off tool designs for SSDs that use power distribution units (PDUs) or wireless controllers, but as the number of supported SSDs increases, the demand for equipment also increases, and the cost increases significantly.
[0005] Therefore, the existing one-to-many abnormal power-off test of solid-state hard disks has the problem of high testing cost. Summary of the invention
[0006] The purpose of the embodiments of the present invention is to provide a solid-state hard disk abnormal power-off test method, a solid-state hard disk abnormal power-off test system, a solid-state hard disk abnormal power-off test device, a machine-readable storage medium and an electronic device. The solid-state hard disk abnormal power-off test method can provide a one-to-many solid-state hard disk power-off test by using protocol messages to control the abnormal power-off test of the solid-state hard disk to be tested. The power-off strategy control can be conveniently performed without adding more equipment, the cost is lower, and the improvement of test efficiency does not depend on the increase of equipment.
[0007] In order to achieve the above-mentioned object, the first aspect of the present application provides a solid state drive abnormal power failure test method, comprising:
[0008] Acquire a configuration strategy, and generate a power-off protocol message based on the configuration strategy, wherein the configuration strategy includes a power-off strategy corresponding to each solid-state hard disk to be tested;
[0009] Execute the test script, and when the execution of the test script reaches a preset power-off test point, perform power-off control on each of the solid-state hard disks to be tested according to the power-off protocol message;
[0010] After completing power-off control of each of the solid-state hard disks to be tested, querying and obtaining the current status of each of the solid-state hard disks to be tested;
[0011] Based on the current status of each solid state hard disk to be tested, an abnormal power-off test result is obtained.
[0012] In an embodiment of the present application, generating a power-off protocol message based on the configuration strategy includes:
[0013] Based on the configuration strategy, determine the current test scenario type;
[0014] When it is determined that the current test scenario type is one-to-one, based on the power-off strategy corresponding to the solid-state drive to be tested, a single message packaging method is used to perform message packaging to obtain a power-off protocol message;
[0015] When the current test scenario type is determined to be one-to-many, for each solid-state drive to be tested, based on the power-off strategy corresponding to the solid-state drive to be tested, a single message packaging method is used to obtain a power-off protocol message.
[0016] In the embodiment of the present application, the power-off strategy includes the hardware connection relationship and power-on and power-off duration of the solid-state hard disk to be tested;
[0017] The power-off strategy corresponding to the solid-state hard disk to be tested is based on the power-off strategy, and a single message packaging method is used to package the message to obtain the power-off protocol message, including:
[0018] Setting power-off control parameters based on the hardware connection relationship of the solid-state hard disk to be tested;
[0019] Based on the power on and off duration, setting power limit time parameters;
[0020] Based on the power-off control parameter and the power-limit time parameter, message packetization is performed according to a preset message protocol to obtain a power-off protocol message.
[0021] In an embodiment of the present application, the power-off protocol message is a 698 protocol message; wherein each array structure in the 698 protocol message is used to control a solid-state drive to be tested, and each array structure is linked to form a control class object.
[0022] In the embodiment of the present application, the power-off control of each solid-state hard disk to be tested according to the power-off protocol message includes:
[0023] Unpacking the power-off protocol message to obtain message content;
[0024] Based on the message content, generating a power-off command;
[0025] The power-off command is sent to each of the solid-state hard disks to be tested.
[0026] In an embodiment of the present application, the method further includes:
[0027] After the power-off command is sent to each of the solid-state hard disks to be tested, the command execution status is packaged to form a return message.
[0028] In an embodiment of the present application, before executing the test script, the method further includes:
[0029] According to the power-off strategy, determining a solid state hard disk to be tested to be operated;
[0030] Obtaining a file operation policy, and determining a read / write scenario based on the file operation policy;
[0031] Based on the solid state drive to be tested and the read-write scenario, a solid state drive file operation script is determined and obtained, and the solid state drive file operation script is used as a test script.
[0032] In the embodiment of the present application, the executing of the test script and, when the executing of the test script reaches a preset power-off test point, performing power-off control on each of the solid-state hard disks to be tested according to the power-off protocol message includes:
[0033] Executing the solid state drive file operation script to perform a solid state drive file operation test on each of the solid state drives to be tested;
[0034] Determine whether the execution of the solid state drive file operation script reaches a preset power-off control test point;
[0035] When it is determined that the execution of the solid state hard disk file operation script reaches a preset power-off control test point, power-off control is performed on each of the solid state hard disks to be tested according to the power-off protocol message.
[0036] In an embodiment of the present application, the method further includes:
[0037] Get data validation strategy;
[0038] The abnormal power failure test result is obtained based on the current state of each solid state hard disk to be tested, including:
[0039] Based on the current status of each of the solid-state hard disks to be tested, determining whether each of the solid-state hard disks to be tested has been restored;
[0040] When it is determined that each of the solid-state hard disks to be tested has been restored, determining whether the execution of the test script reaches a preset data verification test point;
[0041] When it is determined that the execution of the test script reaches a preset data verification test point, the data generated when the test script is executed is verified according to the data verification strategy to obtain a verification result;
[0042] Based on the verification result, an abnormal power-off test result is obtained.
[0043] In the embodiment of the present application, it also includes:
[0044] When it is determined that each of the solid-state hard disks to be tested has not been restored, within a preset time range, the status of each of the solid-state hard disks to be tested is queried multiple times at preset intervals, and after each status query of each of the solid-state hard disks to be tested, the execution is jumped to determine whether each of the solid-state hard disks to be tested has been restored based on the current status of each of the solid-state hard disks to be tested;
[0045] When the current status of each solid-state hard disk to be tested obtained by performing status inquiries on each solid-state hard disk to be tested multiple times is all unrecovered, the abnormal power-off test of the solid-state hard disk is terminated.
[0046] In the embodiment of the present application, the obtaining configuration strategy includes:
[0047] Get test scenario configuration information;
[0048] Based on the test scenario configuration information, a configuration strategy is generated.
[0049] A second aspect of the present application provides a solid state hard disk abnormal power failure test system, comprising: a test host and a protocol power failure module, the test host is connected to the protocol power failure module, and the test host and the protocol power failure module are respectively connected to each solid state hard disk to be tested;
[0050] The test host is used to obtain a configuration strategy, and based on the configuration strategy, generate a power-off protocol message, wherein the configuration strategy includes a power-off strategy corresponding to each solid-state hard disk to be tested; it is also used to execute a test script, and when the execution of the test script reaches a preset power-off test point, the power-off protocol message is sent to the protocol power-off module; it is also used to query and obtain the current state of each solid-state hard disk to be tested after completing the power-off control of each solid-state hard disk to be tested, and obtain an abnormal power-off test result based on the current state of each solid-state hard disk to be tested;
[0051] The protocol power-off module is used to perform power-off control on each solid-state hard disk to be tested according to the power-off protocol message.
[0052] In an embodiment of the present application, the test host is connected to the protocol power-off module via a serial port.
[0053] In the embodiment of the present application, the test host and the protocol power-off module communicate using the 698 protocol.
[0054] In the embodiment of the present application, the test host is connected to each solid-state hard disk to be tested via a USB port.
[0055] In the embodiment of the present application, the protocol power-off module controls the power lines between the test host and each of the solid-state hard disks to be tested to be disconnected, so as to achieve power-off control of each of the solid-state hard disks to be tested.
[0056] In the embodiment of the present application, the protocol power-off module uses a relay closing and opening method to control the power-off of each solid-state hard disk to be tested.
[0057] In the embodiment of the present application, the protocol power-off module includes: an unpacking unit, a command generating unit and a control unit;
[0058] The unpacking unit is used to unpack the power-off protocol message to obtain the message content;
[0059] The command generating unit is used to generate a power-off command based on the message content;
[0060] The control unit is used to send the power-off command to each of the solid-state hard disks to be tested.
[0061] In an embodiment of the present application, the protocol power-off module is also used to package the command execution status into a return message after sending the power-off command to each solid-state hard disk to be tested, and send the return message to the test host.
[0062] In an embodiment of the present application, the test host includes: a test scenario policy configurator, a protocol message packaging module, a file operation instruction sending module and a power-off control instruction sending unit, the power-off control instruction sending unit is connected to the protocol power-off module, and the file operation instruction sending module is connected to each solid-state hard disk to be tested;
[0063] The test scenario policy configurator is used to obtain a configuration policy and send the configuration policy to the protocol message packaging module; wherein the configuration policy includes a power-off policy corresponding to each solid-state hard disk to be tested;
[0064] The protocol message packaging module is used to generate a power-off protocol message based on the configuration strategy, and send the power-off protocol message to the power-off control instruction sending unit;
[0065] The file operation instruction sending module is used to execute the test script, and after completing the power-off control of each solid-state hard disk to be tested, query the current state of each solid-state hard disk to be tested, and obtain the abnormal power-off test result based on the current state of each solid-state hard disk to be tested;
[0066] The power-off control instruction sending unit is used to send the power-off protocol message to the protocol power-off module when the execution of the test script reaches a preset power-off test point.
[0067] In an embodiment of the present application, the test scenario policy configurator is further used to obtain a file operation policy and send the file operation policy to the file operation instruction sending module;
[0068] The file operation instruction sending module is used to determine the solid-state hard disk to be tested to be operated according to the power-off strategy; it is also used to determine the read-write scenario based on the file operation strategy; it is also used to determine the solid-state hard disk file operation script based on the solid-state hard disk to be tested to be operated and the read-write scenario, and use the solid-state hard disk file operation script as a test script.
[0069] In an embodiment of the present application, the test host further includes a data verification module, and the file operation instruction sending module and the test scenario policy configurator are respectively connected to the data verification module;
[0070] The test scenario strategy configurator is also used to obtain a data verification strategy and send the data verification strategy to the data verification module;
[0071] The file operation instruction sending module is also used to determine whether each of the solid-state hard disks to be tested has been restored based on the current state of each of the solid-state hard disks to be tested, and when it is determined that each of the solid-state hard disks to be tested has been restored, determine whether the execution of the test script reaches a preset data verification test point;
[0072] The data verification module is used to verify the data generated when executing the test script according to the data verification strategy when determining that the execution of the test script reaches a preset data verification test point, obtain a verification result, and send the verification result to the file operation instruction sending module.
[0073] In the embodiment of the present application, the test host further includes a log recording and display module;
[0074] The log recording and display module is used to obtain the test log and generate a result chart based on the test log.
[0075] In an embodiment of the present application, there are multiple protocol power-off modules, and the multiple protocol power-off modules are combined through networking to obtain a combined protocol power-off module. The combined protocol power-off module is used to control the power-off of each solid-state hard disk to be tested according to the power-off protocol message.
[0076] A third aspect of the present application is a solid state hard disk abnormal power failure test device, comprising:
[0077] An acquisition module, used to acquire a configuration strategy and generate a power-off protocol message based on the configuration strategy, wherein the configuration strategy includes a power-off strategy corresponding to each solid-state hard disk to be tested;
[0078] An execution module, used for executing a test script, and when the execution of the test script reaches a preset power-off test point, performing power-off control on each of the solid-state hard disks to be tested according to the power-off protocol message;
[0079] A query module, used for querying and obtaining the current status of each solid-state hard disk to be tested after completing the power-off control of each solid-state hard disk to be tested;
[0080] The test module is used to obtain abnormal power-off test results based on the current status of each solid-state hard disk to be tested.
[0081] In the embodiment of the present application, the acquisition module includes:
[0082] A scenario determination unit, configured to determine a current test scenario type based on the configuration strategy;
[0083] The first packetizing unit is used to, when determining that the current test scenario type is one-to-one, use a single message packetizing method to perform message packetizing based on the power-off strategy corresponding to the solid-state hard disk to be tested, so as to obtain a power-off protocol message;
[0084] The second packet grouping unit is used to group messages by a single message packing method for each solid-state drive to be tested based on the power-off strategy corresponding to the solid-state drive to be tested when determining that the current test scenario type is one-to-many, so as to obtain a power-off protocol message.
[0085] In the embodiment of the present application, the device further includes:
[0086] A hard disk determination module, used to obtain a file operation strategy, and determine a solid state hard disk to be tested to be operated according to the power-off strategy;
[0087] A scenario determination module, used to determine a read / write scenario based on the file operation strategy;
[0088] The script determination module is used to determine and obtain a solid-state hard disk file operation script based on the solid-state hard disk to be tested and the read and write scenario, and use the solid-state hard disk file operation script as a test script.
[0089] In the embodiment of the present application, the device further includes:
[0090] A strategy acquisition module is used to obtain data verification strategies;
[0091] The test module includes:
[0092] A second judgment unit, configured to judge whether each of the solid-state hard disks to be tested has been restored based on the current state of each of the solid-state hard disks to be tested;
[0093] A third judgment unit is used to judge whether the execution of the test script reaches a preset data verification test point when it is determined that each of the solid-state hard disks to be tested has been restored;
[0094] A verification unit, configured to verify the data generated when executing the test script according to the data verification strategy to obtain a verification result when determining that the execution of the test script reaches a preset data verification test point;
[0095] The determination unit is used to obtain an abnormal power-off test result based on the verification result.
[0096] A fourth aspect of the present application provides an electronic device, the electronic device comprising:
[0097] at least one processor;
[0098] a memory connected to the at least one processor;
[0099] The memory stores instructions that can be executed by the at least one processor, and the at least one processor implements the above-mentioned abnormal power-off testing method for the solid-state hard disk by executing the instructions stored in the memory.
[0100] A fifth aspect of the present application provides a machine-readable storage medium having instructions stored thereon, which, when executed by a processor, configures the processor to execute the above-mentioned abnormal power-off test method for a solid-state hard disk.
[0101] Through the above technical solution, by obtaining the configuration strategy, and based on the configuration strategy, generating a power-off protocol message, the configuration strategy includes a power-off strategy corresponding to each solid-state hard disk to be tested; executing the test script, and when the execution of the test script reaches the preset power-off test point, according to the power-off protocol message, the power-off control of each solid-state hard disk to be tested is performed; after completing the power-off control of each solid-state hard disk to be tested, query to obtain the current state of each solid-state hard disk to be tested; based on the current state of each solid-state hard disk to be tested, obtain the abnormal power-off test result. By using the protocol message to control the abnormal power-off test of the solid-state hard disk to be tested, a one-to-many solid-state hard disk power-off test can be provided, and the power-off strategy control can be conveniently performed without adding more equipment. Compared with the existing whole-machine power-off platform, and other methods using a power distribution unit (PDU) or a wireless controller, the cost is lower, and the improvement of test efficiency does not depend on the increase of equipment.
[0102] Other features and advantages of the embodiments of the present invention will be described in detail in the subsequent detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0103] The accompanying drawings are used to provide a further understanding of the embodiments of the present invention and constitute a part of the specification. Together with the following specific implementations, they are used to explain the embodiments of the present invention, but do not constitute a limitation on the embodiments of the present invention. In the accompanying drawings:
[0104] Figure 1 A schematic diagram of a process flow of a solid state hard disk abnormal power failure test method according to an embodiment of the present application is shown;
[0105] Figure 2 A schematic diagram of a solid state drive abnormal power failure test flow chart according to an embodiment of the present application is shown;
[0106] Figure 3 The following schematically shows a flow chart of 698 message grouping according to an embodiment of the present application;
[0107] Figure 4 A single 698 message packetization flow chart according to an embodiment of the present application is schematically shown;
[0108] Figure 5 A schematic diagram of a host software flow chart for abnormal power failure testing of a solid state drive according to an embodiment of the present application is shown;
[0109] Figure 6 The following schematically shows a workflow diagram of a file operation module according to an embodiment of the present application;
[0110] Figure 7 A schematic diagram of a solid state hard disk abnormal power failure test (1 to 1) according to an embodiment of the present application is shown;
[0111] Figure 8 A schematic diagram of a solid state hard disk abnormal power failure test (1 to many) device according to an embodiment of the present application is shown;
[0112] Fig. 9 A schematic diagram of a data flow chart of a host software for testing abnormal power failure of a solid state drive according to an embodiment of the present application is shown;
[0113] Fig.10 A test scenario selection flow chart according to an embodiment of the present application is schematically shown;
[0114] Fig.11 A schematic diagram of the structure of a solid state hard disk abnormal power failure test device according to an embodiment of the present application is shown;
[0115] Fig.12 The internal structure diagram of a computer device according to an embodiment of the present application is schematically shown.
[0116] Description of Reference Numerals
[0117] 410 - acquisition module; 420 - execution module; 430 - query module; 440 - test module; A01 - processor; A02 - network interface; A03 - internal memory; A04 - display screen; A05 - input device; A06 - non-volatile storage medium; B01 - operating system; B02 - computer program. DETAILED DESCRIPTION
[0118] The specific implementation of the embodiment of the present invention is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described here is only used to illustrate and explain the embodiment of the present invention, and is not used to limit the embodiment of the present invention.
[0119] It should be noted that if the embodiments of the present application involve directional indications (such as up, down, left, right, front, back...), such directional indications are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.
[0120] In addition, if there are descriptions involving "first", "second", etc. in the embodiments of the present application, the descriptions of "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or suggesting their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.
[0121] Please see Figure 1 and Figure 2 , Figure 1 A schematic diagram of a process flow of a solid state hard disk abnormal power failure test method according to an embodiment of the present application is shown; Figure 2 The flowchart of abnormal power failure test of a solid state drive according to an embodiment of the present application is schematically shown. This embodiment provides a method for abnormal power failure test of a solid state drive, comprising the following steps:
[0122] Step 210: Obtain a configuration strategy, and generate a power-off protocol message based on the configuration strategy, wherein the configuration strategy includes a power-off strategy corresponding to each solid-state hard disk to be tested;
[0123] In this embodiment, the above configuration strategy includes a power-off strategy corresponding to each solid-state hard disk to be tested. The power-off strategy includes the power-off and power-on time, power-off duration, number of solid-state hard disks, hardware connection relationship, etc. when the solid-state hard disk to be tested is subjected to an abnormal power-off test. The user can configure the number of solid-state hard disks, the hardware connection relationship of the solid-state hard disks, and the power-off related parameters (power-off times N times / power-off interval M seconds, power-on and power-off duration K seconds), and then generate the power-off strategy according to the configuration. The above-mentioned generation of the power-off protocol message can be obtained by packaging the configuration strategy according to a preset protocol. The above-mentioned protocols include but are not limited to 698 protocols, 645 protocols, etc. Accordingly, a power-off protocol message corresponding to the protocol message can be generated, such as a power-off protocol message being a 698 message.
[0124] Among them, the 698 protocol standardizes the communication architecture, data link layer, application layer, interface class and object identification of the power consumption information data exchange protocol, with stronger interoperability, stronger scalability and higher efficiency. Therefore, the power-off protocol message 698 message generated by the 698 protocol can conveniently perform one-to-many device remote control. In some embodiments, the power-off protocol message is a 698 protocol message; wherein, each array structure in the 698 protocol message is used to control a solid-state hard disk to be tested, and each array structure is linked to form a control class object.
[0125] In this embodiment, multiple array structures in the 698 message can be used to set each array structure to control a single SSD, and then each array is linked to form an arraylist (control class object) to control the power-off of multiple solid-state drives.
[0126] It should be noted that, in order to facilitate the description of the solution, this embodiment is mainly described by taking the power-off protocol message being the 698 message as an example.
[0127] In some embodiments, obtaining the configuration strategy includes the following steps:
[0128] First, obtain the test scenario configuration information;
[0129] Then, based on the test scenario configuration information, a configuration strategy is generated.
[0130] In this embodiment, a test scenario can be selected according to the test purpose, and the test scenario can be specified and allocated by the tester to obtain the test scenario configuration information. The configuration strategy of each solid-state drive can be allocated and generated by the tester, and multiple solid-state drives can be supported to run the same or different test scenarios. The test scenario configuration information includes: the number of solid-state drives, the hardware connection relationship of the solid-state drives, power-off related parameters (power-off times N times / power-off interval M seconds, power-on and power-off duration K seconds), etc.
[0131] In some embodiments, during the test, there may be one or more solid state drives to be tested. In order to generate power-off protocol messages more accurately, corresponding methods may be used to generate power-off protocol messages for different test scenarios. The generation of power-off protocol messages based on the configuration strategy includes the following steps:
[0132] First, based on the configuration strategy, determine the current test scenario type;
[0133] In this embodiment, the above-mentioned determination of the current test scenario type can be based on the number of solid-state drives in the power-off strategy and the hardware connection relationship to determine whether the current test scenario is one-to-one or one-to-many. The above-mentioned one-to-one refers to testing one solid-state drive, and one-to-many refers to testing multiple solid-state drives at the same time.
[0134] Then, when it is determined that the current test scenario type is one-to-one, based on the power-off strategy corresponding to the solid-state drive to be tested, a single message packaging method is used to perform message packaging to obtain a power-off protocol message;
[0135] In this embodiment, in a one-to-one situation, for the power-off strategy corresponding to the SSD to be tested, a single message is packaged to obtain a power-off protocol message. For example, if it is one-to-one, the power-off strategy of the SSD is read and a single SSD 698 message is packaged.
[0136] Then, when it is determined that the current test scenario type is one-to-many, for each SSD to be tested, based on the power-off strategy corresponding to the SSD to be tested, a single message packaging method is used to obtain a power-off protocol message.
[0137] In this embodiment, in the case of one-to-many, the power-off strategies of the power-off strategies corresponding to the SSD to be tested are read in turn, and a single message is grouped to obtain a power-off protocol message. For example, if it is one-to-many, the power-off strategies of the SSDs are read in turn, and a single SSD 698 message is grouped until all SSDs are traversed.
[0138] Please see Figure 3 , Figure 3 The 698 message grouping flow chart according to the embodiment of the present application is schematically shown. The first step is to determine whether the current test scenario is one-to-one or one-to-many according to the number of solid-state hard disks in the power-off strategy; the second step is to read the power-off strategy of the solid-state hard disk if it is one-to-one, perform 698 message grouping for a single solid-state hard disk, and end the process; the third step is to read the power-off strategy of the solid-state hard disk in turn if it is one-to-many, perform 698 message grouping for a single solid-state hard disk in turn, until all solid-state hard disks are traversed; the fourth step is to add the grouped messages to the array queue Arraylist in turn after all solid-state hard disks are traversed in step 3, complete the 698 message grouping for multiple solid-state hard disks, and end the process.
[0139] The power-off strategy includes the hardware connection relationship and power-on and power-off duration of the solid-state hard disk to be tested; the power-off strategy corresponding to the solid-state hard disk to be tested adopts a single message packaging method to perform message packaging to obtain a power-off protocol message, including the following steps:
[0140] The first step is to set power-off control parameters based on the hardware connection relationship of the solid state drive to be tested;
[0141] The second step is to set a power-limiting time parameter based on the power-on and power-off durations;
[0142] The third step is to perform message packetization according to a preset message protocol based on the power-off control parameter and the power-limit time parameter to obtain a power-off protocol message.
[0143] In this embodiment, the power-off control parameter refers to the parameter for controlling the closing and closing of a solid-state hard disk. In order to facilitate the description of the scheme, the power-off protocol message generated as 698 message is used as an example for description. Please refer to Figure 4 , Figure 4 The schematic diagram shows a single 698 message packet assembly flow chart according to an embodiment of the present application. The first step is to set the "relay OAD" parameter in the remote control method of the control class object according to the hardware connection relationship between the solid-state hard disk and the protocol power-off module in the power-off strategy; the second step is to set the "power limit time" parameter according to the power-on and power-off duration in the power-off strategy; the third step is to complete the assembly of the 698 message header and other parameters, that is, to complete the assembly of the single solid-state hard disk 698 message, obtain the power-off protocol message, and leave it for sending when the power-off control point is reached.
[0144] In the above implementation process, by setting the power-off control parameters and power-limit time parameters, the power-off and power-on time and power-off duration of each solid-state drive can be controlled through the power-off protocol message, which helps to implement different abnormal power-off test strategies for different solid-state drives. The power-off protocol message achieves one-to-one, one-to-many, and controllable power-on and power-off test scenario coverage, which helps to achieve accurate, efficient, and comprehensive solid-state drive power-off testing.
[0145] Step 220: executing the test script, and when the test script reaches a preset power-off test point, performing power-off control on each of the solid-state hard disks to be tested according to the power-off protocol message;
[0146] In this embodiment, the test script is a script for implementing an abnormal power-off test of a solid-state drive. A power-off test point is pre-set in the script. When the script is executed to the power-off test point, the power-off control of each solid-state drive to be tested is started according to the power-off protocol message. According to the selected test scenario, the power-off protocol message is sent regularly according to the script requirements to control the power-off and power-on of each solid-state drive to be tested.
[0147] In some embodiments, the power-off control of each of the solid-state hard disks to be tested according to the power-off protocol message includes the following steps:
[0148] First, the power-off protocol message is unpacked to obtain the message content;
[0149] Then, based on the message content, a power-off command is generated;
[0150] Finally, the power-off command is sent to each of the solid-state hard disks to be tested.
[0151] In this embodiment, the power-off protocol message is first unpacked, and a power-off command is generated according to the unpacked message content. The power-off is controlled by the power-off command to achieve power-off control of the solid-state drive to be tested, wherein one solid-state drive to be tested corresponds to one configuration strategy.
[0152] In some embodiments, the method further includes: after the power-off command is sent to each of the solid-state hard disks to be tested, packaging the command execution status to form a return message.
[0153] In this embodiment, after the power-off command is sent, the command execution status may be packaged into a return message to determine whether the power-off control of each solid-state hard disk to be tested is completed.
[0154] Step 230: after completing the power-off control of each of the solid-state hard disks to be tested, query and obtain the current status of each of the solid-state hard disks to be tested;
[0155] In this embodiment, the current status of each SSD to be tested can be obtained by querying each SSD to be tested. The query to obtain the current status of each SSD to be tested includes: 1. querying the data storage status in the SSD to determine the integrity and reliability of the data before and after the power failure in different power failure test scenarios; 2. the availability of the hard disk after the power failure to determine the health status of the hard disk. Through the current status of each SSD to be tested, the abnormal power failure result can be determined by combining the two types of results, data integrity and health status.
[0156] Step 240: Obtain abnormal power-off test results based on the current status of each solid-state hard disk to be tested.
[0157] In this embodiment, after obtaining the current status of each solid-state hard disk to be tested by querying, a round of power-off test is completed to obtain the abnormal power-off test result. For example: if the hard disk is available and the data integrity check passes, the abnormal power-off test passes; if the hard disk is available but the data check fails, the abnormal power-off test fails; if the hard disk is unavailable, the abnormal power-off test fails.
[0158] In the above implementation process, a configuration strategy is obtained, and a power-off protocol message is generated based on the configuration strategy, wherein the configuration strategy includes a power-off strategy corresponding to each solid-state hard disk to be tested; the test script is executed, and when the execution of the test script reaches a preset power-off test point, the power-off control of each solid-state hard disk to be tested is performed according to the power-off protocol message; after completing the power-off control of each solid-state hard disk to be tested, the current state of each solid-state hard disk to be tested is queried; based on the current state of each solid-state hard disk to be tested, the abnormal power-off test result is obtained. By using a protocol message to control the abnormal power-off test of the solid-state hard disk to be tested, a one-to-many solid-state hard disk power-off test can be provided, and one-to-one and one-to-many power-off strategy control can be conveniently performed without adding more equipment. Compared with the existing whole-machine power-off platform and other methods using a power distribution unit (PDU) or a wireless controller, the cost is lower, and the improvement of test efficiency does not depend on the increase of equipment.
[0159] Since the power-off test scenario is mainly designed based on the mapping table update scenario, in order to enable the existing file system to directly access the SSD without any modification, the SSD uses a flash translation layer (FTL) to simulate the operation of NAND Flash into the operation of the disk. The SSD uses FTL to manage the NAND Flash array. Among them, address mapping is an important part of the entire FTL. It is responsible for converting all logical addresses issued by the file system into physical block addresses that can be recognized by NAND Flash. At the same time, it establishes a mapping relationship between logical blocks and physical block addresses, and stores them in the mapping table for query and modification.
[0160] During the power-on period of the SSD, the SSD will load part or all of the mapping table into the SRAM to perform addressing operations. SRAM has the characteristic of data loss during power failure. During abnormal power failure, the mapping table may not be written back to the NAND Flash in time. After the next power-on, the entire mapping table needs to be rebuilt for the system to operate normally. If the mapping table cannot be built, the data file system in the NAND Flash cannot be read and written normally.
[0161] Based on the mapping table update scenario, the power-off test scenarios mainly include the following three scenarios:
[0162] (a) Data writing scenario: The process of writing data is the process of updating the mapping table. Power failure during the writing process will affect whether the mapping table is completely updated. In this scenario, when writing data row by row normally, the SSD is abnormally powered off;
[0163] (b) Data deletion scenario: The process of deleting data, like creating files, also involves updating the mapping table. In this scenario, when deleting data line by line or entire segment, the SSD is abnormally powered off;
[0164] (c) Garbage collection scenario: When a certain amount of data is written to the SSD or the free area is reduced to a certain extent, the background starts garbage collection. Garbage collection means data relocation, and data relocation means updating the mapping table. At this time, abnormal power failure usually causes problems. In this scenario, when the SSD is used as an empty disk, when writing X% of the data, an abnormal power failure test is performed every M seconds, and the time interval between each power failure and power on is K seconds. For example, when writing 30%, 50%, 70%, and 100% of the data, an abnormal power failure test is performed every 300 seconds, and the time interval between each power failure and power on is 30s. After power on, the write operation continues.
[0165] In some embodiments, before executing the test script, the method further includes the following steps:
[0166] First, according to the power-off strategy, a solid-state hard disk to be tested is determined to be operated;
[0167] In this embodiment, a corresponding number of solid state drives to be tested are operated according to the test scenario selected in the power-off strategy, such as one-to-one or one-to-many scenario, preset values, test duration, etc.
[0168] Then, a file operation strategy is obtained, and based on the file operation strategy, a read and write scenario is determined;
[0169] Finally, based on the solid state drive to be tested and the read-write scenario, a solid state drive file operation script is determined and obtained, and the solid state drive file operation script is used as a test script.
[0170] In this embodiment, the user can configure the power-off test scenario, and can select a data writing scenario, a data deletion scenario, or a garbage collection scenario according to the test purpose, and then generate a file operation strategy according to the power-off test scenario configuration. Each power-off test scenario contains multiple test scripts and sub-scripts. Each solid-state drive is assigned a test scenario and a strategy is generated by the tester, and multiple solid-state drives can be supported to run the same or different test scenarios. Different solid-state drive file operation scripts can be pre-set according to different file operation strategies. During the test, the file operation strategy used in the current test can be obtained according to the selected test scenario, and then the corresponding solid-state drive file operation script can be determined.
[0171] The SSD file operation script can be quickly and accurately obtained through the SSD to be tested and the read and write scenarios to be operated, and power-off testing of data writing scenarios, data deletion scenarios or garbage collection scenarios in one-to-one or one-to-many scenarios can be realized.
[0172] Accordingly, the execution of the test script and, when the execution of the test script reaches a preset power-off test point, the power-off control of each solid-state hard disk to be tested is performed according to the power-off protocol message, including the following steps:
[0173] First, executing the solid state drive file operation script to perform a solid state drive file operation test on each of the solid state drives to be tested;
[0174] In this embodiment, since each power-off test scenario includes multiple test scripts and sub-scripts, executing the SSD file operation script may be executing multiple test scripts or sub-scripts. The SSD file operation script corresponds to one or more power-off test scenarios. Start reading the SSD file operation script and perform a SSD file operation (write, delete, etc.) test.
[0175] Then, determining whether the execution of the solid state hard disk file operation script reaches a preset power-off control test point;
[0176] In this embodiment, in the data writing scenario, a file will be created in the solid-state hard disk to be tested and random data will be written line by line. During the writing process, it is determined that the power-off execution condition is met, that is, the preset power-off control test point is reached; in the data deletion scenario, a basic file will be created first, and the file data are all random numbers. Then the file data is deleted line by line. During the deletion process, it is determined that the power-off execution condition is met, that is, the preset power-off control test point is reached; in the garbage collection scenario, the solid-state hard disk to be tested is operated according to the preset scenario of the tester to generate a basic file. When X% of the data is written, it is determined that the power-off execution condition is met, that is, the preset power-off control test point is reached.
[0177] Finally, when it is determined that the execution of the solid state hard disk file operation script reaches a preset power-off control test point, power-off control is performed on each of the solid state hard disks to be tested according to the power-off protocol message.
[0178] In this embodiment, the power-off control test point is a power-off control judgment pre-set in the solid-state hard disk file operation script to determine whether the power-off control judgment is reached. If the power-off control judgment is not reached, the solid-state hard disk file operation continues. Otherwise, power-off control is performed on each of the solid-state hard disks to be tested according to the power-off protocol message.
[0179] In the above implementation process, the SSD file operation script can be determined through the file operation strategy, and then the SSD file operation script is used to test the SSD file operation, and when the power-off control test point is reached, the power-off control is performed on each SSD to be tested. By introducing the file operation strategy, different power-off test scenarios can be configured, providing a customizable SSD slave power-off test scenario, which helps to achieve accurate, efficient and comprehensive SSD power-off testing.
[0180] In some embodiments, the method further comprises: obtaining a data verification policy;
[0181] In this embodiment, the user can configure the data verification method, select the appropriate data verification granularity according to the selected power-off test scenario, and generate a data verification strategy according to the data verification method configuration. The above data verification strategy includes that the ability to open the file indicates that the hard disk is not damaged, the full file integrity check of the written data after the entire test is completed, and the data integrity check of each line written. In addition to the above three configurations, other verification methods can be expanded according to actual needs, which is not limited in this embodiment.
[0182] Accordingly, obtaining the abnormal power-off test result based on the current status of each solid-state hard disk to be tested includes the following steps:
[0183] First, based on the current status of each of the solid-state hard disks to be tested, it is determined whether each of the solid-state hard disks to be tested has been restored;
[0184] Then, when it is determined that each of the solid state drives to be tested has been restored, it is determined whether the execution of the test script reaches a preset data verification test point;
[0185] In this embodiment, the current status of each solid state drive is queried. If the current status of each solid state drive has been restored, the file operation is continued, and it is determined whether the data verification judgment is reached, that is, whether the data verification test point is executed.
[0186] Then, when it is determined that the execution of the test script reaches a preset data verification test point, the data generated when the test script is executed is verified according to the data verification strategy to obtain a verification result;
[0187] In this embodiment, the above verification is based on the set data verification strategy, for example, using the verification strategy to verify data integrity, obtain hard disk data and perform comparison verification. If it is determined that the solid state hard disk file operation script has not been executed to reach the data verification test point, the file operation continues, that is, the test script continues to be executed.
[0188] Then, based on the verification result, an abnormal power-off test result is obtained.
[0189] In this embodiment, after obtaining the verification result, the verification result can be judged and recorded to determine whether a round of power-off test has been completed. When it is determined that the abnormal power-off test of the solid-state hard disk has been completed, the abnormal power-off test result is obtained. For example: if the hard disk is available and the data integrity check passes, the abnormal power-off test passes; if the hard disk is available but the data check fails, the abnormal power-off test fails; if the hard disk is unavailable, the abnormal power-off test fails.
[0190] Among them, it also includes:
[0191] First, when it is determined that each of the solid-state hard disks to be tested has not been restored, within a preset time range, the status of each of the solid-state hard disks to be tested is queried multiple times at preset intervals, and after each status query of each of the solid-state hard disks to be tested, the execution is jumped to determine whether each of the solid-state hard disks to be tested has been restored based on the current status of each of the solid-state hard disks to be tested;
[0192] In this embodiment, the state of the solid-state hard disk to be tested can be queried at preset intervals to obtain a new current state of the solid-state hard disk to be tested; the new current state of the solid-state hard disk to be tested is used as the current state of the solid-state hard disk to be tested, and the execution is jumped to determine whether each solid-state hard disk to be tested has been restored based on the current state of each solid-state hard disk to be tested;
[0193] Then, when the current status of each solid-state hard disk to be tested obtained by performing status inquiries on each solid-state hard disk to be tested multiple times is not recovered, the abnormal power-off test of the solid-state hard disk is terminated.
[0194] In this embodiment, it is determined whether the current status of each SSD to be tested is not recovered within the preset time range. If so, the abnormal power failure test of the SSD is terminated. The above preset time and preset time range can be preset, such as 30 seconds. If each SSD to be tested is not recovered, the SSD status query is performed every 30 seconds. Each query jumps to the execution based on the current status of each SSD to be tested, and determines whether each SSD to be tested has been recovered until each SSD to be tested has been recovered. If none of them are recovered within the preset time range, the test is terminated.
[0195] According to the data verification strategy, the data after the file operation is verified, which can complete the data security verification function and improve the test safety and reliability. By querying the status of the solid-state hard disk to be tested at preset intervals, and judging whether the current status of each solid-state hard disk to be tested is unrecovered within the preset time range, it is helpful to quickly end the abnormal power failure test of the solid-state hard disk and improve the efficiency of the abnormal power failure test of the solid-state hard disk.
[0196] For example: See Figure 5 , Figure 5 A flowchart of a host software for testing abnormal power failure of a solid state drive according to an embodiment of the present application is schematically shown. The host software flowchart for testing abnormal power failure of a solid state drive includes the following steps:
[0197] (1) Select a test scenario based on the test purpose. The tester specifies and allocates the test scenario. The test scenario policy configurator generates the power-off policy, file operation policy, and data verification policy for each SSD to be tested based on the tester's configuration and distributes them to the corresponding modules.
[0198] (2) Obtain the file operation strategy used in the current test according to the selected test scenario, select the corresponding SSD file operation script, and perform 698 message grouping according to the power-off strategy and keep it for backup;
[0199] (3) Start reading the file operation script and perform SSD file operation (writing, deleting, etc.) tests;
[0200] (4) When determining whether the power-off control judgment is reached, if the power-off control judgment is not reached, continue to perform the solid-state hard disk file operation;
[0201] (5) Step 4 reaches the power-off control, and the 698 message assembled in step 2 is sent to the protocol power-off module, and the protocol power-off module sends a control command to power off the solid-state drive;
[0202] (6) Query the current status of the SSD. If the SSD has been restored, continue the file operation. If it has not been restored, query the SSD status every 30 seconds. If the SSD cannot be queried for more than 15 minutes, end the test.
[0203] (7) Determine whether the data verification judgment has been reached. If not, continue to perform the SSD file operation;
[0204] (8) When step 7 reaches the data verification stage, the data is verified according to the data verification strategy;
[0205] (9) Judge and record the verification results to determine whether a round of power-off test has been completed;
[0206] Figure 1 FIG. 1 is a flow chart of a method for testing abnormal power failure of a solid state hard disk in one embodiment. It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed 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 part of the sub-steps or stages of other steps.
[0207] The present embodiment provides a solid state hard disk abnormal power failure test system, comprising: a test host and a protocol power failure module, the test host is connected to the protocol power failure module, and the test host and the protocol power failure module are respectively connected to each solid state hard disk to be tested;
[0208] The test host is used to obtain a configuration strategy, and based on the configuration strategy, generate a power-off protocol message, wherein the configuration strategy includes a power-off strategy corresponding to each solid-state hard disk to be tested; it is also used to execute a test script, and when the execution of the test script reaches a preset power-off test point, the power-off protocol message is sent to the protocol power-off module; it is also used to query and obtain the current state of each solid-state hard disk to be tested after completing the power-off control of each solid-state hard disk to be tested, and obtain an abnormal power-off test result based on the current state of each solid-state hard disk to be tested;
[0209] The protocol power-off module is used to perform power-off control on each solid-state hard disk to be tested according to the power-off protocol message.
[0210] In this embodiment, the test host refers to the SSD abnormal power-off test host, which is responsible for running the test script, generating and sending the power-off protocol message to the protocol power-off module. After receiving the power-off protocol message from the test host, the protocol power-off module controls the opening and closing operation and the opening and closing time according to the power-off protocol message requirements, thereby controlling the power-off and power-on time and power-off duration of the SSD to be tested, and realizing the abnormal power-off test of the SSD.
[0211] In the above implementation process, by connecting the test host to the protocol power-off module, the test host is respectively connected to each solid-state drive to be tested, so as to build an automated test environment with customizable power-off test scenarios and run the test script; by using protocol messages to control the abnormal power-off test of the solid-state drive to be tested, it is possible to provide a one-to-many solid-state drive power-off test, and it is convenient to perform one-to-one or one-to-many power-off strategy control without adding more equipment. Compared with the existing whole-machine power-off platform and other methods using power distribution units (PDUs) or wireless controllers, the cost is lower and the efficiency improvement does not depend on the increase of equipment.
[0212] In some embodiments, the test host is connected to the protocol power-off module via a serial port.
[0213] In this embodiment, the communication mode of the protocol power-off module includes serial communication and Ethernet communication. For example, the protocol power-off module includes one RS-485 serial port and one Ethernet interface. The serial port supports up to 4 normally open and normally closed switch-on and switch-off control outputs, and the network port supports multiple normally open and normally closed switch-on and switch-off control outputs. Among them, the hardware and software implementation of the serial communication are relatively simple, and only a small amount of hardware and software resources are needed to realize data transmission.
[0214] In some embodiments, the test host and the protocol power-off module communicate using the 698 protocol.
[0215] In this embodiment, the 698 protocol standardizes the communication architecture, data link layer, application layer, interface class and object identification of the power consumption information data exchange protocol, which has stronger interoperability, stronger scalability and higher efficiency. Therefore, using the 698 protocol for communication can conveniently perform one-to-many device remote control.
[0216] In some embodiments, the test host is connected to each solid-state drive to be tested via a USB port.
[0217] In some embodiments, the protocol power-off module controls the power lines between the test host and each of the solid-state hard disks to be tested to be disconnected, so as to achieve power-off control of each of the solid-state hard disks to be tested.
[0218] In this embodiment, the solid state drive to be tested is connected to the power-off test host through the USB port, the data line is directly connected to the USB port, and the USB power line is controlled on and off by the protocol power-off module to simulate the power-on and power-off process.
[0219] Taking the serial port as an example, the one-to-one and one-to-many connection modes of the SSD abnormal power failure test system are as follows: Figure 7 and Figure 8 As shown, Figure 7 A schematic diagram of a solid state hard disk abnormal power failure test (1 to 1) according to an embodiment of the present application is shown; Figure 8 A diagram schematically shows a device diagram for abnormal power failure testing (1 to many) of a solid state drive according to an embodiment of the present application.
[0220] In a one-to-one test scenario, the test host is responsible for running the test script and sending 698 protocol messages through the serial port; after the protocol power-off module receives the power-off protocol message from the test host, it controls the opening and closing operations and the opening and closing time through the USB power line according to the instructions, thereby controlling the power-off and power-on time and power-off duration of the solid-state hard disk to be tested, and realizing abnormal power-off testing of the solid-state hard disk.
[0221] In a one-to-many test scenario, the difference from a one-to-one test scenario is that the SSD abnormal power-off test host generates a power-off control strategy for each SSD according to the test script, and forms a 698 protocol message, which is sent to the protocol power-off module through the serial port; after the protocol power-off module receives the power-off protocol message from the test host, it accurately controls the power-off and power-on time and power-off duration of each SSD according to the message instruction requirements, so as to implement different abnormal power-off test strategies for different SSDs.
[0222] In some embodiments, the protocol power-off module uses a relay closing method to control the power-off of each solid-state hard disk to be tested.
[0223] In this embodiment, taking the 698 protocol as an example, the relay closing and closing method is used, the control class object remote control method in the 698 protocol is used, the "relay OAD" parameter in the control class object remote control method 129 is set, and the "power limit time" parameter is set according to the power-on and power-off duration in the power-off strategy, and the packaging of the 698 message header and other parameters is completed, that is, the packaging work of the 698 message of a single solid-state hard disk is completed, and it is left to be sent when the power-off control point is reached.
[0224] Specifically, the relay closing and closing method is used to control power-off and power-on. The remote control method of the control class object in the 698 protocol has the following parameter structure:
[0225] Method 129: Trip(parameters)
[0226] Parameters: array structure
[0227] {
[0228] Relay OAD,
[0229] Alarm delay unsigned (unit: minute, conversion: 0),
[0230] Power-limiting time long-unsigned (unit: minute, conversion: 0; a value of 0 indicates permanent power-limiting).
[0231] Automatic closing bool (True: automatic closing; False: non-automatic closing)
[0232] }
[0233] Power-off control parameters: Use the parameter "Relay OAD" to control the closing and opening of a solid-state hard disk. F2050201, F2050202, F2050203, and F2050204 close the 1st, 2nd, 3rd, and 4th circuits, and F2050205, F2050206, F2050207, and F2050208 close the 1st, 2nd, 3rd, and 4th circuits.
[0234] Power-off duration control: Use the parameter "Power-off time" to control the power-off time of a certain SSD in minutes.
[0235] Control of multiple SSDs: Use multiple array structures, set each arraystructure to control a single SSD, and then link each array to form an arraylist to control different power-off strategies of multiple SSDs.
[0236] For 1-to-1 opening and closing control mode: the protocol power-off module terminal numbers 1-12, each 3 as a group, support 4 normally open, normally closed opening and closing control outputs. Taking 1-3 as an example, terminal 1-opening normally open, terminal 2-opening common, terminal 3-opening normally closed. Abnormal power-off scenarios can be divided into:
[0237] Power off in the closed state: Use terminals 2 and 3, in the closed state, to perform abnormal power off, and then power on again after a period of time to return to the closed state;
[0238] Power on in open state: Use terminals 1 and 2 to power on in open state, and then power off and return to open state after a period of time.
[0239] For the 1-to-4 switch control mode: the protocol power-off module terminals are 1-12, 3 in a group, to control the power-on and power-off operations of the 4 SSDs to be tested. The abnormal power-off scenario can be the same for the 4 SSDs to be tested, or different scenarios can be configured for testing.
[0240] 1-to-many opening and closing control mode: In addition to supporting serial port communication, the protocol power-off module also supports network port communication. The one-to-many opening and closing control can be designed by networking multiple protocol power-off modules to support the expansion of power-off testing of more solid-state hard disk devices.
[0241] In some embodiments, the protocol power-down module includes: an unpacking unit, a command generation unit, and a control unit;
[0242] The unpacking unit is used to unpack the power-off protocol message to obtain the message content;
[0243] The command generating unit is used to generate a power-off command based on the message content;
[0244] The control unit is used to send the power-off command to each of the solid-state hard disks to be tested.
[0245] In this embodiment, the power-off protocol message is first unpacked, and a power-off command is generated according to the unpacked message content. The power-off is controlled by the power-off command to achieve power-off control of the solid-state drive to be tested, wherein one solid-state drive to be tested corresponds to one configuration strategy.
[0246] In some embodiments, the protocol power-off module is further used to package the command execution status into a return message after sending the power-off command to each of the solid-state drives to be tested, and send the return message to the test host.
[0247] In this embodiment, after the power-off command is sent, the command execution status may be packaged into a return message to determine whether the power-off control of each solid-state hard disk to be tested is completed.
[0248] Among them, please see Fig. 9 , Fig. 9 The data flow chart of the host software for testing abnormal power failure of a solid-state hard disk according to an embodiment of the present application is schematically shown. The test host comprises: a test scenario strategy configurator, a protocol message packaging module, a file operation instruction sending module and a power failure control instruction sending unit, the protocol message packaging module and the file operation instruction sending module are respectively connected to the test scenario strategy configurator, the power failure control instruction sending unit is connected to the protocol power failure module, and the file operation instruction sending module is connected to each solid-state hard disk to be tested;
[0249] The test scenario policy configurator is used to obtain a configuration policy and send the configuration policy to the protocol message packaging module; wherein the configuration policy includes a power-off policy corresponding to each solid-state hard disk to be tested;
[0250] The protocol message packaging module is used to generate a power-off protocol message based on the configuration strategy, and send the power-off protocol message to the power-off control instruction sending unit;
[0251] The file operation instruction sending module is used to execute the test script, and after completing the power-off control of each solid-state hard disk to be tested, query the current state of each solid-state hard disk to be tested, and obtain the abnormal power-off test result based on the current state of each solid-state hard disk to be tested;
[0252] The power-off control instruction sending unit is used to send the power-off protocol message to the protocol power-off module when the execution of the test script reaches a preset power-off test point.
[0253] In this embodiment, the test scenario policy configurator is responsible for the selection of test scenarios and policy generation. Each power-off test scenario contains multiple test scripts and sub-scripts. Each solid-state drive is assigned a test scenario and a policy is generated by a tester, and multiple solid-state drives are supported to run the same or different test scenarios. Before the test begins, the test scenario is specified and assigned by the tester. The test scenario policy configurator generates a power-off policy, a file operation policy, and a data verification policy for each solid-state drive to be tested according to the tester's configuration, and distributes them to the corresponding modules. The safety performance of the solid-state drive is closely related to the power-off test scenario. Different test contents and environments will affect the power-off performance evaluation of the solid-state drive. At the same time, a single test scenario can no longer meet the needs of the solid-state drive power-off test. The test scenario policy configurator can include power-off test scenario configuration, data verification mode configuration, solid-state drive quantity configuration, solid-state drive hardware connection relationship configuration, and power-off related parameter configuration (power-off times N times / power-off interval M seconds, power-on and power-off duration K seconds).
[0254] In this embodiment, the protocol message packetization module performs protocol message packetization according to the received power-off strategy, the number of solid-state hard disks configured in the power-off strategy, the hardware connection relationship of the solid-state hard disks, power-off related parameters, etc., and outputs the power-off control instructions for the test scenario, which are sent to the solid-state hard disk when the power-off test point is executed.
[0255] In this embodiment, the file operation instruction sending module has two functional components: the main function is to generate corresponding file operation instructions through the scenario selected by the user, send them to the operating system, and operate the SSD; the other function is to communicate with the protocol message packaging module after a specific scenario is completed (such as: in the scenario recycling scenario, when X% of the data has been written), and notify the protocol message packaging module that the power-off execution condition is met. Among them, the specific power-off method is still generated and executed by the protocol message packaging module, and the file operation instruction sending module only notifies the protocol message packaging module that the execution condition is met.
[0256] Please see Figure 6 , Figure 6 The following is a schematic diagram of the workflow of the file operation module according to an embodiment of the present application. The specific operation steps of the file operation instruction sending module are as follows:
[0257] In the first step, when the module is working, the corresponding number of SSDs are operated according to the test scenario selected by the test, such as: one-to-one or one-to-many scenario, preset value, test duration, etc.
[0258] The second step is to determine the read and write scenario. When it is determined to be a data writing scenario, a file will be created in the SSD and random data will be written line by line. During the writing process, the protocol message packaging module will be notified to meet the power-off execution condition. In the data deletion scenario, a basic file will be created first. The file data are all random numbers, and then the file data will be deleted line by line. During the deletion process, the protocol message packaging module will be notified to meet the power-off execution condition. In the garbage collection scenario, the SSD is operated according to the preset scenario of the tester to generate a basic file. When X% of the data is written, the protocol message packaging module will be notified to meet the power-off execution condition.
[0259] The third step is to execute the file operation to end the set test time.
[0260] In this embodiment, the power-off control instruction sending unit is responsible for sending the power-off control message output by the protocol message packaging module at regular intervals according to the selected test scenario and the script requirements in the actual test scenario to perform power-off and power-on control.
[0261] The test scenario policy configurator is further used to obtain a file operation policy and send the file operation policy to the file operation instruction sending module;
[0262] The file operation instruction sending module is used to determine the solid-state hard disk to be tested to be operated according to the power-off strategy; it is also used to determine the read-write scenario based on the file operation strategy; it is also used to determine the solid-state hard disk file operation script based on the solid-state hard disk to be tested to be operated and the read-write scenario, and use the solid-state hard disk file operation script as a test script.
[0263] In this embodiment, the file operation instruction sending module is also responsible for selecting a corresponding file operation script according to a file operation strategy in an actual test scenario, sending specific file operation instructions, and realizing file operations on the solid state drive.
[0264] Wherein, the test host further includes a data verification module, and the file operation instruction sending module and the test scenario strategy configurator are respectively connected to the data verification module;
[0265] The test scenario strategy configurator is also used to obtain a data verification strategy and send the data verification strategy to the data verification module;
[0266] The file operation instruction sending module is also used to determine whether each of the solid-state hard disks to be tested has been restored based on the current state of each of the solid-state hard disks to be tested, and when it is determined that each of the solid-state hard disks to be tested has been restored, determine whether the execution of the test script reaches a preset data verification test point;
[0267] The data verification module is used to verify the data generated when executing the test script according to the data verification strategy when determining that the execution of the test script reaches a preset data verification test point, obtain a verification result, and send the verification result to the file operation instruction sending module.
[0268] In this embodiment, the data verification module is responsible for verifying the data after the file operation according to the data verification strategy in the actual test scenario to complete the data security verification function. The data verification module can verify the data consistency before and after each power-off and power-on for each SSD in the test environment separately and in real time, and whether there is loss or damage, and send the result to the test log recording and display module. When the module detects that the data is lost or damaged, the system can control the test to be terminated according to the result, retain the power-off problem site, or control the test to continue, which is used to verify whether the SSD can still work normally after the power-off problem.
[0269] like Fig.10 As shown, Fig.10 The test scenario selection flow chart according to an embodiment of the present application is schematically shown. The operation process of the test scenario strategy configurator includes:
[0270] In the first step, the user configures the power-off test scenario and selects the data writing scenario, data deletion scenario or garbage collection scenario according to the test purpose. The test scenario policy configurator generates a file operation policy based on the power-off test scenario configuration and distributes it to the file read and write instruction sending module;
[0271] In the second step, the user configures the data verification method and selects the appropriate data verification granularity according to the selected power-off test scenario. The test scenario policy configurator generates the data verification policy according to the data verification method configuration and distributes it to the data verification module;
[0272] In the third step, the user configures the number of SSDs, the hardware connection relationship of the SSDs, and power-off related parameters (N power-off times / M seconds power-off interval, K seconds power-on and power-off duration). The test scenario policy configurator generates a power-off policy based on the configuration and distributes it to the protocol message assembly module.
[0273] In the above implementation process, by designing a test scenario strategy configurator, the power-off strategy, file operation strategy and data verification strategy of each SSD to be tested can be generated according to the configuration of the tester, and a customizable SSD slave power-off test scenario can be provided, realizing an accurate, efficient, comprehensive and low-cost SSD power-off test method. It is possible to customize the power-off test scenario and automatically generate the test strategy, power-off strategy and data verification strategy. Based on the scenario of mapping table update, the power-off strategy of the three scenarios of data writing, data deletion and garbage collection is designed, and data verification strategies of different granularities are provided. Testers can customize and cover the power-off test scenario as needed, and the test scenario is more comprehensive.
[0274] In some embodiments, the test host also includes a log recording and display module, which is responsible for collecting, recording, and displaying test logs of the entire solid-state hard disk abnormal power-off test device during the test process, and at the same time organizes the data to generate corresponding result charts.
[0275] In some embodiments, there are multiple protocol power-off modules, and the multiple protocol power-off modules are combined through networking to obtain a combined protocol power-off module, which is used to control the power-off of each solid-state hard disk to be tested according to the power-off protocol message.
[0276] In this embodiment, the protocol power-off module supports not only serial port communication but also network port communication. One-to-many switch opening and closing control can be designed by networking multiple protocol power-off modules to support the expansion of power-off testing of more solid-state hard disk devices.
[0277] This embodiment provides a solid state hard disk abnormal power failure test device, please refer to Fig.11 , Fig.11 The structure diagram of a solid state drive abnormal power failure test device according to an embodiment of the present application is schematically shown, and the solid state drive abnormal power failure test device includes an acquisition module 410, an execution module 420, a query module 430 and a test module 440, wherein:
[0278] The acquisition module 410 is used to acquire a configuration strategy and generate a power-off protocol message based on the configuration strategy, wherein the configuration strategy includes a power-off strategy corresponding to each solid-state hard disk to be tested;
[0279] An execution module 420 is used to execute a test script, and when the execution of the test script reaches a preset power-off test point, perform power-off control on each of the solid-state hard disks to be tested according to the power-off protocol message;
[0280] The query module 430 is used to query and obtain the current status of each solid-state hard disk to be tested after completing the power-off control of each solid-state hard disk to be tested;
[0281] The testing module 440 is used to obtain abnormal power-off test results based on the current status of each solid-state hard disk to be tested.
[0282] Wherein, the acquisition module 410 includes:
[0283] A scenario determination unit, configured to determine a current test scenario type based on the configuration strategy;
[0284] The first packetizing unit is used to, when determining that the current test scenario type is one-to-one, use a single message packetizing method to perform message packetizing based on the power-off strategy corresponding to the solid-state hard disk to be tested, so as to obtain a power-off protocol message;
[0285] The second packet grouping unit is used to group messages by a single message packing method for each solid-state drive to be tested based on the power-off strategy corresponding to the solid-state drive to be tested when determining that the current test scenario type is one-to-many, so as to obtain a power-off protocol message.
[0286] Wherein, the device further comprises:
[0287] A hard disk determination module, used to obtain a file operation strategy, and determine a solid state hard disk to be tested to be operated according to the power-off strategy;
[0288] A scenario determination module, used to determine a read / write scenario based on the file operation strategy;
[0289] The script determination module is used to determine and obtain a solid-state hard disk file operation script based on the solid-state hard disk to be tested and the read and write scenario, and use the solid-state hard disk file operation script as a test script.
[0290] Wherein, the device further comprises:
[0291] A strategy acquisition module is used to obtain data verification strategies;
[0292] The test module 440 includes:
[0293] A second judgment unit, configured to judge whether each of the solid-state hard disks to be tested has been restored based on the current state of each of the solid-state hard disks to be tested;
[0294] A third judgment unit is used to judge whether the execution of the test script reaches a preset data verification test point when it is determined that each of the solid-state hard disks to be tested has been restored;
[0295] A verification unit, configured to verify the data generated when executing the test script according to the data verification strategy to obtain a verification result when the test script is executed and reaches a preset data verification test point;
[0296] The determination unit is used to obtain an abnormal power-off test result based on the verification result.
[0297] The solid state drive abnormal power failure test device includes a processor and a memory. The above-mentioned acquisition module 410, execution module 420, query module 430 and test module 440 are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to implement corresponding functions.
[0298] The processor includes a kernel, which calls the corresponding program unit from the memory. One or more kernels can be set, and the abnormal power-off test of the solid-state hard disk to be tested can be achieved by adjusting the kernel parameters through the use of protocol messages.
[0299] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0300] An embodiment of the present invention provides a machine-readable storage medium on which a program is stored. When the program is executed by a processor, the method for testing abnormal power failure of a solid state hard disk is implemented.
[0301] An embodiment of the present invention provides a processor, which is used to run a program, wherein the solid state hard disk abnormal power failure test method is executed when the program is running.
[0302] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Fig.12 As shown. The computer device includes a processor A01, a network interface A02, a display screen A04, an input device A05 and a memory (not shown in the figure) connected through a system bus. Among them, the processor A01 of the computer device is used to provide computing and control capabilities. The memory of the computer device includes an internal memory A03 and a non-volatile storage medium A06. The non-volatile storage medium A06 stores an operating system B01 and a computer program B02. The internal memory A03 provides an environment for the operation of the operating system B01 and the computer program B02 in the non-volatile storage medium A06. The network interface A02 of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor A01, a solid-state hard disk abnormal power failure test method is implemented. The display screen A04 of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device A05 of the computer device can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse, etc.
[0303] Those skilled in the art will understand that Fig.12 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0304] In one embodiment, the abnormal power failure test device for a solid state hard disk provided in the present application can be implemented in the form of a computer program. The computer program can be implemented in the form of a computer program. Fig.12 The memory of the computer device can store various program modules constituting the abnormal power failure test device for the solid state hard disk, for example, Fig.11 The acquisition module 410, execution module 420, query module 430 and test module 440 are shown. The computer program composed of various program modules enables the processor to execute the steps in the calling method of the file system of each embodiment of the present application described in this specification.
[0305] Fig.12 The computer device shown can be Fig.11 In the solid state hard disk abnormal power failure test device shown, the acquisition module 410 executes step 210 , the execution module 420 executes step 220 , the query module 430 executes step 230 , and the test module 440 executes step 240 .
[0306] The embodiment of the present application provides a device, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, the following steps are implemented:
[0307] Acquire a configuration strategy, and generate a power-off protocol message based on the configuration strategy, wherein the configuration strategy includes a power-off strategy corresponding to each solid-state hard disk to be tested;
[0308] Execute the test script, and when the execution of the test script reaches a preset power-off test point, perform power-off control on each of the solid-state hard disks to be tested according to the power-off protocol message;
[0309] After completing power-off control of each of the solid-state hard disks to be tested, querying and obtaining the current status of each of the solid-state hard disks to be tested;
[0310] Based on the current status of each solid state hard disk to be tested, an abnormal power-off test result is obtained.
[0311] In one embodiment, the generating a power-off protocol message based on the configuration policy includes:
[0312] Based on the configuration strategy, determine the current test scenario type;
[0313] When it is determined that the current test scenario type is one-to-one, based on the power-off strategy corresponding to the solid-state drive to be tested, a single message packaging method is used to perform message packaging to obtain a power-off protocol message;
[0314] When the current test scenario type is determined to be one-to-many, for each solid-state drive to be tested, based on the power-off strategy corresponding to the solid-state drive to be tested, a single message packaging method is used to obtain a power-off protocol message.
[0315] In one embodiment, the power-off strategy includes the hardware connection relationship and power-on and power-off duration of the solid-state drive to be tested;
[0316] The power-off strategy corresponding to the solid-state hard disk to be tested is based on the power-off strategy, and a single message packaging method is used to package the message to obtain the power-off protocol message, including:
[0317] Setting power-off control parameters based on the hardware connection relationship of the solid-state hard disk to be tested;
[0318] Based on the power on and off duration, setting power limit time parameters;
[0319] Based on the power-off control parameter and the power-limit time parameter, message packetization is performed according to a preset message protocol to obtain a power-off protocol message.
[0320] In one embodiment, the power-off protocol message is a 698 protocol message; wherein each array structure in the 698 protocol message is used to control a solid state drive to be tested, and each array structure is linked to form a control class object.
[0321] In one embodiment, the power-off control of each solid-state hard disk to be tested according to the power-off protocol message includes:
[0322] Unpacking the power-off protocol message to obtain message content;
[0323] Based on the message content, generating a power-off command;
[0324] The power-off command is sent to each of the solid-state hard disks to be tested.
[0325] In one embodiment, the method further comprises:
[0326] After the power-off command is sent to each of the solid-state hard disks to be tested, the command execution status is packaged to form a return message.
[0327] In one embodiment, before executing the test script, the method further includes:
[0328] According to the power-off strategy, determining a solid state hard disk to be tested to be operated;
[0329] Obtaining a file operation policy, and determining a read / write scenario based on the file operation policy;
[0330] Based on the solid state drive to be tested and the read-write scenario, a solid state drive file operation script is determined and obtained, and the solid state drive file operation script is used as a test script.
[0331] In one embodiment, the executing of the test script and, when the executing of the test script reaches a preset power-off test point, performing power-off control on each of the solid-state hard disks to be tested according to the power-off protocol message includes:
[0332] Executing the solid state drive file operation script to perform a solid state drive file operation test on each of the solid state drives to be tested;
[0333] Determine whether the execution of the solid state drive file operation script reaches a preset power-off control test point;
[0334] When it is determined that the execution of the solid state hard disk file operation script reaches a preset power-off control test point, power-off control is performed on each of the solid state hard disks to be tested according to the power-off protocol message.
[0335] In one embodiment, the method further comprises:
[0336] Get data validation strategy;
[0337] The abnormal power failure test result is obtained based on the current state of each solid state hard disk to be tested, including:
[0338] Based on the current status of each of the solid-state hard disks to be tested, determining whether each of the solid-state hard disks to be tested has been restored;
[0339] When it is determined that each of the solid-state hard disks to be tested has been restored, determining whether the execution of the test script reaches a preset data verification test point;
[0340] When it is determined that the execution of the test script reaches a preset data verification test point, the data generated when the test script is executed is verified according to the data verification strategy to obtain a verification result;
[0341] Based on the verification result, an abnormal power-off test result is obtained.
[0342] In one embodiment, it further includes:
[0343] When it is determined that each of the solid-state hard disks to be tested has not been restored, within a preset time range, the status of each of the solid-state hard disks to be tested is queried multiple times at preset intervals, and after each status query of each of the solid-state hard disks to be tested, the execution is jumped to determine whether each of the solid-state hard disks to be tested has been restored based on the current status of each of the solid-state hard disks to be tested;
[0344] When the current status of each solid-state hard disk to be tested obtained by performing status inquiries on each solid-state hard disk to be tested multiple times is all unrecovered, the abnormal power-off test of the solid-state hard disk is terminated.
[0345] In one embodiment, the obtaining configuration strategy includes:
[0346] Get test scenario configuration information;
[0347] Based on the test scenario configuration information, a configuration strategy is generated.
[0348] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0349] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0350] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0351] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0352] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0353] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0354] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0355] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0356] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A method for testing abnormal power failure of a solid state hard disk, characterized in that: include: Acquire a configuration strategy, and generate a power-off protocol message based on the configuration strategy, wherein the configuration strategy includes a power-off strategy corresponding to each solid-state hard disk to be tested; Execute the test script, and when the execution of the test script reaches a preset power-off test point, perform power-off control on each of the solid-state hard disks to be tested according to the power-off protocol message; wherein the test script refers to a script for implementing an abnormal power-off test of the solid-state hard disk, and the power-off test point is preset in the script; After completing power-off control of each of the solid-state hard disks to be tested, querying and obtaining the current status of each of the solid-state hard disks to be tested; Based on the current status of each solid state hard disk to be tested, an abnormal power-off test result is obtained.
2. The method for testing abnormal power failure of a solid state hard disk according to claim 1, characterized in that: The generating of the power-off protocol message based on the configuration strategy includes: Based on the configuration strategy, determine the current test scenario type; When it is determined that the current test scenario type is one-to-one, based on the power-off strategy corresponding to the solid-state drive to be tested, a single message packaging method is used to perform message packaging to obtain a power-off protocol message; When the current test scenario type is determined to be one-to-many, for each solid-state drive to be tested, based on the power-off strategy corresponding to the solid-state drive to be tested, a single message packaging method is used to obtain a power-off protocol message.
3. The method for testing abnormal power failure of a solid state hard disk according to claim 2, characterized in that: The power-off strategy includes the hardware connection relationship and power-on and power-off duration of the solid-state hard disk to be tested; The power-off strategy corresponding to the solid-state hard disk to be tested is based on the power-off strategy, and a single message packaging method is used to package the message to obtain the power-off protocol message, including: Setting power-off control parameters based on the hardware connection relationship of the solid-state hard disk to be tested; Based on the power on and off duration, setting power limit time parameters; Based on the power-off control parameter and the power-limit time parameter, message packetization is performed according to a preset message protocol to obtain a power-off protocol message.
4. The method for testing abnormal power failure of a solid state hard disk according to claim 1, characterized in that: The power-off protocol message is a 698 protocol message; wherein each array structure in the 698 protocol message is used to control a solid state drive to be tested, and each array structure is linked to form a control class object.
5. The method for testing abnormal power failure of a solid state hard disk according to claim 1, characterized in that: The power-off control of each of the solid-state hard disks to be tested according to the power-off protocol message includes: Unpacking the power-off protocol message to obtain message content; Based on the message content, generating a power-off command; The power-off command is sent to each of the solid-state hard disks to be tested.
6. The method for testing abnormal power failure of a solid state hard disk according to claim 5, characterized in that: The method further comprises: After the power-off command is sent to each of the solid-state hard disks to be tested, the command execution status is packaged to form a return message.
7. The method for testing abnormal power failure of a solid state hard disk according to claim 1, characterized in that: Before executing the test script, the method further includes: According to the power-off strategy, determining a solid state hard disk to be tested to be operated; Obtaining a file operation policy, and determining a read / write scenario based on the file operation policy; Based on the solid state drive to be tested and the read-write scenario, a solid state drive file operation script is determined and obtained, and the solid state drive file operation script is used as a test script.
8. The method for testing abnormal power failure of a solid state hard disk according to claim 7, characterized in that: The executing the test script and, when the executing test script reaches a preset power-off test point, performing power-off control on each of the solid-state hard disks to be tested according to the power-off protocol message, includes: Executing the solid state drive file operation script to perform a solid state drive file operation test on each of the solid state drives to be tested; Determine whether the execution of the solid state drive file operation script reaches a preset power-off control test point; When it is determined that the execution of the solid state hard disk file operation script reaches a preset power-off control test point, power-off control is performed on each of the solid state hard disks to be tested according to the power-off protocol message.
9. The method for testing abnormal power failure of a solid state hard disk according to claim 1, characterized in that: The method further comprises: Get data validation strategy; The abnormal power failure test result is obtained based on the current state of each solid state hard disk to be tested, including: Based on the current status of each of the solid-state hard disks to be tested, determining whether each of the solid-state hard disks to be tested has been restored; When it is determined that each of the solid-state hard disks to be tested has been restored, determining whether the execution of the test script reaches a preset data verification test point; When it is determined that the execution of the test script reaches a preset data verification test point, the data generated when the test script is executed is verified according to the data verification strategy to obtain a verification result; Based on the verification result, an abnormal power-off test result is obtained.
10. The method for testing abnormal power failure of a solid state hard disk according to claim 9, characterized in that: Also includes: When it is determined that each of the solid-state hard disks to be tested has not been restored, within a preset time range, the status of each of the solid-state hard disks to be tested is queried multiple times at preset intervals, and after each status query of each of the solid-state hard disks to be tested, the execution is jumped to determine whether each of the solid-state hard disks to be tested has been restored based on the current status of each of the solid-state hard disks to be tested; When the current status of each solid-state hard disk to be tested obtained by performing status inquiries on each solid-state hard disk to be tested multiple times is all unrecovered, the abnormal power-off test of the solid-state hard disk is terminated.
11. The method for testing abnormal power failure of a solid state hard disk according to claim 1, characterized in that: The obtaining configuration strategy includes: Get test scenario configuration information; Based on the test scenario configuration information, a configuration strategy is generated.
12. A solid state hard disk abnormal power failure test system, characterized in that: include: A test host and a protocol power-off module, wherein the test host is connected to the protocol power-off module, and the test host and the protocol power-off module are respectively connected to each solid-state hard disk to be tested; The test host is used to obtain a configuration strategy, and based on the configuration strategy, generate a power-off protocol message, wherein the configuration strategy includes a power-off strategy corresponding to each solid-state hard disk to be tested; it is also used to execute a test script, and when the execution of the test script reaches a preset power-off test point, the power-off protocol message is sent to the protocol power-off module; it is also used to query and obtain the current state of each solid-state hard disk to be tested after completing the power-off control of each solid-state hard disk to be tested, and obtain an abnormal power-off test result based on the current state of each solid-state hard disk to be tested; wherein the test script refers to a script for implementing an abnormal power-off test of a solid-state hard disk, and a power-off test point is preset in the script; The protocol power-off module is used to perform power-off control on each solid-state hard disk to be tested according to the power-off protocol message.
13. The SSD abnormal power failure test system according to claim 12, characterized in that: The test host is connected to the protocol power-off module via a serial port.
14. The SSD abnormal power failure test system according to claim 12, characterized in that: The test host communicates with the protocol power-off module using the 698 protocol.
15. The abnormal power failure test system for a solid state hard disk according to claim 12, characterized in that: The test host is connected to each solid state drive to be tested via a USB port.
16. The abnormal power failure test system for a solid state hard disk according to claim 15, characterized in that: The protocol power-off module controls the power lines between the test host and each of the solid-state hard disks to be tested to be disconnected, so as to realize power-off control of each of the solid-state hard disks to be tested.
17. The abnormal power failure test system for a solid state hard disk according to claim 12, characterized in that: The protocol power-off module uses a relay closing and closing method to control the power-off of each solid-state hard disk to be tested.
18. The abnormal power failure test system for a solid state hard disk according to claim 12, characterized in that: The protocol power-off module includes: an unpacking unit, a command generating unit and a control unit; The unpacking unit is used to unpack the power-off protocol message to obtain the message content; The command generating unit is used to generate a power-off command based on the message content; The control unit is used to send the power-off command to each of the solid-state hard disks to be tested.
19. The abnormal power failure test system for a solid state hard disk according to claim 18, characterized in that: The protocol power-off module is also used to package the command execution status into a return message after sending the power-off command to each of the solid-state hard disks to be tested, and send the return message to the test host.
20. The abnormal power failure test system for a solid state hard disk according to claim 12, characterized in that: The test host comprises: a test scenario policy configurator, a protocol message packaging module, a file operation instruction sending module and a power-off control instruction sending unit, wherein the power-off control instruction sending unit is connected to the protocol power-off module, and the file operation instruction sending module is connected to each solid-state hard disk to be tested; The test scenario policy configurator is used to obtain a configuration policy and send the configuration policy to the protocol message packaging module; wherein the configuration policy includes a power-off policy corresponding to each solid-state hard disk to be tested; The protocol message packaging module is used to generate a power-off protocol message based on the configuration strategy, and send the power-off protocol message to the power-off control instruction sending unit; The file operation instruction sending module is used to execute the test script, and after completing the power-off control of each solid-state hard disk to be tested, query the current state of each solid-state hard disk to be tested, and obtain the abnormal power-off test result based on the current state of each solid-state hard disk to be tested; The power-off control instruction sending unit is used to send the power-off protocol message to the protocol power-off module when the execution of the test script reaches a preset power-off test point.
21. The abnormal power failure test system for a solid state hard disk according to claim 20, characterized in that: The test scenario policy configurator is also used to obtain a file operation policy and send the file operation policy to the file operation instruction sending module; The file operation instruction sending module is used to determine the solid-state hard disk to be tested to be operated according to the power-off strategy; it is also used to determine the read-write scenario based on the file operation strategy; it is also used to determine the solid-state hard disk file operation script based on the solid-state hard disk to be tested to be operated and the read-write scenario, and use the solid-state hard disk file operation script as a test script.
22. The abnormal power failure test system for a solid state hard disk according to claim 20, characterized in that: The test host further comprises a data verification module, and the file operation instruction sending module and the test scenario strategy configurator are respectively connected to the data verification module; The test scenario strategy configurator is also used to obtain a data verification strategy and send the data verification strategy to the data verification module; The file operation instruction sending module is also used to determine whether each of the solid-state hard disks to be tested has been restored based on the current state of each of the solid-state hard disks to be tested, and when it is determined that each of the solid-state hard disks to be tested has been restored, determine whether the execution of the test script reaches a preset data verification test point; The data verification module is used to verify the data generated when executing the test script according to the data verification strategy when determining that the execution of the test script reaches a preset data verification test point, obtain a verification result, and send the verification result to the file operation instruction sending module.
23. The abnormal power failure test system for a solid state hard disk according to claim 12, characterized in that: The test host also includes a log recording and display module; The log recording and display module is used to obtain the test log and generate a result chart based on the test log.
24. The abnormal power failure test system for a solid state hard disk according to claim 12, characterized in that: There are multiple protocol power-off modules, and the multiple protocol power-off modules are combined in a networking manner to obtain a combined protocol power-off module. The combined protocol power-off module is used to control the power-off of each solid-state hard disk to be tested according to the power-off protocol message.
25. A solid state hard disk abnormal power failure test device, characterized in that: include: An acquisition module, used to acquire a configuration strategy and generate a power-off protocol message based on the configuration strategy, wherein the configuration strategy includes a power-off strategy corresponding to each solid-state hard disk to be tested; An execution module, used for executing a test script, and when the execution of the test script reaches a preset power-off test point, performing power-off control on each of the solid-state hard disks to be tested according to the power-off protocol message; wherein the test script refers to a script for implementing an abnormal power-off test of a solid-state hard disk, and a power-off test point is preset in the script; A query module, used for querying and obtaining the current status of each solid-state hard disk to be tested after completing the power-off control of each solid-state hard disk to be tested; The test module is used to obtain abnormal power-off test results based on the current status of each solid-state hard disk to be tested.
26. The abnormal power failure test device for a solid state hard disk according to claim 25, characterized in that: The acquisition module comprises: A scenario determination unit, configured to determine a current test scenario type based on the configuration strategy; The first packetizing unit is used to, when determining that the current test scenario type is one-to-one, use a single message packetizing method to perform message packetizing based on the power-off strategy corresponding to the solid-state hard disk to be tested, so as to obtain a power-off protocol message; The second packet grouping unit is used to group messages by a single message packing method for each solid-state drive to be tested based on the power-off strategy corresponding to the solid-state drive to be tested when determining that the current test scenario type is one-to-many, so as to obtain a power-off protocol message.
27. The abnormal power failure test device for a solid state hard disk according to claim 25, characterized in that: The device also includes: A hard disk determination module, used to obtain a file operation strategy, and determine a solid state hard disk to be tested to be operated according to the power-off strategy; A scenario determination module, used to determine a read / write scenario based on the file operation strategy; The script determination module is used to determine and obtain a solid-state hard disk file operation script based on the solid-state hard disk to be tested and the read and write scenario, and use the solid-state hard disk file operation script as a test script.
28. The abnormal power failure test device for a solid state hard disk according to claim 25, characterized in that: The device also includes: A strategy acquisition module is used to obtain data verification strategies; The test module includes: A second judgment unit, configured to judge whether each of the solid-state hard disks to be tested has been restored based on the current state of each of the solid-state hard disks to be tested; A third judgment unit is used to judge whether the execution of the test script reaches a preset data verification test point when it is determined that each of the solid-state hard disks to be tested has been restored; A verification unit, configured to verify the data generated when executing the test script according to the data verification strategy to obtain a verification result when determining that the execution of the test script reaches a preset data verification test point; The determination unit is used to obtain an abnormal power-off test result based on the verification result.
29. An electronic device, characterized in that: The electronic device includes: at least one processor; a memory connected to the at least one processor; The memory stores instructions that can be executed by the at least one processor, and the at least one processor implements the abnormal power-off testing method for a solid-state hard disk according to any one of claims 1 to 11 by executing the instructions stored in the memory.
30. A machine-readable storage medium having instructions stored thereon, characterized in that: When the instruction is executed by a processor, the processor is configured to execute the abnormal power-off test method for a solid state drive according to any one of claims 1 to 11.
