Storage device access method and apparatus, storage medium, and electronic device
By deploying storage expansion devices between servers and storage devices and dynamically adjusting storage channels, the problem of insufficient storage device expansion flexibility is solved, achieving efficient and flexible storage expansion and meeting the performance requirements of high IO access density applications.
Patent Information
- Application Number
- PCT/CN2024/136881
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-03-29
- Filing Date
- 2024-12-04
- Publication Date
- 2025-10-02
AI Technical Summary
In the existing technology, the expansion flexibility of server local storage devices is insufficient and the expansion capacity is fixed, resulting in low storage device expansion efficiency and high cost, and unable to meet the performance requirements of high IO access density applications.
By deploying storage expansion devices between servers and storage devices, storage channels are established, allowing servers to identify and allocate multiple virtual storage devices, realizing data access conversion and mapping, dynamically adjusting the number of storage devices, and avoiding hardware replacement and waste.
It improves the storage device expansion efficiency, provides independent storage device services, improves performance and flexibility, and reduces costs without changing the server storage device usage logic or adding new devices.
Smart Images

Figure CN2024136881_02102025_PF_FP_ABST
Abstract
Description
Storage device access method, device, storage medium and electronic device
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to the Chinese patent application filed with the China Patent Office on March 29, 2024, with application number 202410376341.2, and application name “Access method, device, storage medium and electronic device for storage device”, all contents of which are incorporated by reference into this application. Technical Field
[0003] The embodiments of the present application relate to the field of computers, and more specifically, to a method and apparatus for accessing a storage device, a non-volatile readable storage medium, and an electronic device. Background Art
[0004] In data center cloud service scenarios, some virtual machines or containers with strong real-time requirements and high IO (Input / Output) access density have high performance requirements for storage devices such as bandwidth latency. The performance of remotely deployed centralized storage systems cannot meet the requirements, and local storage devices on the server are needed to provide support. Since the number of PCIe (Peripheral Component Interconnect express, a high-speed serial computer expansion bus standard) ports that can be provided by the server CPU (Central Processing Unit) is limited, the number of supported storage devices is also limited. Therefore, how to use limited local storage device resources to support the local access needs of a large number of virtual machines is one of the problems faced by storage performance improvement in current cloud scenarios. In order to solve the above problems, the relevant technology adopts a PCIe Switch expansion solution, in which a dedicated Switch controller is used to expand the PCIe port of a CPU into multiple downstream ports to increase the number of storage devices carried by the server, and each downstream port is connected to a storage device. The advantage of this solution is that it increases the local storage capacity of the server in hardware without the need for additional software coordination, has low latency, and is highly versatile. However, this solution lacks expansion flexibility. The PCIe switch model must be selected at the outset of server motherboard design, which sets the expansion capacity. Subsequent expansion requires replacing a PCIe switch controller with a larger number of ports, requiring a complete motherboard hardware redesign. If demand decreases, the additional PCIe lanes remain idle, resulting in waste. Furthermore, expansion is achieved by connecting a storage device to each downstream port of the PCIe switch, resulting in high overall costs. Summary of the Invention
[0005] Embodiments of the present application provide a method, apparatus, non-volatile readable storage medium, and electronic device for accessing a storage device, to at least solve the problem of low storage device expansion efficiency when expanding a storage device connected to a server in the related art.
[0006] According to one embodiment of the present application, a method for accessing a storage device is provided, which is applied to a storage expansion device, wherein the storage expansion device is connected between a first storage device and a server, one or more virtual machines are deployed on the server, one or more storage channels are established in the storage expansion device that are allowed to be identified as a second storage device by the server, the second storage device is assigned to the virtual machine deployed on the server, and the storage channel is assigned corresponding storage space on the first storage device. The method includes: receiving a data access request sent by a reference virtual machine, wherein the one or more virtual machines include a reference virtual machine, and the data access request is used to request a first data access to a reference storage device in the second storage device that is assigned to the reference virtual machine; responding to the data access request, converting the first data access into a second data access through the reference storage channel, wherein the reference storage channel is a storage channel identified as a reference storage device among the storage channels established in the storage expansion device, and the second data access is a data access to a reference storage space in the first storage device that corresponds to the reference storage channel; and controlling the reference storage space of the first storage device to perform the second data access.
[0007] Converting a first data access into a second data access by referencing a memory channel, comprising:
[0008] determining a reference storage channel identified as a reference storage device from the storage channels established in the storage expansion device;
[0009] forwarding the first data access to a reference memory channel;
[0010] The first data access is converted into a second data access by referencing the memory channel.
[0011] Optionally, a first virtual bridge device is further deployed in the storage expansion device, the first virtual bridge device is connected to the storage channel established in the storage expansion device, the first virtual bridge device is further configured to connect to the server and is recognized by the server as being connected to a second storage device, and the first virtual bridge device records the second storage device and the storage channel having a corresponding relationship, wherein:
[0012] Determining a reference storage channel identified as a reference storage device from storage channels established in the storage expansion device, comprising: searching, through a first virtual bridge device, for a reference storage channel corresponding to the reference storage device from a second storage device and a storage channel having a corresponding relationship;
[0013] Forwarding the first data access to the reference storage channel includes: forwarding the first data access to the reference storage channel through a first virtual bridge device.
[0014] Optionally, searching, by the first virtual bridge device, for a reference storage channel corresponding to the reference storage device from the second storage devices and storage channels having a corresponding relationship includes:
[0015] extracting a reference device identifier of a reference storage device from a data access request by the first virtual bridge device;
[0016] The reference storage channel corresponding to the reference device identifier is searched for from the storage device identifiers and storage channels having a corresponding relationship through the first virtual bridge device, wherein the storage device identifier is a device identifier assigned to the corresponding storage channel and allowed to be identified as a storage device.
[0017] Optionally, the method further includes:
[0018] Creating an initial virtual bridge device in the storage expansion unit;
[0019] configuring a first attribute of a transmission protocol for the initial virtual bridge device in a protocol configuration space of the initial virtual bridge device to obtain a first virtual bridge device, wherein the server and the storage expansion device are connected via a protocol bus that complies with the transmission protocol, and the first attribute is a protocol attribute that allows the server to identify the bridge device as complies with the transmission protocol;
[0020] A connection is established between the first virtual bridge device and the storage channel established in the storage expansion apparatus, and a corresponding second storage device and storage channel are recorded.
[0021] Optionally, the storage channel includes a second virtual bridge device and a virtual storage device, the first virtual bridge device is connected to the second virtual bridge device, the second virtual bridge device is connected to the virtual storage device, and the virtual storage device is configured to connect to the first storage device, wherein,
[0022] Converting a first data access into a second data access by referencing a memory channel, comprising:
[0023] receiving a first data access via the second virtual bridge device in the reference memory channel;
[0024] transmitting the first data access to the virtual storage device in the reference storage channel via the second virtual bridge device in the reference storage channel;
[0025] The first data access is converted into a second data access by referencing a virtual storage device in the storage channel.
[0026] Optionally, converting the first data access into the second data access by referring to the virtual storage device in the storage channel includes:
[0027] Obtaining a first access address indicated by the first data access by referring to a virtual storage device in the storage channel, wherein the first access address is a virtual address of the reference storage device indicated by the reference virtual machine for access;
[0028] querying a first storage address corresponding to the first access address from a virtual address range and a storage address range having a corresponding relationship by referring to a virtual storage device in the storage channel, wherein the virtual address range is an address range of the reference storage device identified by the server, and the storage address range is an address range of storage space allocated on the first storage device to the virtual storage device in the reference storage channel;
[0029] The first access address in the first data access is replaced with the first storage address to obtain a second data access.
[0030] Optionally, querying the first storage address corresponding to the first access address from a virtual address range and a storage address range having a corresponding relationship by referring to a virtual storage device in the storage channel includes:
[0031] The first storage address mapped by the first access address is queried from the address mapping between the addressing space of the transmission protocol of the reference storage device and the storage space of the storage protocol of the first storage device by referring to the virtual storage device in the storage channel, wherein the reference storage device is identified by the server as a device that complies with the transmission protocol, the virtual address range includes the addressing space of the transmission protocol, the first storage device is a storage device of the storage protocol, and the storage address range includes the storage space of the storage protocol.
[0032] Optionally, the method further includes:
[0033] Creating multiple sets of initial virtual bridge devices and initial virtual storage devices in the storage expansion device;
[0034] configuring a second attribute of the transmission protocol for the initial virtual bridge device in a protocol configuration space of the initial virtual bridge device to obtain a second virtual bridge device, wherein the server and the storage expansion device are connected via a protocol bus that complies with the transmission protocol, and the second attribute is a protocol attribute that allows the server to identify the bridge device as complies with the transmission protocol;
[0035] The third attribute of the transmission protocol of the initial virtual storage device is configured in the transmission protocol configuration space of the initial virtual storage device, and the fourth attribute of the storage protocol of the initial virtual storage device is configured in the storage protocol configuration space of the initial virtual storage device to obtain a virtual storage device, wherein the first storage device is a storage device that complies with the storage protocol, the third attribute is a protocol attribute that allows it to be identified by the server as a terminal device that complies with the transmission protocol, and the fourth attribute is a protocol attribute that allows it to be identified by the server as a storage device that complies with the storage protocol.
[0036] Optionally, a protocol parsing unit is deployed in the virtual storage device, and the third attribute configuration of the transmission protocol of the initial virtual storage device is performed in the transmission protocol configuration space of the initial virtual storage device, including:
[0037] The data link layer attributes and transaction layer attributes of the transmission protocol of the initial virtual storage device are configured in the transmission protocol configuration space of the initial virtual storage device, wherein the third attribute configuration includes: data link layer attributes and transaction layer attributes, and the protocol parsing unit is used to use the data link layer attributes to perform data link layer protocol parsing on the received data access, and / or, use the transaction layer attributes to perform transaction layer protocol parsing on the received data access.
[0038] Optionally, configuring the fourth attribute of the storage protocol of the initial virtual storage device in the storage protocol configuration space of the initial virtual storage device includes:
[0039] The storage capacity attribute and queue quantity attribute of the storage protocol are configured for the initial virtual storage device in the storage protocol configuration space of the initial virtual storage device, wherein the fourth attribute configuration includes: storage capacity attribute and queue quantity attribute, and the storage capacity attribute and queue quantity attribute are used to be identified by the server as a storage device that complies with the storage protocol.
[0040] Optionally, the storage expansion device further comprises a target bus and a bus interface, wherein the bus interface is configured to connect a plurality of storage channels connected to the target bus to the first storage device, and the bus interface has a mapping relationship between a bus address space of the target bus and a storage address space of the first storage device, wherein:
[0041] Controlling the reference storage space of the first storage device to perform second data access includes:
[0042] receiving a second data access via the target bus;
[0043] The second data access is forwarded to the reference storage space through the bus interface according to the mapping relationship.
[0044] Optionally, the bus interface includes: a bus arbitration unit and a storage device driver unit, wherein the storage device driver unit has a mapping relationship between the bus address space of the target bus and the storage address space of the first storage device, wherein:
[0045] Forwarding the second data access to the reference storage space according to the mapping relationship through the bus interface includes:
[0046] determining, by a bus arbitration unit, whether to process a bus access of the reference storage channel according to a priority of the reference storage channel;
[0047] In the case of determining to process the bus access of the reference storage channel, the second data access is forwarded to the reference storage space according to the mapping relationship by the storage device driver unit.
[0048] According to another embodiment of the present application, a storage expansion device is provided, including: a server port, a processing controller and a storage device port, wherein the server port is connected to the processing controller, the processing controller is connected to the storage device port, one or more storage channels are established in the processing controller, the server port is configured to connect to the server, wherein one or more virtual machines are deployed on the server, the one or more storage channels are allowed to be identified by the server as one or more second storage devices, and the one or more second storage devices are allocated to the virtual machines deployed on the server; the storage device port is configured to connect to the first storage device, wherein the storage channel is allocated corresponding storage space on the first storage device; the processing controller is configured to implement the steps of accessing the aforementioned storage device.
[0049] Optionally, a first virtual bridge device is deployed in the processing controller, the first virtual bridge device is connected to one or more storage channels, the first virtual bridge device is further configured to connect to a server port, and is identified by the server as being connected to a second storage device, and the first virtual bridge device records the second storage device and the storage channel having a corresponding relationship, wherein,
[0050] The first virtual bridging device is configured to search for a reference storage channel corresponding to a reference storage device from second storage devices and storage channels with corresponding relationships when receiving a first data access, wherein the reference storage device is a storage device in one or more second storage devices that is assigned to a reference virtual machine that initiates a data access request, and the reference storage channel is a storage channel in one or more storage channels that is identified as a reference storage device; and forward the first data access to the reference storage channel.
[0051] Optionally, the storage channel includes a second virtual bridge device and a virtual storage device, the second virtual bridge device is connected to the first virtual bridge device, the second virtual bridge device is connected to the virtual storage device, and the virtual storage device is connected to the first storage device, wherein,
[0052] The second virtual bridge device is configured to forward the first data access to the virtual storage device connected to the second virtual bridge device when receiving the first data access;
[0053] The virtual storage device is configured to convert a first data access into a second data access for accessing a storage space corresponding to a reference storage channel in the first storage device.
[0054] Optionally, an external storage device is deployed in the storage expansion device, and the external storage device is connected to the virtual storage device, wherein:
[0055] The external storage device is configured to cache data to be accessed by the virtual storage device in the first storage device.
[0056] Optionally, a target processor is also deployed in the processing controller, and the target processor is connected to one or more storage channels via an internal high-speed bus. The target processor is also connected to a storage device port, wherein:
[0057] The target processor is configured to respond to a data access request transmitted by the storage channel and perform storage control and data access on the first storage device.
[0058] According to another embodiment of the present application, a storage device access device is provided, which is applied to a storage expansion device, wherein the storage expansion device is connected between a first storage device and a server, one or more virtual machines are deployed on the server, one or more storage channels are established in the storage expansion device that are allowed to be identified as a second storage device by the server, the second storage device is assigned to the virtual machine deployed on the server, and the storage channel is assigned corresponding storage space on the first storage device. The device includes: a receiving module, which is configured to receive a data access request sent by a reference virtual machine, wherein the one or more virtual machines include a reference virtual machine, and the data access request is used to request a first data access to a reference storage device in the second storage device that is assigned to the reference virtual machine; a conversion module, which is configured to respond to the data access request and convert the first data access into a second data access through the reference storage channel, wherein the reference storage channel is a storage channel identified as a reference storage device among the storage channels established in the storage expansion device, and the second data access is a data access to a reference storage space in the first storage device corresponding to the reference storage channel; and a control module, which is configured to control the reference storage space of the first storage device to perform the second data access.
[0059] According to another embodiment of the present application, a computer non-volatile readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0060] According to another embodiment of the present application, an electronic device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0061] According to another embodiment of the present application, a computer program product is provided, including a computer program, characterized in that when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.
[0062] Through the present application, a storage expansion device is deployed between a server and a first storage device deployed on the server. The storage expansion device establishes one or more storage channels, which are allowed to be identified by the server as one or more second storage devices and allocated to the virtual machines deployed on the server for use, so that the virtual machine side can believe that each virtual machine is connected to a second storage device. Furthermore, after the storage expansion device receives a data access request sent by a reference virtual machine on the server, it converts the data access to the reference storage device into data access to the storage space corresponding to the reference storage channel in the first storage device through the one or more storage channels identified as the reference storage device. This achieves that only one storage device needs to be connected to provide services for multiple virtual machines on the server, and achieves the expansion of the service-connected storage device without changing the server's storage device usage logic and without adding new storage devices. For the server, each virtual machine is still provided with an independent storage device, making the storage device expansion performance higher, more versatile, and more flexible and reliable. This can solve the problem of low storage device expansion efficiency when expanding server-connected storage devices in the related art, and achieve the effect of improving storage device expansion efficiency when expanding server-connected storage devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] FIG1 is a schematic diagram of a method for accessing a storage device according to an embodiment of the present application;
[0064] FIG2 is a schematic diagram of a storage expansion device according to an embodiment of the present application;
[0065] FIG3 is a schematic diagram of an optional storage device space allocation according to an embodiment of the present application;
[0066] FIG4 is a schematic diagram of an optional bus interface according to an embodiment of the present application;
[0067] FIG5 is an architecture diagram of an optional storage device connection system according to an embodiment of the present application;
[0068] FIG6 is a flowchart of an optional storage expansion device operation according to an embodiment of the present application;
[0069] FIG7 is an optional storage device access flow chart according to an embodiment of the present application;
[0070] FIG8 is a structural diagram of an optional storage expansion device according to an embodiment of the present application;
[0071] FIG9 is a structural block diagram of an optional storage expansion device according to an embodiment of the present application;
[0072] FIG10 is a structural block diagram of an access device of a storage device according to an embodiment of the present application. DETAILED DESCRIPTION
[0073] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0074] It should be noted that the terms "first", "second", etc. in the description and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0075] In this embodiment, a method for accessing a storage device is provided. FIG1 is a schematic diagram of the method for accessing a storage device according to an embodiment of the present application. As shown in FIG1 , the method is applied to a storage expansion device, the storage expansion device is connected between a first storage device and a server, one or more virtual machines are deployed on the server, one or more storage channels are established in the storage expansion device that are allowed to be recognized by the server as a second storage device, the second storage device is assigned to the virtual machine deployed on the server, and the storage channel is assigned corresponding storage space on the first storage device. The method includes the following steps:
[0076] Step S102: receiving a data access request sent by a reference virtual machine, wherein the one or more virtual machines include the reference virtual machine, and the data access request is used to request a first data access to a reference storage device in the second storage device that is allocated to the reference virtual machine;
[0077] Step S104, in response to the data access request, converting the first data access into a second data access through the reference storage channel, wherein the reference storage channel is a storage channel identified as a reference storage device among the storage channels established in the storage expansion device, and the second data access is a data access to a reference storage space in the first storage device corresponding to the reference storage channel;
[0078] Step S106: Control the reference storage space of the first storage device to perform a second data access.
[0079] Through the above steps, a storage expansion device is deployed between the server and the first storage device deployed on the server. The storage expansion device establishes one or more storage channels, which are allowed to be identified by the server as one or more second storage devices and allocated to the virtual machines deployed on the server for use, so that the virtual machine side can believe that each virtual machine is connected to a second storage device. Furthermore, after the storage expansion device receives a data access request sent by the reference virtual machine on the server, it converts the data access to the reference storage device into data access to the storage space corresponding to the reference storage channel in the first storage device through the one or more storage channels identified as the reference storage device. This achieves that only one storage device is needed to provide services for multiple virtual machines on the server, and achieves the expansion of the service-connected storage device without changing the server's storage device usage logic and without adding new storage devices. For the server, each virtual machine is still provided with an independent storage device, making the storage device expansion performance higher, more versatile, and more flexible and reliable. This can solve the problem of low storage device expansion efficiency when expanding the storage device connected to the server in the related art, and achieve the effect of improving the storage device expansion efficiency when expanding the storage device connected to the server.
[0080] In the technical solution provided in the above step S102, the storage device is configured to provide data storage services for the virtual machines on the server. In an embodiment of the present application, the storage device may include, but is not limited to, a hard disk drive, a solid-state hard disk, an optical disk, a flash drive, a tape, etc., such as an NVMe (Non-Volatile Memory express, non-volatile memory host controller interface specification) storage device (for example, NVMe SSD (Solid State Drives, solid-state hard disk)), which is not limited in this solution.
[0081] Optionally, in an embodiment of the present application, the storage channel established in the storage expansion device may be pre-established, or may be established based on the storage channel requirements of a virtual machine deployed on the server, and this solution does not limit this.
[0082] Optionally, in an embodiment of the present application, one or more storage channels are established in the storage expansion device for accessing the corresponding storage space allocated on the first storage device, and then each storage channel is identified as a storage device on the server side. In the present application, the storage space on the first storage device can be allocated according to, but not limited to, the number of virtual machines deployed on the server and the storage space requirements of each virtual machine, and corresponding storage space is allocated to each virtual machine, and a storage space and corresponding connection relationship is established. At the same time, the storage expansion device sends the index information of the storage channel (such as the address information of the storage channel, the communication protocol of the storage channel, the data transmission format, etc.) to the server, so that the server can use the index information to call the storage space corresponding to the storage channel.
[0083] Optionally, in an embodiment of the present application, a reference virtual machine can be allocated one or more storage channels in the storage expansion device. For example, N storage channels are allocated in the storage expansion device. The conventional allocation method may be to allocate a corresponding storage channel to each reference virtual machine, or, in order to achieve the access efficiency of the reference virtual machine to the storage device, M storage channels (where N is greater than or equal to M) can be selected for the reference virtual machine from the N storage channels based on the access requirements of the reference virtual machine to the storage device. Then, the reference virtual machine can simultaneously perform data access operations on the reference storage devices corresponding to the M reference storage channels by sending data access requests. This solution does not limit this.
[0084] Optionally, in an embodiment of the present application, the data access request may include, but is not limited to, an operation request to perform a data read operation on a reference storage device, or may also be a data write request to write data to a reference storage device, which is not limited in this solution.
[0085] In the embodiment provided in the above step S104, the reference storage channel is used to achieve a one-to-one mapping between the reference storage device and the storage space corresponding to the reference storage channel in the first storage device. Since one or more storage channels in the storage expansion device in this embodiment are identified by the server as being connected to one or more storage devices, the virtual machine on the server will send a data access request for performing a first data access on the reference storage device to the reference storage device. The storage expansion device acts as a transit device connected between the first storage device and the server, converting the first data access into a second data access operation for accessing the storage space corresponding to the reference storage channel on the first storage device.
[0086] Optionally, in an embodiment of the present application, the reference storage channel converts the first data access into the second data access by converting the data access address, that is, the virtual machine is connected to the first storage device through the reference storage channel, and the reference storage channel is regarded as a reference storage device on the virtual machine. The virtual machine needs to access data according to the virtual address of the reference storage device when accessing the storage device. Therefore, the first data access needs to carry the first access address for performing the data access operation. Since the reference storage channel side is connected to the first storage device, the reference storage channel needs to perform a data access operation on the storage area corresponding to the reference storage channel on the first storage device. Therefore, the reference storage channel needs to perform an address conversion operation on the first data access, and convert the access address from the first access address to the second access address of the storage area corresponding to the reference storage channel on the first storage device.
[0087] Optionally, in an embodiment of the present application, the reference storage channel converts the first data access into the second data access, which may be an access to a data transmission protocol format, that is, the virtual machine is connected to the first storage device through the reference storage channel, and then the reference storage channel is regarded as a reference storage device on the virtual machine. The virtual machine needs to access data according to the virtual address of the reference storage device when accessing the storage device, so the first data access needs to be accessed according to the data transmission protocol format of the reference storage device. Since the data transmission protocol format of the reference storage device and the data transmission protocol format of the first storage device are stored differently, the reference storage channel needs to perform data transmission protocol format conversion on the first data access, thereby converting the first data access into the second data access.
[0088] Optionally, in the implementation of the present application, the reference storage space can be a continuous storage space corresponding to the reference storage channel in the first storage device, or it can also be multiple non-continuous storage spaces. For example, the storage space of the first storage device can be divided into five consecutive storage spaces, namely storage space A, storage space B, storage space C, and storage space D, wherein the storage area of storage space A ends and is adjacent to the storage space starting position of storage space B, the storage space end position of storage space B is adjacent to the storage space starting position of storage space C, and the storage space end position of storage space C is adjacent to the storage space starting position of storage space D. Then, storage space A or storage space A and B can be used as storage space corresponding to a storage channel. When some of the storage spaces in the middle position of the four storage spaces are allocated to a certain storage channel, such as storage space C is allocated to a certain storage device, then in order to ensure the effective use of the storage space, when another storage channel needs two storage spaces, storage space A and storage space C can be allocated together to another storage channel.
[0089] In the embodiment provided in the above step S106, a mapping relationship between the reference storage channel and the reference storage space allocated for the reference storage channel in the first storage device is maintained in the storage expansion device. The purpose is to perform a one-to-one mapping between the reference storage device and the reference storage space. Then, when it is necessary to perform a second data access operation, the reference storage space on the first storage device that has a mapping relationship with the reference channel is found through the mapping relationship.
[0090] The embodiments of the present application can be applied to, but not limited to, methods for expanding NVMe storage devices. The core idea is to expand the number of PCIe channels by adding an NVMe expansion device between the CPU and the NVMe storage device, while virtualizing an NVMe storage device under each channel and completing a many-to-one mapping with the physical device, so that when only one NVMe storage device is connected downstream, multiple storage devices are presented to the CPU, thereby achieving the purpose of device expansion. The present application uses a hardware device to implement the NVMe storage device expansion function without excessive software involvement, that is, it has the high performance and versatility of the PCIe Switch expansion solution, and the flexibility and low cost of the software virtualization solution. The storage device expansion system includes a server, a storage expansion device, and a first storage device. The storage expansion device is connected between the first storage device and the server. One or more virtual machines are deployed on the server, which can present a topology of multiple virtual NVMe devices (vDevice) mounted under a PCIe root node on the server CPU side, and can dynamically adjust the number of expanded virtual devices according to user needs. In this application, all virtual devices share one NVMe storage device, so the physical NVMe storage space addresses corresponding to multiple virtual devices cannot overlap, and a dedicated address mapping unit is responsible for space management.
[0091] As an optional embodiment, converting the first data access into the second data access by referring to the storage channel includes:
[0092] determining a reference storage channel identified as a reference storage device from the storage channels established in the storage expansion device;
[0093] forwarding the first data access to a reference memory channel;
[0094] The first data access is converted into a second data access by referencing the memory channel.
[0095] Optionally, in an embodiment of the present application, the storage expansion device may, but is not limited to, maintain a mapping relationship between virtual machines and storage channels, which is used to map the virtual machines deployed on the server and the storage channels allocated to the virtual machines. Then, after receiving a data access request sent by a reference virtual machine, the storage expansion device can find the reference storage channel allocated to the reference virtual machine based on the mapping relationship.
[0096] Through the above content, since one or more storage channels are established in the storage expansion device, the storage channels are used to connect the virtual machine and the storage space allocated for the storage channels on the first storage device, so that the server can identify one or more storage channels as one or more second storage devices, and then after receiving the data access request sent by the reference virtual machine, by determining the reference storage channel identified as the reference storage device by the reference virtual machine from one or more storage channels, the storage space on the first storage device where the data access operation needs to be performed is found, and then by forwarding the first data access to the reference storage channel, the reference storage channel can convert the first data access that performs the data access operation on the reference storage device into the second data access that performs the data access operation on the reference storage space allocated for the reference storage device on the first storage device, thereby ensuring the accuracy of converting the first data access into the second data access.
[0097] As an optional embodiment, a first virtual bridge device is further deployed in the storage expansion device. The first virtual bridge device is connected to the storage channel established in the storage expansion device. The first virtual bridge device is also configured to connect to the server and is recognized by the server as being connected to one or more second storage devices. The first virtual bridge device records the corresponding second storage devices and storage channels, wherein:
[0098] Determining a reference storage channel identified as a reference storage device from storage channels established in the storage expansion device, comprising: searching, through a first virtual bridge device, for a reference storage channel corresponding to the reference storage device from a second storage device and a storage channel having a corresponding relationship;
[0099] Forwarding the first data access to the reference storage channel includes: forwarding the first data access to the reference storage channel through a first virtual bridge device.
[0100] Optionally, in an embodiment of the present application, the first virtual bridging device is configured to realize the connection between the server and one or more storage channels, and perform protocol parsing on the data sent by the virtual machine or the data that needs to be returned to the virtual machine. In this embodiment, the first virtual bridging device can also perform routing and forwarding according to the first pair of data packets in the data packet. For example, the data access request sent by the reference virtual machine carries the address information of the reference storage channel allocated to the reference virtual machine, and then the first virtual bridging device finds the reference storage channel that matches the address information from one or more storage channels according to the address information, and sends the data access request to the reference storage channel. Alternatively, after performing the data access operation on the storage space allocated to the reference storage channel in the first storage device, it is necessary to perform feedback on the data access result (for example, if the data access request is a request to read data, the read data needs to be fed back to the reference virtual machine). At this time, the reference storage channel sends the data access result to the first virtual bridging device, and the first virtual bridging device forwards the data access result sent by the reference storage channel to the reference virtual machine corresponding to the reference storage channel.
[0101] Optionally, in an embodiment of the present application, the first virtual bridging device may also maintain a mapping relationship between the virtual machine and the storage channel assigned to the virtual machine, and then implement data forwarding between the virtual machine and the storage channel through the first virtual bridging device, that is, the virtual machine sends a data access request to the first virtual bridging device, and the first virtual bridging device finds a reference storage channel assigned to the virtual machine in one or more storage channels according to the stored mapping relationship, and then forwards the data access request to the reference storage channel, or the storage channel sends the data packet read from the first storage device to the first virtual machine bridging device, and then finds the reference virtual machine corresponding to the storage channel in the virtual machine deployed on the first virtual machine bridging device server, and then forwards the data packet sent by the storage channel to the reference virtual machine.
[0102] Through the above content, by deploying a first virtual machine bridging device in the storage expansion device, which is configured to link the virtual machine and one or more storage channels established in the storage expansion device, since the first virtual machine bridging device is configured to connect to the server and is recognized by the server as connected to one or more second storage devices, the first virtual machine bridging device records the second storage devices and storage channels with corresponding relationships, thereby searching for the reference storage channel corresponding to the reference storage device through the correspondence between the second storage devices and the storage channels on the first virtual bridging device, thereby achieving accurate search of the storage channel and avoiding forwarding errors in the first data access.
[0103] As an optional embodiment, searching, by the first virtual bridge device, for a reference storage channel corresponding to the reference storage device from the second storage devices and storage channels having a corresponding relationship includes:
[0104] extracting a reference device identifier of a reference storage device from a data access request by the first virtual bridge device;
[0105] The reference storage channel corresponding to the reference device identifier is searched for from the storage device identifiers and storage channels having a corresponding relationship through the first virtual bridge device, wherein the storage device identifier is a device identifier assigned to the corresponding storage channel and allowed to be identified as a storage device.
[0106] Optionally, in an embodiment of the present application, the first virtual bridging device is responsible for executing the transit connection between the server and the storage channel. On the server side, the server believes that it is connected to multiple second storage devices, and then generates a data access request to call the second storage device. The data access request carries the reference device identifier of the second storage device to be requested to access. The first virtual bridging device maintains the correspondence between the storage device identifier and the storage channel, and then determines the reference storage channel corresponding to the reference device identifier through the correspondence, and then sends the corresponding data access request to the reference storage channel, thereby calling the first storage device.
[0107] Through the above steps, by setting up a first virtual bridge device and using the virtual bridge device as a transit connection device between the server and multiple storage channels, since the multiple storage channels are identified by the server as multiple second storage devices, and then by maintaining the correspondence between the device identifier and the storage channel on the first virtual bridge device, the device identifier of the device requested to be called by the device and the storage channel are mapped, thereby achieving accurate search of the storage channel.
[0108] As an optional embodiment, the method further includes:
[0109] Creating an initial virtual bridge device in the storage expansion unit;
[0110] configuring a first attribute of a transmission protocol for the initial virtual bridge device in a protocol configuration space of the initial virtual bridge device to obtain a first virtual bridge device, wherein the server and the storage expansion device are connected via a protocol bus that complies with the transmission protocol, and the first attribute is a protocol attribute that allows the server to identify the bridge device as complies with the transmission protocol;
[0111] A connection between the first virtual bridge device and one or more storage channels is established, and corresponding second storage devices and storage channels are recorded.
[0112] Optionally, in an embodiment of the present application, the first attribute configuration of the transmission protocol for the initial virtual bridge device may include, but is not limited to, register definitions such as PCIe configuration space, Memory base, and Memory limit. By configuring the transmission protocol, it can be identified as a normal bridge device during the server CPU enumeration process.
[0113] Optionally, in an embodiment of the present application, the virtual bridging device can be, but is not limited to, a virtual PCIe bridging device, which is configured to implement bridging between the PCIe buses of the server and the first storage device, or is configured to implement connections between the server and multiple storage channels identified by the server as second storage devices, thereby performing protocol parsing on PCIe data packets from upstream and downstream links, and routing and forwarding upstream and downstream data packets according to the address information in the device. This solution does not limit this.
[0114] Through the above content, by configuring the first attribute of the transmission protocol of the initial virtual bridge device in the protocol configuration space of the initial virtual bridge device, the configured first virtual bridge device can be recognized by the server as a bridge device that complies with the transmission protocol, thereby realizing the normal identification of the first virtual bridge device on the CPU, and further providing protocol protection for the connection between the server and multiple storage channels.
[0115] As an optional embodiment, the storage channel includes a second virtual bridge device and a virtual storage device, the first virtual bridge device is connected to the second virtual bridge device, the second virtual bridge device is connected to the virtual storage device, and the virtual storage device is configured to connect to the first storage device, wherein,
[0116] Converting a first data access into a second data access by referencing a memory channel, comprising:
[0117] receiving a first data access via the second virtual bridge device in the reference memory channel;
[0118] transmitting the first data access to the virtual storage device in the reference storage channel via the second virtual bridge device in the reference storage channel;
[0119] The first data access is converted into a second data access by referencing a virtual storage device in the storage channel.
[0120] Optionally, in an embodiment of the present application, the virtual storage device has the logical functions of the device link layer and the transaction layer, and can perform functions such as unpacking, encapsulating, and verifying DLP (Data-Level Parallelism) and TLP (Task-Level Parallelism) data packets according to the protocol, and complete bus transactions such as memory read and write, configuration read and write. Before the CPU enumerates the device tree, the channel expansion logic can prepare the necessary information such as the virtual device's configuration space, address range, number of devices, etc. as needed to cooperate with upstream system calls.
[0121] Optionally, in an embodiment of the present application, the core functional unit in the virtual device may include, but is not limited to, a protocol parsing unit, a data cache unit, and an address mapping unit. These three parts are interconnected in the virtual device through a high-bandwidth bus; the protocol parsing unit: this unit completes the protocol parsing, packetization, verification, and data processing of the PCIe data link layer and the transaction layer. At the data link layer, an ACK (ACKnowledge Character) / NAK (Negative Acknowledgment) response mechanism is used to perform error retransmission and flow control between the sender and the receiver. DLLP (Data Link Layer Protocol) message processing is performed according to the data link layer protocol to achieve reliable data transmission in the channel, and the sending order of different types of messages is defined to ensure that important information receives priority response. At the transaction layer, the unit uses the bus number, device number, and function number ID (Identity Document) in the TLP data packet to complete routing addressing, realize the reading and writing of the configuration space content, and perform addressing according to the Address field in the TLP packet to realize the reading and writing of the memory space and IO space; the data cache unit is configured to temporarily transmit the data transmitted between the server and the first storage device. When the virtual storage device accesses the PCIe upstream and downstream ports at a high frequency, the data packet processing may not be timely due to the mismatch of the upstream and downstream port response rates. The present application sets a data cache unit inside the virtual storage device to deal with the problem of inconsistent data processing speed. The size of the data cache unit of each virtual storage device can be adjusted to adapt to different application scenarios; address mapping unit: in the present application, the final data storage medium is the first storage device connected to the downstream port, rather than the virtual storage device "seen" by the server CPU. Each virtual storage device has a corresponding space in the first storage device. Data read and written to the virtual storage device will eventually be affected by this space. Therefore, bidirectional data forwarding is required between the virtual storage device and the first storage device to map the CPU's data read and write access to the virtual storage device to the first storage device.
[0122] Optionally, in an embodiment of the present application, the virtual storage device is configured to serve as a data transfer device between the server and the first storage device, that is, to temporarily store the data access request sent by the server, and perform data access operations on the storage area corresponding to the virtual storage device on the first storage device according to the data access request, and temporarily store the accessed data and pass it to the server. Therefore, in order to achieve this purpose, cache control can be allocated to the virtual device in the storage expansion device, that is, the storage space of the storage expansion device is allocated to multiple virtual storage devices, where the storage space of the storage expansion device can be evenly distributed to multiple virtual storage devices or can also be allocated according to the storage space requirements of the business to be handled by each virtual storage device. This solution does not limit this.
[0123] Through the above content, by setting up a second virtual bridge device and a virtual storage device in the storage channel, the first data access request is received through the second virtual bridge device, and the virtual storage device is used as a transit device for the first data access and the second data access, thereby achieving efficient and accurate access to the storage space of the connected first storage device through the storage channel.
[0124] In an embodiment of the present application, the virtual bridging device can be, but is not limited to, a virtual PCIe bridging device, which is configured to implement bridging between two PCIe buses. Figure 2 is a schematic diagram of a storage expansion device according to an embodiment of the present application, as shown in Figure 2: the storage expansion device includes a channel expansion logic module and an internal bus interface module. The channel expansion logic module is configured to be connected to a server port (a server or a virtual machine deployed on a server). The channel expansion logic is also connected to the internal bus interface. The internal bus interface module is connected to a storage device port (a first storage device). The internal bus interface is configured to implement data access to the first storage device by the storage channel created in the storage expansion device. vBridge in this application is a virtual PCIe bridging device (including a first virtual bridging device and a second virtual bridging device), which is configured to implement bridging between two PCIe buses. In this application, the vBridge structure includes register definitions such as PCIe configuration space, Memory base, and Memory limit, which can be identified as a normal PCIe Bridge during CPU enumeration. In this application, vBridge is responsible for establishing a connection between the CPU and the virtual PCIe Device (vDevice (virtual storage device)), performing protocol parsing on PCIe packets from upstream and downstream links, and routing and forwarding upstream and downstream packets based on the address information therein.
[0125] In this embodiment, the vDevice device (virtual storage device) is first a PCIe Endpoint device and also an NVMe storage device based on it. The vDevice device in this application has the logical functions of the PCIe Endpoint device link layer and transaction layer, and can perform functions such as unpacking, encapsulating, and verifying DLP and TLP data packets in accordance with the protocol, and complete bus transactions such as memory reading and writing, and configuration reading and writing. Before the CPU enumerates the PCIe device tree, the channel extension logic can prepare the necessary information such as the configuration space, address range, and number of devices of the vDevice as needed to cooperate with the upstream system call. The core functional units in the vDevice include three parts: a protocol parsing unit, a data cache unit, and an address mapping unit. These three parts are interconnected in the vDevice through a high-bandwidth bus. Details are as follows:
[0126] Protocol parsing unit: This unit completes the protocol parsing, packet encapsulation, verification, and data processing of the PCIe data link layer and transaction layer. At the data link layer, the ACK / NAK response mechanism is used to perform error retransmission and flow control between the sender and the receiver. DLLP message processing is performed according to the data link layer protocol to achieve reliable data transmission in the channel, and the sending order of different types of messages is defined to ensure that important information receives priority response. At the transaction layer, the unit uses the bus number, device number, and function number ID in the TLP data packet to complete routing addressing, realize the reading and writing of the configuration space content, and performs addressing according to the Address field in the TLP packet to realize the reading and writing of the memory space and IO space.
[0127] Based on PCIe, this unit also supports vDevice with the logical functions of NVMe devices. By implementing the standard NVMe control register group, vDevice has the ability to obtain CQ (Completion Queue) and SQ (Submission Queue) queue information from the Host, respond to the Host's DoorBell commands, and send MSI (Message Signaled Interrupts) interrupts. For data writing and reading of NVMe storage space, this unit will forward data and commands between the upstream server CPU and the downstream NVMe device through the vDevice's data cache unit and address mapping unit, thereby completing the actual read and write operations.
[0128] Data cache unit: When vDevice accesses PCIe upstream and downstream ports at a high frequency, the problem of delayed data packet processing will occur due to the mismatch in the response rates of the upstream and downstream ports. This application sets a data cache unit inside the vDevice to deal with the problem of inconsistent data processing speed. The size of the data cache unit of each vDevice can be adjusted to adapt to different application scenarios. The medium of the data cache unit, SRAM (Static Random-Access Memory) or DRAM (Dynamic Random-Access Memory), can be located inside the NVMe expansion device or outside the NVMe expansion device.
[0129] Address mapping unit: In this application, the final data storage medium is the NVMe storage device connected to the downstream port, not the vDevice "seen" by the server CPU. Each vDevice has a corresponding space in the NVMe storage device, and the data read and write of the vDevice will eventually act on this space. Therefore, it is necessary to perform two-way data forwarding between the vDevice and the NVMe storage device to map the CPU's data read and write access to the vDevice to the NVMe storage device. Figure 3 is an optional storage device space allocation diagram according to an embodiment of the present application. As shown in Figure 3, the storage space of the first storage device is allocated according to the target granularity (which can be based on the number of virtual storage devices, or the storage space requirements of these virtual storage devices), thereby obtaining multiple allocated storage spaces, and then the storage space can be allocated to the corresponding virtual storage device according to the data storage requirements of each virtual machine.
[0130] The above work in this application is completed by the address mapping unit in the vDevice. The core idea is to perform a one-to-one mapping between the PCIe BAR (Base Address Register) space of each vDevice and the part of the BAR space of the NVMe storage device allocated to the vDevice. Whenever the vDevice receives a PCIe data packet, it forwards the data packet to the corresponding address of the NVMe storage device according to this mapping relationship. The reverse transmission is also the same. Every time the vDevice receives a data packet from the NVMe storage device, it forwards the data packet to the PCIe BAR space corresponding to the Host. The one-to-one mapping is implemented through a dedicated register group, which uses registers to store the first and last addresses of the PCIe BAR space on the vDevice side and the NVMe storage device side respectively, and uses hardware logic to implement address matching and offset addressing.
[0131] As an optional embodiment, converting the first data access into the second data access by referring to the virtual storage device in the storage channel includes:
[0132] Obtaining a first access address indicated by the first data access by referring to a virtual storage device in the storage channel, wherein the first access address is a virtual address of the reference storage device indicated by the reference virtual machine for access;
[0133] querying a first storage address corresponding to the first access address from a virtual address range and a storage address range having a corresponding relationship by referring to a virtual storage device in the storage channel, wherein the virtual address range is an address range of the reference storage device identified by the server, and the storage address range is an address range of storage space allocated on the first storage device to the virtual storage device in the reference storage channel;
[0134] The first access address in the first data access is replaced with the first storage address to obtain a second data access.
[0135] Optionally, in an embodiment of the present application, the virtual address range may be, but is not limited to, an address range of a storage space allocated on a network connection device for a corresponding storage channel for caching data.
[0136] Optionally, in an embodiment of the present application, in order to improve the utilization rate of the storage space in the first storage device, the storage space of the first storage device can be divided according to the target granularity, thereby dividing the storage space into multiple parts, and then allocating a corresponding storage address range to the virtual storage device according to the data storage capacity and the memory occupancy in the storage space, wherein the storage addresses in the storage address range can be continuous storage addresses or discontinuous storage addresses, that is, in order to improve the utilization rate of the storage space, the storage space corresponding to multiple unoccupied discontinuous storage address ranges in the storage space can be used for data storage, and this solution does not limit this.
[0137] Through the above steps, a virtual address range is allocated to the reference virtual machine corresponding to the reference storage device in the storage space of the storage expansion device, so that the virtual storage device can temporarily store the data transmitted between the server and the first storage device, avoiding the problem of inconsistent data delay, and allocating a corresponding storage address range to the reference virtual machine on the first storage device, and then configuring a virtual address range and a storage address range with a corresponding relationship on the virtual storage device, and then the virtual storage device can replace the first address of the first data access with the first storage address when a data access conversion operation is required according to the mapping relationship, thereby improving the accuracy of data access. This solution does not limit this.
[0138] As an optional embodiment, querying the first storage address corresponding to the first access address from a virtual address range and a storage address range having a corresponding relationship by referring to a virtual storage device in a storage channel includes:
[0139] The first storage address mapped by the first access address is queried from the address mapping between the addressing space of the transmission protocol of the reference storage device and the storage space of the storage protocol of the first storage device by referring to the virtual storage device in the storage channel, wherein the reference storage device is identified by the server as a device that complies with the transmission protocol, the virtual address range includes the addressing space of the transmission protocol, the first storage device is a storage device of the storage protocol, and the storage address range includes the storage space of the storage protocol.
[0140] As an optional embodiment, the method further includes:
[0141] Creating multiple sets of initial virtual bridge devices and initial virtual storage devices in the storage expansion device;
[0142] configuring a second attribute of the transmission protocol for the initial virtual bridge device in a protocol configuration space of the initial virtual bridge device to obtain a second virtual bridge device, wherein the server and the storage expansion device are connected via a protocol bus that complies with the transmission protocol, and the second attribute is a protocol attribute that allows the server to identify the bridge device as complies with the transmission protocol;
[0143] The third attribute of the transmission protocol of the initial virtual storage device is configured in the transmission protocol configuration space of the initial virtual storage device, and the fourth attribute of the storage protocol of the initial virtual storage device is configured in the storage protocol configuration space of the initial virtual storage device to obtain a virtual storage device, wherein the first storage device is a storage device that complies with the storage protocol, the third attribute is a protocol attribute that allows it to be identified by the server as a terminal device that complies with the transmission protocol, and the fourth attribute is a protocol attribute that allows it to be identified by the server as a storage device that complies with the storage protocol.
[0144] Optionally, in an embodiment of the present application, data transmission between the server and the storage expansion device can be, but is not limited to, carried out through the PCIe protocol, that is, the server is a PCIe server, the virtual bridge device is configured to forward data packets between the PCIe server and the virtual storage device, and each second virtual bridge device is connected to a virtual storage device, so standard PCIe attribute settings need to be performed in the PCIe configuration space, and information such as the bus number of the downstream device will be automatically determined when the CPU enumerates the PCIe device tree. This work is implemented by the system management unit of the internal bus interface.
[0145] Optionally, in an embodiment of the present application, the third attribute configuration may include, but is not limited to, PCIe attribute configurations such as DID (Device ID, device identification code) / VID (Vendor ID, manufacturer identification code) and BAR space.
[0146] Optionally, in an embodiment of the present application, the fourth attribute configuration may include, but is not limited to, NVMe attribute configurations such as storage capacity and number of queues, and private attribute configurations such as cache size and priority.
[0147] As an optional embodiment, a protocol parsing unit is deployed in the virtual storage device, and the third attribute configuration of the transmission protocol of the initial virtual storage device is performed in the transmission protocol configuration space of the initial virtual storage device, including:
[0148] The data link layer attributes and transaction layer attributes of the transmission protocol of the initial virtual storage device are configured in the transmission protocol configuration space of the initial virtual storage device, wherein the third attribute configuration includes: data link layer attributes and transaction layer attributes, and the protocol parsing unit is used to use the data link layer attributes to perform data link layer protocol parsing on the received data access, and / or, use the transaction layer attributes to perform transaction layer protocol parsing on the received data access.
[0149] Optionally, in embodiments of the present application, data link layer attributes may include, but are not limited to, data transmission rate, encoding method, frame format, etc., while transaction layer attributes include data transmission order, confirmation mechanism, error handling, etc. For example, at the data link layer, an ACK / NAK response mechanism is used to perform error retransmission and flow control between the sender and receiver, DLLP message processing is performed according to the data link layer protocol to achieve reliable data transmission in the channel, and the sending order of different types of messages is defined to ensure that important information receives priority response.
[0150] Optionally, in an embodiment of the present application, at the data link layer, the bus number, device number and function number ID in the TLP data packet are used to complete routing addressing to realize reading and writing of the configuration space content, and addressing is performed according to the Address field in the TLP packet to realize reading and writing of the memory space and IO space.
[0151] Through the above content, by configuring the data link layer attributes and transaction layer attributes, the transmission protocol of the initial virtual storage device can be effectively managed and controlled, thereby achieving reliable transmission and processing of data.
[0152] As an optional embodiment, configuring the fourth attribute of the storage protocol of the initial virtual storage device in the storage protocol configuration space of the initial virtual storage device includes:
[0153] The storage capacity attribute and queue quantity attribute of the storage protocol are configured for the initial virtual storage device in the storage protocol configuration space of the initial virtual storage device, wherein the fourth attribute configuration includes: storage capacity attribute and queue quantity attribute, and the storage capacity attribute and queue quantity attribute are used to be identified by the server as a storage device that complies with the storage protocol.
[0154] Optionally, in an embodiment of the present application, the configuration of the storage capacity attribute includes but is not limited to setting the total capacity size of the virtual storage device and the capacity ratio allocated to different storage protocols.
[0155] Optionally, in an embodiment of the application, the configuration of the queue quantity attribute includes but is not limited to setting parameters such as the read and write queue quantity and queue depth of the storage protocol to optimize storage performance and improve concurrent access capabilities.
[0156] Through the above content, by configuring the storage capacity attributes and queue quantity attributes of the storage protocol, you can customize the storage protocol configuration for the virtual storage device according to actual needs and application scenarios, thereby improving storage performance and flexibility and meeting the storage needs of different applications.
[0157] As an optional embodiment, the storage expansion device further comprises a target bus and a bus interface, wherein the bus interface is configured to connect a plurality of storage channels connected to the target bus to the first storage device, and the bus interface has a mapping relationship between a bus address space of the target bus and a storage address space of the first storage device, wherein:
[0158] Controlling the reference storage space of the first storage device to perform second data access includes:
[0159] receiving a second data access via the target bus;
[0160] The second data access is forwarded to the reference storage space through the bus interface according to the mapping relationship.
[0161] Optionally, in an embodiment of the present application, the bus interface is a high-bandwidth parallel bus interface connecting each virtual storage device and the storage device port, the bandwidth of which is much greater than the transmission bandwidth of PCIe, and can realize data transmission between each virtual storage device and the downstream port with very low latency.
[0162] As an optional embodiment, the bus interface includes: a bus arbitration unit and a storage device driver unit, wherein the storage device driver unit has a mapping relationship between the bus address space of the target bus and the storage address space of the first storage device, wherein:
[0163] Forwarding the second data access to the reference storage space according to the mapping relationship through the bus interface includes:
[0164] determining, by a bus arbitration unit, whether to process a bus access of the reference storage channel according to a priority of the reference storage channel;
[0165] In the case of determining to process the bus access of the reference storage channel, the second data access is forwarded to the reference storage space according to the mapping relationship by the storage device driver unit.
[0166] Optionally, in an embodiment of the present application, a bus arbitration unit may be configured to address bus conflicts when multiple virtual storage devices simultaneously access a storage device port. The bus arbitration unit in the present application performs arbitration based on the different priority settings of each virtual storage device. When a bus access conflict occurs, it determines which virtual storage device has priority access to the internal bus to ensure quality of service. A dedicated priority field is set in the configuration space of each virtual storage device. For example, an 8-bit register can correspond to 256 priority levels, with smaller values indicating higher priorities.
[0167] Optionally, in an embodiment of the present application, the internal bus interface has an NVMe device driver module (storage device driver unit) for interacting with the controller of the NVMe storage device to complete the initialization of the NVMe storage device, including reading the BAR space content and obtaining the storage capacity, interrupt and DMA (Direct Memory Access) configuration, AER (Advanced Error Reporting) and other hardware attribute settings, configuring CQ and SQ queues, etc. At the same time, in the process of presenting the NVMe storage device to multiple vDevices (virtual storage devices) through the internal bus interface, the NVMe driver can realize the mapping of the PCIe address space of the NVMe storage device to the internal bus address space for vDevice access.
[0168] In this embodiment, the bus interface is a high-bandwidth parallel bus interface connecting each virtual storage device and the storage device port, with a bandwidth much greater than the transmission bandwidth of PCIe, and can realize data transmission between each virtual storage device and the downstream port with very low latency. Figure 4 is a schematic diagram of an optional bus interface according to an embodiment of the present application. As shown in Figure 4, the storage expansion device includes an expansion logic module and an internal bus interface module. The channel expansion logic module is configured to be connected to the server port (server or virtual machine deployed on the server), and the channel expansion logic is also connected to the internal bus interface. The internal bus interface module is connected to the storage device port (first storage device). The channel expansion logic module is configured to create one or more storage channels on the storage expansion device that are allowed to be recognized by the server as the second storage device. The internal bus interface includes a bus arbitration unit, an NVMe driver unit (storage device driver unit) and a system management unit, and its functions are as follows:
[0169] Bus arbitration unit: When multiple vDevices access storage device ports simultaneously, bus conflicts can occur. The bus arbitration unit in this application arbitrates based on the different priorities of each vDevices. When bus access conflicts occur, it determines which vDevices receive priority access to the internal bus to ensure quality of service. A dedicated priority field is set in each vDevice's configuration space. For example, an 8-bit register can correspond to 256 priority levels, with smaller values indicating higher priorities.
[0170] NVMe driver unit: In this application, the internal bus interface has an NVMe device driver module, which is used to interact with the controller of the NVMe storage device to complete the initialization of the NVMe storage device, including reading the BAR space content and obtaining the storage capacity, interrupt and DMA configuration, setting hardware attributes such as AER, configuring CQ and SQ queues, etc. At the same time, when the NVMe storage device is presented to multiple vDevices through the internal bus interface, the NVMe driver can realize the mapping of the PCIe address space of the NVMe storage device to the internal bus address space for vDevice access.
[0171] System Management Unit: The system management unit is responsible for providing the device management interface for this application, enabling user management functions such as adding and removing vDevices, configuring vDevice storage capacity, managing vDevice priorities, and reporting device and operational information. Because vDevice is entirely implemented by internal logic units and does not involve external interfaces, it can be flexibly modified based on the application scenario. In addition to managing the internal bus interface, the system management unit also has the ability to receive end-user settings, modify the entire system, including vBridge and vDevice parameter settings, and handle system exceptions to ensure reliable system operation.
[0172] As an optional embodiment, after controlling the reference storage space of the first storage device to perform the second data access, the method further includes:
[0173] receiving access result information returned by the reference storage space in response to the second data access;
[0174] Forwarding access result information to the reference storage channel;
[0175] The access result information is sent to the server through the reference storage channel.
[0176] Optionally, in an embodiment of the present application, the access result information returned by the reference storage space in response to the second data access may include, but is not limited to, data read from the reference storage space, or may also be the write result returned after the data protocol to be written to the reference storage space is referenced by the storage space. This solution does not limit this.
[0177] Optionally, in an embodiment of the present application, the reference storage channel may include but is not limited to a mapping relationship between the virtual machine that stores the second data access and the virtual machine that initiates the data access on the server, and then the reference storage channel finds the target virtual machine corresponding to the access result information according to the mapping relationship, and then feeds back the access result to the target virtual machine on the server.
[0178] Optionally, in an embodiment of the application, the storage expansion device may be, but is not limited to, configured with a corresponding data cache space for each reference storage channel for caching the data in the reference storage channel. Furthermore, when the data transmission link between the reference storage channel and the server is in an occupied state when receiving the access result information, the access result information can be temporarily stored in the data cache space.
[0179] As an optional embodiment, forwarding the access result information to the reference storage channel includes:
[0180] Extract the source address from the access result information to obtain the reference storage space;
[0181] Determining a reference storage channel corresponding to the reference storage space from the storage channels established in the storage expansion device;
[0182] Send access result information to the reference storage channel.
[0183] Optionally, in an embodiment of the present application, the reference storage channel may be, but is not limited to, determined by the storage expansion device from one or more storage channels according to a mapping relationship between the stored reference storage space and the storage channel, and this solution does not impose any limitation on this.
[0184] As an optional embodiment, sending access result information to the server through the reference storage channel includes:
[0185] Replacing the source address in the access result information from the reference storage space to the reference storage device to obtain reference access result information;
[0186] Send reference access result information to the server.
[0187] As an optional embodiment,
[0188] The method also includes one of the following:
[0189] Determining the number of storage channels established in the storage expansion device according to resource information on the storage expansion device;
[0190] Determining the number of storage channels established in the storage expansion device according to resource information on the storage expansion device and device information of the first storage device;
[0191] The channel quantity of the storage channels established in the storage expansion device is determined according to the resource information on the storage expansion device, the device information of the first storage device, and the virtual machine information of the virtual machine deployed on the server.
[0192] Optionally, in an embodiment of the present application, the number of storage channels in the storage expansion device can be flexibly configured according to demand.
[0193] Optionally, in an embodiment of the present application, the resource information on the storage expansion device may be, but is not limited to, the available space capacity of the storage resource, or the number of multiple candidate storage spaces obtained by dividing the storage resource according to the target granularity, each candidate storage space corresponding to a storage channel.
[0194] Optionally, in an embodiment of the present application, the virtual machine information may include, but is not limited to, the total number of virtual machines currently deployed on the server and the number of virtual machines currently storing data access requirements on the server, and this solution does not impose any restrictions on this.
[0195] As an optional embodiment, determining the number of storage channels established in the storage expansion device according to resource information on the storage expansion device and device information of the first storage device includes:
[0196] detecting a connection with a first storage device;
[0197] When detecting that the device is connected to the first storage device, loading a storage device driver;
[0198] Obtaining device information from the first storage device through a storage device driver;
[0199] The channel quantity of one or more storage channels is determined according to the resource information on the storage expansion device and the device information of the first storage device.
[0200] The storage expansion device of the present application is composed of four parts: a server port, a channel expansion logic, an internal bus interface, and a storage device port. FIG5 is an architecture diagram of an optional storage device connection system according to an embodiment of the present application. As shown in FIG5 , the storage expansion device includes four parts: a server port, a channel expansion logic, an internal bus interface, and a PCIe downstream port. Its functions are as follows:
[0201] 1. Server port:
[0202] The server port is the hardware interface between the NVMe expansion device and the server CPU, responsible for establishing a physical connection with the CPU's PCIe root complex. The server port incorporates the electrical and logical properties of the PCIe physical layer, enabling the transmission of transceiver, clock, reset, and other signals, power supply, serial-to-parallel conversion, link training, and other functions. It can take the form of a connector, gold finger, cable, or other similar device.
[0203] 2. Storage device port:
[0204] The storage device port is the hardware interface between the NVMe expansion device and the NVMe storage device in this application, responsible for establishing a connection with the NVMe storage device. Like the server port, the storage device port includes the electrical and logical properties of the physical layer of the PCIe protocol, can transmit transceiver, clock, reset, and other signals and supply power, and perform functions such as serial-to-parallel conversion and link training. It can take the form of a connector, gold finger, cable, etc.
[0205] 3. Channel expansion logic:
[0206] The channel extension logic is an important part of this application, which is responsible for dynamically creating multiple virtual PCIe devices (vEP) inside the NVMe extension device. They are mainly composed of virtual PCIe Bridge (vBridge) and virtual PCIe devices (vDevice). The channel extension logic is connected to the storage device port through an internal bus. For the server, these vDevices have the same properties as other physical PCIe devices, and the virtual machine management software (VMM (Virtual Machine Monitor)) can easily allocate them to each virtual machine (VM (Virtual Machine)) for use. For downstream NVMe storage devices, the NVMe extension device is embodied as an NVMe master device, which can perform operations such as reading, writing and erasing on the NVMe storage device. The channel extension logic is internally divided into upstream and downstream channels. The data direction of the downstream channel is from the CPU to the NVMe device, and the data direction of the upstream channel is from the NVMe device to the CPU.
[0207] FIG6 is a flowchart of an optional storage expansion device operation according to an embodiment of the present application. As shown in FIG6 , the process includes at least the following steps:
[0208] S601, Internal Bus Interface Configuration. Enumerate and manage NVMe storage devices (first storage device) through the downstream PCIe port, load the driver, and obtain device information, such as PCIe bit width and speed level, storage capacity, etc., to provide information for subsequent vDevice quantity and capacity parameter configuration.
[0209] S602, vDevice (virtual storage device) configuration. This includes PCIe attribute configuration such as DID / VID and BAR space, NVMe attribute configuration such as storage capacity and queue number, and private attribute configuration such as cache size and priority. This work is implemented by the system management unit of the internal bus interface.
[0210] S603, vBridge (virtual bridge device, including the first virtual bridge device and the second virtual bridge device) configuration. In this application, the vBridge is configured to forward data packets between the PCIe RC and the vDevice. Each vBridge is connected to only one vDevice downstream device. Therefore, standard PCIe properties must be set in the PCIe configuration space. The downstream device's bus number and other information are automatically determined when the CPU enumerates the PCIe device tree. This task is implemented by the system management unit of the internal bus interface.
[0211] S604 , the server operating system (OS) is started, and the PCIe bus devices are enumerated. N Endpoint (vDevice) and N+1 Bridge (vBridge) devices are successfully enumerated.
[0212] S605: The server loads the NVMe standard driver and identifies N NVMe devices. Under the action of the virtual machine manager (VMM), the N NVMe devices are allocated to multiple virtual machines.
[0213] S606, the application on each virtual machine accesses the storage device and finally accesses the physical NVMe storage device through the PCIe upstream port <-> VBridge <-> VDevice <-> internal bus interface <-> PCIe downstream port <-> NVMe storage device data channel.
[0214] FIG7 is a flowchart of an optional storage device access according to an embodiment of the present application. As shown in FIG7 , the flowchart includes at least the following steps:
[0215] S701: The channel expansion logic initializes the configuration of vDevice (virtual storage device) and vBridge (virtual bridge device, including the first virtual bridge device and the second virtual bridge device). The CPU enumerates the PCIe device tree, identifies N virtual vDevices, and assigns them to each virtual machine through the VMM.
[0216] S702: A virtual machine initiates a read / write request to the vDevice to which it belongs. The PCIe RC (Root Complex) of the CPU sends the request to the upstream port in this application according to the accessed address range.
[0217] S703: After being imported by the upstream port, the data packet is parsed by the vBridge protocol and forwarded to the corresponding vDevice according to the PCIe ID number or address space range.
[0218] S704: PICe and NVMe protocols are parsed in the vDevice in sequence, and then, through the address mapping link, the address access to the vDevice is converted into access to the internal bus address.
[0219] S705, after the vDevice obtains the bus usage right through bus arbitration, it converts the internal bus address access into read and write access to the downstream physical NVMe storage device with the assistance of the NVMe driver and sends it to the PCIe downstream port.
[0220] S706: The access request is sent to the NVMe storage device via the PCIe downstream port and processed. The returned data is then passed back to the CPU in reverse order through the above steps.
[0221] In this embodiment, by introducing the NVMe storage device expansion device of the present application, an ordinary NVMe SSD is equipped with hardware-supported virtualization-like functions, and the channel extension logic in the FPGA implements key links such as protocol parsing, device management, and address mapping, thereby solving the compatibility issues caused by the complex configuration process of traditional virtualization technologies such as SR-IOV (Single Root I / O Virtualization, a hardware-accelerated virtualization technology).
[0222] The embodiments of this application can be applied, but not limited to, to the expansion of NVMe storage devices. By adding an NVMe channel expansion device to the link, a single NVMe storage device can be presented to the CPU as multiple virtual NVMe devices. Unlike existing software virtualization solutions and hardware PCIe switch expansion solutions, this application combines the high efficiency of hardware expansion solutions with the high flexibility of software virtualization solutions.
[0223] The NVMe channel expansion device includes a PCIe upstream port, a PCIe downstream port, a channel expansion logic and an internal bus interface unit.
[0224] The PCIe upstream port is the hardware interface between this device and the server, responsible for establishing a physical connection with the PCIe RC of the server CPU;
[0225] The PCIe downstream port is the hardware interface between this device and the NVMe storage device, and is responsible for establishing a physical connection with the NVMe storage device.
[0226] The channel extension logic creates multiple PCIe bridge devices (vBridge) and Endpoint devices (vDevice) to complete the protocol parsing and forwarding of their respective PCIe link layer and transaction layer, thereby realizing the expansion function of the PCIe channel.
[0227] The internal bus interface unit completes the address mapping between the PCIe addressing space and the NVMe storage space, realizing multi-channel access between multiple extended PCIe devices (vDevice) and NVMe storage devices.
[0228] The PCIe upstream port and PCIe downstream port have the electrical and logical functions of the PCIe physical layer, can transmit and supply power to transceivers, clocks, resets, and other signals, complete serial-to-parallel conversion, link training and other functions, and can be in the form of connectors, gold fingers, cables, etc.
[0229] vBridge and vDevice can implement protocol parsing and data forwarding at the PCIe data link layer and transaction layer, without implementing non-core links such as the physical layer, consistency testing, and power management, saving hardware and logic resources and reducing overall link latency.
[0230] The number of vBridges and vDevice can be flexibly adjusted through the system management unit in this application.
[0231] The internal bus interface unit consists of three units: bus president, NVMe driver, and system management.
[0232] The bus arbitration unit implements a priority-based bus arbitration mechanism when multiple vDevices communicate with an NVMe storage device.
[0233] The NVMe driver unit implements address translation and access control between the internal bus space and the NVMe storage space.
[0234] The system management unit implements management functions such as channel expansion capability configuration, operation information reporting, and exception handling.
[0235] In this embodiment, a storage expansion device is further provided. FIG8 is a structural diagram of an optional storage expansion device according to an embodiment of the present application. As shown in FIG8 , the storage expansion device includes:
[0236] A server port, a processing controller and a storage device port, wherein the server port is connected to the processing controller, the processing controller is connected to the storage device port, and one or more storage channels are established in the processing controller.
[0237] A server port is configured to connect to a server, wherein one or more virtual machines are deployed on the server, the one or more storage channels are allowed to be recognized by the server as one or more second storage devices, and the one or more second storage devices are allocated on the server to the virtual machines deployed on the server;
[0238] a storage device port configured to connect to a first storage device, wherein the storage channel is allocated corresponding storage space on the first storage device;
[0239] The processing controller is configured to implement the steps of the aforementioned storage device access method.
[0240] Through the above, a storage expansion device is deployed between a server and a first storage device deployed on the server. The storage expansion device establishes one or more storage channels, which are allowed to be identified by the server as one or more second storage devices and allocated to the virtual machines deployed on the server for use, so that the virtual machine side can believe that each virtual machine is connected to a second storage device. Furthermore, after the storage expansion device receives a data access request sent by the reference virtual machine on the server, it converts the data access to the reference storage device into data access to the storage space corresponding to the reference storage channel in the first storage device through the one or more storage channels identified as the reference storage device. This achieves that only one storage device is needed to provide services for multiple virtual machines on the server, and achieves the expansion of the service-connected storage device without changing the server's storage device usage logic and without adding new storage devices. For the server, each virtual machine is still provided with an independent storage device, making the storage device expansion performance higher, more versatile, and more flexible and reliable. This can solve the problem of low storage device expansion efficiency when expanding the storage device connected to the server in the related art, and achieve the effect of improving the storage device expansion efficiency when expanding the storage device connected to the server.
[0241] As an optional embodiment, a first virtual bridge device is deployed in the processing controller, the first virtual bridge device is connected to one or more storage channels, the first virtual bridge device is also configured to connect to a server port and is recognized by the server as being connected to a second storage device, and the first virtual bridge device records the second storage device and the storage channel having a corresponding relationship, wherein:
[0242] The first virtual bridging device is configured to search for a reference storage channel corresponding to a reference storage device from second storage devices and storage channels with corresponding relationships when receiving a first data access, wherein the reference storage device is a storage device in one or more second storage devices that is assigned to a reference virtual machine that initiates a data access request, and the reference storage channel is a storage channel in one or more storage channels that is identified as a reference storage device; and forward the first data access to the reference storage channel.
[0243] As an optional embodiment, the storage channel includes a second virtual bridge device and a virtual storage device, the second virtual bridge device is connected to the first virtual bridge device, the second virtual bridge device is connected to the virtual storage device, and the virtual storage device is connected to the first storage device, wherein,
[0244] The second virtual bridge device is configured to forward the first data access to the virtual storage device connected to the second virtual bridge device when receiving the first data access;
[0245] The virtual storage device is configured to convert a first data access into a second data access for accessing a storage space corresponding to a reference storage channel in the first storage device.
[0246] Optionally, in an embodiment of the present application, data storage resources are deployed in the processing controller for temporarily storing data that the virtual storage device needs to access in the first storage device. For one or more storage channels established in the storage expansion device, the processing controller needs to allocate data storage resources based on the number of storage channels created. When allocating, the resources can be allocated according to the resource requirements of each storage channel, or the data storage resources can be evenly divided according to the number of storage channels created. This solution does not limit this.
[0247] As an optional embodiment, an external storage device is further deployed in the storage expansion device, and the external storage device is connected to the virtual storage device, wherein:
[0248] The external storage device is configured to cache data to be accessed by the virtual storage device in the first storage device.
[0249] Optionally, in an embodiment of the present application, the external storage device is configured to provide data storage services for the storage channel when the data storage resources of the processing controller are insufficient. An external storage device can be configured for each storage channel, or multiple storage channels can be connected to a common external storage device, and the external storage device can be used to provide data storage services for all storage channels.
[0250] As an optional embodiment, a target processor is further deployed in the processing controller, and the target processor is connected to one or more storage channels via an internal high-speed bus. The target processor is also connected to a storage device port, wherein:
[0251] The target processor is configured to respond to a data access request transmitted by the storage channel and perform storage control and data access on the first storage device.
[0252] Optionally, in an embodiment of the present application, the storage expansion device may be, but is not limited to, configured with a storage device connected to the target processor, such as DDR (Double Data Rate Synchronous Dynamic Random Access Memory) memory, running the Linux operating system with the support of DDR, and implementing management and access to the NVMe storage device under the driver of standard NVMe.
[0253] The processing controller of the present application can, but is not limited to, realize the virtualization of NVMe storage devices through an FPGA accelerator in the form of a PCIe Add-in (Add-in Card) card. It includes two PCIe ports. In this embodiment, one is configured as a PCIe EndPoint interface (server port) and connected to the server CPU with a gold finger; the other PCIe port is configured as a PCIe RC interface (storage device port) and connected to the downstream NVMe storage device through an MCIO connector. The PCIe channel expansion logic in this application is implemented in the IP of the FPGA (processing controller), and the management and access of the NVMe storage device are realized through the NVMe driver IP (Internet Protocol). Figure 9 is a block diagram of the structure of an optional storage expansion device according to an embodiment of the present application. As shown in Figure 9, the PCIe upstream port (server port) is in the form of a PCIe gold finger, which is configured to be inserted into the PCIe slot of the server and the PCIe RC interface of the connector CPU. The PCIe downstream port (storage device port) is a high-speed connector in the form of an MCIO (Mini Cool Edge O, a standard definition of a high-speed connector) and can be connected to an NVMe SSD via a cable. Based on the FPGA's resource availability, a total of 16 vBridges (secondary virtual bridge devices) and corresponding vDevices are configured within the channel expansion logic. These devices share an 8TB NVMe storage device (primary storage device) connected to a downstream port, with each vDevice allocated an average of 512GB of capacity. With the support of the virtual machine manager (VMM), these 16 vDevices are assigned to 16 different virtual machines, storing frequently changing user data with relatively low security requirements. The FPGA includes not only the logic unit (PL) but also a processor unit (PS) based on a quad-core ARM (Advanced RISC Machine) A53 processor. The PS runs the Linux operating system with external DDR support and manages and accesses the NVMe storage device using standard NVMe drivers. The PL also has 8GB of external DDR, which can be used as a vDevice data cache when the FPGA's internal SRAM resources are insufficient. The system management function is implemented through the SMBUS (System Management Bus).Through the SMBUS bus, storage virtualization devices can receive out-of-band instructions from the server to implement system performance settings such as the number of virtual machines, vDevice priority settings, data cache adjustment, virtual capacity allocation, etc. They can also read device information such as power consumption and temperature of the entire device, as well as perform system reset and power on and off operations.
[0254] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a non-volatile readable storage medium (such as ROM (Read-Only Memory, Read-Only Memory) / RAM (Random Access Memory, Random Access Memory), a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods of each embodiment of the present application.
[0255] This embodiment also provides a storage device access device, which is configured to implement the above-mentioned embodiments and preferred implementations. Details already described will not be repeated. As used below, the term "module" may refer to a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation using hardware, or a combination of software and hardware, is also possible and contemplated.
[0256] FIG10 is a structural block diagram of an access device for a storage device according to an embodiment of the present application. As shown in FIG10 ,
[0257] The device is applied to a storage expansion device, which is connected between a first storage device and a server. One or more virtual machines are deployed on the server. One or more storage channels are established in the storage expansion device, which are allowed to be recognized by the server as second storage devices. The second storage device is allocated to the virtual machine deployed on the server, and the storage channel is allocated corresponding storage space on the first storage device. The device includes:
[0258] a receiving module 1002 configured to receive a data access request sent by a reference virtual machine, wherein the one or more virtual machines include the reference virtual machine, and the data access request is used to request a first data access to a reference storage device in the second storage device that is allocated to the reference virtual machine;
[0259] a conversion module 1004 configured to convert, in response to a data access request, a first data access into a second data access via a reference storage channel, wherein the reference storage channel is a storage channel identified as a reference storage device among storage channels established in the storage expansion device, and the second data access is a data access to a reference storage space in the first storage device corresponding to the reference storage channel;
[0260] The control module 1006 is configured to control the reference storage space of the first storage device to perform the second data access.
[0261] Through the above, a storage expansion device is deployed between a server and a first storage device deployed on the server. The storage expansion device establishes one or more storage channels, which are allowed to be identified by the server as one or more second storage devices and allocated to the virtual machines deployed on the server for use, so that the virtual machine side can believe that each virtual machine is connected to a second storage device. Furthermore, after the storage expansion device receives a data access request sent by the reference virtual machine on the server, it converts the data access to the reference storage device into data access to the storage space corresponding to the reference storage channel in the first storage device through the one or more storage channels identified as the reference storage device. This achieves that only one storage device is needed to provide services for multiple virtual machines on the server, and achieves the expansion of the service-connected storage device without changing the server's storage device usage logic and without adding new storage devices. For the server, each virtual machine is still provided with an independent storage device, making the storage device expansion performance higher, more versatile, and more flexible and reliable. This can solve the problem of low storage device expansion efficiency when expanding the storage device connected to the server in the related art, and achieve the effect of improving the storage device expansion efficiency when expanding the storage device connected to the server.
[0262] Optional, conversion module, including:
[0263] a first determining unit configured to determine a reference storage channel identified as a reference storage device from storage channels established in the storage expansion device;
[0264] a forwarding unit configured to forward the first data access to a reference storage channel;
[0265] The first conversion unit is configured to convert the first data access into the second data access by referring to the storage channel.
[0266] Optionally, a first virtual bridge device is further deployed in the storage expansion device, and the first virtual bridge device is connected to the storage channel established in the storage expansion device. The first virtual bridge device is also configured to connect to the server and is recognized by the server as being connected to a second storage device established in the storage expansion device. The first virtual bridge device records the second storage device and the storage channel having a corresponding relationship, wherein:
[0267] The first determining unit is configured to: search, through the first virtual bridge device, for a reference storage channel corresponding to the reference storage device from the second storage devices and storage channels having a corresponding relationship;
[0268] Forwarding the first data access to the reference storage channel includes: forwarding the first data access to the reference storage channel through a first virtual bridge device.
[0269] Optionally, the first determining unit is configured to:
[0270] extracting a reference device identifier of a reference storage device from a data access request by the first virtual bridge device;
[0271] The reference storage channel corresponding to the reference device identifier is searched for from the storage device identifiers and storage channels having a corresponding relationship through the first virtual bridge device, wherein the storage device identifier is a device identifier assigned to the corresponding storage channel and allowed to be identified as a storage device.
[0272] Optionally, the device further comprises:
[0273] A first creation module is configured to create an initial virtual bridge device in the storage expansion device;
[0274] a first configuration module configured to configure a first attribute of a transmission protocol for an initial virtual bridge device in a protocol configuration space of the initial virtual bridge device to obtain a first virtual bridge device, wherein the server and the storage expansion device are connected via a protocol bus that complies with the transmission protocol, and the first attribute is a protocol attribute that allows the server to identify the bridge device as complying with the transmission protocol;
[0275] The processing module is configured to establish a connection between the first virtual bridge device and the storage channel established in the storage expansion apparatus, and record the second storage device and the storage channel having a corresponding relationship.
[0276] Optionally, the storage channel includes a second virtual bridge device and a virtual storage device, the first virtual bridge device is connected to the second virtual bridge device, the second virtual bridge device is connected to the virtual storage device, and the virtual storage device is configured to connect to the first storage device, wherein,
[0277] Conversion modules, including:
[0278] a first receiving unit configured to receive a first data access via a second virtual bridge device in a reference storage channel;
[0279] a transmission unit configured to transmit the first data access to the virtual storage device in the reference storage channel via the second virtual bridge device in the reference storage channel;
[0280] The second conversion unit is configured to convert the first data access into the second data access by referring to the virtual storage device in the storage channel.
[0281] Optionally, the second conversion unit is configured to:
[0282] Obtaining a first access address indicated by the first data access by referring to a virtual storage device in the storage channel, wherein the first access address is a virtual address of the reference storage device indicated by the reference virtual machine for access;
[0283] querying a first storage address corresponding to the first access address from a virtual address range and a storage address range having a corresponding relationship by referring to a virtual storage device in the storage channel, wherein the virtual address range is an address range of the reference storage device identified by the server, and the storage address range is an address range of storage space allocated on the first storage device to the virtual storage device in the reference storage channel;
[0284] The first access address in the first data access is replaced with the first storage address to obtain a second data access.
[0285] Optionally, the second conversion unit is configured to:
[0286] The first storage address mapped by the first access address is queried from the address mapping between the addressing space of the transmission protocol of the reference storage device and the storage space of the storage protocol of the first storage device by referring to the virtual storage device in the storage channel, wherein the reference storage device is identified by the server as a device that complies with the transmission protocol, the virtual address range includes the addressing space of the transmission protocol, the first storage device is a storage device of the storage protocol, and the storage address range includes the storage space of the storage protocol.
[0287] Optionally, the device further comprises:
[0288] A second creation module is configured to create multiple groups of initial virtual bridge devices and initial virtual storage devices in the storage expansion device;
[0289] a second configuration module configured to configure a second attribute of a transmission protocol for the initial virtual bridge device in a protocol configuration space of the initial virtual bridge device to obtain a second virtual bridge device, wherein the server and the storage expansion device are connected via a protocol bus that complies with the transmission protocol, and the second attribute is a protocol attribute that allows the server to identify the bridge device as complying with the transmission protocol;
[0290] The third configuration module is configured to configure the third attribute of the transmission protocol of the initial virtual storage device in the transmission protocol configuration space of the initial virtual storage device, and to configure the fourth attribute of the storage protocol of the initial virtual storage device in the storage protocol configuration space of the initial virtual storage device, to obtain a virtual storage device, wherein the first storage device is a storage device that complies with the storage protocol, the third attribute is a protocol attribute that allows it to be identified by the server as a terminal device that complies with the transmission protocol, and the fourth attribute is a protocol attribute that allows it to be identified by the server as a storage device that complies with the storage protocol.
[0291] Optionally, a protocol parsing unit is deployed in the virtual storage device, and the third configuration module includes:
[0292] The configuration unit is configured to configure the data link layer attributes and transaction layer attributes of the transmission protocol of the initial virtual storage device in the transmission protocol configuration space of the initial virtual storage device, wherein the third attribute configuration includes: data link layer attributes and transaction layer attributes, and the protocol parsing unit is used to use the data link layer attributes to perform data link layer protocol parsing on the received data access, and / or, use the transaction layer attributes to perform transaction layer protocol parsing on the received data access.
[0293] Optionally, the configuration unit is set to:
[0294] The storage capacity attribute and queue quantity attribute of the storage protocol are configured for the initial virtual storage device in the storage protocol configuration space of the initial virtual storage device, wherein the fourth attribute configuration includes: storage capacity attribute and queue quantity attribute, and the storage capacity attribute and queue quantity attribute are used to be identified by the server as a storage device that complies with the storage protocol.
[0295] Optionally, the storage expansion device further comprises a target bus and a bus interface, wherein the bus interface is configured to connect a plurality of storage channels connected to the target bus to the first storage device, and the bus interface has a mapping relationship between a bus address space of the target bus and a storage address space of the first storage device, wherein:
[0296] Execution module, including:
[0297] a second receiving unit configured to receive a second data access via the target bus;
[0298] The forwarding unit is configured to forward the second data access to the reference storage space according to the mapping relationship through the bus interface.
[0299] Optionally, the bus interface includes: a bus arbitration unit and a storage device driver unit, wherein the storage device driver unit has a mapping relationship between the bus address space of the target bus and the storage address space of the first storage device, wherein:
[0300] The forwarding unit is set to:
[0301] determining, by a bus arbitration unit, whether to process a bus access of the reference storage channel according to a priority of the reference storage channel;
[0302] In the case of determining to process the bus access of the reference storage channel, the second data access is forwarded to the reference storage space according to the mapping relationship by the storage device driver unit.
[0303] Optionally, the device further comprises:
[0304] a receiving module configured to receive access result information returned by the reference storage space in response to the second data access after controlling the reference storage space of the first storage device to perform the second data access;
[0305] a forwarding module, configured to forward access result information to a reference storage channel;
[0306] The sending module is configured to send the access result information to the server through the reference storage channel.
[0307] Optional forwarding module, including:
[0308] an extraction unit configured to extract a source address from the access result information to obtain a reference storage space;
[0309] a second determining unit configured to determine a reference storage channel corresponding to the reference storage space from the storage channels established in the storage expansion device;
[0310] The sending unit is configured to send access result information to the reference storage channel.
[0311] Optionally, the sending unit is set to:
[0312] Replacing the source address in the access result information from the reference storage space to the reference storage device to obtain reference access result information;
[0313] Send reference access result information to the server.
[0314] Optionally, the device further includes one of the following:
[0315] A first determining module is configured to determine the number of storage channels established in the storage expansion device based on resource information on the storage expansion device;
[0316] a second determining module configured to determine the number of storage channels established in the storage expansion device based on resource information on the storage expansion device and device information of the first storage device;
[0317] The third determining module is configured to determine the channel quantity of the storage channels established in the storage expansion device according to the resource information on the storage expansion device, the device information of the first storage device, and the virtual machine information of the virtual machine deployed on the server.
[0318] Optionally, the first determining module includes:
[0319] a detection unit configured to detect a connection with the first storage device;
[0320] a loading unit configured to load a storage device driver when detecting that the device is connected to the first storage device;
[0321] An acquiring unit, configured to acquire device information from a first storage device via a storage device driver;
[0322] The determining unit is configured to determine the channel quantity of the storage channels established in the storage expansion device according to the resource information on the storage expansion device and the device information of the first storage device.
[0323] It should be noted that the above modules can be implemented through software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0324] An embodiment of the present application further provides a computer non-volatile readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0325] In an exemplary embodiment, the above-mentioned computer non-volatile readable storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.
[0326] An embodiment of the present application further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0327] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0328] The examples in this embodiment can refer to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail here.
[0329] Obviously, those skilled in the art should understand that the modules or steps of the present application described above can be implemented using a general-purpose computing device, they can be concentrated on a single computing device, or distributed across a network composed of multiple computing devices, they can be implemented using program code executable by the computing device, and thus, they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be performed in a different order than herein, or they can be fabricated into separate integrated circuit modules, or multiple modules or steps can be fabricated into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
[0330] The above are merely optional embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may be subject to various modifications and variations. Any modifications, equivalent replacements, improvements, etc. made within the principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A method for accessing a storage device, characterized in that: The method is applied to a storage expansion device, the storage expansion device being connected between a first storage device and a server, one or more virtual machines being deployed on the server, one or more storage channels being established in the storage expansion device that are allowed to be recognized by the server as second storage devices, the second storage devices being allocated to the virtual machines deployed on the server, and corresponding storage space being allocated to the storage channels on the first storage device, the method comprising: receiving a data access request sent by a reference virtual machine, wherein the one or more virtual machines include the reference virtual machine, and the data access request is used to request a first data access to a reference storage device in the second storage device that is allocated to the reference virtual machine; In response to the data access request, convert the first data access into a second data access through a reference storage channel, wherein the reference storage channel is a storage channel identified as the reference storage device among the storage channels established in the storage expansion device, and the second data access is a data access to a reference storage space corresponding to the reference storage channel in the first storage device; The reference storage space of the first storage device is controlled to perform the second data access.
2. The method according to claim 1, characterized in that The converting the first data access into a second data access by referring to the storage channel includes: determining a reference storage channel identified as the reference storage device from the storage channels established in the storage expansion device; forwarding the first data access to the reference storage channel; The first data access is converted into the second data access through the reference memory channel.
3. The method according to claim 2, characterized in that A first virtual bridge device is further deployed in the storage expansion device. The first virtual bridge device is connected to the storage channel established in the storage expansion device. The first virtual bridge device is also configured to connect to the server and is recognized by the server as being connected to the second storage device. The first virtual bridge device records the second storage device and the storage channel having a corresponding relationship. Determining the reference storage channel identified as the reference storage device from the storage channels established in the storage expansion device includes: searching, through the first virtual bridge device, for the reference storage channel corresponding to the reference storage device from the second storage device and the storage channels having a corresponding relationship; The forwarding the first data access to the reference storage channel includes: forwarding the first data access to the reference storage channel through the first virtual bridge device.
4. The method according to claim 3, characterized in that The searching, by the first virtual bridge device, for the reference storage channel corresponding to the reference storage device from the second storage device and the storage channel having a corresponding relationship includes: extracting, by the first virtual bridge device, a reference device identifier of the reference storage device from the data access request; The reference storage channel corresponding to the reference device identifier is searched for from storage device identifiers and storage channels having a corresponding relationship through the first virtual bridge device, wherein the storage device identifier is a device identifier assigned to a corresponding storage channel and allowed to be identified as a storage device.
5. The method according to claim 3, characterized in that The method further comprises: Creating an initial virtual bridge device in the storage expansion device; configuring a first attribute of a transmission protocol for the initial virtual bridge device in a protocol configuration space of the initial virtual bridge device to obtain the first virtual bridge device, wherein the server and the storage expansion device are connected via a protocol bus that complies with the transmission protocol, and the first attribute is a protocol attribute that allows the server to identify the bridge device as complies with the transmission protocol; A connection is established between the first virtual bridge device and the storage channel established in the storage expansion apparatus, and a corresponding second storage device and storage channel are recorded.
6. The method according to claim 1, characterized in that The storage channel includes a second virtual bridge device and a virtual storage device, the first virtual bridge device is connected to the second virtual bridge device, the second virtual bridge device is connected to the virtual storage device, and the virtual storage device is configured to connect to the first storage device, wherein: The converting the first data access into the second data access through the reference storage channel includes: receiving the first data access via the second virtual bridge device in the reference storage channel; transmitting the first data access to the virtual storage device in the reference storage channel through the second virtual bridge device in the reference storage channel; The first data access is converted into the second data access through the virtual storage device in the reference storage channel.
7. The method according to claim 6, characterized in that The converting the first data access into the second data access by the virtual storage device in the reference storage channel includes: Obtaining, through the virtual storage device in the reference storage channel, a first access address indicated by the first data access, wherein the first access address is a virtual address of the reference storage device indicated by the reference virtual machine to access; querying, through the virtual storage device in the reference storage channel, a first storage address corresponding to the first access address from a virtual address range and a storage address range that have a corresponding relationship, wherein the virtual address range is an address range of the reference storage device identified by the server, and the storage address range is an address range of storage space allocated to the virtual storage device in the reference storage channel on the first storage device; The first access address in the first data access is replaced with the first storage address to obtain the second data access.
8. The method according to claim 7, characterized in that The querying, through the virtual storage device in the reference storage channel, of a first storage address corresponding to the first access address from a virtual address range and a storage address range having a corresponding relationship includes: The first storage address mapped by the first access address is queried from the address mapping between the addressing space of the transmission protocol of the reference storage device and the storage space of the storage protocol of the first storage device through the virtual storage device in the reference storage channel, wherein the reference storage device is identified by the server as a device that complies with the transmission protocol, the virtual address range includes the addressing space of the transmission protocol, the first storage device is a storage device of the storage protocol, and the storage address range includes the storage space of the storage protocol.
9. The method according to claim 6, characterized in that The method further comprises: Creating multiple groups of initial virtual bridging devices and initial virtual storage devices in the storage expansion device; configuring a second attribute of a transmission protocol for the initial virtual bridge device in a protocol configuration space of the initial virtual bridge device to obtain the second virtual bridge device, wherein the server and the storage expansion device are connected via a protocol bus that complies with the transmission protocol, and the second attribute is a protocol attribute that allows the server to identify the bridge device as complies with the transmission protocol; The third attribute of the transmission protocol of the initial virtual storage device is configured in the transmission protocol configuration space of the initial virtual storage device, and the fourth attribute of the storage protocol of the initial virtual storage device is configured in the storage protocol configuration space of the initial virtual storage device to obtain the virtual storage device, wherein the first storage device is a storage device that complies with the storage protocol, the third attribute is a protocol attribute that allows it to be identified by the server as a terminal device that complies with the transmission protocol, and the fourth attribute is a protocol attribute that allows it to be identified by the server as a storage device that complies with the storage protocol.
10. The method according to claim 9, characterized in that A protocol parsing unit is deployed in the virtual storage device, and configuring the third attribute of the transmission protocol of the initial virtual storage device in the transmission protocol configuration space of the initial virtual storage device includes: The data link layer attributes and transaction layer attributes of the transmission protocol are configured for the initial virtual storage device in the transmission protocol configuration space of the initial virtual storage device, wherein the third attribute configuration includes: the data link layer attributes and the transaction layer attributes, and the protocol parsing unit is used to use the data link layer attributes to perform data link layer protocol parsing on the received data access, and / or use the transaction layer attributes to perform transaction layer protocol parsing on the received data access.
11. The method according to claim 10, characterized in that Configuring the fourth attribute of the storage protocol of the initial virtual storage device in the storage protocol configuration space of the initial virtual storage device includes: The storage capacity attribute and queue quantity attribute of the storage protocol are configured for the initial virtual storage device in the storage protocol configuration space of the initial virtual storage device, wherein the fourth attribute configuration includes: the storage capacity attribute and the queue quantity attribute, and the storage capacity attribute and the queue quantity attribute are used to be identified by the server as a storage device that complies with the storage protocol.
12. The method according to claim 1, characterized in that The storage expansion device further comprises a target bus and a bus interface, wherein the bus interface is configured to connect the plurality of storage channels connected to the target bus to the first storage device, and the bus interface has a mapping relationship between the bus address space of the target bus and the storage address space of the first storage device, wherein: The controlling the reference storage space of the first storage device to perform the second data access comprises: receiving the second data access via the target bus; The second data access is forwarded to the reference storage space through the bus interface according to the mapping relationship.
13. The method according to claim 12, characterized in that The bus interface includes: a bus arbitration unit and a storage device driver unit, wherein the storage device driver unit has a mapping relationship between the bus address space of the target bus and the storage address space of the first storage device, wherein: The forwarding the second data access to the reference storage space according to the mapping relationship through the bus interface includes: determining, by the bus arbitration unit according to the priority of the reference storage channel, whether to process the bus access of the reference storage channel; In a case where it is determined to process the bus access of the reference storage channel, the second data access is forwarded to the reference storage space according to the mapping relationship by the storage device driver unit.
14. A storage expansion device, characterized in that: include: A server port, a processing controller and a storage device port, wherein the server port is connected to the processing controller, the processing controller is connected to the storage device port, and one or more storage channels are established in the processing controller. The server port is configured to connect to a server, wherein one or more virtual machines are deployed on the server, the one or more storage channels are allowed to be identified by the server as one or more second storage devices, and the one or more second storage devices are allocated on the server to the virtual machines deployed on the server; The storage device port is configured to connect to a first storage device, wherein the storage channel is allocated corresponding storage space on the first storage device; The method according to any one of claims 1 to 13 is implemented on the process controller.
15. The storage expansion device according to claim 14, wherein: A first virtual bridge device is deployed in the processing controller, the first virtual bridge device is connected to the one or more storage channels, the first virtual bridge device is further configured to connect to the server port and is recognized by the server as being connected to the second storage device, and the first virtual bridge device records the second storage device and the storage channel having a corresponding relationship, wherein: The first virtual bridging device is configured to, upon receiving a first data access, search for a reference storage channel corresponding to a reference storage device from the corresponding second storage devices and storage channels, wherein the reference storage device is a storage device among the one or more second storage devices that is assigned to a reference virtual machine that initiates a data access request, and the reference storage channel is a storage channel among the one or more storage channels that is identified as the reference storage device; and forward the first data access to the reference storage channel.
16. The storage expansion device according to claim 15, wherein: The storage channel includes a second virtual bridge device and a virtual storage device, the second virtual bridge device is connected to the first virtual bridge device, the second virtual bridge device is connected to the virtual storage device, and the virtual storage device is connected to the first storage device, wherein, The second virtual bridge device is configured to forward the first data access to the virtual storage device connected to the second virtual bridge device when receiving the first data access; The virtual storage device is configured to convert the first data access into a second data access for accessing a storage space corresponding to the reference storage channel in the first storage device.
17. The storage expansion device according to claim 16, wherein: The storage expansion device further includes an external storage device connected to the virtual storage device. The external storage device is configured to cache data that the virtual storage device is to access in the first storage device.
18. The storage expansion device according to claim 15, wherein: The processing controller further includes a target processor, which is connected to the one or more storage channels via an internal high-speed bus, and is also connected to the storage device port, wherein: The target processor is configured to respond to a data access request transmitted by the storage channel and perform storage control and data access on the first storage device.
19. A storage device access device, characterized in that: Applied to a storage expansion device, the storage expansion device is connected between a first storage device and a server, one or more virtual machines are deployed on the server, one or more storage channels are established in the storage expansion device that are allowed to be recognized by the server as second storage devices, the second storage devices are allocated to the virtual machines deployed on the server, and the storage channels are allocated corresponding storage space on the first storage device, the device comprising: a receiving module configured to receive a data access request sent by a reference virtual machine, wherein the one or more virtual machines include the reference virtual machine, and the data access request is configured to request a first data access to a reference storage device in the second storage device that is allocated to the reference virtual machine; a conversion module configured to, in response to the data access request, convert the first data access into a second data access via a reference storage channel, wherein the reference storage channel is a storage channel identified as the reference storage device among the storage channels established in the storage expansion device, and the second data access is a data access to a reference storage space in the first storage device corresponding to the reference storage channel; The control module is configured to control the reference storage space of the first storage device to perform the second data access.
20. A computer-readable non-volatile storage medium, characterized in that: The computer non-volatile readable storage medium stores a computer program, wherein the computer program implements the steps of the method described in any one of claims 1 to 13 when executed by a processor.
21. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 13 are implemented.
22. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 13 are implemented.
Citation Information
Patent Citations
Storage device virtualization processing method, bridging device, system and medium
CN116774933A
Storage equipment control method and device, electronic equipment and storage medium
CN117608757A
Access method and device of storage equipment, storage medium and electronic equipment
CN117971135A
Defining virtualized page attributes based on guest page attributes
US20180074969A1
Cited By
PCIE bridge unloading timing transceiver mechanism design circuit
CN121116891A