Hard disk detection method and device, electronic equipment and storage medium

By expanding the hard disk detection range to the link hardware system, accurately locate the reasons for the degradation of hard disk performance, solving the problem of degradation of the sub-health status of the hard disk, and improving system stability and troubleshooting efficiency.

CN120508462APending Publication Date: 2025-08-19JINAN INSPUR DATA TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510684960.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-26
Publication Date
2025-08-19

AI Technical Summary

Technical Problem

In the prior art, only hard disks are detected, and it is impossible to find the impact of other hardware problems on hard disk performance of the disk link, resulting in a decrease in the sub-health status of the hard disk, a decrease in system performance and a worse user experience.

Method used

By obtaining the detection information of the hard disk, determine whether there is an abnormality in the link hardware, and generate a link hardware abnormal alarm when the abnormality is abnormal, expand the detection range to the entire link hardware system, and accurately locate the fault source.

Benefits of technology

Accurately locate the fault source, reduce the risk of system performance degradation and worse user experience, and improve troubleshooting efficiency and system stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120508462A_ABST
    Figure CN120508462A_ABST
Patent Text Reader

Abstract

The invention discloses a hard disk detection method and device, electronic equipment and a storage medium, and relates to the technical field of computers, and the method comprises the steps: determining whether the link hardware of a to-be-detected hard disk is abnormal when the detection information of the to-be-detected hard disk is detected to be abnormal, and generating a link hardware abnormality alarm when the link hardware is abnormal, the detection range is expanded from a single hard disk to the whole link hardware system associated with the single hard disk, so that the problem that the performance of the hard disk is reduced due to the abnormal link hardware can be accurately identified, and the situation that the hard disk problem is misjudged as a pure hard disk fault due to neglecting the link hardware fault is avoided. Therefore, the technical problem that in the prior art, only a hard disk is detected, and other hardware problems of a disk link cannot be found to affect the hard disk can be solved, the purposes of accurately positioning a fault source, giving an alarm in time and reducing the risks of system performance reduction, poor user experience and the like caused by link hardware abnormity are achieved, and the user experience is improved. And the system stability and the troubleshooting efficiency are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a hard disk detection method, device, electronic device, and storage medium. Background Art

[0002] Disk sub-health is a slow-failure state where the disk is still running and functioning normally, but in a degraded state, with performance below expectations. This state can lead to a poor user experience, increased latency, and even trigger a cascading effect, affecting the performance and availability of the entire system.

[0003] Currently, the detection of hard disk sub-health usually only detects the hard disk, but when there are problems with other hardware in the disk link, the hard disk will also be affected. Summary of the Invention

[0004] The present application provides a hard disk detection method, device, electronic device and storage medium to at least solve the problem in the related art that the detection of hard disk sub-health is usually only performed on the hard disk.

[0005] This application provides a hard disk detection method, including:

[0006] Get the detection information of the hard disk to be detected;

[0007] When it is determined that the detection information is abnormal, determining whether the link hardware of the hard disk to be detected is abnormal;

[0008] When an abnormality occurs in the link hardware, a link hardware abnormality alarm is generated.

[0009] The present application also provides a hard disk detection device, comprising:

[0010] A first acquiring unit, configured to acquire detection information of the hard disk to be detected;

[0011] a determining unit, configured to determine whether a link hardware of the hard disk to be detected has an abnormality when it is determined that the detection information has an abnormality;

[0012] The first generating unit is configured to generate a link hardware abnormality alarm when an abnormality occurs in the link hardware.

[0013] The present application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the steps of any one of the above-mentioned XX methods when executing the computer program.

[0014] The present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned hard disk detection methods are implemented.

[0015] The present application also provides a computer program product, including a computer program, which implements the steps of any of the above-mentioned hard disk detection methods when executed by a processor.

[0016] Through this application, when an abnormality is detected in the detection information of the hard disk to be tested, it is determined whether the link hardware of the hard disk to be tested has an abnormality. When the link hardware has an abnormality, a link hardware abnormality alarm is generated, and the detection range is expanded from a single hard disk to the entire link hardware system associated with it. It can accurately identify the problem of hard disk performance degradation caused by link hardware abnormality, and avoid misjudging the hard disk problem as a simple hard disk fault due to ignoring the link hardware failure. Therefore, it can solve the technical problem of only detecting the hard disk in the existing technology and failing to discover the impact of other hardware problems in the disk link on the hard disk. It can achieve the technical effect of accurately locating the fault source, issuing a timely alarm, reducing the risk of system performance degradation and poor user experience caused by link hardware abnormality, and improving system stability and troubleshooting efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0018] Figure 1 A flowchart of a hard disk detection method provided by an embodiment of the present disclosure;

[0019] Figure 2 A schematic diagram of an overall process provided by an embodiment of the present application;

[0020] Figure 3 A schematic diagram of an overall architecture provided by an embodiment of the present application;

[0021] Figure 4 A schematic diagram of a link and hardware information collection logic provided in an embodiment of the present application;

[0022] Figure 5 A flowchart of another hard disk detection method provided in an embodiment of the present application;

[0023] Figure 6 A schematic structural diagram of a hard disk detection device provided in an embodiment of the present application;

[0024] Figure 7 A schematic structural diagram of another hard disk detection device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0025] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0026] It should be noted that, in the description of this application, the terms "comprises," "includes," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. The terms "first," "second," etc., in this application are used to distinguish similar objects, and are not used to describe a particular order or sequence.

[0027] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.

[0028] The embodiment of the present application provides a hard disk detection method. Figure 1 A flowchart of a hard disk detection method provided in an embodiment of the present application is provided.

[0029] like Figure 1 As shown, the method comprises the following steps:

[0030] Step 101: Acquire detection information of the hard disk to be detected.

[0031] In some embodiments, the operating data of the hard disk to be tested is collected by collaborating with the hardware protocol layer and the system software layer to construct a multi-dimensional detection data set. For example, based on the hard disk interface type, the corresponding underlying protocol is called to obtain basic status data such as the Small Computer System Interface (SCSI) protocol and the Advanced Technology Attachment (ATA) protocol. After the collection is completed, all collected data is structured and stored according to the timestamp and the device's unique identifier (such as the WWN World Wide Name), forming a detection information set that includes basic device attributes, health status, performance, and system interaction records, providing a standardized input data source.

[0032] Step 102: When it is determined that the detection information has an abnormality, it is determined whether the link hardware of the hard disk to be detected has an abnormality.

[0033] When the hard disk detection information to be detected obtained in step 101 (such as disk intelligent parameters, IO performance indicators, etc.) is abnormal, the system will start the link hardware abnormality detection process, and perform multi-dimensional verification of the communication link and related components (such as connecting cables, expansion devices, bus interfaces, etc.) between the hard disk and the host. By analyzing key factors such as the physical connection status of the link, signal transmission quality, and protocol interaction stability, it is determined whether the link hardware has potential faults that may cause hard disk abnormalities (such as connection interruption, rate degradation, bit error rate exceeding the standard, etc.), providing key basis for the subsequent accurate generation of hardware abnormality alarms or further hard disk sub-health assessments.

[0034] Step 103: If the link hardware is abnormal, generate a link hardware abnormality alarm.

[0035] In some embodiments, structured alarm information can be automatically generated based on the anomaly type (e.g., physical layer cable disconnection, protocol layer rate degradation, device layer controller failure) and impact scope (e.g., single hard drive link interruption, expander cascading failure, global PCIe bus anomaly). This information includes the precise timestamp of the fault occurrence, the hardware topology path, anomaly indicator threshold comparison, and a prediction of the fault's development trend. Furthermore, a multi-channel collaborative push mechanism can be used to distribute alarm information to operations and maintenance personnel in real time. Prompt-level alarms (e.g., a minor link rate degradation) are displayed on the monitoring platform dashboard and via email. Warning-level alarms (e.g., a sustained increase in the bit error rate on an expander port) receive SMS notifications. Critical alarms (e.g., a physical bus connection interruption) trigger an audible and visual alarm in the computer room and are simultaneously pushed to mobile operations and maintenance terminals. Furthermore, the system automatically links to the configuration management database (CMDB), providing the alarm with a list of affected business systems (e.g., "I / O throughput of the production database is affected by approximately 40%) and a predefined emergency response plan (e.g., "Please check the cable connection within 30 minutes. If not, switch to the backup link").

[0036] In some embodiments, knowledge cards containing historical exception records and similar fault solutions can also be generated for reference by operation and maintenance personnel, forming a closed-loop management system from fault discovery to root cause location, ensuring that hardware anomalies can be effectively handled in the shortest time possible, and reducing the risk of data loss and business interruption losses caused by link failures.

[0037] Through this application, when an abnormality is detected in the detection information of the hard disk to be tested, it is determined whether the link hardware of the hard disk to be tested has an abnormality. When the link hardware has an abnormality, a link hardware abnormality alarm is generated, and the detection range is expanded from a single hard disk to the entire link hardware system associated with it. It can accurately identify the problem of hard disk performance degradation caused by link hardware abnormality, and avoid misjudging the hard disk problem as a simple hard disk fault due to ignoring the link hardware failure. Therefore, it can solve the technical problem of only detecting the hard disk in the existing technology and failing to discover the impact of other hardware problems in the disk link on the hard disk. It can achieve the technical effect of accurately locating the fault source, issuing a timely alarm, reducing the risk of system performance degradation and poor user experience caused by link hardware abnormality, and improving system stability and troubleshooting efficiency.

[0038] In some embodiments, after determining whether the link hardware of the hard disk to be detected is abnormal, the method further includes:

[0039] When there is no abnormality in the link hardware, obtaining link statistical information;

[0040] When it is determined that the number of abnormalities in the link statistical information exceeds a preset threshold, a sub-health alarm of the hard disk to be detected is generated.

[0041] After confirming the link hardware anomaly detection and determining that there is no anomaly in the link hardware, perform in-depth analysis of the link statistical information: collect fine-grained operation data of the link layer, including but not limited to the physical layer signal quality (such as bit error rate fluctuation trend, signal attenuation value), protocol layer interaction efficiency (such as command retry frequency, data retransmission ratio) and performance indicator stability (such as bandwidth utilization variance, response delay jitter coefficient), and construct a multi-dimensional statistical feature vector; by comparing historical baseline data with real-time collection values, use anomaly detection algorithms (such as isolation forest, time series prediction model) to identify anomalies in statistical indicators; when the number of detected anomalies exceeds the preset threshold value that is dynamically adjusted based on business importance and hardware life cycle (such as the critical business hard disk threshold is set to 5 times / hour, and ordinary storage devices are 15 times / hour), a sub-health alarm will be generated, which is different from a hardware failure.

[0042] In some embodiments, obtaining detection information of the hard disk to be detected includes:

[0043] Obtain disk intelligence information, disk input and output information, and link hardware information of the hard disk to be detected.

[0044] In some embodiments, the acquisition of detection information of the hard disk to be detected specifically includes collecting multi-source data from three dimensions: obtaining disk intelligence information, covering hard disk physical health parameters (such as bad sector reallocation count, unrepairable sector count, operating temperature), life indicators (such as power-on time, total SSD write bytes) and firmware status, etc. For example, when the seek error rate of the mechanical hard disk (HDD) continues to increase or the reserved erase and write life of the solid-state drive (SSD) is less than 20%, an abnormality is marked; the monitoring interface collects disk input and output information, including throughput (sequential / random read and write bandwidth), input and output operations per second (Input / Output Operations Per Second), and the like. Second, IOPS), response delay, queue depth utilization and other real-time performance indicators, such as when random write IOPS drops by 30% compared to the baseline or when the read latency P99 exceeds 2 times the manufacturer's specification, a performance anomaly warning is triggered; link hardware information is obtained through hardware management interface and protocol analysis, including the connection parameters between the hard disk and the host (such as SATA / SAS link rate, Peripheral Component Interconnect Express (PCIe) channel width), expander port status (communication link bit error rate, temperature) and controller status (RAID card firmware compatibility, cache hit rate), etc. For example, when the SAS link rate is degraded from 12Gbps to 6Gbps or the PCIe link training state machine frequently jumps abnormally, link transmission risks are recorded. By integrating the above three types of information, a multi-dimensional detection data set including hard disk media health, IO performance and link transmission quality is formed, providing comprehensive data support for subsequent anomaly judgment.

[0045] In some embodiments, when it is determined that the detection information has an abnormality, determining whether the link hardware of the hard disk to be detected has an abnormality includes:

[0046] When it is determined that the number of abnormalities in the disk intelligence information of the hard disk to be detected is greater than a first preset abnormality threshold; or

[0047] When it is determined that the number of abnormalities in the disk input and output information of the hard disk to be detected is greater than a second preset abnormality threshold, it is determined whether abnormal information exists in the link hardware information.

[0048] The method of determining whether there is an abnormality in the link hardware of the hard disk to be detected when determining that there is an abnormality in the detection information is specifically: when the disk intelligent information of the hard disk to be detected (such as the bad sector reallocation count, the number of unrepairable sectors, the operating temperature, etc. in the SMART data) is counted through a sliding time window (such as 1 minute), the number of abnormal indicators (such as the number of HDD reallocated sectors increased by more than 5 within 1 hour, the SSD reserved erase and write life is less than 30% and the write amplification factor is greater than 3, etc.) exceeds the first preset abnormality threshold set for different hard disk types (such as 3 times for enterprise-level HDD and 2 times for SSD), or when the disk input and output information (such as throughput, IOPS, response delay, etc.) is counted through real-time performance monitoring, the number of abnormal events (such as the sequential read bandwidth suddenly drops to below 50% of the baseline value and lasts for 5 minutes, the random write IOPS drops by 40% and is accompanied by queue depth exceeding the limit, etc.) exceeds When the second preset abnormality threshold set according to the business load (such as 2 times in high-frequency trading scenarios and 5 times in normal scenarios) is set, the link hardware abnormality detection process is triggered; at this time, the system will verify the SATA / SAS cable connection status and measure the PCIe link signal integrity through the hardware management interface, analyze the link rate and error count of the Expander expander port, analyze the PCIe link training state machine log and the firmware compatibility and instruction error rate of the RAID / NVMe controller. If it is detected that the physical connection is interrupted, the link rate is degraded to below 50% of the nominal value, the PHY layer bit error rate is continuously higher than 1e-10, the Expander controller temperature exceeds the limit, or the controller has a fatal error, the link hardware is determined to be abnormal, thereby realizing the correlation detection from individual hard drive performance degradation to link system failure, avoiding fault location deviation caused by single-dimensional abnormalities.

[0049] In some embodiments, obtaining disk intelligence information, disk input / output information, and link hardware information of the hard disk to be detected includes:

[0050] Obtaining link and topology information between the processor and the hard disk to be detected;

[0051] At least one of a link rate, a link status, a number of link physical channels, and a link physical channel change count between the processor and the hard disk to be detected is obtained based on a first preset time interval.

[0052] Obtain the disk intelligence information, disk input and output information and link hardware information of the hard disk to be detected, specifically including: first, obtaining the physical link connection information (such as SATA / SAS controller port number, PCIe slot position) and topology structure (such as whether the hard disk is cascaded through an Expander, the hierarchical relationship of the RAID controller) between the processor and the hard disk to be detected through the system management bus (such as IPMI, SMBus) or hardware abstraction layer interface, and building a hardware connection mapping table; at the same time, based on a first preset time interval (such as 10 seconds), periodically collecting key link layer parameters, including but not limited to: reading the link negotiation rate (such as PCIe 100) through the PCIe configuration space register; The system monitors the 16GT / s in 4.0x16) and the current status of the link state machine (LTSSM) (such as L0 active status or recovery status). It obtains the actual operating rate of the SAS / SATA link (such as 12Gbps or 6Gbps after degradation) through the SCSI management protocol. It reads the number of valid physical channels (such as the actual number of available x8 channels of a PCIe link) and the channel status change count (reflecting the frequency of link training failure or renegotiation) from the physical layer controller. It stores the above multi-dimensional data in time series to form a dynamic monitoring data set for the link hardware status, providing real-time and complete physical layer and protocol layer parameter basis for subsequent anomaly judgment.

[0053] In some embodiments, determining whether the link hardware of the hard disk to be detected is abnormal includes:

[0054] At least one of disk array abnormality information, expander abnormality information, and peripheral component interconnect standard high-speed serial bus abnormality information in the system log is obtained and recorded based on a second preset time interval.

[0055] Based on the second preset time interval (such as 5 minutes), the system log parsing task is periodically executed, and the hardware exception records in the kernel log are obtained through the operating system log interface (such as Linux's `journalctl` or Windows's Event Viewer); for the storage subsystem, the log entries containing keywords such as "disk array", "expander", and "PCIe bus" are extracted and analyzed, specifically including: identifying the exception information generated by the disk array controller (such as "unrecoverable media error" and "array degradation"), recording the time when the error occurred, the affected physical drive number and the error type; for expander-related logs, the port link status changes (such as "link disconnection" and "rate negotiation failure") and the physical layer error count are parsed, and the expander number and port location where the exception occurred are associated; for PCIe bus exceptions, bus transaction errors (such as "end-to-end verification failure"), link training failure events (such as "entering recovery state") and accidental device disconnection are analyzed, and the relevant device identification information is recorded; the above-mentioned parsed exception information is stored in the database in chronological order, and a statistical report containing the exception type, impact range, and occurrence frequency is generated at the same time, providing time series correlation data support for subsequent fault cause analysis.

[0056] In some embodiments, generating a sub-health alarm for the hard disk to be detected further includes:

[0057] The health status of the hard disk to be detected is determined, and a sub-health alarm of a corresponding alarm state is generated according to the health status of the hard disk to be detected; wherein, the sub-health alarm mode and alarm level of different alarm states are different.

[0058] When the system determines that the hard disk to be tested is in a sub-healthy state through multi-dimensional indicator evaluation, a sub-healthy alarm corresponding to the alarm state will be generated based on the preset health score model. This model integrates disk intelligence information (such as the reallocated sector count and remaining life percentage in the SMART parameters), disk input and output information (such as IOPS fluctuation range, latency percentile) and link statistical information (such as bit error rate trend, link training frequency), calculates the health index through a weighted algorithm and divides it into three levels: Level 1 sub-health (health index 70-85 points) is manifested as individual indicators approaching the threshold (such as the remaining life of the SSD drops to 35%), triggering a yellow warning, and notifying the operation and maintenance personnel through flashing on the monitoring platform dashboard and email, and recommends performing basic tests (such as SMART self-diagnosis). Level 2 sub-health (index 50-69 points) shows multiple abnormal indicators (such as a 20% monthly increase in HDD seek error rate and a 30% decrease in random write IOPS), triggering an orange alert, and simultaneous SMS and email push notifications, with attached abnormal trend analysis charts and recommendations for in-depth testing (such as offline bad sector scanning); Level 3 sub-health (index <50 points) shows signs of serious performance degradation (such as a continuous increase in unrepairable sectors and P99.9 latency exceeding the baseline by 3 times), triggering a red alert. In addition to multi-channel notifications, a pre-replacement work order is automatically generated and pushed to the spare parts management system, prompting preparations for hardware replacement.

[0059] In some embodiments, the response time for different alarm states is strictly graded (e.g., level three requires a response within 2 hours), and the alarm information includes predictive analysis based on a historical fault library (e.g., "Based on the current decay rate, the disk may go offline within 15 days"), forming a closed-loop management mechanism from early warning to fault prevention, effectively reducing the risk of downtime of critical business systems.

[0060] The following uses a complete implementation process as an example to illustrate the hard disk detection method provided by the embodiment of the present application; please refer to Figure 2 , Figure 2 This is a schematic diagram of an overall process provided by an embodiment of the present application, such as Figure 2 As shown, it includes three parts: information collection, information analysis, and information processing. Among them, information collection includes collecting disk SMART information, disk I / O information, link and link hardware information; information analysis includes integrated detection of disk SMART information, disk I / O information, link and link hardware information; information processing includes fault handling for faulty links, link hardware, or disks.

[0061] See also Figure 3 , Figure 3 A schematic diagram of the overall architecture provided by the embodiment of the present application is shown as follows: Figure 3 As shown, the collected information includes disk SMART information collection, disk IO information collection, and link and hardware information collection.

[0062] See also Figure 4 , Figure 4 A schematic diagram of a link and hardware information collection logic provided in an embodiment of the present application is shown as follows: Figure 4 As shown, link and hardware information collection can be performed according to the following steps:

[0063] (1) Obtain the entire link and topology information from the CPU to the disk, and establish a one-to-one correspondence between the link and the disk.

[0064] (2) Start the link statistics timer every 5 seconds to obtain and record the link speed, link status, link phy count (PHY count), and link phy change count (PHY change count).

[0065] (3) Start the link hardware exception information timer every 10 seconds, obtain and record the raid exception information in dmesg, obtain and record the expander exception information in dmesg, and obtain and record the pcie exception information in dmesg.

[0066] See also Figure 5 , Figure 5 A flow chart of another hard disk detection method provided in an embodiment of the present application is shown as follows: Figure 5 Shown, including:

[0067] Get all disk related information from the database.

[0068] Check the disk SMART information. If the disk SMART information abnormality exceeds the threshold, check the link hardware information; otherwise, check the disk I / O abnormality exceeds the threshold.

[0069] Determine the link hardware information. If there is link hardware abnormality information, restart the corresponding link hardware; otherwise, determine that the link statistics abnormality exceeds the threshold.

[0070] Determine whether the disk I / O anomaly exceeds the threshold. If the disk I / O anomaly exceeds the threshold, determine whether there is any abnormal information in the link hardware information. If the disk I / O anomaly does not exceed the threshold, determine that there is no fault and exit the judgment process directly.

[0071] Restarting the corresponding link hardware, including RAID or expander, will generate a link hardware abnormality alarm.

[0072] Determines whether the link statistics exceed the threshold. If so, a link abnormality alarm and a disk sub-health alarm are generated. Otherwise, a disk sub-health alarm is generated.

[0073] After the disk sub-health alarm is generated, it is determined whether the hard disk needs to be replaced, and if it is determined that replacement is necessary, the hard disk is replaced.

[0074] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method.

[0075] The embodiment of the present application also provides a hard disk detection device, Figure 6 This is a structural diagram of a hard disk detection device provided in an embodiment of the present application, as shown in FIG. Figure 6 Shown, including:

[0076] A first acquiring unit 21 is configured to acquire detection information of the hard disk to be detected;

[0077] A determining unit 22 is configured to determine whether there is an abnormality in the link hardware of the hard disk to be detected when it is determined that the detection information is abnormal;

[0078] The first generating unit 23 is configured to generate a link hardware abnormality alarm when an abnormality occurs in the link hardware.

[0079] Through this application, when an abnormality is detected in the detection information of the hard disk to be tested, it is determined whether the link hardware of the hard disk to be tested has an abnormality. When the link hardware has an abnormality, a link hardware abnormality alarm is generated, and the detection range is expanded from a single hard disk to the entire link hardware system associated with it. It can accurately identify the problem of hard disk performance degradation caused by link hardware abnormality, and avoid misjudging the hard disk problem as a simple hard disk fault due to ignoring the link hardware failure. Therefore, it can solve the technical problem of only detecting the hard disk in the existing technology and failing to discover the impact of other hardware problems in the disk link on the hard disk. It can achieve the technical effect of accurately locating the fault source, issuing a timely alarm, reducing the risk of system performance degradation and poor user experience caused by link hardware abnormality, and improving system stability and troubleshooting efficiency.

[0080] Furthermore, in a possible implementation of the embodiment of the present disclosure, as Figure 7 As shown, the device also includes:

[0081] A second acquiring unit 24 is configured to acquire link statistical information if the link hardware of the hard disk to be detected is not abnormal after the determining unit 22 determines whether the link hardware of the hard disk to be detected is abnormal;

[0082] The second generating unit 25 is configured to generate a sub-health alarm for the hard disk to be detected when it is determined that the number of abnormalities in the link statistical information exceeds a preset threshold.

[0083] Furthermore, in a possible implementation of the embodiment of the present disclosure, the first acquiring unit 21 is further configured to:

[0084] Obtain disk intelligence information, disk input and output information, and link hardware information of the hard disk to be detected.

[0085] Furthermore, in a possible implementation of the embodiment of the present disclosure, the determining unit 22 is further configured to:

[0086] When it is determined that the number of abnormalities in the disk intelligence information of the hard disk to be detected is greater than a first preset abnormality threshold; or

[0087] When it is determined that the number of abnormalities in the disk input and output information of the hard disk to be detected is greater than a second preset abnormality threshold, it is determined whether abnormal information exists in the link hardware information.

[0088] Furthermore, in a possible implementation of the embodiment of the present disclosure, the first acquiring unit 21 is further configured to:

[0089] Obtaining link and topology information between the processor and the hard disk to be detected;

[0090] At least one of a link rate, a link status, a number of link physical channels, and a link physical channel change count between the processor and the hard disk to be detected is obtained based on a first preset time interval.

[0091] Furthermore, in a possible implementation of the embodiment of the present disclosure, the determining unit 22 is further configured to:

[0092] At least one of disk array abnormality information, expander abnormality information, and peripheral component interconnect standard high-speed serial bus abnormality information in the system log is obtained and recorded based on a second preset time interval.

[0093] Furthermore, in a possible implementation of the embodiment of the present disclosure, the second generating unit 25 is further configured to:

[0094] The health status of the hard disk to be detected is determined, and a sub-health alarm of a corresponding alarm state is generated according to the health status of the hard disk to be detected; wherein, the sub-health alarm mode and alarm level of different alarm states are different.

[0095] For the description of the features in the embodiment corresponding to the hard disk detection device, reference can be made to the relevant description of the embodiment corresponding to the hard disk detection method, which will not be repeated here.

[0096] An embodiment of the present application further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any of the above-mentioned hard disk detection method embodiments.

[0097] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above-mentioned hard disk detection method embodiments when run.

[0098] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.

[0099] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of any of the above-mentioned hard disk detection method embodiments are implemented.

[0100] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above-mentioned hard disk detection method embodiments are implemented.

[0101] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0102] The above is a detailed introduction to the hard disk detection method, device, electronic device, and storage medium provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only intended to help understand the method and core concept of the present application. It should be pointed out that, for those skilled in the art, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.

Claims

1. A hard disk detection method, characterized in that: include: Get the detection information of the hard disk to be detected; When it is determined that the detection information is abnormal, determining whether the link hardware of the hard disk to be detected is abnormal; When an abnormality occurs in the link hardware, a link hardware abnormality alarm is generated.

2. The hard disk detection method according to claim 1, characterized in that: After determining whether the link hardware of the hard disk to be detected is abnormal, the method further includes: When there is no abnormality in the link hardware, obtaining link statistical information; When it is determined that the number of abnormalities in the link statistical information exceeds a preset threshold, a sub-health alarm of the hard disk to be detected is generated.

3. The hard disk detection method according to claim 1, wherein: The step of obtaining the detection information of the hard disk to be detected includes: Obtain disk intelligence information, disk input and output information, and link hardware information of the hard disk to be detected.

4. The hard disk detection method according to claim 3, characterized in that: When it is determined that the detection information is abnormal, determining whether the link hardware of the hard disk to be detected is abnormal includes: When it is determined that the number of abnormalities in the disk intelligence information of the hard disk to be detected is greater than a first preset abnormality threshold; or When it is determined that the number of abnormalities in the disk input and output information of the hard disk to be detected is greater than a second preset abnormality threshold, it is determined whether abnormal information exists in the link hardware information.

5. The hard disk detection method according to claim 3, characterized in that: The step of obtaining disk intelligence information, disk input / output information, and link hardware information of the hard disk to be detected includes: Obtaining link and topology information between the processor and the hard disk to be detected; At least one of a link rate, a link status, a number of link physical channels, and a link physical channel change count between the processor and the hard disk to be detected is obtained based on a first preset time interval.

6. The hard disk detection method according to claim 5, characterized in that: Determining whether the link hardware of the hard disk to be detected is abnormal includes: At least one of disk array abnormality information, expander abnormality information, and peripheral component interconnect standard high-speed serial bus abnormality information in the system log is obtained and recorded based on a second preset time interval.

7. The hard disk detection method according to claim 2, characterized in that: Generating a sub-health alarm of the hard disk to be detected further includes: The health status of the hard disk to be detected is determined, and a sub-health alarm of a corresponding alarm state is generated according to the health status of the hard disk to be detected; wherein, the sub-health alarm mode and alarm level of different alarm states are different.

8. A hard disk detection device, characterized in that: include: A first acquiring unit, configured to acquire detection information of the hard disk to be detected; a determining unit, configured to determine whether a link hardware of the hard disk to be detected is abnormal when it is determined that the detection information is abnormal; The first generating unit is configured to generate a link hardware abnormality alarm when an abnormality occurs in the link hardware.

9. An electronic device, characterized in that: include: memory for storing computer programs; A processor, configured to implement the steps of the hard disk detection method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the hard disk detection method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Abnormality detection method and storage device

    CN121116697A