Request processing method and apparatus, electronic device, and storage medium
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
AI Technical Summary
In existing technologies, hardware RAID controllers have low processing efficiency and long response times for input/output requests when the independent disk redundant array group is in a deformed state, which cannot meet the high-performance requirements of modern applications.
By receiving input/output requests from the host, the target independent disk redundant array group is parsed to obtain its current partition watermark. Based on the partition watermark, the transformation completion area, transformation conversion area, and transformation waiting area are determined. The hardware processing unit creates engine instruction code and sends it to the independent disk redundant array engine for processing. After completion, a request for processing completion information is sent to the host.
It improves the efficiency of input/output request processing in the transformation state, reduces response time, reduces the load on the chip's CPU, ensures that the host is unaware of the transformation process, and enhances the overall performance of the RAID chip.
Smart Images

Figure CN122152224A_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 increasing demand for server computing power from artificial intelligence and big data, the requirements for server storage performance and reliability are also rising. Redundant Array of Independent Disks (RAID) technology combines multiple independent disks into a large disk system, providing better storage performance and higher reliability than a single disk. The RAID controller, as the core component of a RAID storage system, is responsible for data storage, retrieval, verification, and fault recovery. In related technologies, when the RAID group that receives an input / output request is in a modified state, the hardware RAID controller uses a software processing unit to create engine instruction codes corresponding to the input / output request, and then uses the RAID engine to process these engine instruction codes to complete the input / output request processing.
[0003] Because the efficiency of software processing units in creating engine instruction codes is much lower than that of hardware processing units, the processing efficiency of input / output requests is low and the response time is long when the RAID group to which the input / output request is hit is in a deformed state. Summary of the Invention
[0004] This application provides a request processing method, apparatus, electronic device, and storage medium to at least solve the problem in the related art that the processing efficiency of input / output requests is low and the response time is long when the RAID group to which the input / output request is hit is in a deformed state.
[0005] This application provides a request processing method, including:
[0006] Receive input / output requests from the host; Parse input and output requests to determine the target independent disk redundant array group; When the target independent disk redundant array group is in a deformed state, obtain the current partition water level of the target independent disk redundant array group; Based on the current partition water level, determine the transformation completion area, transformation conversion area, and transformation waiting area of the target independent disk redundant array group; Based on the transformation completion area, transformation conversion area, and transformation waiting area of the target independent disk redundant array group, the target partition corresponding to the input / output request is determined; Based on the target partition corresponding to the input / output request, the hardware processing unit creates the engine instruction code corresponding to the input / output request, and sends the engine instruction code to the independent disk redundant array engine so that the independent disk redundant array engine can process the engine instruction code. After the engine instruction code is processed, it sends a request for processing completion information to the host.
[0007] This application also provides a request processing apparatus, including: The receiving module is used to receive input / output requests sent by the host. The first determining module is used to parse input and output requests and determine the target independent disk redundant array group; The acquisition module is used to acquire the current partition water level of the target independent disk redundant array group when the target independent disk redundant array group is in a deformed state. The second determining module is used to determine the deformation completion area, deformation conversion area, and deformation waiting area of the target independent disk redundant array group based on the current partition water level. The third determination module is used to determine the target partition corresponding to the input / output request based on the deformation completion area, deformation conversion area and deformation waiting area of the target independent disk redundant array group. The processing module is used to create engine instruction codes corresponding to the input / output requests based on the target partition corresponding to the input / output requests using the hardware processing unit, and send the engine instruction codes to the independent disk redundant array engine so that the independent disk redundant array engine can process the engine instruction codes. After the engine instruction codes are processed, a request for processing completion information is sent to the host.
[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 receiving input / output requests from a host; parsing the input / output requests to determine the target redundant independent disk array (BRA); if the target BRA is in a modified state, obtaining the current partition watermark of the target BRA; based on the current partition watermark, determining the modification completion area, modification conversion area, and modification waiting area of the target BRA; based on the modification completion area, modification conversion area, and modification waiting area of the target BRA, determining the target partition corresponding to the input / output request; based on the target partition corresponding to the input / output request, using a hardware processing unit to create engine instruction code corresponding to the input / output request, sending the engine instruction code to the BRA engine so that the BRA engine processes the engine instruction code, and sending a request for processing completion information to the host after the engine instruction code processing is completed. By creating engine instruction codes corresponding to the input / output requests in the target partition of the target independent disk redundant array group when the input / output request is in a deformed state, the hardware processing unit creates engine instruction codes corresponding to the input / output requests in the target partition of the target independent disk redundant array group, so that the independent disk redundant array engine processes the engine instruction codes. Therefore, the technical problem of low processing efficiency and long response time of input / output requests when the RAID group hit by the input / output request is in a deformed state can be solved, and the technical effect of improving the processing efficiency of input / output requests and reducing the response time can be achieved. 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 illustrating the working principle of a hardware RAID controller in related technologies. Figure 2 This is a schematic diagram of multiple RAID groups in a RAID controller provided in an embodiment of this application; Figure 3 A flowchart illustrating a request processing method provided in an embodiment of this application; Figure 4 A partitioning diagram illustrating the expansion of a RAID group provided in this application embodiment; Figure 5 A flowchart illustrating another request processing method provided in an embodiment of this application; Figure 6 A schematic diagram of the target hardware cache queue provided in an embodiment of this application; Figure 7 A flowchart illustrating another request processing method provided in an embodiment of this application; Figure 8 This is a schematic diagram illustrating the working principle of the hardware RAID controller provided in the embodiments of this application; Figure 9 This is a schematic diagram of the structure of a request processing device provided in an embodiment of this application; Figure 10 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] With the increasing demand for server computing power from artificial intelligence and big data, the requirements for server storage performance and reliability are also rising. Redundant Array of Independent Disks (RAID) technology combines multiple independent disks into a large disk system, achieving better storage performance and higher reliability than a single disk. The RAID controller, as the core component of a RAID storage system, is responsible for data storage, retrieval, verification, and fault recovery. Software-based RAID controllers are RAID controllers that do not rely on dedicated hardware; they implement RAID functionality through the collaboration of the operating system and software. With the advent of the big data era, the storage and rapid access of massive amounts of data place higher demands on the performance of RAID controllers. When processing large-scale data, software RAID controllers often experience problems such as high CPU usage, decreased read / write speeds, and increased latency, failing to meet the high-performance requirements of modern applications.
[0018] Hardware RAID controllers completely solve the shortcomings of software RAID controllers in terms of their implementation principles. Figure 1 This is a schematic diagram illustrating the working principle of a hardware RAID controller in related technologies, such as... Figure 1As shown, the RAID controller chip, acting as a PCIe endpoint (EP), establishes a connection with the host's PCIe root complex (RC). The RAID controller chip connects to the underlying disks via its own PCIe RC, managing communication with the physical disks as the root complex. The hardware RAID controller, integrated on the RAID controller chip, receives input / output (IO) requests in the form of Submission Queue Entry (SQE) from the host. It parses the IO requests to determine the RAID group to which the IO request is triggered. It then obtains the status information of the RAID group to which the IO request is triggered. Based on the status information of the RAID group to which the IO request is triggered, it performs IO routing. When the status of the RAID group to which the IO request is triggered is normal, the IO request is routed to the hardware processing unit in the hardware RAID controller. The hardware processing unit creates the engine instruction code corresponding to the IO request and submits it to the RAID engine for execution. After the RAID engine completes the execution, it replies to the host with the request processing result in the form of a Completion Queue Entry (CQE), completing the interaction with the host. The entire process is handled by the hardware processing unit, without the need for firmware or software processing units, greatly improving the RAID group's ability to respond to host I / O under normal conditions. Specifically, the hardware processing unit creates the corresponding engine instruction code for the I / O request based on the RAID group's configuration information and the I / O request itself. The hardware RAID controller includes multiple RAID engines. The I / O request includes the requested operation type (read / write), Starting Logical Block Address (SLBA), and Number of Logical Blocks (NLB), etc. The RAID group's configuration information includes the RAID level, RAID group identifier, and member disk list.
[0019] When an I / O request hits a RAID group in a transformed state, the I / O request is routed to the firmware (software processing unit) in the hardware RAID controller for processing. Specifically, it determines whether the I / O request hits the transformed completion area of the corresponding RAID group. If it does, the firmware obtains the configuration information of the transformed RAID group, creates the corresponding engine command code based on the transformed RAID group's configuration information and the I / O request, and then executes the engine command code. If the transformed completion area of the corresponding RAID group is not hit, it determines whether the I / O request hits the transformed waiting area of the corresponding RAID group. If it does, the firmware obtains the configuration information of the RAID group before transformation, creates the corresponding engine command code based on the pre-transformation RAID group configuration information and the I / O request, and then executes the engine command code. If the corresponding RAID group's transformation waiting area is not hit, the IO request is determined to have hit the corresponding RAID group's transformation conversion area, i.e., the area currently undergoing transformation. The firmware caches the IO request in the IO queue, waiting for the background task to complete. Once the area where the IO request hits the corresponding RAID group changes from the transformation conversion area to the transformation completion area, the IO request is re-evaluated to create the corresponding engine instruction code according to the processing flow for RAID group transformation completion areas. A RAID group in a transformation state indicates that the RAID group is undergoing operations such as expansion, level migration, reconstruction, or copy-back.
[0020] Figure 2 This is a schematic diagram of multiple RAID groups in a RAID controller provided in an embodiment of this application, as shown below. Figure 2 As shown, the RAID controller includes 7 disks. Disks 1 to 3 form RAID group A, which is in a normal state. All I / O requests from the host that hit RAID group A are handled by the RAID controller's hardware processing unit to create the corresponding engine command code, which is then executed by the RAID engine. Disks 4 to 6 form RAID group B. When a new disk 7 is added to RAID group B, it needs to be modified. The firmware configures RAID group B to a modified state. During I / O traffic distribution, the hardware RAID controller determines if the RAID group hit by the I / O request is in a modified state and then forwards all I / O requests to the firmware for processing. The firmware processes the requests according to the above procedure, which will not be elaborated further here.
[0021] As can be seen from the above process, in related technologies, when the RAID group hit by an IO request is in a modified state, the hardware RAID controller hands over the IO request to the firmware for processing. The host is not aware of the RAID group's modification process during modification. However, because all IO requests hitting this RAID group during modification are handled by the firmware, and the firmware's efficiency in creating engine instruction codes is far lower than that of the hardware processing unit, the processing efficiency of IO requests is low and the response time is long when the RAID group hit by the IO request is in a modified state. Furthermore, the Input / Output Operations Per Second (IOPS) of IO requests hitting RAID groups in a modified state will be significantly reduced.
[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: receiving an input / output request from a host; parsing the input / output request to determine a target redundant independent disk array (BRA); if the target BRA is in a modified state, obtaining the current partition watermark of the target BRA; based on the current partition watermark, determining the modified completion area, modified conversion area, and modified waiting area of the target BRA; based on the modified completion area, modified conversion area, and modified waiting area of the target BRA, determining the target partition corresponding to the input / output request; based on the target partition corresponding to the input / output request, creating engine instruction code corresponding to the input / output request using a hardware processing unit, sending the engine instruction code to the BRA engine to enable the BRA engine to process the engine instruction code, and sending request processing completion information to the host after the engine instruction code processing is completed. The method provided by the above solution, when the target independent disk redundant array group hit by the input / output request is in a deformed state, uses a hardware processing unit to create engine instruction code corresponding to the input / output request in the target partition corresponding to the target independent disk redundant array group, so that the independent disk redundant array engine processes the engine instruction code. Therefore, it can solve the technical problem of low processing efficiency and long response time of input / output requests when the RAID group hit by the input / output request is in a deformed state in related technologies. It achieves the technical effect of improving the processing efficiency of input / output requests, reducing response time, effectively reducing the CPU load of the chip during the deformation process, and having no significant reduction in IOPS presented by the host, realizing the host is "unnoticeable" during the deformation process, and improving the overall performance of the RAID chip.
[0023] Embodiments of this application provide a request processing method applied to a hardware RAID controller. Figure 3 This is a flowchart illustrating the request processing method provided in an embodiment of this application, as shown below. Figure 3 As shown, the request processing method includes the following steps: Step S301: Receive input / output requests from the host.
[0024] It is understandable that the input / output requests are in the form of SQE.
[0025] Step S302: parse the input / output requests to determine the target independent disk redundant array group.
[0026] Specifically, the input / output requests are parsed to determine the target independent disk redundant array group to which the input / output requests are matched.
[0027] Step S303: When the target independent disk redundant array group is in a deformed state, obtain the current partition water level of the target independent disk redundant array group.
[0028] When the target independent disk redundant array group is in a deformed state, the software processing unit (firmware) deforms the target independent disk redundant array in stripe units.
[0029] When expanding the target independent disk redundant array group, the chip firmware informs the hardware processing unit of the location of different partitions in the target independent disk redundant array group by setting the current partition watermark of the target independent disk redundant array group. The hardware processing unit determines the partition hit by the current IO request based on the current partition watermark.
[0030] For example, when a RAID group is expanded, the chip firmware performs the process of reorganizing the original RAID group data and moving it to the expanded RAID group in the background according to the stripe partition. Figure 4 A partitioning diagram for expanding the RAID group provided in this application embodiment is shown below. Figure 4 As shown, when a RAID group expands from three disks to four disks, the partitions during the expansion process are divided into a completed expansion area, a transformation transition area, and a transformation waiting area. These partitions are distinguished by partition watermarks; for example, a high watermark distinguishes the transformation waiting area from the transformation transition area, and a low watermark distinguishes the transformation transition area from the completed expansion area. It is understandable that the partition watermarks change continuously as the RAID group's expansion progresses.
[0031] Transformation Completion Area: This area is where the chip firmware reassembles the original RAID group data to form a new RAID group. Subsequent IO requests from the host need to create engine instruction codes based on the expanded RAID group configuration information to perform disk read or disk write operations when reading or writing to this area.
[0032] Transformation / Transition Area: This area indicates that the chip firmware is reassembling and moving this part of the data in the original RAID group to the new RAID group. During the reassembly process, when the host sends an IO request that hits this area, it must wait for the chip firmware to complete the reassembly before responding.
[0033] Deformation Waiting Area: This area is in the queue. The chip firmware reorganization and movement operation has not yet been executed in this area. When the IO request issued by the host hits this area, it needs to create engine instruction code according to the original RAID group configuration information to perform disk read or disk write operations.
[0034] During the RAID group transformation process, the firmware continuously adjusts the position of the transformation conversion area and performs background transformation reconstruction operations. The transformation conversion area moves gradually towards higher logical addresses in stripes as the smallest unit until all address areas of the RAID group have been reconstructed and converted into transformation completion areas, at which point the transformation operation is declared complete.
[0035] Step S304: Based on the current partition water level, determine the transformation completion area, transformation conversion area, and transformation waiting area of the target independent disk redundant array group.
[0036] Step S305: Based on the transformation completion area, transformation conversion area, and transformation waiting area of the target independent disk redundant array group, determine the target partition corresponding to the input / output request.
[0037] It is understandable that the target partition for the input / output request is determined based on the transformation completion area, transformation conversion area, and transformation waiting area of the target independent disk redundant array group.
[0038] Step S306: Based on the target partition corresponding to the input / output request, the hardware processing unit creates the engine instruction code corresponding to the input / output request, and sends the engine instruction code to the independent disk redundant array engine so that the independent disk redundant array engine can process the engine instruction code. After the engine instruction code is processed, a request processing completion message is sent to the host.
[0039] It is understandable that the request processing completion message is in CQE format.
[0040] The request processing method provided in this application, when the target independent disk redundant array group hit by the input / output request is in a deformed state, uses a hardware processing unit to create engine instruction code corresponding to the input / output request in the target partition corresponding to the target independent disk redundant array group based on the input / output request, so that the independent disk redundant array engine processes the engine instruction code. Therefore, it can solve the technical problem in the related art that the processing efficiency of input / output requests is low and the response time is long when the RAID group hit by the input / output request is in a deformed state, and achieve the technical effect of improving the processing efficiency of input / output requests and reducing the response time when the RAID group hit by the input / output request is in a deformed state.
[0041] Embodiments of this application provide a request processing method applied to a hardware RAID controller. 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: Receive input / output requests from the host. For details, please refer to [link to relevant documentation]. Figure 3 Step S301 of the illustrated embodiment will not be described again here.
[0042] Step S502: Parse the input / output requests to determine the target independent disk redundant array group. For details, please refer to [link to relevant documentation]. Figure 3 Step S302 of the illustrated embodiment will not be described again here.
[0043] Step S503: If the target independent disk redundant array group is in a deformed state, obtain the current partition watermark of the target independent disk redundant array group. For details, please refer to [link to details]. Figure 3 Step S303 of the illustrated embodiment will not be described again here.
[0044] Step S504: Based on the current partition watermark, determine the transformation completion area, transformation conversion area, and transformation waiting area of the target independent disk redundant array group. For details, please refer to... Figure 3 Step S304 of the illustrated embodiment will not be described again here.
[0045] Step S505: Based on the transformation completion area, transformation conversion area, and transformation waiting area of the target independent disk redundant array group, determine the target partition corresponding to the input / output request. For details, please refer to [link to details]. Figure 3 Step S305 of the illustrated embodiment will not be described again here.
[0046] Step S506: Based on the target partition corresponding to the input / output request, the hardware processing unit creates the engine instruction code corresponding to the input / output request, and sends the engine instruction code to the independent disk redundant array engine so that the independent disk redundant array engine can process the engine instruction code. After the engine instruction code is processed, a request processing completion message is sent to the host.
[0047] Specifically, step S506 includes: Step S5061: If the target partition corresponding to the input / output request is the transformed area of the target independent disk redundant array group, obtain the configuration information of the transformed target independent disk redundant array group.
[0048] Step S5062: Using the hardware processing unit, based on the configuration information and input / output requests of the modified target independent disk redundant array group, create engine instruction codes corresponding to the input / output requests, and send the engine instruction codes to the independent disk redundant array engine so that the independent disk redundant array engine can process the engine instruction codes. After the engine instruction codes are processed, send a request for processing completion information to the host.
[0049] The request processing method provided in this application embodiment, when the target partition corresponding to the IO request is a transformed completed area, utilizes a hardware processing unit to create engine instruction code corresponding to the IO request based on the transformed target RAID group configuration information and the IO request, without the need for firmware involvement, thereby improving the processing efficiency of the IO request and reducing the response time of the IO request.
[0050] In some optional implementations, step S506 above includes: Step a1: If the target partition corresponding to the input / output request is the transformation waiting area of the target independent disk redundant array group, obtain the configuration information of the target independent disk redundant array group before transformation.
[0051] Step a2: Using the hardware processing unit, based on the configuration information and input / output requests of the target independent disk redundant array group before transformation, create engine instruction codes corresponding to the input / output requests, and send the engine instruction codes to the independent disk redundant array engine so that the independent disk redundant array engine can process the engine instruction codes. After the engine instruction codes are processed, send a request for processing completion information to the host.
[0052] The request processing method provided in this application embodiment, when the target partition corresponding to the IO request is a transformation waiting area, utilizes a hardware processing unit to create engine instruction code corresponding to the IO request based on the target RAID group configuration information and the IO request before transformation, without the need for firmware involvement, thereby improving the processing efficiency of the IO request and reducing the response time of the IO request.
[0053] In some optional implementations, step S506 above includes: Step b1: If the target partition corresponding to the input / output request is a transformation area of the target independent disk redundant array group, the input / output request is placed in the target hardware cache queue corresponding to the target independent disk redundant array group.
[0054] Step b2: When the partition waterline of the target independent disk redundant array group changes, traverse the input / output requests in the target hardware cache queue and return to execute the step of obtaining the current partition waterline of the target independent disk redundant array group when the target independent disk redundant array group is in a deformed state.
[0055] Understandably, when the partition watermark of the target redundant RAID group changes, the transformation completion area, transformation conversion area, and transformation waiting area of the target redundant RAID group also change, and the state of the target redundant RAID group may also change. Therefore, for any input / output request in the target hardware cache queue, it is determined whether the state of the target redundant RAID group it hits is in a transformed state. If the state of the target redundant RAID group is in a transformed state, the current partition watermark of the target redundant RAID group is obtained. Based on the current partition watermark, the transformation completion area, transformation conversion area, and transformation waiting area of the target redundant RAID group are determined. Based on the transformation completion area, transformation conversion area, and transformation waiting area of the target redundant RAID group, the target partition corresponding to the input / output request is determined. Based on the target partition corresponding to the input / output request, the hardware processing unit creates the engine instruction code corresponding to the input / output request, and sends the engine instruction code to the redundant RAID engine so that the redundant RAID engine can process the engine instruction code. After the engine instruction code is processed, a request for processing completion information is sent to the host.
[0056] If the target independent disk redundant array group is in a normal state, the configuration information of the target independent disk redundant array group is obtained; using the hardware processing unit, based on the configuration information and input / output requests of the target independent disk redundant array group, engine instruction codes corresponding to the input / output requests are created, and the engine instruction codes are sent to the independent disk redundant array engine so that the independent disk redundant array engine can process the engine instruction codes. After the engine instruction codes are processed, a request for processing completion information is sent to the host.
[0057] It is understandable that when the partition water level of the target independent disk redundant array group changes, if the target independent disk redundant array group only includes the transformation completed area and has no transformation conversion area and transformation waiting area, then the state of the target independent disk redundant array group is determined to be normal.
[0058] The request processing method provided in this application embodiment, when the target partition corresponding to the IO request is a transformation zone, puts the IO request into a hardware cache queue, so that the cache management of IO requests that hit the transformation zone is completely managed by the hardware management unit without the need for firmware involvement, thereby improving the processing efficiency of IO requests.
[0059] In some optional implementations, the above request processing method further includes: Step c1: When the partition waterline of the target independent disk redundant array group changes, the flag bit of the target hardware cache queue is flipped so that the flag bit of the input / output request put into the target hardware cache queue after the flag bit is flipped is the flipped flag bit.
[0060] The target hardware cache queue's flag is initially 0, then becomes 1 after one flip, then 0 after another flip, and so on.
[0061] After the flag bit of the target hardware cache queue is flipped, the flag bit of the input / output request placed into the target hardware cache queue is updated to the flag bit of the target hardware cache queue after this flip.
[0062] Step c2: When traversing the input / output requests in the target hardware cache queue, if the flag bit of the traversed input / output request is the same as the flag bit of the target hardware cache queue after this flip, then the current traversal is determined to be over.
[0063] Figure 6 This is a schematic diagram of the target hardware cache queue provided in the embodiments of this application, as shown below. Figure 6 As shown, the flag bit of the target hardware cache queue is used to determine whether the queue has been cycled through once when reading input / output requests from the target hardware cache queue. In other words, queue reading is determined based on the flag bit of the target hardware cache queue to see if the queue has been cycled through once. The initial value of the flag bit of the target hardware cache queue is 0. When a partition waterline change in the target independent disk redundant array group triggers the reading of input / output requests from the target hardware cache queue, the flag bit at the entry of the target hardware cache queue is flipped. Afterwards, the flag bit of input / output requests pushed into the target hardware cache queue becomes 1. When reading input / output requests from the target hardware cache queue, a flipped flag bit indicates that the entire contents of the target hardware cache queue at the time the reading was triggered have been cycled through once. When the target hardware cache queue is read again, the flag bit is changed from 1 to 0, and a flipped flag bit indicates that the queue has been cycled through once.
[0064] The request processing method provided in this application embodiment accurately distinguishes IO requests before and after the water level change by flipping the flag bit, avoiding repeated traversal of newly enqueued requests and greatly improving the traversal efficiency of the cache queue; by using the flag bit after the first match flip as the traversal end node, it realizes one-time accurate traversal processing of cached IO before the water level change, without the need for a full scan of the queue, reducing firmware processing overhead.
[0065] The hardware processing unit automatically manages the hardware cache queue based on the water level and the marker bit, without the need for firmware intervention.
[0066] In some optional implementations, the above request processing method further includes: Step d1: If the target independent disk redundant array group is in a normal state, obtain the configuration information of the target independent disk redundant array group.
[0067] Step d2: Using the hardware processing unit, based on the configuration information and input / output requests of the target independent disk redundant array group, create engine command codes corresponding to the input / output requests, and send the engine command codes to the independent disk redundant array engine so that the independent disk redundant array engine can process the engine command codes. After the engine command codes are processed, send a request for processing completion information to the host.
[0068] The request processing method provided in this application embodiment, under the normal state of the target RAID group, is led by the hardware processing unit to create and issue engine instruction codes. It relies on the hardware-fixed logic to realize the high-speed generation of instruction codes, give full play to the hardware acceleration advantages, and greatly improve the efficiency of IO request processing.
[0069] In some optional implementations, step S506 above includes: Step e1: Randomly select a target RAID engine from multiple independent disk redundant array engines. Alternatively, obtain the status information of multiple RAID engines, determine the idle RAID engines based on the status information, and randomly select a target RAID engine from the idle RAID engines. Alternatively, obtain the status information of multiple RAID engines, and determine the target RAID engine with the fewest pending engine instruction codes based on the status information.
[0070] Step e2: Based on the target partition corresponding to the input / output request, the hardware processing unit creates the engine instruction code corresponding to the input / output request, and sends the engine instruction code to the target independent disk redundant array engine so that the target independent disk redundant array engine can process the engine instruction code. After the engine instruction code is processed, a request processing completion message is sent to the host.
[0071] The request processing method provided in this application offers multiple RAID engine filtering strategies, supporting flexible adaptation from random filtering to minimum task volume filtering. The filtering strategy based on engine status achieves load balancing scheduling of multiple RAID engines, avoiding resource waste due to single engine overload or idle engines, maximizing the advantages of multi-engine parallel processing, improving the overall IOPS and throughput of the RAID group, and reducing single IO processing latency.
[0072] Embodiments of this application provide a request processing method applied to a hardware RAID controller. Figure 7 This is a flowchart illustrating the request processing method provided in an embodiment of this application, as shown below. Figure 7 As shown, the request processing method includes the following steps: Get the I / O requests sent by the host.
[0073] Get the status information of the RAID group that the IO request hit.
[0074] Based on the status information of the RAID group hit by the IO request, it is determined whether the status of the RAID group hit by the IO request is in a deformed state. If the status of the RAID group hit by the IO request is not in a deformed state, that is, the status of the RAID group hit by the IO request is in a normal state, then the hardware processing unit uses the configuration information of the RAID group hit by the IO request and the IO request to create the corresponding engine instruction code, and then hands it over to the RAID engine for processing.
[0075] If the RAID group hit by the IO request is in a transformed state, the hardware processing unit retrieves the transformed information of the RAID group, which includes the current partition watermark configuration of the RAID group. Based on the current partition watermark configuration, the partition corresponding to the IO request is determined. It is then determined whether the partition corresponding to the IO request is in a transformed state. If it is, the IO request is pushed into the corresponding hardware cache queue for caching. When the partition watermark of the RAID group hit by the IO request changes in the hardware cache queue, the queue is traversed again, starting from whether the RAID group hit by the IO request is in a transformed state. If the partition corresponding to the IO request is not in a transformed state, it is determined whether it is in a transformed state. If it is, the hardware processing unit creates the engine instruction code corresponding to the IO request based on the transformed configuration information of the RAID group hit by the IO request and the IO request itself. After creation, the code is handed over to the RAID engine for processing. If the partition corresponding to the IO request is not the transformation completion area, then the partition corresponding to the IO request is determined to be the transformation waiting area. Using the hardware processing unit, the engine instruction code corresponding to the IO request is created based on the configuration information of the RAID group before transformation hit by the IO request and the IO request. After creation, it is handed over to the RAID engine for processing.
[0076] Compared to related technologies where the IO request is handled by the firmware when the RAID group is in a modified state, the request processing method provided in this application utilizes a hardware processing unit to store the RAID group configuration information before and after modification. It determines the partition corresponding to the current IO request based on the partition watermark configured in the firmware. When the request falls within the modified completion zone, the modified RAID group configuration information is used to directly create engine command codes for execution by the hardware engine, significantly improving IOPS when the host IO hits the modified completion zone. Conversely, when the request falls within the modification waiting zone, the modified RAID group configuration information is used to create engine command codes for execution by the hardware engine, further improving IOPS when the host IO hits the modification waiting zone. When an IO request falls into the transformation zone, it is cached by the hardware processing unit. When the firmware performs transformation processing in the background task, it processes the transformation in stripes. Therefore, compared to the transformation waiting zone and the transformation completion zone, the transformation zone can complete the transformation step by step in very small areas. This ensures that only a small portion of the IOs issued by the host hit the transformation zone, and thus the IOPS presented to the host in the transformation state does not decrease significantly. After the transformation zone is completed, the partition corresponding to the request in the cache queue is re-evaluated. If the IO request in the cache queue hits the transformation completion zone, the hardware processing unit creates the corresponding engine instruction code, and the engine executes it and replies to the host CQE.
[0077] The request processing method provided in this application embodiment, when the RAID group hit by the IO request is in a modified state, the hardware processing unit processes the IO request, and the chip firmware is only responsible for modifying the modified RAID group and configuring the partition waterline of the modified RAID group, which greatly improves the host IO processing capability of the RAID chip during capacity expansion.
[0078] Figure 8 This is a schematic diagram illustrating the working principle of the hardware RAID controller provided in the embodiments of this application, as shown below. Figure 8 As shown, the RAID controller chip, acting as a PCIe endpoint device, establishes a connection with the host's PCIe root complex. The RAID controller chip connects to the underlying disks via its own PCIe RC, managing communication with the physical disks as the root complex. A hardware RAID controller is integrated on the RAID controller chip and is used to receive SQE-formatted I / O requests from the host. The I / O request is parsed to determine the RAID group to which the I / O request is triggered. The status information of the RAID group to which the I / O request is triggered is obtained. I / O traffic is distributed based on the status information of the RAID group to which the I / O request is triggered. When the status of the RAID group to which the I / O request is triggered is normal, the I / O request is distributed to the hardware processing unit in the hardware RAID controller. The hardware processing unit creates the engine instruction code corresponding to the I / O request and then passes it to the RAID engine for execution. After the RAID engine completes the execution, it replies to the host with a CQE-formatted request processing result, completing the interaction with the host. When the RAID group hit by the IO request is in a transformed state, the partition to be hit is determined based on the current partition watermark of the RAID group configured in the chip firmware. If the partition is in a transformed complete area or a transformed waiting area, the hardware processing unit creates the engine command code corresponding to the IO request and then hands it over to the RAID engine for execution. After the RAID engine completes the execution, it replies to the host with the request processing result in the form of CQE, completing the interaction with the host. When the partition to be hit by the IO request is in a transformed transition area, the IO request is pushed into the corresponding hardware cache queue. When the firmware updates the partition watermark of the RAID group hit by the IO request, the IO requests in the hardware cache queue are traversed. IO requests in the transformed complete area after the partition watermark update are handed over to the hardware processing unit for engine command code creation, while IO requests still in the transformed transition area are pushed back into the hardware cache queue for caching.
[0079] When expanding a RAID group, the chip firmware informs the hardware processing unit of the location of different partitions by setting the partition watermarks of the RAID group. The hardware processing unit determines the region where the current I / O request is located based on the partition watermarks of the RAID group. The RAID group configuration information used to process I / O requests that hit the transformation completion region and the transformation waiting region is different. Therefore, the firmware provides two sets of RAID group configuration information for the hardware processing unit to use. The original RAID group information represents the RAID group information before transformation, and the transformed RAID group information represents the RAID group information after transformation.
[0080] Understandably, I / O requests hitting the transformation transition zone enter the corresponding hardware cache queue through the arbiter. The arbiter assigns a flag bit to each I / O request entering the hardware cache queue that is the same as the current flag bit in the hardware cache queue. When the partition waterline of the RAID group hit by the I / O request changes, it triggers a flag bit flip in the corresponding hardware cache queue, so that the flag bit of the I / O request placed in the hardware cache queue after the flag bit flip is the flipped flag bit. The I / O requests in the hardware cache queue are traversed to redetermine the partition corresponding to the I / O request. After the partition corresponding to the I / O request is updated to the transformation completion zone, the I / O request is distributed to the hardware processing unit, which generates the engine instruction code corresponding to the I / O request. If the partition corresponding to the I / O request is still in the transformation transition zone, the I / O request continues to be placed in the hardware cache queue.
[0081] 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.
[0082] Embodiments of this application also provide a request processing apparatus, such as... Figure 9 As shown, the request processing device includes: The receiving module 901 is used to receive input / output requests sent by the host.
[0083] The first determining module 902 is used to parse the input and output requests and determine the target independent disk redundant array group.
[0084] The acquisition module 903 is used to acquire the current partition water level of the target independent disk redundant array group when the target independent disk redundant array group is in a deformed state.
[0085] The second determining module 904 is used to determine the deformation completion area, deformation conversion area, and deformation waiting area of the target independent disk redundant array group based on the current partition water level.
[0086] The third determining module 905 is used to determine the target partition corresponding to the input / output request based on the deformation completion area, deformation conversion area and deformation waiting area of the target independent disk redundant array group.
[0087] The processing module 906 is used to create engine instruction codes corresponding to the input / output requests based on the target partition corresponding to the input / output requests using the hardware processing unit, and send the engine instruction codes to the independent disk redundant array engine so that the independent disk redundant array engine can process the engine instruction codes. After the engine instruction codes are processed, the module sends a request for processing completion information to the host.
[0088] In some alternative implementations, the processing module 906 includes: The first acquisition unit is used to acquire the configuration information of the modified target independent disk redundant array group when the target partition corresponding to the input / output request is the modified completed area of the target independent disk redundant array group.
[0089] The first creation unit is used to utilize the hardware processing unit to create engine instruction codes corresponding to the input / output requests based on the configuration information and input / output requests of the modified target independent disk redundant array group, and to send the engine instruction codes to the independent disk redundant array engine so that the independent disk redundant array engine can process the engine instruction codes. After the engine instruction codes are processed, a request for processing completion information is sent to the host.
[0090] In some alternative implementations, the processing module 906 includes: The second acquisition unit is used to acquire the configuration information of the target independent disk redundant array group before deformation when the target partition corresponding to the input / output request is the deformation waiting area of the target independent disk redundant array group.
[0091] The second creation unit is used to utilize the hardware processing unit to create engine instruction codes corresponding to the input / output requests based on the configuration information and input / output requests of the target independent disk redundant array group before transformation, and to send the engine instruction codes to the independent disk redundant array engine so that the independent disk redundant array engine can process the engine instruction codes. After the engine instruction codes are processed, a request for processing completion information is sent to the host.
[0092] In some alternative implementations, the processing module 906 includes: The input / output request is placed into the target hardware cache queue corresponding to the target independent disk redundant array group when the target partition corresponding to the input / output request is a variant conversion area of the target independent disk redundant array group.
[0093] The return execution unit is used to traverse the input / output requests in the target hardware cache queue when the partition waterline of the target independent disk redundant array group changes, and return to execute the step of obtaining the current partition waterline of the target independent disk redundant array group when the target independent disk redundant array group is in a deformed state.
[0094] In some optional embodiments, the request processing apparatus further includes: The flip unit is used to flip the flag bit of the target hardware cache queue when the partition waterline of the target independent disk redundant array group changes, so that the flag bit of the input / output request placed into the target hardware cache queue after the flag bit is flipped is the flipped flag bit.
[0095] The determination unit is used to determine the end of the current traversal if, during the traversal of input / output requests in the target hardware cache queue, the flag bit of the traversed input / output request is the same as the flag bit of the target hardware cache queue after this flip.
[0096] In some optional embodiments, the request processing apparatus further includes: The third acquisition unit is used to acquire the configuration information of the target independent disk redundant array group when the target independent disk redundant array group is in a normal state.
[0097] The third creation unit is used to utilize the hardware processing unit to create engine instruction codes corresponding to the input / output requests based on the configuration information and input / output requests of the target independent disk redundant array group, and to send the engine instruction codes to the independent disk redundant array engine so that the independent disk redundant array engine can process the engine instruction codes. After the engine instruction codes are processed, a request for processing completion information is sent to the host.
[0098] 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.
[0099] Embodiments of this application also provide an electronic device, such as... Figure 10 As shown, it includes a processor 1001 and a memory 1002, in which a computer program is stored. The processor 1001 is configured to run the computer program to perform the steps in any of the above-described request processing method embodiments.
[0100] 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.
[0101] 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.
[0102] 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.
[0103] 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.
[0104] 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.
[0105] 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: Receive input / output requests from the host; The input / output requests are parsed to determine the target independent disk redundant array group; When the target independent disk redundant array group is in a deformed state, obtain the current partition water level of the target independent disk redundant array group; Based on the current partition water level, determine the transformation completion area, transformation conversion area, and transformation waiting area of the target independent disk redundant array group; Based on the transformation completion area, transformation conversion area, and transformation waiting area of the target independent disk redundant array group, the target partition corresponding to the input / output request is determined; Based on the target partition corresponding to the input / output request, the hardware processing unit creates the engine instruction code corresponding to the input / output request, and sends the engine instruction code to the independent disk redundant array engine so that the independent disk redundant array engine processes the engine instruction code. After the engine instruction code is processed, a request processing completion message is sent to the host.
2. The method according to claim 1, characterized in that, Based on the target partition corresponding to the input / output request, the hardware processing unit creates engine instruction code corresponding to the input / output request, and sends the engine instruction code to the independent disk redundant array engine so that the independent disk redundant array engine processes the engine instruction code. After the engine instruction code is processed, a request for processing completion information is sent to the host, including: If the target partition corresponding to the input / output request is the transformation completion area of the target independent disk redundant array group, obtain the configuration information of the transformed target independent disk redundant array group; Using a hardware processing unit, based on the configuration information of the modified target independent disk redundant array group and the input / output request, an engine instruction code corresponding to the input / output request is created, and the engine instruction code is sent to the independent disk redundant array engine so that the independent disk redundant array engine processes the engine instruction code. After the engine instruction code is processed, a request for processing completion information is sent to the host.
3. The method according to claim 1, characterized in that, Based on the target partition corresponding to the input / output request, the hardware processing unit creates engine instruction code corresponding to the input / output request, and sends the engine instruction code to the independent disk redundant array engine so that the independent disk redundant array engine processes the engine instruction code. After the engine instruction code is processed, a request for processing completion information is sent to the host, including: If the target partition corresponding to the input / output request is the transformation waiting area of the target independent disk redundant array group, obtain the configuration information of the target independent disk redundant array group before transformation; Using a hardware processing unit, based on the configuration information of the target independent disk redundant array group before the transformation and the input / output request, an engine instruction code corresponding to the input / output request is created, and the engine instruction code is sent to the independent disk redundant array engine so that the independent disk redundant array engine processes the engine instruction code. After the engine instruction code is processed, a request for processing completion information is sent to the host.
4. The method according to claim 1, characterized in that, Based on the target partition corresponding to the input / output request, the hardware processing unit creates engine instruction code corresponding to the input / output request, and sends the engine instruction code to the independent disk redundant array engine so that the independent disk redundant array engine processes the engine instruction code. After the engine instruction code is processed, a request for processing completion information is sent to the host, including: If the target partition corresponding to the input / output request is a transformation area of the target independent disk redundant array group, the input / output request is placed in the target hardware cache queue corresponding to the target independent disk redundant array group; When the partition water level of the target independent disk redundant array group changes, the input / output requests in the target hardware cache queue are traversed, and the step of obtaining the current partition water level of the target independent disk redundant array group is returned when the state of the target independent disk redundant array group is in a deformed state.
5. The method according to claim 4, characterized in that, The method further includes: When the partition waterline of the target independent disk redundant array group changes, the flag bit of the target hardware cache queue is flipped so that the flag bit of the input / output request placed into the target hardware cache queue after the flag bit is flipped is the flipped flag bit; When traversing the input / output requests in the target hardware cache queue, if the flag bit of the traversed input / output request is the same as the flag bit of the target hardware cache queue after this flip for the first time, then the current traversal is determined to be over.
6. The method according to claim 1, characterized in that, When the target independent disk redundant array group is in a deformed state, the software processing unit deforms the target independent disk redundant array in stripe units.
7. The method according to claim 1, characterized in that, The method further includes: If the target independent disk redundant array group is in a normal state, obtain the configuration information of the target independent disk redundant array group; Using a hardware processing unit, based on the configuration information of the target independent disk redundant array group and the input / output request, an engine instruction code corresponding to the input / output request is created, and the engine instruction code is sent to the independent disk redundant array engine so that the independent disk redundant array engine processes the engine instruction code. After the engine instruction code is processed, a request for processing completion information is sent to the host.
8. A request processing apparatus, characterized in that, include: The receiving module is used to receive input / output requests sent by the host. The first determining module is used to parse the input / output request and determine the target independent disk redundant array group; The acquisition module is used to acquire the current partition water level of the target independent disk redundant array group when the target independent disk redundant array group is in a deformed state; The second determining module is used to determine the deformation completion area, deformation conversion area, and deformation waiting area of the target independent disk redundant array group based on the current partition water level. The third determining module is used to determine the target partition corresponding to the input / output request based on the deformation completion area, deformation conversion area and deformation waiting area of the target independent disk redundant array group. The processing module is used to create engine instruction code corresponding to the input / output request based on the target partition corresponding to the input / output request using a hardware processing unit, send the engine instruction code to the independent disk redundant array engine so that the independent disk redundant array engine processes the engine instruction code, and send a request processing completion information to the host after the engine instruction code is processed.
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.