Hard disk status detection method, system, complex programmable logic device and server

Through complex programmable logic devices, the hard disk status is detected in the PCIe Switch architecture, which solves the problem of difficulty in detecting the hard disk status when the system is powered on, and achieves rapid and timely detection and reporting of the hard disk status.

CN115016996BActive Publication Date: 2024-12-24SHANGHAI EVEX INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210764034.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-30
Publication Date
2024-12-24
Estimated Expiration
2042-06-30

AI Technical Summary

Technical Problem

In a system based on PCIe Switch architecture, it is difficult to fully detect the hard disk status when the system is powered on, especially in the case of poor working conditions, which leads to the inability to sense the hard disk status and the inability to report status.

Method used

The hard disk status detection is performed by using complex programmable logic devices (CPLDs). By receiving notification data from PCIe Switch, it parses and stores it in registers. It sets the time limit to filter other data, monitors the register refresh status, and compares it with preset data. Latch the hard disk status signal to determine the hard disk status.

Benefits of technology

It realizes rapid detection and reporting of the hard disk status when the system is powered on, prevents detection failure caused by excessive working conditions, and ensures that the hard disk status can be sensed and reported in a timely manner.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115016996B_ABST
    Figure CN115016996B_ABST
Patent Text Reader

Abstract

The present invention provides a hard disk status detection method, system, complex programmable logic device and server. In the hard disk status detection method, when the system is detected to be powered on with a disk, the complex programmable logic device receives and analyzes the first notification data sent by the PCIe Switch and stores it in a first register, filters other data sent by the PCIe Switch in a first time period or sends the first notification data multiple times to generate other operations or refreshes on the first register, restores the first register to write data after the timing ends and monitors the refresh state of the first register, compares the first notification data with the preset data when the refresh is generated, receives and latches the status signal when the comparison result is consistent, and determines the status of the hard disk according to the status signal. The complex programmable logic device combines the first notification data and the status signal of the hard disk to determine the status of the hard disk, so as to detect the status of the hard disk when the system is powered on with a disk, and prevents the hard disk status from being unable to be detected due to the inability to complete the polling due to the poor working condition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of hard disk status detection, and in particular to a hard disk status detection method, system, complex programmable logic device and server. Background Art

[0002] At present, in the server or storage field, in order to improve the data transmission rate, major manufacturers have laid out the PCIeSwitch architecture. PCIe Switch technology has been widely used in traditional storage systems, server platforms, etc. The hard disk is the main storage medium in the storage system. The hard disk is equivalent to the warehouse of the computer. The operating system, installed software, documents, and data are all stored in the hard disk. The operation of the software is also to transfer the data into the memory first, the CPU and the memory interact, and the final result is placed in the hard disk. Therefore, the hard disk is one of the important hardware in the storage system, and the hard disk failure needs to be quickly discovered and located to prevent it from affecting the operation of the storage system.

[0003] However, in a PCIe link based on a PCIe Switch architecture, when the system is powered on, the host first initiates a detection action on the EP device, and then the HOST end performs a polling scan and subsequent actions on the PCIe device. For hard disks with different working conditions, it is difficult for the HOST end to fully report the status of the hard disk. When the detection cannot be completed, the HOST end cannot perceive the EP device, and the driver cannot send data streams to report the hard disk status. Therefore, when the working conditions are so bad at system power-on that the detection cannot be completed, how to detect and report the status of the hard disk is a technical problem that technical personnel in this field urgently need to solve. Summary of the invention

[0004] The object of the present invention is to provide a hard disk status detection method, system, complex programmable logic device and server, which can detect the status of the hard disk when the system is powered on.

[0005] In order to achieve the above object, the present invention provides a hard disk status detection method, which is used to detect the hard disk status when a system based on PCIeSwitch is powered on. The hard disk status detection method is executed by a complex programmable logic device, and the complex programmable logic device includes a first register. The hard disk status detection method includes:

[0006] The system is detected to be powered on;

[0007] receiving first notification data sent by the PCIe Switch, parsing the first notification data and storing the first notification data in a first register, wherein the first notification data represents system power-on and reset;

[0008] Stop writing data to the first register for a preset first time period;

[0009] After the first time period ends, resuming writing data into the first register and monitoring the refresh status of the first register;

[0010] When it is monitored that the first register is refreshed, the first notification data is compared with the preset data, and if the comparison results are consistent, a hard disk status signal is received and latched;

[0011] The status of the hard disk is determined according to the status signal.

[0012] Optionally, the complex programmable logic device further includes a second register, and the detecting that the system reel is powered on includes:

[0013] A power-on signal and a hard disk in-place signal indicating that the hard disk is in place are received, and according to the power-on signal and the hard disk in-place signal, a status code in the second register is refreshed and latched, the status code indicating that the system with the hard disk is powered on.

[0014] Optionally, when the comparison result of the first notification data is consistent with the preset data, the status signal of the hard disk is received and latched within a preset second time period.

[0015] Optionally, the complex programmable logic device further includes a fault flag register, and when it is determined that the hard disk is in a fault state according to the status signal, the hard disk fault state information is stored in the fault flag register.

[0016] Optionally, the complex programmable logic device is connected to a baseboard management controller and a status indication module respectively, and the hard disk status detection method further includes:

[0017] Sending the fault status information to the baseboard management controller;

[0018] receiving a control signal sent by the baseboard management controller according to the fault status information;

[0019] The status indication module is controlled according to the control signal to display the fault status of the hard disk.

[0020] In order to achieve the above object, the present invention further provides a complex programmable logic device, comprising:

[0021] Detection module, used to detect whether the system has been powered on;

[0022] A receiving module and a first register, wherein the receiving module is connected to the PCIe Switch and is used to receive first notification data sent by the PCIe Switch, parse the first notification data and store it in the first register, wherein the first notification data represents system power-on and reset;

[0023] A timer, the timer being used to set a first duration for timing, stopping the first register from writing data during the first duration, and resuming the first register from writing data after the first duration ends;

[0024] A monitoring module, the monitoring module is used to monitor the refresh state of the first register after restoring the first register to write data;

[0025] A comparison module, configured to compare the first notification data with preset data when monitoring that the first register is refreshed;

[0026] The status judgment module is used to receive and latch the status signal of the hard disk, and judge the status of the hard disk according to the status signal.

[0027] Optionally, the complex programmable logic device also includes a second register, and the receiving module is further used to receive a power-on signal and a hard disk in place signal indicating that the hard disk is in place, and refresh and latch a status code in the second register based on the power-on signal and the hard disk in place signal, wherein the status code indicates that the system is powered on with the disk.

[0028] Optionally, the complex programmable logic device further includes a fault flag register, and when the status judgment module determines that the hard disk is in a fault state according to the status signal, the hard disk fault state information is stored in the fault flag register.

[0029] In order to achieve the above object, the present invention also provides a hard disk status detection system, comprising the complex programmable logic device as described above, a baseboard management controller and a status indication module, wherein the baseboard management controller is used to receive hard disk fault status information sent by the complex programmable logic device and send a control signal according to the hard disk fault status information;

[0030] The complex programmable logic device controls the status indication module to display the fault status of the hard disk according to the control signal.

[0031] In order to achieve the above-mentioned purpose, the present invention also provides a server, including a host, a PCIe Switch, multiple hard disks and the hard disk status detection system as described above, wherein the host is connected to the PCIe Switch, the PCIeSwitch is connected to the complex programmable logic device, and the multiple hard disks are connected to the PCIe Switch.

[0032] In the hard disk status detection method of the present invention, when it is detected that the system is powered on with a disk, the complex programmable logic device receives the first notification data sent by the PCIe Switch and parses the first notification data and stores it in the first register. After the parsing is completed, the timer is used to set a first duration for timing, and the first register is stopped from writing data during the first duration to filter out other data sent by the PCIe Switch within the first duration or multiple first notification data sent to generate other operations or refreshes on the first register. After the timing is over, the complex programmable logic device resumes writing data to the first register and monitors the refresh status of the first register. When the first register is refreshed, the first notification data is compared with the preset data. If the comparison result is consistent, it means that the system is powered on and the boot is completed. The host performs read and write operations on the hard disk through the PCIe Switch to cause the hard disk status signal to jump. The complex programmable logic device receives and latches the hard disk status signal, and determines the hard disk status according to the latched status signal. The first notification data sent by the PCIe Switch is parsed through a complex programmable logic device, and the hard disk status is judged in combination with the first notification data sent by the PCIe Switch and the status signal of the hard disk, so that the hard disk status can be detected when the system is powered on with the disk, to prevent the hard disk status from being unable to be detected and reported due to the inability to complete polling due to poor working conditions. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 It is a flow chart of a hard disk status detection method according to an embodiment of the present invention.

[0034] Figure 2 This is a partial flow chart of the hard disk status detection method according to an embodiment of the present invention.

[0035] Figure 3 It is a module diagram of the server according to an embodiment of the present invention.

[0036] Figure 4 It is a module diagram of a complex programmable logic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0037] In order to explain the technical content, structural features and achieved effects of the present invention in detail, the following is a detailed description in conjunction with the implementation modes and the accompanying drawings.

[0038] like Figure 1 As shown, an embodiment of the present invention discloses a hard disk status detection method, which is used to detect the hard disk status when a system based on PCIeSwitch is powered on. The hard disk status detection method is executed by a complex programmable logic device (CPLD), and the complex programmable logic device includes a first register. The hard disk status detection method includes:

[0039] S110: Detect that the system reel is powered on.

[0040] In the embodiment of the present invention, system power-on with disk means "the hard disk has been inserted into the slot before the system is powered on", and the complex programmable logic device receives a power-on signal and a hard disk in-place signal indicating that the hard disk is in place, and refreshes and latches a status code in the second register of the complex programmable logic device according to the power-on signal and the hard disk in-place signal indicating that the hard disk is in place, and the status code indicates that the system power-on with disk.

[0041] When the hard disk presence signal indicates that the hard disk is in place, when the effective edge (such as the rising edge or the falling edge) of the PERST signal or the PWREN signal (that is, the power-on signal) is generated, the system is powered on with the disk, which makes it easier for the complex programmable logic device to determine whether the system is powered on with the disk.

[0042] It is understandable that the hard disk presence signal can indicate that the hard disk is in place, or it can indicate that the hard disk is not in place. For example, when the hard disk presence signal is "1", it indicates that the hard disk is in place, and when the hard disk presence signal is "0", it indicates that the hard disk is not in place. Similarly, the status code in the second register can indicate whether the system is powered on or idle with the disk. For example, when the status code is "00", it indicates that the system is idle (the system can be powered off, not powered on, the disk is unplugged, or powered on without a disk), and when the status code is "01", it indicates that the system is powered on with the disk. When the complex programmable logic device receives a power-on signal and a hard disk presence signal indicating that the hard disk is in place, the status code in the second register can be refreshed from "00" to "01" and the status code "01" can be latched.

[0043] S120, receiving first notification data sent by the PCIe Switch, parsing the first notification data and storing the first notification data in a first register, where the first notification data represents system power-on and reset.

[0044] In the embodiment of the present invention, according to the characteristics of the PCIe Switch, after power-on, the PCIe Switch will scan the IO Expand interface of the complex programmable logic device through the SHP interface connected to the complex programmable logic device, first obtain the hard disk presence signal of the corresponding slot, if the hard disk is in place, then confirm whether the configuration information of the corresponding IO Expand interface is consistent with the preset configuration information, when the configuration information is consistent with the preset configuration information, the PCIe Switch will send some data to the complex programmable logic device, and finally stabilize to a data, which is the first notification data, after the PCIe Switch sends the first notification data, it temporarily stops sending data to the complex programmable logic device. Generally speaking, when the system is powered on, due to the initialization of devices such as UPI / MEM, the CPU of the system may actively perform hot plugging actions, at this time, the system will jump to the initial state, the data stored in the complex programmable logic device will be cleared, and when it is powered on again, the hard disk status detection will be performed again from step S110. It can be understood that the first notification data can be a data code, for example, when the first notification data is 0x16, it represents system power-on and system reset.

[0045] S130, stopping writing data into the first register for a preset first time period.

[0046] S140: After the first time period ends, resume writing data into the first register and monitor the refresh status of the first register.

[0047] During the timing with the first duration, the data sent by the PCIe Switch will be continuously reset when powered on, and other data other than the first notification data will be issued or the first notification data will be issued multiple times. By stopping the writing of data to the first register at the first duration, other data sent by the PCIe Switch during this process or the multiple issuance of the first notification data can be filtered to generate other operations or refreshes on the first register. After the timing with the first duration ends, the PCIe Switch will no longer issue data that will generate other operations or refreshes on the first register, and the refresh of the first register will not be generated until the system is powered on and booted up. Therefore, after the timing of the first duration ends, the complex programmable logic device resumes writing data to the first register and monitors the refresh status of the first register. Among them, the first duration can be set to 20S, 15S, etc., and the first duration is set according to system performance.

[0048] It can be understood that, in step S130, "stop writing data to the first register for the first time period" can mean that the complex programmable logic device receives data sent by the PCIe Switch, but does not process the data or write it into the first register; it can also mean that the complex programmable logic device pauses receiving data sent by the PCIe Switch, thereby not writing data to the first register.

[0049] S150, when it is monitored that the first register is refreshed, the first notification data is compared with the preset data, and if the comparison results are consistent, a status signal (active signal) of the hard disk is received and latched.

[0050] It should be noted that the preset data is the data code corresponding to the system power-on and reset. Whether the system has been powered on and booted up is determined by comparing whether the first notification data is the same as the preset data. For example, if the preset data is 0x16, whether the system has been powered on and booted up is determined by comparing whether the first notification data is 0x16. When the system is powered on and booted up, the host will generate data interaction with the hard disk through the PCIe Switch, and the PCIe Switch will generate read and write operations on the hard disk. When the hard disk is normal, the read and write operations on the hard disk will cause the hard disk status signal to jump. When the comparison result of the complex programmable logic device comparing the first notification data and the preset data is consistent, the complex programmable logic device knows that the system has been powered on and booted up, and can receive the hard disk status signal. In fact, when the first register is monitored to be refreshed, the system is powered on and booted up. However, in order to ensure that the refresh generated by the first register is generated after the system is powered on and booted up, the first notification data and the preset data are compared to ensure that the first register is refreshed after the system is powered on and booted up.

[0051] It should be noted that, in the embodiment of the present invention, it is not the case that the PCIe Switch performs a read / write operation on the hard disk to cause the hard disk status signal to jump only when the complex programmable logic device compares the first notification data to be consistent with the preset data. Instead, when the system is powered on and booted up, the PCIe Switch will perform data interaction with the hard disk to generate a read / write operation. When the system is powered on and booted up, the first notification data will be consistent with the preset data. Therefore, the complex programmable logic device determines whether the system is powered on and booted up by comparing the first notification data with the comparison data to see if they are consistent.

[0052] It is understandable that the complex programmable logic device may also include a data buffer. When the complex programmable logic device monitors that the first register is refreshed, the first notification data stored in the first register may be stored in the data buffer, and the first notification data stored in the data buffer may be compared with the preset data.

[0053] S160: Determine the status of the hard disk according to the status signal.

[0054] The latched status signal is analyzed and judged. When the status signal has a jump, it is considered that the hard disk is working normally. When the status signal has no jump, it is considered that the hard disk is abnormal. The jump of the status signal can be a jump from a high level to a low level or from a low level to a high level. For example, the status signal has a jump from "1" to "0" or from "0" to "1".

[0055] In the hard disk status detection method of the embodiment of the present invention, when it is detected that the system is powered on with a disk, the complex programmable logic device receives the first notification data sent by the PCIe Switch and parses the first notification data and stores it in the first register. After the parsing is completed, the timer is used to set a first duration for timing, and the first register is stopped from writing data within the first duration to filter out other data sent by the PCIe Switch or multiple first notification data sent during the first duration to generate other operations or refreshes on the first register. After the timing is over, the complex programmable logic device resumes writing data to the first register and monitors the refresh status of the first register. When the first register is refreshed, the first notification data is compared with the preset data. If the comparison result is consistent, it means that the system is powered on and the boot is completed. The host performs read and write operations on the hard disk through the PCIe Switch to cause the hard disk status signal to jump. The complex programmable logic device receives and latches the hard disk status signal, and determines the hard disk status according to the latched status signal. The first notification data sent by the PCIe Switch is parsed through a complex programmable logic device, and the hard disk status is judged in combination with the first notification data sent by the PCIe Switch and the status signal of the hard disk, so that the hard disk status can be detected when the system is powered on with the disk, to prevent the hard disk status from being unable to be detected and reported due to the inability to complete polling due to poor working conditions.

[0056] It should be noted that the above-mentioned system refers to a server system, a storage system, a computer system, and other systems that require a hard disk for data storage; when the system is powered on, the HOST end of the PCIe Switch will restart three times, and after each restart, all related data (such as the first notification data, the status signal) will be cleared, and the hard disk status detection will be restarted from step S110. When the restart interval is greater than the first time length, the first time length timing will end and the step S140 will be entered to monitor the refresh status of the first register. After the first time length, the PCIe Switch will no longer send data that will generate other operations or refresh operations on the first register, and the first register will not be refreshed until the system is powered on and booted up after the first time length (that is, after three restarts). Therefore, even if the restart interval is greater than the first time length, the subsequent steps will not be executed.

[0057] In some specific examples, in order to facilitate the latching and judgment of status signals and prevent the reception of status signals for too long, after the comparison results of the first notification data and the preset data are consistent, the status signal of the hard disk can be received and latched within a preset second time period, and the status of the hard disk can be judged based on the status signal latched during the second time period.

[0058] In order to facilitate technicians to obtain the fault status of the hard disk, the complex programmable logic device can also include a fault flag register. When the hard disk is judged to be in a fault state according to the status signal, the hard disk fault status information is stored in the fault flag register, thereby saving the hard disk fault status information.

[0059] It can be understood that the fault mark register is not limited to storing the fault status information of the hard disk, but can also store the normal status information of the hard disk. For example, the fault mark register can store the status signal of the hard disk. The status signal can represent different states of the hard disk by setting different data codes. According to the detected hard disk status, the corresponding data code is stored in the fault mark register. When the hard disk fault status needs to be obtained, the data code can be read from the fault mark register, and the status of the hard disk can be obtained according to the data code.

[0060] like Figure 2 As shown, in order to facilitate the staff to obtain the status of the hard disk in time, the complex programmable logic device is connected to the baseboard management controller (BMC) and the status indication module respectively, and the hard disk status detection method also includes:

[0061] S170: Send the hard disk failure status information to the baseboard management controller.

[0062] In order to receive hard disk fault information in time, the fault mark register storing hard disk fault status information may be opened to the baseboard management controller. When a hard disk fails, the baseboard management controller may obtain the fault information in time.

[0063] S180: Receive a control signal sent by a baseboard management controller according to the fault status information.

[0064] S190, controlling the status indication module to display the fault status of the hard disk according to the control signal.

[0065] The status indication module is controlled by a control signal to indicate the fault status of the hard disk. The staff can check the status indication module to know whether the hard disk has a fault, so that the fault can be handled in time. In a specific example, the status indication module can be an LED light, and each hard disk can correspond to an LED light. The LED light turns on and off according to the control signal to indicate the status of the hard disk. For example, the control signal can be the same as the status signal, so that the LED light flashes according to the status signal. When the hard disk is normal, the status signal will jump, and the LED light will flash according to the status signal; when the hard disk is abnormal, the status signal will not jump, and the LED light will be always on or off according to the status signal. Of course, the status indication module of the embodiment of the present invention is not limited to the above-mentioned LED light, and can also be other devices with an indicating function, such as a display, etc., which can display the status of the hard disk according to the control signal.

[0066] See also Figure 3 and Figure 4 The embodiment of the present invention further provides a complex programmable logic device 10, including a detection module 11, a receiving module 12, a first register 13, a timer 14, a monitoring module 15, a comparison module 16 and a state judgment module 17, wherein the detection module 11 is used to detect that the system has been powered on with a disk; the receiving module 12 is connected to the PCIe Switch, and is used to receive the first notification data issued by the PCIe Switch, parse the first notification data and store it in the first register 13, wherein the first notification data represents the power-on and reset of the system; the timer 14 is used to set a first duration for timing, stop the first register 13 from writing data during the first duration, and resume writing data to the first register 13 after the first duration ends; the monitoring module 15 is used to monitor the refresh state of the first register 13 after resuming the writing of data to the first register 13; the comparison module 16 is used to compare the first notification data with the preset data when monitoring that the first register 13 is refreshed; the state judgment module 17 is used to receive and latch the state signal of the hard disk, and judge the state of the hard disk according to the state signal.

[0067] Furthermore, in order to facilitate the latching and judgment of the status signal and prevent the receiving status signal from being too long, after the comparison result of the first notification data and the preset data is consistent, the second duration can be set using a timer for timing, the status signal of the hard disk is received and latched during the second duration, and the status of the hard disk is judged based on the status signal latched during the second duration.

[0068] It should be noted that the same timer 14 can be reused to set the first duration and the second duration for timing respectively; the timer 14 can also include a first timer and a second timer, the first timer sets the first duration for timing, and the second timer sets the second duration for timing.

[0069] It is understandable that each module in the complex programmable logic device 10 in the embodiment of the present invention may be electronic hardware, computer program or a combination of the two. The first register 13 may be a PCA9555 chip integrated in the complex programmable logic device 10 .

[0070] In some specific examples, the complex programmable logic device 10 also includes a second register (not shown), and the receiving module 11 is also used to receive a power-on signal and a hard disk in place signal indicating that the hard disk is in place, and refresh and latch the status code in the second register according to the power-on signal and the hard disk in place signal indicating that the hard disk is in place. The status code indicates that the system is powered on with the disk, which facilitates the complex programmable logic device 10 to determine whether the system is powered on with the disk.

[0071] In order to facilitate technicians to obtain the fault status of the hard disk, the complex programmable logic device 10 also includes a fault flag register. When the status judgment module 17 judges that the hard disk is in a fault state according to the status signal, the hard disk fault state information is stored in the fault flag register.

[0072] like Figure 3 As shown, in order to facilitate the staff to obtain the hard disk status in time, the embodiment of the present invention also provides a hard disk status detection system 1, including the complex programmable logic device 10, the baseboard management controller 20 and the status indication module 30 as described above, the baseboard management controller 20 is used to receive the hard disk fault status information sent by the complex programmable logic device 10 and send a control signal according to the hard disk fault status information; the complex programmable logic device 10 controls the status indication module 30 to display the hard disk fault status according to the control signal. Specifically, the baseboard management controller 20 can read the hard disk fault status information stored in the fault flag register, and then send a control signal according to the hard disk fault status information read.

[0073] like Figure 3 As shown, an embodiment of the present invention further provides a server, including a host 2 (CPU), a PCIe Switch 40, multiple hard disks 3 and the hard disk status detection system 1 as described above, the host 2 is connected to the PCIe Switch 40, the PCIe Switch 40 is connected to the complex programmable logic device 10, and the multiple hard disks 3 are connected to the PCIe Switch 40.

[0074] It is understandable that the hard disk 3 can be connected to the PCIe Switch 40 via a hard disk connector, and some control signal interfaces (such as up and down power signals, in-position signals, status signals, etc.) of the hard disk 3 can be connected to the complex programmable logic device 10.

[0075] The above disclosure is only a preferred embodiment of the present invention, which is intended to facilitate the understanding and implementation of the present invention by those skilled in the art. It certainly cannot be used to limit the scope of rights of the present invention. Therefore, equivalent changes made according to the scope of the patent application of the present invention still fall within the scope covered by the present invention.

Claims

1. A hard disk status detection method is used to detect the hard disk status of a system based on a PCIe Switch when it is powered on, characterized in that: The hard disk status detection method is executed by a complex programmable logic device, the complex programmable logic device includes a first register, and the hard disk status detection method includes: Detect that the system disk is powered on; receiving first notification data sent by the PCIe Switch, parsing the first notification data and storing the first notification data in a first register, wherein the first notification data represents system power-on and reset; Stop writing data to the first register for a preset first time period; After the first time period ends, the writing of data to the first register is resumed and the refresh status of the first register is monitored, and the PCIe Switch no longer sends data that will generate other operations or refresh operations on the first register; When it is monitored that the first register is refreshed, the first notification data is compared with the preset data, and if the comparison result is consistent, the hard disk status signal is received and latched, wherein the preset data is the data code corresponding to the system power-on and reset; The status of the hard disk is determined according to the status signal.

2. The hard disk status detection method according to claim 1, characterized in that: The complex programmable logic device further includes a second register, and the detecting that the system reel is powered on includes: A power-on signal and a hard disk in-place signal indicating that the hard disk is in place are received, and a status code in the second register is refreshed and latched according to the power-on signal and the hard disk in-place signal, wherein the status code indicates that the system is powered on with the hard disk.

3. The hard disk status detection method according to claim 1, characterized in that: When the comparison result of the first notification data is consistent with the preset data, the status signal of the hard disk is received and latched for a preset second time period.

4. The hard disk status detection method according to claim 1, characterized in that: The complex programmable logic device also includes a fault flag register. When the hard disk is judged to be in a fault state according to the state signal, the hard disk fault state information is stored in the fault flag register.

5. The hard disk status detection method according to claim 4, characterized in that: The complex programmable logic device is connected to the baseboard management controller and the status indication module respectively, and the hard disk status detection method further includes: Sending the fault status information to the baseboard management controller; receiving a control signal sent by the baseboard management controller according to the fault status information; The status indication module is controlled according to the control signal to display the fault status of the hard disk.

6. A complex programmable logic device, characterized in that: include: Detection module, used to detect whether the system has been powered on; A receiving module and a first register, wherein the receiving module is connected to the PCIe Switch and is used to receive first notification data sent by the PCIe Switch, parse the first notification data and store it in the first register, wherein the first notification data represents system power-on and reset; A timer, wherein the timer is used to set a first duration for timing, stop writing data to the first register during the first duration, and resume writing data to the first register after the first duration ends, and the PCIe Switch no longer sends data that will generate other operations or refresh operations on the first register; A monitoring module, the monitoring module is used to monitor the refresh state of the first register after restoring the first register to write data; A comparison module, wherein when it is monitored that the first register is refreshed, the comparison module is used to compare the first notification data with preset data, wherein the preset data is a data code corresponding to system power-on and reset; The status judgment module is used to receive and latch the status signal of the hard disk, and judge the status of the hard disk according to the status signal.

7. The complex programmable logic device according to claim 6, characterized in that: The complex programmable logic device also includes a second register, and the receiving module is also used to receive a power-on signal and a hard disk in place signal indicating that the hard disk is in place, and refresh and latch the status code in the second register according to the power-on signal and the hard disk in place signal, and the status code indicates that the system is powered on with the disk.

8. The complex programmable logic device according to claim 6, characterized in that: The complex programmable logic device also includes a fault flag register. When the state judgment module determines that the hard disk is in a fault state according to the state signal, the hard disk fault state information is stored in the fault flag register.

9. A hard disk status detection system, characterized in that: It comprises the complex programmable logic device according to claim 8, a baseboard management controller and a status indication module, wherein the baseboard management controller is used to receive hard disk fault status information sent by the complex programmable logic device and send a control signal according to the hard disk fault status information; The complex programmable logic device controls the status indication module to display the fault status of the hard disk according to the control signal.

10. A server, characterized in that: It includes a host, a PCIe Switch, multiple hard disks and the hard disk status detection system as described in claim 9, the host is connected to the PCIe Switch, the PCIe Switch is connected to the complex programmable logic device, and the multiple hard disks are connected to the PCIe Switch.