A hard disk detection method, electronic equipment, storage medium and program product

By obtaining the number of bad sectors and analyzing sector aging, the accuracy problem of hard drive status detection is solved, the reliability of hard drive detection and maintenance efficiency are improved, false positives and false negatives are avoided, and the service life of hard drives is extended.

CN120704969BActive Publication Date: 2025-11-11INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511196929.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-26
Publication Date
2025-11-11
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 data loss, with particularly severe consequences in the server testing field.

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, thus reducing misjudgments.

Benefits of technology

It improves the accuracy and reliability of hard drive health status detection, reduces missed detections, 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 CN120704969B_ABST
    Figure CN120704969B_ABST
Patent Text Reader

Abstract

This application discloses a hard disk testing method, electronic device, storage medium, and program product, relating to the field of computer technology. The method includes: acquiring a first number of bad sectors that have been replaced cumulatively on the hard disk under test, and a second number of potential bad sectors within the current unit of 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 the cause of the potential bad sectors is determined to be sector aging, acquiring a third number of bad sectors that have been replaced on the hard disk under test within a preset time; and determining the health status of the hard disk under test based on the first number, the second number, the third number, and the pre-acquired maximum number of reallocatable sectors corresponding to the hard disk under test. This application comprehensively analyzes the hard disk status by integrating data from multiple time periods, improving the accuracy and reliability of the testing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a hard disk testing method, electronic device, storage medium, and program product. Background Technology

[0002] During the operation of computing devices, the hard drive, as a core storage component, directly affects data security, device reliability, and service continuity. Therefore, accurate monitoring of the hard drive's status is crucial. Once a hard drive experiences faults such as bad sectors, it can lead to abnormal data read / write operations, decreased device performance, and even serious losses such as data loss and service interruptions. Especially in server testing, accurate control of the hard drive's status is a prerequisite for ensuring test quality and improving testing efficiency. Summary of the Invention

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

[0004] This application provides a hard disk testing method, including:

[0005] Get the first number of bad sectors that have been replaced on the hard drive under test, and the second number of potential bad sectors in the current unit of time.

[0006] When the first quantity is greater than the first preset threshold, and / or when the second quantity is greater than the second preset threshold and it is determined that the cause of the potential bad sector is sector aging, obtain the third quantity corresponding to the bad sectors that the hard drive under test has replaced within a preset time.

[0007] The health status of the hard drive under test is determined based on the first quantity, the second quantity, the third quantity, and the maximum number of reallocatable sectors corresponding to the hard drive under test that are pre-acquired.

[0008] This application also provides a hard disk testing device, including:

[0009] The first acquisition module is used to acquire the first number of bad sectors that have been replaced in the hard drive under test, and the second number of potential bad sectors in the current unit of time.

[0010] The second acquisition module is used to acquire the third number of bad sectors that the hard drive under test has replaced within a preset time 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 sectors is sector aging.

[0011] The determination module is used to determine the health status of the hard drive under test based on the first quantity, the second quantity, the third quantity, and the pre-acquired maximum number of reallocatable sectors corresponding to the hard drive under test.

[0012] This application also provides an electronic device, including: a memory for storing a computer program; and a processor for executing the computer program to implement the steps of any of the above-described hard disk detection methods.

[0013] This application also provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of any of the above-described hard disk detection methods.

[0014] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the above-described hard disk detection methods.

[0015] This application achieves two main goals. First, by considering the first number of bad sectors that have been replaced cumulatively, the second number of potential bad sectors within the current unit time, and the third number of bad sectors that have been replaced within a preset time, along with the maximum number of reallocatable sectors on the hard drive under test, it focuses on both the cumulative wear of the hard drive (i.e., the cumulative number of bad sectors that have been replaced) and the short-term trend of the hard drive (i.e., potential bad sectors within a unit time and bad sectors that have been replaced within a preset time). This comprehensive analysis of the hard drive's actual wear and tear, combined with sector data from different time periods and of different natures (such as replaced bad sectors and potential bad sectors), improves the accuracy of hard drive health status detection. Second, when the second number exceeds a second preset threshold, it further determines whether the potential bad sectors are caused by sector aging. This effectively distinguishes potential bad sectors caused by environmental interference and other reasons, avoiding misjudging such cases as severe hard drive damage. Simultaneously, obtaining the third number under certain conditions 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. Attached Figure Description

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

[0017] Figure 1 A flowchart of a hard disk detection method provided in an embodiment of this application;

[0018] Figure 2A flowchart illustrating yet another hard disk detection method provided in this application embodiment;

[0019] Figure 3 This is a schematic diagram of the structure of a hard disk testing device provided in an embodiment of this application;

[0020] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

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

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

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

[0024] First, the application scenarios of the embodiments of this application will be introduced by way of example.

[0025] As a core storage component in computing devices, the stable operation of hard drives is directly related to data security, reliable device operation, and continuous service. Once a hard drive experiences failures such as bad sectors, it can cause abnormal data read / write operations, performance degradation, and even serious consequences such as data loss and service interruption. Especially in the field of server testing, accurately monitoring the hard drive's status is crucial for ensuring test quality and improving testing efficiency.

[0026] In view of this, embodiments of this application provide a hard disk testing method to improve the accuracy of hard disk health status testing.

[0027] It should be noted that the hard disk detection method provided in this embodiment of the invention can be executed by a hard disk detection device. This device can be implemented as part or all of an electronic device through software, hardware, or a combination of both. The electronic device can be a server or a terminal. In this embodiment, the server can be a single server or a server cluster composed of multiple servers. The terminal can be a smartphone, personal computer, tablet computer, wearable device, or other intelligent hardware device such as an intelligent robot. The following method embodiments will use an electronic device as the execution subject for illustration.

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

[0029] This embodiment provides a hard disk detection method, which can be used in the aforementioned electronic devices, such as servers. Figure 1 This is a flowchart of a hard disk detection method provided according to an embodiment of the present invention, such as... Figure 1 As shown, the process includes:

[0030] S101, obtain the first number of bad sectors that have been replaced on the hard drive under test, and the second number of potential bad sectors in the current unit of time.

[0031] Specifically, reallocated bad sectors and pending bad sectors are key data indicating hard drive failures. Hard drives have self-repair capabilities for bad blocks; reallocated bad sectors represent actual physical bad sectors that have been replaced, directly reflecting the physical damage to the hard drive. Pending bad sectors have complex and varied causes. They may be due to deteriorating sector health leading to impending failure, or data read failures caused by environmental interference or fluctuations in hard drive operating conditions (such as repeated read / write operations triggering forced Adjacent Track Interference (ATI) checks). These factors encompass hard drive-related issues, operating environment factors, and operational conditions.

[0032] The first number corresponding to the cumulative replaced bad sectors 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 3 years and a total of 20 physical bad sectors have been replaced during that time, then the first number is 20. The cumulative replaced bad sectors can reflect the long-term physical damage of the hard drive.

[0033] The second number of potential bad sectors within the current unit of time refers to the number of sectors marked as potential bad sectors within a set unit of time (such as a monitoring period). For example, if the monitoring period is set to 7 days, and the hard drive adds 5 new potential bad sectors during that monitoring period, then the second number is 5. The number of potential bad sectors within the current unit of time reflects the recent changes in the hard drive's condition.

[0034] For example, the hard drive's firmware interface can be used to read the cumulative number of bad sectors that have been replaced, i.e., the first number, and the number of potential bad sectors per unit time, i.e., the second number.

[0035] S102, when the first quantity is greater than the first preset threshold, and / or when the second quantity is greater than the second preset threshold and it is determined that the cause of the potential bad sector is sector aging, obtain the third quantity corresponding to the bad sectors that the hard drive under test has replaced within a preset time.

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

[0037] The third quantity corresponding to the replaced bad sectors refers to the number of bad sectors that the hard drive has replaced within a preset time. The preset time can be limited according to actual conditions; for example, it can be set to 1 day. If the hard drive under test replaces 2 bad sectors within 1 day, then the third quantity is 2.

[0038] The first and second preset thresholds can be set according to actual conditions. For example, both the first and second preset thresholds can be set to 0. A first quantity greater than the first preset threshold indicates that the hard drive has accumulated serious damage and may pose a significant risk. A second quantity greater than the second preset threshold, and the potential bad sectors being caused by sector aging, indicates that the recent rapid increase in bad sectors is due to the hard drive's own aging. Further analysis using a third quantity to determine the trend of potential bad sectors is needed to comprehensively assess the hard drive's health.

[0039] S103. Determine the health status of the hard drive to be tested based on the first quantity, the second quantity, the third quantity, and the maximum number of realizable sectors corresponding to the hard drive to be tested that is pre-acquired.

[0040] Specifically, the Maximum Number of Available Sectors for Reassignment (MAR) is the maximum number of sectors that a hard drive can use to replace bad sectors, as set at the factory. It is an inherent parameter of the hard drive.

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

[0042] In this embodiment, on the one hand, based on the first number of bad sectors that have been replaced cumulatively, the second number of potential bad sectors within the current unit time, and the third number of bad sectors that have been replaced within a preset time, as well as the maximum number of sectors that can be reallocated on the hard drive under test, the system focuses on both the cumulative wear of the hard drive (i.e., the cumulative number of bad sectors that have been replaced) and the short-term trend of the hard drive (i.e., potential bad sectors within a unit time and bad sectors that have been replaced within a preset time). This comprehensive analysis of the actual wear of the hard drive improves the accuracy of hard drive health status detection by combining sector data from different time periods and of different natures (such as bad sectors that have been replaced and potential bad sectors). On the other hand, when the second number is greater than the second preset threshold, it further determines whether the potential bad sectors are caused by sector aging. This effectively distinguishes potential bad sectors caused by environmental interference and other reasons, avoiding misjudging such cases as severe hard drive damage. At the same time, obtaining the third number under certain conditions 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.

[0043] In some embodiments, based on the foregoing embodiments, the health status of the hard drive under test is determined according to a first quantity, a second quantity, a third quantity, and the pre-acquired maximum number of realizable sectors corresponding to the hard drive under test, specifically including the following steps:

[0044] a1, based on the second quantity, determine the rate of change of the number of potential bad sectors on the hard drive to be tested within the current unit of time.

[0045] Specifically, the rate of change in the number of potential bad sectors indicates the growth trend and speed of the number of potential bad sectors on the hard drive under test within the current unit of time. The rate of change allows analysis of the changing trend of potential bad sectors, such as rapid growth, slow growth, or stabilization. Considering that the changing trend of the number of potential bad sectors can often predict the health status or operating environment of the hard drive itself, this embodiment introduces the dynamic dimension of the rate of change in the number of potential bad sectors to improve the accuracy of hard drive health status detection, avoid detection errors caused by relying solely on static data, enable earlier detection of potential risks, and enhance the timeliness of hard drive detection.

[0046] For example, the rate of change of the number of potential bad sectors can be the ratio between the second number and the duration corresponding to the current unit of time. For instance, if the current unit of time is 7 days, and the second number of potential bad sectors in the current unit of time is 21, then the rate of change is 21 / 7.

[0047] a2 determines the health status of the hard drive to be tested based on the first quantity, the second quantity, the quantity change rate, the third quantity, and the maximum number of sectors that can be reallocated.

[0048] In one possible implementation, in a2 above, the health status of the hard drive to be tested is determined in the following way:

[0049] b1, determine the first weight corresponding to the first quantity based on the third quantity and the maximum number of sectors that can be reassigned.

[0050] Specifically, the first weight is used to measure the importance or impact of the first number of bad sectors that have been replaced in assessing the health of the hard drive.

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

[0052]

[0053] in, As the first weight, As the third quantity, This represents the maximum number of sectors that can be reallocated.

[0054] b2, based on the rate of change of quantity, determine the second weight corresponding to the second quantity.

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

[0056] Optionally, in b2 above, the second weight corresponding to the second quantity is determined as follows:

[0057]

[0058] in, As the second weight, This represents the rate of change in quantity.

[0059] b3. Determine the health status of the hard drive to be tested 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.

[0060] Optionally, in b3 above, health status is determined as follows:

[0061] First, 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 value of the hard drive to be tested is obtained.

[0062] Specifically, the health value is determined by a first quantity, a first weight, a second quantity, and a second weight, and is used to quantify the health status of the hard drive under test. The magnitude of the health value directly reflects the health level of the hard drive. In this embodiment, a lower health value indicates a better health status of the hard drive under test.

[0063] In one possible scenario, the health value of the hard drive to be tested is determined by weighted summation of the first quantity and the second quantity, based on the first weight corresponding to the first quantity and the second weight corresponding to the second quantity.

[0064] For example, the health value of the hard drive to be tested is determined in the following way:

[0065]

[0066] in, For health values, RSC (Reallocated Sector Count) is the first quantity. The first weight is used, and the second weight is PSC (Pending Sector Count). It is the second weight.

[0067] In another possible implementation, the method provided in this application embodiment further includes the following:

[0068] First, obtain the physical location information corresponding to the potential bad sectors.

[0069] 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 drive. 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 drive to be tested.

[0070] For example, the physical track location, such as the track number, corresponding to the potential bad sectors can be obtained through the sector physical address mapping table of the hard drive to be tested. For instance, through the sector physical address mapping table, the track numbers corresponding to the potential bad sectors L100-L120 can be obtained as 120, 121, 125, 150, 160, etc.

[0071] Then, the second weight is adjusted based on the physical location information corresponding to the potential bad sectors to obtain the adjusted second weight.

[0072] The adjusted second weight, along with the first quantity, the first weight, and the second quantity, are used to determine the health status of the hard drive to be tested.

[0073] Specifically, the adjusted second weight takes into account the rate of change in the number of potential bad sectors and the risk of their location, which can accurately reflect the impact of potential bad sectors on the health status of the hard drive.

[0074] Optionally, when the number of potential bad sectors in a preset hard drive area of ​​the hard drive under test is greater than a third preset threshold based on the physical location information corresponding to the potential bad sectors, the second weight is adjusted to obtain the adjusted second weight. When the number of potential bad sectors in a preset hard drive area of ​​the hard drive under test is less than or equal to the third preset threshold based on the physical location information corresponding to the potential bad sectors, the second weight remains unchanged. That is, the health status of the hard drive under test is determined based on the second weight, the first number, the first weight, and the second number.

[0075] Specifically, the preset hard drive area can be determined based on the physical characteristics of the hard drive under test or actual needs, focusing on areas that significantly impact hard drive performance. For example, the preset hard drive area can be the outer track. This is because the outer track has a longer circumference and relatively lower storage density, but the read / write head can read and write sectors on the outer track faster at the same rotational speed (higher linear speed). Therefore, the outer track is a high-frequency read / write area (such as operating system files and frequently used application data are typically stored here). If potential bad sectors are concentrated on the outer track of the hard drive under test, it will directly affect the read / write efficiency of high-frequency data access, and the impact on the overall hard drive performance is far greater than that on the inner track sectors. For example, based on the total number of tracks on the hard drive under test, the physical tracks of the hard drive can be divided into three hard drive areas: outer track, middle track, and inner track. For instance, a hard drive with a total of 1000 tracks might have tracks 1-300 as the outer track (high-frequency read / write area), 301-700 as the middle track, and 701-1000 as the inner track.

[0076] The number of potential bad sectors within the preset hard drive area refers to the number of potential bad sectors within the preset hard drive area in the second quantity. For example, if the second quantity is 50, and 35 of them are located in the preset hard drive area, then the number of potential bad sectors within the preset hard drive area is 35. The third preset threshold can be set according to actual conditions and is not limited here.

[0077] In this way, even if the overall second number is small, if the number of potential bad sectors in critical areas exceeds the threshold, the threat posed by potential bad sectors to the hard drive can be highlighted by adjusting the weight (usually by increasing it). For example, if the second number is only 30, but there are 25 potential bad sectors in the preset hard drive area (20 more than the third preset threshold), adjusting the weight can highlight the absolute risk in critical areas of the hard drive, preventing core hidden dangers from being overlooked due to the small overall number.

[0078] Optionally, when the ratio between the number of potential bad sectors in a preset hard drive area of ​​the hard drive to be tested and the second number is greater than the preset ratio, the second weight is increased to obtain the adjusted second weight.

[0079] The preset ratio is used to determine whether potential bad sectors within a preset hard disk area are too concentrated. The preset ratio can be limited according to actual conditions, and this application embodiment does not impose a specific limitation on it.

[0080] If the number of potential bad sectors located on the outer edge of the hard drive under test is greater than a preset ratio (e.g., 80%) based on the physical location information of the potential bad sectors, then the potential bad sectors are determined to be concentrated on the outer edge of the hard drive under test. In this case, the second weight is increased by 20%, that is, the adjusted second weight is 1.2 times the second weight.

[0081] Since the preset hard drive area is often a critical area of ​​the hard drive under test, such as the area storing system files and core business data, sectors in these areas can have a more serious impact on the normal operation of the hard drive and data security. When the proportion of potentially bad sectors in the preset area (i.e., the ratio between the number of potentially bad sectors in the preset hard drive area of ​​the hard drive under test and the second weight) is high, it means that the critical areas of the hard drive face greater risks. If the second weight is still used, this risk may be underestimated, and the health status of the hard drive cannot 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.

[0082] When the ratio between the number of potential bad sectors in a preset hard drive area of ​​the hard drive to be tested and the second number is less than or equal to the preset ratio, the second weight remains unchanged. That is, the health status of the hard drive to be tested is determined based on the second weight, the first number, the first weight, and the second number.

[0083] When the ratio of the number of potential bad sectors in a preset hard drive area to the second weight is less than or equal to the preset ratio, it indicates that the potential bad sectors in the preset area are relatively dispersed, do not form a concentrated risk, and the impact on the core functions of the hard drive is within an acceptable range. At this time, the second weight can objectively reflect the overall risk of potential bad sectors and no adjustment is needed.

[0084] Of course, when the ratio between the number of potential bad sectors in the preset hard drive area of ​​the hard drive to be tested and the second number is less than or equal to the preset ratio, the second weight can be reduced to obtain the adjusted second weight.

[0085] It should be noted that the specific implementation of determining the health status of the hard drive to be tested based on the adjusted second weight, the first quantity, the first weight, and the second quantity can refer to the implementation in b3 above. For example, the health value of the hard drive to be tested can be determined by weighted summing of the first quantity and the second quantity based on the first weight corresponding to the first quantity and the adjusted second weight corresponding to the second quantity. This will not be elaborated here.

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

[0087] Specifically, the preset mapping relationship between health values ​​and health status refers to the correspondence rules between health value ranges and corresponding health states. For example, when the health value is less than 400, the hard drive to be tested is determined to be in a healthy state; when the health value is in the range of [400, 600], the hard drive to be tested is determined to be in a poor health state and is in a warning state; when the health value is greater than 600, the hard drive to be tested is determined to be in an extremely poor health state and is in a serious alarm state.

[0088] The preset mapping relationship between health values ​​and health status can be determined by referring to the safety values ​​corresponding to the remaining replaceable bad sectors of the hard drive under test in the relevant technical field. For example, a ratio of remaining replaceable bad sectors to the maximum number of reallocatable sectors is considered a safe value, meaning the hard drive under test is considered healthy. A ratio between 85% and 95% is a critical warning value, meaning the hard drive under test is considered to be in poor health and is under warning. A ratio below 70% is a dangerous value, meaning the hard drive under test is considered to be in extremely poor health and is under serious alarm. For example, if the maximum number of realizable sectors for the hard drive under test is 10,000, and the number of bad sectors that have been replaced is 500 and 1,500 when the proportion of remaining replaceable sectors to the maximum number of realizable sectors is 95% and 85% respectively, and the number of potential bad sectors is set to 200 and 300 when the proportion of remaining replaceable bad sectors to the maximum number of realizable sectors is 95% and 85% respectively, and the first and second weights can be set between 0.5 and 1.0, then the health values ​​corresponding to the proportion of remaining replaceable sectors to the maximum number of realizable sectors can be obtained according to the formula in b3 above, that is, the mapping relationship between health value and health status can be established.

[0089] In another possible implementation, in a2 above, when the proportion of the first quantity to the maximum number of realizable sectors exceeds a preset proportion threshold, and the second and third quantities exceed their respective preset quantity thresholds, and the quantity change rate exceeds a preset change rate threshold, it indicates that the hard drive's health status has deteriorated sharply and is in a serious alarm state; if the proportion of the first quantity to the maximum number of realizable sectors is less than a preset proportion threshold, and the second and third quantities are not less than their respective preset quantity thresholds, and the quantity change rate is less than a preset change rate threshold, it indicates that the hard drive is in a healthy state.

[0090] In this embodiment, the quantity change rate supplements the dynamic change information of potential bad sectors. Combined with the first quantity, the second quantity, the third quantity, and the maximum number of sectors that can be reallocated, it can more comprehensively reflect the historical accumulation, current status, and trend of bad sectors on the hard drive, effectively reducing misjudgment and omission, and discovering potential risks of the hard drive earlier, thus providing a foundation for further ensuring data security and device reliability.

[0091] In some embodiments, based on any of the foregoing embodiments, the hard disk detection method provided in this application further includes the following steps:

[0092] c1, obtains the preset identification information corresponding to potential bad sectors, the environmental parameters corresponding to the hard drive under test, and the near-path interference count.

[0093] Specifically, the preset identification information is used to indicate whether the hard drive under test has pseudo-bad sectors. Pseudo-bad sectors are not real bad sectors, but rather failures caused by incorrect operation during hard drive use or operation. If pseudo-bad sectors persist, it will cause the system to continuously report errors, affecting customer business. For example, the preset identification information can be preset flag bits. By capturing the preset flag bits corresponding to potential bad sectors, it can be determined whether the hard drive under test has pseudo-bad sectors.

[0094] Environmental parameters refer to the external environmental data of the hard drive during operation, including but not limited to temperature, humidity, and vibration intensity. For example, environmental parameters are collected by deploying sensors (such as temperature sensors, humidity sensors, and vibration sensors) in the hard drive under test.

[0095] For hard disk drives (HDDs), due to the extremely high track density and small spacing, if a sector is continuously read from without allowing the hard drive a chance for self-diagnosis, it can lead to near-track interference and other problems. This can cause errors and an increase in the number of potential bad sectors when the system reads or writes to that sector again. Near-track interference count refers to the number of times data read / write errors occur due to interference caused by the read / write head switching between adjacent tracks during read / write operations. For example, if a hard drive experiences 3 read / write errors due to near-track interference within one hour, its near-track interference count is 3. If the near-track interference count of the hard drive under test exceeds a preset threshold, it indicates that the hard drive is performing a large number of repeated read operations on that sector, triggering sector protection and actively performing data verification. This can lead to read commands not responding in time, resulting in an increase in the number of potential bad sectors.

[0096] The causes of potential bad sectors are complex. Preset identification information can directly eliminate interference from pseudo bad sectors. Environmental parameters can reflect the impact of the external environment on the hard drive under test. Short-path interference count can reflect the internal interference situation during hard drive operation. Combining preset identification information, environmental parameters, and short-path interference count can provide multi-dimensional basis for judging sector aging, avoid misjudgment due to incomplete information, and improve the accuracy of judging the cause of potential bad sectors.

[0097] c2, based on preset identification information, environmental parameters and near-channel interference count, determines whether the cause of potential bad sectors is sector aging.

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

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

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

[0101] For example, if the preset flag is "no false bad sectors," the environmental parameters are within the baseline range (e.g., temperature 25-40℃, humidity 40%-60%, vibration frequency less than 5 times per hour), and the near-channel interference count is below the preset threshold (e.g., ≤3 times per hour), then the potential bad sector is determined to be caused by sector aging. If the preset flag is "false bad sectors exist," or the environmental parameters are abnormal (e.g., temperature > 40℃), or the near-channel interference count is too high (e.g., > 3 times per hour), then the cause is not sector aging, and the potential bad sector may be caused by false bad sectors, environmental interference, or near-channel interference.

[0102] In this embodiment, a multi-dimensional potential bad sector cause judgment system is established by combining preset identification information, environmental parameters, and short-path interference counts to solve the problem of complex causes and difficulty in accurately judging potential bad sectors. Preset identification information directly eliminates pseudo-bad sector interference, while environmental parameters and short-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 judgment, avoids misjudging potential bad sectors (such as temporary environmental interference) as hard drive sector aging, and thus quickly determines the cause of potential bad sectors, reducing unnecessary hard drive replacements.

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

[0104] This is because pseudo-bad sectors are reversible, non-physical damage, and can be restored to normal use after repair. When the near-track interference count is greater than or equal to a preset threshold, 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 pseudo-bad sectors and potential bad sectors caused by near-track interference maximizes the recovery of usable hard drive space, reduces the ineffective consumption of reallocatable sectors, reduces premature hard drive replacement due to misjudgment, extends hard drive lifespan, and reduces performance loss caused by the continuous impact of near-track interference.

[0105] For example, when preset identification information is used to indicate that a potential bad sector is a pseudo bad sector, a "sector reset command" is sent to the pseudo bad sector to clear the potential bad sector mark of the sector and return it to normal status.

[0106] For example, when the near-track interference count is greater than or equal to a preset count threshold, for tracks severely affected by near-track interference and their corresponding potential bad sectors, the data on those tracks can be migrated to a reserved spare track on the hard drive (track remapping). The original potential bad sectors are then forcibly checked, and once confirmed to be free of physical damage, the marking is removed to prevent continued interference and thus repair the potential bad sectors. For instance, if the hard drive's near-track interference count remains at 6 times for 3 consecutive hours (the preset count threshold is 5 times), the potential bad sector involved is potential bad sector 1. Through track remapping, the data on the track containing this sector can be migrated to a spare track. Subsequently, a preset number of read / write checks are performed on this sector. If no abnormalities are found, the potential bad sector marking for that sector is cleared.

[0107] In one possible implementation, when environmental parameters are outside the range of their corresponding baseline environmental parameters, an alarm message corresponding to the device under test is generated.

[0108] Specifically, alarm information is used to inform relevant personnel that the equipment is in an abnormal environment and needs to be dealt with promptly. For example, alarm information includes, but is not limited to, the name of the abnormal environmental parameter (such as temperature, humidity, vibration, etc.), the current environmental parameter value, the corresponding baseline environmental parameter range, the event that occurred, and the hard drive identifier.

[0109] In this implementation, by monitoring environmental parameters in real time and comparing them with the corresponding baseline environmental parameter range, an alarm can be issued as soon as the environmental parameters exceed the hard drive's tolerance range. This allows for rapid adjustment of the hard drive's environment, preventing damage to the hard drive due to environmental issues (such as overheating caused by high temperatures or static electricity caused by low humidity). This ensures the stable operation of the device containing the hard drive, avoids the tedious process of manually collecting and analyzing various system logs and component logs, and improves the efficiency of problem localization and maintenance.

[0110] Figure 2 This is a flowchart illustrating another hard drive testing method. Figure 2 First, the system acquires the first and second numbers of the hard drives to be tested. Then, it sequentially compares the first number with 0 (i.e., the first preset threshold) and the second number with 0 (i.e., the second preset threshold), determining the content to be tested based on the comparison results. If the first number is greater than 0 (i.e., the first preset threshold) and the second number is 0 (i.e., the second preset threshold), it means that the hard drive to be tested has physical bad sectors that have been replaced. Then, the system acquires the third number. Finally, based on the first, second, and third numbers, as well as the pre-acquired maximum number of reallocatable sectors corresponding to the hard drive to be tested, the system determines the health status of the hard drive to be tested.

[0111] If the first quantity is 0 and the second quantity is greater than 0, it indicates that the hard drive under test has potential bad sectors, and further investigation is needed to determine the cause of these potential bad sectors. Figure 2 In the process, when the first quantity is 0 and the second quantity is greater than 0, a preset flag bit for potential bad sectors is obtained. Based on the preset flag bit, it is determined whether the potential bad sector is a pseudo-bad sector. If the preset flag bit is 1, the potential bad sector is determined to be a pseudo-bad sector, and repair is performed on the potential bad sector. If the preset flag bit is not 1, the potential bad sector is determined not to be a pseudo-bad sector. At this time, environmental parameters are obtained to check for abnormal interference from external environmental parameters (such as temperature and vibration), that is, to determine whether the environmental parameters are within the corresponding baseline environmental parameter range. If the environmental parameters are not within the corresponding baseline 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 baseline environmental parameter range, it is determined that there is no abnormal interference from external environmental parameters, and the short-path interference count is further obtained to determine whether the short-path interference count is less than a preset count threshold to analyze the read and write operation status of the potential bad sector. If the short-path interference count is less than the preset count threshold, the cause of the potential bad sector is determined to be sector aging. If the cause of potential bad sectors is determined to be sector aging, a third quantity is obtained. Based on the first, second, and third quantities, as well as the maximum number of reallocatable sectors on the hard drive under test, the health status of the hard drive is determined. If the near-path interference count is greater than or equal to a preset threshold, it indicates that the hard drive under test has a large number of repeated read operations on potential bad sectors, causing the hard drive to trigger sector protection and actively perform data verification. This prevents the sector from responding to read commands, resulting in a potential bad sector. In this case, the potential bad sector is repaired to avoid continuous errors.

[0112] If the first quantity is greater than 0 and the second quantity is greater than 0, it means that the hard drive under test has both bad sector replacement and potential bad sectors. In this case, not only will the health status of the hard drive under test be determined based on the first quantity, the second quantity, the third quantity, and the maximum number of sectors that can be reallocated corresponding to the hard drive under test, but also the diagnostic operation as described above in the case where the first quantity is 0 and the second quantity is greater than 0 will be performed.

[0113] The hard disk detection method provided in this application will be illustrated by a complete embodiment below.

[0114] The command "smartctl -a / dev / sdb |grep –I “pending sector”|awk '{print $NF}'; smartctl -a / dev / sdb |grep –I “Reallocated Sector”|awk '{print $NF}'" is used to capture the first, second, and third number of hard drives to be tested.

[0115] Assume the first quantity is 1200, the second quantity is 210, the third quantity is 800, the maximum number of sectors that can be reallocated is 10000, 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 quantity corresponding to the hard drive under test is greater than the first preset threshold, and the second quantity is greater than the second preset threshold.

[0116] First, potential bad sectors are diagnosed, and if they are repairable sectors, they are repaired. According to... Figure 2 The diagnostic process shown uses the command "hdparm --read-sector LBA / dev / sda | xxd | grep -i "pseudo\|invalid"" 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, it indicates that the potential bad sector is a pseudo-bad sector, and the sector is repaired (for example, the 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 capture the environmental parameters (including temperature and vibration parameters) of the hard drive under test. It is determined whether the environmental parameters are within the corresponding baseline environmental parameter range. If they are not within the baseline environmental parameter range, it indicates that the working environment of the hard drive under test is abnormal, and an alarm message is generated to prevent the environmental abnormality 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 used to capture the near-path interference count and assess the read / write behavior of potential bad sectors. If the near-path interference count is greater than or equal to a preset count threshold, it indicates that the sector has been continuously read, triggering the near-path interference count. In this case, the sector is repaired (e.g., the data is rewritten to the sector). If the ATI parameters are not less than the preset count threshold, the cause of the potential bad sectors is determined to be sector aging. Based on the first, second, and third counts, as well as the pre-acquired maximum number of reallocatable sectors corresponding to the hard drive under test, the health status of the hard drive under test is further determined.

[0117] In determining the health status, based on the second quantity, the rate of change in the number of potential bad sectors of the hard drive under test within the current unit of time is obtained. Second weight First weight Therefore, the health value H is calculated to be 617.2.

[0118] In this embodiment, the mapping relationship between health value and health status is based on the hard drive manufacturer's determination of the safe value of replaceable sector margin. Generally, a ratio of 95% or higher between the remaining replaceable sectors and the maximum number of sectors that can be reallocated is considered a safe value; between 95% and 85% is a critical warning value; and below 70% is a dangerous value. Therefore, the preset mapping relationship between health value and health status, and the judgment criteria, are as follows:

[0119]

[0120] In this embodiment of the application, the health status corresponding to H=617.2 is a critical 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 large number of bad sectors breaking out in the future.

[0121] The above mainly describes the solution provided by the embodiments of this application from a methodological perspective.

[0122] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.

[0123] This application also provides a hard disk testing device for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0124] This embodiment provides a hard disk testing device, such as... Figure 3 As shown, it includes:

[0125] The first acquisition module 301 is used to acquire the first number of bad sectors that have been replaced in the hard disk to be tested, and the second number of potential bad sectors in the current unit of time.

[0126] The second acquisition module 302 is used to acquire the third number of bad sectors that the hard drive under test has replaced within a preset time 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 sectors is sector aging.

[0127] The determination module 303 is used to determine the health status of the hard drive to be tested based on the first quantity, the second quantity, the third quantity, and the pre-acquired maximum number of realizable sectors corresponding to the hard drive to be tested.

[0128] The apparatus provided in this application, on the one hand, focuses on both the cumulative number of bad sectors that have been replaced, the second number of potential bad sectors within the current unit time, and the third number of bad sectors that have been replaced within a preset time, as well as the maximum number of sectors that can be reallocated on the hard drive under test. This allows for a comprehensive analysis of the actual wear and tear of the hard drive, considering both the cumulative number of bad sectors that have been replaced and the short-term trend of the hard drive (i.e., potential bad sectors within a unit time and bad sectors that have been replaced within a preset time). Combining sector data from different time periods and of different natures (such as replaced bad sectors and potential bad sectors) improves the accuracy of hard drive health status detection. On the other hand, when the second number exceeds a second preset threshold, it further determines whether the potential bad sectors are caused by sector aging. This effectively distinguishes potential bad sectors caused by environmental interference and avoids misjudging such situations as severe hard drive damage. Simultaneously, obtaining the third number under certain conditions 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.

[0129] In one possible implementation, the determining module 303 is specifically used to determine the rate of change of the number of potential bad sectors of the hard disk to be tested in the current unit time, based on the second quantity.

[0130] The health status of the hard drive under test is determined based on the first quantity, the second quantity, the rate of change of quantity, the third quantity, and the maximum number of sectors that can be reallocated.

[0131] In one possible implementation, the determining module 303 is specifically used to determine the first weight corresponding to the first quantity based on the third quantity and the maximum number of sectors that can be reallocated;

[0132] Determine the second weight corresponding to the second quantity based on the rate of change of quantity;

[0133] The health status of the hard drive to be tested is determined 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.

[0134] In one possible implementation, the determining module 303 is specifically used to obtain the health value of the hard disk to be tested 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.

[0135] The health status is determined based on the health value and the preset mapping relationship between the health value and the health status.

[0136] In one possible implementation, the determining module 303 obtains the health value of the hard drive to be tested using the following formula:

[0137]

[0138] in, For health values, RSC is the first quantity. The first weight is PSC, and the second quantity is PSC. It is the second weight.

[0139] In one possible implementation, the determining module 303 determines the first weight corresponding to the first quantity using the following formula:

[0140]

[0141] in, As the first weight, As the third quantity, This represents the maximum number of sectors that can be reallocated.

[0142] In one possible implementation, the determining module 303 determines the second weight corresponding to the second quantity using the following formula:

[0143]

[0144] in, As the second weight, This represents the rate of change in quantity.

[0145] In one possible implementation, the first acquisition module 301 is also used to acquire preset identification information corresponding to potential bad sectors, environmental parameters corresponding to the hard disk to be tested, and near-channel interference count.

[0146] The determination module 303 is also used to determine whether the cause of potential bad sectors is sector aging based on preset identification information, environmental parameters and near-channel interference counts.

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

[0148] In one possible implementation, the first acquisition module 301 is also used to acquire the physical location information corresponding to the potential bad sector;

[0149] The determination module 303 is also used to adjust the second weight according to the physical location information corresponding to the potential bad sectors to obtain the adjusted second weight. The adjusted second weight, along with the first quantity, the first weight, and the second quantity, are used to determine the health status of the hard drive to be tested.

[0150] In one possible implementation, the determining module 303 is specifically used to increase the second weight when the number of potential bad sectors in a preset hard disk area of ​​the hard disk to be tested is greater than a third preset threshold, based on the physical location information corresponding to the potential bad sectors.

[0151] For a description of the features in the embodiment corresponding to the hard disk testing device, please refer to the relevant description of the embodiment corresponding to the hard disk testing method, which will not be repeated here.

[0152] Embodiments of this application also provide 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 perform the steps in any of the above embodiments of the hard disk detection method.

[0153] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above embodiments of the hard disk detection method when it is run.

[0154] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.

[0155] The embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above embodiments of the hard disk detection method.

[0156] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above-described hard disk detection method embodiments.

[0157] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can 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.

[0158] The above provides a detailed description of the hard disk testing method, electronic device, storage medium, and program product provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only intended to help understand the method and core ideas of this application. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this application.

Claims

1. A hard disk testing method, characterized in that, The method includes: Get the first number of bad sectors that have been replaced on the hard drive under test, and the second number of potential bad sectors in the current unit of time. When the first quantity is greater than the first preset threshold, and / or when the second quantity is greater than the second preset threshold and it is determined that the cause of the potential bad sector is sector aging, a third quantity corresponding to the bad sectors that the hard drive under test has replaced within a preset time is obtained. The health status of the hard drive under test is determined based on the first quantity, the second quantity, the third quantity, and the pre-acquired maximum number of reallocatable sectors corresponding to the hard drive under test. The step of determining the health status of the hard drive under test based on the first quantity, the second quantity, the third quantity, and the pre-obtained maximum number of reallocatable sectors corresponding to the hard drive under test includes: Based on the second quantity, determine the rate of change of the number of potential bad sectors on the hard disk under test within the current unit of time. The health status of the hard drive to be tested is determined based on the first quantity, the second quantity, the rate of change of the quantity, the third quantity, and the maximum number of sectors that can be reallocated.

2. The method according to claim 1, characterized in that, Determining the health status of the hard drive under test based on the first quantity, the second quantity, the rate of change of the quantity, the third quantity, and the maximum number of sectors that can be reallocated includes: The first weight corresponding to the first quantity is determined based on the third quantity and the maximum number of sectors that can be reallocated; Based on the rate of change of the quantity, determine the second weight corresponding to the second quantity; The health status of the hard drive to be tested is determined 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.

3. The method according to claim 2, characterized in that, Determining the health status of the hard drive to be tested 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 includes: 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 value corresponding to the hard drive to be tested is obtained; The health status is determined based on the health value and the preset mapping relationship between the health value and the health status.

4. The method according to claim 3, characterized in that, The step of obtaining the health value of the hard drive to be tested 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 includes: in, The health value is represented by RSC, which is the first quantity. The first weight is denoted as , and PSC is denoted as , the second quantity. This is the second weight.

5. The method according to claim 2, characterized in that, The step of determining the first weight corresponding to the first quantity based on the third quantity and the maximum number of sectors that can be reallocated includes: in, For the first weight, For the third quantity, The maximum number of sectors that can be reallocated.

6. The method according to claim 2, characterized in that, The step of determining the second weight corresponding to the second quantity based on the rate of change of the quantity includes: in, This is the second weight. The rate of change of the quantity is given.

7. The method according to any one of claims 1-6, characterized in that, The method further includes: Acquire preset identification information corresponding to the potential bad sectors, environmental parameters corresponding to the hard drive to be tested, and near-path interference counts; Based on the preset identification information, the environmental parameters, and the near-channel interference count, determine whether the cause of the potential bad sector is sector aging.

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

9. The method according to claim 7, characterized in that, The method further includes: When the preset identification information is used to indicate that the potential bad sector is a pseudo bad sector, and / or the near-channel interference count is greater than or equal to a preset count threshold, the potential bad sector is repaired.

10. The method according to claim 2, characterized in that, The method further includes: Obtain the physical location information corresponding to the potential bad sectors; Based on the physical location information corresponding to the potential bad sectors, the second weight is adjusted to obtain the adjusted second weight. The adjusted second weight, along with the first quantity, the first weight, and the second quantity, are used to determine the health status of the hard drive to be tested.

11. The method according to claim 10, characterized in that, The step of adjusting the second weight based on the physical location information to obtain the adjusted second weight includes: When the number of potential bad sectors in a preset hard drive area of ​​the hard drive to be tested is greater than the third preset threshold, the second weight is increased to obtain the adjusted second weight.

12. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the hard disk detection method as described in any one of claims 1-11 when executing the computer program.

13. 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 as described in any one of claims 1-11.

14. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the hard disk detection method as described in any one of claims 1-11.

Citation Information

Patent Citations

  • Hard disk fault detection method and device

    CN103197995A

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

    CN120469631A