Request processing method and device, computer device, storage medium and program product
By adopting an adaptive IO aggregation strategy, the aggregation queue and delivery instructions are dynamically adjusted according to the storage medium type and execution window load, which solves the problem that existing IO aggregation methods cannot adapt to load changes and improves the performance and throughput of the storage system.
Patent Information
- Application Number
- CN202611207506.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-10
- Publication Date
- 2026-11-24
AI Technical Summary
Existing IO aggregation methods cannot effectively adjust dynamically according to load conditions, resulting in timeouts during low loads or premature delivery during high loads, which affects the performance of the storage system.
The aggregation queue is adaptively determined based on the storage medium type, and I/O requests are dynamically merged based on the address range. Delivery instructions are generated by combining the load of the execution window and the concurrent execution range, and aggregation termination is dynamically triggered to optimize the aggregation strategy.
It effectively balances aggregation benefits with IO latency, improves the overall performance of the storage system, and reduces CPU consumption and resource waste.
Smart Images

Figure CN123157418A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of IO aggregation technology, and in particular to a request processing method, apparatus, computer device, storage medium, and program product. Background Technology
[0002] As computer storage systems continue to expand in scale, they will face scenarios involving the processing of massive input / output (IO) requests. Aggregating IO requests to process these massive IO requests can reduce the number of system calls, lower resource overhead, and increase throughput, which has become a key to improving the overall performance of computer storage systems.
[0003] In related technologies, common IO aggregation methods include fixed threshold schemes and fixed timeout schemes. The fixed threshold scheme sets the aggregation to be triggered when the number or size of IOs reaches a preset threshold; the fixed timeout scheme triggers aggregation periodically at preset time intervals.
[0004] However, the above methods all use a preset delay or quantity as the basis for terminating the aggregation and deliver the aggregated IO requests to the corresponding execution window, which has the problem of not being able to effectively aggregate IO requests. Summary of the Invention
[0005] Therefore, it is necessary to provide a request processing method, apparatus, computer device, storage medium, and program product to address the aforementioned technical problems.
[0006] Firstly, this application provides a request processing method, including:
[0007] Based on the storage medium type corresponding to the multiple pending IO requests received, determine the aggregation queue corresponding to each pending IO request;
[0008] Based on the processing order of each pending IO request, for each pending IO request, the aggregation strategy of the pending IO request is determined according to the first address range of the pending IO request and the second address range of the existing IO requests in the aggregation queue, and the pending IO request is inserted into the aggregation queue based on the aggregation strategy.
[0009] In response to the delivery instruction, the target IO request sequence in the aggregation queue is delivered to the corresponding execution window, and the aggregation strategy for determining the pending IO requests is stopped; the delivery instruction is generated based on the current load of the execution window and the concurrent execution range of the IO requests in the execution window.
[0010] In the above request processing method, the aggregation queue is adaptively determined according to the storage medium type, and IO requests are dynamically merged based on the address range. At the same time, the delivery indication is generated based on the real-time load and concurrent execution range of the execution window, so that the aggregation termination can be dynamically triggered based on the actual processing capacity of the execution window. This prevents timeouts due to waiting under low load and avoids queuing caused by premature delivery under high load, thereby effectively balancing aggregation benefits and IO latency, and thus improving the overall performance of the storage system.
[0011] In one embodiment, the aggregation strategy for the I / O requests to be processed is determined based on a first address range of the I / O requests to be processed and a second address range of existing I / O requests in the aggregation queue, including:
[0012] The existing IO requests are traversed sequentially from the tail to the head of the aggregation queue. Based on the first address range of the IO request to be processed, the second address range of the existing IO requests, and the storage medium type of the IO request to be processed, the aggregation strategy of the IO request to be processed is determined.
[0013] In this embodiment, by traversing existing IO requests from the tail to the head of the aggregation queue and determining the aggregation strategy based on the storage medium type, the newly enqueued IO requests can be processed first, shortening the aggregation decision path. At the same time, by dynamically selecting the aggregation strategy based on the storage medium type, the aggregation effect is optimized, and CPU consumption and aggregation latency are reduced.
[0014] In one embodiment, when the storage medium type is a hard disk drive, an aggregation strategy for the IO request to be processed is determined based on a first address range of the IO request to be processed, a second address range of existing IO requests, and the storage medium type of the IO request to be processed, including any one of the following:
[0015] If the first address range is completely covered by the second address range, the pending IO request is added to the dependency chain of existing IO requests, and the traversal is terminated.
[0016] If the first address range and the second address range do not overlap, and the interval between the first address range and the second address range exceeds the preset interval threshold, then skip the existing IO request and continue to traverse the next existing IO request after the existing IO request.
[0017] If the first address range overlaps with the second address range, or the second address range is completely covered by the first address range, or the interval between the first address range and the second address range does not exceed the preset interval threshold, then the existing IO request is marked as an IO request to be merged, and the next existing IO request of the existing IO request is traversed until the traversal is completed. Then, the dependency chains of each IO request to be merged are merged into a new dependency chain, and the IO request to be processed is added to the new dependency chain.
[0018] In this embodiment, the comparison and merging strategy is further refined for the mechanical hard disk drive (HDD) scenario. By judging whether address coverage, overlap, and interval exceed the threshold, operations such as terminating traversal, skipping, or marking to be merged are performed respectively, and finally multiple dependency chains are merged into a new dependency chain. This can aggregate multiple small requests into consecutive large requests, effectively reducing the number of seek times and latency of the HDD. At the same time, by avoiding invalid comparisons, the computational overhead is reduced, thereby improving the IO performance and resource utilization in the HDD scenario.
[0019] In one embodiment, when the storage medium type is a solid-state drive, an aggregation strategy for the IO request to be processed is determined based on a first address range of the IO request to be processed, a second address range of existing IO requests, and the storage medium type of the IO request to be processed, including any one of the following:
[0020] If the first address range is completely covered by the second address range, the pending IO request is added to the dependency chain of existing IO requests, and the traversal is terminated.
[0021] If the second address range is completely covered by the first address range, the IO request to be processed is added to the dependency chain of existing IO requests, the second address range is replaced based on the first address range, and the traversal is terminated.
[0022] In this embodiment, the comparison and merging strategy is further refined for solid-state drive scenarios. If a new request is covered by an existing request, it is directly added to the dependency chain and the traversal is terminated. If an existing request is covered by a new request, the address range is updated and added to the dependency chain. This can reduce unnecessary address comparisons and reduce CPU overhead. At the same time, it avoids forcibly merging a large number of independent requests with similar addresses into a single large request, thereby giving full play to the advantages of multi-channel parallel processing of solid-state drives and improving overall throughput.
[0023] In one embodiment, the method further includes:
[0024] The first original address range of the IO request to be processed is extended according to sector alignment to obtain the first address range corresponding to the IO request to be processed.
[0025] The second original address range for each existing IO request is extended according to sector alignment to obtain the second address range corresponding to each existing IO request.
[0026] In this embodiment, by expanding the original address range of the IO request to be processed and the existing IO request by sector alignment, subsequent address comparisons are performed on a unified sector boundary, avoiding the misjudgment of adjacent or overlapping IO requests as discontinuous due to address misalignment, thereby improving the accuracy of the aggregation strategy.
[0027] In one embodiment, the delivery instruction includes a first delivery instruction or a second delivery instruction; the method further includes:
[0028] If the current load is not greater than the lower limit of IO concurrent execution, a first delivery indication is generated; the first delivery indication is used to indicate the termination of the aggregation operation to deliver IO requests and to trigger the aggregation processing of existing IO requests in the aggregation queue again after the current delivery is completed.
[0029] If the current load is greater than the lower limit of IO concurrent execution but less than the upper limit of IO concurrent execution, a second delivery instruction is generated; the second delivery instruction is used to indicate the termination of the aggregation operation and the delivery of the IO request.
[0030] In this embodiment, different delivery instructions are generated by comparing the real-time load with the lower and upper limits of IO concurrent execution. When the load is below the lower limit, a first delivery instruction is generated, which indicates that aggregation will be triggered again after delivery, so as to make full use of idle processing capacity to accelerate IO processing. When the load is between the upper and lower limits, a second delivery instruction is generated, which indicates that aggregation will be terminated and delivery will be made, thereby flexibly balancing aggregation benefits and response speed, and improving the system's adaptability and overall performance.
[0031] In one embodiment, in response to a delivery instruction, the target I / O request sequence in the aggregation queue is delivered to the corresponding execution window, including:
[0032] In response to the delivery instruction, the target sequence length is determined based on the length of the aggregation queue, the single delivery limit, and the remaining concurrency capacity of the execution window;
[0033] Based on the target sequence length and the enqueue time of each IO request in the aggregation queue, the target IO request sequence is determined from the aggregation queue and delivered to the execution window.
[0034] In this embodiment, by combining the length of the aggregation queue, the upper limit of a single delivery, and the remaining concurrent capacity of the execution window to determine the length of the target sequence, the number of IOs delivered each time can be precisely controlled. This avoids excessive delivery leading to blocking of delivery actions or queuing at the underlying level, and also avoids under-delivery wasting transmission resources. At the same time, the target sequence is selected from the aggregation queue based on the enqueue time, ensuring that the earliest arriving IO request is delivered first, preventing some requests from remaining in the queue for a long time. While ensuring delivery efficiency and system stability, the principle of fairness is taken into account, and the robustness of IO aggregation is enhanced.
[0035] In one embodiment, in response to a delivery instruction, the target sequence length is determined based on the length of the aggregation queue, the single delivery limit, and the remaining concurrency capacity of the execution window, including:
[0036] In response to the delivery instruction, the minimum of the length of the aggregation queue, the single delivery limit, and the remaining concurrent capacity is determined as the target sequence length.
[0037] In this embodiment, the target sequence length is determined by taking the minimum value of the aggregation queue length, the single delivery limit, and the remaining concurrent capacity of the execution window. This ensures that the number of available requests in the queue is not exceeded, guaranteeing that there is IO available for delivery. It also avoids thread blocking or scheduling misalignment due to excessive delivery at one time. At the same time, it does not exceed the remaining concurrent capacity, preventing IO from being delivered to the underlying layer and wasting aggregation benefits. This improves the system's throughput stability and response timeliness.
[0038] In one embodiment, the target IO request sequence is determined from the aggregated queue based on the target sequence length and the enqueue time of each IO request in the aggregated queue, including:
[0039] Multiple candidate IO request sequences are identified from the aggregated queue; for each candidate IO request sequence, the length of the candidate IO request sequence is equal to the length of the target sequence, and the candidate IO request sequence contains the earliest enqueued IO request; each candidate IO request sequence includes the original IO request and / or the merged IO request.
[0040] The candidate IO request sequence with the highest number of original IO requests among multiple candidate IO request sequences is determined as the target IO request sequence.
[0041] In this embodiment, by limiting the target IO request sequence to include the earliest enqueued IO request, and selecting the sequence with the most original IO requests from multiple candidate sequences that meet the conditions for delivery, the aggregation efficiency and throughput are improved while avoiding some requests from waiting for a long time due to the merging rules.
[0042] Secondly, this application also provides a request processing apparatus, comprising:
[0043] The first determining module is used to determine the aggregation queue corresponding to each pending IO request based on the storage medium type corresponding to the multiple pending IO requests received.
[0044] The second determining module is used to determine the aggregation strategy of each pending IO request based on the processing order of each pending IO request, according to the first address range of the pending IO request and the second address range of existing IO requests in the aggregation queue, and insert the pending IO request into the aggregation queue based on the aggregation strategy.
[0045] The request delivery module is used to deliver the target IO request sequence in the aggregation queue to the corresponding execution window in response to the delivery instruction, and to stop determining the aggregation strategy for the IO requests to be processed; the delivery instruction is generated based on the current load of the execution window and the concurrent execution range of the IO requests in the execution window.
[0046] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0047] Based on the storage medium type corresponding to the multiple pending IO requests received, determine the aggregation queue corresponding to each pending IO request;
[0048] Based on the processing order of each pending IO request, for each pending IO request, the aggregation strategy of the pending IO request is determined according to the first address range of the pending IO request and the second address range of the existing IO requests in the aggregation queue, and the pending IO request is inserted into the aggregation queue based on the aggregation strategy.
[0049] In response to the delivery instruction, the target IO request sequence in the aggregation queue is delivered to the corresponding execution window, and the aggregation strategy for determining the pending IO requests is stopped; the delivery instruction is generated based on the current load of the execution window and the concurrent execution range of the IO requests in the execution window.
[0050] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:
[0051] Based on the storage medium type corresponding to the multiple pending IO requests received, determine the aggregation queue corresponding to each pending IO request;
[0052] Based on the processing order of each pending IO request, for each pending IO request, the aggregation strategy of the pending IO request is determined according to the first address range of the pending IO request and the second address range of the existing IO requests in the aggregation queue, and the pending IO request is inserted into the aggregation queue based on the aggregation strategy.
[0053] In response to the delivery instruction, the target IO request sequence in the aggregation queue is delivered to the corresponding execution window, and the aggregation strategy for determining the pending IO requests is stopped; the delivery instruction is generated based on the current load of the execution window and the concurrent execution range of the IO requests in the execution window.
[0054] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:
[0055] Based on the storage medium type corresponding to the multiple pending IO requests received, determine the aggregation queue corresponding to each pending IO request;
[0056] Based on the processing order of each pending IO request, for each pending IO request, the aggregation strategy of the pending IO request is determined according to the first address range of the pending IO request and the second address range of the existing IO requests in the aggregation queue, and the pending IO request is inserted into the aggregation queue based on the aggregation strategy.
[0057] In response to the delivery instruction, the target IO request sequence in the aggregation queue is delivered to the corresponding execution window, and the aggregation strategy for determining the pending IO requests is stopped; the delivery instruction is generated based on the current load of the execution window and the concurrent execution range of the IO requests in the execution window.
[0058] The aforementioned request processing method, apparatus, computer equipment, storage medium, and program product determine an aggregation queue corresponding to each of the multiple pending IO requests based on the storage medium type. Based on the processing order of each pending IO request, for each pending IO request, an aggregation strategy is determined according to a first address range of the pending IO request and a second address range of existing IO requests in the aggregation queue. The pending IO request is then inserted into the aggregation queue based on the aggregation strategy. In response to a delivery instruction generated based on the current load of the execution window and the concurrent execution range of the IO requests in the execution window, the target IO request sequence in the aggregation queue is delivered to the corresponding execution window, and the determination of the aggregation strategy for the pending IO requests is stopped. This allows aggregation termination to be dynamically triggered based on the actual processing capacity of the execution window, preventing timeouts under low load and avoiding premature delivery causing queuing under high load, thereby effectively balancing aggregation benefits and IO latency, and ultimately improving the overall performance of the storage system. Attached Figure Description
[0059] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0060] Figure 1 This is an internal structural diagram of a computer device provided in an embodiment of this application;
[0061] Figure 2 This is a flowchart illustrating a request processing method provided in an embodiment of this application;
[0062] Figure 3 This is a flowchart illustrating a method for determining an address range provided in an embodiment of this application;
[0063] Figure 4 This is a flowchart illustrating a delivery instruction generation method provided in an embodiment of this application;
[0064] Figure 5 This is a flowchart illustrating a request delivery method provided in an embodiment of this application;
[0065] Figure 6 This is a flowchart illustrating a method for determining a target I / O request sequence provided in an embodiment of this application;
[0066] Figure 7 This is a schematic diagram of the structure of an IO aggregator provided in an embodiment of this application;
[0067] Figure 8 This is a structural block diagram of a request processing device provided in an embodiment of this application. Detailed Implementation
[0068] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0069] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.
[0070] As computer storage systems continue to expand in scale, they will face scenarios involving the processing of massive input / output (IO) requests. Aggregating IO requests to process these massive IO requests can reduce the number of system calls, lower resource overhead, and increase throughput, which has become a key to improving the overall performance of computer storage systems.
[0071] In related technologies, common IO aggregation methods include fixed threshold schemes and fixed timeout schemes. The fixed threshold scheme sets the aggregation to be triggered when the number or size of IOs reaches a preset threshold; the fixed timeout scheme triggers aggregation periodically at preset time intervals.
[0072] However, with a fixed threshold scheme, load fluctuations have a significant impact on performance, especially in low-traffic scenarios. The number of IO requests in the aggregation window may not reach the threshold for a long time, causing the aggregation latency to exceed the performance gains from aggregation. The latency of different IO requests also varies unpredictably due to fluctuations in aggregation time. The fixed timeout scheme also suffers from an inability to adapt to load fluctuations. Under low load, IO requests may needlessly increase aggregation time without being merged with any IO requests for processing. Under high load, even if a sufficient number of IO requests have been aggregated, they must wait for the aggregation timeout before continuing delivery, which actually increases latency. This results in IO requests not being effectively aggregated.
[0073] The request processing method provided in this application embodiment can be applied to, for example, Figure 1 The application environment shown. Figure 1 This is an internal structure diagram of a computer device provided in an embodiment of this application. The computer device may be a server, and its internal structure diagram may be as follows: Figure 1 As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and databases. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements a request processing method.
[0074] Those skilled in the art will understand that Figure 1 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0075] In one embodiment, such as Figure 2 As shown, Figure 2 This is a flowchart illustrating a request processing method provided in an embodiment of this application. This method can be applied to... Figure 1 The method, using a computer device, includes the following steps:
[0076] S201, determine the aggregation queue corresponding to each pending IO request based on the storage medium type corresponding to the multiple pending IO requests received.
[0077] In this embodiment, independent aggregation queues can be configured for different types of storage media. After receiving multiple pending IO requests from the IO initiator, the storage media type corresponding to each pending IO request is identified, and the corresponding aggregation queue is determined for the pending IO request based on the different storage media types.
[0078] For example, storage media types include hard disk drives (HDDs) and solid-state drives (SSDs).
[0079] S202, based on the processing order of each pending IO request, for each pending IO request, determine the aggregation strategy of the pending IO request according to the first address range of the pending IO request and the second address range of the existing IO requests in the aggregation queue, and insert the pending IO request into the aggregation queue based on the aggregation strategy.
[0080] In this embodiment, aggregation processing can be performed on each pending IO request sequentially according to the order in which they arrive at the IO aggregator. For the currently being processed IO request, the first address range corresponding to the IO request and the second address range corresponding to existing IO requests in the aggregation queue are obtained. Then, the first address range is compared with each of the second address ranges, and the aggregation strategy corresponding to the IO request is determined based on the comparison result.
[0081] For example, the aggregation strategy may include inserting the IO request to be processed directly as an independent IO request into the aggregation queue, or attaching the IO request to be processed to the dependency chain of an existing IO request, or merging multiple existing IO requests and attaching the IO request to be processed to the merged dependency chain.
[0082] It should be noted that the existing IO requests in the aggregation queue may be the original IO requests or the merged IO requests obtained after merging.
[0083] S203, in response to the delivery instruction, the target IO request sequence in the aggregation queue is delivered to the corresponding execution window, and the aggregation strategy for determining the IO requests to be processed is stopped; the delivery instruction is generated based on the current load of the execution window and the concurrent execution range of the IO requests in the execution window.
[0084] In this embodiment, the aggregation decision component can generate a delivery instruction based on the current load of the execution window and the concurrent execution range of the IO requests within the execution window, and then send the delivery instruction to the IO aggregator. When the IO aggregator receives the delivery instruction, in response to the instruction, it determines the target IO request sequence that meets the delivery conditions from the aggregation queue, and delivers the target IO request sequence to the corresponding execution window in one go. The execution window then sends the IO requests to the underlying storage device for actual execution. At the same time, the IO aggregator stops determining the aggregation strategy for the IO requests to be processed, that is, it suspends the operation of inserting the IO requests to be processed into the aggregation queue.
[0085] For example, the current load of the execution window refers to the number of IO requests being executed in the execution window, and the concurrent execution range includes the lower limit and the upper limit of IO concurrent execution.
[0086] In this embodiment, the aggregation queue is adaptively determined according to the storage medium type, and IO requests are dynamically merged based on the address range. At the same time, the delivery indication is generated based on the real-time load and concurrent execution range of the execution window, so that the aggregation termination can be dynamically triggered based on the actual processing capacity of the execution window. This prevents timeouts due to idle waiting under low load and avoids queuing caused by premature delivery under high load, thereby effectively balancing aggregation benefits and IO latency, and thus improving the overall performance of the storage system.
[0087] In an exemplary embodiment, S202 above includes the following steps:
[0088] The existing IO requests are traversed sequentially from the tail to the head of the aggregation queue. Based on the first address range of the IO request to be processed, the second address range of the existing IO requests, and the storage medium type of the IO request to be processed, the aggregation strategy of the IO request to be processed is determined.
[0089] For example, upon receiving a new I / O request to be processed, the existing I / O requests in the aggregation queue can be traversed one by one from the tail of the queue. For each existing I / O request that has been traversed, the second address range of the existing I / O request can be obtained. The first address range of the I / O request to be processed is compared with the second address range, and combined with the storage medium type corresponding to the I / O request to be processed, it is determined whether the I / O request to be processed can be merged with the existing I / O request that has been traversed, or whether the existing I / O request should be skipped and the traversal should continue.
[0090] Optionally, the pending I / O requests can be merged with the currently traversed existing I / O requests to determine the aggregation strategy for the pending I / O requests, and the traversal can be stopped. Alternatively, after the traversal is complete, the pending I / O requests can be directly inserted into the aggregation queue as independent I / O requests to determine the aggregation strategy for the pending I / O requests. Or, after the traversal is complete, the pending I / O requests can be merged with multiple existing I / O requests to determine the aggregation strategy for the pending I / O requests.
[0091] In this embodiment, by traversing existing IO requests from the tail to the head of the aggregation queue and determining the aggregation strategy based on the storage medium type, the newly enqueued IO requests can be processed first, shortening the aggregation decision path. At the same time, by dynamically selecting the aggregation strategy based on the storage medium type, the aggregation effect is optimized, and CPU consumption and aggregation latency are reduced.
[0092] In an exemplary embodiment, in a mechanical hard disk drive scenario, determining the aggregation strategy for the IO request to be processed based on a first address range of the IO request to be processed, a second address range of existing IO requests, and the storage medium type of the IO request to be processed may include any of the following:
[0093] If the first address range is completely covered by the second address range, the pending I / O request is added to the dependency chain of existing I / O requests, and the traversal is terminated.
[0094] Optionally, if the first address range of the I / O request to be processed falls entirely within the second address range of the existing I / O requests currently being traversed, it indicates that the data range corresponding to the I / O request to be processed has been completely contained by the existing I / O requests. In this case, it is only necessary to attach the I / O request to be processed to the dependency chain of the existing I / O request. Furthermore, since the first address range has been covered, there is no possibility that the I / O request to be processed will be merged with other existing I / O requests that were enqueued earlier. Therefore, the traversal is terminated, and earlier I / O requests are no longer examined.
[0095] If the first address range and the second address range do not overlap, and the interval between the first address range and the second address range exceeds a preset interval threshold, then skip the existing IO request and continue to traverse the next existing IO request.
[0096] Optionally, if the first address range of the IO request to be processed is completely independent of the second address range of the existing IO request currently being traversed, that is, there is no overlap between the two address ranges, and the address interval between the two is greater than a preset interval threshold, it indicates that the IO request to be processed and the existing IO request currently being traversed are far apart in address. Merging them will not benefit the reduction of hard disk seek time. Therefore, the IO request to be processed and the existing IO request currently being traversed will not be merged. The existing IO request currently being traversed will be skipped, and the next existing IO request in the aggregation queue will continue to be traversed forward.
[0097] If the first address range overlaps with the second address range, or the second address range is completely covered by the first address range, or the interval between the first address range and the second address range does not exceed the preset interval threshold, then the existing IO request is marked as an IO request to be merged, and the next existing IO request of the existing IO request is traversed until the traversal is completed. Then, the dependency chains of each IO request to be merged are merged into a new dependency chain, and the IO request to be processed is added to the new dependency chain.
[0098] Optionally, when the first address range of the I / O request to be processed partially overlaps with the second address range of the currently traversed existing I / O request, or when the second address range of the existing I / O request falls entirely within the first address range of the I / O request to be processed, or when the first address range of the I / O request to be processed and the second address range of the currently traversed existing I / O request are independent but the interval does not exceed a preset interval threshold, it indicates that the existing I / O request and the I / O request to be processed have the possibility of being merged in terms of address. The existing I / O request can be marked as an I / O request to be merged, and then the process continues to traverse the next existing I / O request in the aggregation queue. After traversing all existing I / O requests in the aggregation queue, the dependency chains corresponding to all existing I / O requests marked as I / O requests to be merged are merged into a new dependency chain, and the I / O request to be processed is added to this new dependency chain. Simultaneously, the address ranges of all I / O requests to be merged are superimposed with the first address range of the I / O request to be processed to obtain a new merged address range, which is used as the address range of the new merged request, and the address gaps are filled with reserved pages.
[0099] In this embodiment of the application, the comparison and merging strategy is further refined for the mechanical hard disk drive (HDD) scenario. By judging whether the address coverage, overlap, and interval exceed the threshold, operations such as terminating traversal, skipping, or marking to be merged are performed respectively, and finally multiple dependency chains are merged into a new dependency chain. This can aggregate multiple small requests into consecutive large requests, effectively reducing the number of seek times and latency of the HDD. At the same time, by avoiding invalid comparisons, the computational overhead is reduced, thereby improving the IO performance and resource utilization in the HDD scenario.
[0100] In an exemplary embodiment, in a solid-state drive (SSD) scenario, determining the aggregation strategy for the IO request to be processed based on a first address range of the IO request to be processed, a second address range of existing IO requests, and the storage medium type of the IO request to be processed may include any of the following:
[0101] If the first address range is completely covered by the second address range, the pending I / O request is added to the dependency chain of existing I / O requests, and the traversal is terminated.
[0102] Optionally, when the first address range of the pending IO request falls entirely within the second address range of the currently traversed existing IO requests, it indicates that the data range corresponding to the pending IO request has been completely contained by the existing IO request. In this case, the pending IO request can be attached to the dependency chain of the existing IO request. Since it is not necessary to force the merging of requests with similar addresses into a single large request in the case of solid-state drive scenarios, the traversal is terminated directly when the first address range is covered, and the traversal of existing IO requests is no longer continued.
[0103] If the second address range is completely covered by the first address range, the IO request to be processed is added to the dependency chain of existing IO requests, the second address range is replaced based on the first address range, and the traversal is terminated.
[0104] Optionally, when the second address range of the existing IO request being traversed falls completely within the first address range of the IO request to be processed, it indicates that the data range of the IO request to be processed includes the data range of the existing IO request. In this case, the IO request to be processed is attached to the dependency chain of the existing IO request, and the original second address range of the existing IO request is replaced with the first address range to expand the address range represented by the existing IO request, and then the traversal is terminated.
[0105] In this embodiment of the application, the comparison and merging strategy is further refined for solid-state drive scenarios. If a new request is covered by an existing request, it is directly added to the dependency chain and the traversal is terminated. If an existing request is covered by a new request, the address range is updated and added to the dependency chain. This can reduce unnecessary address comparisons and reduce CPU overhead. At the same time, it avoids forcibly merging a large number of requests with similar but independent addresses into a single large request, thereby giving full play to the advantages of multi-channel parallel processing of solid-state drives and improving overall throughput.
[0106] Reference Figure 3 , Figure 3 This is a flowchart illustrating a method for determining an address range according to an embodiment of this application. In an exemplary embodiment, the method further includes the following steps:
[0107] S301, the first original address range of the IO request to be processed is extended according to sector alignment to obtain the first address range corresponding to the IO request to be processed.
[0108] In this embodiment, after receiving an I / O request to be processed, a first original address range of the I / O request can be obtained. Since the start and end addresses of the first original address range may not be aligned with the sector boundaries of the storage medium, directly using the original address range for address comparison may cause adjacent or overlapping I / O requests to be misjudged as discontinuous, thus affecting the accuracy of the aggregation strategy. Therefore, the first original address range can be aligned and extended according to the sector size to obtain the first address range corresponding to the I / O request to be processed.
[0109] For example, the starting address of the first original address range can be aligned to the nearest sector start boundary, and the ending address of the first original address range can be aligned to the nearest sector end boundary. The expanded address range is then used as the first address range corresponding to the IO request to be processed.
[0110] S302, the second original address range of each existing IO request is extended according to sector alignment to obtain the second address range corresponding to each existing IO request.
[0111] For example, for each existing IO request in the aggregation queue, the second original address range of the existing IO request can be obtained, and then the starting address of the second original address range can be aligned to the nearest sector start boundary, and the ending address of the second original address range can be aligned to the nearest sector end boundary. The expanded address range is used as the second address range corresponding to the existing IO request.
[0112] It should be noted that the address expansion for existing IO requests can be pre-completed and stored when the IO request is enqueued, or it can be calculated in real time each time the address is compared with a new IO request to be processed.
[0113] In this embodiment, the original address range of the IO request to be processed and the existing IO request is expanded by sector alignment, so that subsequent address comparisons are performed on a unified sector boundary. This avoids adjacent or overlapping IO requests being misjudged as discontinuous due to address misalignment, thereby improving the accuracy of the aggregation strategy.
[0114] Reference Figure 4 , Figure 4 This is a flowchart illustrating a delivery instruction generation method provided in an embodiment of this application. In an exemplary embodiment, the method further includes the following steps:
[0115] S401, if the current load is not greater than the lower limit of IO concurrent execution, a first delivery instruction is generated; the first delivery instruction is used to indicate the termination of the aggregation operation to deliver IO requests and to trigger the aggregation processing of existing IO requests in the aggregation queue again after the current delivery is completed.
[0116] In this embodiment, the current load of the execution window, i.e., the number of IO requests currently being executed in the execution window, can be obtained in real time. If the current load is not greater than the lower limit of IO concurrent execution, it indicates that the current execution window is relatively idle, and the number of concurrently executed IO requests can be increased. In this case, a first delivery instruction is generated to instruct the IO aggregator to immediately terminate the current aggregation operation, deliver the IO requests in the aggregation queue to the execution window for execution, and immediately trigger the aggregation processing of the existing IO requests in the aggregation queue again after this delivery is completed. That is to say, when the system processing capacity is sufficient, not only should the aggregated IO requests be delivered, but more IO requests should also be attempted to be aggregated after the delivery is completed, so as to make full use of the system's idle processing capacity to accelerate IO processing and improve throughput.
[0117] S402, if the current load is greater than the lower limit of IO concurrent execution and less than the upper limit of IO concurrent execution, a second delivery instruction is generated; the second delivery instruction is used to indicate the termination of the aggregation operation and the delivery of the IO request.
[0118] In this embodiment, if the current load of the execution window is greater than the lower limit of concurrent IO execution but less than the upper limit of concurrent IO execution, it indicates that the current IO processing capacity of the system is within the normal working range, and increasing the number of concurrent IO executions will not cause system overload. In this case, a second delivery instruction is generated to instruct the IO aggregator to terminate the current aggregation operation and deliver the IO requests in the aggregation queue to the execution window for execution. However, after this delivery is completed, a new round of aggregation processing will not be triggered immediately.
[0119] It should be noted that if the current load is greater than or equal to the IO concurrent execution limit, no delivery instruction will be generated, and the IO aggregator will continue to maintain the aggregation state without performing delivery operations. This is because the execution window is already full or overloaded at this time, and even if the IO request is delivered, it will be queued and wait at the underlying level. It is better to leave it in the aggregation queue to continue aggregation to achieve a better aggregation effect.
[0120] Optionally, the upper limit of I / O concurrency can be calculated as follows: Set the initial default value of the upper limit of I / O concurrency to the maximum value, and dynamically adjust it gradually based on actual performance data during system operation. When an I / O request completes and exits the execution window, the execution time of that I / O request can be statistically analyzed, and the real-time load of the execution window at that time can be recorded, thus forming historical data for analyzing system performance. After accumulating a certain amount of historical data, if a segment is found where the I / O execution time and real-time load exhibit a linear growth relationship, then the real-time load value at the bottom of that linear segment is multiplied by 120%, and this is used as the new value for the upper limit of I / O concurrency. In addition, changes in real-time load can be continuously monitored: if the real-time load remains near the current IO execution concurrency limit for a long time, and the statistical IO execution time is significantly increased compared to the normal execution time corresponding to the limit value, it indicates that the current limit setting is too high, causing IO request queuing and blocking. The limit value needs to be gradually lowered. At this time, the new lower IO execution concurrency limit is calculated and determined according to the aforementioned linear segment analysis method. Conversely, if the real-time load remains near the IO execution concurrency limit, but the statistical IO execution time is significantly reduced compared to the normal execution time corresponding to the current value, it indicates that the system still has spare processing capacity and can withstand higher concurrency. The limit value needs to be gradually increased. Similarly, the new higher IO execution concurrency limit is calculated and determined according to the aforementioned linear segment analysis method.
[0121] Optionally, the lower limit of I / O concurrency can be calculated as follows: The initial default value of the lower limit of I / O concurrency can be set to 0, and then dynamically adjusted gradually based on actual performance data during system operation. This adjustment is based on the same set of historical data as the upper limit of I / O concurrency. After accumulating a certain amount of historical data, if a segment is found where the real-time load is significantly lower than the current upper limit of I / O concurrency, and the corresponding I / O execution time does not change much regardless of fluctuations in the real-time load within this segment, it indicates that the system's processing capacity is not yet saturated within this load range, and increasing the concurrent load will not significantly affect the I / O completion time. In this case, the highest real-time load value in this segment is multiplied by 90% as the new value of the lower limit of I / O concurrency. In addition, changes in real-time load can be continuously monitored and dynamically adjusted accordingly: If the real-time load remains below the current lower limit of IO execution concurrency for an extended period, but the statistically recorded IO execution time is significantly increased compared to the normal execution time corresponding to this lower limit, it indicates that the current lower limit may be set too high, causing the system to wait for aggregation even under low load, thus increasing latency. Therefore, the lower limit needs to be gradually lowered, i.e., a new, lower IO execution concurrency lower limit needs to be recalculated and determined based on the linear segment analysis method in the historical data mentioned above. Conversely, if the real-time load remains above the current lower limit of IO execution concurrency, but the statistically recorded IO execution time is not significantly different from the normal execution time corresponding to the current value, it indicates that the system can still maintain good responsiveness at this load level and can withstand higher concurrency. Therefore, the lower limit needs to be gradually increased, and a new, higher IO execution concurrency lower limit needs to be recalculated and determined based on historical data.
[0122] In this embodiment, different delivery instructions are generated by comparing the real-time load with the lower and upper limits of IO concurrent execution. When the load is below the lower limit, a first delivery instruction is generated, which indicates that aggregation will be triggered again after delivery, so as to make full use of idle processing capacity to accelerate IO processing. When the load is between the upper and lower limits, a second delivery instruction is generated, which indicates that aggregation will be terminated and delivery will be made, thereby flexibly balancing aggregation benefits and response speed, and improving the system's adaptability and overall performance.
[0123] Reference Figure 5 , Figure 5 This is a flowchart illustrating a request delivery method provided in an embodiment of this application. This embodiment relates to a possible implementation of how to deliver a target IO request sequence in an aggregation queue to the corresponding execution window in response to a delivery instruction. In an exemplary embodiment, the above-described S203 includes the following steps:
[0124] S501, in response to the delivery instruction, determines the target sequence length based on the length of the aggregation queue, the single delivery limit, and the remaining concurrent capacity of the execution window.
[0125] For example, the length of the aggregation queue is the total number of existing IO requests in the current aggregation queue; the single delivery limit is the maximum number of IO requests that a single delivery operation can handle. Exceeding this value will significantly increase the time consumed by the IO delivery action, which may cause thread blocking and scheduling misalignment; the remaining concurrent capacity of the execution window is the difference between the IO concurrent execution limit of the execution window and the current load, indicating the number of IO requests that the execution window can still accommodate.
[0126] In this embodiment, the minimum value among the length of the aggregation queue, the single delivery limit, and the remaining concurrent capacity can be determined as the target sequence length. This ensures that the target sequence length does not exceed the number of available requests in the queue, guaranteeing that there is IO available for delivery; it also does not exceed the single delivery limit, avoiding thread blocking due to excessive delivery at one time; and it does not exceed the remaining concurrent capacity, preventing IO from still queuing and waiting after delivery to the underlying layer.
[0127] Optionally, the single delivery limit can be determined as follows: Set the initial value of the single delivery limit to a maximum value, and adjust it according to the environment during system operation. When an IO request exits the aggregation queue and enters the execution window, record the IO delivery time and the corresponding number of delivered IOs. If both the IO delivery time and the number of delivered IOs are significantly higher than other data, then take the minimum of the number of delivered IOs and the current single delivery limit as the new single delivery limit.
[0128] S502: Based on the target sequence length and the enqueue time of each IO request in the aggregation queue, determine the target IO request sequence from the aggregation queue and submit the target IO request sequence to the execution window.
[0129] For example, suppose the target sequence length is N. In this embodiment, a subsequence of length N can be selected from the aggregated queue as the target IO request sequence based on the enqueue time of each IO request in the aggregated queue.
[0130] After determining the target IO request sequence, the IO requests in the target IO request sequence can be dequeued from the aggregation queue, the interface of the IO executor can be called, N IO requests can be delivered to the executor at once, and these N IO requests can be moved into the execution window to wait for the notification of IO execution completion.
[0131] In this embodiment, by combining the length of the aggregation queue, the upper limit of a single delivery, and the remaining concurrent capacity of the execution window to determine the length of the target sequence, the number of IOs delivered each time can be precisely controlled. This avoids excessive delivery leading to blocking of delivery actions or queuing at the underlying level, and also avoids under-delivery wasting transmission resources. At the same time, the target sequence is selected from the aggregation queue based on the enqueue time, ensuring that the earliest arriving IO request is delivered first, preventing some requests from remaining in the queue for a long time. While ensuring delivery efficiency and system stability, the principle of fairness is taken into account, and the robustness of IO aggregation is enhanced.
[0132] Reference Figure 6 , Figure 6 This is a flowchart illustrating a method for determining a target IO request sequence according to an embodiment of this application. This embodiment relates to a possible implementation of determining a target IO request sequence from an aggregated queue based on the target sequence length and the enqueue time of each IO request in the aggregated queue. In an exemplary embodiment, the above-described S502 includes the following steps:
[0133] S601 identifies multiple candidate IO request sequences from the aggregate queue.
[0134] For each candidate IO request sequence, the length of the candidate IO request sequence is equal to the length of the target sequence, and the candidate IO request sequence contains the earliest enqueued IO request; each candidate IO request sequence includes the original IO request and / or the merged IO request.
[0135] In this embodiment, after determining the target sequence length N, the subsequence containing the earliest enqueued IO request in the aggregation queue and having a length of N is selected as the candidate IO request sequence.
[0136] It should be noted that the aforementioned merged I / O request is formed by combining multiple original I / O requests, and its internal dependency chain records all the merged original I / O requests. Therefore, each candidate I / O request sequence may consist entirely of original I / O requests, may contain merged I / O requests, or may contain both original I / O requests and merged I / O requests.
[0137] S602, the candidate IO request sequence with the largest number of original IO requests among multiple candidate IO request sequences is determined as the target IO request sequence.
[0138] In this embodiment, after determining multiple candidate IO request sequences, the number of original IO requests contained in each candidate IO request sequence can be counted, and the candidate IO request sequence containing the most original IO requests can be selected as the target IO request sequence from the multiple candidate IO request sequences.
[0139] Optionally, if a candidate IO request sequence contains a merged IO request, the actual number of original IO requests corresponding to the candidate IO request sequence should be the sum of the number of original IO requests attached to the dependency chain of the merged IO request and the number of other original IO requests in the candidate IO request sequence.
[0140] In this embodiment of the application, by limiting the target IO request sequence to include the earliest enqueued IO request, and selecting the sequence with the most original IO requests from multiple candidate sequences that meet the conditions for delivery, the aggregation efficiency and throughput are improved while avoiding some requests from waiting for a long time due to the merging rules.
[0141] The following will use a complete embodiment to illustrate... Figure 7 The overall implementation logic and beneficial effects of the performance data acquisition method proposed in this application are explained below:
[0142] like Figure 7 As shown, the IO aggregator comprises four core components: an aggregation queue, aggregation strategy customization, an execution window, and an aggregation decision component. Assuming the storage system contains both mechanical hard drives and solid-state drives (SSDs), the upper-layer application continuously sends multiple pending IO requests to the IO aggregator.
[0143] First, when multiple pending I / O requests arrive at the I / O aggregator, the aggregator assigns them to the corresponding aggregation queue based on the storage medium type of each pending I / O request. For each pending I / O request entering the aggregation queue, the I / O aggregator performs aggregation processing sequentially based on the processing order of each pending I / O request.
[0144] Taking a hard disk drive (HDD) aggregation queue as an example, when a new I / O request arrives, the I / O aggregator first obtains the first original address range of the I / O request and expands it according to sector alignment to obtain the first address range. Then, the I / O aggregator traverses the existing I / O requests in the queue from the tail to the head. For each existing I / O request currently being traversed, its second original address range is also expanded according to sector alignment to obtain the second address range, and the first address range is compared with the second address range. During the comparison, the aggregation strategy customization component provides corresponding comparison rules and merging rules based on the media characteristics of the HDD. If the first address range is completely covered by the second address range, the I / O request is added to the dependency chain of existing I / O requests, and the traversal terminates. If the first address range and the second address range do not overlap and the interval between them exceeds a preset interval threshold, the existing I / O request is skipped, and the traversal continues to the next existing I / O request. If the first address range and the second address range overlap, or the second address range is completely covered by the first address range, or the interval between them does not exceed the preset interval threshold, the existing I / O request is marked as an I / O request to be merged, and the traversal continues to the next existing I / O request. After completing the traversal, the dependency chains of all IO requests to be merged are merged into a new dependency chain, and the IO requests to be processed are added to the new dependency chain. At the same time, the address ranges of all IO requests to be merged are superimposed with the first address range of the new request to form a new address range after merging, and the address gaps are filled with reserved pages.
[0145] For pending I / O requests in the SSD aggregation queue, another set of comparison and merging rules is used: if the first address range is completely covered by the second address range, the request is added to the dependency chain of existing I / O requests and the traversal is terminated; if the second address range is completely covered by the first address range, the request is added to the dependency chain of existing I / O requests, the second address range is replaced by the first address range, and the traversal is terminated.
[0146] During the aggregation process described above, each time an IO request enters the aggregation queue, enters the execution window, or exits the execution window, it registers a corresponding event with the aggregation decision component. Based on the timing of these events, the aggregation decision component calculates or statistically analyzes the following key metrics in real time: the current load of the execution window, the aggregation queue length, the IO execution time, the IO delivery time, the upper limit of IO execution concurrency, the lower limit of IO execution concurrency, and the upper limit of a single delivery. The upper and lower limits of IO execution concurrency are dynamically adjusted based on the linear relationship between historical IO execution time and real-time load, while the upper limit of a single delivery is dynamically adjusted based on the relationship between historical IO delivery time and the number of deliveries.
[0147] Aggregation decisions are triggered when a new I / O request is sent to the aggregator or when an I / O request completes execution. Whenever an aggregation decision is triggered, the aggregation decision component obtains the current load of the execution window and compares it with the lower and upper limits of I / O execution concurrency. If the current load is greater than or equal to the upper limit of I / O execution concurrency, it indicates that the execution window is full or overloaded. Even if I / O requests in the aggregation queue are submitted, they will wait in the lower layer. Therefore, the aggregator continues to maintain the aggregation state and does not submit any requests. If the current load is not greater than the lower limit of I / O execution concurrency, it indicates that the system's processing capacity is relatively idle. At this time, a first submission instruction is generated, indicating to terminate the aggregation operation and submit the I / O request. Simultaneously, after this submission is completed, the aggregation decision is triggered again to fully utilize idle processing capacity. If the current load is between the lower and upper limits of I / O execution concurrency, a second submission instruction is generated, indicating to terminate the aggregation operation and submit the I / O request. However, after this submission is completed, no new round of aggregation is triggered.
[0148] Upon receiving the delivery instruction, the aggregator performs a termination aggregation operation. First, it determines the number N of IO requests to be delivered, where N is the minimum of the aggregation queue length, the single delivery limit, and the remaining concurrent capacity of the execution window. Then, it selects a subsequence of length N from the aggregation queue that contains the earliest enqueued IO request as a candidate target sequence, and chooses the sequence containing the most original IO requests from among these candidate sequences as the target IO request sequence. Finally, it dequeues the target IO request sequence from the aggregation queue and delivers it to the execution window all at once through the IO executor interface, moving these IO requests into the execution window to await completion. Once the IO requests have been completed at the lower level, the execution window receives a completion notification and, based on the dependency chain of each IO request, sends completion notifications to each original IO request on the dependency chain, informing the upper-layer application that their respective IO requests have been completed.
[0149] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.
[0150] Based on the same inventive concept, this application also provides a request processing apparatus for implementing the request processing method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more request processing apparatus embodiments provided below can be found in the limitations of the request processing method described above, and will not be repeated here.
[0151] In one exemplary embodiment, such as Figure 8 As shown, Figure 8 This is a structural block diagram of a request processing apparatus provided in an embodiment of this application. The apparatus includes:
[0152] The first determining module is used to determine the aggregation queue corresponding to each pending IO request based on the storage medium type corresponding to the multiple pending IO requests received.
[0153] The second determining module is used to determine the aggregation strategy of each pending IO request based on the processing order of each pending IO request, according to the first address range of the pending IO request and the second address range of existing IO requests in the aggregation queue, and insert the pending IO request into the aggregation queue based on the aggregation strategy.
[0154] The request delivery module is used to deliver the target IO request sequence in the aggregation queue to the corresponding execution window in response to the delivery instruction, and to stop determining the aggregation strategy for the IO requests to be processed; the delivery instruction is generated based on the current load of the execution window and the concurrent execution range of the IO requests in the execution window.
[0155] In one embodiment, the second determining module includes:
[0156] The first determining unit is used to traverse the existing IO requests sequentially from the tail to the head of the aggregation queue, and determine the aggregation strategy of the IO request to be processed based on the first address range of the IO request to be processed, the second address range of the existing IO requests, and the storage medium type of the IO request to be processed.
[0157] In one embodiment, when the storage medium type is a hard disk drive, the first determining unit includes any one of the following:
[0158] The first decision subunit is used to add the IO request to be processed to the dependency chain of existing IO requests and terminate the traversal if the first address range is completely covered by the second address range.
[0159] The second decision subunit is used to skip the existing IO request and continue to traverse the next existing IO request if the first address range and the second address range do not overlap and the interval between the first address range and the second address range exceeds a preset interval threshold.
[0160] The third decision subunit is used to mark existing IO requests as IO requests to be merged if the first address range overlaps with the second address range, or the second address range is completely covered by the first address range, or the interval between the first address range and the second address range does not exceed a preset interval threshold. Then, it continues to traverse the next existing IO request of the existing IO request until the traversal is completed, merges the dependency chains of each IO request to be merged into a new dependency chain, and adds the IO request to be processed to the new dependency chain.
[0161] In one embodiment, when the storage medium type is a solid-state drive, the first determining unit includes any one of the following:
[0162] The fourth decision subunit is used to add the IO request to be processed to the dependency chain of existing IO requests and terminate the traversal if the first address range is completely covered by the second address range.
[0163] The fifth decision subunit is used to add the IO request to be processed to the dependency chain of existing IO requests if the second address range is completely covered by the first address range, replace the second address range based on the first address range, and terminate the traversal.
[0164] In one embodiment, the device further includes:
[0165] The first extension module is used to extend the first original address range of the IO request to be processed according to sector alignment to obtain the first address range corresponding to the IO request to be processed.
[0166] The second extension module is used to extend the second original address range of each existing IO request according to sector alignment to obtain the second address range corresponding to each existing IO request.
[0167] In one embodiment, the delivery instruction includes a first delivery instruction or a second delivery instruction; the device further includes:
[0168] The first generation module is used to generate a first delivery instruction if the current load is not greater than the lower limit of IO concurrent execution. The first delivery instruction is used to indicate the termination of the aggregation operation to deliver IO requests and to trigger the aggregation processing of existing IO requests in the aggregation queue again after the current delivery is completed.
[0169] The second generation module is used to generate a second delivery instruction if the current load is greater than the lower limit of IO concurrent execution and less than the upper limit of IO concurrent execution; the second delivery instruction is used to indicate the termination of the aggregation operation and the delivery of the IO request.
[0170] In one embodiment, the request delivery module includes:
[0171] The second determining unit is used to determine the length of the target sequence in response to the delivery instruction, based on the length of the aggregation queue, the single delivery limit, and the remaining concurrent capacity of the execution window.
[0172] The request delivery unit is used to determine the target IO request sequence from the aggregate queue based on the target sequence length and the enqueue time of each IO request in the aggregate queue, and then deliver the target IO request sequence to the execution window.
[0173] In one embodiment, the second determining unit is specifically configured to, in response to a delivery instruction, determine the minimum of the length of the aggregation queue, the single delivery limit, and the remaining concurrent capacity as the target sequence length.
[0174] In one embodiment, the request delivery unit is specifically used to determine multiple candidate IO request sequences from the aggregation queue; wherein, for each candidate IO request sequence, the length of the candidate IO request sequence is equal to the length of the target sequence, and the candidate IO request sequence contains the earliest enqueued IO request; each candidate IO request sequence includes original IO requests and / or merged IO requests; the candidate IO request sequence containing the most original IO requests among the multiple candidate IO request sequences is determined as the target IO request sequence.
[0175] Each module in the aforementioned request processing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can invoke and execute the operations corresponding to each module.
[0176] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0177] Based on the storage medium type corresponding to the multiple pending IO requests received, determine the aggregation queue corresponding to each pending IO request;
[0178] Based on the processing order of each pending IO request, for each pending IO request, the aggregation strategy of the pending IO request is determined according to the first address range of the pending IO request and the second address range of the existing IO requests in the aggregation queue, and the pending IO request is inserted into the aggregation queue based on the aggregation strategy.
[0179] In response to the delivery instruction, the target IO request sequence in the aggregation queue is delivered to the corresponding execution window, and the aggregation strategy for determining the pending IO requests is stopped; the delivery instruction is generated based on the current load of the execution window and the concurrent execution range of the IO requests in the execution window.
[0180] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0181] The existing IO requests are traversed sequentially from the tail to the head of the aggregation queue. Based on the first address range of the IO request to be processed, the second address range of the existing IO requests, and the storage medium type of the IO request to be processed, the aggregation strategy of the IO request to be processed is determined.
[0182] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0183] If the first address range is completely covered by the second address range, the pending IO request is added to the dependency chain of existing IO requests, and the traversal is terminated.
[0184] If the first address range and the second address range do not overlap, and the interval between the first address range and the second address range exceeds the preset interval threshold, then skip the existing IO request and continue to traverse the next existing IO request after the existing IO request.
[0185] If the first address range overlaps with the second address range, or the second address range is completely covered by the first address range, or the interval between the first address range and the second address range does not exceed the preset interval threshold, then the existing IO request is marked as an IO request to be merged, and the next existing IO request of the existing IO request is traversed until the traversal is completed. Then, the dependency chains of each IO request to be merged are merged into a new dependency chain, and the IO request to be processed is added to the new dependency chain.
[0186] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0187] If the first address range is completely covered by the second address range, the pending IO request is added to the dependency chain of existing IO requests, and the traversal is terminated.
[0188] If the second address range is completely covered by the first address range, the IO request to be processed is added to the dependency chain of existing IO requests, the second address range is replaced based on the first address range, and the traversal is terminated.
[0189] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0190] The first original address range of the IO request to be processed is extended according to sector alignment to obtain the first address range corresponding to the IO request to be processed.
[0191] The second original address range for each existing IO request is extended according to sector alignment to obtain the second address range corresponding to each existing IO request.
[0192] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0193] If the current load is not greater than the lower limit of IO concurrent execution, a first delivery indication is generated; the first delivery indication is used to indicate the termination of the aggregation operation to deliver IO requests and to trigger the aggregation processing of existing IO requests in the aggregation queue again after the current delivery is completed.
[0194] If the current load is greater than the lower limit of IO concurrent execution but less than the upper limit of IO concurrent execution, a second delivery instruction is generated; the second delivery instruction is used to indicate the termination of the aggregation operation and the delivery of the IO request.
[0195] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0196] In response to the delivery instruction, the target sequence length is determined based on the length of the aggregation queue, the single delivery limit, and the remaining concurrency capacity of the execution window;
[0197] Based on the target sequence length and the enqueue time of each IO request in the aggregation queue, the target IO request sequence is determined from the aggregation queue and delivered to the execution window.
[0198] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0199] In response to the delivery instruction, the minimum of the length of the aggregation queue, the single delivery limit, and the remaining concurrent capacity is determined as the target sequence length.
[0200] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0201] Multiple candidate IO request sequences are identified from the aggregated queue; for each candidate IO request sequence, the length of the candidate IO request sequence is equal to the length of the target sequence, and the candidate IO request sequence contains the earliest enqueued IO request; each candidate IO request sequence includes the original IO request and / or the merged IO request.
[0202] The candidate IO request sequence with the highest number of original IO requests among multiple candidate IO request sequences is determined as the target IO request sequence.
[0203] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0204] Based on the storage medium type corresponding to the multiple pending IO requests received, determine the aggregation queue corresponding to each pending IO request;
[0205] Based on the processing order of each pending IO request, for each pending IO request, the aggregation strategy of the pending IO request is determined according to the first address range of the pending IO request and the second address range of the existing IO requests in the aggregation queue, and the pending IO request is inserted into the aggregation queue based on the aggregation strategy.
[0206] In response to the delivery instruction, the target IO request sequence in the aggregation queue is delivered to the corresponding execution window, and the aggregation strategy for determining the pending IO requests is stopped; the delivery instruction is generated based on the current load of the execution window and the concurrent execution range of the IO requests in the execution window.
[0207] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0208] The existing IO requests are traversed sequentially from the tail to the head of the aggregation queue. Based on the first address range of the IO request to be processed, the second address range of the existing IO requests, and the storage medium type of the IO request to be processed, the aggregation strategy of the IO request to be processed is determined.
[0209] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0210] If the first address range is completely covered by the second address range, the pending IO request is added to the dependency chain of existing IO requests, and the traversal is terminated.
[0211] If the first address range and the second address range do not overlap, and the interval between the first address range and the second address range exceeds the preset interval threshold, then skip the existing IO request and continue to traverse the next existing IO request after the existing IO request.
[0212] If the first address range overlaps with the second address range, or the second address range is completely covered by the first address range, or the interval between the first address range and the second address range does not exceed the preset interval threshold, then the existing IO request is marked as an IO request to be merged, and the next existing IO request of the existing IO request is traversed until the traversal is completed. Then, the dependency chains of each IO request to be merged are merged into a new dependency chain, and the IO request to be processed is added to the new dependency chain.
[0213] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0214] If the first address range is completely covered by the second address range, the pending IO request is added to the dependency chain of existing IO requests, and the traversal is terminated.
[0215] If the second address range is completely covered by the first address range, the IO request to be processed is added to the dependency chain of existing IO requests, the second address range is replaced based on the first address range, and the traversal is terminated.
[0216] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0217] The first original address range of the IO request to be processed is extended according to sector alignment to obtain the first address range corresponding to the IO request to be processed.
[0218] The second original address range for each existing IO request is extended according to sector alignment to obtain the second address range corresponding to each existing IO request.
[0219] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0220] If the current load is not greater than the lower limit of IO concurrent execution, a first delivery indication is generated; the first delivery indication is used to indicate the termination of the aggregation operation to deliver IO requests and to trigger the aggregation processing of existing IO requests in the aggregation queue again after the current delivery is completed.
[0221] If the current load is greater than the lower limit of IO concurrent execution but less than the upper limit of IO concurrent execution, a second delivery instruction is generated; the second delivery instruction is used to indicate the termination of the aggregation operation and the delivery of the IO request.
[0222] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0223] In response to the delivery instruction, the target sequence length is determined based on the length of the aggregation queue, the single delivery limit, and the remaining concurrency capacity of the execution window;
[0224] Based on the target sequence length and the enqueue time of each IO request in the aggregation queue, the target IO request sequence is determined from the aggregation queue and delivered to the execution window.
[0225] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0226] In response to the delivery instruction, the minimum of the length of the aggregation queue, the single delivery limit, and the remaining concurrent capacity is determined as the target sequence length.
[0227] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0228] Multiple candidate IO request sequences are identified from the aggregated queue; for each candidate IO request sequence, the length of the candidate IO request sequence is equal to the length of the target sequence, and the candidate IO request sequence contains the earliest enqueued IO request; each candidate IO request sequence includes the original IO request and / or the merged IO request.
[0229] The candidate IO request sequence with the highest number of original IO requests among multiple candidate IO request sequences is determined as the target IO request sequence.
[0230] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:
[0231] Based on the storage medium type corresponding to the multiple pending IO requests received, determine the aggregation queue corresponding to each pending IO request;
[0232] Based on the processing order of each pending IO request, for each pending IO request, the aggregation strategy of the pending IO request is determined according to the first address range of the pending IO request and the second address range of the existing IO requests in the aggregation queue, and the pending IO request is inserted into the aggregation queue based on the aggregation strategy.
[0233] In response to the delivery instruction, the target IO request sequence in the aggregation queue is delivered to the corresponding execution window, and the aggregation strategy for determining the pending IO requests is stopped; the delivery instruction is generated based on the current load of the execution window and the concurrent execution range of the IO requests in the execution window.
[0234] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0235] The existing IO requests are traversed sequentially from the tail to the head of the aggregation queue. Based on the first address range of the IO request to be processed, the second address range of the existing IO requests, and the storage medium type of the IO request to be processed, the aggregation strategy of the IO request to be processed is determined.
[0236] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0237] If the first address range is completely covered by the second address range, the pending IO request is added to the dependency chain of existing IO requests, and the traversal is terminated.
[0238] If the first address range and the second address range do not overlap, and the interval between the first address range and the second address range exceeds the preset interval threshold, then skip the existing IO request and continue to traverse the next existing IO request after the existing IO request.
[0239] If the first address range overlaps with the second address range, or the second address range is completely covered by the first address range, or the interval between the first address range and the second address range does not exceed the preset interval threshold, then the existing IO request is marked as an IO request to be merged, and the next existing IO request of the existing IO request is traversed until the traversal is completed. Then, the dependency chains of each IO request to be merged are merged into a new dependency chain, and the IO request to be processed is added to the new dependency chain.
[0240] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0241] If the first address range is completely covered by the second address range, the pending IO request is added to the dependency chain of existing IO requests, and the traversal is terminated.
[0242] If the second address range is completely covered by the first address range, the IO request to be processed is added to the dependency chain of existing IO requests, the second address range is replaced based on the first address range, and the traversal is terminated.
[0243] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0244] The first original address range of the IO request to be processed is extended according to sector alignment to obtain the first address range corresponding to the IO request to be processed.
[0245] The second original address range for each existing IO request is extended according to sector alignment to obtain the second address range corresponding to each existing IO request.
[0246] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0247] If the current load is not greater than the lower limit of IO concurrent execution, a first delivery indication is generated; the first delivery indication is used to indicate the termination of the aggregation operation to deliver IO requests and to trigger the aggregation processing of existing IO requests in the aggregation queue again after the current delivery is completed.
[0248] If the current load is greater than the lower limit of IO concurrent execution but less than the upper limit of IO concurrent execution, a second delivery instruction is generated; the second delivery instruction is used to indicate the termination of the aggregation operation and the delivery of the IO request.
[0249] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0250] In response to the delivery instruction, the target sequence length is determined based on the length of the aggregation queue, the single delivery limit, and the remaining concurrency capacity of the execution window;
[0251] Based on the target sequence length and the enqueue time of each IO request in the aggregation queue, the target IO request sequence is determined from the aggregation queue and delivered to the execution window.
[0252] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0253] In response to the delivery instruction, the minimum of the length of the aggregation queue, the single delivery limit, and the remaining concurrent capacity is determined as the target sequence length.
[0254] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0255] Multiple candidate IO request sequences are identified from the aggregated queue; for each candidate IO request sequence, the length of the candidate IO request sequence is equal to the length of the target sequence, and the candidate IO request sequence contains the earliest enqueued IO request; each candidate IO request sequence includes the original IO request and / or the merged IO request.
[0256] The candidate IO request sequence with the highest number of original IO requests among multiple candidate IO request sequences is determined as the target IO request sequence.
[0257] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0258] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0259] The above embodiments are merely illustrative of several implementation methods of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A request processing method, characterized in that, The method includes: Based on the storage medium type corresponding to the multiple pending IO requests received, determine the aggregation queue corresponding to each pending IO request; Based on the processing order of each pending IO request, for each pending IO request, an aggregation strategy for the pending IO request is determined according to the first address range of the pending IO request and the second address range of existing IO requests in the aggregation queue, and the pending IO request is inserted into the aggregation queue based on the aggregation strategy. In response to the delivery instruction, the target IO request sequence in the aggregation queue is delivered to the corresponding execution window, and the aggregation strategy for determining the IO requests to be processed is stopped; the delivery instruction is generated based on the current load of the execution window and the concurrent execution range of the IO requests in the execution window.
2. The method according to claim 1, characterized in that, The step of determining the aggregation strategy for the IO request to be processed based on the first address range of the IO request to be processed and the second address range of the existing IO requests in the aggregation queue includes: The existing IO requests are traversed sequentially from the tail to the head of the aggregation queue. Based on the first address range of the IO request to be processed, the second address range of the existing IO requests, and the storage medium type of the IO request to be processed, the aggregation strategy of the IO request to be processed is determined.
3. The method according to claim 2, characterized in that, When the storage medium type is a hard disk drive, determining the aggregation strategy for the IO request to be processed based on the first address range of the IO request to be processed, the second address range of the existing IO requests, and the storage medium type of the IO request to be processed includes any one of the following: If the first address range is completely covered by the second address range, then the IO request to be processed is added to the dependency chain of the existing IO requests, and the traversal is terminated; If the first address range and the second address range do not overlap, and the interval between the first address range and the second address range exceeds a preset interval threshold, then the existing IO request is skipped, and the next existing IO request is traversed. If the first address range overlaps with the second address range, or the second address range is completely covered by the first address range, or the interval between the first address range and the second address range does not exceed a preset interval threshold, then the existing IO request is marked as an IO request to be merged, and the next existing IO request of the existing IO request is traversed until the traversal is completed. Then, the dependency chains of each IO request to be merged are merged into a new dependency chain, and the IO request to be processed is added to the new dependency chain.
4. The method according to claim 2, characterized in that, When the storage medium type is a solid-state drive, determining the aggregation strategy for the IO request to be processed based on the first address range of the IO request to be processed, the second address range of the existing IO requests, and the storage medium type of the IO request to be processed includes any one of the following: If the first address range is completely covered by the second address range, then the IO request to be processed is added to the dependency chain of the existing IO requests, and the traversal is terminated; If the second address range is completely covered by the first address range, then the unprocessed IO request is added to the dependency chain of the existing IO requests, the second address range is replaced based on the first address range, and the traversal is terminated.
5. The method according to any one of claims 1-4, characterized in that, The method further includes: The first original address range of the IO request to be processed is extended according to sector alignment to obtain the first address range corresponding to the IO request to be processed. The second original address range of each existing IO request is extended according to sector alignment to obtain the second address range corresponding to each existing IO request.
6. The method according to any one of claims 1-4, characterized in that, The delivery instruction includes a first delivery instruction or a second delivery instruction; the method further includes: If the current load is not greater than the lower limit of IO concurrent execution, a first delivery indication is generated; the first delivery indication is used to indicate the termination of the aggregation operation to deliver IO requests and to trigger the aggregation processing of existing IO requests in the aggregation queue again after the current delivery is completed; If the current load is greater than the lower limit of IO concurrent execution and less than the upper limit of IO concurrent execution, a second delivery instruction is generated; the second delivery instruction is used to indicate the termination of the aggregation operation and the delivery of the IO request.
7. The method according to claim 1, characterized in that, The step of responding to the delivery instruction by delivering the target IO request sequence in the aggregation queue to the corresponding execution window includes: In response to the delivery instruction, the target sequence length is determined based on the length of the aggregation queue, the single delivery limit, and the remaining concurrency capacity of the execution window; Based on the target sequence length and the enqueue time of each IO request in the aggregation queue, the target IO request sequence is determined from the aggregation queue and delivered to the execution window.
8. The method according to claim 7, characterized in that, In response to the delivery instruction, the target sequence length is determined based on the length of the aggregation queue, the single delivery limit, and the remaining concurrency capacity of the execution window, including: In response to the delivery instruction, the minimum of the length of the aggregation queue, the single delivery limit, and the remaining concurrent capacity is determined as the target sequence length.
9. The method according to claim 7, characterized in that, The step of determining the target IO request sequence from the aggregated queue based on the target sequence length and the enqueue time of each IO request in the aggregated queue includes: Multiple candidate IO request sequences are determined from the aggregated queue; wherein, for each candidate IO request sequence, the length of the candidate IO request sequence is equal to the length of the target sequence, and the candidate IO request sequence contains the earliest enqueued IO request; each candidate IO request sequence includes the original IO request and / or the merged IO request; The candidate IO request sequence that contains the most original IO requests among the multiple candidate IO request sequences is determined as the target IO request sequence.
10. A request processing apparatus, characterized in that, The device includes: The first determining module is used to determine the aggregation queue corresponding to each of the multiple pending IO requests based on the storage medium type received. The second determining module is used to determine the aggregation strategy of each pending IO request based on the processing order of each pending IO request, according to the first address range of the pending IO request and the second address range of existing IO requests in the aggregation queue, and insert the pending IO request into the aggregation queue based on the aggregation strategy. The request delivery module is used to, in response to the delivery instruction, deliver the target IO request sequence in the aggregation queue to the corresponding execution window and stop determining the aggregation strategy for the IO requests to be processed; the delivery instruction is generated based on the current load of the execution window and the concurrent execution range of the IO requests in the execution window.
11. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 9.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 9.
13. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 9.
