A serial hard disk fault processing method, device and medium

By detecting serial hard drive fault information, obtaining status information, and controlling the DEVSLP pin to restart the link, the problem of not being able to detect software transmission layer faults in existing technologies is solved, realizing comprehensive fault detection and maintenance of serial hard drives.

CN116089139BActive Publication Date: 2026-05-19INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
INSPUR SUZHOU INTELLIGENT TECH CO LTD
Filing Date
2022-12-09
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

In existing technologies, maintenance personnel can only determine serial port hard drive failures by detecting electrical signals and analyzing the reliability of physical links. They cannot effectively detect software transmission layer failures, such as abnormal transmission protocols and unexpected serial port failures.

Method used

A serial port hard drive fault handling method is provided. By detecting fault information, obtaining hard drive status information, determining whether preset conditions are met, and sending a command to the DEVSLP pin to control the hard drive link restart, the method includes reading the serial port status register to obtain status information, sending a standby immediate command to put the hard drive into a low-power state, and determining whether the hard drive has entered a low-power state by using test data packets.

Benefits of technology

It enables fault detection at the software transmission level of serial hard drives, ensuring the link between the hard drive and the controller is restarted, and helping maintenance personnel identify and handle hard drive faults.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116089139B_ABST
    Figure CN116089139B_ABST
Patent Text Reader

Abstract

The application relates to the field of computer hard disks, and discloses a serial hard disk fault processing method, a device and a medium, which comprise the following steps: after detecting fault information, determining a fault hard disk according to the fault information, so as to facilitate subsequent processing of the fault hard disk; obtaining state information of the fault hard disk, and judging whether the state information satisfies a preset condition; if the preset condition is satisfied, sending an instruction to a DEVSLP pin of the fault hard disk, so as to control link restart of the fault hard disk. It can be seen that the serial hard disk fault processing method provided by the application sends an instruction to the DEVSLP pin of the fault hard disk to make the device enter a low-power consumption state when the preset condition is satisfied, so that the link between the fault hard disk and the controller is restarted, whether the software transmission layer of the fault hard disk is faulty is judged, and maintenance personnel can maintain the fault hard disk.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer hard disks, and in particular to a method, apparatus, and medium for handling serial hard disk failures. Background Technology

[0002] SATA is an abbreviation for Serial ATA. It is a computer bus whose main function is to transmit data between the motherboard and a large number of storage devices (such as hard drives and optical disc drives). It is named for its serial data transmission method and also has the advantages of simple structure and support for hot-swapping.

[0003] SATA storage devices are widely used in hardware products such as servers. Since SATA is a communication interface that includes a communication protocol, ensuring the security and accuracy of stored information is paramount for SATA storage devices to function properly. Currently, when a serial ATA hard drive malfunctions, hardware maintenance personnel can only diagnose the problem by testing the electrical signals and analyzing the reliability of the physical link. However, besides physical link failures, software-level faults such as abnormal transmission protocols and unexpected serial port failures can also cause serial ATA hard drive failures.

[0004] Therefore, it is evident that providing a more comprehensive fault detection method to enable maintenance personnel to determine whether there are faults in the software transmission layer of serial hard drives is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0005] The purpose of this application is to provide a method, apparatus, and medium for handling serial hard drive failures, so as to determine whether there is a fault in the software transport layer of the serial hard drive, so as to facilitate maintenance personnel to maintain the faulty hard drive.

[0006] To address the aforementioned technical problems, this application provides a method for handling serial port hard drive failures, including:

[0007] Once fault information is detected, the faulty hard drive is identified based on that information.

[0008] Obtain the status information of the faulty hard drive;

[0009] Determine whether the status information meets the preset conditions;

[0010] If the preset conditions are met, a command is sent to the DEVSLP pin of the faulty hard drive to control the link restart of the faulty hard drive.

[0011] Preferably, obtaining the status information of the faulty hard drive includes:

[0012] Read the serial port status register to obtain the status information.

[0013] Preferably, the status information includes at least: normal operating status, link initialization status, and low power consumption status;

[0014] Accordingly, the preset condition is that the status information is in a normal working state.

[0015] Preferably, sending the instruction to the DEVSLP pin of the faulty hard disk includes:

[0016] Send a standby immediate command to the DEVSLP pin of the faulty hard drive to put the faulty hard drive into a low-power state.

[0017] Preferably, reading the serial port status register to obtain the status information includes:

[0018] The target address of the serial port status register is read through the interface power management device to obtain the status information.

[0019] Preferably, after the step of sending a command to the DEVSLP pin of the faulty hard disk, the method further includes:

[0020] Send a test data packet to the faulty hard drive and obtain the time parameters of the faulty hard drive;

[0021] The time parameter is used to determine whether the faulty hard drive has entered a low-power state.

[0022] Preferably, after the step of sending a command to the DEVSLP pin of the faulty hard disk, the method further includes:

[0023] After the link of the faulty hard drive is restarted, it is determined whether the fault information exists on the faulty hard drive;

[0024] If the aforementioned fault information exists, the fault information will be sent to maintenance personnel.

[0025] To address the aforementioned technical problems, this application also provides a serial port hard disk fault handling device, comprising:

[0026] The determination module is used to determine the faulty hard drive based on the fault information after the fault information is detected;

[0027] The acquisition module is used to acquire the status information of the faulty hard drive;

[0028] The judgment module is used to determine whether the status information meets preset conditions;

[0029] The instruction sending module is used to send an instruction to the DEVSLP pin of the faulty hard disk if the preset conditions are met, so as to control the link restart of the faulty hard disk.

[0030] Furthermore, the serial hard drive fault handling device provided in this application also includes: a low-power state judgment module and a fault information sending module. The low-power state judgment module is used to send a test data packet to the faulty hard drive and obtain the time parameters of the faulty hard drive; it then determines whether the faulty hard drive has entered a low-power state based on the time parameters. The fault information sending module is used to determine whether the faulty hard drive has the fault information after the link of the faulty hard drive is restarted; if the fault information exists, it sends the fault information to maintenance personnel.

[0031] To solve the above-mentioned technical problems, this application also provides a serial port hard disk fault handling device, including a memory for storing computer programs;

[0032] A processor is used to implement the steps of the serial port hard disk fault handling method when executing the computer program.

[0033] To address the aforementioned technical problems, this application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the serial hard disk fault handling method.

[0034] This application provides a serial hard drive fault handling method, including: upon detecting fault information, identifying the faulty hard drive based on the fault information to facilitate subsequent processing; acquiring the status information of the faulty hard drive and determining whether the status information meets preset conditions; if the preset conditions are met, sending a command to the DEVSLP pin of the faulty hard drive to control the link restart of the faulty hard drive. Therefore, the serial hard drive fault handling method provided in this application, by sending a command to the DEVSLP pin of the faulty hard drive when preset conditions are met to put the device into a low-power state, thereby restarting the link between the faulty hard drive and the controller, determines whether there is a fault in the software transport layer of the faulty hard drive, facilitating maintenance personnel to maintain the faulty hard drive.

[0035] Furthermore, this application also provides a serial hard drive fault handling device and medium, comprising: upon detecting fault information, identifying the faulty hard drive based on the fault information to facilitate subsequent processing of the faulty hard drive; acquiring the status information of the faulty hard drive and determining whether the status information meets preset conditions; if the preset conditions are met, sending a command to the DEVSLP pin of the faulty hard drive to control the link restart of the faulty hard drive. Thus, the serial hard drive fault handling scheme provided in this application, by sending a command to the DEVSLP pin of the faulty hard drive when preset conditions are met to put the device into a low-power state, thereby restarting the link between the faulty hard drive and the controller, determines whether there is a fault in the software transport layer of the faulty hard drive, facilitating maintenance personnel to maintain the faulty hard drive. Attached Figure Description

[0036] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0037] Figure 1 This is a schematic diagram illustrating a serial hard drive connection method provided in an embodiment of this application;

[0038] Figure 2 A flowchart illustrating a serial port hard drive fault handling method provided in this application embodiment;

[0039] Figure 3 This is a structural diagram of a serial hard disk fault handling device provided in an embodiment of this application;

[0040] Figure 4 This is a structural diagram of another serial hard disk fault handling device provided in an embodiment of this application;

[0041] The attached diagram is labeled as follows: 1 is the controller, and 2 is the serial hard drive. Detailed Implementation

[0042] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.

[0043] The core of this application is to provide a method, device, and medium for handling serial hard drive failures, so as to determine whether there is a fault in the software transmission layer of the serial hard drive, so as to facilitate maintenance personnel to maintain the faulty hard drive.

[0044] For ease of understanding, the hardware architecture to which the technical solution of the present invention applies will be described below. Figure 1 The diagram illustrates a serial hard drive connection method provided in an embodiment of this application, as shown below. Figure 1As shown, the controller communicates with the serial ATA hard drive via the DEVSLP signal. The SATA bus uses an embedded clock frequency signal, providing stronger error correction capabilities than before. It can check transmission commands (not just data) and automatically correct errors, improving data transmission reliability. The most obvious difference between SATA and previous models is the use of thinner ribbon cables, which facilitates airflow within the chassis and increases the stability of the entire platform. Table 1 shows a typical SATA interface diagram. As shown in Table 1, the signal pins P1, P2, and P3 on the power side of the serial ATA hard drive are usually idle. For ordinary 2.5-inch and 3.5-inch HDDs and SSDs, these three pins are not usable. Pin 3 is used to transmit the DEVSLP signal, which puts the device into a low-power state. If the device briefly idles during read / write operations, the OS or motherboard may trigger the "DEVSLP" command. The controller sends this signal to put the device into a low-power state, thus initiating the data transmission link between the storage device and the controller. The technical solution provided in this application is applied to the controller of a smart device for SATA hard drive fault detection. In a specific implementation, the controller sends a command to the serial hard drive through the P3 pin of the serial hard drive to control the hard drive to enter a low-power state.

[0045] Table 1

[0046]

[0047] In serial ATA hard drive (SATA) applications, ensuring normal data transmission requires a stable communication link. When a SATA hard drive malfunctions, hardware maintenance personnel can only test it by checking electrical signals and analyzing the reliability of the physical link. However, besides physical link failures, software-level faults such as abnormal transmission protocols or unexpected serial port failures can also cause SATA hard drive failures. To enable maintenance personnel to determine if there is a fault in the software transmission layer of a SATA hard drive, this application provides a SATA hard drive fault handling method. This method includes: upon detecting fault information, identifying the faulty hard drive based on the fault information for subsequent handling; acquiring the status information of the faulty hard drive and determining whether the status information meets preset conditions; if the preset conditions are met, sending a command to the DEVSLP pin of the faulty hard drive to control the link restart of the faulty hard drive. Therefore, the SATA hard drive fault handling method provided in this application, by sending a command to the DEVSLP pin of the faulty hard drive when preset conditions are met to put the device into a low-power state, thereby restarting the link between the faulty hard drive and the controller, determines whether there is a fault in the software transmission layer of the faulty hard drive, facilitating maintenance personnel to maintain the faulty hard drive.

[0048] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0049] Figure 1 A serial port hard drive fault handling method provided in the embodiments of this application, such as Figure 1 As shown, the method includes:

[0050] S10: After detecting fault information, determine the faulty hard drive based on the fault information.

[0051] It should be noted that the technical solution provided in this application is applied to serial ATA hard drives to detect whether there are software transmission protocol level faults in the serial ATA hard drives. The technical solution provided in this application is applied to a device including a main controller and a serial ATA hard drive, wherein the control pin of the main controller is connected to the PIN3 pin of the serial ATA hard drive to send a DEVSLP signal to the serial ATA hard drive. Simultaneously, the DEVSLP signal receiving end on the device side controls whether the DEVSLP signal is set by pulling it high or low.

[0052] In practice, considering that there are usually multiple hard drives in a server, in order to improve the efficiency of fault diagnosis, the fault information sent by the control is obtained, and the drive letter, region and other information of the faulty hard drive are determined based on the fault information.

[0053] S11: Obtain the status information of the faulty hard drive;

[0054] S12: Determine whether the status information meets the preset conditions.

[0055] In practice, the status information of the faulty hard drive is first obtained, and it is determined whether the status information meets the preset conditions to determine whether the faulty hard drive can enter the low power mode.

[0056] The status information of a faulty hard drive can be obtained by reading SCR0 of the SATA Status Register. Specifically, the values ​​of bits [11:8] of this register are mapped to the Interface Power Management (IPM) module. Therefore, by setting the IPM module to read the value in this register, the controller (Host) can determine the state that the SATA hard drive (Device) is required to enter. If the controller determines that the SATA hard drive can successfully hit the DEVSLP signal by reading the value in the SATA Status Register, then the status information of the SATA hard drive is considered to meet the preset conditions.

[0057] S13: If the preset conditions are met, send a command to the DEVSLP pin of the faulty hard drive to control the link restart of the faulty hard drive.

[0058] In practical implementation, when the controller determines that the serial hard drive can successfully hit the DEVSLP signal by reading the value in the serial port status register, it sends a DEVSLP command to the PIN3 pin of the serial hard drive to put it into a low-power state. This restarts the communication link between the serial hard drive and the controller. The simulated link initialization is equivalent to simulating the process of the communication link going from a power-off state to a power-on state. In this embodiment, when the serial hard drive malfunctions, we can force the device into the DEVSLP low-power state by enabling the DEVSLP signal. Once in this state, operating the device or re-enabling the signal will break the low-power state, requiring a re-link initialization to identify the device and re-read and identify it.

[0059] This embodiment provides a serial hard drive fault handling method, including: upon detecting fault information, identifying the faulty hard drive based on the fault information to facilitate subsequent processing; acquiring the status information of the faulty hard drive and determining whether the status information meets preset conditions; if the preset conditions are met, sending a command to the DEVSLP pin of the faulty hard drive to control the link restart of the faulty hard drive. Therefore, the serial hard drive fault handling method provided in this application, by sending a command to the DEVSLP pin of the faulty hard drive when preset conditions are met to put the device into a low-power state, thereby restarting the link between the faulty hard drive and the controller, determines whether there is a fault in the software transport layer of the faulty hard drive, facilitating maintenance personnel to maintain the faulty hard drive.

[0060] In a preferred embodiment, obtaining the status information of the faulty hard drive includes: reading the serial port status register to obtain the status information. The status information includes at least: normal operating status, link initialization status, and low power consumption status; correspondingly, the preset condition is that the status information is in the normal operating status.

[0061] In practical implementation, the host controller can obtain the status information of the faulty hard drive by reading SCR0 of the SATA Status Register. The values ​​of bits [11:8] of this register are mapped to the Interface Power Management (IPM) module. Therefore, by setting the IPM module to read the value in this register, the host can determine the state the controller (Host) requires the SATA hard drive (Device) to enter. The SATA hard drive's states include normal operation, link initialization, and low power. The low power state is when the SATA hard drive stops working, and the link initialization state is the link recovery phase. When in the link initialization state, the controller can re-enable the SATA hard drive, thereby re-establishing the communication link between the SATA hard drive and the controller to resolve software-level faults such as transmission protocol anomalies and unexpected serial port failures.

[0062] In practical implementation, when the main controller determines that the faulty hard drive can hit the DEVSLP pin, it sends a command to the faulty hard drive to put it into a low-power state. Sending the command to the DEVSLP pin includes sending a standby immediate command to the DEVSLP pin to put the faulty hard drive into a low-power state. Therefore, the serial hard drive fault handling method provided in this application, by sending a command to the DEVSLP pin of the faulty hard drive to put the device into a low-power state when preset conditions are met, restarts the link between the faulty hard drive and the controller, thereby determining whether there is a fault in the software transport layer of the faulty hard drive, facilitating maintenance personnel to maintain the faulty hard drive.

[0063] Understandably, if the controller sends a command to the DEVSLP pin of the faulty hard drive, and data transmission still fails after the link to the faulty hard drive restarts, it indicates a hardware-level fault in the hard drive. However, due to the special nature of the DEVSLP pin, the command sent by the controller may not always be successful. Therefore, it is necessary to test the faulty hard drive to determine if it has entered a low-power state.

[0064] Based on the above embodiment, after the step of sending an instruction to the DEVSLP pin of the faulty hard disk, the method further includes: sending a test data packet to the faulty hard disk and obtaining the time parameters of the faulty hard disk; and determining whether the faulty hard disk has entered a low-power state based on the time parameters.

[0065] Understandably, if the faulty hard drive does not enter a low-power state, the controller will send a standby immediate command to the DEVSLP pin again to bring the faulty hard drive into a low-power state.

[0066] It is important to note that the causes of hard drive failures include not only software-level faults such as transmission protocol anomalies and unexpected serial port failures, but also physical link failures. Restarting the transmission link of a faulty hard drive only addresses software-level faults. Therefore, in a preferred embodiment, after sending a command to the DEVSLP pin of the faulty hard drive, the process further includes: after restarting the link of the faulty hard drive, determining whether fault information exists; if fault information exists, sending the fault information to maintenance personnel. This allows administrators to promptly maintain the physical connection of the faulty hard drive.

[0067] The serial port hard drive failure handling method has been described in detail in the above embodiments. This application also provides embodiments corresponding to the serial port hard drive failure handling device. It should be noted that this application describes the device embodiments from two perspectives: one is based on functional modules, and the other is based on hardware.

[0068] Figure 3 This is a structural diagram of a serial hard disk fault handling device provided in an embodiment of this application, as shown below. Figure 3 As shown, the serial hard disk fault handling device provided in this application includes:

[0069] The determination module 10 is used to determine the faulty hard drive based on the fault information after the fault information is detected.

[0070] Module 11 is used to acquire the status information of the faulty hard drive;

[0071] Judgment module 12 is used to determine whether the status information meets the preset conditions;

[0072] The instruction sending module 13 is used to send an instruction to the DEVSLP pin of the faulty hard disk if preset conditions are met, so as to control the link restart of the faulty hard disk.

[0073] In practice, the status information of the faulty hard drive is first obtained, and it is determined whether the status information meets the preset conditions to determine whether the faulty hard drive can enter the low power mode.

[0074] The status information of a faulty hard drive can be obtained by reading SCR0 of the SATA Status Register. Specifically, the values ​​of bits [11:8] of this register are mapped to the Interface Power Management (IPM) module. Therefore, by setting the IPM module to read the value in this register, the controller (Host) can determine the state that the SATA hard drive (Device) is required to enter. If the controller determines that the SATA hard drive can successfully hit the DEVSLP signal by reading the value in the SATA Status Register, then the status information of the SATA hard drive is considered to meet the preset conditions.

[0075] In practical implementation, when the controller determines that the serial hard drive can successfully hit the DEVSLP signal by reading the value in the serial port status register, it sends a DEVSLP command to the PIN3 pin of the serial hard drive to put it into a low-power state. This restarts the communication link between the serial hard drive and the controller. The simulated link initialization is equivalent to simulating the process of the communication link going from a power-off state to a power-on state. In this embodiment, when the serial hard drive malfunctions, we can force the device into the DEVSLP low-power state by enabling the DEVSLP signal. Once in this state, operating the device or re-enabling the signal will break the low-power state, requiring a re-link initialization to identify the device and re-read and identify it.

[0076] Since the embodiments of the apparatus and the embodiments of the method correspond to each other, please refer to the description of the embodiments of the method for the embodiments of the apparatus, which will not be repeated here.

[0077] Furthermore, the serial hard drive fault handling device provided in this application also includes: a low-power state judgment module and a fault information sending module. The low-power state judgment module is used to send a test data packet to the faulty hard drive and obtain the time parameters of the faulty hard drive; it then determines whether the faulty hard drive has entered a low-power state based on the time parameters. The fault information sending module is used to determine whether the faulty hard drive has the fault information after the link of the faulty hard drive is restarted; if the fault information exists, it sends the fault information to maintenance personnel.

[0078] This application provides a serial hard drive fault handling method, including: upon detecting fault information, identifying the faulty hard drive based on the fault information to facilitate subsequent processing; acquiring the status information of the faulty hard drive and determining whether the status information meets preset conditions; if the preset conditions are met, sending a command to the DEVSLP pin of the faulty hard drive to control the link restart of the faulty hard drive. Therefore, the serial hard drive fault handling method provided in this application, by sending a command to the DEVSLP pin of the faulty hard drive when preset conditions are met to put the device into a low-power state, thereby restarting the link between the faulty hard drive and the controller, determines whether there is a fault in the software transport layer of the faulty hard drive, facilitating maintenance personnel to maintain the faulty hard drive.

[0079] Figure 4 This is a structural diagram of another serial hard disk fault handling device provided in an embodiment of this application, as shown below. Figure 4 As shown, the serial port hard disk fault handling device includes: a memory 20 for storing computer programs;

[0080] The processor 21 is used to execute computer programs to implement the steps of the serial port hard disk fault handling method as described in the above embodiments.

[0081] The terminal devices provided in this embodiment may include, but are not limited to, smartphones, tablets, laptops, or desktop computers.

[0082] The processor 21 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 21 may be implemented using at least one of the following hardware forms: Digital Signal Processor (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 21 may also include a main processor and a coprocessor. The main processor, also known as the Central Processing Unit (CPU), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 21 may integrate a Graphics Processing Unit (GPU), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, the processor 21 may also include an Artificial Intelligence (AI) processor, which is used to handle computational operations related to machine learning.

[0083] The memory 20 may include one or more computer-readable storage media, which may be non-transitory. The memory 20 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In this embodiment, the memory 20 is used to store at least the following computer program 201, which, after being loaded and executed by the processor 21, can implement the relevant steps of the serial hard disk fault handling method disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, and the storage method may be temporary or permanent storage. The operating system 202 may include Windows, Unix, Linux, etc. The data 203 may include, but is not limited to, fault information.

[0084] In some embodiments, the serial hard disk fault handling device may further include a display screen 22, an input / output interface 23, a communication interface 24, a power supply 25, and a communication bus 26.

[0085] Those skilled in the art will understand that Figure 4 The structure shown does not constitute a limitation on the serial hard drive failure handling device and may include more or fewer components than shown.

[0086] The serial port hard disk fault handling device provided in this application includes a memory and a processor. When the processor executes the program stored in the memory, it can implement the following method:

[0087] Once fault information is detected, the faulty hard drive is identified based on that information.

[0088] Obtain the status information of the faulty hard drive;

[0089] Determine whether the status information meets the preset conditions; if the preset conditions are met, send a command to the DEVSLP pin of the faulty hard drive to control the link restart of the faulty hard drive.

[0090] This application provides a serial hard drive fault handling device, comprising: upon detecting fault information, identifying the faulty hard drive based on the fault information to facilitate subsequent processing of the faulty hard drive; acquiring the status information of the faulty hard drive and determining whether the status information meets preset conditions; if the preset conditions are met, sending a command to the DEVSLP pin of the faulty hard drive to control the link restart of the faulty hard drive. Therefore, the serial hard drive fault handling device provided in this application, by sending a command to the DEVSLP pin of the faulty hard drive when preset conditions are met to put the device into a low-power state, thereby restarting the link between the faulty hard drive and the controller, determines whether there is a fault in the software transport layer of the faulty hard drive, facilitating maintenance personnel to maintain the faulty hard drive.

[0091] Finally, this application also provides an embodiment corresponding to a computer-readable storage medium. The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps described in the above method embodiments. The computer-readable storage medium provided in this embodiment is used to store the serial hard disk fault handling method described in the above embodiments, which includes: upon detecting fault information, determining the faulty hard disk based on the fault information to facilitate subsequent processing of the faulty hard disk; obtaining the status information of the faulty hard disk and determining whether the status information meets preset conditions; if the preset conditions are met, sending an instruction to the DEVSLP pin of the faulty hard disk to control the link restart of the faulty hard disk. Therefore, the serial hard disk fault handling method provided in this application, by sending an instruction to the DEVSLP pin of the faulty hard disk when preset conditions are met to cause the device to enter a low-power state, thereby restarting the link between the faulty hard disk and the controller, determines whether there is a fault in the software transport layer of the faulty hard disk, facilitating maintenance personnel to maintain the faulty hard disk.

[0092] It is understood that if the methods in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and executes all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0093] The serial hard drive fault handling method, apparatus, and medium provided in this application have been described in detail above. The serial hard drive fault handling method, apparatus, and medium provided in this application, by sending a command to the DEVSLP pin of the faulty hard drive when preset conditions are met to put the device into a low-power state, thereby restarting the link between the faulty hard drive and the controller, to determine whether there is a fault in the software transport layer of the faulty hard drive, so as to facilitate maintenance personnel to maintain the faulty hard drive. The various embodiments in the specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple, and relevant parts can be referred to in the method section. It should be noted that for those skilled in the art, several improvements and modifications can be made to this application without departing from the principles of this application, and these improvements and modifications also fall within the protection scope of the claims of this application.

[0094] It should also be noted that, in this specification, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

Claims

1. A method for handling serial port hard drive failures, characterized in that, include: Once fault information is detected, the faulty hard drive is identified based on that information. Obtain the status information of the faulty hard drive; Determine whether the status information meets the preset conditions; If the preset conditions are met, a command is sent to the DEVSLP pin of the faulty hard drive to control the link restart of the faulty hard drive; The step of sending a command to the DEVSLP pin of the faulty hard drive includes: Send a standby immediate command to the DEVSLP pin of the faulty hard drive to put the faulty hard drive into a low-power state and restart the communication link between the serial hard drive and the controller; wherein, the simulated link initialization is equivalent to simulating the process of the communication link going from the power-off state to the power-on state. The process of obtaining the status information of the faulty hard drive includes: Read the serial port status register to obtain the status information; The status information includes at least: normal operating status, link initialization status, and low power consumption status; Accordingly, the preset condition is that the status information is in a normal working state; The step of reading the serial port status register to obtain the status information includes: The target address of the serial port status register is read through the interface power management device to obtain the status information.

2. The serial port hard drive fault handling method according to claim 1, characterized in that, After the step of sending a command to the DEVSLP pin of the faulty hard disk, the method further includes: Send a test data packet to the faulty hard drive and obtain the time parameters of the faulty hard drive; The time parameter is used to determine whether the faulty hard drive has entered a low-power state.

3. The serial port hard drive fault handling method according to claim 1, characterized in that, After the step of sending a command to the DEVSLP pin of the faulty hard disk, the method further includes: After the link of the faulty hard drive is restarted, it is determined whether the fault information exists on the faulty hard drive; If the aforementioned fault information exists, the fault information will be sent to maintenance personnel.

4. A serial port hard drive fault handling device, characterized in that, include: The determination module is used to determine the faulty hard drive based on the fault information after the fault information is detected; The acquisition module is used to acquire the status information of the faulty hard drive; The judgment module is used to determine whether the status information meets preset conditions; The instruction sending module is used to send an instruction to the DEVSLP pin of the faulty hard disk if the preset conditions are met, so as to control the link restart of the faulty hard disk; Specifically, the instruction sending module is used to send a standby immediate command to the DEVSLP pin of the faulty hard drive to make the faulty hard drive enter a low-power state and restart the communication link between the serial hard drive and the controller; the simulated link initialization is equivalent to simulating the process of the communication link going from a power-off state to a power-on state. The acquisition module is specifically used to read the serial port status register to obtain the status information; The status information includes at least: normal operating status, link initialization status, and low power consumption status; Accordingly, the preset condition is that the status information is in a normal working state; The acquisition module is specifically used to read the target address of the serial port status register through the interface power management device to obtain the status information.

5. A serial port hard drive fault handling device, characterized in that, Includes memory used to store computer programs; A processor, configured to implement the steps of the serial hard disk fault handling method as described in any one of claims 1 to 3 when executing the computer program.

6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the serial hard disk fault handling method as described in any one of claims 1 to 3.