IO blocking detection method and device, computer device, storage medium and product

By obtaining the current number of IO requests and the number of IO requests completed, and combining a counting variable with a preset threshold, the problem of low accuracy in traditional IO blocking detection methods is solved, and accurate detection of IO blocking is achieved.

CN115098331BActive Publication Date: 2026-07-10INDUSTRIAL AND COMMERCIAL BANK OF CHINA

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
INDUSTRIAL AND COMMERCIAL BANK OF CHINA
Filing Date
2022-06-29
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

Traditional I/O blocking detection methods cannot accurately distinguish between hardware failures, software failures, and thread or process blocking caused by hardware's inability to respond quickly, resulting in low detection accuracy.

Method used

By obtaining the current number of IO requests and the number of IO requests completed, the system uses a counter variable and a preset threshold to determine whether IO blocking has occurred, and outputs alarm information when blocking is detected.

Benefits of technology

It achieves accurate detection of I/O blocking, avoids false positives, and improves the accuracy of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115098331B_ABST
    Figure CN115098331B_ABST
Patent Text Reader

Abstract

The application relates to an IO blocking detection method and device, computer equipment, a storage medium and a product. The method comprises the following steps: obtaining a current IO request number and a current IO request completion number from a system; the current IO request number is used for representing the number of IO requests to be processed at the current time; the current IO request completion number is used for representing the number of IO requests processed within a first preset time period before the current time; according to the current IO request number and the current IO request completion number, it is determined whether the system has IO blocking; if the system has IO blocking, an alarm information is output. By using the method, whether the system has IO blocking caused by software and hardware faults can be determined through the current IO request number, the current IO request completion number and a counting variable, the problem that the IO blocking detection accuracy is low in the traditional method can be avoided, and thus accurate IO blocking detection can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to an I / O blocking detection method, apparatus, computer equipment, storage medium, and product. Background Technology

[0002] When a server needs to handle a large number of read / write threads or processes, hardware or software failures may cause I / O requests to fail or complete slowly, resulting in slow disk read / write operations and a large number of read / write threads or processes being blocked, a phenomenon known as I / O blocking (IO HANG). I / O blocking can leave a large number of threads or processes in an uninterruptible state, leading to excessive system load or even system freeze. Therefore, accurately detecting I / O blocking in a system plays a crucial role in ensuring the safe operation of a computer.

[0003] When a large number of concurrent I / O requests occur on a system, and the hardware is unable to respond quickly enough, many threads or processes may become blocked. However, this is not actually due to a hardware or software malfunction causing the blocking; therefore, the system is not actually experiencing I / O blocking.

[0004] Traditional methods assume that any blocking of threads or processes, whether due to hardware or software malfunctions or simply slow hardware response, is an I / O blocking issue. Therefore, these methods misclassify situations where a large number of threads or processes are blocked due to slow hardware response as I / O blocking. Consequently, traditional I / O blocking detection methods have low accuracy. Summary of the Invention

[0005] Therefore, it is necessary to provide an I / O blocking detection method, apparatus, computer equipment, storage medium, and product that can improve detection accuracy in response to the above-mentioned technical problems.

[0006] Firstly, this application provides an I / O blocking detection method. The method includes:

[0007] The system retrieves the current number of I / O requests and the current number of completed I / O requests. The current number of I / O requests represents the number of I / O requests pending at the current moment. The current number of completed I / O requests represents the number of I / O requests processed within a first preset time period prior to the current moment.

[0008] Based on the current number of I / O requests and the current number of completed I / O requests, determine whether the system is experiencing I / O blocking;

[0009] If the system experiences I / O blocking, an alarm message will be output.

[0010] In one embodiment, determining whether the system is experiencing I / O blocking based on the current number of I / O requests and the current number of completed I / O requests includes:

[0011] Determine whether the current number of I / O requests is greater than the current number of I / O requests completed;

[0012] If so, a counter variable is used to count the number of times the current number of I / O requests is greater than the current number of completed I / O requests;

[0013] Based on the value of the count variable, determine whether the system has experienced I / O blocking.

[0014] In one embodiment, determining whether the system has experienced I / O blocking based on the value of the counter variable includes:

[0015] Determine whether the value of the counting variable has reached a preset threshold;

[0016] If the value of the counting variable reaches a preset threshold, it is determined that the system has experienced I / O blocking.

[0017] In one embodiment, the method further includes:

[0018] If the value of the counting variable does not reach the preset threshold, then the first specified sampling time, which is spaced apart from the current time by a second preset time interval, will be taken as the new current time.

[0019] At the first specified sampling time, the current number of IO requests and the current number of IO requests completed are obtained from the system;

[0020] The process involves repeatedly checking whether the current number of I / O requests is greater than the current number of I / O requests completed; if so, a counter variable is used to count the number of times the current number of I / O requests is greater than the current number of I / O requests completed; and the process continues until the value of the counter variable reaches the preset threshold.

[0021] In one embodiment, the method further includes:

[0022] If the current number of I / O requests is less than or equal to the current number of I / O requests completed, then the second specified sampling time, which is three preset time intervals from the current time, will be taken as the new current time.

[0023] At the second specified sampling time, the current number of IO requests and the current number of IO requests completed are obtained from the system;

[0024] Based on the current number of I / O requests and the current number of completed I / O requests, determine whether the system is experiencing I / O blocking;

[0025] If the system experiences I / O blocking, an alarm message will be output.

[0026] In one embodiment, obtaining the current number of IO requests and the current number of IO requests completed from the system includes:

[0027] Get the current number of I / O requests from the system;

[0028] If the current number of IO requests is less than the preset number of IO requests, then the third specified sampling time, which is four preset time intervals from the current time, will be used as the new current time in a loop.

[0029] At the third specified sampling time, the current number of IO requests is obtained from the system until the current number of IO requests is greater than or equal to the preset number of IO requests, then the current number of completed IO requests is obtained from the system.

[0030] In one embodiment, the method further includes:

[0031] Create a first variable, a second variable, and a counter variable in the system; the first variable is used to store the current number of IO requests, the second variable is used to store the current number of IO requests completed, and the counter variable is used to store the number of times the current number of IO requests is greater than the current number of IO requests completed.

[0032] Initialize the first variable, the second variable, and the counter variable;

[0033] The first variable is updated based on the number of IO requests monitored at the current moment, generating the updated first variable; the second variable is updated based on the number of IO requests completed at the current moment, generating the updated second variable.

[0034] In one embodiment, obtaining the current number of IO requests and the current number of IO requests completed from the system includes:

[0035] Read the current number of IO requests from the updated first variable and the current number of IO requests completed from the updated second variable.

[0036] Secondly, this application also provides an I / O blocking detection device. The device includes:

[0037] The IO request count acquisition module is used to acquire the current IO request count and the current IO request completion count from the system; the current IO request count is used to represent the number of IO requests to be processed at the current moment; the current IO request completion count is used to represent the number of IO requests processed within a first preset time period before the current moment;

[0038] The IO blocking determination module is used to determine whether the system is experiencing IO blocking based on the current number of IO requests and the current number of IO requests completed.

[0039] The alarm information output module is used to output alarm information if the system experiences IO blocking.

[0040] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of the method in any of the embodiments of the first aspect described above.

[0041] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the steps of the method in any of the embodiments of the first aspect described above.

[0042] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the steps of the method in any of the embodiments of the first aspect described above.

[0043] The aforementioned I / O blocking detection method, apparatus, computer equipment, storage medium, and product obtain the current I / O request count and the current I / O request completion count from the system. The current I / O request count represents the number of I / O requests pending processing at the current moment. The current I / O request completion count represents the number of I / O requests processed within a first preset time period before the current moment. Based on the current I / O request count and the current I / O request completion count, it is determined whether the system is experiencing I / O blocking. If the system is experiencing I / O blocking, an alarm message is output. Using this method, when a large number of I / O requests cause the hardware to be unable to respond quickly, although the system will experience blocking, the current I / O request completion count only indicates slower processing, not that I / O requests are not being processed or that the number of processed I / O requests is abnormally low. Therefore, the current I / O request completion count can still maintain a certain level. However, when the system experiences I / O blocking due to software or hardware failure, the current I / O request completion count will be abnormally low. Therefore, by using the current I / O request count, the current I / O request completion count, and a counter variable to determine whether the system is experiencing I / O blocking due to software or hardware failure, the low accuracy of I / O blocking detection in traditional methods can be avoided, thereby achieving accurate I / O blocking detection. Attached Figure Description

[0044] Figure 1 This is a diagram illustrating the application environment of an I / O blocking detection method in one embodiment.

[0045] Figure 2 This is a flowchart illustrating an I / O blocking detection method in one embodiment;

[0046] Figure 3 This is a flowchart illustrating the I / O blocking determination steps in one embodiment;

[0047] Figure 4 This is a flowchart illustrating the counting variable determination step in one embodiment;

[0048] Figure 5 This is a flowchart illustrating the IO blocking detection method in another embodiment;

[0049] Figure 6 This is a flowchart illustrating the IO blocking detection method in another embodiment;

[0050] Figure 7 This is a flowchart illustrating the steps for obtaining the number of IO requests in one embodiment;

[0051] Figure 8 This is a flowchart illustrating the IO blocking detection method in another embodiment;

[0052] Figure 9 This is a flowchart illustrating an I / O blocking detection method in a specific embodiment.

[0053] Figure 10 This is a structural block diagram of an I / O blocking detection device in one embodiment;

[0054] Figure 11 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0055] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0056] Traditional methods for detecting I / O blocking mainly include: First, judging by system-provided monitoring metrics, such as the percentage of time the CPU spends waiting for I / O operations within a sampling period (iowait). If I / O blocking or high I / O activity occurs, the iowait percentage will increase. Second, judging by disk metrics, such as disk utilization (util) and average I / O service time (svctm). This method compares the processing time of a single I / O request obtained from disk metrics with the normal I / O request processing time to determine whether I / O blocking has occurred. Third, checking process status, such as whether a large number of processes in the system are in a blocked state.

[0057] When a large number of concurrent I / O requests occur on a system, and the hardware is unable to respond quickly enough, many threads or processes may become blocked. However, this is not actually due to a hardware or software malfunction causing the blocking; therefore, the system is not actually experiencing I / O blocking.

[0058] Traditional methods assume that any blocking of threads or processes, whether due to hardware or software malfunctions or simply slow hardware response, is an I / O blocking issue. Therefore, these methods misclassify situations where a large number of threads or processes are blocked due to slow hardware response as I / O blocking. Consequently, traditional I / O blocking detection methods have low accuracy.

[0059] The IO blocking detection method provided in this application embodiment can be applied to, for example, Figure 1In the application environment shown, terminal 120 communicates with server 140 via a network. A data storage system can store the data that server 140 needs to process. The data storage system can be integrated onto server 140 or placed on a cloud or other network server. Server 140 obtains the current number of IO requests and the current number of completed IO requests from the system on terminal 120. The current number of IO requests represents the number of IO requests pending processing at the current moment; the current number of completed IO requests represents the number of IO requests processed within a first preset time period before the current moment. Based on the current number of IO requests and the current number of completed IO requests, server 140 determines whether IO blocking has occurred. If IO blocking has occurred, an alarm message is output. Terminal 120 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, etc. Portable wearable devices can include smartwatches, smart bracelets, head-mounted devices, etc. Server 140 can be implemented using a standalone server or a server cluster composed of multiple servers.

[0060] In one embodiment, such as Figure 2 As shown, an I / O blocking detection method is provided, which is applied to... Figure 1 Taking server 140 as an example, the explanation includes the following steps:

[0061] Step 220: Obtain the current number of IO requests and the current number of IO requests completed from the system; the current number of IO requests is used to represent the number of IO requests to be processed at the current moment; the current number of IO requests completed is used to represent the number of IO requests processed within the first preset time period before the current moment.

[0062] Specifically, server 140 obtains the current number of IO requests and the current number of IO requests completed from the system on terminal 120. The system running can be a Linux operating system, Windows operating system, etc., and this application does not limit this. The current number of IO requests represents the number of IO requests pending processing at the current moment; the current number of IO requests completed represents the number of IO requests processed within a first preset time period before the current moment. The current number of IO requests completed is the number of IO requests completed at the end of the first preset time period minus the number of IO requests completed at the beginning of the first preset time period. Furthermore, the current moment can be updated as the system runs. In this embodiment, the first preset time period can be set to 1 second, 2 seconds, 5 seconds, 10 seconds, etc., and this application does not limit this.

[0063] Step 240: Determine whether the system is experiencing IO blocking based on the current number of IO requests and the current number of completed IO requests.

[0064] Specifically, after server 140 obtains the current number of I / O requests and the current number of I / O requests completed from the system on terminal 120, it compares the current number of I / O requests with the current number of I / O requests completed to determine whether the current number of I / O requests is greater than the current number of I / O requests completed. Based on the result of the comparison, it determines whether I / O blocking has occurred in the system.

[0065] Step 260: If the system experiences IO blocking, an alarm message will be output.

[0066] Specifically, after server 140 determines that the system has experienced I / O blocking, server 140 will output alarm information to detect and alert on the I / O blocking. The output alarm information may include an alarm pop-up, an alarm indicator light, or an alarm sound.

[0067] In the aforementioned I / O blocking detection method, the current number of I / O requests and the current number of completed I / O requests are obtained from the system. The current number of I / O requests represents the number of I / O requests pending processing at the current moment. The current number of completed I / O requests represents the number of I / O requests processed within a first preset time period before the current moment. Based on the current number of I / O requests and the current number of completed I / O requests, it is determined whether I / O blocking has occurred in the system. If I / O blocking has occurred, an alarm message is output. Using this method, when a large number of I / O requests cause the hardware to be unable to respond quickly, although the system will be blocked, the current number of completed I / O requests only indicates slower processing, not that I / O requests are not being processed or that the number of processed I / O requests is abnormally low. Therefore, the current number of completed I / O requests can still maintain a certain level. However, when the system experiences hardware or software failures that cause I / O blocking, the current number of completed I / O requests will be abnormally low. Therefore, by using the current number of I / O requests, the current number of completed I / O requests, and the counter variable to determine whether the system is experiencing I / O blocking due to hardware or software failures, the low accuracy of I / O blocking detection in traditional methods can be avoided, thus achieving accurate I / O blocking detection.

[0068] The above embodiment mentioned determining whether the system is experiencing I / O blocking by using the current number of I / O requests and the current number of completed I / O requests. The specific method is described below. In one embodiment, such as... Figure 3 As shown, based on the current number of I / O requests and the number of completed I / O requests, it is determined whether the system is experiencing I / O blocking, including:

[0069] Step 320: Determine whether the current number of IO requests is greater than the current number of IO requests completed.

[0070] Specifically, server 140 compares the number of IO requests to be processed at the current moment with the number of IO requests processed in the first preset time period before the current moment, and determines whether the number of IO requests to be processed at the current moment is greater than the number of IO requests processed in the first preset time period before the current moment.

[0071] Step 340: If so, use a counter variable to count the number of times the current number of IO requests is greater than the current number of completed IO requests.

[0072] Specifically, if the number of pending I / O requests at the current moment is greater than the number of I / O requests processed within a first preset time period prior to the current moment, a counter variable is used to count the number of times the number of pending I / O requests at the current moment is greater than the number of I / O requests processed within the first preset time period prior to the current moment. The counter variable can be updated as the system runs, and its value increases by 1 each time an update is performed.

[0073] Step 360: Determine whether the system is experiencing I / O blocking based on the value of the counter variable.

[0074] Specifically, based on the value of the counter variable, it is determined whether the continuously updated value of the counter variable has reached a preset threshold. If the value of the counter variable reaches the preset threshold, it is determined that the system has encountered IO blocking.

[0075] In this embodiment, it is determined whether the current number of IO requests is greater than the current number of IO requests completed. If so, a counter variable is used to count the number of times the current number of IO requests is greater than the current number of IO requests completed. Based on the value of the counter variable, it is determined whether the system has experienced IO blocking. Thus, by using the current number of IO requests, the current number of IO requests completed, and the counter variable, it is possible to determine whether the system has experienced IO blocking due to software or hardware failure. This avoids the problem of low accuracy in IO blocking detection in traditional methods, thereby achieving accurate IO blocking detection.

[0076] The above embodiments illustrate how to determine whether I / O blocking has occurred in the system based on the value of a counter variable. The specific method is described below. In one embodiment, such as... Figure 4 As shown, step 360 includes:

[0077] Step 420: Determine whether the value of the counting variable has reached the preset threshold.

[0078] Specifically, if the number of IO requests to be processed at the current moment is greater than the number of IO requests processed in the first preset time period before the current moment, the value of the counter variable is incremented by 1, and the step of judging whether the number of IO requests to be processed at the current moment is greater than the number of IO requests processed in the first preset time period before the current moment is executed repeatedly, and the value of the counter variable is continuously updated, and it is judged whether the value of the counter variable reaches the preset threshold after each update.

[0079] Step 440: If the value of the counter variable reaches the preset threshold, it is determined that the system has encountered IO blocking.

[0080] Specifically, if the value of the counter variable reaches a preset threshold, it is determined that I / O blocking has occurred in the system. The preset threshold is a constant used to determine whether I / O blocking has occurred in the system. In this embodiment, the preset threshold is set to 5 by default, but it can also be set according to actual conditions; this application does not limit this setting. A larger preset threshold results in better accuracy in detecting I / O blocking.

[0081] In this embodiment, by determining whether the value of the count variable reaches a preset threshold, if the value of the count variable reaches the preset threshold, it is determined that the system has experienced IO blocking. By comparing the count variable with the preset threshold, it is possible to determine whether the system has experienced IO blocking due to software or hardware failure. This avoids the problem of low accuracy in IO blocking detection in traditional methods, thereby achieving accurate IO blocking detection.

[0082] The above embodiments mentioned that if the value of the counter variable reaches a preset threshold, it is determined that the system has experienced I / O blocking. Below, another embodiment of the I / O blocking detection method will be described. In one embodiment, such as... Figure 5 As shown, an I / O blocking detection method is provided, which also includes:

[0083] Step 520: If the value of the counting variable does not reach the preset threshold, then the first specified sampling time with a second preset time interval from the current time is taken as the new current time.

[0084] Specifically, if the value of the counting variable does not reach a preset threshold, the first specified sampling time, which is an interval of the second preset time period from the current time, is taken as the new current time. The second preset time period can be set to 1 second, 5 seconds, 8 seconds, 10 seconds, etc., but this application does not limit this setting. The first specified sampling time is the updated current time, which is an interval of the second preset time period from the current time.

[0085] Step 540: At the first specified sampling time, obtain the current number of IO requests and the current number of IO requests completed from the system.

[0086] Specifically, at a first specified sampling time, the number of IO requests at the first specified sampling time and the number of IO requests completed within a second preset time interval from the first specified sampling time are obtained from the system. Here, the number of IO requests at the first specified sampling time is the updated number of IO requests pending at the first specified sampling time as the system processes IO requests; and the number of IO requests completed within the second preset time interval from the first specified sampling time is the updated number of IO requests processed within the second preset time interval before the first specified sampling time as the system processes IO requests.

[0087] Step 560: Repeatedly execute the step of determining whether the current number of I / O requests is greater than the current number of I / O requests completed; if so, use a counter variable to count the number of times the current number of I / O requests is greater than the current number of I / O requests completed; determine whether the system has experienced I / O blocking based on the value of the counter variable, until the value of the counter variable reaches a preset threshold.

[0088] Specifically, after obtaining the number of IO requests at the first specified sampling time and the number of IO requests completed at the second preset time interval from the first specified sampling time, the system repeatedly executes the step of determining whether the number of IO requests at the first specified sampling time is greater than the number of IO requests completed at the second preset time interval from the first specified sampling time. If the number of IO requests at the first specified sampling time is greater than the number of IO requests completed at the second preset time interval from the first specified sampling time, a counter variable is used to count the number of times the number of IO requests at the first specified sampling time is greater than the number of IO requests completed at the second preset time interval from the first specified sampling time. Based on the value of the counter variable, the system determines whether IO blocking has occurred, until the value of the counter variable reaches a preset threshold.

[0089] In this embodiment, if the value of the counter variable does not reach a preset threshold, the first specified sampling time, which is a second preset time interval from the current time, is taken as the new current time. At the first specified sampling time, the current number of IO requests and the current number of completed IO requests are obtained from the system. The system repeatedly checks whether the current number of IO requests is greater than the current number of completed IO requests. If so, the counter variable is used to count the number of times the current number of IO requests is greater than the current number of completed IO requests. Based on the value of the counter variable, the system determines whether IO blocking has occurred, until the value of the counter variable reaches the preset threshold. Through the above steps, the operation of checking whether the current number of IO requests is greater than the current number of completed IO requests is repeatedly executed, and the value of the counter variable is continuously updated. This allows the system to determine whether IO blocking due to hardware or software failure is occurring based on the current number of IO requests, the current number of completed IO requests, and the counter variable. This avoids the problem of low accuracy in IO blocking detection in traditional methods, thereby achieving accurate IO blocking detection.

[0090] The above embodiments mentioned determining whether the current number of IO requests is greater than the current number of IO requests completed. Below, another embodiment of the IO blocking detection method will be described. In one embodiment, such as... Figure 6 As shown, an I / O blocking detection method is provided, which also includes:

[0091] Step 620: If the current number of IO requests is less than or equal to the current number of completed IO requests, then the second specified sampling time, which is three preset time intervals from the current time, is taken as the new current time.

[0092] Specifically, after obtaining the current number of IO requests and the current number of IO requests completed from the system, if the current number of IO requests is less than or equal to the current number of IO requests completed, then the second specified sampling time, which is an interval of the third preset time period from the current time, is taken as the new current time. The third preset time period can be set to 1 second, 3 seconds, 5 seconds, 10 seconds, etc., but this application does not limit it. The second specified sampling time is the updated current time, which is an interval of the third preset time period from the current time.

[0093] Step 640: At the second specified sampling time, obtain the current number of IO requests and the current number of IO requests completed from the system.

[0094] Specifically, at the second specified sampling time, the number of IO requests at the second specified sampling time and the number of IO requests completed at the third preset time interval from the second specified sampling time are obtained from the system. Here, the number of IO requests at the second specified sampling time is the updated number of pending IO requests at the second specified sampling time as the system processes IO requests; and the number of IO requests completed at the third preset time interval from the second specified sampling time is the updated number of IO requests processed within the third preset time interval before the second specified sampling time as the system processes IO requests.

[0095] Step 660: Determine whether the system is experiencing IO blocking based on the current number of IO requests and the current number of completed IO requests.

[0096] Specifically, after server 140 obtains the number of pending IO requests at the second specified sampling time and the number of IO requests processed within the third preset time period before the second specified sampling time from the system on terminal 120, it compares the number of pending IO requests at the second specified sampling time with the number of IO requests processed within the third preset time period before the second specified sampling time to determine whether the number of pending IO requests at the second specified sampling time is greater than the number of IO requests processed within the third preset time period before the second specified sampling time. Based on the comparison result, it is determined whether IO blocking has occurred in the system.

[0097] Step 680: If the system experiences IO blocking, an alarm message will be output.

[0098] Specifically, after server 140 determines that the system has experienced I / O blocking, server 140 will output alarm information to detect and alert on the I / O blocking. The output alarm information may include an alarm pop-up, an alarm indicator light, or an alarm sound.

[0099] In this embodiment, if the current number of IO requests is less than or equal to the current number of completed IO requests, a second specified sampling time with a third preset time interval from the current time is taken as the new current time. At the second specified sampling time, the current number of IO requests and the current number of completed IO requests are obtained from the system. Based on the current number of IO requests and the current number of completed IO requests, it is determined whether the system has experienced IO blocking. If the system has experienced IO blocking, an alarm message is output. The above steps, when the current number of IO requests is less than or equal to the current number of completed IO requests, update the second specified sampling time to obtain the updated current number of IO requests and the updated current number of completed IO requests, and determine whether the system has experienced IO blocking due to software or hardware failure. This avoids the problem of low accuracy in IO blocking detection in traditional methods, thereby achieving accurate IO blocking detection.

[0100] The above embodiments mentioned the operation of obtaining the current number of IO requests and the current number of IO requests completed from the system. The specific method is described below. In one embodiment, such as... Figure 7 As shown, step 220 includes:

[0101] Step 720: Obtain the current number of IO requests from the system.

[0102] Specifically, first, server 140 obtains the number of pending IO requests at the current moment from the system on terminal 120. This number is obtained by hooking into the system to monitor and record the number of pending IO requests currently in operation.

[0103] Step 740: If the current number of IO requests is less than the preset number of IO requests, then the loop executes and takes the third specified sampling time, which is four preset time intervals from the current time, as the new current time.

[0104] Specifically, if the number of pending IO requests at the current moment is less than the preset number of IO requests, the process will loop and use the third specified sampling moment, which is a fourth preset time interval from the current moment, as the new current moment. The fourth preset time interval can be set to 1 second, 2 seconds, 5 seconds, 10 seconds, etc., but this application does not limit this setting. The third specified sampling moment is the updated current moment, which is a fourth preset time interval from the current moment.

[0105] Step 760: At the third specified sampling time, obtain the current number of IO requests from the system until the current number of IO requests is greater than or equal to the preset number of IO requests, then obtain the current number of completed IO requests from the system.

[0106] Specifically, at the third specified sampling time, the number of IO requests at the third specified sampling time is obtained from the system. This process continues until the number of pending IO requests at the current time is greater than or equal to the preset number of IO requests. Then, the number of completed IO requests at a fourth preset time interval from the third specified sampling time is obtained from the system. Here, the number of IO requests at the third specified sampling time is the updated number of pending IO requests at the third specified sampling time, updated as the system processes IO requests.

[0107] In this embodiment, the current number of I / O requests is obtained from the system. If the current number of I / O requests is less than a preset number of I / O requests, the process iteratively executes a third specified sampling time, which is four preset time intervals from the current time, as the new current time. At the third specified sampling time, the current number of I / O requests is obtained from the system until the current number of I / O requests is greater than or equal to the preset number of I / O requests. Then, the current number of completed I / O requests is obtained from the system. In the case where the current number of I / O requests is less than the preset number of I / O requests, the above steps update the third specified sampling time to obtain the updated current number of I / O requests until the current number of I / O requests is greater than or equal to the preset number of I / O requests. Then, the current number of completed I / O requests is obtained from the system. This allows for the determination of whether the system is experiencing I / O blocking due to hardware or software faults by obtaining the updated current number of I / O requests, the current number of completed I / O requests, and the counter variable. This avoids the problem of low accuracy in I / O blocking detection in traditional methods, thus achieving accurate I / O blocking detection.

[0108] The above embodiments mentioned obtaining the current number of IO requests and the current number of IO requests completed from the system. Below, another embodiment of the IO blocking detection method will be described. In one embodiment, such as... Figure 8 As shown, an I / O blocking detection method is provided, which also includes:

[0109] Step 820: Create a first variable, a second variable, and a counter variable in the system; the first variable is used to store the current number of IO requests, the second variable is used to store the current number of IO requests completed, and the counter variable is used to store the number of times the current number of IO requests is greater than the current number of IO requests completed.

[0110] Specifically, a first variable, a second variable, and a count variable are created in the system. The first variable stores the number of I / O requests to be processed at the current moment, the second variable stores the number of I / O requests processed within a first preset time period before the current moment, and the count variable stores the number of times the number of I / O requests to be processed at the current moment is greater than the number of I / O requests processed within the first preset time period before the current moment.

[0111] Step 840: Initialize the first variable, the second variable, and the count variable.

[0112] Specifically, the first variable storing the number of IO requests to be processed at the current moment is initialized by setting its initial value to 0; the second variable storing the number of IO requests processed within a first preset time period before the current moment is initialized by setting its initial value to 0; and the count variable storing the number of times the number of IO requests to be processed at the current moment is greater than the number of IO requests processed within the first preset time period before the current moment is initialized by setting its initial value to 0.

[0113] Step 860: Update the initialized first variable based on the number of IO requests monitored at the current moment to generate the updated first variable; update the initialized second variable based on the number of IO requests completed at the current moment to generate the updated second variable.

[0114] Specifically, by performing hooks within the system, the number of pending I / O requests at the current moment is monitored, and the monitored number of pending I / O requests at the current moment is statistically updated to generate an updated first variable. Similarly, by performing hooks within the system, the number of I / O requests processed within a first preset time period prior to the current moment is monitored, and the monitored number of I / O requests processed within the first preset time period prior to the current moment is statistically updated to generate an updated second variable.

[0115] Taking the Linux operating system as an example, when an I / O request exists in the system, the system will submit the I / O request. For example, a block device will call the `blk_account_io_start()` function to submit the I / O request to the request queue. At this time, a hook can be made in this function so that when a new I / O request is submitted, the value of the first variable is incremented by 1. When the I / O request is successfully processed, the system will release the successfully processed I / O request. For example, a block device will call the `blk_account_io_done()` function to release the successfully processed I / O request from the I / O request queue. At this time, a hook can be made in this function so that when an I / O request is released, the value of the first variable is decremented by 1 and the value of the second variable is incremented by 1.

[0116] In this embodiment, a first variable, a second variable, and a count variable `count` are created in the system. The first variable stores the current number of I / O requests, the second variable stores the current number of completed I / O requests, and the count variable `count` stores the number of times the current number of I / O requests exceeds the current number of completed I / O requests. The first variable, the second variable, and the count variable `count` are initialized. The first variable is updated based on the currently monitored number of I / O requests, generating an updated first variable. Similarly, the second variable is updated based on the currently monitored number of completed I / O requests, generating an updated second variable. By creating and updating the first variable, the second variable, and the count variable `count`, the current number of I / O requests, the current number of completed I / O requests, and the count variable `count` can be obtained. This allows for the determination of whether the system is experiencing I / O blocking due to hardware or software failures, avoiding the low accuracy of I / O blocking detection in traditional methods and achieving accurate I / O blocking detection.

[0117] The above embodiments describe the operation of obtaining the current number of IO requests and the current number of IO requests completed from the system. The specific method is described below. In one embodiment, step 220 includes:

[0118] Read the current number of I / O requests from the updated first variable and the current number of I / O requests completed from the updated second variable.

[0119] Specifically, by performing a hook in the system, the current number of IO requests and the current number of completed IO requests in the system are monitored. Then, the number of IO requests to be processed at the current moment is read from the updated first variable, and the number of IO requests processed in the first preset time period before the current moment is read from the updated second variable.

[0120] In this embodiment, by reading the current number of I / O requests from the updated first variable and the current number of I / O requests completed from the updated second variable, the current number of I / O requests, the current number of I / O requests completed, and the count variable count can be obtained. By obtaining the current number of I / O requests, the current number of I / O requests completed, and the count variable count, it is possible to determine whether the system is experiencing I / O blocking due to software or hardware failure. This avoids the problem of low accuracy in I / O blocking detection in traditional methods, thereby achieving accurate I / O blocking detection.

[0121] In a specific embodiment, such as Figure 9 As shown, an I / O blocking detection method is provided, applied to server 140, including:

[0122] Step 902: Create a first variable, a second variable, and a counter variable in the system; the first variable is used to store the current number of IO requests, the second variable is used to store the current number of IO requests completed, and the counter variable is used to store the number of times the current number of IO requests is greater than the current number of IO requests completed.

[0123] Step 904: Initialize the first variable, the second variable, and the count variable;

[0124] Step 906: Update the initialized first variable based on the number of IO requests monitored at the current moment to generate the updated first variable; update the initialized second variable based on the number of IO requests completed at the current moment to generate the updated second variable;

[0125] Step 908: Read the current number of IO requests from the updated first variable and the current number of IO requests completed from the updated second variable;

[0126] Step 910: Determine whether the current number of IO requests is greater than or equal to the preset number of IO requests; if yes, proceed to step 912; if no, proceed to step 914.

[0127] Step 912: Obtain the current number of completed IO requests from the system, then proceed to step 916;

[0128] Step 914: Take the third designated sampling time that is four preset time intervals away from the current time as the new current time, and proceed to step 908;

[0129] Step 916: Determine if the current number of IO requests is greater than the current number of IO requests completed; if yes, proceed to step 918; if no, proceed to step 920.

[0130] Step 918: Use a counter variable to count the number of times the current number of IO requests is greater than the current number of completed IO requests, then proceed to step 922;

[0131] Step 920: Take the second designated sampling time, which is three preset time intervals away from the current time, as the new current time. At the second designated sampling time, proceed to step 908.

[0132] Step 922: Determine whether the value of the count variable has reached the preset threshold; if yes, proceed to step 924; if no, proceed to step 926.

[0133] Step 924: After confirming that the system has encountered I / O blocking, proceed to step 928;

[0134] Step 926: Take the first designated sampling time that is a second preset time interval from the current time as the new current time, and proceed to step 908 at the first designated sampling time.

[0135] Step 928: Output alarm information.

[0136] In this embodiment, the current number of I / O requests and the current number of completed I / O requests are obtained and compared to determine whether the current number of I / O requests is greater than the current number of completed I / O requests. If so, the counter variable is incremented by 1, the current time is updated, and the updated current number of I / O requests and the updated current number of completed I / O requests are obtained again. This process of determining whether the current number of I / O requests is greater than the current number of completed I / O requests is repeated until the value of the counter variable reaches a preset threshold. At this point, I / O blocking is confirmed, and an alarm message is output. Thus, I / O blocking can be detected using the current number of I / O requests, the current number of completed I / O requests, and the counter variable. In the above I / O blocking detection method, when a large number of I / O requests cause the hardware to be unable to respond quickly, although the system will be blocked, the current number of completed I / O requests only processes slowly, not that I / O requests are not being processed or that the number of processed I / O requests is abnormally low. Therefore, the current number of completed I / O requests can still be maintained at a certain level. However, when the system experiences hardware or software failures that cause I / O blocking, the current number of completed I / O requests will be abnormally low. Therefore, by using the current number of I / O requests, the current number of completed I / O requests, and the counter variable, it is possible to determine whether the system is experiencing I / O blocking due to hardware or software failures. This avoids the problem of low accuracy in I / O blocking detection in traditional methods, thus achieving accurate I / O blocking detection.

[0137] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0138] Based on the same inventive concept, this application also provides an I / O blocking detection device for implementing the I / O blocking detection method described above. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations in one or more I / O blocking detection device embodiments provided below can be found in the limitations of the I / O blocking detection method described above, and will not be repeated here.

[0139] In one embodiment, such as Figure 10As shown, an I / O blocking detection device 1000 is provided, including: an I / O request count acquisition module 1020, an I / O blocking determination module 1040, and an alarm information output module 1060, wherein:

[0140] The IO request count acquisition module 1020 is used to obtain the current IO request count and the current IO request completion count from the system; the current IO request count is used to represent the number of IO requests to be processed at the current moment; the current IO request completion count is used to represent the number of IO requests processed in the first preset time period before the current moment.

[0141] The IO blocking determination module 1040 is used to determine whether the system is experiencing IO blocking based on the current number of IO requests and the current number of completed IO requests.

[0142] The alarm information output module 1060 is used to output alarm information if the system experiences IO blocking.

[0143] In one embodiment, the IO blocking determination module 1040 includes:

[0144] The IO request count determination unit is used to determine whether the current IO request count is greater than the current IO request completion count;

[0145] The counting variable statistics unit is used to count the number of times the current number of I / O requests is greater than the current number of I / O requests completed if the count variable is used.

[0146] The IO blocking determination unit is used to determine whether the system is experiencing IO blocking based on the value of the counter variable.

[0147] In one embodiment, the IO blocking determination unit includes:

[0148] The counting variable judgment unit is used to determine whether the value of the counting variable has reached a preset threshold.

[0149] The preset threshold judgment unit is used to determine that the system has encountered IO blocking if the value of the counting variable reaches the preset threshold.

[0150] In one embodiment, the IO blocking detection device 1000 further includes:

[0151] The first current time update unit is used to take the first specified sampling time, which is a second preset time interval from the current time, as the new current time if the value of the counting variable does not reach the preset threshold.

[0152] The first IO request count acquisition unit is used to acquire the current IO request count and the current IO request completion count from the system at the first specified sampling time.

[0153] The loop judgment unit is used to repeatedly execute the steps of judging whether the current number of I / O requests is greater than the current number of I / O requests completed; if so, it uses a counter variable to count the number of times the current number of I / O requests is greater than the current number of I / O requests completed; and determines whether the system has experienced I / O blocking based on the value of the counter variable, until the value of the counter variable reaches a preset threshold.

[0154] In one embodiment, the IO blocking detection device 1000 further includes:

[0155] The second current time update unit is used to update the second specified sampling time, which is a third preset time interval from the current time, as the new current time if the current number of IO requests is less than or equal to the current number of IO requests completed.

[0156] The second IO request count acquisition unit is used to acquire the current IO request count and the current IO request completion count from the system at the second specified sampling time;

[0157] The IO blocking determination unit is used to determine whether the system is experiencing IO blocking based on the current number of IO requests and the current number of IO requests completed.

[0158] The alarm information output unit is used to output alarm information if the system experiences IO blocking.

[0159] In one embodiment, the IO request count acquisition module 1020 includes:

[0160] The current I / O request count acquisition unit is used to obtain the current I / O request count from the system;

[0161] The third current time update unit is used to repeatedly execute the third specified sampling time with a fourth preset time interval from the current time as the new current time if the current number of IO requests is less than the preset number of IO requests.

[0162] The third IO request count acquisition unit is used to acquire the current IO request count from the system at the third specified sampling time, until the current IO request count is greater than or equal to the preset IO request count, and then acquire the current IO request completion count from the system.

[0163] In one embodiment, the IO blocking detection device 1000 further includes:

[0164] The variable creation unit is used to create a first variable, a second variable, and a counter variable in the system. The first variable is used to store the current number of IO requests, the second variable is used to store the current number of IO requests completed, and the counter variable is used to store the number of times the current number of IO requests is greater than the current number of IO requests completed.

[0165] The variable initialization unit is used to initialize the first variable, the second variable, and the counter variable.

[0166] The variable update unit is used to update the initialized first variable based on the number of IO requests monitored at the current time, and to generate the updated first variable; and to update the initialized second variable based on the number of IO requests completed at the current time, and to generate the updated second variable.

[0167] In one embodiment, the IO request count acquisition module 1020 includes:

[0168] The IO request completion count reading unit is used to read the current IO request count from the updated first variable and the current IO request completion count from the updated second variable.

[0169] Each module in the aforementioned I / O blocking detection device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0170] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 11 As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database stores I / O blocking detection data. The network interface communicates with external terminals via a network connection. When executed by the processor, the computer program implements an I / O blocking detection method.

[0171] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 11As shown, the computer device includes a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When executed by the processor, the computer program implements an I / O blocking detection method. The display screen can be an LCD screen or an e-ink display screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the computer device casing, or an external keyboard, touchpad, or mouse.

[0172] Those skilled in the art will understand that Figure 11 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0173] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0174] The system retrieves the current number of I / O requests and the current number of completed I / O requests. The current number of I / O requests represents the number of I / O requests pending at the current moment. The current number of completed I / O requests represents the number of I / O requests processed within a first preset time period prior to the current moment.

[0175] Based on the current number of I / O requests and the number of completed I / O requests, determine whether the system is experiencing I / O blocking;

[0176] If the system experiences I / O blocking, an alarm message will be output.

[0177] In one embodiment, based on the current number of I / O requests and the current number of completed I / O requests, it is determined whether the system is experiencing I / O blocking. When the processor executes the computer program, it also performs the following steps:

[0178] Determine if the current number of I / O requests is greater than the current number of I / O requests completed;

[0179] If so, then a counter variable is used to count the number of times the current number of I / O requests is greater than the current number of completed I / O requests;

[0180] Based on the value of the counter variable, determine whether the system is experiencing I / O blocking.

[0181] In one embodiment, based on the value of the counter variable, to determine whether the system has experienced I / O blocking, the processor also performs the following steps when executing the computer program:

[0182] Determine whether the value of the count variable has reached a preset threshold;

[0183] If the value of the counter variable reaches a preset threshold, it is determined that the system has experienced I / O blocking.

[0184] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0185] If the value of the counting variable does not reach the preset threshold, the first specified sampling time with a second preset time interval from the current time will be taken as the new current time.

[0186] At the first specified sampling time, obtain the current number of I / O requests and the current number of completed I / O requests from the system;

[0187] The process involves repeatedly checking whether the current number of I / O requests is greater than the current number of I / O requests completed. If so, a counter variable is used to count the number of times the current number of I / O requests is greater than the current number of I / O requests completed. Based on the value of the counter variable, the process is repeated to determine whether the system has experienced I / O blocking. This process continues until the value of the counter variable reaches a preset threshold.

[0188] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0189] If the current number of I / O requests is less than or equal to the current number of completed I / O requests, then the second specified sampling time, which is three preset time intervals from the current time, will be used as the new current time.

[0190] At the second specified sampling time, obtain the current number of I / O requests and the current number of I / O requests completed from the system;

[0191] Based on the current number of I / O requests and the number of completed I / O requests, determine whether the system is experiencing I / O blocking;

[0192] If the system experiences I / O blocking, an alarm message will be output.

[0193] In one embodiment, the current number of I / O requests and the current number of I / O requests completed are obtained from the system, and the processor, while executing the computer program, also performs the following steps:

[0194] Get the current number of I / O requests from the system;

[0195] If the current number of IO requests is less than the preset number of IO requests, the loop will use the third specified sampling time, which is four preset time intervals from the current time, as the new current time.

[0196] At the third specified sampling time, the current number of IO requests is obtained from the system until the current number of IO requests is greater than or equal to the preset number of IO requests, then the current number of completed IO requests is obtained from the system.

[0197] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0198] Create a first variable, a second variable, and a counter variable in the system; the first variable is used to store the current number of IO requests, the second variable is used to store the current number of IO requests completed, and the counter variable is used to store the number of times the current number of IO requests is greater than the current number of IO requests completed.

[0199] Initialize the first variable, the second variable, and the count variable;

[0200] The first variable is updated based on the number of IO requests monitored at the current moment, generating the updated first variable; the second variable is updated based on the number of IO requests completed at the current moment, generating the updated second variable.

[0201] In one embodiment, the current number of I / O requests and the current number of I / O requests completed are obtained from the system, and the processor, while executing the computer program, also performs the following steps:

[0202] Read the current number of I / O requests from the updated first variable and the current number of I / O requests completed from the updated second variable.

[0203] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:

[0204] The system retrieves the current number of I / O requests and the current number of completed I / O requests. The current number of I / O requests represents the number of I / O requests pending at the current moment. The current number of completed I / O requests represents the number of I / O requests processed within a first preset time period prior to the current moment.

[0205] Based on the current number of I / O requests and the number of completed I / O requests, determine whether the system is experiencing I / O blocking;

[0206] If the system experiences I / O blocking, an alarm message will be output.

[0207] In one embodiment, based on the current number of I / O requests and the current number of completed I / O requests, it is determined whether the system is experiencing I / O blocking. When the computer program is executed by the processor, the following steps are performed:

[0208] Determine if the current number of I / O requests is greater than the current number of I / O requests completed;

[0209] If so, then a counter variable is used to count the number of times the current number of I / O requests is greater than the current number of completed I / O requests;

[0210] Based on the value of the counter variable, determine whether the system is experiencing I / O blocking.

[0211] In one embodiment, based on the value of the counter variable, it is determined whether the system has experienced I / O blocking. When the computer program is executed by the processor, the following steps are performed:

[0212] Determine whether the value of the count variable has reached a preset threshold;

[0213] If the value of the counter variable reaches a preset threshold, it is determined that the system has experienced I / O blocking.

[0214] In one embodiment, when a computer program is executed by a processor, it performs the following steps:

[0215] If the value of the counting variable does not reach the preset threshold, the first specified sampling time with a second preset time interval from the current time will be taken as the new current time.

[0216] At the first specified sampling time, obtain the current number of I / O requests and the current number of completed I / O requests from the system;

[0217] The process involves repeatedly checking whether the current number of I / O requests is greater than the current number of I / O requests completed. If so, a counter variable is used to count the number of times the current number of I / O requests is greater than the current number of I / O requests completed. Based on the value of the counter variable, the process is repeated to determine whether the system has experienced I / O blocking. This process continues until the value of the counter variable reaches a preset threshold.

[0218] In one embodiment, when a computer program is executed by a processor, it performs the following steps:

[0219] If the current number of I / O requests is less than or equal to the current number of completed I / O requests, then the second specified sampling time, which is three preset time intervals from the current time, will be used as the new current time.

[0220] At the second specified sampling time, obtain the current number of I / O requests and the current number of I / O requests completed from the system;

[0221] Based on the current number of I / O requests and the number of completed I / O requests, determine whether the system is experiencing I / O blocking;

[0222] If the system experiences I / O blocking, an alarm message will be output.

[0223] In one embodiment, the current number of I / O requests and the current number of I / O requests completed are obtained from the system, and the computer program, when executed by the processor, performs the following steps:

[0224] Get the current number of I / O requests from the system;

[0225] If the current number of IO requests is less than the preset number of IO requests, the loop will use the third specified sampling time, which is four preset time intervals from the current time, as the new current time.

[0226] At the third specified sampling time, the current number of IO requests is obtained from the system until the current number of IO requests is greater than or equal to the preset number of IO requests, then the current number of completed IO requests is obtained from the system.

[0227] In one embodiment, when a computer program is executed by a processor, it performs the following steps:

[0228] Create a first variable, a second variable, and a counter variable in the system; the first variable is used to store the current number of IO requests, the second variable is used to store the current number of IO requests completed, and the counter variable is used to store the number of times the current number of IO requests is greater than the current number of IO requests completed.

[0229] Initialize the first variable, the second variable, and the count variable;

[0230] The first variable is updated based on the number of IO requests monitored at the current moment, generating the updated first variable; the second variable is updated based on the number of IO requests completed at the current moment, generating the updated second variable.

[0231] In one embodiment, the current number of I / O requests and the current number of I / O requests completed are obtained from the system, and the computer program, when executed by the processor, performs the following steps:

[0232] Read the current number of I / O requests from the updated first variable and the current number of I / O requests completed from the updated second variable.

[0233] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:

[0234] The system retrieves the current number of I / O requests and the current number of completed I / O requests. The current number of I / O requests represents the number of I / O requests pending at the current moment. The current number of completed I / O requests represents the number of I / O requests processed within a first preset time period prior to the current moment.

[0235] Based on the current number of I / O requests and the number of completed I / O requests, determine whether the system is experiencing I / O blocking;

[0236] If the system experiences I / O blocking, an alarm message will be output.

[0237] In one embodiment, based on the current number of I / O requests and the current number of completed I / O requests, it is determined whether the system is experiencing I / O blocking. When the computer program is executed by the processor, the following steps are also performed:

[0238] Determine if the current number of I / O requests is greater than the current number of I / O requests completed;

[0239] If so, then a counter variable is used to count the number of times the current number of I / O requests is greater than the current number of completed I / O requests;

[0240] Based on the value of the counter variable, determine whether the system is experiencing I / O blocking.

[0241] In one embodiment, based on the value of the counter variable, to determine whether the system has experienced I / O blocking, the computer program, when executed by the processor, also performs the following steps:

[0242] Determine whether the value of the count variable has reached a preset threshold;

[0243] If the value of the counter variable reaches a preset threshold, it is determined that the system has experienced I / O blocking.

[0244] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0245] If the value of the counting variable does not reach the preset threshold, the first specified sampling time with a second preset time interval from the current time will be taken as the new current time.

[0246] At the first specified sampling time, obtain the current number of I / O requests and the current number of completed I / O requests from the system;

[0247] The process involves repeatedly checking whether the current number of I / O requests is greater than the current number of I / O requests completed. If so, a counter variable is used to count the number of times the current number of I / O requests is greater than the current number of I / O requests completed. Based on the value of the counter variable, the process is repeated to determine whether the system has experienced I / O blocking. This process continues until the value of the counter variable reaches a preset threshold.

[0248] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0249] If the current number of I / O requests is less than or equal to the current number of completed I / O requests, then the second specified sampling time, which is three preset time intervals from the current time, will be used as the new current time.

[0250] At the second specified sampling time, obtain the current number of I / O requests and the current number of I / O requests completed from the system;

[0251] Based on the current number of I / O requests and the number of completed I / O requests, determine whether the system is experiencing I / O blocking;

[0252] If the system experiences I / O blocking, an alarm message will be output.

[0253] In one embodiment, the current number of I / O requests and the current number of I / O requests completed are obtained from the system. When the computer program is executed by the processor, the following steps are also performed:

[0254] Get the current number of I / O requests from the system;

[0255] If the current number of IO requests is less than the preset number of IO requests, the loop will use the third specified sampling time, which is four preset time intervals from the current time, as the new current time.

[0256] At the third specified sampling time, the current number of IO requests is obtained from the system until the current number of IO requests is greater than or equal to the preset number of IO requests, then the current number of completed IO requests is obtained from the system.

[0257] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0258] Create a first variable, a second variable, and a counter variable in the system; the first variable is used to store the current number of IO requests, the second variable is used to store the current number of IO requests completed, and the counter variable is used to store the number of times the current number of IO requests is greater than the current number of IO requests completed.

[0259] Initialize the first variable, the second variable, and the count variable;

[0260] The first variable is updated based on the number of IO requests monitored at the current moment, generating the updated first variable; the second variable is updated based on the number of IO requests completed at the current moment, generating the updated second variable.

[0261] In one embodiment, the current number of I / O requests and the current number of I / O requests completed are obtained from the system. When the computer program is executed by the processor, the following steps are also performed:

[0262] Read the current number of I / O requests from the updated first variable and the current number of I / O requests completed from the updated second variable.

[0263] 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, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0264] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile 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. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0265] The technical features of the above embodiments can be combined in any way. For the sake of brevity, 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 specification.

[0266] The above embodiments are merely illustrative of several implementation methods of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A method for detecting I / O blocking, characterized in that, The method includes: The system retrieves the current number of I / O requests and the current number of completed I / O requests. The current number of I / O requests represents the number of I / O requests pending at the current moment. The current number of completed I / O requests represents the number of I / O requests processed within a first preset time period prior to the current moment. Based on the current number of I / O requests and the current number of completed I / O requests, determine whether the system is experiencing I / O blocking; If the system experiences I / O blocking, an alarm message will be output. The step of determining whether the system is experiencing I / O blocking based on the current number of I / O requests and the current number of completed I / O requests includes: Determine whether the current number of I / O requests is greater than the current number of I / O requests completed; If so, a counter variable is used to count the number of times the current number of I / O requests is greater than the current number of completed I / O requests; Determine whether the value of the count variable has reached a preset threshold; if the value of the count variable has reached the preset threshold, then determine that the system has experienced I / O blocking. If the value of the counting variable does not reach the preset threshold, then the first specified sampling time, which is spaced apart from the current time by a second preset time interval, will be taken as the new current time. At the first specified sampling time, the current number of IO requests and the current number of IO requests completed are obtained from the system; The process involves repeatedly checking whether the current number of I / O requests is greater than the current number of I / O requests completed; if so, a counter variable is used to count the number of times the current number of I / O requests is greater than the current number of I / O requests completed; and the process continues until the value of the counter variable reaches the preset threshold. If the current number of I / O requests is less than or equal to the current number of I / O requests completed, then a second specified sampling time with a third preset time interval from the current time is taken as the new current time; at the second specified sampling time, the current number of I / O requests and the current number of I / O requests completed are obtained from the system; based on the current number of I / O requests and the current number of I / O requests completed, it is determined whether the system has experienced I / O blocking; if the system has experienced I / O blocking, an alarm message is output.

2. The method according to claim 1, characterized in that, The process of obtaining the current number of I / O requests and the current number of I / O requests completed from the system includes: Get the current number of I / O requests from the system; If the current number of IO requests is less than the preset number of IO requests, then the third specified sampling time, which is four preset time intervals from the current time, will be used as the new current time in a loop. At the third specified sampling time, the current number of IO requests is obtained from the system until the current number of IO requests is greater than or equal to the preset number of IO requests, then the current number of completed IO requests is obtained from the system.

3. The method according to claim 1, characterized in that, The method further includes: Create a first variable, a second variable, and a counter variable in the system; the first variable is used to store the current number of IO requests, the second variable is used to store the current number of IO requests completed, and the counter variable is used to store the number of times the current number of IO requests is greater than the current number of IO requests completed. Initialize the first variable, the second variable, and the counter variable; The first variable is updated based on the number of IO requests monitored at the current moment, generating the updated first variable; the second variable is updated based on the number of IO requests completed at the current moment, generating the updated second variable.

4. The method according to claim 3, characterized in that, The process of obtaining the current number of I / O requests and the current number of I / O requests completed from the system includes: Read the current number of IO requests from the updated first variable and the current number of IO requests completed from the updated second variable.

5. An I / O blocking detection device, characterized in that, The device includes: The IO request count acquisition module is used to acquire the current IO request count and the current IO request completion count from the system; the current IO request count is used to represent the number of IO requests to be processed at the current moment; the current IO request completion count is used to represent the number of IO requests processed within a first preset time period before the current moment; The IO blocking determination module is used to determine whether the system is experiencing IO blocking based on the current number of IO requests and the current number of IO requests completed. An alarm information output module is used to output alarm information if the system experiences IO blocking. The IO blocking determination module includes: An IO request count determination unit is used to determine whether the current IO request count is greater than the current IO request completion count; The counting variable statistics unit is used to count the number of times the current number of IO requests is greater than the current number of IO requests completed if the condition is met. An I / O blocking determination unit is used to determine whether I / O blocking has occurred in the system based on the value of the counter variable; The I / O blocking determination unit includes: A counting variable judgment unit is used to determine whether the value of the counting variable reaches a preset threshold. A preset threshold judgment unit is used to determine that the system has experienced IO blocking if the value of the counting variable reaches a preset threshold. The I / O blocking detection device further includes: The first current time update unit is used to update the first specified sampling time that is a second preset time interval from the current time as the new current time if the value of the counting variable does not reach the preset threshold. The first IO request count acquisition unit is used to acquire the current IO request count and the current IO request completion count from the system at the first specified sampling time. The loop judgment unit is used to repeatedly execute the step of judging whether the current number of IO requests is greater than the current number of IO requests completed; if so, it uses a counter variable to count the number of times the current number of IO requests is greater than the current number of IO requests completed; and determines whether the system has experienced IO blocking based on the value of the counter variable, until the value of the counter variable reaches the preset threshold. The I / O blocking detection device further includes: The second current time update unit is used to update the current time by taking the second specified sampling time, which is a third preset time interval from the current time, as the new current time if the current number of IO requests is less than or equal to the current number of IO requests completed. The second IO request count acquisition unit is used to acquire the current IO request count and the current IO request completion count from the system at the second specified sampling time; An IO blocking determination unit is used to determine whether the system is experiencing IO blocking based on the current number of IO requests and the current number of IO requests completed. An alarm information output unit is used to output alarm information if the system experiences IO blocking.

6. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 4.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 4.

8. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 4.