[go: up one dir, main page]

CN117971135A - Storage device access method and device, storage medium and electronic device - Google Patents

Storage device access method and device, storage medium and electronic device Download PDF

Info

Publication number
CN117971135A
CN117971135A CN202410376341.2A CN202410376341A CN117971135A CN 117971135 A CN117971135 A CN 117971135A CN 202410376341 A CN202410376341 A CN 202410376341A CN 117971135 A CN117971135 A CN 117971135A
Authority
CN
China
Prior art keywords
storage
virtual
storage device
data access
channel
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202410376341.2A
Other languages
Chinese (zh)
Other versions
CN117971135B (en
Inventor
刘铁军
李仁刚
公维锋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Metabrain Intelligent Technology Co Ltd
Original Assignee
Suzhou Metabrain Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Metabrain Intelligent Technology Co Ltd filed Critical Suzhou Metabrain Intelligent Technology Co Ltd
Priority to CN202410376341.2A priority Critical patent/CN117971135B/en
Publication of CN117971135A publication Critical patent/CN117971135A/en
Application granted granted Critical
Publication of CN117971135B publication Critical patent/CN117971135B/en
Priority to PCT/CN2024/136881 priority patent/WO2025200554A1/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of storage systems
    • G06F3/0635Configuration or reconfiguration of storage systems by changing the path, e.g. traffic rerouting, path reconfiguration
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0662Virtualisation aspects
    • G06F3/0664Virtualisation aspects at device level, e.g. emulation of a storage device or system
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/067Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

The embodiment of the application provides a storage device access method, a storage device access device, a storage medium and an electronic device, wherein the method is applied to a storage expansion device, and the storage expansion device is connected between a first storage device and a server and comprises the following steps: receiving a data access request sent by a reference virtual machine; converting the first data access to a second data access by referring to the storage channel in response to the data access request; and controlling the reference storage space of the first storage device to execute the second data access. According to the application, the problem of low storage device expansion efficiency when the storage device connected with the server is expanded in the related technology is solved, and the effect of improving the storage device expansion efficiency when the storage device connected with the server is expanded is achieved.

Description

存储设备的访问方法、装置、存储介质和电子设备Storage device access method, device, storage medium and electronic device

技术领域Technical Field

本申请实施例涉及计算机领域,具体而言,涉及一种存储设备的访问方法、装置、存储介质和电子设备。The embodiments of the present application relate to the computer field, and in particular, to a storage device access method, apparatus, storage medium and electronic device.

背景技术Background technique

在数据中心云服务场景中,一些虚拟机或容器中实时性较强及IO访问密度高的应用,对存储设备的带宽延时等性能要求较高,远端部署的集中式存储系统性能无法满足需求,需要服务器本地的存储设备提供支持。由于服务器CPU能够提供的PCIe端口数量有限制,所以支持的存储设备数量也收到限制,因此如何利用有限的本地存储设备资源来支持数量众多的虚拟机本地访问需求,是当前云场景下存储性能提升所面临的问题之一。为了解决上述问题,相关技术中采用PCIe Switch扩展方案,在该方案中采用专用Switch芯片,将一个CPU的PCIe端口扩展出多个下游端口来增加服务器所搭载存储设备的数量,每个下游端口连接一个存储设备。该方案的优点是在硬件上增加了服务器的本地存储能力,无需额外的软件配合,延时低,通用性强。但该方案扩展灵活性不足,需要在服务器主板设计之初就选定PCIe Switch型号,扩展能力随之固定。如果后续需要扩展更多通道,就只能更换端口数量更多的PCIe Switch芯片,需重新设计主板硬件;而如果需求变少,额外的PCIe通道也只能闲置,造成浪费。另外,扩展是通过在每个PCIe Switch的下游端口接一个存储设备实现,整体成本较高。In the cloud service scenario of data centers, some applications with strong real-time performance and high IO access density in virtual machines or containers have high requirements for the bandwidth latency and other performance of storage devices. The performance of the centralized storage system deployed remotely cannot meet the requirements, and the local storage device of the server is required to provide support. Since the number of PCIe ports that the server CPU can provide 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 requirements of a large number of virtual machines is one of the problems faced by the current cloud scenario in improving storage performance. In order to solve the above problems, the PCIe Switch expansion solution is adopted in the relevant technology. In this solution, a dedicated Switch chip 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 the local storage capacity of the server is increased in hardware, no additional software cooperation is required, the latency is low, and the versatility is strong. However, the expansion flexibility of this solution is insufficient, and the PCIe Switch model needs to be selected at the beginning of the server motherboard design, and the expansion capacity is fixed accordingly. If more channels are needed in the future, the only option is to replace the PCIe Switch chip with more ports, which requires redesigning the motherboard hardware. If the demand decreases, the additional PCIe channels will be idle, resulting in waste. In addition, expansion is achieved by connecting a storage device to the downstream port of each PCIe Switch, which has a high overall cost.

发明内容Summary of the invention

本申请实施例提供了一种存储设备的访问方法、装置、存储介质和电子设备,以至少解决相关技术中对服务器连接的存储设备进行扩展时存储设备扩展效率较低的问题。The embodiments of the present application provide a storage device access method, apparatus, storage medium and electronic 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.

根据本申请的一个实施例,提供了一种存储设备的访问方法,应用于存储扩展装置,所述存储扩展装置连接在第一存储设备与服务器之间,所述服务器上部署了一个或者多个虚拟机,所述存储扩展装置中建立了一个或者多个允许被所述服务器识别为第二存储设备的存储通道,所述第二存储设备被分配给所述服务器上部署的虚拟机,所述存储通道在所述第一存储设备上被分配了对应的存储空间,所述方法包括:接收参考虚拟机发送的数据访问请求,其中,所述一个或者多个虚拟机包括所述参考虚拟机,所述数据访问请求用于请求对所述第二存储设备中被分配给所述参考虚拟机的参考存储设备进行第一数据访问;响应所述数据访问请求,通过参考存储通道将所述第一数据访问转换为第二数据访问,其中,所述参考存储通道是所述存储扩展装置中建立的存储通道中被识别为所述参考存储设备的存储通道,所述第二数据访问是对所述第一存储设备中与所述参考存储通道对应的参考存储空间的数据访问;控制所述第一存储设备的所述参考存储空间执行所述第二数据访问。According to an 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 a corresponding storage space 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 assigned to the reference virtual machine; in response to the data access request, converting 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 in 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.

所述通过参考存储通道将第一数据访问转换为第二数据访问,包括:The converting the first data access into the second data access by referring to the storage channel comprises:

从所述存储扩展装置中建立的存储通道中确定被识别为所述参考存储设备的参考存储通道;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.

可选的,所述存储扩展装置中还部署了第一虚拟桥接设备,所述第一虚拟桥接设备与所述存储扩展装置中建立的存储通道连接,所述第一虚拟桥接设备还用于连接所述服务器并被所述服务器识别为连接了所述第二存储设备,所述第一虚拟桥接设备上记录了具有对应关系的第二存储设备和存储通道,其中,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 also used to connect to the server 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 step of determining the reference storage channel identified as the reference storage device from the storage channels established in the storage expansion device comprises: searching, through the first virtual bridge device, for the reference storage channel corresponding to the reference storage device from the second storage devices and 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.

可选的,所述通过所述第一虚拟桥接设备从具有对应关系的第二存储设备和存储通道中查找所述参考存储设备所对应的所述参考存储通道,包括:Optionally, searching, by the first virtual bridge device, for the reference storage channel corresponding to the reference storage device from second storage devices and storage channels having a corresponding relationship, includes:

通过所述第一虚拟桥接设备从所述数据访问请求中提取所述参考存储设备的参考设备标识;extracting a reference device identifier of the reference storage device from the data access request through the first virtual bridge device;

通过所述第一虚拟桥接设备从具有对应关系的存储设备标识和存储通道中查找所述参考设备标识所对应的所述参考存储通道,其中,所述存储设备标识是被分配给对应的存储通道的允许被识别为存储设备的设备标识。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.

可选的,所述方法还包括:Optionally, the method further includes:

在所述存储扩展装置中创建初始的虚拟桥接设备;Creating an initial virtual bridge device in the storage expansion device;

在所述初始的虚拟桥接设备的协议配置空间对所述初始的虚拟桥接设备进行传输协议的第一属性配置,得到所述第一虚拟桥接设备,其中,所述服务器与所述存储扩展装置是通过符合所述传输协议的协议总线连接的,所述第一属性是允许被所述服务器识别为符合所述传输协议的桥接设备的协议属性;Performing a first attribute configuration of a transmission protocol on the initial virtual bridge device in the 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 complying 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 second storage device and a storage channel having a corresponding relationship are recorded.

可选的,所述存储通道包括第二虚拟桥接设备和虚拟存储设备,第一虚拟桥接设备与所述第二虚拟桥接设备连接,所述第二虚拟桥接设备与所述虚拟存储设备连接,所述虚拟存储设备用于连接所述第一存储设备,其中,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 used 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 through 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.

可选的,所述通过所述参考存储通道中的所述虚拟存储设备将所述第一数据访问转换为所述第二数据访问,包括:Optionally, converting the first data access into the second data access through the virtual storage device in the reference storage channel includes:

通过所述参考存储通道中的所述虚拟存储设备获取所述第一数据访问所指示访问的第一访问地址,其中,所述第一访问地址是所述参考虚拟机指示访问的所述参考存储设备的虚拟地址;Acquire, 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 having 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 a 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.

可选的,所述通过所述参考存储通道中的所述虚拟存储设备从具有对应关系的虚拟地址范围和存储地址范围中查询所述第一访问地址所对应的第一存储地址,包括: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 through the virtual storage device in the reference storage channel 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.

可选的,所述方法还包括:Optionally, the method further includes:

在所述存储扩展装置中创建多组初始虚拟桥接设备和初始虚拟存储设备;Creating multiple groups of initial virtual bridging devices and initial virtual storage devices in the storage expansion device;

在所述初始虚拟桥接设备的协议配置空间对所述初始虚拟桥接设备进行传输协议的第二属性配置,得到所述第二虚拟桥接设备,其中,所述服务器与所述存储扩展装置是通过符合所述传输协议的协议总线连接的,所述第二属性是允许被所述服务器识别为符合所述传输协议的桥接设备的协议属性;Performing a second attribute configuration of a transmission protocol on the initial virtual bridge device in the 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 complying 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 recognized 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 recognized by the server as a storage device that complies with the storage protocol.

可选的,所述虚拟存储设备中部署了协议解析单元,所述在所述初始虚拟存储设备的传输协议配置空间对所述初始虚拟存储设备进行传输协议的第三属性配置,包括:Optionally, a protocol parsing unit is deployed in the virtual storage device, and the 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 perform data link layer protocol parsing on the received data access using the data link layer attributes, and/or, perform transaction layer protocol parsing on the received data access using the transaction layer attributes.

可选的,所述在所述初始虚拟存储设备的存储协议配置空间对所述初始虚拟存储设备进行存储协议的第四属性配置,包括:Optionally, configuring a 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.

可选的,所述存储扩展装置中还部署了目标总线和总线接口,所述总线接口用于将连接在所述目标总线上的多个所述存储通道连接至所述第一存储设备,所述总线接口中具有所述目标总线的总线地址空间与所述第一存储设备的存储地址空间的映射关系,其中,Optionally, a target bus and a bus interface are further deployed in the storage expansion device, and the bus interface is used 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.

可选的,所述总线接口包括:总线仲裁单元和存储设备驱动单元,所述存储设备驱动单元中具有所述目标总线的总线地址空间与所述第一存储设备的存储地址空间的映射关系,其中,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 a bus address space of the target bus and a storage address space of the first storage device, wherein:

所述通过所述总线接口根据所述映射关系将所述第二数据访问转发至所述参考存储空间,包括:The step of 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, whether to process bus access of the reference storage channel according to the priority of the reference storage channel;

在确定处理所述参考存储通道的总线访问的情况下,通过所述存储设备驱动单元根据所述映射关系将所述第二数据访问转发至所述参考存储空间。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.

根据本申请的另一个实施例,提供了一种存储扩展装置,包括:服务器端口,处理芯片和存储设备端口,其中,所述服务器端口与所述处理芯片连接,所述处理芯片与所述存储设备端口连接,所述处理芯片中建立了一个或者多个存储通道,所述服务器端口,用于连接服务器,其中,所述服务器上部署了一个或者多个虚拟机,所述一个或者多个存储通道允许被所述服务器识别为一个或者多个第二存储设备,所述一个或者多个第二存储设备在所述服务器上被分配给所述服务器上部署的虚拟机;所述存储设备端口,用于连接第一存储设备,其中,所述存储通道在所述第一存储设备上被分配了对应的存储空间;所述处理芯片用于实现前述存储设备的访问的步骤。According to another embodiment of the present application, a storage expansion device is provided, comprising: a server port, a processing chip and a storage device port, wherein the server port is connected to the processing chip, the processing chip is connected to the storage device port, one or more storage channels are established in the processing chip, the server port is used to connect to the server, wherein one or more virtual machines are deployed on the server, the one or more storage channels allow the server to identify them 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 used to connect to a first storage device, wherein the storage channel is allocated corresponding storage space on the first storage device; the processing chip is used to implement the aforementioned storage device access step.

可选的,所述处理芯片中部署了第一虚拟桥接设备,所述第一虚拟桥接设备与所述一个或者多个存储通道连接,所述第一虚拟桥接设备还用于连接所述服务器端口,并被所述服务器识别为连接了所述第二存储设备,所述第一虚拟桥接设备上记录了具有对应关系的所述第二存储设备和存储通道,其中,Optionally, a first virtual bridge device is deployed in the processing chip, the first virtual bridge device is connected to the one or more storage channels, the first virtual bridge device is also used 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 used to search for a reference storage channel corresponding to a reference storage device from the second storage devices and storage channels having a corresponding relationship when receiving a first data access, 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.

可选的,所述存储通道包括第二虚拟桥接设备和虚拟存储设备,所述第二虚拟桥接设备和所述第一虚拟桥接设备连接,所述第二虚拟桥接设备和所述虚拟存储设备连接,所述虚拟存储设备和所述第一存储设备连接,其中,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,

所述第二虚拟桥接设备,用于在接收到所述第一数据访问的情况下,将所述第一数据访问转发至所述第二虚拟桥接设备连接的所述虚拟存储设备;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 used to convert the first data access into a second data access for accessing the storage space corresponding to the reference storage channel in the first storage device.

可选的,所述存储扩展装置中还部署了外接存储设备,所述外接存储设备与所述虚拟存储设备连接,其中,Optionally, 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:

所述外接存储设备,用于对所述虚拟存储设备在所述第一存储设备中所要访问的数据进行缓存。The external storage device is used to cache the data that the virtual storage device is to access in the first storage device.

可选的,所述处理芯片中还部署了目标处理器,所述目标处理器通过内部高速总线和所述一个或者多个存储通道连接,所述目标处理器还和所述存储设备端口连接,其中,Optionally, a target processor is also deployed in the processing chip, and the target processor is connected to the one or more storage channels through an internal high-speed bus, and the target processor is also connected to the storage device port, wherein:

所述目标处理器,用于响应所述存储通道传输的数据访问请求,对所述第一存储设备进行存储控制和数据访问。The target processor is used to respond to the data access request transmitted by the storage channel and perform storage control and data access on the first storage device.

根据本申请的另一个实施例,提供了一种存储设备的访问装置,应用于存储扩展装置,所述存储扩展装置连接在第一存储设备与服务器之间,所述服务器上部署了一个或者多个虚拟机,所述存储扩展装置中建立了一个或者多个允许被所述服务器识别为第二存储设备的存储通道,所述第二存储设备被分配给所述服务器上部署的虚拟机,所述存储通道在所述第一存储设备上被分配了对应的存储空间,所述装置包括:接收模块,用于接收参考虚拟机发送的数据访问请求,其中,所述一个或者多个虚拟机包括所述参考虚拟机,所述数据访问请求用于请求对所述第二存储设备中被分配给所述参考虚拟机的参考存储设备进行第一数据访问;转换模块,用于响应所述数据访问请求,通过参考存储通道将所述第一数据访问转换为第二数据访问,其中,所述参考存储通道是所述存储扩展装置中建立的存储通道中被识别为所述参考存储设备的存储通道,所述第二数据访问是对所述第一存储设备中与所述参考存储通道对应的参考存储空间的数据访问;控制模块,用于控制所述第一存储设备的所述参考存储空间执行所述第二数据访问。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 a corresponding storage space on the first storage device, the device comprising: a receiving module, used 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 assigned to the reference virtual machine; a conversion module, used to respond to the data access request and 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 in 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 a control module, used to control the reference storage space of the first storage device to perform the second data access.

根据本申请的又一个实施例,还提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序,其中,所述计算机程序被设置为运行时执行上述任一项方法实施例中的步骤。According to another embodiment of the present application, a computer-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.

根据本申请的又一个实施例,还提供了一种电子设备,包括存储器和处理器,所述存储器中存储有计算机程序,所述处理器被设置为运行所述计算机程序以执行上述任一项方法实施例中的步骤。According to another embodiment of the present application, an electronic device is provided, including 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.

根据本申请的又一个实施例,还提供了一种计算机程序产品,包括计算机程序,其特征在于,所述计算机程序被处理器执行时实现上述任一项方法实施例中的步骤。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.

通过本申请,在服务器和服务器部署的第一存储设备之间部署了存储扩展装置,该存储扩展装置建立的一个或者多个存储通道,该一个或者多个存储通道允许被服务器识别为一个或者多个第二存储设备,并分配给服务器上部署的虚拟机使用,从而实现在虚拟机侧能够认为每个虚拟机都连接有一个第二存储设备,进而,在存储扩展装置接收到服务器上参考虚拟机发送的数据访问请求后,通过一个或者多个存储通道中被识别为参考存储设备的为参考存储通道,将对参考存储设备的数据访问转换对第一存储设备中参考存储通道对应的存储空间的数据访问,从而实现只需要连接一个存储设备就可以为服务器上的多个虚拟机提供服务,实现了在不更改服务器对存储设备的使用逻辑和无需新增存储设备的前提下,实现对服务连接的存储设备的扩展,并且对于服务器来说仍然是每个虚拟机都提供一个独立的存储设备,使得对存储设备的扩展性能更高,通用性更强,同时更加灵活可靠。可以解决相关技术中对服务器连接的存储设备进行扩展时存储设备扩展效率较低的问题,达到提高对服务器连接的存储设备进行扩展时存储设备扩展效率的效果。Through the present application, a storage expansion device is deployed between a server and a first storage device deployed on the server, and one or more storage channels established by the storage expansion device 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 each virtual machine can be considered to be connected to a second storage device on the virtual machine side, and then, after the storage expansion device receives a data access request sent by the reference virtual machine on the server, the data access to the reference storage device is converted 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, so that only one storage device needs to be connected to provide services for multiple virtual machines on the server, and the expansion of the storage device connected to the service is realized without changing the server's storage device usage logic and without adding a new storage device, and for the server, each virtual machine is still provided with an independent storage device, so that the expansion performance of the storage device is higher, the versatility is stronger, and it is more flexible and reliable. It can solve the problem of low storage device expansion efficiency when the storage device connected to the server is expanded in the related art, and achieve the effect of improving the storage device expansion efficiency when the storage device connected to the server is expanded.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1是根据本申请实施例的存储设备的访问方法的示意图;FIG1 is a schematic diagram of a method for accessing a storage device according to an embodiment of the present application;

图2是根据本申请实施例的一种存储扩展装置示意图;FIG2 is a schematic diagram of a storage expansion device according to an embodiment of the present application;

图3是根据本申请实施例的一种可选的存储设备空间分配示意图;FIG3 is a schematic diagram of an optional storage device space allocation according to an embodiment of the present application;

图4是根据本申请实施例的一种可选的总线接口示意图;FIG4 is a schematic diagram of an optional bus interface according to an embodiment of the present application;

图5是根据本申请实施例的一种可选的存储设备连接系统架构图;FIG5 is an optional storage device connection system architecture diagram according to an embodiment of the present application;

图6是根据本申请实施例的一种可选的存储扩展装置运行流程图;FIG6 is a flowchart of an optional storage expansion device operation according to an embodiment of the present application;

图7是根据本申请实施例的一种可选的存储设备访问流程图;FIG7 is an optional storage device access flow chart according to an embodiment of the present application;

图8是根据本申请实施例的一种可选的存储扩展装置结构图;FIG8 is a structural diagram of an optional storage expansion device according to an embodiment of the present application;

图9是根据本申请实施例的一种可选的存储扩展装置结构框图;FIG9 is a structural block diagram of an optional storage expansion device according to an embodiment of the present application;

图10是根据本申请实施例的存储设备的访问装置的结构框图。FIG. 10 is a structural block diagram of an access device of a storage device according to an embodiment of the present application.

具体实施方式Detailed ways

下文中将参考附图并结合实施例来详细说明本申请的实施例。The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

需要说明的是,本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。It should be noted that the terms "first", "second", etc. in the specification 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.

在本实施例中提供了一种存储设备的访问方法,图1是根据本申请实施例的存储设备的访问方法的示意图,如图1所示,应用于存储扩展装置,所述存储扩展装置连接在第一存储设备与服务器之间,所述服务器上部署了一个或者多个虚拟机,所述存储扩展装置中建立了一个或者多个允许被所述服务器识别为第二存储设备的存储通道,所述第二存储设备被分配给所述服务器上部署的虚拟机,所述存储通道在所述第一存储设备上被分配了对应的存储空间,该方法包括如下步骤:In this embodiment, a method for accessing a storage device is provided. FIG. 1 is a schematic diagram of a method for accessing a storage device according to an embodiment of the present application. As shown in FIG. 1 , 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 that are allowed to be identified as a second storage device by the server are established in the storage expansion device, 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 method comprises the following steps:

步骤S102,接收参考虚拟机发送的数据访问请求,其中,所述一个或者多个虚拟机包括所述参考虚拟机,所述数据访问请求用于请求对所述第二存储设备中被分配给所述参考虚拟机的参考存储设备进行第一数据访问;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;

步骤S104,响应所述数据访问请求,通过参考存储通道将所述第一数据访问转换为第二数据访问,其中,所述参考存储通道是所述存储扩展装置中建立的存储通道中被识别为所述参考存储设备的存储通道,所述第二数据访问是对所述第一存储设备中与所述参考存储通道对应的参考存储空间的数据访问;Step S104, in response to the data access request, converting 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 in the first storage device corresponding to the reference storage channel;

步骤S106,控制所述第一存储设备的所述参考存储空间执行所述第二数据访问。Step S106: controlling the reference storage space of the first storage device to perform the second data access.

通过上述步骤,在服务器和服务器部署的第一存储设备之间部署了存储扩展装置,该存储扩展装置建立的一个或者多个存储通道,该一个或者多个存储通道允许被服务器识别为一个或者多个第二存储设备,并分配给服务器上部署的虚拟机使用,从而实现在虚拟机侧能够认为每个虚拟机都连接有一个第二存储设备,进而,在存储扩展装置接收到服务器上参考虚拟机发送的数据访问请求后,通过一个或者多个存储通道中被识别为参考存储设备的为参考存储通道,将对参考存储设备的数据访问转换对第一存储设备中参考存储通道对应的存储空间的数据访问,从而实现只需要连接一个存储设备就可以为服务器上的多个虚拟机提供服务,实现了在不更改服务器对存储设备的使用逻辑和无需新增存储设备的前提下,实现对服务连接的存储设备的扩展,并且对于服务器来说仍然是每个虚拟机都提供一个独立的存储设备,使得对存储设备的扩展性能更高,通用性更强,同时更加灵活可靠。可以解决相关技术中对服务器连接的存储设备进行扩展时存储设备扩展效率较低的问题,达到提高对服务器连接的存储设备进行扩展时存储设备扩展效率的效果。Through the above steps, a storage expansion device is deployed between the server and the first storage device deployed on the server, and one or more storage channels established by the storage expansion device 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 each virtual machine can be considered to be connected to a second storage device on the virtual machine side, and then, after the storage expansion device receives the data access request sent by the reference virtual machine on the server, the data access to the reference storage device is converted into the 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, so that only one storage device needs to be connected to provide services for multiple virtual machines on the server, and the expansion of the storage device connected to the service is realized without changing the server's storage device usage logic and without adding new storage devices, and for the server, each virtual machine is still provided with an independent storage device, so that the expansion performance of the storage device is higher, the versatility is stronger, and it is more flexible and reliable. The problem of low storage device expansion efficiency when expanding the storage device connected to the server in the related art can be solved, and the effect of improving the storage device expansion efficiency when expanding the storage device connected to the server can be achieved.

在上述步骤S102提供的技术方案中,存储设备用于为服务器上的虚拟机提供数据存储服务,在本申请实施例中,存储设备可以但不限于包括硬盘驱动器、固态硬盘、光盘、闪存驱动器、磁带等等,比如NVMe(Non-Volatile Memory express,非易失性内存主机控制器接口规范)存储设备(例如NVMe SSD(Solid State Drives,固态硬盘)),本方案对此不做限定。In the technical solution provided in the above step S102, the storage device is used to provide data storage services for the virtual machines on the server. In the embodiment of the present application, the storage device may include but is not limited to hard disk drives, solid-state hard disks, optical disks, flash drives, tapes, etc., such as NVMe (Non-Volatile Memory express, non-volatile memory host controller interface specification) storage devices (such as NVMe SSD (Solid State Drives, solid-state hard disks)), which is not limited in this solution.

可选地,在本申请实施例中,存储扩展装置中建立的存储通道可以是预先建立好的,或者还可以是根据服务器上部署的虚拟机对存储通道的需求建立的,本方案对此不做限定。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 demand for the storage channel by a virtual machine deployed on the server, and this solution does not limit this.

可选地,在本申请实施例中,在存储扩展装置中建立了一个或者多个用于对第一存储设备上被分配的对应的存储空间进行访问的存储通道,进而在服务器侧每个存储通道被识别为一个存储设备,本申请中可以但不限于根据服务器上虚拟机的部署数量以及每个虚拟机的存储空间需求对第一存储设备上的存储空间进行分配,为每个虚拟机分配对应的存储空间,建立存储空间和对应的连接关系,同时存储扩展装置将存储通道的索引信息(比如存储通道的地址信息、存储通道的通信协议、数据传输格式等等)发送给服务器,从而服务器能够使用该索引信息对存储通道对应的存储空间进行调用。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 a corresponding connection relationship are 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.

可选地,在本申请实施例中,一个参考虚拟机在存储扩展装置中可以被分配一个或者多个存储通道,比如,存储扩展装置中分配了N个存储通道,常规的分配方式可以是为每个参考虚拟机分配一个对应的存储通道,或者为了实现参考虚拟机对存储设备的访问效率,可以根据参考虚拟机对存储设备的访问需求,从N个存储通道中为该参考虚拟机选择M个存储通道(其中N大于或者等于M),进而参考虚拟机可以通过发送数据访问请求的方式同时对M个参考存储通道对应的参考存储设备执行数据访问操作,本方案对此不做限定。Optionally, in an embodiment of the present application, a reference virtual machine may 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. Alternatively, in order to achieve efficient access of the reference virtual machine to the storage device, M storage channels (where N is greater than or equal to M) may 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. The reference virtual machine may then 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.

可选地,在本申请实施例中,数据访问请求可以但不限于包括对参考存储设备执行数据读取操作的操作请求,或者还可以是将数据写入参考存储设备的数据写入请求,本方案对此不做限定。Optionally, in an embodiment of the present application, a 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.

在上述步骤S104提供的实施例中,参考存储通道用于实现参考存储设备和第一存储设备中与参考存储通道对应的存储空间的一对一映射,由于本实施例中存储扩展装置中的一个或者多个存储通道被服务器识别为连接了一个或者多个存储设备,进而服务器上的虚拟机会向参考存储设备下发用于对参考存储设备进行第一数据访问的数据访问请求,存储扩展装置作为连接在第一存储设备和服务器之间的中转设备,将第一数据访问转换为对第一存储设备上与参考存储通道对应的存储空间进行访问的第二数据访问操作。In the embodiment provided in the above step S104, the reference storage channel is used to implement 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 recognized 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 to the reference storage device to the reference storage device. The storage expansion device, as a transit device connected between the first storage device and the server, converts 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.

可选地,在本申请实施例中,参考存储通道将第一数据访问转换为第二数据访问可以是对数据访问地址的转换,即虚拟机通过参考存储通道和第一存储设备连接,进而在虚拟机上参考存储通道被是被为一个参考存储设备,虚拟机访问该存储设备需要根据参考存储设备的虚拟地址进行数据访问,因此第一数据访问中需要携带执行数据访问操作的第一访问地址,而参考存储通道侧因为连接了第一存储设备,因此参考存储通道需要对第一存储设备上与参考存储通道对应的存储区执行数据访问操作,因此,参考存储通道需要对第一数据访问执行地址转换操作,将访问地址有第一访问地址转换为第一存储设备上与参考存储通道对应的存储区的第二访问地址。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 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. 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 on the first storage device corresponding to the reference storage channel. 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 on the first storage device corresponding to the reference storage channel.

可选地,在本申请实施例中,参考存储通道将第一数据访问转换为第二数据访问可以是对数据传输协议格式的访问,即虚拟机通过参考存储通道和第一存储设备连接,进而在虚拟机上参考存储通道被是被为一个参考存储设备,虚拟机访问该存储设备需要根据参考存储设备的虚拟地址进行数据访问,因此第一数据访问需要按照参考存储设备的数据传输协议格式进行访问,由于参考存储设备的数据传输协议格式和第一存储设备的数据传输协议格式存储区别,因此参考存储通道需要对第一数据访问执行数据传输协议格式的转换,从而将第一数据访问转换为第二数据访问。Optionally, in an embodiment of the present application, the reference storage channel converts the first data access into the second data access by accessing 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. Therefore, 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.

可选地,在本申请实施中,参考存储空间可以是第一存储设备中与参考存储通道对应的连续的存储空间,或者还可以是多个非连续的存储空间,比如,对第一存储设备的存储空间进行划分,能划分出依次连续的5个存储空间,分别是存储空间A、存储空间B、存储空间C、和存储空间D,其中存储空间A的存储区域结束为止和存储空间B的存储空间起始位置相邻,存储空间B的存储空间结束位置和存储空间C的存储空间起始位置相邻,存储空间C的存储空间结束为止和存储空间D的存储空间起始位置相邻,进而可以将存储空间A或者将存储空间A和B同时作为一个存储通道对应的存储空间,当4个存储空间中有部分处于中间位置的存储空间被分配给某一存储通道时,如存储空间C被分给某一存储设备,进而为了保证存储空间的有效利用,可以当另一个存储通道需要两个存储空间时,可以将存储空间A和存储空间C一起分配给另一个存储通道。Optionally, in the implementation of the present application, the reference storage space may be a continuous storage space corresponding to the reference storage channel in the first storage device, or may also be a plurality of non-continuous storage spaces. For example, the storage space of the first storage device may 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 start position of storage space B, the storage space end position of storage space B is adjacent to the storage space start position of storage space C, and the storage space end position of storage space C is adjacent to the storage space start position of storage space D. Thus, storage space A or storage space A and B may be used as storage space corresponding to a storage channel. When some of the storage spaces in the middle of the four storage spaces are allocated to a storage channel, such as storage space C is allocated to a storage device, then in order to ensure effective use of the storage space, when another storage channel needs two storage spaces, storage space A and storage space C may be allocated together to another storage channel.

在上述步骤S106提供的实施例中,在存储扩展装置中维护有参考存储通道和第一存储设备中为该参考存储通道分配的参考存储空间的映射关系,其目的是将参考存储设备与参考存储空间进行一对一映射,进而在需要执行第二数据访问操作后,通过该映射关系查找出第一存储设备上与参考通道具有映射关系的参考存储空间。In the embodiment provided in the above step S106, a mapping relationship between a reference storage channel and a reference storage space allocated to the reference storage channel in the first storage device is maintained in the storage expansion device, with the purpose of mapping the reference storage device to the reference storage space one-to-one, and 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.

本申请实施例可以但不限于应用与对NVMe存储设备的扩展方法,其核心思想是通过在CPU与NVMe存储设备之间中增加一个NVMe扩展装置,实现PCIe的通道数量扩展,同时在每个通道下虚拟出一个NVMe存储设备,并完成与物理设备之间的多对一映射,从而在下游只连接一个NVMe存储设备的情况下,向CPU呈现出多个存储设备,达到设备扩展的目的。本发明用硬件装置实现NVMe存储设备扩展功能,无需软件过多参与,即具备PCIe Switch扩展方案的高性能与通用性,又具备软件虚拟化方案的灵活性与低成本。存储设备扩展系统包括服务器、存储扩展装置、第一存储设备,存储扩展装置连接第一存储设备与服务器之间,服务器上部署了一个或者多个虚拟机,能够在服务器CPU侧呈现出一个PCIe根节点下挂载了多个虚拟NVMe设备(vDevice)的拓扑形式,并可根据用户需求动态调整所扩展出的虚拟设备的数量。在本申请中,所有的虚拟设备共享一个NVMe存储设备,因此多个虚拟设备所对应的物理NVMe存储空间地址不能有重合的部分,有专门的地址映射单元负责空间管理。The embodiment of the present application can be applied to but not limited to the expansion method of 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, and at the same time, virtualize an NVMe storage device under each channel, and complete the many-to-one mapping between the physical device, so that when only one NVMe storage device is connected downstream, multiple storage devices are presented to the CPU to achieve the purpose of device expansion. The present invention uses a hardware device to implement the NVMe storage device expansion function without excessive software participation, that is, it has the high performance and versatility of the PCIe Switch expansion solution, and has 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 form of multiple virtual NVMe devices (vDevice) mounted under a PCIe root node on the server CPU side, and can dynamically adjust the number of virtual devices expanded 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.

作为一种可选的实施例,所述通过参考存储通道将第一数据访问转换为第二数据访问,包括:As an optional embodiment, converting the first data access into the 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.

可选地,在本申请实施例中,存储扩展装置中可以但不限于维护有虚拟机和存储通道的映射关系,用于将服务器上部署的虚拟机和为虚拟机分配的存储通道进行映射,进而存储扩展装置在接收到参考虚拟机发送的数据访问请求后,能够根据该映射关系查找出为参考虚拟机分配的参考存储通道。Optionally, in an embodiment of the present application, a mapping relationship between virtual machines and storage channels may be maintained in the storage expansion device, but is not limited to, for mapping 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 out the reference storage channel allocated to the reference virtual machine according to the mapping relationship.

通过以上内容,由于存储扩展装置中建立了一个或者多个存储通道,存储通道用于将虚拟机和第一存储设备上为存储通道分配的存储空间进行连接,从而使得服务器能够将一个或者多个存储通道识别为一个或者多个第二存储设备,进而在接收到参考虚拟机发送的数据访问请求后,通过从一个或者多个存储通道中确定出被参考虚拟机识别为参考存储设备的参考存储通道,从而也就找到了第一存储设备上需要执行数据访问操作的存储空间,进而通过将第一数据访问转发给参考存储通道,从而参考存储通道能够将对参考存储设备执行数据访问操作的第一数据访问转换为对第一存储设备而上为参考存储设备分配的参考存储空间执行数据访问操作的第二数据访问,从而实现保证将第一数据访问转换为第二数据访问的准确性。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 that needs to perform the data access operation 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.

作为一种可选的实施例,所述存储扩展装置中还部署了第一虚拟桥接设备,所述第一虚拟桥接设备与所述存储扩展装置中建立的存储通道连接,所述第一虚拟桥接设备还用于连接所述服务器并被所述服务器识别为连接了所述一个或者多个第二存储设备,所述第一虚拟桥接设备上记录了具有对应关系的第二存储设备和存储通道,其中,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 used to connect to the server and is recognized by the server as being connected to the one or more second storage devices, and the first virtual bridge device records the second storage devices and storage channels having a corresponding relationship, wherein,

所述从所述存储扩展装置中建立的存储通道中确定被识别为所述参考存储设备的参考存储通道,包括:通过所述第一虚拟桥接设备从具有对应关系的第二存储设备和存储通道中查找所述参考存储设备所对应的所述参考存储通道;The step of determining the reference storage channel identified as the reference storage device from the storage channels established in the storage expansion device comprises: searching, through the first virtual bridge device, for the reference storage channel corresponding to the reference storage device from the second storage devices and 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.

可选地,在本申请实施例中,第一虚拟桥接设备用于实现服务器和一个或者多个存储通道的连接,对虚拟机发送的数据或者需要返回给虚拟机的数据进行协议解析,在本实施例中,第一虚拟桥接设备还可以根据数据包中的第一对数据包进行路由转发,比如,参考虚拟机发送的数据访问请求中携带为该参考虚拟机分配的参考存储通道的地址信息,进而第一虚拟桥接设备根据地址信息从一个或者多个存储通道中查找出与该地址信息匹配的参考存储通道,将数据访问请求发送给参考存储通道,或者,在对第一存储设备中为参考存储通道分配的存储空间执行完数据访问操作,需要执行数据访问结果的反馈(比如数据访问请求是请求读取数据,则需要将读取的数据反馈参考虚拟机),此时参考存储通道将数据访问结果发送给第一虚拟桥接设备,第一虚拟桥接设备将参考存储通道发送的数据访问结果转发给与参考存储通道对应的参考虚拟机。Optionally, in an embodiment of the present application, the first virtual bridging device is used 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 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 a 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.

可选地,在本申请实施例中,第一虚拟桥接设备中还可以维护有虚拟机和为虚拟机分配的存储通道的映射关系,进而通过第一虚拟桥接设备实现对虚拟机和存储通道之间的数据转发,即虚拟机将数据访问请求发送给第一虚拟桥接设备,第一虚拟桥接设备根据存储的映射关系查找出一个或者多个存储通道中为该虚拟机分配的参考存储通道,进而将数据访问请求转发给参考存储通道,或者存储通道将从第一存储设备中读取到的数据包发送给第一虚拟机桥接设备,进而第一虚拟机桥接设备服务器上部署的虚拟机中找到与该存储通道对应的参考虚拟机,进而将存储通道发送的数据包转发给参考虚拟机。Optionally, in an embodiment of the present application, the first virtual bridging device may also maintain a mapping relationship between a virtual machine and a 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 a data packet read from the first storage device to the first virtual machine bridging device, and then finds a 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.

通过以上内容,通过在存储扩展装置中部署用于对虚拟机和存储扩展装置中建立的一个或者多个存储通道进行链接的第一虚拟机桥接设备,由于第一虚拟机桥接设备用于连接服务器并被服务器识别为连接了一个或者多个第二存储设备,进而第一虚拟机桥接设备上记录具有对应关系的第二存储设备和存储通道,从而通过第一虚拟桥接设备上的第二存储设备和存储通道的对应关系查找与参考存储设备对应的参考存储通道,实现对存储通道的准确查找,避免第一数据访问的转发错误。Through the above content, by deploying a first virtual machine bridging device in the storage expansion device for linking a virtual machine and one or more storage channels established in the storage expansion device, since the first virtual machine bridging device is used to connect to the server and is recognized by the server as connected to one or more second storage devices, the second storage devices and storage channels with corresponding relationships are recorded on the first virtual machine bridging device, so that the reference storage channel corresponding to the reference storage device is searched through the corresponding relationship between the second storage device and the storage channel on the first virtual bridging device, thereby achieving accurate search of the storage channel and avoiding forwarding errors in the first data access.

作为一种可选的实施例,所述通过所述第一虚拟桥接设备从具有对应关系的第二存储设备和存储通道中查找所述参考存储设备所对应的所述参考存储通道,包括:As an optional embodiment, searching, by the first virtual bridge device, the reference storage channel corresponding to the reference storage device from the second storage devices and storage channels having a corresponding relationship, includes:

通过所述第一虚拟桥接设备从所述数据访问请求中提取所述参考存储设备的参考设备标识;extracting a reference device identifier of the reference storage device from the data access request through the first virtual bridge device;

通过所述第一虚拟桥接设备从具有对应关系的存储设备标识和存储通道中查找所述参考设备标识所对应的所述参考存储通道,其中,所述存储设备标识是被分配给对应的存储通道的允许被识别为存储设备的设备标识。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.

可选地,在本申请实施例中,第一虚拟桥接设备负责执行服务器和存储通道的中转连接,在服务器侧服务器认为自身连接了多个第二存储设备,进而会生成调用第二存储设备的数据访问请求,该数据访问请求中携带有待请求访问的第二存储设备的参考设备标识,第一虚拟桥接设别上维护了存储设备标识和存储通道的对应关系,进而通过该对应关系确定出参考设备标识对应的参考存储通道,进而将对应的数据访问请求发送给参考存储通道,从而对第一存储设备进行调用。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 a reference device identifier of the second storage device to be requested for 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.

通过以上步骤,通过设置第一虚拟桥接设备,并将虚拟桥接设备作为服务器和多个存储通道的中转连接设备,由于多个存储通道被服务器识别为多个第二存储设备,进而通过在第一虚拟桥接设备上维护设备标识和存储通道的对应关系,从而将设备请求调用的设备的设备标识和存储通道之间进行映射,实现对存储通道的准确查找。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 as multiple second storage devices by the server, 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.

作为一种可选的实施例,所述方法还包括:As an optional embodiment, the method further includes:

在所述存储扩展装置中创建初始的虚拟桥接设备;Creating an initial virtual bridge device in the storage expansion device;

在所述初始的虚拟桥接设备的协议配置空间对所述初始的虚拟桥接设备进行传输协议的第一属性配置,得到所述第一虚拟桥接设备,其中,所述服务器与所述存储扩展装置是通过符合所述传输协议的协议总线连接的,所述第一属性是允许被所述服务器识别为符合所述传输协议的桥接设备的协议属性;Performing a first attribute configuration of a transmission protocol on the initial virtual bridge device in the 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 complying with the transmission protocol;

建立所述第一虚拟桥接设备与所述一个或者多个存储通道之间的连接,并记录具有对应关系的第二存储设备和存储通道。A connection is established between the first virtual bridge device and the one or more storage channels, and a second storage device and a storage channel having a corresponding relationship are recorded.

可选地,在本申请实施例中,对初始虚拟桥接设备进行的传输协议的第一属性配置可以但不限于包括PCIe配置空间、Memory base、Memory limit等寄存器定义,通过对传协议的配置,从而能够在服务器CPU枚举过程中被识别为正常的桥接设备。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, Memory limit, etc., and through the configuration of the transmission protocol, it can be identified as a normal bridge device during the server CPU enumeration process.

可选地,在本申请实施例中,虚拟桥接设备可以但不限于是虚拟的PCIe桥接设备,用于实现服务器和第一存储设备的PCIe总线之间的桥接,或者用于实现服务器和多个被服务器识别为第二存储设备的存储通道之间的连接,从而对来自上下游环节的PCIe数据包进行协议解析,并根据器中的地址信息进行上下游数据包路由和转发,本方案对此不做限定。Optionally, in an embodiment of the present application, the virtual bridging device may be, but is not limited to, a virtual PCIe bridging device, which is used to implement bridging between the PCIe buses of the server and the first storage device, or to implement connection 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.

通过以上内容,通过在初始的虚拟桥接设备的协议配置空间中对初始的虚拟桥接设备进行传输协议的第一属性配置,使得配置后的第一虚拟桥接设备能够允许被服务器识别为符合传输协议的桥接设备,从而实现第一虚拟桥接设备在cpu上的正常识别,进而为服务器和多个存储通道之间的连接提供了协议保障。Through the above content, by configuring the first attribute of the transmission protocol for 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.

作为一种可选的实施例,所述存储通道包括第二虚拟桥接设备和虚拟存储设备,第一虚拟桥接设备与所述第二虚拟桥接设备连接,所述第二虚拟桥接设备与所述虚拟存储设备连接,所述虚拟存储设备用于连接所述第一存储设备,其中,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 used to connect to the first storage device, wherein,

所述通过所述参考存储通道将所述第一数据访问转换为所述第二数据访问,包括:The converting the first data access into the second data access through the reference storage channel comprises:

通过所述参考存储通道中的所述第二虚拟桥接设备接收所述第一数据访问;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.

可选地,在本申请实施例中,虚拟存储设备具备设备链路层与事务层的逻辑功能,能够按照协议进行DLP与TLP数据包的解包、封装、校验等功能,并完成存储器读写、配置读写等总线事务。在CPU枚举设备树之前,通道扩展逻辑可根据需要准备好虚拟设备的配置空间、地址范围、设备数量等必要信息以配合上游系统调用。Optionally, in the 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 and TLP data packets according to the protocol, and complete bus transactions such as memory read and write, configuration read and write, etc. Before the CPU enumerates the device tree, the channel expansion logic can prepare the necessary information such as the configuration space, address range, and number of devices of the virtual device as needed to cooperate with the upstream system call.

可选地,在本申请实施例中,虚拟设备中的核心功能单元可以但不限于包括协议解析单元、数据缓存单元与地址映射单元三部分,此三部分在虚拟设备中通过高带宽的总线互连;协议解析单元:该单元完成PCIe数据链路层与事务层的协议解析、封包、校验与数据处理。在数据链路层,采用ACK/NAK应答机制在发送端与接收端之间进行错误重传与流量控制,根据数据链路层协议进行DLLP报文处理以实现通道中的数据可靠传输,并定义不同类型报文的发送顺序以保证重要的信息得到优先响应。在事务层,该单元利用TLP数据包中的总线号、设备号与功能号ID完成路由寻址,实现对配置空间内容的读写,并根据TLP包中的Address字段进行寻址,实现对存储器空间和IO空间的读写;数据缓存单元用于对在服务器和第一存储设备之间传输的数据进行临时传输,当虚拟存储设备高频率访问PCIe上下游端口时,由于上下游端口响应速率不匹配会出现数据包处理不及时的问题,本发明在虚拟存储设备内部设置了数据缓存单元,用来应对数据处理速度不一致的问题。每个虚拟存储设备的数据缓存单元大小可以调整,用来适配不同的应用场景;地址映射单元:在本申请中最终的数据存储介质是下游端口所连接的第一存储设备,而不是服务器CPU所“看到”的虚拟存储设备。每个虚拟存储设备在第一存储设备中都有一段对应的空间,对虚拟存储设备进行的数据读写最终都会作用到该空间上,因此需要在虚拟存储设备与第一存储设备之间进行双向数据转发,将CPU对虚拟存储设备的数据读写访问映射至第一存储设备。Optionally, in the 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, which are interconnected in the virtual device through a high-bandwidth bus; 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/NAK response mechanism is used to perform error retransmission and flow control between the sender and the receiver, and 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 is responded to first. 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, realizes 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; the data cache unit is used 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 problem of untimely data packet processing will occur due to the mismatch of the upstream and downstream port response rates. The present invention 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 this application, the final data storage medium is the first storage device connected to the downstream port, not the virtual storage device "seen" by the server CPU. Each virtual storage device has a corresponding space in the first storage device, and the data reading and writing of the virtual storage device will eventually act on the space. Therefore, it is necessary to perform bidirectional data forwarding between the virtual storage device and the first storage device, and map the CPU's data reading and writing access to the virtual storage device to the first storage device.

可选地,在本申请实施例中,虚拟存储设备用于作为服务器和第一存储设备之间的数据中转设备,即将服务器发送的数据访问请求进行临时存储,并根据数据访问请求对第一存储设备上与该虚拟存储设备对应的存储区域进行数据访问操作,并将访问得到的数据进行临时存储并传递给服务器,因此,为了实现这一目的可以在存储扩展装置中为虚拟设备分配缓存控制,即将存储扩展装置的存储空间分配多个虚拟存储设备,其中存储扩展装置的存储空间可以是平均的分配给多个虚拟存储设备或者还可以是根据各个虚拟存储设备所要办理的业务对存储空间的需求进行分配,本方案对此不做限定。Optionally, in an embodiment of the present application, the virtual storage device is used 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, wherein the storage space of the storage expansion device can be evenly allocated 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, and this scheme does not limit this.

通过以上内容,通过在存储通道中设置第二虚拟桥接设备和虚拟存储设备,从而通过第二虚拟桥接设备接收第一数据访问请求,并通过虚拟存储设备作为第一数据访问和第二数据访问的中转设备,从而实现通过存储通道对连接的第一存储设备的存储空间的高效并准确的访问。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.

在本申请实施例中,虚拟桥接设备可以但不限于是虚拟PCIe桥接设备,用于实现两条PCIe总线之间的桥接,图2是根据本申请实施例的一种存储扩展装置示意图,如图2所示:存储扩展装置包括通道扩展逻辑模块和内部总线接口模块,通道扩展逻辑模块用于和服务器端口(服务器或者服务器上部署的虚拟机)连接,通道扩展逻辑还与内部总线接口连接,内部总线接口模块和存储设备端口(第一存储设备)连接,内部总线接口用于实现存储扩展装置中创建的存储通道对第一存储设备的数据访问。vBridge在本发明中为虚拟PCIe桥接设备(包括第一虚拟桥接设备和第二虚拟桥接设备),用于实现两条PCIe总线之间的桥接。本发明中在vBridge结构中包括PCIe配置空间、Memory base、Memory limit等寄存器定义,能够在CPU枚举过程中被识别为正常的PCIe Bridge。在本发明中vBridge负责建立CPU与虚拟PCIe Device(vDevice(虚拟存储设备))之间的连接关系,对来自上下游环节的PCIe数据包进行协议解析,并根据其中的地址信息进行上下行数据包路由转发。In the embodiment of the present application, the virtual bridge device can be but not limited to a virtual PCIe bridge device, which is used to realize the bridge between two PCIe buses. FIG2 is a schematic diagram of a storage expansion device according to the embodiment of the present application, as shown in FIG2: the storage expansion device includes a channel expansion logic module and an internal bus interface module, the channel expansion logic module is used to connect to the server port (server or virtual machine deployed on the server), 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), and the internal bus interface is used to realize the data access of the storage channel created in the storage expansion device to the first storage device. vBridge in the present invention is a virtual PCIe bridge device (including a first virtual bridge device and a second virtual bridge device) for realizing the bridge between two PCIe buses. In the present invention, the vBridge structure includes the PCIe configuration space, Memory base, Memory limit and other register definitions, which can be identified as a normal PCIe Bridge during the CPU enumeration process. In the present invention, vBridge is responsible for establishing a connection relationship between the CPU and the virtual PCIe Device (vDevice (virtual storage device)), 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 therein.

在本实施例中,vDevice设备(虚拟存储设备)首先是一个PCIe Endpoint设备更进一步的是在此基础上的NVMe存储设备。本发明中的vDevice设备具备PCIe Endpoint设备链路层与事务层的逻辑功能,能够按照协议进行DLP与TLP数据包的解包、封装、校验等功能,并完成存储器读写、配置读写等总线事务。在CPU枚举PCIe设备树之前,通道扩展逻辑可根据需要准备好vDevice的配置空间、地址范围、设备数量等必要信息以配合上游系统调用。vDevice中的核心功能单元包括协议解析单元、数据缓存单元与地址映射单元三部分,此三部分在vDevice中通过高带宽的总线互连。详述如下:In this embodiment, the vDevice device (virtual storage device) is first a PCIe Endpoint device and further an NVMe storage device based on it. The vDevice device in the present invention has the logical functions of the link layer and transaction layer of the PCIe Endpoint device, and can perform functions such as unpacking, encapsulating, and verifying DLP and TLP data packets according to the protocol, and complete bus transactions such as memory reading and writing, configuration reading and writing, etc. Before the CPU enumerates the PCIe device tree, the channel extension logic can prepare the necessary information such as the configuration space, address range, number of devices, etc. of the vDevice as needed to cooperate with the upstream system call. The core functional units in the vDevice include 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:

协议解析单元:该单元完成PCIe数据链路层与事务层的协议解析、封包、校验与数据处理。在数据链路层,采用ACK/NAK应答机制在发送端与接收端之间进行错误重传与流量控制,根据数据链路层协议进行DLLP报文处理以实现通道中的数据可靠传输,并定义不同类型报文的发送顺序以保证重要的信息得到优先响应。在事务层,该单元利用TLP数据包中的总线号、设备号与功能号ID完成路由寻址,实现对配置空间内容的读写,并根据TLP包中的Address字段进行寻址,实现对存储器空间和IO空间的读写。Protocol parsing unit: This unit completes the protocol parsing, packetization, 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 address according to the Address field in the TLP packet to realize the reading and writing of the memory space and IO space.

在PCIe的基础上,本单元还支持vDevice具备了NVMe设备的逻辑功能。通过实现标准NVMe控制寄存器组,使vDevice具备从Host获取CQ与SQ队列信息、响应Host的DoorBell命令以及发送MSI中断的能力。对于NVMe存储空间的数据写入与读取,该单元将通过vDevice的数据缓存单元与地址映射单元,在上游服务器CPU与下游NVMe设备之间进行数据与命令进行转发,从而完成实际的读写操作。Based on PCIe, this unit also supports vDevice to have the logical functions of NVMe devices. By implementing the standard NVMe control register group, vDevice has the ability to obtain CQ and SQ queue information from the Host, respond to the Host's DoorBell command, and send MSI 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.

数据缓存单元:当vDevice高频率访问PCIe上下游端口时,由于上下游端口响应速率不匹配会出现数据包处理不及时的问题。本发明在vDevice内部设置了数据缓存单元,用来应对数据处理速度不一致的问题。每个vDevice的数据缓存单元大小可以调整,用来适配不同的应用场景。数据缓存单元的介质SRAM或DRAM,位置或处于所述NVMe扩展装置的内部,也可处于NVMe扩展装置外部。Data cache unit: When vDevice accesses PCIe upstream and downstream ports at a high frequency, data packets may not be processed in time due to the mismatch in the response rates of the upstream and downstream ports. The present invention sets a data cache unit inside the vDevice to address 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 SRAM or DRAM of the data cache unit may be located inside the NVMe expansion device or outside the NVMe expansion device.

地址映射单元:在本发明中最终的数据存储介质是下游端口所连接的NVMe存储设备,而不是服务器CPU所“看到”的vDevice。每个vDevice在NVMe存储设备中都有一段对应的空间,对vDevice进行的数据读写最终都会作用到该空间上,因此需要在vDevice与NVMe存储设备之间进行双向数据转发,将CPU对vDevice的数据读写访问映射至NVMe存储设备。图3是根据本申请实施例的一种可选的存储设备空间分配示意图,如图3所示,将第一存储设备的存储空间按照目标粒度(可以按照虚拟存储设备的数量,或这虚拟存储设备对存储空间的需求)进行分配,从而得到分配后的多个存储空间,进而可以根据各个虚拟机的数据存储需求将存储空间分配给对应的虚拟存储设备。Address mapping unit: In the present invention, the final data storage medium is the NVMe storage device connected to the downstream port, rather than 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 a schematic diagram of an optional storage device space allocation 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 demand for storage space of this virtual storage device), 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.

本申请中上述工作由vDevice中的地址映射单元完成。其核心思想是将每个vDevice的PCIe BAR空间与NVMe存储设备的BAR空间中分配给该vDevice的部分进行一对一映射。每当vDevice收到一个PCIe数据包,就根据此映射关系向NVMe存储设备的对应地址转发此数据包。反向传输亦如此,vDevice每接收一个来自NVMe存储设备的数据包,就向Host对应的PCIe BAR空间转发此数据包。所述的一对一映射通过专用的寄存器组实现,利用寄存器分别存储vDevice侧与NVMe存储设备侧的PCIe BAR空间首末地址,并用硬件逻辑实现地址匹配与偏址。The above work in this application is completed by the address mapping unit in vDevice. The core idea is to map the PCIe BAR space of each vDevice to the part of the BAR space of the NVMe storage device allocated to the vDevice one-to-one. 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 address.

作为一种可选的实施例,所述通过所述参考存储通道中的所述虚拟存储设备将所述第一数据访问转换为所述第二数据访问,包括:As an optional embodiment, converting the first data access into the second data access through the virtual storage device in the reference storage channel includes:

通过所述参考存储通道中的所述虚拟存储设备获取所述第一数据访问所指示访问的第一访问地址,其中,所述第一访问地址是所述参考虚拟机指示访问的所述参考存储设备的虚拟地址;Acquire, 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 having 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 a 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.

可选地,在本申请实施例中,虚拟地址范围可以但不限于是网络连接设备上为对应的存储通道分配的用于对数据进行缓存的存储空间的地址范围。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.

可选地,在本申请实施例中,为了提高对第一存储设备中存储空间的利用率,可以将第一存储设备的存储空间按照目标粒度进行划分,从而将存储空间划分为多份,进而根据数据存储量和存储空间中内存占用情况为虚拟存储设备分配对应的存储地址范围,其中存储地址范围中的存储地址可以是连续的存储地址或者还可以是不连续的存储地址,即为了提高对存储空间的利用率,可以利用存储空间中未被占用的多个非连续的存储地址范围对应的存储空间进行数据存储,本方案对此不做限定。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 scheme does not limit this.

通过以上步骤,在存储扩展装置的存储空间中为参考存储设备对应的参考虚拟机分配虚拟地址范围,从而虚拟存储设备可以对在服务器和第一存储设备之间传输的数据进行临时存储,避免出现数据延迟不一致的问题,并在第一存储设备上为参考虚拟机分配对应的存储地址范围,进而在虚拟存储设别上配置具有对应关系的虚拟地址范围和存储地址范围,进而虚拟存储设备能够根据该映射关系在需要进行数据访问转换操作是,将第一数据访问的第一地址替换为第一存储地址,从而提高数据访问的准确率,本方案对此不做限定。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 to avoid the problem of inconsistent data delays, and a corresponding storage address range is allocated to the reference virtual machine on the first storage device, and then a virtual address range and a storage address range with a corresponding relationship are configured 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, and this scheme does not limit this.

作为一种可选的实施例,所述通过所述参考存储通道中的所述虚拟存储设备从具有对应关系的虚拟地址范围和存储地址范围中查询所述第一访问地址所对应的第一存储地址,包括: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 through the virtual storage device in the reference storage channel 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.

作为一种可选的实施例,所述方法还包括:As an optional embodiment, the method further includes:

在所述存储扩展装置中创建多组初始虚拟桥接设备和初始虚拟存储设备;Creating multiple groups of initial virtual bridging devices and initial virtual storage devices in the storage expansion device;

在所述初始虚拟桥接设备的协议配置空间对所述初始虚拟桥接设备进行传输协议的第二属性配置,得到所述第二虚拟桥接设备,其中,所述服务器与所述存储扩展装置是通过符合所述传输协议的协议总线连接的,所述第二属性是允许被所述服务器识别为符合所述传输协议的桥接设备的协议属性;Performing a second attribute configuration of a transmission protocol on the initial virtual bridge device in the 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 complying 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 recognized 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 recognized by the server as a storage device that complies with the storage protocol.

可选地,在本申请实施例中,服务器与存储扩展装置之间可以但不限于通过PCIe协议进行数据传输,即服务器为PCIe服务器,虚拟桥接设备用于在PCIe服务器和虚拟存储设备之间转发数据包,并且每个第二虚拟桥接设备值连接一个虚拟存储设备,因此需要在PCIe配置空间进行标准PCIe属性设置,下游设备的总线号等信息会在CPU枚举PCIe设备树时自动确定,此工作由内部总线接口的系统管理单元实施。Optionally, in an embodiment of the present application, data can be transmitted between the server and the storage expansion device through, but is not limited to, the PCIe protocol, that is, the server is a PCIe server, and the virtual bridge device is used 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 it is necessary to set standard PCIe properties 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.

可选地,在本申请实施例中,第三属性配置可以但不限于包括DID/VID及BAR空间等PCIe属性配置。Optionally, in the embodiment of the present application, the third attribute configuration may include but is not limited to PCIe attribute configurations such as DID/VID and BAR space.

可选地,在本申请实施例中,第四属性配置可以但不限于包括存储容量与队列数量等NVMe属性配置,以及缓存大小及优先级等私有属性配置。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.

作为一种可选的实施例,所述虚拟存储设备中部署了协议解析单元,所述在所述初始虚拟存储设备的传输协议配置空间对所述初始虚拟存储设备进行传输协议的第三属性配置,包括: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 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 perform data link layer protocol parsing on the received data access using the data link layer attributes, and/or, perform transaction layer protocol parsing on the received data access using the transaction layer attributes.

可选地,在本申请实施例中,数据链路层属性可以但不限于包括数据传输的速率、编码方式、帧格式等,而事务层属性包括数据传输的顺序、确认机制、错误处理等。比如,在数据链路层,采用ACK/NAK应答机制在发送端与接收端之间进行错误重传与流量控制,根据数据链路层协议进行DLLP报文处理以实现通道中的数据可靠传输,并定义不同类型报文的发送顺序以保证重要的信息得到优先响应。Optionally, in the embodiment of the present application, the data link layer attributes may include, but are not limited to, data transmission rate, encoding method, frame format, etc., while the 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 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 is responded to first.

可选地,在本申请实施例中,在数据链路层,利用TLP数据包中的总线号、设备号与功能号ID完成路由寻址,实现对配置空间内容的读写,并根据TLP包中的Address字段进行寻址,实现对存储器空间和IO空间的读写。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.

通过以上内容,通过对数据链路层属性和事务层属性的配置,可以有效地管理和控制初始虚拟存储设备的传输协议,从而实现数据的可靠传输和处理。Through the above content, by configuring the data link layer attributes and the 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.

作为一种可选的实施例,所述在所述初始虚拟存储设备的存储协议配置空间对所述初始虚拟存储设备进行存储协议的第四属性配置,包括: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:

在所述初始虚拟存储设备的存储协议配置空间对所述初始虚拟存储设备进行所述存储协议的存储容量属性的配置和队列数量属性的配置,其中,所述第四属性配置包括:所述存储容量属性和所述队列数量属性,所述存储容量属性和所述队列数量属性用于被所述服务器识别为符合所述存储协议的存储设备。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.

可选地,在本申请实施例中,存储容量属性的配置包括但不限于设置虚拟存储设备的总容量大小,以及分配给不同存储协议的容量比例等。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.

可选地,在申请实施例中,队列数量属性的配置包括但不限于设置存储协议的读写队列数量、队列深度等参数,以优化存储性能和提高并发访问能力。Optionally, in the application embodiment, the configuration of the queue quantity attribute includes but is not limited to setting the read and write queue quantity, queue depth and other parameters of the storage protocol to optimize storage performance and improve concurrent access capabilities.

通过以上内容,通过对存储协议的存储容量属性和队列数量属性进行配置,可以根据实际需求和应用场景,对虚拟存储设备进行定制化的存储协议配置,从而提高存储性能和灵活性,满足不同应用的存储需求。Through the above content, by configuring the storage capacity attributes and queue quantity attributes of the storage protocol, the virtual storage device can be customized with storage protocol configuration according to actual needs and application scenarios, thereby improving storage performance and flexibility and meeting the storage needs of different applications.

作为一种可选的实施例,所述存储扩展装置中还部署了目标总线和总线接口,所述总线接口用于将连接在所述目标总线上的多个所述存储通道连接至所述第一存储设备,所述总线接口中具有所述目标总线的总线地址空间与所述第一存储设备的存储地址空间的映射关系,其中,As an optional embodiment, a target bus and a bus interface are further deployed in the storage expansion device, and the bus interface is used to connect the multiple 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.

可选地,在本申请实施例中,总线接口为连接各个虚拟存储设备与存储设备端口的高带宽并行总线接口,带宽远大于PCIe的传输带宽,并能够以很低的延迟实现各虚拟存储设备与下游端口的数据传输。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 is much larger than the transmission bandwidth of PCIe, and can realize data transmission between each virtual storage device and the downstream port with very low latency.

作为一种可选的实施例,所述总线接口包括:总线仲裁单元和存储设备驱动单元,所述存储设备驱动单元中具有所述目标总线的总线地址空间与所述第一存储设备的存储地址空间的映射关系,其中,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 a bus address space of the target bus and a storage address space of the first storage device, wherein:

所述通过所述总线接口根据所述映射关系将所述第二数据访问转发至所述参考存储空间,包括:The step of 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, whether to process bus access of the reference storage channel according to the priority of the reference storage channel;

在确定处理所述参考存储通道的总线访问的情况下,通过所述存储设备驱动单元根据所述映射关系将所述第二数据访问转发至所述参考存储空间。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.

可选地,在本申请实施例中,对于总线仲裁单元,当多个虚拟存储设备同时访问存储设备端口时会存在总线冲突的问题。本发明中的总线仲裁单元根据每个虚拟存储设备的不同优先级设置来进行仲裁,当总线访问冲突时决定谁来优先使用内部总线,以保证服务质量。在每个虚拟存储设备的配置空间中设置专门的优先级字段,如一个8bit的寄存器就可以对应256个优先级等级,数值越小优先级越高。Optionally, in an embodiment of the present application, for a bus arbitration unit, when multiple virtual storage devices access a storage device port at the same time, there may be a bus conflict problem. The bus arbitration unit in the present invention performs arbitration according to the different priority settings of each virtual storage device, and decides who will use the internal bus first when there is a bus access conflict to ensure the quality of service. A special priority field is set in the configuration space of each virtual storage device, such as an 8-bit register that can correspond to 256 priority levels, and the smaller the value, the higher the priority.

可选地,在本申请实施例中,内部总线接口具备NVMe设备驱动模块(存储设备驱动单元),用来与NVMe存储设备的控制器进行交互,完成NVMe存储设备的初始化工作,包括BAR空间内容读取及存储容量获取、中断与DMA配置、AER等硬件属性设置、配置CQ与SQ队列等。同时,在NVMe存储设备通过内部总线接口呈现给多个vDevice(虚拟存储设备)的过程中,NVMe驱动可实现NVMe存储设备的PCIe地址空间至内部总线地址空间的映射以供vDevice访问。Optionally, in the embodiment of the present application, the internal bus interface has an NVMe device driver module (storage device driver unit) to interact with the controller of the NVMe storage device to complete the initialization of the NVMe storage device, including BAR space content reading and storage capacity acquisition, interrupt and DMA configuration, AER and other hardware attribute settings, configuration of 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.

在本实施例中,总线接口为连接各个虚拟存储设备与存储设备端口的高带宽并行总线接口,带宽远大于PCIe的传输带宽,并能够以很低的延迟实现各虚拟存储设备与下游端口的数据传输。图4是根据本申请实施例的一种可选的总线接口示意图,如图4所示存储扩展装置中包括通过扩展逻辑模块和内部总线接口模块,通道扩展逻辑模块用于和服务器端口(服务器或者服务器上部署的虚拟机)连接,通道扩展逻辑还与内部总线接口连接,内部总线接口模块和存储设备端口(第一存储设备)连接,通道扩展逻辑模块用于在存储扩展装置上创建一个或者多个允许被服务器识别为第二存储设备的存储通道,内部总线接口包括总线仲裁单元、NVMe驱动单元(存储设备驱动单元)和系统管理单元,其功能如下:In this embodiment, the bus interface is a high-bandwidth parallel bus interface that connects each virtual storage device to the storage device port, and the bandwidth 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. 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 used to connect 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 used to create one or more storage channels on the storage expansion device that are allowed to be recognized as the second storage device by the server. 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:

总线仲裁单元:当多个vDevice同时访问存储设备端口时会存在总线冲突的问题。本发明中的总线仲裁单元根据每个vDevice的不同优先级设置来进行仲裁,当总线访问冲突时决定谁来优先使用内部总线,以保证服务质量。在每个vDevice的配置空间中设置专门的优先级字段,如一个8bit的寄存器就可以对应256个优先级等级,数值越小优先级越高。Bus arbitration unit: When multiple vDevices access the storage device port at the same time, there will be a bus conflict problem. The bus arbitration unit in the present invention arbitrates according to the different priority settings of each vDevices, and decides who will use the internal bus first when there is a bus access conflict to ensure the quality of service. A special priority field is set in the configuration space of each vDevice, such as an 8-bit register that can correspond to 256 priority levels, and the smaller the value, the higher the priority.

NVMe驱动单元:在本发明中,内部总线接口具备NVMe设备驱动模块,用来与NVMe存储设备的控制器进行交互,完成NVMe存储设备的初始化工作,包括BAR空间内容读取及存储容量获取、中断与DMA配置、AER等硬件属性设置、配置CQ与SQ队列等。同时,在NVMe存储设备通过内部总线接口呈现给多个vDevice的过程中,NVMe驱动可实现NVMe存储设备的PCIe地址空间至内部总线地址空间的映射以供vDevice访问。NVMe driver unit: In the present invention, the internal bus interface is equipped with 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 BAR space content reading and storage capacity acquisition, interrupt and DMA configuration, AER and other hardware attribute settings, configuration of CQ and SQ queues, etc. At the same time, in the process of presenting the NVMe storage device 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.

系统管理单元:系统管理单元负责提供本发明的设备管理接口,实现vDevice添加与移除、vDevice存储容量配置、vDevice优先级管理、设备与运行信息上报等用户管理功能。由于vDevice全部由内部的逻辑单元实现,不涉及装置的外部接口,因此可根据应用场景灵活地修改。除了管理内部总线接口外,系统管理单元还具备接收终端用户的设定,修改整个系统包括vBridge与vDevice的参数设置、处理系统异常事件等功能,以保证系统的可靠运行。System management unit: The system management unit is responsible for providing the device management interface of the present invention, realizing user management functions such as vDevice addition and removal, vDevice storage capacity configuration, vDevice priority management, and device and operation information reporting. Since vDevice is entirely implemented by internal logic units and does not involve the external interface of the device, it can be flexibly modified according to the application scenario. In addition to managing the internal bus interface, the system management unit also has the functions of receiving terminal user settings, modifying the parameter settings of the entire system including vBridge and vDevice, and handling system abnormal events to ensure the reliable operation of the system.

作为一种可选的实施例,在所述控制所述第一存储设备的所述参考存储空间执行所述第二数据访问之后,所述方法还包括: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:

接收所述参考存储空间响应所述第二数据访问返回的访问结果信息;receiving access result information returned by the reference storage space in response to the second data access;

将所述访问结果信息转发至所述参考存储通道;forwarding the access result information to the reference storage channel;

通过所述参考存储通道将所述访问结果信息发送至所述服务器。The access result information is sent to the server through the reference storage channel.

可选地,在本申请实施例中,参考存储空间响应第二数据访问返回的访问结果信息可以但不限与包括从参考存储空间中读取的数据,或者还可以是将待写入参考存储空间的数据协议参考存储空间后返回的写入结果,本方案对此不做限定。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.

可选地,在本申请实施例中,参考存储通道中可以但不限与保存了第二数据访问与服务器上发起数据访问的虚拟机的映射关系,进而参考存储通道根据该映射关系找到该访问结果信息对应的目标虚拟机,进而将访问结果反馈给服务器上的目标虚拟机。Optionally, in an embodiment of the present application, the reference storage channel may include but is not limited to a mapping relationship between 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.

可选地,在申请实施例中,存储扩展装置中可以但不限于为每个参考存储通道配置了对应的数据缓存空间,用于对参考存储通道中的数据进行缓存,进而,当参考存储通道在接收到访问结果信息时与服务器之间的数据传输链路处于占用状态的情况下,可以将访问结果信息在数据缓存空间中进行临时存储。Optionally, in an embodiment of the application, the storage expansion device may, but is not limited to, configure 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 access result information, the access result information can be temporarily stored in the data cache space.

作为一种可选的实施例,所述将所述访问结果信息转发至所述参考存储通道,包括:As an optional embodiment, forwarding the access result information to the reference storage channel includes:

从所述访问结果信息中提取源地址,得到所述参考存储空间;Extracting the source address from the access result information to obtain the reference storage space;

从所述存储扩展装置中建立的存储通道中确定所述参考存储空间所对应的所述参考存储通道;Determining the reference storage channel corresponding to the reference storage space from the storage channels established in the storage expansion device;

向所述参考存储通道发送所述访问结果信息。The access result information is sent to the reference storage channel.

可选地,在本申请实施例中,参考存储通道可以但不限于是存储扩展装置根据存储的参考存储空间和存储通道的映射关系从一个或者多个存储通道中确定出来的,本方案对此不做限定。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.

作为一种可选的实施例,所述通过所述参考存储通道将所述访问结果信息发送至所述服务器,包括:As an optional embodiment, sending the access result information to the server through the reference storage channel includes:

将所述访问结果信息中的源地址从所述参考存储空间替换为所述参考存储设备,得到参考访问结果信息;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;

向所述服务器发送所述参考访问结果信息。The reference access result information is sent to the server.

作为一种可选的实施例,As an optional embodiment,

所述方法还包括以下之一:The method further comprises one of the following:

根据所述存储扩展装置上的资源信息,确定所述存储扩展装置中建立的存储通道的通道数量;Determining the number of storage channels established in the storage expansion device according to resource information on the storage expansion device;

根据所述存储扩展装置上的资源信息和所述第一存储设备的设备信息,确定所述存储扩展装置中建立的存储通道的通道数量;Determining the number of 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;

根据所述存储扩展装置上的资源信息,所述第一存储设备的设备信息,以及所述服务器上所部署的虚拟机的虚拟机信息,确定所述存储扩展装置中建立的存储通道的通道数量。The number of channels 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.

可选地,在本申请实施例中,存储扩展装置中的存储通道的数量可以根据需求灵活配置。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.

可选地,在本申请实施例中,存储扩展装置上的资源信息可以但不限于是存储资源的可利用空间容量,或者对存储资源按照目标粒度进行划分得到的多个候选存储空间的数量,每个候选存储空间对应一个存储通道。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.

可选地,在本申请实施例中,虚拟机信息可以但不限与包括当前服务器上部署的虚拟机总量、服务器上当前存储数据访问需求的虚拟机数量,本方案对此不做限定。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 limitation on this.

作为一种可选的实施例,所述根据所述存储扩展装置上的资源信息和所述第一存储设备的设备信息,确定所述存储扩展装置中建立的存储通道的通道数量,包括:As an optional embodiment, determining the number of channels 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 includes:

检测与所述第一存储设备的连接;detecting a connection with the first storage device;

在检测到已连接至所述第一存储设备的情况下,加载存储设备驱动;When it is detected that the storage device is connected to the first storage device, loading a storage device driver;

通过所述存储设备驱动从所述第一存储设备上获取所述设备信息;Acquire the device information from the first storage device through the storage device driver;

根据所述存储扩展装置上的资源信息和所述第一存储设备的设备信息,确定所述一个或者多个存储通道的通道数量。The channel quantity of the 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.

本申请存储扩展装置,由服务器端口、通道扩展逻辑、内部总线接口、存储设备端口共四部分组成,图5是根据本申请实施例的一种可选的存储设备连接系统架构图,如图5所示,存储扩展装置包括服务器端口、通道扩展逻辑、内部总线接口、PCIe下游端口四部分,其功能如下: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 optional storage device connection system architecture diagram 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:

1.服务器端口:1. Server Port:

服务器端口是本发明所述的NVMe扩展装置与服务器CPU之间的硬件接口,负责与CPU的PCIe Root Complex之间建立物理连接。服务器端口包含PCIe物理层的电气属性与逻辑属性,可完成收发器、时钟、复位、等信号的传输与电源供给,实施串并转换、链路训练等功能,形态上可以为连接器、金手指,线缆等形式。The server port is the hardware interface between the NVMe expansion device and the server CPU described in the present invention, and is responsible for establishing a physical connection with the PCIe Root Complex of the CPU. The server port contains the electrical and logical properties of the PCIe physical layer, can complete the transmission and power supply of transceiver, clock, reset, and other signals, implement serial-to-parallel conversion, link training and other functions, and can be in the form of connectors, gold fingers, cables, etc.

2.存储设备端口:2. Storage device port:

存储设备端口是本发明所述的NVMe扩展装置与NVMe存储设备之间的硬件接口,负责与NVMe存储设备之间建立连接。与服务器端口一样,存储设备端口包含PCIe协议中物理层中的电气与逻辑属性,能进行收发器、时钟、复位、等信号的传输与电源供给,并完成串并转换、链路训练等功能,形态上可以为连接器、金手指,线缆等形式。The storage device port is the hardware interface between the NVMe expansion device and the NVMe storage device described in the present invention, and is responsible for establishing a connection with the NVMe storage device. Like the server port, the storage device port contains the electrical and logical properties of the physical layer in the PCIe protocol, can transmit and supply power to the transceiver, clock, reset, and other signals, and complete serial-to-parallel conversion, link training and other functions, and can be in the form of a connector, gold finger, cable, etc.

3.通道扩展逻辑:3. Channel expansion logic:

通道扩展逻辑是本发明的重要部分,负责在NVMe扩展装置内部动态创建多个虚拟PCIe设备(vEP),它们主要是由虚拟PCIe Bridge(vBridge)与虚拟PCIe设备(vDevice)所构成。通道扩展逻辑通过内部总线与所述的存储设备端口相连。对于服务器来说,这些vDevice与其它物理PCIe设备的属性相同,虚拟机管理软件(VMM)可以很容易的将它们分配给各虚拟机(VM)使用。对于下游NVMe存储设备来说,所述的NVMe扩展装置体现为一个NVMe主控设备,可以对NVMe存储设备进行读写与擦除等操作。通道扩展逻辑在内部分为上行与下行通道。下行通道的数据方向为CPU至NVMe设备方向,上行通道的数据方向为NVMe设备至CPU方向。The channel extension logic is an important part of the present invention, which is responsible for dynamically creating multiple virtual PCIe devices (vEP) inside the NVMe extension device, which 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) can easily allocate them to each virtual machine (VM) for use. For the downstream NVMe storage device, 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.

图6是根据本申请实施例的一种可选的存储扩展装置运行流程图,如图6所示,至少包括如下步骤:FIG. 6 is a flowchart of an optional storage expansion device operation according to an embodiment of the present application. As shown in FIG. 6 , the operation flow chart at least includes the following steps:

S601,内部总线接口配置。通过下游PCIe端口枚举与管理NVMe存储设备(第一存储设别),加载驱动,获取设备信息。如PCIe位宽与速度等级、存储容量等,为后续vDevice的数量与容量参数配置提供信息。S601, internal bus interface configuration. Enumerate and manage NVMe storage devices (first storage device) through downstream PCIe ports, load drivers, 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.

S602,vDevice(虚拟存储设备)配置。内容包括DID/VID及BAR空间等PCIe属性配置,存储容量与队列数量等NVMe属性配置,以及缓存大小及优先级等私有属性配置。此工作由内部总线接口的系统管理单元实施。S602, vDevice (virtual storage device) configuration. The content 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.

S603,vBridge(虚拟桥接设备,包括第一虚拟桥接设备和第二虚拟桥接设备)配置。本发明中vBridge用于在PCIe RC与vDevice之间转发数据包,且每个vBridge只连接一个vDevice下游设备,因此需在PCIe配置空间进行标准PCIe属性设置,下游设备的总线号等信息会在CPU枚举PCIe设备树时自动确定。此工作由内部总线接口的系统管理单元实施。S603, vBridge (virtual bridge device, including the first virtual bridge device and the second virtual bridge device) configuration. In the present invention, vBridge is used to forward data packets between PCIe RC and vDevice, and each vBridge is only connected to one vDevice downstream device, so standard PCIe attribute settings need to be performed in the PCIe configuration space, and the bus number and other information 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.

S604,启动服务器OS,枚举PCIe总线设备,可成功枚举到N个Endpoint(vDevice)与N+1个Bridge(vBridge)设备。S604, start the server OS, enumerate the PCIe bus devices, and successfully enumerate N Endpoint (vDevice) and N+1 Bridge (vBridge) devices.

S605,服务器加载NVMe标准驱动,进一步识别到N个NVMe设备。在虚拟机管理器(VMM)的作用下,将N个NVMe设备分配给多个虚拟机。S605, the server loads the NVMe standard driver, further identifies N NVMe devices, and allocates the N NVMe devices to multiple virtual machines under the action of a virtual machine manager (VMM).

S606,每个虚拟机上的应用程序进行存储设备访问,经过 PCIe上游端口<->VBridge <->VDevice<->内部总线接口<->PCIe下游端口<->NVMe存储设备 数据通道最终访问到实体NVMe存储设备。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.

图7是根据本申请实施例的一种可选的存储设备访问流程图,如图7所示,至少包括如下步骤:FIG. 7 is an optional storage device access flow chart according to an embodiment of the present application. As shown in FIG. 7 , the flow chart at least includes the following steps:

S701,通道扩展逻辑初始化vDevice(虚拟存储设备),vBridge (虚拟桥接设备,包括第一虚拟桥接设备和第二虚拟桥接设备)配置。CPU枚举PCIe设备树,识别到N个虚拟vDevice设备,并由VMM分配给各虚拟机。S701, the channel extension 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 vDevice devices, and allocates them to each virtual machine by the VMM.

S702,某虚拟机发起对其所属的vDevice的读写请求。CPU的PCIe RC根据所访问的地址范围,将请求发送至本发明中的上游端口。S702, a virtual machine initiates a read/write request to the vDevice to which it belongs. The PCIe RC of the CPU sends the request to the upstream port in the present invention according to the accessed address range.

S703,经过上游端口导入后,数据包经vBridge协议解析,根据PCIe ID号或地址空间范围转发至对应vDevice。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.

S704,在vDevice中依次进行PICe与NVMe协议的解析,再经过地址映射环节,将对vDevice的地址访问转换为对内部总线地址的访问。S704, PICe and NVMe protocols are parsed in the vDevice in turn, and then the address access to the vDevice is converted into the access to the internal bus address through the address mapping link.

S705,vDevice经总线仲裁获得总线使用权后,在NVMe驱动的协助下,将内部总线地址访问转换成对下游物理NVMe存储设备的读写访问,并发送至PCIe下游端口。S705, after the vDevice obtains the right to use the bus through bus arbitration, it converts the internal bus address access into a read/write access to the downstream physical NVMe storage device with the assistance of the NVMe driver, and sends it to the PCIe downstream port.

S706,经PCIe下游端口,访问请求被发送至NVMe 存储设备并处理。返回数据依次反向经过上述环节传递回CPU。S706, the access request is sent to the NVMe storage device via the PCIe downstream port and processed. The returned data is transmitted back to the CPU in reverse order through the above links.

在本实施例中,通过引入本发明的NVMe存储设备扩展装置,使普通的NVMe SSD具备了硬件支持的类虚拟化功能,由FPGA中的通道扩展逻辑实现了协议解析、设备管理与地址映射等关键环节,解决了SR-IOV等传统虚拟化技术的复杂配置过程所带来的兼容性问题。In this embodiment, by introducing the NVMe storage device expansion device of the present invention, an ordinary NVMe SSD is equipped with a hardware-supported class virtualization function, and the key links such as protocol parsing, device management and address mapping are implemented by the channel expansion logic in the FPGA, thereby solving the compatibility problems caused by the complex configuration process of traditional virtualization technologies such as SR-IOV.

本申请实施例可以但不限于应用于对NVMe存储设备的扩展,通过在链路中增加一个NVMe通道扩展装置,实现单一NVMe存储设备可呈现给CPU多个虚拟NVMe设备。区别与现有的软件虚拟化方案与硬件PCIe Swich扩展方案,本发明同时具备硬件扩展方案的高效率与软件虚拟化方案的高灵活性。The embodiments of the present application can be applied to, but not limited to, the expansion of NVMe storage devices. By adding an NVMe channel expansion device in the link, a single NVMe storage device can be presented to the CPU as multiple virtual NVMe devices. Different from the existing software virtualization solutions and hardware PCIe Switch expansion solutions, the present invention has both the high efficiency of hardware expansion solutions and the high flexibility of software virtualization solutions.

NVMe通道扩展装置包含一个PCIe上游端口、一个PCIe下游端口、一个通道扩展逻辑与一个内部总线接口单元。The NVMe channel expansion device includes a PCIe upstream port, a PCIe downstream port, a channel expansion logic and an internal bus interface unit.

PCIe上游端口是本装置与服务器之间的硬件接口,负责与服务器CPU的PCIe RC之间建立物理连接;The PCIe upstream port is the hardware interface between the device and the server, responsible for establishing a physical connection with the PCIe RC of the server CPU;

PCIe下游端口是本装置与NVMe存储设备之间的硬件接口,负责与NVMe存储设备之间建立物理连接。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.

通道扩展逻辑通过创建多个PCIe桥设备(vBridge)与Endpoint设备(vDevice),完成各自的PCIe链路层与事务层的协议解析与转发,实现PCIe通道的扩展功能。The channel extension logic creates multiple PCIe bridge devices (vBridge) and Endpoint devices (vDevice) to complete the protocol parsing and forwarding of the respective PCIe link layer and transaction layer, thereby realizing the expansion function of the PCIe channel.

内部总线接口单元完成PCIe寻址空间与NVMe存储空间之间的地址映射, 实现多个扩展PCIe设备(vDevice)与NVMe存储设备间的多通道访问。The internal bus interface unit completes the address mapping between the PCIe addressing space and the NVMe storage space, and implements multi-channel access between multiple extended PCIe devices (vDevice) and NVMe storage devices.

所述的PCIe上游端口与PCIe下游端口具备PCIe物理层的电气与逻辑功能,能进行收发器、时钟、复位、等信号的传输与电源供给,完成串并转换、链路训练等功能,形态上可以为连接器、金手指,线缆等形式。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.

所述的vBridge与vDevice能够实现PCIe数据链路层与事务层的协议解析与数据转发,不实现物理层、一致性测试、电源管理等非核心环节,节省硬件与逻辑资源,降低整体链路延迟。The vBridge and vDevice described can implement protocol parsing and data forwarding of the PCIe data link layer and transaction layer, and do not implement non-core links such as the physical layer, consistency testing, and power management, thereby saving hardware and logic resources and reducing overall link latency.

所述的vBridge与vDevice,其数量可通过本发明中的系统管理单元进行灵活调整。The number of the vBridges and vDevice can be flexibly adjusted by the system management unit in the present invention.

所述的内部总线接口单元由总线总裁、NVMe驱动、系统管理三个单元组成。The internal bus interface unit is composed of three units: bus president, NVMe driver, and system management.

总线仲裁单元实现多个vDevice与一个NVMe存储设备通信时基于优先级的总线仲裁机制。The bus arbitration unit implements a priority-based bus arbitration mechanism when multiple vDevices communicate with one NVMe storage device.

NVMe驱动单元实现了内部总线空间与NVMe存储空间的地址转换与访问控制。The NVMe driver unit implements address conversion and access control between the internal bus space and the NVMe storage space.

系统管理单元实现了通道扩展能力配置、运行信息上报、异常处理等管理功能。The system management unit implements management functions such as channel expansion capability configuration, operation information reporting, and exception handling.

在本实施例中还提供了一种存储扩展装置,图8是根据本申请实施例的一种可选的存储扩展装置结构图,如图8所示,包括:In this embodiment, a storage expansion device is also provided. FIG. 8 is a structural diagram of an optional storage expansion device according to an embodiment of the present application. As shown in FIG. 8 , the storage expansion device includes:

服务器端口,处理芯片和存储设备端口,其中,所述服务器端口与所述处理芯片连接,所述处理芯片与所述存储设备端口连接,所述处理芯片中建立了一个或者多个存储通道,A server port, a processing chip and a storage device port, wherein the server port is connected to the processing chip, the processing chip is connected to the storage device port, and one or more storage channels are established in the processing chip.

所述服务器端口,用于连接服务器,其中,所述服务器上部署了一个或者多个虚拟机,所述一个或者多个存储通道允许被所述服务器识别为一个或者多个第二存储设备,所述一个或者多个第二存储设备在所述服务器上被分配给所述服务器上部署的虚拟机;The server port is used 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 used to connect to a first storage device, wherein the storage channel is allocated a corresponding storage space on the first storage device;

所述处理芯片用于实现前述存储设备的访问方法的步骤。The processing chip is used to implement the steps of the aforementioned storage device access method.

通过以上内容,在服务器和服务器部署的第一存储设备之间部署了存储扩展装置,该存储扩展装置建立的一个或者多个存储通道,该一个或者多个存储通道允许被服务器识别为一个或者多个第二存储设备,并分配给服务器上部署的虚拟机使用,从而实现在虚拟机侧能够认为每个虚拟机都连接有一个第二存储设备,进而,在存储扩展装置接收到服务器上参考虚拟机发送的数据访问请求后,通过一个或者多个存储通道中被识别为参考存储设备的为参考存储通道,将对参考存储设备的数据访问转换对第一存储设备中参考存储通道对应的存储空间的数据访问,从而实现只需要连接一个存储设备就可以为服务器上的多个虚拟机提供服务,实现了在不更改服务器对存储设备的使用逻辑和无需新增存储设备的前提下,实现对服务连接的存储设备的扩展,并且对于服务器来说仍然是每个虚拟机都提供一个独立的存储设备,使得对存储设备的扩展性能更高,通用性更强,同时更加灵活可靠。可以解决相关技术中对服务器连接的存储设备进行扩展时存储设备扩展效率较低的问题,达到提高对服务器连接的存储设备进行扩展时存储设备扩展效率的效果。Through the above content, a storage expansion device is deployed between the server and the first storage device deployed on the server, and one or more storage channels established by the storage expansion device 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 each virtual machine can be considered to be connected to a second storage device on the virtual machine side, and then, after the storage expansion device receives the data access request sent by the reference virtual machine on the server, the data access to the reference storage device is converted into the 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, so that only one storage device needs to be connected to provide services for multiple virtual machines on the server, and the expansion of the storage device connected to the service is realized without changing the server's storage device usage logic and without adding new storage devices, and for the server, each virtual machine is still provided with an independent storage device, so that the expansion performance of the storage device is higher, the versatility is stronger, and it is more flexible and reliable. It 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.

作为一种可选的实施例,所述处理芯片中部署了第一虚拟桥接设备,所述第一虚拟桥接设备与所述一个或者多个存储通道连接,所述第一虚拟桥接设备还用于连接所述服务器端口,并被所述服务器识别为连接了所述第二存储设备,所述第一虚拟桥接设备上记录了具有对应关系的所述第二存储设备和存储通道,其中,As an optional embodiment, a first virtual bridge device is deployed in the processing chip, the first virtual bridge device is connected to the one or more storage channels, the first virtual bridge device is also used 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 used to search for a reference storage channel corresponding to a reference storage device from the second storage devices and storage channels having a corresponding relationship when receiving a first data access, 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.

作为一种可选的实施例,所述存储通道包括第二虚拟桥接设备和虚拟存储设备,所述第二虚拟桥接设备和所述第一虚拟桥接设备连接,所述第二虚拟桥接设备和所述虚拟存储设备连接,所述虚拟存储设备和所述第一存储设备连接,其中,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,

所述第二虚拟桥接设备,用于在接收到所述第一数据访问的情况下,将所述第一数据访问转发至所述第二虚拟桥接设备连接的所述虚拟存储设备;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 used to convert the first data access into a second data access for accessing the storage space corresponding to the reference storage channel in the first storage device.

可选地,在本申请实施例中,处理芯片中部署了数据存储资源,用于对虚拟存储设备需要在第一存储设备中访问的数据进行临时存储,对于存储扩展装置中建立的一个或者多个存储通道而言,处理芯片需要根据存储通道的创建数量对数据存储资源进行分配,在分配时可以按照各个存储通道的资源需求进行分配,或者还可以对数据存储资源按照存储通道的创建数量进行均分,本方案对此不做限定。Optionally, in an embodiment of the present application, data storage resources are deployed in the processing chip 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 chip needs to allocate data storage resources based on the number of storage channels created. When allocating, the data storage 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.

作为一种可选的实施例,所述存储扩展装置中还部署了外接存储设备,所述外接存储设备与所述虚拟存储设备连接,其中,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:

所述外接存储设备,用于对所述虚拟存储设备在所述第一存储设备中所要访问的数据进行缓存。The external storage device is used to cache the data that the virtual storage device is to access in the first storage device.

可选地,在本申请实施例中,外接存储设备用于在处理芯片的数据存储资源不够用时,为存储通道提供数据存储服务,可以为每个存储通道配置一个外接存储设备,或者还可以将多个存储通道连接在一个共用的外接存储设备上,使用该外接存储设备对全部存储通道提供数据存储服务。Optionally, in an embodiment of the present application, an external storage device is used to provide data storage services for storage channels when the data storage resources of the processing chip 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 is used to provide data storage services for all storage channels.

作为一种可选的实施例,所述处理芯片中还部署了目标处理器,所述目标处理器通过内部高速总线和所述一个或者多个存储通道连接,所述目标处理器还和所述存储设备端口连接,其中,As an optional embodiment, a target processor is also deployed in the processing chip, and the target processor is connected to the one or more storage channels through an internal high-speed bus, and the target processor is also connected to the storage device port, wherein:

所述目标处理器,用于响应所述存储通道传输的数据访问请求,对所述第一存储设备进行存储控制和数据访问。The target processor is used to respond to the data access request transmitted by the storage channel and perform storage control and data access on the first storage device.

可选地,在本申请实施例中,存储扩展装置可以但不限于配置有与目标处理器连接的存储设备,如DDR存储器,DDR的支持下运行Linux操作系统,在标准NVMe的驱动下实现对NVMe存储设备的管理与访问。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 a DDR memory, running a Linux operating system with the support of DDR, and implementing management and access to the NVMe storage device under the driver of a standard NVMe.

本申请处理芯片可以但不限于通过一张PCIe Add-in卡形态的FPGA加速器实现了NVMe存储设备的虚拟化。它包含两个PCIe端口,本实施例中将一个配置成PCIe EndPoint接口(服务器端口),以金手指连接服务器CPU;另一个PCIe端口配置成PCIe RC接口(存储设备端口),通过一个MCIO连接器连接下游的NVMe存储设备。在FPGA(处理芯片)的IP中实现了本发明中的PCIe通道扩展逻辑,并通过NVMe驱动IP实现了对NVMe存储设备的管理与访问。图9是根据本申请实施例的一种可选的存储扩展装置结构框图,如图9所示,PCIe上游端口(服务器端口)为PCIe金手指形态,用于插入服务器的PCIe插槽,连接器CPU的PCIeRC接口。PCIe下游端口(存储设备端口)为一个MCIO形态的高速连接器,可通过线缆连接一个NVMe SSD。在通道扩展逻辑中根据FPGA的资源情况,一共设置了16个vBridge(第二虚拟桥接设备)以及对应的vDevice,它们共享了一块下游端口所连接的8TB的NVMe存储设备(第一存储设备),每个vDevice(虚拟存储设备)平均分配到512GB容量。在虚拟机管理器(VMM)的支持下,将16个vDevice(虚拟存储设备)分配给了16个不同的虚拟机,用于存储频繁变化且对安全性要求相对较低的用户数据。在FPGA内部除了包含逻辑单元(PL侧)之外,还包含以四核ARMA53处理器为核心的处理器单元(PS侧)。PS侧在外部DDR的支持下运行Linux操作系统,在标准NVMe的驱动下实现对NVMe存储设备的管理与访问。PL侧也配置了8GB的外部DDR,当FPGA内部的SRAM资源不够时可用作vDevice的数据缓存。系统管理功能是通过SMBUS总线实现的。通过SMBUS总线,存储虚拟化设备可以接收来自服务器的带外指令,实现虚拟机数量设置、vDevice优先级设置、数据缓存调整、虚拟容量分配等系统性能设置,也可以实现整个装置的功耗、温度等设备信息读取,以及系统复位与上下电等操作。The processing chip 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 card. It includes two PCIe ports. In this embodiment, one is configured as a PCIe EndPoint interface (server port) to connect the server CPU with a gold finger; the other PCIe port is configured as a PCIe RC interface (storage device port) to connect the downstream NVMe storage device through an MCIO connector. The PCIe channel expansion logic in the present invention is implemented in the IP of the FPGA (processing chip), and the management and access to the NVMe storage device are realized through the NVMe driver IP. Figure 9 is a structural block diagram 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 used to insert the PCIe slot of the server and the PCIeRC interface of the connector CPU. The PCIe downstream port (storage device port) is a high-speed connector in the form of an MCIO, which can be connected to an NVMe SSD via a cable. In the channel expansion logic, according to the FPGA resources, a total of 16 vBridges (second virtual bridge devices) and corresponding vDevices are set up. They share an 8TB NVMe storage device (first storage device) connected to the downstream port, and each vDevice (virtual storage device) is allocated an average of 512GB. With the support of the virtual machine manager (VMM), 16 vDevices (virtual storage devices) are allocated to 16 different virtual machines to store user data that changes frequently and has relatively low security requirements. In addition to the logic unit (PL side), the FPGA also contains a processor unit (PS side) with a quad-core ARMA53 processor as the core. The PS side runs the Linux operating system with the support of external DDR and manages and accesses the NVMe storage device under the standard NVMe driver. The PL side is also configured with 8GB of external DDR, which can be used as a data cache for vDevice when the SRAM resources inside the FPGA are insufficient. The system management function is implemented through the SMBUS 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 adjustments, virtual capacity allocation, etc. It can also read device information such as power consumption and temperature of the entire device, as well as perform operations such as system reset and power on and off.

通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。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 a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, disk, CD), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.

在本实施例中还提供了一种存储设备的访问装置,该装置用于实现上述实施例及优选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。In this embodiment, a storage device access device is also provided, which is used to implement the above embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and/or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

图10是根据本申请实施例的存储设备的访问装置的结构框图,如图10所示,FIG. 10 is a structural block diagram of an access device for a storage device according to an embodiment of the present application. As shown in FIG. 10 ,

应用于存储扩展装置,所述存储扩展装置连接在第一存储设备与服务器之间,所述服务器上部署了一个或者多个虚拟机,所述存储扩展装置中建立了一个或者多个允许被所述服务器识别为第二存储设备的存储通道,所述第二存储设备被分配给所述服务器上部署的虚拟机,所述存储通道在所述第一存储设备上被分配了对应的存储空间,所述装置包括: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 that are allowed to be identified as second storage devices by the server are established in the storage expansion device, 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 comprises:

接收模块1002,用于接收参考虚拟机发送的数据访问请求,其中,所述一个或者多个虚拟机包括所述参考虚拟机,所述数据访问请求用于请求对所述第二存储设备中被分配给所述参考虚拟机的参考存储设备进行第一数据访问;A receiving module 1002 is 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;

转换模块1004,用于响应所述数据访问请求,通过参考存储通道将所述第一数据访问转换为第二数据访问,其中,所述参考存储通道是所述存储扩展装置中建立的存储通道中被识别为所述参考存储设备的存储通道,所述第二数据访问是对所述第一存储设备中与所述参考存储通道对应的参考存储空间的数据访问;a conversion module 1004, configured to respond to the data access request and 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 in 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;

控制模块1006,用于控制所述第一存储设备的所述参考存储空间执行所述第二数据访问。The control module 1006 is used to control the reference storage space of the first storage device to perform the second data access.

通过以上内容,在服务器和服务器部署的第一存储设备之间部署了存储扩展装置,该存储扩展装置建立的一个或者多个存储通道,该一个或者多个存储通道允许被服务器识别为一个或者多个第二存储设备,并分配给服务器上部署的虚拟机使用,从而实现在虚拟机侧能够认为每个虚拟机都连接有一个第二存储设备,进而,在存储扩展装置接收到服务器上参考虚拟机发送的数据访问请求后,通过一个或者多个存储通道中被识别为参考存储设备的为参考存储通道,将对参考存储设备的数据访问转换对第一存储设备中参考存储通道对应的存储空间的数据访问,从而实现只需要连接一个存储设备就可以为服务器上的多个虚拟机提供服务,实现了在不更改服务器对存储设备的使用逻辑和无需新增存储设备的前提下,实现对服务连接的存储设备的扩展,并且对于服务器来说仍然是每个虚拟机都提供一个独立的存储设备,使得对存储设备的扩展性能更高,通用性更强,同时更加灵活可靠。可以解决相关技术中对服务器连接的存储设备进行扩展时存储设备扩展效率较低的问题,达到提高对服务器连接的存储设备进行扩展时存储设备扩展效率的效果。Through the above content, a storage expansion device is deployed between the server and the first storage device deployed on the server, and one or more storage channels established by the storage expansion device 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 each virtual machine can be considered to be connected to a second storage device on the virtual machine side, and then, after the storage expansion device receives the data access request sent by the reference virtual machine on the server, the data access to the reference storage device is converted into the 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, so that only one storage device needs to be connected to provide services for multiple virtual machines on the server, and the expansion of the storage device connected to the service is realized without changing the server's storage device usage logic and without adding new storage devices, and for the server, each virtual machine is still provided with an independent storage device, so that the expansion performance of the storage device is higher, the versatility is stronger, and it is more flexible and reliable. It 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.

可选的,所述转换模块,包括:Optionally, the conversion module includes:

第一确定单元,用于从所述存储扩展装置中建立的存储通道中确定被识别为所述参考存储设备的参考存储通道;A first determining unit, configured to determine a reference storage channel identified as the reference storage device from the storage channels established in the storage expansion device;

转发单元,用于将所述第一数据访问转发至所述参考存储通道;a forwarding unit, configured to forward the first data access to the reference storage channel;

第一转换单元,用于通过所述参考存储通道将所述第一数据访问转换为所述第二数据访问。A first conversion unit is configured to convert the first data access into the second data access through the reference storage channel.

可选的,所述存储扩展装置中还部署了第一虚拟桥接设备 ,所述第一虚拟桥接设备与所述存储扩展装置中建立的存储通道连接,所述第一虚拟桥接设备还用于连接所述服务器并被所述服务器识别为连接了所述存储扩展装置中建立的第二存储设备,所述第一虚拟桥接设备上记录了具有对应关系的第二存储设备和存储通道,其中,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 also used 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, and the first virtual bridge device records the second storage device and the storage channel having a corresponding relationship, wherein,

所述第一确定单元,用于:通过所述第一虚拟桥接设备从具有对应关系的第二存储设备和存储通道中查找所述参考存储设备所对应的所述参考存储通道;The first determining unit is configured to: search, through the first virtual bridge device, for the reference storage channel corresponding to the reference storage device from second storage devices and 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.

可选的,所述第一确定单元,用于:Optionally, the first determining unit is configured to:

通过所述第一虚拟桥接设备从所述数据访问请求中提取所述参考存储设备的参考设备标识;extracting a reference device identifier of the reference storage device from the data access request through the first virtual bridge device;

通过所述第一虚拟桥接设备从具有对应关系的存储设备标识和存储通道中查找所述参考设备标识所对应的所述参考存储通道,其中,所述存储设备标识是被分配给对应的存储通道的允许被识别为存储设备的设备标识。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.

可选的,所述装置还包括:Optionally, the device further comprises:

第一创建模块,用于在所述存储扩展装置中创建初始的虚拟桥接设备;A first creation module, used for creating an initial virtual bridge device in the storage expansion device;

第一配置模块,用于在所述初始的虚拟桥接设备的协议配置空间对所述初始的虚拟桥接设备进行传输协议的第一属性配置,得到所述第一虚拟桥接设备,其中,所述服务器与所述存储扩展装置是通过符合所述传输协议的协议总线连接的,所述第一属性是允许被所述服务器识别为符合所述传输协议的桥接设备的协议属性;A first configuration module is used to configure 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 complying with the transmission protocol;

处理模块,用于建立所述第一虚拟桥接设备与所述存储扩展装置中建立的存储通道之间的连接,并记录具有对应关系的第二存储设备和存储通道。The processing module is used to establish a connection between the first virtual bridge device and the storage channel established in the storage expansion device, and record the second storage device and the storage channel having a corresponding relationship.

可选的,所述存储通道包括第二虚拟桥接设备 和虚拟存储设备 ,所述第一虚拟桥接设备与所述第二虚拟桥接设备连接,所述第二虚拟桥接设备与所述虚拟存储设备连接,所述虚拟存储设备用于连接所述第一存储设备,其中,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 used to connect to the first storage device, wherein,

所述转换模块,包括:The conversion module comprises:

第一接收单元,用于通过所述参考存储通道中的所述第二虚拟桥接设备接收所述第一数据访问;A first receiving unit, configured to receive the first data access through the second virtual bridge device in the reference storage channel;

传输单元,用于通过所述参考存储通道中的所述第二虚拟桥接设备将所述第一数据访问传输至所述参考存储通道中的所述虚拟存储设备;a transmission unit, configured to transmit 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;

第二转换单元,用于通过所述参考存储通道中的所述虚拟存储设备将所述第一数据访问转换为所述第二数据访问。A second conversion unit is configured to convert the first data access into the second data access through the virtual storage device in the reference storage channel.

可选的,所述第二转换单元,用于:Optionally, the second conversion unit is used to:

通过所述参考存储通道中的所述虚拟存储设备获取所述第一数据访问所指示访问的第一访问地址,其中,所述第一访问地址是所述参考虚拟机指示访问的所述参考存储设备的虚拟地址;Acquire, 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 having 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 a 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.

可选的,所述第二转换单元,用于:Optionally, the second conversion unit is used to:

通过所述参考存储通道中的所述虚拟存储设备从所述参考存储设备的传输协议的寻址空间与所述第一存储设备的存储协议的存储空间之间的地址映射中查询所述第一访问地址所映射的所述第一存储地址,其中,所述参考存储设备被所述服务器识别为符合所述传输协议的设备,所述虚拟地址范围包括所述传输协议的寻址空间,所述第一存储设备为所述存储协议的存储设备,所述存储地址范围包括所述存储协议的存储空间。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.

可选的,所述装置还包括:Optionally, the device further comprises:

第二创建模块,用于在所述存储扩展装置中创建多组初始虚拟桥接设备和初始虚拟存储设备;A second creation module, used for creating multiple groups of initial virtual bridging devices and initial virtual storage devices in the storage expansion device;

第二配置模块,用于在所述初始虚拟桥接设备的协议配置空间对所述初始虚拟桥接设备进行传输协议的第二属性配置,得到所述第二虚拟桥接设备,其中,所述服务器与所述存储扩展装置是通过符合所述传输协议的协议总线连接的,所述第二属性是允许被所述服务器识别为符合所述传输协议的桥接设备的协议属性;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 the second virtual bridge device, wherein the server and the storage expansion device are connected via a protocol bus conforming to the transmission protocol, and the second attribute is a protocol attribute that allows the server to identify the bridge device as conforming to the transmission protocol;

第三配置模块,用于在所述初始虚拟存储设备的传输协议配置空间对所述初始虚拟存储设备进行传输协议的第三属性配置,并在所述初始虚拟存储设备的存储协议配置空间对所述初始虚拟存储设备进行存储协议的第四属性配置,得到所述虚拟存储设备,其中,所述第一存储设备是符合所述存储协议的存储设备,所述第三属性是允许被所述服务器识别为符合所述传输协议的终端设备的协议属性,所述第四属性是允许被所述服务器识别为符合所述存储协议的存储设备的协议属性。A third configuration module is used 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, so as 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 the server to identify it as a terminal device that complies with the transmission protocol, and the fourth attribute is a protocol attribute that allows the server to identify it as a storage device that complies with the storage protocol.

可选的,所述虚拟存储设备中部署了协议解析单元,所述第三配置模块,包括:Optionally, a protocol parsing unit is deployed in the virtual storage device, and the third configuration module includes:

配置单元,用于在所述初始虚拟存储设备的传输协议配置空间对所述初始虚拟存储设备进行所述传输协议的数据链路层属性的配置和事务层属性的配置,其中,所述第三属性配置包括:所述数据链路层属性和所述事务层属性,所述协议解析单元用于使用所述数据链路层属性对接收到的数据访问进行数据链路层的协议解析,和/或,使用所述事务层属性对接收到的数据访问进行事务层的协议解析。A configuration unit is used 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: 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 received data access, and/or use the transaction layer attributes to perform transaction layer protocol parsing on received data access.

可选的,所述配置单元,用于:Optionally, the configuration unit is used to:

在所述初始虚拟存储设备的存储协议配置空间对所述初始虚拟存储设备进行所述存储协议的存储容量属性的配置和队列数量属性的配置,其中,所述第四属性配置包括:所述存储容量属性和所述队列数量属性,所述存储容量属性和所述队列数量属性用于被所述服务器识别为符合所述存储协议的存储设备。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.

可选的,所述存储扩展装置中还部署了目标总线和总线接口,所述总线接口用于将连接在所述目标总线上的多个所述存储通道连接至所述第一存储设备,所述总线接口中具有所述目标总线的总线地址空间与所述第一存储设备的存储地址空间的映射关系,其中,Optionally, a target bus and a bus interface are further deployed in the storage expansion device, and the bus interface is used 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 execution module comprises:

第二接收单元,用于通过所述目标总线接收所述第二数据访问;a second receiving unit, configured to receive the second data access via the target bus;

转发单元,用于通过所述总线接口根据所述映射关系将所述第二数据访问转发至所述参考存储空间。A forwarding unit is used to forward the second data access to the reference storage space through the bus interface according to the mapping relationship.

可选的,所述总线接口包括:总线仲裁单元和存储设备驱动单元,所述存储设备驱动单元中具有所述目标总线的总线地址空间与所述第一存储设备的存储地址空间的映射关系,其中,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 a bus address space of the target bus and a storage address space of the first storage device, wherein:

所述转发单元,用于:The forwarding unit is used for:

通过所述总线仲裁单元根据所述参考存储通道的优先级确定是否处理所述参考存储通道的总线访问;determining, by the bus arbitration unit, whether to process bus access of the reference storage channel according to the priority of the reference storage channel;

在确定处理所述参考存储通道的总线访问的情况下,通过所述存储设备驱动单元根据所述映射关系将所述第二数据访问转发至所述参考存储空间。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.

可选的,所述装置还包括:Optionally, the device further comprises:

接收模块,用于在所述控制所述第一存储设备的所述参考存储空间执行所述第二数据访问之后,接收所述参考存储空间响应所述第二数据访问返回的访问结果信息;A receiving module, configured to receive access result information returned by the reference storage space in response to the second data access after the reference storage space of the first storage device is controlled to perform the second data access;

转发模块,用于将所述访问结果信息转发至所述参考存储通道;A forwarding module, used for forwarding the access result information to the reference storage channel;

发送模块,用于通过所述参考存储通道将所述访问结果信息发送至所述服务器。A sending module is used to send the access result information to the server through the reference storage channel.

可选的,所述转发模块,包括:Optionally, the forwarding module includes:

提取单元,用于从所述访问结果信息中提取源地址,得到所述参考存储空间;An extraction unit, used to extract a source address from the access result information to obtain the reference storage space;

第二确定单元,用于从所述存储扩展装置中建立的存储通道中确定所述参考存储空间所对应的所述参考存储通道;a second determining unit, configured to determine the reference storage channel corresponding to the reference storage space from the storage channels established in the storage expansion device;

发送单元,用于向所述参考存储通道发送所述访问结果信息。A sending unit is used to send the access result information to the reference storage channel.

可选的,所述发送单元,用于:Optionally, the sending unit is used to:

将所述访问结果信息中的源地址从所述参考存储空间替换为所述参考存储设备,得到参考访问结果信息;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;

向所述服务器发送所述参考访问结果信息。The reference access result information is sent to the server.

可选的,所述装置还包括以下之一:Optionally, the device further comprises one of the following:

第一确定模块,用于根据所述存储扩展装置上的资源信息,确定所述存储扩展装置中建立的存储通道的通道数量;A first determining module, configured to determine the number of storage channels established in the storage expansion device according to resource information on the storage expansion device;

第二确定模块,用于根据所述存储扩展装置上的资源信息和所述第一存储设备的设备信息,确定所述存储扩展装置中建立的存储通道的通道数量;A second determining module, configured to determine the number of channels 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;

第三确定模块,用于根据所述存储扩展装置上的资源信息,所述第一存储设备的设备信息,以及所述服务器上所部署的虚拟机的虚拟机信息,确定所述存储扩展装置中建立的存储通道的通道数量。The third determination module is used 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.

可选的,所述第一确定模块,包括:Optionally, the first determining module includes:

检测单元,用于检测与所述第一存储设备的连接;a detection unit, configured to detect a connection with the first storage device;

加载单元,用于在检测到已连接至所述第一存储设备的情况下,加载存储设备驱动;A loading unit, configured to load a storage device driver when detecting that the storage device is connected to the first storage device;

获取单元,用于通过所述存储设备驱动从所述第一存储设备上获取所述设备信息;an acquiring unit, configured to acquire the device information from the first storage device through the storage device driver;

确定单元,用于根据所述存储扩展装置上的资源信息和所述第一存储设备的设备信息,确定所述存储扩展装置中建立的存储通道的通道数量。A determination unit is used 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.

需要说明的是,上述各个模块是可以通过软件或硬件来实现的,对于后者,可以通过以下方式实现,但不限于此:上述模块均位于同一处理器中;或者,上述各个模块以任意组合的形式分别位于不同的处理器中。It should be noted that the above modules can be implemented by 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.

本申请的实施例还提供了一种计算机可读存储介质,该计算机可读存储介质中存储有计算机程序,其中,该计算机程序被设置为运行时执行上述任一项方法实施例中的步骤。An embodiment of the present application further provides a computer-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 run.

在一个示例性实施例中,上述计算机可读存储介质可以包括但不限于:U盘、只读存储器(Read-Only Memory,简称为ROM)、随机存取存储器(Random Access Memory,简称为RAM)、移动硬盘、磁碟或者光盘等各种可以存储计算机程序的介质。In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as 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.

本申请的实施例还提供了一种电子设备,上述电子设备包括存储器和处理器,该存储器中存储有计算机程序,该处理器被设置为运行计算机程序以执行上述任一项方法实施例中的步骤。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.

在一个示例性实施例中,上述电子设备还可以包括传输设备以及输入输出设备,其中,该传输设备和上述处理器连接,该输入输出设备和上述处理器连接。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.

本实施例中的具体示例可以参考上述实施例及示例性实施方式中所描述的示例,本实施例在此不再赘述。For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

显然,本领域的技术人员应该明白,上述的本申请的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本申请不限制于任何特定的硬件和软件结合。Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that 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 executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.

以上所述仅为本申请的优选实施例而已,并不用于限制本申请,对于本领域的技术人员来说,本申请可以有各种更改和变化。凡在本申请的原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.

Claims (22)

1. A method for accessing a memory device, characterized in that,
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 which are allowed to be identified as second storage devices by the server are established in the storage expansion device, the second storage devices are allocated to the virtual machines deployed on the server, and corresponding storage spaces are allocated on the first storage devices by the storage channels, and the method comprises the following steps:
Receiving a data access request sent by a reference virtual machine, wherein the one or more virtual machines comprise the reference virtual machine, and the data access request is used for requesting first data access to a reference storage device allocated to the reference virtual machine in the second storage device;
Responding to the data access request, and converting the first data access into second data access through a reference storage channel, wherein the reference storage channel is a storage channel which is identified as the reference storage device in a storage channel established in the storage expansion device, and the second data access is data access to a reference storage space corresponding to the reference storage channel in the first storage device;
controlling the reference storage space of the first storage device to execute the second data access.
2. The method of claim 1, wherein the step of determining the position of the substrate comprises,
The converting the first data access to a second data access by referring to a storage channel includes:
determining a reference storage channel identified as the reference storage device from storage channels established in the storage expansion means;
forwarding the first data access to the reference storage channel;
And converting the first data access into the second data access through the reference storage channel.
3. The method of claim 2, wherein the step of determining the position of the substrate comprises,
The storage expansion device is further provided with a first virtual bridge device, the first virtual bridge device is connected with a storage channel established in the storage expansion device, the first virtual bridge device is further used for connecting the server and is recognized by the server as being connected with the second storage device, the first virtual bridge device records a second storage device and a storage channel with corresponding relations,
The determining a reference storage channel identified as the reference storage device from the storage channels established in the storage expansion apparatus includes: searching the reference storage channel corresponding to the reference storage device from the second storage device and the storage channel with corresponding relation through the first virtual bridge device;
the forwarding the first data access to the reference storage channel includes: forwarding, by the first virtual bridge device, the first data access to the reference storage channel.
4. The method of claim 3, wherein the step of,
The searching, by the first virtual bridge device, 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;
And searching the reference storage channel corresponding to the reference device identifier from the storage device identifiers and the storage channels which have a corresponding relationship through the first virtual bridge device, wherein the storage device identifier is a device identifier which is allocated to the corresponding storage channel and is allowed to be identified as a storage device.
5. The method of claim 3, wherein the step of,
The method further comprises the steps of:
Creating an initial virtual bridge device in the storage expansion device;
Performing first attribute configuration of a transmission protocol on the initial virtual bridging device in a protocol configuration space of the initial virtual bridging device to obtain the first virtual bridging device, wherein the server and the storage expansion device are connected through a protocol bus conforming to the transmission protocol, and the first attribute is a protocol attribute of the bridging device which is allowed to be identified by the server as conforming to the transmission protocol;
and establishing connection between the first virtual bridge equipment and the storage channel established in the storage expansion device, and recording a second storage equipment and the storage channel with corresponding relations.
6. The method of claim 1, wherein the step of determining the position of the substrate comprises,
The storage channel comprises a second virtual bridge device and a virtual storage device, a first virtual bridge device is connected with the second virtual bridge device, the second virtual bridge device is connected with the virtual storage device, the virtual storage device is used for connecting the first storage device,
The converting the first data access to the second data access through the reference storage channel includes:
receiving, by the second virtual bridge device in the reference storage channel, the first data access;
Transmitting, by the second virtual bridge device in the reference storage channel, the first data access to the virtual storage device in the reference storage channel;
the first data access is converted to the second data access by the virtual storage device in the reference storage channel.
7. The method of claim 6, wherein the step of providing the first layer comprises,
Said converting said first data access to said second data access by said virtual storage device in said reference storage channel comprising:
Acquiring a first access address of the access indicated by the first data access through the virtual storage device in the reference storage channel, wherein the first access address is a virtual address of the reference storage device indicated by the reference virtual machine;
querying, by 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 having a corresponding relationship, where 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 a storage space allocated on the first storage device by the virtual storage device in the reference storage channel;
And replacing the first access address in the first data access with the first storage address to obtain the second data access.
8. The method of claim 7, wherein the step of determining the position of the probe is performed,
The querying, by 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 having a corresponding relationship, includes:
Querying, by the virtual storage device in the reference storage channel, the first storage address mapped by the first access address from an address mapping between an addressing space of a transport protocol of the reference storage device and a storage space of a storage protocol of the first storage device, wherein the reference storage device is identified by the server as a device conforming to the transport protocol, the virtual address range includes the addressing space of the transport 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 of claim 6, wherein the step of providing the first layer comprises,
The method further comprises the steps of:
Creating a plurality of groups of initial virtual bridging devices and initial virtual storage devices in the storage expansion device;
Configuring a second attribute of a transmission protocol of 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 through a protocol bus conforming to the transmission protocol, and the second attribute is a protocol attribute of the bridge device which is allowed to be identified by the server as conforming to the transmission protocol;
And performing third attribute configuration of a transmission protocol on the initial virtual storage device in a transmission protocol configuration space of the initial virtual storage device, and performing fourth attribute configuration of a storage protocol on the initial virtual storage device in a 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 conforming to the storage protocol, the third attribute is a protocol attribute of a terminal device which is allowed to be identified by the server as conforming to the transmission protocol, and the fourth attribute is a protocol attribute of a storage device which is allowed to be identified by the server as conforming to the storage protocol.
10. The method of claim 9, wherein the step of determining the position of the substrate comprises,
The protocol analysis unit is deployed in the virtual storage device, and the performing, in the transport protocol configuration space of the initial virtual storage device, third attribute configuration of a transport protocol on the initial virtual storage device includes:
and performing configuration of data link layer attribute and transaction layer attribute of the transmission protocol on the initial virtual storage device in a transmission protocol configuration space of the initial virtual storage device, wherein the third attribute configuration comprises: the protocol analysis unit is used for carrying out protocol analysis of a data link layer on the received data access by using the data link layer attribute and/or carrying out protocol analysis of a transaction layer on the received data access by using the transaction layer attribute.
11. The method of claim 10, wherein the step of determining the position of the first electrode is performed,
The performing, in the storage protocol configuration space of the initial virtual storage device, a fourth attribute configuration of a storage protocol on the initial virtual storage device includes:
And performing configuration of storage capacity attribute and queue number attribute of the storage protocol on the initial virtual storage device in a storage protocol configuration space of the initial virtual storage device, wherein the fourth attribute configuration comprises: the storage capacity attribute and the queue number attribute are for use by the server to identify storage devices that conform to the storage protocol.
12. The method of claim 1, wherein the step of determining the position of the substrate comprises,
The memory expansion device is further provided with a target bus and a bus interface, wherein the bus interface is used for connecting a plurality of memory channels connected to the target bus to the first memory device, and has a mapping relation between a bus address space of the target bus and a memory address space of the first memory device,
The controlling the reference storage space of the first storage device to perform the second data access includes:
Receiving the second data access via the target bus;
And forwarding the second data access to the reference storage space according to the mapping relation through the bus interface.
13. The method of claim 12, wherein the step of determining the position of the probe is performed,
The bus interface includes: a bus arbitration unit and a memory device driving unit having therein a mapping relationship of a bus address space of the target bus and a memory address space of the first memory device,
The forwarding the second data access to the reference storage space through the bus interface according to the mapping relationship includes:
determining whether to process bus access of the reference memory channel according to the priority of the reference memory channel through the bus arbitration unit;
And forwarding the second data access to the reference memory space by the memory device driving unit according to the mapping relation under the condition of determining to process the bus access of the reference memory channel.
14. A storage expansion device is characterized in that,
Comprising the following steps:
A server port, a processing chip and a storage device port, wherein the server port is connected with the processing chip, the processing chip is connected with the storage device port, one or more storage channels are established in the processing chip,
The server port is used for connecting a server, wherein one or more virtual machines are deployed on the server, the one or more storage channels allow the server to identify the one or more storage channels as one or more second storage devices, and the one or more second storage devices are distributed to the virtual machines deployed on the server;
The storage device port is used for connecting a first storage device, wherein the storage channel is allocated with a corresponding storage space on the first storage device;
the processing chip having disposed thereon the method of any of claims 1 to 13.
15. The storage expansion device of claim 14, wherein the memory is configured to store the data,
The processing chip is provided with a first virtual bridge device, the first virtual bridge device is connected with the one or more storage channels, the first virtual bridge device is also used for connecting the server port and is identified by the server as being connected with the second storage device, the first virtual bridge device records the second storage device and the storage channels with corresponding relations,
The first virtual bridge device is configured to search, when a first data access is received, a reference storage channel corresponding to a reference storage device from the second storage devices and storage channels having a corresponding relationship, where the reference storage device is a storage device allocated to a reference virtual machine that initiates a data access request in the one or more second storage devices, and the reference storage channel is a storage channel identified as the reference storage device in the one or more storage channels; forwarding the first data access to the reference storage channel.
16. The storage expansion device of claim 15, wherein the memory is configured to store the data,
The storage channel comprises a second virtual bridge device and a virtual storage device, the second virtual bridge device is connected with the first virtual bridge device, the second virtual bridge device is connected with the virtual storage device, the virtual storage device is connected with 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 the first data access is received;
The virtual storage device is used for converting the first data access into a second data access for accessing the storage space corresponding to the reference storage channel in the first storage device.
17. The storage expansion device of claim 16, wherein the memory is configured to store the data,
An external storage device is also arranged in the storage expansion device, the external storage device is connected with the virtual storage device, wherein,
The external storage device is used for caching the data to be accessed by the virtual storage device in the first storage device.
18. The storage expansion device of claim 15, wherein the memory is configured to store the data,
A target processor is also disposed in the processing chip, the target processor being coupled to the one or more memory channels via an internal high-speed bus, the target processor also being coupled to the memory device port, wherein,
And the target processor is used for responding to the data access request transmitted by the storage channel and performing storage control and data access on the first storage device.
19. An access device for a storage device, characterized in that,
The storage expansion device 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 which are allowed to be identified as second storage devices by the server are established in the storage expansion device, the second storage devices are allocated to the virtual machines deployed on the server, the storage channels are allocated with corresponding storage spaces on the first storage devices, and the storage expansion device comprises:
The receiving module is used for receiving a data access request sent by a reference virtual machine, wherein the one or more virtual machines comprise the reference virtual machine, and the data access request is used for requesting to perform first data access on a reference storage device allocated to the reference virtual machine in the second storage device;
The conversion module is used for responding to the data access request and converting the first data access into second data access through a reference storage channel, wherein the reference storage channel is a storage channel which is identified as the reference storage device in a storage channel established in the storage expansion device, and the second data access is data access to a reference storage space corresponding to the reference storage channel in the first storage device;
and the control module is used for controlling the reference storage space of the first storage device to execute the second data access.
20. A computer-readable storage medium comprising,
The computer readable storage medium has stored therein a computer program, wherein the computer program when executed by a processor realizes the steps of the method as claimed in any of claims 1 to 13.
21. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that,
The processor, when executing the computer program, implements the steps of the method as claimed in any one of claims 1 to 13.
22. A computer program product comprising a computer program, characterized in that,
Which computer program, when being executed by a processor, carries out the steps of the method as claimed in any one of claims 1 to 13.
CN202410376341.2A 2024-03-29 2024-03-29 Storage device access method and device, storage medium and electronic device Active CN117971135B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202410376341.2A CN117971135B (en) 2024-03-29 2024-03-29 Storage device access method and device, storage medium and electronic device
PCT/CN2024/136881 WO2025200554A1 (en) 2024-03-29 2024-12-04 Storage device access method and apparatus, storage medium, and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410376341.2A CN117971135B (en) 2024-03-29 2024-03-29 Storage device access method and device, storage medium and electronic device

Publications (2)

Publication Number Publication Date
CN117971135A true CN117971135A (en) 2024-05-03
CN117971135B CN117971135B (en) 2024-06-14

Family

ID=90846433

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410376341.2A Active CN117971135B (en) 2024-03-29 2024-03-29 Storage device access method and device, storage medium and electronic device

Country Status (2)

Country Link
CN (1) CN117971135B (en)
WO (1) WO2025200554A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2025200554A1 (en) * 2024-03-29 2025-10-02 苏州元脑智能科技有限公司 Storage device access method and apparatus, storage medium, and electronic device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115794669A (en) * 2021-09-11 2023-03-14 华为技术有限公司 Method, device and related equipment for expanding memory
CN116774933A (en) * 2023-06-19 2023-09-19 北京火山引擎科技有限公司 Virtualization processing method of storage device, bridging device, system and medium
CN117608757A (en) * 2023-12-01 2024-02-27 北京火山引擎科技有限公司 Storage equipment control method, device, electronic equipment and storage medium
WO2024041412A1 (en) * 2022-08-24 2024-02-29 阿里云计算有限公司 Storage system and method, and hardware offload card

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10713177B2 (en) * 2016-09-09 2020-07-14 Intel Corporation Defining virtualized page attributes based on guest page attributes
CN117971135B (en) * 2024-03-29 2024-06-14 苏州元脑智能科技有限公司 Storage device access method and device, storage medium and electronic device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115794669A (en) * 2021-09-11 2023-03-14 华为技术有限公司 Method, device and related equipment for expanding memory
WO2024041412A1 (en) * 2022-08-24 2024-02-29 阿里云计算有限公司 Storage system and method, and hardware offload card
CN116774933A (en) * 2023-06-19 2023-09-19 北京火山引擎科技有限公司 Virtualization processing method of storage device, bridging device, system and medium
CN117608757A (en) * 2023-12-01 2024-02-27 北京火山引擎科技有限公司 Storage equipment control method, device, electronic equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2025200554A1 (en) * 2024-03-29 2025-10-02 苏州元脑智能科技有限公司 Storage device access method and apparatus, storage medium, and electronic device

Also Published As

Publication number Publication date
CN117971135B (en) 2024-06-14
WO2025200554A1 (en) 2025-10-02

Similar Documents

Publication Publication Date Title
US11829309B2 (en) Data forwarding chip and server
US20200278880A1 (en) Method, apparatus, and system for accessing storage device
US20180059939A1 (en) Method, Device, and System for Implementing Hardware Acceleration Processing
WO2025001344A1 (en) Cxl data transmission board and data transmission control method
CN109983449A (en) Data processing method and storage system
US20140040527A1 (en) Optimized multi-root input output virtualization aware switch
CN102609215B (en) Data processing method and device
US20140104967A1 (en) Inter-memory data transfer control unit
CN114546913B (en) Method and device for high-speed data interaction between multiple hosts based on PCIE interface
CN100592273C (en) Apparatus and method for performing DMA data transfer
CN110119304B (en) Interrupt processing method, device and server
CN117033275B (en) DMA method and device between acceleration cards, acceleration card, acceleration platform and medium
CN117591450B (en) Data processing system, method, equipment and medium
AU2015402888B2 (en) Computer device and method for reading/writing data by computer device
CN114238156A (en) Processing system and method of operating a processing system
EP3716084A1 (en) Apparatus and method for sharing a flash device among multiple masters of a computing platform
CN117421268A (en) Interconnection system, equipment and network
CN116737604A (en) Memory control chips, server memory modules and servers
CN117971135B (en) Storage device access method and device, storage medium and electronic device
US11604742B2 (en) Independent central processing unit (CPU) networking using an intermediate device
CN118519951A (en) Computing system and data transmission method
US20250077454A1 (en) Peripheral component interconnect express device and operating method thereof
US8032675B2 (en) Dynamic memory buffer allocation method and system
WO2023186143A1 (en) Data processing method, host, and related device
JP2005062940A (en) I / O controller

Legal Events

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