CN116069576A - Abnormal power-down detection method, electronic equipment and storage medium - Google Patents

Abnormal power-down detection method, electronic equipment and storage medium Download PDF

Info

Publication number
CN116069576A
CN116069576A CN202310033330.XA CN202310033330A CN116069576A CN 116069576 A CN116069576 A CN 116069576A CN 202310033330 A CN202310033330 A CN 202310033330A CN 116069576 A CN116069576 A CN 116069576A
Authority
CN
China
Prior art keywords
power
solid state
state disk
instruction
template data
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.)
Pending
Application number
CN202310033330.XA
Other languages
Chinese (zh)
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.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent 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 Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202310033330.XA priority Critical patent/CN116069576A/en
Publication of CN116069576A publication Critical patent/CN116069576A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2205Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2273Test methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2284Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing by power-on test, e.g. power-on self test [POST]
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Power Sources (AREA)

Abstract

The invention provides an abnormal power-down detection method, electronic equipment and a storage medium, which are applied to a test host, wherein the method comprises the following steps: in response to receiving the abnormal power-down test task, configuring a first register state to indicate entry into an abnormal power-down test mode; responding to a power-off instruction, and sending a power-off instruction to the solid state disk according to the power-off instruction; responding to the detection that the second register state is the power-down completion, and completing the shutdown operation, wherein the second register state is configured by the solid state disk according to the first register state and the power-down instruction; and detecting the solid state disk and generating an abnormal power-down detection result of the solid state disk in response to the completion of the re-power-up. The problem that the relay is used for controlling the switch button and abnormal power down cannot be guaranteed to enter into each shutdown is solved, and the accurate control of the abnormal power down test is improved.

Description

Abnormal power-down detection method, electronic equipment and storage medium
Technical Field
The present invention relates to the field of power-down detection, and in particular, to an abnormal power-down detection method, an electronic device, and a storage medium.
Background
In the SSD development process, ABRUPT SHUTDOWN needs a large amount of long-time testing to ensure stability under an SSD abnormal power-down environment, at present, abnormal power-down testing is often performed by adopting a mode of manual plug, using hot plug equipment (quad), using a relay to control a power button and the like, wherein the manual plug cannot meet a large amount of long-time testing requirements; the quad hot plug device cannot meet the requirements of a large number of tests because of the need of adding test equipment and high price, and can introduce negative influence on the tests because of the fact that the hot plug device is connected between the SSD and the host; through testing, the relay is used for controlling the switch button, and due to the functions of an operating system and a host power supply, the relay can enter NORMALSHUTDOWN with high probability, and the abnormal power-down accurate test cannot be guaranteed. For example, when the host computer is idle when the power-down detection task starts to be executed, a normal power-down instruction is sent, and then firmware replies. If the host is busy, after the task with better priority is processed, abnormal power-down is triggered if no power is sent to send a normal power-down command.
Disclosure of Invention
Accordingly, in order to solve the above-mentioned problems, it is necessary to provide an abnormal power-down detection method, an electronic device, and a storage medium that can accurately test a solid state disk when abnormal power-down occurs.
In a first aspect, an abnormal power-down detection method is provided, and is applied to a test host, and the method includes:
in response to receiving the abnormal power-down test task, configuring a first register state to indicate entry into an abnormal power-down test mode;
responding to a power-off instruction, and sending a power-off instruction to the solid state disk according to the power-off instruction;
responding to the detection that the second register state is the power-down completion, and completing the shutdown operation, wherein the second register state is configured by the solid state disk according to the first register state and the power-down instruction;
and detecting the solid state disk and generating an abnormal power-down detection result of the solid state disk in response to the completion of the re-power-up.
In one embodiment, responding to receiving a shutdown instruction, and sending a power-down instruction to the solid state disk according to the shutdown instruction includes:
sending a formatting instruction to the solid state disk to format a file system of the solid state disk;
and writing the first template data into the file system and sending a power-down instruction to the solid state disk.
In one embodiment, in response to detecting that the second register state is a power-down completion, completing the shutdown operation includes:
Detecting a second register corresponding to the solid state disk;
acquiring the state of the second register and determining whether the solid state disk is powered down;
if yes, continuing to finish the shutdown operation;
and if not, re-acquiring the second register state.
In one embodiment, the detecting the solid state disk and generating the abnormal power-down detection result of the solid state disk in response to the completion of the re-power-up includes:
attempting to access the file system;
if the solid state disk fails, determining that the solid state disk is not mounted and sending alarm information to a user;
and if so, acquiring second template data from the file system and generating the abnormal power-down detection result according to the second template data and the first template data.
In one embodiment, generating the abnormal power-down detection result according to the second template data and the first template data includes:
determining whether the first template data and the second template data are identical;
if yes, generating a first abnormal power-down detection result and sending the first abnormal power-down detection result to the user;
if not, generating a second abnormal power-down detection result and sending the second abnormal power-down detection result to the user.
In one embodiment, the method for detecting abnormal power-down is further provided and is applied to a solid state disk, and the method comprises the following steps:
receiving a power-down instruction sent by a test host;
obtaining a first register state, wherein the first register state is configured by the test host in response to receiving an abnormal power-down test task to indicate entering an abnormal power-down test mode;
performing pseudo power-down actions according to the first register state and the power-down instruction;
and configuring a second register state to indicate that the powering-down of the solid state disk is completed.
In one embodiment, the method further comprises:
in response to receiving a formatting instruction issued by the test host, formatting a file system of the solid state disk;
and receiving first template data sent by the test host and writing the first template data into the file system.
In one embodiment, the method further comprises:
and responding to a test data reading request sent by the test host after the re-electrifying is completed, and sending second template data to the test host so that the test host can generate the abnormal electrifying detection result according to the first template data and the second template data.
In another aspect, an abnormal power-down detection device is provided, and is applied to a test host, and the device includes:
the first configuration module is used for configuring the state of the first register to indicate entering an abnormal power-down test mode in response to receiving an abnormal power-down test task;
the instruction sending module is used for responding to a received shutdown instruction and sending a power-down instruction to the solid state disk according to the shutdown instruction;
the shutdown module is used for completing shutdown operation in response to detection of the fact that the second register state is the power-down completion, wherein the second register state is configured by the solid state disk according to the first register state and the power-down instruction in a pseudo power-down action;
the detection module is used for detecting the solid state disk and generating an abnormal power-down detection result of the solid state disk in response to the completion of the re-power-up.
In one embodiment, in response to receiving a shutdown instruction, the instruction sending module sends a power-down instruction to the solid state disk according to the shutdown instruction includes:
sending a formatting instruction to the solid state disk to format a file system of the solid state disk;
and writing the first template data into the file system and sending a power-down instruction to the solid state disk.
In one embodiment, in response to detecting that the second register state is a power-down completion, the shutdown module completing a shutdown operation includes:
detecting a second register corresponding to the solid state disk;
acquiring the state of the second register and determining whether the solid state disk is powered down;
if yes, continuing to finish the shutdown operation;
and if not, re-acquiring the second register state.
In one embodiment, in response to the completion of the re-powering up, the detecting module detects the solid state disk and generates an abnormal power-down detection result of the solid state disk includes:
attempting to access the file system;
if the solid state disk fails, determining that the solid state disk is not mounted and sending alarm information to a user;
and if so, acquiring second template data from the file system and generating the abnormal power-down detection result according to the second template data and the first template data.
In one embodiment, the detecting module generating the abnormal power-down detection result according to the second template data and the first template data includes:
determining whether the first template data and the second template data are identical;
If yes, generating a first abnormal power-down detection result and sending the first abnormal power-down detection result to the user;
if not, generating a second abnormal power-down detection result and sending the second abnormal power-down detection result to the user.
In one embodiment, an abnormal power-down detection device is further provided, and the device is applied to a solid state disk, and comprises:
the receiving module is used for receiving a power-down instruction sent by the test host;
an acquisition module for acquiring a first register state, wherein the first register state is configured by the test host in response to receiving an abnormal power-down test task to indicate entering an abnormal power-down test mode;
the action module is used for performing pseudo power-down actions according to the state of the first register and the power-down instruction;
the second configuration module is used for configuring a second register state to indicate that the powering-down of the solid state disk is completed.
In one embodiment, the apparatus further comprises:
the formatting module is used for formatting a file system of the solid state disk in response to receiving a formatting instruction issued by the test host;
and the read-write module is used for receiving the first template data sent by the test host and writing the first template data into the file system.
In one embodiment, the apparatus further comprises:
the data sending module is used for responding to a test data reading request sent by the test host after the re-electrifying is completed and sending second template data to the test host so that the test host can generate the abnormal electrifying detection result according to the first template data and the second template data.
In yet another aspect, an electronic device is provided comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program:
in response to receiving the abnormal power-down test task, configuring a first register state to indicate entry into an abnormal power-down test mode;
responding to a power-off instruction, and sending a power-off instruction to the solid state disk according to the power-off instruction;
responding to the detection that the second register state is the power-down completion, and completing the shutdown operation, wherein the second register state is configured by the solid state disk according to the first register state and the power-down instruction;
and detecting the solid state disk and generating an abnormal power-down detection result of the solid state disk in response to the completion of the re-power-up.
In one embodiment, the processor, when executing the computer program, performs the steps of:
the response to receiving the shutdown instruction, the sending the power-down instruction to the solid state disk according to the shutdown instruction comprises:
sending a formatting instruction to the solid state disk to format a file system of the solid state disk;
and writing the first template data into the file system and sending a power-down instruction to the solid state disk.
In one embodiment, the processor, when executing the computer program, performs the steps of:
responsive to detecting the second register state as a power-down completion, completing the shutdown operation includes:
detecting a second register corresponding to the solid state disk;
acquiring the state of the second register and determining whether the solid state disk is powered down;
if yes, continuing to finish the shutdown operation;
and if not, re-acquiring the second register state.
In one embodiment, the processor, when executing the computer program, performs the steps of:
the step of detecting the solid state disk and generating an abnormal power-down detection result of the solid state disk comprises the following steps of:
attempting to access the file system;
If the solid state disk fails, determining that the solid state disk is not mounted and sending alarm information to a user;
and if so, acquiring second template data from the file system and generating the abnormal power-down detection result according to the second template data and the first template data.
In one embodiment, the processor, when executing the computer program, performs the steps of:
generating the abnormal power-down detection result according to the second template data and the first template data comprises the following steps:
determining whether the first template data and the second template data are identical;
if yes, generating a first abnormal power-down detection result and sending the first abnormal power-down detection result to the user;
if not, generating a second abnormal power-down detection result and sending the second abnormal power-down detection result to the user.
In one embodiment, the processor, when executing the computer program, performs the steps of:
receiving a power-down instruction sent by a test host;
obtaining a first register state, wherein the first register state is configured by the test host in response to receiving an abnormal power-down test task to indicate entering an abnormal power-down test mode;
Performing pseudo power-down actions according to the first register state and the power-down instruction;
and configuring a second register state to indicate that the powering-down of the solid state disk is completed.
In one embodiment, the processor, when executing the computer program, performs the steps of:
in response to receiving a formatting instruction issued by the test host, formatting a file system of the solid state disk;
and receiving first template data sent by the test host and writing the first template data into the file system.
In one embodiment, the processor, when executing the computer program, performs the steps of:
and responding to a test data reading request sent by the test host after the re-electrifying is completed, and sending second template data to the test host so that the test host can generate the abnormal electrifying detection result according to the first template data and the second template data.
In yet another aspect, a computer readable storage medium is provided, having stored thereon a computer program which when executed by a processor performs the steps of:
in response to receiving the abnormal power-down test task, configuring a first register state to indicate entry into an abnormal power-down test mode;
Responding to a power-off instruction, and sending a power-off instruction to the solid state disk according to the power-off instruction;
responding to the detection that the second register state is the power-down completion, and completing the shutdown operation, wherein the second register state is configured by the solid state disk according to the first register state and the power-down instruction;
and detecting the solid state disk and generating an abnormal power-down detection result of the solid state disk in response to the completion of the re-power-up.
In one embodiment, the computer program when executed by a processor performs the steps of:
the response to receiving the shutdown instruction, the sending the power-down instruction to the solid state disk according to the shutdown instruction comprises:
sending a formatting instruction to the solid state disk to format a file system of the solid state disk;
and writing the first template data into the file system and sending a power-down instruction to the solid state disk.
In one embodiment, the computer program when executed by a processor performs the steps of:
responsive to detecting the second register state as a power-down completion, completing the shutdown operation includes:
detecting a second register corresponding to the solid state disk;
Acquiring the state of the second register and determining whether the solid state disk is powered down;
if yes, continuing to finish the shutdown operation;
and if not, re-acquiring the second register state.
In one embodiment, the computer program when executed by a processor performs the steps of:
the step of detecting the solid state disk and generating an abnormal power-down detection result of the solid state disk comprises the following steps of:
attempting to access the file system;
if the solid state disk fails, determining that the solid state disk is not mounted and sending alarm information to a user;
and if so, acquiring second template data from the file system and generating the abnormal power-down detection result according to the second template data and the first template data.
In one embodiment, the computer program when executed by a processor performs the steps of:
generating the abnormal power-down detection result according to the second template data and the first template data comprises the following steps:
determining whether the first template data and the second template data are identical;
if yes, generating a first abnormal power-down detection result and sending the first abnormal power-down detection result to the user;
If not, generating a second abnormal power-down detection result and sending the second abnormal power-down detection result to the user.
In one embodiment, the computer program when executed by a processor performs the steps of:
receiving a power-down instruction sent by a test host;
obtaining a first register state, wherein the first register state is configured by the test host in response to receiving an abnormal power-down test task to indicate entering an abnormal power-down test mode;
performing pseudo power-down actions according to the first register state and the power-down instruction;
and configuring a second register state to indicate that the powering-down of the solid state disk is completed.
In one embodiment, the computer program when executed by a processor performs the steps of:
in response to receiving a formatting instruction issued by the test host, formatting a file system of the solid state disk;
and receiving first template data sent by the test host and writing the first template data into the file system.
In one embodiment, the computer program when executed by a processor performs the steps of:
and responding to a test data reading request sent by the test host after the re-electrifying is completed, and sending second template data to the test host so that the test host can generate the abnormal electrifying detection result according to the first template data and the second template data.
Configuring a first register state to indicate entry into an abnormal power-down mode in response to receiving an abnormal power-down test task; responding to a power-off instruction, and sending a power-off instruction to the solid state disk according to the power-off instruction; responding to the detection that the second register state is the power-down completion, and completing the shutdown operation, wherein the second register state is configured by the solid state disk according to the first register state and the power-down instruction; and detecting the solid state disk and generating an abnormal power-down detection result of the solid state disk in response to the completion of the re-power-up. The problem that the relay is used for controlling the switch button and abnormal power down cannot be guaranteed to be carried out every time of shutdown is solved, and the accurate control of the abnormal power down test is improved; compared with hot plug testing equipment such as quad, the method reduces testing cost and can realize abnormal power-down testing of a large number of equipment.
Drawings
FIG. 1 is a schematic flow chart of an abnormal power down detection method;
FIG. 2 is a schematic diagram illustrating steps of an abnormal power-down detection method applied to a test host;
FIG. 3 is a schematic diagram illustrating steps of an abnormal power-down detection method applied to a solid state disk;
FIG. 4 is a schematic diagram of an abnormal power down detection device applied to a test host;
FIG. 5 is a schematic diagram of an abnormal power-down detection device applied to a solid state disk;
FIG. 6 is an internal block diagram of a computer device in accordance with an embodiment of the present invention;
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
The method provided by the application can be applied to a flow chart of the abnormal power-down detection method shown in fig. 1, wherein the first register state is configured to indicate to enter an abnormal power-down detection mode, then a formatting instruction is sent to the solid state disk to format a file system of the solid state disk, first template data is written into the file system and the power-down instruction is sent to the solid state disk, then the state of a second register is acquired, whether the solid state disk is powered down is completed or not is determined, then the file system is tried to be accessed, finally second template data is acquired from the file system, and an abnormal power-down detection result is generated according to the second template data and the first template data.
In one embodiment, as shown in fig. 2, the present invention provides an abnormal power-down detection method applied to a test host, the method comprising:
s201, in response to receiving an abnormal power-down test task, configuring a first register state to indicate entering an abnormal power-down test mode;
s202, responding to a power-off instruction, and sending a power-off instruction to the solid state disk according to the power-off instruction;
s203, responding to detection that a second register state is power-down completion, and completing shutdown operation, wherein the second register state is configured by the solid state disk according to the first register state and the power-down instruction;
and S204, detecting the solid state disk and generating an abnormal power-down detection result of the solid state disk in response to the completion of the re-power-up.
Specifically, before abnormal power-down detection is performed on the solid state disk, a first register A corresponding to the solid state disk can be configured through the pc ie, so that control of an abnormal power-down test mode is realized. For example, when the host receives the abnormal power-down detection task, writing a first register A=1, and entering an abnormal power-down test mode after the solid state disk is known, wherein the solid state disk exits the abnormal power-down test mode when the first register A=0, so that the use after the test is finished is not affected.
In one embodiment, responding to receiving a shutdown instruction, and sending a power-down instruction to the solid state disk according to the shutdown instruction includes:
sending a formatting instruction to the solid state disk to format a file system of the solid state disk;
and writing the first template data into the file system and sending a power-down instruction to the solid state disk.
Specifically, when a shutdown instruction sent by a user is received, the host starts to execute the shutdown action, wherein the file system ext4 (Fourth extended filesystem fourth generation extended file system) of the solid state disk is formatted, then the pattern is written into the solid state disk by using a fio tool, and finally a power-down instruction is issued to the solid state disk.
In one embodiment, in response to detecting that the second register state is a power-down completion, completing the shutdown operation includes:
detecting a second register corresponding to the solid state disk;
acquiring the state of the second register and determining whether the solid state disk is powered down;
if yes, continuing to finish the shutdown operation;
and if not, re-acquiring the second register state.
Specifically, as described above, after the test host issues the power-down instruction to the solid state disk, the test host continues to obtain the state of the second register B corresponding to the solid state disk, and if it is detected that the second register indicates that the solid state disk has completed powering down, the test host formally completes the power-down operation, that is, includes that other components in the host complete powering down. When the second register B shows that the solid state disk is not powered down, other components can be powered down first, then the state of the second register B is obtained again, and the host finishes the shutdown action until the solid state disk is powered down.
In one embodiment, the detecting the solid state disk and generating the abnormal power-down detection result of the solid state disk in response to the completion of the re-power-up includes:
attempting to access the file system;
if the solid state disk fails, determining that the solid state disk is not mounted and sending alarm information to a user;
and if so, acquiring second template data from the file system and generating the abnormal power-down detection result according to the second template data and the first template data.
Specifically, the test host can complete power-on and power-on through the relay control switch button, the solid state disk is powered on successfully at the moment, the test host tries to access the file system of the solid state disk at the moment, if the file system cannot be accessed or is not detected, it is determined that the solid state disk is not normally mounted after abnormal power-off, and at the moment, an alarm is required to be given to a user. If the file system is successfully detected and accessed, the test host acquires pattern (second template data) after abnormal power-down detection from the file system and generates a final abnormal power-down detection result by comparing two times of data.
In one embodiment, the generating the abnormal power-down detection result according to the second template data and the first template data includes:
Determining whether the first template data and the second template data are identical;
if yes, generating a first abnormal power-down detection result and sending the first abnormal power-down detection result to the user;
if not, generating a second abnormal power-down detection result and sending the second abnormal power-down detection result to the user.
Specifically, as described above, after the second template data is successfully obtained, the original pattern written into the file system before powering on is compared with the second template data, when the error between the two is less than, for example, 1%, the abnormal power-down detection of the solid state disk is indicated to be normal (the first abnormal power-down detection) and sent to the user, and when the error between the two is greater than or equal to, for example, 1%, the abnormal power-down detection of the solid state disk is indicated to be abnormal (the second abnormal power-down detection) and sent to the user, wherein the error coefficient can be set by the user.
In one embodiment, as shown in fig. 3, there is further provided an abnormal power-down detection method applied to a solid state disk, where the method includes:
s301, receiving a power-down instruction sent by a test host;
s302, acquiring a first register state, wherein the first register state is configured by the test host in response to receiving an abnormal power-down test task so as to indicate to enter an abnormal power-down test mode;
S303, performing pseudo power-down actions according to the state of the first register and the power-down instruction;
s304, configuring a second register state to indicate that the powering-down of the solid state disk is completed.
Specifically, when a power-down instruction sent by the test host is received, the state of the first register a is obtained, if a=1, the solid state disk enters an abnormal power-down mode, and at the moment, a pseudo power-down action is performed on the received power-down instruction. The method comprises the steps of modifying the state of the corresponding second register into the state of the second register after power-down is completed, and not actually powering down a file system and the like of the second register, namely, only modifying the state of the second register when a solid state disk does not execute actual power-down action during the shutdown of a host.
In one embodiment, the method further comprises:
s305, formatting a file system of the solid state disk in response to receiving a formatting instruction issued by the test host;
s306, receiving the first template data sent by the test host and writing the first template data into the file system.
Specifically, as described above, before the host computer is formally powered off, a formatting instruction issued by the host computer is received, and according to the formatting instruction, the file system is formatted, that is, original file data is cleaned, and pattern (first template data) retransmitted by the host computer is received.
In one embodiment, the method further comprises:
s307, responding to a test data reading request sent by the test host after the re-power-up is completed, and sending second template data to the test host so that the test host can generate the abnormal power-down detection result according to the first template data and the second template data.
Specifically, as described above, after the solid state disk is powered up again, when a test data reading request sent by the host is received, the pattern (second template data) after power-down and power-up in the file system is sent to the test host for comparing and generating an abnormal power-down detection result.
The scheme of the application has the following beneficial effects:
1) The problem that the relay is used for controlling the switch button and abnormal power down cannot be guaranteed to be carried out every time of shutdown is solved, and the accurate control of the abnormal power down test is improved;
2) Compared with hot plug testing equipment such as quad, the method reduces testing cost and can realize abnormal power-down testing of a large number of equipment.
It should be understood that, although the steps in the flowcharts of fig. 2 and 3 are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in fig. 2 and 3 may include multiple sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, nor does the order in which the sub-steps or stages are performed necessarily performed in sequence, but may be performed alternately or alternately with at least a portion of the sub-steps or stages of other steps or other steps.
In one embodiment, as shown in fig. 4, there is provided an abnormal power-down detection apparatus applied to a test host, the apparatus including:
a first configuration module 401, responsive to receiving an abnormal power-down test task, for configuring a first register state to indicate entering an abnormal power-down test mode;
the instruction sending module 402 is configured to send a power-down instruction to the solid state disk according to the power-down instruction in response to receiving the power-down instruction;
the shutdown module 403 is configured to complete a shutdown operation in response to detecting that the second register state is a power-down completion, where the second register state is configured by the solid state disk according to the first register state and the power-down instruction to perform a pseudo power-down action;
and the detection module 404 is used for detecting the solid state disk and generating an abnormal power-down detection result of the solid state disk in response to the completion of the re-power-up.
In one embodiment, in response to receiving a shutdown instruction, the instruction sending module sends a power-down instruction to the solid state disk according to the shutdown instruction includes:
sending a formatting instruction to the solid state disk to format a file system of the solid state disk;
And writing the first template data into the file system and sending a power-down instruction to the solid state disk.
In one embodiment, in response to detecting that the second register state is a power-down completion, the shutdown module completing a shutdown operation includes:
detecting a second register corresponding to the solid state disk;
acquiring the state of the second register and determining whether the solid state disk is powered down;
if yes, continuing to finish the shutdown operation;
and if not, re-acquiring the second register state.
In one embodiment, in response to the completion of the re-powering up, the detecting module detects the solid state disk and generates an abnormal power-down detection result of the solid state disk includes:
attempting to access the file system;
if the solid state disk fails, determining that the solid state disk is not mounted and sending alarm information to a user;
and if so, acquiring second template data from the file system and generating the abnormal power-down detection result according to the second template data and the first template data.
In one embodiment, the detecting module generating the abnormal power-down detection result according to the second template data and the first template data includes:
Determining whether the first template data and the second template data are identical;
if yes, generating a first abnormal power-down detection result and sending the first abnormal power-down detection result to the user;
if not, generating a second abnormal power-down detection result and sending the second abnormal power-down detection result to the user.
In one embodiment, as shown in fig. 5, there is further provided an abnormal power-down detection device applied to a solid state disk, where the device includes:
the receiving module 501 is configured to receive a power-down instruction sent by the test host;
an acquisition module 502 configured to acquire a first register state, wherein the first register state is configured by the test host in response to receiving an abnormal power-down test task to indicate entering an abnormal power-down test mode;
an action module 503, configured to perform a pseudo power-down action according to the first register state and the power-down instruction;
the second configuration module 504 is configured to configure a second register state to indicate that the solid state disk is powered down.
In one embodiment, the apparatus further comprises:
the formatting module 505 is used for formatting a file system of the solid state disk in response to receiving a formatting instruction issued by the test host;
And the read-write module 506 is configured to receive the first template data sent by the test host and write the first template data into the file system.
In one embodiment, the apparatus further comprises:
the data sending module 507 is configured to send second template data to the test host in response to a test data reading request sent by the test host after the re-power-up is completed, so that the test host generates the abnormal power-down detection result according to the first template data and the second template data.
The specific limitation of the abnormal power-down detection device can be referred to the limitation of the abnormal power-down detection method hereinabove, and will not be described herein. The above-described respective modules in the abnormal power-down detection apparatus may be implemented in whole or in part by software, hardware, or a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a terminal, and the internal structure of which may be as shown in fig. 6. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program, when executed by a processor, implements an alert information processing method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, can also be keys, a track ball or a touch pad arranged on the shell of the computer equipment, and can also be an external keyboard, a touch pad or a mouse and the like.
It will be appreciated by those skilled in the art that the structure shown in fig. 6 is merely a block diagram of some of the structures associated with the present application and is not limiting of the computer device to which the present application may be applied, and that a particular computer device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, an electronic device is provided that includes a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the steps of:
in response to receiving the abnormal power-down test task, configuring a first register state to indicate entry into an abnormal power-down test mode;
responding to a power-off instruction, and sending a power-off instruction to the solid state disk according to the power-off instruction;
responding to the detection that the second register state is the power-down completion, and completing the shutdown operation, wherein the second register state is configured by the solid state disk according to the first register state and the power-down instruction;
and detecting the solid state disk and generating an abnormal power-down detection result of the solid state disk in response to the completion of the re-power-up.
In one embodiment, the processor, when executing the computer program, performs the steps of:
the response to receiving the shutdown instruction, the sending the power-down instruction to the solid state disk according to the shutdown instruction comprises:
sending a formatting instruction to the solid state disk to format a file system of the solid state disk;
and writing the first template data into the file system and sending a power-down instruction to the solid state disk.
In one embodiment, the processor, when executing the computer program, performs the steps of:
responsive to detecting the second register state as a power-down completion, completing the shutdown operation includes:
detecting a second register corresponding to the solid state disk;
acquiring the state of the second register and determining whether the solid state disk is powered down;
if yes, continuing to finish the shutdown operation;
and if not, re-acquiring the second register state.
In one embodiment, the processor, when executing the computer program, performs the steps of:
the step of detecting the solid state disk and generating an abnormal power-down detection result of the solid state disk comprises the following steps of:
attempting to access the file system;
If the solid state disk fails, determining that the solid state disk is not mounted and sending alarm information to a user;
and if so, acquiring second template data from the file system and generating the abnormal power-down detection result according to the second template data and the first template data.
In one embodiment, the processor, when executing the computer program, performs the steps of:
generating the abnormal power-down detection result according to the second template data and the first template data comprises the following steps:
determining whether the first template data and the second template data are identical;
if yes, generating a first abnormal power-down detection result and sending the first abnormal power-down detection result to the user;
if not, generating a second abnormal power-down detection result and sending the second abnormal power-down detection result to the user.
In one embodiment, the processor, when executing the computer program, performs the steps of:
receiving a power-down instruction sent by a test host;
obtaining a first register state, wherein the first register state is configured by the test host in response to receiving an abnormal power-down test task to indicate entering an abnormal power-down test mode;
Performing pseudo power-down actions according to the first register state and the power-down instruction;
and configuring a second register state to indicate that the powering-down of the solid state disk is completed.
In one embodiment, the processor, when executing the computer program, performs the steps of:
in response to receiving a formatting instruction issued by the test host, formatting a file system of the solid state disk;
and receiving first template data sent by the test host and writing the first template data into the file system.
In one embodiment, the processor, when executing the computer program, performs the steps of:
and responding to a test data reading request sent by the test host after the re-electrifying is completed, and sending second template data to the test host so that the test host can generate the abnormal electrifying detection result according to the first template data and the second template data.
In one embodiment, a computer readable storage medium is provided having stored thereon a computer program which when executed by a processor performs the steps of:
in response to receiving the abnormal power-down test task, configuring a first register state to indicate entry into an abnormal power-down test mode;
Responding to a power-off instruction, and sending a power-off instruction to the solid state disk according to the power-off instruction;
responding to the detection that the second register state is the power-down completion, and completing the shutdown operation, wherein the second register state is configured by the solid state disk according to the first register state and the power-down instruction;
and detecting the solid state disk and generating an abnormal power-down detection result of the solid state disk in response to the completion of the re-power-up.
In one embodiment, the computer program when executed by a processor performs the steps of:
the response to receiving the shutdown instruction, the sending the power-down instruction to the solid state disk according to the shutdown instruction comprises:
sending a formatting instruction to the solid state disk to format a file system of the solid state disk;
and writing the first template data into the file system and sending a power-down instruction to the solid state disk.
In one embodiment, the computer program when executed by a processor performs the steps of:
responsive to detecting the second register state as a power-down completion, completing the shutdown operation includes:
detecting a second register corresponding to the solid state disk;
Acquiring the state of the second register and determining whether the solid state disk is powered down;
if yes, continuing to finish the shutdown operation;
and if not, re-acquiring the second register state.
In one embodiment, the computer program when executed by a processor performs the steps of:
the step of detecting the solid state disk and generating an abnormal power-down detection result of the solid state disk comprises the following steps of:
attempting to access the file system;
if the solid state disk fails, determining that the solid state disk is not mounted and sending alarm information to a user;
and if so, acquiring second template data from the file system and generating the abnormal power-down detection result according to the second template data and the first template data.
In one embodiment, the computer program when executed by a processor performs the steps of:
generating the abnormal power-down detection result according to the second template data and the first template data comprises the following steps:
determining whether the first template data and the second template data are identical;
if yes, generating a first abnormal power-down detection result and sending the first abnormal power-down detection result to the user;
If not, generating a second abnormal power-down detection result and sending the second abnormal power-down detection result to the user.
In one embodiment, the computer program when executed by a processor performs the steps of:
receiving a power-down instruction sent by a test host;
obtaining a first register state, wherein the first register state is configured by the test host in response to receiving an abnormal power-down test task to indicate entering an abnormal power-down test mode;
performing pseudo power-down actions according to the first register state and the power-down instruction;
and configuring a second register state to indicate that the powering-down of the solid state disk is completed.
In one embodiment, the computer program when executed by a processor performs the steps of:
in response to receiving a formatting instruction issued by the test host, formatting a file system of the solid state disk;
and receiving first template data sent by the test host and writing the first template data into the file system.
In one embodiment, the computer program when executed by a processor performs the steps of:
and responding to a test data reading request sent by the test host after the re-electrifying is completed, and sending second template data to the test host so that the test host can generate the abnormal electrifying detection result according to the first template data and the second template data.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the various embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
Any combination of the technical features of the above embodiments may be performed, and for brevity of description, all of the possible combinations of the technical features of the above embodiments are not described, however, as long as there is no contradiction between the combinations of the technical features, they should be regarded as the scope of the description.
The above examples merely represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the invention. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application is to be determined by the claims appended hereto.

Claims (10)

1. An abnormal power-down detection method applied to a test host, the method comprising:
in response to receiving the abnormal power-down test task, configuring a first register state to indicate entry into an abnormal power-down test mode;
responding to a power-off instruction, and sending a power-off instruction to the solid state disk according to the power-off instruction;
responding to the detection that the second register state is the power-down completion, and completing the shutdown operation, wherein the second register state is configured by the solid state disk according to the first register state and the power-down instruction;
And detecting the solid state disk and generating an abnormal power-down detection result of the solid state disk in response to the completion of the re-power-up.
2. The method of claim 1, wherein in response to receiving a shutdown instruction, sending a power down instruction to the solid state disk in accordance with the shutdown instruction comprises:
sending a formatting instruction to the solid state disk to format a file system of the solid state disk;
and writing the first template data into the file system and sending a power-down instruction to the solid state disk.
3. The method of claim 1, wherein completing the shutdown operation in response to detecting that the second register state is a power-down completion comprises:
detecting a second register corresponding to the solid state disk;
acquiring the state of the second register and determining whether the solid state disk is powered down;
if yes, continuing to finish the shutdown operation;
and if not, re-acquiring the second register state.
4. The method of claim 2, wherein detecting the solid state disk and generating an abnormal power down detection result for the solid state disk in response to the re-power up being completed comprises:
attempting to access the file system;
If the solid state disk fails, determining that the solid state disk is not mounted and sending alarm information to a user;
and if so, acquiring second template data from the file system and generating the abnormal power-down detection result according to the second template data and the first template data.
5. The method of claim 4, wherein generating the abnormal power down detection result from the second template data and the first template data comprises:
determining whether the first template data and the second template data are identical;
if yes, generating a first abnormal power-down detection result and sending the first abnormal power-down detection result to the user;
if not, generating a second abnormal power-down detection result and sending the second abnormal power-down detection result to the user.
6. An abnormal power-down detection method is applied to a solid state disk, and comprises the following steps:
receiving a power-down instruction sent by a test host;
obtaining a first register state, wherein the first register state is configured by the test host in response to receiving an abnormal power-down test task to indicate entering an abnormal power-down test mode;
performing pseudo power-down actions according to the first register state and the power-down instruction;
And configuring a second register state to indicate that the powering-down of the solid state disk is completed.
7. The method of claim 6, wherein the method further comprises:
in response to receiving a formatting instruction issued by the test host, formatting a file system of the solid state disk;
and receiving first template data sent by the test host and writing the first template data into the file system.
8. The method of claim 7, wherein the method further comprises:
and responding to a test data reading request sent by the test host after the re-electrifying is completed, and sending second template data to the test host so that the test host can generate the abnormal electrifying detection result according to the first template data and the second template data.
9. An electronic device, comprising:
one or more processors; and a memory associated with the one or more processors, the memory for storing program instructions that, when read for execution by the one or more processors, perform the method of any of claims 1-8.
10. A computer storage medium, characterized in that a computer program is stored thereon, wherein the program, when executed by a processor, implements the method according to any of claims 1-8.
CN202310033330.XA 2023-01-10 2023-01-10 Abnormal power-down detection method, electronic equipment and storage medium Pending CN116069576A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310033330.XA CN116069576A (en) 2023-01-10 2023-01-10 Abnormal power-down detection method, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310033330.XA CN116069576A (en) 2023-01-10 2023-01-10 Abnormal power-down detection method, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116069576A true CN116069576A (en) 2023-05-05

Family

ID=86176326

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310033330.XA Pending CN116069576A (en) 2023-01-10 2023-01-10 Abnormal power-down detection method, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116069576A (en)

Similar Documents

Publication Publication Date Title
CN103930878B (en) Method, Apparatus and system for memory verification
CN110727597B (en) Method for checking invalid code completion case based on log
US20140068350A1 (en) Self-checking system and method using same
CN108364670B (en) Read-write pressure testing method, device, equipment and storage medium
CN108874441B (en) Board card configuration method, device, server and storage medium
US20170103797A1 (en) Calibration method and device for dynamic random access memory
CN111694684A (en) Abnormal construction method and device of storage equipment, electronic equipment and storage medium
US7797134B2 (en) System and method for testing a memory with an expansion card using DMA
CN117827554A (en) Test method, test device, computer equipment and storage medium
CN117707884A (en) Method, system, equipment and medium for monitoring power management chip
CN112486519A (en) Method and equipment for configuring embedded product
CN110008105B (en) BMC time retention method and device, electronic device and storage medium
CN108009039B (en) Terminal information recording method, device, storage medium and electronic equipment
CN116069576A (en) Abnormal power-down detection method, electronic equipment and storage medium
CN111124881A (en) eMMC firmware test method and device
US7350109B2 (en) System and method for testing a memory using DMA
CN115359828A (en) Server firmware refreshing method, device, terminal and storage medium
CN114496053A (en) Data anomaly detection method, device and equipment and computer readable storage medium
US20070168740A1 (en) Method and apparatus for dumping a process memory space
US10922023B2 (en) Method for accessing code SRAM and electronic device
CN113470725A (en) Method and device for testing dynamic random access memory
CN115114193A (en) Memory system, control method of memory system, and host device
CN112486747A (en) Memory abnormity detection method and device, electronic equipment and readable storage medium
CN114385379B (en) Method, system, terminal and storage medium for detecting on-board information refreshing
CN117076182B (en) Error reporting method, system on chip, computer equipment and storage medium

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