CN116069576A - Abnormal power-off detection method, electronic device and storage medium - Google Patents

Abnormal power-off detection method, electronic device 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
abnormal power
register
template data
instruction
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-off detection method, electronic device and storage medium

技术领域technical field

本发明涉及下电检测领域,特别是涉及一种异常下电检测方法、电子设备及存储介质。The invention relates to the field of power-off detection, in particular to a detection method for abnormal power-off, electronic equipment and a storage medium.

背景技术Background technique

在SSD开发过程中,ABRUPT SHUTDOWN需要大量的长时间测试以保证SSD异常下电环境下的稳定性,目前异常下电测试往往采用人工插拔,使用热插拔设备(quarch),使用继电器控制电源按钮等方式进行,其中人工插拔无法实现大量,长时间的测试要求;quarch热插拔设备因为需要增加测试设备且价格贵,也无法满足大量测试的要求,且因为其在SSD与host之间连接了热插拔设备,可能对测试引入负面影响;使用继电器控制开关按钮,经过测试,由于操作系统及主机电源的作用,大概率会进入NORMALSHUTDOWN,无法保证异常下电的精准测试。比如开始执行下电检测任务时主机空闲的话,就会发送正常下电指令,然后等固件回复。如果主机比较忙,处理完优先级更好的任务后,没有电量发送正常下电命令的话,就会触发异常下电。During the SSD development process, ABRUPT SHUTDOWN needs a lot of long-term tests to ensure the stability of the SSD in an abnormal power-off environment. At present, abnormal power-off tests often use manual plugging, use hot-swappable equipment (quarch), and use relays to control the power supply Buttons and other methods, in which manual plugging and unplugging cannot achieve a large number of long-term testing requirements; quarch hot-swapping equipment cannot meet the requirements of a large number of testing because it needs to add testing equipment and is expensive, and because it is between the SSD and the host Connecting a hot-swappable device may have a negative impact on the test; using a relay to control the switch button, after testing, due to the effect of the operating system and the host power supply, there is a high probability that it will enter NORMAL SHUTDOWN, and the accurate test of abnormal power-off cannot be guaranteed. For example, if the host is idle when the power-off detection task is started, it will send a normal power-off command, and then wait for the firmware to reply. If the host is busy, after processing tasks with higher priority, if there is no power to send a normal power-off command, an abnormal power-off will be triggered.

发明内容Contents of the invention

基于此,有必要针对上述技术问题,提供一种能够精准测试异常下电时的固态硬盘的异常下电检测方法、电子设备及存储介质。Based on this, it is necessary to provide an abnormal power-off detection method, an electronic device, and a storage medium capable of accurately testing a solid-state hard disk during an abnormal power-off in view of the above-mentioned technical problems.

第一方面,提供一种异常下电检测方法,应用于测试主机,所述方法包括:In the first aspect, a method for detecting abnormal power-off is provided, which is applied to a test host, and the method includes:

响应于接收到异常下电测试任务,配置第一寄存器状态以指示进入异常下电测试模式;In response to receiving the abnormal power-off test task, configure the state of the first register to indicate entering the abnormal power-off test mode;

响应于接收到关机指令,根据所述关机指令向所述固态硬盘发送下电指令;In response to receiving a shutdown instruction, send a power-off instruction to the solid state disk according to the shutdown instruction;

响应于检测到第二寄存器状态为下电完成,完成关机操作,其中所述第二寄存器状态由所述固态硬盘根据所述第一寄存器状态以及所述下电指令进行伪下电动作并配置;In response to detecting that the second register status is power-off completion, the shutdown operation is completed, wherein the second register status is performed and configured by the solid-state hard disk according to the first register status and the power-off command;

响应于重新上电完成,检测所述固态硬盘并生成所述固态硬盘的异常下电检测结果。In response to the completion of power-on again, detect the solid-state hard disk and generate an abnormal power-off detection result of the solid-state hard disk.

在其中一个实施例中,响应于接收到关机指令,根据所述关机指令向所述固态硬盘发送下电指令包括:In one of the embodiments, in response to receiving the shutdown instruction, sending the power-off instruction to the solid state disk according to the shutdown instruction includes:

向所述固态硬盘发送格式化指令以格式化所述固态硬盘的文件系统;Send a formatting instruction to the solid-state hard disk to format the file system of the solid-state hard disk;

将第一模板数据写入所述文件系统并向所述固态硬盘发送下电指令。Writing the first template data into the file system and sending a power-off instruction to the solid-state hard disk.

在其中一个实施例中,响应于检测到第二寄存器状态为下电完成,完成关机操作包括:In one of the embodiments, in response to detecting that the state of the second register is power-off completion, completing the shutdown operation includes:

检测所述固态硬盘对应的第二寄存器;Detecting the second register corresponding to the solid state disk;

获取所述第二寄存器的状态并确定所述固态硬盘是否已完成下电;Acquiring the state of the second register and determining whether the solid state disk has been powered off;

若是,则继续完成关机操作;If so, continue to complete the shutdown operation;

若否,则重新获取所述第二寄存器状态。If not, the state of the second register is reacquired.

在其中一个实施例中,响应于重新上电完成,检测所述固态硬盘并生成所述固态硬盘的异常下电检测结果包括:In one of the embodiments, in response to the completion of power-on again, detecting the solid-state hard disk and generating the abnormal power-off detection result of the solid-state hard disk includes:

尝试访问所述文件系统;Attempt to access said file system;

若失败,则确定所述固态硬盘未挂载并向用户发送告警信息;If it fails, it is determined that the solid state drive is not mounted and a warning message is sent to the user;

若成功,则从所述文件系统中获取第二模板数据并根据所述第二模板数据和所述第一模板数据生成所述异常下电检测结果。If successful, acquire second template data from the file system, and generate the abnormal power-off detection result according to the second template data and the first template data.

在其中一个实施例中,根据所述第二模板数据和所述第一模板数据生成所述异常下电检测结果包括:In one of the embodiments, generating the abnormal power-off 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 the same;

若是,则生成第一异常下电检测结果并向所述用户发送所述第一异常下电检测结果;If so, generate a first abnormal power-off detection result and send the first abnormal power-off detection result to the user;

若否,则生成第二异常下电检测结果并向所述用户发送所述第二异常下电检测结果。If not, generate a second abnormal power-off detection result and send the second abnormal power-off detection result to the user.

在其中一个实施例中,还提供一种异常下电检测方法,应用于固态硬盘,所述方法包括:In one of the embodiments, there is also provided a method for detecting abnormal power-off, which is applied to solid-state hard drives, and the method includes:

接收测试主机发送的下电指令;Receive the power-off command sent by the 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-off test task to indicate entering an abnormal power-off test mode;

根据所述第一寄存器状态以及所述下电指令进行伪下电动作;performing a pseudo-power-off action according to the state of the first register and the power-off instruction;

配置第二寄存器状态以指示固态硬盘下电完成。Configure the status of the second register to indicate that the solid state disk is powered off.

在其中一个实施例中,所述方法还包括:In one embodiment, the method also includes:

响应于接收到测试主机下发的格式化指令,格式化固态硬盘的文件系统;Formatting the file system of the solid state drive in response to receiving a formatting instruction issued by the test host;

接收所述测试主机发送的第一模板数据并写入所述文件系统。receiving the first template data sent by the test host and writing it into the file system.

在其中一个实施例中,所述方法还包括:In one embodiment, the method also includes:

响应于所述测试主机在重新上电完成后发送的测试数据读取请求,将第二模板数据发送至测试主机,以供所述测试主机根据所述第一模板数据以及第二模板数据生成所述异常下电检测结果。In response to the test data reading request sent by the test host after re-powering on, the second template data is sent to the test host, so that the test host can generate the test data according to the first template data and the second template data. The above-mentioned abnormal power-off detection results.

另一方面,提供一种异常下电检测装置,应用于测试主机,所述装置包括:In another aspect, an abnormal power-off detection device is provided, which is applied to a test host, and the device includes:

第一配置模块,响应于接收到异常下电测试任务,用于配置第一寄存器状态以指示进入异常下电测试模式;The first configuration module, in response to receiving the abnormal power-off test task, is used to configure the state of the first register to indicate entering the abnormal power-off test mode;

指令发送模块,响应于接收到关机指令,用于根据所述关机指令向所述固态硬盘发送下电指令;An instruction sending module, in response to receiving a shutdown instruction, for sending a power-off instruction to the solid-state hard disk according to the shutdown instruction;

关机模块,响应于检测到第二寄存器状态为下电完成,用于完成关机操作,其中所述第二寄存器状态由所述固态硬盘根据所述第一寄存器状态以及所述下电指令进行伪下电动作并配置;The shutdown module is configured to complete the shutdown operation in response to detecting that the second register state is power-off completion, wherein the second register state is pseudo-downloaded by the solid state disk according to the first register state and the power-off instruction Electric action and configuration;

检测模块,响应于重新上电完成,用于检测所述固态硬盘并生成所述固态硬盘的异常下电检测结果。The detection module is configured to detect the solid-state hard disk and generate an abnormal power-off detection result of the solid-state hard disk in response to the power-on completion.

在其中一个实施例中,响应于接收到关机指令,所述指令发送模块根据所述关机指令向所述固态硬盘发送下电指令包括:In one of the embodiments, in response to receiving the shutdown instruction, the instruction sending module sending the power-off instruction to the solid-state hard disk according to the shutdown instruction includes:

向所述固态硬盘发送格式化指令以格式化所述固态硬盘的文件系统;Send a formatting instruction to the solid-state hard disk to format the file system of the solid-state hard disk;

将第一模板数据写入所述文件系统并向所述固态硬盘发送下电指令。Writing the first template data into the file system and sending a power-off instruction to the solid-state hard disk.

在其中一个实施例中,响应于检测到第二寄存器状态为下电完成,所述关机模块完成关机操作包括:In one of the embodiments, in response to detecting that the state of the second register is power-off complete, the shutdown module completing the shutdown operation includes:

检测所述固态硬盘对应的第二寄存器;Detecting the second register corresponding to the solid state disk;

获取所述第二寄存器的状态并确定所述固态硬盘是否已完成下电;Acquiring the state of the second register and determining whether the solid state disk has been powered off;

若是,则继续完成关机操作;If so, continue to complete the shutdown operation;

若否,则重新获取所述第二寄存器状态。If not, the state of the second register is reacquired.

在其中一个实施例中,响应于重新上电完成,所述检测模块检测所述固态硬盘并生成所述固态硬盘的异常下电检测结果包括:In one of the embodiments, in response to the completion of power-on again, the detection module detects the solid-state hard disk and generates the abnormal power-off detection result of the solid-state hard disk, including:

尝试访问所述文件系统;Attempt to access said file system;

若失败,则确定所述固态硬盘未挂载并向用户发送告警信息;If it fails, it is determined that the solid state drive is not mounted and a warning message is sent to the user;

若成功,则从所述文件系统中获取第二模板数据并根据所述第二模板数据和所述第一模板数据生成所述异常下电检测结果。If successful, acquire second template data from the file system, and generate the abnormal power-off detection result according to the second template data and the first template data.

在其中一个实施例中,所述检测模块根据所述第二模板数据和所述第一模板数据生成所述异常下电检测结果包括:In one of the embodiments, the detection module generating the abnormal power-off 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 the same;

若是,则生成第一异常下电检测结果并向所述用户发送所述第一异常下电检测结果;If so, generate a first abnormal power-off detection result and send the first abnormal power-off detection result to the user;

若否,则生成第二异常下电检测结果并向所述用户发送所述第二异常下电检测结果。If not, generate a second abnormal power-off detection result and send the second abnormal power-off detection result to the user.

在其中一个实施例中,还提供一种异常下电检测装置,应用于固态硬盘,所述装置包括:In one of the embodiments, there is also provided a device for detecting abnormal power-off, which is applied to a solid-state hard disk, and the device includes:

接收模块,用于接收测试主机发送的下电指令;The receiving module is used to receive the power-off command sent by the test host;

获取模块,用于获取第一寄存器状态,其中所述第一寄存器状态由所述测试主机响应于接收到异常下电测试任务而配置,以指示进入异常下电测试模式;An acquisition module, 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-off test task to indicate entering an abnormal power-off test mode;

动作模块,用于根据所述第一寄存器状态以及所述下电指令进行伪下电动作;An action module, configured to perform a pseudo power-off action according to the state of the first register and the power-off instruction;

第二配置模块,用于配置第二寄存器状态以指示固态硬盘下电完成。The second configuration module is configured to configure the state of the second register to indicate that the solid state disk is powered off.

在其中一个实施例中,所述装置还包括:In one of the embodiments, the device also includes:

格式化模块,响应于接收到测试主机下发的格式化指令,用于格式化固态硬盘的文件系统;The formatting module is used to format the file system of the solid-state hard disk in response to receiving a formatting instruction issued by the test host;

读写模块,用于接收所述测试主机发送的第一模板数据并写入所述文件系统。The read-write module is used to receive the first template data sent by the test host and write it into the file system.

在其中一个实施例中,所述装置还包括:In one of the embodiments, the device also includes:

数据发送模块,响应于所述测试主机在重新上电完成后发送的测试数据读取请求,用于将第二模板数据发送至测试主机,以供所述测试主机根据所述第一模板数据以及第二模板数据生成所述异常下电检测结果。The data sending module is used to send the second template data to the test host in response to the test data reading request sent by the test host after the power-on is completed, so that the test host can use the first template data and The second template data generates the abnormal power-off detection result.

再一方面,提供了一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现以下步骤:In yet another aspect, an electronic device is provided, including a memory, a processor, and a computer program stored on the memory and operable on the processor. When the processor executes the computer program, the following steps are implemented:

响应于接收到异常下电测试任务,配置第一寄存器状态以指示进入异常下电测试模式;In response to receiving the abnormal power-off test task, configure the state of the first register to indicate entering the abnormal power-off test mode;

响应于接收到关机指令,根据所述关机指令向所述固态硬盘发送下电指令;In response to receiving a shutdown instruction, send a power-off instruction to the solid state disk according to the shutdown instruction;

响应于检测到第二寄存器状态为下电完成,完成关机操作,其中所述第二寄存器状态由所述固态硬盘根据所述第一寄存器状态以及所述下电指令进行伪下电动作并配置;In response to detecting that the second register status is power-off completion, the shutdown operation is completed, wherein the second register status is performed and configured by the solid-state hard disk according to the first register status and the power-off command;

响应于重新上电完成,检测所述固态硬盘并生成所述固态硬盘的异常下电检测结果。In response to the completion of power-on again, detect the solid-state hard disk and generate an abnormal power-off detection result of the solid-state hard disk.

在其中一个实施例中,所述处理器执行所述计算机程序时实现以下步骤:In one of the embodiments, the processor implements the following steps when executing the computer program:

响应于接收到关机指令,根据所述关机指令向所述固态硬盘发送下电指令包括:In response to receiving the shutdown instruction, sending the power-off instruction to the solid state disk according to the shutdown instruction includes:

向所述固态硬盘发送格式化指令以格式化所述固态硬盘的文件系统;Send a formatting instruction to the solid-state hard disk to format the file system of the solid-state hard disk;

将第一模板数据写入所述文件系统并向所述固态硬盘发送下电指令。Writing the first template data into the file system and sending a power-off instruction to the solid-state hard disk.

在其中一个实施例中,所述处理器执行所述计算机程序时实现以下步骤:In one of the embodiments, the processor implements the following steps when executing the computer program:

响应于检测到第二寄存器状态为下电完成,完成关机操作包括:In response to detecting that the state of the second register is power-off completion, completing the shutdown operation includes:

检测所述固态硬盘对应的第二寄存器;Detecting the second register corresponding to the solid state disk;

获取所述第二寄存器的状态并确定所述固态硬盘是否已完成下电;Acquiring the state of the second register and determining whether the solid state disk has been powered off;

若是,则继续完成关机操作;If so, continue to complete the shutdown operation;

若否,则重新获取所述第二寄存器状态。If not, the state of the second register is reacquired.

在其中一个实施例中,所述处理器执行所述计算机程序时实现以下步骤:In one of the embodiments, the processor implements the following steps when executing the computer program:

响应于重新上电完成,检测所述固态硬盘并生成所述固态硬盘的异常下电检测结果包括:In response to the completion of re-powering, detecting the solid-state hard disk and generating the abnormal power-off detection result of the solid-state hard disk includes:

尝试访问所述文件系统;Attempt to access said file system;

若失败,则确定所述固态硬盘未挂载并向用户发送告警信息;If it fails, it is determined that the solid state drive is not mounted and a warning message is sent to the user;

若成功,则从所述文件系统中获取第二模板数据并根据所述第二模板数据和所述第一模板数据生成所述异常下电检测结果。If successful, acquire second template data from the file system, and generate the abnormal power-off detection result according to the second template data and the first template data.

在其中一个实施例中,所述处理器执行所述计算机程序时实现以下步骤:In one of the embodiments, the processor implements the following steps when executing the computer program:

根据所述第二模板数据和所述第一模板数据生成所述异常下电检测结果包括:Generating the abnormal power-off 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 the same;

若是,则生成第一异常下电检测结果并向所述用户发送所述第一异常下电检测结果;If so, generate a first abnormal power-off detection result and send the first abnormal power-off detection result to the user;

若否,则生成第二异常下电检测结果并向所述用户发送所述第二异常下电检测结果。If not, generate a second abnormal power-off detection result and send the second abnormal power-off detection result to the user.

在其中一个实施例中,所述处理器执行所述计算机程序时实现以下步骤:In one of the embodiments, the processor implements the following steps when executing the computer program:

接收测试主机发送的下电指令;Receive the power-off command sent by the 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-off test task to indicate entering an abnormal power-off test mode;

根据所述第一寄存器状态以及所述下电指令进行伪下电动作;performing a pseudo-power-off action according to the state of the first register and the power-off instruction;

配置第二寄存器状态以指示固态硬盘下电完成。Configure the status of the second register to indicate that the solid state disk is powered off.

在其中一个实施例中,所述处理器执行所述计算机程序时实现以下步骤:In one of the embodiments, the processor implements the following steps when executing the computer program:

响应于接收到测试主机下发的格式化指令,格式化固态硬盘的文件系统;Formatting the file system of the solid state drive in response to receiving a formatting instruction issued by the test host;

接收所述测试主机发送的第一模板数据并写入所述文件系统。receiving the first template data sent by the test host and writing it into the file system.

在其中一个实施例中,所述处理器执行所述计算机程序时实现以下步骤:In one of the embodiments, the processor implements the following steps when executing the computer program:

响应于所述测试主机在重新上电完成后发送的测试数据读取请求,将第二模板数据发送至测试主机,以供所述测试主机根据所述第一模板数据以及第二模板数据生成所述异常下电检测结果。In response to the test data reading request sent by the test host after re-powering on, the second template data is sent to the test host, so that the test host can generate the test data according to the first template data and the second template data. The above-mentioned abnormal power-off detection results.

又一方面,提供了一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现以下步骤:In yet another aspect, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

响应于接收到异常下电测试任务,配置第一寄存器状态以指示进入异常下电测试模式;In response to receiving the abnormal power-off test task, configure the state of the first register to indicate entering the abnormal power-off test mode;

响应于接收到关机指令,根据所述关机指令向所述固态硬盘发送下电指令;In response to receiving a shutdown instruction, send a power-off instruction to the solid state disk according to the shutdown instruction;

响应于检测到第二寄存器状态为下电完成,完成关机操作,其中所述第二寄存器状态由所述固态硬盘根据所述第一寄存器状态以及所述下电指令进行伪下电动作并配置;In response to detecting that the second register status is power-off completion, the shutdown operation is completed, wherein the second register status is performed and configured by the solid-state hard disk according to the first register status and the power-off command;

响应于重新上电完成,检测所述固态硬盘并生成所述固态硬盘的异常下电检测结果。In response to the completion of power-on again, detect the solid-state hard disk and generate an abnormal power-off detection result of the solid-state hard disk.

在其中一个实施例中,所述计算机程序被处理器执行时实现以下步骤:In one of the embodiments, when the computer program is executed by the processor, the following steps are implemented:

响应于接收到关机指令,根据所述关机指令向所述固态硬盘发送下电指令包括:In response to receiving the shutdown instruction, sending the power-off instruction to the solid state disk according to the shutdown instruction includes:

向所述固态硬盘发送格式化指令以格式化所述固态硬盘的文件系统;Send a formatting instruction to the solid-state hard disk to format the file system of the solid-state hard disk;

将第一模板数据写入所述文件系统并向所述固态硬盘发送下电指令。Writing the first template data into the file system and sending a power-off instruction to the solid-state hard disk.

在其中一个实施例中,所述计算机程序被处理器执行时实现以下步骤:In one of the embodiments, when the computer program is executed by the processor, the following steps are implemented:

响应于检测到第二寄存器状态为下电完成,完成关机操作包括:In response to detecting that the state of the second register is power-off completion, completing the shutdown operation includes:

检测所述固态硬盘对应的第二寄存器;Detecting the second register corresponding to the solid state disk;

获取所述第二寄存器的状态并确定所述固态硬盘是否已完成下电;Acquiring the state of the second register and determining whether the solid state disk has been powered off;

若是,则继续完成关机操作;If so, continue to complete the shutdown operation;

若否,则重新获取所述第二寄存器状态。If not, the state of the second register is reacquired.

在其中一个实施例中,所述计算机程序被处理器执行时实现以下步骤:In one of the embodiments, when the computer program is executed by the processor, the following steps are implemented:

响应于重新上电完成,检测所述固态硬盘并生成所述固态硬盘的异常下电检测结果包括:In response to the completion of re-powering, detecting the solid-state hard disk and generating the abnormal power-off detection result of the solid-state hard disk includes:

尝试访问所述文件系统;Attempt to access said file system;

若失败,则确定所述固态硬盘未挂载并向用户发送告警信息;If it fails, it is determined that the solid state drive is not mounted and a warning message is sent to the user;

若成功,则从所述文件系统中获取第二模板数据并根据所述第二模板数据和所述第一模板数据生成所述异常下电检测结果。If successful, acquire second template data from the file system, and generate the abnormal power-off detection result according to the second template data and the first template data.

在其中一个实施例中,所述计算机程序被处理器执行时实现以下步骤:In one of the embodiments, when the computer program is executed by the processor, the following steps are implemented:

根据所述第二模板数据和所述第一模板数据生成所述异常下电检测结果包括:Generating the abnormal power-off 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 the same;

若是,则生成第一异常下电检测结果并向所述用户发送所述第一异常下电检测结果;If so, generate a first abnormal power-off detection result and send the first abnormal power-off detection result to the user;

若否,则生成第二异常下电检测结果并向所述用户发送所述第二异常下电检测结果。If not, generate a second abnormal power-off detection result and send the second abnormal power-off detection result to the user.

在其中一个实施例中,所述计算机程序被处理器执行时实现以下步骤:In one of the embodiments, when the computer program is executed by the processor, the following steps are implemented:

接收测试主机发送的下电指令;Receive the power-off command sent by the 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-off test task to indicate entering an abnormal power-off test mode;

根据所述第一寄存器状态以及所述下电指令进行伪下电动作;performing a pseudo-power-off action according to the state of the first register and the power-off instruction;

配置第二寄存器状态以指示固态硬盘下电完成。Configure the status of the second register to indicate that the solid state disk is powered off.

在其中一个实施例中,所述计算机程序被处理器执行时实现以下步骤:In one of the embodiments, when the computer program is executed by the processor, the following steps are implemented:

响应于接收到测试主机下发的格式化指令,格式化固态硬盘的文件系统;Formatting the file system of the solid state drive in response to receiving a formatting instruction issued by the test host;

接收所述测试主机发送的第一模板数据并写入所述文件系统。receiving the first template data sent by the test host and writing it into the file system.

在其中一个实施例中,所述计算机程序被处理器执行时实现以下步骤:In one of the embodiments, when the computer program is executed by the processor, the following steps are implemented:

响应于所述测试主机在重新上电完成后发送的测试数据读取请求,将第二模板数据发送至测试主机,以供所述测试主机根据所述第一模板数据以及第二模板数据生成所述异常下电检测结果。In response to the test data reading request sent by the test host after re-powering on, the second template data is sent to the test host, so that the test host can generate the test data according to the first template data and the second template data. The above-mentioned abnormal power-off detection results.

通过响应于接收到异常下电测试任务,配置第一寄存器状态以指示进入异常下电测试模式;响应于接收到关机指令,根据所述关机指令向所述固态硬盘发送下电指令;响应于检测到第二寄存器状态为下电完成,完成关机操作,其中所述第二寄存器状态由所述固态硬盘根据所述第一寄存器状态以及所述下电指令进行伪下电动作并配置;响应于重新上电完成,检测所述固态硬盘并生成所述固态硬盘的异常下电检测结果。解决了使用继电器控制开关按钮,不能保证每一次关机都进入异常下电的问题,提高了异常下电测试的精准控制;相对于使用quarch等热插拔测试设备,降低了测试成本,可以实现大量设备的异常下电测试。By responding to receiving an abnormal power-off test task, configuring the first register state to indicate entering the abnormal power-off test mode; in response to receiving a shutdown command, sending a power-off command to the solid-state hard disk according to the shutdown command; in response to the detection The second register state is power-off completion, and the shutdown operation is completed, wherein the second register state is performed and configured by the solid-state hard disk according to the first register state and the power-off command; in response to restarting After power-on is completed, the solid-state hard disk is detected and an abnormal power-off detection result of the solid-state hard disk is generated. It solves the problem that using the relay to control the switch button cannot guarantee that every shutdown will enter the abnormal power-off problem, and improves the precise control of the abnormal power-off test; compared with using quarch and other hot-swappable test equipment, it reduces the test cost and can realize a large number of Abnormal power-off test of the device.

附图说明Description of drawings

图1为异常下电检测方法的流程示意图;FIG. 1 is a schematic flow chart of a method for abnormal power-off detection;

图2为应用于测试主机的异常下电检测方法的步骤示意图;2 is a schematic diagram of the steps of the abnormal power-off detection method applied to the test host;

图3为应用于固态硬盘的异常下电检测方法的步骤示意图;3 is a schematic diagram of the steps of the abnormal power-off detection method applied to the solid-state hard disk;

图4为应用于测试主机的异常下电检测装置的装置示意图;Fig. 4 is a device schematic diagram of an abnormal power-off detection device applied to a test host;

图5为应用于固态硬盘的异常下电检测装置的装置示意图;Fig. 5 is a device schematic diagram of an abnormal power-off detection device applied to a solid-state hard disk;

图6为本发明实施例中计算机设备的内部结构图;Fig. 6 is the internal structural diagram of computer equipment in the embodiment of the present invention;

具体实施方式Detailed ways

为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请执行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solution and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present application, and are not intended to limit the present application.

本申请提供的方法,可以应用于如图1所示的异常下电检测方法的流程示意图,先配置第一寄存器状态以指示进入异常下电测试模式,然后向固态硬盘发送格式化指令以格式化固态硬盘的文件系统并将第一模板数据写入文件系统并向固态硬盘发送下电指令,接着获取第二寄存器的状态并确定固态硬盘是否已完成下电,然后尝试访问文件系统,最后从文件系统中获取第二模板数据并根据第二模板数据和第一模板数据生成异常下电检测结果。The method provided by this application can be applied to the flow diagram of the abnormal power-off detection method shown in Figure 1. First, configure the first register status to indicate that the abnormal power-off test mode is entered, and then send a formatting command to the solid-state hard disk to format The file system of the solid-state hard disk and write the first template data into the file system and send a power-off command to the solid-state hard disk, then obtain the status of the second register and determine whether the solid-state hard disk has been powered off, and then try to access the file system, and finally from the file The system acquires the second template data and generates an abnormal power-off detection result according to the second template data and the first template data.

在一个实施例中,如图2所示,本发明提供一种异常下电检测方法,应用于测试主机,所述方法包括:In one embodiment, as shown in FIG. 2, the present invention provides a method for detecting abnormal power-off, which is applied to a test host, and the method includes:

S201、响应于接收到异常下电测试任务,配置第一寄存器状态以指示进入异常下电测试模式;S201. In response to receiving the abnormal power-off test task, configure the state of the first register to indicate entering the abnormal power-off test mode;

S202、响应于接收到关机指令,根据所述关机指令向所述固态硬盘发送下电指令;S202. In response to receiving a shutdown instruction, send a power-off instruction to the solid state disk according to the shutdown instruction;

S203、响应于检测到第二寄存器状态为下电完成,完成关机操作,其中所述第二寄存器状态由所述固态硬盘根据所述第一寄存器状态以及所述下电指令进行伪下电动作并配置;S203. In response to detecting that the second register state is power-off complete, complete the shutdown operation, wherein the second register state is performed by the solid-state hard disk according to the first register state and the power-off instruction to perform a pseudo-power-off action and configuration;

S204、响应于重新上电完成,检测所述固态硬盘并生成所述固态硬盘的异常下电检测结果。S204. In response to the completion of power-on again, detect the solid-state hard disk and generate an abnormal power-off detection result of the solid-state hard disk.

具体的,在对固态硬盘进行异常下电检测之前,可以通过pcie配置固态硬盘对应的第一寄存器A,实现异常下电测试模式的控制。例如当主机接收到异常下电检测任务时,此时将第一寄存器写A=1,固态硬盘获知后进入异常下电测试模式,第一寄存器写A=0时固态硬盘退出异常下电测试模式,不影响测试结束之后的使用。Specifically, before abnormal power-off detection is performed on the solid-state hard disk, the first register A corresponding to the solid-state hard disk can be configured through pcie to realize the control of the abnormal power-off test mode. For example, when the host receives an abnormal power-off detection task, write A=1 to the first register at this time, and the solid-state hard disk will enter the abnormal power-off test mode after being informed, and the solid-state hard disk will exit the abnormal power-off test mode when the first register is written A=0 , does not affect the use after the test.

在其中一个实施例中,响应于接收到关机指令,根据所述关机指令向所述固态硬盘发送下电指令包括:In one of the embodiments, in response to receiving the shutdown instruction, sending the power-off instruction to the solid state disk according to the shutdown instruction includes:

向所述固态硬盘发送格式化指令以格式化所述固态硬盘的文件系统;Send a formatting instruction to the solid-state hard disk to format the file system of the solid-state hard disk;

将第一模板数据写入所述文件系统并向所述固态硬盘发送下电指令。Writing the first template data into the file system and sending a power-off instruction to the solid-state hard disk.

具体的,当接收到用户发送的关机指令时,主机开始执行关机动作,其中先将固态硬盘的文件系统ext4(Fourth extended filesystem第四代扩展文件系统)格式化,再通过使用fio工具对固态硬盘写入pattern,最后向固态硬盘下发下电指令。Specifically, when receiving the shutdown command sent by the user, the host starts to execute the shutdown action. First, the file system ext4 (Fourth extended filesystem) of the solid-state disk is formatted, and then the solid-state disk is formatted by using the fio tool. Write the pattern, and finally issue a power-off command to the SSD.

在其中一个实施例中,响应于检测到第二寄存器状态为下电完成,完成关机操作包括:In one of the embodiments, in response to detecting that the state of the second register is power-off completion, completing the shutdown operation includes:

检测所述固态硬盘对应的第二寄存器;Detecting the second register corresponding to the solid state disk;

获取所述第二寄存器的状态并确定所述固态硬盘是否已完成下电;Acquiring the state of the second register and determining whether the solid state disk has been powered off;

若是,则继续完成关机操作;If so, continue to complete the shutdown operation;

若否,则重新获取所述第二寄存器状态。If not, the state of the second register is reacquired.

具体的,如上所述,在测试主机向固态硬盘下发下电指令后,测试主机继续获取固态硬盘对应的第二寄存器B的状态,如果检测到第二寄存器显示该固态硬盘已完成下电,则测试主机正式完成关机操作,即包括主机内的其他组件也都下电完成。而当第二寄存器B显示固态硬盘尚未下电完成时,可以先将其他组件下电然后重新获取第二寄存器B的状态直到固态硬盘下电完成则主机完成关机动作。Specifically, as described above, after the test host sends a power-off command to the solid-state hard disk, the test host continues to obtain the state of the second register B corresponding to the solid-state hard disk. If it is detected that the second register shows that the solid-state hard disk has been powered off, Then the test host officially completes the shutdown operation, that is, other components in the host are also powered off. And when the second register B shows that the solid-state hard drive has not been powered off, you can first power off other components and then re-acquire the status of the second register B until the solid-state hard drive is powered off and the host completes the shutdown action.

在其中一个实施例中,响应于重新上电完成,检测所述固态硬盘并生成所述固态硬盘的异常下电检测结果包括:In one of the embodiments, in response to the completion of power-on again, detecting the solid-state hard disk and generating the abnormal power-off detection result of the solid-state hard disk includes:

尝试访问所述文件系统;Attempt to access said file system;

若失败,则确定所述固态硬盘未挂载并向用户发送告警信息;If it fails, it is determined that the solid state drive is not mounted and a warning message is sent to the user;

若成功,则从所述文件系统中获取第二模板数据并根据所述第二模板数据和所述第一模板数据生成所述异常下电检测结果。If successful, acquire second template data from the file system, and generate the abnormal power-off detection result according to the second template data and the first template data.

具体的,测试主机可以通过继电器控制开关按钮完成上电开机,此时固态硬盘同样也成功上电,此时测试主机尝试访问固态硬盘的文件系统,如果无法访问或者没有检测到该文件系统,则确定经过异常下电测试后固态硬盘没有正常挂载,此时需要向用户告警。如果成功检测并访问到文件系统时,此时测试主机从文件系统中获取经过异常下电测试后的pattern(第二模板数据)并通过对比两次数据生成最终的异常下电检测结果。Specifically, the test host can complete the power-on and start-up through the relay control switch button. At this time, the solid-state hard drive is also successfully powered on. At this time, the test host tries to access the file system of the solid-state hard drive. If the file system cannot be accessed or is not detected, then It is determined that the solid-state drive is not mounted normally after the abnormal power-off test, and the user needs to be alerted at this time. If the file system is successfully detected and accessed, the test host obtains the pattern (second template data) after the abnormal power-off test from the file system and generates the final abnormal power-off detection result by comparing the two data.

在其中一个实施例中,所述根据所述第二模板数据和所述第一模板数据生成所述异常下电检测结果包括:In one of the embodiments, the generating the abnormal power-off 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 the same;

若是,则生成第一异常下电检测结果并向所述用户发送所述第一异常下电检测结果;If so, generate a first abnormal power-off detection result and send the first abnormal power-off detection result to the user;

若否,则生成第二异常下电检测结果并向所述用户发送所述第二异常下电检测结果。If not, generate a second abnormal power-off detection result and send the second abnormal power-off detection result to the user.

具体的,如上所述,当成功获取到第二模板数据后,将上电开机前写入文件系统的原pattern(第一模板数据)和第二模板数据进行字符比对,当两者误差小于比如1%以内时,说明该固态硬盘异常下电检测正常(第一异常下电检测)并发送给用户,当当两者误差大于或等于比如1%以内时,说明该固态硬盘异常下电检测异常(第二异常下电检测)并发送给用户,其中误差系数可以由用户设置。Specifically, as mentioned above, after the second template data is successfully obtained, the original pattern (first template data) written into the file system before power-on and booting is compared with the second template data, and when the error between the two is less than For example, if it is within 1%, it means that the abnormal power-off detection of the solid-state drive is normal (the first abnormal power-off detection) and sent to the user. When the error between the two is greater than or equal to, for example, within 1%, it means that the abnormal power-off detection of the solid-state drive is abnormal (Second abnormal power-off detection) and sent to the user, wherein the error coefficient can be set by the user.

在其中一个实施例中,如图3所示,还提供一种异常下电检测方法,应用于固态硬盘,所述方法包括:In one of the embodiments, as shown in FIG. 3 , a method for detecting abnormal power-off is also provided, which is applied to a solid-state hard disk, and the method includes:

S301、接收测试主机发送的下电指令;S301. Receive a power-off command sent by the test host;

S302、获取第一寄存器状态,其中所述第一寄存器状态由所述测试主机响应于接收到异常下电测试任务而配置,以指示进入异常下电测试模式;S302. Acquire a first register state, wherein the first register state is configured by the test host in response to receiving an abnormal power-off test task, so as to indicate entering an abnormal power-off test mode;

S303、根据所述第一寄存器状态以及所述下电指令进行伪下电动作;S303. Perform a pseudo power-off action according to the state of the first register and the power-off instruction;

S304、配置第二寄存器状态以指示固态硬盘下电完成。S304. Configure the state of the second register to indicate that the solid state disk is powered off.

具体的,在接收时测试主机发送的下电指令时,获取第一寄存器A的状态,如果A=1,则固态硬盘进入异常下电测试模式,此时对于接收到的下电指令进行伪下电动作。包括将对应的第二寄存器器状态修改成已下电完成,但对于自身的文件系统等不进行真实下电,即主机关机时固态硬盘不执行真实的下电动作仅修改第二寄存器的状态。Specifically, when receiving and testing the power-off command sent by the host, the state of the first register A is obtained. If A=1, the solid-state hard disk enters the abnormal power-off test mode. At this time, the received power-off command is pseudo-down electric action. Including modifying the state of the corresponding second register to have been powered off, but not actually powering off its own file system, that is, when the host is turned off, the SSD does not perform a real power-off action and only modifies the state of the second register.

在其中一个实施例中,所述方法还包括:In one embodiment, the method also includes:

S305、响应于接收到测试主机下发的格式化指令,格式化固态硬盘的文件系统;S305. Formatting the file system of the solid-state hard disk in response to receiving the formatting instruction issued by the test host;

S306、接收所述测试主机发送的第一模板数据并写入所述文件系统。S306. Receive the first template data sent by the test host and write it into the file system.

具体的,如上所述,在主机正式关机前,先接收到主机下发的格式化指令,根据该格式化指令先将文件系统格式化,即清理原有的文件数据,并接收主机重新发送的pattern(第一模板数据)。Specifically, as mentioned above, before the host is officially shut down, it first receives the formatting command issued by the host, and according to the formatting command, the file system is first formatted, that is, the original file data is cleared, and the host re-sent is received. pattern (first template data).

在其中一个实施例中,所述方法还包括:In one embodiment, the method also includes:

S307、响应于所述测试主机在重新上电完成后发送的测试数据读取请求,将第二模板数据发送至测试主机,以供所述测试主机根据所述第一模板数据以及第二模板数据生成所述异常下电检测结果。S307. In response to the test data reading request sent by the test host after power-on is completed, send the second template data to the test host, so that the test host can use the first template data and the second template data The abnormal power-off detection result is generated.

具体的,如上所述,当固态硬盘重新上电完成后,当接收到主机发送的测试数据读取请求时,将文件系统中已经过下电并上电后的pattern(第二模板数据)发送给测试主机用于比较生成异常下电检测结果。Specifically, as described above, after the solid state hard drive is powered on again, when the test data reading request sent by the host is received, the pattern (second template data) that has been powered off and powered on in the file system is sent It is used for the test host to compare and generate abnormal power-off detection results.

本申请的方案有如下有益效果:The scheme of the present application has the following beneficial effects:

1)解决了使用继电器控制开关按钮,不能保证每一次关机都进入异常下电的问题,提高了异常下电测试的精准控制;1) It solves the problem that using the relay to control the switch button cannot guarantee that the abnormal power-off will occur every time the machine is shut down, and improves the precise control of the abnormal power-off test;

2)相对于使用quarch等热插拔测试设备,降低了测试成本,可以实现大量设备的异常下电测试。2) Compared with using quarch and other hot-swap test equipment, the test cost is reduced, and abnormal power-off tests of a large number of devices can be realized.

应该理解的是,虽然图2和图3的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图2和图3中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次执行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that although the steps in the flow charts of FIG. 2 and FIG. 3 are shown sequentially as indicated by the arrows, these steps are not necessarily executed sequentially in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least some of the steps in FIG. 2 and FIG. 3 may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily performed at the same time, but may be performed at different times, these sub-steps or The execution sequence of the stages is not necessarily executed sequentially, but may be executed alternately or alternately with at least a part of other steps or substeps of other steps or stages.

在一个实施例中,如图4所示,提供一种异常下电检测装置,应用于测试主机,所述装置包括:In one embodiment, as shown in FIG. 4 , an abnormal power-off detection device is provided, which is applied to a test host, and the device includes:

第一配置模块401,响应于接收到异常下电测试任务,用于配置第一寄存器状态以指示进入异常下电测试模式;The first configuration module 401, in response to receiving the abnormal power-off test task, is used to configure the state of the first register to indicate entering the abnormal power-off test mode;

指令发送模块402,响应于接收到关机指令,用于根据所述关机指令向所述固态硬盘发送下电指令;The instruction sending module 402, in response to receiving the shutdown instruction, is configured to send a power-off instruction to the solid-state hard disk according to the shutdown instruction;

关机模块403,响应于检测到第二寄存器状态为下电完成,用于完成关机操作,其中所述第二寄存器状态由所述固态硬盘根据所述第一寄存器状态以及所述下电指令进行伪下电动作并配置;The shutdown module 403 is configured to complete the shutdown operation in response to detecting that the second register status is power-off completion, wherein the second register status is faked by the solid state disk according to the first register status and the power-off command Power off and configure;

检测模块404,响应于重新上电完成,用于检测所述固态硬盘并生成所述固态硬盘的异常下电检测结果。The detection module 404 is configured to detect the solid-state hard disk and generate a detection result of abnormal power-off of the solid-state hard disk in response to completion of power-on again.

在其中一个实施例中,响应于接收到关机指令,所述指令发送模块根据所述关机指令向所述固态硬盘发送下电指令包括:In one of the embodiments, in response to receiving the shutdown instruction, the instruction sending module sending the power-off instruction to the solid-state hard disk according to the shutdown instruction includes:

向所述固态硬盘发送格式化指令以格式化所述固态硬盘的文件系统;Send a formatting instruction to the solid-state hard disk to format the file system of the solid-state hard disk;

将第一模板数据写入所述文件系统并向所述固态硬盘发送下电指令。Writing the first template data into the file system and sending a power-off instruction to the solid-state hard disk.

在其中一个实施例中,响应于检测到第二寄存器状态为下电完成,所述关机模块完成关机操作包括:In one of the embodiments, in response to detecting that the state of the second register is power-off complete, the shutdown module completing the shutdown operation includes:

检测所述固态硬盘对应的第二寄存器;Detecting the second register corresponding to the solid state disk;

获取所述第二寄存器的状态并确定所述固态硬盘是否已完成下电;Acquiring the state of the second register and determining whether the solid state disk has been powered off;

若是,则继续完成关机操作;If so, continue to complete the shutdown operation;

若否,则重新获取所述第二寄存器状态。If not, the state of the second register is reacquired.

在其中一个实施例中,响应于重新上电完成,所述检测模块检测所述固态硬盘并生成所述固态硬盘的异常下电检测结果包括:In one of the embodiments, in response to the completion of power-on again, the detection module detects the solid-state hard disk and generates the abnormal power-off detection result of the solid-state hard disk, including:

尝试访问所述文件系统;Attempt to access said file system;

若失败,则确定所述固态硬盘未挂载并向用户发送告警信息;If it fails, it is determined that the solid state drive is not mounted and a warning message is sent to the user;

若成功,则从所述文件系统中获取第二模板数据并根据所述第二模板数据和所述第一模板数据生成所述异常下电检测结果。If successful, acquire second template data from the file system, and generate the abnormal power-off detection result according to the second template data and the first template data.

在其中一个实施例中,所述检测模块根据所述第二模板数据和所述第一模板数据生成所述异常下电检测结果包括:In one of the embodiments, the detection module generating the abnormal power-off 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 the same;

若是,则生成第一异常下电检测结果并向所述用户发送所述第一异常下电检测结果;If so, generate a first abnormal power-off detection result and send the first abnormal power-off detection result to the user;

若否,则生成第二异常下电检测结果并向所述用户发送所述第二异常下电检测结果。If not, generate a second abnormal power-off detection result and send the second abnormal power-off detection result to the user.

在其中一个实施例中,如图5所示,还提供一种异常下电检测装置,应用于固态硬盘,所述装置包括:In one of the embodiments, as shown in FIG. 5 , a device for detecting abnormal power-off is also provided, which is applied to a solid-state hard disk, and the device includes:

接收模块501,用于接收测试主机发送的下电指令;The receiving module 501 is configured to receive the power-off command sent by the test host;

获取模块502,用于获取第一寄存器状态,其中所述第一寄存器状态由所述测试主机响应于接收到异常下电测试任务而配置,以指示进入异常下电测试模式;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-off test task, so as to indicate entering an abnormal power-off test mode;

动作模块503,用于根据所述第一寄存器状态以及所述下电指令进行伪下电动作;An action module 503, configured to perform a pseudo power-off action according to the state of the first register and the power-off instruction;

第二配置模块504,用于配置第二寄存器状态以指示固态硬盘下电完成。The second configuration module 504 is configured to configure the state of the second register to indicate that the solid state disk is powered off.

在其中一个实施例中,所述装置还包括:In one of the embodiments, the device also includes:

格式化模块505,响应于接收到测试主机下发的格式化指令,用于格式化固态硬盘的文件系统;The formatting module 505 is used to format the file system of the solid-state hard disk in response to receiving the formatting instruction issued by the test host;

读写模块506,用于接收所述测试主机发送的第一模板数据并写入所述文件系统。The read-write module 506 is configured to receive the first template data sent by the test host and write it into the file system.

在其中一个实施例中,所述装置还包括:In one of the embodiments, the device also includes:

数据发送模块507,响应于所述测试主机在重新上电完成后发送的测试数据读取请求,用于将第二模板数据发送至测试主机,以供所述测试主机根据所述第一模板数据以及第二模板数据生成所述异常下电检测结果。The data sending module 507 is used to send the second template data to the test host in response to the test data reading request sent by the test host after the power-on is completed, so that the test host can And the second template data generates the abnormal power-off detection result.

关于异常下电检测装置的具体限定可以参见上文中对于异常下电检测方法的限定,在此不再赘述。上述异常下电检测装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。For specific limitations on the abnormal power-off detection device, please refer to the above-mentioned limitations on the abnormal power-off detection method, which will not be repeated here. Each module in the above-mentioned abnormal power-off detection device may be implemented in whole or in part by software, hardware or a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, and can also be stored in the memory of the computer device in the form of software, so that the processor can call and execute the corresponding operations of the above modules.

在一个实施例中,提供了一种计算机设备,该计算机设备可以是终端,其内部结构图可以如图6所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口、显示屏和输入装置。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统和计算机程序。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机程序被处理器执行时以实现告警信息处理方法。该计算机设备的显示屏可以是液晶显示屏或者电子墨水显示屏,该计算机设备的输入装置可以是显示屏上覆盖的触摸层,也可以是计算机设备外壳上设置的按键、轨迹球或触控板,还可以是外接的键盘、触控板或鼠标等。In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure 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 through a system bus. Wherein, the processor of the computer device is used to provide calculation 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 computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, the alarm information processing method can be realized. The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device may be a touch layer covered on the display screen, or a button, a trackball or a touch pad provided on the casing of the computer device , and can also be an external keyboard, touchpad, or mouse.

本领域技术人员可以理解,图6中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。Those skilled in the art can understand that the structure shown in FIG. 6 is only a block diagram of a part of the structure related to the solution of this application, and does not constitute a limitation on the computer equipment to which the solution of this application is applied. The specific computer equipment can be More or fewer components than shown in the figures may be included, or some components may be combined, or have a different arrangement of components.

在一个实施例中,提供了一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现以下步骤:In one embodiment, an electronic device is provided, including a memory, a processor, and a computer program stored on the memory and operable on the processor, and the processor implements the following steps when executing the computer program:

响应于接收到异常下电测试任务,配置第一寄存器状态以指示进入异常下电测试模式;In response to receiving the abnormal power-off test task, configure the state of the first register to indicate entering the abnormal power-off test mode;

响应于接收到关机指令,根据所述关机指令向所述固态硬盘发送下电指令;In response to receiving a shutdown instruction, send a power-off instruction to the solid state disk according to the shutdown instruction;

响应于检测到第二寄存器状态为下电完成,完成关机操作,其中所述第二寄存器状态由所述固态硬盘根据所述第一寄存器状态以及所述下电指令进行伪下电动作并配置;In response to detecting that the second register status is power-off completion, the shutdown operation is completed, wherein the second register status is performed and configured by the solid-state hard disk according to the first register status and the power-off command;

响应于重新上电完成,检测所述固态硬盘并生成所述固态硬盘的异常下电检测结果。In response to the completion of power-on again, detect the solid-state hard disk and generate an abnormal power-off detection result of the solid-state hard disk.

在其中一个实施例中,所述处理器执行所述计算机程序时实现以下步骤:In one of the embodiments, the processor implements the following steps when executing the computer program:

响应于接收到关机指令,根据所述关机指令向所述固态硬盘发送下电指令包括:In response to receiving the shutdown instruction, sending the power-off instruction to the solid state disk according to the shutdown instruction includes:

向所述固态硬盘发送格式化指令以格式化所述固态硬盘的文件系统;Send a formatting instruction to the solid-state hard disk to format the file system of the solid-state hard disk;

将第一模板数据写入所述文件系统并向所述固态硬盘发送下电指令。Writing the first template data into the file system and sending a power-off instruction to the solid-state hard disk.

在其中一个实施例中,所述处理器执行所述计算机程序时实现以下步骤:In one of the embodiments, the processor implements the following steps when executing the computer program:

响应于检测到第二寄存器状态为下电完成,完成关机操作包括:In response to detecting that the state of the second register is power-off completion, completing the shutdown operation includes:

检测所述固态硬盘对应的第二寄存器;Detecting the second register corresponding to the solid state disk;

获取所述第二寄存器的状态并确定所述固态硬盘是否已完成下电;Acquiring the state of the second register and determining whether the solid state disk has been powered off;

若是,则继续完成关机操作;If so, continue to complete the shutdown operation;

若否,则重新获取所述第二寄存器状态。If not, the state of the second register is reacquired.

在其中一个实施例中,所述处理器执行所述计算机程序时实现以下步骤:In one of the embodiments, the processor implements the following steps when executing the computer program:

响应于重新上电完成,检测所述固态硬盘并生成所述固态硬盘的异常下电检测结果包括:In response to the completion of re-powering, detecting the solid-state hard disk and generating the abnormal power-off detection result of the solid-state hard disk includes:

尝试访问所述文件系统;Attempt to access said file system;

若失败,则确定所述固态硬盘未挂载并向用户发送告警信息;If it fails, it is determined that the solid state drive is not mounted and a warning message is sent to the user;

若成功,则从所述文件系统中获取第二模板数据并根据所述第二模板数据和所述第一模板数据生成所述异常下电检测结果。If successful, acquire second template data from the file system, and generate the abnormal power-off detection result according to the second template data and the first template data.

在其中一个实施例中,所述处理器执行所述计算机程序时实现以下步骤:In one of the embodiments, the processor implements the following steps when executing the computer program:

根据所述第二模板数据和所述第一模板数据生成所述异常下电检测结果包括:Generating the abnormal power-off 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 the same;

若是,则生成第一异常下电检测结果并向所述用户发送所述第一异常下电检测结果;If so, generate a first abnormal power-off detection result and send the first abnormal power-off detection result to the user;

若否,则生成第二异常下电检测结果并向所述用户发送所述第二异常下电检测结果。If not, generate a second abnormal power-off detection result and send the second abnormal power-off detection result to the user.

在其中一个实施例中,所述处理器执行所述计算机程序时实现以下步骤:In one of the embodiments, the processor implements the following steps when executing the computer program:

接收测试主机发送的下电指令;Receive the power-off command sent by the 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-off test task to indicate entering an abnormal power-off test mode;

根据所述第一寄存器状态以及所述下电指令进行伪下电动作;performing a pseudo-power-off action according to the state of the first register and the power-off instruction;

配置第二寄存器状态以指示固态硬盘下电完成。Configure the status of the second register to indicate that the solid state disk is powered off.

在其中一个实施例中,所述处理器执行所述计算机程序时实现以下步骤:In one of the embodiments, the processor implements the following steps when executing the computer program:

响应于接收到测试主机下发的格式化指令,格式化固态硬盘的文件系统;Formatting the file system of the solid state drive in response to receiving a formatting instruction issued by the test host;

接收所述测试主机发送的第一模板数据并写入所述文件系统。receiving the first template data sent by the test host and writing it into the file system.

在其中一个实施例中,所述处理器执行所述计算机程序时实现以下步骤:In one of the embodiments, the processor implements the following steps when executing the computer program:

响应于所述测试主机在重新上电完成后发送的测试数据读取请求,将第二模板数据发送至测试主机,以供所述测试主机根据所述第一模板数据以及第二模板数据生成所述异常下电检测结果。In response to the test data reading request sent by the test host after re-powering on, the second template data is sent to the test host, so that the test host can generate the test data according to the first template data and the second template data. The above-mentioned abnormal power-off detection results.

在一个实施例中,提供了一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现以下步骤:In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

响应于接收到异常下电测试任务,配置第一寄存器状态以指示进入异常下电测试模式;In response to receiving the abnormal power-off test task, configure the state of the first register to indicate entering the abnormal power-off test mode;

响应于接收到关机指令,根据所述关机指令向所述固态硬盘发送下电指令;In response to receiving a shutdown instruction, send a power-off instruction to the solid state disk according to the shutdown instruction;

响应于检测到第二寄存器状态为下电完成,完成关机操作,其中所述第二寄存器状态由所述固态硬盘根据所述第一寄存器状态以及所述下电指令进行伪下电动作并配置;In response to detecting that the second register status is power-off completion, the shutdown operation is completed, wherein the second register status is performed and configured by the solid-state hard disk according to the first register status and the power-off command;

响应于重新上电完成,检测所述固态硬盘并生成所述固态硬盘的异常下电检测结果。In response to the completion of power-on again, detect the solid-state hard disk and generate an abnormal power-off detection result of the solid-state hard disk.

在其中一个实施例中,所述计算机程序被处理器执行时实现以下步骤:In one of the embodiments, when the computer program is executed by the processor, the following steps are implemented:

响应于接收到关机指令,根据所述关机指令向所述固态硬盘发送下电指令包括:In response to receiving the shutdown instruction, sending the power-off instruction to the solid state disk according to the shutdown instruction includes:

向所述固态硬盘发送格式化指令以格式化所述固态硬盘的文件系统;Send a formatting instruction to the solid-state hard disk to format the file system of the solid-state hard disk;

将第一模板数据写入所述文件系统并向所述固态硬盘发送下电指令。Writing the first template data into the file system and sending a power-off instruction to the solid-state hard disk.

在其中一个实施例中,所述计算机程序被处理器执行时实现以下步骤:In one of the embodiments, when the computer program is executed by the processor, the following steps are implemented:

响应于检测到第二寄存器状态为下电完成,完成关机操作包括:In response to detecting that the state of the second register is power-off completion, completing the shutdown operation includes:

检测所述固态硬盘对应的第二寄存器;Detecting the second register corresponding to the solid state disk;

获取所述第二寄存器的状态并确定所述固态硬盘是否已完成下电;Acquiring the state of the second register and determining whether the solid state disk has been powered off;

若是,则继续完成关机操作;If so, continue to complete the shutdown operation;

若否,则重新获取所述第二寄存器状态。If not, the state of the second register is reacquired.

在其中一个实施例中,所述计算机程序被处理器执行时实现以下步骤:In one of the embodiments, when the computer program is executed by the processor, the following steps are implemented:

响应于重新上电完成,检测所述固态硬盘并生成所述固态硬盘的异常下电检测结果包括:In response to the completion of re-powering, detecting the solid-state hard disk and generating the abnormal power-off detection result of the solid-state hard disk includes:

尝试访问所述文件系统;Attempt to access said file system;

若失败,则确定所述固态硬盘未挂载并向用户发送告警信息;If it fails, it is determined that the solid state drive is not mounted and a warning message is sent to the user;

若成功,则从所述文件系统中获取第二模板数据并根据所述第二模板数据和所述第一模板数据生成所述异常下电检测结果。If successful, acquire second template data from the file system, and generate the abnormal power-off detection result according to the second template data and the first template data.

在其中一个实施例中,所述计算机程序被处理器执行时实现以下步骤:In one of the embodiments, when the computer program is executed by the processor, the following steps are implemented:

根据所述第二模板数据和所述第一模板数据生成所述异常下电检测结果包括:Generating the abnormal power-off 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 the same;

若是,则生成第一异常下电检测结果并向所述用户发送所述第一异常下电检测结果;If so, generate a first abnormal power-off detection result and send the first abnormal power-off detection result to the user;

若否,则生成第二异常下电检测结果并向所述用户发送所述第二异常下电检测结果。If not, generate a second abnormal power-off detection result and send the second abnormal power-off detection result to the user.

在其中一个实施例中,所述计算机程序被处理器执行时实现以下步骤:In one of the embodiments, when the computer program is executed by the processor, the following steps are implemented:

接收测试主机发送的下电指令;Receive the power-off command sent by the 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-off test task to indicate entering an abnormal power-off test mode;

根据所述第一寄存器状态以及所述下电指令进行伪下电动作;performing a pseudo-power-off action according to the state of the first register and the power-off instruction;

配置第二寄存器状态以指示固态硬盘下电完成。Configure the status of the second register to indicate that the solid state disk is powered off.

在其中一个实施例中,所述计算机程序被处理器执行时实现以下步骤:In one of the embodiments, when the computer program is executed by the processor, the following steps are implemented:

响应于接收到测试主机下发的格式化指令,格式化固态硬盘的文件系统;Formatting the file system of the solid state drive in response to receiving a formatting instruction issued by the test host;

接收所述测试主机发送的第一模板数据并写入所述文件系统。receiving the first template data sent by the test host and writing it into the file system.

在其中一个实施例中,所述计算机程序被处理器执行时实现以下步骤:In one of the embodiments, when the computer program is executed by the processor, the following steps are implemented:

响应于所述测试主机在重新上电完成后发送的测试数据读取请求,将第二模板数据发送至测试主机,以供所述测试主机根据所述第一模板数据以及第二模板数据生成所述异常下电检测结果。In response to the test data reading request sent by the test host after re-powering on, the second template data is sent to the test host, so that the test host can generate the test data according to the first template data and the second template data. The above-mentioned abnormal power-off detection results.

本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be implemented through computer programs to instruct related hardware, and the computer programs can be stored in a non-volatile computer-readable memory In the medium, when the computer program is executed, it may include the processes of the embodiments of the above-mentioned methods. Wherein, any references to memory, storage, database or other media used in the various embodiments provided in the present application may include non-volatile and/or volatile memory. 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 many forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Chain Synchlink DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

以上实施例的各技术特征可以执行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都执行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be It is considered to be within the range described in this specification.

以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。The above-mentioned embodiments only express several implementation modes of the present application, and the description thereof is relatively specific and detailed, but it should not be construed as limiting the scope of the patent for the invention. It should be noted that those skilled in the art can make several modifications and improvements without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the scope of protection of the patent application should be based on the appended claims.

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-off detection method, electronic device 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-off detection method, electronic device 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-off detection method, electronic device 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-off detection method, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN116069576A (en)

Similar Documents

Publication Publication Date Title
KR102147970B1 (en) Method of reparing non-volatile memory based storage device and operation method of electronic system including the storage device
CN103930878A (en) Method, apparatus and system for memory validation
CN111105840B (en) Method, device and system for testing abnormal power failure of solid state disk
US10691569B2 (en) System and method for testing a data storage device
CN102289398A (en) Restart testing method
CN108364670B (en) Read-write pressure testing method, device, equipment and storage medium
CN111143132A (en) BIOS recovery method, device, equipment and readable storage medium
CN115314416B (en) Network card state automatic detection method, device, electronic equipment and storage medium
CN105912488A (en) Computer apparatus and control method therefor
JP6599725B2 (en) Information processing apparatus, log management method, and computer program
CN115421750A (en) Method, device, terminal and storage medium for noninductive upgrading of server firmware
CN114496053A (en) Data anomaly detection method, device and equipment and computer readable storage medium
US20070005860A1 (en) Interrupt control system and method
CN112667442B (en) Control method, device and equipment for booting system based on non-volatile memory device
CN109634782B (en) A system robustness detection method, device, storage medium and terminal
CN116069576A (en) Abnormal power-off detection method, electronic device and storage medium
CN112035171A (en) Factory setting restoration method and system based on UEFI firmware
CN117827304A (en) Loading method and device of device executable firmware, storage medium and electronic device
CN114721877B (en) A software fault-tolerant recovery method, device, equipment and storage medium
CN117251361A (en) Method, device, equipment and storage medium for testing system stability
JP2015032103A (en) Image forming apparatus, control method of image forming apparatus, and program
CN113778485A (en) System operation method, device, electronic chip and storage medium of electronic chip
CN114385379B (en) Method, system, terminal and storage medium for detecting on-board information refreshing
WO2019169615A1 (en) Method for accessing code sram, and electronic device
CN120215971A (en) Firmware upgrade method, device, equipment, storage medium and program product

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