CN111552594B - Method, device and system for detecting power failure of solid state disk and electronic equipment - Google Patents

Method, device and system for detecting power failure of solid state disk and electronic equipment Download PDF

Info

Publication number
CN111552594B
CN111552594B CN202010342409.7A CN202010342409A CN111552594B CN 111552594 B CN111552594 B CN 111552594B CN 202010342409 A CN202010342409 A CN 202010342409A CN 111552594 B CN111552594 B CN 111552594B
Authority
CN
China
Prior art keywords
solid state
power
state disk
power supply
preset
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010342409.7A
Other languages
Chinese (zh)
Other versions
CN111552594A (en
Inventor
胡俊明
秦智
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Haikang Storage Technology Co ltd
Original Assignee
Hangzhou Haikang Storage Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Haikang Storage Technology Co ltd filed Critical Hangzhou Haikang Storage Technology Co ltd
Priority to CN202010342409.7A priority Critical patent/CN111552594B/en
Publication of CN111552594A publication Critical patent/CN111552594A/en
Application granted granted Critical
Publication of CN111552594B publication Critical patent/CN111552594B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1441Resetting or repowering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/16Protection against loss of memory contents

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Testing Electric Properties And Detecting Electric Faults (AREA)
  • Power Sources (AREA)

Abstract

The embodiment of the invention provides a method, a device and a system for detecting power failure of a solid state disk and electronic equipment. The method comprises the following steps: controlling the solid state disk to execute a preset operation instruction through the testing machine; in the process of executing the operation instruction by the solid state disk, controlling the external power supply to supply power to the power supply module, and controlling the PDU to terminate supplying power to the testing machine; acquiring an execution result of the solid state disk for executing the preset operation instruction; determining whether the execution result is matched with an expected result preset for the preset operation instruction; and if the execution result is not matched with the expected result, controlling the external power supply to continuously supply power to the power supply module, and controlling the PDU to continuously be in a state of stopping supplying power to the testing machine so as to enable the solid state disk to be maintained in a power-down state. The method can enable staff to have enough time to collect the state of the solid state disk in the power-down processing process, so that the problem of a power-down protection mechanism is analyzed.

Description

Method, device and system for detecting power failure of solid state disk and electronic equipment
Technical Field
The present invention relates to the field of solid state storage technologies, and in particular, to a method, an apparatus, a system, and an electronic device for detecting power failure of a solid state disk.
Background
Solid state disk (Solid State Drive, SSD) is widely used in various fields due to its strong random read-write capability. The solid state disk can be installed on a host (host) to serve as a storage medium of the host, and the host transmits data to the solid state disk, so that the solid state disk writes the transmitted data into the solid state disk for storage.
In the working process, the solid state disk needs to be powered by the host computer so as to maintain the normal working of the solid state disk. In some application scenarios, the host may terminate the power supply of the solid state disk (hereinafter referred to as abnormal power failure) without notifying the solid state disk in advance, for example, the power supply of the host is suddenly turned off. In the abnormal power failure process, the solid state disk may not have enough time to write the data issued by the host into a nonvolatile storage unit (such as NAND Flash, a nonlinear Flash storage unit), but only store the issued data in a cache of the solid state disk. Abnormal power loss may result in data loss of the host, affecting the data security of the host.
In the related art, a power supply module can be arranged in the solid state disk, and certain electric quantity is stored in the power supply module, so that the solid state disk can be powered when the solid state disk is abnormally powered down, and the solid state disk can continuously complete data writing (hereinafter referred to as power-down processing). The mechanism is a power failure protection mechanism of the solid state disk. To reduce the possibility of data loss due to abnormal power loss, it is necessary to maintain the normal operation of the power-down protection mechanism.
However, the power supply module has limited power, the duration of the power-down processing process is short, the duration is usually in the order of milliseconds, and it is difficult for staff to effectively collect the state of the solid state disk in the power-down processing process, so that when the power-down protection mechanism cannot normally operate, the problem occurring in the power-down protection mechanism is analyzed, and the problem is solved in time, so that the power-down protection mechanism can normally operate.
Disclosure of Invention
The embodiment of the invention aims to provide a method, a device, a system and electronic equipment for detecting the power failure of a solid state disk, so that when the abnormality of a power failure protection mechanism of the solid state disk is found, the site of power failure processing of the solid state disk is kept, and a worker can collect the state of the solid state disk in the power failure processing process for a sufficient time, so that the problems of the power failure protection mechanism can be effectively analyzed. The specific technical scheme is as follows:
In a first aspect of the embodiment of the present invention, a method for detecting power failure of a solid state disk is provided, where the solid state disk is installed in a testing machine, the solid state disk includes a power supply module, where the power supply module is configured to supply power to the solid state disk when the solid state disk performs power failure processing, a maximum electric quantity that can be stored by the power supply module is lower than a preset electric quantity threshold, the testing machine supplies power through a power distribution unit PDU, and supplies power to the solid state disk when the solid state disk normally works, and the power supply module is connected with an external power supply, and the method includes:
controlling the solid state disk to execute a preset operation instruction through the testing machine;
in the process of executing the operation instruction by the solid state disk, controlling the external power supply to supply power to the power supply module, and controlling the PDU to terminate supplying power to the testing machine;
acquiring an execution result of the solid state disk for executing the preset operation instruction;
determining whether the execution result is matched with an expected result preset for the preset operation instruction;
and if the execution result is not matched with the expected result, controlling the external power supply to continuously supply power to the power supply module, and controlling the PDU to continuously be in a state of stopping supplying power to the testing machine so as to enable the solid state disk to be maintained in a power-down state.
In a possible embodiment, the preset operation instruction includes an operation instruction for controlling the solid state disk to output a preset character string in a power-down process;
the determining whether the execution result matches an expected result preset for the preset operation instruction includes:
determining whether the execution result comprises the preset character string or not;
if the execution result comprises the preset character string, determining that the execution result is matched with an expected result preset for the preset operation instruction;
and if the execution result does not comprise the preset character string, determining that the execution result is not matched with the expected result.
In a possible embodiment, the preset operation instruction includes an operation instruction for controlling the solid state disk to output a preset character string when the power-down process is completed.
In a possible embodiment, the external power supply is connected with the power supply module through a relay, and the external power supply is kept in an on state, when the relay is on, a circuit between the external power supply and the power supply module is in a path state, and when the relay is off, the circuit between the external power supply and the power supply module is in an off state;
The controlling the external power supply to supply power to the power supply module includes:
and controlling the relay to switch to an on state.
In one possible embodiment, after said determining whether said execution result matches an expected result preset for said preset operation instruction, the method further comprises:
and if the execution result is matched with the expected result, controlling the external power supply to terminate the power supply for the power supply module.
In a second aspect of the embodiment of the present invention, a device for detecting power failure of a solid state disk is provided, where the solid state disk is installed in a testing machine, the solid state disk includes a power supply module, where the power supply module is configured to supply power to the solid state disk when the solid state disk performs power failure processing, a maximum electric quantity that can be stored by the power supply module is lower than a preset electric quantity threshold, the testing machine supplies power through a power distribution unit PDU, and supplies power to the solid state disk when the solid state disk normally works, and the power supply module is connected with an external power supply, where the device includes:
the script running module is used for controlling the solid state disk to execute a preset operation instruction through the testing machine;
the power failure simulation module is used for controlling the external power supply to supply power to the power supply module and controlling the PDU to terminate supplying power to the testing machine in the process of executing the operation instruction by the solid state disk;
The data reading module is used for obtaining an execution result of the solid state disk for executing the preset operation instruction;
the result comparison module is used for determining whether the execution result is matched with an expected result preset for the preset operation instruction;
and the state retaining module is used for controlling the external power supply to continuously supply power to the power supply module and controlling the PDU to continuously be in a state of stopping supplying power to the testing machine if the execution result is not matched with the expected result, so that the solid state disk is maintained in a power-down state.
In a possible embodiment, the preset operation instruction includes an operation instruction for controlling the solid state disk to output a preset character string in a power-down process;
the result comparison module is specifically configured to determine whether the execution result includes the preset character string;
if the execution result comprises the preset character string, determining that the execution result is matched with an expected result preset for the preset operation instruction;
and if the execution result does not comprise the preset character string, determining that the execution result is not matched with the expected result.
In a possible embodiment, the preset operation instruction includes an operation instruction for controlling the solid state disk to output a preset character string when the power-down process is completed.
In one possible embodiment, the external power supply is connected to the power supply module through a relay, and the external power supply is kept in an on state, a circuit between the external power supply and the power supply module is in a path state when the relay is on, and a circuit between the external power supply and the power supply module is in an off state when the relay is off;
the power failure simulation module is specifically used for controlling the relay to be switched to an on state.
In a possible embodiment, the apparatus further comprises a complete power-down module for controlling the external power supply to terminate supplying power to the power supply module if the execution result matches the expected result.
In a third aspect of the embodiment of the present invention, a system for detecting power failure of a solid state disk is provided, where the system includes:
the device comprises a solid state disk, a testing machine, a power distribution unit PDU, a control machine and an external power supply;
the solid state disk comprises a power supply module, wherein the power supply module is used for supplying power to the solid state disk when the solid state disk is subjected to power failure treatment;
the solid state disk is arranged on the testing machine;
the PDU is used for supplying power to the tester;
The controller is used for controlling the solid state disk to execute a preset operation instruction through the testing machine; in the process of executing the operation instruction by the solid state disk, controlling the external power supply to supply power to the power supply module, and controlling the PDU to terminate supplying power to the testing machine;
the solid state disk is used for outputting an execution result of executing the preset operation instruction to the controller;
the control machine is further used for determining whether the execution result is matched with an expected result preset for the preset operation instruction; and if the execution result is not matched with the expected result, controlling the external power supply to continuously supply power to the power supply module so as to enable the solid state disk to be maintained in a power-down state.
In a possible embodiment, the preset operation instruction includes an operation instruction for controlling the solid state disk to output a preset character string in a power-down process;
the solid state disk is specifically configured to execute the preset operation instruction, so that the preset character string is output to the controller in a power-down processing process, and is used as an execution result of executing the preset operation instruction;
the control machine is specifically configured to determine whether the execution result includes the preset character string; if the execution result comprises the preset character string, determining that the execution result is matched with an expected result preset for the preset operation instruction; and if the execution result does not comprise the preset character string, determining that the execution result is not matched with the expected result.
In a possible embodiment, the preset operation instruction includes an operation instruction for controlling the solid state disk to output a preset character string when the power-down process is completed.
In a possible embodiment, the system further comprises a relay for connecting the external power source and the power supply module; the circuit between the external power supply and the power supply module is in a passage state when the relay is opened, and the circuit between the external power supply and the power supply module is in an open circuit state when the relay is closed;
the external power supply is kept in an on state;
the control machine is specifically used for controlling the relay to be switched to an on state so that the external power supply supplies power for the power supply module.
In a fourth aspect of the embodiment of the present invention, there is provided an electronic device, including:
a memory for storing a computer program;
a processor for implementing the method steps of any of the above first aspects when executing a program stored on a memory.
In a fifth aspect of embodiments of the present invention, there is provided a computer readable storage medium having stored therein a computer program which when executed by a processor implements the method steps of any of the first aspects described above.
According to the method, the device, the system and the electronic equipment for detecting the power failure of the solid state disk, provided by the embodiment of the invention, the situation of abnormal power failure can be simulated for the solid state disk by stopping the power supply of the testing machine, and whether a power failure protection mechanism of the solid state disk can normally operate is judged by comparing the execution result actually output by the solid state disk with the expected result. When the power-down protection mechanism of the solid state disk cannot normally operate, the power supply module is continuously charged by the external power supply, and the state that the solid state disk is powered by the power supply module is maintained, so that the solid state disk can be kept in a power-down state for a long time, a worker can collect the state of the solid state disk in the power-down processing process for a sufficient time, and the problem of the power-down protection mechanism can be effectively analyzed.
Of course, it is not necessary for any one product or method of practicing the invention to achieve all of the advantages set forth above at the same time.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic structural diagram of a power failure detection system for a solid state disk according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of a method for detecting power failure of a solid state disk according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of another structure of a power failure detection system for a solid state disk according to an embodiment of the present invention;
fig. 4 is another flow chart of a method for detecting power failure of a solid state disk according to an embodiment of the present invention;
FIG. 5a is a schematic structural diagram of a power failure detection device for a solid state disk according to an embodiment of the present invention;
FIG. 5b is a schematic diagram of another structure of a power failure detection device for a solid state disk according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In order to more clearly explain the method for detecting the power failure of the solid state disk provided by the embodiment of the invention, a possible application scenario of the method for detecting the power failure of the solid state disk provided by the embodiment of the invention will be described. It can be understood that this example is only one possible application scenario of the method for detecting the power failure of the solid state disk provided by the embodiment of the present invention, and in other possible embodiments, the method for detecting the power failure of the solid state disk provided by the embodiment of the present invention may also be applied to other application scenarios, and the embodiment does not limit this.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a solid state disk power failure detection system according to an embodiment of the present invention, which may include:
solid state disk 110, tester 120, PDU (Power Distribution Unit ) 130, controller 140, external power supply 150.
The solid state disk 110 includes a power supply module, which is configured to supply power to the solid state disk 110 when the solid state disk 110 performs power failure processing. The power supply module may be any component with energy storage and energy supply functions, for example, in a possible embodiment, the power supply module may be formed by a capacitor, and may store a certain amount of electricity in the capacitor by charging the capacitor, and supply power when the solid state disk 110 is powered down by discharging the capacitor. The maximum electric quantity which can be stored by the power supply module is lower than a preset electric quantity threshold, the preset electric quantity threshold is different according to different application scenes, for example, in some application scenes, the preset electric quantity threshold can be the power consumption of the solid state disk in a power-down state for 10 milliseconds, and in other application scenes, the preset electric quantity threshold can also be the power consumption of the solid state disk in the power-down state for 5 milliseconds. It can be understood that, because the maximum electric quantity that the power supply module can store is smaller, the power supply module can not maintain the solid state disk in the power-down state for a long time by means of the stored electric quantity.
The solid state disk 110 is installed in the testing machine 120, and the testing machine 120 supplies power for the normal operation of the solid state disk 110. The solid state disk 110 may be mounted on the tester 120 through a SATA (Serial Advanced Technology Attachment ) interface or a PCIE (Peripheral Component Interconnect Express, a high speed serial computer expansion bus standard) interface plugged onto the tester 120.
The PDU130 is used for supplying power to the testing machine 120, and since the solid state disk 110 installed on the testing machine 120 is powered by the testing machine 120, the PDU130 indirectly supplies power to the solid state disk 110. For example, PDU130 may power a power supply in test machine 110 and the power supply in test machine 120 powers solid state disk 110. It will be appreciated that if the PDU130 terminates powering the tester 120, the solid state disk 110 theoretically enters a power down state.
The controller 140 may be connected to the solid state disk 110 through a UART (Universal Asynchronous Receiver/Transmitter, universal asynchronous receiver Transmitter) interface, and in other possible embodiments, may also be connected to the solid state disk 110 through other interfaces to receive signals output by the solid state disk 110. It can be appreciated that if the solid state disk 110 enters a power-down state due to the PDU130 terminating to supply power to the testing machine 120, the power-down protection mechanism of the solid state disk 110 is triggered, and at this time, the testing machine 120 cannot work due to lack of power supply. Therefore, in this embodiment, the solid state disk 110 cannot send a signal to the controller 140 through the testing machine 120 in the power-down processing, and the signal needs to be directly sent to the controller 140 through an interface between the solid state disk 110 and the controller 140, such as a UART interface, so that the controller 140 can detect the power-down processing of the solid state disk 110. In other possible embodiments, the solid state disk 110 may also indirectly send a signal to the controller 140 through other electronic devices other than the testing machine 120, which is not limited in this embodiment.
Taking the solid state disk power failure detection system as an example, the solid state disk power failure detection method provided by the embodiment of the invention can be applied to a controller therein. Referring to fig. 2, fig. 2 is a schematic flow chart of a method for detecting power failure of a solid state disk according to an embodiment of the present invention, which may include:
s201, controlling the solid state disk to execute a preset operation instruction through the testing machine.
S202, controlling an external power supply to supply power to a power supply module and controlling the PDU to terminate supplying power to a testing machine in the process of executing an operation instruction by the solid state disk.
S203, an execution result of the solid state disk to execute the preset operation instruction is obtained.
S204, determining whether the execution result is matched with an expected result preset for a preset operation instruction.
And S205, if the execution result is not matched with the expected result, controlling the external power supply to continuously supply power to the power supply module, and controlling the PDU to continuously be in a state of stopping supplying power to the testing machine so as to enable the solid state disk to be maintained in a power-down state.
By adopting the embodiment, the abnormal power failure situation can be simulated for the solid state disk by stopping the power supply of the testing machine, and whether the power failure protection mechanism of the solid state disk can normally operate can be judged by comparing the execution result actually output by the solid state disk with the expected result. When the power-down protection mechanism of the solid state disk cannot normally operate, the power supply module is continuously charged by the external power supply, and the state that the solid state disk is powered by the power supply module is maintained, so that the solid state disk can be kept in a power-down state for a long time, a worker can collect the state of the solid state disk in the power-down processing process for a sufficient time, and the problem of the power-down protection mechanism can be effectively analyzed.
In S201, a control script may be stored in advance in the control machine, and the control machine executes the control script, so as to control the solid state disk to execute a preset operation instruction through the test machine according to an instruction in the control script. The preset operation instructions can also be different according to different application scenes.
For example, the preset operation instruction may include an operation instruction for controlling the solid state disk to output a preset character string in the power-down process, and in a possible embodiment, to distinguish a character string output by the solid state disk in the power-down process from a character string output by the solid state disk in the non-power-down process, a special character string may be used as the preset character string, where the special character string is a character string that cannot be (or has a low probability of being) output by the solid state disk in the non-power-down process. By adopting the embodiment, the probability of recognizing the character string output by the solid state disk in the non-power-down processing process as the preset character string can be reduced, and the detection accuracy is improved.
In S202, the control machine may directly control the working state of the external power source, and control the external power source to supply power to the power supply module, for example, the control machine may control the external power source to switch from the off state to the on state through the internet of things, so that the external power source supplies power to the power supply module. In other possible embodiments, the control machine may not directly control the working state of the external power supply, so as to indirectly control the external power supply to supply power to the power supply module.
For example, in one possible embodiment, as shown in fig. 3, the solid state disk power failure detection system may be configured such that the external power supply 150 is connected to the power supply module in the solid state disk 110 through the relay 160, and the external power supply 150 is kept in an on state, and when the relay 160 is turned on, a circuit between the external power supply 160 and the power supply module is in a path state, and at this time, the external power supply 150 supplies power to the power supply module. When the relay 160 is turned off, the circuit between the external power supply 150 and the power supply module is in an open state, and the external power supply 150 is terminated to supply power to the power supply module.
In this embodiment, the control machine may be configured to control the relay to switch to an on state, so as to control the external power source to supply power to the power supply module. The control machine may be connected to the relay through a USB (Universal Serial Bus ) interface to control the state of the relay. By adopting the embodiment, the control machine can indirectly control the external power supply to supply power to the power supply module through the relay without switching the working state of the external power supply, and the state switching of the relay is simpler than the state switching of the external power supply, so that the implementation difficulty of the solid state disk power failure detection method provided by the embodiment of the invention can be reduced by adopting the embodiment.
Similarly, the control machine can directly control the working state of the PDU to control the PDU to terminate to supply power to the testing machine, or indirectly control the PDU to terminate to supply power to the power supply module, and the principle is the same as that of the control machine for controlling the external power supply, and the description is omitted here.
It can be appreciated that the occurrence of abnormal power failure often has randomness, so in one possible embodiment, in order to make the simulated abnormal power failure situation more approximate to the actual situation, the controller may control the external power supply to supply power to the power supply module and control the PDU to terminate supplying power to the testing machine according to a time generated randomly during the process of executing the preset operation instruction by the solid state disk. The time can be generated by adopting different random algorithms, such as a chaotic equation, a random number table and the like, according to different actual requirements, and the embodiment is not limited to the time. By adopting the embodiment, the simulated abnormal power failure situation is more similar to the actual situation, so that the detection result can better reflect the running condition of the power failure protection mechanism of the solid state disk under the actual situation.
In S203, the control machine may acquire the execution result actively or passively. For example, the execution result sent by the solid state disk may be received, or the execution result may be read from a specific storage path in the solid state disk.
In S204, the matching of the execution result with the expected result may mean that the execution result is identical to the expected result, or that the similarity between the execution result and the expected result is higher than a preset similarity threshold. Taking an example that the preset operation instruction includes an operation instruction for controlling the solid state disk to output a preset character string in the power-down processing process, the method may be that whether the execution result includes the preset character string is determined, if the execution result includes the preset character string, the execution result is determined to be matched with the expected result, and if the execution result does not include the preset character string, the execution result is determined to be not matched with the expected result.
In one possible embodiment, the preset operation instruction may include an operation instruction for controlling the solid state disk to output a preset character string when the power-down process is completed. It can be understood that, because the preset character string is output when the power-down processing is completed, and the solid state disk often has relevance among various stages in the power-down processing process, if the execution result includes the preset character string, the solid state disk can be considered to have successfully executed various stages for completing the power-down processing, that is, the power-down processing process of the solid state disk is normal. If the execution result does not include the preset character string, the solid state disk can be considered to have abnormality in at least one stage in the power failure processing process. By adopting the embodiment, the calculation amount required by comparing the execution result with the expected result can be effectively reduced, and the detection efficiency is improved.
In S205, it may be understood that if the execution result matches the expected result, the power-down processing procedure of the solid state disk may be considered to be normal, and if the execution result does not match the expected result, the power-down processing procedure of the solid state disk may be considered to be abnormal. When the power failure processing process is abnormal, the external power supply is controlled to continue to supply power to the power supply module, the PDU is in a state of stopping supplying power to the testing machine, and then the testing machine cannot normally supply power to the solid state disk, so that the solid state disk is powered by the power supply module, the solid state disk can be maintained in the power failure state, the electric quantity of the external power supply can be considered to be sufficient, the solid state disk can be maintained in the power failure state for a long time, and the staff can conveniently collect the state parameters of the power failure state of the solid state disk, so that the problems caused by a power failure protection mechanism can be effectively analyzed. The control manner of the PDU and the external power supply may be referred to the related description in S202, and will not be repeated here.
In one possible embodiment, if the execution result matches the expected result, the external power source may be controlled to terminate supplying power to the power supply module. If the execution result matches with the expected result, the power-down processing process of the solid state disk can be considered to be normal, so that the solid state disk does not need to be maintained in the power-down state for a long time. By selecting this embodiment, energy consumption can be saved.
It will be appreciated that the analysis of abnormal power loss as described above tends to be random, and thus it may be difficult to detect potential problems with the power loss protection mechanism by single solid state drive power loss detection. In one possible embodiment, as shown in fig. 4, it may include:
s401, controlling the PDU to supply power for the tester and the solid state disk.
The control manner of the PDU may be referred to the related description in S202, and will not be repeated here.
S402, controlling the solid state disk to execute a preset operation instruction through the testing machine.
This step is the same as S201, and reference may be made to the foregoing description about S201, which is not repeated here.
S403, controlling an external power supply to supply power to the power supply module and controlling the PDU to terminate supplying power to the testing machine in the process of executing the operation instruction by the solid state disk.
This step is the same as S202, and reference may be made to the foregoing description about S202, which is not repeated here.
S404, an execution result of the solid state disk to execute the preset operation instruction is obtained.
This step is the same as S203, and reference may be made to the foregoing description about S203, which is not repeated here.
S405, determining whether the execution result matches an expected result preset for the preset operation instruction, if the execution result does not match the expected result, executing S406, and if the execution result matches the expected result, executing S407.
This step is the same as S204, and reference may be made to the foregoing description about S204, which is not repeated here.
S406, controlling the external power supply to continue to supply power to the power supply module, and controlling the PDU to continue to be in a state of stopping supplying power to the testing machine so as to enable the solid state disk to be maintained in a power-down state.
This step is the same as S205, and reference may be made to the foregoing description about S205, which is not repeated here.
S407, controlling the external power supply to stop supplying power to the power supply module, and returning to the step S401.
The termination condition of the cycle may be different according to different actual requirements, for example, the cycle may be terminated after a preset number of cycles, or the cycle may be terminated after a cycle termination instruction input by a related person is received, which is not limited in this embodiment. With this embodiment, the possibility of detecting the potential problem of the power-down protection mechanism can be improved by repeated detection.
Referring to fig. 5a, fig. 5a is a schematic structural diagram of a solid state disk detection device according to an embodiment of the present invention, which may include:
the script running module 501 is configured to control the solid state disk to execute a preset operation instruction through the testing machine;
the power-down simulation module 502 is configured to control, during the execution of the operation instruction by the solid state disk, the external power supply to supply power to the power supply module, and control the PDU to terminate supplying power to the testing machine;
A data reading module 503, configured to obtain an execution result of the solid state disk to execute the preset operation instruction;
a result comparison module 504, configured to determine whether the execution result matches an expected result preset for the preset operation instruction;
and the state retaining module 505 is configured to control the external power supply to continue to supply power to the power supply module and control the PDU to continue to be in a state of stopping supplying power to the testing machine if the execution result is not matched with the expected result, so that the solid state disk is maintained in a power-down state.
In a possible embodiment, the preset operation instruction includes an operation instruction for controlling the solid state disk to output a preset character string in a power-down process;
the result comparison module 504 is specifically configured to determine whether the execution result includes the preset character string;
if the execution result comprises the preset character string, determining that the execution result is matched with an expected result preset for the preset operation instruction;
and if the execution result does not comprise the preset character string, determining that the execution result is not matched with the expected result.
In a possible embodiment, the preset operation instruction includes an operation instruction for controlling the solid state disk to output a preset character string when the power-down process is completed.
In one possible embodiment, the external power supply is connected to the power supply module through a relay, and the external power supply is kept in an on state, a circuit between the external power supply and the power supply module is in a path state when the relay is on, and a circuit between the external power supply and the power supply module is in an off state when the relay is off;
the power-down simulation module 502 is specifically configured to control the relay to switch to an on state.
In a possible embodiment, as shown in fig. 5b, the apparatus further comprises a complete power-down module 506 for controlling the external power supply to terminate the power supply to the power supply module if the execution result matches the expected result.
The embodiment of the invention also provides an electronic device, as shown in fig. 6, including:
a memory 601 for storing a computer program;
a processor 602, configured to execute a program stored in the memory 601, and implement the following steps:
controlling the solid state disk to execute a preset operation instruction through the testing machine;
in the process of executing the operation instruction by the solid state disk, controlling the external power supply to supply power to the power supply module, and controlling the PDU to terminate supplying power to the testing machine;
Acquiring an execution result of the solid state disk for executing the preset operation instruction;
determining whether the execution result is matched with an expected result preset for the preset operation instruction;
and if the execution result is not matched with the expected result, controlling the external power supply to continuously supply power to the power supply module, and controlling the PDU to continuously be in a state of stopping supplying power to the testing machine so as to enable the solid state disk to be maintained in a power-down state.
In a possible embodiment, the preset operation instruction includes an operation instruction for controlling the solid state disk to output a preset character string in a power-down process;
the determining whether the execution result matches an expected result preset for the preset operation instruction includes:
determining whether the execution result comprises the preset character string or not;
if the execution result comprises the preset character string, determining that the execution result is matched with an expected result preset for the preset operation instruction;
and if the execution result does not comprise the preset character string, determining that the execution result is not matched with the expected result.
In a possible embodiment, the preset operation instruction includes an operation instruction for controlling the solid state disk to output a preset character string when the power-down process is completed.
In a possible embodiment, the external power supply is connected with the power supply module through a relay, and the external power supply is kept in an on state, when the relay is on, a circuit between the external power supply and the power supply module is in a path state, and when the relay is off, the circuit between the external power supply and the power supply module is in an off state;
the controlling the external power supply to supply power to the power supply module includes:
and controlling the relay to switch to an on state.
In one possible embodiment, after said determining whether said execution result matches an expected result preset for said preset operation instruction, the method further comprises:
and if the execution result is matched with the expected result, controlling the external power supply to terminate the power supply for the power supply module.
The Memory mentioned in the electronic device may include a random access Memory (Random Access Memory, RAM) or may include a Non-Volatile Memory (NVM), such as at least one magnetic disk Memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; but also digital signal processors (Digital Signal Processing, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
In still another embodiment of the present invention, a computer readable storage medium is provided, where instructions are stored, when the computer readable storage medium runs on a computer, to cause the computer to execute the method for detecting a power failure of a solid state disk in any one of the above embodiments.
In yet another embodiment of the present invention, a computer program product containing instructions that, when executed on a computer, cause the computer to perform the method for detecting a power failure of a solid state disk in any of the above embodiments is also provided.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present invention, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another, for example, by wired (e.g., coaxial cable, optical fiber, digital Subscriber Line (DSL)), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk (SSD)), etc.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for embodiments of the apparatus, system, electronic device, computer-readable storage medium, computer program product, the description is relatively simple as it is substantially similar to the method embodiments, as relevant points are found in the partial description of the method embodiments.
The foregoing description is only of the preferred embodiments of the present invention and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims (12)

1. The utility model provides a solid state disk power failure detection method, the solid state disk is installed in the test machine, the solid state disk includes power module, power module is used for the solid state disk power supply when the solid state disk carries out the power failure processing, the maximum electric quantity that power module can store is less than the threshold value of preset electric quantity, the test machine passes through power distribution unit PDU power supply to for the solid state disk power supply when solid state disk normally works, its characterized in that, power module is connected with external power source, the method includes:
controlling the solid state disk to execute a preset operation instruction through the testing machine; the preset operation instruction comprises an operation instruction for controlling the solid state disk to output a preset character string in the power-down processing process and/or an operation instruction for controlling the solid state disk to output the preset character string when the power-down processing is completed; using a special character string as the preset character string, wherein the special character string is a character string with low probability of impossible output or low output probability of the solid state disk in a non-power-down processing process;
In the process of executing the operation instruction by the solid state disk, controlling the external power supply to supply power to the power supply module, and controlling the PDU to terminate supplying power to the testing machine;
acquiring an execution result of the solid state disk for executing the preset operation instruction;
determining whether the execution result is matched with an expected result preset for the preset operation instruction;
and if the execution result is not matched with the expected result, controlling the external power supply to continuously supply power to the power supply module, and controlling the PDU to continuously be in a state of stopping supplying power to the testing machine so as to enable the solid state disk to be maintained in a power-down state.
2. The method of claim 1, wherein the preset operation instruction includes an operation instruction for controlling the solid state disk to output a preset character string in a power-down process;
the determining whether the execution result matches an expected result preset for the preset operation instruction includes:
determining whether the execution result comprises the preset character string or not;
if the execution result comprises the preset character string, determining that the execution result is matched with an expected result preset for the preset operation instruction;
And if the execution result does not comprise the preset character string, determining that the execution result is not matched with the expected result.
3. The method of claim 2, wherein the preset operation instruction includes an operation instruction for controlling the solid state disk to output a preset character string when the power-down process is completed.
4. The method of claim 1, wherein the external power source is connected to the power supply module through a relay, and the external power source is kept in an on state, a circuit between the external power source and the power supply module is in a pass state when the relay is on, and a circuit between the external power source and the power supply module is in an off state when the relay is off;
the controlling the external power supply to supply power to the power supply module includes:
and controlling the relay to switch to an on state.
5. The method of claim 1, wherein after said determining whether said execution result matches an expected result preset for said preset operation instruction, said method further comprises:
and if the execution result is matched with the expected result, controlling the external power supply to terminate the power supply for the power supply module.
6. The utility model provides a solid state disk power failure detection device, the solid state disk is installed in the test machine, the solid state disk includes power module, power module is used for when the solid state disk carries out the power failure processing for the solid state disk power supply, the maximum electric quantity that power module can store is less than the threshold value of preset electric quantity, the test machine passes through power distribution unit PDU power supply, and for the solid state disk power supply when the solid state disk normally works, its characterized in that, power module is connected with external power source, the device includes:
the script running module is used for controlling the solid state disk to execute a preset operation instruction through the testing machine; the preset operation instruction comprises an operation instruction for controlling the solid state disk to output a preset character string in the power-down processing process and/or an operation instruction for controlling the solid state disk to output the preset character string when the power-down processing is completed; using a special character string as the preset character string, wherein the special character string is a character string with low probability of impossible output or low output probability of the solid state disk in a non-power-down processing process;
the power failure simulation module is used for controlling the external power supply to supply power to the power supply module and controlling the PDU to terminate supplying power to the testing machine in the process of executing the operation instruction by the solid state disk;
The data reading module is used for obtaining an execution result of the solid state disk for executing the preset operation instruction;
the result comparison module is used for determining whether the execution result is matched with an expected result preset for the preset operation instruction;
and the state retaining module is used for controlling the external power supply to continuously supply power to the power supply module and controlling the PDU to continuously be in a state of stopping supplying power to the testing machine if the execution result is not matched with the expected result, so that the solid state disk is maintained in a power-down state.
7. A solid state disk power failure detection system, the system comprising:
the device comprises a solid state disk, a testing machine, a power distribution unit PDU, a control machine and an external power supply;
the solid state disk comprises a power supply module, wherein the power supply module is used for supplying power to the solid state disk when the solid state disk is subjected to power failure processing, and the maximum electric quantity which can be stored by the power supply module is lower than a preset electric quantity threshold value;
the solid state disk is arranged on the testing machine;
the PDU is used for supplying power to the tester;
the testing machine is used for supplying power to the solid state disk when the solid state disk works normally;
The controller is used for controlling the solid state disk to execute a preset operation instruction through the testing machine; in the process of executing the operation instruction by the solid state disk, controlling the external power supply to supply power to the power supply module, and controlling the PDU to terminate supplying power to the testing machine; the preset operation instruction comprises an operation instruction for controlling the solid state disk to output a preset character string in the power-down processing process and/or an operation instruction for controlling the solid state disk to output the preset character string when the power-down processing is completed; using a special character string as the preset character string, wherein the special character string is a character string with low probability of impossible output or low output probability of the solid state disk in a non-power-down processing process;
the solid state disk is used for outputting an execution result of executing the preset operation instruction to the controller;
the control machine is further used for determining whether the execution result is matched with an expected result preset for the preset operation instruction; and if the execution result is not matched with the expected result, controlling the external power supply to continuously supply power to the power supply module, and controlling the PDU to continuously be in a state of stopping supplying power to the testing machine so as to enable the solid state disk to be maintained in a power-down state.
8. The system of claim 7, wherein the preset operation instruction includes an operation instruction for controlling the solid state disk to output a preset character string during a power-down process;
the solid state disk is specifically configured to execute the preset operation instruction, so that the preset character string is output to the controller in a power-down processing process, and is used as an execution result of executing the preset operation instruction;
the control machine is specifically configured to determine whether the execution result includes the preset character string; if the execution result comprises the preset character string, determining that the execution result is matched with an expected result preset for the preset operation instruction; and if the execution result does not comprise the preset character string, determining that the execution result is not matched with the expected result.
9. The system of claim 8, wherein the preset operation instruction includes an operation instruction that controls the solid state disk to output a preset string when the power-down process is completed.
10. The system of claim 7, further comprising a relay for connecting the external power source and the power module; the circuit between the external power supply and the power supply module is in a passage state when the relay is opened, and the circuit between the external power supply and the power supply module is in an open circuit state when the relay is closed;
The external power supply is kept in an on state;
the control machine is specifically used for controlling the relay to be switched to an on state so that the external power supply supplies power for the power supply module.
11. The system of claim 7, wherein the controller is further configured to control the external power source to terminate power to the power supply module if the execution result matches the expected result.
12. An electronic device, comprising:
a memory for storing a computer program;
a processor for carrying out the method steps of any one of claims 1-5 when executing a program stored on a memory.
CN202010342409.7A 2020-04-27 2020-04-27 Method, device and system for detecting power failure of solid state disk and electronic equipment Active CN111552594B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010342409.7A CN111552594B (en) 2020-04-27 2020-04-27 Method, device and system for detecting power failure of solid state disk and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010342409.7A CN111552594B (en) 2020-04-27 2020-04-27 Method, device and system for detecting power failure of solid state disk and electronic equipment

Publications (2)

Publication Number Publication Date
CN111552594A CN111552594A (en) 2020-08-18
CN111552594B true CN111552594B (en) 2024-01-02

Family

ID=72001394

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010342409.7A Active CN111552594B (en) 2020-04-27 2020-04-27 Method, device and system for detecting power failure of solid state disk and electronic equipment

Country Status (1)

Country Link
CN (1) CN111552594B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR19980072554A (en) * 1997-03-06 1998-11-05 양승택 How to Configure a Boot Sector on a High-Speed Parallel Computer
CN104658611A (en) * 2013-11-25 2015-05-27 深圳市国微电子有限公司 Method and system for testing abnormal power failure of solid-state hard disk
CN105573871A (en) * 2014-10-07 2016-05-11 昆达电脑科技(昆山)有限公司 Method for automatically detecting operating system type of hard disk
CN109509508A (en) * 2018-12-03 2019-03-22 浪潮电子信息产业股份有限公司 A kind of powered-off fault test method, device, medium and the equipment of SSD
CN110931076A (en) * 2019-11-24 2020-03-27 苏州浪潮智能科技有限公司 Solid state disk abnormal power-on and power-off testing device and method

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007115318A (en) * 2005-10-19 2007-05-10 Toshiba Corp Device and method for evaluating disk
JP5024376B2 (en) * 2007-05-31 2012-09-12 富士通株式会社 Method and apparatus for testing electronic devices

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR19980072554A (en) * 1997-03-06 1998-11-05 양승택 How to Configure a Boot Sector on a High-Speed Parallel Computer
CN104658611A (en) * 2013-11-25 2015-05-27 深圳市国微电子有限公司 Method and system for testing abnormal power failure of solid-state hard disk
CN105573871A (en) * 2014-10-07 2016-05-11 昆达电脑科技(昆山)有限公司 Method for automatically detecting operating system type of hard disk
CN109509508A (en) * 2018-12-03 2019-03-22 浪潮电子信息产业股份有限公司 A kind of powered-off fault test method, device, medium and the equipment of SSD
CN110931076A (en) * 2019-11-24 2020-03-27 苏州浪潮智能科技有限公司 Solid state disk abnormal power-on and power-off testing device and method

Also Published As

Publication number Publication date
CN111552594A (en) 2020-08-18

Similar Documents

Publication Publication Date Title
WO2022078013A1 (en) Server power-down detection method and system, and device and medium
CN106547653B (en) Computer system fault state detection method, device and system
CN103186439A (en) Server test system and server stability test method
CN104424044A (en) Server system
CN112133352A (en) Programmable peak power management
US10678667B1 (en) Holdup self-tests for power loss operations on memory systems
US10055366B2 (en) Method for data transmission and server for implementing the method
CN104081311A (en) Apparatus and method for managing operation of a mobile device
CN103378986A (en) System event log recording system and method
CN111104275A (en) Automatic testing method and device for flash SSD hard disk power supply
JP2020053017A (en) System and method for hybrid power source
CN101739319A (en) Computer device
JP6711933B2 (en) Power supply fan recovery process
CN111552594B (en) Method, device and system for detecting power failure of solid state disk and electronic equipment
CN113204456A (en) Test method, tool, device and equipment for VPP interface of server
CN103809988A (en) Information processing method and electronic device
WO2018227475A1 (en) Fingerprint chip detection method, device and system
CN109117299A (en) The error detecting device and its debugging method of server
CN115237691A (en) Hot plug test method, device, equipment and medium for storage equipment
CN114942871A (en) NFC chip testing method and device, readable medium and electronic equipment
CN103853643A (en) An apparatus and a method for memory testing by a programmable circuit in a safety critical system
CN113778732A (en) Fault positioning method and device for service board card
CN107179911A (en) A kind of method and apparatus for restarting management engine
CN112732498A (en) Test method, device, equipment and storage medium for simulating single-point power-on and power-off of equipment
CN102411527B (en) Detecting method for image-processing chip, developing plate and detecting system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant