Hard disk detection method, electronic equipment, storage medium and program product

By obtaining the number and trend of bad sectors on the hard drive, and combining this with the number of sectors that can be reallocated, the hard drive status can be accurately distinguished. This solves the problem of accuracy and reliability in hard drive detection, improves the accuracy and reliability of hard drive detection, reduces false positives and false negatives, and extends the lifespan of the hard drive.

CN120704969AActive Publication Date: 2025-09-26INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202511196929.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-26
Publication Date
2025-09-26
Estimated Expiration
2045-08-26

AI Technical Summary

Technical Problem

Existing technologies struggle to accurately detect hard drive status, leading to abnormal data read/write operations, degraded device performance, and even data loss. This is particularly problematic in server testing, where insufficient accurate control over hard drive status negatively impacts test quality and efficiency.

Method used

By obtaining the cumulative number of bad sectors that have been replaced, the number of potential bad sectors within the current unit of time, and the number of bad sectors that have been replaced within a preset time, combined with the maximum number of sectors that can be reallocated, the health status of the hard drive can be determined, and potential bad sectors caused by sector aging and environmental interference can be distinguished to avoid misjudgment.

Benefits of technology

It improves the accuracy and reliability of hard drive health status detection, reduces missed detections, promptly detects potential risks, provides a basis for hard drive maintenance, and extends the lifespan of hard drives.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120704969A_ABST
    Figure CN120704969A_ABST
Patent Text Reader

Abstract

The invention discloses a hard disk detection method, electronic equipment, a storage medium and a program product, and relates to the technical field of computers, the method comprises the following steps: obtaining a first number corresponding to accumulated replaced bad sectors of a to-be-detected hard disk and a second number corresponding to potential bad sectors in the current unit time; when the first number is larger than a first preset threshold value, and / or when the second number is larger than a second preset threshold value and it is determined that the generation reason of the potential bad sectors is sector aging, obtaining a third number corresponding to the bad sectors which are replaced by the to-be-detected hard disk within preset time; and determining the health state of the to-be-detected hard disk according to the first number, the second number, the third number and a pre-acquired redistributable maximum sector number corresponding to the to-be-detected hard disk. According to the application, the hard disk state is comprehensively analyzed by integrating the data of multiple time periods, and the detection accuracy and reliability 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, electronic equipment, storage medium, and program product. Background Art

[0002] In the operation of computing devices, hard drives are core storage components. Their stable operation is directly related to data security, device reliability, and service continuity. Therefore, accurate monitoring of hard drive status is crucial. Once a hard drive has a fault such as a bad sector, it can cause data read and write anomalies, device performance degradation, and even lead to serious losses such as data loss and service interruption. Especially in the field of server testing, accurate control of hard drive status is a prerequisite for ensuring test quality and improving test efficiency. Summary of the Invention

[0003] The present application provides a hard disk detection method, electronic device, storage medium and program product to at least solve the problem of how to accurately detect the hard disk status.

[0004] This application provides a hard disk detection method, including: Obtaining a first number of bad sectors of the hard disk to be detected that have been replaced, and a second number of potential bad sectors within a current unit time; When the first number is greater than a first preset threshold, and / or when the second number is greater than a second preset threshold and it is determined that the cause of the potential bad sectors is sector aging, obtaining a third number corresponding to bad sectors of the hard disk to be tested that have been replaced within a preset time; The health status of the hard disk to be detected is determined according to the first number, the second number, the third number, and the pre-acquired maximum number of reallocatable sectors corresponding to the hard disk to be detected.

[0005] The present application also provides a hard disk detection device, comprising: A first acquisition module is used to obtain a first number of bad sectors of the hard disk to be detected that have been replaced, and a second number of potential bad sectors in a current unit time; A second acquisition module is configured to acquire a third number of bad sectors of the hard disk to be tested that have been replaced within a preset time period when the first number is greater than a first preset threshold and / or when the second number is greater than a second preset threshold and it is determined that the cause of the potential bad sectors is sector aging; The determination module is used to determine the health status of the hard disk to be detected according to the first number, the second number, the third number, and the pre-acquired maximum number of reallocatable sectors corresponding to the hard disk to be detected.

[0006] 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 of the above-mentioned hard disk detection methods when executing the computer program.

[0007] 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.

[0008] 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.

[0009] Through this application, on the one hand, based on the first number of bad sectors corresponding to the cumulative number of bad sectors replaced, the second number of potential bad sectors corresponding to the current unit time, and the third number of bad sectors replaced within a preset time, as well as the maximum number of sectors that can be reallocated on the hard drive to be tested, the application not only focuses on the cumulative hard drive wear (i.e., the cumulative number of bad sectors replaced) but also on the hard drive's short-term changing trends (i.e., the number of potential bad sectors per unit time and the number of bad sectors replaced within a preset time), comprehensively analyzing the actual hard drive wear. By combining sector data from different time periods and different properties (e.g., bad sectors replaced and potential bad sectors), the accuracy of hard drive health status detection can be improved. On the other hand, when the second number is greater than a second preset threshold, it further determines whether the potential bad sector is caused by sector aging, effectively distinguishing potential bad sectors caused by environmental interference and other reasons, and avoiding misjudging such situations as serious hard drive damage. At the same time, obtaining the third number when the conditions are met can capture potential risks caused by sector aging, reduce missed detections, further improve the reliability of hard drive detection, and provide a basis for hard drive maintenance. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] 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.

[0011] Figure 1 A flowchart of a hard disk detection method provided in an embodiment of the present application; Figure 2 A flowchart of another hard disk detection method provided in an embodiment of the present application; Figure 3 A schematic structural diagram of a hard disk detection device provided in an embodiment of the present application; Figure 4A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0012] 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.

[0013] 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.

[0014] 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.

[0015] First, the application scenarios of the embodiments of the present application are exemplarily introduced.

[0016] As the core storage component of computing devices, the stable operation of hard drives is directly linked to data security, reliable device operation, and the continued delivery of services. Faults such as bad sectors can cause data read and write anomalies, device performance degradation, and even serious consequences such as data loss and service interruptions. Accurately monitoring hard drive status is crucial for ensuring test quality and improving efficiency, especially in server testing.

[0017] In view of this, an embodiment of the present application provides a hard disk detection method to improve the accuracy of hard disk health status detection.

[0018] It should be noted that the execution subject of the hard disk detection method provided in the embodiment of the present invention can be a hard disk detection device, and the hard disk detection device can be implemented as part or all of an electronic device through software, hardware, or a combination of software and hardware. The electronic device can be a server or a terminal. The server in the embodiment of the present application can be a single server or a server cluster composed of multiple servers. The terminal in the embodiment of the present application can be a smart phone, personal computer, tablet computer, wearable device, intelligent robot or other intelligent hardware device. In the following method embodiments, the execution subject is an electronic device as an example for description.

[0019] According to an embodiment of the present invention, an embodiment of a hard disk detection method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0020] In this embodiment, a hard disk detection method is provided, which can be used in the above-mentioned electronic devices, such as servers. Figure 1 FIG. 1 is a flow chart of a hard disk detection method according to an embodiment of the present invention. Figure 1 As shown, the process includes: S101, obtaining a first number of bad sectors of a hard disk to be detected that have been replaced, and a second number of potential bad sectors within a current unit time.

[0021] Specifically, replaced bad sectors (reallocated sectors) and pending sectors are key indicators of a hard drive's failure rate. Hard drives have the ability to self-repair bad blocks. Replaced bad sectors represent actual physical bad sectors that have been replaced, providing a direct reflection of the drive's physical damage. The causes of potential bad sectors are complex and varied, ranging from deteriorating health of the sector itself to impending failure, data read failures caused by environmental interference, and fluctuations in the drive's operating conditions (such as repeated read and write operations triggering forced Adjacent Track Interference (ATI) checks). These factors encompass a range of factors, including the drive itself, the operating environment, and operating conditions.

[0022] The first number corresponding to the cumulative number of bad sectors replaced refers to the total number of physical bad sectors that have been replaced during the entire use of the hard drive. For example, if a hard drive has been used for three years and 20 physical bad sectors have been replaced during that time, the first number would be 20. The cumulative number of bad sectors replaced can reflect the long-term physical damage of the hard drive.

[0023] The second number of potentially bad sectors in the current unit time refers to the number of sectors marked as potentially bad within a set unit time (such as a monitoring cycle). For example, if the monitoring cycle is set to 7 days and the hard drive has 5 new potentially bad sectors within that monitoring cycle, the second number will be 5. The number of potentially bad sectors in the current unit time can reflect recent changes in the hard drive's status.

[0024] Exemplarily, the cumulative number of bad sectors that have been replaced, ie, the first number, and the number of potential bad sectors per unit time, ie, the second number, recorded inside the hard disk can be read through the firmware interface of the hard disk.

[0025] S102, when the first number is greater than the first preset threshold, and / or when the second number is greater than the second preset threshold and it is determined that the cause of the potential bad sector is sector aging, obtain a third number corresponding to the bad sectors of the hard disk to be tested that have been replaced within a preset time.

[0026] Specifically, sector aging refers to the gradual decline in hard drive performance due to long-term use.

[0027] The third number of bad sectors replaced refers to the number of bad sectors replaced on the hard drive within a preset time period. The preset time period can be limited based on actual conditions. For example, the preset time period is set to 1 day. If the hard drive under test replaces 2 bad sectors within 1 day, the third number is 2.

[0028] The first and second preset thresholds can be set based on actual conditions. For example, both are set to 0. If the first count is greater than the first threshold, it indicates that the hard drive has experienced significant cumulative damage and may present a high risk. If the second count is greater than the second threshold and the number of potential bad sectors is due to sector aging, this indicates that the recent rapid increase in bad sectors on the hard drive is due to aging. Further analysis of the third count to analyze the changing trend of potential bad sectors is necessary to comprehensively assess the hard drive's health.

[0029] S103: Determine the health status of the hard disk to be detected according to the first number, the second number, the third number, and the pre-acquired maximum number of reallocatable sectors corresponding to the hard disk to be detected.

[0030] Specifically, the maximum number of sectors that can be reallocated (Max Number of Available Sectors for Reassignment, MAR) is the maximum number of sectors that can be used to replace bad sectors set by the hard disk at the factory and is an inherent parameter of the hard disk.

[0031] For example, if the ratio of the first number to the maximum number of sectors that can be reallocated exceeds a preset ratio threshold, and the third number exceeds the corresponding preset number threshold, it indicates that the hard disk is in poor health; if the first number, the second number, and the third number are all less than their respective corresponding preset number thresholds, it indicates that the hard disk is in good health.

[0032] In an embodiment of the present application, based on a first number of bad sectors replaced, a second number of potential bad sectors within the current unit time, a third number of bad sectors replaced within a preset time, and the maximum number of sectors that can be reallocated from the hard drive to be tested, the system considers both the accumulated hard drive wear (i.e., the accumulated bad sectors replaced) and the short-term trend of the hard drive (i.e., the number of potential bad sectors within a unit time and the number of bad sectors replaced within a preset time), comprehensively analyzing the actual wear of the hard drive. By combining sector data from different time periods and of different natures (e.g., bad sectors replaced and potential bad sectors), the accuracy of hard drive health status detection can be improved. Furthermore, when the second number is greater than a second preset threshold, the system further determines whether the potential bad sector is caused by sector aging. This effectively distinguishes potential bad sectors caused by environmental interference and other factors, avoiding misjudging such situations as severe hard drive damage. Furthermore, obtaining the third number when conditions are met can capture potential risks caused by sector aging, reduce missed detections, further improve the reliability of hard drive detection, and provide a basis for hard drive maintenance.

[0033] In some embodiments, based on the foregoing embodiments, determining the health status of the hard disk to be detected according to the first number, the second number, the third number, and the pre-acquired maximum number of reallocatable sectors corresponding to the hard disk to be detected specifically includes the following steps: a1. Determine, based on the second quantity, a rate of change in the number of potential bad sectors of the hard disk to be detected within a current unit time.

[0034] Specifically, the rate of change of the number of potential bad sectors corresponding to the hard disk to be tested indicates the growth trend and speed of the number of potential bad sectors in the current unit time. The rate of change of the number can be used to analyze the changing trend of the hard disk's potential bad sectors, such as rapid growth, slow growth, and stabilization. Considering that the changing trend of the number of potential bad sectors can often indicate the health status of the hard disk itself or the working environment, the dynamic change dimension of the rate of change of the number of potential bad sectors corresponding to the potential bad sectors is introduced in the embodiment of the present application to improve the accuracy of detecting the health status of the hard disk, avoid detection errors caused by relying solely on static data, enable detection to discover potential risks earlier, and enhance the timeliness of hard disk detection.

[0035] For example, the rate of change of the number of potential bad sectors may be a ratio of the second number to the duration of the current unit time. For example, if the current unit time is 7 days and the second number of potential bad sectors is 21 within the current unit time, the rate of change is 21 / 7.

[0036] a2. Determine the health status of the hard disk to be detected based on the first number, the second number, the number change rate, the third number, and the maximum number of reallocatable sectors.

[0037] In a possible implementation, in step a2 above, the health status of the hard disk to be tested is determined in the following manner: b1. Determine a first weight corresponding to the first number according to the third number and the maximum number of sectors that can be reallocated.

[0038] Specifically, the first weight is used to measure the importance or influence of the first number of bad sectors that have been replaced in the evaluation of the health status of the hard disk.

[0039] Optionally, in b1 above, the first weight corresponding to the first quantity is determined by the following formula:

[0040] in, is the first weight, is the third quantity, The maximum number of sectors that can be reallocated.

[0041] b2, determining a second weight corresponding to the second quantity according to the quantity change rate.

[0042] Specifically, the second weight is used to measure the importance or influence of the second number of potential bad sectors in the current unit time when evaluating the health status of the hard disk.

[0043] Optionally, in the above b2, the second weight corresponding to the second quantity is determined by:

[0044] in, is the second weight, is the rate of change of quantity.

[0045] b3. Determine the health status of the hard disk to be detected according to the first quantity, the first weight corresponding to the first quantity, the second quantity, and the second weight corresponding to the second quantity.

[0046] Optionally, in step b3 above, the health status is determined by: First, a health value corresponding to the hard disk to be detected is obtained according to the first quantity, the first weight corresponding to the first quantity, the second quantity, and the second weight corresponding to the second quantity.

[0047] Specifically, the health value is determined by the first quantity, the first weight, the second quantity, and the second weight, and is a numerical value used to quantify the health status of the hard drive being tested. The magnitude of the health value can intuitively reflect the health of the hard drive. In this embodiment of the present application, a lower health value indicates a better health status of the hard drive being tested.

[0048] In one possible case, the health value of the hard disk to be detected is determined by taking a weighted sum of the first quantity and the second quantity according to a first weight corresponding to the first quantity and a second weight corresponding to the second quantity.

[0049] Exemplarily, the health value of the hard disk to be tested is determined in the following manner:

[0050] in, is the health value, RSC (Reallocated Sector Count) is the first quantity, is the first weight, PSC (Pending Sector Count) is the second quantity, is the second weight.

[0051] In another possible implementation, the method provided in the embodiment of the present application further includes the following content: First, obtain the physical location information corresponding to the potential bad sector.

[0052] Specifically, the physical location information corresponding to the potential bad sector is used to indicate the specific location of the potential bad sector on the physical track of the hard disk. The exemplary physical location information can be in the form of "track number + sector number" to reflect the actual location of the sector on the hard disk to be tested.

[0053] Exemplarily, the physical track positions, such as track numbers, corresponding to potential bad sectors are obtained through the sector physical address mapping table corresponding to the hard disk to be tested. For example, the track numbers corresponding to potential bad sectors L100-L120 obtained through the sector physical address mapping table are 120, 121, 125, 150, 160, etc.

[0054] Then, the second weight is adjusted according to the physical location information corresponding to the potential bad sector to obtain an adjusted second weight.

[0055] The adjusted second weight, the first quantity, the first weight, and the second quantity are used to determine the health status of the hard disk to be detected.

[0056] Specifically, the adjusted second weight combines the rate of change in the number of potential bad sectors and the location risk, and can accurately reflect the impact of potential bad sectors on the health status of the corresponding hard disk.

[0057] Optionally, when the number of potential bad sectors in a preset hard disk area of ​​the hard disk to be tested is determined to be greater than a third preset threshold value based on the physical location information corresponding to the potential bad sectors, the second weight is adjusted to obtain an adjusted second weight. When the number of potential bad sectors in a preset hard disk area of ​​the hard disk to be tested is determined to be less than or equal to the third preset threshold value based on the physical location information corresponding to the potential bad sectors, the second weight is maintained unchanged, that is, the health status of the hard disk to be tested is determined based on the second weight, the first number, the first weight, and the second number.

[0058] Specifically, the predefined hard drive area can be determined based on the physical characteristics of the hard drive being tested or actual requirements to identify the area with the greatest impact on hard drive performance. For example, the predefined hard drive area can be the outer ring of the hard drive. This is because the outer ring of a hard drive has a longer track circumference and a relatively lower storage density, but the magnetic head can read and write sectors in the outer ring faster (higher linear velocity) at the same rotational speed. Therefore, the outer ring is a high-frequency read and write area (e.g., where operating system files and frequently used application data are typically stored). If potential bad sectors are concentrated in the outer ring of the hard drive being tested, this will directly affect the read and write efficiency of frequently accessed data, significantly impacting the overall hard drive performance more than the inner ring sectors. For example, based on the total number of tracks on the hard drive being tested, the physical tracks of the hard drive are divided into three hard drive areas: outer ring, middle ring, and inner ring. For example, if a hard drive has 1000 tracks, tracks 1-300 are the outer ring (high-frequency read and write area), tracks 301-700 are the middle ring, and tracks 701-1000 are the inner ring.

[0059] The number of potentially bad sectors in the preset hard disk area refers to the number of potentially bad sectors in the second number that are located in the preset hard disk area. For example, if the second number is 50, and 35 of them are located in the preset hard disk area, then the number of potentially bad sectors in the preset hard disk area is 35. The third preset threshold can be set based on actual conditions and is not limited here.

[0060] This way, even if the overall second count is small, but the number of potentially bad sectors in a critical area exceeds the threshold, the threat posed by these potentially bad sectors to the drive can be highlighted by adjusting the weight (usually increasing it). For example, if the second count is only 30, but there are 25 potentially bad sectors in a predefined hard drive area (exceeding the third predefined threshold of 20), adjusting the weight can highlight the absolute risk in the critical area of ​​the drive, preventing core vulnerabilities from being overlooked due to a small overall count.

[0061] Optionally, when it is determined based on the physical location information corresponding to the potential bad sectors that the ratio between the number of potential bad sectors in the preset hard disk area of ​​the hard disk to be detected and the second number is greater than the preset ratio, the second weight is increased to obtain an adjusted second weight.

[0062] The preset ratio is used to determine whether the potential bad sectors in the preset hard disk area are too concentrated. The preset ratio can be limited according to actual conditions, and the embodiment of the present application does not make specific limitations on this.

[0063] If the number of potential bad sectors located on the outer ring of the hard disk to be tested is determined to be greater than a preset ratio (such as 80%) based on the physical location information of the potential bad sectors, it is determined that the potential bad sectors are concentrated on the outer ring of the hard disk to be tested. At this time, the second weight is increased by 20%, that is, the adjusted second weight is 1.2 times the second weight.

[0064] Because the preset hard drive areas are often critical areas of the hard drive being tested, such as those storing system files and core business data, the sectors within these areas can have a more serious impact on the normal operation and data security of the hard drive. When the proportion of potentially bad sectors within the preset area (i.e., the ratio between the number of potentially bad sectors in the preset hard drive area of ​​the hard drive being tested and the second number) is high, it means that the critical area of ​​the hard drive is facing a greater risk. If the second weight is still used, this risk may be underestimated and the health of the hard drive may not be accurately reflected. Therefore, it is necessary to increase the second weight to amplify the impact of this high-risk situation on the health status assessment and improve the accuracy of the health status.

[0065] When it is determined based on the physical location information corresponding to the potential bad sectors that the ratio between the number of potential bad sectors in the preset hard disk area of ​​the hard disk to be tested and the second number is less than or equal to the preset ratio, the second weight is kept unchanged, that is, the health status of the hard disk to be tested is determined based on the second weight, the first number, the first weight and the second number.

[0066] If the ratio between the number of potentially bad sectors in a predetermined area of ​​the hard drive to be tested and the second number is less than or equal to the predetermined ratio, the distribution of potentially bad sectors within the predetermined area is relatively dispersed, not posing a concentrated risk, and the impact on the core functions of the hard drive is within an acceptable range. In this case, the second weight objectively reflects the overall risk of potentially bad sectors and does not require adjustment.

[0067] Of course, when it is determined based on the physical location information corresponding to the potential bad sectors that the ratio between the number of potential bad sectors in the preset hard disk area of ​​the hard disk to be detected and the second number is less than or equal to the preset ratio, the second weight can also be reduced to obtain an adjusted second weight.

[0068] It should be noted that the specific implementation method of determining the health status of the hard disk to be tested based on the adjusted second weight, the first quantity, the first weight and the second quantity can refer to the above-mentioned b3 implementation. For example, based on the first weight corresponding to the first quantity and the adjusted second weight corresponding to the second quantity, the health value of the hard disk to be tested is determined by taking the weighted sum of the first quantity and the second quantity. It will not be repeated here.

[0069] Then, the health status is determined based on the health value and the mapping relationship between the preset health value and the health status.

[0070] Specifically, the preset mapping relationship between health values ​​and health conditions refers to the correspondence between health value ranges and corresponding health states. For example, when the health value is less than 400, the hard drive under test is considered healthy. When the health value is between [400, 600], the hard drive under test is considered in poor health and in a warning state. When the health value is greater than 600, the hard drive under test is considered in extremely poor health and in a severe warning state.

[0071] The mapping relationship between the preset health value and the health status can be determined by referring to the safety value corresponding to the remaining replaceable bad sectors of the hard drive under test in the relevant technical field. For example, a ratio of the remaining replaceable bad sectors to the maximum number of reallocatable sectors of the hard drive under test of 95% or more is a safe value, indicating that the hard drive under test is healthy; a ratio between 85% and 95% is a critical warning value, indicating that the health of the hard drive under test is poor and in a warning state; and a ratio below 70% is a danger value, indicating that the health of the hard drive under test is extremely poor and in a serious alarm state. For example, the maximum number of reallocated sectors corresponding to the hard disk to be tested is 10,000. When the ratio of the remaining replaceable sectors to the maximum number of reallocated sectors is 95% and 85%, the corresponding numbers of bad sectors that have been replaced are 500 and 1,500 respectively. When the ratio of the remaining replaceable bad sectors to the maximum number of reallocated sectors is set to 95% and 85%, the corresponding numbers of potential bad sectors are set to 200 and 300 respectively. The first weight and the second weight can be set between 0.5 and 1.0. Therefore, according to the formula in b3 above, the health values ​​corresponding to the ratios of the remaining replaceable sectors to the maximum number of reallocated sectors of 95% and 85% can be obtained, that is, a mapping relationship between the health value and the health status is established.

[0072] In another possible implementation, in a2 above, when the ratio of the first quantity to the maximum number of sectors that can be reallocated exceeds the preset ratio threshold, and the second quantity and the third quantity respectively exceed their respective corresponding preset quantity thresholds, and the quantity change rate exceeds the preset change rate threshold, it indicates that the health status of the hard disk has deteriorated sharply and is in a serious alarm state; if the ratio of the first quantity to the maximum number of sectors that can be reallocated is less than the preset ratio threshold, and the second quantity and the third quantity are not less than their respective corresponding preset quantity thresholds, and the quantity change rate is less than the preset change rate threshold, it indicates that the hard disk is in a healthy state.

[0073] In the embodiment of the present application, the number change rate supplements the dynamic change information of potential bad sectors. Combined with the first number, the second number, the third number and the maximum number of sectors that can be reallocated, it can more comprehensively reflect the historical accumulation, current status, change trends, etc. of the hard disk bad sectors, effectively reduce misjudgments and missed judgments, discover potential risks of the hard disk earlier, and provide a basis for further ensuring data security and equipment reliability.

[0074] In some embodiments, based on any of the foregoing embodiments, the hard disk detection method provided in the embodiments of the present application further includes the following steps: c1, obtaining preset identification information corresponding to potential bad sectors, environmental parameters corresponding to the hard disk to be detected, and near-channel interference counts.

[0075] Specifically, the preset identification information is used to indicate whether the hard drive under test has any false bad sectors. These false bad sectors are not actual bad sectors, but rather malfunctions caused by improper operation or misuse of the hard drive. If these false bad sectors persist, the system will continuously report errors, impacting customer service. For example, the preset identification information can be a preset flag bit. By capturing the preset flag bit corresponding to a potential bad sector, it can be determined whether the hard drive under test has any false bad sectors.

[0076] Environmental parameters refer to data about the external environment in which the hard drive operates, including but not limited to temperature, humidity, and vibration intensity. For example, the environmental parameters are collected by deploying sensors (such as temperature sensors, humidity sensors, and vibration sensors) in the hard drive to be tested.

[0077] For mechanical hard drive sectors, due to the extremely high track density and extremely small spacing, if a sector is continuously reading data and the hard drive is not given the opportunity to self-diagnose, it will cause problems such as near-track interference in this sector. This will also cause the system to report errors and increase the number of potential bad sectors after reading and writing the sector again. The near-track interference count refers to the number of times the hard drive is recorded during the reading and writing process due to interference when the head switches between adjacent tracks, resulting in abnormal data reading and writing. For example, if a hard drive has 3 read and write errors due to near-track interference within 1 hour, its near-track interference count is 3. If the near-track interference count of the hard drive to be tested exceeds the preset count threshold, it indicates that the hard drive has performed a large number of repeated read operations on this sector, causing the hard drive to trigger sector protection and actively perform data verification, which in turn makes it impossible to respond to read commands in time, resulting in an increase in the number of potential bad sectors.

[0078] The causes of potential bad sectors are complex. Preset identification information can directly eliminate the interference of false bad sectors. Environmental parameters can reflect the impact of the external environment on the hard disk to be tested. Near-channel interference counts can reflect the internal interference during hard disk operation. Combining preset identification information, environmental parameters, and near-channel interference counts can provide a multi-dimensional basis for judging sector aging, avoiding misjudgment due to incomplete information and improving the accuracy of judging the cause of potential bad sectors.

[0079] c2. Determine whether the cause of the potential bad sector is sector aging based on preset identification information, environmental parameters, and near-path interference counts.

[0080] In one possible implementation, in the above c2, when it is determined based on the preset identification information that the potential bad sector is not a pseudo bad sector, and the environmental parameters are within the corresponding reference environmental parameter range, and the near-path interference count is less than the preset count threshold, it is determined that the cause of the potential bad sector is sector aging.

[0081] If the potential bad sector is determined to be a pseudo-bad sector based on the preset identification information, or if the environmental parameters are not within the corresponding reference environmental parameter range, or if the near-channel interference count is greater than or equal to the preset count threshold, the cause of the potential bad sector is determined not to be sector aging. The reference environmental parameter range and the preset count threshold can be set based on actual conditions and are not limited here.

[0082] This is because sector aging is caused by physical wear and tear on the hard drive itself, and is unrelated to external factors such as false bad sectors, environmental interference, and near-channel interference. By eliminating these non-aging factors (based on preset identification information, environmental parameters, and near-channel interference counts), it can be determined that the drive under test has potential bad sectors due to sector aging.

[0083] For example, if the preset identification information indicates "no false bad sectors," environmental parameters are within the baseline range (e.g., temperature 25-40°C, humidity 40%-60%, vibration frequency less than 5 times per hour), and the near-channel interference count is lower than the preset threshold (e.g., ≤ 3 times per hour), the potential bad sector is determined to be caused by sector aging. If the preset identification information indicates "false bad sectors exist," or environmental parameters are abnormal (e.g., temperature > 40°C), or the near-channel interference count is excessively high (e.g., > 3 times per hour), the cause is not determined to be sector aging, but rather false bad sectors, environmental interference, or near-channel interference.

[0084] In the embodiments of this application, a multi-dimensional system for determining the cause of potential bad sectors is established by combining preset identification information, environmental parameters, and near-path interference counts. This system addresses the complex and difficult-to-accurate identification of potential bad sectors. The preset identification information directly eliminates interference from pseudo-bad sectors, while the environmental parameters and near-path interference counts eliminate non-aging factors from the perspectives of external environment and internal operational interference, respectively. This improves the accuracy of sector aging determination and avoids misidentifying potential bad sectors caused by a single factor, such as temporary environmental interference, as hard drive sector aging. This allows for rapid identification of the cause of potential bad sectors and reduces unnecessary hard drive replacements.

[0085] In a possible implementation, when the preset identification information is used to indicate that the potential bad sector is a pseudo bad sector, and / or the close path interference count is greater than or equal to a preset count threshold, the potential bad sector is repaired.

[0086] This is because false bad sectors are reversible, non-physical damage that can be restored to normal use after repair. When the near-channel interference count is greater than or equal to the preset count threshold, the potential bad sectors are mostly caused by head switching interference, rather than physical aging of the sectors, and are also reversible. Targeted and proactive repair of false bad sectors and potential bad sectors caused by near-channel interference maximizes the recovery of available hard drive space, reduces the ineffective consumption of reallocated sectors, reduces premature hard drive replacement due to misjudgment, extends hard drive life, and reduces performance loss caused by the continued impact of near-channel interference.

[0087] Exemplarily, when the preset identification information is used to indicate that a potential bad sector is a pseudo bad sector, a "sector reset instruction" is sent to the pseudo bad sector to clear the potential bad sector mark of the sector and return it to a normal state.

[0088] For example, when the near-track interference count is greater than or equal to a preset count threshold, for the track that is severely affected by the near-track interference and the corresponding potential bad sector, the data of the track can be migrated to the spare track reserved by the hard disk (track remapping), and the original potential bad sector can be forced to be verified. After confirming that there is no physical damage, the mark is removed to avoid the continued impact of interference, thereby achieving the repair of the potential bad sector. For example, the hard disk near-track interference count remains at 6 times for 3 consecutive hours (the preset count threshold is 5 times), and the potential bad sector involved is potential bad sector 1. Through track remapping, the data of the track where the sector is located can be migrated to the spare track, and then the sector is read and written a preset number of times for verification. If there are no abnormalities, the potential bad sector mark of the sector is cleared.

[0089] In a possible implementation, when an environmental parameter is not within a corresponding reference environmental parameter range, alarm information corresponding to the device to be detected is generated.

[0090] Specifically, alarm information is used to inform relevant personnel of abnormal equipment environments that require prompt action. Examples of alarm information include, but are not limited to, the name of the abnormal environmental parameter (such as temperature, humidity, and vibration), the current environmental parameter value, the corresponding baseline environmental parameter range, the event that occurred, and the hard drive identifier.

[0091] In this implementation, by real-time monitoring of environmental parameters and comparing them with the corresponding baseline environmental parameter range, an alarm can be issued as soon as the environmental parameters exceed the tolerance range of the hard disk, so as to quickly adjust the environment in which the hard disk is located, avoid damage to the hard disk due to environmental problems (such as high temperature causing hard disk overheating, low humidity causing static electricity), ensure the stable operation of the equipment where the hard disk is located, avoid the complicated process of manually capturing various system logs and component logs for analysis, and improve the efficiency of problem location and operation and maintenance.

[0092] Figure 2 FIG. 1 is a flowchart of another hard disk detection method. Figure 2 In this process, the first and second counts of the hard drives to be tested are obtained. The difference between the first count and 0 (i.e., the first preset threshold) and the difference between the second count and 0 (i.e., the second preset threshold) are then determined. The hard drive test content is determined based on the results of these determinations. If the first count is greater than 0 (i.e., the first preset threshold) and the second count is 0 (i.e., the second preset threshold), indicating that the hard drive to be tested has physically bad sectors and has been replaced, a third count is obtained. The health status of the hard drive to be tested is then determined based on the first, second, and third counts, as well as the pre-determined maximum number of reallocatable sectors corresponding to the hard drive to be tested.

[0093] If the first number is 0 and the second number is greater than 0, it indicates that there are potential bad sectors in the hard disk to be detected, and further investigation is needed to find out the cause of the potential bad sectors. Figure 2 In the case where the first number is 0 and the second number is greater than 0, the preset flag of the potential bad sector is obtained, and the potential bad sector is determined to be a pseudo bad sector based on the preset flag. If the preset flag is 1, the potential bad sector is determined to be a pseudo bad sector, and the potential bad sector is repaired at this time. If the preset flag is not 1, it is determined that the potential bad sector is not a pseudo bad sector. At this time, the environmental parameters are obtained to check whether there is abnormal interference from external environmental parameters (such as temperature, vibration), that is, to determine whether the environmental parameters are within the corresponding reference environmental parameter range. If the environmental parameters are not within the corresponding reference environmental parameter range, it is determined that there is abnormal interference from external environmental parameters, and an alarm message is generated. If the environmental parameters are within the corresponding reference environmental parameter range, it is determined that there is no abnormal interference from external environmental parameters, and the near-path interference count is further obtained to determine whether the near-path interference count is less than the preset count threshold, so as to analyze the read and write business conditions of the potential bad sector. If the near-path interference count is less than the preset count threshold, it is determined that the cause of the potential bad sector is sector aging. If the cause of the potential bad sectors is determined to be sector aging, a third number is obtained to determine the health status of the hard drive under test based on the first number, the second number, the third number, and the maximum number of reallocatable sectors corresponding to the hard drive under test. If the near-channel interference count is greater than or equal to a preset count threshold, it indicates that the hard drive under test has undergone a large number of repeated read operations on the potential bad sector, causing the hard drive under test to trigger sector protection and actively perform data verification, resulting in the sector being unable to respond to read commands, resulting in the appearance of a potential bad sector. In this case, the potential bad sector is repaired to avoid continuous error reporting.

[0094] If the first number is greater than 0 and the second number is greater than 0, it means that the hard disk to be tested has both bad sector replacements and potential bad sectors. At this time, not only will the health status of the hard disk to be tested be determined based on the first number, the second number, the third number, and the pre-acquired maximum number of reallocated sectors corresponding to the hard disk to be tested, but diagnostic operations will also be performed in the case where the first number is 0 and the second number is greater than 0 as mentioned above.

[0095] The hard disk detection method provided in this application is exemplarily described below through a complete embodiment.

[0096] Run the "smartctl -a / dev / sdb |grep –I “pending sector”|awk '{print $NF}'; smartctl -a / dev / sdb |grep –I “ Reallocated Sector”|awk '{print $NF}'" command to obtain the first, second, and third quantities of the hard disk to be tested.

[0097] Assume that the first number is 1200, the second number is 210, the third number is 800, the maximum number of sectors that can be reallocated is 10,000, the unit time is 7 days, the preset time is 7 days, the first preset threshold is 0, and the second preset threshold is 0. In other words, the first number corresponding to the hard disk to be tested is greater than the first preset threshold, and the second number is greater than the second preset threshold.

[0098] First, diagnose the potential bad sectors and repair them if they are repairable. Figure 2 In the diagnostic process shown, the command "hdparm --read-sector LBA / dev / sda | xxd | grep -i "pseudo\|invalid"" is used to obtain the preset flag corresponding to the potential bad sector and determine whether the preset flag is 1. If the preset flag is 1, indicating that the potential bad sector is a pseudo bad sector, the sector is repaired (for example, data is rewritten to the sector). If the preset flag is not 1, the commands "smartctl -a / dev / sdb |grep –I "Disk_Shift"|awk '{print $NF}'; smartctl -a / dev / sdb |grep –I "Temp"|awk '{print $NF}'" are used to further obtain the environmental parameters of the hard drive under test (including temperature and vibration parameters) and determine whether the environmental parameters are within the corresponding reference environmental parameter range. If not, it indicates that the operating environment of the hard drive under test is abnormal, and an alarm is generated to prevent the abnormal environment from further affecting the normal operation of the hard drive. If the environmental parameters are within the corresponding baseline environmental parameter range, the command "sdparm --long -p ati / dev / sda" is further used to capture the near-channel interference count and determine the read and write status of the potential bad sector. If the near-channel interference count is greater than or equal to the preset count threshold, indicating that the sector is being continuously read and triggering the near-channel interference count, the sector is also repaired (for example, data is rewritten to the sector). If the ATI parameter is not less than the preset count threshold, the cause of the potential bad sector is determined to be sector aging. The health status of the hard drive to be tested is further determined based on the first count, the second count, the third count, and the pre-acquired maximum number of reallocatable sectors corresponding to the hard drive to be tested.

[0099] In the process of determining the health status, the rate of change of the number of potential bad sectors of the hard disk to be detected in the current unit time is obtained according to the second quantity. The second weight , the first weight , the health value H is calculated to be 617.2.

[0100] In the embodiment of the present application, the mapping relationship between the health value and the health status is determined based on the hard drive manufacturer's safety value for the remaining replaceable sectors. Generally, a ratio of the remaining replaceable sectors to the maximum number of sectors that can be reallocated of 95% or more is a safe value, between 95% and 85% is a critical warning value, and below 70% is a dangerous value. Therefore, the mapping relationship between the preset health value and the health status and the determination basis are as follows:

[0101] In the embodiment of the present application, when H=617.2, the corresponding health status is a serious alarm. Although the current bad sectors only account for 12% of the maximum number of sectors that can be reallocated, the main risk comes from α=0.95, that is, the potential bad sector mutation is large, and there is a risk of a subsequent outbreak of a large number of bad sectors.

[0102] The above mainly introduces the solution provided in the embodiment of the present application from the perspective of method.

[0103] 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.

[0104] In the embodiments of the present application, a hard disk detection device is also provided, which is used to implement the above-mentioned embodiments and preferred embodiments. Details that have already been described will not be repeated here. As used below, the term "module" can refer to a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation using hardware, or a combination of software and hardware, is also possible and contemplated.

[0105] This embodiment provides a hard disk detection device, such as Figure 3 Shown, including: The first acquisition module 301 is configured to acquire a first number of bad sectors of the hard disk to be detected that have been replaced, and a second number of potential bad sectors within a current unit time; A second obtaining module 302 is configured to obtain a third number of bad sectors of the hard disk to be tested that have been replaced within a preset time period when the first number is greater than a first preset threshold and / or when the second number is greater than a second preset threshold and the cause of the potential bad sectors is determined to be sector aging; The determination module 303 is configured to determine the health status of the hard disk to be detected according to the first number, the second number, the third number, and the pre-acquired maximum number of reallocatable sectors corresponding to the hard disk to be detected.

[0106] The device provided in the embodiments of the present application, on the one hand, based on a first number of bad sectors corresponding to the cumulative number of bad sectors replaced, a second number of potential bad sectors corresponding to the current unit time, and a third number of bad sectors replaced within a preset time, as well as the maximum number of sectors that can be reallocated on the hard disk to be tested, not only focuses on the cumulative wear and tear of the hard disk (i.e., the cumulative number of bad sectors replaced), but also focuses on the short-term change trend of the hard disk (i.e., the number of potential bad sectors per unit time and the number of bad sectors replaced within a preset time), comprehensively analyzes the actual wear and tear of the hard disk. By combining sector data of different time periods and different properties (such as bad sectors replaced and potential bad sectors), the accuracy of hard disk health status detection can be improved. On the other hand, when the second number is greater than a second preset threshold, it further determines whether the cause of the potential bad sector is sector aging, effectively distinguishing potential bad sectors caused by environmental interference and other reasons, and avoiding misjudging such cases as serious hard disk damage. At the same time, when the conditions are met, obtaining the third number can capture potential risks caused by sector aging, reduce missed detections, further improve the reliability of hard disk detection, and provide a basis for hard disk maintenance.

[0107] In a possible implementation, the determination module 303 is specifically configured to determine, based on the second quantity, a rate of change in the number of potential bad sectors of the hard disk to be detected within a current unit time; The health status of the hard disk to be detected is determined according to the first number, the second number, the number change rate, the third number, and the maximum number of sectors that can be reallocated.

[0108] In one possible implementation, the determination module 303 is specifically configured to determine a first weight corresponding to the first number based on the third number and the maximum number of sectors that can be reallocated; determining a second weight corresponding to the second quantity according to the quantity change rate; The health status of the hard disk to be detected is determined according to the first quantity, the first weight corresponding to the first quantity, the second quantity, and the second weight corresponding to the second quantity.

[0109] In one possible implementation, the determination module 303 is specifically configured to obtain a health value corresponding to the hard disk to be detected based on the first quantity, the first weight corresponding to the first quantity, the second quantity, and the second weight corresponding to the second quantity; The health status is determined based on the health value and the mapping relationship between the preset health value and the health status.

[0110] In a possible implementation, the determination module 303 obtains the health value corresponding to the hard disk to be detected by the following formula:

[0111] in, is the health value, RSC is the first quantity, is the first weight, PSC is the second quantity, is the second weight.

[0112] In a possible implementation, the determination module 303 determines the first weight corresponding to the first quantity by using the following formula:

[0113] in, is the first weight, is the third quantity, The maximum number of sectors that can be reallocated.

[0114] In a possible implementation, the determination module 303 determines the second weight corresponding to the second quantity by using the following formula:

[0115] in, is the second weight, is the rate of change of quantity.

[0116] In a possible implementation, the first acquisition module 301 is further configured to acquire preset identification information corresponding to a potential bad sector, environmental parameters corresponding to the hard disk to be detected, and a near-channel interference count; The determination module 303 is further configured to determine whether the cause of the potential bad sector is sector aging based on preset identification information, environmental parameters, and the near-path interference count.

[0117] In one possible implementation, the determination module 303 is specifically used to determine that the cause of the potential bad sector is sector aging when it is determined based on preset identification information that the potential bad sector is not a pseudo bad sector, and the environmental parameters are within the corresponding reference environmental parameter range, and the near-path interference count is less than a preset count threshold.

[0118] In a possible implementation, the first obtaining module 301 is further configured to obtain physical location information corresponding to a potential bad sector; The determination module 303 is also used to adjust the second weight according to the physical location information corresponding to the potential bad sector to obtain the adjusted second weight, wherein the adjusted second weight, as well as the first quantity, the first weight, and the second quantity are used to determine the health status of the hard disk to be detected.

[0119] In one possible implementation, the determination module 303 is specifically used to increase the second weight to obtain an adjusted second weight when it is determined based on the physical location information corresponding to the potential bad sectors that the number of potential bad sectors in the preset hard disk area of ​​the hard disk to be detected is greater than a third preset threshold.

[0120] 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.

[0121] The embodiment of the present application also provides an electronic device, such as Figure 4 As shown, it includes a memory 10 and a processor 20. The memory 10 stores a computer program, and the processor 20 is configured to run the computer program to execute the steps in any of the above hard disk detection method embodiments.

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

[0123] 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.

[0124] 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 in any of the above-mentioned hard disk detection method embodiments are implemented.

[0125] An embodiment of the present application also provides another computer program product, including a non-volatile computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the steps in any of the above-mentioned hard disk detection method embodiments.

[0126] 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.

[0127] The above is a detailed introduction to the hard disk detection method, electronic device, storage medium, and program product 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 ideas of the present application. It should be pointed out that, for ordinary technicians in this technical field, 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: The method comprises: Obtaining a first number of bad sectors of the hard disk to be detected that have been replaced, and a second number of potential bad sectors within a current unit time; When the first number is greater than a first preset threshold, and / or when the second number is greater than a second preset threshold and it is determined that the cause of the potential bad sector is sector aging, obtaining a third number of bad sectors corresponding to the hard disk to be tested that have been replaced within a preset time; The health status of the hard disk to be detected is determined according to the first number, the second number, the third number, and a pre-acquired maximum number of reallocatable sectors corresponding to the hard disk to be detected.

2. The method according to claim 1, characterized in that The determining the health status of the hard disk to be detected according to the first number, the second number, the third number, and the pre-acquired maximum number of reallocatable sectors corresponding to the hard disk to be detected includes: Determine, based on the second quantity, a rate of change in the number of potential bad sectors of the hard disk to be detected within the current unit time; The health status of the hard disk to be detected is determined according to the first number, the second number, the number change rate, the third number, and the maximum number of sectors that can be reallocated.

3. The method according to claim 2, characterized in that Determining the health status of the hard disk to be detected based on the first number, the second number, the number change rate, the third number, and the maximum number of reallocatable sectors includes: Determining a first weight corresponding to the first number according to the third number and the maximum number of sectors that can be reallocated; determining a second weight corresponding to the second quantity according to the quantity change rate; The health status of the hard disk to be detected is determined according to the first number, a first weight corresponding to the first number, the second number, and a second weight corresponding to the second number.

4. The method according to claim 3, characterized in that The determining the health status of the hard disk to be detected according to the first number, a first weight corresponding to the first number, the second number, and a second weight corresponding to the second number includes: Obtaining a health value corresponding to the hard disk to be detected according to the first quantity, a first weight corresponding to the first quantity, the second quantity, and a second weight corresponding to the second quantity; The health status is determined according to the health value and a preset mapping relationship between the health value and the health status.

5. The method according to claim 4, characterized in that Obtaining the health value corresponding to the hard disk to be detected according to the first quantity, a first weight corresponding to the first quantity, the second quantity, and a second weight corresponding to the second quantity includes: in, is the health value, RSC is the first quantity, is the first weight, PSC is the second quantity, is the second weight.

6. The method according to claim 3, characterized in that The determining, according to the third number and the maximum number of sectors that can be reallocated, a first weight corresponding to the first number includes: in, is the first weight, is the third quantity, The maximum number of sectors that can be reallocated.

7. The method according to claim 3, characterized in that Determining a second weight corresponding to the second quantity according to the quantity change rate includes: in, is the second weight, is the rate of change of the quantity.

8. The method according to any one of claims 1 to 7, characterized in that The method further comprises: Acquire preset identification information corresponding to the potential bad sector, environmental parameters corresponding to the hard disk to be detected, and a near-path interference count; It is determined whether the cause of generation of the potential bad sector is sector aging according to the preset identification information, the environmental parameters and the near path interference count.

9. The method according to claim 8, characterized in that The determining, based on the preset identification information, the environmental parameters, and the near-path interference count, whether the cause of the potential bad sector is sector aging includes: When it is determined according to the preset identification information that the potential bad sector is not a pseudo bad sector, and the environmental parameter is within the corresponding reference environmental parameter range, and the near-path interference count is less than the preset count threshold, it is determined that the cause of the potential bad sector is sector aging.

10. The method according to claim 8, characterized in that The method further comprises: When the preset identification information is used to indicate that the potential bad sector is a pseudo bad sector, and / or the close path interference count is greater than or equal to a preset count threshold, the potential bad sector is repaired.

11. The method according to claim 3, characterized in that The method further comprises: Obtaining physical location information corresponding to the potential bad sector; According to the physical location information corresponding to the potential bad sector, the second weight is adjusted to obtain an adjusted second weight, wherein the adjusted second weight, as well as the first quantity, the first weight, and the second quantity are used to determine the health status of the hard disk to be detected.

12. The method according to claim 11, characterized in that The adjusting the second weight according to the physical location information to obtain an adjusted second weight includes: When it is determined based on the physical location information corresponding to the potential bad sectors that the number of potential bad sectors in the preset hard disk area of ​​the hard disk to be detected is greater than a third preset threshold, the second weight is increased to obtain the adjusted second weight.

13. 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 12 when executing the computer program.

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

15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the hard disk detection method according to any one of claims 1 to 12 are implemented.

Citation Information

Patent Citations

  • Hard disk fault detection method and device

    CN103197995A

  • Disk bad track detection method and system

    CN105279057A

  • Method and device for prolonging service life of hard disk, computer equipment and storage medium

    CN114764596A

  • Data processing method and device, equipment, storage medium and computer program product

    CN120469631A

  • Hard disk management method, electronic equipment, storage medium and program product

    CN120491908A