Request processing method and apparatus, electronic device, and storage medium
By splitting non-full-strip I/O requests into full-strip and non-full-strip sub-requests and processing them separately using hardware and software processing units, the problem of low efficiency of non-full-strip requests in RAID cards is solved, achieving more efficient I/O processing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- JINAN MAIWEI INTELLIGENT TECHNOLOGY CO LTD
- Filing Date
- 2026-01-30
- Publication Date
- 2026-06-05
Smart Images

Figure CN122152227A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data storage technology, and in particular to request processing methods, apparatus, electronic devices and storage media. Background Technology
[0002] With the rapid development of big data and artificial intelligence technologies, data on the internet is becoming increasingly diverse. Enterprises commonly use storage services to manage this data. Redundant Array of Independent Disks (RAID) cards, as a crucial component of storage servers, enable batch management of hard drives. They provide storage services by creating RAID arrays and volumes on top of these arrays. In related technologies, RAID cards typically process input / output requests through hardware processing units.
[0003] However, for non-full-strip input / output requests, RAID cards in related technologies use software processing units for processing, which results in low processing efficiency. Summary of the Invention
[0004] This application provides a request processing method, apparatus, electronic device, and storage medium to at least solve the problem of low processing efficiency in RAID cards that use software processing units to process non-full-strip input / output requests in the related art.
[0005] This application provides a request processing method, including:
[0006] Obtain pending input / output requests; The input / output requests to be processed are parsed to determine the target volume, the starting address of the target logical block, and the number of target logical blocks; Based on the current volume information of the target volume, the starting address of the target logical block, and the number of target logical blocks, determine whether the input / output request to be processed is a full-strip input / output request; If the input / output request to be processed is not a full-strip input / output request, the input / output request to be processed is split into a first full-strip input / output sub-request and at least one first non-full-strip input / output sub-request based on the current volume information of the target volume, the starting address of the target logical block and the number of target logical blocks. The first full-strip I / O sub-request and the first non-full-strip I / O sub-request are sent to the independent disk redundant array card, so that the independent disk redundant array card can use the hardware processing unit to process the first full-strip I / O sub-request and use the software processing unit to process the first non-full-strip I / O sub-request.
[0007] This application also provides a request processing apparatus, including: The acquisition module is used to acquire input / output requests to be processed. The first determination module is used to parse the input / output requests to be processed and determine the target volume, the starting address of the target logical block, and the number of target logical blocks. The second determining module is used to determine whether the input / output request to be processed is a full-strip input / output request based on the current volume information of the target volume, the starting address of the target logical block, and the number of target logical blocks. The first splitting module is used to split the input / output request to be processed into a first full-strip input / output sub-request and at least one first non-full-strip input / output sub-request based on the current volume information of the target volume, the starting address of the target logical block and the number of target logical blocks when the input / output request to be processed is not a full-strip input / output request. The first sending module is used to send the first full-strip input / output sub-request and the first non-full-strip input / output sub-request to the independent disk redundant array card, so that the independent disk redundant array card can use the hardware processing unit to process the first full-strip input / output sub-request and use the software processing unit to process the first non-full-strip input / output sub-request.
[0008] This application also provides an electronic device, including: a memory for storing a computer program; and a processor for implementing the steps of any of the above-described request processing methods when executing the computer program.
[0009] This application also provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of any of the above-described request processing methods.
[0010] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the above-described request processing methods.
[0011] This application involves: acquiring a pending input / output request; parsing the pending input / output request to determine the target volume, the starting address of the target logical block, and the number of target logical blocks; determining whether the pending input / output request is a full-striped input / output request based on the current volume information of the target volume, the starting address of the target logical block, and the number of target logical blocks; if the pending input / output request is not a full-striped input / output request, splitting the pending input / output request into a first full-striped input / output sub-request and at least one first non-full-striped input / output sub-request based on the current volume information of the target volume, the starting address of the target logical block, and the number of target logical blocks; and sending the first full-striped input / output sub-request and the first non-full-striped input / output sub-request to a Redundant Array of Independent Disks (RAID) card, so that the RAID card processes the first full-striped input / output sub-request using a hardware processing unit and processes the first non-full-striped input / output sub-request using a software processing unit. By splitting a non-full-strip I / O request into a first full-strip I / O sub-request and at least one first non-full-strip I / O sub-request, the first full-strip I / O sub-request is processed by a hardware processing unit, and the first non-full-strip I / O sub-request is processed by a software processing unit. Since the processing efficiency of the hardware processing unit is higher than that of the software processing unit, the technical problem of low processing efficiency of RAID cards when using software processing units to process non-full-strip I / O requests can be solved, thereby achieving the technical effect of improving the processing efficiency of non-full-strip I / O requests. Attached Figure Description
[0012] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0013] Figure 1 This is a schematic diagram of the structure of a request processing system provided in an embodiment of this application; Figure 2 A flowchart illustrating a request processing method provided in an embodiment of this application; Figure 3 A schematic diagram of an input / output request to be processed, provided for an embodiment of this application; Figure 4 This is a schematic diagram illustrating the splitting of input / output requests to be processed, as provided in an embodiment of this application. Figure 5 A flowchart illustrating another request processing method provided in an embodiment of this application; Figure 6 A schematic diagram illustrating another input / output request to be processed, provided for an embodiment of this application; Figure 7 This is a schematic diagram illustrating another method for splitting input / output requests to be processed, as provided in an embodiment of this application. Figure 8 An interactive diagram for updating volume information provided in an embodiment of this application; Figure 9 A flowchart illustrating another request processing method provided in an embodiment of this application; Figure 10 This is a schematic diagram of the structure of a request processing device provided in an embodiment of this application; Figure 11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0014] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.
[0015] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.
[0016] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0017] Stripe Unit: The smallest unit on a single disk that performs a single data read or write operation.
[0018] Stripe: A collection of stripe cells at the same "location" on multiple disks within the same RAID group.
[0019] With the rapid development of big data and artificial intelligence technologies, data on the internet is becoming increasingly diverse, and the number of internet users has grown significantly, bringing huge traffic to internet companies. Enterprises typically use storage servers to manage this internet data. The number of storage servers in an enterprise can reach tens of thousands. RAID cards are a crucial component of storage servers. RAID cards can manage hard drives in batches, creating RAID arrays and volumes on top of the array to provide storage services. A well-created RAID array not only speeds up read and write speeds by striping data but also provides redundancy, ensuring data is not lost in the event of partial disk failure, and allowing for data recovery through redundancy algorithms. Because of these capabilities, RAID cards can be considered one of the most important components of a storage server. A RAID array is a redundant array composed of independent disks. It consists of many independent disks forming a large-capacity disk group, leveraging the additive effect of individual disks to improve the overall disk system performance. This technology divides data into many segments and stores them on various hard drives. A RAID card is a device that creates hardware RAID groups. By allowing multiple disks to access data in parallel, it improves data access speed and provides redundancy and error correction capabilities. A volume is a logical storage unit formed by combining multiple physical disk drives. It is a logical unit for host I / O access to data, composed of logical blocks, and is created based on a RAID array. In the NVMe (Non-Volatile Memory Express) protocol, it is called a namespace. The NVMe protocol is a specification that defines how host software communicates with non-volatile memory and is the industry standard for solid-state drives (SSDs).
[0020] In related technologies, RAID cards typically process input / output requests through hardware processing units. However, not all I / O requests can be processed by hardware processing units. For non-full-strip input / output requests, RAID cards in related technologies use software processing units, which results in lower processing efficiency.
[0021] Furthermore, for full-strip input / output requests, if some member disks of the target volume are not present, and the number of absent member disks is no more than the number of redundant disks in the corresponding RAID of the volume, then the software processing unit is used for processing, which results in low processing efficiency.
[0022] To address the aforementioned technical problems, embodiments of this application provide a request processing method, apparatus, electronic device, and storage medium. The request processing method includes: acquiring an input / output request to be processed; parsing the input / output request to be processed to determine a target volume, a target logical block start address, and a target logical block quantity; determining whether the input / output request to be processed is a full-striped input / output request based on the current volume information of the target volume, the target logical block start address, and the target logical block quantity; if the input / output request to be processed is not a full-striped input / output request, splitting the input / output request to be processed into a first full-striped input / output sub-request and at least one first non-full-striped input / output sub-request based on the current volume information of the target volume, the target logical block start address, and the target logical block quantity; and sending the first full-striped input / output sub-request and the first non-full-striped input / output sub-request to a redundant array of independent disks (RAID), so that the RAID uses a hardware processing unit to process the first full-striped input / output sub-request and a software processing unit to process the first non-full-striped input / output sub-request. By splitting a non-full-strip I / O request into a first full-strip I / O sub-request and at least one first non-full-strip I / O sub-request, the first full-strip I / O sub-request is processed by a hardware processing unit, and the first non-full-strip I / O sub-request is processed by a software processing unit. Since the processing efficiency of the hardware processing unit is higher than that of the software processing unit, the technical problem of low processing efficiency of RAID cards when using software processing units to process non-full-strip I / O requests can be solved, thereby achieving the technical effect of improving the processing efficiency of non-full-strip I / O requests.
[0023] The specific application environment architecture or specific hardware architecture on which the execution of the request processing method depends is described here.
[0024] The request processing method provided in this application embodiment is used to process input / output requests, such as... Figure 1The diagram shows the structure of the request processing system upon which this application is based. This system includes a host driver and a RAID card. The host driver includes a first volume context management module and a first I / O processing module. The first volume context management module receives volume information change information sent by the RAID card, and based on this change information, sends volume information query information to the RAID card. This allows the RAID card to retrieve the current volume information of each volume and receive and save this information. When the RAID card detects a change in any volume information, it sends the change information to the host driver. The first I / O processing module receives pending input / output requests (I / O requests) from the host. Combining the RAID card's hardware processing capabilities and the current volume information, it splits the I / O requests and distributes them to the RAID card for processing. Finally, it merges the processing results of the multiple sub-requests after splitting the I / O requests and returns them to the host. Specifically, the host driver acquires pending input / output requests; parses these requests to determine the target volume, the starting address of the target logical block, and the number of target logical blocks; based on the current volume information of the target volume, the starting address of the target logical block, and the number of target logical blocks, it determines whether the pending input / output request is a full-striped input / output request; if the pending input / output request is not a full-striped input / output request, based on the current volume information of the target volume, the starting address of the target logical block, and the number of target logical blocks, it splits the pending input / output request into a first full-striped input / output sub-request and at least one first non-full-striped input / output sub-request; and sends the first full-striped input / output sub-request and the first non-full-striped input / output sub-request to the RAID card, so that the RAID card uses its hardware processing unit to process the first full-striped input / output sub-request and its software processing unit to process the first non-full-striped input / output sub-request. The RAID card includes a second volume context management module and a second I / O processing module. The second volume context management module sends volume information change information to the host driver when it detects a change in any volume information. The second I / O processing module processes I / O requests distributed by the host driver.
[0025] Embodiments of this application provide a request processing method applied to the aforementioned host driver. Figure 2 This is a flowchart illustrating the request processing method provided in an embodiment of this application, as shown below. Figure 2 As shown, the request processing method includes the following steps: Step S201: Obtain the input / output request to be processed.
[0026] The pending input / output request is a standardized data packet conforming to the NVMe protocol. The pending input / output request takes the form of a Submission Queue Entry (SQE).
[0027] Step S202: Parse the input / output requests to be processed to determine the target volume, the starting address of the target logical block, and the number of target logical blocks.
[0028] The process involves parsing the I / O requests to be processed, determining the target volume to be accessed, the address of the first logical block to be accessed (i.e., the starting address of the target logical block), and the total number of consecutive logical blocks to be accessed (i.e., the number of target logical blocks).
[0029] Step S203: Based on the current volume information of the target volume, the starting address of the target logical block, and the number of target logical blocks, determine whether the input / output request to be processed is a full-strip input / output request.
[0030] Specifically, based on the current volume information of the target volume, the starting address of the target logical block, and the number of target logical blocks, it is determined whether the input / output request to be processed is a full-striped input / output request. The volume information includes detailed information such as the volume level, size, stripe size, and member disks.
[0031] A full-strip I / O request refers to an I / O request issued by the host whose corresponding logical block address range can completely hit one or more consecutive complete stripes, and which simultaneously meets two core conditions: the starting logical block address is strictly aligned with the stripe boundary, and the total number of logical blocks is a positive integer multiple of the number of logical blocks in a single stripe. The starting logical block address can be the starting address of the target logical block, and the total number of logical blocks can be the number of target logical blocks.
[0032] The range of logical block addresses (LBAs) is determined by the starting LBA (SLBA) and the number of logical blocks (NLBs).
[0033] Step S204: If the input / output request to be processed is not a full-strip input / output request, based on the current volume information of the target volume, the starting address of the target logical block, and the number of target logical blocks, the input / output request to be processed is split into a first full-strip input / output sub-request and at least one first non-full-strip input / output sub-request.
[0034] For example, Figure 3 A schematic diagram of an input / output request to be processed provided in an embodiment of this application, as shown below. Figure 3As shown, the input / output request to be processed is a write operation request from the host to volume A. The logical block to be written starts from SLBA and has a length of NLB. The RAID array where volume A is located is RAID5 A, consisting of four disks: disks A, B, C, and D. Each disk's horizontal cylinders form stripes, including stripe 0, stripe 1, ..., stripe n. Each stripe includes data blocks and parity blocks. For example, stripe 0 includes data blocks D0_0, D0_1, D0_2, and parity block P0, and so on. The range to be written to volume A by this input / output request is mapped to the disk space as follows: Figure 3 The gray area in RAID5 A.
[0035] It can be seen that the pending input / output requests are not full-strip input / output requests. Therefore, the stripes to be written by the pending input / output requests can be divided into two main categories: The first category is exemplified by stripes 1 and n, where the written data cannot fill the entire stripe. The second category is where the written data can fill the entire stripe. For write operations where the data can fill the entire stripe, the RAID card can directly process them using the hardware processing unit. For write operations where the data does not fill the entire stripe, the RAID card uses the software processing unit. In related technologies, this pending input / output request is processed by the software processing unit.
[0036] In this embodiment, the IO requests that the RAID card needs to process by the software processing unit are split into multiple IO requests, and processed by the RAID card hardware processing unit as much as possible.
[0037] Figure 4 This is a schematic diagram illustrating the splitting of input / output requests to be processed, as provided in an embodiment of this application. Figure 4 As shown, Figure 3 The input / output request to be processed is split into two non-full-strip I / O sub-requests and one full-strip I / O sub-request. The non-full-strip I / O sub-request writes a logical block starting at SLBA with a length of NLB1. The full-strip I / O sub-request writes a logical block starting at SLBA1 with a length of NLB2. The other non-full-strip I / O sub-request writes a logical block starting at SLBA2 with a length of NLB3. This splits the disk-mapped operation into two write I / O operations that do not fill the entire stripe and one write I / O operation that fills the entire stripe. The full-strip write operation handles a larger amount of I / O data and can be directly processed by the hardware processing unit.
[0038] It should be noted that the first full-strip I / O sub-request is a full-strip I / O request corresponding to at least one complete stripe. That is, the logical block address range of the first full-strip I / O sub-request exactly covers all logical blocks of at least one stripe, and satisfies two core conditions: the starting logical block address is aligned with the stripe boundary, and the number of logical blocks is a positive integer multiple of the number of logical blocks in a single stripe.
[0039] A non-full-strip I / O request refers to an I / O request that cannot completely hit one or more consecutive stripes, and does not simultaneously meet the two conditions of "the starting logic block address is aligned with the stripe boundary" and "the number of logic blocks is a positive integer multiple of the number of logic blocks in a single stripe".
[0040] Step S205: Send the first full-strip input / output sub-request and the first non-full-strip input / output sub-request to the independent disk redundant array card, so that the independent disk redundant array card can use the hardware processing unit to process the first full-strip input / output sub-request and use the software processing unit to process the first non-full-strip input / output sub-request.
[0041] The request processing method provided in this application splits a non-full-strip I / O request into a first full-strip I / O sub-request and at least one first non-full-strip I / O sub-request. The first full-strip I / O sub-request is processed by a hardware processing unit, and the first non-full-strip I / O sub-request is processed by a software processing unit. Since the processing efficiency of the hardware processing unit is higher than that of the software processing unit, this method can solve the technical problem in the related art where the processing efficiency of RAID cards using software processing units to process non-full-strip I / O requests is low, thus achieving the technical effect of improving the processing efficiency of non-full-strip I / O requests.
[0042] The increased number of I / O requests handled by the hardware processing unit enhances the stability and reliability of RAID card operation. Multiple I / O requests that can be processed by hardware can be processed in parallel on the RAID card, increasing the parallelism of data transmission.
[0043] Embodiments of this application provide a request processing method applied to the aforementioned host driver. Figure 5 This is a flowchart illustrating the request processing method provided in an embodiment of this application, as shown below. Figure 5 As shown, the request processing method includes the following steps: Step S501: Obtain the input / output request to be processed. For details, please refer to [link to relevant documentation]. Figure 2 Step S201 of the illustrated embodiment will not be described again here.
[0044] Step S502: Parse the input / output request to be processed to determine the target volume, the starting address of the target logical block, and the number of target logical blocks. For details, please refer to [link to relevant documentation]. Figure 2Step S202 of the illustrated embodiment will not be described again here.
[0045] Step S503: Based on the current volume information of the target volume, the starting address of the target logical block, and the number of target logical blocks, determine whether the input / output request to be processed is a full-strip input / output request. For details, please refer to [link to relevant documentation]. Figure 2 Step S203 of the illustrated embodiment will not be described again here.
[0046] Step S504: If the input / output request to be processed is not a full-strip input / output request, based on the current volume information of the target volume, the starting address of the target logical block, and the number of target logical blocks, the input / output request to be processed is split into a first full-strip input / output sub-request and at least one first non-full-strip input / output sub-request. For details, please refer to... Figure 2 Step S204 of the illustrated embodiment will not be described again here.
[0047] Step S505: Send the first full-strip input / output sub-request and the first non-full-strip input / output sub-request to the independent disk redundant array card, so that the independent disk redundant array card can use the hardware processing unit to process the first full-strip input / output sub-request and use the software processing unit to process the first non-full-strip input / output sub-request.
[0048] Specifically, step S505 includes: Step S5051: Based on the current volume information of the target volume, determine the in-place status of the member disks of the target volume.
[0049] In this context, the member disks of the target volume are the physical member disks of the RAID array corresponding to the target volume. The RAID array corresponding to the target volume is the RAID array to which the target volume belongs.
[0050] Step S5052: If at least one member disk of the target volume is in an in-place state, and the number of in-place member disks of the target volume is no more than the number of redundant disks in the independent disk redundant array corresponding to the target volume, then the first full stripe input / output sub-request is split into at least one third full stripe input / output sub-request. The third full stripe input / output sub-request is a full stripe input / output request corresponding to a single complete stripe, and the third full stripe input / output sub-request is a request not to operate on the in-place member disk.
[0051] The third full-strip input / output sub-request is a full-strip input / output request corresponding to a single complete stripe. That is, the logical block address range of the third full-strip input / output sub-request exactly covers all the logical blocks of a stripe and satisfies two core conditions: the starting logical block address of the request is the starting boundary address of the stripe, and the number of logical blocks requested is equal to the total number of logical blocks contained in a single stripe.
[0052] For example, Figure 6A schematic diagram of an input / output request to be processed provided in an embodiment of this application, as shown below. Figure 6 As shown, the input / output request to be processed is a write operation request from the host to volume B. The logical block to be written starts from SLBA and has a length of NLB. The RAID array where volume B is located is RAID5 B, consisting of four disks: disks A, B, C, and D. Each disk's horizontal cylinders form stripes, including stripe 0, stripe 1, ..., stripe n, etc. Each stripe includes data blocks and parity blocks. For example, stripe n includes data blocks Dn_0, Dn_1, Dn_2 and parity block Pn, and so on. The range to be written to volume B by this input / output request is mapped to the disk space as follows: Figure 6 The diagonal striped area in RAID 5 B. Specifically, disk D is not in its slot and therefore cannot perform I / O operations. Figure 6 The gray area is used to represent the middle part.
[0053] It can be seen that the pending input / output request is a full-strip input / output request. If disk D is present, the RAID card can process this pending input / output request using its hardware processing unit. However, since disk D is not present and cannot write data, the RAID card in related technologies cannot process this pending input / output request using its hardware processing unit. For I / O operations that only target disks present in the RAID array, the RAID card can utilize its hardware processing unit for processing.
[0054] In this embodiment, the IO requests that the RAID card needs to process by the software processing unit are split into multiple IO requests, and processed by the RAID card hardware processing unit as much as possible.
[0055] Figure 7 This is a schematic diagram illustrating the splitting of input / output requests to be processed, as provided in an embodiment of this application. Figure 7 As shown, Figure 6 The input / output request to be processed is shown to be split into two full-strip I / O sub-requests. One full-strip I / O sub-request writes a logical block starting at SLBA with a length of NLB1. The other full-strip I / O sub-request writes a logical block starting at SLBA1 with a length of NLB2. This ensures that operations mapped to the disk are not written to the non-present disk D, allowing the RAID card to directly process these two full-strip I / O sub-requests using its hardware processing unit. It should be noted that these two full-strip I / O sub-requests correspond to a single complete stripe of full-strip I / O requests.
[0056] Step S5053: The third full-strip input / output sub-request and the first non-full-strip input / output sub-request are sent to the independent disk redundant array card, so that the independent disk redundant array card can use the hardware processing unit to process the third full-strip input / output sub-request and use the software processing unit to process the first non-full-strip input / output sub-request.
[0057] The request processing method provided in this application embodiment, in the scenario of degraded volume (where some member disks are not present but the redundancy limit is not exceeded), avoids the absence of member disks by splitting the first full-strip IO into multiple third full-strip IOs corresponding to a single complete stripe. This allows the full-strip IOs that were originally not capable of hardware processing to adapt to the RAID card hardware capabilities, increasing the proportion of hardware processing; reducing software processing pressure; lowering IO processing latency; and ensuring the performance and stability of the storage system in the scenario of degraded volume.
[0058] In some optional implementations, the above request processing method further includes: Step a1: When the input / output request to be processed is a full-strip input / output request, determine the presence status of the member disks of the target volume based on the current volume information of the target volume.
[0059] Step a2: If at least one member disk of the target volume is in an in-place state, and the number of in-place member disks of the target volume is no more than the number of redundant disks in the independent disk redundant array corresponding to the target volume, then based on the current volume information of the target volume, the starting address of the target logical block, and the number of target logical blocks, the input / output request to be processed is split into at least one second full-strip input / output sub-request. The second full-strip input / output sub-request is a full-strip input / output request corresponding to a single complete stripe, and the second full-strip input / output sub-request is a request that does not operate on the in-place member disk.
[0060] Similar to the description of step S5052, it will not be repeated here.
[0061] Step a3: The second full-strip I / O sub-request is sent to the independent disk redundant array card so that the independent disk redundant array card can process the second full-strip I / O sub-request using the hardware processing unit.
[0062] The request processing method provided in this application embodiment, in the scenario of degraded volume (where some member disks are not present but have not exceeded the redundancy limit), avoids the absence of member disks by splitting the full-strip IO to be processed into multiple second full-strip IOs corresponding to a single complete stripe. This allows the full-strip IOs that were originally not capable of hardware processing to adapt to the hardware capabilities of the RAID card, thereby increasing the proportion of hardware processing; reducing software processing pressure; lowering IO processing latency; and ensuring the performance and stability of the storage system in the scenario of degraded volume.
[0063] In some optional implementations, the above request processing method further includes: Step b1: When the input / output request to be processed is a full-strip input / output request and the presence status of all member disks of the target volume is present, the input / output request to be processed is sent to the independent disk redundant array card so that the independent disk redundant array card can use the hardware processing unit to process the input / output request to be processed.
[0064] The request processing method provided in this application embodiment can directly reuse the hardware adaptation features of full-strip I / O when the input / output request to be processed is a full-strip I / O request and the in-place status of the member disks of the target volume is in place, without the need for additional splitting operations, thus reducing host driver overhead.
[0065] In some optional implementations, step S505 above includes: Step c1: Fill the target flag bit of the first full-strip I / O sub-request with a first identifier, and fill the target flag bit of the first non-full-strip I / O sub-request with a second identifier. The first identifier is used to indicate that the first full-strip I / O sub-request is processed by the hardware processing unit in the independent disk redundant array card, and the second identifier is used to indicate that the first non-full-strip I / O sub-request is processed by the software processing unit in the independent disk redundant array card.
[0066] Step c2: Send the first full-strip I / O sub-request and the second non-full-strip I / O sub-request to the Independent Redundant Array of Independent Disks (IRAD) so that the IAD determines to process the first full-strip I / O sub-request using a hardware processing unit based on the first identifier in the target flag bit of the first full-strip I / O sub-request; and determines to process the first non-full-strip I / O sub-request using a software processing unit based on the second identifier in the target flag bit of the first non-full-strip I / O sub-request.
[0067] The host driver carries an identifier in the I / O request to notify the RAID card whether the I / O request can be directly processed by the hardware processing unit. This uses a reserved field from the I / O request specification in the NVMe standard. Taking common read / write requests as an example: in write requests, bits 19-16 of the Command Data Word (CDW) are not used in the specification; in read requests, bits 25-16 of the CDW are not used in the specification. In this embodiment, bit 16 of the CDW is used to represent this identifier, where a value of 0 indicates that the I / O request cannot be directly processed by the hardware processing unit, and a value of 1 indicates that the I / O request can be directly processed by the hardware processing unit.
[0068] In other words, the target flag can be bit 16 of CDW12, the first flag can be 1, and the second flag can be 0.
[0069] The request processing method provided in this application specifies the IO processing method through a flag bit, allowing the RAID card to directly process traffic without additional judgment, thus reducing the decision-making overhead of the RAID card. The hardware processing unit accurately handles full-strip IO, while the software processing unit focuses on non-full-strip IO, realizing on-demand allocation of hardware and software resources and improving IO processing efficiency.
[0070] In some optional implementations, the above request processing method further includes: Step d1: Receive volume information change information sent by the independent disk redundant array card.
[0071] Step d2: Based on the volume information change information, send volume information query information to the independent disk redundant array card, so that the independent disk redundant array card can return the current volume information of each volume based on the volume information query information.
[0072] Step d3: Receive and save the current volume information for each volume.
[0073] Figure 8 An interactive diagram for updating volume information provided in an embodiment of this application, such as... Figure 8 As shown, the RAID card sends an Asynchronous Event Notification (AEN) message to the host driver when any volume information changes, to notify the host that the volume information has changed. Scenarios involving volume information changes include: volume creation, disk removal, disk read / write errors causing unavailability, and changes to volume member disk information caused by subsequent expansion and migration tasks.
[0074] In this embodiment, a new Asynchronous Event Information - Notice field of type 07h has been added to the Asynchronous Event Request command of the NVMe protocol. The definition of this type is shown in Table 1. When the RAID card detects a change in the volume context, i.e., a change in the volume information, it will send a notification to the host driver through this field, setting the field to 07h to explicitly inform that "Namespace Contexts Changed" (the volume context has changed).
[0075] Table 1
[0076] When the host detects a change in volume information, the host driver sends a vendor-defined volume query message to the RAID card. The RAID card returns detailed volume information, including the current volume information for each volume, which the host driver saves for subsequent I / O request splitting. The vendor-defined volume query message is generated based on the vendor-defined command SQE format.
[0077] Table 2 shows the vendor-defined command (SQE) format in the NVMe specification, which consists of 64 bytes and 16 command data words. The NVMe specification version 1.4c is used as an example (this application uses this specification version for illustration).
[0078] Table 2
[0079] As shown in Table 2, CDW10~CDW15 can be defined and used by the vendor, and CDW2~CDW3 are reserved fields that can also be defined and used by the vendor. CDW0~CDW9 follow the NVMe standard format. Table 3 shows the format of CDW0 in the vendor-defined command SQE in the NVMe specification.
[0080] Table 3
[0081] As shown in Table 3, the OPC field uses the value 0xC2 to represent the query command, the CDW10 field carries the length of DPTR, and the CDW12 field carries the volume ID to be queried. The RAID card controller fills the queried volume information into the DPTR field in the format of Type-Length-Value (TLV) and returns it to the host driver.
[0082] The host driver splits the IO requests based on the current volume information of each volume, specifically into IO requests that can be processed by the hardware processing unit and IO requests that need to be processed by the software processing unit. The SQE that issues the IO request carries an identification notification to the RAID card.
[0083] The request processing method provided in this application embodiment can detect changes in volume information in real time, ensure that IO splitting is based on the latest volume information, avoid processing anomalies, and ensure the stability of the storage system.
[0084] In some optional implementations, the above request processing method further includes: Step e1: If the input / output request to be processed is not a full-strip input / output request, receive the processing results of the first full-strip input / output sub-request and the first non-full-strip input / output sub-request returned by the independent disk redundant array card.
[0085] Step e2: Based on the processing results of the first full-strip input / output sub-request and the first non-full-strip input / output sub-request, determine the processing results of the first full-strip input / output sub-request and at least one first non-full-strip input / output sub-request corresponding to the input / output request to be processed.
[0086] Step e3: Combine the processing results of the first full-strip input / output sub-request corresponding to the input / output request to be processed with the processing results of at least one first non-full-strip input / output sub-request to obtain the processing result of the input / output request to be processed.
[0087] It is understandable that if the processing result of the first full-strip input / output sub-request corresponding to the input / output request to be processed and the processing result of at least one first non-full-strip input / output sub-request are both completed, the processing result of the input / output request to be processed is determined to be completed.
[0088] The processing result is in the form of a Completion Queue Entry (CQE).
[0089] In some optional implementations, the above request processing method further includes: Step f1: If the processing time of the pending input / output request exceeds the preset time and the pending input / output request has not been completed, then the processing result of the pending input / output request is determined to be a processing failure.
[0090] Step f2: If the processing result of the input / output request to be processed is a failure, return to the step of parsing the input / output request to be processed, so as to reprocess the input / output request to be processed.
[0091] Step f3: If the number of times the step of parsing the input / output request to be processed is returned exceeds the preset threshold, and the processing result of the input / output request to be processed is still a failure, then an alarm is issued.
[0092] The preset duration and preset number of times thresholds are set by technical personnel and are not specifically limited here.
[0093] The request processing method provided in this application avoids the loss of IO requests due to single processing timeouts, thereby improving data transmission reliability; it adapts to temporary anomalies (such as volume information synchronization delays or high instantaneous load on RAID cards) through a retry mechanism, reducing invalid alarms; it prevents infinite loops by setting a retry threshold, thereby reducing host driver resource consumption; and it provides timely feedback on persistent faults through an alarm mechanism, facilitating maintenance and troubleshooting (such as RAID card hardware anomalies or volume configuration errors).
[0094] Embodiments of this application provide a request processing method. Figure 9 This is a flowchart illustrating the request processing method provided in an embodiment of this application, as shown below. Figure 9 As shown, the request processing method includes the following steps: The first step involves the host driver on the host side calculating, based on the previously saved volume information, whether the I / O request to be processed is a full-striped I / O request. If it is, proceed to the second step. If not, based on the volume information, the I / O request to be processed is split into full-striped I / O requests and non-full-striped I / O requests.
[0095] The second step involves the host driver on the host side determining whether all member disks on the target volume corresponding to the IO request to be processed are in normal status. If so, proceed to the third step. Otherwise, the full-strip IO request is split into full-strip IO requests that will not operate on the abnormal member disks. It should be noted that the number of abnormal member disks should not exceed the number of redundant disks in the RAID array corresponding to the target volume.
[0096] The third step is for the host driver on the host side to send the split IO requests to the RAID card in sequence. For IO requests that can be directly processed by the hardware processing unit, fill the flag bit with 1.
[0097] Fourth, the RAID card checks if the flag bit of the current I / O request is 1. If it is 1, the hardware processing unit processes the current I / O request. If it is not 1, the software processing unit processes the current I / O request, and then returns the processing result of the I / O request to the host driver on the host side.
[0098] The fifth step involves the host driver on the host side merging the processing results of multiple split IO requests corresponding to the original IO request returned by the RAID card to obtain the processing result of the original IO request.
[0099] The request processing method provided in this application improves the efficiency of RAID card in processing IO requests by splitting IO requests in combination with the hardware processing capabilities of the RAID card.
[0100] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.
[0101] Embodiments of this application also provide a request processing apparatus, such as... Figure 10 As shown, the request processing device includes: The acquisition module 1001 is used to acquire input / output requests to be processed.
[0102] The first determining module 1002 is used to parse the input / output request to be processed and determine the target volume, the starting address of the target logical block, and the number of target logical blocks.
[0103] The second determining module 1003 is used to determine whether the input / output request to be processed is a full-strip input / output request based on the current volume information of the target volume, the starting address of the target logical block, and the number of target logical blocks.
[0104] The first splitting module 1004 is used to split the input / output request to be processed into a first full-strip input / output sub-request and at least one first non-full-strip input / output sub-request based on the current volume information of the target volume, the starting address of the target logical block and the number of target logical blocks when the input / output request to be processed is not a full-strip input / output request.
[0105] The first sending module 1005 is used to send the first full-strip input / output sub-request and the first non-full-strip input / output sub-request to the independent disk redundant array card, so that the independent disk redundant array card can use the hardware processing unit to process the first full-strip input / output sub-request and use the software processing unit to process the first non-full-strip input / output sub-request.
[0106] In some optional implementations, the request processing apparatus further includes: The third determination module is used to determine the presence status of the member disks of the target volume based on the current volume information of the target volume when the input / output request to be processed is a full-strip input / output request.
[0107] The second splitting module is used to split the input / output request to be processed into at least one second full-strip input / output sub-request if at least one member disk of the target volume is not in the in-situ state, and the number of member disks not in the in-situ of the target volume is no more than the number of redundant disks of the independent disk redundant array corresponding to the target volume, based on the current volume information of the target volume, the starting address of the target logical block and the number of target logical blocks. The second full-strip input / output sub-request is a full-strip input / output request corresponding to a single complete stripe, and the second full-strip input / output sub-request is a request that does not operate on the member disks not in the in-situ.
[0108] The second sending module is used to send the second full-strip input / output sub-request to the independent disk redundant array card, so that the independent disk redundant array card can process the second full-strip input / output sub-request using the hardware processing unit.
[0109] In some optional implementations, the request processing apparatus further includes: The third sending module is used to send the input / output request to be processed to the independent disk redundant array card when the input / output request to be processed is a full stripe input / output request and the in-situ status of the member disks of the target volume is in-situ, so that the independent disk redundant array card can use the hardware processing unit to process the input / output request to be processed.
[0110] In some alternative implementations, the first transmitting module 1005 includes: The determination unit is used to determine the presence status of member disks of the target volume based on the current volume information of the target volume.
[0111] The splitting unit is used to split the first full stripe input / output sub-request into at least one third full stripe input / output sub-request if at least one member disk of the target volume is in an in-place state and the number of in-place member disks of the target volume is no more than the number of redundant disks of the independent disk redundant array corresponding to the target volume. The third full stripe input / output sub-request is a full stripe input / output request corresponding to a single complete stripe and is a request that does not operate on the in-place member disk.
[0112] The first sending unit is used to send the third full-strip input / output sub-request and the first non-full-strip input / output sub-request to the independent disk redundant array card, so that the independent disk redundant array card can process the third full-strip input / output sub-request using the hardware processing unit and process the first non-full-strip input / output sub-request using the software processing unit.
[0113] In some alternative implementations, the first transmitting module 1005 includes: The filling unit is used to fill the target flag bit of the first full-strip input / output sub-request with a first identifier and to fill the target flag bit of the first non-full-strip input / output sub-request with a second identifier. The first identifier is used to indicate that the first full-strip input / output sub-request is processed by the hardware processing unit in the independent disk redundant array card, and the second identifier is used to indicate that the first non-full-strip input / output sub-request is processed by the software processing unit in the independent disk redundant array card.
[0114] The second sending unit is configured to send the first full-strip I / O sub-request and the second non-full-strip I / O sub-request to the independent disk redundant array card, so that the independent disk redundant array card determines, based on the first identifier in the target flag bit of the first full-strip I / O sub-request, to use the hardware processing unit to process the first full-strip I / O sub-request; and based on the second identifier in the target flag bit of the first non-full-strip I / O sub-request, to use the software processing unit to process the first non-full-strip I / O sub-request.
[0115] In some optional implementations, the request processing apparatus further includes: The first receiving module is used to receive volume information change information sent by the independent disk redundant array card.
[0116] The fourth sending module is used to send volume information query information to the independent disk redundant array card based on volume information change information, so that the independent disk redundant array card can return the current volume information of each volume based on the volume information query information.
[0117] The second receiving module is used to receive and save the current volume information of each volume.
[0118] In some optional implementations, the request processing apparatus further includes: The third receiving module is used to receive the processing results of the first full-strip input / output sub-request and the first non-full-strip input / output sub-request returned by the independent disk redundant array card when the input / output request to be processed is not a full-strip input / output request.
[0119] The fourth determining module is used to determine the processing result of the first full-strip input / output sub-request and at least one first non-full-strip input / output sub-request corresponding to the input / output request to be processed, based on the processing result of the first full-strip input / output sub-request and the processing result of the first non-full-strip input / output sub-request.
[0120] The merging module is used to merge the processing results of the first full-strip input / output sub-request corresponding to the input / output request to be processed with the processing results of at least one first non-full-strip input / output sub-request to obtain the processing result of the input / output request to be processed.
[0121] For a description of the features in the embodiment corresponding to the request processing device, please refer to the relevant description in the embodiment corresponding to the request processing method, which will not be repeated here.
[0122] Embodiments of this application also provide an electronic device, such as... Figure 11 As shown, it includes a processor 1101 and a memory 1102, in which a computer program is stored. The processor 1101 is configured to run the computer program to perform the steps in any of the above-described request processing method embodiments.
[0123] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above-described request processing method embodiments at runtime.
[0124] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.
[0125] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above-described request processing method embodiments.
[0126] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above-described request processing method embodiments.
[0127] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0128] The foregoing has provided a detailed description of a request processing method, apparatus, electronic device, and storage medium provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only intended to aid in understanding the method and core ideas of this application. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this application.
Claims
1. A request processing method, characterized in that, include: Obtain pending input / output requests; The input / output requests to be processed are parsed to determine the target volume, the starting address of the target logical block, and the number of target logical blocks; Based on the current volume information of the target volume, the starting address of the target logical block, and the number of target logical blocks, determine whether the input / output request to be processed is a full-strip input / output request; If the input / output request to be processed is not a full-strip input / output request, the input / output request to be processed is split into a first full-strip input / output sub-request and at least one first non-full-strip input / output sub-request based on the current volume information of the target volume, the starting address of the target logical block and the number of target logical blocks. The first full-strip I / O sub-request and the first non-full-strip I / O sub-request are sent to the independent disk redundant array card, so that the independent disk redundant array card uses the hardware processing unit to process the first full-strip I / O sub-request and uses the software processing unit to process the first non-full-strip I / O sub-request.
2. The method according to claim 1, characterized in that, The method further includes: When the pending input / output request is a full stripe input / output request, the presence status of the member disks of the target volume is determined based on the current volume information of the target volume. If at least one member disk of the target volume is in an in-place state, and the number of in-place member disks of the target volume is no more than the number of redundant disks in the independent disk redundant array corresponding to the target volume, then based on the current volume information of the target volume, the starting address of the target logical block, and the number of target logical blocks, the input / output request to be processed is split into at least one second full-strip input / output sub-request. The second full-strip input / output sub-request is a full-strip input / output request corresponding to a single complete stripe, and the second full-strip input / output sub-request is a request that does not operate on the in-place member disk. The second full-strip input / output sub-request is sent to the independent disk redundant array card, so that the independent disk redundant array card can process the second full-strip input / output sub-request using the hardware processing unit.
3. The method according to claim 2, characterized in that, The method further includes: When the input / output request to be processed is a full-strip input / output request and all member disks of the target volume are in place, the input / output request to be processed is sent to the independent disk redundant array card so that the independent disk redundant array card can process the input / output request to be processed using the hardware processing unit.
4. The method according to claim 1, characterized in that, The step of sending the first full-strip I / O sub-request and the first non-full-strip I / O sub-request to the independent disk redundant array card, so that the independent disk redundant array card processes the first full-strip I / O sub-request using a hardware processing unit and processes the first non-full-strip I / O sub-request using a software processing unit, includes: Based on the current volume information of the target volume, determine the in-place status of the member disks of the target volume; If at least one member disk of the target volume is in an in-place state, and the number of in-place member disks of the target volume is no more than the number of redundant disks in the independent disk redundant array corresponding to the target volume, then the first full stripe input / output sub-request is split into at least one third full stripe input / output sub-request. The third full stripe input / output sub-request is a full stripe input / output request corresponding to a single complete stripe, and the third full stripe input / output sub-request is a request not to operate on the in-place member disks. The third full-strip I / O sub-request and the first non-full-strip I / O sub-request are sent to the independent disk redundant array card, so that the independent disk redundant array card can process the third full-strip I / O sub-request using the hardware processing unit and process the first non-full-strip I / O sub-request using the software processing unit.
5. The method according to claim 1, characterized in that, The step of sending the first full-strip I / O sub-request and the second non-full-strip I / O sub-request to the independent disk redundant array card, so that the independent disk redundant array card processes the first full-strip I / O sub-request using a hardware processing unit and processes the first non-full-strip I / O sub-request using a software processing unit, includes: A first identifier is filled into the target flag bit of the first full-strip input / output sub-request, and a second identifier is filled into the target flag bit of the first non-full-strip input / output sub-request. The first identifier is used to indicate that the first full-strip input / output sub-request is processed by the hardware processing unit in the independent disk redundant array card, and the second identifier is used to indicate that the first non-full-strip input / output sub-request is processed by the software processing unit in the independent disk redundant array card. The first full-strip I / O sub-request and the second non-full-strip I / O sub-request are sent to the Independent Redundant Array of Independent Disks (IRAD), so that the IAD determines to process the first full-strip I / O sub-request using a hardware processing unit based on a first identifier in the target flag bit of the first full-strip I / O sub-request; and determines to process the first non-full-strip I / O sub-request using a software processing unit based on a second identifier in the target flag bit of the first non-full-strip I / O sub-request.
6. The method according to claim 1, characterized in that, The method further includes: Receive volume information change information sent by the independent disk redundant array card; Based on the volume information change information, a volume information query message is sent to the independent disk redundant array card, so that the independent disk redundant array card returns the current volume information of each volume based on the volume information query message; Receive and save the current volume information for each volume.
7. The method according to claim 1, characterized in that, The method further includes: If the input / output request to be processed is not a full-strip input / output request, the processing results of the first full-strip input / output sub-request and the first non-full-strip input / output sub-request returned by the independent disk redundant array card are received. Based on the processing results of the first full-strip input / output sub-request and the first non-full-strip input / output sub-request, determine the processing results of the first full-strip input / output sub-request and at least one first non-full-strip input / output sub-request corresponding to the input / output request to be processed. The processing results of the first full-strip input / output sub-request corresponding to the input / output request to be processed and at least one first non-full-strip input / output sub-request are combined to obtain the processing result of the input / output request to be processed.
8. A request processing apparatus, characterized in that, include: The acquisition module is used to acquire input / output requests to be processed. The first determining module is used to parse the input / output request to be processed and determine the target volume, the starting address of the target logical block, and the number of target logical blocks; The second determining module is used to determine whether the input / output request to be processed is a full-strip input / output request based on the current volume information of the target volume, the starting address of the target logical block, and the number of target logical blocks. The first splitting module is used to split the input / output request to be processed into a first full-strip input / output sub-request and at least one first non-full-strip input / output sub-request based on the current volume information of the target volume, the starting address of the target logical block and the number of target logical blocks when the input / output request to be processed is not a full-strip input / output request. The first sending module is used to send the first full-strip input / output sub-request and the first non-full-strip input / output sub-request to the independent disk redundant array card, so that the independent disk redundant array card can process the first full-strip input / output sub-request using a hardware processing unit and process the first non-full-strip input / output sub-request using a software processing unit.
9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the request processing method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the request processing method as described in any one of claims 1 to 7.