Device management method and apparatus, electronic device, and storage medium
By adding NVMe device identifiers and priority path identifiers to the query commands of the SCSI protocol, the problem of unified management of block devices under the SCSI and NVMe protocols is solved, and the flexibility, efficiency and compatibility of device access are improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- MACROSAN TECH
- Filing Date
- 2026-04-10
- Publication Date
- 2026-06-30
AI Technical Summary
In existing technologies, the NVMe protocol and the SCSI protocol differ in protocol specifications and transmission mechanisms, which makes it impossible for server-side multipath software to uniformly integrate and manage block devices under the two protocols, resulting in complex operation and maintenance and insufficient data access reliability.
By adding a custom NVMe protocol device identifier field and a priority path identifier to the query command of the SCSI protocol, aggregated management of SCSI and NVMe block devices can be achieved. Priority path policies can be set in the target aggregated device to prioritize the issuance of IO commands and protocol conversion, ensuring that block devices under different protocols can be uniformly scheduled and managed.
It achieves unified aggregation management of block devices under different protocols, improves the flexibility and efficiency of device access, ensures the normal execution of IO instructions and the compatibility and reliability of device access, and avoids access interruption caused by priority path failure.
Smart Images

Figure CN122308744A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer storage technology, and more particularly to device management methods, apparatus, electronic devices, and storage media. Background Technology
[0002] In the field of computer storage technology, centralized storage is a common approach. It refers to storage devices that centrally deploy and manage storage resources, providing data storage and access services to multiple server terminals. It is widely used in data centers and other similar scenarios. In centralized storage, mainstream devices generally support NVMe over Fabric, FC SAN, and iSCSI protocols simultaneously. NVMe over Fabric is recognized as a Non-Volatile Memory Express (NVMe) block device on the server side, while FC SAN and iSCSI are recognized as Small Computer System Interface (SCSI) block devices. All three ultimately access the same storage space on the storage device, ensuring data consistency.
[0003] However, due to the fundamental differences between the NVMe and SCSI protocols in terms of protocol specifications and transmission mechanisms, server-side multipath software cannot uniformly integrate and manage block devices corresponding to the two protocols; it can only manage devices of a single protocol, which leads to problems such as complex operation and maintenance and insufficient data access reliability. Summary of the Invention
[0004] In view of this, embodiments of this application provide a device management method, apparatus, electronic device, and storage medium to achieve the aggregation of block devices under different protocols.
[0005] This application provides a device management method, the method comprising: For the target block device under the current first protocol to be managed, the target aggregation device is queried based on the query instruction corresponding to the first protocol; the query instruction includes a first device identifier field corresponding to the first protocol, the first device identifier field carries the device identifier of the target block device, and the query instruction also adds a second device identifier field corresponding to the second protocol and a priority path identifier, the second device identifier field carries the device identifier of the target block device; the priority path identifier indicates whether the first protocol or the second protocol takes precedence; If a target aggregation device exists, and the device identifier of the target aggregation device is the device identifier carried in the first protocol device identifier field or the second protocol device identifier field, then the target block device is aggregated to the target aggregation device as a block device under the first protocol. If the target aggregation device does not exist, then based on the creation of the target aggregation device, the target block device is the first block device in the created target aggregation device, with the block device under the first protocol as the first block device; the target aggregation device is associated with the priority path identifier. For IO commands to be sent to the target aggregation device, the IO commands are sent to the corresponding block devices based on the priority path identifier associated with the target aggregation device.
[0006] This application embodiment also provides a device management apparatus, the apparatus comprising: The query unit is configured to query the target aggregation device based on the query instruction corresponding to the first protocol for the target block device under the current first protocol to be managed. The query instruction includes a first device identifier field corresponding to the first protocol, which carries the device identifier of the target block device. The query instruction also adds a second device identifier field corresponding to the second protocol and a priority path identifier, whereby the second device identifier field carries the device identifier of the target block device. The priority path identifier indicates whether the first protocol or the second protocol takes precedence. The aggregation unit is configured to, if a target aggregation device exists and its device identifier is a device identifier carried in either the first protocol device identifier field or the second protocol device identifier field, aggregate the target block device as a block device under the first protocol to the target aggregation device; if the target aggregation device does not exist, create a target aggregation device, with the target block device being the first block device in the created target aggregation device, and the target aggregation device is associated with the priority path identifier. The IO command issuing unit is configured to issue IO commands to the corresponding block devices based on the priority path identifier associated with the target aggregation device.
[0007] This application also provides an electronic device, which includes a processor and a computer-readable storage medium, wherein computer program instructions are stored in the computer-readable storage medium, and the computer program instructions, when executed by the processor, cause the processor to perform the steps of the method described above.
[0008] This application also provides a computer-readable storage medium storing computer program instructions that, when executed, can implement the steps of the method described above.
[0009] As can be seen from the above technical solutions, in this embodiment, by customizing and adding a device identifier field and a priority path identifier corresponding to the second protocol in the query instruction of the first protocol, it is possible to carry dual protocol device identifiers in the same query process at the same time and set a protocol priority strategy. It is not necessary to perform independent query operations based on different protocols. When a corresponding target aggregation device exists, the target block device under the first protocol is directly aggregated to that device. When it does not exist, a new target aggregation device is created and the target block device is used as the first block device. This realizes the unified aggregation management of block devices under different protocols. Subsequent IO instructions for the target aggregation device can be preferentially issued to the block device of the corresponding protocol according to the associated priority path identifier. This not only realizes the unified scheduling and management of multi-protocol block devices, but also selects the access path according to the preset priority, improving the flexibility and efficiency of block device access.
[0010] Furthermore, by explicitly defining the first and second protocols as a bidirectional combination of SCSI and NVMe, the collaborative management problem of these two commonly used block device protocols, SCSI and NVMe, is specifically addressed.
[0011] Furthermore, for protocol commands to be sent to the target aggregation device, the system first identifies whether a block device under that protocol exists in the target aggregation device based on the first target protocol to which the command belongs. If it exists, the command is sent directly; otherwise, the command undergoes bidirectional protocol conversion, and the converted command is sent to the designated block device of the corresponding protocol. The returned response information is then converted in reverse protocol and output. This achieves flexible conversion and compatibility between the two protocols. Even if the block device of the protocol to which the command belongs does not exist in the target aggregation device, the command can still be executed normally and a valid response can be returned through protocol conversion, thus improving the compatibility and reliability of device access.
[0012] Furthermore, when issuing IO commands based on the priority path identifier associated with the target aggregation device, it is first determined whether there is a block device under the protocol indicated by the priority path identifier in the target aggregation device. If it exists, the command is issued to the block device of that protocol first; otherwise, it is issued to the block device of another protocol. This not only strictly follows the preset priority path strategy to ensure that IO commands can be executed through the block device of the specified protocol first, but also automatically switches to the block device of another protocol when the block device corresponding to the priority protocol does not exist. This avoids access interruption problems caused by priority path failure, further optimizes command issuance efficiency and device scheduling flexibility, and improves the stability of the device management system. Attached Figure Description
[0013] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this specification and, together with the description, serve to explain the principles of this specification.
[0014] Figure 1 A flowchart illustrating the method provided in this application embodiment; Figure 2 This is a flowchart illustrating the issuance of IO instructions according to an embodiment of this application; Figure 3 This is a flowchart illustrating the SCSI command issuance process according to an embodiment of this application. Figure 4 This is a structural diagram of the device provided in the embodiments of this application; Figure 5 This is a structural diagram of the electronic device provided in the embodiments of this application. Detailed Implementation
[0015] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this specification. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this specification as detailed in the appended claims.
[0016] The terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of this specification. The singular forms “a,” “the,” and “the” as used in this specification and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.
[0017] It should be understood that although the terms first, second, third, etc., may be used in this specification to describe various information, this information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this specification, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."
[0018] Aggregation is a common technique in computer storage technology. It combines multiple block devices pointing to the same physical storage device to form a single logical aggregate device, facilitating management. In computer storage, a Logical Unit Number (LUN) corresponds to an independent logical storage unit; that is, multiple block devices belonging to the same LUN correspond to the same storage space. Therefore, multipathing software can be used to integrate these block devices to form aggregate devices, thereby achieving unified management.
[0019] Existing multipath software can only aggregate devices using the same protocol. This is because for block devices using different protocols, querying the target aggregation device based on the query command corresponding to the different protocols returns different device identifiers. Specifically, for a given protocol, when querying the target aggregation device based on the corresponding query command, only the device identifier carried in the device identifier field under that protocol can be found. For example, for SCSI block devices, when querying the target aggregation device based on the query command corresponding to the SCSI protocol (inquiry), only aggregation devices with the same World Wide Name (wwn) as the SCSI block device can be found, where wwn is the device identifier carried in the device identifier field under the SCSI protocol. Similarly, when querying the target aggregation device based on the query command corresponding to the NVMe protocol (identify), only aggregation devices with the same World Wide Identifier (wwid) as the NVMe block device can be found, where wwid is the device identifier carried in the device identifier field under the NVMe protocol. It is easy to see that the aggregated device formed by NVMe block device aggregation cannot aggregate SCSI block devices. That is, the multipath software in the existing technology can only aggregate block devices under the same protocol, and cannot aggregate block devices with different protocols.
[0020] In view of this, embodiments of this application provide a device management method that can utilize multipath software to aggregate block devices of different protocols, thereby enabling the aggregation of block devices under different protocols.
[0021] See Figure 1 , Figure 1 The device management method flowchart provided in this application embodiment is applied to SCSI block devices, such as... Figure 1 As shown, the process may include the following steps: Step 101: For the target block device under the current first protocol to be managed, query the target aggregation device based on the query instruction corresponding to the first protocol; the query instruction includes a first device identifier field corresponding to the first protocol, the first device identifier field carries the device identifier of the target block device, the query instruction also adds a second device identifier field corresponding to the second protocol and a priority path identifier, the second device identifier field carries the device identifier of the target block device; the priority path identifier indicates whether the first protocol or the second protocol takes precedence.
[0022] In this embodiment, the first protocol is SCSI, and the second protocol is NVMe. Specifically, the block device to be managed refers to a newly launched block device. A block device coming online means that the block device is successfully discovered, identified, and included in management by the system, entering a state where it can be accessed and used normally. It should be understood that in this embodiment, the type of block device is determined based on the protocol currently used by the storage space corresponding to the block device. Specifically, when the storage space currently uses the SCSI protocol, the corresponding block device is a SCSI block device; when the storage space currently uses the NVMe protocol, the corresponding block device is an NVMe block device.
[0023] The query command includes the target block device's attribute information, used for device identification and compatibility assessment. In the SCSI protocol, the query command is specifically the `inquiry` command. Besides the first device identifier field corresponding to the first protocol, it also includes a custom-added second identifier field corresponding to the second protocol. This can be achieved by adding the second identifier field corresponding to the second protocol to the vendor-defined fields in the query command. Specifically, the device identifier for the target block device under the first protocol in the first device identifier field is `wwn`, and the device identifier for the target block device under the second protocol in the second device identifier field is `wwid`.
[0024] That is, in this embodiment of the application, a device identifier field including wwid corresponding to the target block device under the NVMe protocol is added to the inquiry command of the SCSI protocol, so that the inquiry command includes not only the wwn of the target block device, but also the wwid of the target block device under the NVMe protocol.
[0025] Step 102: If a target aggregation device exists, and the device identifier of the target aggregation device is the device identifier carried in the first protocol device identifier field or the second protocol device identifier field, then the target block device is aggregated to the target aggregation device as a block device under the first protocol. If the target aggregation device does not exist, then based on the creation of the target aggregation device, the target block device is the first block device in the created target aggregation device, with the block device under the first protocol as the first block device; the target aggregation device is associated with the priority path identifier.
[0026] Since the query command includes the wwn and wwid of the target block device, the query command can be used to query the target aggregation device that matches the wwn or wwid of the target block device. When a target aggregation device that matches the wwn or wwid of the target block device is found, it indicates that the target block device and the target aggregation device belong to the same storage space. At this time, the target block device is added to the target aggregation device.
[0027] If no target aggregation device corresponding to the target block device's wwn or wwid is found, it indicates that the corresponding target aggregation device does not yet exist in the current aggregation devices. In this case, the target block device is created as the first child device of the aggregation device, and the device identifier of the target aggregation device is set to the wwn or wwid of the target block device, thus uniquely identifying the target aggregation device. For example, if the wwn of the target block device is 60:0a:0b:0c:d1:e2:f3:45 and the wwid is 60:00:09:72:aa:bb:cc:dd, then the device identifier of the target aggregation device can be set to either 60:0a:0b:0c:d1:e2:f3:45 or 60:00:09:72:aa:bb:cc:dd, as long as the device identifier can uniquely correspond to the storage space of the target aggregation device. After the target aggregation device is created, a priority path identifier is associated with the target aggregation device, enabling the target aggregation device to issue IO commands to the block device according to a preset priority.
[0028] Step 103: For IO commands to be sent to the target aggregation device, send the IO commands to the corresponding block devices based on the priority path identifier associated with the target aggregation device.
[0029] The IO (Input / Output) commands are general-purpose input / output commands used for reading and writing to block devices. The priority path identifier specifically indicates the priority of the SCSI and NVMe protocols; that is, it indicates whether the SCSI or NVMe protocol takes precedence when issuing IO commands. Since the target aggregation device is associated with a priority path identifier during creation, when an IO command is received from the target aggregation device, it is forwarded to the corresponding block device based on the priority path identifier associated with the target aggregation device, thereby enabling the processing of the IO command.
[0030] Specifically, if the priority path identifier indicates the first protocol, the I / O command is preferentially sent to the block device under the first protocol; if the priority path identifier indicates the second protocol, the I / O command is preferentially sent to the block device under the second protocol.
[0031] However, there may be situations where the link corresponding to the protocol indicated by the priority path identifier is unavailable. In this case, the IO command is sent to the block device corresponding to another protocol. Specifically, if the priority path identifier indicates the first protocol and the link corresponding to the first protocol is currently unavailable, the IO command is preferentially sent to the block device under the second protocol in the target aggregation device. If the priority path identifier indicates the second protocol and the link corresponding to the second protocol is currently unavailable, the IO command is preferentially sent to the block device under the first protocol in the target aggregation device.
[0032] The protocol indicated by the priority path identifier associated with the target aggregation device is described as SCSI. When I / O commands are sent to the aggregation device, the I / O commands are sent to the SCSI block devices in the aggregation device first. If the aggregation device does not contain SCSI block devices, the I / O commands are sent to the NVMe block devices first.
[0033] To facilitate understanding, a flowchart is used to explain this process in detail. Figure 2 This is a flowchart of the IO command issuance in this embodiment. The priority path identifier indicates the SCSI protocol for explanation, such as... Figure 2 As shown, it includes: Step 1301: The aggregation device receives IO commands.
[0034] Step 1302: Does the aggregation device include SCSI block devices? If so, proceed to step 1303.
[0035] If not, proceed to step 1304.
[0036] Step 1303: Send IO commands to the SCSI block device.
[0037] Step 1304: Does the aggregation device include NVMe block devices? If so, proceed to step 1305.
[0038] If not, proceed to step 1306.
[0039] Step 1305: Send IO commands to the SCSI block device.
[0040] Step 1306: Send the IO command to the block device that can process IO commands.
[0041] Steps 1301-1306 achieve the goal of prioritizing the issuance of I / O commands to the block device indicated by the priority path identifier based on the priority path identifier.
[0042] The aggregation device formed through the embodiments of this application can simultaneously include SCSI block devices and NVMe block devices, and can issue IO commands based on the priority path identifier. Thus, aggregation of block devices with different protocols is achieved. It should be understood that the principle is the same when the target block device is an NVMe block device. Figure 1 The methods shown are similar, and will not be described in detail here in the embodiments of this application.
[0043] As one embodiment, for a protocol instruction to be sent to a target aggregation device, the system determines whether the target aggregation device has a block device under the first protocol based on the first protocol described in the protocol instruction, and performs the corresponding operation when the determination is made as yes or no. Specifically, the protocol instruction may be an instruction belonging to the first protocol or the second protocol, and is specifically used to manage block devices under the corresponding protocol.
[0044] The following explanation uses the SCSI protocol as the first protocol corresponding to the protocol command (hereinafter referred to as the first protocol command), where the first protocol is the SCSI protocol. First, it is determined whether there is a SCSI block device in the sub-device of the target aggregation device. If it exists, it means that the first protocol command can be processed directly through the SCSI block device, and the first protocol command is directly sent to the SCSI block device. If there is no SCSI block device, it means that the block device in the target aggregation device is an NVMe block device. In this case, the first protocol command is converted to a second protocol command adapted to the NVMe protocol, and then the converted second protocol command is sent to the block device under the second protocol in the target aggregation device. After receiving the second protocol command, the block device under the second protocol performs the corresponding data read / write and query operations according to the second protocol command, and returns the corresponding second response command that also belongs to the second protocol, that is, the response command under the NVMe protocol.
[0045] Upon receiving a second response instruction returned by a block device under the second protocol, based on the second protocol instruction, the system performs protocol conversion on the second response instruction to obtain a first response instruction corresponding to the first protocol, and then outputs the first response instruction. Specifically, upon receiving a response instruction based on the second protocol instruction returned by the target aggregation device, since this response instruction corresponds to the second protocol instruction, and the first response instruction sent to the target aggregation device corresponds to the first protocol, a reverse protocol conversion is performed on the second response instruction to convert it into a first response instruction corresponding to the first protocol.
[0046] The above method enables adaptive forwarding and interoperability of protocol commands of different protocol types, ensuring that normal access and interaction can still be completed through protocol conversion even when the target aggregation device does not support the native protocol of the command, thereby improving the compatibility of the aggregation device and the flexibility of command processing.
[0047] To facilitate understanding, a flowchart is used to explain this process in detail. Figure 3 This is a flowchart of the SCSI command issuance process according to an embodiment of this application, such as... Figure 3 As shown, it includes: Step 301: The aggregation device receives SCSI commands.
[0048] Step 302: Determine whether the aggregation device includes SCSI block devices.
[0049] If so, proceed to step 303.
[0050] If not, proceed to step 305.
[0051] Step 303: Send the SCSI command to the SCSI block device.
[0052] Step 304: The SCSI block device determines the response instruction based on the SCSI instruction.
[0053] Step 305: Determine whether the aggregation device includes NVMe block devices.
[0054] If not, proceed to step 306.
[0055] If so, proceed to step 307.
[0056] Step 306: Perform error handling.
[0057] Specifically, when the sub-devices of the aggregation device do not contain either SCSI sub-devices or NVMe sub-devices, the commands cannot be processed through the sub-devices. In this case, error-related processing is performed to indicate that the aggregation device cannot process SCSI commands.
[0058] Step 307: Determine the NVMe instruction based on the SCSI instruction through protocol conversion.
[0059] Step 308: Send NVMe commands to the NVMe block device.
[0060] Step 309: The NVMe block device determines the response command based on the NVMe command.
[0061] Step 310: Convert the response command to SCSI format via protocol conversion.
[0062] It should be understood that the specific execution method for the third protocol instruction corresponding to the second protocol to be sent to the target aggregation device is similar to the above method and will not be elaborated here.
[0063] Figure 4 This is a structural diagram of the device provided in the embodiments of this application, including: The query unit is configured to query the target aggregation device based on the query instruction corresponding to the first protocol for the target block device under the current first protocol to be managed. The query instruction includes a first device identifier field corresponding to the first protocol, which carries the device identifier of the target block device. The query instruction also adds a second device identifier field corresponding to the second protocol and a priority path identifier, whereby the second device identifier field carries the device identifier of the target block device. The priority path identifier indicates whether the first protocol or the second protocol takes precedence. The aggregation unit is configured to, if a target aggregation device exists and its device identifier is a device identifier carried in either the first protocol device identifier field or the second protocol device identifier field, aggregate the target block device as a block device under the first protocol to the target aggregation device; if the target aggregation device does not exist, create a target aggregation device, with the target block device being the first block device in the created target aggregation device, and the target aggregation device is associated with the priority path identifier. The IO command issuing unit is configured to issue IO commands to the corresponding block devices based on the priority path identifier associated with the target aggregation device.
[0064] Optionally, the first protocol is SCSI and the second protocol is NVMe; or The first protocol is NVMe, and the second protocol is SCSI.
[0065] Optionally, prioritizing the delivery of IO commands to the corresponding block devices based on the priority path identifier associated with the target aggregation device includes: If the priority path identifier indicates the first protocol, the IO command will be preferentially sent to the block device under the first protocol in the target aggregation device; If the priority path identifier indicates the second protocol, the IO command will be preferentially sent to the block device under the second protocol in the target aggregation device.
[0066] Optionally, prioritizing the delivery of IO commands to the corresponding block devices based on the priority path identifier associated with the target aggregation device includes: If the priority path identifier indicates the first protocol and the link corresponding to the current first protocol is unavailable, then the IO command will be preferentially sent to the block device under the second protocol in the target aggregation device; If the priority path identifier indicates the second protocol, and the link corresponding to the current second protocol is unavailable, then the IO command will be preferentially sent to the block device under the first protocol in the target aggregation device.
[0067] Optionally, the method further includes: For a first protocol instruction corresponding to a first protocol to be sent to a target aggregation device, identify whether there is a block device under the first protocol in the target aggregation device; If so, the instruction will be sent to the block device under the first protocol; If not, then: The first protocol instruction is converted to obtain the second protocol instruction corresponding to the second protocol, and the second protocol instruction is sent to the block device under the second protocol in the target aggregation device; Receive the second response instruction corresponding to the second protocol returned by the block device under the second protocol based on the second protocol instruction, perform protocol conversion on the second response instruction to obtain the first response instruction corresponding to the first protocol, and output the first response instruction.
[0068] Optionally, the method further includes: For the third protocol instruction corresponding to the second protocol to be sent to the target aggregation device, identify whether there is a block device under the second protocol in the target aggregation device; If so, the instruction will be sent to the block device under the second protocol; If not, then: The third protocol instruction is converted to obtain the fourth protocol instruction corresponding to the first protocol, and the fourth protocol instruction is sent to the block device under the first protocol in the target aggregation device; Receive the fourth response instruction corresponding to the first protocol returned by the block device under the first protocol based on the fourth protocol instruction, perform protocol conversion on the fourth response instruction to obtain the third response instruction corresponding to the second protocol, and output the third response instruction.
[0069] The first target protocol is either the first protocol or the second protocol, and the second target protocol is another one of the first protocol and the second protocol.
[0070] This application also provides embodiments that... Figure 4 Hardware structure description of the illustrated device. This hardware structure is... Figure 5 The structure in the illustrated electronic device. Please refer to [link / reference]. Figure 5 , Figure 5 This is a structural diagram of an electronic device provided in an embodiment of this application. Figure 5 As shown, the hardware structure may include: a processor and a machine-readable storage medium, the machine-readable storage medium storing machine-executable instructions that can be executed by the processor; the processor is used to execute the machine-executable instructions to implement the method disclosed in the above example of this application.
[0071] Based on the same concept as the above method, this application also provides a machine-readable storage medium storing a plurality of computer instructions, which, when executed by a processor, can implement the method disclosed in the above examples of this application.
[0072] This application can be implemented by executing several computer program code flows using an electronic device. The electronic device loads the computer program into non-volatile memory and uses its processor to read these computer program instructions into memory for execution. One hardware structure diagram of the electronic device, besides... Figure 5 In addition to the processor, memory, network interface, and non-volatile memory shown, electronic devices may also include other hardware depending on their actual functions, which will not be elaborated further.
Claims
1. A method for managing equipment, characterized in that, The method includes: For the target block device under the current first protocol to be managed, the target aggregation device is queried based on the query instruction corresponding to the first protocol; the query instruction includes a first device identifier field corresponding to the first protocol, the first device identifier field carries the device identifier of the target block device, the query instruction also adds a second device identifier field corresponding to the second protocol and a priority path identifier, the second device identifier field carries the device identifier of the target block device; the priority path identifier indicates whether the first protocol or the second protocol takes precedence; If a target aggregation device exists, and the device identifier of the target aggregation device is the device identifier carried in the first protocol device identifier field or the second protocol device identifier field, then the target block device is aggregated to the target aggregation device as a block device under the first protocol. If the target aggregation device does not exist, then based on the creation of the target aggregation device, the target block device is the first block device in the created target aggregation device, with the block device under the first protocol as the first block device; the target aggregation device is associated with the priority path identifier. For IO commands to be sent to the target aggregation device, the IO commands are sent to the corresponding block devices based on the priority path identifier associated with the target aggregation device.
2. The method according to claim 1, characterized in that, The first protocol is SCSI, and the second protocol is NVMe; or The first protocol is NVMe, and the second protocol is SCSI.
3. The method according to claim 1, characterized in that, Based on the priority path identifier associated with the target aggregation device, IO commands are preferentially issued to the corresponding block device, including: If the priority path identifier indicates the first protocol, the IO command will be preferentially sent to the block device under the first protocol in the target aggregation device; If the priority path identifier indicates the second protocol, the IO command will be preferentially sent to the block device under the second protocol in the target aggregation device.
4. The method according to claim 3, characterized in that, Based on the priority path identifier associated with the target aggregation device, IO commands are preferentially issued to the corresponding block device, including: If the priority path identifier indicates the first protocol and the link corresponding to the current first protocol is unavailable, then the IO command will be preferentially sent to the block device under the second protocol in the target aggregation device; If the priority path identifier indicates the second protocol, and the link corresponding to the current second protocol is unavailable, then the IO command will be preferentially sent to the block device under the first protocol in the target aggregation device.
5. The method according to claim 1, characterized in that, The method further includes: For a first protocol instruction corresponding to a first protocol to be sent to a target aggregation device, identify whether there is a block device under the first protocol in the target aggregation device; If so, the instruction will be sent to the block device under the first protocol; If not, then: The first protocol instruction is converted to obtain the second protocol instruction corresponding to the second protocol, and the second protocol instruction is sent to the block device under the second protocol in the target aggregation device; Receive the second response instruction corresponding to the second protocol returned by the block device under the second protocol based on the second protocol instruction, perform protocol conversion on the second response instruction to obtain the first response instruction corresponding to the first protocol, and output the first response instruction.
6. The method according to claim 1, characterized in that, The method further includes: For the third protocol instruction corresponding to the second protocol to be sent to the target aggregation device, identify whether there is a block device under the second protocol in the target aggregation device; If so, the instruction will be sent to the block device under the second protocol; If not, then: The third protocol instruction is converted to obtain the fourth protocol instruction corresponding to the first protocol, and the fourth protocol instruction is sent to the block device under the first protocol in the target aggregation device; Receive the fourth response instruction corresponding to the first protocol returned by the block device under the first protocol based on the fourth protocol instruction, perform protocol conversion on the fourth response instruction to obtain the third response instruction corresponding to the second protocol, and output the third response instruction.
7. An equipment management device, characterized in that, The device includes: The query unit is configured to query the target aggregation device based on the query instruction corresponding to the first protocol for the target block device under the current first protocol to be managed. The query instruction includes a first device identifier field corresponding to the first protocol, which carries the device identifier of the target block device. The query instruction also adds a second device identifier field corresponding to the second protocol and a priority path identifier, whereby the second device identifier field carries the device identifier of the target block device. The priority path identifier indicates whether the first protocol or the second protocol takes precedence. The aggregation unit is configured to, if a target aggregation device exists and its device identifier is a device identifier carried in either the first protocol device identifier field or the second protocol device identifier field, aggregate the target block device as a block device under the first protocol to the target aggregation device; if the target aggregation device does not exist, create a target aggregation device, with the target block device being the first block device in the created target aggregation device, and the target aggregation device is associated with the priority path identifier. The IO command issuing unit is configured to issue IO commands to the corresponding block devices based on the priority path identifier associated with the target aggregation device.
8. The apparatus according to claim 7, characterized in that, The first protocol is SCSI, and the second protocol is NVMe; or The first protocol is NVMe, and the second protocol is SCSI.
9. An electronic device, characterized in that, The electronic device includes: Processor; and A computer-readable storage medium storing computer program instructions that, when executed by the processor, cause the processor to perform the steps of the method as described in any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer program instructions that, when executed by a processor, cause the processor to perform the steps of the method as described in any one of claims 1 to 6.