Command execution method and device, equipment and medium

By splitting the aggregate command into full stripes, the problem of degraded read and write performance in the SSD RAID array is solved, reducing the number of read and write times and extending the disk life.

CN120653200APending Publication Date: 2025-09-16SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510764741.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-09
Publication Date
2025-09-16

AI Technical Summary

Technical Problem

In the prior art, the read and write performance of an SSD RAID array is affected by frequent erase and write operations, resulting in performance degradation. Therefore, how to reduce the number of read and write operations on the disks in the disk array card has become an urgent problem to be solved.

Method used

By splitting the aggregate command into full stripes and performing read and write operations on the disk array card based on the split commands, the number of read and write operations on the disk is reduced and the read and write performance is improved.

Benefits of technology

By aggregating and splitting commands, the number of read and write operations on the disks in the disk array card is reduced, the read and write performance of the disks is improved, and the service life of the disks is extended.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120653200A_ABST
    Figure CN120653200A_ABST
Patent Text Reader

Abstract

The invention discloses a command execution method and device, equipment and a medium, and relates to the field of command processing, and the method comprises the steps: determining whether to update a current aggregation command based on an original read-write command or not by judging whether the original read-write command currently issued by a host meets a preset aggregation condition or not; wherein the preset aggregation condition comprises that the original read-write command and the current aggregation command correspond to the same target disk array card and have the same identification information; and if the original read-write command does not meet a preset aggregation condition or the updated current aggregation command meets a preset end condition, determining the number of logic blocks required by a full stripe based on the target disk array card, and splitting the current aggregation command so as to execute corresponding read-write operation on the target disk array card based on the split command. According to the method, the aggregation command is subjected to full stripe splitting, and the read-write operation is executed on the disk array card based on the split command, so that the read-write frequency of the disk in the disk array card can be reduced, and the read-write performance of the disk is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of command processing, and in particular to a command execution method, apparatus, device and medium. Background Art

[0002] In data center server systems, to improve disk storage read / write performance, scalability, and security, server manufacturers integrate RAID (Redundant Arrays of Independent Disks) cards based on the PCIE (Peripheral Component Interconnect Express) interface, a high-speed serial computer expansion bus standard, to manage disks. RAID cards typically support SATA (Serial Advanced Technology Attachment) mechanical hard drives. However, with the rapid development of computer technology and the surge in data processing demands, mechanical hard drives are increasingly unable to meet these demands.

[0003] SSD RAID arrays based on the NVMe (Non-Volatile Memory Express) protocol offer faster read and write speeds and greater security than full SATA arrays. However, due to the physical properties of SSDs (Solid State Disks), they also present some inherent challenges. For example, data written to an SSD cannot be directly updated; it can only be overwritten by sectors, which requires erasing before overwriting. However, erase operations cannot be performed on sectors, but only on disk blocks. Therefore, before erasing a block, the existing valid data must be read out, the block erased, and then written over with the new data. These repeated operations result in more erase and write operations, which reduces disk read and write performance.

[0004] It can be seen that how to reduce the number of read and write operations on the disks in the disk array card and improve the read and write performance of the disks is a problem that those skilled in the art need to solve. Summary of the Invention

[0005] The purpose of the embodiments of the present invention is to provide a command execution method, apparatus, device, and medium. By splitting aggregate commands into full stripes and executing read and write operations on disk array cards based on the split commands, the number of read and write operations on the disks in the disk array cards can be reduced, thereby improving the read and write performance of the disks. The specific solution is as follows:

[0006] In a first aspect, the present invention provides a command execution method, comprising:

[0007] Obtaining the original read / write command currently issued by the host, and determining whether to update the current aggregation command based on the original read / write command by determining whether the original read / write command meets a preset aggregation condition; the preset aggregation condition includes that the original read / write command and the current aggregation command correspond to the same target disk array card and have the same identification information;

[0008] If the original read / write command does not meet the preset aggregation condition or the updated current aggregation command meets the preset end condition, the command splitting operation is triggered to determine the number of logical blocks required for a full stripe based on the number of data disks in the target disk array card and the minimum number of storage blocks of the data disks;

[0009] The current aggregation command is split using the number of logical blocks required for the full stripe, and corresponding read and write operations are performed on the target disk array card based on the split commands.

[0010] Optionally, the preset aggregation condition further includes that the original read / write command is the first read / write command, and the first read / write command is the first command issued by the host after startup or the first command issued by the host after the command splitting operation is triggered;

[0011] Accordingly, determining whether to update the current aggregate command based on the original read / write command by judging whether the original read / write command meets the preset aggregation condition includes:

[0012] If the original read / write command is the first read / write command, the original read / write command is determined as a new current aggregation command.

[0013] Optionally, the preset aggregation condition further includes that the starting logical block address of the original read / write command is the next address that is continuous with the ending logical block address of the current aggregation command; and the ending logical block address of the current aggregation command is an address determined based on the starting logical block address of the current aggregation command and the total number of logical blocks of the current aggregation command.

[0014] Accordingly, determining whether to update the current aggregate command based on the original read / write command by judging whether the original read / write command meets the preset aggregation condition includes:

[0015] If the original read / write command meets the preset aggregation condition, the total number of logical blocks of the current aggregation command is accumulated based on the total number of logical blocks of the original read / write command to update the current aggregation command.

[0016] Optionally, the preset end condition includes that the total number of logic blocks of the updated current aggregation command reaches a preset number.

[0017] Optionally, the identification information includes submission queue identification information, operation code identification information, and namespace identification information.

[0018] Optionally, the command execution method proposed by the present invention further includes:

[0019] During the process of updating the current aggregation command, if the original read and write commands issued by the host are not obtained within the preset time period, the command splitting operation is triggered.

[0020] Optionally, the current aggregation command is split using the number of logical blocks required for a full stripe, and corresponding read and write operations are performed on the target disk array card based on the split commands, including:

[0021] Using the number of logical blocks required for a full stripe, a corresponding number of logical blocks are sequentially split from the current aggregation command to obtain the split commands;

[0022] Determining, based on the original read and write commands corresponding to the logic blocks contained in the split commands, a layout relationship between the original read and write commands among the split commands; wherein the layout relationship includes whether the original read and write commands are completely located in the same split command or distributed in different split commands;

[0023] Based on the split commands, corresponding read and write operations are performed on the target disk array card, and according to the execution status and layout relationship of the split commands, the original read and write commands that have been executed are determined in sequence, and the execution results of the original read and write commands that have been executed are returned to the host.

[0024] In a second aspect, the present invention provides a command execution device, comprising:

[0025] A command aggregation module is configured to obtain the original read / write command currently issued by the host and determine whether to update the current aggregate command based on the original read / write command by determining whether the original read / write command meets a preset aggregation condition; the preset aggregation condition includes that the original read / write command and the current aggregate command correspond to the same target disk array card and have the same identification information;

[0026] A split trigger module is used to trigger a command split operation if the original read / write command does not meet the preset aggregation condition or the updated current aggregation command meets the preset end condition, so as to determine the number of logical blocks required for a full stripe based on the number of data disks in the target disk array card and the minimum number of storage blocks of the data disks;

[0027] The command execution module is used to split the current aggregation command using the number of logical blocks required for the full stripe, and perform corresponding read and write operations on the target disk array card based on the split commands.

[0028] In a third aspect, the present invention provides an electronic device, comprising:

[0029] Memory for storing computer programs;

[0030] The processor is configured to execute a computer program to implement the steps of the aforementioned command execution method.

[0031] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the aforementioned command execution method when the computer program is executed by a processor.

[0032] In the present invention, an original read / write command currently issued by a host is obtained, and whether the original read / write command satisfies a preset aggregation condition is judged to determine whether the current aggregation command should be updated based on the original read / write command; the preset aggregation condition includes that the original read / write command and the current aggregation command correspond to the same target disk array card and have the same identification information; if the original read / write command does not satisfy the preset aggregation condition or the updated current aggregation command satisfies a preset end condition, a command splitting operation is triggered to determine the number of logical blocks required for a full stripe based on the number of data disks in the target disk array card and the minimum number of storage blocks of the data disks; the current aggregation command is split using the number of logical blocks required for the full stripe, and corresponding read / write operations are performed on the target disk array card based on the split commands.

[0033] Beneficial Effects: The present invention aggregates original read and write commands corresponding to the same disk array card and having the same identification information from the host, determines the number of logical blocks required for a full stripe based on the number of data disks in the disk array card and the minimum number of storage blocks of the data disk, and then performs full stripe splitting on the aggregated commands using the number of logical blocks required for the full stripe, thereby executing corresponding read and write operations on the disk array card based on the split commands. It can be seen that compared to executing corresponding read and write operations on the disk array card individually based on each read and write command issued by the host, this solution significantly reduces the number of read and write operations on the disks in the disk array card, thereby improving the read and write performance of the disks and extending the service life of the disks. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the embodiments of the present invention, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0035] Figure 1 A flow chart of a command execution method provided by an embodiment of the present invention;

[0036] Figure 2 A command execution flow chart provided by an embodiment of the present invention;

[0037] Figure 3 A command aggregation flow chart provided by an embodiment of the present invention;

[0038] Figure 4 A schematic diagram of the structure of a command execution device provided by an embodiment of the present invention;

[0039] Figure 5 A structural diagram of an electronic device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0040] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making any creative efforts shall fall within the scope of protection of the present invention.

[0041] The terms "including" and "having," as used in the present description and accompanying drawings, and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or elements is not limited to the listed steps or elements and may include steps or elements that are not listed.

[0042] In order to enable those skilled in the art to better understand the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific implementation methods.

[0043] Data written to an SSD cannot be directly updated; it can only be overwritten by overwriting sectors. Before overwriting, it must be erased. However, the erase operation cannot be performed on sectors, but only on disk blocks. Therefore, before erasing a block, the original valid data must be read out, the block erased, and then written together with the new data. These repeated operations result in more erase and write operations, thereby reducing the read and write performance of the disk. To this end, the present invention provides a command execution method that reduces the number of read and write operations on the disks in the disk array card by splitting the aggregate command into full stripes and performing read and write operations on the disk array card based on the split commands. This method improves the read and write performance of the disks.

[0044] See also Figure 1 As shown, an embodiment of the present invention provides a command execution method, including:

[0045] Step S11: Obtain the original read / write command currently issued by the host, and determine whether to update the current aggregation command based on the original read / write command by judging whether the original read / write command meets the preset aggregation condition; the preset aggregation condition includes that the original read / write command and the current aggregation command correspond to the same target disk array card and have the same identification information.

[0046] In an embodiment of the present invention, the original read and write commands currently issued by the host are obtained, and it is determined whether the original read and write commands meet the preset aggregation conditions; if the original read and write commands meet the preset aggregation conditions, the current aggregation command is updated based on the original read and write commands; if the original read and write commands do not meet the preset aggregation conditions, a command splitting operation for the current aggregation command is triggered.

[0047] The preset aggregation condition includes the original read / write command and the current aggregation command corresponding to the same target disk array card and having the same identification information. It should be noted that the determination condition for whether the original read / write command and the current aggregation command correspond to the same target disk array card includes whether the disk array card corresponding to the original read / write command and the disk array card corresponding to the current aggregation command have the same array card identification and array card level. Different disk array cards correspond to different array card identifications, and array card levels include, but are not limited to, RAID 5, RAID 6, RAID 10, etc.

[0048] In addition, the identification information includes submission queue identification information, operation code identification information, namespace identification information, etc. The submission queue identification information is used to identify the queue that the host submits commands to the NVMe SSD device. Different submission queues (SQ, Submission Queue) in the host correspond to different submission queue identification information. At the same time, the submission queue identification information can also represent which submission queue in the host the read and write commands come from. Operation code identification information (opcode) is used to identify the read and write properties of the read and write commands. The namespace identification information is used to identify the namespace that the controller of the NVMe SSD device needs to access. Different command spaces (Namespace) correspond to different namespace identification information, and the namespace can be understood as a set of logical block addresses (LBA, Logical Block Address) that the host can directly access.

[0049] Furthermore, the preset aggregation condition also includes that the original read / write command is the first read / write command issued by the host, and that the first read / write command issued by the host is the first command issued by the host after the host is started or the first command issued by the host after the command splitting operation is triggered. Based on this, if the original read / write command currently issued by the host is obtained, and that original read / write command is the first read / write command issued by the host after the host is started or the first read / write command issued by the host after the command splitting operation is triggered, the original read / write command is directly determined as the new current aggregation command. In this case, the starting logical block address (SLBA) of the current aggregation command is the starting logical block address of the original read / write command (the first read / write command issued by the host), and the total number of logical blocks in the current aggregation command is the number of logical blocks (NLB) in the original read / write command (the first read / write command issued by the host). Furthermore, the disk array card and identification information corresponding to the current aggregation command are the same as the disk array card and identification information corresponding to the original read / write command (the first read / write command issued by the host).

[0050] In the method proposed in this invention, the NVMe SSD device divides its address space into logical blocks. When a host submits a read or write command to the NVMe SSD device, the command includes the starting logical block address (SLBA), which indicates the logical block in the device space from which data is to be read or written. Furthermore, the command also includes the number of logical blocks (NLB), which indicates the number of logical blocks of data to be read or written from the starting logical block address (SLBA) in the device space.

[0051] Secondly, the preset aggregation condition also includes that the starting logical block address of the original read / write command is the next address that is continuous with the ending logical block address of the current aggregate command; and the ending logical block address of the current aggregate command is an address determined based on the starting logical block address of the current aggregate command and the total number of logical blocks in the current aggregate command. In other words, the starting logical block address of the current aggregate command + the total number of logical blocks in the current aggregate command + 1 = the starting logical block address of the original read / write command currently issued by the host.

[0052] Accordingly, if the original read / write command and the current aggregate command correspond to the same target disk array card and have the same identification information, and the starting logical block address of the original read / write command is the next address continuous with the ending logical block address of the current aggregate command, then the total number of logical blocks of the current aggregate command is accumulated based on the total number of logical blocks of the original read / write command to update the current aggregate command. At this time, the starting logical block address of the current aggregate command is still the starting logical block address of the first read / write command issued by the host, but the total number of logical blocks of the current aggregate command has been updated to the total number of logical blocks of the current aggregate command + the total number of logical blocks of the original read / write command currently issued by the host.

[0053] Taking the starting logical block address of the current aggregate command as 0x0001, the total number of logical blocks of the current aggregate command as 2, and the corresponding ending logical block address of the current aggregate command as 0x0011 as an example, if the original read and write command currently issued by the host is obtained, and the starting logical block address of the original read and write command is 0x0100, and the number of logical blocks of the original read and write command is 2, then the total number of logical blocks of the original read and write command is 3. Correspondingly, the total number of logical blocks of the current aggregate command is 2+3=5, and the ending logical block address of the current aggregate command is 0x0110.

[0054] Specifically, when obtaining the first original read-write command issued by the host, the first original read-write command is directly determined as the new current aggregate command. At this time, the disk array card and identification information corresponding to the current aggregate command are the disk array card and identification information corresponding to the first original read-write command, the starting logical block address of the current aggregate command is the starting logical block address of the first original read-write command, and the total number of logical blocks of the current aggregate command is the number of logical blocks of the first original read-write command. Afterwards, when obtaining the second original read-write command issued by the host, if the second original read-write command corresponds to the same disk array card and has the same identification information as the current aggregate command, and the starting logical block address of the original read-write command is the next address continuous with the ending logical block address of the current aggregate command, then the total number of logical blocks of the current aggregate command is accumulated based on the total number of logical blocks of the second original read-write command to update the current aggregate command. And so on, thereby achieving continuous updating of the current aggregate command.

[0055] Step S12: If the original read / write command does not meet the preset aggregation condition or the updated current aggregation command meets the preset end condition, the command splitting operation is triggered to determine the number of logical blocks required for the full stripe based on the number of data disks in the target disk array card and the minimum number of storage blocks of the data disk.

[0056] In an embodiment of the present invention, if the original read / write command currently issued by the host does not meet the preset aggregation condition or the updated current aggregation command meets the preset end condition, a command splitting operation of the current aggregation command is triggered to determine the number of logical blocks required for the full stripe based on the number of data disks in the target disk array card and the minimum number of storage blocks of the data disk.

[0057] Among them, the situations where the original read and write commands do not meet the preset aggregation conditions include: the original read and write commands and the current aggregation command correspond to different disk array cards, the original read and write commands and the current aggregation command have different identification information, and the starting logical block address of the original read and write commands is not the next address continuous with the ending logical block address of the current aggregation command.

[0058] Furthermore, the preset termination condition includes that the total number of logic blocks of the updated current aggregate command reaches a preset number. That is, if the total number of logic blocks of the updated current aggregate command reaches a preset number, the command splitting operation of the current aggregate command is triggered.

[0059] Furthermore, in order to avoid the need to wait for the host to issue the next read / write command for a long time during the process of updating the current aggregate command, thereby affecting the real-time performance of command execution, the present invention sets a preset time period to determine whether the original read / write command issued by the host is obtained within the preset time period during the process of updating the current aggregate command. If the original read / write command issued by the host is not obtained within the preset time period, a command splitting operation is triggered. Accordingly, if the original read / write command issued by the host is obtained within the preset time period, the current aggregate command is determined based on the original read / write command by determining whether the original read / write command meets the preset aggregation condition.

[0060] As for the number of logical blocks required for a full stripe, since the disk array card level can reflect whether the disk array card has a check disk and the number of check disks it has, the present invention needs to determine the number of data disks in the target disk array card based on the array card level of the target disk array card. Then, based on the number of data disks in the target disk array card and the minimum number of storage blocks of the data disks, the number of logical blocks required for a full stripe is determined. In other words, the number of logical blocks required for a full stripe = the number of data disks in the target disk array card × the minimum number of storage blocks of the data disks.

[0061] Step S13: split the current aggregation command using the number of logical blocks required for a full stripe, and perform corresponding read and write operations on the target disk array card based on the split commands.

[0062] In an embodiment of the present invention, after determining the number of logical blocks required for a full stripe, the current aggregate command is split using the number of logical blocks required for the full stripe to obtain split commands, and corresponding data read and write operations are performed on the target disk array card in parallel based on the split commands.

[0063] Taking the example of 10 logical blocks required for a full stripe and 30 logical blocks in the current aggregate command, by splitting the current aggregate command using the number of logical blocks required for a full stripe, three split commands can be obtained. That is, each split command contains 10 logical blocks, and full stripe reading and writing can be performed on the target disk array card based on each split command.

[0064] Since non-full stripe reading and writing require first reading the old data and checksum, and then recalculating and writing the new checksum based on the new and old data, this will increase the number of disk reads and writes and the consumption of computing resources. However, the checksum calculation for full stripe reading and writing is completed in one go, which can reduce the number of disk reads and writes, improve the disk's read and write performance, and extend the disk's service life.

[0065] Specifically, the number of logical blocks required for the full stripe is used to sequentially split a corresponding number of logical blocks from the current aggregate command to obtain each split command. Based on the original read and write commands corresponding to the logical blocks contained in the split commands, the layout relationship of each original read and write command among the split commands is determined; wherein, the layout relationship includes whether the original read and write commands are completely located in the same split command or distributed in different split commands. Based on the split commands, the corresponding read and write operations are performed on the target disk array card, and according to the execution status of the split commands and the layout relationship of each original read and write command among the split commands, the original read and write commands that have been executed are sequentially determined, and the execution results of the original read and write commands that have been executed are returned to the host.

[0066] Among them, in the process of using the number of logical blocks required for a full stripe to sequentially split a corresponding number of logical blocks from the current aggregate command to obtain each split command, first determine whether the total number of logical blocks contained in the current aggregate command (the total number of logical blocks of the current aggregate command + 1) is greater than the number of logical blocks required for a full stripe; if greater, then use the number of logical blocks required for a full stripe to split a corresponding number of logical blocks from the current aggregate command to obtain the current split command, and update the current aggregate command based on the current split command, including updating the starting logical block address and the total number of logical blocks of the current aggregate command, and then jump back to the above-mentioned determination of whether the total number of logical blocks contained in the current aggregate command is greater than the number of logical blocks required for a full stripe, until the total number of logical blocks contained in the current aggregate command is not greater than the number of logical blocks required for a full stripe. At this time, the current aggregate command is directly used as the last split command, thereby completing the splitting of the current aggregate command to obtain each split command.

[0067] Assume that the current aggregate command consists of original read / write command 1, which contains 5 logical blocks; original read / write command 2, which contains 20 logical blocks; and original read / write command 3, which contains 5 logical blocks. Using the number of logical blocks required for a full stripe (10), the current aggregate command can be split into three commands: three split commands each containing 10 logical blocks. In this case, original read / write command 1 is completely contained within split command 1; original read / write command 2 is distributed across split commands 1, 2, and 3; and original read / write command 3 is completely contained within split command 3. If split command 1 completes first, the execution result of original read / write command 1 is returned to the host based on the layout of the original read / write commands among the split commands. If split command 3 completes second, the execution result of original read / write command 3 is returned to the host based on the layout of the original read / write commands among the split commands. If split command 2 completes last, the execution result of original read / write command 2 is returned to the host based on the layout of the original read / write commands among the split commands.

[0068] More specifically, after determining the layout relationship between the split commands from the original read / write command, the present invention can also set a corresponding command distribution identifier for each split command based on the layout relationship. That is, based on the layout relationship, the completeness of each original read / write command contained in the split command and the distribution of logical blocks are determined, thereby setting a corresponding command distribution identifier for the split command.

[0069] For example, if it is determined based on the layout relationship that the split command 1 sequentially includes the complete original read and write command 1 and the incomplete original read and write command 2, and includes the starting logical block of the original read and write command 2, then the command distribution identifier of IsHeadCID=0, IsbodyCID=0, and IstailCID=1 is set for the split command 1. If it is determined based on the layout relationship that the split command 2 sequentially includes the incomplete original read and write command 2, and does not include the starting logical block and the ending logical block of the original read and write command 2, then the command distribution identifier of IsHeadCID=0, IsbodyCID=1, and IstailCID=0 is set for the split command 2. If it is determined based on the layout relationship that the split command 3 sequentially includes the incomplete original read and write command 2 and the complete original read and write command 3, and includes the ending logical block of the original read and write command 2, then the command distribution identifier of IsHeadCID=1, IsbodyCID=0, and IstailCID=0 is set for the split command 3.

[0070] IsHeadCID=1 indicates that the first command in the currently split command and the last command in the previously split command belong to the same original read / write command. IstailCID=1 indicates that the last command in the currently split command and the first command in the next split command belong to the same original read / write command. IsbodyCID=1 indicates that the currently split command contains only one command, and that this command, the last command in the previously split command, and the first command in the next split command belong to the same original read / write command.

[0071] Correspondingly, if all commands contained in the split command are complete, the command distribution identifier of IsHeadCID=0, IsbodyCID=0, and IstailCID=0 is set for the split command. If the split command sequentially contains the incomplete original read / write command 4, the complete original read / write command 5, and the incomplete original read / write command 6, and contains the ending logical block of the original read / write command 4 and the starting logical block of the original read / write command 6, the command distribution identifier of IsHeadCID=1, IsbodyCID=0, and IstailCID=1 is set for the split command.

[0072] Furthermore, after setting the corresponding command distribution identifier for the split command, the corresponding read and write operations are performed on the target disk array card based on the split command, and according to the execution status of the split command and the command distribution identifier, the original read and write commands that have been executed are determined in turn, and the execution results of the original read and write commands that have been executed are returned to the host.

[0073] Since the split commands are executed in parallel, the execution completion time of the split commands may be different. The present invention obtains the split commands that have been executed in sequence, and records the currently acquired split commands that have been executed as completed split commands, and obtains the original read-write commands that are completely located in the completed split commands and the original read-write commands that are incomplete in the completed split commands according to the command distribution identifier of the completed split commands. The original read-write commands that are completely located in the completed split commands are used as the original read-write commands that have been executed, and the execution results of the original read-write commands are returned to the host. According to the command distribution identifier of the completed split commands, other split commands related to the original read-write commands that are incomplete in the completed split commands are determined, and then according to the execution status of the other split commands, it is determined whether to use the original read-write commands that are incomplete in the completed split commands as the original read-write commands that have been executed, and if so, the execution results of the original read-write commands are returned to the host.

[0074] Beneficial Effects: The present invention aggregates original read and write commands corresponding to the same disk array card and having the same identification information from the host, determines the number of logical blocks required for a full stripe based on the number of data disks in the disk array card and the minimum number of storage blocks of the data disk, and then performs full stripe splitting on the aggregated commands using the number of logical blocks required for the full stripe, thereby executing corresponding read and write operations on the disk array card based on the split commands. It can be seen that compared to executing corresponding read and write operations on the disk array card individually based on each read and write command issued by the host, this solution significantly reduces the number of read and write operations on the disks in the disk array card, thereby improving the read and write performance of the disks and extending the service life of the disks.

[0075] Based on the above embodiment, the present invention can also introduce a control page table to record the information of the original read and write commands issued by the host, the information of the current aggregated command, and the information of each split command, etc. The control page table is shown in Table 1 below:

[0076] Table 1 Control Page Table

[0077]

[0078] RaidGroup: The array card ID of the disk array card. Different disk array cards correspond to different array card IDs.

[0079] NameSpaceOffsetInRaidGroup: The offset of the current namespace in the disk array card, in NLB units.

[0080] RaidLevel: The array card level of the disk array card.

[0081] ChunkSize: The minimum number of storage blocks in the data disk of the disk array card. The number of logical blocks required for a full stripe can be obtained by multiplying ChunkSize by StripeDataLength.

[0082] StripeLength: The total number of data disks and parity disks in the disk array card.

[0083] StripeDataLength: The number of data disks in the disk array card.

[0084] PHYCH: The channel identification and disk status information of the disk in the disk array card.

[0085] CID: Command identifier of the original read / write command sent by the host. Different original read / write commands correspond to different command identifiers.

[0086] SLBA: The starting logical block address of the IO command.

[0087] NLB: The number of logical blocks of the IO command. The termination logical block address of the IO command = SLBA + NLB.

[0088] NSID: Namespace identification information.

[0089] SQID: Submit queue identification information.

[0090] ControllerID: Controller ID, used to distinguish different controllers in an NVMe SSD device and to identify the controller communicating with the host.

[0091] StartOrgDevID: The disk ID of the starting data disk corresponding to the IO command in the disk array card.

[0092] StartChunkOffset: The starting data block offset of the IO command.

[0093] StripeID: Stripe ID. Different split commands correspond to different stripe IDs.

[0094] IsHeadCID=1 indicates that the first command in the currently split command and the last command in the previously split command belong to the same original read / write command.

[0095] IstailCID=1 indicates that the last command in the currently split command and the first command in the next split command belong to the same original read / write command.

[0096] IsbodyCID=1 indicates that the currently split command contains only one command, and the command, the last command in the previous split command, and the first command in the next split command belong to the same original read / write command.

[0097] CID*m: indicates the command identifiers of the m original read and write commands contained in the split command.

[0098] Done: Used to indicate whether the split command has been executed. If it is set to 0, it means that the split command has not been executed. If it is set to 1, it means that the split command has been executed.

[0099] Further, such as Figure 2 As shown, the command execution method of the present invention is described in detail based on the control page table proposed in the previous embodiment:

[0100] The aggregation module obtains the original read / write command currently issued by the host and determines whether the original read / write command meets the preset aggregation conditions to determine whether to update the current aggregation command based on the original read / write command. The aggregation module also updates the control page table based on the original read / write command and the updated current aggregation command. The preset aggregation conditions include that the original read / write command and the current aggregation command correspond to the same target disk array card and have the same identification information.

[0101] When the original read / write command fails to meet the preset aggregation conditions or the updated current aggregate command meets the preset termination conditions, the aggregation module triggers a command splitting operation. The splitting module determines the number of logical blocks required for a full stripe based on the number of data disks and the minimum number of storage blocks on the target disk array card. The current aggregate command is split using the required number of logical blocks, and the corresponding read / write operations are performed on the target disk array card based on the split commands. Simultaneously, the control page table is updated based on the split commands, adding the split command information to the control page table.

[0102] The return host module obtains information about the split commands from the control page table, such as which original read and write commands are included in the split commands and the layout relationship between the original read and write commands among the split commands. Then, based on the execution status of the split commands, the original read and write commands that have been executed are determined in turn, and the execution results of the original read and write commands that have been executed are returned to the host.

[0103] by Figure 3 For example, the read and write command aggregation process of the present invention is described in detail based on the control page table proposed in the above embodiment:

[0104] The first original read / write command issued by the host is obtained and determined as the new current aggregate command. The control page table is updated based on the first original read / write command and the new current aggregate command. At this time, the disk array card and identification information corresponding to the current aggregate command are the same as those corresponding to the first original read / write command, the starting logical block address of the current aggregate command is the same as the starting logical block address of the first original read / write command, and the total number of logical blocks in the current aggregate command is the same as the number of logical blocks in the first original read / write command.

[0105] Determine whether the next original read / write command issued by the host is obtained within the preset time period. If the next original read / write command issued by the host is not obtained within the preset time period, trigger a command splitting operation on the current aggregation command.

[0106] If the next original read / write command from the host is received within a preset time period, the system determines whether the next original read / write command corresponds to the same disk array card and has the same identification information as the current aggregate command. Furthermore, the system determines whether the starting logical block address of the next original read / write command is a continuous next logical block address as the ending logical block address of the current aggregate command. If not, the system triggers a command splitting operation for the current aggregate command.

[0107] If so, the total number of logical blocks of the current aggregate command is accumulated based on the total number of logical blocks of the next original read / write command to update the current aggregate command. At the same time, the control page table is updated based on the next original read / write command and the updated current aggregate command. Then, a determination is made as to whether the total number of logical blocks of the updated current aggregate command reaches the preset number. If so, a command splitting operation is triggered for the current aggregate command. If not, the process returns to the above step of determining whether the next original read / write command issued by the host is obtained within the preset time period.

[0108] See also Figure 4 As shown, an embodiment of the present invention provides a command execution device, including:

[0109] The command aggregation module 11 is configured to obtain the original read / write command currently issued by the host and determine whether to update the current aggregate command based on the original read / write command by determining whether the original read / write command meets a preset aggregation condition; the preset aggregation condition includes that the original read / write command and the current aggregate command correspond to the same target disk array card and have the same identification information;

[0110] A split trigger module 12 is configured to trigger a command split operation if the original read / write command does not meet a preset aggregation condition or the updated current aggregation command meets a preset end condition, so as to determine the number of logical blocks required for a full stripe based on the number of data disks in the target disk array card and the minimum number of storage blocks of the data disks;

[0111] The command execution module 13 is configured to split the current aggregation command using the number of logical blocks required for a full stripe, and execute corresponding read and write operations on the target disk array card based on the split commands.

[0112] Since the embodiments of the device part correspond to the above embodiments, the embodiments of the device part please refer to the description of the embodiments of the method part, and will not be repeated here.

[0113] Beneficial Effects: The present invention aggregates original read and write commands corresponding to the same disk array card and having the same identification information from the host, determines the number of logical blocks required for a full stripe based on the number of data disks in the disk array card and the minimum number of storage blocks of the data disk, and then performs full stripe splitting on the aggregated commands using the number of logical blocks required for the full stripe, thereby executing corresponding read and write operations on the disk array card based on the split commands. It can be seen that compared to executing corresponding read and write operations on the disk array card individually based on each read and write command issued by the host, this solution significantly reduces the number of read and write operations on the disks in the disk array card, thereby improving the read and write performance of the disks and extending the service life of the disks.

[0114] Furthermore, the embodiment of the present application also discloses an electronic device, Figure 5 This is a block diagram of an electronic device according to an exemplary embodiment. The content in the diagram should not be construed as limiting the scope of use of this application. The electronic device may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps of the command execution method disclosed in any of the aforementioned embodiments. In addition, the electronic device in this embodiment may specifically be an electronic computer.

[0115] In this embodiment, the power supply 23 is used to provide operating voltage for various hardware devices on the electronic device; the communication interface 24 can create a data transmission channel between the electronic device and external devices. The communication protocol it follows is any communication protocol that can be applied to the technical solution of this application and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world. Its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0116] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or CD, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.

[0117] The operating system 221 is used to manage and control the hardware devices on the electronic device and the computer program 222, which can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program capable of implementing the command execution method performed by the electronic device disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program capable of implementing other specific tasks.

[0118] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the aforementioned command execution method is implemented. The specific steps of this method can be referred to the corresponding contents disclosed in the aforementioned embodiments and will not be repeated here.

[0119] Furthermore, the present application also discloses a computer program product, including a computer program / instructions; wherein, when executed by a processor, the computer program / instructions implement the aforementioned command execution method. The specific steps of this method can be referred to the corresponding contents disclosed in the aforementioned embodiments and will not be repeated here.

[0120] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from the other embodiments. Reference can be made to the descriptions of the identical or similar parts between the various embodiments. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple, and the relevant parts can be referred to the descriptions of the methods.

[0121] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may 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.

[0122] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0123] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only 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 terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.

[0124] The above is a detailed introduction to the technical solution provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for those skilled in the art, according to the ideas of the present application, there may be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A command execution method, characterized in that: include: Obtaining the original read / write command currently issued by the host, and determining whether to update the current aggregate command based on the original read / write command by judging whether the original read / write command meets a preset aggregation condition; The preset aggregation condition includes that the original read / write command and the current aggregation command correspond to the same target disk array card and have the same identification information; If the original read / write command does not satisfy the preset aggregation condition or the updated current aggregation command satisfies the preset end condition, a command splitting operation is triggered to determine the number of logical blocks required for a full stripe based on the number of data disks in the target disk array card and the minimum number of storage blocks of the data disks; The current aggregation command is split using the number of logical blocks required for the full stripe, and corresponding read and write operations are performed on the target disk array card based on the split commands.

2. The command execution method according to claim 1, characterized in that: The preset aggregation condition also includes that the original read / write command is the first read / write command, and the first read / write command is the first command issued by the host after startup or the first command issued by the host after the command splitting operation is triggered; Accordingly, determining whether to update the current aggregate command based on the original read / write command by judging whether the original read / write command satisfies a preset aggregation condition includes: If the original read / write command is the first read / write command, the original read / write command is determined as a new current aggregation command.

3. The command execution method according to claim 1, wherein: The preset aggregation condition also includes that the starting logical block address of the original read / write command is the next address that is continuous with the ending logical block address of the current aggregation command; and the ending logical block address of the current aggregation command is an address determined based on the starting logical block address of the current aggregation command and the total number of logical blocks of the current aggregation command; Accordingly, determining whether to update the current aggregate command based on the original read / write command by judging whether the original read / write command satisfies a preset aggregation condition includes: If the original read / write command satisfies the preset aggregation condition, the total number of logical blocks of the current aggregation command is accumulated based on the total number of logical blocks of the original read / write command to update the current aggregation command.

4. The command execution method according to claim 3, characterized in that: The preset end condition includes that the total number of logic blocks of the updated current aggregation command reaches a preset number.

5. The command execution method according to claim 1, characterized in that: The identification information includes submission queue identification information, operation code identification information, and namespace identification information.

6. The command execution method according to claim 1, characterized in that: Also includes: During the process of updating the current aggregate command, if the original read / write command issued by the host is not obtained within a preset time period, the command splitting operation is triggered.

7. The command execution method according to any one of claims 1 to 6, characterized in that: The method of splitting the current aggregation command by using the number of logical blocks required for the full stripe and performing corresponding read and write operations on the target disk array card based on the split commands includes: Sequentially splitting a corresponding number of logical blocks from the current aggregate command using the number of logical blocks required for the full stripe to obtain the split commands; Determining, based on the original read / write commands corresponding to the logic blocks contained in the split commands, a layout relationship between the original read / write commands among the split commands; wherein the layout relationship includes whether the original read / write commands are completely located in the same split command or distributed in different split commands; Based on the split commands, corresponding read and write operations are performed on the target disk array card, and according to the execution status of the split commands and the layout relationship, the original read and write commands that have been executed are determined in sequence, and the execution results of the original read and write commands that have been executed are returned to the host.

8. A command execution device, characterized in that: include: A command aggregation module is used to obtain the original read and write commands currently issued by the host, and determine whether to update the current aggregated command based on the original read and write commands by judging whether the original read and write commands meet the preset aggregation conditions; The preset aggregation condition includes that the original read / write command and the current aggregation command correspond to the same target disk array card and have the same identification information; a split trigger module, configured to trigger a command splitting operation if the original read / write command does not satisfy the preset aggregation condition or the updated current aggregation command satisfies the preset end condition, so as to determine the number of logical blocks required for a full stripe based on the number of data disks in the target disk array card and the minimum number of storage blocks of the data disks; The command execution module is configured to split the current aggregation command using the number of logic blocks required for the full stripe, and execute corresponding read and write operations on the target disk array card based on the split commands.

9. An electronic device, characterized in that: include: memory for storing computer programs; A processor, configured to execute the computer program to implement the steps of the command execution method according to 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, which, when executed by a processor, implements the steps of the command execution method according to any one of claims 1 to 7.

Citation Information

Cited By

  • RAID (Redundant Array of Independent Disks) request response method and data storage system and device

    CN122086333A

  • A method for responding to raid requests, a data storage system and apparatus

    CN122086333B