CN116027975A - Data multi-stream writing method and related device for RAID group - Google Patents

Data multi-stream writing method and related device for RAID group Download PDF

Info

Publication number
CN116027975A
CN116027975A CN202211618746.XA CN202211618746A CN116027975A CN 116027975 A CN116027975 A CN 116027975A CN 202211618746 A CN202211618746 A CN 202211618746A CN 116027975 A CN116027975 A CN 116027975A
Authority
CN
China
Prior art keywords
stream
ssd
raid group
raid
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211618746.XA
Other languages
Chinese (zh)
Inventor
张�杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
XFusion Digital Technologies Co Ltd
Original Assignee
XFusion Digital Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by XFusion Digital Technologies Co Ltd filed Critical XFusion Digital Technologies Co Ltd
Priority to CN202211618746.XA priority Critical patent/CN116027975A/en
Publication of CN116027975A publication Critical patent/CN116027975A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a data multi-stream writing method and a related device of a RAID group, wherein the method comprises the following steps: the RAID card acquires a multi-stream write command, wherein the multi-stream write command carries a first stream ID comprising data to be written, a first LBA and a target RAID group; determining SSD corresponding to the writing operation according to a RAID algorithm; if the destination SSD supports multiple streams, determining a second stream ID of the SSD corresponding to the first stream ID of the destination RAID according to the mapping table, and executing the multi-stream write operation on the destination SSD according to the second stream ID, the data to be written and the second LBA. The destination SSD is one of SSDs corresponding to the current writing operation, the mapping table is a mapping relation table between the stream ID of the RAID group and the stream ID of the SSD, and the second LBA is obtained based on the first LBA. The adoption of the embodiment can enable upper software in the server to use the multi-stream characteristic of SSDs in RAID groups.

Description

Data multi-stream writing method and related device for RAID group
Technical Field
The present disclosure relates to the field of computers, and in particular, to a method and an apparatus for writing data into a RAID group in multiple streams.
Background
When an overwrite operation is performed on a block in an SSD, due to the inherent property of flash, the data on the block cannot be simply rewritten, but the current data on the flash block is first read into a cache in the DDR, the data may include data to be rewritten and data not to be rewritten, new data and data not to be rewritten are combined in the cache in the DDR, then an erase operation is performed on the block, and finally the combined data is written into the block. This process includes read-modify-erase-write. This process has some drawbacks: even if the data of a partial area on one flash block needs to be rewritten, the whole block needs to be subjected to one-time erasing and writing operation, so that the times of erasing and writing operation are increased; the flash particles can bear limited erasing times, and the data is unreliable after exceeding the threshold value of the erasing times, namely the flash is written through; completion of the read-modify-erase operation at the time of writing may result in performance degradation.
The OP space in the SSD may reduce the probability of read-change-erase, but at the same time may lead to a cost increase. To address the above issues, SSD manufacturers and related industry organizations have proposed multi-stream features. The multi-stream marks the data with different IDs and the SSD stores the data in different areas according to the IDs. The upper software and SSD are combined to use the multi-stream characteristic, data in different life cycles can be stored in different areas, data in the same life cycle are stored in the same area, the time for overwriting and deleting the data is approximately the same, thus write amplification can be effectively reduced, the service life and performance of the SSD are improved, and the OP space can be reduced to save cost.
However, in the implementation of the RAID card of the current server, after the SSD is configured as the RAID group, the multi-stream attribute of the SSD is shielded from the operating system, so that the upper layer software cannot apply the multi-stream attribute of the SSD in the RAID group.
Disclosure of Invention
The embodiment of the application provides a data multi-stream writing method and a related device of a RAID group, and by adopting the embodiment, upper software in a server can use multi-stream characteristics of SSDs in the RAID group.
In a first aspect, the present application provides a data multi-stream writing method of a RAID group, which is applied to a RAID card.
The RAID card obtains a multi-stream write command carrying a first stream ID including data to be written, a first logical differential address (LBA), and a target RAID group. And the RAID card determines SSD corresponding to the current writing operation according to the RAID algorithm. If the destination SSD supports multiple streams, the RAID card determines a second stream ID of the SSD corresponding to the first stream ID of the destination RAID according to the mapping table, and executes the multi-stream write operation on the destination SSD according to the second stream ID, the data to be written and the second LBA. The destination SSD is one of SSDs corresponding to the current writing operation, the mapping table is a mapping relation table between the stream ID of the RAID group and the stream ID of the SSD, and the second LBA is obtained based on the first LBA.
After receiving the multi-stream write command, determining a second stream ID of the SSD corresponding to the first stream ID of the target RAID group in the multi-stream write command according to the mapping relation between the stream IDs of the RAID group and the stream IDs of the SSD, and further, directly using the second ID of the SSD to execute multi-stream write operation on the target SSD, so that upper software in the server can use the multi-stream characteristic of the SSD in the RAID group.
In one possible implementation, if the destination SSD does not support multi-streaming, the RAID card performs a normal write operation to the destination SSD according to the data to be written and the second LBA.
The multi-stream write command may be a SCSI multi-stream write command or an NVME multi-stream write command.
For SCSI multi-stream write commands, multi-stream write operations may be implemented for a RAID group presented to host as a SCSI device; for NVME multi-stream write commands, multi-stream write operations for RAID groups presented to host as NVME devices may be implemented.
In one possible implementation, the method of the present application further includes:
the RAID card receives a first stream control instruction, wherein the first stream control instruction is used for applying for stream for a target RAID group; if the number of the opened streams of the target RAID group does not exceed the number of the streams supported by the target RAID group, the RAID card allocates a third stream ID for the target RAID group, and acquires at least one stream ID of each SSD from each SSD in at least one SSD supporting multiple streams in the target RAID group; the RAID card establishes a mapping relation between a fourth stream ID and a third stream ID of each SSD, and stores the mapping relation into a mapping table, wherein the fourth stream ID of each SSD is one of at least one stream ID of each SSD.
Before the new stream ID is allocated to the RAID group, judging whether the number of the opened streams of the RAID group exceeds the number of the streams supported by the RAID group, and allocating the new stream ID to the RAID group when the number of the opened streams of the RAID group is determined not to exceed the number of the streams supported by the RAID group, so that the situation that the opened streams of the RAID group exceed the streams supported by the RAID group is avoided. By constructing the mapping table, the subsequent RAID card can determine the stream ID of the SSD corresponding to the stream ID of the RAID group based on the mapping table, and then the multi-stream write operation can be directly executed on the SSD by using the stream ID of the SSD, so that the multi-stream characteristic of the SSD in the RAID group can be used by upper software in the server.
In one possible implementation, the RAID card obtains at least one stream ID for each SSD from each of the at least one SSDs supporting multiple streams in the target RAID group, including:
the RAID card sends a second stream control instruction to each SSD; a first response to the second stream control instruction sent by each SSD is received, the first response including one stream ID for each SSD.
When the target RAID group appears as a SCSI device, for SAS disks supporting multiple flows in the target RAID group, the flow IDs of the SAS disks can be acquired in this manner.
In one possible implementation, the RAID card obtains at least one stream ID for each SSD from each of the at least one SSDs supporting multiple streams in the target RAID group, including:
the RAID card sends a first resource allocation instruction to each SSD; the first configuration resource instruction is used for indicating SSD feedback stream ID; the RAID card receives a second response to the first configuration resource instruction sent by each SSD, wherein the second response carries at least one stream ID of each SSD.
When the target RAID group appears as a SCSI device, for the NVME disk supporting multiple streams in the target RAID group, the stream ID of the NVME disk can be acquired in this way.
In one possible implementation, the third stream ID of each SSD is one idle stream ID of the at least one stream ID of each SSD, and the method of the application includes:
The RAID card marks the fourth stream ID of each SSD as used after establishing a mapping relation between the fourth stream ID and the third stream ID of each SSD.
In one possible implementation, a third response to the first flow control instruction is sent, the third response carrying a third flow ID.
In one possible implementation, the method of the present application further includes:
the RAID card receives a second configuration resource instruction, wherein the second configuration resource instruction is used for applying for a stream for a target RAID group, and the second configuration resource instruction carries quantity indication information, and the quantity indication information is used for indicating quantity M; if the overcurrent ID is not allocated to the target RAID group, the RAID card allocates M fifth stream IDs to the target RAID group; the RAID card acquires a plurality of sixth stream IDs of each SSD from each SSD in at least one SSD supporting multiple streams in a target RAID group, wherein the total number of the sixth stream IDs acquired from each SSD in the at least one SSD is not more than the number of streams supported by the target RAID; and the RAID card establishes a mapping relation between a plurality of sixth stream IDs of each SSD in the at least one SSD and each fifth stream ID, and stores the mapping relation into a mapping table.
Before the new stream ID is allocated to the RAID group, judging whether the over-current ID is allocated to the RAID, and allocating the new stream ID to the RAID group when determining that the stream ID is not allocated to the RAID group, thereby avoiding the situation that the number of the stream IDs allocated to the RAID group exceeds the stream ID supported by the RAID group. By constructing the mapping table, the subsequent RAID card can determine the stream ID of the SSD corresponding to the stream ID of the RAID group based on the mapping table, and then the multi-stream write operation can be directly executed on the SSD by using the stream ID of the SSD, so that the multi-stream characteristic of the SSD in the RAID group can be used by upper software in the server.
In one possible implementation, obtaining, from each SSD of the at least one SSD indicating the multiple streams in the target RAID group, a plurality of sixth stream IDs for each SSD includes:
the RAID card sends a third configuration resource instruction to at least one SSD in the SSD supporting the flow in the target RAID group, and receives a fourth response, which is fed back by the at least one SSD and is aimed at the second configuration resource instruction, wherein the fourth response carries a plurality of sixth flow IDs of each SSD in the at least one SSD.
When the target RAID group appears as an NVME device, the stream ID of the NVME disk can be acquired in this way for the NVME disk supporting multiple streams in the target RAID group.
In one possible implementation, the method of the present application further includes:
the RAID card sends a fifth response to the second configuration resource instruction, wherein the fifth response carries the M fifth stream IDs.
In one possible implementation, the method of the present application further includes:
the RAID card receives a RAID group creation instruction, wherein the RAID group creation instruction is used for indicating to create a target RAID group; the RAID group creation instruction comprises identifiers of a plurality of first SSDs; the RAID card determines a plurality of first SSDs according to the plurality of first SSD identifiers, and the target RAID group comprises the plurality of first SSDs; the RAID card acquires a second SSD from the plurality of first SSDs, wherein the second SSD is an SSD supporting multiple streams in the plurality of first SSDs; the RAID card takes the number of the flows supported by the third SSD as the number of the flows supported by the target RAID group; the third SSD is the SSD in which the number of supported streams in the second SSD is the smallest.
By setting attributes for the target RAID group: the number of the supporting streams can avoid the situation that the stream ID allocated for the target RAID group exceeds the self capacity of the target RAID group.
In a second aspect, the present application provides a RAID card comprising:
the system comprises an acquisition unit, a storage unit and a storage unit, wherein the acquisition unit is used for acquiring a multi-stream write command, wherein the multi-stream write command carries a first stream ID comprising data to be written, LBA and a target RAID group;
the determining unit is used for determining SSD corresponding to the current writing operation from the target RAID group according to the RAID algorithm; if the destination SSD supports multiple streams, determining a second stream ID of the SSD corresponding to the first stream ID according to the mapping table; the destination SSD is one of SSDs corresponding to the writing operation, and the mapping table is a mapping relation table between the stream ID of the RAID group and the stream ID of the SSD;
and the execution unit is used for executing multi-stream write operation on the destination SSD according to the second stream ID, the data to be written and the second LBA, wherein the second LBA is obtained based on the first LBA.
In a possible implementation, the execution unit is further configured to:
and if the destination SSD does not support multiple streams, performing common write operation on the destination SSD according to the data to be written and the second LBA.
In one possible implementation, the multi-stream write command is a SCSI multi-stream write command, or an NVME multi-stream write command.
In one possible implementation, the RAID card further comprises:
the receiving and transmitting unit is used for receiving a first stream control instruction, and the first stream control instruction is used for applying for stream for the target RAID group;
an allocation unit, configured to allocate a third stream ID to the target RAID group if the number of open streams of the target RAID group does not exceed the number of streams supported by the target RAID group;
the receiving and transmitting unit is further used for acquiring at least one stream ID of each SSD from each SSD in at least one SSD supporting multiple streams in the target RAID group;
the establishing unit is used for establishing a mapping relation between the fourth stream ID and the third stream ID of each SSD and storing the mapping relation into the mapping table, wherein the fourth stream ID of each SSD is one of at least one stream ID of each SSD.
In one possible implementation manner, in acquiring at least one stream ID of each SSD from each SSD of at least one SSD supporting multiple streams in the target RAID group, the transceiver unit is specifically configured to:
sending a second stream control instruction to each SSD; and receiving a first response sent by each SSD and aiming at the second stream control instruction, wherein the first response comprises one stream ID of each SSD.
In one possible implementation manner, in acquiring at least one stream ID of each SSD from each SSD of at least one SSD supporting multiple streams in the target RAID group, the transceiver unit is specifically configured to:
Sending a first resource allocation instruction to each SSD; and receiving a second response sent by each SSD and aiming at the first configuration resource instruction, wherein the second response carries at least one stream ID of each SSD.
In one possible implementation, the fourth stream ID of each SSD is one idle stream ID of the at least one stream ID of each SSD, and the establishing unit is further configured to: after establishing a mapping relationship between the fourth stream ID and the third stream ID of each SSD, the fourth stream ID of each SSD is marked as used.
In one possible implementation, the transceiver unit is further configured to:
a third response to the first flow control instruction is sent, the third response carrying a third flow ID.
In one possible implementation, the RAID card further comprises:
the receiving and transmitting unit is used for receiving a second configuration resource instruction, and the second configuration resource instruction is used for applying for a stream for the target RAID group; the second configuration resource instruction carries quantity indication information, and the quantity indication information is used for indicating quantity M;
an allocation unit, configured to allocate M fifth stream IDs to the target RAID group if no over-current ID is allocated to the target RAID group;
a transceiving unit further configured to acquire a plurality of sixth stream IDs of each SSD from each of at least one SSD supporting multiple streams in the target RAID group; wherein the total number of sixth stream IDs acquired from each of the at least one SSD does not exceed the number of streams supported by the target RAID;
And the establishing unit is used for establishing a mapping relation between a plurality of sixth stream IDs of each SSD in at least one SSD and each fifth stream ID, and storing the mapping relation into a mapping table.
In one possible implementation manner, in acquiring, from each SSD of the at least one SSD indicating the multiple streams in the target RAID group, a plurality of sixth stream IDs of each SSD, the transceiving unit is specifically configured to:
and sending a third configuration resource instruction to at least one SSD in the destination RAID group, and receiving a fourth response, fed back by the at least one SSD, aiming at the second configuration resource instruction, wherein the fourth response carries a plurality of sixth stream IDs of each SSD in the at least one SSD.
In one possible implementation, the transceiver unit is further configured to:
and sending a fifth response to the second configuration resource instruction, wherein the fifth response carries M fifth stream IDs.
In a possible implementation manner, the transceiver unit is further configured to receive a RAID group creation instruction, where the RAID group creation instruction is used to instruct to create a target RAID group; the RAID group creation instruction comprises identifications of a plurality of first SSDs;
the determining unit is further used for determining a plurality of first SSDs according to the plurality of first SSD identifiers, and the target RAID group comprises the plurality of first SSDs;
The acquisition unit is further used for acquiring a second SSD from the plurality of first SSDs, wherein the second SSD is an SSD supporting multiple streams in the plurality of first SSDs;
a determining unit further configured to take the number of flows supported by the third SSD as the number of flows supported by the target RAID group; the third SSD is the SSD in which the number of supported streams in the second SSD is the smallest.
In a third aspect, the present application provides a RAID card comprising a processor and a memory. The memory is used for storing program codes. The processor is configured to invoke program code stored in the memory to perform the method of the first aspect or any of the possible implementations of the first aspect.
In a fourth aspect, an embodiment of the present application provides a server including a plurality of RAID groups and a RAID card according to the second aspect or the third aspect, where the target RAID group is one of the plurality of RAID groups.
In a fifth aspect, embodiments of the present application provide a computer storage medium comprising computer instructions which, when run on an electronic device, cause the electronic device to perform a method as provided in the first aspect or any one of the possible implementations of the first aspect.
In a sixth aspect, the present application provides a computer program product for, when run on a computer, causing the computer to perform the method as provided by the first aspect or any one of the possible implementations of the first aspect.
It will be appreciated that the RAID card according to the second aspect, the RAID card according to the third aspect, the server according to the fourth aspect, the computer storage medium according to the fifth aspect and the computer program product according to the sixth aspect are all adapted to implement the method provided in any of the first aspects. Therefore, the advantages achieved by the method can be referred to as the advantages of the corresponding method, and will not be described herein.
Drawings
Fig. 1a is a schematic diagram of a server hardware architecture according to an embodiment of the present application;
fig. 1b is a schematic diagram of a server software architecture according to an embodiment of the present application;
FIG. 2 is a schematic flow chart of a method for writing data into RAID groups according to an embodiment of the present application;
FIG. 3 is a schematic structural diagram of a RAID card according to an embodiment of the present application;
fig. 4 is a schematic architecture diagram of a server according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of another RAID card according to the embodiment of the present disclosure.
Detailed Description
The terms "first," "second," "third," and "fourth" and the like in the description and in the claims of this application and in the drawings, are used for distinguishing between different objects and not for describing a particular sequential order. Furthermore, the terms "comprise" and "have," as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those listed steps or elements but may include other steps or elements not listed or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the present application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments.
"plurality" means two or more. "and/or", describes an association relationship of an association object, and indicates that there may be three relationships, for example, a and/or B, and may indicate: a exists alone, A and B exist together, and B exists alone. The character "/" generally indicates that the context-dependent object is an "or" relationship.
Multi-stream writing technology: data having the same or similar life cycle is written into the same block of the SSD according to a Stream ID (Stream ID) provided by host.
Embodiments of the present application are described below with reference to the accompanying drawings.
Referring to fig. 1a, fig. 1a is a schematic diagram of a hardware system architecture of a server according to an embodiment of the present application. As shown in fig. 1a, the server includes a Central Processing Unit (CPU), a RAID card, a hard disk back plate, and a plurality of SSDs.
The SSDs are connected to a hard disk backboard of the server, then connected with a CPU of the server through a RAID card, and host software runs on the CPU of the server. The plurality of SSDs includes various types of hard disks, such as a serial attached small computer system interface (Serial Attached Small Computer System Interface, SAS) disk, a serial advanced technology attachment (Serial Advanced Technology Attachment, SATA) disk, and a non-volatile storage standard (non-volatile memory express, NVME) disk.
The CPU and the RAID card are communicated through a PCIe bus, the RAID card and the hard disk backboard are communicated through the PCIe bus or the SAS, and the hard disk backboard and the SSD are communicated through the PCIe bus or the SAS. host software may be a module or process in the kernel, such as a file system, or an application. The host software can send a read-write command and a management configuration command to the RAID card so as to realize the reading and writing of data and the management of RAID groups. The write command includes a multi-stream write command in the following embodiments, and the management configuration command includes a RAID group creation instruction, a flow control instruction, and the like in the following embodiments.
Referring to fig. 1b, fig. 1b is a schematic diagram of a server software architecture according to an embodiment of the present application. As shown in fig. 1b, a plurality of applications, i.e. APP1 and APP2, run on the main CPU of the server, i.e. on the operating system. After the RAID card forms a RAID group by a plurality of SSDs, reporting the RAID group to an operating system, wherein each RAID group corresponds to one OS drive letter, and the operating system can directly operate the OS drive letters so as to further realize the operation of the RAID group. As shown in fig. 1b, the OS disk drives corresponding to the RAID groups allocated by the RAID card to APP1 and APP2 may be dev/nvme0n1 and dev/nvme1n1, respectively. It should be appreciated that the RAID group shown in FIG. 1b presents a device type of NVME. If the device type represented by the RAID group shown in FIG. 1b is SCSI, the OS drives corresponding to the RAID group allocated by the RAID card to APP1 and APP2 may be dev/sda and dev/sdb, respectively.
Referring to fig. 2, fig. 2 is a flow chart of a data multi-stream writing method of a RAID group according to an embodiment of the present disclosure.
As shown in fig. 2, the method includes:
s201, the RAID card acquires a multi-stream write command.
Wherein the multi-stream write command is issued by host. The multi-stream write command is used for indicating to perform multi-stream write, and the multi-stream write command carries a first stream ID of the target RAID group, data to be written and a first LBA. The first stream ID of the target RAID group is one of the at least one stream ID of the RAID group.
LBAs are general mechanisms that describe the block of data on a computer storage device, LBAs may be used to refer to the address of a block of data or to the block of data to which an address points. In general, blocks are positioned starting with a number of 0, a first block lba=0, a second block lba=1, and so on.
S202, the RAID card calculates SSD corresponding to the current writing operation according to a RAID algorithm.
After receiving the multi-stream write command for the target RAID group, the RAID card distributes the data to be written into each SSD according to a RAID algorithm. Schematically, the SSD corresponding to the current writing operation is determined according to the RAID algorithm, and the data to be written is divided into a plurality of data blocks based on the number of the SSD corresponding to the current writing operation, where the number of the data blocks is the same as the number of the SSD corresponding to the current writing operation. And when the subsequent writing operation is performed, writing the plurality of data blocks into SSDs corresponding to the current writing operation respectively.
It should be noted that, the SSD corresponding to the current writing operation is an SSD in the target RAID group, may be one SSD in the target RAID group, may be a plurality of SSDs in the target RAID group, or may be all SSDs in the target RAID group. It should be understood that when the data size of the data to be written is small, a part of SSDs in the target RAID group may be regarded as SSDs corresponding to the current write operation.
S203, if the destination SSD supports multiple streams, the RAID card determines a second stream ID of the SSD corresponding to the first stream ID according to the mapping table, and executes multiple stream write operation on the destination SSD according to the second stream ID, the data to be written and the second LBA.
Specifically, the mapping table includes stream IDs of a plurality of RAID groups and stream IDs of a plurality of SSDs corresponding to the stream IDs of the plurality of RAID groups. When the destination SSD supports multiple streams, the RAID card determines a second stream ID of the SSD corresponding to the first stream ID according to the mapping table; and then performing multi-stream write operation on the destination SSD according to the second stream ID, the data to be written and the second LBA. The second LBA is calculated by the RAID card according to the RAID algorithm and the first LBA. Optionally, if there are multiple second stream IDs of the SSD corresponding to the first stream ID, the RAID card selects a free second stream ID from the multiple second stream IDs of the SSD corresponding to the first stream ID, so as to perform a multi-stream write operation on the destination SSD.
If the destination SSD does not support multiple streams, the RAID card performs a normal write operation to the destination SSD according to the second LBA to write part or all of the data to be written to the destination SSD.
It should be understood that SSDs supporting multiple streams include two types: SAS disk and NVME disk. It should be noted that, the SAS protocol family and the NVME protocol family define characteristics and implementation requirements related to multiple streams, and the corresponding SSDs supporting multiple streams are respectively of two types, namely SAS and NVME. The RAID group presents the device type to host with two types of SCSI and NVME, wherein, for the RAID group with the device type presented to host being SCSI, the SSD included in the RAID group can be an SAS disk or an NVME disk; for a RAID group with a device type NVME presented to host, the SSD it includes may be an NVME disk. Thus in the case of a RAID group presenting different device types to host, the received multi-stream write commands are also different for different types of SSDs.
In one example, when the destination SSD is a SAS disk and the device type presented to host by the destination RAID group is SCSI, the multi-stream write command is a SCSI type multi-stream write command; the RAID card calculates and obtains SSD corresponding to the current writing operation according to the RAID algorithm; executing the following operations on each SSD in the SSDs corresponding to the current writing operation:
The RAID card judges whether the destination SSD supports multi-stream; such as RAID card sends an INQUIRY command to the destination SSD, receiving Block Limits Extension VPD page the destination SSD feedback, where MAXIMUM NUMBER OF STREAMS in Block Limits Extension VPD page is used to indicate whether the SSD supports multi-streaming. MAXIMUM NUMBER OF STREAMS is 0, which indicates that the destination SSD does not support multi-stream; if MAXIMUM NUMBER OF STREAMS is not 0, it indicates that the destination SSD supports multiple flows, and MAXIMUM NUMBER OF STREAMS is the number of flows supported by the destination SSD. If the destination SSD does not support multi-stream, performing ordinary write operation on the destination SSD according to the second LBA so as to write part or all of the data to be written into the destination SSD; if the destination SSD supports multiple streams, the RAID card executes the multi-stream write operation to the destination SSD according to the second stream ID, the second LBA and the data to be written according to the second stream ID of the SSD corresponding to the first stream ID of the destination RAID group obtained from the mapping table.
Based on the above manner, the data writing operation of the SAS disk in the RAID group with SCSI of the device type presented to host can be realized.
In another example, when the destination SSD is an NVME disk and the device type presented to host by the destination RAID group is SCSI, the multi-stream write command is a SCSI type multi-stream write command; the RAID card calculates and obtains SSD corresponding to the current writing operation according to the RAID algorithm; executing the following operations on each SSD in the SSDs corresponding to the current writing operation:
The RAID card judges whether the destination SSD supports multi-stream; for example, the RAID card obtains Identify Controller data structure of the destination SSD, and determines whether the destination SSD supports Directives according to bit5 of the OACS field in Identify Controller data structure of the destination SSD; if the SSD supports Directives, then a Return Parameter operation of Identify Directive is used to obtain whether the destination SSD supports Streams Directive, if so Streams Directive, indicating that the destination SSD supports multi-streaming. If the destination SSD does not support either of Directives and Streams Directive, then it means that the destination SSD does not support convection; if the destination SSD does not support multi-stream, performing ordinary write operation on the destination SSD according to the second LBA so as to write part or all of the data to be written into the destination SSD; if the destination SSD supports multiple streams, the RAID card executes the multi-stream write operation to the destination SSD according to the second stream ID, the second LBA and the data to be written according to the second stream ID of the SSD corresponding to the first stream ID of the destination RAID group obtained from the mapping table. The RAID card performs a multi-stream write operation on the destination SSD according to the second stream ID, the second LBA, and the data to be written, also by a write command, the object to which the write command is directed being the destination SSD. Wherein, the type field in the write command is 01h, and the second stream ID of the destination SSD is indicated in the stream and dspec fields.
Based on the above manner, the data writing operation of the NVME disk in the RAID group with SCSI for the device type presented to host can be implemented.
In another example, when the destination SSD is an NVME disk and the device type presented to host by the destination RAID group is NVME, the multi-stream write command is a multi-stream write command of NVME type, wherein the DTYPE field in the multi-stream write command is 01h, the stream, the first stream ID of the destination RAID group is indicated in the DSPEC field; the RAID card calculates and obtains SSD corresponding to the current writing operation according to the RAID algorithm; executing the following operations on each SSD in the SSDs corresponding to the current writing operation:
the RAID card judges whether the destination SSD supports multi-stream; the RAID card obtains Identify Controller data structure of the destination SSD, and determines whether the destination SSD supports Directives according to bit5 of an OACS field in Identify Controller data structure of the destination SSD; if the SSD supports Directives, then a Return Parameter operation of Identify Directive is used to obtain whether the destination SSD supports Streams Directive, if so Streams Directive, indicating that the destination SSD supports multi-streaming. If the destination SSD does not support either of Directives and Streams Directive, then it means that the destination SSD does not support convection; if the destination SSD does not support multi-stream, performing ordinary write operation on the destination SSD according to the second LBA so as to write part or all of the data to be written into the destination SSD; a type field in a write command for performing a normal write operation is 01h, and stream is set to 00h,directivesnot inuse; if the destination SSD supports multiple streams, the RAID card executes the multi-stream write operation to the destination SSD according to the second stream ID, the second LBA and the data to be written according to the second stream ID of the SSD corresponding to the first stream ID of the destination RAID group obtained from the mapping table. The second stream ID is marked in an open state at this time to indicate that the stream to which the second stream ID corresponds has been used.
Based on the above manner, the data writing operation of the NVME disk in the RAID group of the device type NVME presented to host can be realized.
After the above operations are performed on SSDs corresponding to the current write operation, the RAID marks the first stream ID of the target RAID group as an open state to mark that the first stream ID has been used. When the host is no longer used for the stream corresponding to the first stream ID, the host releases the stream corresponding to the first stream ID, and after the release, the RAID card may mark the first stream ID as a closed state, so that other host software may use the stream corresponding to the first stream ID.
Before writing data by using the target RAID, the target RAID needs to be created, and in the process of creating the target RAID group, relevant configuration needs to be carried out on the target RAID group, such as the number of supporting flows of the target RAID group. In one implementation, the method of the present embodiment further includes:
a target RAID group is created.
Specifically, the RAID card receives a RAID group creation instruction, wherein the RAID group creation instruction is used for indicating to create a target RAID group, the RAID group creation instruction comprises a plurality of first SSD identifications, and the RAID card determines a plurality of first SSDs according to the plurality of first SSD identifications, and the target RAID group comprises a plurality of first SSDs; acquiring a second SSD from the plurality of first SSDs, wherein the second SSD is an SSD supporting multiple streams in the plurality of first SSDs; and taking the number of the streams supported by the third SSD as the number of the streams supported by the target RAID group, wherein the third SSD is the SSD with the minimum number of the streams supported in the second SSD.
By setting the number of attribute supporting streams for the target RAID group, the condition that the stream ID allocated for the target RAID group exceeds the self capacity of the target RAID group can be avoided.
It should be noted here that SAS and NVME protocol families define characteristics and implementation requirements related to multiple streams, and corresponding SSDs supporting multiple streams are of two types, namely SAS and NVME. The RAID group presents the device type to host with two types of SCSI and NVME, wherein, for the RAID group with the device type presented to host being SCSI, the SSD included in the RAID group can be an SAS disk or an NVME disk; for a RAID group with a device type NVME presented to host, the SSD it includes may be an NVME disk. Thus for a RAID group, which may be made up of different types of SSDs, the creation process varies as different device types are presented to host.
In one example, when a target RAID group consisting of SAS disks appears to host as a SCSI device, the specific process of creating the target RAID group includes:
the RAID card receives a RAID group creation command, wherein the RAID group creation command carries identifications for indicating a plurality of first SSDs included in a target RAID group. For different types of RAID groups, the number of SSDs included is also different, for example, a RAID group of type RAID1 includes at least 2 SSDs, a RAID group of type RAID2 includes at least 3 SSDs, and a RAID group of type RAID6 includes at least 4 SSDs.
And the RAID card determines a plurality of first SSDs according to the identifiers of the plurality of first SSDs, and determines whether each SSD in the plurality of first SSDs supports multi-stream. Specifically, the command determination may be defined by SAS protocol family. Such as RAID card sending an INQUIRY command to each SSD of the first plurality of SSDs, receiving SSD feedback Block Limits Extension VPD page, wherein MAXIMUM NUMBER OF STREAMS in Block Limits Extension VPD page is used to indicate whether the SSD supports multi-streaming. MAXIMUM NUMBER OF STREAMS is 0, which indicates that the SSD does not support multi-stream; if MAXIMUM NUMBER OF STREAMS is not 0, it indicates that the SSD supports multiple streams, and MAXIMUM NUMBER OF STREAMS is the number of streams supported by the SSD.
If at least one SSD in the first SSDs supports multi-stream, the RAID card displays the attribute of the logic disk block device corresponding to the target RAID group as supporting multi-stream; otherwise, it appears that multi-streaming is not supported. To ensure compatibility of applicable user habits and operating system software, the presentation manner herein may follow the definition of SAS protocol family, i.e. the presentation is performed through Block Limits Extension VPD page of the logical disk corresponding to the target RAID group, and MAXIMUM NUMBER OF STREAMS in Block Limits Extension VPD page of the logical disk corresponding to the target RAID group is set to the minimum value of MAXIMUM NUMBER OF STREAMS of SSDs supporting multiple flows in SSDs included in the target RAID group. While the RAID card sets an OPTIMAL stream write SIZE (OPTIMAL STREAM WRITE SIZE) and stream granularity SIZE (STREAM GRANULARITY SIZE) for the multi-stream capable SSD based on the multi-stream capable SSD's capability.
Wherein the optimal stream write size field indicates the alignment and size of the optimal stream write in units of several logical blocks. The stream granularity size field indicates the number of write size blocks in the best stream to represent the stream granularity.
After the RAID card completes the setting on the target RAID group, other conventional operations, such as whether to enable the cache, whether to set a special cache, the size of the special cache, and the like, are also completed on the target RAID group.
By the method, the number of the attribute supporting streams can be set for the target RAID group which is formed by the SAS disk and presents the SCSI equipment to the host, and the condition that the stream ID allocated for the target RAID group exceeds the self-capacity of the target RAID group can be avoided.
In one example, when a target RAID group consisting of NVME disks appears to host as a SCSI device, the specific process of creating the target RAID group includes:
the RAID card receives a RAID group creation command, wherein the RAID group creation command carries identifications for indicating a plurality of first SSDs included in a target RAID group. For different types of RAID groups, the number of SSDs included is also different, for example, a RAID group of type RAID1 includes at least 2 SSDs, a RAID group of type RAID2 includes at least 3 SSDs, and a RAID group of type RAID6 includes at least 4 SSDs.
And the RAID card determines a plurality of first SSDs according to the identifiers of the plurality of first SSDs, and determines whether each SSD in the plurality of first SSDs supports multi-stream. Specifically, directives defined by the NVME specification. For example, the RAID card obtains Identify Controller data structure of each SSD in the plurality of first SSDs included in the target RAID group, and determines whether each SSD supports Directives according to bit5 of the OACS field in Identify Controller data structure of each SSD; if the SSD supports Directives, then it is obtained through the Return Parameter operation of Identify Directive if the SSD supports Streams Directive, if so Streams Directive, indicating that the SSD supports multi-streaming. If SSD does not support either of Directives and Streams Directive, then this SSD is indicated as not supporting convection.
If at least one of the SSDs included in the target RAID group supports multi-streaming, streams Directive of the SSDs supporting multi-streaming is enabled. If none of the SSDs included in the target RAID group support multi-streaming, the target RAID group attribute appears to support no multi-streaming.
The RAID card presents the multi-stream attribute of the SCSI logical disk corresponding to the RAID group according to the definition of the SAS protocol family, namely, the multi-stream attribute is presented through Block Limits Extension VPD page of the logical disk corresponding to the target RAID group, and MAXIMUM NUMBER OF STREAMS in Block Limits Extension VPD page of the logical disk corresponding to the target RAID group is set as the minimum value of MAXIMUM NUMBER OF STREAMS of SSDs supporting multi-streams in SSDs included in the target RAID group. While the RAID card sets an OPTIMAL stream write SIZE (OPTIMAL STREAM WRITE SIZE) and stream granularity SIZE (STREAM GRANULARITY SIZE) for the multi-stream capable SSD based on the multi-stream capable SSD's capability.
After the RAID card completes the setting on the target RAID group, other conventional operations, such as whether to enable the cache, whether to set a special cache, the size of the special cache, and the like, are also completed on the target RAID group.
By the method, the number of the attribute support streams can be set for the target RAID group which is formed by the NVME disk and presents SCSI equipment to host, and the condition that the stream ID allocated for the target RAID group exceeds the self-capacity of the target RAID group can be avoided.
In one example, when a target RAID group consisting of NVME disks appears to host as an NVME device, the specific process of creating the target RAID group includes:
the RAID card receives a RAID group creation command, wherein the RAID group creation command carries identifications for indicating a plurality of first SSDs included in a target RAID group. For different types of RAID groups, the number of SSDs included is also different, for example, a RAID group of type RAID1 includes at least 2 SSDs, a RAID group of type RAID2 includes at least 3 SSDs, and a RAID group of type RAID6 includes at least 4 SSDs.
And the RAID card determines a plurality of first SSDs according to the identifiers of the plurality of first SSDs, and determines whether each SSD in the plurality of first SSDs supports multi-stream. Specifically, directives defined by the NVME specification. For example, the RAID card obtains Identify Controller data structure of each SSD in the target RAID group, and determines whether each SSD supports Directives according to bit5 of an OACS field in Identify Controller data structure of each SSD; if the SSD supports Directives, then it is obtained through the Return Parameter operation of Identify Directive if the SSD supports Streams Directive, if so Streams Directive, indicating that the SSD supports multi-streaming. If SSD does not support either of Directives and Streams Directive, then this SSD is indicated as not supporting convection.
If at least one of the SSDs included in the target RAID group supports multi-streaming, streams Directive of the SSDs supporting multi-streaming is enabled. If none of the SSDs included in the target RAID group support multi-streaming, the target RAID group attribute appears to support no multi-streaming.
The RAID card presents the multi-Stream attribute of the NVME logical disk corresponding to the RAID group according to the definition of the NVME specification, namely the OACS field of the logical disk corresponding to the RAID group takes a value of 1, and Stream direct is set as supported in the response to Return Parameters operation of direct. The RAID card takes the minimum value of the number of supported streams of the SSD supporting multiple streams in the target RAID group as the number of supported streams of the target RAID group.
After the RAID card completes the setting on the target RAID group, other conventional operations, such as whether to enable the cache, whether to set a special cache, the size of the special cache, and the like, are also completed on the target RAID group.
By the method, the number of the attribute supporting streams can be set for the target RAID group which is formed by the NVME disk and presents the NVME device to the host, and the condition that the stream ID allocated for the target RAID group exceeds the self-capacity of the target RAID group can be avoided.
It should be noted here that before writing streaming data to a target RAID group supporting multiple streams, multiple streams of the target RAID group need to be enabled and a stream ID applied.
In one possible embodiment, when the target RAID group presents the SCSI device to host, the method of the present application further comprises:
the RAID card receives a first stream control instruction sent by host, wherein the first stream control instruction is used for indicating to apply for stream for a target RAID group; if the number of the opened streams of the target RAID group does not exceed the number of the streams supported by the target RAID group, the RAID card allocates a third stream ID for the target RAID card; and obtaining at least one stream ID of each SSD from each SSD in at least one SSD supporting multiple streams in the target RAID group, establishing a mapping relation between a fourth stream ID of each SSD and a third stream ID, and storing the mapping relation into a mapping table, wherein the fourth stream ID of each SSD is one of the at least one stream ID of each SSD.
Before the new stream ID is allocated to the RAID group, judging whether the number of the streams allocated to the RAID group exceeds the number of the streams supported by the RAID group, and allocating the new stream ID to the RAID group when the number of the streams allocated to the RAID group is determined not to exceed the number of the streams supported by the RAID group, so that the situation that the allocated streams of the RAID group exceed the streams supported by the RAID group is avoided. By constructing the mapping table, the subsequent RAID card can determine the stream ID of the SSD corresponding to the stream ID of the RAID group based on the mapping table, and then the multi-stream write operation can be directly executed on the SSD by using the stream ID of the SSD, so that the multi-stream characteristic of the SSD in the RAID group can be used by upper software in the server.
For a target RAID group formed by SAS disks, the RAID card sends a second stream control instruction to each SSD in SSDs supporting multiple streams in the target RAID group, wherein the second stream control instruction is used for instructing the SSDs to feed back a stream ID; a first response fed back by each SSD for the second stream control instruction is received, wherein the first response carries one stream ID of each SSD. Aiming at a target RAID group formed by the SAS disk, the flow ID is applied to the SSD through the flow control instruction, so that the application scheme is compatible with the SAS protocol family.
For a target RAID group formed by NVME disks, the RAID card sends a first configuration resource instruction to each SSD in the target RAID group, wherein the first configuration resource instruction is used for indicating each SSD to feed back at least one stream ID, and receives a second response fed back by each SSD aiming at the first configuration resource instruction, and the second response carries at least one stream ID of each SSD. Wherein the fourth stream ID of each SSD is one idle stream ID of the at least one stream ID of each SSD. After establishing a mapping relationship between the fourth stream ID and the third stream ID of each SSD, the fourth stream ID of each SSD is marked as used. Aiming at a target RAID group formed by NVME disks, the application scheme can be compatible with the NVME protocol family by configuring a resource instruction to apply a stream ID to the SSD.
In one possible embodiment, the method of the present application further comprises:
the RAID card sends a third response to the first stream control instruction to host, the third response carrying a third stream ID allocated for the target RAID group.
In one specific example, a RAID group containing SAS disks supports a flow control command defined by the SAS protocol family, and the operating system and upper layer software can enable multiple flows of the target RAID group using the flow control command and apply for a flow ID.
After the RAID card receives the first stream control command, the RAID card acquires the number of streams of which the target RAID group is opened; if the number of the opened streams of the target RAID group exceeds the maximum number of the streams supported by the target RAID group, the RAID card returns an error according to the SAS protocol family rule and ends the flow control operation; if the number of the opened streams of the target RAID group does not exceed the maximum number of the streams supported by the target RAID group, the RAID card allocates a new stream ID, namely a third stream ID, to the target RAID group, wherein the third stream ID can be recorded as idr, and the value range of the idr is 0x1-0xFFFF. The RAID card executes the following operations on each SSD in the SSDs included in the target RAID group:
determining whether each SSD supports multiple streams; if the SSD does not support multi-stream, performing no operation on the SSD; if the SSD supports multiple streams, sending a second stream control command carrying an open instruction to the SSD, and receiving a first response of the SSD to the second stream control command, where the first response carries a stream ID of the SSD, which may be denoted as idx, and the RAID card records a mapping relationship between the stream ID of the target RAID group and the stream ID of the SSD, that is, a mapping relationship between idx and idr.
After the above operation is completed for each SSD, the RAID card ends the processing of the first stream control instruction for the target RAID group.
The RAID card updates the mapping relation between the obtained third stream ID of the target RAID group and the stream ID fed back by the SSD into a mapping table; the mapping table is a mapping relation table between the stream ID of the RAID group and the stream ID of each SSD in the RAID group.
In one example, the mapping table is shown in table 1 below:
TABLE 1
Figure BDA0004001251960000121
/>
In table 1, n+1 RAID group stream IDs are illustrated, which are RAID stream ID0, RAID streams ID1, … …, and RAID stream idn, respectively. Wherein, each RAID group stream ID of the n+1 RAID group stream IDs has a mapping relationship with the n+1 SSD stream IDs, such as RAID stream ID0 and SSD stream ID: the id0-0, the id0-1 and the id … … have a mapping relation between the id 0-n; RAID stream ID1 and SSD stream ID: the id1-0, the id1-1 and the id … … have a mapping relation between the id 1-n; RAID stream idn and SSD stream ID: idn-0, idn-1, … …, idn-n have a mapping relation therebetween.
It should be noted here that closing (releasing) streams is also the use of flow control commands, each of which can open or close one stream. When a flow control command is executed for the first time to apply for a flow, the RAID card generates a mapping table of the mapping relationship between the RAID group flow ID and the flow IDs of SSDs in the RAID group. And after the RAID card successfully executes the once-through flow control command, updating the mapping table according to the command execution result.
In a specific embodiment, the target RAID group includes an SSD that is an NVME disk, the logical disk corresponding to the RAID group is of SCSI type, the RAID group supports a flow control command defined by an SAS protocol family, and an operating system and upper software can enable multiple flows of the target RAID group by using the flow control command to apply for a flow ID. After the RAID card receives the first flow control command, operating the NVME disk according to the definition of the NVME specification, wherein the specific flow comprises the following steps:
after the RAID card receives the first stream control command, the RAID card acquires the number of opened streams of the target RAID group; if the number of the opened streams of the target RAID group exceeds the maximum number of the streams supported by the target RAID group, the RAID card returns an error according to the SAS protocol family rule and ends the flow control operation; if the number of the opened streams of the RAID group does not exceed the maximum number of the streams supported by the target RAID group, the RAID card allocates a new stream ID for the target RAID group, namely the third stream ID, which can be marked as idr, and the value range of the idr is 0x1-0xFFFF.
The RAID card determines whether streams are applied to all SSDs supporting multiple streams in the target RAID group; if the flows are not applied to all SSDs supporting multiple flows in the target RAID group, the RAID card applies the flows to all SSDs supporting multiple flows in the target RAID group, and the number of the applied flows is the maximum number of the flows supported by the RAID group. Specifically, the method includes the steps that a Allocate Resources instruction, namely a first configuration resource instruction, is sent to each SSD in the SSDs supporting multiple streams in the RAID group through Allocate Resources operation application of Streams Directive in the NVME specification, and a second response of each SSD in the SSDs supporting multiple streams in the target RAID group for Allocate Resources instruction is received, wherein the first response carries at least one stream ID of each SSD; after the RAID card obtains SSD stream IDs fed back by SSDs supporting multiple streams in the target RAID group, a stream ID resource pool is built based on the fed back SSD stream IDs, and each stream ID in the stream ID resource pool is marked as idle.
The RAID card allocates a free stream ID, namely a fourth stream ID, from the stream ID resource pool to SSDs supporting multiple streams in the target RAID group, the fourth stream ID can be marked as idx, the mapping relation between the idx and the idr is recorded, and the allocated free stream ID in the stream ID resource pool is marked as used. If the streams have been applied to all SSDs supporting multiple streams in the RAID group, a mapping relationship between the stream IDs of the target RAID group and the stream IDs of all SSDs supporting multiple streams in the target RAID group is established. After establishing a mapping relation between the stream ID of the target RAID group and the stream ID of the SSD supporting multiple streams in the target RAID group, updating the mapping relation into a mapping table.
Closing (releasing) streams is also the use of flow control commands, each flow control can open/close one stream. When the flow control closing flow operation is executed, the flow of the SSD is not required to be closed in practice, only the mapping between the RAID group flow id and the SSD flow id is required to be removed, and the SSD flow id is recovered.
In one example, the mapping table is as shown in table 2:
TABLE 2
Figure BDA0004001251960000131
Figure BDA0004001251960000141
Note that a stream ID of 0 in table 2 indicates that a stream ID of a RAID group is not allocated, and a stream ID of a RAID group other than 0 indicates that a stream ID of a RAID group is allocated. In another example, whether the stream ID indicating RAID is used may be identified by the stream ID status of the RAID group, as shown in table 3 below:
TABLE 3 Table 3
Figure BDA0004001251960000142
For the state of the RAID group flow ID, a field may be added to the mapping table, where the field is used to indicate that the state of the RAID group flow ID is used when the value of the field is 1 or wire, and indicates that the state of the corresponding RAID group flow ID is unused when the value of the field is 0 or false.
Similarly, for the state of the SSD stream ID, a field may be added to the mapping table, where the field is used to indicate the state of the SSD stream ID, for example, when the value of the field is 1 or wire, the state of the corresponding SSD stream ID is used, and when the value of the field is 0 or false, the state of the corresponding SSD stream ID is idle.
The RAID card feeds back a third response aiming at the first stream control command according to the SAS protocol, wherein the third response carries a third stream ID of the target RAID group, and the processing of the first stream control command aiming at the target RAID group is ended.
It should be appreciated that there may be one or more stream IDs of the target RAID group, the third stream ID being one of the one or more stream IDs of the target RAID group, and the first stream ID being one of the one or more stream IDs of the target RAID group. The third stream ID and the first stream ID may be the same stream ID of the target RAID group, or may be different stream IDs of the target RAID group. The SSD may have one or more stream IDs, the second stream ID being one of the one or more stream IDs of the SSD, and the fourth stream ID being one of the one or more stream IDs of the SSD. The second stream ID and the fourth stream ID may be the same stream ID of the SSD, or may be different stream IDs of the SSD.
In one possible embodiment, when the target RAID group is made up of NVME disks and the target RAID group presents the NVME devices to host, the method of the present application further comprises:
the RAID card receives a second resource allocation instruction sent by host, wherein the second resource allocation instruction is used for applying for a stream for a target RAID group; the second configuration resource instruction carries quantity indication information, and the quantity indication information is used for indicating quantity M; if the overcurrent IDs are not allocated to the target RAID group, M fifth stream IDs are allocated to the target RAID group; acquiring a plurality of sixth stream IDs of each SSD from each of at least one SSD supporting multiple streams in the target RAID group; wherein the number of sixth stream IDs acquired from each of the at least one SSD does not exceed the number of streams supported by the target RAID group; and establishing a mapping relation between a plurality of sixth stream IDs of each SSD in at least one SSD and each fifth stream ID, and storing the mapping relation into a mapping table.
Before the new stream ID is allocated to the RAID group, judging whether the over-current ID is allocated to the RAID, and allocating the new stream ID to the RAID group when determining that the stream ID is not allocated to the RAID group, thereby avoiding the situation that the number of the stream IDs allocated to the RAID group exceeds the stream ID supported by the RAID group. By constructing the mapping table, the subsequent RAID card can determine the stream ID of the SSD corresponding to the stream ID of the RAID group based on the mapping table, and then the multi-stream write operation can be directly executed on the SSD by using the stream ID of the SSD, so that the multi-stream characteristic of the SSD in the RAID group can be used by upper software in the server.
Wherein the first stream ID is one of the M fifth stream IDs, the destination SSD is one SSD in the RAID group, the destination SSD also has a plurality of sixth stream IDs, and the second stream ID of the destination SSD is one of the plurality of sixth stream IDs.
In one example, the RAID card may send a third configuration resource instruction to each of at least one of the SSDs supporting the flow in the target RAID group, the third configuration resource instruction being for instructing each SSD to feed back a plurality of sixth flow IDs; a fourth response to the third configuration resource instruction fed back by each of the at least one SSD is received, the fourth response carrying a plurality of sixth stream IDs of each of the at least one SSD. Aiming at a target RAID group formed by NVME disks, the application scheme can be compatible with the NVME protocol family by configuring a resource instruction to apply a stream ID to the SSD.
Further, the RAID card sends a fifth response to the host for the second configuration resource instruction, wherein the fifth response carries M fifth stream IDs.
In one specific example of this embodiment, the method comprises,
it should be noted here that, for a RAID group including an NVME disk, supporting directives related commands defined by the NVME specification, the RAID card may enable multi-streaming of the RAID group through Allocate Resources operation instructions of Streams Directive and apply for a stream ID:
The RAID card receives a second configuration resource instruction of the Host aiming at the target RAID group, wherein the second configuration resource instruction has the flow number applied for the target RAID group, namely the first number M; the RAID card determines whether a stream has been allocated for the target RAID group; if so, the RAID card feeds back a response for indicating that the second configuration resource instruction fails to execute. If not, the RAID card allocates a group of stream IDs for the target RAID group, wherein the number of the group of stream IDs is M. The RAID card applies for streams to SSD supporting multiple streams in a target RAID group, wherein the number of the applied streams is the number of the streams supported by the RAID group. In one example, the RAID card may configure the resource instructions by sending a configuration resource instruction to each of the SSDs in the target RAID group that support multiple streams; and receiving a fourth response of each SSD aiming at the third configuration resource instruction, wherein the fourth response carries the stream ID of each SSD, the number of the stream IDs can be one or a plurality of, but the number of the stream IDs fed back by each SSD in the SSD supporting multiple streams in the target RAID group does not exceed the number of the streams supported by the target RAID group. The RAID card establishes a mapping relationship between a set of stream IDs allocated for the target RAID group and stream IDs fed back by the SSD, and it should be understood that allocating the target RAID group to the set of stream IDs includes at least one stream ID, and establishing a mapping relationship between the set of stream IDs allocated for the target RAID group and stream IDs fed back by the SSD refers to establishing a mapping relationship between each stream ID in the set of stream IDs allocated for the target RAID group and stream IDs fed back by the SSD. The RAID card stores the newly established mapping relation into a mapping table. In one example, the mapping table is shown in table 3.
The RAID card feeds back to the Host a fifth response to the second configuration resource instruction, the fifth response including M stream IDs allocated for the target RAID group, and the RAID card ends the operation for the second configuration resource instruction in the target RAID group.
The Allocate Resources operation defined in the NVME specification is only used to apply a sufficient stream ID once, and the stream is opened in a subsequent write operation, i.e. the relevant resource is associated with the stream, at which time the RAID card opens the stream of the SSD in the RAID group. The RAID card can acquire the opened RAID group Stream ID through the Get Status operation of the Stream direct by the RAID group support.
It should be noted that the configuration resource (Allocate Resources) instruction in this application is of the Stream direct type. Allocate Resources operation is the same instruction as the configure resource instruction.
It can be seen that, in the scheme of the present application, by establishing a mapping relationship between the stream ID of the RAID group and the stream ID of the SSD in the RAID group, an upper layer application or software (that is, host) can write data under the condition of using the RAID group, and also can use the function of the stream of the SSD, thereby further improving the service life and performance of the SSD. And in order to be compatible with SSDs of different types, a Stream control instruction or a configuration resource instruction enabling and applying Stream of Stream direct type is adopted.
Referring to fig. 3, fig. 3 is a schematic structural diagram of a RAID card according to an embodiment of the present disclosure. As shown in fig. 3, the RAID card 300 includes:
an obtaining unit 301, configured to obtain a multi-stream write command, where the multi-stream write command carries a first stream ID including data to be written, an LBA, and a target RAID group;
a determining unit 302, configured to determine, according to a RAID algorithm, an SSD corresponding to the current write operation from a target RAID group; if the destination SSD supports multiple streams, determining a second stream ID of the SSD corresponding to the first stream ID according to the mapping table; the destination SSD is one of SSDs corresponding to the writing operation, and the mapping table is a mapping relation table between the stream ID of the RAID group and the stream ID of the SSD;
the executing unit 303 is configured to execute a multi-stream write operation on the destination SSD according to the second stream ID, the data to be written, and a second LBA, where the second LBA is obtained based on the first LBA.
In a possible implementation, the execution unit 303 is further configured to:
and if the destination SSD does not support multiple streams, performing common write operation on the destination SSD according to the data to be written and the second LBA.
In one possible implementation, the multi-stream write command is a SCSI multi-stream write command, or an NVME multi-stream write command.
In one possible implementation, RAID card 300 further includes:
A transceiver unit 304, configured to receive a first flow control instruction, where the first flow control instruction is used to apply for a flow for a target RAID group;
an allocation unit 305, configured to allocate a third stream ID to the target RAID group if the number of open streams of the target RAID group does not exceed the number of streams supported by the target RAID group;
a transceiver unit 304, configured to obtain at least one stream ID of each SSD from each SSD of at least one SSD supporting multiple streams in the target RAID group;
the establishing unit 306 is configured to establish a mapping relationship between the fourth stream ID and the third stream ID of each SSD, and store the mapping relationship in the mapping table, where the fourth stream ID of each SSD is one of at least one stream ID of each SSD.
In one possible implementation, in acquiring at least one stream ID of each SSD from each SSD of the at least one SSDs supporting multiple streams in the target RAID group, the transceiver unit 304 is specifically configured to:
sending a second stream control instruction to each SSD; and receiving a first response sent by each SSD and aiming at the second stream control instruction, wherein the first response comprises one stream ID of each SSD.
In one possible implementation, in acquiring at least one stream ID of each SSD from each SSD of the at least one SSDs supporting multiple streams in the target RAID group, the transceiver unit 304 is specifically configured to:
Sending a first resource allocation instruction to each SSD; and receiving a second response sent by each SSD and aiming at the first configuration resource instruction, wherein the second response carries at least one stream ID of each SSD.
In one possible implementation, the fourth stream ID of each SSD is one idle stream ID of the at least one stream ID of each SSD, and the establishing unit 306 is further configured to: after establishing a mapping relationship between the fourth stream ID and the third stream ID of each SSD, the fourth stream ID of each SSD is marked as used.
In one possible implementation, the transceiver unit 304 is further configured to:
a third response to the first flow control instruction is sent, the third response carrying a third flow ID.
In one possible implementation, RAID card 300 further includes:
the transceiver unit 304 is configured to receive a second configuration resource instruction, where the second configuration resource instruction is used to apply for a flow for the target RAID group; the second configuration resource instruction carries quantity indication information, and the quantity indication information is used for indicating quantity M;
an allocation unit 305, configured to allocate M fifth stream IDs to the target RAID group if no over-current ID is allocated to the target RAID group;
a transceiver unit 304, configured to obtain, from each SSD of at least one SSD supporting multiple streams in the target RAID group, multiple sixth stream IDs of each SSD; wherein the total number of sixth stream IDs acquired from each of the at least one SSD does not exceed the number of streams supported by the target RAID;
And a building unit 306, configured to build a mapping relationship between the plurality of sixth stream IDs and each fifth stream ID of each SSD in the at least one SSD, and store the mapping relationship in the mapping table.
In one possible implementation, in acquiring, from each SSD of the at least one SSD indicating the multiple streams in the target RAID group, multiple sixth stream IDs of each SSD, the transceiver unit 304 is specifically configured to:
and sending a third configuration resource instruction to at least one SSD in the destination RAID group, and receiving a fourth response, fed back by the at least one SSD, aiming at the second configuration resource instruction, wherein the fourth response carries a plurality of sixth stream IDs of each SSD in the at least one SSD.
In one possible implementation, the transceiver unit 304 is further configured to:
and sending a fifth response to the second configuration resource instruction, wherein the fifth response carries M fifth stream IDs.
In a possible implementation manner, the transceiver unit 304 is further configured to receive a RAID group creation instruction, where the RAID group creation instruction is used to instruct to create a target RAID group; the RAID group creation instruction comprises identifications of a plurality of first SSDs;
a determining unit 302, configured to determine a plurality of first SSDs according to the plurality of first SSD identities, where the target RAID group includes the plurality of first SSDs;
The obtaining unit 301 is further configured to obtain a second SSD from the plurality of first SSDs, where the second SSD is an SSD that supports multiple streams from among the plurality of first SSDs;
a determining unit 302, configured to further use the number of flows supported by the third SSD as the number of flows supported by the target RAID group; the third SSD is the SSD in which the number of supported streams in the second SSD is the smallest.
It should be noted that, for the specific functional implementation of the RAID card 300, reference may be made to the description of the data multi-stream writing method of the RAID group shown in fig. 2, for example, the acquiring unit 301 is configured to execute the relevant content of S201, the determining unit 302 is configured to execute the relevant content of S202 and S203, and the executing unit 303, the transceiving unit 304, the distributing unit 305 and the establishing unit 306 are configured to execute the relevant content of S203, which will not be described herein. The individual units or modules in the RAID card 600 may be individually or all combined into one or several additional units or modules, or some of the units or modules may be further split into multiple units or modules with smaller functions, which may achieve the same operation without affecting the implementation of the technical effects of the embodiments of the present invention. The above units or modules are divided based on logic functions, and in practical applications, the functions of one unit (or module) may be implemented by a plurality of units (or modules), or the functions of a plurality of units (or modules) may be implemented by one unit (or module).
Referring to fig. 4, fig. 4 is a schematic architecture diagram of another server according to an embodiment of the present application. As shown in fig. 4, the server includes host 401, RAID card 402, and a plurality of SSDs 403. The RAID driver in host is used for realizing interaction between the RAID card and the OS kernel and between the RAID card and the BISO, receiving commands of the OS kernel and the BISO, and feeding back corresponding responses.
The RAID card 402 includes: a front-end processing module 4021, a RAID algorithm module 4022, a configuration management module 4023, and a back-end processing module 4024.
The front-end processing module 4021 receives the service read-write command and the configuration management command sent from the host 401, and distributes the service read-write command and the configuration management command to the RAID algorithm module 4022 and the configuration management module 4023.
The RAID algorithm module 4022 is configured to process read and write commands for a RAID group, including normal read and write and downgrade pair shoes. After receiving the read-write command for the RAID group forwarded by the front-end processing module 4021, the RAID algorithm module 4022 splits the received read-write command into a read-write command for a specific physical hard disk (for example, SSD) according to the RAID algorithm, and then distributes the read-write command to the back-end processing module 4024. For example, the write command for a RAID group may include a multi-stream write command for a target RAID group in the embodiment shown in FIG. 2, and the write command for a particular physical hard disk includes instructions for performing a multi-stream write operation or a normal write operation to a target SSD in the embodiment shown in FIG. 2. Depending on the RAID group configuration and service scenario, RAID algorithm module 4022 may interact with the memory of the RAID card when processing the read/write command, e.g., using the memory as a read/write cache, or writing a write log to the memory. The RAID algorithm module 4022 also receives information about the configuration management module 4023, such as a change in the state of the RAID group, a hard disk upgrade operation, and so on.
The configuration management module 4023 is configured to process transactions such as creation, deletion, reconstruction, and hard disk management of a RAID group. When the front-end processing module 4021 receives the hard disk firmware upgrading command, the hard disk firmware upgrading command is forwarded to the configuration management module 4023, and the configuration management module 4023 informs the RAID algorithm module 4022 of performing corresponding processing and simultaneously packages and sends the hard disk firmware upgrading command to the back-end processing module 4024.
The configuration management command includes a RAID group creation instruction, a flow control instruction for implementing an enable flow and an apply flow, or a configuration resource instruction in the embodiment shown in fig. 2.
The back-end processing module 4024 receives the commands of the RAID algorithm module 4022 and the configuration management module 4023, and assembles the commands into corresponding protocol instructions, such as a flow control instruction, a configuration resource instruction, an information command, and the like, according to the hard disk types, in the embodiment shown in fig. 2, so as to implement interaction with each hard disk (such as SSD).
It should be noted that, the specific functions and advantages of the front-end processing module 4021, the RAID algorithm module 4022, the configuration management module 4023, and the back-end processing module 4024 may be described with reference to the embodiment shown in fig. 2, and will not be described herein.
Based on the description of the method embodiment and the RAID card embodiment, please refer to fig. 5, and further provide a structural schematic diagram of a RAID card 500 according to an embodiment of the present invention. The RAID card 500 shown in FIG. 5 (the RAID card 500 may be a computer device in particular) includes a memory 501, a processor 502, a communication interface 503, and a bus 504. The memory 501, the processor 502, and the communication interface 503 are communicatively connected to each other via a bus 504.
The memory 501 may be a ROM, static storage device, dynamic storage device, or RAM.
The memory 501 may store a program, and when the program stored in the memory 501 is executed by the processor 502, the processor 502 and the communication interface 503 are configured to perform the steps of the data multi-stream writing method of the RAID group according to the embodiment of the present application.
The processor 502 may employ a general-purpose CPU, microprocessor, ASIC, GPU, or one or more integrated circuits for executing associated programs to perform the functions required to be performed by the elements in the RAID card 500 of the method embodiments of the present application or to perform the data multi-stream writing method of the RAID group of the method embodiments of the present application.
The processor 502 may also be an integrated circuit chip with signal processing capabilities. In implementation, various steps of the data multi-stream writing method of the RAID group of the present application may be accomplished by instructions in the form of integrated logic circuits or software of hardware in the processor 502. The processor 502 described above may also be a general purpose processor, DSP, ASIC, FPGA or other programmable logic device, discrete gate or transistor logic device, discrete hardware components. The disclosed methods, steps, and logic blocks in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the embodiments of the present application may be embodied directly in hardware, in a decoded processor, or in a combination of hardware and software modules in a decoded processor. The software modules may be located in a random access memory, flash memory, read only memory, programmable read only memory, or electrically erasable programmable memory, registers, etc. as well known in the art. The storage medium is located in the memory 501, and the processor 502 reads information in the memory 501, and combines the hardware of the storage medium to implement functions required to be executed by units included in the network risk association assessment device of the embodiment of the present application, or execute the data multi-stream writing method of the RAID group of the embodiment of the method of the present application.
The communication interface 503 enables communication between the RAID card 500 and other devices or communication networks using a transceiving means such as, but not limited to, a transceiver. For example, data may be acquired through the communication interface 503.
Bus 504 may include a path for transferring information between various components of RAID card 500 (e.g., memory 501, processor 502, communication interface 503).
It should be noted that although the RAID card 500 shown in FIG. 5 illustrates only memory, processors, and communication interfaces, those skilled in the art will appreciate that in a particular implementation, the RAID card 500 also includes other devices necessary to achieve proper operation. Also, as will be appreciated by those skilled in the art, RAID card 500 may also include hardware devices that implement other additional functions, as desired. Furthermore, it will be appreciated by those skilled in the art that RAID card 500 may also include only the devices necessary to implement embodiments of the present application and not all of the devices shown in FIG. 5.
The embodiment of the application also provides a chip, which comprises a processor and a data interface, wherein the processor reads the instructions stored in the memory through the data interface so as to realize the data multi-stream writing method of the RAID group.
Optionally, as an implementation manner, the chip may further include a memory, where the memory stores instructions, and the processor is configured to execute the instructions stored on the memory, and when the instructions are executed, the processor is configured to perform the data multi-stream writing method of the RAID group.
Embodiments also provide a computer readable storage medium having instructions stored therein, which when run on a computer or processor, cause the computer or processor to perform one or more steps of any of the methods described above.
Embodiments of the present application also provide a computer program product comprising instructions. The computer program product, when run on a computer or processor, causes the computer or processor to perform one or more steps of any of the methods described above.
Those of skill in the art will appreciate that the functions described in connection with the various illustrative logical blocks, modules, and algorithm steps described in connection with the disclosure herein may be implemented as hardware, software, firmware, or any combination thereof. If implemented in software, the functions described by the various illustrative logical blocks, modules, and steps may be stored on a computer readable medium or transmitted as one or more instructions or code and executed by a hardware-based processing unit. Computer-readable media may include computer-readable storage media corresponding to tangible media, such as data storage media, or communication media including any medium that facilitates transfer of a computer program from one place to another (e.g., based on a communication protocol). In this manner, a computer-readable medium may generally correspond to (1) a non-transitory tangible computer-readable storage medium, or (2) a communication medium, such as a signal or carrier wave. Data storage media may be any available media that can be accessed by one or more computers or one or more processors to retrieve instructions, code and/or data structures for implementing the techniques described herein. The computer program product may include a computer-readable medium.
By way of example, and not limitation, such computer-readable storage media can comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, flash memory, or any other medium that can be used to store desired program code in the form of instructions or data structures and that can be accessed by a computer. Also, any connection is properly termed a computer-readable medium. For example, if the instructions are transmitted from a website, server, or other remote source using a coaxial cable, fiber optic cable, twisted pair, digital Subscriber Line (DSL), or wireless technologies such as infrared, radio, and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. It should be understood, however, that the computer-readable storage medium and data storage medium do not include connections, carrier waves, signals, or other transitory media, but are actually directed to non-transitory tangible storage media. Disk and disc, as used herein, includes Compact Disc (CD), laser disc, optical disc, digital Versatile Disc (DVD), and blu-ray disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.
The instructions may be executed by one or more processors, such as one or more Digital Signal Processors (DSPs), general purpose microprocessors, application Specific Integrated Circuits (ASICs), field programmable logic arrays (FPGAs), or other equivalent integrated or discrete logic circuitry. Thus, the term "processor" as used herein may refer to any of the foregoing structure or any other structure suitable for implementation of the techniques described herein. Additionally, in some aspects, the functions described by the various illustrative logical blocks, modules, and steps described herein may be provided within dedicated hardware and/or software modules configured for encoding and decoding, or incorporated in a combination codec. Moreover, the techniques may be fully implemented in one or more circuits or logic elements.
The techniques of this disclosure may be implemented in a wide variety of devices or apparatuses including a wireless handset, an Integrated Circuit (IC), or a set of ICs (e.g., a chipset). The various components, modules, or units are described in this application to emphasize functional aspects of the devices for performing the disclosed techniques but do not necessarily require realization by different hardware units. Indeed, as described above, the various units may be combined in an encoded hardware unit in combination with suitable software and/or firmware, or provided by interoperating hardware units, including one or more processors as described above.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to specific descriptions of corresponding step procedures in the foregoing method embodiments, and are not repeated herein.
It should be understood that in the description of the present application, unless otherwise indicated, "/" means that the associated object is an "or" relationship, e.g., a/B may represent a or B; wherein A, B may be singular or plural. Also, in the description of the present application, unless otherwise indicated, "a plurality" means two or more than two. "at least one of" or the like means any combination of these items, including any combination of single item(s) or plural items(s). For example, at least one (one) of a, b, or c may represent: a, b, c, a-b, a-c, b-c, or a-b-c, wherein a, b, c may be single or plural. In addition, in order to clearly describe the technical solutions of the embodiments of the present application, in the embodiments of the present application, the words "first", "second", and the like are used to distinguish the same item or similar items having substantially the same function and effect. It will be appreciated by those of skill in the art that the words "first," "second," and the like do not limit the amount and order of execution, and that the words "first," "second," and the like do not necessarily differ. Meanwhile, in the embodiments of the present application, words such as "exemplary" or "such as" are used to mean serving as examples, illustrations, or descriptions. Any embodiment or design described herein as "exemplary" or "for example" should not be construed as preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "such as" is intended to present related concepts in a concrete fashion that may be readily understood.
In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the division of the unit is merely a logic function division, and there may be another division manner when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted or not performed. The coupling or direct coupling or communication connection shown or discussed with each other may be through some interface, device or unit indirect coupling or communication connection, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present application, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted across a computer-readable storage medium. The computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by a wired (e.g., coaxial cable, fiber optic, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a ROM, or a random access memory RAM, or a magnetic medium, such as a floppy disk, a hard disk, a magnetic tape, a magnetic disk, or an optical medium, such as a digital versatile disk (digital versatile disc, DVD), or a semiconductor medium, such as a Solid State Disk (SSD), or the like.
The foregoing is merely a specific implementation of the embodiments of the present application, but the protection scope of the embodiments of the present application is not limited thereto, and any changes or substitutions within the technical scope disclosed in the embodiments of the present application should be covered by the protection scope of the embodiments of the present application. Therefore, the protection scope of the embodiments of the present application shall be subject to the protection scope of the claims.

Claims (14)

1. A method for multi-stream writing of data to a RAID group, the method comprising:
acquiring a multi-stream write command, wherein the multi-stream write command carries a first stream ID comprising data to be written, a first logic block address LBA and a target RAID group;
determining SSD corresponding to the writing operation according to a RAID algorithm;
if the destination SSD supports multiple streams, determining a second stream ID of the SSD corresponding to the first stream ID according to a mapping table; the destination SSD is one SSD corresponding to the current writing operation; the mapping table is a mapping relation table between the stream ID of the RAID group and the stream ID of the SSD;
and executing multi-stream write operation on the destination SSD according to the second stream ID, the data to be written and a second LBA, wherein the second LBA is obtained based on the first LBA.
2. The method according to claim 1, wherein the method further comprises:
And if the destination SSD does not support multi-stream, performing common write operation on the destination SSD according to the data to be written and the second LBA.
3. The method of claim 1 or 2, wherein the multi-stream write command is a SCSI multi-stream write command or an NVME multi-stream write command.
4. A method according to any one of claims 1-3, wherein the method further comprises:
receiving a first stream control instruction, wherein the first stream control instruction is used for applying for a stream for the target RAID group;
if the number of the opened flows of the target RAID group does not exceed the number of the flows supported by the target RAID group, a third flow ID is allocated to the target RAID group;
obtaining at least one stream ID for each of at least one SSDs supporting multiple streams from the target RAID group,
and establishing a mapping relation between the fourth stream ID of each SSD and the third stream ID, and storing the mapping relation into the mapping table, wherein the fourth stream ID of each SSD is one of at least one stream ID of each SSD.
5. The method of claim 4, wherein the obtaining at least one stream ID for each of the at least one SSDs supporting multiple streams from the target RAID group comprises:
Sending a second stream control instruction to each SSD;
and receiving a first response sent by each SSD and aiming at a second flow control instruction, wherein the first response comprises one flow ID of each SSD.
6. The method of claim 4, wherein the obtaining at least one stream ID for each of the at least one SSDs supporting multiple streams from the target RAID group comprises:
sending a first resource allocation instruction to each SSD;
and receiving a second response sent by each SSD and aiming at the first configuration resource instruction, wherein the second response carries at least one stream ID of each SSD.
7. The method of claim 6, wherein the fourth stream ID of each SSD is one idle stream ID of the at least one stream ID of each SSD,
the method comprises the following steps:
after establishing the mapping relation between the fourth stream ID and the third stream ID of each SSD, marking the fourth stream ID of each SSD as used.
8. The method according to any one of claims 4-7, further comprising:
and sending a third response to the first flow control instruction, wherein the third response carries the third flow ID.
9. A method according to any one of claims 1-3, wherein the method further comprises:
receiving a second configuration resource instruction, wherein the second configuration resource instruction is used for applying for a stream for a target RAID group; the second configuration resource instruction carries quantity indication information, and the quantity indication information is used for indicating quantity M;
if the overcurrent IDs are not allocated to the target RAID group, M fifth stream IDs are allocated to the target RAID group;
acquiring a plurality of sixth stream IDs of at least one SSD supporting multiple streams from each SSD in the target RAID group; wherein a total number of sixth stream IDs acquired from each of the at least one SSD does not exceed a number of streams supported by the target RAID;
and establishing a mapping relation between a plurality of sixth stream IDs of each SSD in the at least one SSD and each fifth stream ID, and storing the mapping relation into the mapping table.
10. The method of claim 9, wherein the obtaining the plurality of sixth stream IDs for each of the at least one SSD in the target RAID group indicating multiple streams from each SSD comprises:
sending a third configuration resource instruction to at least one of the SSDs supporting the stream in the target RAID group,
A fourth response to the second configuration resource instruction fed back by the at least one SSD is received, the fourth response carrying a plurality of sixth stream IDs for each of the at least one SSD.
11. The method according to claim 9 or 10, characterized in that the method further comprises:
and sending a fifth response to the second configuration resource instruction, wherein the fifth response carries the M fifth stream IDs.
12. The method according to any one of claims 4-11, further comprising:
receiving a RAID group creation instruction, wherein the RAID group creation instruction is used for indicating to create the target RAID group; the RAID group creation instruction comprises identifiers of a plurality of first SSDs;
determining a plurality of first SSDs according to the plurality of first SSD identifications, wherein the target RAID group comprises the plurality of first SSDs;
obtaining a second SSD from the plurality of first SSDs, wherein the second SSD is an SSD supporting multiple flows in the plurality of first SSDs;
taking the number of flows supported by a third SSD as the number of flows supported by the target RAID group; the third SSD is an SSD in which the number of supported streams is smallest in the second SSD.
13. A RAID card comprising a processor and a memory, the memory for storing program code, the processor for invoking the program code stored in the memory to perform the method of any of claims 1-12.
14. A server comprising a plurality of RAID groups and the RAID card of claim 13, wherein the target RAID group is one of the plurality of RAID groups.
CN202211618746.XA 2022-12-15 2022-12-15 Data multi-stream writing method and related device for RAID group Pending CN116027975A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211618746.XA CN116027975A (en) 2022-12-15 2022-12-15 Data multi-stream writing method and related device for RAID group

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211618746.XA CN116027975A (en) 2022-12-15 2022-12-15 Data multi-stream writing method and related device for RAID group

Publications (1)

Publication Number Publication Date
CN116027975A true CN116027975A (en) 2023-04-28

Family

ID=86080523

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211618746.XA Pending CN116027975A (en) 2022-12-15 2022-12-15 Data multi-stream writing method and related device for RAID group

Country Status (1)

Country Link
CN (1) CN116027975A (en)

Similar Documents

Publication Publication Date Title
US10564859B2 (en) Composite solid state drive identification and optimization technologies
KR101466560B1 (en) Management of device firmware update effects as seen by a host
KR101467941B1 (en) Variable over­provisioning for non­volatile storage
US8489803B2 (en) Efficient use of flash memory in flash drives
KR20210111527A (en) Apparatus and method for performing garbage collection in a memory system
US20220197818A1 (en) Method and apparatus for performing operations to namespaces of a flash memory device
CN112445723A (en) Apparatus and method for transferring mapping information in memory system
US7774575B2 (en) Integrated circuit capable of mapping logical block address data across multiple domains
US20110202790A1 (en) Storage Configuration
US11010055B2 (en) Command processing for a storage system
KR20210112548A (en) Apparatus and method for controlling map data in a memory system
KR20220043432A (en) Apparatus and method for controlling a read voltage in a memory system
KR20210124705A (en) Apparatus and method for controlling map data in a memory system
US9483195B2 (en) Response reading method and data transmission system
KR20220090020A (en) Apparatus and method for transmitting metadata generated by a non-volatile memory system
CN116027975A (en) Data multi-stream writing method and related device for RAID group
CN110609660A (en) Host end mapping method and device of SSD array, computer equipment and storage medium
CN111124253A (en) Method, apparatus and computer program product for managing storage devices
KR20230165580A (en) Memory system for controlling operating speed and data processing system including the same
US20060277326A1 (en) Data transfer system and method
KR20220032816A (en) Calibration apparatus and method for data communication in a memory system
KR20220049230A (en) Apparatus and method for checking an error of a non-volatile memory device in a memory system
KR20210142863A (en) Apparatus and method for increasing operation efficiency in a memory system
KR20220076803A (en) Data storage device and operating method thereof
CN116204118A (en) RAID group data writing method and related device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination