IO scheduling optimization method and device based on hybrid load and computer equipment

By classifying and sorting I/O requests from mechanical hard drives, the problem of slow I/O response speed caused by the inability to distinguish data types in existing technologies is solved, and faster I/O response speed is achieved.

CN121722331APending Publication Date: 2026-03-24HUNAN TONGYOU FEIJI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-23
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

Existing I/O scheduling algorithms cannot distinguish data types, resulting in slow I/O response speeds.

Method used

The I/O requests from the hard disk are classified, and the number of I/O requests to be extracted for each type is calculated based on the maximum number of I/O processing and the weight ratio. The requests are then sorted and merged to form an I/O request scheduling queue before being sent to the hard disk.

Benefits of technology

It enables fine-grained priority control for different types of I/O requests, thereby improving I/O response speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121722331A_ABST
    Figure CN121722331A_ABST
Patent Text Reader

Abstract

The invention discloses an IO scheduling optimization method and device based on a hybrid load and computer equipment. The method comprises the following steps: acquiring different types of I / O requests from a request queue of a mechanical hard disk; classifying the different types of I / O requests to obtain classified I / O requests; calculating the extraction quantity of each type of I / O requests according to the maximum IO processing quantity of the mechanical hard disk and the weight ratio of each type of I / O requests; extracting the corresponding I / O requests from the classified I / O requests according to the calculated extraction quantity of each type of I / O requests; sorting and combining the extracted I / O requests to obtain an I / O request scheduling queue; and issuing the I / O request to the mechanical hard disk according to the I / O request scheduling queue, and waiting for response. According to the method, more refined priority control is achieved, rapid scheduling of IO of a small number of types is achieved, and the response speed of IO is greatly increased.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of I / O scheduling technology, specifically to an I / O scheduling optimization method, apparatus, and computer device based on mixed load. Background Technology

[0002] Hard disk drives (HDDs) remain the most commonly used data storage medium and are still widely used in servers and data centers. However, with the rapid development of artificial intelligence and big data applications, the requirements for storage performance and access latency are constantly increasing. Due to the limitations of their physical structure, especially the seek latency caused by the movement of the read / write head between different cylinders, HDDs have become a performance bottleneck in data transmission.

[0003] While solid-state drives (SSDs) offer significant advantages in speed and latency, their higher cost prevents them from completely replacing hard disk drives (HDDs) in the short term. Therefore, operating systems employ various mechanisms to optimize HDD data read / write efficiency, with the two most important strategies being caching and I / O scheduling algorithms. Caching reduces disk access by temporarily storing frequently accessed data in high-speed memory, while I / O scheduling reduces head movement by reordering I / O requests, thereby lowering seek time and improving overall performance.

[0004] In I / O scheduling algorithms, when the system initiates read / write requests to a hard disk drive (HDD), these I / O requests are not executed immediately but are temporarily stored in the corresponding hard disk device's request queue. Each HDD has its own independent request queue, and the I / O scheduler is responsible for maintaining the order of these queues to utilize I / O resources more efficiently and transform unordered I / O operations into ordered ones. Furthermore, the operating system must first determine the total number of I / O requests in the queue before scheduling can begin. The purpose of scheduling is to reduce disk rotation requirements, primarily achieved through merging and sorting.

[0005] Because each hard drive has its own request queue, which stores the data space to be read or written, a new request is compared with the requests in the queue before being placed in the queue. This checks whether the address to be read or written is adjacent to the current request in the queue. If they are adjacent, they are merged into one request; otherwise, they are sorted according to the disk's rotation direction.

[0006] Currently, commonly used I / O scheduling algorithms include: Completely Fair Queued Scheduler (CFQ), Deadline Scheduler, No Operations-Free Scheduler (NOOP), and Budget Fair Scheduler (BFQ). However, these I / O scheduling algorithms can only distinguish between read and write types, not data types. Therefore, they cannot achieve more granular priority control. If different types of I / O are mixed, a small number of I / O types cannot be scheduled quickly and can only be scheduled after a timeout by the Deadline Scheduler, which greatly affects the I / O response speed. Summary of the Invention

[0007] To address this issue, this application provides an I / O scheduling optimization method, apparatus, and computer device based on mixed load, in order to solve the problem that existing I / O scheduling algorithms cannot distinguish data types, resulting in slow I / O response speed.

[0008] To achieve the above objectives, this application provides the following technical solution:

[0009] Firstly, an I / O scheduling optimization method based on mixed load includes:

[0010] Step 1: Obtain different types of I / O requests from the request queue of the hard disk drive;

[0011] Step 2: Classify the different types of I / O requests to obtain the classified I / O requests;

[0012] Step 3: Calculate the number of I / O requests to be extracted for each type of I / O request based on the maximum number of I / O processing requests of the hard disk drive and the weight ratio of each type of I / O request;

[0013] Step 4: Extract the corresponding I / O requests from the categorized I / O requests based on the calculated number of I / O requests for each type;

[0014] Step 5: Sort and merge the retrieved I / O requests to obtain the I / O request scheduling queue;

[0015] Step 6: Send the I / O request to the hard disk drive according to the I / O request scheduling queue, and wait for the response.

[0016] Preferably, in step 2, when classifying different types of I / O requests, it is necessary to limit the number of I / O requests of each type.

[0017] Preferably, in step 2, the classification of different types of I / O requests is based on the initiating process ID or a rule set by the upper-layer application itself.

[0018] Preferably, in step 3, the maximum number of I / O operations of the hard disk is 256.

[0019] Preferably, in step 5, the retrieved I / O requests are sorted according to the LBA address written to the hard disk.

[0020] Secondly, an I / O scheduling optimization device based on mixed load includes:

[0021] The I / O request acquisition module is used to acquire different types of I / O requests from the request queue of the hard disk drive;

[0022] The I / O request classification module is used to classify different types of I / O requests to obtain the classified I / O requests;

[0023] The extraction quantity determination module is used to calculate the extraction quantity of each type of I / O request based on the maximum number of I / O processing operations of the mechanical hard disk and the weight ratio of each type of I / O request.

[0024] The I / O request extraction module is used to extract the corresponding I / O request from the classified I / O requests based on the calculated number of I / O requests for each type.

[0025] The sorting and merging module is used to sort and merge the retrieved I / O requests to obtain the I / O request scheduling queue;

[0026] The I / O request dispatch module is used to dispatch I / O requests to the mechanical hard disk according to the I / O request scheduling queue and wait for a response.

[0027] Thirdly, a computer device includes a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the steps of an I / O scheduling optimization method based on mixed load.

[0028] Fourthly, a computer-readable storage medium having a computer program stored thereon, the computer program, when executed by a processor, implementing the steps of an I / O scheduling optimization method based on mixed load.

[0029] Fifthly, a computer program product includes a computer program or instructions that, when executed by a processor, implement steps of a mixed-load-based I / O scheduling optimization method.

[0030] Compared with the prior art, this application has at least the following beneficial effects:

[0031] This application provides an I / O scheduling optimization method based on mixed load. It involves: obtaining different types of I / O requests from the request queue of a hard disk drive (HDD); classifying these I / O requests to obtain categorized I / O requests; calculating the extraction quantity of each type of I / O request based on the HDD's maximum I / O processing capacity and the weight ratio of each type; retrieving the corresponding I / O request from the categorized I / O requests based on the calculated extraction quantity; sorting and merging the retrieved I / O requests to obtain an I / O request scheduling queue; and then sending the I / O requests to the HDD according to the I / O request scheduling queue and waiting for a response. The method provided in this application modifies a single queue into queues of different types and rearranges them according to type and priority before sending them to the hard drive, achieving more granular priority control and enabling fast scheduling of a smaller number of I / O types, thus greatly improving the I / O response speed. Attached Figure Description

[0032] To more intuitively illustrate the prior art and this application, exemplary drawings are provided below. It should be understood that the specific shapes and structures shown in the drawings should not generally be regarded as limiting conditions for implementing this application; for example, based on the technical concept disclosed in this application and the exemplary drawings, those skilled in the art are able to easily make conventional adjustments or further optimizations to the addition / reduction / classification, specific shapes, positional relationships, connection methods, size ratios, etc. of certain units (components).

[0033] Figure 1 A flowchart of an I / O scheduling optimization method based on mixed load is provided in Embodiment 1 of this application;

[0034] Figure 2 This is a schematic diagram of an I / O scheduling optimization method based on mixed load provided in Embodiment 1 of this application. Detailed Implementation

[0035] The present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0036] In the description of this application: unless otherwise stated, "a plurality of" means two or more. The terms "first," "second," "third," etc., in this application are intended to distinguish the objects referred to and do not have any special meaning in terms of technical connotation (e.g., they should not be construed as an emphasis on importance or order). Expressions such as "including," "comprising," and "having" also mean "not limited to" (certain units, components, materials, steps, etc.).

[0037] The terms used in this application, such as "upper," "lower," "left," "right," and "middle," are generally used to indicate the general relative positional relationship for the purpose of intuitive understanding by referring to the accompanying drawings, and are not absolute limitations on the positional relationship in the actual product.

[0038] Example 1

[0039] Please see Figure 1 This embodiment provides an I / O scheduling optimization method based on mixed load. This method modifies a single queue into different types of queues and uses a scheduling method to ensure that different types of I / O have a fair scheduling opportunity before being assigned to disk. The method includes:

[0040] S1: Retrieve different types of I / O requests from the request queue of the hard disk drive;

[0041] For details, please refer to Figure 2 In this diagram, the two different squares represent different types of I / O. This method can also be applied to scenarios with more than two types of I / O; this embodiment uses two as examples. In real-world applications, the number of different types of I / O often varies greatly, for example, 1000:1 or even 10000:1. If existing solutions are used, it is difficult to schedule smaller numbers of I / O types, or scheduling may only be possible through deadline timeouts. However, the method provided in this embodiment can optimize I / O scheduling.

[0042] S2: Classify different types of I / O requests to obtain the classified I / O requests;

[0043] Specifically, this step categorizes the acquired I / O requests according to different types. The categorization can be based on the initiating process ID or rules set by the upper-layer application. However, the categorization is not simply a matter of separating different types of I / O; there is a limit to the number of requests that can be categorized. For example... Figure 2 In this system, the number of each type of IO is limited to 6, meaning that a maximum of 6 IOs of a certain type can be used at a time. This limit is added to prevent an imbalance in the number of IOs of a certain type from being too many.

[0044] S3: Calculate the number of I / O requests extracted for each type based on the maximum number of I / O processing operations of the hard disk drive and the weight ratio of each type of I / O request;

[0045] Specifically, this step extracts a corresponding number of I / O operations based on the maximum I / O processing capacity of the hard drive (enterprise-grade hard drives typically have a maximum I / O processing capacity of 256). The extracted number is calculated using a weighted method: if two types of I / O have the same weight, then 128 of each type are extracted; if one type of I / O has fewer than 128, then all are extracted; other weight coefficients are extracted based on the calculated number. In this embodiment, the weight coefficient represents priority; the higher the weight, the higher the priority.

[0046] S4: Extract the corresponding I / O request from the classified I / O requests based on the calculated number of I / O requests for each type;

[0047] S5: Sort and merge the retrieved I / O requests to obtain the I / O request scheduling queue;

[0048] Specifically, this step sorts and merges the retrieved I / Os based on their LBA addresses written to the hard drive. The LBA address is like a unique identification number for each data block on the hard drive, allowing the operating system to pinpoint its storage location.

[0049] S6: Distribute I / O requests to the hard disk according to the I / O request scheduling queue and wait for a response.

[0050] Specifically, this step involves sequentially sending the processed I / O to the hard disk drive and waiting for a response.

[0051] This embodiment provides an I / O scheduling optimization method based on mixed loads. For different types of mixed loads, the scheduling is rearranged according to type and priority, so as to maximize the performance of the hard disk while ensuring the latency of different types of I / O.

[0052] This application provides an I / O scheduling optimization method based on mixed load, which modifies a single queue into different types of queues, and then reorders them according to type and priority before sending them to the hard disk, achieving more refined priority control and realizing fast scheduling of a small number of I / O types, which greatly improves the I / O response speed.

[0053] Example 2

[0054] This embodiment provides an I / O scheduling optimization device based on mixed load, including:

[0055] The I / O request acquisition module is used to acquire different types of I / O requests from the request queue of the hard disk drive;

[0056] The I / O request classification module is used to classify different types of I / O requests to obtain the classified I / O requests;

[0057] The extraction quantity determination module is used to calculate the extraction quantity of each type of I / O request based on the maximum number of I / O processing operations of the mechanical hard disk and the weight ratio of each type of I / O request.

[0058] The I / O request extraction module is used to extract the corresponding I / O request from the classified I / O requests based on the calculated number of I / O requests for each type.

[0059] The sorting and merging module is used to sort and merge the retrieved I / O requests to obtain the I / O request scheduling queue;

[0060] The I / O request dispatch module is used to dispatch I / O requests to the mechanical hard disk according to the I / O request scheduling queue and wait for a response.

[0061] For details on the specific implementation of each module in a hybrid load-based I / O scheduling optimization device, please refer to the above description of the limitations of a hybrid load-based I / O scheduling optimization method, which will not be repeated here.

[0062] Example 3

[0063] This embodiment provides a computer device, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps of an I / O scheduling optimization method based on mixed load.

[0064] Example 4

[0065] This embodiment provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of an I / O scheduling optimization method based on mixed load.

[0066] Example 5

[0067] This embodiment provides a computer program product, including a computer program or instructions, which, when executed by a processor, implements the steps of a hybrid load-based I / O scheduling optimization method.

[0068] The technical features of the above embodiments can be combined in any way (as long as there is no contradiction in the combination of these technical features). For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described; these embodiments not explicitly written should also be considered to be within the scope of this specification.

Claims

1. A method for optimizing I / O scheduling based on mixed load, characterized in that, include: Step 1: Obtain different types of I / O requests from the request queue of the hard disk drive; Step 2: Classify the different types of I / O requests to obtain the classified I / O requests; Step 3: Calculate the number of I / O requests to be extracted for each type of I / O request based on the maximum number of I / O processing requests of the hard disk drive and the weight ratio of each type of I / O request; Step 4: Extract the corresponding I / O requests from the categorized I / O requests based on the calculated number of I / O requests for each type; Step 5: Sort and merge the retrieved I / O requests to obtain the I / O request scheduling queue; Step 6: Send the I / O request to the hard disk drive according to the I / O request scheduling queue, and wait for the response.

2. The I / O scheduling optimization method based on mixed load according to claim 1, characterized in that, In step 2, when classifying different types of I / O requests, it is necessary to limit the number of I / O requests of each type.

3. The I / O scheduling optimization method based on mixed load according to claim 1, characterized in that, In step 2, the classification of different types of I / O requests is based on the initiating process ID or rules set by the upper-layer application itself.

4. The I / O scheduling optimization method based on mixed load according to claim 1, characterized in that, In step 3, the maximum number of I / O operations for the hard disk drive is 256.

5. The I / O scheduling optimization method based on mixed load according to claim 1, characterized in that, In step 5, the retrieved I / O requests are sorted according to the LBA address written to the hard disk.

6. An I / O scheduling optimization device based on mixed load, characterized in that, include: The I / O request acquisition module is used to acquire different types of I / O requests from the request queue of the hard disk drive; The I / O request classification module is used to classify different types of I / O requests to obtain the classified I / O requests; The extraction quantity determination module is used to calculate the extraction quantity of each type of I / O request based on the maximum number of I / O processing operations of the mechanical hard disk and the weight ratio of each type of I / O request. The I / O request extraction module is used to extract the corresponding I / O request from the classified I / O requests based on the calculated number of I / O requests for each type. The sorting and merging module is used to sort and merge the retrieved I / O requests to obtain the I / O request scheduling queue; The I / O request dispatch module is used to dispatch I / O requests to the mechanical hard disk according to the I / O request scheduling queue and wait for a response.

7. 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 5.

8. 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 5.

9. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the method according to any one of claims 1 to 5.