Method and device for processing read-write request, storage medium and electronic equipment

By predicting the timeout time of read and write requests in the RAID card and dynamically setting the timeout timeout time, the problem of abnormal accumulation caused by the RAID card being unable to actively predict instructions that may timeout is solved, and processing efficiency and stability are improved.

CN119473403AInactive Publication Date: 2025-02-18SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202510075470.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-17
Publication Date
2025-02-18
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

When issuing instructions, RAID cards cannot actively predict instructions that may time out soon, resulting in exception accumulation, and the existing technology lacks effective solutions.

Method used

By determining the request category when receiving a read and write request and predicting the timeout time based on the history, the timeout timeout time is dynamically set to prevent instruction timeouts and exception accumulation.

Benefits of technology

It effectively prevents instruction timeouts and abnormal accumulation, improves the processing efficiency and stability of RAID cards, and reduces the inaccuracy of manual timeout.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119473403A_ABST
    Figure CN119473403A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a read-write request processing method and device, a storage medium and electronic device.The read-write request processing method comprises the steps that under the condition that a first read-write request is received, the first request category of the first read-write request is determined; according to the first request category, predicting a first timeout duration of the first read-write request, the first timeout duration being used for indicating an upper limit of a processing duration of the first read-write request; processing the first read-write request according to the first timeout duration; by the adoption of the scheme, the problem that in the related technology, an RAID card can only carry out further processing after timeout occurs and cannot actively predict instructions which are about to be timeout possibly, and abnormal accumulation is caused is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computers, and more specifically, to a method and device for processing read and write requests, a storage medium, and an electronic device. Background Art

[0002] The RAID card and the hard disk interact with each other through the command queue located in the memory of the RAID card. The command queue includes the SQ submission queue and the CQ completion queue. The RAID card needs to put the SQE command executed by the hard disk device into the SQ queue, and then notify the hard disk device to read the SQE command from the SQ queue. The controller inside the hard disk device reads the SQE command from the SQ queue in the memory of the RAID card through the PCIe message, and executes the command inside the hard disk device. Finally, the result of the executed command CQE is put into the CQ queue of the RAID card through the PCIe message, and the RAID card is notified to complete an I / O interaction. Usually, the RAID card will set the timeout length of the command before issuing the command. If the processing result of the command is not received after the time period, the command is considered to have timed out and needs to be further processed.

[0003] At present, when issuing instructions, the RAID card will manually set a timeout period and then insert it into the SQ. If the hard disk completes the processing and replies within the set timeout period, it will be processed normally; otherwise, the RAID card needs to retry or otherwise process the timed-out instructions, and also needs to process the instructions that have been inserted into the SQ. When designing or implementing, it is not reasonable to set the timeout period too long or too short. There is no standard for setting the timeout period, and it can only be set manually. There is no compatibility setting based on different hard disks, and the timed-out instructions and the instructions that have been issued can only be further processed passively after the timeout occurs.

[0004] In the related art, the RAID card can only perform further processing after a timeout occurs, and cannot actively predict instructions that may time out, resulting in a technical problem of abnormal accumulation. No effective solution has yet been proposed. Summary of the invention

[0005] The embodiments of the present application provide a method and device for processing read and write requests, a storage medium, and an electronic device to at least solve the problem in the related art that the RAID card can only perform further processing after a timeout occurs, and cannot actively predict instructions that may time out, resulting in abnormal accumulation.

[0006] According to one embodiment of the present application, a method for processing a read / write request is provided, including: upon receiving a first read / write request, determining a first request category of the first read / write request; predicting a first timeout duration of the first read / write request based on the first request category, wherein the first timeout duration is used to indicate an upper limit of a processing duration of the first read / write request; and processing the first read / write request based on the first timeout duration.

[0007] In an exemplary embodiment, predicting the first timeout period of the first read / write request based on the first request category includes: querying historical read / write requests of the first request category and historical processing records of the historical read / write requests based on the first request category, wherein the historical processing records are at least used to indicate actual processing durations of the historical read / write requests; if the historical read / write requests and the historical processing records are not found, determining a preset timeout period as the first timeout period; if the historical read / write requests and the historical processing records are found, predicting the first timeout period based on the historical read / write requests and the historical processing records.

[0008] In an exemplary embodiment, predicting the first timeout period based on the historical read and write requests and the historical processing records includes: determining the data size of the first data corresponding to the historical read and write requests, and determining the actual processing time based on the historical processing records; fitting a processing time fitting curve of the read and write requests of the first request category based on the data size and the actual processing time, wherein the processing time fitting curve is used to indicate the correlation between the data size and the actual processing time; predicting the processing time of the first read and write request based on the processing time fitting curve, and determining the first prediction result as the first timeout period.

[0009] In an exemplary embodiment, the processing of the first read / write request according to the first timeout duration includes: The first timeout period is processed to obtain a second timeout period, wherein T is the first timeout period, T_ERR is the error period, and T_CURR is the second timeout period; and the first read / write request is processed according to the second timeout period.

[0010] In an exemplary embodiment, the processing of the first read / write request according to the second timeout period includes: determining the difference between the second timeout period and the preset timeout period; when the second timeout period is greater than the preset timeout period, determining whether the target queue is empty, and processing the first read / write request according to the first determination result obtained, wherein the target queue is used to store the second read / write requests to be executed of the first request category; when the second timeout period is less than or equal to the preset timeout period, sending the first read / write request to the target queue according to the second timeout period.

[0011] In an exemplary embodiment, the processing of the first read-write request according to the first determination result obtained includes: when the target queue is empty, sending the target number of third read-write requests to the target queue according to the preset timeout period, wherein the first read-write request includes the third read-write request; obtaining a first execution result of the third read-write request, wherein the first execution result includes the actual processing duration of the third read-write request; determining whether the third read-write request has timed out according to the first execution result and the preset timeout period, and obtaining a second determination result; processing a fourth read-write request according to the second determination result, wherein the first read-write request includes the third read-write request and the fourth read-write request, and the fourth read-write request is the next read-write request of the third read-write request.

[0012] In an exemplary embodiment, the processing of the fourth read-write request according to the second determination result includes: when the second determination result indicates that the execution of the third read-write request has not timed out, updating the processing time fitting curve of the read-write requests of the first request category according to the actual processing time of the third read-write request and the data size of the second data corresponding to the third read-write request, and predicting the processing time of the fourth read-write request according to the updated processing time fitting curve, and processing the fourth read-write request according to the obtained second prediction result, wherein the processing time fitting curve is used to indicate the correlation between the data size and the actual processing time; when the second determination result indicates that the execution of the third read-write request has timed out, restarting the RAID card, wherein the RAID card is used to process read-write requests.

[0013] In an exemplary embodiment, the processing of the first read-write request based on the first determination result includes: when the target queue is not empty, obtaining a second execution result of the second read-write request, wherein the second execution result includes an actual processing duration of the second read-write request; determining whether the second read-write request has timed out based on the second execution result to obtain a third determination result; and processing the first read-write request based on the third determination result.

[0014] In an exemplary embodiment, the processing of the first read-write request according to the third determination result includes: when the third determination result indicates that the execution of the second read-write request has not timed out, updating the processing time fitting curve of the read-write requests of the first request category according to the actual processing time of the second read-write request and the data size of the third data corresponding to the second read-write request, and re-predicting the processing time of the first read-write request according to the updated processing time fitting curve, and processing the first read-write request according to the obtained third prediction result, wherein the processing time fitting curve is used to indicate the correlation between the data size and the actual processing time; when the third determination result indicates that the execution of the second read-write request has timed out, restarting the RAID card, wherein the RAID card is used to process read-write requests.

[0015] In an exemplary embodiment, sending the first read-write request to the target queue according to the second timeout period includes: sending the fifth read-write request to the target queue according to the second timeout period, wherein the first read-write request includes the fifth read-write request; obtaining a third execution result of the fifth read-write request, wherein the third execution result includes an actual processing duration of the fifth read-write request; determining whether the fifth read-write request has timed out according to the third execution result and the second timeout period, and obtaining a fourth determination result; processing the sixth read-write request according to the fourth determination result, wherein the first read-write request includes the sixth read-write request, and the sixth read-write request is the next read-write request of the fifth read-write request.

[0016] In an exemplary embodiment, the processing of the sixth read-write request according to the fourth determination result includes: when the fourth determination result indicates that the execution of the fifth read-write request has not timed out, updating the processing time fitting curve of the read-write requests of the first request category according to the actual processing time of the fifth read-write request and the data size of the fourth data corresponding to the fifth read-write request, and predicting the processing time of the sixth read-write request according to the updated processing time fitting curve, and processing the sixth read-write request according to the obtained fourth prediction result, wherein the processing time fitting curve is used to indicate the correlation between the data size and the actual processing time; when the fourth determination result indicates that the execution of the fifth read-write request has timed out, restarting the RAID card, wherein the RAID card is used to process read-write requests.

[0017] In an exemplary embodiment, after the restart process is performed on the RAID card, the method further includes: when it is determined that the restart of the RAID card is completed, re-processing the second read-write request.

[0018] In an exemplary embodiment, before restarting the RAID card, the method also includes: performing abnormality detection on the RAID card through an abnormality detection algorithm to determine the abnormality category of the RAID card; when it is determined that the abnormality category is a first category, performing abnormality repair on the RAID card through an abnormality repair algorithm, wherein the first category is an abnormality category that can be repaired online; when it is determined that the abnormality category is a second category, restarting the RAID card, wherein the second category is an abnormality category that cannot be repaired online.

[0019] In an exemplary embodiment, before determining the size of the second timeout period and the preset timeout period, the method also includes: obtaining hard disk parameters of the target hard disk, wherein the target hard disk is connected to a RAID card, the RAID card is used to process read and write requests, and the read and write requests are used to perform read and write operations on the target hard disk; and initializing and generating the preset timeout period according to the hard disk parameters.

[0020] In an exemplary embodiment, the method further includes: obtaining a processing time fitting curve of read and write requests of multiple second request categories, wherein the multiple second request categories include the first request category, and the processing time fitting curve is used to indicate the correlation between the data size corresponding to the read and write request and the actual processing time corresponding to the read and write request; determining the maximum processing time of the read and write requests of the multiple second request categories according to the multiple processing time fitting curves; and updating the preset timeout duration of the read and write requests of the multiple second request categories according to the multiple maximum processing times.

[0021] In an exemplary embodiment, the method further includes: when determining that the RAID card is in energy-saving mode, extending the preset timeout duration of the read and write requests of the multiple second request categories according to preset rules, wherein the RAID card is used to process the read and write requests.

[0022] According to another embodiment of the present application, a device for processing read and write requests is provided, including: a determination module, for determining a first request category of a first read and write request upon receiving the first read and write request; a prediction module, for predicting a first timeout duration of the first read and write request based on the first request category, wherein the first timeout duration is used to indicate an upper limit of a processing duration of the first read and write request; and a processing module, for processing the first read and write request based on the first timeout duration.

[0023] According to another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when run.

[0024] According to another embodiment of the present application, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0025] According to another embodiment of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps of the method described in each embodiment of the present application are implemented.

[0026] The present application provides a method for processing read / write requests. When a first read / write request is received, a first request category of the first read / write request is first determined, and a first timeout duration of the first read / write request is predicted according to the first request category, wherein the first timeout duration is used to limit an upper limit of a processing duration of the first read / write request; the first read / write request is processed according to the first timeout duration; the above scheme is adopted to predict the processing duration of an IO request (i.e., the first read / write request) and dynamically set the timeout duration, so as to prevent too many IO requests from being issued, resulting in too many exceptions that need to be processed when a timeout occurs; thereby solving the problem in the related art that a RAID card can only perform further processing after a timeout occurs, and cannot actively predict instructions that are about to time out, resulting in accumulation of exceptions. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 It is a hardware structure block diagram of a computer terminal according to a method for processing a read / write request in an embodiment of the present application;

[0028] Figure 2 This is a schematic diagram of a RAID card and a host / hard disk structure according to an embodiment of the present application;

[0029] Figure 3 is a flowchart of a method for processing a read / write request according to an embodiment of the present application;

[0030] Figure 4 It is a flowchart of an optional timeout duration prediction and processing method according to an embodiment of the present application;

[0031] Figure 5 This is an overall architecture diagram of a timeout duration prediction module according to an embodiment of the present application;

[0032] Figure 6 It is a structural block diagram of a read and write request processing device according to an embodiment of the present application. DETAILED DESCRIPTION

[0033] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0034] It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0035] The method embodiments provided in the embodiments of the present application can be executed in a computer terminal or a similar computing device. Taking running on a computer terminal as an example, Figure 1 1 is a hardware structure block diagram of a computer terminal of a method for processing a read / write request according to an embodiment of the present application. Figure 1 As shown, the computer terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the above-mentioned computer terminal may also include a transmission device 106 and an input and output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above-mentioned computer terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.

[0036] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the processing method of the read and write request in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories can be connected to the computer terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0037] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of a computer terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0038] The following is an explanation of the professional terms that appear in this application:

[0039] RAID card: (redundant arrays of independent disks) is a disk array card that combines multiple physical disks into a virtual single large-capacity disk through a RAID controller, thereby providing higher storage performance, higher I / O performance and reliability than a single disk.

[0040] SQ: SubmissI / On Queue. The queue for NVMe protocol to submit instructions.

[0041] CQ: CompleteI / On Queue. The queue for NVMe protocol completion instructions.

[0042] SQE: SubmissI / On Queue Entry. NVMe protocol submission instruction.

[0043] CQE: CompleteI / On Queue Entry. NVMe protocol completion instruction.

[0044] PCIe: peripheral component interconnect express, high-speed serial computer expansion bus standard.

[0045] Solid State Drive (SSD) is a hard disk made of a solid-state electronic storage chip array, mainly composed of a control unit, a storage unit (FLASH chip, DRAM chip) and a cache unit, referred to as a hard disk in this application.

[0046] Timeout duration: A specific operation or task fails to complete the set time limit within the specified time. In this application, it means the time required for the RAID card to issue a command and receive the execution result of the command.

[0047] Online fitting: A method that can perform function fitting in real time. It is based on the regression analysis method in mathematical statistics and describes the relationship between data by finding a function model to minimize the sum of square errors between the observed data and the model. In this process, the online fitting function can adapt to data changes in real time by using the technology of dynamically modifying model parameters.

[0048] The current RAID card is developing towards higher performance and better stability. With the development of hard disks, RAID cards are also adapting to higher-speed storage needs. RAID cards act as a bridge between the host and the hard disk. The connection diagram is as follows: Figure 2 It ensures data security, reliability and efficient storage by optimizing data transmission, providing fault tolerance protection and managing disk arrays.

[0049] When the host needs to read or write data, it interacts with the disk through the RAID card. The RAID card receives the host's I / O write request and distributes the data to different disks according to the RAID card level and configuration; for I / O read requests, the RAID card retrieves the data from the corresponding disk and returns it to the host. The data transmission rate of the RAID card is also one of the factors to evaluate its performance. During the data transmission process, it takes a certain amount of time from issuing instructions to receiving processing results. However, in some cases, the processing will time out and the data processing results cannot be received.

[0050] Currently, there is no standard for setting the timeout duration, and it can only be set manually. There is no compatibility setting based on different hard disks, and the timed-out instructions and the instructions that have been issued can only be further processed passively after the timeout occurs. This method can achieve the setting of the timeout duration and the timeout processing, but there are still problems that the timeout duration set manually is not accurate and reasonable, and it wastes time.

[0051] Specifically, if the timeout period is too short, the following problems may occur:

[0052] (1) Frequent I / O errors: When the timeout period is set too short, a large number of error reports will appear in the system, affecting normal I / O operations and even causing application or system crashes. Frequent timeout errors require more time and effort to troubleshoot and solve the problem, increasing costs.

[0053] (2) Performance degradation: A timeout period that is too short means that the system has extremely high requirements for the response speed of I / O operations. Under high load or busy conditions, the system may not be able to complete all I / O operations in time, resulting in performance degradation. In addition, frequent timeout errors may also cause the system to frequently perform error processing, further degrading performance.

[0054] (3) It may increase the instability of the system. In some cases, such as fluctuations in disk read and write speeds, instantaneous network delays, etc., normal I / O operations may only be slightly delayed, but a timeout period that is too short may cause the system to misjudge it as an error, thereby causing unnecessary system restarts or data recovery operations, further affecting system stability.

[0055] If the timeout period is too long, it may cause the following problems:

[0056] (1) Response delay: When the timeout period is set too long, if the I / O operation cannot be completed immediately due to some reason (such as disk failure, network delay, etc.), the system will wait longer before determining that the operation has timed out. This will cause users or applications to feel obvious delays, affecting the overall system performance.

[0057] (2) System stability risk: Too long a timeout period may increase system instability. For example, if an I / O operation cannot be completed due to a hardware failure, the long wait may cause the system to be unable to respond to other operations in a timely manner, and may even cause the system to crash or data loss.

[0058] Therefore, when setting the timeout period, both performance and stability must be considered, and a reasonable timeout period needs to be set. In the prior art, the RAID card can only perform further processing after a timeout occurs, and cannot actively predict instructions that may time out, resulting in abnormal accumulation. In order to solve this problem, a method for processing read and write requests is provided in this embodiment. Figure 3 is a flowchart of a method for processing a read / write request according to an embodiment of the present application, such as Figure 3 As shown, the method for processing the read and write request includes:

[0059] Step S302, when a first read / write request is received, determining a first request category of the first read / write request;

[0060] Step S304: predicting a first timeout duration of the first read / write request according to the first request category, wherein the first timeout duration is used to indicate an upper limit of a processing duration of the first read / write request;

[0061] Step S306: Process the first read / write request according to the first timeout period.

[0062] The above scheme, when receiving the first read-write request, first determines the first request category of the first read-write request, predicts the first timeout duration of the first read-write request according to the first request category, wherein the first timeout duration is used to limit the upper limit of the processing time of the first read-write request; processes the first read-write request according to the first timeout duration; adopts the above scheme, by predicting the processing time of the IO request (i.e., the first read-write request), dynamically sets the timeout duration, prevents too many IO requests from being issued, and prevents too many exceptions from being processed when a timeout occurs; thereby solving the problem in the related art that the RAID card can only perform further processing after a timeout occurs, and cannot actively predict instructions that may time out, resulting in accumulation of exceptions.

[0063] In an exemplary embodiment, predicting the first timeout period of the first read / write request based on the first request category includes: querying historical read / write requests of the first request category and historical processing records of the historical read / write requests based on the first request category, wherein the historical processing records are at least used to indicate actual processing durations of the historical read / write requests; if the historical read / write requests and the historical processing records are not found, determining a preset timeout period as the first timeout period; if the historical read / write requests and the historical processing records are found, predicting the first timeout period based on the historical read / write requests and the historical processing records.

[0064] First, according to the first request category, the relevant records of historical read and write requests of the first request category are queried. If no records are found, it means that the IO request of this category is issued for the first time, and the first timeout period is set according to the T_MAX (that is, the preset timeout period) preset before initialization. If the historical read and write requests and historical processing records are queried, the first timeout period corresponding to the first read and write request is predicted based on the historical read and write requests and historical processing records.

[0065] Through this embodiment, the timeout duration of a newly issued IO request can be predicted based on the processing results of the previous IO requests, thereby dynamically adjusting the timeout durations of different IO requests.

[0066] Furthermore, predicting the first timeout period based on the historical read and write requests and the historical processing records includes: determining the data size of the first data corresponding to the historical read and write requests, and determining the actual processing time based on the historical processing records; fitting a processing time fitting curve of the read and write requests of the first request category based on the data size and the actual processing time, wherein the processing time fitting curve is used to indicate the correlation between the data size and the actual processing time; predicting the processing time of the first read and write request based on the processing time fitting curve, and determining the first prediction result obtained as the first timeout period.

[0067] First, determine the data volume of the first data corresponding to the read and write operations performed by the historical read and write requests, that is, the above-mentioned data size, and determine its actual processing time based on the historical processing records; then fit the processing time fitting curve of the read and write requests of the first request category based on multiple groups of data sizes and actual processing times to determine the correlation between the data size and the actual processing time. Generally, the larger the data size, the longer the actual processing time; after obtaining the processing time fitting curve, predict the processing time of the first read and write request based on the size of the data volume to be processed corresponding to the first read and write request, and determine the first prediction result obtained as the first timeout duration.

[0068] Through this embodiment, the processing time of the newly triggered IO request is predicted in combination with the historical processing conditions of the same type of IO requests, so as to set a more appropriate timeout period to monitor its processing condition, making it more reasonable.

[0069] In an optional embodiment, the curves of IO size (data size) and actual execution time fitted for different IO request types can be in the form of: T=aX+b, where a and b are coefficients, X is the data size, and T represents the timeout duration; it can also be other linear relationships, which is not limited in this application.

[0070] Optionally, the processing of the first read / write request according to the first timeout duration includes: The first timeout period is processed to obtain a second timeout period, wherein T is the first timeout period, T_ERR is the error period, and T_CURR is the second timeout period; and the first read / write request is processed according to the second timeout period.

[0071] In general, there are errors in the prediction results. In order to eliminate the errors, it is necessary to add T_ERR to the results predicted based on the processing time fitting curve. The final prediction result T_CURR is: , and obtain the final predicted second timeout duration.

[0072] Through this embodiment, after the preliminary prediction is performed, the error of the preliminary prediction result is further eliminated in combination with the error duration, so that the prediction result is more accurate.

[0073] Optionally, the processing of the first read / write request according to the second timeout period includes: determining the difference between the second timeout period and a preset timeout period; when the second timeout period is greater than the preset timeout period, determining whether the target queue is empty, and processing the first read / write request according to the first determination result obtained, wherein the target queue is used to store second read / write requests to be executed of the first request category; when the second timeout period is less than or equal to the preset timeout period, sending the first read / write request to the target queue according to the second timeout period.

[0074] Compare the second timeout period with the initial timeout period; if the second timeout period is greater than a pre-set larger timeout period, it is necessary to further determine whether the SQ queue (i.e., the target queue mentioned above) is empty, and obtain a first determination result, and then determine the processing method of the first read / write request in combination with the first determination result. The SQ queue stores relevant information of the second read / write request to be processed of the same category as the first read / write request; and if the second timeout period is less than or equal to the preset timeout period, the first read / write request can be directly sent to the target queue according to the second timeout period.

[0075] Through this embodiment, further judgment is performed based on the predicted second timeout duration and the preset timeout duration, and different processing methods are adopted according to different results, so that the processing method for the newly issued IO request is more reasonable and accurate.

[0076] Optionally, the processing of the first read-write request according to the first determination result obtained includes: when the target queue is empty, sending a target number of third read-write requests to the target queue according to the preset timeout period, wherein the first read-write request includes the third read-write request; obtaining a first execution result of the third read-write request, wherein the first execution result includes an actual processing duration of the third read-write request; determining whether the third read-write request has timed out according to the first execution result and the preset timeout period, and obtaining a second determination result; processing a fourth read-write request according to the second determination result, wherein the first read-write request includes the third read-write request and the fourth read-write request, and the fourth read-write request is the next read-write request of the third read-write request.

[0077] If it is determined that the target queue is empty, the IO request (i.e., the third read / write request) is only issued once (i.e., the target number mentioned above) according to the preset timeout period, and then the first execution result of the IO request is obtained; then, it is determined whether the third read / write request has timed out according to the first execution result, and a second determination result is obtained, and the next fourth read / write request is processed according to the second result.

[0078] Through this embodiment, when the second timeout period is greater than the preset timeout period and the target queue is empty, an IO request is first tentatively issued to observe its execution result; then, the processing method of subsequent read and write requests is determined according to the execution result and the timeout situation, thereby avoiding the problem of too many IO requests being issued and too many IO requests needing to be reprocessed when a failure occurs.

[0079] Furthermore, the processing of the fourth read-write request according to the second determination result includes: when the second determination result indicates that the execution of the third read-write request has not timed out, updating the processing time fitting curve of the read-write requests of the first request category according to the actual processing time of the third read-write request and the data size of the second data corresponding to the third read-write request, and predicting the processing time of the fourth read-write request according to the updated processing time fitting curve, and processing the fourth read-write request according to the obtained second prediction result, wherein the processing time fitting curve is used to indicate the correlation between the data size and the actual processing time; when the second determination result indicates that the execution of the third read-write request has timed out, restarting the RAID card, wherein the RAID card is used to process read-write requests.

[0080] If the second determination result indicates that the execution of the third read / write request has not timed out, then the processing time fitting curve of the read / write request of the first request category is updated once in combination with the actual processing time of the third read / write request and the data size of the second data corresponding to the third read / write request to ensure the real-time validity of the processing time fitting curve; then the processing time of the subsequent fourth read / write request is predicted in combination with the updated processing time fitting curve, and then the processing process of the third read / write request is repeated to process the fourth read / write request; on the other hand, if the second determination result indicates that the execution of the third read / write request has timed out, the RAID card needs to be restarted, where the RAID card is used to process these read / write requests.

[0081] In this embodiment, after the third read / write request sent tentatively times out, it is determined that the RAID card has some faults or abnormalities, and it is restarted in time to avoid abnormality accumulation; if it does not time out, the above solution is continued to process the next read / write request to ensure normal processing of the read / write request.

[0082] Optionally, the processing of the first read-write request based on the first determination result includes: when the target queue is not empty, obtaining a second execution result of the second read-write request, wherein the second execution result includes an actual processing duration of the second read-write request; determining whether the second read-write request has timed out based on the second execution result to obtain a third determination result; and processing the first read-write request based on the third determination result.

[0083] If the target queue is not empty, it means that there are IO requests that have not been processed yet in the queue. On the basis of determining that there is a timeout risk, suspend sending IO requests to the queue and wait for the processing result of the IO requests in the queue, that is, the second execution result mentioned above; first determine whether the second read / write request has timed out based on the second execution result, and obtain a third determination result; then determine the processing method for the first read / write request based on the third determination result.

[0084] Through this embodiment, when the target queue is not empty, the processing status of the second read / write request in the target queue is first observed, and whether the current RAID card has an abnormality is determined based on the processing result, thereby avoiding abnormal accumulation caused by a large number of IO requests not being processed normally when an abnormality occurs.

[0085] Optionally, the processing of the first read-write request according to the third determination result includes: when the third determination result indicates that the execution of the second read-write request has not timed out, updating the processing time fitting curve of the read-write requests of the first request category according to the actual processing time of the second read-write request and the data size of the third data corresponding to the second read-write request, and re-predicting the processing time of the first read-write request according to the updated processing time fitting curve, and processing the first read-write request according to the obtained third prediction result, wherein the processing time fitting curve is used to indicate the correlation between the data size and the actual processing time; when the third determination result indicates that the execution of the second read-write request has timed out, restarting the RAID card, wherein the RAID card is used to process read-write requests.

[0086] If the third determination result indicates that the execution of the second read-write request has not timed out, the processing time fitting curve of the read-write request of the first request category is first updated according to the actual processing time of the second read-write request and the data size of the third data corresponding to the second read-write request, and the processing time of the unprocessed first read-write request is re-predicted according to the updated processing time fitting curve to obtain the third prediction result, and then the above processing process is re-performed to process the first read-write request according to the third prediction result; if the third determination result indicates that the execution of the second read-write request has timed out, it is determined that the RAID card may have a fault or abnormality, and the RAID card is restarted, wherein the RAID card is used to process these read-write requests.

[0087] Through this embodiment, on the one hand, when the second read / write request can be processed normally, the timeout period of the first read / write request is re-predicted based on its processing situation to reduce the risk of abnormalities; on the other hand, if the second read / write request cannot be processed normally, the RAID card is restarted in time to repair the fault and avoid abnormal accumulation.

[0088] Optionally, sending the first read-write request to the target queue according to the second timeout period includes: sending the fifth read-write request to the target queue according to the second timeout period, wherein the first read-write request includes the fifth read-write request; obtaining a third execution result of the fifth read-write request, wherein the third execution result includes an actual processing time of the fifth read-write request; determining whether the fifth read-write request has timed out according to the third execution result and the second timeout period, and obtaining a fourth determination result; processing the sixth read-write request according to the fourth determination result, wherein the first read-write request includes the sixth read-write request, and the sixth read-write request is the next read-write request of the fifth read-write request.

[0089] If the second timeout period is less than or equal to the preset timeout period, the fifth read-write request in the first read-write request is first sent to the target queue according to the second timeout period; then the third execution result of the fifth read-write request is obtained to determine its actual processing time; then, based on the third execution result and the second timeout period, it is determined whether the fifth read-write request has timed out to obtain a fourth determination result; finally, the next sixth read-write request is processed according to the fourth determination result.

[0090] Optionally, the processing of the sixth read-write request according to the fourth determination result includes: when the fourth determination result indicates that the execution of the fifth read-write request has not timed out, updating the processing time fitting curve of the read-write requests of the first request category according to the actual processing time of the fifth read-write request and the data size of the fourth data corresponding to the fifth read-write request, and predicting the processing time of the sixth read-write request according to the updated processing time fitting curve, and processing the sixth read-write request according to the obtained fourth prediction result, wherein the processing time fitting curve is used to indicate the correlation between the data size and the actual processing time; when the fourth determination result indicates that the execution of the fifth read-write request has timed out, restarting the RAID card, wherein the RAID card is used to process read-write requests.

[0091] If the fifth read-write request is executed without timeout, the processing time fitting curve of the first request category is updated according to the actual processing time of the fifth read-write request and the data size of the fourth data corresponding to the fifth read-write request. Then, before processing the sixth read-write request, the timeout duration of the sixth read-write request is predicted according to the updated processing time fitting curve to obtain a fourth prediction result. Then, according to the fourth prediction result, the sixth read-write request is processed in the same way as the fifth read-write request. If the fourth determination result indicates that the fifth read-write request has timed out, the RAID card also needs to be restarted.

[0092] Based on the above steps, after the RAID card is restarted, the method further includes: when it is determined that the RAID card is restarted, reprocessing the second read / write request.

[0093] After the RAID card is restarted, the fault or abnormality of the RAID card is repaired, and the second read and write request that has not been processed in the target queue needs to be restored and reprocessed to ensure the smooth execution of all read and write requests and avoid data processing disorder.

[0094] Optionally, before restarting the RAID card, the method also includes: performing abnormality detection on the RAID card through an abnormality detection algorithm to determine the abnormality category of the RAID card; when it is determined that the abnormality category is a first category, performing abnormality repair on the RAID card through an abnormality repair algorithm, wherein the first category is an abnormality category that can be repaired online; when it is determined that the abnormality category is a second category, restarting the RAID card, wherein the second category is an abnormality category that cannot be repaired online.

[0095] After the read and write request processing times out, you can first use the anomaly detection algorithm to detect anomalies on the RAID card and first determine the anomaly category of the RAID card anomaly; take different processing methods according to different anomaly categories; if the anomaly category is the first category that can be repaired online, you do not need to restart the RAID card, and first use the anomaly repair algorithm to repair the RAID card online; if the anomaly category is the second category that cannot be repaired online, you still need to restart the RAID card and repair it offline.

[0096] Through this embodiment, the frequency of restarting the RAID card when an abnormality occurs is reduced, thereby improving the working efficiency of the RAID.

[0097] It should be noted that if the execution result is a timeout, it usually means that the system or device did not complete the expected response or operation within the scheduled time. In the interaction between the RAID card and the hard disk, the timeout specifically represents the following aspects:

[0098] 1. I / O operation is not completed: When the RAID card sends a read or write command to the hard disk and sets a timeout, if no response is received from the hard disk within this time (i.e. the result of completing the command CQE), it will be judged as a timeout. This may be because the hard disk processes data slower than expected, or due to some external factors, such as disk failure, network delay, hardware bottleneck, etc., resulting in delay in command execution.

[0099] 2. System performance issues: Frequent timeouts can reflect system performance issues, such as excessive CPU load, insufficient memory, or inefficient communication between the RAID card and the hard disk.

[0100] 3. Stability risk: Timeouts may also reveal stability risks for the system. For example, if the hard disk encounters a failure when processing instructions, a long wait may cause the RAID card or the entire system to be unable to respond to other requests, thus affecting the overall stability and reliability of the system.

[0101] 4. Data consistency issues: In some cases, timeouts may mean data consistency issues. If a timeout occurs during data writing, data may not be fully written or may be written incorrectly, affecting the integrity and accuracy of the data.

[0102] In order to deal with the timeout problem, RAID cards usually adopt a retry mechanism, that is, resending instructions after a timeout, or performing error processing, such as starting a redundant disk for data recovery. In this application, by real-time prediction and adaptively setting the timeout duration, the occurrence of timeouts can be reduced to a certain extent, thereby reducing the impact of the above problems and improving the efficiency and stability of the system.

[0103] Optionally, before determining the size of the second timeout period and the preset timeout period, the method also includes: obtaining hard disk parameters of the target hard disk, wherein the target hard disk is connected to a RAID card, the RAID card is used to process read and write requests, and the read and write requests are used to perform read and write operations on the target hard disk; and initializing and generating the preset timeout period according to the hard disk parameters.

[0104] Optionally, the preset timeout period can be set in the following way: first obtain the hard disk parameters of the target hard disk connected to the RAID card, determine the read and write performance and other information of the target hard disk based on the hard disk parameters, and then initialize and set a larger and more appropriate preset timeout period based on this information.

[0105] Optionally, the method also includes: obtaining processing time fitting curves of read and write requests of multiple second request categories, wherein the multiple second request categories include the first request category, and the processing time fitting curve is used to indicate the correlation between the data size corresponding to the read and write request and the actual processing time corresponding to the read and write request; determining the maximum processing time of the read and write requests of the multiple second request categories according to the multiple processing time fitting curves; and updating the preset timeout duration of the read and write requests of the multiple second request categories according to the multiple maximum processing times.

[0106] After running for a period of time, the RAID card will obtain processing time fitting curves for various types of read and write requests, which respectively reflect how the actual processing time of read and write requests of different request categories changes with the data size; combined with these processing time fitting curves, the maximum processing time of read and write requests of different request categories can be determined respectively; based on the maximum processing time, the preset timeout duration of each request category can be appropriately adjusted.

[0107] The preset timeout period generated by initialization can be a common parameter for all request categories. In actual application, the RAID card will have a better understanding of the processing time variation characteristics of different categories of read and write requests, so that a more accurate preset timeout period can be set for read and write requests of different request categories. In the subsequent processing process, the respective accurate preset timeout periods can be combined to further improve the setting precision and accuracy of the timeout period, thereby improving the working efficiency of the RAID card.

[0108] It should be noted that in the embodiments of the present application, only the functional relationship between the data size and the actual processing time is considered. In actual application, in addition to the I / O size, other hardware status parameters can be considered, such as disk temperature, hard disk read and write speed fluctuations, network delay, etc., for multi-dimensional online fitting to more accurately predict the timeout duration.

[0109] Optionally, the method further includes: when it is determined that the RAID card is in the energy-saving mode, extending a preset timeout duration of the read and write requests of the plurality of second request categories according to a preset rule.

[0110] In energy-saving mode, the read and write speed of the RAID card or hard disk will decrease. If the timeout period obtained in normal mode is still used for setting, the RAID card will frequently restart due to timeout, affecting the system's work efficiency. It is necessary to adaptively extend the timeout period to ensure the normal operation of the system.

[0111] Optionally, the present application proposes an optional method for adaptively setting the timeout duration of a RAID card, the process of which is as follows: Figure 4 As shown, the specific steps include:

[0112] Step 1, initialize the timeout duration T_CURR (second timeout duration) = T_MAX (preset timeout duration);

[0113] Step 2: Predict and update T_CERR. Specifically, if the IO request is issued for the first time, the T_MAX value is used by default. If it is not issued for the first time, online fitting is performed based on the historical issuance and processing conditions to obtain a fitting curve, and then prediction and update are performed based on the fitting curve.

[0114] Step 3: Determine whether T_CURR is greater than T_MAX. If so, proceed to step 4; if not, proceed to step 5.

[0115] Step 4: Determine whether the SQ queue (i.e., the target queue) is empty; if it is empty, execute step 6; if it is not empty, execute step 7;

[0116] Step 5: Issue IO (first read / write request) according to T_CURR.

[0117] Step 6: According to T_MAX, only one IO is issued (the third read / write request);

[0118] Step 7: Stop issuing IO and wait for the result of the previous IO (second read / write request);

[0119] Step 8: Receive IO processing results;

[0120] Step 9: Determine whether the IO has timed out based on the processing result; if it has timed out, execute step 10; if it has not timed out, return to execute step 2 to predict and update the T_CURR of the next IO;

[0121] Step 10, end.

[0122] Through the above steps, the timeout duration is predicted by using online fitting, and when the prediction result is a timeout, the IO requests are reduced or stopped, thereby effectively reducing the operations after the timeout.

[0123] Optionally, the present application optimizes the structure of the RAID card and adds a timeout duration prediction / setting module to the RAID card, such as Figure 5 As shown in the figure, the module records the execution time of historical instructions, and obtains the curve of IO size (data size) and execution time (i.e., the above-mentioned processing time fitting curve) for different IO types through online fitting. It predicts and sets the timeout of the instruction before the next instruction is issued, which can effectively solve the irrationality of manually setting the timeout too long or too short. At the same time, when facing hard disks of different manufacturers and different performances, this method can also effectively improve the compatibility of RAID cards. When the prediction is about to time out, first determine whether the SQ queue is empty. If not, wait for the result; if it is empty, only issue one IO to verify whether it is really timed out, to prevent too many IOs from being issued, and too many exceptions to be handled when timeout occurs.

[0124] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0125] In this embodiment, a device for executing a read-write task is also provided. Figure 6 is a structural block diagram of a device for executing a read / write task according to an embodiment of the present application, such as Figure 6 As shown, the device comprises:

[0126] A determination module 62, configured to determine a first request category of a first read / write request when a first read / write request is received;

[0127] A prediction module 64, configured to predict a first timeout duration of the first read / write request according to the first request category, wherein the first timeout duration is used to indicate an upper limit of a processing duration of the first read / write request;

[0128] The processing module 66 is used to process the first read / write request according to the first timeout period.

[0129] Through the above-mentioned device, when a first read-write request is received, the first request category of the first read-write request is first determined, and the first timeout duration of the first read-write request is predicted according to the first request category, wherein the first timeout duration is used to limit the upper limit of the processing duration of the first read-write request; the first read-write request is processed according to the first timeout duration; by adopting the above-mentioned scheme, the processing duration of the IO request (i.e., the first read-write request) is predicted, and the timeout duration is dynamically set, so as to prevent too many IO requests from being issued, resulting in too many exceptions that need to be processed when a timeout occurs; thereby solving the problem in the related art that the RAID card can only perform further processing after a timeout occurs, and cannot actively predict instructions that may time out, resulting in accumulation of exceptions.

[0130] Optionally, the prediction module 64 is further used to query historical read and write requests of the first request category and historical processing records of the historical read and write requests according to the first request category, wherein the historical processing records are at least used to indicate the actual processing duration of the historical read and write requests; if the historical read and write requests and the historical processing records are not queried, the preset timeout duration is determined as the first timeout duration; if the historical read and write requests and the historical processing records are queried, the first timeout duration is predicted based on the historical read and write requests and the historical processing records.

[0131] Optionally, the above-mentioned prediction module 64 is also used to determine the data size of the first data corresponding to the historical read and write requests, and determine the actual processing time based on the historical processing records; fit the processing time fitting curve of the read and write requests of the first request category according to the data size and the actual processing time, wherein the processing time fitting curve is used to indicate the correlation between the data size and the actual processing time; predict the processing time of the first read and write request according to the processing time fitting curve, and determine the first prediction result obtained as the first timeout duration.

[0132] Furthermore, the processing module 66 is also used to calculate the The first timeout period is processed to obtain a second timeout period, wherein T is the first timeout period, T_ERR is the error period, and T_CURR is the second timeout period; and the first read / write request is processed according to the second timeout period.

[0133] Optionally, the above-mentioned processing module 66 is also used to determine the size of the second timeout period and the preset timeout period; when the second timeout period is greater than the preset timeout period, determine whether the target queue is empty, and process the first read and write request according to the first determination result obtained, wherein the target queue is used to store the second read and write requests to be executed of the first request category; when the second timeout period is less than or equal to the preset timeout period, send the first read and write request to the target queue according to the second timeout period.

[0134] Optionally, the above-mentioned processing module 66 is also used to, when the target queue is empty, send a target number of third read-write requests to the target queue according to the preset timeout period, wherein the first read-write request includes the third read-write request; obtain a first execution result of the third read-write request, wherein the first execution result includes an actual processing time of the third read-write request; determine whether the third read-write request has timed out according to the first execution result and the preset timeout period, and obtain a second determination result; process the fourth read-write request according to the second determination result, wherein the first read-write request includes the third read-write request and the fourth read-write request, and the fourth read-write request is the next read-write request of the third read-write request.

[0135] Optionally, the above-mentioned processing module 66 is also used to update the processing time fitting curve of the read and write requests of the first request category according to the actual processing time of the third read and write request and the data size of the second data corresponding to the third read and write request, when the second determination result indicates that the execution of the third read and write request has not timed out, and predict the processing time of the fourth read and write request according to the updated processing time fitting curve, and process the fourth read and write request according to the obtained second prediction result, wherein the processing time fitting curve is used to indicate the correlation between the data size and the actual processing time; when the second determination result indicates that the execution of the third read and write request has timed out, restart the RAID card, wherein the RAID card is used to process the read and write requests.

[0136] Optionally, the above-mentioned processing module 66 is also used to obtain a second execution result of the second read-write request when the target queue is not empty, wherein the second execution result includes an actual processing time of the second read-write request; determine whether the second read-write request has timed out according to the second execution result to obtain a third determination result; and process the first read-write request according to the third determination result.

[0137] Optionally, the above-mentioned processing module 66 is also used to update the processing time fitting curve of the read and write requests of the first request category according to the actual processing time of the second read and write request and the data size of the third data corresponding to the second read and write request when the third determination result indicates that the execution of the second read and write request has not timed out, and re-predict the processing time of the first read and write request according to the updated processing time fitting curve, and process the first read and write request according to the obtained third prediction result, wherein the processing time fitting curve is used to indicate the correlation between the data size and the actual processing time; when the third determination result indicates that the execution of the second read and write request has timed out, restart the RAID card, wherein the RAID card is used to process read and write requests.

[0138] Optionally, the above-mentioned processing module 66 is also used to send the fifth read-write request to the target queue according to the second timeout period, wherein the first read-write request includes the fifth read-write request; obtain a third execution result of the fifth read-write request, wherein the third execution result includes the actual processing time of the fifth read-write request; determine whether the fifth read-write request has timed out according to the third execution result and the second timeout period, and obtain a fourth determination result; process the sixth read-write request according to the fourth determination result, wherein the first read-write request includes the sixth read-write request, and the sixth read-write request is the next read-write request of the fifth read-write request.

[0139] Optionally, the above-mentioned processing module 66 is also used to update the processing time fitting curve of the read and write requests of the first request category according to the actual processing time of the fifth read and write request and the data size of the fourth data corresponding to the fifth read and write request when the fourth determination result indicates that the execution of the fifth read and write request has not timed out, and predict the processing time of the sixth read and write request according to the updated processing time fitting curve, and process the sixth read and write request according to the fourth prediction result obtained, wherein the processing time fitting curve is used to indicate the correlation between the data size and the actual processing time; when the fourth determination result indicates that the execution of the fifth read and write request has timed out, restart the RAID card, wherein the RAID card is used to process read and write requests.

[0140] Optionally, the processing module 66 is further configured to re-process the second read / write request when it is determined that the RAID card has been restarted.

[0141] Optionally, the above-mentioned processing module 66 is also used to perform abnormality detection on the RAID card through an abnormality detection algorithm to determine the abnormality category of the RAID card; when it is determined that the abnormality category is the first category, perform abnormality repair on the RAID card through an abnormality repair algorithm, wherein the first category is an abnormality category that can be repaired online; when it is determined that the abnormality category is the second category, restart the RAID card, wherein the second category is an abnormality category that cannot be repaired online.

[0142] Optionally, the above-mentioned determination module 62 is also used to obtain the hard disk parameters of the target hard disk, wherein the target hard disk is connected to a RAID card, the RAID card is used to process read and write requests, and the read and write requests are used to perform read and write operations on the target hard disk; and the preset timeout period is generated according to the hard disk parameter initialization.

[0143] Optionally, the above-mentioned device is also used to obtain a processing time fitting curve of read and write requests of multiple second request categories, wherein the multiple second request categories include the first request category, and the processing time fitting curve is used to indicate the correlation between the data size corresponding to the read and write request and the actual processing time corresponding to the read and write request; the maximum processing time of the read and write requests of the multiple second request categories is determined according to the multiple processing time fitting curves; and the preset timeout duration of the read and write requests of the multiple second request categories is updated according to the multiple maximum processing times.

[0144] Optionally, the above-mentioned device is also used to extend the preset timeout duration of the read and write requests of the plurality of second request categories according to a preset rule when it is determined that the RAID card is in the energy-saving mode.

[0145] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.

[0146] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.

[0147] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0148] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0149] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0150] An embodiment of the present application further provides a computer program product, comprising a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program product, and when the computer program is executed by a processor, the steps of the method described in each embodiment of the present application are implemented.

[0151] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0152] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.

[0153] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.

Claims

1. A method for processing a read / write request, characterized in that: include: Upon receiving a first read / write request, determining a first request category of the first read / write request; Predicting a first timeout duration of the first read / write request according to the first request category, wherein the first timeout duration is used to indicate an upper limit of a processing duration of the first read / write request; The first read / write request is processed according to the first timeout period.

2. The method for processing a read / write request according to claim 1, characterized in that: The predicting a first timeout duration of the first read / write request according to the first request category includes: querying historical read / write requests of the first request category and historical processing records of the historical read / write requests according to the first request category, wherein the historical processing records are at least used to indicate actual processing duration of the historical read / write requests; In the case where the historical read / write request and the historical processing record are not found, determining a preset timeout duration as the first timeout duration; When the historical read / write requests and the historical processing records are queried, the first timeout duration is predicted according to the historical read / write requests and the historical processing records.

3. The method for processing a read / write request according to claim 2, characterized in that: The predicting the first timeout duration according to the historical read / write requests and the historical processing records includes: Determine the data size of the first data corresponding to the historical read / write request, and determine the actual processing duration according to the historical processing record; fitting a processing time fitting curve of the read and write requests of the first request category according to the data size and the actual processing time, wherein the processing time fitting curve is used to indicate the correlation relationship between the data size and the actual processing time; The processing duration of the first read / write request is predicted according to the processing duration fitting curve, and the obtained first prediction result is determined as the first timeout duration.

4. The method for processing a read / write request according to claim 1, characterized in that: The processing of the first read / write request according to the first timeout duration includes: By formula Processing the first timeout duration to obtain a second timeout duration, wherein T is the first timeout duration, T_ERR is the error duration, and T_CURR is the second timeout duration; The first read / write request is processed according to the second timeout period.

5. The method for processing a read / write request according to claim 4, characterized in that: The processing of the first read / write request according to the second timeout duration includes: Determine the difference between the second timeout period and a preset timeout period; In the case where the second timeout period is greater than the preset timeout period, determining whether the target queue is empty, and processing the first read / write request according to the first determination result, wherein the target queue is used to store the second read / write request to be executed of the first request category; When the second timeout period is less than or equal to the preset timeout period, the first read / write request is sent to the target queue according to the second timeout period.

6. The method for processing a read / write request according to claim 5, characterized in that: The processing of the first read / write request according to the obtained first determination result includes: When the target queue is empty, sending a target number of third read / write requests to the target queue according to the preset timeout period, wherein the first read / write request includes the third read / write request; Obtaining a first execution result of the third read / write request, wherein the first execution result includes an actual processing duration of the third read / write request; Determine whether the third read / write request has timed out according to the first execution result and the preset timeout duration, and obtain a second determination result; The fourth read / write request is processed according to the second determination result, wherein the first read / write request includes the third read / write request and the fourth read / write request, and the fourth read / write request is a next read / write request of the third read / write request.

7. The method for processing a read / write request according to claim 6, characterized in that: The processing of the fourth read / write request according to the second determination result includes: In the case where the second determination result indicates that the execution of the third read / write request has not timed out, the processing time fitting curve of the read / write requests of the first request category is updated according to the actual processing time of the third read / write request and the data size of the second data corresponding to the third read / write request, and the processing time fitting curve is predicted for the fourth read / write request according to the updated processing time fitting curve, and the fourth read / write request is processed according to the obtained second prediction result, wherein the processing time fitting curve is used to indicate the correlation between the data size and the actual processing time; When the second determination result indicates that the third read / write request has timed out, a restart process is performed on the RAID card, wherein the RAID card is used to process the read / write request.

8. The method for processing a read / write request according to claim 5, characterized in that: The processing of the first read / write request according to the obtained first determination result includes: When the target queue is not empty, obtaining a second execution result of the second read / write request, wherein the second execution result includes an actual processing time of the second read / write request; Determine whether the second read / write request has timed out according to the second execution result, and obtain a third determination result; The first read / write request is processed according to the third determination result.

9. The method for processing a read / write request according to claim 8, characterized in that: The processing of the first read / write request according to the third determination result includes: In the case where the third determination result indicates that the execution of the second read / write request has not timed out, the processing time fitting curve of the read / write request of the first request category is updated according to the actual processing time of the second read / write request and the data size of the third data corresponding to the second read / write request, and the processing time of the first read / write request is re-predicted according to the updated processing time fitting curve, and the first read / write request is processed according to the obtained third prediction result, wherein the processing time fitting curve is used to indicate the correlation between the data size and the actual processing time; When the third determination result indicates that the second read / write request has timed out, a restart process is performed on the RAID card, wherein the RAID card is used to process the read / write request.

10. The method for processing a read / write request according to claim 5, characterized in that: The sending the first read / write request to the target queue according to the second timeout duration includes: Sending a fifth read / write request to the target queue according to the second timeout duration, wherein the first read / write request includes the fifth read / write request; Obtaining a third execution result of the fifth read / write request, wherein the third execution result includes an actual processing duration of the fifth read / write request; Determine whether the fifth read / write request has timed out according to the third execution result and the second timeout duration, to obtain a fourth determination result; The sixth read / write request is processed according to the fourth determination result, wherein the first read / write request includes the sixth read / write request, and the sixth read / write request is a next read / write request of the fifth read / write request.

11. The method for processing a read / write request according to claim 10, characterized in that: The processing of the sixth read / write request according to the fourth determination result includes: In the case where the fourth determination result indicates that the execution of the fifth read / write request has not timed out, the processing time fitting curve of the read / write requests of the first request category is updated according to the actual processing time of the fifth read / write request and the data size of the fourth data corresponding to the fifth read / write request, and the processing time fitting curve is predicted for the sixth read / write request according to the updated processing time fitting curve, and the sixth read / write request is processed according to the obtained fourth prediction result, wherein the processing time fitting curve is used to indicate the correlation between the data size and the actual processing time; When the fourth determination result indicates that the fifth read / write request has timed out, a restart process is performed on the RAID card, wherein the RAID card is used to process the read / write request.

12. The method for processing a read / write request according to any one of claims 7, 9 and 11, characterized in that: After the RAID card is restarted, the method further includes: When it is determined that the RAID card has been restarted, the second read-write request is processed again.

13. The method for processing a read / write request according to claim 12, characterized in that: Before the RAID card is restarted, the method further includes: Performing anomaly detection on the RAID card by using an anomaly detection algorithm to determine an anomaly category of the RAID card; When it is determined that the abnormality category is the first category, performing abnormality repair on the RAID card by using an abnormality repair algorithm, wherein the first category is an abnormality category that can be repaired online; When it is determined that the abnormality category is the second category, the RAID card is restarted, wherein the second category is an abnormality category that cannot be repaired online.

14. The method for processing a read / write request according to claim 5, characterized in that: Before determining the difference between the second timeout duration and the preset timeout duration, the method further includes: Obtain hard disk parameters of a target hard disk, wherein the target hard disk is connected to a RAID card, the RAID card is used to process read and write requests, and the read and write requests are used to perform read and write operations on the target hard disk; The preset timeout duration is generated according to the hard disk parameter initialization.

15. The method for processing a read / write request according to claim 5, characterized in that: The method further comprises: Obtaining a processing time fitting curve of a plurality of read and write requests of a second request category, wherein the plurality of second request categories include the first request category, and the processing time fitting curve is used to indicate a correlation between a data size corresponding to the read and write request and an actual processing time corresponding to the read and write request; Determine the maximum processing durations of the read and write requests of the plurality of second request categories respectively according to the plurality of processing duration fitting curves; The preset timeout durations of the read and write requests of the plurality of second request categories are updated respectively according to the plurality of maximum processing durations.

16. The method for processing a read / write request according to claim 15, characterized in that: The method further comprises: When it is determined that the RAID card is in energy-saving mode, the preset timeout durations of the read and write requests of the plurality of second request categories are extended according to preset rules, wherein the RAID card is used to process the read and write requests.

17. A device for processing read and write requests, characterized in that: include: A determination module, configured to determine a first request category of a first read / write request upon receiving the first read / write request; a prediction module, configured to predict a first timeout duration of the first read / write request according to the first request category, wherein the first timeout duration is used to indicate an upper limit of a processing duration of the first read / write request; A processing module is used to process the first read and write request according to the first timeout period.

18. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method described in any one of claims 1 to 16 when executed by a processor.

19. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method described in any one of claims 1 to 16 are implemented.

20. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 16 are implemented.

Citation Information

Patent Citations

  • Method and device for dynamically determining time-out period of system

    CN108509325A

  • Network request processing method and device, electronic equipment and storage medium

    CN112118329A

  • Read-write speed control method and device

    CN113325998A

  • RAID (Redundant Array of Independent Disks) read-write timeout processing method and device, equipment and medium

    CN113391941A

  • IO request processing method and device, electronic equipment and computer readable medium

    CN113419669A