Hard disk operation method, system and equipment and computer readable storage medium
By splitting the requests in the RAID array into sub-requests and allocating the processing queue according to the correlation, the problem of low data processing efficiency in the RAID array is solved, and more efficient data processing and throughput are achieved.
Patent Information
- Application Number
- CN202510466331.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-14
- Publication Date
- 2025-07-08
AI Technical Summary
现有RAID阵列场景下,硬盘之间的耦合和依赖导致数据处理效率低,尤其在I/O请求阻塞或延迟时,影响整体数据处理效率。
The target request is split into sub-requests to the target hard disk, and according to the correlation information of the sub-request and the operation, a strongly related sub-request is added to the first processing queue, and non-strongly related ones are added to the second processing queue, and the first queue is processed first to avoid blockage.
It improves data processing efficiency in RAID array scenarios, avoids the blocking of target operations, and improves the overall data processing efficiency and throughput rate.
Smart Images

Figure CN120276912A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of storage technology, and more specifically, to a hard disk operation method, system, device, and computer-readable storage medium. Background Art
[0002] RAID (Redundant Array of Independent Disks) is a data storage technology that combines multiple independent physical hard disks in a specific manner to form a logical storage unit, so as to improve the data read and write speed of the storage system and enhance data redundancy to improve fault tolerance.
[0003] However, the hard disks in the same RAID group are interrelated, and I / O (Input / Output) requests are coupled and dependent. For example, a data request to access disk 1 in RAID group A may, after being scheduled by the RAID controller, generate additional requests for disk 2 or disk 3. If the requests for disk 2 or disk 3 are blocked or delayed, it will cause the data processing efficiency in the RAID array scenario to become low.
[0004] In summary, how to ensure the data processing efficiency in the RAID array scenario is an urgent problem to be solved by those skilled in the art at present. Summary of the Invention
[0005] The purpose of the present application is to provide a hard disk operation method, which can, to a certain extent, solve the technical problem of how to ensure the data processing efficiency in the RAID array scenario. The present application also provides a hard disk operation system, an electronic device, and a computer-readable storage medium.
[0006] To achieve the above purpose, the present application provides the following technical solutions:
[0007] A hard disk operation method includes:
[0008] Obtaining a target request for performing a target operation on a redundant array of independent disks group;
[0009] Determining a target hard disk to be operated according to the target request;
[0010] Splitting the target request into target sub-requests for operating on the target hard disk;
[0011] Generating correlation information between the target sub-request and the target operation;
[0012] In response to the correlation information satisfying the set strong correlation condition, add the target sub-request to the first processing queue corresponding to the target hard disk; in response to the correlation information not satisfying the strong correlation condition, add the target sub-request to the second processing queue corresponding to the target hard disk;
[0013] Operate on the target hard disk according to the first processing queue. If the first processing queue is empty, operate on the target hard disk according to the second processing queue.
[0014] In an exemplary embodiment, the determining the target hard disk that needs to be operated according to the target request includes:
[0015] Determine the target data that the target request needs to operate on;
[0016] Determine the read / write attribute of the target request;
[0017] Determine the storage hard disk that stores the target data;
[0018] According to the disk grouping method of the redundant array of independent disks, determine the target hard disk associated with the target data, the read / write attribute, and the storage hard disk.
[0019] In an exemplary embodiment, the generating the correlation information between the target sub-request and the target operation includes:
[0020] Parse the type of the target operation to obtain operation type information;
[0021] Detect whether the operation type information is an operation type;
[0022] In response to the operation type information being the operation type, parse the read / write type of the target sub-request to obtain sub-request type information;
[0023] Detect whether the sub-request type information is a data read type;
[0024] In response to the sub-request type information being the data read type, generate correlation information indicating that the target sub-request provides operation data for the target operation;
[0025] In response to the sub-request type being a data write type, generate correlation information indicating that the target sub-request processes the result data of the target operation.
[0026] In an exemplary embodiment, in response to the correlation information satisfying a set strong correlation condition, adding the target sub-request to a first processing queue corresponding to the target hard disk; in response to the correlation information not satisfying the strong correlation condition, adding the target sub-request to a second processing queue corresponding to the target hard disk, including:
[0027] In response to the correlation information indicating that the target sub-request provides operation data for the target operation, adding the target sub-request to a first processing queue corresponding to the target hard disk;
[0028] In response to the correlation information indicating that the target sub-request processes the result data of the target operation, adding the target sub-request to a second processing queue corresponding to the target hard disk.
[0029] In an exemplary embodiment, after detecting whether the operation type information is an operation type, further including:
[0030] In response to the operation type information not being the operation type, generating correlation information indicating that the target sub-request processes the result data of the target operation.
[0031] In an exemplary embodiment, detecting whether the operation type information is an operation type includes:
[0032] Detecting whether the operation type information is a new data disk write type or a data recovery type;
[0033] In response to the operation type information being a new data disk write type or a data recovery type, determining that the operation type information is an operation type.
[0034] In an exemplary embodiment, further including:
[0035] Obtaining a management instruction for the target hard disk;
[0036] Adding the management instruction to a third processing queue corresponding to the target hard disk;
[0037] Before operating on the target hard disk according to the first processing queue, further including:
[0038] Operating on the target hard disk according to the third processing queue, and if the third processing queue is empty, performing the step of operating on the target hard disk according to the first processing queue.
[0039] A hard disk operating system, including:
[0040] A first acquisition module, configured to acquire a target request for performing a target operation on an independent disk redundant array group;
[0041] A first determination module, configured to determine a target hard disk for an operation according to the target request;
[0042] A first splitting module, configured to split the target request into target sub-requests for operating on the target hard disk;
[0043] A first generation module, configured to generate correlation information between the target sub-request and the target operation;
[0044] A first addition module, configured to, in response to the correlation information satisfying a set strong correlation condition, add the target sub-request to a first processing queue corresponding to the target hard disk; and in response to the correlation information not satisfying the strong correlation condition, add the target sub-request to a second processing queue corresponding to the target hard disk;
[0045] A first operation module, configured to operate on the target hard disk according to the first processing queue, and if the first processing queue is empty, operate on the target hard disk according to the second processing queue.
[0046] An electronic device, comprising:
[0047] A memory, configured to store a computer program;
[0048] A processor, configured to implement the steps of any of the above hard disk operation methods when executing the computer program.
[0049] A computer-readable storage medium, in which a computer program is stored, and the computer program, when executed by a processor, implements the steps of any of the above hard disk operation methods.
[0050] A hard disk operation method provided by this application obtains a target request for performing a target operation on a redundant array of independent disks (RAID) group; determines a target hard disk required for the operation according to the target request; splits the target request into target sub-requests for operating on the target hard disk; generates correlation information between the target sub-requests and the target operation; in response to the correlation information meeting a set strong correlation condition, adds the target sub-requests to a first processing queue corresponding to the target hard disk; in response to the correlation information not meeting the strong correlation condition, adds the target sub-requests to a second processing queue corresponding to the target hard disk; operates on the target hard disk according to the first processing queue, and if the first processing queue is empty, operates on the target hard disk according to the second processing queue. In this application, after splitting the target request into target sub-requests for operating on the target hard disk, according to the correlation information between the target sub-requests and the target operation, the strongly correlated target sub-requests are added to the first processing queue corresponding to the target hard disk, and the not-strongly correlated target sub-requests are added to the second processing queue corresponding to the target hard disk, and the target hard disk is preferentially operated on according to the first processing queue. In this way, the target sub-requests strongly correlated with the target operation will be preferentially processed in the target hard disk, avoiding the situation where the target operation is blocked and ensuring the data processing efficiency in the RAID array scenario. A hard disk operation system, an electronic device, and a computer-readable storage medium provided by this application also solve the corresponding technical problems. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of this application. For those of ordinary skill in the art, other drawings can be obtained according to the provided drawings without creative efforts.
[0052] Figure 1 It is a flowchart of a hard disk operation method provided by an embodiment of this application;
[0053] Figure 2 It is a schematic diagram of the composition of a RAID system;
[0054] Figure 3 It is a schematic diagram of the composition of a RAID5 system;
[0055] Figure 4 It is a schematic diagram of the queue mechanism of the NVMe specification;
[0056] Figure 5 It is a schematic diagram of the composition of an NVMe queue;
[0057] Figure 6 It is a schematic diagram of the structure of a hard disk operation system provided by an embodiment of this application;
[0058] Figure 7 Schematic diagram of a structure of an electronic device provided by an embodiment of the present application;
[0059] Figure 8 Another schematic diagram of a structure of an electronic device provided by an embodiment of the present application. Detailed implementation manners
[0060] Next, the technical solutions in the embodiments of the present application will be clearly and completely described with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application without creative efforts shall fall within the protection scope of the present application.
[0061] Please refer to Figure 1 , Figure 1 Flowchart of a hard disk operation method provided by an embodiment of the present application.
[0062] A hard disk operation method provided by an embodiment of the present application may include the following steps:
[0063] Step S101: Obtain a target request for performing a target operation on a redundant array of independent disks (RAID) group.
[0064] In practical applications, a target request for performing a target operation on a RAID group may be obtained first. The types of the target operation and the target request may be flexibly determined according to the application scenario. For example, the target request may be a request to store new data in the RAID group, or a request to recover data in the RAID group, etc. The present application does not make specific limitations herein.
[0065] Step S102: Determine a target hard disk required for the operation according to the target request.
[0066] Step S103: Split the target request into target sub-requests for operating on the target hard disk.
[0067] In practical applications, since a RAID group is composed of multiple disks, the target request may operate on multiple disks, and the operations on each disk are different. Therefore, it is necessary to determine each target hard disk required for the operation according to the target request, and then split the target request into target sub-requests for operating on the target hard disk.
[0068] For ease of understanding, assume that the RAID system for NVMe (Non-Volatile Memory Express) SSD (Solid State Disk) hard disks is composed as Figure 2As shown, the host server and the RAID controller are interconnected through a high-speed PCIe (Peripheral Component Interconnect Express) bus. The RAID controller and the NVMe hard disk devices are interconnected through the PCIe bus. The RAID controller serves as a bridge between the host and the physical hard disks, responsible for managing all the NVMe hard disks in the downstream array, establishing and allocating the management queue and I / O queue of NVMe. Taking RAID5 as an example, an additional parity disk Dp is added to protect the user's stored data information, facilitating data reconstruction in case of hard disk failure. Due to the parity check mechanism of RAID5, each write operation will trigger two read operations and two write operations, which is usually called write penalty. As Figure 3 shown, the NVMe disks D1, D2, D3, and Dp form a RAID5 array. Assuming that Dp is the parity disk under the current data stripe, and the host plans to write new data to D1, each write operation needs to complete the following steps:
[0069] Step 1: Read the old data block D from the data disk D1 old ;
[0070] Step 2: Read the old parity data P from the parity disk Dp old ;
[0071] Step 3: Perform an exclusive OR operation on the old data D old , the new data D new and the old parity data P old to obtain the new parity data P new ;
[0072] Step 4: Write the new data D new to the data disk D1;
[0073] Step 5: Write the calculated new parity information P new to the disk Dp storing the parity information.
[0074] Obviously, the operation of writing new data to D1 requires the participation of the data disk D1 and the parity disk Dp, and the processing processes of each disk are different. Therefore, the target request needs to be split into specific sub-requests corresponding to each disk, so as to perform targeted processing on the specific sub-requests of each disk later.
[0075] It should be noted that NVMe is a communication protocol based on the PCIe interface, designed specifically for SSDs to provide high-speed and low-latency storage access; the queue mechanism of the NVMe specification is as Figure 4As shown in the figure, the communication of the NVMe interface is implemented based on the mechanism of paired Submission Queues (SQ) and Completion Queues (CQ). The upstream host software puts commands into the submission queue SQ, and the controller puts the completion results into the corresponding completion queue CQ. The SQ and CQ queues are allocated in the upstream host memory and are divided into management queues and I / O queues according to their functions. The NVMe protocol stipulates that each NVMe device sets a group of management SQ / CQ pairs for the control and management of the NVMe device to process management commands such as configuring I / O queues and controller characteristics. Each NVMe device can create up to 64K I / O queues for submitting and completing I / O data transfer commands. The multi-I / O queue mechanism enables NVMe to efficiently process a large number of parallel I / O requests. Usually, the number of I / O queues created by the NVMe driver matches the number of processor cores in the upstream host system. On a system based on an N-core processor, an I / O queue is created for each processor core to avoid multiple processor cores competing for access and to ensure that the queue-related data structures can effectively utilize the cache of the processor core.
[0076] In practical applications, during the process of determining the target hard disk for the required operation according to the target request, it is necessary to determine the target data required for the target request; determine the read / write attribute of the target request; determine the storage hard disk storing the target data; and determine the target hard disk associated with the target data, read / write attribute, and storage hard disk according to the disk grouping method of the redundant array of independent disks.
[0077] Step S104: Generate the correlation information between the target sub-request and the target operation.
[0078] Step S105: In response to the correlation information satisfying the set strong correlation condition, add the target sub-request to the first processing queue corresponding to the target hard disk; in response to the correlation information not satisfying the strong correlation condition, add the target sub-request to the second processing queue corresponding to the target hard disk.
[0079] Step S106: Operate on the target hard disk according to the first processing queue. If the first processing queue is empty, operate on the target hard disk according to the second processing queue.
[0080] In practical applications, the processing speed of the target sub-requests in the target hard disk will affect the response speed of the target request, and this influence depends on the correlation between the target sub-request and the target operation. Still taking the Figure 3 system shown in the figure as an example, the disk write of the new data D new in step 4 and the disk write of the new parity P new in step 5 strictly depend on the reading of the old data D old in step 1 and the reading of the old parity P old in step 2. If D is readold Or read the old checksum P old If the I / O request for new is blocked or delayed, it will affect the new data D in the current RAID5 array
[0081] being written to disk. To avoid this situation, it is necessary to generate correlation information between the target sub-request and the target operation. In response to the correlation information meeting the set strong correlation condition, add the target sub-request to the first processing queue corresponding to the target hard disk; in response to the correlation information not meeting the strong correlation condition, add the target sub-request to the second processing queue corresponding to the target hard disk; finally, operate on the target hard disk according to the first processing queue. If the first processing queue is empty, operate on the target hard disk according to the second processing queue, that is, process the target sub-requests in the target hard disk in the order of the first processing queue first and then the second processing queue. In this way, the target sub-requests strongly correlated with the target operation in the first processing queue are processed first, so as not to block the progress of the target operation, which is equivalent to improving the processing efficiency of the target request.
[0082] In a specific application scenario, in response to the correlation information satisfying the set strong correlation condition, the target sub-request is added to the first processing queue corresponding to the target hard disk; in response to the correlation information not satisfying the strong correlation condition, during the process of adding the target sub-request to the second processing queue corresponding to the target hard disk, in response to the correlation information indicating that the target sub-request provides operation data for the target operation, the target sub-request is added to the first processing queue corresponding to the target hard disk; in response to the correlation information indicating that the target sub-request processes the result data of the target operation, the target sub-request is added to the second processing queue corresponding to the target hard disk.
[0083] In a specific application scenario, after detecting whether the operation type information is an operation type, in response to the operation type information not being an operation type, at this time, only data reading and writing need to be performed according to the RAID rule, and there is no mandatory order for data reading and writing, so it will not affect the processing of other sub-requests. Therefore, correlation information indicating that the target sub-request processes the result data of the target operation can be generated, that is, correlation information indicating that the target sub-request and the target operation are not strongly correlated can be generated.
[0084] In a specific application scenario, considering that data recovery and new data disk dropping require operations, so during the process of detecting whether the operation type information is an operation type, it can be detected whether the operation type information is a new data disk dropping type or a data recovery type; in response to the operation type information being a new data disk dropping type or a data recovery type, it is determined that the operation type information is an operation type.
[0085] In practical applications, sometimes it is also necessary to manage the hard disk. At this time, in order to prioritize the management of the hard disk, a management instruction for the target hard disk can also be obtained; the management instruction is added to the third processing queue corresponding to the target hard disk; correspondingly, before operating on the target hard disk according to the first processing queue, the target hard disk can also be operated according to the third processing queue. If the third processing queue is empty, the step of operating on the target hard disk according to the first processing queue is executed, that is, the target sub-request of the target hard disk is processed in the order of the third processing queue first, then the first processing queue, and finally the second processing queue.
[0086] In practical applications, considering the concurrent processing of multiple target requests, for a target hard disk, the strongly related target sub-requests belonging to multiple target requests are all saved in the first processing queue. If the second processing queue is processed only after the first processing queue is emptied, it will cause a situation where one target request blocks another target request. To avoid this situation and improve the processing efficiency of target requests, the maximum delay processing duration of a single target request can be set. First, process the target sub-requests of the target hard disk according to the first processing queue, and accumulate the duration during which the target request has not been processed. If the accumulated duration does not reach the maximum delay processing duration, continue to process the target sub-requests of the target hard disk according to the first processing queue, and return to the step of accumulating the duration during which the target request has not been processed; if the accumulated duration reaches the maximum delay processing duration, process the target sub-requests of the target hard disk according to the second processing queue, clear the accumulated duration, and return to the step of processing the target sub-requests of the target hard disk according to the first processing queue. In this way, during the process of processing the target sub-requests of the target hard disk according to the first processing queue in this application, the duration during which the target request has not been processed is accumulated. When the accumulated duration does not reach the maximum delay processing duration, the target sub-requests strongly related to the target operation are preferentially processed. When the accumulated duration reaches the maximum delay processing duration, the target sub-requests not strongly related to the target operation are processed first to complete a single target request, reducing the processing delay of the target request, avoiding the situation where one target request blocks another target request, and improving the processing efficiency of the target request.
[0087] A hard disk operation method provided by this application includes: obtaining a target request for performing a target operation on an independent disk redundant array group; determining a target hard disk that needs to be operated according to the target request; splitting the target request into target sub-requests for operating on the target hard disk; generating correlation information between the target sub-requests and the target operation; in response to the correlation information satisfying a set strong correlation condition, adding the target sub-request to the first processing queue corresponding to the target hard disk; in response to the correlation information not satisfying the strong correlation condition, adding the target sub-request to the second processing queue corresponding to the target hard disk; operating on the target hard disk according to the first processing queue, and if the first processing queue is empty, operating on the target hard disk according to the second processing queue. In this application, after splitting the target request into target sub-requests for operating on the target hard disk, according to the correlation information between the target sub-requests and the target operation, the strongly related target sub-requests are added to the first processing queue corresponding to the target hard disk, and the not strongly related target sub-requests are added to the second processing queue corresponding to the target hard disk, and the target hard disk is preferentially operated according to the first processing queue. In this way, the target sub-requests strongly related to the target operation will be preferentially processed on the target hard disk, avoiding the situation where the target operation is blocked, and ensuring the data processing efficiency in the RAID array scenario.
[0088] To facilitate understanding of the hard disk operation solution proposed in this application, assume that the third processing queue, the first processing queue, and the second processing queue are represented by the Admin queue, the Urgent queue, and the Priority queue respectively. As Figure 5 shown, the priorities of the three queues are, from high to low, the Admin queue, the Urgent queue, and the Priority queue. Then Figure 3 the hard disk operation process shown can be as follows:
[0089] NVMe disks D1, D2, D3, and Dp form a RAID5 array. The RAID controller Craid creates three NVMe queues for each of D1, D2, D3, and Dp: the Admin (management) queue, the Urgent I / O queue, and the Priority I / O queue;
[0090] Craid receives the data write-to-disk I / O request R h from the host and, according to the characteristics of the current RAID5 array, decomposes R h into R d1r , R d1w , R pr , and R pw . Among them, the I / O request R d1r is intended to read old data from the NVMe disk D1; R d1w is used to write new data to D1; R pr is used to read old parity data from the Dp parity disk; R pw is used to write the calculated new parity data to Dp;
[0091] Craid determines that R d1r , R pr are strongly correlated with the calculation of the new RAID parity, so it places the R d1r request in the Urgent I / O queue of disk D1 and places the R pr request in the Urgent I / O queue of disk Dp; R d1w , R pw are not correlated with the calculation of the RAID parity, so it places the R d1w in the Priority I / O queue of D1 and places the R pw in the Priority I / O queue of Dp;
[0092] Requests placed in the Urgent I / O queue get a faster and more efficient response, which can avoid congestion in the parity calculation and improve the data processing ability of the entire RAID array.
[0093] Through the solution of this application, by reasonably allocating and managing the NVMe queues within the RAID group, the resources of the RAID controller are maximally utilized, making the data writing in the RAID array more efficient, improving the transmission efficiency and bandwidth, and enhancing the throughput rate of the entire RAID system; by using the priority mechanism of the I / O queue, the scheduling of I / O requests is optimized, and the data buffer resources within the RAID controller can be utilized more effectively; and it is applicable to various RAIDs, with good flexibility, without the need to adjust the hardware design of the RAID controller, and is relatively easy to upgrade and deploy, with low costs.
[0094] Please refer to Figure 6 , Figure 6 which is a schematic structural diagram of a hard disk operating system provided by an embodiment of this application.
[0095] A hard disk operating system provided by an embodiment of this application may include:
[0096] A first acquisition module 101, configured to acquire a target request for performing a target operation on a redundant array of independent disks (RAID) group;
[0097] A first determination module 102, configured to determine a target hard disk for which an operation is required according to the target request;
[0098] A first splitting module 103, configured to split the target request into target sub-requests for operating on the target hard disk;
[0099] A first generation module 104, configured to generate correlation information between the target sub-request and the target operation;
[0100] A first addition module 105, configured to, in response to the correlation information satisfying a set strong correlation condition, add the target sub-request to a first processing queue corresponding to the target hard disk; and in response to the correlation information not satisfying the strong correlation condition, add the target sub-request to a second processing queue corresponding to the target hard disk;
[0101] A first operation module 106, configured to operate on the target hard disk according to the first processing queue, and if the first processing queue is empty, operate on the target hard disk according to the second processing queue.
[0102] For a hard disk operating system provided by an embodiment of this application, the first determination module may include:
[0103] A first determination unit, configured to determine target data for which an operation is required by the target request;
[0104] A second determination unit, configured to determine the read / write attribute of the target request;
[0105] A third determination unit, configured to determine a storage hard disk for storing the target data;
[0106] A fourth determination unit, configured to determine a target hard disk associated with target data, a read / write attribute, and a storage hard disk according to the disk grouping mode of a redundant array of independent disks (RAID) group.
[0107] For a hard disk operating system provided by an embodiment of the present application, the first generation module may include:
[0108] A first parsing unit, configured to parse the type of a target operation to obtain operation type information;
[0109] A first detection unit, configured to detect whether the operation type information is an operation type; in response to the operation type information being an operation type, parse the read / write type of a target sub-request to obtain sub-request type information; detect whether the sub-request type information is a data read type; in response to the sub-request type information being a data read type, generate correlation information indicating that the target sub-request provides operation data for the target operation; in response to the sub-request type being a data write type, generate correlation information indicating that the target sub-request processes the result data of the target operation.
[0110] For a hard disk operating system provided by an embodiment of the present application, the first addition module may include:
[0111] A first addition unit, configured to add the target sub-request to a first processing queue corresponding to the target hard disk in response to the correlation information indicating that the target sub-request provides operation data for the target operation;
[0112] A second addition unit, configured to add the target sub-request to a second processing queue corresponding to the target hard disk in response to the correlation information indicating that the target sub-request processes the result data of the target operation.
[0113] For a hard disk operating system provided by an embodiment of the present application, the first detection unit may further be configured to: after detecting whether the operation type information is an operation type, in response to the operation type information not being an operation type, generate correlation information indicating that the target sub-request processes the result data of the target operation.
[0114] For a hard disk operating system provided by an embodiment of the present application, the first detection unit may be configured to: detect whether the operation type information is a new data disk write type or a data recovery type; in response to the operation type information being a new data disk write type or a data recovery type, determine that the operation type information is an operation type.
[0115] A hard disk operating system provided by an embodiment of the present application may further include:
[0116] A second acquisition module, configured to acquire a management instruction for the target hard disk;
[0117] A second addition module, configured to add management instructions to a third processing queue corresponding to a target hard disk;
[0118] A second operation module, configured to operate on the target hard disk according to the third processing queue before the first operation module operates on the target hard disk according to the first processing queue. If the third processing queue is empty, then execute the step of operating on the target hard disk according to the first processing queue.
[0119] This application also provides an electronic device and a computer-readable storage medium, both of which have corresponding effects of a hard disk operation method provided by an embodiment of this application. Please refer to Figure 7 , Figure 7 FIG. is a schematic structural diagram of an electronic device provided by an embodiment of this application.
[0120] An electronic device provided by an embodiment of this application includes a memory 201 and a processor 202. A computer program is stored in the memory 201. When the processor 202 executes the computer program, the steps of the hard disk operation method described in any of the above embodiments are implemented.
[0121] Please refer to Figure 8 , in another electronic device provided by an embodiment of this application, it may further include: an input port 203 connected to the processor 202, configured to transmit an externally input command to the processor 202; a display unit 204 connected to the processor 202, configured to display the processing result of the processor 202 to the outside; a communication module 205 connected to the processor 202, configured to implement communication between the electronic device and the outside. The display unit 204 may be a display panel, a laser scanning display, etc.; the communication methods adopted by the communication module 205 include but are not limited to Mobile High-Definition Link (MHL), Universal Serial Bus (USB), High-Definition Multimedia Interface (HDMI), wireless connection: Wireless Fidelity (WiFi), Bluetooth communication technology, low-power Bluetooth communication technology, and communication technology based on IEEE802.11s.
[0122] A computer-readable storage medium provided by an embodiment of this application stores a computer program. When the computer program is executed by a processor, the steps of the hard disk operation method described in any of the above embodiments are implemented.
[0123] The computer-readable storage medium involved in this application includes random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disks, removable disks, CD-ROM (Compact Disc Read-Only Memory), or any other form of storage medium well-known in the technical field.
[0124] A computer program product provided by an embodiment of this application includes a computer program / instructions. When the computer program / instructions are executed by a processor, the steps of the hard disk operation method described in any of the above embodiments are implemented.
[0125] For the description of the relevant parts in a hard disk operating system, an electronic device, a computer-readable storage medium, and a computer program product provided by an embodiment of this application, please refer to the detailed description of the corresponding parts in a hard disk operation method provided by an embodiment of this application, which will not be elaborated here. In addition, for the parts in the above technical solutions provided by the embodiments of this application that are consistent with the implementation principles of the corresponding technical solutions in the prior art, no detailed description is given to avoid excessive elaboration.
[0126] It should also be noted that in this text, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "including", "comprising" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article or device including the said element.
[0127] The above description of the disclosed embodiments enables those skilled in the art to implement or use this application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application will not be limited to these embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A hard disk operation method, characterized in that, Including: Obtain a target request for performing a target operation on a redundant array of independent disks (RAID) group; Determine a target hard disk for the required operation according to the target request; Split the target request into target sub-requests for operating on the target hard disk; Generate correlation information between the target sub-request and the target operation; In response to the correlation information meeting a set strong correlation condition, add the target sub-request to a first processing queue corresponding to the target hard disk; in response to the correlation information not meeting the strong correlation condition, add the target sub-request to a second processing queue corresponding to the target hard disk; Operate on the target hard disk according to the first processing queue. If the first processing queue is empty, operate on the target hard disk according to the second processing queue.
2. The hard disk operation method according to claim 1, wherein The determining a target hard disk for the required operation according to the target request includes: Determine target data required for the target request; Determine the read / write attribute of the target request; Determine a storage hard disk storing the target data; According to the disk grouping method of the redundant array of independent disks group, determine the target hard disk associated with the target data, the read / write attribute, and the storage hard disk.
3. The hard disk operation method according to claim 1, wherein, The generating correlation information between the target sub-request and the target operation includes: Parse the type of the target operation to obtain operation type information; Detect whether the operation type information is an operation type; In response to the operation type information being the operation type, parse the read / write type of the target sub-request to obtain sub-request type information; Detect whether the sub-request type information is a data read type; In response to the sub-request type information being the data read type, generate correlation information indicating that the target sub-request provides operation data for the target operation; In response to the sub-request type being a data write type, generate correlation information indicating that the target sub-request processes the result data of the target operation.
4. The hard disk operation method according to claim 3, wherein In response to the correlation information meeting the set strong correlation condition, add the target sub-request to the first processing queue corresponding to the target hard disk; In response to the correlation information not meeting the strong correlation condition, adding the target sub-request to the second processing queue corresponding to the target hard disk includes: In response to the correlation information indicating that the target sub-request provides operation data for the target operation, add the target sub-request to the first processing queue corresponding to the target hard disk; In response to the correlation information indicating that the target sub-request processes the result data of the target operation, add the target sub-request to the second processing queue corresponding to the target hard disk.
5. The hard disk operation method according to claim 4, wherein, After detecting whether the operation type information is an operation type, it further includes: In response to the operation type information not being the operation type, generate correlation information indicating that the target sub-request processes the result data of the target operation.
6. The hard disk operation method according to claim 3, wherein The detecting whether the operation type information is an operation type includes: Detect whether the operation type information is a new data disk write type or a data recovery type; In response to the operation type information being the new data disk write type or the data recovery type, determine that the operation type information is the operation type.
7. The hard disk operation method according to claim 1, characterized in that, It further includes: Obtain a management instruction for the target hard disk; Add the management instruction to a third processing queue corresponding to the target hard disk; Before operating on the target hard disk according to the first processing queue, it further includes: Operate on the target hard disk according to the third processing queue. If the third processing queue is empty, execute the step of operating on the target hard disk according to the first processing queue.
8. A hard disk operating system, characterized in that, It includes: A first acquisition module, configured to acquire a target request for performing a target operation on a redundant array of independent disks (RAID) group; A first determination module, configured to determine a target hard disk that needs to be operated according to the target request; A first splitting module, configured to split the target request into target sub-requests for operating on the target hard disk; A first generation module, configured to generate correlation information between the target sub-request and the target operation; A first addition module, configured to, in response to the correlation information meeting a set strong correlation condition, add the target sub-request to a first processing queue corresponding to the target hard disk; in response to the correlation information not meeting the strong correlation condition, add the target sub-request to a second processing queue corresponding to the target hard disk; A first operation module, configured to operate on the target hard disk according to the first processing queue. If the first processing queue is empty, operate on the target hard disk according to the second processing queue.
9. An electronic device, characterized in that, It includes: A memory, configured to store a computer program; A processor, configured to implement the steps of the hard disk operation method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that, A computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the hard disk operation method according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Data request processing method and device, equipment and storage medium
CN120687041A
A data request processing method, device, apparatus, and storage medium
CN120687041B