Slow disk detection method and device, computer equipment, readable storage medium and program product
By calculating the difference between the request time consumed by the input and output requests and the disk operation time, and combining with the preset threshold, the problem of poor accuracy of slow disk detection in the prior art is solved, and the accurate identification and timely processing of slow disk blocks are realized. Improves the stability of the storage system.
Patent Information
- Application Number
- CN202411247491.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-05
- Publication Date
- 2024-12-13
AI Technical Summary
The existing slow disk detection methods have poor detection accuracy and cannot accurately identify the specific location of slow blocks in the disk, making it difficult to deal with the impact on the storage system in a timely manner.
By analyzing the return time of the input and output request and the last disk operation time, the request time is calculated, and whether there are slow blocks based on the preset threshold value is determined, slow disk detection information is generated, and detection accuracy is improved.
Accurate detection of slow blocks in slow disks is achieved, the accuracy and timeliness of slow disk detection are improved, and the impact on the storage system is reduced.
Smart Images

Figure CN119127084A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a slow disk detection method, device, computer equipment, computer-readable storage medium and computer program product. Background Art
[0002] Traditional mechanical hard disks are mainly composed of: disks, heads, disk shafts and control motors, head controllers, data converters, interfaces, caches, etc. The heads can move along the radius of the disk, and with the high-speed rotation of the disk at several thousand revolutions per minute, the heads can be positioned at the specified position of the disk to read and write data. In storage systems, as the disk is used for a long time, the disk may have long input / output (I / O) and slow response time. When a slow disk occurs, it will cause access jams and interruptions to the storage system. To address the above problems, it is necessary to promptly detect the slow disk and respond to the slow disk to reduce the overall impact on the storage system.
[0003] In the related disk performance monitoring scheme, input / output statistics (I / O stat) are usually used to monitor the performance of disk response input / output. However, the returned data monitoring can only perceive the average input / output time consumption of the disk in a certain period of time as slow. There may be slow disks and slow blocks, but it is impossible to know which area on the disk has slow blocks. Therefore, the detection accuracy of the related slow disk detection methods is poor. Summary of the invention
[0004] Based on this, it is necessary to provide a slow disk detection method, device, computer equipment, computer-readable storage medium and computer program product that can improve detection accuracy in response to the above technical problems.
[0005] In a first aspect, the present application provides a slow disk detection method, comprising:
[0006] In response to an input / output request corresponding to the target disk, determining a request duration of the input / output request according to a return time corresponding to the input / output request and a previous disk input / output request action time corresponding to the return time;
[0007] In the case where the request time meets a preset delay condition, determining the disk space accessed by the input and output request as a slow block;
[0008] When a preset slow disk condition is met, slow disk detection information including slow block information of the slow block is generated.
[0009] In this way, by checking whether the request time of a single input / output request meets the delay condition, the disk space accessed by the input / output request is determined to be a slow block, and the slow disk detection information generated includes the slow block information of the slow block. In this way, during the slow disk detection process, the slow block in the slow disk can be detected, thereby improving the detection accuracy of the slow disk detection. In addition, this method uses the time difference between the return time corresponding to the input / output request and the last disk input / output request action time corresponding to the return time as the request time of a single input / output request and compares it with the corresponding threshold value to determine whether there is a slow block on the disk, which is more in line with the actual situation, can improve the accuracy of slow block detection, and further improve the detection accuracy of slow disk detection.
[0010] In one of the embodiments, when the request time satisfies a preset delay condition, determining the disk space accessed by the input and output request as a slow block includes:
[0011] If the request time consumption is greater than the request time consumption threshold of the target disk, the disk space accessed by the input and output request is determined as a slow block.
[0012] In this way, by determining whether the request time consumption is greater than the request time consumption threshold of the target disk, whether there is a slow block can be detected, thereby realizing slow block detection and improving the detection accuracy of slow disk detection.
[0013] In one of the embodiments, when the request time satisfies a preset delay condition, determining the disk space accessed by the input and output request as a slow block includes:
[0014] The time difference between the disk download time corresponding to the input / output request and the last disk input / output request action time corresponding to the disk download time is used as the disk idle time corresponding to the input / output request;
[0015] If the request time is greater than the request time threshold of the target disk and the disk idle time is less than the disk idle time threshold of the target disk, the disk space accessed by the input and output request is determined as a slow block.
[0016] In this way, by calculating the disk idle time corresponding to the input and output requests, when the disk idle time reaches the disk idle time threshold, even if the request time exceeds the request time threshold, the slow block will not be recorded. Considering the actual situation of disk operation, the accuracy of slow block detection can be further improved, and the accuracy of slow disk detection can be further improved.
[0017] In one embodiment, the method further comprises:
[0018] The disk parameters of the target disk and the historical request times corresponding to the input and output requests of the target disk within a preset historical time period are input into a pre-trained request time threshold prediction model to obtain the request time threshold of the target disk.
[0019] In this way, the real-time disk parameters of the target disk and the historical request consumption corresponding to each input and output request of the target disk within a preset historical time period that changes with time are input into a pre-trained request consumption threshold prediction model, and the request consumption threshold of the target disk is predicted in real time, which is more in line with the actual situation, can improve the accuracy of the request consumption threshold, can further improve the accuracy of slow block detection, and thereby further improve the accuracy of slow disk detection.
[0020] In one of the embodiments, when a preset slow disk condition is met, generating slow disk detection information including slow block information of the slow block includes:
[0021] When the determined number of slow blocks exceeds a preset slow block number threshold, slow disk detection information including slow block information of the slow blocks is generated.
[0022] In this way, by determining whether the number of slow blocks exceeds the slow block number threshold, it is determined whether to generate slow disk detection information. Through the recorded disk slow block information, the terminal can promptly discover the existence of slow disk conditions, so as to promptly discover slow disk conditions in the production environment and deal with the slow disk, thereby reducing the impact on the business and improving the timeliness of slow disk detection and production efficiency.
[0023] In one embodiment, the method further comprises:
[0024] Based on the disk download interface corresponding to the input / output request in the target disk and the return interface corresponding to the input / output request, the input / output request path of the target disk is monitored to obtain the disk download time and return time corresponding to the input / output request.
[0025] In this way, by loading the kernel module and monitoring the input and output request path, the slow blocks of the disk can be monitored and recorded without affecting the normal execution speed and process of the input and output requests.
[0026] In a second aspect, the present application further provides a slow disk detection device, comprising:
[0027] A first determination module is used to respond to an input / output request corresponding to a target disk, and determine a request duration of the input / output request according to a return time corresponding to the input / output request and a previous disk input / output request action time corresponding to the return time;
[0028] A second determination module is used to determine the disk space accessed by the input and output request as a slow block if the request time meets a preset delay condition;
[0029] A generating module is used to generate slow disk detection information including slow block information of the slow block when a preset slow disk condition is met.
[0030] In one embodiment, the second determining module is specifically configured to:
[0031] If the request time consumption is greater than the request time consumption threshold of the target disk, the disk space accessed by the input and output request is determined as a slow block.
[0032] In one embodiment, the second determining module is specifically configured to:
[0033] The time difference between the disk download time corresponding to the input / output request and the last disk input / output request action time corresponding to the disk download time is used as the disk idle time corresponding to the input / output request;
[0034] If the request time is greater than the request time threshold of the target disk and the disk idle time is less than the disk idle time threshold of the target disk, the disk space accessed by the input and output request is determined as a slow block.
[0035] In one embodiment, the device further comprises:
[0036] The prediction module is used to input the disk parameters of the target disk and the historical request consumption corresponding to each input and output request of the target disk in a preset historical time period into a pre-trained request consumption threshold prediction model to obtain the request consumption threshold of the target disk.
[0037] In one embodiment, the generating module is specifically used for:
[0038] When the determined number of slow blocks exceeds a preset slow block number threshold, slow disk detection information including slow block information of the slow blocks is generated.
[0039] In one embodiment, the device further comprises:
[0040] The monitoring module is used to monitor the input and output request path of the target disk based on the disk download interface corresponding to the input and output request in the target disk and the return interface corresponding to the input and output request, and obtain the disk download time and return time corresponding to the input and output request.
[0041] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps described in the first aspect when executing the computer program.
[0042] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps described in the first aspect above when executed by a processor.
[0043] In a fifth aspect, the present application further provides a computer program product, comprising a computer program, which implements the steps described in the first aspect when executed by a processor.
[0044] The above-mentioned slow disk detection method, device, computer equipment, computer-readable storage medium and computer program product respond to the input and output request corresponding to the target disk, determine the request time of the input and output request according to the return time corresponding to the input and output request and the last disk input and output request action time corresponding to the return time; if the request time satisfies the preset delay condition, the disk space accessed by the input and output request is determined as a slow block; when the preset slow disk condition is met, slow disk detection information containing slow block information of the slow block is generated. In this way, the request time of a single input and output request is determined according to the return time corresponding to the input and output request and the last disk input and output request action time corresponding to the return time, and the disk space accessed by the input and output request is determined as a slow block by whether the request time of the single input and output request satisfies the delay condition, and the generated slow disk detection information contains the slow block information of the slow block, so that in the slow disk detection process, the slow blocks in the slow disk can be detected, thereby improving the detection accuracy of the slow disk detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0046] FIG1 is a schematic diagram of a flow chart of a slow disk detection method according to an embodiment;
[0047] FIG2 is a schematic diagram of a scenario in which there is only one input / output request being executed on the current disk in an embodiment;
[0048] FIG3 is a schematic diagram of a first scenario in which two input and output requests are currently being executed on a disk in one embodiment;
[0049] FIG4 is a schematic diagram of a second scenario in which two input and output requests are currently being executed on a disk in one embodiment;
[0050] FIG5 is a flowchart of a step of determining a disk space accessed by an input / output request as a slow block when the request time meets a preset delay condition in one embodiment;
[0051] FIG6 is a schematic diagram of a flow chart of a slow disk detection method in another embodiment;
[0052] FIG7 is a structural block diagram of a slow disk detection device in one embodiment;
[0053] FIG. 8 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0054] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0055] In one embodiment, as shown in FIG1 , a slow disk detection method is provided. This embodiment uses the method applied to a terminal as an example for illustration. It is understandable that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. Among them, the terminal can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, projection devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The head-mounted device can be a virtual reality (VR) device, an augmented reality (AR) device, smart glasses, etc. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services. In this embodiment, the method includes the following steps:
[0056] Step 101 , in response to an input / output request corresponding to a target disk, the request duration of the input / output request is determined according to a return time corresponding to the input / output request and a previous disk input / output request action time corresponding to the return time.
[0057] In an embodiment of the present application, after the input / output request is sent to the disk, the disk can execute the input / output request and return the return result corresponding to the input / output request. In response to the input / output request corresponding to the target disk, the terminal determines the last disk input / output request action time corresponding to the return time according to the return time corresponding to the input / output request. Then, the terminal uses the time difference between the return time and the last disk input / output request action time corresponding to the return time as the request time of the input / output request. Among them, the target disk is the disk to be detected for slow disk. The last disk input / output request action time is the time when the disk last performed the input / output request action. The input / output request action includes the input / output request being sent to the disk and the return result corresponding to the input / output request being returned from the disk. The return time is the time when the return result corresponding to the input / output request is returned from the disk. The disk download time is the time when the input / output request is sent to the disk. The last disk input / output request action time corresponding to the return time includes the disk download time corresponding to the input / output request, and one of the disk download time and the return time corresponding to other input / output requests.
[0058] In one embodiment, when the number of input / output requests executed by the target disk is 1, the terminal determines that the disk download time corresponding to the input / output request is the last disk input / output request action time corresponding to the return time corresponding to the input / output request. For example, in the scenario where the current disk has only one input / output request executing, as shown in FIG2 , the input / output request sending queue queue_cmd sends the input / output request A to the disk disk, and the disk disk returns the return result of the input / output request A to the input / output request completion return queue io_done. The disk download time corresponding to the input / output request A is A1, and the return time corresponding to the input / output request A is A1. ’ , the request time of input and output request A = A1 ’ -A1.
[0059] In another embodiment, the number of input and output requests executed by the target disk may be multiple (i.e., executed in parallel). Taking two input and output requests as an example, when the disk input and output request action times corresponding to the input and output requests are arranged in a time sequence from early to late as the disk download time corresponding to the first input and output request, the disk download time corresponding to the second input and output request, the return time corresponding to the second input and output request, and the return time corresponding to the first input and output request, the terminal determines that the return time corresponding to the second input and output request is the last disk input and output request action time corresponding to the return time corresponding to the first input and output request. For example, in the first scenario where the current disk has two input and output requests being executed, as shown in FIG3, the input and output request sending queue queue_cmd sends input and output requests A and B to the disk disk, and the disk disk returns the return results of input and output requests A and B to the input and output request completion return queue io_done. The disk download time corresponding to input and output request A is A1, and the return time corresponding to input and output request A is A1. ’ ; The download time corresponding to input and output request B is B1, and the return time corresponding to input and output request B is B1 ’ ; A1 <B1<B1 ’ <A1 ’ . Request time for input and output request A = A1 ’ -B1 ’ .
[0060] In another embodiment, the number of input and output requests executed by the target disk can be multiple. Taking two input and output requests as an example, when the disk input and output request action times corresponding to the input and output requests are arranged in a time sequence from early to late as the disk download time corresponding to the first input and output request, the disk download time corresponding to the second input and output request, the return time corresponding to the first input and output request, and the return time corresponding to the second input and output request, the terminal determines that the disk download time corresponding to the second input and output request is the last disk input and output request action time corresponding to the return time corresponding to the first input and output request. For example, the second scenario in which the current disk has two input and output requests being executed, as shown in FIG4, the input and output request sending queue queue_cmd sends input and output requests A and B to the disk disk, and the disk disk returns the return result of the input and output request A to the input and output request completion return queue io_done, and the disk disk sends the input and output request B to the disk execution input and output request queue disk_doing_io. The disk download time corresponding to the input and output request A is A1, and the return time corresponding to the input and output request A is A1. ’ ; The disk download time corresponding to input and output request B is B1, and the disk execution time corresponding to input and output request B is B1 ’ ; A1 <B1<A1’ . Request time for input and output request A = A1 ’ -B1.
[0061] Step 102: When the request time meets a preset delay condition, the disk space accessed by the input and output request is determined as a slow block.
[0062] In an embodiment of the present application, the terminal determines whether the request time meets the preset delay condition. If the request time meets the preset delay condition, the terminal determines the disk space accessed by the input / output request as a slow block. For example, if the request time meets the preset delay condition, the terminal determines the sector accessed by the input / output request as a slow block. The slow block is a block area that responds slowly to the input / output request after the input / output request is placed on the disk.
[0063] Step 103: When a preset slow disk condition is met, slow disk detection information of the target disk including slow block information of slow blocks is generated.
[0064] In the embodiment of the present application, the slow disk condition is used to determine whether the disk is a slow disk. The slow block information includes a slow block identifier and may also include at least one of a request time and a current timestamp. The slow disk detection information is used to indicate whether the disk is a slow disk.
[0065] In one example, each time a slow block is determined, the terminal generates a slow block record including a slow block identifier. If the number of slow block records exceeds a preset slow block record threshold, it is determined that the preset slow disk condition is met. The slow block record threshold may be 1, or may be greater than 1, and may be an integer or a non-integer.
[0066] In one example, the terminal provides a slow disk recording interface.
[0067] In the above slow disk detection method, the request time of a single input and output request is determined according to the return time corresponding to the input and output request and the last disk input and output request action time corresponding to the return time, and the disk space accessed by the input and output request is determined to be a slow block by whether the request time of the single input and output request meets the delay condition, and the generated slow disk detection information contains the slow block information of the slow block, so that in the slow disk detection process, the slow block in the slow disk can be detected, which improves the detection accuracy of the slow disk detection. Not only that, when multiple input and output requests are sent to the same disk within a period of time, the time consumption of a single input and output request may be longer, but this scenario cannot be considered that the disk is a slow disk, because there may be input and output requests sent to the disk or returned from the disk before this input and output request returns. This method compares the time difference between the return time corresponding to the input and output request and the last disk input and output request action time corresponding to the return time as the request time of a single input and output request with the corresponding threshold, and determines that there is a slow block on the disk, which is more in line with the actual situation, can improve the accuracy of slow block detection, and further improve the detection accuracy of slow disk detection.
[0068] In an exemplary embodiment, when the request time satisfies a preset delay condition, the specific process of determining the disk space accessed by the input and output request as a slow block includes the following steps: if the request time is greater than the request time threshold of the target disk, the disk space accessed by the input and output request is determined as a slow block.
[0069] In an embodiment of the present application, the terminal compares the request time consumption with the request time consumption threshold of the target disk. If the request time consumption is greater than the request time consumption threshold of the target disk, the terminal determines the disk space accessed by the input and output request as a slow block. Among them, the request time consumption threshold can be a fixed value or a value that changes in real time; it can be a preset value or a value calculated in real time. The request time consumption thresholds of different disks can be the same or different. The terminal can determine the request time consumption threshold of the target disk based on the disk parameters of the target disk.
[0070] In the above slow disk detection method, whether there is a slow block is determined by whether the request time is greater than the request time threshold of the target disk, so that slow block detection can be implemented and the detection accuracy of slow disk detection can be improved.
[0071] In an exemplary embodiment, as shown in FIG5 , when the request time meets the preset delay condition, the specific process of determining the disk space accessed by the input and output request as a slow block includes the following steps:
[0072] Step 501, taking the time difference between the disk download time corresponding to the input / output request and the last disk input / output request action time corresponding to the disk download time as the disk idle time corresponding to the input / output request.
[0073] In the embodiment of the present application, the last disk input / output request action time corresponding to the disk drop time includes one of the disk drop time and the return time corresponding to other input / output requests. The terminal determines the last disk input / output request action time corresponding to the disk drop time from the disk drop time and the return time corresponding to each input / output request according to the disk drop time corresponding to the input / output request. Then, the terminal uses the time difference between the disk drop time and the last disk input / output request action time corresponding to the disk drop time as the disk idle time corresponding to the input / output request.
[0074] Step 502: If the request time is greater than the request time threshold of the target disk and the disk idle time is less than the disk idle time threshold of the target disk, the disk space accessed by the input and output request is determined as a slow block.
[0075] In an embodiment of the present application, if the request duration is less than or equal to the request duration threshold of the target disk, or the disk idle time is greater than or equal to the disk idle time threshold of the target disk, the terminal determines that the request duration does not meet the preset delay condition. The disk idle time threshold can be a fixed value or a value that changes in real time; it can be a preset value or a value calculated in real time. The disk idle time thresholds of different disks can be the same or different. The terminal can determine the disk idle time threshold of the target disk based on the disk parameters of the target disk.
[0076] In the above slow disk detection method, the time difference between the disk download time corresponding to the input / output request and the last disk input / output request action time corresponding to the disk download time is used as the disk idle time corresponding to the input / output request; if the request time is greater than the request time threshold of the target disk, and the disk idle time is less than the disk idle time threshold of the target disk, the disk space accessed by the input / output request is determined as a slow block. In this way, by calculating the disk idle time corresponding to the input / output request, when the disk idle time reaches the disk idle time threshold, even if the request time exceeds the request time threshold, the slow block is not recorded. Considering the actual situation of the disk operation, the accuracy of slow block detection can be further improved, thereby further improving the accuracy of slow disk detection.
[0077] In an exemplary embodiment, the method also includes the following steps: inputting the disk parameters of the target disk and the historical request consumption corresponding to each input and output request of the target disk within a preset historical time period into a pre-trained request consumption threshold prediction model to obtain the request consumption threshold of the target disk.
[0078] In an embodiment of the present application, the disk parameter may include at least one of the disk rotation speed, the disk size, and the disk temperature. The historical time period (also referred to as the first historical time period for ease of distinction) may be a fixed time window, for example, it may be a time period closest to the current time, or it may be at the hour level. The historical request time is the request time of the input and output requests within the historical time period, and the accuracy may be 1 minute. The request time threshold prediction model is used to predict the request time threshold, and may be a machine learning model, a deep learning model, or a neural network model.
[0079] In the above-mentioned slow disk detection method, the real-time disk parameters of the target disk and the historical request time corresponding to each input and output request of the target disk within a preset historical time period that changes with time are input into a pre-trained request time threshold prediction model, and the request time threshold of the target disk is predicted in real time, which is more in line with the actual situation, can improve the accuracy of the request time threshold, can further improve the accuracy of slow block detection, and thus further improve the accuracy of slow disk detection.
[0080] In an exemplary embodiment, the method further includes the following steps: taking the average time of historical request times corresponding to each input and output request of the target disk within a preset second historical time period as the request time threshold of the target disk. The second historical time period may be a fixed time window, for example, it may be a time period closest to the current time, or it may be at the hour level. The second historical time period may be the same as the first historical time period, or it may be different from the first historical time period. In this way, according to the actual situation that changes in real time, the request time threshold of the target disk is determined in real time, which can improve the accuracy of the request time threshold, further improve the accuracy of slow block detection, and further improve the accuracy of slow disk detection.
[0081] In an exemplary embodiment, when a preset slow disk condition is met, the specific process of generating slow disk detection information including slow block information of slow blocks includes the following steps: when the determined number of slow blocks exceeds a preset slow block number threshold, generating slow disk detection information including slow block information of slow blocks.
[0082] In an embodiment of the present application, each time a slow block is determined, the terminal generates a slow block record containing a slow block identifier. If there is no slow block record containing the slow block identifier, the number of determined slow blocks is updated. If there is a slow block record containing the slow block identifier, the number of determined slow blocks remains unchanged. Among them, the slow block number threshold can be 1, or greater than 1, and can be an integer or a non-integer. After the slow block is disposed of, the terminal clears the slow block record containing the slow block identifier of the slow block.
[0083] In the above slow disk detection method, whether to generate slow disk detection information is determined by determining whether the number of slow blocks exceeds the slow block number threshold. By recording the disk slow block information, the terminal can promptly discover the existence of a slow disk, so as to promptly discover the slow disk in the production environment and deal with the slow disk, thereby reducing the impact on the business and improving the timeliness of slow disk detection and production efficiency.
[0084] In an exemplary embodiment, the method further includes the following steps: based on the disk download interface corresponding to the input / output request in the target disk, and the return interface corresponding to the input / output request, the input / output request path of the target disk is monitored to obtain the disk download time and return time corresponding to the input / output request.
[0085] In an embodiment of the present application, when the terminal system is a Linux system, in response to each input / output request corresponding to the target disk, the terminal monitors the input / output request path of the target disk through the kernel module based on the disk-down interface corresponding to the input / output request in the target disk and the return interface corresponding to the input / output request, obtains the disk-down time and return time corresponding to the input / output request, and records the disk-down time and return time corresponding to the input / output request. The disk-down interface and the return interface are interfaces of the disk controller driver of the target disk. The disk controller driver can be a megaraid_sas driver and / or a mpt3sas driver.
[0086] In the above slow disk detection method, based on the disk download interface corresponding to the input and output request in the target disk and the return interface corresponding to the input and output request, the input and output request path of the target disk is monitored to obtain the disk download time and return time corresponding to the input and output request. In this way, by loading the kernel module and monitoring the input and output request path, the monitoring and recording of the slow blocks of the disk are realized without affecting the normal execution speed and process of the input and output request.
[0087] In one embodiment, as shown in FIG6 , a slow disk detection method is provided, the method comprising the following steps:
[0088] Step 601, based on the disk download interface corresponding to the input / output request in the target disk and the return interface corresponding to the input / output request, the input / output request path of the target disk is monitored to obtain the disk download time and return time corresponding to the input / output request.
[0089] Step 602 , in response to the input / output request corresponding to the target disk, determine the request duration of the input / output request according to the return time corresponding to the input / output request and the last disk input / output request action time corresponding to the return time.
[0090] Step 603 , input the disk parameters of the target disk and the historical request consumption corresponding to each input and output request of the target disk in a preset historical time period into a pre-trained request consumption threshold prediction model to obtain the request consumption threshold of the target disk.
[0091] Step 604: The time difference between the disk download time corresponding to the input / output request and the last disk input / output request action time corresponding to the disk download time is used as the disk idle time corresponding to the input / output request.
[0092] Step 605 , determining whether the request duration is greater than a request duration threshold of the target disk, and whether the disk idle time is less than a disk idle time threshold of the target disk.
[0093] If the request time is greater than the request time threshold of the target disk and the disk idle time is less than the disk idle time threshold of the target disk, jump to step 606 to determine the disk space accessed by the input and output request as a slow block.
[0094] If the request duration is less than or equal to the request duration threshold of the target disk, or the disk idle time is greater than or equal to the disk idle time threshold of the target disk, the process returns to step 601 .
[0095] Step 607: determine whether the determined number of slow blocks exceeds a preset slow block number threshold.
[0096] If the determined number of slow blocks exceeds the preset slow block number threshold, the process jumps to step 608 to generate slow disk detection information including slow block information of the slow blocks.
[0097] If the determined number of slow blocks is less than the preset slow block number threshold, the process returns to step 601 .
[0098] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0099] Based on the same inventive concept, the embodiment of the present application also provides a slow disk detection device for implementing the above-mentioned slow disk detection method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above-mentioned method, so the specific limitations in one or more slow disk detection device embodiments provided below can refer to the limitations of the slow disk detection method above, and will not be repeated here.
[0100] In an exemplary embodiment, as shown in FIG. 7 , a slow disk detection device 700 is provided, comprising: a first determination module 710 , a second determination module 720 , and a generation module 730 , wherein:
[0101] The first determination module 710 is used to respond to the input / output request corresponding to the target disk, and determine the request duration of the input / output request according to the return time corresponding to the input / output request and the last disk input / output request action time corresponding to the return time;
[0102] A second determination module 720 is configured to determine the disk space accessed by the input / output request as a slow block if the request time meets a preset delay condition;
[0103] The generating module 730 is used to generate slow disk detection information including slow block information of the slow block when a preset slow disk condition is met.
[0104] Optionally, the second determining module 720 is specifically configured to:
[0105] If the request time consumption is greater than the request time consumption threshold of the target disk, the disk space accessed by the input and output request is determined as a slow block.
[0106] Optionally, the second determining module 720 is specifically configured to:
[0107] The time difference between the disk download time corresponding to the input / output request and the last disk input / output request action time corresponding to the disk download time is used as the disk idle time corresponding to the input / output request;
[0108] If the request time is greater than the request time threshold of the target disk and the disk idle time is less than the disk idle time threshold of the target disk, the disk space accessed by the input and output request is determined as a slow block.
[0109] Optionally, the device 700 further includes:
[0110] The prediction module is used to input the disk parameters of the target disk and the historical request consumption corresponding to each input and output request of the target disk in a preset historical time period into a pre-trained request consumption threshold prediction model to obtain the request consumption threshold of the target disk.
[0111] Optionally, the generating module 730 is specifically configured to:
[0112] When the determined number of slow blocks exceeds a preset slow block number threshold, slow disk detection information including slow block information of the slow blocks is generated.
[0113] Optionally, the device 700 further includes:
[0114] The monitoring module is used to monitor the input and output request path of the target disk based on the disk download interface corresponding to the input and output request in the target disk and the return interface corresponding to the input and output request, and obtain the disk download time and return time corresponding to the input and output request.
[0115] Each module in the above slow disk detection device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0116] In an exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be shown in FIG8. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, the memory, and the input / output interface are connected via a system bus, and the communication interface, the display unit, and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner may be implemented through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, a slow disk detection method is implemented. The display unit of the computer device is used to form a visually visible picture, which may be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0117] Those skilled in the art will understand that the structure shown in FIG. 8 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0118] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the following steps when executing the computer program: in response to an input / output request corresponding to a target disk, determining a request duration of the input / output request according to a return time corresponding to the input / output request and a previous disk input / output request action time corresponding to the return time; determining the disk space accessed by the input / output request as a slow block when the request duration satisfies a preset delay condition; and generating slow disk detection information containing slow block information of the slow block when the preset slow disk condition is met.
[0119] In one embodiment, when the processor executes the computer program, the following steps are further implemented: when the number of the slow blocks exceeds a preset slow block number threshold, slow disk detection information including slow block information of the slow blocks is generated.
[0120] In one embodiment, when the processor executes the computer program, the following steps are further implemented: if the request time is greater than the request time threshold of the target disk, it is determined that the request time satisfies a preset delay condition.
[0121] In one embodiment, the processor also implements the following steps when executing the computer program: taking the time difference between the disk download time corresponding to the input / output request and the last disk input / output request action time corresponding to the disk download time as the disk idle time corresponding to the input / output request; if the request time is greater than the request time threshold of the target disk, and the disk idle time is less than the disk idle time threshold of the target disk, it is determined that the request time satisfies a preset delay condition.
[0122] In one embodiment, when the processor executes the computer program, the following steps are also implemented: the disk parameters of the target disk and the historical request consumption corresponding to each input and output request of the target disk within a preset historical time period are input into a pre-trained request consumption threshold prediction model to obtain the request consumption threshold of the target disk.
[0123] In one embodiment, when the processor executes the computer program, the following steps are also implemented: based on the lower disk interface corresponding to the input and output request in the target disk, and the return interface corresponding to the input and output request, the input and output request path of the target disk is monitored to obtain the return time corresponding to the input and output request and the last disk input and output request action time corresponding to the return time.
[0124] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented: in response to an input / output request corresponding to a target disk, the request duration of the input / output request is determined according to a return time corresponding to the input / output request and a previous disk input / output request action time corresponding to the return time; if the request duration satisfies a preset delay condition, the disk space accessed by the input / output request is determined as a slow block; when the preset slow disk condition is met, slow disk detection information containing slow block information of the slow block is generated.
[0125] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: when the number of the slow blocks exceeds a preset slow block number threshold, slow disk detection information including slow block information of the slow blocks is generated.
[0126] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: if the request time is greater than the request time threshold of the target disk, determining that the request time satisfies a preset delay condition.
[0127] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: the time difference between the disk download time corresponding to the input / output request and the last disk input / output request action time corresponding to the disk download time is used as the disk idle time corresponding to the input / output request; if the request time is greater than the request time threshold of the target disk, and the disk idle time is less than the disk idle time threshold of the target disk, it is determined that the request time satisfies a preset delay condition.
[0128] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: the disk parameters of the target disk and the historical request consumption corresponding to each input and output request of the target disk within a preset historical time period are input into a pre-trained request consumption threshold prediction model to obtain the request consumption threshold of the target disk.
[0129] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: based on the lower disk interface corresponding to the input and output request in the target disk, and the return interface corresponding to the input and output request, the input and output request path of the target disk is monitored to obtain the return time corresponding to the input and output request and the last disk input and output request action time corresponding to the return time.
[0130] In one embodiment, a computer program product is provided, including a computer program, which implements the following steps when executed by a processor: in response to an input / output request corresponding to a target disk, determining the request duration of the input / output request based on a return time corresponding to the input / output request and a previous disk input / output request action time corresponding to the return time; determining the disk space accessed by the input / output request as a slow block when the request duration satisfies a preset delay condition; and generating slow disk detection information containing slow block information of the slow block when the preset slow disk condition is met.
[0131] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: when the number of the slow blocks exceeds a preset slow block number threshold, slow disk detection information including slow block information of the slow blocks is generated.
[0132] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: if the request time is greater than the request time threshold of the target disk, determining that the request time satisfies a preset delay condition.
[0133] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: the time difference between the disk download time corresponding to the input / output request and the last disk input / output request action time corresponding to the disk download time is used as the disk idle time corresponding to the input / output request; if the request time is greater than the request time threshold of the target disk, and the disk idle time is less than the disk idle time threshold of the target disk, it is determined that the request time satisfies a preset delay condition.
[0134] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: the disk parameters of the target disk and the historical request consumption corresponding to each input and output request of the target disk within a preset historical time period are input into a pre-trained request consumption threshold prediction model to obtain the request consumption threshold of the target disk.
[0135] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: based on the lower disk interface corresponding to the input and output request in the target disk, and the return interface corresponding to the input and output request, the input and output request path of the target disk is monitored to obtain the return time corresponding to the input and output request and the last disk input and output request action time corresponding to the return time.
[0136] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0137] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0138] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0139] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A slow disk detection method, It is characterized in that The method comprises: In response to an input / output request corresponding to the target disk, determining a request duration of the input / output request according to a return time corresponding to the input / output request and a previous disk input / output request action time corresponding to the return time; In the case where the request time meets a preset delay condition, determining the disk space accessed by the input and output request as a slow block; When a preset slow disk condition is met, slow disk detection information including slow block information of the slow block is generated.
2. The method according to claim 1, It is characterized in that When the request time meets a preset delay condition, determining the disk space accessed by the input and output request as a slow block includes: If the request time consumption is greater than the request time consumption threshold of the target disk, the disk space accessed by the input and output request is determined as a slow block.
3. The method according to claim 1, It is characterized in that When the request time meets a preset delay condition, determining the disk space accessed by the input and output request as a slow block includes: The time difference between the disk download time corresponding to the input / output request and the last disk input / output request action time corresponding to the disk download time is used as the disk idle time corresponding to the input / output request; If the request time is greater than the request time threshold of the target disk and the disk idle time is less than the disk idle time threshold of the target disk, the disk space accessed by the input and output request is determined as a slow block.
4. The method according to claim 2 or 3, It is characterized in that The method further comprises: The disk parameters of the target disk and the historical request times corresponding to the input and output requests of the target disk within a preset historical time period are input into a pre-trained request time threshold prediction model to obtain the request time threshold of the target disk.
5. The method according to claim 1, It is characterized in that When the preset slow disk condition is met, generating slow disk detection information including slow block information of the slow block includes: When the determined number of slow blocks exceeds a preset slow block number threshold, slow disk detection information including slow block information of the slow blocks is generated.
6. The method according to any one of claims 1 to 3, It is characterized in that The method further comprises: Based on the disk download interface corresponding to the input / output request in the target disk and the return interface corresponding to the input / output request, the input / output request path of the target disk is monitored to obtain the disk download time and return time corresponding to the input / output request.
7. A slow disk detection device, It is characterized in that The device comprises: A first determination module is used to respond to an input / output request corresponding to a target disk, and determine a request duration of the input / output request according to a return time corresponding to the input / output request and a previous disk input / output request action time corresponding to the return time; A second determination module is used to determine the disk space accessed by the input and output request as a slow block if the request time meets a preset delay condition; A generating module is used to generate slow disk detection information including slow block information of the slow block when a preset slow disk condition is met.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product comprising a computer program, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
