CN111752480A - A data writing method, data reading method and related equipment and system - Google Patents
A data writing method, data reading method and related equipment and system Download PDFInfo
- Publication number
- CN111752480A CN111752480A CN202010420635.2A CN202010420635A CN111752480A CN 111752480 A CN111752480 A CN 111752480A CN 202010420635 A CN202010420635 A CN 202010420635A CN 111752480 A CN111752480 A CN 111752480A
- Authority
- CN
- China
- Prior art keywords
- data
- read
- storage node
- written
- remote storage
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/061—Improving I/O performance
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/25—Integrating or interfacing systems involving database management systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0629—Configuration or reconfiguration of storage systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0655—Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0668—Interfaces specially adapted for storage systems adopting a particular infrastructure
- G06F3/067—Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]
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)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
本发明实施例公开一种数据写方法、数据读方法及相关设备、系统。该数据写方法包括:接收到应用程序调用用于写数据的键值存储接口所发起针对远端存储节点的写请求,写请求携带由键和值组成的键值对,其中,键用于指示待写入数据的目的地址,值用于指示待写入数据的源地址和待写入数据的大小;根据键值对,生成符合高速网络存储协议的写命令;写命令包括:用于指示待写入数据的目的地址的第一字段、用于指示待写入数据的源地址的第二字段,以及用于指示待写入数据的大小的第三字段;通过高速网络存储协议的接口向远端存储节点发送写命令。上述方案可兼容键值存储与所述高速网络存储协议各自的存储优势。
The embodiments of the present invention disclose a data writing method, a data reading method, and related equipment and systems. The data writing method includes: receiving a write request for a remote storage node initiated by an application program calling a key-value storage interface for writing data, the write request carrying a key-value pair consisting of a key and a value, wherein the key is used to indicate The destination address of the data to be written, the value is used to indicate the source address of the data to be written and the size of the data to be written; according to the key-value pair, a write command that conforms to the high-speed network storage protocol is generated; the write command includes: The first field of the destination address of the data to be written, the second field used to indicate the source address of the data to be written, and the third field used to indicate the size of the data to be written; The end storage node sends a write command. The above solution is compatible with the respective storage advantages of key-value storage and the high-speed network storage protocol.
Description
技术领域technical field
本发明涉及存储领域,尤其涉及一种数据写方法、数据读方法及相关设备、系统。The invention relates to the field of storage, in particular to a data writing method, a data reading method, and related equipment and systems.
背景技术Background technique
随着信息技术的高速发展,数据海量存储对存储系统系统提出了新的需求和挑战。为了应对这种挑战,键值存储(即Key-Value储存,简称KV存储)的存储管理技术应运而生。KV存储能够满足对海量数据的高效率存储和访问的需求。另外,非易失性存储标准(Non-Volatile Memory Express,NVMe)作为一个高效的存储协议已经得到了众多闪存、服务器及存储厂商的支持,其生态日趋成熟。与此同时,更为高效的网络存储协议也随着闪存技术的演进呼之欲出,这就是NVMe Over Fabric。NVMe Over Fabric替换了以前的前端所使用的iSCSI(例如Linux下的iSER或者Windows下的SMB3),使得终端用户可以直接通过NVMe Over Fabric协议实现对远端NVMe设备快速、低延迟的访问。With the rapid development of information technology, the mass storage of data brings new demands and challenges to the storage system. In order to cope with this challenge, the storage management technology of key-value storage (ie Key-Value storage, KV storage for short) emerges as the times require. KV storage can meet the needs of efficient storage and access to massive data. In addition, as an efficient storage protocol, Non-Volatile Memory Express (NVMe) has been supported by many flash memory, server and storage manufacturers, and its ecology is becoming more and more mature. At the same time, a more efficient network storage protocol is also coming out with the evolution of flash memory technology, which is NVMe Over Fabric. NVMe Over Fabric replaces the iSCSI (such as iSER under Linux or SMB3 under Windows) used in the previous front-end, so that end users can directly access remote NVMe devices with fast and low latency through the NVMe Over Fabric protocol.
基于NVMe Over Fabric支持远端存储的优点,以及KV存储管理技术支持高效率的海量数据存储管理的优点,KV接口与NVMe Over Fabric的兼容将在未来存储领域中发挥重要的作用,具有良好和广阔的市场前景。Based on the advantages of NVMe Over Fabric supporting remote storage and the advantages of KV storage management technology supporting efficient mass data storage management, the compatibility between KV interface and NVMe Over Fabric will play an important role in the future storage field, with good and broad market prospects.
发明内容SUMMARY OF THE INVENTION
本发明实施例提供了一种数据写方法、数据读方法及相关设备、系统,可实现将键值存储接口承载在用于网络存储的所述高速网络存储协议上,兼容了键值存储与所述高速网络存储协议各自的存储优势。Embodiments of the present invention provide a data writing method, a data reading method, and related equipment and systems, which can implement a key-value storage interface to be carried on the high-speed network storage protocol used for network storage, and are compatible with key-value storage and all The respective storage advantages of the high-speed network storage protocols described above.
第一方面,提供了一种数据写方法,应用于主机侧,包括:In the first aspect, a data writing method is provided, applied to the host side, including:
接收到针对远端存储节点的写请求,所述写请求携带由键和值组成的键值对,并根据所述键值对生成符合高速网络存储协议的写命令,最后通过所述高速网络存储协议的接口向所述远端存储节点发送所述写命令,触发所述远端存储节点响应所述写命令,将存储于所述源地址处的所述待写入数据写入所述目的地址所映射的物理地址中。A write request for a remote storage node is received, the write request carries a key-value pair consisting of a key and a value, and a write command conforming to the high-speed network storage protocol is generated according to the key-value pair, and finally the high-speed network storage The interface of the protocol sends the write command to the remote storage node, triggering the remote storage node to respond to the write command and write the to-be-written data stored at the source address into the destination address in the mapped physical address.
具体的,所述写请求是应用程序通过调用用于写数据的键值存储接口,例如KV_write(),发起的请求;所述用于写数据的键值存储接口的输入参数包括所述键值对,其中,所述键用于指示待写入数据的目的地址,所述值用于指示所述待写入数据的源地址和所述待写入数据的大小。Specifically, the write request is a request initiated by an application program by calling a key-value storage interface for writing data, such as KV_write(); the input parameters of the key-value storage interface for writing data include the key value Yes, wherein the key is used to indicate the destination address of the data to be written, and the value is used to indicate the source address of the data to be written and the size of the data to be written.
具体的,所述写命令可包括:用于指示所述待写入数据的目的地址的第一字段、用于指示所述待写入数据的源地址的第二字段,以及用于指示所述待写入数据的大小的第三字段。Specifically, the write command may include: a first field for indicating the destination address of the data to be written, a second field for indicating the source address of the data to be written, and a second field for indicating the data to be written The third field of the size of the data to be written.
可以理解的,由于所述键值对包含有所述写命令中的第一字段、第二字段和第三字段的值,因此,主机能够根据所述写请求携带的键值对填充所述写命令的相应字段。Understandably, since the key-value pair contains the values of the first field, the second field and the third field in the write command, the host can fill in the write command according to the key-value pair carried in the write request. The corresponding fields of the command.
实施第一方面描述的数据写方法,可实现将用于写数据的键值存储接口承载在用于网络存储的所述高速网络存储协议上,使得应用程序可以通过键值存储接口实现对所述远端存储节点的数据写操作,兼容了所述键值存储接口与所述高速网络存储协议各自的存储优势。By implementing the data writing method described in the first aspect, the key-value storage interface for writing data can be carried on the high-speed network storage protocol used for network storage, so that the application program can implement the key-value storage interface through the key-value storage interface. The data write operation of the remote storage node is compatible with the respective storage advantages of the key-value storage interface and the high-speed network storage protocol.
第二方面,提供了一种数据写方法,应用于远端存储节点侧,包括:In a second aspect, a data writing method is provided, applied to the remote storage node side, including:
通过高速网络存储协议的接口接收主机发送的符合所述高速网络存储协议的写命令,将所述待写入数据的目的地址与所述待写入数据的元数据一一对应的保存在目标缓存区内的目标数据库中,并分析出所述目的地址所映射的物理地址,然后响应所述写命令,将所述待写入数据写入所述目的地址所映射的物理地址中。A write command that conforms to the high-speed network storage protocol sent by the host is received through the interface of the high-speed network storage protocol, and the destination address of the data to be written and the metadata of the data to be written are stored in the target cache in a one-to-one correspondence In the target database in the area, and analyze the physical address mapped by the destination address, and then respond to the write command, write the to-be-written data into the physical address mapped by the destination address.
具体的,所述写命令可包括:用于指示待写入数据的目的地址的第一字段、用于指示所述待写入数据的源地址的第二字段,以及用于指示所述待写入数据的大小的第三字段、用于指示所述待写入数据的元数据的第四字段。所述目标数据库向所述主机提供元数据访问接口,例如增、删、改、查等接口。Specifically, the write command may include: a first field for indicating the destination address of the data to be written, a second field for indicating the source address of the data to be written, and a second field for indicating the to-be-written data A third field of the size of the input data, and a fourth field of metadata used to indicate the data to be written. The target database provides metadata access interfaces to the host, such as interfaces for adding, deleting, modifying, and querying.
与实施第一方面描述的数据写方法的有益效果相同,实施第二方面描述的数据写方法,同样地可实现将用于写数据的键值存储接口承载在用于网络存储的所述高速网络存储协议上,使得应用程序可以通过键值存储接口实现对所述远端存储节点的数据写操作,兼容了所述键值存储接口与所述高速网络存储协议各自的存储优势。With the same beneficial effect of implementing the data writing method described in the first aspect, implementing the data writing method described in the second aspect can also realize that the key-value storage interface for writing data is carried on the high-speed network for network storage. In terms of storage protocol, the application program can realize the data write operation to the remote storage node through the key-value storage interface, which is compatible with the respective storage advantages of the key-value storage interface and the high-speed network storage protocol.
并且,可以理解的,本发明提供的所述目标数据库可实现:所述主机直接从远端存储节点的内存(即所述目标数据库)中访问所述待写入数据的元数据,而不必在存储硬盘上逐块的去查找所述待写入数据的元数据,实现了对已写入所述存储硬盘的数据的元数据的高效率访问和管理。Moreover, it can be understood that the target database provided by the present invention can realize: the host directly accesses the metadata of the data to be written from the memory of the remote storage node (that is, the target database), without having to The metadata of the to-be-written data is searched block by block on the storage hard disk, thereby realizing efficient access and management of the metadata of the data written to the storage hard disk.
在一种实现方式中,在所述远端存储节点将所述待写入数据写入所述目的地址所映射的物理地址中之后,所述远端存储节点可以通过所述高速网络存储协议的接口向主机返回写响应。In an implementation manner, after the remote storage node writes the to-be-written data into the physical address mapped by the destination address, the remote storage node can use the high-speed network storage protocol The interface returns a write response to the host.
相应的,所述主机可以通过所述高速网络存储协议的接口接收到远端存储节点返回的所述写响应。Correspondingly, the host may receive the write response returned by the remote storage node through the interface of the high-speed network storage protocol.
具体实现中,在所述主机接收到所述写响应之后,所述主机可以将所述写响应的数据格式转换成用于接收写响应的键值存储接口,例如KV_Get_Response(),能够识别的写响应格式,使得所述应用程序通过调用该键值存储接口识别出所述写响应。In a specific implementation, after the host receives the write response, the host may convert the data format of the write response into a key-value storage interface for receiving the write response, such as KV_Get_Response(), which can recognize the write response. Response format such that the application recognizes the write response by invoking the key-value store interface.
在一种实现方式中,在接收到主机发送的所述写命令之后,远端存储节点可以向主机发送针对所述待写入数据的获取请求,所述获取请求可包含所述待写入数据的源地址。In an implementation manner, after receiving the write command sent by the host, the remote storage node may send an acquisition request for the data to be written to the host, and the acquisition request may include the data to be written source address.
相应的,主机接可收远端存储节点发送的针对所述待写入数据的获取请求。Correspondingly, the host may receive a request for obtaining the data to be written sent by the remote storage node.
之后,主机可响应所述获取请求,通过所述高速网络存储协议的接口向远端存储节点发送存储于所述源地址处的所述待写入数据。Afterwards, the host may respond to the acquisition request and send the to-be-written data stored at the source address to the remote storage node through the interface of the high-speed network storage protocol.
相应的,远端存储节点可通过所述高速网络存储协议的接口接收到主机发送的所述待写入数据。Correspondingly, the remote storage node can receive the data to be written sent by the host through the interface of the high-speed network storage protocol.
第三方面,提供了一种数据读方法,应用于主机侧,包括:In a third aspect, a data reading method is provided, applied to the host side, including:
接收到针对远端存储节点的读请求,所述读请求携带由键和值组成的键值对,并根据所述键值对生成符合高速网络存储协议的读命令,最后通过所述高速网络存储协议的接口向远端存储节点发送所述读命令,触发所述远端存储节点响应所述读命令,从所述源地址所映射的物理地址中读出所述待读取数据。A read request for a remote storage node is received, the read request carries a key-value pair consisting of a key and a value, and a read command conforming to the high-speed network storage protocol is generated according to the key-value pair, and finally the high-speed network storage The interface of the protocol sends the read command to the remote storage node, triggering the remote storage node to respond to the read command and read the data to be read from the physical address mapped by the source address.
具体的,所述读请求是应用程序通过调用用于读数据的键值存储接口,例如KV_read(),发起的请求,所述用于读数据的键值存储接口的输入参数包括所述键值对;所述键用于指示待读取数据的源地址,所述值用于指示所述待读取数据的目的地址和所述待读取数据的大小;Specifically, the read request is a request initiated by an application program by calling a key-value storage interface for reading data, such as KV_read(), and the input parameters of the key-value storage interface for reading data include the key value Right; the key is used to indicate the source address of the data to be read, and the value is used to indicate the destination address of the data to be read and the size of the data to be read;
具体的,所述读命令可包括:用于指示所述待读取数据的源地址的第一字段、用于指示所述待读取数据的目的地址的第二字段,以及用于指示所述待读取数据的大小的第三字段。Specifically, the read command may include: a first field for indicating the source address of the data to be read, a second field for indicating the destination address of the data to be read, and a second field for indicating the data to be read. The third field of the size of the data to be read.
可以理解的,由于所述键值对包含有所述读命令中的第一字段、第二字段和第三字段的值,因此,主机能够根据所述读请求携带的键值对填充所述读命令的相应字段。Understandably, since the key-value pair contains the values of the first field, the second field and the third field in the read command, the host can fill in the read command according to the key-value pair carried in the read request. The corresponding fields of the command.
实施第一方面描述的数据读方法,可实现将用于读数据的键值存储接口承载在用于网络存储的所述高速网络存储协议上,使得应用程序可以通过键值存储接口实现对所述远端存储节点的数据读操作,兼容了所述键值存储接口与所述高速网络存储协议各自的存储优势。Implementing the data reading method described in the first aspect can realize that the key-value storage interface for reading data is carried on the high-speed network storage protocol used for network storage, so that the application program can implement the key-value storage interface through the key-value storage interface. The data read operation of the remote storage node is compatible with the respective storage advantages of the key-value storage interface and the high-speed network storage protocol.
第四方面,提供了一种数据读方法,应用于远端存储节点侧,包括:In a fourth aspect, a data reading method is provided, applied to the remote storage node side, including:
通过高速网络存储协议的接口接收主机发送的符合所述高速网络存储协议的读命令,分析出所述源地址所映射的物理地址,然后响应所述读命令,从所述源地址所映射的物理地址中读取出所述待读取数据。Receive a read command that conforms to the high-speed network storage protocol sent by the host through the interface of the high-speed network storage protocol, analyze the physical address mapped by the source address, and then respond to the read command, from the physical address mapped by the source address. The data to be read is read from the address.
具体的,所述读命令可包括:用于指示所述待读取数据的源地址的第一字段、用于指示所述待读取数据的目的地址的第二字段,以及用于指示所述待读取数据的大小的第三字段。Specifically, the read command may include: a first field for indicating the source address of the data to be read, a second field for indicating the destination address of the data to be read, and a second field for indicating the data to be read. The third field of the size of the data to be read.
与实施第三方面描述的数据读方法的有益效果相同,实施第四方面描述的数据读方法,同样地可实现将用于读数据的键值存储接口承载在用于网络存储的所述高速网络存储协议上,使得应用程序可以通过键值存储接口实现对所述远端存储节点的数据读操作,兼容了所述键值存储接口与所述高速网络存储协议各自的存储优势。With the same beneficial effect as implementing the data reading method described in the third aspect, implementing the data reading method described in the fourth aspect can also realize that the key-value storage interface used for reading data is carried on the high-speed network used for network storage. In terms of storage protocol, the application program can realize the data read operation on the remote storage node through the key-value storage interface, which is compatible with the respective storage advantages of the key-value storage interface and the high-speed network storage protocol.
在一种实现方式中,在所述远端存储节点从所述源地址所映射的物理地址中读取出所述待读取数据之后,所述远端存储节点可以通过所述高速网络存储协议的接口向主机返回读响应。In an implementation manner, after the remote storage node reads the data to be read from the physical address mapped by the source address, the remote storage node can pass the high-speed network storage protocol The interface returns a read response to the host.
相应的,所述主机可以通过所述高速网络存储协议的接口接收到远端存储节点返回的所述读响应。Correspondingly, the host may receive the read response returned by the remote storage node through the interface of the high-speed network storage protocol.
具体实现中,在接收到所述读响应之后,所述主机可以将所述读响应的数据格式转换成用于接收读响应的键值存储接口,例如KV_Get_Response(),能够识别的读响应格式,使得所述应用程序通过调用该键值存储接口识别出所述读响应。In a specific implementation, after receiving the read response, the host may convert the data format of the read response into a key-value storage interface for receiving the read response, such as KV_Get_Response(), a recognizable read response format, The application is caused to recognize the read response by invoking the key-value store interface.
在一种实现方式中,在接收到所述主机发送的所述读命令之后,所述远端存储节点还可以向主机发送针对所述待读取数据的发送请求,所述发送请求包含所述待读取数据的目的地址。In an implementation manner, after receiving the read command sent by the host, the remote storage node may further send a sending request for the data to be read to the host, where the sending request includes the The destination address of the data to be read.
相应的,所述主机接可收远端存储节点发送的所述发送请求,并向远端存储节点返回针对所述发送请求的应答。Correspondingly, the host can receive the sending request sent by the remote storage node, and return a response to the sending request to the remote storage node.
之后,所述远端存储节点可以接收到所述主机返回的所述应答,并通过高速网络存储协议的接口向所述主机发送所述待读取数据。Afterwards, the remote storage node may receive the response returned by the host, and send the data to be read to the host through an interface of a high-speed network storage protocol.
相应的,所述主机可以通过所述高速网络存储协议的接口接收到所述远端存储节点发送的所述待读取数据,并将所述待读取数据存储到所述目的地址处。Correspondingly, the host may receive the data to be read sent by the remote storage node through the interface of the high-speed network storage protocol, and store the data to be read at the destination address.
第五方面,提供了一种数据写设备,包括用于执行第一方面所述的方法的单元。In a fifth aspect, a data writing device is provided, comprising a unit for performing the method of the first aspect.
第六方面,提供了一种存储节点,包括用于执行第二方面所述的方法的单元。In a sixth aspect, a storage node is provided, comprising a unit for performing the method of the second aspect.
第七方面,提供了一种数据读设备,包括用于执行第三方面所述的方法的单元。In a seventh aspect, a data reading device is provided, comprising a unit for performing the method of the third aspect.
第八方面,提供了一种存储节点,包括用于执行第四方面所述的方法的单元。In an eighth aspect, a storage node is provided, comprising a unit for performing the method of the fourth aspect.
第九方面,提供了一种数据写设备,用于执行第一方面描述的数据写方法。所述数据写设备站可包括:存储器以及与所述存储器耦合的处理器、发射器和接收器,其中:所述发射器用于与向远端存储节点发送移动通信信号,所述接收器用于接收所述远端存储节点发送的移动通信信号,所述存储器用于存储第一方面描述的数据写方法的实现代码,所述处理器用于执行所述存储器中存储的程序代码,即执行第一方面描述的数据写方法。In a ninth aspect, a data writing device is provided for executing the data writing method described in the first aspect. The data writer station may include: a memory and a processor coupled to the memory, a transmitter and a receiver, wherein the transmitter is configured to transmit a mobile communication signal to a remote storage node, and the receiver is configured to receive The mobile communication signal sent by the remote storage node, the memory is used to store the implementation code of the data writing method described in the first aspect, and the processor is used to execute the program code stored in the memory, that is, to execute the first aspect Describes the data writing method.
第十方面,提供了一种数据读设备,用于执行第三方面描述的数据读方法。所述数据读设备站可包括:存储器以及与所述存储器耦合的处理器、发射器和接收器,其中:所述发射器用于与向远端存储节点发送移动通信信号,所述接收器用于接收所述远端存储节点发送的移动通信信号,所述存储器用于存储第三方面描述的数据读方法的实现代码,所述处理器用于执行所述存储器中存储的程序代码,即执行第三方面描述的数据读方法。A tenth aspect provides a data reading device for executing the data reading method described in the third aspect. The data reading device station may include a memory and a processor coupled to the memory, a transmitter and a receiver, wherein the transmitter is configured to transmit a mobile communication signal to a remote storage node, and the receiver is configured to receive The mobile communication signal sent by the remote storage node, the memory is used to store the implementation code of the data reading method described in the third aspect, and the processor is used to execute the program code stored in the memory, that is, to execute the third aspect Describes the data read method.
第十一方面,提供了一种存储系统,包括:数据写设备和存储节点,其中:所述数据写设备是上述第五方面内容所述的数据写设备,所述存储节点是上述第六方面内容所述的存储节点。In an eleventh aspect, a storage system is provided, comprising: a data writing device and a storage node, wherein: the data writing device is the data writing device described in the fifth aspect, and the storage node is the sixth aspect The storage node described in the content.
在一些可能的实现方式中,所述数据写设备也可以是上述第九方面内容所述的存储节点。In some possible implementations, the data writing device may also be the storage node described in the ninth aspect above.
第十二方面,提供了一种存储系统,包括:数据读设备和存储节点,其中:所述数据读设备是上述第七方面内容所述的数据读设备,所述存储节点是上述第八方面内容所述的存储节点。A twelfth aspect provides a storage system, comprising: a data reading device and a storage node, wherein: the data reading device is the data reading device described in the above seventh aspect, and the storage node is the above eighth aspect The storage node described in the content.
在一些可能的实现方式中,所述数据读设备也可以是上述第十方面内容所述的数据读设备。In some possible implementations, the data reading device may also be the data reading device described in the tenth aspect above.
实施本发明实施例,主机可以根据应用程序发送的针对远端存储节点的读写请求所携带的键值对,生成符合高速网络存储协议的读写命令,所述读写请求是所述应用程序通过调用键值存储接口发起的请求;并且,所述主机可以通过所述符合高速网络存储协议的传输接口向所述远端存储节点发送所述符合高速网络存储协议的读写命令,以触发所述远端存储节点响应所述符合高速网络存储协议的读写命令,完成远端读写操作。上述方案可实现将键值存储接口承载在所述高速网络存储协议上,使得应用程序可以通过键值存储接口对所述远端存储节点进行读写操作,兼容了键值存储与所述高速网络存储协议各自的存储优势。Implementing the embodiment of the present invention, the host can generate a read and write command that conforms to the high-speed network storage protocol according to the key-value pair carried by the read and write request for the remote storage node sent by the application program, and the read and write request is the application program. A request initiated by calling a key-value storage interface; and, the host may send the read and write commands that conform to the high-speed network storage protocol to the remote storage node through the transmission interface conforming to the high-speed network storage protocol, so as to trigger all The remote storage node responds to the read and write commands conforming to the high-speed network storage protocol, and completes the remote read and write operations. The above solution can implement the key-value storage interface to be carried on the high-speed network storage protocol, so that applications can read and write operations to the remote storage node through the key-value storage interface, which is compatible with key-value storage and the high-speed network. The storage advantages of the respective storage protocols.
附图说明Description of drawings
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍。In order to illustrate the technical solutions in the embodiments of the present invention more clearly, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments.
图1是本发明实施例提供的一种应用场景的示意图;1 is a schematic diagram of an application scenario provided by an embodiment of the present invention;
图2是本发明实施例提供的一种数据写方法的流程示意图;2 is a schematic flowchart of a data writing method provided by an embodiment of the present invention;
图3是本发明实施例涉及的NVM命令的示意图;3 is a schematic diagram of an NVM command involved in an embodiment of the present invention;
图4是本发明实施例涉及的逻辑地址与物理地址相互映射的示意图;4 is a schematic diagram of the mutual mapping of logical addresses and physical addresses involved in an embodiment of the present invention;
图5是本发明实施例涉及的消息流的示意图;5 is a schematic diagram of a message flow involved in an embodiment of the present invention;
图6是本发明实施例提供一种数据读方法的流程示意图;6 is a schematic flowchart of a data reading method provided by an embodiment of the present invention;
图7是本发明实施例提供的一种数据写设备的结构示意图;7 is a schematic structural diagram of a data writing device provided by an embodiment of the present invention;
图8是本发明实施例提供的一种存储节点的结构示意图;FIG. 8 is a schematic structural diagram of a storage node according to an embodiment of the present invention;
图9是本发明实施例提供的另一种数据写设备的结构示意图;9 is a schematic structural diagram of another data writing device provided by an embodiment of the present invention;
图10是本发明实施例提供的一种数据读设备的结构示意图;10 is a schematic structural diagram of a data reading device provided by an embodiment of the present invention;
图11是本发明实施例提供的一种存储节点的结构示意图;FIG. 11 is a schematic structural diagram of a storage node according to an embodiment of the present invention;
图12是本发明实施例提供的另一种数据读设备的结构示意图。FIG. 12 is a schematic structural diagram of another data reading device provided by an embodiment of the present invention.
具体实施方式Detailed ways
本发明的实施方式部分使用的术语仅用于对本发明的具体实施例进行解释,而非旨在限定本发明。The terms used in the embodiments of the present invention are only used to explain specific embodiments of the present invention, and are not intended to limit the present invention.
为了更好的理解本发明实施例,下面以NVMe Over Fabric协议为例来描述本发明实施例的应用场景。To better understand the embodiments of the present invention, the following uses the NVMe Over Fabric protocol as an example to describe application scenarios of the embodiments of the present invention.
参见图1,图1是本发明实施例公开的应用场景的示意图。在图1所示的应用场景中,主机(Host)和远端存储节点形成了一个网络存储系统,所述主机和所述远端存储节点均集成有NVMe Over Fabric(以下简称NOF)接口,二者通过NOF接口通信。其中,所述主机可用于生成标准的NVM命令,并通过集成在主机上的NOF接口向远端存储节点发送所述NVM命令;所述远端存储节点可用于通过NOF接口接收所述主机发送的NVM命令,并响应所述NVM命令,对所述远端存储节点对应的存储设备,例如附图所示的多个固态硬盘(Solid StateDrive,SSD)进行读写操作。Referring to FIG. 1 , FIG. 1 is a schematic diagram of an application scenario disclosed by an embodiment of the present invention. In the application scenario shown in Figure 1, a host (Host) and a remote storage node form a network storage system, and both the host and the remote storage node are integrated with an NVMe Over Fabric (hereinafter referred to as NOF) interface. communicate through the NOF interface. The host can be used to generate standard NVM commands, and send the NVM commands to the remote storage node through the NOF interface integrated on the host; the remote storage node can be used to receive the NVM command sent by the host through the NOF interface. NVM commands, and in response to the NVM commands, perform read and write operations on storage devices corresponding to the remote storage nodes, such as multiple solid state drives (Solid State Drives, SSDs) shown in the accompanying drawings.
具体的,如图1所示,所述主机和所述远端存储节点之间的交互可主要包括:控制层面和数据层面。其中,所述控制层面可以主要负责:所述主机向所述远端存储节点发送NVM标准命令,以及所述远端存储节点向所述主机返回针对所述NVM标准命令的响应(Response);所述数据层面可以主要负责:所述主机向所述远端存储节点发送待写入数据,以及所述远端存储节点向所述主机发送待读取数据。Specifically, as shown in FIG. 1 , the interaction between the host and the remote storage node may mainly include: a control plane and a data plane. The control plane may be mainly responsible for: the host sending an NVM standard command to the remote storage node, and the remote storage node returning a response (Response) to the NVM standard command to the host; The data plane may be mainly responsible for: the host sending data to be written to the remote storage node, and the remote storage node sending data to be read to the host.
需要说明的,本发明实施例涉及的所述主机可以包括:兼容有NOF接口、能够访问所述远端存储节点的计算设备,例如服务器、存储管理设备等等。It should be noted that the host involved in the embodiment of the present invention may include: a computing device compatible with a NOF interface and capable of accessing the remote storage node, such as a server, a storage management device, and the like.
需要说明的,本发明实施例涉及的所述远端存储节点可以是指集成有所述高速网络存储协议接口的存储节点。这里,所述远端存储节点可以是指相对于所述主机位于远端的网络存储系统中的存储节点,也可以是指位于分布式存储系统(例如云存储)中的存储节点。It should be noted that the remote storage node involved in the embodiment of the present invention may refer to a storage node integrated with the high-speed network storage protocol interface. Here, the remote storage node may refer to a storage node located in a remote network storage system relative to the host, or may refer to a storage node located in a distributed storage system (eg, cloud storage).
需要说明的,本实施例涉及的高速网络存储协议是指用于网络存储并且存储带宽达到Gbps级别(例如1Gbps或更高)的存储协议,例如NVMe Over Fabric协议。本发明实施例不限制所述高速网络存储协议的具体形式,未来可能出现的用于网络存储的高速存储协议也属于本发明方案的实施对象。It should be noted that the high-speed network storage protocol involved in this embodiment refers to a storage protocol used for network storage and whose storage bandwidth reaches the Gbps level (eg, 1 Gbps or higher), such as the NVMe Over Fabric protocol. The embodiment of the present invention does not limit the specific form of the high-speed network storage protocol, and a high-speed storage protocol for network storage that may appear in the future also belongs to the implementation object of the solution of the present invention.
需要说明的,图1所示的网络存储系统仅仅是本发明实施例提供的一种简单的示例,所述网络存储系统的具体组网形式可根据实际应用场景和需求而定,这里不作限制。It should be noted that the network storage system shown in FIG. 1 is only a simple example provided by the embodiments of the present invention, and the specific networking form of the network storage system may be determined according to actual application scenarios and requirements, and is not limited here.
本发明实施例提供了一种数据写方法、数据读方法及相关设备、系统,主机可以根据应用程序发送的针对远端存储节点的读写请求所携带的键值对(key-value),生成符合高速网络存储协议的读写命令,所述读写请求是所述应用程序通过调用键值存储接口(以下简称KV接口)发起的请求;并且,所述主机可以通过所述符合高速网络存储协议的传输接口向所述远端存储节点发送所述符合高速网络存储协议的读写命令,以触发所述远端存储节点响应所述符合高速网络存储协议的读写命令,完成远端读写操作。本发明方案可实现将KV接口承载在用于网络存储的所述高速网络存储协议上,使得应用程序可以通过键值存储接口对所述远端存储节点进行读写操作,兼容了KV存储与所述高速网络存储协议(例如NVMe Over Fabric)各自的存储优势。以下分别进行详细说明。Embodiments of the present invention provide a data writing method, a data reading method, and related devices and systems. A host can generate a key-value pair (key-value) carried by a read and write request for a remote storage node sent by an application program to generate A read and write command that conforms to the high-speed network storage protocol, and the read and write request is a request initiated by the application program by calling a key-value storage interface (hereinafter referred to as the KV interface); and, the host can pass the high-speed network storage protocol. The transmission interface sends the read and write commands conforming to the high-speed network storage protocol to the remote storage node, so as to trigger the remote storage node to respond to the read and write commands conforming to the high-speed network storage protocol, and complete the remote read and write operations. . The solution of the present invention can realize that the KV interface is carried on the high-speed network storage protocol used for network storage, so that the application program can read and write operations to the remote storage node through the key-value storage interface, which is compatible with KV storage and all The respective storage advantages of the above-mentioned high-speed network storage protocols (such as NVMe Over Fabric). Each of them will be described in detail below.
参见图2,图2是本发明实施例提供的一种数据写方法的流程示意图。如图2所示,该方法包括:Referring to FIG. 2, FIG. 2 is a schematic flowchart of a data writing method provided by an embodiment of the present invention. As shown in Figure 2, the method includes:
S101,主机接收到针对远端存储节点的写请求,所述写请求携带由键和值组成的键值对,所述键用于指示待写入数据的目的地址,所述值用于指示所述待写入数据的源地址和所述待写入数据的大小。具体的,所述写请求可以是应用程序通过调用用于写数据的KV接口,例如KV_write(),发起的请求。实际应用中,所述写请求也可以是远端应用程序调用用于写数据的KV接口发起的请求,这里不作限制。S101, the host receives a write request for a remote storage node, the write request carries a key-value pair consisting of a key and a value, the key is used to indicate the destination address of the data to be written, and the value is used to indicate the The source address of the data to be written and the size of the data to be written. Specifically, the write request may be a request initiated by an application program by calling a KV interface for writing data, such as KV_write(). In practical applications, the write request may also be a request initiated by a remote application program calling a KV interface for writing data, which is not limited here.
这里,所述待写入数据的源地址是指主机上的用于存储写之前的所述待写入数据的地址,该源地址通常位于主机的内存空间;所述待写入数据的目的地址是指远端存储节点上的用于写入所述待写入数据的逻辑地址。Here, the source address of the data to be written refers to the address on the host for storing the data to be written before writing, and the source address is usually located in the memory space of the host; the destination address of the data to be written It refers to the logical address on the remote storage node for writing the data to be written.
S103,主机可以根据所述写请求包含的键值对,生成符合高速网络存储协议的写命令。具体的,符合高速网络存储协议的写命令可包括:用于指示所述待写入数据的目的地址的第一字段、用于指示所述待写入数据的源地址的第二字段,以及用于指示所述待写入数据的大小的第三字段。S103, the host may generate a write command conforming to a high-speed network storage protocol according to the key-value pair included in the write request. Specifically, the write command conforming to the high-speed network storage protocol may include: a first field for indicating the destination address of the data to be written; a second field for indicating the source address of the data to be written; in the third field indicating the size of the data to be written.
S105,在生成所述写命令之后,主机可以通过所述高速网络存储协议的接口向远端存储节点发送所述写命令。所述写命令用于触发远端存储节点将存储于所述源地址处的所述待写入数据写入所述目的地址映射的物理地址中。相应的,远端存储节点可以通过所述高速网络存储协议的接口接收到主机发送的所述写命令。S105, after generating the write command, the host may send the write command to the remote storage node through the interface of the high-speed network storage protocol. The write command is used to trigger the remote storage node to write the data to be written stored at the source address into the physical address mapped by the destination address. Correspondingly, the remote storage node can receive the write command sent by the host through the interface of the high-speed network storage protocol.
S107,在接收到主机发送的所述写命令之后,远端存储节点可以分析出所述目的地址所映射的物理地址。S107, after receiving the write command sent by the host, the remote storage node may analyze the physical address mapped by the destination address.
S109,远端存储节点响应所述写命令,将所述待写入数据写入所述目的地址所映射的物理地址中。S109: In response to the write command, the remote storage node writes the to-be-written data into the physical address mapped by the destination address.
下面以NOF这一高速网络存储协议为例说明本发明实施例提供的数据写方法。The data writing method provided by the embodiment of the present invention is described below by taking NOF, a high-speed network storage protocol, as an example.
图3示出了本发明实施例涉及的NVM命令,主要包含:域名空间标识(NamespaceIdentifier,NSID)、起始逻辑块地址(Starting LBA)、逻辑块数量(Number of LogicalBlocks)以及散列表(Scatter Gather List,SGL)等字段。其中,NSID和Starting LBA结合可以指示出该命令在远端存储节点上涉及的逻辑地址,例如写入数据的目的地址,或者读取数据的源地址;逻辑块数量可以指示出该命令涉及的数据长度,例如待写入数据的长度,或者待读取数据的长度;SGL是内存地址空间中用于存储数据的缓存区,例如用于存储所述待写入数据的源地址,或者用于存储所述待读取数据的目的地址。FIG. 3 shows the NVM commands involved in the embodiment of the present invention, which mainly include: a namespace identifier (NamespaceIdentifier, NSID), a starting logical block address (Starting LBA), a number of logical blocks (Number of LogicalBlocks), and a hash table (Scatter Gather). List, SGL) and other fields. The combination of NSID and Starting LBA can indicate the logical address involved in the command on the remote storage node, such as the destination address for writing data, or the source address for reading data; the number of logical blocks can indicate the data involved in the command Length, such as the length of the data to be written, or the length of the data to be read; SGL is a buffer area in the memory address space for storing data, such as the source address for storing the data to be written, or for storing The destination address of the data to be read.
本发明实施例中,应用程序可以调用用于写数据的KV接口,例如KV_write(),发起所述写请求,用以请求主机向远端存储节点写入所述待写入数据。该写请求携带的键值对(key-value)可如表1所示:In this embodiment of the present invention, an application may call a KV interface for writing data, such as KV_write(), to initiate the write request, so as to request the host to write the to-be-written data to the remote storage node. The key-value pair (key-value) carried by the write request can be shown in Table 1:
表1Table 1
其中,键(key)可包括:NSID和Starting LBA,用于指示所述待写入数据的目的地址;值(value)可包括:SGL、Length,其中,SGL用于指示所述待写入数据的源地址,Length用于指示所述待写入数据的大小,相当于NVM命令中的逻辑块数量。The key (key) may include: NSID and Starting LBA, which are used to indicate the destination address of the data to be written; the value (value) may include: SGL and Length, where SGL is used to indicate the data to be written. The source address, Length is used to indicate the size of the data to be written, which is equivalent to the number of logical blocks in the NVM command.
需要说明的,如果所述写请求是针对远端存储节点的整个域名空间的写入(如全盘写),则所述键(key)也可以仅包括NSID。It should be noted that, if the write request is to write to the entire domain name space of the remote storage node (eg, full disk write), the key (key) may also include only the NSID.
可以理解的,从图3示出的NVM命令和表1示出的键值对可知,由于所述键值对包含有所述写命令中的第一字段、第二字段和第三字段的值,因此,主机能够根据所述写请求携带的键值对填充NVM写命令的相应字段。这里,NVM写命令包含的其他字段可以由主机按照NVMe协议规定进行填充,具体请参考NVM Express Revision 1.2,这里不赘述。It can be understood that from the NVM command shown in FIG. 3 and the key-value pair shown in Table 1, since the key-value pair contains the values of the first field, the second field and the third field in the write command , therefore, the host can fill the corresponding fields of the NVM write command according to the key-value pair carried in the write request. Here, other fields included in the NVM write command can be filled by the host according to the NVMe protocol. For details, please refer to NVM Express Revision 1.2, which will not be described here.
需要说明的,表1仅仅是针对NVM写命令设计的键值对,对于其他类型的高速网络存储协议的写命令来说,本发明实施例涉及的所述写请求携带的键值对可不受表1限制,只要满足该键值对的键用于指示所述待写入数据的目的地址,并且该键值对的值用于指示所述待写入数据的源地址和所述待写入数据的大小即可。It should be noted that Table 1 is only a key-value pair designed for NVM write commands. For write commands of other types of high-speed network storage protocols, the key-value pairs carried in the write request involved in the embodiments of the present invention may not be included in the table. 1 Restriction, as long as the key of the key-value pair is used to indicate the destination address of the data to be written, and the value of the key-value pair is used to indicate the source address of the data to be written and the data to be written. size.
本发明实施例中,在远端存储节点接收到主机发送的所述符合高速网络存储协议的写命令之后,远端存储节点可以分析出所述第一字段表示的目的地址所映射的物理地址。In this embodiment of the present invention, after the remote storage node receives the write command conforming to the high-speed network storage protocol sent by the host, the remote storage node can analyze the physical address mapped by the destination address represented by the first field.
具体的,如图4所示,远端存储节点对应的存储设备可集成有多个存储硬盘(如SSD),所述多个存储硬盘共同映射出一段连续的逻辑块地址。如图4所示,存储于该存储设备上的一份数据对应一个逻辑块地址,而该逻辑块地址可实际映射着多段离散的物理块地址(Physical Block Address,PBA)。例如,数据Data1对应逻辑块地址LBA-1,而LBA-1映射着PBA-11,PBA-12等多段PBA。具体实现中,远端存储节点可以通过闪存转换层(FlashTranslation Layer,FTL)分析出所述第一字段表示的目的地址所映射的物理地址,最后将所述待写入数据写入到该物理地址中。Specifically, as shown in FIG. 4 , the storage device corresponding to the remote storage node may be integrated with multiple storage hard disks (eg, SSDs), and the multiple storage hard disks jointly map a continuous logical block address. As shown in FIG. 4 , a piece of data stored on the storage device corresponds to a logical block address, and the logical block address may actually map multiple discrete physical block addresses (Physical Block Address, PBA). For example, the data Data1 corresponds to the logical block address LBA-1, and LBA-1 maps to PBA-11, PBA-12 and other multi-segment PBAs. In specific implementation, the remote storage node can analyze the physical address mapped by the destination address represented by the first field through a Flash Translation Layer (FTL), and finally write the data to be written to the physical address middle.
可选的,本发明实施例提供所述数据写方法还可进一步包括图2中的S111,即:在将所述待写入数据写入所述目的地址所映射的物理地址中之后,远端存储节点可以通过所述高速网络存储协议的接口向主机返回写响应。相应的,主机可以通过所述高速网络存储协议的接口接收到远端存储节点返回的所述写响应。Optionally, the data writing method provided in this embodiment of the present invention may further include S111 in FIG. 2 , that is: after writing the data to be written into the physical address mapped by the destination address, the remote The storage node may return a write response to the host through the interface of the high-speed network storage protocol. Correspondingly, the host can receive the write response returned by the remote storage node through the interface of the high-speed network storage protocol.
下面以NOF这一高速网络存储协议为例,结合图5示出的消息流图,详细说明本发明实施例涉及的写数据的消息处理过程。The following takes NOF, a high-speed network storage protocol, as an example, in conjunction with the message flow diagram shown in FIG. 5 , to describe the message processing process of writing data involved in the embodiment of the present invention in detail.
如图5所示,上述S101至S109所对应的消息处理过程可包括:1.应用程序(APP)通过调用用于写数据的KV接口,例如KV_write(),发起针对远端存储节点的写请求,并通过KV_write()向主机传入键值对key-value;2.主机根据应用程序传入的键值对生成标准的NVM写命令,即图中的NVM_Command;3.主机通过NOF接口向远端存储节点发送所述标准的NVM写命令。As shown in FIG. 5 , the message processing procedures corresponding to the above S101 to S109 may include: 1. An application program (APP) initiates a write request for a remote storage node by calling a KV interface for writing data, such as KV_write() , and pass the key-value pair key-value to the host through KV_write(); 2. The host generates a standard NVM write command according to the key-value pair passed in by the application, that is, NVM_Command in the figure; 3. The host sends the remote through the NOF interface The end storage node sends the standard NVM write command.
如图5所示,上述S111所对应的消息处理过程可具体包括:4.主机通过NOF接口接收远端存储节点返回的写响应,即图中的NVM_Response;5.主机将所述写响应的数据格式转换成用于接收写响应的KV接口,例如KV_Get_Response(),能够识别的写响应格式,即图中KV_Response的数据格式;6.应用程序(APP)通过掉KV接口,例如KV_Get_Response(),接收远端存储节点返回的写响应。As shown in FIG. 5 , the message processing process corresponding to the above S111 may specifically include: 4. The host receives the write response returned by the remote storage node through the NOF interface, that is, the NVM_Response in the figure; 5. The host sends the data of the write response The format is converted into a KV interface for receiving write responses, such as KV_Get_Response(), a recognizable write response format, that is, the data format of KV_Response in the figure; 6. The application (APP) receives the KV interface, such as KV_Get_Response(), by dropping the KV interface. The write response returned by the remote storage node.
上述内容从控制层面详细说明了本发明实施例提供的所述数据写方法。The above content describes the data writing method provided by the embodiment of the present invention in detail from the control level.
从数据层面来讲,本发明实施例提供的所述数据写方法还可包括:From a data level, the data writing method provided by the embodiment of the present invention may further include:
在接收到主机发送的所述写命令之后,远端存储节点可以向主机发送针对所述待写入数据的获取请求,所述获取请求可包含所述待写入数据的源地址;相应的,主机接可收远端存储节点发送的针对所述待写入数据的获取请求。之后,主机可响应所述获取请求,通过所述高速网络存储协议的接口向远端存储节点发送存储于所述源地址处的所述待写入数据;相应的,远端存储节点可通过所述高速网络存储协议的接口接收到主机发送的所述待写入数据。After receiving the write command sent by the host, the remote storage node may send an acquisition request for the data to be written to the host, where the acquisition request may include the source address of the data to be written; correspondingly, The host may receive a request for obtaining the data to be written sent by the remote storage node. After that, the host can respond to the acquisition request and send the data to be written stored at the source address to the remote storage node through the interface of the high-speed network storage protocol; correspondingly, the remote storage node can pass the The interface of the high-speed network storage protocol receives the data to be written sent by the host.
进一步的,本发明实施例中,所述写请求携带的键值对中的值(Value)还可包括:所述待写入数据的元数据(Metadata),所述元数据是用于描述所述待写入数据的属性(例如业务类型、创建时间等)的一种数据。相应的,主机生成的符合所述高速网络存储协议的写命令还包括:用于指示所述待写入数据的元数据的第四字段。Further, in this embodiment of the present invention, the value (Value) in the key-value pair carried by the write request may further include: metadata (Metadata) of the data to be written, where the metadata is used to describe the A type of data that describes the attributes of the data to be written (such as service type, creation time, etc.). Correspondingly, the write command generated by the host and conforming to the high-speed network storage protocol further includes: a fourth field used to indicate the metadata of the data to be written.
也即是说,远端存储节点接收到的所述写命令还包括:用于指示所述待写入数据的元数据的第四字段。具体实现中,远端存储节点可以将所述待写入数据的目的地址与所述待写入数据的元数据一一对应的保存在目标缓存区内的目标数据库中,所述目标缓存区位于远端存储节点的内存地址空间,可向主机提供元数据访问接口。例如,所述目标数据库可如表2所示:That is to say, the write command received by the remote storage node further includes: a fourth field used to indicate the metadata of the data to be written. In a specific implementation, the remote storage node may store the destination address of the data to be written and the metadata of the data to be written in a target database in the target cache area in a one-to-one correspondence, where the target cache area is located in The memory address space of the remote storage node, which can provide a metadata access interface to the host. For example, the target database can be as shown in Table 2:
表2Table 2
其中,“NSID”和“Starting LBA”相结合用于指示所述待写入数据的目的地址,“Metadata”用于指示所述待写入数据的元数据。需要说明的,表2仅仅是本发明实施例的一种实现方式,实际应用中还可以不同,不应构成限定。The combination of "NSID" and "Starting LBA" is used to indicate the destination address of the data to be written, and "Metadata" is used to indicate the metadata of the data to be written. It should be noted that Table 2 is only an implementation manner of the embodiment of the present invention, and may be different in practical applications, which should not be construed as a limitation.
具体的,在将所述待写入数据的目的地址与所述待写入数据的元数据一一对应的保存在目标缓存区内的目标数据库中时,远端存储节点可以:判断所述目标数据库中是否已经有所述目的地址,如果有,则将所述目标数据库中所述目的地址对应的元数据替换为所述待写入数据的元数据,否则,在所述目标数据库中新建映射关系,用于对应的存储所述待写入数据的目的地址与所述待写入数据的元数据。Specifically, when the destination address of the data to be written and the metadata of the data to be written are stored in the target database in the target cache area in a one-to-one correspondence, the remote storage node may: determine the target Whether the destination address already exists in the database, if so, replace the metadata corresponding to the destination address in the target database with the metadata of the data to be written, otherwise, create a new mapping in the target database The relationship is used for correspondingly storing the destination address of the data to be written and the metadata of the data to be written.
具体实现中,所述目标数据库向主机提供数据访问接口可包括:增、删、改、查等接口,用于管理所述目标数据库中的元数据。In a specific implementation, the target database provides a data access interface to the host, which may include interfaces such as adding, deleting, modifying, and querying, for managing metadata in the target database.
可以理解的,由于所述目标缓存区位于远端存储节点的内存地址空间,而不是存储节点对应的存储硬盘上的物理存储空间,因此,本发明提供的所述目标数据库可实现:主机直接从远端存储节点的内存(即所述目标数据库)中访问所述待写入数据的元数据,而不必在存储硬盘上逐块的去查找所述待写入数据的元数据,实现了对已写入所述存储硬盘的数据的元数据的高效率访问和管理。It can be understood that, because the target cache area is located in the memory address space of the remote storage node, rather than the physical storage space on the storage hard disk corresponding to the storage node, the target database provided by the present invention can realize: The metadata of the data to be written is accessed in the memory of the remote storage node (that is, the target database) without having to search the metadata of the data to be written block by block on the storage hard disk, which realizes Efficient access and management of metadata of data written to the storage hard disk.
实施本发明实施例,在接收到应用程序发送的针对远端存储节点的写请求(所述写请求携带键值对,所述键用于指示待写入数据的目的地址,所述值用于指示所述待写入数据的源地址和所述待写入数据的大小)之后,主机可以根据该键值对生成符合高速网络存储协议的写命令,并通过所述高速网络存储协议的接口向所述远端存储节点发送所述写命令,触发所述远端存储节点将待写入数据写入所述目的地址所映射的物理地址中。所述数据写方法可实现将用于写数据的KV接口承载在用于网络存储的所述高速网络存储协议上,使得应用程序可以通过用于写数据的KV接口实现对所述远端存储节点的数据写操作,兼容了KV存储与所述高速网络存储协议各自的存储优势。Implementing this embodiment of the present invention, after receiving a write request sent by an application for a remote storage node (the write request carries a key-value pair, the key is used to indicate the destination address of the data to be written, and the value is used to After indicating the source address of the data to be written and the size of the data to be written), the host can generate a write command conforming to the high-speed network storage protocol according to the key-value pair, and send it to the high-speed network storage protocol through the interface of the high-speed network storage protocol. The remote storage node sends the write command to trigger the remote storage node to write the data to be written into the physical address mapped by the destination address. The data writing method can realize that the KV interface for writing data is carried on the high-speed network storage protocol for network storage, so that the application program can realize the remote storage node through the KV interface for writing data. The data write operation is compatible with the respective storage advantages of KV storage and the high-speed network storage protocol.
参见图6,图6是本发明实施例提供的一种数据读方法的流程示意图。如图6所示,该方法包括:Referring to FIG. 6, FIG. 6 is a schematic flowchart of a data reading method provided by an embodiment of the present invention. As shown in Figure 6, the method includes:
S201,主机接收到针对远端存储节点的读请求,所述读请求携带由键和值组成的键值对,所述键用于指示待读取数据的源地址,所述值用于指示所述待读取数据的目的地址和所述待读取数据的大小。具体的,所述读请求可以是主机上的应用程序(APP)通过调用用于读数据的KV接口,例如KV_read(),发起的请求。实际应用中,所述读请求也可以是远端应用程序调用用于读数据的KV接口发起的请求,这里不作限制。S201, the host receives a read request for a remote storage node, the read request carries a key-value pair consisting of a key and a value, the key is used to indicate the source address of the data to be read, and the value is used to indicate the The destination address of the data to be read and the size of the data to be read. Specifically, the read request may be a request initiated by an application program (APP) on the host by calling a KV interface for reading data, such as KV_read( ). In practical applications, the read request may also be a request initiated by a remote application program calling a KV interface for reading data, which is not limited here.
这里,所述待读取数据的源地址是指远端存储节点上的用于存储读之前的所述待读取数据的逻辑地址;所述待读取数据的目的地址是指主机上的用于存储读取出的所述待读取数据的地址,该目的地址通常位于主机的内存空间。Here, the source address of the data to be read refers to the logical address on the remote storage node used to store the data to be read before reading; the destination address of the data to be read refers to the For storing the address of the read data to be read, the destination address is usually located in the memory space of the host.
S203,主机根据所述读请求包含的键值对,可以生成符合高速网络存储协议的读命令。具体的,所述读命令可包括:用于指示所述待读取数据的源地址的第一字段、用于指示所述待读取数据的目的地址的第二字段,以及用于指示所述待读取数据的大小的第三字段。S203, the host may generate a read command conforming to the high-speed network storage protocol according to the key-value pair included in the read request. Specifically, the read command may include: a first field for indicating the source address of the data to be read, a second field for indicating the destination address of the data to be read, and a second field for indicating the data to be read. The third field of the size of the data to be read.
S205,在生成所述读命令之后,主机可以通过所述高速网络存储协议的接口向远端存储节点发送所述读命令。相应的,远端存储节点可以通过所述高速网络存储协议的接口接收到主机发送的所述读命令。S205, after generating the read command, the host may send the read command to the remote storage node through the interface of the high-speed network storage protocol. Correspondingly, the remote storage node can receive the read command sent by the host through the interface of the high-speed network storage protocol.
S207,在接收到主机发送的所述读命令之后,远端存储节点可以分析出所述源地址所映射的物理地址。S207, after receiving the read command sent by the host, the remote storage node may analyze the physical address mapped by the source address.
具体的,关于分析出所述源地址所映射的物理地址的方法可参考图2方法实施例中的相关内容,这里不再赘述。Specifically, for the method of analyzing the physical address mapped by the source address, reference may be made to the relevant content in the method embodiment in FIG. 2 , which will not be repeated here.
S209,远端存储节点响应所述读命令,从所述源地址所映射的物理地址中读取出所述待读取数据。S209, the remote storage node reads the data to be read from the physical address mapped by the source address in response to the read command.
本发明实施例涉及的所述待读取数据可以是通过图2方法实施例提供的数据写方法写入到远端存储节点对应的存储设备上的。需要说明的,实际应用中,所述待读取数据还可以是通过其他途径写入到所述存储设备上的,这里不作限制。The data to be read involved in the embodiment of the present invention may be written to a storage device corresponding to a remote storage node by using the data writing method provided in the method embodiment of FIG. 2 . It should be noted that, in practical applications, the data to be read may also be written to the storage device through other means, which is not limited here.
下面以NOF这一高速网络存储协议为例说明本发明实施例提供的数据读方法。图3示出了NVM命令,具体格式可参考图2方法实施例中的相关内容,这里不再赘述。The data reading method provided by the embodiment of the present invention is described below by taking NOF, a high-speed network storage protocol, as an example. FIG. 3 shows an NVM command, and the specific format can refer to the relevant content in the method embodiment of FIG. 2 , and details are not repeated here.
本发明实施例中,应用程序可以调用用于读数据的KV接口,例如KV_read(),发起所述读请求,用以请求主机从远端存储节点中读取出所述待读取数据。该读请求携带的键值对(key-value)可如表3所示:In this embodiment of the present invention, an application may call a KV interface for reading data, such as KV_read(), to initiate the read request, so as to request the host to read the data to be read from the remote storage node. The key-value pair (key-value) carried by the read request can be shown in Table 3:
表3table 3
其中,键(key)可包括:NSID和Starting LBA,用于指示所述待读取数据的源地址;值(value)可包括:SGL、Length,其中,SGL用于指示所述待读取数据的目的地址,Length用于指示所述待读取数据的大小,相当于NVM命令中的逻辑块数量。The key (key) may include: NSID and Starting LBA, which are used to indicate the source address of the data to be read; the value (value) may include: SGL, Length, where SGL is used to indicate the data to be read. The destination address, Length is used to indicate the size of the data to be read, which is equivalent to the number of logical blocks in the NVM command.
需要说明的,如果所述读请求是针对远端存储节点的整个域名空间的写入(如全盘读),则所述键(key)也可以仅包括NSID。It should be noted that, if the read request is for writing to the entire domain name space of the remote storage node (eg, full disk read), the key (key) may also include only the NSID.
可以理解的,从图3示出的NVM读写命令和表3示出的键值对可知,主机能够根据所述读请求携带的键值对填充NVM读命令的相应字段。这里,NVM读命令包含的其他字段可以由主机按照NVMe协议规定进行填充,具体请参考NVM Express Revision 1.2,这里不赘述。It can be understood from the NVM read and write commands shown in FIG. 3 and the key-value pairs shown in Table 3 that the host can fill corresponding fields of the NVM read command according to the key-value pairs carried in the read request. Here, other fields included in the NVM read command can be filled by the host according to the NVMe protocol. For details, please refer to NVM Express Revision 1.2, which will not be repeated here.
需要说明的,表3仅仅是针对NVM读命令设计的键值对,对于其他类型的高速网络存储协议的读命令来说,本发明实施例涉及的所述读请求携带的键值对可不受表3限制,只要满足该键值对的键用于指示所述待读取数据的源地址,并且该键值对的值用于指示所述待读取数据的目的地址和所述待读取数据的大小即可。It should be noted that Table 3 is only a key-value pair designed for NVM read commands. For read commands of other types of high-speed network storage protocols, the key-value pairs carried in the read request involved in the embodiment of the present invention may not be included in the table. 3 Restrictions, as long as the key of the key-value pair is used to indicate the source address of the data to be read, and the value of the key-value pair is used to indicate the destination address of the data to be read and the data to be read size.
可选的,本发明实施例提供所述数据读方法还可进一步包括图6中的S211,即:在从所述源地址所映射的物理地址中读取出所述待读取数据之后,远端存储节点可以通过所述高速网络存储协议的接口向主机返回读响应。相应的,主机可以通过所述高速网络存储协议的接口接收到远端存储节点返回的所述读响应。Optionally, the data reading method provided in the embodiment of the present invention may further include S211 in FIG. 6 , that is: after reading the to-be-read data from the physical address mapped by the source address, remote The end storage node can return a read response to the host through the interface of the high-speed network storage protocol. Correspondingly, the host can receive the read response returned by the remote storage node through the interface of the high-speed network storage protocol.
下面以NOF这一高速网络存储协议为例,结合图5示出的消息流图,详细说明本发明实施例涉及的读数据的消息处理过程。The following takes NOF, a high-speed network storage protocol, as an example, in conjunction with the message flow diagram shown in FIG. 5 , to describe the message processing process of reading data involved in the embodiment of the present invention in detail.
如图5所示,上述S201至S209所对应的消息处理过程可包括:1.应用程序(APP)通过调用用于读数据的KV接口,例如KV_read(),发起针对远端存储节点的读请求,并通过KV_read()向主机传入键值对key-value;2.主机根据应用程序传入的键值对生成标准的NVM读命令,即图中的NVM_Command;3.主机通过NOF接口向远端存储节点发送所述标准的NVM读命令。As shown in FIG. 5 , the message processing procedures corresponding to the above S201 to S209 may include: 1. An application program (APP) initiates a read request for a remote storage node by calling a KV interface for reading data, such as KV_read( ). , and pass the key-value pair key-value to the host through KV_read(); 2. The host generates a standard NVM read command according to the key-value pair passed in by the application, that is, NVM_Command in the figure; 3. The host sends the remote through the NOF interface The end storage node sends the standard NVM read command.
如图5所示,上述S211所对应的消息处理过程可具体包括:4.主机通过NOF接口接收远端存储节点返回的读响应,即图中的NVM_Response;5.主机将所述读响应的数据格式转换成KV接口,例如KV_Get_Response(),能够识别的读响应格式,即图中KV_Response的数据格式;6.应用程序(APP)通过掉KV接口,例如KV_Get_Response(),接收远端存储节点返回的读响应。As shown in FIG. 5 , the message processing process corresponding to the above S211 may specifically include: 4. The host receives the read response returned by the remote storage node through the NOF interface, that is, the NVM_Response in the figure; 5. The host sends the data of the read response The format is converted into a KV interface, such as KV_Get_Response(), the read response format that can be recognized, that is, the data format of KV_Response in the figure; 6. The application (APP) receives the response returned by the remote storage node through the KV interface, such as KV_Get_Response(). Read response.
上述内容从控制层面详细说明了本发明实施例提供的所述数据读方法。The above content describes the data reading method provided by the embodiment of the present invention in detail from the control level.
从数据层面来讲,本发明实施例提供的所述数据读方法还可包括:From a data level, the data reading method provided in the embodiment of the present invention may further include:
在接收到主机发送的所述读命令之后,远端存储节点可以向主机发送针对所述待读取数据的发送请求,所述发送请求包含所述待读取数据的目的地址;相应的,主机接可收远端存储节点发送的所述发送请求,并向远端存储节点返回针对所述发送请求的应答。之后,远端存储节点可以接收到所述主机返回的所述应答,并通过高速网络存储协议的接口向所述主机发送所述待读取数据;相应的,所述主机可以通过所述高速网络存储协议的接口接收到所述远端存储节点发送的所述待读取数据,并将所述待读取数据存储到所述目的地址处。After receiving the read command sent by the host, the remote storage node may send a sending request for the data to be read to the host, where the sending request includes the destination address of the data to be read; correspondingly, the host The sending request sent by the remote storage node can be received, and a response to the sending request is returned to the remote storage node. Afterwards, the remote storage node can receive the response returned by the host, and send the data to be read to the host through the high-speed network storage protocol interface; correspondingly, the host can pass the high-speed network The interface of the storage protocol receives the data to be read sent by the remote storage node, and stores the data to be read at the destination address.
实施本发明实施例,在接收到应用程序发送的针对远端存储节点的读请求(所述读请求携带键值对,所述键用于指示待读取数据的源地址,所述值用于指示所述待读取数据的目的地址和所述待读取数据的大小)之后,主机可以根据该键值对生成符合高速网络存储协议的读命令,并通过所述高速网络存储协议的接口向所述远端存储节点发送所述读命令,触发所述远端存储节点从所述源地址所映射的物理地址中读取出所述待读取数。所述数据读方法可实现将用于据读数据的KV接口承载在用于网络存储的所述高速网络存储协议上,使得应用程序可以通过用于读数据的KV接口对远端存储节点进行读数据操作,兼容了KV存储与所述高速网络存储协议各自的存储优势。Implementing the embodiment of the present invention, after receiving a read request sent by an application for a remote storage node (the read request carries a key-value pair, the key is used to indicate the source address of the data to be read, and the value is used to After indicating the destination address of the data to be read and the size of the data to be read), the host can generate a read command conforming to the high-speed network storage protocol according to the key-value pair, and send it to the high-speed network storage protocol through the interface of the high-speed network storage protocol. The remote storage node sends the read command to trigger the remote storage node to read the to-be-read number from the physical address mapped by the source address. The data reading method can realize that the KV interface used for reading data is carried on the high-speed network storage protocol used for network storage, so that the application program can read the remote storage node through the KV interface used for reading data. Data operation is compatible with the respective storage advantages of KV storage and the high-speed network storage protocol.
参见图7,图7是本发明实施例提供的一种数据写设备的结构示意图。如图7所示,数据写设备10可包括:第一接收单元101、写命令生成单元103和写命令发送单元105。Referring to FIG. 7, FIG. 7 is a schematic structural diagram of a data writing device provided by an embodiment of the present invention. As shown in FIG. 7 , the
其中:in:
第一接收单元101,用于接收到针对远端存储节点的写请求,所述写请求携带由键和值组成的键值对,其中,所述键用于指示待写入数据的目的地址,所述值用于指示所述待写入数据的源地址和所述待写入数据的大小;The
写命令生成单元103,用于根据所述键值对,生成符合高速网络存储协议的写命令;所述写命令包括:用于指示所述待写入数据的目的地址的第一字段、用于指示所述待写入数据的源地址的第二字段,以及用于指示所述待写入数据的大小的第三字段;The write
写命令发送单元105,用于通过所述高速网络存储协议的接口向所述远端存储节点发送所述写命令,触发所述远端存储节点响应所述写命令,将存储于所述源地址处的所述待写入数据写入所述目的地址所映射的物理地址中。A write
如图7所示,数据写设备10还可进一步的包括:第二接收单元107和数据发送单元109,其中:As shown in FIG. 7 , the
第二接收单元107,可用于在写命令发送单元105通过所述高速网络存储协议的接口向所述远端存储节点发送所述写命令之后,接收所述远端存储节点发送的针对所述待写入数据的获取请求,所述获取请求包含所述待写入数据的源地址;The
数据发送单元109,可用于响应所述获取请求,通过所述高速网络存储协议的接口向所述远端存储节点发送存储于所述源地址处的所述待写入数据。The
本发明实施例中,所述键值对中的值还可包括:所述待写入数据的元数据,则所述写命令相应的还可包括:用于指示所述待写入数据的元数据的第四字段。In this embodiment of the present invention, the value in the key-value pair may further include: metadata of the data to be written, and accordingly the write command may further include: a metadata used to indicate the data to be written The fourth field of data.
可以理解的,数据写设备10包括的功能单元的具体实现可参考图2方法实施例中所述主机的功能,这里不再赘述。It can be understood that, for the specific implementation of the functional units included in the
参见图8,图8是本发明实施例提供的一种存储节点的结构示意图。存储节点20与图7所示的数据写设备10对应,用于接收数据写设备10发送的符合高速网络存储协议的写命令,执行写操作。如图8所示,存储节点20可包括:写命令接收单元201、保存单元203、分析单元205和写入单元207。其中:Referring to FIG. 8, FIG. 8 is a schematic structural diagram of a storage node according to an embodiment of the present invention. The
写命令接收单元201,用于通过高速网络存储协议的接口接收主机发送的符合所述高速网络存储协议的写命令;所述写命令包括:用于指示待写入数据的目的地址的第一字段、用于指示所述待写入数据的源地址的第二字段,以及用于指示所述待写入数据的大小的第三字段、用于指示所述待写入数据的元数据的第四字段;A write
保存单元203,用于将所述待写入数据的目的地址与所述待写入数据的元数据一一对应的保存在目标缓存区内的目标数据库中,所述目标数据库向所述主机提供元数据访问接口The
分析单元205,用于分析出所述目的地址所映射的物理地址;An
写入单元207,用于响应所述写命令,将所述待写入数据写入所述目的地址所映射的物理地址中。The
如图8所示,存储节点20还可进一步的包括:发送单元211和数据接收单元209,其中:As shown in FIG. 8, the
发送单元211,可用于在写命令接收单元201通过高速网络存储协议的接口接收主机发送的符合所述高速网络存储协议的写命令之后,向所述主机发送针对所述待写入数据的获取请求,所述获取请求包含所述待写入数据的源地址;The sending
数据接收单元209,可用于通过所述高速网络存储协议的接口接收所述主机响应所述获取请求所发送的所述待写入数据。The
具体实现中,所述保存单元可具体用于:判断所述目标数据库中是否已经有所述目的地址,如果有,则将所述目标数据库中所述目的地址对应的元数据替换为所述待写入数据的元数据,否则,在所述目标数据库中新建映射关系,用于对应的存储所述待写入数据的目的地址与所述待写入数据的元数据。In a specific implementation, the storage unit may be specifically configured to: determine whether the destination address already exists in the target database, and if so, replace the metadata corresponding to the destination address in the target database with the to-be-to-be Write the metadata of the data, otherwise, create a new mapping relationship in the target database for correspondingly storing the destination address of the data to be written and the metadata of the data to be written.
可以理解的,存储节点20包括的功能单元的具体实现可参考图2方法实施例中所述远端存储节点的功能,这里不再赘述。It can be understood that, for the specific implementation of the functional units included in the
为了便于实施本发明实施例,本发明提供了另一种数据写设备。参见图9,数据写设备90可包括:发射器903、接收器904、存储器902和与存储器902耦合的处理器901(数据写设备90中的处理器901的数量可以是一个或多个,图9中以一个处理器为例)。在本发明的一些实施例中,发射器903、接收器904、存储器902和处理器901可通过总线或者其它方式连接,其中,图9中以通过总线连接为例。In order to facilitate the implementation of the embodiments of the present invention, the present invention provides another data writing device. 9, the
其中,发射器903用于向远端存储节点发送数据,接收器904用于向远端存储节点接收数据。具体实现中,发射器903与接收器904可集成为:无线收发模块、有线收发模块等收发器件。存储器902用于存储程序代码,具体实现中,存储器902可以采用只读存储器(Read Only Memory,ROM),可用于存储前述图2方法实施例中描述的数据写方法的实现代码。处理器901,例如CPU,用于调用存储于存储器902中程序代码执行如下步骤:The
接收到针对远端存储节点的写请求,所述写请求携带由键和值组成的键值对,其中,所述键用于指示待写入数据的目的地址,所述值用于指示所述待写入数据的源地址和所述待写入数据的大小;所述写请求是应用程序调用用于写数据的键值存储接口发起的请求,所述用于写数据的键值存储接口的输入参数包括所述键值对;A write request for a remote storage node is received, and the write request carries a key-value pair consisting of a key and a value, wherein the key is used to indicate the destination address of the data to be written, and the value is used to indicate the The source address of the data to be written and the size of the data to be written; the write request is a request initiated by an application calling the key-value storage interface for writing data, and the key-value storage interface for writing data The input parameter includes the key-value pair;
根据所述键值对,生成符合高速网络存储协议的写命令;所述写命令包括:用于指示所述待写入数据的目的地址的第一字段、用于指示所述待写入数据的源地址的第二字段,以及用于指示所述待写入数据的大小的第三字段;According to the key-value pair, a write command conforming to the high-speed network storage protocol is generated; the write command includes: a first field used to indicate the destination address of the data to be written, a field used to indicate the data to be written a second field of the source address, and a third field used to indicate the size of the data to be written;
通过所述高速网络存储协议的接口利用发射器903向所述远端存储节点发送所述写命令,触发所述远端存储节点响应所述写命令,将存储于所述源地址处的所述待写入数据写入所述目的地址所映射的物理地址中。Using the
本发明实施例中,在利用发射器903向所述远端存储节点发送所述写命令之后,处理器901还可以:In this embodiment of the present invention, after using the
利用接收器904接收所述远端存储节点发送的针对所述待写入数据的获取请求,所述获取请求包含所述待写入数据的源地址;Utilize the
响应所述获取请求,通过所述高速网络存储协议的接口利用发射器903向所述远端存储节点发送存储于所述源地址处的所述待写入数据。In response to the acquisition request, the to-be-written data stored at the source address is sent to the remote storage node by using the
进一步的,所述键值对中的所述值还可包括:所述待写入数据的元数据,则所述写命令还包括:用于指示所述待写入数据的元数据的第四字段。Further, the value in the key-value pair may further include: metadata of the data to be written, and the write command further includes: a fourth parameter used to indicate the metadata of the data to be written field.
可理解的是,处理器901的执行步骤还可参照图2方法实施例中所述主机涉及的内容,这里不再赘述。It is understandable that, for the execution steps of the
参见图10,图10是本发明实施例提供的一种数据读设备的结构示意图。如图10所示,数据读设备30可包括:第一接收单元301、读命令生成单元303和读命令发送单元305。Referring to FIG. 10, FIG. 10 is a schematic structural diagram of a data reading device provided by an embodiment of the present invention. As shown in FIG. 10 , the
其中:in:
第一接收单元301,用于接收到针对远端存储节点的读请求,所述读请求携带由键和值组成的键值对,其中,所述键用于指示待读取数据的源地址,所述值用于指示所述待读取数据的目的地址和所述待读取数据的大小;The
读命令生成单元303,用于根据所述键值对,生成符合高速网络存储协议的读命令;所述读命令包括:用于指示所述待读取数据的源地址的第一字段、用于指示所述待读取数据的目的地址的第二字段,以及用于指示所述待读取数据的大小的第三字段;The read
读命令发送单元305,用于通过所述高速网络存储协议的接口向远端存储节点发送所述读命令,触发所述远端存储节点响应所述读命令,从所述源地址所映射的物理地址中读出所述待读取数据。The read
如图10所示,数据读设备30还可进一步的包括:第二接收单元307、应答单元309和数据接收单元311,其中:As shown in FIG. 10, the
第二接收单元307,可用于在所述读命令发送单元通过所述高速网络存储协议的接口向远端存储节点发送所述读命令之后,接收所述远端存储节点发送的针对所述待读取数据的发送请求,所述发送请求包含所述待读取数据的目的地址;The
应答单元309,可用于响应所述发送请求,针对所述发送请求向远端存储节点返回应答;The
数据接收单元311,可用于通过所述高速网络存储协议的接口接收所述远端存储节点发送的所述待读取数据,并将所述待读取数据存储到所述目的地址处。The
可以理解的,数据读设备30包括的功能单元的具体实现可参考图6方法实施例中所述主机的功能,这里不再赘述。It can be understood that, for the specific implementation of the functional units included in the
参见图11,图11是本发明实施例提供的一种存储节点的结构示意图。存储节点40与图9所示的数据读设备30对应,用于接收数据读设备30发送的符合高速网络存储协议的读命令,执行读操作。如图11所示,存储节点40可包括:读命令接收单元401、分析单元403和读取单元405。其中:Referring to FIG. 11, FIG. 11 is a schematic structural diagram of a storage node according to an embodiment of the present invention. The
读命令接收单元401,用于通过高速网络存储协议的接口接收主机发送的符合所述高速网络存储协议的读命令;所述读命令包括:用于指示所述待读取数据的源地址的第一字段、用于指示所述待读取数据的目的地址的第二字段,以及用于指示所述待读取数据的大小的第三字段;The read
分析单元403,用于分析出所述源地址所映射的物理地址;An
读取单元405,用于响应所述读命令,从所述源地址所映射的物理地址中读取出所述待读取数据。The
如图11所示,存储节点40还可进一步的包括:发送单元407、应答接收单元409和数据发送单元411,其中:As shown in FIG. 11, the
发送单元407,可用于在所述读取单元从所述源地址所映射的物理地址中读取出所述待读取数据之后,向所述主机发送针对所述待读取数据的发送请求,所述发送请求包含所述待读取数据的目的地址;The sending
应答接收单元409,可用于接收到所述主机返回的针对所述发送请求的应答;A
数据发送单元411,可用于通过高速网络存储协议的接口向所述主机发送所述待读取数据。The
可以理解的,存储节点40包括的功能单元的具体实现可参考图6方法实施例中所述远端存储节点的功能,这里不再赘述。It can be understood that, for the specific implementation of the functional units included in the
为了便于实施本发明实施例,本发明提供了另一种数据读设备。参见图12,数据读设备100可包括:发射器1003、接收器1004、存储器1002和与存储器1002耦合的处理器1001(数据读设备100中的处理器1001的数量可以是一个或多个,图12中以一个处理器为例)。在本发明的一些实施例中,发射器1003、接收器1004、存储器1002和处理器1001可通过总线或者其它方式连接,其中,图12中以通过总线连接为例。In order to facilitate the implementation of the embodiments of the present invention, the present invention provides another data reading device. 12, the
其中,发射器1003用于向远端存储节点发送数据,接收器1004用于向远端存储节点接收数据。具体实现中,发射器1003与接收器1004可集成为:无线收发模块、有线收发模块等收发器件。存储器1002用于存储程序代码,具体实现中,存储器1002可以采用只读存储器(Read Only Memory,ROM),可用于存储前述图6方法实施例中描述的数据读方法的实现代码。处理器1001,例如CPU,用于调用存储于存储器1002中程序代码执行如下步骤:The
接收到针对远端存储节点的读请求,所述读请求携带由键和值组成的键值对,其中,所述键用于指示待读取数据的源地址,所述值用于指示所述待读取数据的目的地址和所述待读取数据的大小;所述读请求是应用程序调用用于读数据的键值存储接口发起的请求,所述用于读数据的键值存储接口的输入参数包括所述键值对;A read request for the remote storage node is received, and the read request carries a key-value pair consisting of a key and a value, wherein the key is used to indicate the source address of the data to be read, and the value is used to indicate the The destination address of the data to be read and the size of the data to be read; the read request is a request initiated by an application calling the key-value storage interface for reading data, and the key-value storage interface for reading data The input parameter includes the key-value pair;
根据所述键值对,生成符合高速网络存储协议的读命令;所述读命令包括:用于指示所述待读取数据的源地址的第一字段、用于指示所述待读取数据的目的地址的第二字段,以及用于指示所述待读取数据的大小的第三字段;According to the key-value pair, a read command conforming to the high-speed network storage protocol is generated; the read command includes: a first field used to indicate the source address of the data to be read, a field used to indicate the data to be read a second field of the destination address, and a third field used to indicate the size of the data to be read;
通过所述高速网络存储协议的接口利用发射器1003向远端存储节点发送所述读命令,触发所述远端存储节点响应所述读命令,从所述源地址所映射的物理地址中读出所述待读取数据。The
本发明实施例中,在所述从所述源地址所映射的物理地址中读取出所述待读取数据之后,处理器1001还可以:In this embodiment of the present invention, after reading the data to be read from the physical address mapped from the source address, the
利用发射器1003向所述主机发送针对所述待读取数据的发送请求,所述发送请求包含所述待读取数据的目的地址;Using the
利用接收器1004接收到所述主机返回的针对所述发送请求的应答,并通过高速网络存储协议的接口利用发射器1003向所述主机发送所述待读取数据。The response to the sending request returned by the host is received by the
可理解的是,处理器1001的执行步骤还可参考图6实施例中所述主机涉及的内容,这里不再赘述。It is understandable that, for the execution steps of the
另外,本发明实施例提供了一种存储系统(如图1所示),所述存储系统包括:主机和远端存储节点。其中:所述主机可以是由图7描述的数据写设备10,所述远端存储节点可以是图8描述的存储节点20。In addition, an embodiment of the present invention provides a storage system (as shown in FIG. 1 ), where the storage system includes: a host and a remote storage node. Wherein: the host may be the
需要说明的,所述主机可以图2方法实施例提及的所述主机,所述远端存储节点可以图2方法实施例提及的所述远端存储节点,这里不再赘述。It should be noted that the host may be the host mentioned in the method embodiment of FIG. 2 , and the remote storage node may be the remote storage node mentioned in the method embodiment of FIG. 2 , which will not be repeated here.
本发明实施例还提供了一种存储系统(如图1所示),所述存储系统包括:主机和远端存储节点。其中:所述主机可以是由图10描述的数据读设备30,所述远端存储节点可以是图11描述的存储节点40。An embodiment of the present invention further provides a storage system (as shown in FIG. 1 ), where the storage system includes: a host and a remote storage node. Wherein: the host may be the
需要说明的,所述主机可以图6方法实施例提及的所述主机,所述远端存储节点可以图6方法实施例提及的所述远端存储节点,这里不再赘述。It should be noted that the host may be the host mentioned in the method embodiment of FIG. 6 , and the remote storage node may be the remote storage node mentioned in the method embodiment of FIG. 6 , which will not be repeated here.
综上所述,实施本发明实施例,主机可以根据应用程序发送的针对远端存储节点的读写请求所携带的键值对,生成符合高速网络存储协议的读写命令,所述读写请求是所述应用程序通过调用键值存储接口发起的请求;并且,所述主机可以通过所述符合高速网络存储协议的传输接口向所述远端存储节点发送所述符合高速网络存储协议的读写命令,以触发所述远端存储节点响应所述符合高速网络存储协议的读写命令,完成远端读写操作。上述方案可实现将键值存储接口承载在所述高速网络存储协议上,使得应用程序可以通过键值存储接口对所述远端存储节点进行读写操作,兼容了键值存储与所述高速网络存储协议各自的存储优势。To sum up, by implementing the embodiments of the present invention, the host can generate a read and write command that conforms to the high-speed network storage protocol according to the key-value pair carried by the read and write request sent by the application to the remote storage node. The read and write request is a request initiated by the application program by calling the key-value storage interface; and, the host can send the read and write data that conforms to the high-speed network storage protocol to the remote storage node through the transmission interface that conforms to the high-speed network storage protocol. command to trigger the remote storage node to respond to the read and write commands conforming to the high-speed network storage protocol to complete remote read and write operations. The above solution can implement the key-value storage interface to be carried on the high-speed network storage protocol, so that applications can read and write operations to the remote storage node through the key-value storage interface, which is compatible with key-value storage and the high-speed network. The storage advantages of the respective storage protocols.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)或随机存储记忆体(Random AccessMemory,RAM)等。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and the program is During execution, it may include the processes of the embodiments of the above-mentioned methods. The storage medium may be a magnetic disk, an optical disk, a read-only memory (Read-Only Memory, ROM), or a random access memory (Random Access Memory, RAM) or the like.
Claims (20)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010420635.2A CN111752480B (en) | 2016-03-24 | 2016-03-24 | A data writing method, a data reading method and related equipment and system |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610176106.6A CN107229415B (en) | 2016-03-24 | 2016-03-24 | A data writing method, data reading method and related equipment and system |
CN202010420635.2A CN111752480B (en) | 2016-03-24 | 2016-03-24 | A data writing method, a data reading method and related equipment and system |
Related Parent Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610176106.6A Division CN107229415B (en) | 2016-03-24 | 2016-03-24 | A data writing method, data reading method and related equipment and system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111752480A true CN111752480A (en) | 2020-10-09 |
CN111752480B CN111752480B (en) | 2025-01-24 |
Family
ID=59931730
Family Applications (2)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610176106.6A Active CN107229415B (en) | 2016-03-24 | 2016-03-24 | A data writing method, data reading method and related equipment and system |
CN202010420635.2A Active CN111752480B (en) | 2016-03-24 | 2016-03-24 | A data writing method, a data reading method and related equipment and system |
Family Applications Before (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610176106.6A Active CN107229415B (en) | 2016-03-24 | 2016-03-24 | A data writing method, data reading method and related equipment and system |
Country Status (1)
Country | Link |
---|---|
CN (2) | CN107229415B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115292420A (en) * | 2022-10-10 | 2022-11-04 | 天津南大通用数据技术股份有限公司 | Method and device for rapidly loading data in distributed database |
WO2024037193A1 (en) * | 2022-08-17 | 2024-02-22 | 北京超弦存储器研究院 | Network storage processing device, storage server, and data storage and reading method |
Families Citing this family (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108153682B (en) * | 2017-12-12 | 2020-10-27 | 西安交通大学 | Method for mapping addresses of flash translation layer by utilizing internal parallelism of flash memory |
CN112615917B (en) * | 2017-12-26 | 2024-04-12 | 华为技术有限公司 | Storage device management method and storage system in storage system |
CN110110003A (en) * | 2018-01-26 | 2019-08-09 | 广州中国科学院计算机网络信息中心 | The data storage control method and device of M2M platform |
WO2020185679A1 (en) * | 2019-03-11 | 2020-09-17 | Replixio Ltd. | System and method for optimizing write requests of a write queue |
CN110674106B (en) * | 2019-08-30 | 2022-03-15 | 中国人民财产保险股份有限公司 | Storage method, device and equipment of policy data and computer readable storage medium |
CN111090869B (en) * | 2019-12-16 | 2022-04-05 | 海光信息技术股份有限公司 | A data encryption method, processor and computer equipment |
CN113037772B (en) * | 2021-03-30 | 2023-05-02 | 苏州科达科技股份有限公司 | Data processing method, system, equipment and storage medium |
CN112988681A (en) * | 2021-04-07 | 2021-06-18 | 拉卡拉支付股份有限公司 | File processing method, file processing device, electronic equipment, storage medium and program product |
CN117675759A (en) * | 2022-09-06 | 2024-03-08 | 成都华为技术有限公司 | Data processing method and device |
CN115766889B (en) * | 2022-09-28 | 2024-06-21 | 重庆赛力斯凤凰智创科技有限公司 | Data frame structure and data communication method |
CN117234427B (en) * | 2023-11-09 | 2024-02-09 | 苏州元脑智能科技有限公司 | Data reading and writing method, device, equipment, system, storage medium and storage system |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20130042060A1 (en) * | 2011-08-08 | 2013-02-14 | Takao Marukame | Memory system including key-value store |
WO2014089828A1 (en) * | 2012-12-14 | 2014-06-19 | 华为技术有限公司 | Method for accessing storage device and storage device |
CN103973810A (en) * | 2014-05-22 | 2014-08-06 | 华为技术有限公司 | Data processing method and device based on IP disk |
CN104007938A (en) * | 2014-05-29 | 2014-08-27 | 华为技术有限公司 | Key value generating method and device in storage network |
CN104238963A (en) * | 2014-09-30 | 2014-12-24 | 华为技术有限公司 | Data storage method, device and system |
US20150370700A1 (en) * | 2014-06-23 | 2015-12-24 | Google Inc. | Managing storage devices |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8151323B2 (en) * | 2006-04-12 | 2012-04-03 | Citrix Systems, Inc. | Systems and methods for providing levels of access and action control via an SSL VPN appliance |
US9367346B2 (en) * | 2013-02-20 | 2016-06-14 | Nec Corporation | Accelerating distributed transactions on key-value stores through dynamic lock localization |
-
2016
- 2016-03-24 CN CN201610176106.6A patent/CN107229415B/en active Active
- 2016-03-24 CN CN202010420635.2A patent/CN111752480B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20130042060A1 (en) * | 2011-08-08 | 2013-02-14 | Takao Marukame | Memory system including key-value store |
WO2014089828A1 (en) * | 2012-12-14 | 2014-06-19 | 华为技术有限公司 | Method for accessing storage device and storage device |
CN103973810A (en) * | 2014-05-22 | 2014-08-06 | 华为技术有限公司 | Data processing method and device based on IP disk |
CN104007938A (en) * | 2014-05-29 | 2014-08-27 | 华为技术有限公司 | Key value generating method and device in storage network |
US20150370700A1 (en) * | 2014-06-23 | 2015-12-24 | Google Inc. | Managing storage devices |
CN104238963A (en) * | 2014-09-30 | 2014-12-24 | 华为技术有限公司 | Data storage method, device and system |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2024037193A1 (en) * | 2022-08-17 | 2024-02-22 | 北京超弦存储器研究院 | Network storage processing device, storage server, and data storage and reading method |
CN115292420A (en) * | 2022-10-10 | 2022-11-04 | 天津南大通用数据技术股份有限公司 | Method and device for rapidly loading data in distributed database |
Also Published As
Publication number | Publication date |
---|---|
CN107229415A (en) | 2017-10-03 |
CN111752480B (en) | 2025-01-24 |
CN107229415B (en) | 2020-06-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107229415B (en) | A data writing method, data reading method and related equipment and system | |
US12197345B2 (en) | Data processing method and NVMe storage device | |
US9678918B2 (en) | Data processing system and data processing method | |
US11169745B1 (en) | Exporting an address space in a thin-provisioned storage device | |
CN110837479B (en) | Data processing method, related equipment and computer storage medium | |
CN103412822B (en) | Operation Nonvolatile memory and the method and relevant apparatus of data manipulation | |
CN111831588A (en) | A storage device access method, apparatus and system | |
CN113032293A (en) | Cache manager and control component | |
CN103064797A (en) | Data processing method and virtual machine management platform | |
CN104636266A (en) | SMR hard disk and data writing method and device for SMR hard disk | |
CN110727403A (en) | Metadata management method and device | |
US11940917B2 (en) | System and method for network interface controller based distributed cache | |
CN117112219A (en) | Method and device for accessing memory data of host | |
WO2022121385A1 (en) | File access method, storage node, and network card | |
CN105988871A (en) | Remote memory allocation method, device and system | |
KR102623061B1 (en) | Apparatus for performing iterator operation in database | |
CN106775456A (en) | A kind of data processing method, apparatus and system | |
CN113031849A (en) | Direct memory access unit and control unit | |
KR102275706B1 (en) | Method of operating data storage device and method of operating data processing system having same |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |