A slow disc detection method and apparatus
By acquiring device IO service time and using clustering models to generate differentiated slow disk detection thresholds, the problem of traditional detection solutions being unable to identify slow disks is solved, improving the accuracy and adaptability of detection and reducing the impact on business.
Patent Information
- Application Number
- CN202310562322.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-17
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2043-05-17
AI Technical Summary
Traditional BMC fault detection and alarm solutions cannot accurately identify slow disk scenarios, leading to abnormal performance of hard drives or disk arrays and affecting business operations.
By acquiring device I/O service time, a differentiated slow disk detection threshold is generated using a clustering model. Slow disk detection is performed by combining cluster centers and I/O service time, and the threshold is dynamically adjusted to adapt to changes in hard disk performance and business scenarios.
It improves the accuracy and real-time performance of slow disk detection, reduces the impact on business operations, and enables flexible adaptation to different hard drives and scenarios.
Smart Images

Figure CN116644289B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of servers, and in particular to a slow disk detection method and device. BACKGROUND
[0002] Under the background of continuous deepening of digital transformation in various industries, the demand for business high availability and continuity is increasingly obvious. As the infrastructure for providing computing power, the abnormality of the running state of the computing device will directly impact the upper-layer business. Taking a server as an example, at present, server hardware failures will be accurately detected and timely alarmed by a baseboard management controller (BMC), and field operation and maintenance personnel will quickly isolate and replace the server according to the alarm.
[0003] In this process, the abnormal decline in the performance of the hard disk or disk array identified by the disk symbol in the server will also seriously slow down the normal operation of the entire business, and will cause very serious impact on real-time business scenarios. Due to the magnetic degradation, bad tracks or vibration of the hard disk or disk array, the hard disk or disk array may have problems such as slow input / output (IO) response and reduced performance. Such a hard disk or disk array will be referred to as a slow disk, which is not a bad disk. Therefore, the traditional BMC fault detection and alarm scheme cannot cover the slow disk scenario, and the traditional redundant arrays of independent disks (RAID) and platform controller hub (PCH) can only realize the judgment and reporting of the running state of the member disk corresponding to the hard disk or disk array identified by the disk symbol, and cannot accurately identify the slow disk scenario. SUMMARY
[0004] Embodiments of the present application provide a slow disk detection method and device, which can improve the accuracy of slow disk identification.
[0005] In a first aspect, the embodiments of the present application provide a slow disk detection method, which comprises: obtaining device input / output (IO) service time of a target device, the device IO service time comprising IO service time corresponding to each disk symbol in N1 disk symbols; determining K1 distances based on the device IO service time and K1 cluster centers; K1 and N1 are positive integers; one cluster center corresponds to one slow disk detection threshold; determining a target distance from the K1 distances, a target cluster center corresponding to the target distance from the K1 cluster centers, and a target slow disk detection threshold corresponding to the target cluster center; and performing slow disk detection on hard disks or logical hard disks identified by each disk symbol in the target device based on the target slow disk detection threshold and the IO service time corresponding to each disk symbol.
[0006] In the technical solution, accurate identification of the slow disk scenario can be achieved from the perspective of the IO performance corresponding to the disk symbol, and a suitable target slow disk detection threshold can be selected through the distance between the device IO service time and the cluster center, thereby solving the problem of single solidification of the slow disk detection threshold and improving the accuracy and effectiveness of slow disk detection.
[0007] In an implementation manner, the method further includes: inputting the M training samples into the clustering model to obtain K1 cluster sets and K1 cluster centers output by the clustering model, and one cluster set corresponds to one cluster center; generating K1 slow disk detection thresholds based on the K1 cluster centers; and each of the M training samples includes the historical IO service time corresponding to each of N1 disk symbols.
[0008] In the technical solution, the K1 cluster centers are generated by using the clustering model, so that the slow disk detection threshold can be customized differently, the problem of single solidification of the slow disk detection threshold is solved, and the accuracy of slow disk detection is improved. In addition, since the clustering model has the unsupervised learning feature, the slow disk detection threshold of hard disks or logical hard disks of different manufacturers, different types and different models in different scenarios can be customized differently, and the flexibility of slow disk detection threshold customization is improved.
[0009] In an implementation manner, the method further includes: inputting the M first training samples into the clustering model to obtain K2 initial cluster sets and K2 initial cluster centers output by the clustering model, and one initial cluster set corresponds to one initial cluster center; K2 is a positive integer; generating K2 initial slow disk detection thresholds based on the K2 initial cluster centers; inputting the M second training samples into the clustering model to obtain K1 cluster sets and K1 cluster centers output by the clustering model; K1 is a positive integer; generating K1 reference slow disk detection thresholds based on the K1 cluster centers; updating the K2 initial slow disk detection thresholds based on the K1 reference slow disk detection thresholds to obtain K1 slow disk detection thresholds; and each of the first training samples includes the historical IO service time corresponding to each of N2 disk symbols, each of the second training samples includes the historical IO service time corresponding to each of N1 disk symbols, and N2 is a positive integer.
[0010] In the technical solution, by updating the initial slow disk detection threshold, the impact of hard disk performance changes, hard disk replacement and changes in business scenarios on the slow disk detection standard can be solved, so that a set of slow disk detection thresholds that can be customized differently and adjusted dynamically can be obtained, and the subsequent slow disk detection is more real-time, more practical, and the impact of slow disk on customer business is reduced.
[0011] In an implementation manner, inputting the M second training samples into the clustering model comprises: inputting the M second training samples into the clustering model when a time difference between a generation time of the K2 initial slow disk detection thresholds and a current time is greater than or equal to a time threshold.
[0012] In an implementation manner, inputting the M second training samples into the clustering model comprises: inputting the M second training samples into the clustering model in a case where it is detected that attribute information corresponding to a disk symbol in the target device changes; wherein the attribute information comprises a hard disk serial number or RAID information of a logical disk, and the RAID information comprises at least one of a RAID card model corresponding to the logical disk, a RAID group quantity, a RAID group level, a RAID group read-write strategy, and member disk information in a RAID group.
[0013] In an implementation manner, inputting the M second training samples into the clustering model comprises:
[0014] Inputting the M second training samples into the clustering model when a detection threshold update trigger instruction is received.
[0015] In an implementation manner, the target slow disk detection threshold comprises a detection threshold corresponding to each of the N1 disk symbols; and the slow disk detection on the hard disk or the logical hard disk identified by each disk symbol in the target device based on the target slow disk detection threshold and IO service time corresponding to each disk symbol comprises: determining the detection threshold corresponding to a target disk symbol from the target detection threshold; the target disk symbol is any one of the N1 disk symbols; if the IO service time corresponding to the target disk symbol is greater than the detection threshold corresponding to the target disk symbol, updating a parameter value of a first parameter based on a parameter value of a second parameter to obtain a parameter update value of the first parameter; and initializing the parameter value of the second parameter to obtain a parameter update value of the second parameter; the first parameter is used to represent a number of times that the IO service time corresponding to the target disk symbol is greater than the detection threshold corresponding to the target disk symbol; the second parameter is used to represent a number of times that the target disk symbol is normal, and the target disk symbol is normal refers to that the IO service time corresponding to the target disk symbol is less than or equal to the detection threshold corresponding to the target disk symbol and the parameter value of the first parameter is greater than 0; and if the parameter update value of the first parameter is greater than a number threshold, determining that the hard disk or the logical hard disk identified by the target disk symbol is a slow disk, and the number threshold is greater than 0.
[0016] In the technical scheme, the first parameter and the second parameter are introduced to perform the slow disk detection on the hard disk or the logical hard disk identified by each disk symbol, the accuracy of the disk symbol detection is improved, each time the IO service time corresponding to each disk symbol in the N1 disk symbols is sampled, a corresponding appropriate target slow disk detection threshold is selected, the problem of single solidification of the slow disk detection threshold is solved, and the slow disk detection is more time-efficient and accurate.
[0017] In an implementation manner, the method further comprises: if the parameter update value of the first parameter is less than or equal to the threshold of times, and the parameter update value of the first parameter is greater than or equal to 0, continuing to acquire the device IO service time of the target device.
[0018] In an implementation manner, the method further comprises: if the parameter update value of the first parameter is less than 0, initializing the parameter update value of the first parameter, and continuing to acquire the device IO service time of the target device.
[0019] In an implementation manner, the method further comprises: if the IO service time corresponding to the target drive letter is less than or equal to the detection threshold corresponding to the target drive letter, and the parameter value of the first parameter is greater than 0, updating the parameter value of the second parameter to obtain the parameter update value of the second parameter, and continuing to acquire the device IO service time of the target device.
[0020] In an implementation manner, the parameter value of the first parameter is an initial value obtained by initializing the first parameter, or the parameter value of the first parameter is the parameter update value of the first parameter obtained when the last slow disk detection is performed.
[0021] The parameter value of the second parameter is an initial value obtained by initializing the second parameter, or the parameter value of the second parameter is the parameter update value of the second parameter obtained when the last slow disk detection is performed.
[0022] In an implementation manner, acquiring the device input / output (IO) service time of the target device comprises: acquiring the device IO service time of the target device at a first sampling frequency; or acquiring the device IO service time of the target device at a second sampling frequency; wherein the first sampling frequency is less than the second sampling frequency.
[0023] In the technical solution, when the parameter update value of the first parameter is greater than or equal to 0, it means that the hard disk or the logical hard disk identified by the target drive letter may be a slow disk, and therefore the sampling frequency can be adjusted to the second sampling frequency, the sampling frequency is increased, and the acquisition of the device IO service time of the target device is accelerated.
[0024] In a second aspect, an embodiment of the present application provides a slow disk detection device, which comprises:
[0025] An acquisition unit, configured to acquire a device input / output (IO) service time of a target device, wherein the device IO service time comprises an IO service time corresponding to each drive letter in N1 drive letters;
[0026] A processing unit, configured to determine K1 distances based on the device IO service time and K1 cluster centers, wherein K1 and N1 are positive integers, and one cluster center corresponds to one slow disk detection threshold.
[0027] The processing unit is further configured to determine a target distance from the K1 distances, determine a target cluster center corresponding to the target distance from the K1 cluster centers, and determine a target slow disk detection threshold corresponding to the target cluster center.
[0028] The processing unit is further configured to perform slow disk detection on the hard disk or the logical hard disk identified by each disk symbol in the target device based on the target slow disk detection threshold and the IO service time corresponding to each disk symbol.
[0029] In an implementation manner, the processing unit is specifically configured to:
[0030] input the M training samples into the clustering model to obtain K1 cluster sets output by the clustering model and K1 cluster centers, one cluster set corresponding to one cluster center;
[0031] generate K1 slow disk detection thresholds based on the K1 cluster centers;
[0032] Each of the M training samples includes the historical IO service time corresponding to each of N1 disk symbols.
[0033] In an implementation manner, the processing unit is specifically configured to:
[0034] input the M first training samples into the clustering model to obtain K2 initial cluster sets output by the clustering model and K2 initial cluster centers, one initial cluster set corresponding to one initial cluster center; K2 is a positive integer;
[0035] generate K2 initial slow disk detection thresholds based on the K2 initial cluster centers;
[0036] input the M second training samples into the clustering model to obtain K1 cluster sets output by the clustering model and K1 cluster centers; K1 is a positive integer;
[0037] generate K1 reference slow disk detection thresholds based on the K1 cluster centers;
[0038] update the K2 initial slow disk detection thresholds based on the K1 reference slow disk detection thresholds to obtain K1 slow disk detection thresholds;
[0039] Each of the first training samples includes the historical IO service time corresponding to each of N2 disk symbols, each of the second training samples includes the historical IO service time corresponding to each of N1 disk symbols, and N2 is a positive integer.
[0040] In an implementation manner, the processing unit is specifically configured to:
[0041] When a time difference between a generation time of the K2 initial slow disk detection thresholds and a current time is greater than or equal to a time threshold, input the M second training samples to the clustering model.
[0042] In an implementation manner, the processing unit is specifically configured to:
[0043] In a case where it is detected that attribute information corresponding to a disk symbol in the target device changes, input the M second training samples to the clustering model; the attribute information includes a hard disk serial number or RAID information of a logical disk, and the RAID information includes at least one of a RAID card model corresponding to the logical disk, a RAID group quantity, a RAID group level, a RAID group read-write strategy, and member disk information in a RAID group.
[0044] In an implementation manner, the processing unit is specifically configured to:
[0045] When the detection threshold update trigger instruction is received, input the M second training samples to the clustering model.
[0046] In an implementation manner, the target slow disk detection threshold includes a detection threshold corresponding to each of N1 disk symbols; the processing unit is specifically configured to:
[0047] Determine the detection threshold corresponding to the target disk symbol from the target detection threshold; the target disk symbol is any one of the N1 disk symbols;
[0048] If the IO service time of the target disk symbol is greater than the detection threshold corresponding to the target disk symbol, update a parameter value of a first parameter based on a parameter value of a second parameter to obtain a parameter update value of the first parameter, and initialize the parameter value of the second parameter to obtain a parameter update value of the second parameter; the first parameter is used to represent a number of times that the IO service time of the target disk symbol is greater than the detection threshold corresponding to the target disk symbol; the second parameter is used to represent a number of times that the target disk symbol is normal, and the target disk symbol normal means that the IO service time of the target disk symbol is less than or equal to the detection threshold corresponding to the target disk symbol and the parameter value of the first parameter is greater than 0;
[0049] If the parameter update value of the first parameter is greater than a number threshold, determine that a hard disk or a logical disk identified by the target disk symbol is a slow disk, and the number threshold is greater than 0.
[0050] In an implementation manner, the obtaining unit is further configured to:
[0051] If the parameter update value of the first parameter is less than or equal to the number threshold and the parameter update value of the first parameter is greater than or equal to 0, continue to obtain the device IO service time of the target device.
[0052] In an implementation manner, the processing unit is further configured to initialize the parameter update value of the first parameter if the parameter update value of the first parameter is less than 0.
[0053] The acquisition unit is further configured to continue to acquire the device IO service time of the target device.
[0054] In an implementation manner, the processing unit is further configured to:
[0055] If the IO service time corresponding to the target disk symbol is less than or equal to the detection threshold corresponding to the target disk symbol, and the parameter value of the first parameter is greater than 0, the parameter value of the second parameter is updated to obtain a parameter update value of the second parameter.
[0056] The acquisition unit 801 is further configured to continue to acquire the device IO service time of the target device.
[0057] In an implementation manner, the parameter value of the first parameter is an initial value obtained by initializing the first parameter, or the parameter value of the first parameter is a parameter update value of the first parameter obtained when the slow disk detection is performed last time.
[0058] The parameter value of the second parameter is an initial value obtained by initializing the second parameter, or the parameter value of the second parameter is a parameter update value of the second parameter obtained when the slow disk detection is performed last time.
[0059] In an implementation manner, the acquisition unit is specifically configured to: acquire the device IO service time of the target device at a first sampling frequency; or acquire the device IO service time of the target device at a second sampling frequency; wherein the first sampling frequency is less than the second sampling frequency.
[0060] In a third aspect, an embodiment of the present application provides a computing device, comprising a processor and a memory, the processor and the memory are electrically connected, wherein the memory is configured to store a computer program, the computer program comprises program instructions, and the processor is configured to execute the program instructions to enable the computing device to perform the slow disk detection method in the first aspect.
[0061] In a fourth aspect, an embodiment of the present application provides a computing device, comprising a central processing unit, a redundant array of independent disks (RAID) card, a hard disk, and a mainboard, wherein the RAID card is connected to the hard disk through a cable, and the RAID card is connected to the central processing unit through the mainboard, and the central processing unit is configured to perform the slow disk detection method in the first aspect.
[0062] In a fifth aspect, an embodiment of the present application provides a computer readable storage medium, which stores a computer program, the computer program is loaded and executed by a processor to perform the slow disk detection method in the first aspect.
[0063] In a sixth aspect, an embodiment of the present application provides a computer program product, which comprises a computer program stored in a computer readable storage medium. A processor of a computing device reads the computer program from the computer readable storage medium, and the processor executes the computer program to enable the computing device to perform the slow disk detection method of the first aspect. BRIEF DESCRIPTION OF DRAWINGS
[0064] Figure 1a An architecture diagram of a slow disk detection system provided by an embodiment of the present application is shown in FIG. 1.
[0065] Figure 1b An architecture diagram of another slow disk detection system provided by an embodiment of the present application is shown in FIG. 2.
[0066] Figure 2 A flowchart of a slow disk detection method provided by an embodiment of the present application is shown in FIG. 3.
[0067] Figure 3 A flowchart of another slow disk detection method provided by an embodiment of the present application is shown in FIG. 4.
[0068] Figure 4 A flowchart of a slow disk detection threshold generation method provided by an embodiment of the present application is shown in FIG. 5.
[0069] Figure 5 A flowchart of another slow disk detection threshold generation method provided by an embodiment of the present application is shown in FIG. 6.
[0070] Figure 6 A flowchart of a slow disk detection threshold update triggering method provided by an embodiment of the present application is shown in FIG. 7.
[0071] Figure 7 A structural diagram of a computing device provided by an embodiment of the present application is shown in FIG. 8.
[0072] Figure 8 A structural diagram of a slow disk detection device provided by an embodiment of the present application is shown in FIG. 9. DETAILED DESCRIPTION
[0073] The following first describes the terms involved in the embodiments of the present application.
[0074] I. Redundant Arrays of Independent Disks (RAID) card
[0075] A RAID card is a card that enables RAID functionality. A RAID card can combine multiple independent hard drives (physical hard drives) in different ways to form one or more hard drive groups. A hard drive group can be called a logical hard drive or a RAID group. A logical hard drive can provide higher storage performance and data backup technology than a single hard drive. It should be understood that the hard drives involved in the embodiments of this application all refer to physical hard drives.
[0076] In this application embodiment, the RAID information of the logical hard drive is involved. The RAID information of the logical hard drive may include one or more of the following: the RAID card model corresponding to the logical hard drive, the number of RAID groups, the RAID group level, the RAID read / write strategy, and member disk information. The number of RAID groups refers to the number of logical hard drives existing under a RAID card. For example, the number of RAID groups can be 1, 2, ..., 8, 10, 11, etc., which is not limited in this application embodiment. The RAID group level refers to the level of the logical hard drive (RAID group), for example, the level of the logical hard drive can be RAID 0, RAID 1, etc. The RAID read / write strategy refers to the strategy of the logical hard drive in the process of reading and writing data. For example, the logical hard drive read / write strategy is that the logical hard drive can only start reading data after receiving a data read command. A logical hard drive contains one or more member disks (member disks are physical hard drives). Member disk information refers to the information of the hard drives contained in the logical hard drive. This information may include, for example, the hard drive model, hard drive barcode, hard drive manufacturer, etc.
[0077] II. Slow-paced trading
[0078] During the use of a hard drive or logical hard drive, problems such as slow input / output (IO) response and reduced performance may occur. Such a hard drive or logical hard drive is called a slow drive.
[0079] III. Disk Symbol
[0080] A drive letter can be used to identify a hard drive in a device, or a drive letter can be used to identify a logical hard drive in a device. In other words, a drive letter can be understood as an identifier for a hard drive or logical hard drive in the device within the operating system.
[0081] It should be noted that when multiple hard drives in a device are connected to a RAID card (understand it as multiple hard drives being connected to a RAID card), the RAID card combines multiple independent hard drives (physical hard drives) in different ways to form one or more logical hard drives. One logical hard drive can correspond to one drive letter. In other words, the drive letter in the device is used to identify the logical hard drive under the RAID card.
[0082] When multiple hard drives exist independently in a device (meaning multiple hard drives are not mounted to a RAID card), one hard drive can correspond to one drive letter. In other words, the drive letter in the device is used to identify the hard drives in the device.
[0083] When a device contains multiple hard drives, some of these hard drives are mounted to a RAID card, while the remaining hard drives exist independently. In this case, the device will have logical hard drives and independent hard drives. A logical hard drive can correspond to a drive letter, and each independent hard drive will also correspond to a drive letter. In other words, a drive letter in the device can be used to identify the corresponding logical hard drive in the device, or a drive letter can be used to identify the corresponding hard drive in the device.
[0084] IV. Clustering Model
[0085] Clustering models, also known as clustering networks, can be a type of competitive neural network. During training, this model employs unsupervised learning. Through continuous training, the training samples input to the clustering model are mapped into point clusters in the competition layer. Each point cluster constitutes a cluster set. In this embodiment, the point clusters subsequently obtained through the clustering model are referred to as cluster sets. For example, a self-organizing map network (SOM) can be used. The clustering model can consist of an input layer and a competition layer. The training process follows a basic training principle: "activate surrounding neurons and inhibit distant neurons, with the winning neuron as the center." This can be understood as follows: during training, the winning neuron needs to be identified from among multiple neurons in the competition layer, and the weights of neurons closer to the winning neuron are adjusted while the weights of neurons farther away are suppressed.
[0086] The slow disk detection system provided in the embodiments of this application will be described in detail below.
[0087] Please see Figure 1a , Figure 1a This is an architectural diagram of a slow disk detection system provided in an embodiment of this application. The slow disk detection system may include: a target device 101 and a slow disk detection device 102, wherein... Figure 1a The number and configuration of devices shown are for illustrative purposes only and do not constitute a limitation on the embodiments of this application. For example, a slow disk detection system may include multiple target devices 101.
[0088] In this embodiment, the target device 101 can be a terminal device or a server, and the slow disk detection device 102 can be a terminal device or a server. Specifically, the target device involved in this application embodiment can be a server or a storage device dedicated to storing data, and the slow disk detection device 102 can be a terminal device or a server. It should be noted that the terminal device can be a smartphone, tablet, laptop, desktop computer, etc.; the server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms, etc.
[0089] The target device 101 may include at least one of the following: a hard drive, or a logical hard drive assembled from RAID cards in a certain combination. Each hard drive or logical hard drive in the target device 101 corresponds to a specific drive letter. The slow disk detection device 102 can generate and update a slow disk detection standard, which may include different slow disk detection thresholds. The slow disk detection device 102 can monitor and obtain the I / O service time (svctm) corresponding to all drive letters. The I / O service time refers to the average service time for each I / O operation performed by the hard drive or logical hard drive identified by the drive letter. The slow disk detection device 102 performs slow disk detection on all hard drives or logical hard drives identified by drive letters in the target device 101 using the slow disk detection standard.
[0090] It should be noted that, in this embodiment, the slow disk detection device 102 can generate and update a slow disk detection standard. Then, the slow disk detection device 102 performs slow disk detection on all hard drives or logical hard drives identified by drive letters in the target device 101 using the slow disk detection standard. In some embodiments, the slow disk detection device 102 can generate and update a slow disk detection standard. Then, the target device 101 can obtain the slow disk detection standard from the slow disk detection device 102 and perform slow disk detection on all hard drives or logical hard drives identified by drive letters in the target device 101 using the slow disk detection standard.
[0091] In other embodiments, the target device may generate and update a slow disk detection standard. The target device then uses this standard to perform slow disk detection on all hard drives or logical hard drives identified by drive letters within the target device. In specific implementations, the target device can use software to effectively monitor and judge the IO service time corresponding to drive letters, thereby effectively identifying slow disk scenarios and issuing alerts. The following example uses the target device as a server.
[0092] Please see Figure 1b , Figure 1b This is an architecture diagram of another slow disk detection system provided in an embodiment of this application. The slow disk detection system is a server. The server 10 may include: a RAID card 11, a central processing unit 12, a management controller 13, a motherboard 14, and a hard disk backplane 15.
[0093] RAID card 11 can be connected to one or more hard drives on the hard drive backplane via cables. In one implementation, when multiple hard drives in the target device are connected to the RAID card, the RAID card can combine multiple independent hard drives (physical hard drives) in different ways to form one or more logical hard drives, each logical hard drive corresponding to a drive letter. In another implementation, when some of the hard drives in the multiple hard drives are connected to the RAID card, the RAID card can combine some of the hard drives to form one or more logical hard drives, each logical hard drive corresponding to a drive letter. The remaining hard drives in the multiple hard drives can be directly connected to the motherboard 14, and each of the remaining hard drives corresponds to a corresponding drive letter.
[0094] RAID card 11 can be connected to the motherboard, thereby connecting to the central processing unit 12. Both the central processing unit 12 and the management controller 13 are located on the motherboard 14, and are electrically connected through the motherboard 14. An operating system can run on the central processing unit 12. By running this operating system, the central processing unit 12 can perform the following processes: generating slow disk detection standards, updating slow disk detection standards, and performing slow disk detection on the hard drives or logical hard drives in the server based on the slow disk detection standards.
[0095] The management controller 13 is a controller with monitoring and management functions. The management controller 13 can be a BMC (Baseboard Management Controller), or it can be other management controllers. In this embodiment, the management controller is a BMC as an example for explanation.
[0096] It should be noted that different servers may use different names for the BMC. For example, some servers call it BMC, some call it iLO (Integrated lights-out), and others call it Integrated Dell Remote Access Controller (iDRAC). BMC, iLO, or iDRAC can all be understood as the BMC in the embodiments of this application.
[0097] When the CPU determines that a hard drive or logical hard drive in the server is a slow drive, it can issue a slow drive alarm in two ways: in-band alarm and out-of-band alarm. An in-band alarm means that when the CPU determines that a hard drive or logical hard drive in the server is a slow drive, it directly outputs an alarm message. An out-of-band alarm means that when the CPU determines that a hard drive or logical hard drive in the server is a slow drive, it sends slow drive detection information to the management controller 13. This slow drive detection information indicates that the hard drive or logical hard drive identified by the target drive letter (i.e., any drive letter among multiple drive letters in the server) is a slow drive. After receiving the slow drive detection information, the management controller 13 can generate and output an alarm message based on the slow drive detection information. This alarm message includes the target drive letter and is used to indicate that the hard drive or logical hard drive identified by the target drive letter is a slow drive.
[0098] Based on the above-mentioned slow disk detection system, this application provides a slow disk detection scheme, which can be divided into the following three processes:
[0099] ① Determine the slow disk detection standard: Using the historical IO service time corresponding to all drive letters in a certain device (i.e., the target device) as training samples, the unsupervised learning characteristics of the clustering model are utilized (unsupervised learning means that no labels are added to the training samples). The clustering model is trained through the training samples to obtain the cluster centers. Based on the cluster centers, the slow disk detection threshold corresponding to the cluster centers is determined. The slow disk detection standard can be generated based on the slow disk detection threshold corresponding to the cluster centers, thereby realizing the differentiated customization of the slow disk detection standard.
[0100] ② Slow Disk Detection Standard Update: After establishing the slow disk detection standard, it can be updated proactively or passively. This means that training samples need to be re-acquired to train the clustering model. Updating the slow disk detection standard can effectively address situations such as performance degradation of the hard drive or logical hard drive identified by the drive letter, hard drive replacement, hard drive deletion, hard drive addition, and changes in business scenarios that occur during server service. This makes the slow disk detection standard more realistic and accurate. Changes in business scenarios can include, for example, changing from 1K read data to 2K read data, changes in storage services (such as changing from storing voice data to storing text data), etc., which are not limited in this application. Proactive updates can include: proactively triggering updates to the slow disk detection standard within a preset period (such as 1 month, 1 week, 1 day, etc.); passive updates can include at least one of the following: passively updating the slow disk detection standard due to performance degradation of the hard drive or logical hard drive indicated by the drive letter, hard drive replacement, hard drive deletion, hard drive addition, and changes in business scenarios; or triggering updates to the slow disk detection standard through manual manipulation (such as sending a slow disk detection standard update command).
[0101] ③ Slow disk detection implementation process: The slow disk detection standard is adopted to perform slow disk detection on all hard disks or logical hard disks identified by drive letters in the target device from two dimensions: frequency and number of times. By effectively identifying the situation of "multiple occurrences of IO service abnormalities in a short period of time" from the two dimensions of number of times and frequency, the problem of real-time and accuracy of judging the existence of slow disk scenarios is solved, thereby effectively improving the effectiveness of slow disk detection.
[0102] The slow disk detection method provided in the embodiments of this application will be described below.
[0103] Please see Figure 2 , Figure 2 This is a flowchart illustrating a slow disk detection method provided in an embodiment of this application. The slow disk detection method can be executed by a computing device, which can be a target device or a slow disk detection device. The slow disk detection method may include the following steps S201-S206:
[0104] S201. Obtain the device input / output (IO) service time of the target device.
[0105] The device I / O service time includes the I / O service time for each of the N1 drive letters, where N1 is a positive integer. The N1 drive letters can be all drive letters in the target device or a subset of drive letters in the target device. I / O service time refers to the average service time for each I / O operation performed by the hard disk or logical hard disk identified by the drive letter. In one implementation, the input / output I / O service time can be the I / O data latency time.
[0106] In this embodiment, each drive letter can be used to identify a hard drive or a logical hard drive in the target device. When multiple hard drives in the target device are connected to a RAID card (meaning multiple hard drives can be connected to the RAID card), the RAID card combines multiple independent hard drives (physical hard drives) in different ways to form one or more logical hard drives. A drive letter can be used to identify one logical hard drive. For example, the RAID card combines multiple independent hard drives (physical hard drives) in different ways to form three logical hard drives, namely logical hard drive 1, logical hard drive 2, and logical hard drive 3. Logical hard drive 1 corresponds to drive letter 1, that is, drive letter 1 is used to identify logical hard drive 1; logical hard drive 2 corresponds to drive letter 2, drive letter 2 is used to identify logical hard drive 2; logical hard drive 3 corresponds to drive letter 3, drive letter 3 is used to identify logical hard drive 3. In this case, the value of N1 can be 1, 2, or 3, and this embodiment does not limit this value.
[0107] When multiple hard drives exist independently in the target device (i.e., not mounted to a RAID card), each hard drive in the target device can correspond to a drive letter. In other words, the drive letter in the device is used to identify the hard drives. For example, if the target device has three hard drives, A, B, and C, drive A corresponds to drive letter 1, meaning drive letter 1 identifies hard drive 1; drive 2 corresponds to drive letter 2, meaning drive letter 2 identifies hard drive 2; and drive 3 corresponds to drive letter 3, meaning drive letter 3 identifies hard drive 3.
[0108] When some hard drives in the target device are mounted to a RAID card, and the remaining hard drives in the target device exist independently, logical hard drives and hard drives can each have a corresponding drive letter. In other words, a drive letter in the target device can be used to identify a corresponding logical hard drive in the target device, or a drive letter in the target device can be used to identify a corresponding hard drive in the target device.
[0109] In some feasible implementations, the device I / O service time of the target device can be obtained in real time; in other feasible implementations, the device I / O service time of the target device is obtained at a certain sampling frequency (such as 1 / 3Hz, 1Hz, etc.).
[0110] S202. Determine K1 distances based on device IO service time and K1 cluster centers.
[0111] Where K1 is a positive integer, and each cluster center corresponds to a slow disk detection threshold. A cluster center represents the normal performance metric of the IO model corresponding to each of the N1 drive letters. The IO model corresponding to each drive letter can be understood as the IO model of the logical hard drive or the hard drive itself. It should be understood that the IO model can be the same or different for different hard drives or logical hard drives. For example, the IO model of hard drive 1 could be the IO model corresponding to 1K of read data and 2K of write data; the IO model of hard drive 2 could be the IO model corresponding to 3K of read data. For example, cluster center 1 is (0.2 seconds, 0.3 seconds, 0.5 seconds); 0.2 seconds in cluster center 1 represents the normal performance metric of the IO model corresponding to drive letter 1, 0.3 seconds in cluster center 1 represents the normal performance metric of the IO model corresponding to drive letter 2, and 0.5 seconds in cluster center 1 represents the normal performance metric of the IO model corresponding to drive letter 3. By calculating the distance between the device IO service time and each cluster center, the slow disk detection threshold used for slow disk detection can be determined.
[0112] The K1 cluster centers are obtained by clustering multiple historical device I / O service times collected within a historical time period (such as 1 hour, 1 day, etc. before the system time) into K1 cluster sets, and calculating the cluster centers for the historical device I / O service times in each cluster set. The historical device I / O service times include the historical I / O service times corresponding to each of the N1 drive letters.
[0113] The slow disk detection threshold can include the detection threshold corresponding to each of the N1 drive letters. These thresholds are used to determine whether the hard drive or logical hard drive identified by the corresponding drive letter is a slow disk. For example, if N1 is 2, representing drive letter 1 and drive letter 2, the slow disk detection threshold can include the detection thresholds for drive letter 1 and drive letter 2. As another example, if N1 = 3, representing drive letters A, B, and C, the slow disk detection threshold is (0.2, 0.5, 0.6), meaning the detection threshold for drive letter A is 0.2, for drive letter B it is 0.5, and for drive letter C it is 0.6.
[0114] It should be understood that for any of the N1 drive letters, a corresponding detection threshold can be found in the slow disk detection threshold. For example, if the N1 drive letters include drive letter 1 and drive letter 2, the detection thresholds for drive letter 1 and drive letter 2 can be found in the slow disk detection threshold.
[0115] In one implementation, determining the K1 distances based on the device I / O service time and K1 cluster centers may include: the computing device calculating the Euclidean distance between the device I / O service time and each of the K1 cluster centers, thereby obtaining the K1 distances. For example, the device I / O service time includes the I / O service time corresponding to each of the three drive letters, such as (0.2 seconds, 0.3 seconds, 0.5 seconds), where 0.2 seconds is the I / O service time corresponding to drive letter 1, 0.3 seconds is the I / O service time corresponding to drive letter 2, and 0.5 seconds is the I / O service time corresponding to drive letter 3. K1 = 3, meaning there are 3 cluster centers: cluster center 1 (0.2 seconds, 0.3 seconds, 0.5 seconds), cluster center 2 (0.1 seconds, 0.1 seconds, 0.3 seconds), and cluster center 3 (0.1 seconds, 0.2 seconds, 0.5 seconds). The 0.2 seconds in cluster center 1 represents the normal performance metric for the I / O model corresponding to drive 1, the 0.3 seconds in cluster center 1 represents the normal performance metric for the I / O model corresponding to drive 2, and the 0.5 seconds in cluster center 1 represents the normal performance metric for the I / O model corresponding to drive 3. Similarly, cluster centers 2 and 3 can be understood in the same way.
[0116] The computing device can calculate the Euclidean distance between the device I / O service time (0.2 seconds, 0.3 seconds, 0.5 seconds) and cluster center 1 (0.2 seconds, 0.3 seconds, 0.5 seconds), that is, the distance between the device I / O service time and cluster center 1.
[0117] It should be noted that, referring to the formula for calculating the Euclidean distance between device I / O service time and cluster center 1 above, the Euclidean distance between device I / O service time and cluster center 2 is calculated to be 0.3, and the Euclidean distance between device I / O service time and cluster center 3 is calculated to be...
[0118] S203. Determine the target distance from K1 distances.
[0119] In practical implementation, the shortest distance among K1 distances can be determined as the target distance. For example, in the above example, K1 = 3, and the three determined distances are 0, 0.3, and so on. Therefore, the distance 0 is set as the target distance.
[0120] S204. Determine the target cluster center corresponding to the target distance from K1 cluster centers.
[0121] In the specific implementation, as mentioned in S202 above, based on the device IO service time and K1 cluster centers, K1 distances can be determined. Therefore, the target cluster center corresponding to the target distance can be determined from the K1 cluster centers.
[0122] S205. Determine the target slow disk detection threshold corresponding to the target cluster center.
[0123] As mentioned above, each cluster center corresponds to a slow disk detection threshold. Therefore, the slow disk detection threshold corresponding to the target cluster center can be determined as the target slow disk detection threshold.
[0124] S206. Based on the target slow disk detection threshold and the IO service time corresponding to each disk letter, perform slow disk detection on the hard disk or logical hard disk identified by each disk letter in the target device.
[0125] In a specific implementation, the target slow disk detection threshold can include the detection threshold corresponding to each of the N1 drive letters. Based on the detection threshold corresponding to each drive letter, slow disk detection is performed on the hard disk or logical hard disk identified by each drive letter. Finally, the slow disk detection result corresponding to each drive letter can be obtained. The slow disk detection result can indicate that the hard disk or logical hard disk identified by the drive letter is a slow disk, or it can indicate that the hard disk or logical hard disk identified by the drive letter is not a slow disk.
[0126] In one implementation, the target slow disk detection threshold can include the detection threshold corresponding to each of the N1 drive letters. During the slow disk detection process for the hard drives or logical drives identified by each drive letter in the target device, based on the target slow disk detection threshold and the IO service time corresponding to each drive letter, for the target drive letter among the N1 drive letters, it can be determined whether the IO service time corresponding to the target drive letter is greater than the detection threshold corresponding to the target drive letter in the target slow disk detection threshold. If the IO service time corresponding to the target drive letter is greater than the detection threshold corresponding to the target drive letter, the number of times the threshold is exceeded is updated. If the number of times the threshold is exceeded is greater than the target number of times, then the hard drive or logical drive identified by the target drive letter is determined to be a slow disk. For example, the target drive letter is used to identify logical drives; when the number of times the threshold is exceeded is greater than the target number of times, the logical drive identified by the target drive letter can be determined to be a slow disk. By counting the number of times the threshold is exceeded, a more accurate judgment can be made as to whether the hard drive or logical drive identified by the target drive letter is a slow disk, improving the accuracy of slow disk detection.
[0127] It should be understood that the slow disk detection process for each hard drive or logical hard drive identified by each of the N1 drive letters can refer to the slow disk detection process for the hard drive or logical hard drive identified by the target drive letter mentioned above, and will not be repeated here.
[0128] In another implementation, for a hard drive or logical drive identified by a certain drive letter, a small number of instances (meaning the number of times the I / O service time of the hard drive or logical drive identified by the drive letter exceeds the detection threshold for that drive letter is less than the threshold itself) of I / O service time exceeding the detection threshold for that drive letter have a relatively small impact on upper-layer services. Only when the I / O service time exceeds the detection threshold multiple times consecutively within a short period will it impact the normal operation of upper-layer services. For example, if the hard drive or logical drive identified by a certain drive letter experiences 20 instances of I / O service time exceeding the detection threshold within 5 minutes, it will impact the normal operation of upper-layer services. Therefore, to improve the accuracy of slow disk detection, the implementation of slow disk detection needs to consider both the number of instances and the frequency to analyze and evaluate the I / O service time of each drive letter on the target device within a certain period, thereby determining whether the hard drive or logical drive identified by each drive letter is a slow disk.
[0129] For details on how to analyze and evaluate the I / O service time of each drive letter in the target device within a certain period, considering both the number of times and frequency, please refer to [link to relevant documentation]. Figure 3 The embodiments shown will not be described in detail here.
[0130] In this embodiment, the device IO service time of the target device is obtained, including the IO service time corresponding to each of the N1 drive letters. Then, based on the device IO service time and K1 cluster centers, K1 distances are determined; K1 and N1 are positive integers; each cluster center corresponds to a slow disk detection threshold. A target distance is determined from the K1 distances, and a target cluster center corresponding to the target distance is determined from the K1 cluster centers. The target slow disk detection threshold corresponding to the target cluster center is then determined. Based on the target slow disk detection threshold and the IO service time corresponding to each drive letter, slow disk detection is performed on the hard disks or logical hard disks identified by each drive letter in the target device. This embodiment enables accurate identification of slow disk scenarios from the perspective of IO performance corresponding to drive letters. Furthermore, this embodiment allows selection of a suitable target slow disk detection threshold by using the distance between the device IO service time and the cluster center, solving the problem of a single, fixed slow disk detection threshold and improving the accuracy and effectiveness of slow disk detection.
[0131] The following section describes in detail the slow disk detection process for each hard drive or logical hard drive identified by each drive letter in the target device, based on the target slow disk detection threshold and the IO service time corresponding to each drive letter. Please refer to [link to relevant documentation]. Figure 3 , Figure 3This is a flowchart illustrating another slow disk detection method provided in an embodiment of this application. The slow disk detection method can be executed by a computing device, which can be a target device or a slow disk detection device. In this embodiment, slow disk detection is mainly performed on the hard disks or logical hard disks identified by each drive letter in the target device from two dimensions: the number of times and the frequency. The slow disk detection method may include the following steps S301-S313:
[0132] S301. Initialize the first parameter (n) and the second parameter (m) to their initial values, and set the sampling frequency to the first sampling frequency. The first sampling frequency can be, for example, 1 / 3 Hz. The initial values are 0, meaning n = 0 and m = 0.
[0133] The first parameter represents the number of times the target drive exceeded the threshold; that is, the number of times the IO service time corresponding to the target drive was greater than the detection threshold. The second parameter represents the number of times the target drive was normal; that is, a normal target drive is defined as one whose IO service time is less than or equal to the detection threshold, and the value of the first parameter is greater than 0.
[0134] S302. Obtain the device IO service time of the target device; the device IO service time includes the IO service time corresponding to each of the N1 disks, where N1 is a positive integer.
[0135] In one implementation, the device I / O service time of the target device can be acquired multiple times within a certain period of time. The following explanation will focus on the i-th acquisition among these multiple acquisitions. Specifically, the device I / O service time in S302 can be the device I / O service time acquired in the i-th acquisition. For example, when i = 1, it indicates that the device I / O service time of the target device is acquired for the first time, and this acquisition is done at the first sampling frequency.
[0136] S303. Based on the device IO service time and K1 cluster centers, determine K1 distances; one cluster center corresponds to one slow disk detection threshold.
[0137] It should be understood that each time the device IO service time of the target device is obtained, K1 distances need to be determined based on the obtained device IO service time and K1 cluster centers.
[0138] S304. Determine the target distance from K1 distances, determine the target cluster center corresponding to the target distance from K1 cluster centers, and determine the target slow disk detection threshold corresponding to the target cluster center.
[0139] The specific implementation methods of S303-S304 can be found above. Figure 2The corresponding steps in the implementation are not described in detail here. It should be noted that when performing slow disk detection later, the target disk letter among N1 disk letters will be used as an example. The target disk letter can be any one of the N1 disk letters.
[0140] S305. Determine whether the IO service time corresponding to the target drive letter is greater than the detection threshold corresponding to the target drive letter in the target slow disk detection threshold.
[0141] When the device IO service time in S302 is the device IO service time obtained for the i-th time, since the device IO service time includes the IO service time corresponding to the target disk, the IO service time corresponding to the target disk is also the IO service time obtained for the i-th time.
[0142] In the specific implementation, if the IO service time corresponding to the target drive letter is greater than the detection threshold corresponding to the target drive letter in the target slow disk detection threshold, then S306 is executed; if the IO service time corresponding to the target drive letter is less than or equal to the detection threshold corresponding to the target drive letter in the target slow disk detection threshold, then it is determined whether the parameter value of the first parameter is greater than 0 (i.e., S312 is executed).
[0143] S306. If the IO service time corresponding to the target drive letter is greater than the detection threshold corresponding to the target drive letter in the target slow disk detection threshold, then based on the parameter value of the second parameter, update the parameter value of the first parameter to obtain the parameter update value of the first parameter; and initialize the parameter value of the second parameter to obtain the parameter update value of the second parameter, also known as m=0.
[0144] In one implementation, the formula for calculating the updated value of the first parameter is as follows: n' = n + 1 - int(m / 5). Here, n' is the updated value of the first parameter, n is the value of the first parameter, m is the value of the second parameter, and int() represents rounding up.
[0145] Wherein, the IO service time corresponding to the target drive letter is the IO service time obtained in the i-th time. Accordingly, the parameter update value of the first parameter can be recorded as the parameter update value of the first parameter corresponding to the i-th time, and the parameter update value of the second parameter can be recorded as the parameter update value of the second parameter corresponding to the i-th time.
[0146] When i=1, the parameter value of the first parameter is the initial value of the first parameter 0, that is, n=0, and the parameter value of the second parameter is the initial value of the second parameter 0, that is, m=0. Based on the parameter value of the second parameter, updating the parameter value of the first parameter can include: substituting the initial value of the first parameter 0 and the initial value of the second parameter 0 into the first parameter update formula to obtain the parameter update value of the first parameter.
[0147] For example, substituting n=0 and m=0 into n'=n+1-int(m / 5) gives n'=0+1-int(0 / 5)=1, which means the updated value of the first parameter is n'=1, and after the update, n=1.
[0148] When i is greater than 1, the parameter value of the first parameter is the parameter update value of the first parameter corresponding to the (i-1)th time; the parameter value of the second parameter is the parameter update value of the first parameter corresponding to the (i-1)th time; based on the parameter value of the second parameter, updating the parameter value of the first parameter may include: generating the parameter update value of the first parameter for the i-th time based on the parameter update value of the first parameter corresponding to the (i-1)th time and the parameter update value of the second parameter corresponding to the (i-1)th time.
[0149] For example, i = 2, the value of the first parameter is n' = 1 corresponding to the first time, which means n = 1 after the update; the value of the second parameter is m' = 0 corresponding to the first time, which means m = 0 after the update; substituting n = 1 and m = 0 into n' = n + 1 - int(m / 5) gives n' = 1 + 1 - int(0 / 5) = 2, which means the updated value of the first parameter is n' = 2, and n = 2 after the update.
[0150] S307. Determine whether the parameter update value of the first parameter is greater than the number of times threshold.
[0151] The number of attempts threshold can be set according to requirements, for example, 30, 60, etc. When the updated value of the first parameter is greater than the number of attempts threshold, execute S308. When the updated value of the first parameter is less than or equal to the number of attempts threshold, execute S309.
[0152] S308. If the parameter update value of the first parameter is greater than the number of times threshold is reached, an alarm message is output. This alarm message is used to indicate that the logical hard drive identified by the target drive letter or the hard drive is a slow drive.
[0153] Specifically, if the parameter update value of the first parameter is greater than the number of times threshold is reached, then the logical hard drive or hard drive identified by the target drive letter is determined to be a slow drive.
[0154] In one implementation, the alarm information can be output directly by the central processing unit (CPU) in the computing device. In another implementation, the alarm information can be output by the computing device through a management controller. Specifically, the CPU in the computing device sends slow disk detection information to the management controller, which indicates that the logical hard disk or hard disk identified by the target drive letter (the target drive letter is any one of N1 drive letters) is a slow disk.
[0155] S309. If the parameter update value of the first parameter is less than or equal to the number of times threshold, then determine whether the parameter update value of the first parameter is less than 0.
[0156] S310. If the parameter update value of the first parameter is greater than or equal to 0, then the sampling frequency is set to the second sampling frequency, and S302 is executed.
[0157] It should be understood that after setting the sampling frequency to the second sampling frequency, S302 is executed to obtain the device IO service time of the target device at the second sampling frequency.
[0158] The second sampling frequency is less than the first sampling frequency. For example, the first sampling frequency is 1 / 3 Hz, and the second sampling frequency can be 1 Hz. When the update value of the first parameter is greater than or equal to 0, it means that the hard drive or logical hard drive identified by the target drive letter may be a slow drive. Therefore, the sampling frequency can be adjusted to the second sampling frequency to increase the sampling frequency and speed up the acquisition of device I / O service time for the target device.
[0159] S311. If the parameter update value of the first parameter is less than 0, then set the sampling frequency to the first sampling frequency and initialize the parameter update value of the first parameter, and execute S302. For example, if the parameter update value of the first parameter n' = -1, and the parameter update value of the first parameter is less than 0, then update n' = -1 to n = 0.
[0160] It should be understood that after setting the sampling frequency to the first sampling frequency, when S302 is executed, the device IO service time of the target device is obtained at the first sampling frequency.
[0161] S312. If the IO service time corresponding to the target drive is less than or equal to the detection threshold corresponding to the target drive in the target slow disk detection threshold, then determine whether the parameter value of the first parameter is greater than 0.
[0162] If the value of the first parameter is greater than 0, then S313 is executed; if the value of the first parameter is less than or equal to 0, then the device I / O service time of the target device is obtained, that is, the computing device continues to execute S302.
[0163] When the IO service time corresponding to the target drive is the same as the IO service time obtained in the first instance (i=1), if the IO service time corresponding to the target drive is less than or equal to the detection threshold corresponding to the target drive in the target slow disk detection threshold, then the value of the initialized first parameter is used as the value of the first parameter corresponding to the first instance, and the value of the initialized second parameter is used as the value of the second parameter corresponding to the second instance. For example, the initialized n=0 is used as the value of the first parameter corresponding to the first instance, meaning the value of the first parameter corresponding to the first instance is n=0; the initialized m=0 is used as the value of the second parameter corresponding to the second instance, meaning the value of the second parameter corresponding to the second instance is m=0. Then, the computing device determines whether n=0 is greater than 0.
[0164] When the IO service time corresponding to the target drive is the IO service time obtained in the i-th instance (i>1), if the IO service time corresponding to the target drive is less than or equal to the detection threshold corresponding to the target drive in the target slow drive detection threshold, then the parameter value of the first parameter involved in S312 is the parameter update value of the first parameter corresponding to the (i-1)-th instance. That is, it is determined whether the parameter update value of the first parameter corresponding to the (i-)-th instance is greater than 0. If the parameter update value of the first parameter corresponding to the (i-)-th instance is greater than 0, then S313 is executed; otherwise, S302 is executed. For example, i=2; the parameter value of the first parameter in the second instance is the parameter update value of the first parameter corresponding to the first instance. That is, if the parameter update value of the first parameter corresponding to the first instance is m'=1, then the parameter value of the first parameter in the second instance is m=1.
[0165] S313. If the parameter value of the first parameter is greater than 0, then update the parameter value of the second parameter to obtain the updated parameter value of the second parameter.
[0166] In the specific implementation, the value of the second parameter can be incremented by 1 to obtain the updated value of the second parameter. The formula for calculating the updated value of the second parameter is m' = m + 1. m' represents the updated value of the second parameter, and m represents the value of the second parameter. For example, if the value of the second parameter m = 0, then substituting m = 0 into m' = m + 1 gives m' = m + 1 = 1, which means the updated value of the second parameter m' = 1, or m = 1 after the update.
[0167] It should be understood that after obtaining the updated value of the second parameter, S302 can continue to be executed.
[0168] For ease of understanding, this application provides a specific flowchart for slow disk detection. Assume the target device contains N1 drive letters, and the target drive letter is any one of the N1 drive letters. Assuming a threshold of 2 attempts, the specific slow disk detection process includes:
[0169] 1) Initialize the first parameter n to 0, the second parameter m to 0 (m=0), and the sampling frequency f=1 / 3Hz.
[0170] 2) The process of the first (i.e., i=1) slow disk detection of the target drive is as follows:
[0171] ① Obtain the device I / O service time of the target device at f = 1 / 3Hz. This device I / O service time includes the I / O service time corresponding to each of the N1 disk letters.
[0172] ② Based on the device IO service time and K1 cluster centers, determine K1 distances; each cluster center corresponds to a slow disk detection threshold, and determine the target distance from the K1 distances, determine the target cluster center corresponding to the target distance from the K1 cluster centers, and determine the target slow disk detection threshold corresponding to the target cluster center.
[0173] ③ Determine whether the IO service time corresponding to the target drive letter is greater than the detection threshold corresponding to the target drive letter in the target slow disk detection threshold.
[0174] ④ If the IO service time corresponding to the target drive is determined to be greater than the detection threshold corresponding to the target drive, the parameter update value of the first parameter is determined based on n' = n + 1 - int(m / 5); and the parameter value of the second parameter is initialized to obtain the parameter update value of the second parameter.
[0175] Specifically, the parameter value of the first parameter is n = 0, and the parameter value of the second parameter is m = 0; the parameter update value of the second parameter is n' = 0 + 1 - int(0 / 5) = 1; the parameter value of the second parameter is initialized, and the parameter update value of the second parameter is m' = 0.
[0176] ⑤ Determine whether the parameter update value of the first parameter (i.e., n' = 1) is greater than the number of times threshold 2; if it is determined that the parameter update value of the first parameter is less than the number of times threshold 2 and the parameter update value of the first parameter is greater than 0, continue to obtain the device IO service time of the target device at the second sampling frequency f = 1Hz.
[0177] 3) The second (i=2) slow disk detection process for the target drive letter is as follows: the parameter update value of the first parameter corresponding to the first time (n'=1) is used as the parameter value of the first parameter (n=1), and the parameter update value of the second parameter corresponding to the first time (m'=0) is used as the parameter value of the second parameter (m=0).
[0178] (1) Obtain the device I / O service time of the target device at f = 1Hz.
[0179] (2) Based on the device IO service time and K1 cluster centers, determine K1 distances; then determine the target distance from the K1 distances, determine the target cluster center corresponding to the target distance from the K1 cluster centers, and determine the target slow disk detection threshold corresponding to the target cluster center.
[0180] (3) Determine whether the IO service time corresponding to the target drive letter is greater than the detection threshold corresponding to the target drive letter in the target slow disk detection threshold. At this time, there are two situations:
[0181] Case 1: If the IO service time corresponding to the target drive is less than or equal to the detection threshold corresponding to the target drive and the parameter value of the first parameter is greater than 0 (i.e. n=1, greater than 0), then update the parameter value of the second parameter to obtain the parameter update value of the second parameter, and continue to sample the device IO service time of the target device at the first sampling frequency f=1 / 3Hz.
[0182] Specifically, the value of the first parameter is m = 0; based on m' = m + 1, the updated value of the second parameter is m' = 0 + 1 = 1.
[0183] It should be noted that the value of the first parameter can be regarded as the updated value of the first parameter for the second time (i.e., n' = 1).
[0184] Case 2: If the IO service time corresponding to the target drive is greater than the detection threshold corresponding to the target drive, then based on n' = n + 1 - int(m / 5), determine the parameter update value of the first parameter, initialize the parameter value of the second parameter, and obtain the parameter update value of the second parameter.
[0185] Specifically, the value of the first parameter is n=1, and the value of the second parameter is m=0; the update value of the first parameter is n'=1+1-int(0 / 5)=2, and the value of the second parameter is initialized, so that the update value of the second parameter is m'=0.
[0186] Then, it is determined whether the parameter update value of the first parameter (i.e., n'=2) is greater than the number of times threshold. If it is determined that the parameter update value of the first parameter (i.e., n'=2) is equal to the number of times threshold and greater than 0, the device IO service time of the target device is obtained again at f=1Hz.
[0187] 4) Assuming that case 1 in 3) is executed, the process of slow disk detection of the target drive letter for the third time (i=3) is as follows: the parameter update value of the first parameter corresponding to the second time (n'=1) is used as the parameter value of the first parameter (i.e., n=1), and the parameter update value of the second parameter corresponding to the second time (m'=1) is used as the parameter value of the second parameter (i.e., m=1).
[0188] The device I / O service time of the target device is continuously acquired at the first sampling frequency f = 1 / 3Hz. Based on the device I / O service time and K1 cluster centers, K1 distances are determined. Then, the target distance is determined from the K1 distances, and the target cluster center corresponding to the target distance is determined from the K1 cluster centers. The target slow disk detection threshold corresponding to the target cluster center is then determined. Next, it is determined whether the I / O service time corresponding to the target disk letter is greater than the detection threshold corresponding to the target disk letter in the target slow disk detection threshold. At this time, the following two situations exist:
[0189] Case 1: If the IO service time corresponding to the target drive is less than or equal to the detection threshold corresponding to the target drive and the parameter value of the first parameter (n=1) is greater than 0, then update the parameter value of the second parameter to obtain the updated parameter value of the second parameter. Then continue to sample the device IO service time of the target device at the first sampling frequency f=1 / 3Hz.
[0190] Specifically, the parameter value of the second parameter is m=1. Based on m'=m+1, the parameter update value of the second parameter is m'=1+1=2.
[0191] It should be noted that the value of the first parameter can be regarded as the updated value of the first parameter for the second time (i.e., n' = 1).
[0192] Case 2: If the IO service time corresponding to the target drive is greater than the detection threshold corresponding to the target drive, then based on n' = n + 1 - int(m / 5), determine the parameter update value of the first parameter; and initialize the parameter value of the second parameter to obtain the parameter update value of the second parameter.
[0193] Specifically, the first parameter has a value of n = 1, and the second parameter has a value of m = 1; the update value of the first parameter is n' = 1 + 1 - int(1 / 5) = 2 - 1 = 1. The second parameter is initialized, resulting in an update value of m' = 0.
[0194] Then, if the parameter update value (n'=1) of the first parameter is less than the number of times threshold 2 and the parameter update value of the first parameter is greater than 0, the device IO service time of the target device will continue to be obtained at the second sampling frequency f=1Hz.
[0195] Assuming that case 2 in 3) is executed, the process of slow disk detection of the target drive letter for the third time (i=3) is as follows: the parameter update value of the first parameter corresponding to the second time (n'=2) is used as the parameter value of the first parameter (i.e., n=2), and the parameter update value of the second parameter corresponding to the second time (m'=0) is used as the parameter value of the second parameter (i.e., m=0).
[0196] The device I / O service time of the target device is continuously acquired at the first sampling frequency f = 1Hz. Based on the device I / O service time and K1 cluster centers, K1 distances are determined. Then, the target distance is determined from the K1 distances, and the target cluster center corresponding to the target distance is determined from the K1 cluster centers. The target slow disk detection threshold corresponding to the target cluster center is then determined. Next, it is determined whether the I / O service time corresponding to the target disk letter is greater than the detection threshold corresponding to the target disk letter in the target slow disk detection threshold. At this time, the following two situations exist:
[0197] Case 1: If the IO service time corresponding to the target drive is less than or equal to the detection threshold corresponding to the target drive and the parameter value of the first parameter (n=2) is greater than 0, then based on m'=m+1, update the parameter value of the second parameter (i.e., m=0), and obtain the parameter update value of the second parameter m'=1. Then continue to sample the device IO service time of the target device at the first sampling frequency f=1Hz.
[0198] Case 2: If the IO service time corresponding to the target drive is greater than the detection threshold corresponding to the target drive, then based on n' = n + 1 - int(m / 5), the parameter update value of the second parameter is obtained; and the parameter value of the second parameter is initialized to obtain the parameter update value m' = 0.
[0199] Specifically, the first parameter has a value of n = 2, and the second parameter has a value of m = 0. The update value of the first parameter is n' = 2 + 1 - int(0 / 5) = 3. An alarm message is output when the update value of the first parameter (n' = 3) is greater than the threshold value of 2. This alarm message indicates that the hard drive or logical hard drive identified by the target drive letter is a slow drive.
[0200] In this embodiment, by introducing sampling frequency, a first parameter, and a second parameter to perform slow disk detection on the hard disk or logical hard disk identified by each drive letter, the accuracy of drive letter detection is improved. Moreover, each time the IO service time corresponding to each drive letter in N1 drives is sampled, a suitable target slow disk detection threshold is selected, which realizes the differential customization of the slow disk detection threshold and solves the problem of a single and fixed slow disk detection threshold, making slow disk detection more timely and accurate.
[0201] The following describes in detail the process of obtaining K1 cluster centers and generating the slow disk detection threshold corresponding to each cluster center in the embodiments of this application. Please refer to [link to relevant documentation]. Figure 4 , Figure 4 This is a flowchart illustrating a method for generating a slow disk detection threshold according to an embodiment of this application. This method can be executed by a computing device and may include the following steps S401-S403:
[0202] S401. Obtain the training set of samples, which contains M training samples.
[0203] Each training sample includes the historical I / O service time for each of the N1 drive letters. The clustering model can be a SOM network. It should be understood that inputting M training samples into the clustering model is actually inputting the historical I / O service time for each drive letter included in each of the M training samples into the clustering model.
[0204] In one implementation, the M training samples can be obtained by collecting the historical I / O service time corresponding to each of the N1 drive letters at different historical time points within a historical time period. One training sample corresponds to one historical time point, and one training sample includes the historical I / O service time corresponding to each of the N1 drive letters collected at that historical time point. That is, at each historical time point, the historical I / O service time corresponding to each of the N1 drive letters is collected, and the historical I / O service time corresponding to each of the N1 drive letters collected at a single historical time point constitutes one training sample, ultimately resulting in M training samples. The M historical time points can be time points within a historical time period (e.g., 1 week, 1 day). The value of M can be set according to requirements; for example, M can be 200, 1000, 2000, etc. For example, if the current time is 13:00, then at 12:00, the historical IO service time corresponding to each of the N1 drive letters can be collected, and the historical IO service time corresponding to each of the N1 drive letters collected at 12:00 can be used to form a training sample; at 12:10, the historical IO service time corresponding to each of the N1 drive letters can be collected, and the historical IO service time corresponding to each of the N1 drive letters collected at 12:10 can be used to form another training sample, and so on, until M training samples are obtained.
[0205] Here, the training sample can be represented as x(s), and the historical IO service time corresponding to each of the N1 disks included in each training sample can be represented as x(s) = [x1(s), x2(s), ... x N1 [(s)], s = 1, 2, 3, ..., M. This is illustrative, with M being 1000. x1(s) represents the historical I / O service time corresponding to the first drive letter in the target device, x2(s) represents the historical I / O service time corresponding to the second drive letter, and so on. N1 (s) represents the historical I / O service time corresponding to the N1th drive letter.
[0206] S402. Input M training samples into the clustering model to obtain K1 cluster sets and K1 cluster centers output by the clustering model. One cluster set corresponds to one cluster center.
[0207] In a feasible implementation, the clustering model includes an input layer and a competition layer. The input layer performs feature processing on the training samples to obtain the input vector corresponding to the training samples. The competition layer can contain H neurons, where H is a positive integer. This competition layer can be used to cluster the training samples in the training sample set. In this case, inputting M training samples into the clustering model to obtain K1 cluster sets and K1 cluster centers output by the clustering model can include the following steps S11-S18:
[0208] S11: Obtain the initial feature parameters of the clustering model and set the iteration number t. These initial feature parameters may include: the initial weight matrix corresponding to the H neurons, the initial neighborhood N, and so on. j* (0) Initial learning rate η(0). In specific implementation, the feature parameters in the clustering model can be initialized to obtain the initial feature parameters. It should be understood that the initial weight matrix can contain the initial weights corresponding to each of the H neurons, and the initial weight matrix can be represented as W = [w1, w2, ..., w H ] T H represents the number of neurons in the competition layer, w1 represents the initial weights corresponding to the first neuron in the competition layer, w2 represents the initial weights corresponding to the second neuron in the competition layer, and so on. H Let [ ] represent the initial weights corresponding to the H-th neuron in the competition layer. T This represents the transpose. When initializing the feature parameters in the clustering model, a relatively large initial neighborhood is initialized. As the clustering model is continuously trained, this initial neighborhood converges with the increase of iterations, thus forming a cluster set. In the embodiment of the application, the initial value of t can be set to 1.
[0209] S12: Traverse the M training samples and determine the target training sample for the current input clustering model from the M training samples.
[0210] In one implementation, a training sample is randomly selected from M training samples as the target training sample for the current input clustering model. It should be understood that when a selected training sample already exists among the M training samples and has been input into the clustering model, by traversing the M training samples, unselected training samples can be identified, and a training sample is randomly selected from the unselected training samples as the target training sample for the current input clustering model.
[0211] In another implementation, each training sample has a corresponding sample number. The computing device can select the training sample as the target training sample for the current input clustering model in ascending (or descending) order of sample number. For example, M=2, the M training samples include training sample x(1) and training sample x(2), the sample number of training sample x(1) is 1, and the sample number of training sample x(2) is 2. The computing device iterates through x(1) and x(2), and determines the target training sample for the current input clustering model as x(1) in ascending order of sample number.
[0212] It should be noted that, in this embodiment, M training samples are sequentially input into the clustering model, meaning one training sample is input into the clustering model at a time for model training. This model training can also be understood as performing clustering processing on the input training samples. Since the number of training samples is M, and only one training sample is input at a time, the number of iterations for training the clustering model in this embodiment is at least M. This can also be understood as the number of iterations for clustering the M training samples sequentially is at least M.
[0213] S13: Input the target training sample into the clustering model, calculate the Euclidean distance between the target training sample and each neuron in the competition layer, and determine the winning neuron from H neurons based on the Euclidean distance between the target training sample and each neuron in the competition layer.
[0214] To illustrate, taking the first iteration as an example, the Euclidean distance between the target training sample and each neuron in the competing layer can include: processing the target training sample through the input layer to obtain the input vector corresponding to the target training sample; then calculating the Euclidean distance between the input vector corresponding to the target training sample and the initial weights corresponding to each neuron, thus obtaining the Euclidean distance between the target training sample and each neuron in the competing layer (i.e., the Euclidean distance between the target training sample and each neuron in the competing layer at the time of the first iteration). Specifically, when the number of iterations is t, the formula for calculating the Euclidean distance between the target training sample and each neuron in the competing layer is as follows:
[0215]
[0216] Where, d j (t) represents the Euclidean distance between the target training sample and the j-th neuron, x(t) represents the target training sample, and w j (t) represents the weight corresponding to the j-th neuron, N1 represents the number of disks, and x v (t) represents the historical I / O service time corresponding to the v-th drive letter in the target training sample, w vj(t) represents the connection weight between the historical I / O service time corresponding to the v-th disk letter in the target training sample and the j-th neuron. t represents the number of iterations.
[0217] In one implementation, determining the winning neighborhood from H neurons based on the Euclidean distance between the target training sample and each neuron in the competitive layer can include: determining the neuron with the smallest Euclidean distance from the H neurons based on the Euclidean distance between the target training sample and each neuron in the competitive layer, and identifying this neuron as the winning neuron. The representation of the obtained neuron is as follows:
[0218] ||x(t)-w c (t)||=min(d c )
[0219] Where x(t) represents the target training sample, w c (t) represents the winning neuron, min(d) c ) indicates that the Euclidean distance between the target training sample and the c-th neuron is the shortest.
[0220] S14: Determine the winning neighborhood based on the neighborhood radius and the winning neuron.
[0221] The neighborhood radius decreases continuously with the number of iterations, and the neighborhood radius is determined as follows:
[0222]
[0223] Where t is the number of iterations, INT() represents the floor function, for example, INT(0.5) takes the value 1. r(t+1) represents the updated neighborhood radius, r(t) represents the unupdated neighborhood radius, and M represents the number of training samples.
[0224] S15: Update the connection weights of neurons in the winning neighborhood.
[0225] The update formula for the connection weights of neurons in the winning neighborhood is as follows:
[0226] w vj (t+1)=w vj (t)+η(t)h c,j (t)(x v (t)-w vj (t)), v=1,2,3...,N1,j∈N j* (t)
[0227] Among them, w vj (t+1) represents the updated historical I / O service time corresponding to the v-th drive letter and the connection weight corresponding to the j-th neuron; wvj (t) represents the historical I / O service time corresponding to the v-th disk and the connection weight corresponding to the j-th neuron; η(t) represents the learning rate, where 0 < η(t) < 1. This η(t) serves as a gain function and decreases with the number of iterations t. c,j (t) is the neighborhood function, h c,j (t) represents the distance between the winning neuron c and the j-th neuron in its winning neighborhood, x v (t) represents the historical IO service time corresponding to the v-th drive letter in the target training sample. j* represents the winning neighborhood.
[0228] S16: Update the gain function η(t) and the neighborhood function h c,j (t).
[0229] The update formula for the gain function η(t) is as follows:
[0230]
[0231] Where η(t+1) represents the updated learning rate, η(t) represents the learning rate before the update, η(0) represents the initial learning rate, and M represents the number of training samples.
[0232] Neighborhood function h c,j The update formula for (t) is as follows:
[0233]
[0234] Among them, h c,j r(t) represents the distance between the winning neuron c and the j-th neuron in its winning neighborhood, where r(t) represents the neighborhood radius.
[0235] S17: Update the iteration count and determine if the updated iteration count is greater than M. In the specific implementation, each time a training sample is input into the clustering model, thus completing one iteration of training the clustering model, the iteration count is incremented by 1 (i.e., t = t + 1).
[0236] S18: If the number of iterations is greater than M, the training of the clustering model is complete, resulting in K1 cluster sets and the cluster center for each cluster set. It should be understood that with multiple iterations, neurons gradually approach the cluster centers, eventually resulting in multiple cluster centers. If the number of iterations is less than M, continue with S12-S17.
[0237] For example, after training the clustering model, we obtain K1 cluster sets, which are represented as c = [c1, c2, ..., c1]. K1 ], where c1 represents the first cluster set, c2 represents the second cluster set, and so on, cK1 This represents the 3rd cluster set. The cluster centers corresponding to the K1 cluster sets are c(i) = [c1(i), c2(i), ... c1(i)]. N1 (i)], i=1,2,3...K1. When i=1, that is, c(1)=[c1(1),c2(1),...c N1 (1)] represents the cluster center corresponding to the first cluster set; when i = 2, that is, c(2) = [c1(2), c2(2), ... c N1 (2)] represents the cluster center corresponding to the second cluster set, and so on. When i = K1, that is, c(K1) = [c1(K1), c2(K1), ... c N1 [(K1)] represents the cluster center corresponding to the K1th cluster set.
[0238] It should be understood that when training a clustering model, a training sample includes the IO service time corresponding to each of the N1 drive letters. Therefore, the cluster center can be understood as the normal performance metric corresponding to different IO models. Once the slow disk detection threshold constructed by the normal performance metric is exceeded, then there may be a slow disk among the N1 drive letters. The IO model here could be, for example, the IO model corresponding to 1K of read data and 2K of write data, the IO model corresponding to 1K of read data, and so on.
[0239] S403. Based on K1 cluster centers, generate K1 slow disk detection thresholds.
[0240] In the implementation, a slow disk detection threshold can be generated for each cluster center. For example, K1 cluster centers can be represented as c(i) = [c1(i), c2(i), ... c1(i)]. N1 [i], i = 1, 2, 3...K1. Then, the slow disk detection threshold for each cluster center can be: c * (i) = Pc(i), i = 1, 2, 3...K1. P can be set according to requirements; for example, P can take values such as 5, 9, 3, etc. When i = 1, i.e., c * (1)=P[c1(1),c2(1),...c N1 (1)] represents the slow disk detection threshold corresponding to the first cluster center. When i = 2, i.e., c * (2)=P[c1(2),c2(2),...c N1 (2)] represents the slow disk detection threshold corresponding to the second cluster center, and so on. When i = K1, i.e., c * (K1)=P[c1(K1),c2(K1),...c N1[K1] represents the slow disk detection threshold corresponding to the K1th cluster center. Each slow disk detection threshold contains the detection threshold corresponding to each of the N1 drive letters. For example, the slow disk detection threshold c * (K1)=P[c1(K1),c2(K1),...c N1 [(K1)], where Pc1(K1) corresponds to the detection threshold for the first drive letter, Pc2(K1) corresponds to the detection threshold for the second drive letter, and so on. N1 (K1) corresponds to the detection threshold of the N1th drive letter.
[0241] It should be noted that the K1 slow disk detection thresholds are the slow disk detection standards corresponding to the N1 drive letters in the target device. In actual use, the appropriate slow disk detection thresholds can be selected from the slow disk detection standards based on the distance between the device IO service time of the target device and each cluster center. This solves the problem of single and fixed detection thresholds in existing slow disk detection solutions and improves the accuracy of slow disk detection.
[0242] In this embodiment, M training samples are input into a clustering model to obtain K1 cluster sets and K1 cluster centers, with one cluster set corresponding to one cluster center. Based on the K1 cluster centers, K1 slow disk detection thresholds are generated. Each of the M training samples includes the historical IO service time corresponding to each of the N1 drive letters. By utilizing the clustering model to generate K1 cluster centers, the slow disk detection thresholds can be customized, solving the problem of a single, fixed detection threshold and improving the accuracy of slow disk detection. Furthermore, since the clustering model possesses unsupervised learning characteristics, slow disk detection thresholds can be customized for different manufacturers, types, and models of hard drives or logical hard drives in different scenarios.
[0243] Please see Figure 5 , Figure 5 This is a flowchart illustrating another method for generating a slow disk detection threshold provided in an embodiment of this application. The method for generating a slow disk detection threshold can be executed by a computing device and may include the following steps S501-S505:
[0244] S501. Input M first training samples into the clustering model to obtain K2 initial cluster sets and K2 initial cluster centers output by the clustering model. Each initial cluster set corresponds to one initial cluster center. Each of the M first training samples includes the historical IO service time corresponding to each of the N2 drive letters. K2 is a positive integer. N2 is a positive integer, and the N2 drive letters can be all or some of the drive letters in the target device.
[0245] It should be noted that the specific implementation of S501 is similar to that of S401. Please refer to the specific implementation of S401 above, which will not be repeated here.
[0246] S502. Based on K2 initial cluster centers, generate K2 initial slow disk detection thresholds, with one initial cluster center corresponding to one initial slow disk detection threshold.
[0247] As target devices (such as servers) operate, changes in hard drive performance, hard drive replacements, and changes in business scenarios all impact the slow disk detection standards established through clustering model training. To make slow disk detection more real-time and more realistic, this application embodiment establishes a dynamic update process for the slow disk detection standards, that is, updating K2 initial slow disk detection thresholds. By updating these K1 slow disk detection thresholds, not only can a set of differentiated, customizable, and dynamically adjustable slow disk detection standards be established, but effective and timely detection of slow disk scenarios can also be achieved, thereby reducing the impact of slow disks on customer businesses.
[0248] At this point, in this embodiment, the update of the K2 initial slow disk detection thresholds can be triggered in various ways. Please refer to [link to relevant documentation]. Figure 6 , Figure 6 This is a schematic diagram illustrating a slow disk detection threshold triggering update process provided in an embodiment of this application. Figure 6 In the middle, triggering the update of the K2 initial slow disk detection thresholds can include the following methods:
[0249] (1) Record the generation time of the K2 initial slow disk detection thresholds, and determine whether the time difference between the generation time and the current time is greater than or equal to the time threshold. If the time difference is greater than or equal to the time threshold, execute S503, that is, start updating the K2 initial slow disk detection thresholds; if the time difference is less than the time threshold, no operation is required. The time threshold can be set according to needs, such as 30 days, one week, etc. For example, if the time threshold is 30 days, the generation time of the K1 initial slow disk detection thresholds is November 1, XX year, and the current time is December 1, XX year, and the time difference between the generation time and the current time is determined to be 30 days, then the time difference is equal to the time threshold, and S503 is executed.
[0250] (2) Record the attribute information corresponding to the drive letter in the target device. This attribute information may include: hard drive serial number (SN) or logical hard drive RAID information. The logical hard drive RAID information includes at least one of the following: the RAID card model corresponding to the logical hard drive, the number of RAID groups, the RAID group level, the RAID group read / write policy, and the member disk information in the RAID group. The computer device can detect whether the attribute information corresponding to the drive letter in the target device has changed within a preset period. If a change is detected, S503 is executed. It should be understood that if one or more drive letter attribute information changes are detected in the target device, then S503 can be executed to update the K2 initial slow disk detection thresholds. Changes in the attribute information corresponding to the drive letter in the target device include, for example, changes in the hard drive serial number, changes in the RAID group level (e.g., changing from RAID0 to RAID1), etc.
[0251] (3) When a user needs to update the K2 initial slow disk detection thresholds, they can send a detection threshold update trigger command to the computer device. When the computer device receives the detection threshold update trigger command, it executes S503 to update the K2 initial slow disk detection thresholds.
[0252] S503. Input M second training samples into the clustering model to obtain K1 cluster sets and K1 cluster centers output by the clustering model; K1 is a positive integer; each of the M second training samples includes the historical IO service time corresponding to each of the N1 disks, where N1 is a positive integer.
[0253] It should be noted that the specific implementation of S503 is similar to that of S402. Please refer to the specific implementation of S402 above, which will not be repeated here.
[0254] S504. Based on K1 cluster centers, generate K1 reference slow disk detection thresholds.
[0255] S505. Based on K1 reference slow disk detection thresholds, update K2 initial slow disk detection thresholds to obtain K1 slow disk detection thresholds.
[0256] In one implementation, updating the K2 initial slow disk detection thresholds based on the K1 reference slow disk detection thresholds may include: directly replacing the K2 initial slow disk detection thresholds with the K1 reference slow disk detection thresholds to obtain the K1 slow disk detection thresholds.
[0257] It should be understood that the values of K1 and K2 can be the same or different. That is, since clustering models are unsupervised learning, the number of clusters obtained by inputting M second training samples into the clustering model will be different from the number of initial clusters obtained by inputting M first training samples into the clustering model; of course, they may also be the same. Furthermore, the values of N1 and N2 can also be the same or different. This means that due to business needs (such as business changes), hard drives or logical hard drives in the target device may be added or removed according to business requirements. For example, when the business storage volume increases, corresponding hard drives or logical hard drives will be added to the target device, and corresponding drive letters will be assigned to the added hard drives or logical hard drives. In other words, new drive letters will be added to the target device, and therefore N1 and N2 will be different.
[0258] In this embodiment, M first training samples are input into the clustering model to obtain K2 initial cluster sets and K2 initial cluster centers output by the clustering model, with one initial cluster set corresponding to one initial cluster center. Based on the K2 initial cluster centers, K2 initial slow disk detection thresholds are generated. M second training samples are input into the clustering model to obtain K1 cluster sets and K1 cluster centers output by the clustering model; K2 is a positive integer. Based on the K1 cluster centers, K1 reference slow disk detection thresholds are generated. Then, based on the K1 reference slow disk detection thresholds, the K2 initial slow disk detection thresholds are updated to obtain K1 slow disk detection thresholds. This can address the impact of changes in hard drive performance, hard drive replacement, and changes in business scenarios on the slow disk detection standard. This allows for a differentiated, customizable, and dynamically adjustable slow disk detection standard, making subsequent slow disk detection more real-time and more practical, reducing the impact of slow disks on customer business, effectively improving customer experience, product maintainability, and product competitiveness.
[0259] In addition, please see Figure 7 , Figure 7 This is a schematic diagram of a computing device provided in an embodiment of this application. The computing device described in this embodiment includes a processor 701, a communication interface 702, and a memory 703. The processor 701, communication interface 702, and memory 703 can be connected via a bus or other means; this embodiment uses a bus connection as an example.
[0260] The processor 701 (or Central Processing Unit, CPU) is the computing and control core of the computing device. The communication interface 702 may optionally include a standard wired interface or a wireless interface (such as Wi-Fi, mobile communication interface, etc.), controlled by the processor 701 for sending and receiving data. The memory 703 is the storage device of the computing device, used to store programs and data. It is understood that the memory 703 here may be high-speed RAM, or non-volatile memory, such as at least one disk storage device; optionally, it may also be at least one storage device located remotely from the processor 701. The memory 703 provides storage space for the operating system of the computing device, which may include, but is not limited to, Windows (an operating system), Linux (an operating system), etc., and this invention does not limit this.
[0261] In this embodiment, memory 703 is used to store a computer program, which includes program instructions. Processor 701 is used to execute the program instructions stored in memory 703 to perform the aforementioned... Figures 3-6 The descriptions of the methods in the corresponding embodiments will not be repeated here. Furthermore, the beneficial effects of using the same methods will also not be repeated.
[0262] Furthermore, it should be noted that this application also provides a computer-readable storage medium, which stores a computer program, including program instructions. When a processor executes the program instructions, it can execute the aforementioned... Figures 3-6 The descriptions of the methods in the corresponding embodiments are already provided and will not be repeated here. Furthermore, the beneficial effects of using the same methods will also not be repeated. For technical details not disclosed in the computer-readable storage medium embodiments related to this application, please refer to the description of the method embodiments of this application. As an example, program instructions may be deployed and executed on a computing device, or executed on multiple computing devices located in one location.
[0263] Furthermore, it should be noted that this application also provides a computer program product or computer program, which may include program instructions that can be stored in a computer-readable storage medium. The processor of a computing device reads the program instructions from the computer-readable storage medium and executes the program instructions, causing the computing device to perform the aforementioned... Figures 3-6The methods described in the corresponding embodiments are already known, and therefore will not be repeated here. Furthermore, the beneficial effects of using the same method will also not be repeated. For technical details not disclosed in the computer program products or computer program embodiments related to this application, please refer to the description of the method embodiments of this application.
[0264] It should be understood that, corresponding to the methods given in the above method embodiments, this application also provides corresponding apparatus, including modules or units for executing the corresponding embodiments. The modules or units may be software, hardware, or a combination of software and hardware.
[0265] Please see Figure 8 This is a schematic diagram of a slow disk detection device provided in this application. The slow disk detection device can be a computer program (including program code) running on a computing device; for example, the slow disk detection device can be application software within the computing device. The slow disk detection device can be used to execute... Figures 3-6 Some or all of the steps in the method embodiments shown. Please refer to [link / reference]. Figure 8 The slow disk detection device includes the following units:
[0266] The acquisition unit 801 is used to acquire the device input / output IO service time of the target device, and the device IO service time includes the IO service time corresponding to each of the N1 disk letters;
[0267] Processing unit 802 is used to determine K1 distances based on device IO service time and K1 cluster centers; K1 and N1 are positive integers; one cluster center corresponds to one slow disk detection threshold;
[0268] The processing unit 802 is also used to determine the target distance from K1 distances, determine the target cluster center corresponding to the target distance from K1 cluster centers, and determine the target slow disk detection threshold corresponding to the target cluster center;
[0269] The processing unit 802 is also used to perform slow disk detection on the hard disk or logical hard disk identified by each drive letter in the target device based on the target slow disk detection threshold and the IO service time corresponding to each drive letter.
[0270] In one implementation, the processing unit 802 is specifically used for:
[0271] Input M training samples into the clustering model to obtain K1 cluster sets and K1 cluster centers output by the clustering model, with one cluster set corresponding to one cluster center;
[0272] Based on K1 cluster centers, generate K1 slow disk detection thresholds;
[0273] Each of the M training samples includes the historical IO service time corresponding to each of the N1 disks.
[0274] In one implementation, the processing unit 802 is specifically used for:
[0275] Input M initial training samples into the clustering model to obtain K2 initial cluster sets and K2 initial cluster centers output by the clustering model. Each initial cluster set corresponds to one initial cluster center; K2 is a positive integer.
[0276] Based on K2 initial cluster centers, generate K2 initial slow disk detection thresholds;
[0277] Input M second training samples into the clustering model to obtain K1 cluster sets and K1 cluster centers output by the clustering model; K1 is a positive integer;
[0278] Based on K1 cluster centers, generate K1 reference slow disk detection thresholds;
[0279] Based on K1 reference slow disk detection thresholds, update K2 initial slow disk detection thresholds to obtain K1 slow disk detection thresholds;
[0280] Each first training sample includes the historical IO service time corresponding to each of the N2 drive letters, and each second training sample includes the historical IO service time corresponding to each of the N1 drive letters, where N2 is a positive integer.
[0281] In one implementation, the target slow disk detection threshold includes a detection threshold corresponding to each of the N1 disk letters; the processing unit 802 is specifically used for:
[0282] The detection threshold corresponding to the target drive letter is determined from the target detection threshold; the target drive letter is any drive letter among N1 drive letters;
[0283] If the IO service time corresponding to the target drive is greater than the detection threshold corresponding to the target drive, then based on the value of the second parameter, the value of the first parameter is updated to obtain the updated value of the first parameter; and the value of the second parameter is initialized to obtain the updated value of the second parameter; the first parameter is used to represent the number of times the IO service time corresponding to the target drive is greater than the detection threshold corresponding to the target drive; the second parameter is used to represent the number of times the target drive is normal, where normal means that the IO service time corresponding to the target drive is less than or equal to the detection threshold corresponding to the target drive, and the value of the first parameter is greater than 0;
[0284] If the update value of the first parameter is greater than the number of times threshold is reached, then the hard disk or logical disk identified by the target drive letter is determined to be a slow disk, and the number of times threshold is greater than 0.
[0285] In one implementation, the acquisition unit 801 is also used for:
[0286] If the parameter update value of the first parameter is less than or equal to the number of times threshold is reached, and the parameter update value of the first parameter is greater than or equal to 0, then continue to obtain the device IO service time of the target device.
[0287] In one implementation, the processing unit 802 is further configured to: initialize the parameter update value of the first parameter if the parameter update value of the first parameter is less than 0;
[0288] The acquisition unit 801 is also used to continue acquiring the device I / O service time of the target device.
[0289] In one implementation, the processing unit 802 is further configured to:
[0290] If the IO service time corresponding to the target drive is less than or equal to the detection threshold corresponding to the target drive, and the parameter value of the first parameter is greater than 0, then update the parameter value of the second parameter to obtain the parameter update value of the second parameter.
[0291] The acquisition unit 801 is also used to continue acquiring the device I / O service time of the target device.
[0292] In one implementation, the parameter value of the first parameter is either the initial value obtained by initializing the first parameter or the parameter update value of the first parameter obtained during the last slow disk detection.
[0293] The value of the second parameter is either the initial value obtained by initializing the second parameter, or the updated value of the second parameter obtained during the last slow disk test.
[0294] In one implementation, the acquisition unit 801 is specifically used to: acquire the device I / O service time of the target device at a first sampling frequency; or, acquire the device I / O service time of the target device at a second sampling frequency; wherein the first sampling frequency is less than the second sampling frequency.
[0295] In this embodiment, the device IO service time of the target device is obtained, including the IO service time corresponding to each of the N1 drive letters. Then, based on the device IO service time and K1 cluster centers, K1 distances are determined; K1 and N1 are positive integers; each cluster center corresponds to a slow disk detection threshold. A target distance is determined from the K1 distances, and a target cluster center corresponding to the target distance is determined from the K1 cluster centers. The target slow disk detection threshold corresponding to the target cluster center is then determined. Based on the target slow disk detection threshold and the IO service time corresponding to each drive letter, slow disk detection is performed on the hard disks or logical hard disks identified by each drive letter in the target device. This embodiment enables accurate identification of slow disk scenarios from the perspective of IO performance corresponding to drive letters. Furthermore, this embodiment allows selection of a suitable target slow disk detection threshold by using the distance between the device IO service time and the cluster center, solving the problem of a single, fixed slow disk detection threshold and improving the accuracy and effectiveness of slow disk detection.
Claims
1. A method for detecting slow disks, characterized in that, include: Obtain the device I / O service time of the target device, wherein the device I / O service time includes the I / O service time corresponding to each of the N1 disk letters; Based on the device IO service time and K1 cluster centers, K1 distances are determined; K1 is a positive integer, and N1 is an integer greater than or equal to 2; each cluster center corresponds to a slow disk detection threshold set; the cluster centers are calculated based on the historical device IO service time in the corresponding cluster set, and the historical device IO service time includes the historical IO service time corresponding to each of the N1 disk letters; the slow disk detection threshold set includes the detection threshold corresponding to each of the N1 disk letters; Determine the target distance from the K1 distances, determine the target cluster center corresponding to the target distance from the K1 cluster centers, and determine the target slow disk detection threshold set corresponding to the target cluster center; Based on the target slow disk detection threshold set and the IO service time corresponding to each drive letter, slow disk detection is performed on the hard disks or logical hard disks identified by each drive letter in the target device.
2. The method as described in claim 1, characterized in that, The method further includes: Input M training samples into the clustering model to obtain K1 cluster sets and K1 cluster centers output by the clustering model, with one cluster set corresponding to one cluster center; Based on the K1 cluster centers, generate a set of K1 slow disk detection thresholds; Each of the M training samples includes the historical IO service time corresponding to each of the N1 drive letters.
3. The method as described in claim 1, characterized in that, The method further includes: M first training samples are input into the clustering model to obtain K2 initial cluster sets and K2 initial cluster centers output by the clustering model, where one initial cluster set corresponds to one initial cluster center; K2 is a positive integer; Based on the K2 initial cluster centers, generate K2 initial slow disk detection threshold sets; M second training samples are input into the clustering model to obtain K1 cluster sets and K1 cluster centers output by the clustering model; where K1 is a positive integer. Based on the K1 cluster centers, generate a set of K1 reference slow disk detection thresholds; Based on the K1 reference slow disk detection threshold sets, update the K2 initial slow disk detection threshold sets to obtain the K1 slow disk detection threshold sets. Each first training sample includes the historical IO service time corresponding to each of the N2 drive letters, and each second training sample includes the historical IO service time corresponding to each of the N1 drive letters, where N2 is a positive integer.
4. The method as described in claim 1, characterized in that, The target slow disk detection threshold set includes the detection threshold corresponding to each of the N1 disk letters; The step of performing slow disk detection on the hard disks or logical hard disks identified by each drive letter in the target device based on the target slow disk detection threshold set and the IO service time corresponding to each drive letter includes: The detection threshold corresponding to the target drive letter is determined from the target slow drive detection threshold set; the target drive letter is any drive letter among N1 drive letters; If the IO service time corresponding to the target drive is greater than the detection threshold corresponding to the target drive, then based on the parameter value of the second parameter, the parameter value of the first parameter is updated to obtain the parameter update value of the first parameter; and the parameter value of the second parameter is initialized to obtain the parameter update value of the second parameter; the first parameter is used to represent the number of times the IO service time corresponding to the target drive is greater than the detection threshold corresponding to the target drive; the second parameter is used to represent the number of times the target drive is normal, wherein a normal target drive means that the IO service time corresponding to the target drive is less than or equal to the detection threshold corresponding to the target drive, and the parameter value of the first parameter is greater than 0; If the parameter update value of the first parameter is greater than the number of times threshold, then the hard disk or logical disk identified by the target drive letter is determined to be a slow disk, and the number of times threshold is greater than 0.
5. The method as described in claim 4, characterized in that, The method further includes: If the parameter update value of the first parameter is less than or equal to the number of times threshold, and the parameter update value of the first parameter is greater than or equal to 0, then continue to obtain the device IO service time of the target device.
6. The method as described in claim 5, characterized in that, The method further includes: If the parameter update value of the first parameter is less than 0, then the parameter update value of the first parameter is initialized, and the device IO service time of the target device is obtained again.
7. The method as described in claim 4, characterized in that, The method further includes: If the IO service time corresponding to the target drive is less than or equal to the detection threshold corresponding to the target drive, and the parameter value of the first parameter is greater than 0, then the parameter value of the second parameter is updated to obtain the parameter update value of the second parameter, and the device IO service time of the target device is continued to be obtained.
8. The method according to any one of claims 4-7, characterized in that, The parameter value of the first parameter is the initial value obtained by initializing the first parameter, or the parameter value of the first parameter is the parameter update value obtained when the slow disk detection was performed last time; The value of the second parameter is either the initial value obtained by initializing the second parameter or the updated value of the second parameter obtained during the last slow disk detection.
9. The method as described in claim 1, characterized in that, The acquisition of the device input / output (IO) service time of the target device includes: Obtain the device I / O service time of the target device using the first sampling frequency; or, The device I / O service time of the target device is obtained using the second sampling frequency. Wherein, the first sampling frequency is less than the second sampling frequency.
10. A computing device, characterized in that, The computing device includes a central processing unit (CPU), a disk array (RAID) card, a hard drive, and a motherboard. The RAID card is connected to the hard drive via a cable, and the RAID card is connected to the CPU via the motherboard. The CPU is used to execute the slow disk detection method as described in any one of claims 1-9.
Citation Information
Patent Citations
Data processing method and device and storage medium
CN111831389A
Slow-disk detection method, and storage array
WO2019101087A1