Hard disk detection method, system and equipment and computer readable storage medium

By controlling the working status on the hard disk, performing random write operations and firmware upgrades, and collecting the IO zero drop time and maximum tail delay, the problem of not being able to analyze the impact of firmware upgrades is solved, and accurate analysis and comprehensive improvement of hard disk performance is achieved.

CN119003256APending Publication Date: 2024-11-22INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411215003.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-30
Publication Date
2024-11-22

AI Technical Summary

Technical Problem

The existing technology cannot effectively analyze the impact of firmware upgrades on hard disk performance, and it is impossible to predict whether firmware upgrades will have an impact on hard disk.

Method used

By controlling the hard disk to enter the set working state, perform random write operations and send firmware upgrade instructions, collect the IO zero drop time and maximum tail delay, detect whether the deviation between them is greater than the set threshold, and save the data for performance analysis if it is less than or equal to the one. , if it is greater than, it returns to the initial state.

Benefits of technology

It realizes the acquisition of hard disk performance data during the firmware upgrade process of uninterrupted services, accurately analyzes the impact of firmware upgrades on hard disk performance, fills the technical gap that cannot be expected to affect firmware upgrades, and improves the comprehensiveness of hard disk performance analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119003256A_ABST
    Figure CN119003256A_ABST
Patent Text Reader

Abstract

The invention discloses a hard disk detection method, system and device and a computer readable storage medium. A to-be-detected hard disk is controlled to enter a set working state; performing random write operation on the to-be-detected hard disk, and sending a firmware upgrading instruction of the uninterrupted service to the to-be-detected hard disk; collecting IO zero-falling time and maximum tail time delay of the to-be-detected hard disk, wherein the maximum tail time delay comprises a value when the total time delay data is 100%; detecting whether the deviation between the IO zeroing time of the to-be-detected hard disk and the maximum tail time delay of the to-be-detected hard disk is greater than a set threshold value or not; if the deviation is smaller than or equal to the set threshold value, the IO zero-falling time of the to-be-detected hard disk and the maximum tail time delay of the to-be-detected hard disk are stored; and if the deviation is greater than the set threshold value, returning to execute the step of controlling the to-be-detected hard disk to enter the set working state. According to the method and the device, the accurate IO zero-drop time and the maximum tail time delay can be obtained, so that the influence of firmware upgrading on the hard disk performance can be accurately analyzed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of storage technology, and more specifically, to a hard disk detection method, system, device and computer-readable storage medium. Background Art

[0002] Currently, the firmware can be upgraded when the hard disk is performing business operations, such as reading and writing, querying any information of the disk, or clearing data in the disk. This upgrade operation is not affected by any business status of the solid-state drive. However, it is impossible to predict whether the firmware upgrade will affect the hard disk, and it is impossible to conduct a comprehensive analysis of the hard disk performance.

[0003] In summary, how to analyze the impact of firmware upgrade on hard disk performance is an urgent problem to be solved by those skilled in the art. Summary of the invention

[0004] The purpose of this application is to provide a hard disk detection method, which can solve the technical problem of how to analyze the impact of firmware upgrade on hard disk performance to a certain extent. This application also provides a hard disk detection system, electronic equipment and computer readable storage medium.

[0005] In order to achieve the above objectives, this application provides the following technical solutions:

[0006] A hard disk detection method, comprising:

[0007] Control the hard disk to be tested to enter the set working state;

[0008] Performing a random write operation on the hard disk to be detected, and sending a firmware upgrade instruction for uninterrupted service to the hard disk to be detected;

[0009] Collect the IO drop-to-zero time and the maximum tail delay of the hard disk to be tested, where the maximum tail delay includes the value when the total delay data is 100%;

[0010] Detect whether the deviation between the IO drop-to-zero time of the hard disk to be detected and the maximum tail delay of the hard disk to be detected is greater than a set threshold;

[0011] If the deviation is less than or equal to the set threshold, the IO drop-to-zero time of the hard disk to be detected and the maximum tail delay of the hard disk to be detected are saved to perform performance analysis on the hard disk to be detected;

[0012] If the deviation is greater than the set threshold, the process returns to the step of controlling the hard disk to be detected to enter a set working state.

[0013] In an exemplary embodiment, after saving the IO drop-to-zero time of the hard disk to be detected and the maximum tail delay of the hard disk to be detected, the method further includes:

[0014] Accumulate the real-time number of save operations;

[0015] Detecting whether the real-time number value is less than the set number value;

[0016] If the real-time number value is greater than or equal to the set number value, the saved IO drop-to-zero time of the hard disk to be detected is calculated to obtain the target IO drop-to-zero time of the hard disk to be detected, and the maximum tail delay of the hard disk to be detected is calculated to obtain the target maximum tail delay of the hard disk to be detected;

[0017] If the real-time number value is less than the set number value, the process returns to the step of controlling the hard disk to be detected to enter the set working state.

[0018] In an exemplary embodiment, the calculating the saved IO drop to zero time of the hard disk to be detected to obtain the target IO drop to zero time of the hard disk to be detected includes:

[0019] Taking an average of the saved IO drop to zero time of the hard disk to be detected, to obtain a target IO drop to zero time of the hard disk to be detected;

[0020] The calculating the maximum tail delay of the hard disk to be detected to obtain the target maximum tail delay of the hard disk to be detected includes:

[0021] The maximum tail delays of the hard disk to be detected are averaged to obtain the target maximum tail delay of the hard disk to be detected.

[0022] In an exemplary embodiment, the step of controlling the hard disk to be detected to enter a set working state includes:

[0023] Formatting the hard disk to be detected, clearing all data in the hard disk to be detected, so as to control the hard disk to be detected to enter a set empty disk state;

[0024] or,

[0025] Formatting the hard disk to be tested, and clearing all data in the hard disk to be tested;

[0026] Performing two full-disk sequential writes on the hard disk to be detected, and then performing random writes, so as to control the hard disk to be detected to enter a set steady state;

[0027] The steady state includes a state where garbage collection is performed as long as data is written.

[0028] In an exemplary embodiment, after performing a random write operation on the hard disk to be detected and sending a firmware upgrade instruction for uninterrupted service to the hard disk to be detected, the method further includes:

[0029] Reading data from the hard disk to be detected to obtain read data;

[0030] Whether the random write operation is accurate is detected based on the read data, and the corresponding random write detection result is recorded.

[0031] In an exemplary embodiment, it further includes:

[0032] Get the IO zero drop time and maximum tail latency of other hard disks;

[0033] The maximum tail delay of the hard disk to be calculated is converted to obtain a converted maximum tail delay whose time unit is consistent with the IO drop zero time; the hard disk to be calculated includes other hard disks and the hard disk to be detected;

[0034] Generate the difference between the maximum tail delay of the hard disk to be calculated and the IO drop time of the hard disk to be calculated;

[0035] Generate a ratio of the difference to the maximum tail delay of the conversion of the hard disk to be calculated;

[0036] Convert the ratio into a percentage to obtain the deviation rate of the hard disk to be calculated;

[0037] Determine a set number of deviation rate thresholds;

[0038] Counting the values ​​of the deviation rate within each deviation rate threshold;

[0039] Divide the number of values ​​by the total number of deviation rates to obtain a data proportion value corresponding to the deviation rate threshold;

[0040] The deviation rate threshold corresponding to the second largest data proportion value is determined as the set threshold.

[0041] In an exemplary embodiment, after collecting the IO drop-to-zero time and the maximum tail delay of the hard disk to be detected, the method further includes:

[0042] Collect the total IO drop time of the hard disk to be tested;

[0043] After the IO drop-to-zero time of the hard disk to be detected and the maximum tail delay of the hard disk to be detected are saved, the method further includes:

[0044] The total IO drop time of the hard disk to be detected is saved.

[0045] A hard disk detection system, comprising:

[0046] The first control module is used to control the hard disk to be detected to enter a set working state;

[0047] A first operation module, used for performing a random write operation on the hard disk to be detected, and sending a firmware upgrade instruction of uninterrupted service to the hard disk to be detected;

[0048] The first acquisition module is used to collect the IO drop time and the maximum tail delay of the hard disk to be detected;

[0049] The first detection module is used to detect whether the deviation between the IO drop to zero time of the hard disk to be detected and the maximum tail delay of the hard disk to be detected is greater than a set threshold; if the deviation is less than or equal to the set threshold, the IO drop to zero time of the hard disk to be detected and the maximum tail delay of the hard disk to be detected are saved to perform performance analysis on the hard disk to be detected; if the deviation is greater than the set threshold, return to execute the step of controlling the hard disk to be detected to enter a set working state.

[0050] An electronic device, comprising:

[0051] Memory for storing computer programs;

[0052] A processor is used to implement the steps of any of the hard disk detection methods described above when executing the computer program.

[0053] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any of the hard disk detection methods described above are implemented.

[0054] The present application provides a hard disk detection method, which controls a hard disk to be detected to enter a set working state; performs random write operations on the hard disk to be detected, and sends a firmware upgrade instruction for uninterrupted business to the hard disk to be detected; collects the IO drop-to-zero time and the maximum tail delay of the hard disk to be detected, and the maximum tail delay includes the value when the total delay data is 100%; detects whether the deviation between the IO drop-to-zero time of the hard disk to be detected and the maximum tail delay of the hard disk to be detected is greater than a set threshold; if the deviation is less than or equal to the set threshold, saves the IO drop-to-zero time of the hard disk to be detected and the maximum tail delay of the hard disk to be detected to perform performance analysis on the hard disk to be detected; if the deviation is greater than the set threshold, returns to execute the step of controlling the hard disk to be detected to enter the set working state. After the hard disk to be detected enters the set working state, the present application can collect the IO drop to zero time and the maximum tail delay of the hard disk to be detected during the firmware upgrade process of the uninterrupted business as performance data for evaluating the hard disk to be detected, and save the IO drop to zero time and the maximum tail delay only when the deviation between the IO drop to zero time and the maximum tail delay is less than or equal to the set threshold, so as to obtain accurate IO drop to zero time and maximum tail delay, so as to accurately analyze the impact of the firmware upgrade on the hard disk performance, fill the technical gap of whether the firmware upgrade can not be predicted to affect the hard disk, and improve the comprehensiveness of the hard disk performance analysis. A hard disk detection system, electronic device and computer readable storage medium provided by the present application also solve the corresponding technical problems. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0056] Figure 1 A flowchart of a hard disk detection method provided in an embodiment of the present application;

[0057] Figure 2 This is a schematic diagram of IO latency;

[0058] Figure 3 This is a schematic diagram of FIO log;

[0059] Figure 4 This is a schematic diagram of data collection in the empty disk state;

[0060] Figure 5 It is a schematic diagram of data acquisition in steady state;

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

[0062] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0063] Figure 8 Another structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

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

[0065] See also Figure 1 , Figure 1 A flowchart of a hard disk detection method provided in an embodiment of the present application.

[0066] A hard disk detection method provided in an embodiment of the present application may include the following steps:

[0067] Step S101: controlling the hard disk to be detected to enter a set working state.

[0068] In actual applications, considering that the hard disk may have many working states during use, such as empty disk, full disk, data has been written but has not reached steady state, steady state, etc., the performance of the hard disk will be different if the firmware is upgraded under different working states. Therefore, the hard disk to be tested can be controlled to enter the set working state first, so as to subsequently analyze the performance impact of the firmware upgrade of the hard disk under this working state.

[0069] It should be noted that steady state refers to a mode after the hard disk enters a stable state. In this mode, garbage collection will be performed as long as data is written. Garbage collection means that when the hard disk writes new data, it needs to first erase the flash memory blocks occupied by the original data. Due to the characteristics of the flash memory chip, it cannot directly overwrite the written data. Instead, it needs to mark the original data as invalid before performing the erase operation. This process is called garbage collection. In addition, the type of hard disk to be detected can be flexibly determined according to the application scenario, such as a solid state disk (SSD).

[0070] In a specific application scenario, in the process of controlling the hard disk to be tested to enter the set working state, the hard disk to be tested can be formatted and all data in the hard disk to be tested can be cleared to control the hard disk to be tested to enter the set empty disk state, so as to analyze the performance impact of the firmware upgrade on the empty disk hard disk. Of course, it is also possible to format the hard disk to be tested and clear all data in the hard disk to be tested; perform two full-disk sequential writes on the hard disk to be tested, and then perform random writes to control the hard disk to be tested to enter the set steady state; wherein, the steady state includes a state where garbage collection will inevitably be performed as long as data is written, so as to analyze the performance impact of the firmware upgrade on the steady-state hard disk.

[0071] Step S102: Perform a random write operation on the hard disk to be detected, and send a firmware upgrade instruction for uninterrupted service to the hard disk to be detected.

[0072] Step S103: collecting the IO drop-to-zero time and the maximum tail delay of the hard disk to be detected, where the maximum tail delay includes the value when the total delay data is 100%.

[0073] In actual applications, during the performance test of a hard disk, it is necessary to perform random write operations on the hard disk to be tested, and send a firmware upgrade instruction for uninterrupted services to the hard disk to be tested, so that the hard disk to be tested can perform random write operations while performing the firmware upgrade for uninterrupted services, and in this process, the IO drop time and maximum tail delay of the hard disk to be tested can be collected, and the maximum tail delay includes the value when the total delay data is 100%, that is, the maximum tail delay is the value when the total delay data is 100%, so that the performance analysis of the hard disk to be tested can be performed based on the IO drop time and the maximum tail delay. Of course, other data that can be used for performance analysis of the hard disk to be tested can also be collected, and this application does not make specific limitations here.

[0074] It should be noted that when the hard disk is an SSD, the firmware upgrade refers to the following in the NVME1.4 SSD standard protocol: following the NVME download command specified in the standard protocol, implementing the private command NVME fw-download, applying for a fixed-size space in the DDR to store the SSD firmware file transferred by the NVME fw-download command; following the NVME commit command specified in the standard protocol; implementing the private command NVME fw-activate, and refreshing the SSD firmware file downloaded to the DDR by the NVME fw-download to the norflash. If all the SSD firmware files are completed, the slot is switched and the firmware is activated; at the same time, in the NVME2.0 SSD standard protocol, following the NVME download command specified in the standard protocol, implementing the private command NVME fw-download, applying for a fixed-size space in the DDR to store the SSD firmware file transferred by the NVME fw-download command; following the NVME commit command specified in the standard protocol; implementing the private command NVME fw-activate, download the SSD firmware file downloaded to ddr by nvmefw-download, and refresh it to norflash. If all SSD firmware files are completed, perform slot switching and activate the firmware. Non-stop service firmware upgrade (ndu) refers to the firmware upgrade of the solid-state drive in working mode, that is, when executing fio, admin and other operations, without affecting the business operation.

[0075] It should also be noted that the IO drop-to-zero time and the maximum tail latency belong to the hard disk latency. There are three basic types of latency data: slat, clat, and lat. (1) slat refers to the time from when fio submits an I / O request to the system to when the I / O is actually executed. This part is mainly determined by the server processor and operating system, and is also related to the SSD interface protocol and working mode. For tests conducted on physical servers and when asynchronous IO is used, the value of slat is usually very small, about 1 microsecond, which is much smaller than the order of magnitude of clat. (2) clat refers to the time from when I / O is submitted to when I / O is completed. This part is mainly determined by the SSD, but if it is set to a synchronous IO engine, the clat item is meaningless. In this application, the IO engine used can be libaio, which belongs to asynchronous IO. (3) lat refers to the time from when fio creates an I / O to when the I / O is completed, which is equivalent to slat+clat. The average latency is most directly related to the performance of the SSD and the set queue depth. (4) As technology is updated and iterated, more and more users begin to care about the fourth type of latency: clat percentiles, that is, the latency of a specific percentile, commonly known as P99 or tail latency. Since the average cannot represent the actual experience, users are more sensitive to extreme situations. Different users will determine their own confidence intervals based on their own business characteristics and customer types. For example, more relaxed users pay attention to the latency of 95% of requests, such as Figure 2 As shown in the figure, the clat corresponding to 95% (95.00th) is 2704us, which means that 95% of IO requests are completed within 2704us. Strict users will set the standard to 99%, 99.99% or even 100%.

[0076] In addition, the parameters for random write operations on the hard disk to be tested can be flexibly determined according to actual needs. For example, random write operations with bs=4k and QD=1*1 can be performed on the hard disk to be tested. In the FIO library, the BS (Buffer Size) parameter represents the buffer size, that is, the amount of data that can be stored in the buffer during each read and write operation. The BS parameter is a configuration parameter that directly affects the efficiency of file operations. QD represents the number of queues processed simultaneously per unit time. QD=numjobs*iodepth, numjobs represents the number of workers, and iodepth represents the queue depth.

[0077] Step S104: Detect whether the deviation between the IO drop zero time of the hard disk to be detected and the maximum tail delay of the hard disk to be detected is greater than a set threshold; if the deviation is less than or equal to the set threshold, execute step S105; if the deviation is greater than the set threshold, execute step S106.

[0078] Step S105: Save the IO zero-drop time and the maximum tail latency of the hard disk to be detected for performance analysis of the hard disk to be detected.

[0079] Step S106: Return to execute the step of controlling the hard disk to be detected to enter the set working state.

[0080] In practical applications, the situation where clat is 100% is the state where fio completely drops to zero. For the sake of understanding, assume that the IO zero-drop time and the maximum tail latency are recorded from the log generated by the FIO tool. As Figure 3 shown, the first column is the time value (i.e., the current data value of FIO is taken every 0.25 seconds), and the second column is the iops value (this item is related to the FIO parameter, and the value is either iops or bw. Bw is the bandwidth, and both the bandwidth and iops are standard values for measuring performance). In Figure 3 , take the average value of the first 10s iops, that is Figure 1 add up all the values in the second column in and take the average value to get iops_avg(93146)=avg(……92996,93120,92940……92980); when iops drops to zero, record the time interval between the two times of dropping to zero, which is the FIO zero-drop value. As Figure 3 shown, the start time of dropping to zero T1 = 13159, the end time of dropping to zero T2 = 13910, and the time interval is 751 (T3)=13910 (T2)-13159 (T1). Since the value of T is in milliseconds, T3 = 0.751s. And since the minimum interval of FIO value is 0.25 seconds, the zero-drop time T0 is 0.75s < T0 < 1.001s; when iops is affected by dropping to zero and the value is below 80% of the average value, record the corresponding time interval as the value of the time affected by iops, that is, iops_stand(74516)=iops_avg(93146)*0.8. The value less than the iops_stand data is the time affected by iops. Record to get T1 = 12158, T2 = 14661, and the time interval is 2503 (T3)=14661 (T2)-12158 (T1). Since the value of T is in milliseconds, T3 = 2.503s. And since the minimum interval of FIO value is 0.25 seconds, the zero-drop time T0 is 2.503s < T0 < 2.753s; as Figure 2The data within the indicated box represents the value when the total delay data is 100%, i.e., T_clat100% = 0.7s. From the above calculations, it can be seen that the time when IO drops to 0 is basically the same as the duration of the 100% delay, with a small difference (T_clat100% = 0.7s, 0.75s < T0 < 1.001s); therefore, when performing operations in such scenarios alone (i.e., without performing other types of disk operations, such as FIO mixed nvme command operations), the clat100% delay value can be used as a reference for the time when IO drops to 0.

[0081] Therefore, by comparing this data with the time when fio drops to 0, it can be used as a reference value to evaluate whether the time when IO drops to 0 is accurate. That is, it can be detected whether the deviation between the time when IO drops to 0 of the hard disk to be detected and the maximum tail delay of the hard disk to be detected is greater than the set threshold; if the deviation is less than or equal to the set threshold, the time when IO drops to 0 of the hard disk to be detected and the maximum tail delay of the hard disk to be detected are saved to perform performance analysis on the hard disk to be detected based on the saved time when IO drops to 0 and the maximum tail delay; if the deviation is greater than the set threshold, the step of controlling the hard disk to be detected to enter the set working state is returned to perform performance testing on the hard disk to be detected again. It should be noted that the saved time when IO drops to 0 and the maximum tail delay can be used not only for analyzing the hard disk performance but also for users, such as allowing users to select the hard disk that best meets their requirements among multiple hard disks.

[0082] In practical applications, considering that there may be errors in single measurement, to reduce this error, after saving the time when IO drops to 0 of the hard disk to be detected and the maximum tail delay of the hard disk to be detected, the real-time number of times of the save operation can also be accumulated, that is, the numerical value of the number of times of the saved time when IO drops to 0 and the maximum tail delay is accumulated; it is detected whether the real-time number of times value is less than the set number of times value; if the real-time number of times value is greater than or equal to the set number of times value, the time when IO drops to 0 of the hard disk to be detected is calculated to obtain the target time when IO drops to 0 of the hard disk to be detected, and the maximum tail delay of the hard disk to be detected is calculated to obtain the target maximum tail delay of the hard disk to be detected, and then the real-time number of times value can be cleared for the next round of number statistics; if the real-time number of times value is less than the set number of times value, the step of controlling the hard disk to be detected to enter the set working state is returned. At this time, the data acquisition process in the empty disk state can be as Figure 4 shown, and the data acquisition process in the steady state can be as Figure 5 shown.

[0083] In a specific application scenario, in the process of calculating the saved IO drop to zero time of the hard disk to be detected and obtaining the target IO drop to zero time of the hard disk to be detected, the saved IO drop to zero time of the hard disk to be detected can be averaged to obtain the target IO drop to zero time of the hard disk to be detected; similarly, in the process of calculating the maximum tail delay of the hard disk to be detected and obtaining the target maximum tail delay of the hard disk to be detected, the maximum tail delay of the hard disk to be detected can be averaged to obtain the target maximum tail delay of the hard disk to be detected, so as to analyze the performance impact of the firmware upgrade on the hard disk to be detected based on the target IO drop to zero time and the target maximum tail delay. Of course, there can be other ways to obtain the target IO drop to zero time and the target maximum tail delay, which are not specifically limited in this application.

[0084] In actual applications, after performing random write operations on the hard disk to be tested and sending uninterrupted business firmware upgrade instructions to the hard disk to be tested, data can also be read from the hard disk to be tested to obtain the read data; based on the read data, whether the random write operation is accurate is detected, and the corresponding random write test results are recorded to accurately analyze the impact of the firmware upgrade on the random write operation of the hard disk to be tested.

[0085] In practical applications, the hard disk detection method of the present application may also include the following steps: obtaining the IO drop time and maximum tail delay of other hard disks, and the IO drop time and maximum tail delay of other hard disks are determined in the same way as the hard disk to be detected; converting the maximum tail delay of the hard disk to be calculated to obtain a conversion maximum tail delay whose time unit is consistent with the IO drop time; the hard disk to be calculated includes other hard disks and hard disks to be detected; generating a difference between the conversion maximum tail delay of the hard disk to be calculated and the IO drop time of the hard disk to be calculated; generating a ratio of the difference to the conversion maximum tail delay of the hard disk to be calculated; performing percentage conversion on the comparison value to obtain a deviation rate of the hard disk to be calculated; determining a set number of deviation rate thresholds, such as the deviation rate thresholds are (-10%, 10%), (10%, 15%), (-15%, 15%), etc.; counting the number of deviation rate values ​​within each deviation rate threshold; dividing the number of deviation rates by the total number of deviation rates to obtain the data proportion value corresponding to the deviation rate threshold; and determining the deviation rate threshold corresponding to the second largest data proportion value as the set threshold.

[0086] From this implementation process, it can be seen that in the process of determining the set threshold, the present application obtains the IO drop time and the maximum tail delay of other hard disks; then, according to the IO drop time and the maximum tail delay of the hard disk to be detected, the deviation rate between the two data of the hard disk to be detected is calculated, and according to the IO drop time and the maximum tail delay of other hard disks, the deviation rate between the two data of other hard disks is calculated, so that the deviation rate between the IO drop time and the maximum tail delay of each hard disk can be known; then, the individual values ​​of the deviation rate within each deviation rate threshold are counted, and the individual values ​​are divided by the total number of deviation rates to obtain the data proportion value corresponding to the deviation rate threshold, so as to analyze the distribution of the deviation rate through the data proportion value; finally, the deviation rate threshold corresponding to the second largest data proportion value is determined as the set threshold, and the set threshold is determined by comprehensively analyzing the deviation rates of each hard disk, so that the set threshold is consistent with the deviation rate of each hard disk, and the accuracy of the set threshold is improved, so that the set threshold can be used to accurately detect whether the deviation between the IO drop time and the maximum tail delay is too large, thereby ensuring the accuracy of the hard disk detection method.

[0087] In order to facilitate understanding of the principle of determining the threshold value in this application, it is assumed that the IO drop time and maximum tail delay of each hard disk in an empty disk and steady state are as shown in Table 1, Table 2 and Table 3:

[0088] Table 1 The first part of the hard disk test results

[0089]

[0090] Table 2 The second part of the hard disk test results

[0091]

[0092] Table 3 Hard disk test results for the third part

[0093]

[0094] The calculation formula for the deviation rate in the three tables is: Deviation rate = (clat100% (us) / 1000000-fall time s) / (clat100% (us) / 1000000) * 100%; after statistics on the deviation rate of the hard disk according to Table 4, the data proportion is shown in Table 5, where G2: G115 data in Table 4 are deviation rate column data, 114 refers to the total row data of the deviation rate, and J2 is the number of deviation rates that fall within this deviation rate threshold.

[0095] Table 4 Data percentage statistics

[0096]

[0097] Table 5 Schematic diagram of data proportion

[0098]

[0099] It can be seen from Table 1 to Table 5 that the value of clat100% is basically the same as the value of fall0. Therefore, the data of clat100% can be used as a reference value for the fall0 value. If the deviation is within a certain range, the fall0 data is considered valid; otherwise, the fall0 data is invalid and needs to be retested. Moreover, according to the actual deviation rate values in Table 5, it can be seen that the data with a deviation rate in the range of -10% < P < 10% accounts for 71%, the data with a deviation rate in the range of -15% < P < 15% accounts for 84%, but the data with a deviation rate in the range of -20% < P < 20% only increases by 1% to 85%. From this, it can be concluded that the deviation rate values in the range of -15% < P < 15% can be recognized as reliable data, that is, the reference value of the fall0 data, and the data outside this range needs to be re-verified and tested.

[0100] In a specific application scenario, in the process of determining the deviation rate threshold corresponding to the second largest data occupancy ratio as the set threshold, the deviation rate threshold corresponding to the first largest data occupancy ratio can be first determined as the first candidate deviation rate threshold, the deviation rate threshold corresponding to the second largest data occupancy ratio can be determined as the second candidate deviation rate threshold, a first difference between the first candidate deviation rate threshold and the second candidate deviation rate threshold is generated, a second difference between the first largest data occupancy ratio and the second largest data occupancy ratio is generated, it is detected whether the second difference is less than a first preset difference and it is detected whether the first difference is greater than a second preset difference. If the second difference is less than the first preset difference and the first difference is greater than or equal to the second preset difference, then the deviation rate threshold corresponding to the second largest data occupancy ratio can be determined as the set threshold; otherwise, the deviation rate threshold corresponding to the first largest data occupancy ratio is determined as the set threshold.

[0101] From this implementation process, it can be seen that in the process of determining the deviation rate threshold corresponding to the second largest data proportion value as the set threshold, the present application determines the deviation rate threshold corresponding to the first largest data proportion value as the first deviation rate threshold to be selected, determines the deviation rate threshold corresponding to the second largest data proportion value as the second deviation rate threshold to be selected, generates a first difference between the first deviation rate threshold to be selected and the second deviation rate threshold to be selected, and generates a second difference between the first largest data proportion value and the second largest data proportion value, so as to quantify the gap between the first deviation rate threshold to be selected and the second deviation rate threshold to be selected through the first difference, and quantify the gap between the first largest data proportion value and the second deviation rate threshold to be selected through the second difference. the difference between the second largest data proportion values; then, only when the second difference is less than the first preset difference and the first difference is greater than or equal to the second preset difference, the deviation rate threshold corresponding to the second largest data proportion value can be determined as the set threshold, otherwise, the deviation rate threshold corresponding to the first largest data proportion value needs to be determined as the set threshold. In this way, when the difference between the data proportion values ​​is too small and the difference between the deviation rate thresholds is too large, the deviation rate threshold corresponding to the second largest data proportion value is determined as the set threshold, which can avoid the setting threshold being too large and causing the hard disk detection accuracy to decrease. In other words, the accuracy of the hard disk detection can be further guaranteed.

[0102] In actual applications, after collecting the IO drop to zero time and the maximum tail delay of the hard disk to be tested, the total IO drop time of the hard disk to be tested can also be collected; correspondingly, after saving the IO drop to zero time and the maximum tail delay of the hard disk to be tested, the total IO drop time of the hard disk to be tested can also be saved, so as to analyze the performance impact of the firmware upgrade on the hard disk to be tested based on the total IO drop time.

[0103] The present application provides a hard disk detection method, which controls a hard disk to be detected to enter a set working state; performs random write operations on the hard disk to be detected, and sends a firmware upgrade instruction for uninterrupted business to the hard disk to be detected; collects the IO drop-to-zero time and the maximum tail delay of the hard disk to be detected, and the maximum tail delay includes the value when the total delay data is 100%; detects whether the deviation between the IO drop-to-zero time of the hard disk to be detected and the maximum tail delay of the hard disk to be detected is greater than a set threshold; if the deviation is less than or equal to the set threshold, saves the IO drop-to-zero time of the hard disk to be detected and the maximum tail delay of the hard disk to be detected to perform performance analysis on the hard disk to be detected; if the deviation is greater than the set threshold, returns to execute the step of controlling the hard disk to be detected to enter the set working state. After the hard disk to be detected enters the set working state, the present application can collect the IO drop-to-zero time and the maximum tail delay of the hard disk to be detected during the firmware upgrade process of uninterrupted business as performance data for evaluating the hard disk to be detected, and save the IO drop-to-zero time and the maximum tail delay only when the deviation between the IO drop-to-zero time and the maximum tail delay is less than or equal to the set threshold, so as to obtain accurate IO drop-to-zero time and maximum tail delay, so as to accurately analyze the impact of the firmware upgrade on the hard disk performance, fill the technical gap of whether the firmware upgrade can not predict whether the hard disk will be affected, and improve the comprehensiveness of the hard disk performance analysis.

[0104] See also Figure 6 , Figure 6 A structural schematic diagram of a hard disk detection system provided in an embodiment of the present application.

[0105] A hard disk detection system provided in an embodiment of the present application may include:

[0106] The first control module 101 is used to control the hard disk to be detected to enter a set working state;

[0107] The first operation module 102 is used to perform a random write operation on the hard disk to be detected, and send a firmware upgrade instruction of uninterrupted service to the hard disk to be detected;

[0108] The first acquisition module 103 is used to collect the IO drop time and the maximum tail delay of the hard disk to be detected, where the maximum tail delay includes the value when the total delay data is 100%;

[0109] The first detection module 104 is used to detect whether the deviation between the IO drop to zero time of the hard disk to be detected and the maximum tail delay of the hard disk to be detected is greater than a set threshold; if the deviation is less than or equal to the set threshold, the IO drop to zero time of the hard disk to be detected and the maximum tail delay of the hard disk to be detected are saved to perform performance analysis on the hard disk to be detected; if the deviation is greater than the set threshold, return to the step of controlling the hard disk to be detected to enter the set working state.

[0110] A hard disk detection system provided in an embodiment of the present application may further include:

[0111] A first accumulation module, configured to accumulate the real-time number of execution of the saving operation after the first detection module saves the IO drop zero time of the hard disk to be detected and the maximum tail delay of the hard disk to be detected;

[0112] The second detection module is used to detect whether the real-time count value is less than the set count value; if the real-time count value is greater than or equal to the set count value, the saved IO drop-to-zero time of the hard disk to be detected is calculated to obtain the target IO drop-to-zero time of the hard disk to be detected, and the maximum tail delay of the hard disk to be detected is calculated to obtain the target maximum tail delay of the hard disk to be detected; if the real-time count value is less than the set count value, return to the step of controlling the hard disk to be detected to enter the set working state.

[0113] In a hard disk detection system provided in an embodiment of the present application, the second detection module may include:

[0114] The first processing unit is used to average the saved IO drop to zero time of the hard disk to be detected to obtain the target IO drop to zero time of the hard disk to be detected;

[0115] The second processing unit is used to average the maximum tail delays of the hard disk to be detected to obtain a target maximum tail delay of the hard disk to be detected.

[0116] In an embodiment of the present application, a hard disk detection system is provided, wherein the first control module may include:

[0117] The first control unit is used to format the hard disk to be detected and clear all data in the hard disk to be detected, so as to control the hard disk to be detected to enter a set empty disk state;

[0118] or,

[0119] The second control unit is used to format the hard disk to be tested and clear all data in the hard disk to be tested; perform two full-disk sequential writes on the hard disk to be tested, and then perform random writes to control the hard disk to be tested to enter a set steady state; wherein the steady state includes a state in which garbage collection will be performed as long as data is written.

[0120] A hard disk detection system provided in an embodiment of the present application may further include:

[0121] A first reading module is used for the first operation module to perform a random write operation on the hard disk to be detected, and after sending a firmware upgrade instruction of uninterrupted service to the hard disk to be detected, to read data from the hard disk to be detected to obtain read data;

[0122] The third detection module is used to detect whether the random write operation is accurate based on the read data, and record the corresponding random write detection result.

[0123] A hard disk detection system provided in an embodiment of the present application may further include:

[0124] The first acquisition module is used to obtain the IO drop time and maximum tail delay of other hard disks;

[0125] The first conversion module is used to convert the maximum tail delay of the hard disk to be calculated to obtain a conversion maximum tail delay whose time unit is consistent with the IO drop zero time; the hard disk to be calculated includes other hard disks and the hard disk to be detected;

[0126] The first generating module is used to generate the difference between the maximum tail delay of the conversion of the hard disk to be calculated and the IO drop time of the hard disk to be calculated;

[0127] The second generating module is used to generate a ratio of the difference value to the maximum tail delay of the conversion of the hard disk to be calculated;

[0128] The second conversion module is used to convert the comparison value into a percentage to obtain the deviation rate of the hard disk to be calculated;

[0129] A first determination module, used to determine a set number of deviation rate thresholds;

[0130] A first statistical module, used for counting the number of deviation rates within each deviation rate threshold;

[0131] The third generation module is used to divide the individual value by the total number of deviation rates to obtain a data proportion value corresponding to the deviation rate threshold;

[0132] The second determination module is used to determine the deviation rate threshold corresponding to the second largest data proportion value as the set threshold.

[0133] A hard disk detection system provided in an embodiment of the present application may further include:

[0134] The second acquisition module is used to collect the IO total drop time of the hard disk to be detected after the first acquisition module collects the IO drop zero time and the maximum tail delay of the hard disk to be detected;

[0135] The first detection module may also be used to: save the IO drop zero time of the hard disk to be detected and the maximum tail delay of the hard disk to be detected, and then save the IO total drop time of the hard disk to be detected.

[0136] The present application also provides an electronic device and a computer-readable storage medium, both of which have the corresponding effects of the hard disk detection method provided in the embodiment of the present application. Figure 7 , Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0137] An electronic device provided in an embodiment of the present application includes a memory 201 and a processor 202. The memory 201 stores a computer program. When the processor 202 executes the computer program, the steps of the hard disk detection method described in any of the above embodiments are implemented.

[0138] See also Figure 8 , another electronic device provided in the embodiment of the present application may also include: an input port 203 connected to the processor 202, for transmitting commands input from the outside to the processor 202; a display unit 204 connected to the processor 202, for displaying the processing results of the processor 202 to the outside; a communication module 205 connected to the processor 202, for realizing communication between the electronic device and the outside. The display unit 204 can be a display panel, a laser scanning display, etc.; the communication method adopted by the communication module 205 includes but is not limited to mobile high-definition link technology (Mobile High-Definition Link, MHL), Universal Serial Bus (Universal Serial Bus, USB), High-Definition Multimedia Interface (High-DefinitionMultimedia Interface, HDMI), wireless connection: wireless fidelity technology (WIreless Fidelity, WiFi), Bluetooth communication technology, low-power Bluetooth communication technology, and communication technology based on IEEE802.11s.

[0139] An embodiment of the present application 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 the hard disk detection method described in any of the above embodiments are implemented.

[0140] The computer-readable storage medium involved in this application includes random access memory (RAM), memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disks, removable disks, CD-ROMs (Compact Disc Read-Only Memory), or any other form of storage medium known in the technical field.

[0141] A computer program product provided in an embodiment of the present application includes a computer program / instruction, which, when executed by a processor, implements the steps of the hard disk detection method described in any of the above embodiments.

[0142] For the description of the relevant parts of a hard disk detection system, electronic device, computer-readable storage medium, and computer program product provided in the embodiments of the present application, please refer to the detailed description of the corresponding parts in a hard disk detection method provided in the embodiments of the present application, which will not be repeated here. In addition, the parts of the above technical solutions provided in the embodiments of the present application that are consistent with the implementation principles of the corresponding technical solutions in the prior art are not described in detail to avoid excessive elaboration.

[0143] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0144] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A hard disk detection method, characterized in that: include: Control the hard disk to be tested to enter the set working state; Performing a random write operation on the hard disk to be detected, and sending a firmware upgrade instruction for uninterrupted service to the hard disk to be detected; Collect the IO drop-to-zero time and the maximum tail delay of the hard disk to be tested, where the maximum tail delay includes the value when the total delay data is 100%; Detect whether the deviation between the IO drop-to-zero time of the hard disk to be detected and the maximum tail delay of the hard disk to be detected is greater than a set threshold; If the deviation is less than or equal to the set threshold, the IO drop-to-zero time of the hard disk to be detected and the maximum tail delay of the hard disk to be detected are saved to perform performance analysis on the hard disk to be detected; If the deviation is greater than the set threshold, the process returns to the step of controlling the hard disk to be detected to enter a set working state.

2. The method according to claim 1, characterized in that After the IO drop-to-zero time of the hard disk to be detected and the maximum tail delay of the hard disk to be detected are saved, the method further includes: Accumulate the real-time number of save operations; Detecting whether the real-time number value is less than the set number value; If the real-time number value is greater than or equal to the set number value, the saved IO drop-to-zero time of the hard disk to be detected is calculated to obtain the target IO drop-to-zero time of the hard disk to be detected, and the maximum tail delay of the hard disk to be detected is calculated to obtain the target maximum tail delay of the hard disk to be detected; If the real-time number value is less than the set number value, the process returns to the step of controlling the hard disk to be detected to enter the set working state.

3. The method according to claim 2, characterized in that The step of calculating the saved IO drop to zero time of the hard disk to be detected to obtain a target IO drop to zero time of the hard disk to be detected includes: Taking an average of the saved IO drop to zero time of the hard disk to be detected, to obtain a target IO drop to zero time of the hard disk to be detected; The calculating the maximum tail delay of the hard disk to be detected to obtain the target maximum tail delay of the hard disk to be detected includes: The maximum tail delays of the hard disk to be detected are averaged to obtain the target maximum tail delay of the hard disk to be detected.

4. The method according to claim 1, characterized in that The controlling the hard disk to be detected to enter a set working state includes: Formatting the hard disk to be detected, clearing all data in the hard disk to be detected, so as to control the hard disk to be detected to enter a set empty disk state; or, Formatting the hard disk to be tested, and clearing all data in the hard disk to be tested; Performing two full-disk sequential writes on the hard disk to be detected, and then performing random writes, so as to control the hard disk to be detected to enter a set steady state; The steady state includes a state where garbage collection is performed as long as data is written.

5. The method according to claim 1, characterized in that: After performing a random write operation on the hard disk to be detected and sending a firmware upgrade instruction for uninterrupted service to the hard disk to be detected, the method further includes: Reading data from the hard disk to be detected to obtain read data; Whether the random write operation is accurate is detected based on the read data, and the corresponding random write detection result is recorded.

6. The method according to any one of claims 1 to 5, characterized in that: Also includes: Get the IO zero drop time and maximum tail latency of other hard disks; Convert the maximum tail delay of the hard disk to be calculated to obtain a converted maximum tail delay whose time unit is consistent with the IO drop zero time; The hard disks to be calculated include other hard disks and the hard disk to be detected; Generate the difference between the maximum tail delay of the hard disk to be calculated and the IO drop time of the hard disk to be calculated; Generate a ratio of the difference to the maximum tail delay of the conversion of the hard disk to be calculated; Convert the ratio into a percentage to obtain the deviation rate of the hard disk to be calculated; Determine a set number of deviation rate thresholds; Counting the values ​​of the deviation rate within each deviation rate threshold; Divide the number of values ​​by the total number of deviation rates to obtain a data proportion value corresponding to the deviation rate threshold; The deviation rate threshold corresponding to the second largest data proportion value is determined as the set threshold.

7. The method according to claim 1, characterized in that After collecting the IO drop-to-zero time and the maximum tail delay of the hard disk to be detected, the method further includes: Collect the total IO drop time of the hard disk to be tested; After the IO drop-to-zero time of the hard disk to be detected and the maximum tail delay of the hard disk to be detected are saved, the method further includes: The total IO drop time of the hard disk to be detected is saved.

8. A hard disk detection system, characterized in that: include: The first control module is used to control the hard disk to be detected to enter a set working state; A first operation module, used for performing a random write operation on the hard disk to be detected, and sending a firmware upgrade instruction of uninterrupted service to the hard disk to be detected; A first acquisition module is used to collect the IO drop-to-zero time and the maximum tail delay of the hard disk to be detected, where the maximum tail delay includes the value when the total delay data is 100%; The first detection module is used to detect whether the deviation between the IO drop-to-zero time of the hard disk to be detected and the maximum tail delay of the hard disk to be detected is greater than a set threshold; If the deviation is less than or equal to the set threshold, the IO drop-to-zero time of the hard disk to be detected and the maximum tail delay of the hard disk to be detected are saved to perform performance analysis on the hard disk to be detected; if the deviation is greater than the set threshold, return to execute the step of controlling the hard disk to be detected to enter the set working state.

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

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and 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 7 are implemented.