[go: up one dir, main page]

CN118689788A - Data sharing method, device and equipment - Google Patents

Data sharing method, device and equipment Download PDF

Info

Publication number
CN118689788A
CN118689788A CN202310611054.0A CN202310611054A CN118689788A CN 118689788 A CN118689788 A CN 118689788A CN 202310611054 A CN202310611054 A CN 202310611054A CN 118689788 A CN118689788 A CN 118689788A
Authority
CN
China
Prior art keywords
host
address
data
storage
shared
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310611054.0A
Other languages
Chinese (zh)
Inventor
朱晓明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to PCT/CN2024/077829 priority Critical patent/WO2024193272A1/en
Publication of CN118689788A publication Critical patent/CN118689788A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/06Addressing a physical block of locations, e.g. base addressing, module addressing, memory dedication
    • G06F12/0638Combination of memories, e.g. ROM and RAM such as to permit replacement or supplementing of words in one module by words in another module
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/06Addressing a physical block of locations, e.g. base addressing, module addressing, memory dedication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/16Handling requests for interconnection or transfer for access to memory bus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/16Handling requests for interconnection or transfer for access to memory bus
    • G06F13/1605Handling requests for interconnection or transfer for access to memory bus based on arbitration
    • G06F13/1647Handling requests for interconnection or transfer for access to memory bus based on arbitration with interleaved bank access
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/16Handling requests for interconnection or transfer for access to memory bus
    • G06F13/1668Details of memory controller
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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
    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11CSTATIC STORES
    • G11C7/00Arrangements for writing information into, or reading information out from, a digital store
    • G11C7/24Memory cell safety or protection circuits, e.g. arrangements for preventing inadvertent reading or writing; Status cells; Test cells

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种数据共享方法、装置及设备,本申请中,计算系统包括第一主机、第二主机、存储控制器、第一主机的存储装置以及第二主机的存储装置。第一主机向存储控制器发送读请求,该读请求用于请求从第一主机的存储装置上的第一地址读取第一数据。存储控制器接收到该读请求后,根据第一主机的共享信息确定第一地址映射到第二主机的存储装置上的第二地址。存储控制器从第二地址读取第一数据,将第一数据反馈给第一主机。存储控制器直接从第二地址读取第一数据,并反馈给第一主机,不需要将第一数据本身移动第一主机的存储装置,保证第一主机及时获取该第一数据,提升了第一主机以及第二主机之间的数据共享效率。

A data sharing method, device and equipment, in the present application, a computing system includes a first host, a second host, a storage controller, a storage device of the first host and a storage device of the second host. The first host sends a read request to the storage controller, and the read request is used to request to read the first data from the first address on the storage device of the first host. After receiving the read request, the storage controller determines that the first address is mapped to the second address on the storage device of the second host according to the sharing information of the first host. The storage controller reads the first data from the second address and feeds the first data back to the first host. The storage controller directly reads the first data from the second address and feeds it back to the first host, without moving the first data itself to the storage device of the first host, ensuring that the first host obtains the first data in time, thereby improving the data sharing efficiency between the first host and the second host.

Description

一种数据共享方法、装置及设备Data sharing method, device and equipment

相关申请的交叉引用CROSS-REFERENCE TO RELATED APPLICATIONS

本申请要求在2023年3月22日提交中华人民共和国知识产权局、申请号为202310293968.7、发明名称为“一种计算系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to the Chinese patent application filed with the Intellectual Property Office of the People's Republic of China on March 22, 2023, with application number 202310293968.7 and invention name "A Computing System", the entire contents of which are incorporated by reference in this application.

技术领域Technical Field

本申请涉及通信技术领域,尤其涉及一种数据共享方法、装置及设备。The present application relates to the field of communication technology, and in particular to a data sharing method, device and equipment.

背景技术Background Art

计算快速互联(compute express link,CXL)是在快捷外围部件互连标准(peripheral component interconnect express,PCIe)的基础上演化而来的。关于CXL的协议,从最初的CXL1.0协议将慢慢过渡到CXL2.0协议。Compute Express Link (CXL) is an evolution of the Peripheral Component Interconnect Express (PCIe) standard. Regarding the CXL protocol, the initial CXL1.0 protocol will gradually transition to the CXL2.0 protocol.

在CXL 2.0协议中,基于CXL构建的计算系统中的存储设备可以被划分为多个逻辑设备,该多个逻辑设备能够与该计算系统中的不同的主机绑定。主机可以通过CXL访问主机的逻辑设备,进行数据读取以及数据写入。In the CXL 2.0 protocol, storage devices in a computing system built on CXL can be divided into multiple logical devices, which can be bound to different hosts in the computing system. The host can access the host's logical devices through CXL to read and write data.

但在CXL 2.0协议中,不同主机之间的数据共享伴随着数据本身的迁移。以计算系统中的主机1以及主机2之间的数据共享为例,当主机1需要共享主机2的逻辑设备中的数据时,主机2的逻辑设备的数据需要迁移到主机1的逻辑设备中,也即从主机2的逻辑设备中复制该数据后,再将该数据写入主机的1的逻辑设备中,数据本身需要发生迁移。主机1通过访问自己的逻辑设备,从主机1的逻辑设备中读取该数据。数据的迁移导致CXL 2.0协议中不同主机之间的数据共享效率较低。However, in the CXL 2.0 protocol, data sharing between different hosts is accompanied by the migration of the data itself. Take the data sharing between host 1 and host 2 in the computing system as an example. When host 1 needs to share the data in the logical device of host 2, the data in the logical device of host 2 needs to be migrated to the logical device of host 1, that is, after copying the data from the logical device of host 2, the data is written to the logical device of host 1, and the data itself needs to be migrated. Host 1 reads the data from the logical device of host 1 by accessing its own logical device. The migration of data leads to low efficiency of data sharing between different hosts in the CXL 2.0 protocol.

发明内容Summary of the invention

本申请提供一种数据共享方法、装置及设备,用以提升主机之间的数据共享效率。The present application provides a data sharing method, device and equipment to improve the data sharing efficiency between hosts.

第一方面,本申请实施例提供了一种数据共享方法,该方法应用于计算系统,计算系统包括第一主机、第二主机、存储控制器、第一主机的存储装置以及第二主机的存储装置。第一主机可以通过存储控制器访问该第一主机的存储装置,第二主机可以通过存储控制器访问该第二主机的存储装置。在本申请实施例中,第一主机的存储装置中的存储空间可以映射到第二主机的存储装置的存储空间中。这样,第一主机能够访问第一主机的存储装置中的存储空间所映射到的第二主机的存储装置的存储空间。下面对该访问过程进行说明:In a first aspect, an embodiment of the present application provides a data sharing method, which is applied to a computing system, wherein the computing system includes a first host, a second host, a storage controller, a storage device of the first host, and a storage device of the second host. The first host can access the storage device of the first host through the storage controller, and the second host can access the storage device of the second host through the storage controller. In an embodiment of the present application, the storage space in the storage device of the first host can be mapped to the storage space of the storage device of the second host. In this way, the first host can access the storage space of the storage device of the second host to which the storage space in the storage device of the first host is mapped. The access process is described below:

第一主机可以向存储控制器发送读请求,该读请求用于请求从第一主机的存储装置上的第一地址读取第一数据(该第一数据可以为本申请实施例中的数据1或者数据2)。The first host may send a read request to the storage controller, where the read request is used to request to read first data (the first data may be data 1 or data 2 in the embodiment of the present application) from a first address on the storage device of the first host.

存储控制器接收到该读请求后,可以根据第一主机的共享信息确定第一地址映射到第二主机的存储装置上的第二地址,第一主机的共享信息指示了第一地址与第二地址之间的映射关系。After receiving the read request, the storage controller can determine the mapping of the first address to the second address on the storage device of the second host according to the sharing information of the first host, where the sharing information of the first host indicates the mapping relationship between the first address and the second address.

存储控制器根据该第一主机的共享信息确定了第二地址之后,从第二地址读取第一数据,将第一数据反馈给第一主机。After determining the second address according to the shared information of the first host, the storage controller reads the first data from the second address and feeds the first data back to the first host.

上述说明中,仅是以第一主机为例进行说明,类似的,第二主机的存储装置中的存储空间也可以映射到第一主机的存储装置的存储空间中。这样,第二主机可以访问第二主机的存储装置中的存储空间所映射到的第一主机的存储装置的存储空间。访问过程与第一主机访问第二主机的存储装置的存储空间的方式类似,具体可以参见前述说明,此处不再赘述。In the above description, only the first host is used as an example. Similarly, the storage space in the storage device of the second host can also be mapped to the storage space of the storage device of the first host. In this way, the second host can access the storage space of the storage device of the first host to which the storage space in the storage device of the second host is mapped. The access process is similar to the way the first host accesses the storage space of the storage device of the second host. For details, please refer to the above description, which will not be repeated here.

通过上述方法,由于第一主机的共享信息中指示了第一地址与第二地址的映射关系,存储控制器只需在确定了第二地址后,直接从第二地址读取第一数据,并反馈给第一主机,不需要将第一数据本身移动到第一主机的存储装置,减少了数据移动,保证第一主机能够及时获取该第一数据,提升了第一主机以及第二主机之间的数据共享效率。Through the above method, since the mapping relationship between the first address and the second address is indicated in the sharing information of the first host, the storage controller only needs to read the first data directly from the second address after determining the second address and feed it back to the first host. There is no need to move the first data itself to the storage device of the first host, which reduces data movement, ensures that the first host can obtain the first data in time, and improves the data sharing efficiency between the first host and the second host.

在一种可能的实施方式中,第一主机在发起读请求之前,可以通过存储控制器将第一数据从第二地址迁移到第一地址。过程如下:In a possible implementation, before the first host initiates a read request, the first data may be migrated from the second address to the first address through the storage controller. The process is as follows:

第一主机向存储控制器发送数据迁移指令,数据迁移指令用于请求将第一数据从第二地址迁移到第一地址。The first host sends a data migration instruction to the storage controller, where the data migration instruction is used to request to migrate the first data from the second address to the first address.

存储控制器接收到该数据迁移指令后,更新第一主机的共享信息,更新后第一主机的共享信息指示了第一地址与第二地址之间的映射关系。After receiving the data migration instruction, the storage controller updates the sharing information of the first host, and the updated sharing information of the first host indicates the mapping relationship between the first address and the second address.

通过上述方法,在主机指示存储控制器将第一数据从第二地址迁移到第一地址时,存储控制器不需要对第一数据本身进行迁移,仅需要在第一主机的共享信息中增加第一地址与第二地址之间的映射关系,避免数据本身迁移带来的较大功耗,数据迁移效率更高,也保证了后续第一主机在读取第一数据时,存储控制器能够从第二主机中读取该第一数据。Through the above method, when the host instructs the storage controller to migrate the first data from the second address to the first address, the storage controller does not need to migrate the first data itself, but only needs to add a mapping relationship between the first address and the second address in the shared information of the first host, thereby avoiding the high power consumption caused by the migration of the data itself, and the data migration efficiency is higher. It also ensures that when the first host subsequently reads the first data, the storage controller can read the first data from the second host.

在一种可能的实施方式中,第一主机还可以向第一主机的存储装置中写入数据。这里以第二数据为例,该第二数据对应于本申请实施例中提及的数据3。In a possible implementation, the first host may also write data into the storage device of the first host. Here, the second data is taken as an example, and the second data corresponds to the data 3 mentioned in the embodiment of the present application.

第一主机向存储控制器发送写请求,该写请求用于请求在第一地址处写入第二数据。The first host sends a write request to the storage controller, where the write request is used to request to write second data at a first address.

存储控制器接收到写请求后,删除第一主机的共享信息中第一地址与第二地址之间的映射关系。存储控制器访问第一主机的存储装置,在第一地址写入第二数据。After receiving the write request, the storage controller deletes the mapping relationship between the first address and the second address in the shared information of the first host. The storage controller accesses the storage device of the first host and writes the second data at the first address.

通过上述方法,存储控制器在接收到写请求后,及时删除该第一地址与第二地址之间的映射关系,避免后续从第一地址读取数据时,无法读取第二数据。Through the above method, after receiving the write request, the storage controller promptly deletes the mapping relationship between the first address and the second address, thereby avoiding failure to read the second data when subsequently reading data from the first address.

在一种可能的实施方式中,第二主机的共享信息中可以记录该第二主机的存储设备中的存储空间是否允许共享。存储控制器在更新第一主机的共享信息,存储控制器可以查询第二主机的共享信息,确定第二地址是否允许共享。若该第二主机的共享信息指示第二地址允许共享,存储控制器再更新第一主机的共享信息。In a possible implementation, the sharing information of the second host may record whether the storage space in the storage device of the second host is allowed to be shared. When the storage controller updates the sharing information of the first host, the storage controller may query the sharing information of the second host to determine whether the second address is allowed to be shared. If the sharing information of the second host indicates that the second address is allowed to be shared, the storage controller updates the sharing information of the first host.

通过上述方法,存储控制器在更新第一主机的共享信息之前,先确定第二地址是否允许共享,以保证第二主机的存储装置中第二地址上数据的安全性,避免第二主机的存储装置的数据发生泄漏。Through the above method, the storage controller determines whether the second address allows sharing before updating the sharing information of the first host, so as to ensure the security of the data at the second address in the storage device of the second host and avoid data leakage of the storage device of the second host.

在一种可能的实施方式中,存储控制器接收来自第一主机的数据迁移指令,数据迁移指令用于请求将第一数据从第二地址迁移到第一地址;存储控制器可以查询第二主机的共享信息,确定第二地址是否允许共享。若该第二主机的共享信息指示第二地址禁止共享,存储控制器通知第一主机数据迁移失败。由于第二地址不允许共享,存储控制器通过告知第一主机数据迁移失败,避免了第二地址上数据的泄漏。In a possible implementation, the storage controller receives a data migration instruction from the first host, the data migration instruction is used to request to migrate the first data from the second address to the first address; the storage controller can query the sharing information of the second host to determine whether the second address allows sharing. If the sharing information of the second host indicates that the second address prohibits sharing, the storage controller notifies the first host that the data migration fails. Since the second address does not allow sharing, the storage controller avoids leakage of data at the second address by notifying the first host of the data migration failure.

在一种可能的实施方式中,计算系统可以部署在多个计算设备中,第一主机、第二主机、存储控制器、第一主机的存储装置以及第二主机的存储装置可以分布在多个计算设备中。例如,第一主机、以及第一主机的存储装置可以位于不同的计算设备中,第一主机以及第二主机可以位于不同的计算设备上。该计算系统也可以部署在一个计算设备中,也即第一主机、第二主机、存储控制器、第一主机的存储装置以及第二主机的存储装置部署在一个计算设备。In a possible implementation, the computing system may be deployed in multiple computing devices, and the first host, the second host, the storage controller, the storage device of the first host, and the storage device of the second host may be distributed in multiple computing devices. For example, the first host and the storage device of the first host may be located in different computing devices, and the first host and the second host may be located in different computing devices. The computing system may also be deployed in one computing device, that is, the first host, the second host, the storage controller, the storage device of the first host, and the storage device of the second host are deployed in one computing device.

通过上述方法,计算系统存在多种部署方式,适用于不同的场景。Through the above methods, there are multiple deployment methods for computing systems, suitable for different scenarios.

在一种可能的实施方式中,第一主机的存储装置以及第二主机的存储装置可以是物理形态的存储设备,也可以是物理形态的存储设备虚拟形成的逻辑设备。In a possible implementation, the storage device of the first host and the storage device of the second host may be physical storage devices, or may be logical devices formed by virtualization of physical storage devices.

通过上述方法,第一主机的存储装置以及第二主机的存储装置的形态较为灵活,有效地扩展了该方法所适用的场景。Through the above method, the storage device of the first host and the storage device of the second host are more flexible in form, which effectively expands the applicable scenarios of the method.

在一种可能的实施方式中,第一地址以及第二地址均为HPA,存储控制器从第二地址读取第一数据时,可以先查询第二主机的主机设备地址映射表,将第二地址转换为第二主机的DPA,从DPA上读取中第一数据,其中,第二主机的主机设备地址映射表描述得了第二主机的HPA与DPA之间的映射关系。In a possible implementation, the first address and the second address are both HPA. When the storage controller reads the first data from the second address, it can first query the host device address mapping table of the second host, convert the second address into the DPA of the second host, and read the first data from the DPA, wherein the host device address mapping table of the second host describes the mapping relationship between the HPA and DPA of the second host.

通过上述方法,存储控制器可以先查询第一主机的共享信息,之后再查询第二主机的主机设备地址映射表,以保证能够从第二地址读取该第一数据。Through the above method, the storage controller can first query the sharing information of the first host, and then query the host device address mapping table of the second host to ensure that the first data can be read from the second address.

在一种可能的实施方式中,存储控制器保存各个主机的共享信息,以第一主机的共享信息为例,第一主机的共享信息包括第一主机的HPA、以及与第一主机的HPA存在映射关系的第二主机的HPA、以及第二主机的信息。第一主机的HPA可以表征该第一主机的存储装置的存储空间。第二主机的HPA可以表征该第二主机的存储装置的存储空间。In a possible implementation, the storage controller saves the sharing information of each host. Taking the sharing information of the first host as an example, the sharing information of the first host includes the HPA of the first host, the HPA of the second host that has a mapping relationship with the HPA of the first host, and the information of the second host. The HPA of the first host can represent the storage space of the storage device of the first host. The HPA of the second host can represent the storage space of the storage device of the second host.

通过上述方法,存储控制器能够维护各个主机的共享信息,以保证主机之间能够实现数据共享。Through the above method, the storage controller can maintain the shared information of each host to ensure that data can be shared between the hosts.

在一种可能的实施方式中,第一主机的共享信息还包括共享标记,共享标记用于指示第一主机的HPA是否允许共享。In a possible implementation manner, the sharing information of the first host further includes a sharing mark, and the sharing mark is used to indicate whether the HPA of the first host allows sharing.

通过上述方法,通过设置显式的共享标记能够明确该第一主机的HPA是否允许共享。Through the above method, by setting an explicit sharing mark, it can be made clear whether the HPA of the first host allows sharing.

在一种可能的实施方式中,若第一主机的共享信息未指示第一地址与第二地址之间的映射关系;也就是说,第一地址与第二地址之间不存在映射关系。存储控制器在接收到读请求后,可以访问第一主机的存储装置,从第一地址读取第一数据,将第一数据反馈给第一主机。In a possible implementation, if the sharing information of the first host does not indicate a mapping relationship between the first address and the second address; that is, there is no mapping relationship between the first address and the second address. After receiving the read request, the storage controller can access the storage device of the first host, read the first data from the first address, and feed the first data back to the first host.

通过上述方法,存储控制器在接收到读请求后,若第一共享信息中未指示第一地址所映射的地址,存储控制器可以按照正常的数据读取流程,访问第一主机的存储装置,从第一地址读取第一数据,将第一数据反馈给第一主机。Through the above method, after receiving a read request, if the first shared information does not indicate the address mapped by the first address, the storage controller can access the storage device of the first host according to the normal data reading process, read the first data from the first address, and feed the first data back to the first host.

在一种可能的实施方式中,第一地址以及第二地址均为HPA,第一主机的共享信息是以DPA来表征第一主机的存储装置的存储空间或第二主机的存储装置的存储空间。存储控制器在接收到读请求之后,先查询第一主机的主机设备地址映射表,将第一地址转换为第一主机的DPA,其中,第一主机的主机设备地址映射表描述了第一主机的HPA与DPA之间的映射关系;In a possible implementation, the first address and the second address are both HPA, and the shared information of the first host is represented by DPA to represent the storage space of the storage device of the first host or the storage space of the storage device of the second host. After receiving the read request, the storage controller first queries the host device address mapping table of the first host and converts the first address into the DPA of the first host, wherein the host device address mapping table of the first host describes the mapping relationship between the HPA and DPA of the first host;

存储控制器根据第一主机的共享信息确定第一主机的DPA映射到第二主机的存储装置的DPA,其中,第二地址与第二主机的DPA存在映射关系。之后,存储控制器从第二主机的DPA上读取中第一数据。The storage controller determines that the DPA of the first host is mapped to the DPA of the storage device of the second host according to the shared information of the first host, wherein the second address and the DPA of the second host have a mapping relationship. Afterwards, the storage controller reads the first data from the DPA of the second host.

通过上述方法,存储控制器可以先查询第一主机的主机设备地址映射表,之后再查询第一主机的共享信息,以保证能够从第二地址读取该第一数据。Through the above method, the storage controller can first query the host device address mapping table of the first host, and then query the shared information of the first host to ensure that the first data can be read from the second address.

第二方面,本申请实施例还提供了一种计算系统,该计算系统包括第一主机、第二主机、存储控制器、第一主机的存储装置以及第二主机的存储装置,该计算系统可以是基于计算互联总线连接的。存储控制器、第一主机配合具有实现上述第一方面的方法实例中行为的功能,有益效果可以参见第一方面的描述此处不再赘述。In a second aspect, an embodiment of the present application further provides a computing system, the computing system comprising a first host, a second host, a storage controller, a storage device of the first host, and a storage device of the second host, the computing system may be connected based on a computing interconnect bus. The storage controller and the first host cooperate to implement the behavior in the method example of the first aspect above, and the beneficial effects can be referred to the description of the first aspect and will not be repeated here.

第一主机,用于向存储控制器发送读请求,读请求用于请求从第一主机的存储装置上的第一地址读取第一数据。The first host is used to send a read request to the storage controller, where the read request is used to request to read first data from a first address on the storage device of the first host.

存储控制器,用于接收读请求,根据第一主机的共享信息确定第一地址映射到第二主机的存储装置上的第二地址,第一主机的共享信息指示了第一地址与第二地址之间的映射关系;从第二地址读取第一数据,将第一数据反馈给第一主机。A storage controller is used to receive a read request, determine the mapping of a first address to a second address on a storage device of a second host according to shared information of a first host, wherein the shared information of the first host indicates a mapping relationship between the first address and the second address; read first data from the second address, and feed the first data back to the first host.

在一种可能的实施方式中,第一主机在发送读请求之前向存储控制器发送数据迁移指令,数据迁移指令用于请求将第一数据从第二地址迁移到第一地址。In a possible implementation, the first host sends a data migration instruction to the storage controller before sending the read request, where the data migration instruction is used to request to migrate the first data from the second address to the first address.

存储控制器接收数据迁移指令后,更新第一主机的共享信息,更新后第一主机的共享信息指示了第一地址与第二地址之间的映射关系。After receiving the data migration instruction, the storage controller updates the sharing information of the first host, and the updated sharing information of the first host indicates the mapping relationship between the first address and the second address.

在一种可能的实施方式中,第一主机向存储控制器发送写请求,写请求用于请求在第一地址处写入第二数据。In a possible implementation, the first host sends a write request to the storage controller, where the write request is used to request to write the second data at the first address.

存储控制器接收写请求后,删除第一主机的共享信息中第一地址与第二地址之间的映射关系;访问第一主机的存储装置,在第一地址写入第二数据。After receiving the write request, the storage controller deletes the mapping relationship between the first address and the second address in the shared information of the first host; accesses the storage device of the first host, and writes the second data at the first address.

在一种可能的实施方式中,存储控制器在更新第一主机的共享信息之前,可以查询第二主机的共享信息,第二主机的共享信息指示第二地址允许共享。In a possible implementation, before updating the sharing information of the first host, the storage controller may query the sharing information of the second host, and the sharing information of the second host indicates that the second address allows sharing.

在一种可能的实施方式中,存储控制器接收来自第一主机的数据迁移指令,数据迁移指令用于请求将第一数据从第二地址迁移到第一地址;存储控制器在确定第二主机的共享信息指示第二地址禁止共享时,通知第一主机数据迁移失败。In one possible implementation, the storage controller receives a data migration instruction from the first host, where the data migration instruction is used to request migration of the first data from the second address to the first address; when the storage controller determines that the sharing information of the second host indicates that sharing of the second address is prohibited, the storage controller notifies the first host that the data migration has failed.

在一种可能的实施方式中,计算系统可以部署在一个计算设备上,也可以部署多个计算设备中。In a possible implementation, the computing system may be deployed on one computing device or on multiple computing devices.

在一种可能的实施方式中,第一主机的存储装置以及第二主机的存储装置可以是物理形态的存储设备虚拟形成的逻辑设备,第一主机的存储装置以及第二主机的存储装置也可以是物理形态的存储设备。In a possible implementation, the storage device of the first host and the storage device of the second host may be logical devices virtually formed by physical storage devices, or the storage device of the first host and the storage device of the second host may also be physical storage devices.

在一种可能的实施方式中,第一地址以及第二地址均为HPA,存储控制器在从第二地址读取第一数据时,查询第二主机的主机设备地址映射表,将第二地址转换为第二主机的DPA,从DPA上读取中第一数据,其中,第二主机的主机设备地址映射表描述得了第二主机的HPA与DPA之间的映射关系。In one possible implementation, the first address and the second address are both HPA. When the storage controller reads the first data from the second address, it queries the host device address mapping table of the second host, converts the second address into the DPA of the second host, and reads the first data from the DPA, wherein the host device address mapping table of the second host describes the mapping relationship between the HPA and DPA of the second host.

在一种可能的实施方式中,存储控制器保存有第一主机的共享信息,第一主机的共享信息包括第一主机的HPA、以及与第一主机的HPA存在映射关系的第二主机的HPA、以及第二主机的信息。In a possible implementation, the storage controller stores sharing information of the first host, where the sharing information of the first host includes the HPA of the first host, the HPA of the second host that is mapped to the HPA of the first host, and information of the second host.

在一种可能的实施方式中,第一主机的共享信息还包括共享标记,共享标记用于指示第一主机的HPA是否允许共享。In a possible implementation manner, the sharing information of the first host further includes a sharing mark, and the sharing mark is used to indicate whether the HPA of the first host allows sharing.

在一种可能的实施方式中,若第一主机的共享信息未指示第一地址与第二地址之间的映射关系;存储控制器在接收到读请求后,访问第一主机的存储装置,从第一地址读取第一数据,将第一数据反馈给第一主机。In a possible implementation, if the sharing information of the first host does not indicate a mapping relationship between the first address and the second address; after receiving a read request, the storage controller accesses the storage device of the first host, reads the first data from the first address, and feeds the first data back to the first host.

在一种可能的实施方式中,第一地址以及第二地址均为HPA,第一主机的共享信息是以DPA来表征第一主机的存储装置的存储空间或第二主机的存储装置的存储空间。In a possible implementation, the first address and the second address are both HPA, and the shared information of the first host uses DPA to represent the storage space of the storage device of the first host or the storage space of the storage device of the second host.

存储控制器在接收到读请求后,先查询第一主机的主机设备地址映射表,将第一地址转换为第一主机的存储装置的DPA,其中,第一主机的主机设备地址映射表描述得了第一主机的HPA与DPA之间的映射关系。After receiving the read request, the storage controller first queries the host device address mapping table of the first host and converts the first address into the DPA of the storage device of the first host, wherein the host device address mapping table of the first host describes the mapping relationship between the HPA and DPA of the first host.

存储控制器根据第一主机的共享信息确定第一主机的DPA映射到第二主机的DPA,第二地址与第二主机的DPA存在映射关系。之后,存储控制器从第二主机的DPA上读取中第一数据。The storage controller determines, based on the shared information of the first host, that the DPA of the first host is mapped to the DPA of the second host, and that there is a mapping relationship between the second address and the DPA of the second host. Afterwards, the storage controller reads the first data from the DPA of the second host.

第三方面,本申请实施例还提供了一种数据共享装置,该数据共享装置具有实现上述第一方面的方法实例中行为的功能,有益效果可以参见第一方面的描述此处不再赘述。功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。硬件或软件包括一个或多个与上述功能相对应的模块。在一个可能的设计中,装置的结构中包括接收模块、处理模块、以及发送模块,这些模块可以执行上述第一方面方法示例中的相应功能,具体参见方法示例中的详细描述,此处不做赘述。In the third aspect, the embodiment of the present application further provides a data sharing device, which has the function of implementing the behavior in the method example of the first aspect above. The beneficial effects can be found in the description of the first aspect and will not be repeated here. The functions can be implemented by hardware, or by hardware executing corresponding software implementations. The hardware or software includes one or more modules corresponding to the above functions. In one possible design, the structure of the device includes a receiving module, a processing module, and a sending module, which can execute the corresponding functions in the method example of the first aspect above. Please refer to the detailed description in the method example for details, which will not be repeated here.

第四方面,本申请还提供了一种计算设备,所述计算设备包括处理器和供电电路,该供电电路用于为该处理器供电,所述处理器可以执行上述第一方面或第一方面任一可能的实施方式提供的方法。所述处理器也可以调用存储器中存储的计算机程序指令执行上述第一方面或第一方面任一可能的实施方式提供的方法,所述存储器与所述处理器耦合,其保存数据共享过程中必要的计算机程序指令和数据。In a fourth aspect, the present application further provides a computing device, the computing device comprising a processor and a power supply circuit, the power supply circuit being used to power the processor, the processor being able to execute the method provided in the first aspect or any possible implementation of the first aspect. The processor may also call computer program instructions stored in a memory to execute the method provided in the first aspect or any possible implementation of the first aspect, the memory being coupled to the processor, and storing the necessary computer program instructions and data in the data sharing process.

第五方面,本申请提供了一种计算设备系统,该计算设备系统包括至少一个计算设备。每个计算设备包括存储器和处理器。至少一个计算设备的处理器用于访问所述存储器中的代码以执行第一方面或第一方面的任意一种可能的实现方式提供的方法。In a fifth aspect, the present application provides a computing device system, which includes at least one computing device. Each computing device includes a memory and a processor. The processor of at least one computing device is used to access the code in the memory to execute the method provided by the first aspect or any possible implementation of the first aspect.

第六方面,本申请提供了一种非瞬态的可读存储介质,所述非瞬态的可读存储介质被计算设备执行时,所述计算设备执行前述第一方面或第一方面的任意可能的实施方式中提供的方法。该存储介质中存储了程序。该存储介质包括但不限于易失性存储器,例如随机访问存储器,非易失性存储器,例如快闪存储器、硬盘(hard disk drive,HDD)、固态硬盘(solid state drive,SSD)。In a sixth aspect, the present application provides a non-transitory readable storage medium, and when the non-transitory readable storage medium is executed by a computing device, the computing device executes the method provided in the aforementioned first aspect or any possible implementation of the first aspect. The storage medium stores a program. The storage medium includes but is not limited to a volatile memory, such as a random access memory, a non-volatile memory, such as a flash memory, a hard disk drive (HDD), and a solid state drive (SSD).

第七方面,本申请提供了一种计算设备程序产品,所述计算设备程序产品包括计算机指令,在被计算设备执行时,所述计算设备执行前述第一方面或第一方面的任意可能的实施方式中提供的方法。该计算机程序产品可以为一个软件安装包,在需要使用前述第一方面或第一方面的任意可能的实施方式中提供的方法的情况下,可以下载该计算机程序产品并在计算设备上执行该计算机程序产品。In a seventh aspect, the present application provides a computing device program product, the computing device program product comprising computer instructions, when executed by a computing device, the computing device performs the method provided in the aforementioned first aspect or any possible implementation of the first aspect. The computer program product may be a software installation package, and when the method provided in the aforementioned first aspect or any possible implementation of the first aspect needs to be used, the computer program product may be downloaded and executed on a computing device.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1为本申请提供的一种计算系统的架构示意图;FIG1 is a schematic diagram of the architecture of a computing system provided by the present application;

图2为本申请提供的一种数据共享方法的示意图;FIG2 is a schematic diagram of a data sharing method provided by the present application;

图3~图7为本申请提供的一种主机的共享信息示意图;3 to 7 are schematic diagrams of shared information of a host provided by the present application;

图8为本申请提供的一种数据共享装置的结构示意图;FIG8 is a schematic diagram of the structure of a data sharing device provided by the present application;

图9~图10为本申请提供的一种计算设备的结构示意图。9 and 10 are schematic diagrams of the structure of a computing device provided by the present application.

具体实施方式DETAILED DESCRIPTION

在对本申请实施例所提供的一种数据共享方法、系统以及设备介绍之前,先对本申请实施例涉及的一些概念进行说明。Before introducing a data sharing method, system, and device provided in the embodiments of the present application, some concepts involved in the embodiments of the present application are first explained.

(1)、虚拟化技术、计算实例、容器(container)、虚拟机(virtual machine,VM)。(1) Virtualization technology, computing instance, container, virtual machine (VM).

虚拟化(virtualization)是一种资源管理技术,通过虚拟化技术将主机的各种物理资源,如处理器、内存及接口等,予以抽象、转换后呈现出来。虚拟化是一种从逻辑角度出发的资源配置方法,是物理资源的逻辑抽象。Virtualization is a resource management technology that abstracts and transforms the host's physical resources, such as processors, memory, and interfaces, and presents them. Virtualization is a resource configuration method from a logical perspective and is a logical abstraction of physical resources.

计算设备借助虚拟化技术能够在计算设备上形成具备独立的运行环境的软件模块,在本申请实施例中将计算设备上形成的具备独立的运行环境的软件模块称为计算实例。该计算实例可以为虚拟机,也可以为容器。The computing device can form a software module with an independent operating environment on the computing device by means of virtualization technology. In the embodiment of the present application, the software module with an independent operating environment formed on the computing device is called a computing instance. The computing instance can be a virtual machine or a container.

虚拟机是通过虚拟机化技术模拟的具有完整硬件系统功能的、运行在一个完全隔离环境中的“完整计算机”。实体计算机中能够完成的工作在虚拟机中都能够实现。虚拟机具备处理器(该处理器也被称为虚拟处理器)、内存、硬盘等组件,虚拟机的处理器、内存、硬盘等组件均是由主机的处理器、内存、硬盘等组件虚拟而成的。A virtual machine is a "complete computer" that runs in a completely isolated environment and has complete hardware system functions, which is simulated by virtualization technology. All the work that can be done in a physical computer can be done in a virtual machine. A virtual machine has a processor (the processor is also called a virtual processor), memory, hard disk and other components. The processor, memory, hard disk and other components of the virtual machine are virtualized from the processor, memory, hard disk and other components of the host.

容器是通过虚拟化技术模拟的一种独立的运行环境,容器类似于一个轻量级的沙盒,实现对容器外部的软件以及硬件进行屏蔽,容器是在操作系统层面上实现虚拟化,直接复用主机的操作系统。A container is an independent operating environment simulated by virtualization technology. A container is similar to a lightweight sandbox that shields software and hardware outside the container. The container implements virtualization at the operating system level and directly reuses the host's operating system.

对计算设备来说,计算实例会被看做是一种特殊的“进程”。该“进程”会执行计算任务、还会占用计算设备的处理器、内存、硬盘等资源。For computing devices, computing instances are considered to be a special kind of "process". This "process" will perform computing tasks and occupy the computing device's processor, memory, hard disk and other resources.

(2)、设备直通、直通设备。(2) Direct access to equipment and direct access to equipment.

设备直通是指将设备直通给主机使用,为了能够便于将设备直通给主机,产生了一些在硬件层面进行虚拟化的技术,基于硬件层面的虚拟化技术能够将硬件虚拟化为多个“设备”,这些“设备”被计算设备(如操作系统)或者计算实例(如虚拟机、容器)识别为独立的硬件设备。计算设备以及计算实例均会将这些虚拟的设备当做真实的硬件使用。单根直通(single-root I/O virtualization,SR-IOV)技术是一种常见硬件层面的虚拟化技术。Device passthrough refers to passing a device directly to the host for use. In order to facilitate passing a device directly to the host, some virtualization technologies at the hardware level have been developed. Virtualization technologies based on the hardware level can virtualize the hardware into multiple "devices". These "devices" are recognized as independent hardware devices by computing devices (such as operating systems) or computing instances (such as virtual machines and containers). Both computing devices and computing instances will use these virtual devices as real hardware. Single-root I/O virtualization (SR-IOV) technology is a common hardware-level virtualization technology.

在本申请实施例中,借助硬件层面的虚拟化技术,物理形态的存储设备可以虚拟出多个逻辑设备。每个逻辑设备具备存储设备的功能,能够实现数据存储。主机可以分别将各自的数据存储在不同的逻辑硬盘上。In the embodiment of the present application, with the help of hardware-level virtualization technology, a physical storage device can be virtualized into multiple logical devices. Each logical device has the function of a storage device and can realize data storage. The host can store its own data on different logical hard disks.

(3)、计算快速互联(compute express link,CXL)。(3) Compute Express Link (CXL).

CXL是在快捷外围部件互连标准(peripheral component interconnectexpress,PCIe)的基础上演化而来的,CXL运行在PCIE物理层上的,与PCIE具有相同的电器特性。相较于PCIE,CXL对缓存以及内存进行了优化,CXL能够支持更低的时延以及更高的带宽。CXL is evolved from the Peripheral Component Interconnect Express (PCIe). CXL runs on the PCIE physical layer and has the same electrical characteristics as PCIE. Compared with PCIE, CXL optimizes cache and memory, and can support lower latency and higher bandwidth.

CXL标准下,提出了“多逻辑设备(multi-logic device,MLD)”,MLD组件是CXL标准下实现资源逻辑划分的组件,MLD组件可以理解为软件模块,与可以理解为硬件模块。对于存储设备这类存储资源来说,MLD组件能够将存储设备划分为16个甚至更多数量的逻辑设备,为每个逻辑设备分配逻辑设备的标识符(LD-ID),每个逻辑设备都能够作为独立的CXL设备(CXL设备是指通过CXL接入的设备)运行。主机能够识别该逻辑设备,访问该逻辑设备。Under the CXL standard, "multi-logic device (MLD)" is proposed. The MLD component is a component that implements the logical division of resources under the CXL standard. The MLD component can be understood as a software module and a hardware module. For storage resources such as storage devices, the MLD component can divide the storage device into 16 or more logical devices, assign a logical device identifier (LD-ID) to each logical device, and each logical device can operate as an independent CXL device (CXL device refers to a device connected through CXL). The host can identify the logical device and access it.

如图1所示,为本申请实施例提供的一种计算系统的结构示意图,在该计算系统中包括主机100、存储控制器200以及存储设备300。本申请实施例中并不限定该计算设备中包括的主机100以及存储设备300的数量,该计算系统中可以包括一个主机100,也可以包括多个主机100。计算系统中可以包括一个存储设备300或多个存储设备300。图1中仅示例性的展示了三个主机100以及三个存储设备300。As shown in FIG1 , it is a schematic diagram of the structure of a computing system provided in an embodiment of the present application, in which a host 100, a storage controller 200 and a storage device 300 are included in the computing system. The number of hosts 100 and storage devices 300 included in the computing device is not limited in the embodiment of the present application, and the computing system may include one host 100 or multiple hosts 100. The computing system may include one storage device 300 or multiple storage devices 300. FIG1 only shows three hosts 100 and three storage devices 300 by way of example.

在该计算系统中,主机100、存储控制器200以及存储设备300之间可以基于计算互联总线连接,其中,计算互联总线可以为基于PCIe的线路,也可以为CXL、统一总线(unifiedbus,Ubus或UB)或缓存一致互联协议(cache coherent interconnect for accelerators,CCIX)协议或其他协议的总线。In the computing system, the host 100, the storage controller 200 and the storage device 300 can be connected based on a computing interconnect bus, wherein the computing interconnect bus can be a PCIe-based line, or a bus of CXL, unified bus (Ubus or UB) or cache coherent interconnect for accelerators (CCIX) protocol or other protocols.

主机100是计算系统中主要的数据处理单元,是计算系统中承担业务的主要部分。该主机100可以为桌面电脑、服务器、笔记本电脑以及移动设备等计算设备。该主机100可以为裸金属服务器。主机100上也可以为部署在计算设备上的容器或虚拟机等计算实例,该主机100还可以是处理器或者处理器核。The host 100 is the main data processing unit in the computing system and is the main part of the computing system that undertakes the business. The host 100 can be a computing device such as a desktop computer, a server, a laptop, and a mobile device. The host 100 can be a bare metal server. The host 100 can also be a computing instance such as a container or a virtual machine deployed on a computing device, and the host 100 can also be a processor or a processor core.

其中,处理器可以为中央处理器(central processing unit,CPU)、专用集成电路(application specific integrated circuit,ASIC)、现场可编程门阵列(fieldprogrammable gate array,FPGA)、人工智能(artificial intelligence,AI)芯片、片上系统(system on chip,SoC)或复杂可编程逻辑器件(complex programmable logic device,CPLD),图形处理器(graphics processing unit,GPU),数据处理器单元(data processingunit,DPU)等,凡是具备处理功能的模块均可以作为处理器。处理器核是处理器中的核(core),是处理器的核心,本申请实施例并不显得该处理器核的类型,该处理器核可以为高级精简指令集机器(advanced RISC machine,ARM)、也可以为无内部互锁流水级的微处理器(microprocessor without interlocked pipeline stages,MIPS)。Among them, the processor can be a central processing unit (CPU), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), an artificial intelligence (AI) chip, a system on chip (SoC) or a complex programmable logic device (CPLD), a graphics processing unit (GPU), a data processing unit (DPU), etc., and any module with processing functions can be used as a processor. The processor core is the core in the processor, and the embodiment of the present application does not show the type of the processor core. The processor core can be an advanced reduced instruction set machine (ARM) or a microprocessor without interlocked pipeline stages (MIPS).

本申请并不限定主机100的具体形态。例如,当该计算系统部署在单个计算设备上时,该多个主机100可以部署在同一个计算设备上,任一主机100可以为该计算设备上部署的容器或虚拟机,也可以为该计算设备中的处理器或者处理器核。又例如,当该计算系统分布式部署在多个计算设备上时,该多个主机100可以分布在该多个计算设备上,任一主机100可以为部署一个计算设备上部署的容器或虚拟机,也可以为一个计算设备中的处理器或者处理器核,也可以为一个计算设备。The present application does not limit the specific form of the host 100. For example, when the computing system is deployed on a single computing device, the multiple hosts 100 can be deployed on the same computing device, and any host 100 can be a container or virtual machine deployed on the computing device, or a processor or processor core in the computing device. For another example, when the computing system is distributed and deployed on multiple computing devices, the multiple hosts 100 can be distributed on the multiple computing devices, and any host 100 can be a container or virtual machine deployed on a computing device, or a processor or processor core in a computing device, or a computing device.

存储设备300具备存储功能,面向主机100提供存储资源。该存储设备300能够用于存储主机100所需存储的数据。在本申请实施例中,存储设备300(或存储设备300虚拟形成的逻辑设备)可以作为主机100的“内存”,临时存储主机100运行所需的数据。该存储设备300(或存储设备300虚拟形成的逻辑设备)也可以作为主机100的“硬盘”,能够帮助主机100临时持久化存储数据。The storage device 300 has a storage function and provides storage resources for the host 100. The storage device 300 can be used to store data required by the host 100. In the embodiment of the present application, the storage device 300 (or the logical device virtually formed by the storage device 300) can be used as the "memory" of the host 100 to temporarily store data required for the operation of the host 100. The storage device 300 (or the logical device virtually formed by the storage device 300) can also be used as the "hard disk" of the host 100, which can help the host 100 temporarily and persistently store data.

本申请实施例并不限定存储设备300的类型,如该存储设备300可以计算设备中的内存,如只读存储器(read only memory,ROM)、动态随机存取存储器(dynamic randomaccess memory,DRAM),或者存储级存储器(storage class memory,SCM)、静态随机存取存储器(static random access memory,SRAM)、双列直插式存储器模块或双线存储器模块(dualin-linememorymodule,DIMM)等。存储设备300还可以为计算设备中的持久化存储器,如机械硬盘(hard disk drive,HDD)或固态硬盘(solid state drive,SSD)。The embodiment of the present application does not limit the type of storage device 300. For example, the storage device 300 can be a memory in a computing device, such as a read-only memory (ROM), a dynamic random access memory (DRAM), or a storage class memory (SCM), a static random access memory (SRAM), a dual in-line memory module or a dual in-line memory module (DIMM). The storage device 300 can also be a persistent memory in a computing device, such as a hard disk drive (HDD) or a solid state drive (SSD).

存储控制器200用于管理存储设备300。存储控制器200对存储设备300的管理表现在如下方面:The storage controller 200 is used to manage the storage device 300. The management of the storage device 300 by the storage controller 200 is manifested in the following aspects:

1)、存储设备300的虚拟化。1) Virtualization of the storage device 300.

存储控制器200可以将存储设备300虚拟为多个逻辑设备(logical device,LD),每个逻辑设备可以与一个主机100绑定。逻辑设备与存储设备300类似,具备数据存储功能,能够为所绑定的主机100存储数据。主机100可以通过存储控制器200访问所绑定的逻辑设备。在本申请实施例中将与主机100绑定的逻辑设备称为主机100的逻辑设备。任一逻辑设备可以位于同一个存储设备300上,也可以位于不同的存储设备300上。The storage controller 200 can virtualize the storage device 300 into multiple logical devices (logical devices, LD), each of which can be bound to a host 100. The logical device is similar to the storage device 300, has a data storage function, and can store data for the bound host 100. The host 100 can access the bound logical device through the storage controller 200. In the embodiment of the present application, the logical device bound to the host 100 is referred to as the logical device of the host 100. Any logical device can be located on the same storage device 300 or on different storage devices 300.

本申请实施例并不限定存储控制器200将存储设备300虚拟为多个逻辑设备的方式。存储控制器200上可以部署有多逻辑设备(multi-logic device,MLD)组件,MLD组件将存储设备300虚拟为多个逻辑设备。存储控制器200也可以采用硬件层面的虚拟机化技术,将存储设备300虚拟化为多个逻辑设备,将逻辑设备直通给主机100。The embodiment of the present application does not limit the manner in which the storage controller 200 virtualizes the storage device 300 into multiple logical devices. A multi-logic device (MLD) component may be deployed on the storage controller 200, and the MLD component virtualizes the storage device 300 into multiple logical devices. The storage controller 200 may also use hardware-level virtualization technology to virtualize the storage device 300 into multiple logical devices and directly pass the logical devices to the host 100.

2)、主机100的共享信息的维护。2) Maintenance of shared information of host 100.

在本申请实施例中,每个主机100设置有共享信息。该主机100的共享信息记录了主机100的存储装置310中的共享存储空间,该主机100的存储装置310还记录了主机100的存储装置310中的共享存储空间与其他主机100的存储装置310中存储空间之间的映射关系。In the embodiment of the present application, each host 100 is provided with sharing information. The sharing information of the host 100 records the shared storage space in the storage device 310 of the host 100, and the storage device 310 of the host 100 also records the mapping relationship between the shared storage space in the storage device 310 of the host 100 and the storage space in the storage device 310 of other hosts 100.

值得注意的是,在本申请实施例中主机100的存储装置310存在两种可能的形态,例如,该主机100的存储装置310可以是该计算系统中的物理形态的存储设备300,也可以是该计算系统中由存储设备300虚拟化后形成的逻辑设备。无论主机的100的存储装置310是物理形态的存储设备300,还是逻辑设备,主机100的存储装置310所代表的意义是指该存储装置的存储空间是由主机100所使用的,主机100能够决定主机100的存储装置310中的存储空间是否可以允许共享。故而,主机100的存储装置310的存储空间包括共享存储空间以及非共享存储空间。It is worth noting that in the embodiment of the present application, the storage device 310 of the host 100 has two possible forms. For example, the storage device 310 of the host 100 can be a physical storage device 300 in the computing system, or a logical device formed by virtualizing the storage device 300 in the computing system. Regardless of whether the storage device 310 of the host 100 is a physical storage device 300 or a logical device, the storage device 310 of the host 100 means that the storage space of the storage device is used by the host 100, and the host 100 can determine whether the storage space in the storage device 310 of the host 100 can be shared. Therefore, the storage space of the storage device 310 of the host 100 includes shared storage space and non-shared storage space.

主机100的存储装置310中的共享存储空间是指允许与该主机100之外的主机100发生共享的存储空间。主机100的存储装置310中的共享存储空间能够映射到该主机100之外的主机100的存储装置310中的存储空间,主机100的存储装置310中的共享存储空间与除该主机100之外的主机100的存储装置310中的存储空间存在映射关系。相反的,主机100的存储装置310中的非共享存储空间是指不允许与该主机100之外的主机100发生共享的存储空间。主机100的存储装置310中的非共享存储空间不允许映射到该主机100之外的主机100的存储装置310中的存储空间,主机100的存储装置310中的非共享存储空间与除该主机100之外的主机100的存储装置310中的存储空间之间不存在映射关系。The shared storage space in the storage device 310 of the host 100 refers to the storage space that is allowed to be shared with the host 100 other than the host 100. The shared storage space in the storage device 310 of the host 100 can be mapped to the storage space in the storage device 310 of the host 100 other than the host 100, and there is a mapping relationship between the shared storage space in the storage device 310 of the host 100 and the storage space in the storage device 310 of the host 100 other than the host 100. On the contrary, the non-shared storage space in the storage device 310 of the host 100 refers to the storage space that is not allowed to be shared with the host 100 other than the host 100. The non-shared storage space in the storage device 310 of the host 100 is not allowed to be mapped to the storage space in the storage device 310 of the host 100 other than the host 100, and there is no mapping relationship between the non-shared storage space in the storage device 310 of the host 100 and the storage space in the storage device 310 of the host 100 other than the host 100.

主机100的存储装置310中的共享存储空间存在两种状态,一种状态为已共享状态,另一种状态为待共享状态。The shared storage space in the storage device 310 of the host 100 has two states, one state is a shared state, and the other state is a to-be-shared state.

已共享状态是指该主机100的存储装置310中共享存储空间已与其他主机100发生共享,该主机100存储装置310中共享存储空间与其他主机100的存储装置310中的存储空间之间建立了映射关系。主机100对该共享存储空间的读操作可以被存储控制器200转换为对与该共享存储空间存在映射关系的其他主机100的存储装置310中的存储空间的读操作。也就是说,当主机100发起对共享存储空间的读请求(如读取请求中携带的数据的地址属于该共享存储空间)时,存储管理控制器200接收到该读请求,可以从与该共享存储空间存在映射关系的其他主机100的存储装置310中的存储空间读取数据,将读取的数据反馈给主机100。The shared state means that the shared storage space in the storage device 310 of the host 100 has been shared with other hosts 100, and a mapping relationship has been established between the shared storage space in the storage device 310 of the host 100 and the storage space in the storage devices 310 of other hosts 100. The read operation of the host 100 on the shared storage space can be converted by the storage controller 200 into a read operation on the storage space in the storage device 310 of other hosts 100 that has a mapping relationship with the shared storage space. In other words, when the host 100 initiates a read request for the shared storage space (such as the address of the data carried in the read request belongs to the shared storage space), the storage management controller 200 receives the read request, can read data from the storage space in the storage device 310 of other hosts 100 that has a mapping relationship with the shared storage space, and feed the read data back to the host 100.

待共享状态是指该主机100的存储装置310中共享存储空间还未与其他主机100发生共享,该主机100存储装置310中共享存储空间与其他主机100的存储装置310中的存储空间之间还未建立了映射关系。对于待共享状态的共享存储空间,主机100可以针对该共享存储资源发起数据迁移指令,该数据迁移指令用于请求将其他主机100的存储装置310中的存储空间的数据迁移到该共享存储空间(如数据迁移指令携带数据在其他主机100的存储装置310中的地址以及该主机100的存储装置310的地址,该主机100的存储装置310的地址属于待共享的共享存储空间)。当存储控制器200在接收到该数据迁移指令后,存储控制器200无需进行真实的数据迁移,仅需要更新主机100的共享信息,建立主机100存储装置310中共享存储空间与其他主机100的存储装置310中的存储空间之间的映射关系,这样处于待共享状态的共享存储空间也就转换为处于已共享状态的共享存储空间。The state to be shared means that the shared storage space in the storage device 310 of the host 100 has not been shared with other hosts 100, and a mapping relationship has not been established between the shared storage space in the storage device 310 of the host 100 and the storage space in the storage devices 310 of other hosts 100. For the shared storage space in the state to be shared, the host 100 can initiate a data migration instruction for the shared storage resource, and the data migration instruction is used to request that the data in the storage space of the storage device 310 of other hosts 100 be migrated to the shared storage space (for example, the data migration instruction carries the address of the data in the storage device 310 of other hosts 100 and the address of the storage device 310 of the host 100, and the address of the storage device 310 of the host 100 belongs to the shared storage space to be shared). When the storage controller 200 receives the data migration instruction, the storage controller 200 does not need to perform actual data migration, but only needs to update the sharing information of the host 100 and establish a mapping relationship between the shared storage space in the storage device 310 of the host 100 and the storage space in the storage device 310 of other hosts 100, so that the shared storage space in the to-be-shared state is converted into the shared storage space in the shared state.

存储控制器200可以维护每个主机100的共享信息,更新主机100的共享信息中记录的主机100的存储装置310中的共享存储空间,其中,对主机100的共享信息的更新包括但不限于:The storage controller 200 may maintain the shared information of each host 100, and update the shared storage space in the storage device 310 of the host 100 recorded in the shared information of the host 100, wherein the update of the shared information of the host 100 includes but is not limited to:

增加主机100的存储装置310中的共享存储空间、删除主机100的存储装置310中的共享存储空间、将待共享的共享存储空间的状态配置为已共享状态(也即建立主机100存储装置310中共享存储空间与其他主机100的存储装置310中的存储空间之间的映射关系)、将已共享的共享存储空间的状态配置为待共享状态(也即删除主机100存储装置310中共享存储空间与其他主机100的存储装置310中的存储空间之间的映射关系)、修改主机100存储装置310中共享存储空间与其他主机100的存储装置310中的存储空间之间的映射关系。Increase the shared storage space in the storage device 310 of the host 100, delete the shared storage space in the storage device 310 of the host 100, configure the state of the shared storage space to be shared as a shared state (that is, establish a mapping relationship between the shared storage space in the storage device 310 of the host 100 and the storage space in the storage devices 310 of other hosts 100), configure the state of the shared shared storage space as a to-be-shared state (that is, delete the mapping relationship between the shared storage space in the storage device 310 of the host 100 and the storage space in the storage devices 310 of other hosts 100), and modify the mapping relationship between the shared storage space in the storage device 310 of the host 100 and the storage space in the storage devices 310 of other hosts 100.

①:增加主机100的存储装置310中的共享存储空间。①: Increase the shared storage space in the storage device 310 of the host 100.

对于任一主机100,主机100的存储装置310中哪些存储空间允许共享,哪些存储空间不允许共享可以是主机100决定的。主机100在需要增加主机100的存储装置310中的共享存储空间时,可以向存储控制器200发起共享指令,该共享指令用于请求增加共享存储空间,该共享指令携带了用于指示需要增加的共享存储空间的信息,如该共享存储空间的地址。存储控制器200在接收到该共享指示后,可以更新该主机100的共享信息,在该主机100的共享信息中增加该共享存储空间,也即在该主机100的共享信息增加该共享存储空间的信息。For any host 100, which storage spaces in the storage device 310 of the host 100 are allowed to be shared and which storage spaces are not allowed to be shared can be determined by the host 100. When the host 100 needs to increase the shared storage space in the storage device 310 of the host 100, it can initiate a sharing instruction to the storage controller 200. The sharing instruction is used to request to increase the shared storage space. The sharing instruction carries information for indicating the shared storage space to be increased, such as the address of the shared storage space. After receiving the sharing instruction, the storage controller 200 can update the sharing information of the host 100 and add the shared storage space to the sharing information of the host 100, that is, add the information of the shared storage space to the sharing information of the host 100.

②:删除主机100的存储装置310中的共享存储空间。②: Delete the shared storage space in the storage device 310 of the host 100.

对于任一主机100,主机100的存储装置310中哪些存储空间允许共享,哪些存储空间不允许共享可以是主机100决定的。主机100在需要禁止已记录在共享信息中的共享存储空间被共享时,可以向存储控制器200发起禁止共享指令,该禁止共享指令用于请求删除共享存储空间,该禁止共享指令携带了用于指示需要删除的共享存储空间的信息,如该共享存储空间的地址。存储控制器200在接收到该禁止共享指令后,可以更新该主机100的共享信息,在该主机100的共享信息中删除该共享存储空间,如在该主机100的共享信息删除主机100存储装置310中共享存储空间与其他主机100的存储装置310中的存储空间之间的映射关系、删除该主机100存储装置310中共享存储空间的信息,或将该共享存储空间的状态标识为禁止共享。For any host 100, which storage spaces in the storage device 310 of the host 100 are allowed to be shared and which storage spaces are not allowed to be shared can be determined by the host 100. When the host 100 needs to prohibit the shared storage space recorded in the sharing information from being shared, it can initiate a prohibit sharing instruction to the storage controller 200. The prohibit sharing instruction is used to request the deletion of the shared storage space. The prohibit sharing instruction carries information for indicating the shared storage space to be deleted, such as the address of the shared storage space. After receiving the prohibit sharing instruction, the storage controller 200 can update the sharing information of the host 100, delete the shared storage space in the sharing information of the host 100, such as deleting the mapping relationship between the shared storage space in the storage device 310 of the host 100 and the storage space in the storage device 310 of other hosts 100 in the sharing information of the host 100, deleting the information of the shared storage space in the storage device 310 of the host 100, or marking the status of the shared storage space as prohibited from sharing.

在本申请实施例中还存在一种删除主机100的存储装置310中的共享存储空间的场景,当主机100对处于已共享状态的共享存储空间发起写请求时,存储管理控制器200接收到该写请求,可以更新该主机100的共享信息,在该主机100的共享信息中删除该共享存储空间,如在该主机100的共享信息删除该共享存储空间与其他主机100的存储装置310中的存储空间之间的映射关系,或将该共享存储空间的状态标识为禁止共享,并根据写请求在该共享存储空间中写入数据。In an embodiment of the present application, there is also a scenario of deleting a shared storage space in the storage device 310 of the host 100. When the host 100 initiates a write request to a shared storage space in a shared state, the storage management controller 200 receives the write request and can update the sharing information of the host 100 and delete the shared storage space in the sharing information of the host 100, such as deleting the mapping relationship between the shared storage space and the storage space in the storage device 310 of other hosts 100 in the sharing information of the host 100, or marking the status of the shared storage space as prohibited from sharing, and writing data in the shared storage space according to the write request.

③:将待共享的共享存储空间的状态配置为已共享状态。③: Configure the status of the shared storage space to be shared as shared.

参见前述内容,关于主机100发起数据迁移指令的相关说明。在主机100发起数据迁移指令的过程中,存储控制器200可以在共享信息中建立主机100存储装置310中共享存储空间与其他主机100的存储装置310中的存储空间之间的映射关系,将处于待共享状态的共享存储空间也就转换为处于已共享状态的共享存储空间。See the above content for the relevant description of the host 100 initiating the data migration instruction. In the process of the host 100 initiating the data migration instruction, the storage controller 200 can establish a mapping relationship between the shared storage space in the storage device 310 of the host 100 and the storage space in the storage device 310 of other hosts 100 in the sharing information, and convert the shared storage space in the to-be-shared state into the shared storage space in the shared state.

④:将已共享的共享存储空间的状态配置为待共享状态。④: Set the shared storage space to a waiting-to-share state.

当主机100对处于已共享状态的共享存储空间发起写请求时,存储管理控制器200接收到该写请求,除了在该主机100的共享信息中删除该共享存储空间,也可以将已共享的共享存储空间的状态配置为待共享状态,删除已共享的共享存储空间与其他主机100的存储装置310中的存储空间之间的映射关系。When the host 100 initiates a write request to a shared storage space in a shared state, the storage management controller 200 receives the write request and, in addition to deleting the shared storage space in the sharing information of the host 100, can also configure the state of the shared shared storage space to a to-be-shared state and delete the mapping relationship between the shared shared storage space and the storage space in the storage device 310 of the other host 100.

当主机100的存储装置310中的共享存储空间已与其他主机100发生共享之后,主机100可以决定不再与该其他主机100共享该共享存储空间,主机100可以向存储控制器200发起共享变更指令,该共享变更指令用于请求解除该共享存储空间与其他主机100的共享关系,该共享变更指令携带了用于指示该共享存储空间的信息,如该共享存储空间的地址。存储控制器200在接收到该共享变更指令后,可以更新该主机100的共享信息,将已共享的共享存储空间的状态配置为待共享状态,删除已共享的共享存储空间与其他主机100的存储装置310中的存储空间之间的映射关系。After the shared storage space in the storage device 310 of the host 100 has been shared with other hosts 100, the host 100 may decide not to share the shared storage space with the other hosts 100, and the host 100 may initiate a sharing change instruction to the storage controller 200, the sharing change instruction is used to request to release the sharing relationship between the shared storage space and other hosts 100, and the sharing change instruction carries information indicating the shared storage space, such as the address of the shared storage space. After receiving the sharing change instruction, the storage controller 200 may update the sharing information of the host 100, configure the state of the shared shared storage space to the waiting-to-be-shared state, and delete the mapping relationship between the shared shared storage space and the storage space in the storage device 310 of the other host 100.

⑤:修改主机100存储装置310中共享存储空间与其他主机100的存储装置310中的存储空间之间的映射关系。⑤: Modify the mapping relationship between the shared storage space in the storage device 310 of the host 100 and the storage space in the storage device 310 of other hosts 100 .

当主机100发起的数据迁移指令请求将其他主机100的存储装置310中的存储空间的数据迁移到处于已共享状态的共享存储空间(如数据迁移指令携带数据在其他主机100的存储装置310中的地址以及该主机100的存储装置310的地址1,该主机100的存储装置310的地址1属于已共享的共享存储空间)。当存储控制器200在接收到该数据迁移指令后,存储控制器200无需进行真实的数据迁移,仅需要更新主机100的共享信息,修改主机100的共享信息中主机100存储装置310中该共享存储空间与其他主机100的存储装置310中的存储空间之间的映射关系,建立该共享存储空间中该地址1所指示的存储空间与其他主机100的存储装置310中的数据所在的存储空间之间的映射关系,对于该共享存储空间中除该地址1所指示的存储空间之外的存储空间保持原有的已共享的状态。When the host 100 initiates a data migration instruction request to migrate the data in the storage space of the storage device 310 of other hosts 100 to the shared storage space in a shared state (e.g., the data migration instruction carries the address of the data in the storage device 310 of other hosts 100 and address 1 of the storage device 310 of the host 100, and address 1 of the storage device 310 of the host 100 belongs to the shared shared storage space). After receiving the data migration instruction, the storage controller 200 does not need to perform real data migration, but only needs to update the sharing information of the host 100, modify the mapping relationship between the shared storage space in the storage device 310 of the host 100 and the storage space in the storage device 310 of other hosts 100 in the sharing information of the host 100, establish a mapping relationship between the storage space indicated by the address 1 in the shared storage space and the storage space where the data in the storage device 310 of other hosts 100 is located, and keep the original shared state for the storage space in the shared storage space except the storage space indicated by the address 1.

3)、对主机100的存储装置310进行读写。3) Read and write data to the storage device 310 of the host 100.

当主机100需要访问该主机的100的存储装置310时,可以发起数据访问请求,如用于请求写入数据的写请求,以及用于请求读取数据的读请求。存储控制器200在接收到该数据访问请求后,可以根据该数据访问请求访问该存储装置310。如当数据访问请求为写请求时,存储控制器200可以将写请求携带的数据写入到该写请求携带的数据的地址所指示的位置处。如当数据访问请求为读请求时,若该读请求携带的数据的地址属于共享存储空间,且该共享存储空间处于已共享的状态,存储控制器200可以从与该共享存储空间存在映射关系的其他主机100的存储装置310的存储空间读取数据,反馈给主机100。若该读请求携带的存储空间的地址并非为共享存储空间的地址,存储控制器200访问该主机的存储装置310,从该读请求携带的存储空间的地址所指示的位置处读取数据,并将读取的数据反馈给100。When the host 100 needs to access the storage device 310 of the host 100, a data access request may be initiated, such as a write request for requesting to write data, and a read request for requesting to read data. After receiving the data access request, the storage controller 200 may access the storage device 310 according to the data access request. For example, when the data access request is a write request, the storage controller 200 may write the data carried by the write request to the location indicated by the address of the data carried by the write request. For example, when the data access request is a read request, if the address of the data carried by the read request belongs to a shared storage space, and the shared storage space is in a shared state, the storage controller 200 may read data from the storage space of the storage device 310 of other hosts 100 that have a mapping relationship with the shared storage space, and feed it back to the host 100. If the address of the storage space carried by the read request is not the address of the shared storage space, the storage controller 200 accesses the storage device 310 of the host, reads data from the location indicated by the address of the storage space carried by the read request, and feeds the read data back to 100.

本申请实施例并不限定该存储控制器200的具体形态,该存储控制器200可以为软件模块,如该存储控制器200可以是允许在处理器上的软件。该存储控制器200也可以为硬件模块,如该存储控制器200可以为ASIC、FPGA、AI芯片、SoC或复杂可编程逻辑器件(complex programmable logic device,CPLD、可编程逻辑器件(programmable logicdevice,PLD)等。The embodiment of the present application does not limit the specific form of the storage controller 200. The storage controller 200 may be a software module, such as the storage controller 200 may be software allowed on a processor. The storage controller 200 may also be a hardware module, such as the storage controller 200 may be an ASIC, FPGA, AI chip, SoC or complex programmable logic device (CPLD, programmable logic device, PLD), etc.

前述内容提及的“主机100的存储装置310中共享存储空间与其他主机100的存储装置310中的存储空间之间的映射关系”可以表现为主机100的存储装置310中共享存储空间的地址与其他主机100的存储装置310中的存储空间的地址之间的映射关系。The “mapping relationship between the shared storage space in the storage device 310 of the host 100 and the storage space in the storage devices 310 of other hosts 100” mentioned in the above content can be expressed as a mapping relationship between the address of the shared storage space in the storage device 310 of the host 100 and the address of the storage space in the storage devices 310 of other hosts 100.

本申请实施例中提及的地址(如共享存储空间的地址、存储空间的地址、数据的地址等),本申请涉及两类地址,一类为主机100与存储控制器200交互所需的地址,该类地址称为主机物理地址(host physical address,HPA),主机发起的数据访问请求(如写请求或读请求)以及各种指令(共享指令、数据迁移指令、禁止共享指令、共享变更指令等)中携带的地址为主机物理地址,HPA是主机100侧用于表征数据的存储位置所使用的地址。另一类为存储控制器200与存储装置310300(或存储装置310)交互所需的地址称为设备物理地址(device physical address,DPA),该DPA仅存储设备300或存储装置310侧用于表征数据的存储位置所使用的地址,故而,DPA是存储设备300或存储装置310侧可见的地址,主机100并不可见。The addresses mentioned in the embodiments of the present application (such as the address of the shared storage space, the address of the storage space, the address of the data, etc.) are related to two types of addresses in the present application. One type is the address required for the host 100 to interact with the storage controller 200. This type of address is called the host physical address (HPA). The address carried in the data access request (such as a write request or a read request) and various instructions (sharing instructions, data migration instructions, prohibition of sharing instructions, sharing change instructions, etc.) initiated by the host is the host physical address. The HPA is the address used by the host 100 side to represent the storage location of the data. The other type is the address required for the storage controller 200 to interact with the storage device 310300 (or storage device 310) is called the device physical address (DPA). The DPA is only the address used by the storage device 300 or storage device 310 side to represent the storage location of the data. Therefore, the DPA is an address visible to the storage device 300 or storage device 310 side, and is not visible to the host 100.

HPA需要经过转换才能变成DPA。在本申请实施例中,地址转换操作可以由存储控制器200执行,存储控制器200能够获取主机100的主机设备地址映射表(host devicemapping,HDM),主机100的主机设备地址映射表记录了主机100的HPA与DPA之间的映射关系。存储控制器200通过查询HDM可以将HPA转换DPA。HPA needs to be converted to DPA. In the embodiment of the present application, the address conversion operation can be performed by the storage controller 200, and the storage controller 200 can obtain the host device address mapping table (host device mapping, HDM) of the host 100. The host device address mapping table of the host 100 records the mapping relationship between the HPA and DPA of the host 100. The storage controller 200 can convert the HPA to the DPA by querying the HDM.

例如,存储控制器200接收到主机发起的数据访问请求(如写请求或读请求)后,获取该数据访问请求中携带的HPA,查询HDM可以将HPA转换DPA,之后,根据转换获得的DPA访问该主机100的存储装置310。For example, after the storage controller 200 receives a data access request (such as a write request or a read request) initiated by the host, it obtains the HPA carried in the data access request, queries the HDM to convert the HPA into a DPA, and then accesses the storage device 310 of the host 100 according to the converted DPA.

鉴于这两类不同的地址,主机100的共享信息以如下两种形式表征。In view of these two different types of addresses, the shared information of the host 100 is represented in the following two forms.

形式一、主机100的共享信息中用HPA表征存储空间(该存储空间指共享存储空间或者与共享存储空间存在映射关系的存储空间)。也即该100的共享信息中记录的共享存储空间的地址为HPA,与已共享的共享存储空间存在映射关系的存储空间的地址也为HPA。Form 1: HPA is used to represent storage space in the shared information of the host 100 (the storage space refers to the shared storage space or the storage space that has a mapping relationship with the shared storage space). That is, the address of the shared storage space recorded in the shared information of the host 100 is HPA, and the address of the storage space that has a mapping relationship with the shared shared storage space is also HPA.

采用这种形式,存储控制器200在接收到主机发起的数据访问请求(如写请求或读请求)以及各种指令(共享指令、数据迁移指令、禁止共享指令、共享变更指令等)时,可以先查询该主机100的共享信息。若需要进行地址转换,在查询了该主机100的共享信息之后再查询HDM(需要查询HDM的场景主要是指在接收到主机发起的数据访问请求的场景)。In this form, when the storage controller 200 receives a data access request (such as a write request or a read request) and various instructions (sharing instructions, data migration instructions, sharing prohibition instructions, sharing change instructions, etc.) initiated by the host, it can first query the sharing information of the host 100. If address conversion is required, the HDM is queried after the sharing information of the host 100 is queried (the scenario in which the HDM needs to be queried mainly refers to the scenario in which a data access request initiated by the host is received).

对于主机发起的数据访问请求,存储控制器200可以查询该主机100的共享信息确定数据访问请求中携带的HPA是否为共享存储空间的地址,若数据访问请求中携带的HPA并非为共享存储空间的地址,存储控制器200根据HDM将该HPA转换为主机100的存储装置310的DPA(可以简称为主机100的DPA)后,访问该主机100的存储装置310,在该DPA处写入数据或读取数据。若数据访问请求中携带的HPA为共享存储空间的地址,对于读请求,存储控制器200将查询与该HPA存在映射关系的其他主机100的HPA,将该其他主机100的HPA转换为其他主机100的DPA后,访问该其他主机100的存储装置310,在该DPA处读取数据,将读取的数据反馈给主机100。对于写请求,存储控制器200更新该主机100的共享信息,删除该共享信息中记录的该HPA,或者将该HPA的状态配置为待共享状态,根据HDM将该HPA转换为主机100的DPA后,访问该主机100的存储装置310,在该DPA处写入数据。For a data access request initiated by a host, the storage controller 200 may query the sharing information of the host 100 to determine whether the HPA carried in the data access request is the address of the shared storage space. If the HPA carried in the data access request is not the address of the shared storage space, the storage controller 200 converts the HPA into the DPA of the storage device 310 of the host 100 (which may be referred to as the DPA of the host 100) according to the HDM, and then accesses the storage device 310 of the host 100 to write or read data at the DPA. If the HPA carried in the data access request is the address of the shared storage space, for a read request, the storage controller 200 will query the HPA of other hosts 100 that have a mapping relationship with the HPA, convert the HPA of other hosts 100 into the DPA of other hosts 100, and then access the storage device 310 of the other hosts 100 to read data at the DPA, and feed the read data back to the host 100. For a write request, the storage controller 200 updates the sharing information of the host 100, deletes the HPA recorded in the sharing information, or configures the state of the HPA to be shared, converts the HPA into the DPA of the host 100 according to the HDM, accesses the storage device 310 of the host 100, and writes data at the DPA.

对于主机发起的指令(共享指令、数据迁移指令、禁止共享指令、共享变更指令等),存储控制器200可以查询该主机100的共享信息,根据主机发起的指令更新该共享信息。对于共享指令,存储控制器200在该主机100的共享信息中增加该指令携带的HPA,将该HPA标注为待共享状态。对于数据迁移指令,存储控制器200在该主机100的共享信息中增加该指令携带的HPA与其他主机100的HPA的映射关系。对于禁止共享指令,存储控制器200在该主机100的共享信息中删除该指令携带的HPA或将该HPA标注为禁止共享状态。对于共享变更指令,存储控制器200在更新该主机100的共享信息,将已共享的该HPA的状态配置为待共享状态,删除已共享的该HPA与其他主机100的HPA的之间的映射关系。For instructions initiated by the host (sharing instructions, data migration instructions, prohibit sharing instructions, sharing change instructions, etc.), the storage controller 200 can query the sharing information of the host 100 and update the sharing information according to the instructions initiated by the host. For sharing instructions, the storage controller 200 adds the HPA carried by the instruction to the sharing information of the host 100 and marks the HPA as a state to be shared. For data migration instructions, the storage controller 200 adds the mapping relationship between the HPA carried by the instruction and the HPA of other hosts 100 in the sharing information of the host 100. For prohibit sharing instructions, the storage controller 200 deletes the HPA carried by the instruction from the sharing information of the host 100 or marks the HPA as a state to be prohibited from sharing. For sharing change instructions, the storage controller 200 updates the sharing information of the host 100, configures the state of the shared HPA to a state to be shared, and deletes the mapping relationship between the shared HPA and the HPA of other hosts 100.

形式二、主机100的共享信息中用DPA表征存储空间的地址(该存储空间指共享存储空间或者与共享存储空间存在映射关系的存储空间)。也即该100的共享信息中记录的共享存储空间的地址为DPA,与已共享的共享存储空间存在映射关系的存储空间的地址也为DPA。Form 2: The address of the storage space is represented by DPA in the shared information of the host 100 (the storage space refers to the shared storage space or the storage space that has a mapping relationship with the shared storage space). That is, the address of the shared storage space recorded in the shared information of the host 100 is DPA, and the address of the storage space that has a mapping relationship with the shared shared storage space is also DPA.

采用这种形式,存储控制器200在接收到主机发起的数据访问请求(如写请求或读请求)以及各种指令(共享指令、数据迁移指令、禁止共享指令、共享变更指令等)时,需要先进行地址转换,也即将查询HDM,将数据访问请求以及各种指令中携带的该主机100的HPA转换为该主机100的DPA,之后,再查询该主机100的共享信息,执行相应的操作。In this form, when the storage controller 200 receives a data access request (such as a write request or a read request) and various instructions (sharing instructions, data migration instructions, prohibit sharing instructions, sharing change instructions, etc.) initiated by the host, it needs to first perform address conversion, that is, query the HDM, and convert the HPA of the host 100 carried in the data access request and various instructions into the DPA of the host 100. After that, query the sharing information of the host 100 and perform corresponding operations.

对于主机发起的数据访问请求,存储控制器200将数据访问请求携带的该主机100的HPA转换为该主机100的DPA后,查询该主机100的共享信息确定数据访问请求中携带的DPA是否为共享存储空间的地址,若数据访问请求中携带的DPA并非为共享存储空间的地址,存储控制器200访问该主机100的存储装置310,在该DPA处写入数据或读取数据。若数据访问请求中携带的DPA为共享存储空间的地址,对于读请求,存储控制器200将查询与该DPA存在映射关系的其他主机100的存储装置310的DPA,访问该其他主机100的存储装置310,在该DPA处读取数据,将读取的数据反馈给主机100。对于写请求,存储控制器200更新该主机100的共享信息,删除该共享信息中记录的该DPA,或者将该DPA的状态配置为待共享状态。For a data access request initiated by a host, the storage controller 200 converts the HPA of the host 100 carried in the data access request into the DPA of the host 100, and then queries the sharing information of the host 100 to determine whether the DPA carried in the data access request is the address of the shared storage space. If the DPA carried in the data access request is not the address of the shared storage space, the storage controller 200 accesses the storage device 310 of the host 100 and writes or reads data at the DPA. If the DPA carried in the data access request is the address of the shared storage space, for a read request, the storage controller 200 will query the DPA of the storage device 310 of other hosts 100 that have a mapping relationship with the DPA, access the storage device 310 of the other host 100, read data at the DPA, and feed the read data back to the host 100. For a write request, the storage controller 200 updates the sharing information of the host 100, deletes the DPA recorded in the sharing information, or configures the state of the DPA to be shared.

对于主机发起的指令(共享指令、数据迁移指令、禁止共享指令、共享变更指令等),存储控制器200将指令中携带的该主机100的HPA转换为该主机100的DPA后,可以查询该主机100的共享信息,根据主机发起的指令更新该共享信息。对于共享指令,存储控制器200在该主机100的共享信息中增加该指令携带的DPA,将该DPA标注为待共享状态。对于数据迁移指令,存储控制器200在该主机100的共享信息中增加该指令携带的DPA与其他主机100的DPA的映射关系。对于禁止共享指令,存储控制器200在该主机100的共享信息中删除该指令携带的DPA或将该DPA标注为禁止共享状态。对于共享变更指令,存储控制器200在更新该主机100的共享信息,将已共享的该DPA的状态配置为待共享状态,删除已共享的该DPA与其他主机100的DPA的之间的映射关系。For instructions initiated by the host (sharing instructions, data migration instructions, sharing prohibition instructions, sharing change instructions, etc.), after the storage controller 200 converts the HPA of the host 100 carried in the instruction into the DPA of the host 100, it can query the sharing information of the host 100 and update the sharing information according to the instructions initiated by the host. For sharing instructions, the storage controller 200 adds the DPA carried by the instruction to the sharing information of the host 100 and marks the DPA as a state to be shared. For data migration instructions, the storage controller 200 adds the mapping relationship between the DPA carried by the instruction and the DPA of other hosts 100 in the sharing information of the host 100. For sharing prohibition instructions, the storage controller 200 deletes the DPA carried by the instruction in the sharing information of the host 100 or marks the DPA as a state to be shared. For sharing change instructions, the storage controller 200 updates the sharing information of the host 100, configures the state of the shared DPA to a state to be shared, and deletes the mapping relationship between the shared DPA and the DPA of other hosts 100.

下面结合如图2对本申请实施例提供的一种数据共享方法进行说明,在图2中以两个主机之间的数据共享方法为例进行说明,为了方便说明,该两个主机分别标注为主机A以及主机B,主机的共享信息采用前述提及的形式一。A data sharing method provided in an embodiment of the present application is described below in conjunction with FIG2 . In FIG2 , a data sharing method between two hosts is taken as an example for description. For the convenience of description, the two hosts are respectively labeled as host A and host B, and the shared information of the hosts adopts the aforementioned form 1.

对于主机的共享信息采用前述提及的形式二时数据共享方法与主机的共享信息采用前述提及的形式一时的数据共享方法类似,区别在于存储控制器查询HDM以及主机的共享信息的先后顺序,此处不再赘述。The data sharing method when the host's shared information adopts the aforementioned form 2 is similar to the data sharing method when the host's shared information adopts the aforementioned form 1. The difference lies in the order in which the storage controller queries the HDM and the host's shared information, which will not be repeated here.

如图2所示的数据共享方法中包括三个流程,一个流程为数据读取流程,具体可以参见步骤201~步骤206,一个流程为数据迁移流程,具体可以参见步骤207~步骤210,一个流程为数据写入流程,具体可以参见步骤211~步骤214。这三个流程相互独立,在实际应用中这三个流程可以独立执行。在图2所示的实施例中为了体现针对不同共享存储空间执行的数据读取流程、数据迁移流程、数据写入流程之间的关系将这三个流程整合在一起。The data sharing method shown in FIG2 includes three processes, one process is a data reading process, specifically, see step 201 to step 206, one process is a data migration process, specifically, see step 207 to step 210, and one process is a data writing process, specifically, see step 211 to step 214. These three processes are independent of each other, and in practical applications, these three processes can be executed independently. In the embodiment shown in FIG2, in order to reflect the relationship between the data reading process, data migration process, and data writing process executed for different shared storage spaces, these three processes are integrated together.

步骤201:主机100A发起读请求,该读请求用于请求读取数据1,该读请求携带该数据1的HPA。该数据1的HPA包括数据1的起始主机物理地址以及数据1的大小。Step 201: the host 100A initiates a read request, the read request is used to request to read data 1, and the read request carries the HPA of the data 1. The HPA of the data 1 includes the starting host physical address of the data 1 and the size of the data 1.

步骤202:存储控制器200接收该读请求,查询该主机100A的共享信息,确定该数据1的HPA是否为已共享的共享存储空间的地址,如是,则执行步骤203,否则执行步骤205。Step 202: the storage controller 200 receives the read request, queries the sharing information of the host 100A, and determines whether the HPA of the data 1 is the address of the shared storage space. If so, execute step 203; otherwise, execute step 205.

如图3所示,本申请实施例提供的一种主机100A的共享信息,该主机100A的共享信息中记录了多个共享存储空间的地址。每个共享存储空间的地址可以用该共享存储空间的起始主机物理地址以及该共享存储空间的大小表示。对于已共享的共享存储空间,该主机100A的共享信息中还记录了与该共享存储空间存在映射关系的存储空间所属的主机100,以及与该共享存储空间存在映射关系的存储空间的地址,同样的,与该共享存储空间存在映射关系的存储空间的地址可以用该存储空间的起始主机物理地址以及该存储空间的大小表示。该共享关系中还包括共享标记,该共享标记指示存储空间是否允许共享。如对于共享存储空间,共享标记指示该存储空间允许共享。示例性的,该共享标记还可以指示共享存储空间处于待共享状态或者已共享状态。对于非共享存储空间,或者禁止共享的存储空间(如通过禁止共享指令指示的存储空间),共享标识指示该存储空间指示禁止共享。As shown in FIG3 , a host 100A sharing information provided in an embodiment of the present application records the addresses of multiple shared storage spaces in the sharing information of the host 100A. The address of each shared storage space can be represented by the starting host physical address of the shared storage space and the size of the shared storage space. For the shared shared storage space, the host 100A sharing information also records the host 100 to which the storage space with which the shared storage space has a mapping relationship belongs, and the address of the storage space with which the shared storage space has a mapping relationship. Similarly, the address of the storage space with which the shared storage space has a mapping relationship can be represented by the starting host physical address of the storage space and the size of the storage space. The sharing relationship also includes a sharing mark, which indicates whether the storage space is allowed to be shared. For example, for a shared storage space, the sharing mark indicates that the storage space is allowed to be shared. Exemplarily, the sharing mark can also indicate that the shared storage space is in a state to be shared or in a shared state. For a non-shared storage space, or a storage space that is prohibited from sharing (such as a storage space indicated by a prohibition of sharing instruction), the sharing mark indicates that the storage space indicates that sharing is prohibited.

在图3中主机100A的共享信息记录了三个共享存储空间,假设主机100A的存储装置310中的数据存储最小粒度为16字节,第一个共享存储空间的起始主机物理地址为1001、大小有64字节。第二个共享存储空间的起始主机物理地址为1005、大小有64字节。第一个共享存储空间的起始主机物理地址与第二个共享存储空间的起始主机物理地址的差值为4,且第一共享存储空间的大小刚好等于4个数据存储最小粒度,也即第一共享存储空间与第二共享存储空间是相邻的。第三个共享存储空间的起始主机物理地址为1010、大小有4字节。主机100A的共享信息中还地标注了三个共享存储空间的状态,其中,第一个共享存储空间以及第三个共享存储空间的状态为已共享状态,第二个共享存储空间的状态为待共享状态。主机100A的共享信息还记录了与第一个共享存储空间以及第三个共享存储空间存在映射关系的两个存储空间的地址。其中,与第一个共享存储空间存在映射关系的存储空间属于主机100B,与第一个共享存储空间存在映射关系的存储空间的起始主机物理地址为2002。与第三个共享存储空间存在映射关系的存储空间属于主机100B,与第三个共享存储空间存在映射关系的存储空间的起始主机物理地址为2020。由于与共享存储空间存在映射关系的存储空间的大小与该共享存储空间的大小是一致的,在图3所示的主机100A的共享信息中省略了与共享存储空间存在映射关系的存储空间的大小,只需参考相应的共享存储空间的大小即可。In FIG3 , the sharing information of the host 100A records three shared storage spaces. Assuming that the minimum granularity of data storage in the storage device 310 of the host 100A is 16 bytes, the starting host physical address of the first shared storage space is 1001, and the size is 64 bytes. The starting host physical address of the second shared storage space is 1005, and the size is 64 bytes. The difference between the starting host physical address of the first shared storage space and the starting host physical address of the second shared storage space is 4, and the size of the first shared storage space is just equal to 4 minimum granularities of data storage, that is, the first shared storage space and the second shared storage space are adjacent. The starting host physical address of the third shared storage space is 1010, and the size is 4 bytes. The sharing information of the host 100A also marks the status of the three shared storage spaces, wherein the status of the first shared storage space and the third shared storage space is shared, and the status of the second shared storage space is to be shared. The sharing information of the host 100A also records the addresses of the two storage spaces that have a mapping relationship with the first shared storage space and the third shared storage space. Among them, the storage space that has a mapping relationship with the first shared storage space belongs to the host 100B, and the starting host physical address of the storage space that has a mapping relationship with the first shared storage space is 2002. The storage space that has a mapping relationship with the third shared storage space belongs to the host 100B, and the starting host physical address of the storage space that has a mapping relationship with the third shared storage space is 2020. Since the size of the storage space that has a mapping relationship with the shared storage space is consistent with the size of the shared storage space, the size of the storage space that has a mapping relationship with the shared storage space is omitted in the sharing information of the host 100A shown in FIG. 3, and only the size of the corresponding shared storage space needs to be referred to.

若该数据1的HPA属于第一个共享存储空间或第三个共享存储空间中任一共享存储空间,则执行步骤203,若该数据1的HPA不属于第一个共享存储空间或第三个共享存储空间中任一共享存储空间,否则执行步骤205。If the HPA of the data 1 belongs to the first shared storage space or any of the third shared storage spaces, execute step 203; if the HPA of the data 1 does not belong to the first shared storage space or any of the third shared storage spaces, execute step 205.

需要说明的是,这里仅是以主机100A以及主机100B为例进行说明,在实际应用中,主机100A的共享信息中,与多个共享存储空间存在映射关系的多个存储空间可以均属于主机100B,也可以分布在多个不同的主机100。也就是说,主机100A与多个不同的主机100共享的存储装置310的存储空间,但主机100A的存储装置310的一个共享存储空间只能与一个主机100发生共享,也即主机100A的存储装置310的一个共享存储空间只能与一个主机100的存储装置310的存储空间存在映射关系。It should be noted that only the host 100A and the host 100B are used as examples for explanation here. In actual applications, in the sharing information of the host 100A, the multiple storage spaces that have a mapping relationship with the multiple shared storage spaces may all belong to the host 100B, or may be distributed in multiple different hosts 100. In other words, the host 100A shares the storage space of the storage device 310 with multiple different hosts 100, but one shared storage space of the storage device 310 of the host 100A can only be shared with one host 100, that is, one shared storage space of the storage device 310 of the host 100A can only be mapped with the storage space of the storage device 310 of one host 100.

步骤203:存储控制器200根据该主机100A的共享信息确定与该数据1的HPA存在映射关系的主机100B的HPA。Step 203: The storage controller 200 determines the HPA of the host 100B that has a mapping relationship with the HPA of the data 1 according to the sharing information of the host 100A.

该数据1的HPA属于该主机100A的存储装置310中已共享的共享存储空间,那么,在该共享存储空间存在映射关系的主机100B的存储装置310中的存储空间将包括与该数据1的HPA存在映射关系的主机100B的HPA。其中,该数据1的HPA在该共享存储空间中的位置与该数据1的HPA存在映射关系的主机100B的HPA在该存储空间中的位置一致。The HPA of the data 1 belongs to the shared storage space in the storage device 310 of the host 100A. Then, the storage space in the storage device 310 of the host 100B that has a mapping relationship with the shared storage space will include the HPA of the host 100B that has a mapping relationship with the HPA of the data 1. The position of the HPA of the data 1 in the shared storage space is consistent with the position of the HPA of the host 100B that has a mapping relationship with the HPA of the data 1 in the storage space.

以图3所示的主机100A的共享信息为例,若数据1的HPA的起始主机物理地址为1001,数据1的大小为4比特。该数据1的HPA属于第一个共享存储空间,与该数据1的HPA存在映射关系的主机100B的HPA的起始主机物理地址为2002,数据1的大小为4比特。若数据1的HPA的起始主机物理地址为1002,距离第一共享存储空间的起始物理地址的偏移为16字节,数据1的大小为4比特。该数据1的HPA仍属于第一个共享存储空间,那么,与该数据1的HPA存在映射关系的主机100B的HPA的起始主机物理地址为2003,距离与第一共享存储空间存在映射关系的存储空间的起始物理地址的偏移同样为16字节,数据1的大小为4比特。Taking the shared information of the host 100A shown in FIG3 as an example, if the starting host physical address of the HPA of data 1 is 1001, the size of data 1 is 4 bits. The HPA of data 1 belongs to the first shared storage space, and the starting host physical address of the HPA of the host 100B that has a mapping relationship with the HPA of data 1 is 2002, and the size of data 1 is 4 bits. If the starting host physical address of the HPA of data 1 is 1002, the offset from the starting physical address of the first shared storage space is 16 bytes, and the size of data 1 is 4 bits. The HPA of data 1 still belongs to the first shared storage space, then the starting host physical address of the HPA of the host 100B that has a mapping relationship with the HPA of data 1 is 2003, and the offset from the starting physical address of the storage space that has a mapping relationship with the first shared storage space is also 16 bytes, and the size of data 1 is 4 bits.

步骤204:存储控制器200获取该主机100B的HPA后,查询主机100B的HDM,将该主机100B的HPA转换为主机100B的DPA,访问主机100B的存储装置310,从该DPA读取数据1。Step 204: After obtaining the HPA of the host 100B, the storage controller 200 queries the HDM of the host 100B, converts the HPA of the host 100B into the DPA of the host 100B, accesses the storage device 310 of the host 100B, and reads data 1 from the DPA.

步骤205:存储控制器200查询主机100A的HDM,将该数据1的HPA转换该主机100A的DPA,访问该主机100A的存储装置310,从该DPA读取数据1。Step 205: The storage controller 200 queries the HDM of the host 100A, converts the HPA of the data 1 into the DPA of the host 100A, accesses the storage device 310 of the host 100A, and reads the data 1 from the DPA.

步骤206:存储控制器200将数据1反馈给主机100A。Step 206: The storage controller 200 feeds back the data 1 to the host 100A.

至此,数据读取流程结束,在该数据读取流程中可以发现,由于主机100A的共享信息的设置,使得主机100A能够访问主机100B的存储装置310,读取主机100B的存储装置310中的数据。对于主机100A并不会感知到所读取的数据来自主机100B的存储装置310。At this point, the data reading process ends. In the data reading process, it can be found that due to the setting of the shared information of the host 100A, the host 100A can access the storage device 310 of the host 100B and read the data in the storage device 310 of the host 100B. The host 100A does not perceive that the read data comes from the storage device 310 of the host 100B.

步骤207:主机100A发起数据迁移指令,该数据迁移指令请求用于请求将主机100B的存储装置310中的数据2迁移到主机100A的目标HPA处,该数据迁移指令中携带了数据2在主机100B的HPA,以及主机100A的目标HPA。Step 207: Host 100A initiates a data migration instruction, which is used to request to migrate data 2 in the storage device 310 of host 100B to the target HPA of host 100A. The data migration instruction carries the HPA of data 2 in host 100B and the target HPA of host 100A.

步骤208:存储控制器200接收该数据迁移指令,查询该主机100A的共享信息,确定该主机100A的目标HPA是否为共享存储空间的地址,如是,则执行步骤209,否则执行步骤210。Step 208: the storage controller 200 receives the data migration instruction, queries the sharing information of the host 100A, and determines whether the target HPA of the host 100A is the address of the shared storage space. If so, execute step 209; otherwise, execute step 210.

仍以图3所示的主机100A的共享信息为例,若该主机100A的目标HPA属于三个共享存储空间中的一个共享存储空间,则执行步骤209。若该主机100A的目标HPA不属于任一共享存储空间,则执行步骤210。Still taking the sharing information of the host 100A shown in Fig. 3 as an example, if the target HPA of the host 100A belongs to one of the three shared storage spaces, then execute step 209. If the target HPA of the host 100A does not belong to any shared storage space, then execute step 210.

步骤209:存储控制器200在该主机100A的共享信息中建立该主机100A的目标HPA与数据2在主机100B的HPA之间的映射关系。Step 209: The storage controller 200 establishes a mapping relationship between the target HPA of the host 100A and the HPA of the data 2 in the host 100B in the shared information of the host 100A.

若主机100A的存储装置310中目标HPA属于的共享存储空间为待共享的共享存储空间,存储控制器200可以直接在该主机100A的共享信息中增加该主机100A的目标HPA与数据2在主机100B的HPA之间的映射关系。在一些场景中,主机100A的目标HPA仅为待共享的共享存储空间的部分存储空间,在这种场景中,存储控制器200在该主机100A的共享信息中增加该主机100A的目标HPA与数据2在主机100B的HPA之间的映射关系,对于待共享的共享存储空间的剩余存储空间仍保持待共享状态。If the shared storage space to which the target HPA in the storage device 310 of the host 100A belongs is the shared storage space to be shared, the storage controller 200 can directly add the mapping relationship between the target HPA of the host 100A and the HPA of the host 100B for data 2 in the sharing information of the host 100A. In some scenarios, the target HPA of the host 100A is only a part of the storage space of the shared storage space to be shared. In this scenario, the storage controller 200 adds the mapping relationship between the target HPA of the host 100A and the HPA of the host 100B for data 2 in the sharing information of the host 100A, and the remaining storage space of the shared storage space to be shared remains in the state of being shared.

举例来说,主机100A的目标HPA属于主机100A的存储装置310中的第二个共享存储空间,主机100A的目标HPA的起始主机物理地址为1005,大小为16字节。数据2在主机100B的HPA的起始主机物理地址为2006,那么,存储控制器200在该主机100A的共享信息中增加该主机100A的目标HPA(也即起始主机物理地址为1005,大小为16字节)与数据2在主机100B的HPA(即起始主机物理地址为2006,大小为16字节)之间的映射关系,对于待共享的共享存储空间的剩余存储空间(也即起始主机物理地址为1006,大小为48字节)仍保持待共享状态。For example, the target HPA of the host 100A belongs to the second shared storage space in the storage device 310 of the host 100A, and the starting host physical address of the target HPA of the host 100A is 1005, and the size is 16 bytes. The starting host physical address of the data 2 in the HPA of the host 100B is 2006, so the storage controller 200 adds the mapping relationship between the target HPA of the host 100A (that is, the starting host physical address is 1005, the size is 16 bytes) and the HPA of the data 2 in the host 100B (that is, the starting host physical address is 2006, the size is 16 bytes) in the sharing information of the host 100A, and the remaining storage space of the shared storage space to be shared (that is, the starting host physical address is 1006, the size is 48 bytes) remains in the state of being shared.

如图4所示,为更新后的主机100A的共享信息,更新后的主机100A的共享信息将原来的第二共享存储空间分为两个共享存储空间,其中一个共享存储空间起始主机物理地址为1005,大小为16字节,处于已共享状态,与主机100B的存储装置310中的存储空间(即起始主机物理地址为2006,大小为16字节)之间存在映射关系,另一个共享存储空间(起始主机物理地址为1006,大小为48字节)处于待共享状态。As shown in Figure 4, this is the updated sharing information of the host 100A. The updated sharing information of the host 100A divides the original second shared storage space into two shared storage spaces, one of which has a starting host physical address of 1005 and a size of 16 bytes. It is in a shared state and has a mapping relationship with the storage space in the storage device 310 of the host 100B (i.e., the starting host physical address is 2006 and the size is 16 bytes). The other shared storage space (with a starting host physical address of 1006 and a size of 48 bytes) is in a state to be shared.

若主机100A的目标HPA属于的共享存储空间为已共享的共享存储空间,存储控制器200可以在该主机100A的共享信息中修改该共享存储空间与主机100B的存储装置310中存储空间的映射关系。修改后的该共享存储空间与主机100B的存储装置310中存储空间的映射关系需要包括该主机100A的目标HPA与数据2在主机100B的HPA之间的映射关系。在一些场景中,主机100A的目标HPA仅为已共享的共享存储空间的部分存储空间,在这种场景中,存储控制器200在该主机100A的共享信息修改该部分存储空间与主机100B的存储装置310中存储空间的映射关系,修改为该主机100A的目标HPA与数据2在主机100B的HPA之间的映射关系,对于该共享存储空间的剩余存储空间仍保持原有的已共享状态。If the shared storage space to which the target HPA of the host 100A belongs is a shared shared storage space, the storage controller 200 may modify the mapping relationship between the shared storage space and the storage space in the storage device 310 of the host 100B in the sharing information of the host 100A. The modified mapping relationship between the shared storage space and the storage space in the storage device 310 of the host 100B needs to include the mapping relationship between the target HPA of the host 100A and the data 2 in the HPA of the host 100B. In some scenarios, the target HPA of the host 100A is only a portion of the storage space of the shared shared storage space. In such a scenario, the storage controller 200 modifies the mapping relationship between the portion of the storage space and the storage space in the storage device 310 of the host 100B in the sharing information of the host 100A to the mapping relationship between the target HPA of the host 100A and the data 2 in the HPA of the host 100B, and the remaining storage space of the shared storage space remains in the original shared state.

举例来说,主机100A的目标HPA属于主机100A的存储装置310中的第一个共享存储空间,主机100A的目标HPA的起始主机物理地址为1001,大小为16字节。数据2在主机100B的HPA的起始主机物理地址为2006,那么,存储控制器200修改该主机100A的共享信息第一个共享存储空间与主机100B的存储空间之间的映射关系,增加该主机100A的目标HPA(也即起始主机物理地址为1001,大小为16字节)与数据2在主机100B的HPA(即起始主机物理地址为2006,大小为16字节)之间的映射关系,对共享存储空间的剩余存储空间(也即起始主机物理地址为1002,大小为48字节)仍保持已共享状态。For example, the target HPA of the host 100A belongs to the first shared storage space in the storage device 310 of the host 100A, and the starting host physical address of the target HPA of the host 100A is 1001, and the size is 16 bytes. The starting host physical address of the data 2 in the HPA of the host 100B is 2006, so the storage controller 200 modifies the mapping relationship between the first shared storage space of the shared information of the host 100A and the storage space of the host 100B, and adds the mapping relationship between the target HPA of the host 100A (that is, the starting host physical address is 1001, the size is 16 bytes) and the data 2 in the HPA of the host 100B (that is, the starting host physical address is 2006, the size is 16 bytes), and the remaining storage space of the shared storage space (that is, the starting host physical address is 1002, the size is 48 bytes) remains in the shared state.

如图5所示,为更新后的主机100A的共享信息,更新后的主机100A的共享信息将原来的第一共享存储空间分为两个共享存储空间,其中一个共享存储空间起始主机物理地址为1001,大小为16字节,处于已共享状态,与主机100B的存储装置310中的存储空间(即起始主机物理地址为2006,大小为16字节)之间存在映射关系,另一个共享存储空间起始主机物理地址为1002,大小为48字节与主机100B的存储装置310中的存储空间(即起始主机物理地址为2003,大小为48字节)之间保持原有的映射关系。As shown in Figure 5, this is the updated sharing information of the host 100A. The updated sharing information of the host 100A divides the original first shared storage space into two shared storage spaces, one of which has a starting host physical address of 1001, a size of 16 bytes, and is in a shared state. There is a mapping relationship between the shared storage space and the storage space in the storage device 310 of the host 100B (i.e., the starting host physical address is 2006, and the size is 16 bytes). The other shared storage space has a starting host physical address of 1002, a size of 48 bytes, and maintains the original mapping relationship between the shared storage space and the storage space in the storage device 310 of the host 100B (i.e., the starting host physical address is 2003, and the size is 48 bytes).

步骤210:存储控制器200访问主机100B的存储装置310,从主机100B的存储装置310中读取数据2,将数据2写入到该主机100A的目标HPA指示的位置处。Step 210: the storage controller 200 accesses the storage device 310 of the host 100B, reads data 2 from the storage device 310 of the host 100B, and writes data 2 to the location indicated by the target HPA of the host 100A.

若该主机100A的存储装置310中目标HPA不属于共享存储空间,存储控制器200获取主机100B的HDM,将数据2在主机100B的HPA转换为数据2在主机100B的DPA,从该DPA处读取该数据2。存储控制器200获取主机100A的HDM,将主机100A的目标HPA转换为DPA,将数据2写入到该DPA。If the target HPA in the storage device 310 of the host 100A does not belong to the shared storage space, the storage controller 200 obtains the HDM of the host 100B, converts the data 2 in the HPA of the host 100B into the DPA of the data 2 in the host 100B, and reads the data 2 from the DPA. The storage controller 200 obtains the HDM of the host 100A, converts the target HPA of the host 100A into the DPA, and writes the data 2 to the DPA.

在一些场景中,存储控制器200在接收该数据迁移指令后,也可以不执行步骤208以及步骤210,而是直接执行步骤209。也就是说,存储控制器200不需要判断该主机100A的存储装置310中目标HPA是否为共享存储空间的地址,存储控制器200可以直接在该主机100A的共享信息中建立该主机100A的目标HPA与数据2在主机100B的HPA之间的映射关系,这种情况可以理解为主机100A的存储装置310的存储空间均为共享存储空间或者主机100A能够明确该目标HPA属于共享存储空间(这种情况下,也就不存在步骤210这一分支)。In some scenarios, after receiving the data migration instruction, the storage controller 200 may not execute step 208 and step 210, but directly execute step 209. That is, the storage controller 200 does not need to determine whether the target HPA in the storage device 310 of the host 100A is the address of the shared storage space. The storage controller 200 can directly establish a mapping relationship between the target HPA of the host 100A and the HPA of the data 2 in the host 100B in the shared information of the host 100A. This situation can be understood as the storage space of the storage device 310 of the host 100A is a shared storage space or the host 100A can clearly know that the target HPA belongs to the shared storage space (in this case, there is no branch of step 210).

在一些场景中,存储控制器200在接收该数据迁移指令后,还可以查询主机100B的共享信息确定数据2在主机100B的HPA是否属于共享存储空间,若是,存储控制器200可以执行步骤208~步骤210,存储控制器200也可以不执行步骤208以及步骤210,直接执行步骤209。若不是,存储控制器200可以通知主机100A数据迁移失败。In some scenarios, after receiving the data migration instruction, the storage controller 200 may also query the sharing information of the host 100B to determine whether the data 2 in the HPA of the host 100B belongs to the shared storage space. If so, the storage controller 200 may execute steps 208 to 210, or the storage controller 200 may not execute steps 208 and 210 and directly execute step 209. If not, the storage controller 200 may notify the host 100A that the data migration has failed.

至此数据迁移过程结束,从数据迁移过程可以看出,由于主机100A的共享信息的设置,当主机100B的存储装置310中的数据迁移到主机100A的存储装置310中时,并不需要从主机100B的存储装置310中复制数据,之后再将复制的数据写入到主机100A的存储装置310中。仅需简单地对主机100A的共享信息进行更新,增加相应的映射信息,即可达到数据迁移的效果,数据迁移方式更加方便。The data migration process is now complete. It can be seen from the data migration process that, due to the setting of the shared information of the host 100A, when the data in the storage device 310 of the host 100B is migrated to the storage device 310 of the host 100A, it is not necessary to copy the data from the storage device 310 of the host 100B and then write the copied data to the storage device 310 of the host 100A. The effect of data migration can be achieved by simply updating the shared information of the host 100A and adding the corresponding mapping information, and the data migration method is more convenient.

在进行了数据迁移之后,主机100A可以发起用于请求读取数据2的读请求,该读请求中携带有主机100A的目标HPA。存储控制器200在接收到该读请求后,可以查询该主机100A的共享信息,确定与该主机100A的目标HPA存在映射关系的主机100B的HPA;确定了主机100B的HPA之后,将主机100B的HPA转换为主机100B的DPA,从该DPA读取数据2,反馈给主机100A。主机100A读取数据2的过程与主机100A读取数据1的过程类似,这里不再对各个步骤展开赘述,具体可以参见前述内容。After the data migration is performed, the host 100A may initiate a read request for requesting to read data 2, and the read request carries the target HPA of the host 100A. After receiving the read request, the storage controller 200 may query the shared information of the host 100A, and determine the HPA of the host 100B that has a mapping relationship with the target HPA of the host 100A; after determining the HPA of the host 100B, the HPA of the host 100B is converted into the DPA of the host 100B, and data 2 is read from the DPA and fed back to the host 100A. The process of the host 100A reading data 2 is similar to the process of the host 100A reading data 1, and each step will not be described in detail here. For details, please refer to the above content.

步骤211:主机100A发起写请求,该写请求用于请求写入数据3,该读请求携带该数据3的HPA。Step 211: the host 100A initiates a write request, where the write request is used to request writing of data 3, and the read request carries the HPA of the data 3.

步骤212:存储控制器200接收该写请求,查询该主机100A的共享信息,确定该数据3的HPA是否为共享存储空间的地址,如是,则执行步骤213,否则执行步骤214。Step 212: the storage controller 200 receives the write request, queries the sharing information of the host 100A, and determines whether the HPA of the data 3 is the address of the shared storage space. If so, execute step 213; otherwise, execute step 214.

以图5所示的主机100A的共享信息为例,若该数据3的HPA属于任一共享存储空间,则执行步骤213以及步骤214。否则执行步骤214。Taking the sharing information of the host 100A shown in FIG5 as an example, if the HPA of the data 3 belongs to any shared storage space, step 213 and step 214 are executed. Otherwise, step 214 is executed.

步骤213:存储控制器200在该主机100A的共享信息中删除数据3的HPA。Step 213: The storage controller 200 deletes the HPA of data 3 in the shared information of the host 100A.

若该主机100A的共享信息中记录了数据3的HPA与数据2在主机100B的存储装置310中HPA之间的映射关系,也即该数据3的HPA处于已共享的状态,存储控制器200可以删除该映射关系或者或将该或将数据3的HPA标注为禁止共享,若该主机100A的共享信息中记录了数据3的HPA处于待共享的状态,存储控制器200可以删除数据3的HPA或将该或将数据3的HPA标注为禁止共享。下面分情况进行说明:If the host 100A's sharing information records the mapping relationship between the HPA of data 3 and the HPA of data 2 in the storage device 310 of the host 100B, that is, the HPA of data 3 is in a shared state, the storage controller 200 can delete the mapping relationship or mark the HPA of data 3 as prohibited from sharing. If the host 100A's sharing information records that the HPA of data 3 is in a state to be shared, the storage controller 200 can delete the HPA of data 3 or mark the HPA of data 3 as prohibited from sharing. The following is an explanation of different situations:

情况一、当数据3的HPA属于的共享存储空间为已共享的共享存储空间。Case 1: When the shared storage space to which the HPA of data 3 belongs is a shared shared storage space.

存储控制器200可以在该主机100A的共享信息中修改该共享存储空间与主机100B的存储装置310中存储空间的映射关系。修改后的该共享存储空间与主机100B的存储装置310中存储空间的映射关系不再包括该数据3的HPA与数据2在主机100B的HPA之间的映射关系。在一些场景中,数据3的HPA仅为已共享的共享存储空间的部分存储空间,在这种场景中,存储控制器200在该主机100A的共享信息删除该部分存储空间与主机100B的存储装置310中存储空间的映射关系,对于该共享存储空间的剩余存储空间仍保持原有的已共享状态。The storage controller 200 may modify the mapping relationship between the shared storage space and the storage space in the storage device 310 of the host 100B in the sharing information of the host 100A. The modified mapping relationship between the shared storage space and the storage space in the storage device 310 of the host 100B no longer includes the mapping relationship between the HPA of the data 3 and the HPA of the data 2 in the host 100B. In some scenarios, the HPA of the data 3 is only a part of the storage space of the shared shared storage space. In such a scenario, the storage controller 200 deletes the mapping relationship between the part of the storage space and the storage space in the storage device 310 of the host 100B in the sharing information of the host 100A, and the remaining storage space of the shared storage space remains in the original shared state.

以图6所示的主机100A的共享信息为例,假设数据3的HPA属于主机100A的存储装置310中的已共享的一个共享存储空间,数据3的HPA的起始主机物理地址为1002,大小为16字节。那么,存储控制器200修改该主机100A的共享信息中共享存储空间与主机100B的存储装置310的存储空间之间的映射关系,删除该数据3的HPA(也即起始主机物理地址为1002,大小为16字节)与主机100B的存储装置310中存储空间(即起始主机物理地址为2003,大小为16字节)之间的映射关系或将该数据3的HPA标注为禁止共享,对共享存储空间的剩余存储空间(也即起始主机物理地址为1003,大小为32字节)仍保持原来的已共享状态。修改后的主机100A的共享信息如图6所示。Taking the sharing information of the host 100A shown in FIG6 as an example, it is assumed that the HPA of data 3 belongs to a shared storage space in the storage device 310 of the host 100A, and the starting host physical address of the HPA of data 3 is 1002, and the size is 16 bytes. Then, the storage controller 200 modifies the mapping relationship between the shared storage space and the storage space of the storage device 310 of the host 100B in the sharing information of the host 100A, deletes the mapping relationship between the HPA of data 3 (that is, the starting host physical address is 1002, the size is 16 bytes) and the storage space in the storage device 310 of the host 100B (that is, the starting host physical address is 2003, the size is 16 bytes) or marks the HPA of data 3 as prohibited from sharing, and the remaining storage space of the shared storage space (that is, the starting host physical address is 1003, the size is 32 bytes) remains in the original shared state. The modified sharing information of the host 100A is shown in FIG6.

情况二、数据3的HPA属于的共享存储空间为待共享的共享存储空间。Case 2: the shared storage space to which the HPA of data 3 belongs is the shared storage space to be shared.

存储控制器200可以在该主机100A的共享信息中删除该数据3的HPA或将该数据3的HPA标注为禁止共享。在一些场景中,数据3的HPA仅为待共享的共享存储空间的部分存储空间,在这种场景中,存储控制器200在该主机100A的共享信息中删除该数据3的HPA,对于待共享的共享存储空间的剩余存储空间仍保持待共享状态。The storage controller 200 may delete the HPA of the data 3 in the sharing information of the host 100A or mark the HPA of the data 3 as prohibited from being shared. In some scenarios, the HPA of the data 3 is only a part of the storage space of the shared storage space to be shared. In such a scenario, the storage controller 200 deletes the HPA of the data 3 in the sharing information of the host 100A, and the remaining storage space of the shared storage space to be shared remains in the state of being shared.

以图4所示的主机100A的共享信息为例,假设数据3的HPA属于主机100A的存储装置310中的待共享的一个共享存储空间,数据3的HPA的起始主机物理地址为1006,大小为16字节。那么,存储控制器200在该主机100A的共享信息中删除该数据3的HPA(也即起始主机物理地址为1006,大小为16字节),对于待共享的共享存储空间的剩余存储空间(也即起始主机物理地址为1007,大小为32字节)仍保持待共享状态。修改后的主机100A的共享信息如图7所示。Taking the sharing information of the host 100A shown in FIG4 as an example, it is assumed that the HPA of data 3 belongs to a shared storage space to be shared in the storage device 310 of the host 100A, and the starting host physical address of the HPA of data 3 is 1006, and the size is 16 bytes. Then, the storage controller 200 deletes the HPA of data 3 (that is, the starting host physical address is 1006, and the size is 16 bytes) in the sharing information of the host 100A, and the remaining storage space of the shared storage space to be shared (that is, the starting host physical address is 1007, and the size is 32 bytes) remains in the state of being shared. The modified sharing information of the host 100A is shown in FIG7.

步骤214:存储控制器200根据该写请求,将数据3写入到该数据3的HPA处。Step 214: the storage controller 200 writes the data 3 to the HPA of the data 3 according to the write request.

存储控制器200获取主机100A的HDM,将数据3的HPA转换为DPA,将数据2写入到该DPA。The storage controller 200 obtains the HDM of the host 100A, converts the HPA of the data 3 into the DPA, and writes the data 2 into the DPA.

基于与方法实施例同一发明构思,本申请实施例还提供了一种数据共享装置,该数据共享装置用于执行上述方法实施例中存储控制器执行的方法。如图8所示,数据共享装置800包括接收模块801、处理模块802、发送模块803。具体地,在API测试装置中,各模块之间通过通信通路建立连接。Based on the same inventive concept as the method embodiment, the embodiment of the present application also provides a data sharing device, which is used to execute the method executed by the storage controller in the above method embodiment. As shown in Figure 8, the data sharing device 800 includes a receiving module 801, a processing module 802, and a sending module 803. Specifically, in the API testing device, each module is connected through a communication path.

接收模块801,用于接收来自第一主机的读请求,读请求用于请求从第一主机的存储装置上的第一地址读取第一数据。The receiving module 801 is used to receive a read request from a first host, where the read request is used to request to read first data from a first address on a storage device of the first host.

处理模块802,用于根据第一主机的共享信息确定第一地址映射到第二主机的存储装置上的第二地址,第一主机的共享信息指示了第一地址与第二地址之间的映射关系;从第二地址读取第一数据。The processing module 802 is used to determine the mapping of the first address to the second address on the storage device of the second host according to the sharing information of the first host, the sharing information of the first host indicates the mapping relationship between the first address and the second address; and read the first data from the second address.

发送模块803,用于将第一数据反馈给第一主机。The sending module 803 is used to feed back the first data to the first host.

作为一种可能的实施方式,接收模块801接收来自第一主机的数据迁移指令,数据迁移指令用于请求将第一数据从第二地址迁移到第一地址。As a possible implementation, the receiving module 801 receives a data migration instruction from the first host, where the data migration instruction is used to request to migrate the first data from the second address to the first address.

处理模块802更新第一主机的共享信息,更新后第一主机的共享信息指示了第一地址与第二地址之间的映射关系。The processing module 802 updates the sharing information of the first host, and the updated sharing information of the first host indicates a mapping relationship between the first address and the second address.

作为一种可能的实施方式,接收模块801接收来自第一主机的写请求,写请求用于请求在第一地址处写入第二数据。As a possible implementation, the receiving module 801 receives a write request from the first host, where the write request is used to request to write the second data at the first address.

处理模块802删除第一主机的共享信息中第一地址与第二地址之间的映射关系;访问第一主机的存储装置,在第一地址写入第二数据。The processing module 802 deletes the mapping relationship between the first address and the second address in the shared information of the first host; accesses the storage device of the first host, and writes the second data at the first address.

作为一种可能的实施方式,处理模块802在更新第一主机的共享信息之前,查询第二主机的共享信息,第二主机的共享信息指示第二地址允许共享。As a possible implementation, the processing module 802 queries the sharing information of the second host before updating the sharing information of the first host, and the sharing information of the second host indicates that the second address allows sharing.

作为一种可能的实施方式,接收模块801接收来自第一主机的数据迁移指令,数据迁移指令用于请求将第一数据从第二地址迁移到第一地址。处理模块802确定第二主机的共享信息指示第二地址禁止共享;发送模块803通知第一主机数据迁移失败。As a possible implementation, the receiving module 801 receives a data migration instruction from the first host, the data migration instruction is used to request to migrate the first data from the second address to the first address. The processing module 802 determines that the sharing information of the second host indicates that the second address is prohibited from being shared; and the sending module 803 notifies the first host that the data migration fails.

作为一种可能的实施方式,第一主机的存储装置以及第一主机的存储装置是物理形态的存储设备虚拟形成的逻辑设备,也可以是物理形态的存储设备。As a possible implementation manner, the storage device of the first host and the storage device of the first host are logical devices virtually formed by physical storage devices, and may also be physical storage devices.

作为一种可能的实施方式,第一地址以及第二地址均为主机物理地址HPA,处理模块802从第二地址读取第一数据时,查询第二主机的主机设备地址映射表,将第二地址转换为第二主机的DPA,从DPA上读取中第一数据,其中,第二主机的主机设备地址映射表描述得了第二主机的HPA与DPA之间的映射关系。As a possible implementation, the first address and the second address are both host physical addresses HPA. When the processing module 802 reads the first data from the second address, it queries the host device address mapping table of the second host, converts the second address into the DPA of the second host, and reads the first data from the DPA, wherein the host device address mapping table of the second host describes the mapping relationship between the HPA and DPA of the second host.

作为一种可能的实施方式,处理模块802保存有第一主机的共享信息,第一主机的共享信息包括第一主机的HPA、以及与第一主机的HPA存在映射关系的第二主机的HPA、以及第二主机的信息。As a possible implementation, the processing module 802 stores the shared information of the first host, which includes the HPA of the first host, the HPA of the second host that is mapped to the HPA of the first host, and the information of the second host.

作为一种可能的实施方式,第一主机的共享信息还包括共享标记,共享标记用于指示第一主机的HPA是否允许共享。As a possible implementation manner, the sharing information of the first host further includes a sharing mark, and the sharing mark is used to indicate whether the HPA of the first host allows sharing.

作为一种可能的实施方式,若第一主机的共享信息未指示第一地址与第二地址之间的映射关系;处理模块802访问第一主机的存储装置,从第一地址读取第一数据,将第一数据反馈给第一主机。As a possible implementation, if the sharing information of the first host does not indicate the mapping relationship between the first address and the second address, the processing module 802 accesses the storage device of the first host, reads the first data from the first address, and feeds the first data back to the first host.

本申请实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,另外,在本申请各个实施例中的各功能模块可以集成在一个处理器中,也可以是单独物理存在,也可以两个或两个以上模块集成为一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。The division of modules in the embodiments of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation. In addition, each functional module in each embodiment of the present application may be integrated into a processor, or may exist physically separately, or two or more modules may be integrated into one module. The above-mentioned integrated modules may be implemented in the form of hardware or in the form of software functional modules.

该集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台终端设备(可以是个人计算机,手机,或者网络设备等)或处理器(processor)执行本申请各个实施例该方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read-onlymemory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated module is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a terminal device (which can be a personal computer, a mobile phone, or a network device, etc.) or a processor (processor) to execute all or part of the steps of the method of each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.

本申请还提供如图9所示的计算设备900。所述计算设备900包括总线901、处理器902、通信接口903和存储器904。处理器902、存储器904和通信接口903之间通过总线901通信。尽管未示出,该计算设备900还可以包括供电电路,该供电电路用于为该处理器902供电。The present application also provides a computing device 900 as shown in FIG9 . The computing device 900 includes a bus 901, a processor 902, a communication interface 903, and a memory 904. The processor 902, the memory 904, and the communication interface 903 communicate with each other via the bus 901. Although not shown, the computing device 900 may also include a power supply circuit, which is used to supply power to the processor 902.

其中,处理器902可以为CPU、ASIC、FPGA、AI芯片、SoC或CPLD,GPU,DPU等。Among them, the processor 902 can be a CPU, ASIC, FPGA, AI chip, SoC or CPLD, GPU, DPU, etc.

存储器904可以包括易失性存储器(volatile memory),例如随机存取存储器(random access memory,RAM)。存储器904还可以包括非易失性存储器(non-volatilememory),例如ROM,快闪存储器,HDD或SSD。存储器904中可以存储计算机程序指令。The memory 904 may include a volatile memory, such as a random access memory (RAM). The memory 904 may also include a non-volatile memory, such as a ROM, a flash memory, a HDD or a SSD. The memory 904 may store computer program instructions.

处理器902可以执行烧写在该处理器902上的可执行代码,执行如图2所示的实施例中存储控制器200所执行的方法。The processor 902 can execute the executable code burned on the processor 902 to execute the method executed by the storage controller 200 in the embodiment shown in FIG. 2 .

处理器902也可以调用存储器904中存储的计算机程序指令执行前述如图2所示的实施例中存储控制器200所执行的方法。存储器904中还可以包括操作系统等其他运行进程所需的软件模块(如数据共享装置800中的多个模块)。操作系统可以为LINUXTM,UNIXTM,WINDOWSTM等。The processor 902 may also call the computer program instructions stored in the memory 904 to execute the method executed by the storage controller 200 in the embodiment shown in FIG2 . The memory 904 may also include software modules required for other running processes such as an operating system (such as multiple modules in the data sharing device 800 ). The operating system may be LINUX TM , UNIX TM , WINDOWS TM , etc.

本申请还提供一种计算设备系统,所述计算设备系统包括至少一个如图10所示的计算设备1000。所述计算设备1000包括总线1001、处理器1002、通信接口1003和存储器1004。处理器1002、存储器1004和通信接口1003之间通过总线1001通信。所述计算设备系统中的至少一个计算设备1000之间通过通信通路进行通信。The present application also provides a computing device system, which includes at least one computing device 1000 as shown in FIG10. The computing device 1000 includes a bus 1001, a processor 1002, a communication interface 1003, and a memory 1004. The processor 1002, the memory 1004, and the communication interface 1003 communicate with each other through the bus 1001. At least one computing device 1000 in the computing device system communicates with each other through a communication path.

其中,处理器1002以及存储器1004的类型与处理器902以及存储器904的类型相似,具体可以参见前述说明,此处不再赘述。Among them, the types of processor 1002 and memory 1004 are similar to those of processor 902 and memory 904. For details, please refer to the above description and will not be repeated here.

处理器1002可以执行烧写在该处理器1002上的可执行代码,执行如图2所示的实施例中存储控制器200所执行部分或全部方法。The processor 1002 may execute executable codes burned on the processor 1002 to execute part or all of the method executed by the storage controller 200 in the embodiment shown in FIG. 2 .

处理器1002也可以调用存储器1004中存储的计算机程序指令执行前述如图2所示的实施例中存储控制器200所执行的部分或全部方法。存储器1004中还可以包括操作系统等其他运行进程所需的软件模块(如数据共享装置800中的多个模块的部分或全部)。操作系统可以为LINUXTM,UNIXTM,WINDOWSTM等。The processor 1002 may also call the computer program instructions stored in the memory 1004 to execute part or all of the methods executed by the storage controller 200 in the embodiment shown in FIG2 . The memory 1004 may also include software modules required for other running processes such as an operating system (such as part or all of the multiple modules in the data sharing device 800). The operating system may be LINUX TM , UNIX TM , WINDOWS TM , etc.

所述计算设备系统中的至少一个计算设备1000之间通过通信网络互相建立通信,每个计算设备1000上运行数据共享装置800中的任意一个或者任意多个模块。At least one computing device 1000 in the computing device system establishes communication with each other via a communication network, and any one or multiple modules in the data sharing device 800 are run on each computing device 1000.

上述各个附图对应的流程的描述各有侧重,某个流程中没有详述的部分,可以参见其他流程的相关描述。The descriptions of the processes corresponding to the above-mentioned figures have different emphases. For parts that are not described in detail in a certain process, please refer to the relevant descriptions of other processes.

在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。计算机程序产品包括计算机程序指令,在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本发明实施例图2所述的流程或功能。In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product. The computer program product includes computer program instructions, and when the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in FIG. 2 of the embodiment of the present invention are generated.

所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如SSD)。The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line, or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated therein. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., an SSD).

显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims (22)

1.一种数据共享方法,其特征在于,所述方法应用计算系统,所述计算系统包括第一主机、第二主机、存储控制器、所述第一主机的存储装置以及所述第二主机的存储装置,所述方法包括:1. A data sharing method, characterized in that the method uses a computing system, the computing system includes a first host, a second host, a storage controller, a storage device of the first host, and a storage device of the second host, and the method includes: 所述存储控制器接收来自所述第一主机的读请求,所述读请求用于请求从所述第一主机的存储装置上的第一地址读取所述第一数据;The storage controller receives a read request from the first host, wherein the read request is used to request to read the first data from a first address on a storage device of the first host; 所述存储控制器根据所述第一主机的共享信息确定所述第一地址映射到所述第二主机的存储装置上的第二地址,所述第一主机的共享信息指示了所述第一地址与所述第二地址之间的映射关系;The storage controller determines, according to the sharing information of the first host, that the first address is mapped to a second address on the storage device of the second host, wherein the sharing information of the first host indicates a mapping relationship between the first address and the second address; 所述存储控制器从所述第二地址读取所述第一数据,将所述第一数据反馈给所述第一主机。The storage controller reads the first data from the second address and feeds the first data back to the first host. 2.如权利要求1所述的方法,其特征在于,所述存储控制器接收来自所述第一主机的读请求之前,还包括:2. The method according to claim 1, wherein before the storage controller receives the read request from the first host, the method further comprises: 所述存储控制器接收来自所述第一主机的数据迁移指令,所述数据迁移指令用于请求将所述第一数据从所述第二地址迁移到所述第一地址;The storage controller receives a data migration instruction from the first host, where the data migration instruction is used to request to migrate the first data from the second address to the first address; 所述存储控制器更新所述第一主机的共享信息,更新后所述第一主机的共享信息指示了所述第一地址与所述第二地址之间的映射关系。The storage controller updates the sharing information of the first host, and the updated sharing information of the first host indicates a mapping relationship between the first address and the second address. 3.如权利要求1或2所述的方法,其特征在于,所述方法还包括:3. The method according to claim 1 or 2, characterized in that the method further comprises: 所述存储控制器接收来自所述第一主机的写请求,所述写请求用于请求在所述第一地址处写入所述第二数据;The storage controller receives a write request from the first host, where the write request is used to request writing the second data at the first address; 所述存储控制器删除所述第一主机的共享信息中所述第一地址与所述第二地址之间的映射关系;The storage controller deletes the mapping relationship between the first address and the second address in the sharing information of the first host; 所述存储控制器访问所述第一主机的存储装置,在所述第一地址写入所述第二数据。The storage controller accesses the storage device of the first host and writes the second data at the first address. 4.如权利要求2所述的方法,其特征在于,所述存储控制器在更新所述第一主机的共享信息之前,还包括:4. The method according to claim 2, wherein before the storage controller updates the sharing information of the first host, the storage controller further comprises: 所述存储控制器查询所述第二主机的共享信息,所述第二主机的共享信息指示所述第二地址允许共享。The storage controller queries the sharing information of the second host, and the sharing information of the second host indicates that the second address allows sharing. 5.如权利要求1所述的方法,其特征在于,所述方法还包括:5. The method according to claim 1, further comprising: 所述存储控制器接收来自所述第一主机的数据迁移指令,所述数据迁移指令用于请求将所述第一数据从所述第二地址迁移到所述第一地址;The storage controller receives a data migration instruction from the first host, where the data migration instruction is used to request to migrate the first data from the second address to the first address; 所述存储控制器在确定所述第二主机的共享信息指示所述第二地址禁止共享时,通知所述第一主机数据迁移失败。When determining that the sharing information of the second host indicates that the second address is prohibited from being shared, the storage controller notifies the first host that the data migration fails. 6.如权利要求1~5任一项所述的方法,其特征在于,所述计算系统部署一个计算设备中。6. The method according to any one of claims 1 to 5, characterized in that the computing system is deployed in a computing device. 7.如权利要求1~6任一项所述的方法,其特征在于,所述第一主机的存储装置以及所述第二主机的存储装置是物理形态的存储设备虚拟形成的逻辑设备。7. The method according to any one of claims 1 to 6, characterized in that the storage device of the first host and the storage device of the second host are logical devices virtually formed by physical storage devices. 8.如权利要求1-6任一项所述的方法,其特征在于,所述第一地址以及所述第二地址均为主机物理地址HPA,所述存储控制器从所述第二地址读取所述第一数据,包括:8. The method according to any one of claims 1 to 6, wherein the first address and the second address are both host physical addresses HPA, and the storage controller reads the first data from the second address, comprising: 所述存储控制器查询所述第二主机的主机设备地址映射表,将所述第二地址转换为所述第二主机的DPA,从所述DPA上读取中所述第一数据,其中,所述第二主机的主机设备地址映射表描述了所述第二主机的HPA与DPA之间的映射关系。The storage controller queries the host device address mapping table of the second host, converts the second address into the DPA of the second host, and reads the first data from the DPA, wherein the host device address mapping table of the second host describes the mapping relationship between the HPA and DPA of the second host. 9.如权利要求1-8任一项所述的方法,其特征在于,所述存储控制器保存有所述第一主机的共享信息,所述第一主机的共享信息包括所述第一主机的HPA、以及与第一主机的HPA存在映射关系的所述第二主机的HPA、以及所述第二主机的信息。9. The method according to any one of claims 1 to 8, characterized in that the storage controller stores sharing information of the first host, the sharing information of the first host includes the HPA of the first host, the HPA of the second host that is mapped to the HPA of the first host, and information of the second host. 10.如权利要求9所述的方法,其特征在于,所述第一主机的共享信息还包括共享标记,所述共享标记用于指示所述第一主机的HPA是否允许共享。10. The method according to claim 9, wherein the sharing information of the first host further includes a sharing tag, and the sharing tag is used to indicate whether the HPA of the first host allows sharing. 11.一种数据共享装置,其特征在于,所述装置包括:11. A data sharing device, characterized in that the device comprises: 接收模块,用于接收来自所述第一主机的读请求,所述读请求用于请求从所述第一主机的存储装置上的第一地址读取所述第一数据;a receiving module, configured to receive a read request from the first host, wherein the read request is used to request to read the first data from a first address on a storage device of the first host; 处理模块,用于根据所述第一主机的共享信息确定所述第一地址映射到所述第二主机的存储装置上的第二地址,所述第一主机的共享信息指示了所述第一地址与所述第二地址之间的映射关系;从所述第二地址读取所述第一数据;a processing module, configured to determine, according to the sharing information of the first host, that the first address is mapped to a second address on the storage device of the second host, wherein the sharing information of the first host indicates a mapping relationship between the first address and the second address; and read the first data from the second address; 发送模块,用于将所述第一数据反馈给所述第一主机。A sending module is used to feed back the first data to the first host. 12.如权利要求11所述的装置,其特征在于,12. The device according to claim 11, characterized in that 所述接收模块,还用于接收来自所述第一主机的数据迁移指令,所述数据迁移指令用于请求将所述第一数据从所述第二地址迁移到所述第一地址;The receiving module is further used to receive a data migration instruction from the first host, wherein the data migration instruction is used to request to migrate the first data from the second address to the first address; 所述处理模块,还用于更新所述第一主机的共享信息,更新后所述第一主机的共享信息指示了所述第一地址与所述第二地址之间的映射关系。The processing module is further used to update the sharing information of the first host, and the updated sharing information of the first host indicates a mapping relationship between the first address and the second address. 13.如权利要求11或12所述的装置,其特征在于,13. The device according to claim 11 or 12, characterized in that 所述接收模块,还用于接收来自所述第一主机的写请求,所述写请求用于请求在所述第一地址处写入所述第二数据;The receiving module is further used to receive a write request from the first host, wherein the write request is used to request to write the second data at the first address; 所述处理模块,还用于删除所述第一主机的共享信息中所述第一地址与所述第二地址之间的映射关系;访问所述第一主机的存储装置,在所述第一地址写入所述第二数据。The processing module is further used to delete the mapping relationship between the first address and the second address in the shared information of the first host; access the storage device of the first host, and write the second data at the first address. 14.如权利要求12所述的装置,其特征在于,所述处理模块在更新所述第一主机的共享信息之前,还用于:14. The device according to claim 12, wherein before updating the shared information of the first host, the processing module is further configured to: 查询所述第二主机的共享信息,所述第二主机的共享信息指示所述第二地址允许共享。The sharing information of the second host is queried, and the sharing information of the second host indicates that the second address allows sharing. 15.如权利要求11所述的装置,其特征在于,15. The device according to claim 11, characterized in that 所述接收模块,还用于接收来自所述第一主机的数据迁移指令,所述数据迁移指令用于请求将所述第一数据从所述第二地址迁移到所述第一地址;The receiving module is further used to receive a data migration instruction from the first host, wherein the data migration instruction is used to request to migrate the first data from the second address to the first address; 所述处理模块,还用于确定所述第二主机的共享信息指示所述第二地址禁止共享;The processing module is further used to determine that the sharing information of the second host indicates that the second address is prohibited from being shared; 所述发送模块,用于通知所述第一主机数据迁移失败。The sending module is used to notify the first host that the data migration fails. 16.如权利要求11~15任一项所述的装置,其特征在于,所述第一主机的存储装置以及所述第一主机的存储装置是物理形态的存储设备虚拟形成的逻辑设备。16. The device according to any one of claims 11 to 15, wherein the storage device of the first host and the storage device of the second host are logical devices virtually formed by physical storage devices. 17.如权利要求11-16任一项所述的装置,其特征在于,所述第一地址以及所述第二地址均为主机物理地址HPA,所述处理模块从所述第二地址读取所述第一数据,用于:17. The device according to any one of claims 11 to 16, wherein the first address and the second address are both host physical addresses HPA, and the processing module reads the first data from the second address, for: 查询所述第二主机的主机设备地址映射表,将所述第二地址转换为所述第二主机的DPA,从所述DPA上读取中所述第一数据,其中,所述第二主机的主机设备地址映射表描述了所述第二主机的HPA与DPA之间的映射关系。Query the host device address mapping table of the second host, convert the second address into the DPA of the second host, and read the first data from the DPA, wherein the host device address mapping table of the second host describes the mapping relationship between the HPA and the DPA of the second host. 18.如权利要求11-17任一项所述的装置,其特征在于,所述存储控制器保存有所述第一主机的共享信息,所述第一主机的共享信息包括所述第一主机的HPA、以及与第一主机的HPA存在映射关系的所述第二主机的HPA、以及所述第二主机的信息。18. The device according to any one of claims 11 to 17, characterized in that the storage controller stores sharing information of the first host, the sharing information of the first host includes the HPA of the first host, the HPA of the second host that is mapped to the HPA of the first host, and information of the second host. 19.如权利要求18所述的装置,其特征在于,所述第一主机的共享信息还包括共享标记,所述共享标记用于指示所述第一主机的HPA是否允许共享。19. The apparatus according to claim 18, wherein the sharing information of the first host further comprises a sharing mark, and the sharing mark is used to indicate whether the HPA of the first host allows sharing. 20.一种计算设备,其特征在于,所述计算设备包括处理器和供电电路;20. A computing device, characterized in that the computing device comprises a processor and a power supply circuit; 所述供电电路用于对所述处理器供电;The power supply circuit is used to supply power to the processor; 所述处理器执行如权利要求1至10中任一项所述的方法。The processor executes the method according to any one of claims 1 to 10. 21.一种非瞬态的计算机可读存储介质,其特征在于,所述非瞬态的计算机可读存储介质被计算设备执行时,所述计算设备执行上述权利要求1至10中任一项所述的方法。21. A non-transitory computer-readable storage medium, characterized in that when the non-transitory computer-readable storage medium is executed by a computing device, the computing device executes the method according to any one of claims 1 to 10. 22.一种计算设备程序产品,其特征在于,所述计算设备程序产品包括计算机指令,在被计算设备执行时,所述计算设备执行如权利要求1至10中任一项所述的方法。22. A computing device program product, characterized in that the computing device program product comprises computer instructions, and when executed by a computing device, the computing device performs the method according to any one of claims 1 to 10.
CN202310611054.0A 2023-03-22 2023-05-26 Data sharing method, device and equipment Pending CN118689788A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2024/077829 WO2024193272A1 (en) 2023-03-22 2024-02-20 Data sharing method, apparatus and device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN2023102939687 2023-03-22
CN202310293968 2023-03-22

Publications (1)

Publication Number Publication Date
CN118689788A true CN118689788A (en) 2024-09-24

Family

ID=92763637

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310611054.0A Pending CN118689788A (en) 2023-03-22 2023-05-26 Data sharing method, device and equipment

Country Status (2)

Country Link
CN (1) CN118689788A (en)
WO (1) WO2024193272A1 (en)

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014178450A1 (en) * 2013-04-30 2014-11-06 전자부품연구원 Collaboration system between cpu and gpu, and method thereof
CN107278292B (en) * 2016-06-21 2020-07-28 华为技术有限公司 Mapping method and device for memory of virtual machine and data transmission equipment
CN114385516A (en) * 2020-10-21 2022-04-22 澜起科技股份有限公司 Computing system and method for sharing device memory of different computing devices
US20220342553A1 (en) * 2021-04-27 2022-10-27 Micron Technology, Inc. Copy command for a memory system
CN113590364B (en) * 2021-09-29 2021-12-21 阿里云计算有限公司 Data processing method and device based on distributed shared memory system
CN114780448A (en) * 2022-05-18 2022-07-22 苏州忆联信息系统有限公司 Method and device for quickly copying data, computer equipment and storage medium

Also Published As

Publication number Publication date
WO2024193272A1 (en) 2024-09-26

Similar Documents

Publication Publication Date Title
US11500689B2 (en) Communication method and apparatus
US10838665B2 (en) Method, device, and system for buffering data for read/write commands in NVME over fabric architecture
US10552337B2 (en) Memory management and device
CN112540941B (en) Data forwarding chip and server
JP7467593B2 (en) Resource allocation method, storage device, and storage system - Patents.com
CN111831588A (en) A storage device access method, apparatus and system
CN110119304B (en) Interrupt processing method and device and server
US20220253252A1 (en) Data processing method and apparatus
US20220358049A1 (en) Memory access handling for peripheral component interconnect devices
EP4421631A1 (en) Data migration method and apparatus, and electronic device
US20240354267A1 (en) Data Storage Method and System, Storage Access Configuration Method, and Related Device
US20250094203A1 (en) Method and apparatus for creating container, and storage medium
WO2022242665A1 (en) Data storage method and related device
WO2020253523A1 (en) Database access method and device
WO2024060710A1 (en) Page swap-in method and apparatus
WO2024193272A1 (en) Data sharing method, apparatus and device
WO2022151950A1 (en) Tensor processing method, apparatus and device, and computer readable storage medium
WO2022222977A1 (en) Method and apparatus for managing memory of physical server for running cloud service instances
KR101303079B1 (en) Apparatus and method for controlling cache coherence in virtualized environment based on multi-core
CN109684029A (en) Storage content access method, device, electronic equipment and computer storage medium
CN117762572B (en) Unloading method and equipment for host and virtual machine shared directory file system
CN118567576B (en) Multi-control memory system and data storage method, device, medium and product thereof
CN111858418A (en) A memory communication method and device based on remote direct memory access RDMA
CN106445650B (en) A kind of interrupt processing method, IOAPIC and computer system
US20230132442A1 (en) Method for processing data by using intermediate device, computer system, and intermediate device

Legal Events

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