[go: up one dir, main page]

CN104424105B - The read-write processing method and device of a kind of internal storage data - Google Patents

The read-write processing method and device of a kind of internal storage data Download PDF

Info

Publication number
CN104424105B
CN104424105B CN201310376301.XA CN201310376301A CN104424105B CN 104424105 B CN104424105 B CN 104424105B CN 201310376301 A CN201310376301 A CN 201310376301A CN 104424105 B CN104424105 B CN 104424105B
Authority
CN
China
Prior art keywords
request
sub
destination node
packet
identifier
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.)
Expired - Fee Related
Application number
CN201310376301.XA
Other languages
Chinese (zh)
Other versions
CN104424105A (en
Inventor
董建波
张立新
侯锐
李晔
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Institute of Computing Technology of CAS
Original Assignee
Huawei Technologies Co Ltd
Institute of Computing Technology of CAS
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, Institute of Computing Technology of CAS filed Critical Huawei Technologies Co Ltd
Priority to CN201310376301.XA priority Critical patent/CN104424105B/en
Priority to PCT/CN2014/083873 priority patent/WO2015027806A1/en
Publication of CN104424105A publication Critical patent/CN104424105A/en
Application granted granted Critical
Publication of CN104424105B publication Critical patent/CN104424105B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/38Information transfer, e.g. on bus
    • G06F13/382Information transfer, e.g. on bus using universal interface adapter
    • G06F13/385Information transfer, e.g. on bus using universal interface adapter for adaptation of a particular data processing system to different peripheral devices
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本发明公开了一种内存数据的读写处理方法和装置,涉及计算机系统技术领域,解决了现有技术中多个数据量较小的内存数据访存操作浪费较多的开销在数据请求包上,导致传输效率低下的问题。方法包括:源节点获取各个待发送请求包;解析所述各个待发送请求包的目的节点标识,并判断所述各个待发送请求包的目的节点标识是否相同;将所述具有相同目的节点标识的至少两个待发送请求包分别作为子请求包,打包为一个合并请求包;将所述合并请求包发送给所述目的节点标识对应的目的节点,所述合并请求包用于指示所述目的节点对所述目的节点的内存数据进行读和/或写操作。本发明实施例应用于内存数据的读写处理过程中。

The invention discloses a method and device for reading and writing memory data, relates to the technical field of computer systems, and solves the problem of wasting a lot of overhead on data request packets in the prior art when accessing memory data with a small amount of data , leading to the problem of low transmission efficiency. The method includes: the source node acquires each request packet to be sent; parsing the destination node identifiers of each request packet to be sent, and judging whether the destination node identifiers of each request packet to be sent are the same; At least two request packets to be sent are respectively used as sub-request packets and packaged into a merge request packet; the merge request packet is sent to the destination node corresponding to the destination node identifier, and the merge request packet is used to indicate the destination node Perform read and/or write operations on memory data of the destination node. The embodiment of the present invention is applied in the process of reading and writing memory data.

Description

一种内存数据的读写处理方法和装置Method and device for reading and writing processing of memory data

技术领域technical field

本发明涉及计算机系统技术领域,尤其涉及一种内存数据的读写处理方法和装置。The invention relates to the technical field of computer systems, in particular to a method and device for reading and writing data in memory.

背景技术Background technique

在多节点计算机系统中,本地和远程节点之间的数据交互效率直接影响整个系统的性能。远程直接内存访问(Remote Direct Memory Access,RDMA)是将内存数据从一个系统快速移动到远程系统存储器中,而不对操作系统造成任何影响,例如在没有CPU干预的情况下,将一个节点的内存数据直接传送到另一个节点的物理内存中,进而降低了数据传输对处理部件的影响,提升系统的性能。In a multi-node computer system, the efficiency of data interaction between local and remote nodes directly affects the performance of the entire system. Remote direct memory access (Remote Direct Memory Access, RDMA) is to quickly move memory data from a system to remote system memory without any impact on the operating system, for example, without CPU intervention, memory data of a node It is directly transmitted to the physical memory of another node, thereby reducing the impact of data transmission on processing components and improving system performance.

在RDMA的读写操作中,内存与Cache(高速缓冲存储器)之间的数据交换粒度为一个Cache Line,大小为64Bytes(字节)或者128Bytes,如果将每一个Cache Line的数据打包成一个请求数据包发送出去,这种小规模的数据传递存在一定程度的链路带宽浪费,例如PCIE(Peripheral Component Interface Express,快捷外设互联标准)的数据包头可能具有16Bytes,而如果Payload(有效载荷)长度为16Bytes,则链路带宽的利用率仅有50%,因此多个数据量较小的远程数据访存操作会浪费较多的开销在数据请求包上,导致传输效率低下。In RDMA read and write operations, the granularity of data exchange between memory and Cache (cache memory) is a Cache Line, with a size of 64Bytes (bytes) or 128Bytes. If the data of each Cache Line is packaged into a request data There is a certain degree of link bandwidth waste in this small-scale data transmission. For example, the data packet header of PCIE (Peripheral Component Interface Express, fast peripheral interconnection standard) may have 16Bytes, and if the Payload (payload) length is 16Bytes, the utilization rate of the link bandwidth is only 50%, so multiple remote data access operations with small data volumes will waste more overhead on data request packets, resulting in low transmission efficiency.

发明内容Contents of the invention

本发明的实施例提供一种内存数据的读写处理方法和装置,提高了链路的利用效率。Embodiments of the present invention provide a method and device for reading and writing memory data, which improves the utilization efficiency of links.

为达到上述目的,本发明的实施例采用如下技术方案:In order to achieve the above object, embodiments of the present invention adopt the following technical solutions:

第一方面,本发明提供了一种内存数据的读写处理方法,包括:In a first aspect, the present invention provides a method for reading and writing memory data, including:

获取各个待发送请求包,所述待发送请求包包括:读请求包,和/或写请求包;Obtaining each request packet to be sent, the request packet to be sent includes: a read request packet, and/or a write request packet;

解析所述各个待发送请求包的目的节点标识,并判断所述各个待发送请求包的目的节点标识是否相同;Analyzing the destination node identifiers of the respective request packets to be sent, and judging whether the destination node identifiers of the respective request packets to be sent are the same;

将所述具有相同目的节点标识的至少两个待发送请求包分别作为子请求包,打包为一个合并请求包,所述合并请求包中包括公共包头和至少两个子请求包,所述公共包头中包含合并包标识、子请求包个数标识和源节点标识,所述合并包标识用于指示所述请求包为所述至少两个子请求包组合的合并包,所述子请求包个数标识用于指示所述合并请求包携带的子请求包的个数,所述子请求包包含子请求包包头和子请求信息;The at least two request packets to be sent with the same destination node identifier are respectively used as sub-request packets, and packaged into a merge request packet, and the merge request packet includes a public header and at least two sub-request packets, and the public header includes Contains a merged package identifier, a sub-request package number identifier and a source node identifier, the merged package identifier is used to indicate that the request package is a combined package of the at least two sub-request packages, and the sub-request package number identifier is used In order to indicate the number of sub-request packets carried by the merge request packet, the sub-request packet includes a sub-request packet header and sub-request information;

将所述合并请求包发送给所述目的节点标识对应的目的节点,所述合并请求包用于指示所述目的节点对所述目的节点的内存数据进行读和/或写操作。Sending the merge request packet to the destination node corresponding to the destination node identifier, where the merge request packet is used to instruct the destination node to perform read and/or write operations on the memory data of the destination node.

在第一方面的第一种可能的实现方式中,所述打包为一个合并请求包包括:In a first possible implementation manner of the first aspect, the packaging into one merge request package includes:

将所述合并包标识置为预定值,所述预定值指示所述请求包为所述至少两个子请求包组合的合并包;Setting the combined package identifier to a predetermined value, the predetermined value indicating that the request package is a combined package of the at least two sub-request packages;

获取子请求包的个数,将所述个数写入所述子请求包个数标识中。Obtain the number of sub-request packets, and write the number into the number identifier of the sub-request packets.

结合第一方面或第一方面的第一种可能的实现方式,在第二种可能的实现方式中,所述解析所述各个待发送请求包的目的节点标识,并判断所述各个待发送请求包的目的节点标识是否相同包括:In combination with the first aspect or the first possible implementation manner of the first aspect, in the second possible implementation manner, the parsing of the destination node identifier of each request packet to be sent, and judging that each request packet to be sent Whether the destination node identifiers of the packets are the same includes:

获取各个待发送请求包中携带的目的节点标识;Obtain the destination node identifier carried in each request packet to be sent;

判断所述各个待发送请求包的目的节点标识是否相同;Judging whether the destination node identifiers of the respective request packets to be sent are the same;

所述打包为一个合并请求包包括:The packages packaged as a merge request include:

提取所述子请求包中的目的节点标识,并将所述目的节点标识置于所述合并请求包的公共包头中。Extracting the target node identifier in the sub-request package, and placing the target node identifier in the common header of the merge request package.

结合第一方面或第一方面的第一种可能的实现方式,在第三种可能的实现方式中,所述解析所述各个待发送请求包的目的节点标识,并判断所述各个待发送请求包的目的节点标识是否相同包括:In combination with the first aspect or the first possible implementation of the first aspect, in a third possible implementation, the parsing of the destination node identifier of each request packet to be sent, and judging the Whether the destination node identifiers of the packets are the same includes:

获取各个待发送请求包中携带的目的节点内存地址;Obtain the memory address of the destination node carried in each request packet to be sent;

根据所述目的节点内存地址,在地址归属表中查找所述目的节点内存地址归属的目的节点标识,所述地址归属表为目的节点内存地址与目的节点标识的对应关系表;According to the memory address of the destination node, look up the destination node identification to which the memory address of the destination node belongs in the address attribution table, where the address attribution table is a correspondence table between the memory address of the destination node and the destination node identification;

判断所述各个待发送请求包的目的节点标识是否相同。It is judged whether the identifiers of the destination nodes of the request packets to be sent are the same.

结合第一方面的第二种可能的实现方式或第三种可能的实现方式,在第四种可能的实现方式中,所述子请求包包括写请求子包和/或读请求子包,写请求子包包头中包括识别所述写请求子包的写请求标识,所述写请求子包中的写请求信息包括待写入所述目的节点的数据以及待写入的所述目的节点内存地址,读请求子包包头中包括识别所述读请求子包的读请求标识,所述读请求子包中的读请求信息包括待读取数据所处的所述目的节点内存地址,所述方法还包括:With reference to the second possible implementation manner or the third possible implementation manner of the first aspect, in a fourth possible implementation manner, the sub-request package includes a write request sub-package and/or a read request sub-packet, and the write The header of the request sub-packet includes a write request identifier identifying the write request sub-packet, and the write request information in the write request sub-packet includes the data to be written to the destination node and the memory address of the destination node to be written The header of the read request sub-packet includes a read request identifier identifying the read request sub-packet, the read request information in the read request sub-packet includes the memory address of the destination node where the data to be read is located, and the method further includes include:

接收所述目的节点发送的写请求响应消息,所述写请求响应消息中包含写请求成功的所述写请求子包对应的写请求标识;和/或,Receive a write request response message sent by the destination node, where the write request response message includes a write request identifier corresponding to the write request subpacket whose write request is successful; and/or,

接收所述目的节点发送的读请求响应消息,所述读请求响应消息中包含读请求成功的所述读请求子包对应的读请求标识,以及读取的有效载荷,所述有效载荷为所述读请求子包中远程内存地址对应的数据。Receive the read request response message sent by the destination node, the read request response message includes the read request identifier corresponding to the read request subpacket with a successful read request, and the read payload, the payload is the Read the data corresponding to the remote memory address in the request subpacket.

结合第一方面或第一方面的第一种可能的实现方式或第二种可能的实现方式或第三种可能的实现方式或第四种可能的实现方式,在第五种可能的实现方式中,所述解析所述各个待发送请求包的目的节点标识,并判断所述各个待发送请求包的目的节点标识是否相同包括:In combination with the first aspect or the first possible implementation of the first aspect or the second possible implementation or the third possible implementation or the fourth possible implementation, in the fifth possible implementation , the parsing of the destination node identifiers of the respective request packets to be sent, and judging whether the destination node identifiers of the respective request packets to be sent are identical include:

根据所述各个待发送请求包对应的目的节点标识,在路由表中查找所述目的节点标识对应的路由端口,所述路由表包含所述目的节点标识对应的路由端口,所述路由端口为所述待发送请求包到达所述目的节点的路径上的端口;According to the destination node identifier corresponding to each request packet to be sent, the routing port corresponding to the destination node identifier is searched in the routing table, and the routing table includes the routing port corresponding to the destination node identifier, and the routing port is the routing port corresponding to the destination node identifier. Describe the port on the path where the request packet to be sent reaches the destination node;

判断所述各个待发送请求包的路由端口是否相同。It is judged whether the routing ports of the request packets to be sent are the same.

第二方面,本发明提供一种内存数据的读写处理方法,包括:In a second aspect, the present invention provides a method for reading and writing memory data, including:

接收请求包;Receive request packet;

判断接收的请求包中是否携带合并包标识,所述合并包标识用于指示所述请求包为至少两个子请求包组合的合并请求包,所述子请求包包括:读请求子包,和/或写请求子包;Judging whether the received request packet carries a combined package identifier, the combined package identifier is used to indicate that the request package is a combined request package composed of at least two sub-request packages, the sub-request package includes: a read request sub-packet, and/ Or write request subpackage;

当所述请求包中携带合并包标识时,确定所述请求包为合并请求包,所述合并请求包中包括公共包头和子请求包,所述公共包头中包含合并包标识、子请求包个数标识和源节点标识,所述子请求包个数标识用于指示所述合并请求包携带的子请求包的个数,所述子请求包包含子请求包包头和子请求信息;When the request package carries a merge package identifier, it is determined that the request package is a merge request package, and the merge request package includes a public header and a sub-request package, and the public header includes a merge package identifier and the number of sub-request packages An identifier and a source node identifier, the identifier of the number of sub-request packets is used to indicate the number of sub-request packets carried by the merge request packet, and the sub-request packets include sub-request packet headers and sub-request information;

根据所述合并请求包中携带的子请求包个数标识和每个子请求包包头,提取所述合并请求包中与所述子请求包个数标识对应个数的子请求包;According to the number of sub-request packets carried in the merge request packet and the header of each sub-request packet, extracting the number of sub-request packets corresponding to the number of sub-request packets in the merge request packet;

根据所述每个子请求包包头和子请求信息,处理对应的子请求包。According to the header of each sub-request packet and the sub-request information, the corresponding sub-request packet is processed.

在第二方面的第一种可能的实现方式中,所述根据所述每个子请求包包头和子请求信息,处理对应的子请求包包括:In the first possible implementation manner of the second aspect, the processing the corresponding sub-request packet according to the header and sub-request information of each sub-request packet includes:

根据写请求子包包头中的写请求标识、所述写请求子包的写请求信息中的待写入数据以及待写入的目的节点内存地址,将所述待写入数据写入所述目的节点内存地址;和/或,Write the data to be written into the destination according to the write request identifier in the header of the write request subpacket, the data to be written in the write request information of the write request subpacket, and the memory address of the destination node to be written. node memory address; and/or,

根据读请求子包包头中的读请求标识,以及所述读请求子包的读请求信息中的待读取数据所处的目的节点内存地址,在所述目的节点内存地址中读取所述待读取数据。According to the read request identifier in the header of the read request sub-packet and the memory address of the destination node where the data to be read in the read request information of the read request sub-packet is located, read the data to be read in the memory address of the destination node read data.

结合第二方面的第一种可能的实现方式,在第二种可能的实现方式中,在所述提取所述合并请求包中与所述子请求包个数标识对应个数的子请求包之后,还包括:With reference to the first possible implementation of the second aspect, in the second possible implementation, after extracting the number of sub-request packages corresponding to the number of sub-request packages in the merge request package ,Also includes:

将所述源节点标识写入每个子请求包的子请求包包头中,以便于所述目的节点向所述源节点发送响应消息。The source node identifier is written into the sub-request packet header of each sub-request packet, so that the destination node sends a response message to the source node.

结合第二方面的第二种可能的实现方式,在第三种可能的实现方式中,所述目的节点向所述源节点发送响应消息包括:With reference to the second possible implementation manner of the second aspect, in a third possible implementation manner, the destination node sending the response message to the source node includes:

判断各个待发送的响应消息对应的源节点标识是否相同;Judging whether the source node identifiers corresponding to the response messages to be sent are the same;

将具有相同源节点标识的所述待发送的响应消息作为子响应消息,打包为一个合并响应消息包,所述合并响应消息包中包括写请求子响应消息和/或读请求子响应消息;Packing the to-be-sent response messages with the same source node identifier as sub-response messages into a combined response message package, the combined response message package includes a write request sub-response message and/or a read request sub-response message;

将所述合并响应消息包发送给所述源节点标识对应的源节点。Send the combined response message packet to the source node corresponding to the source node identifier.

在第二方面的第四种可能的实现方式中,当所述目的节点为路由端口时,在所述提取所述合并请求包中与所述子请求包个数标识对应个数的子请求包之后,还包括:In a fourth possible implementation of the second aspect, when the destination node is a routing port, in the extracting the sub-request packets corresponding to the number of sub-request packets in the merge request packet After that, also include:

提取所述合并请求包的公共包头中的源节点标识,写入每个子请求包的包头中。Extract the source node identifier in the public header of the merge request package, and write it into the header of each sub-request package.

第三方面,本发明提供一种内存数据的读写处理装置,包括:In a third aspect, the present invention provides a device for reading and writing memory data, including:

获取单元,用于获取各个待发送请求包,所述待发送请求包包括:读请求包,和/或写请求包;An acquisition unit, configured to acquire each request packet to be sent, wherein the request packet to be sent includes: a read request packet, and/or a write request packet;

判断单元,用于解析所述各个待发送请求包的目的节点标识,并判断所述各个待发送请求包的目的节点标识是否相同;A judging unit, configured to parse the destination node identifiers of the respective request packets to be sent, and judge whether the destination node identifiers of the respective request packets to be sent are the same;

处理单元,用于将所述具有相同目的节点标识的至少两个待发送请求包分别作为子请求包,打包为一个合并请求包,所述合并请求包中包括公共包头和至少两个子请求包,所述公共包头中包含合并包标识、子请求包个数标识和源节点标识,所述合并包标识用于指示所述请求包为所述至少两个子请求包组合的合并包,所述子请求包个数标识用于指示所述合并请求包携带的子请求包的个数,所述子请求包包含子请求包包头和子请求信息;A processing unit, configured to pack the at least two request packets to be sent with the same destination node identifier as sub-request packets into a combined request package, wherein the combined request package includes a common header and at least two sub-request packages, The public packet header includes a merged package identifier, a sub-request packet number identifier, and a source node identifier, and the merged package identifier is used to indicate that the request package is a combined package of the at least two sub-request packages, and the sub-request The packet number identifier is used to indicate the number of sub-request packets carried by the merge request packet, and the sub-request packets include sub-request packet headers and sub-request information;

发送单元,用于将所述合并请求包发送给所述目的节点标识对应的目的节点,所述合并请求包用于指示所述目的节点对所述目的节点的内存数据进行读和/或写操作。A sending unit, configured to send the merge request packet to a destination node corresponding to the destination node identifier, where the merge request packet is used to instruct the destination node to perform read and/or write operations on the memory data of the destination node .

在第三方面的第一种可能的实现方式中,所述处理单元包括:In a first possible implementation manner of the third aspect, the processing unit includes:

第一标识模块,用于将所述合并包标识置为预定值,所述预定值指示所述请求包为所述至少两个子请求包组合的合并包;A first identification module, configured to set the combined package identifier to a predetermined value, the predetermined value indicating that the request package is a combined package of the at least two sub-request packages;

第二标识模块,用于获取子请求包的个数,将所述个数写入所述子请求包个数标识中。The second identification module is configured to obtain the number of sub-request packets, and write the number into the identifier of the number of sub-request packets.

结合第三方面或第三方面的第一种可能的实现方式,在第二种可能的实现方式中,所述判断单元包括:With reference to the third aspect or the first possible implementation manner of the third aspect, in a second possible implementation manner, the judging unit includes:

第一获取模块,用于获取各个待发送请求包中携带的目的节点标识;The first obtaining module is used to obtain the destination node identification carried in each request packet to be sent;

第一判断模块,用于判断所述各个待发送请求包的目的节点标识是否相同;The first judging module is used to judge whether the destination node identifiers of the request packets to be sent are the same;

所述处理单元还包括:The processing unit also includes:

第三标识模块,用于提取所述子请求包中的目的节点标识,并将所述目的节点标识置于所述合并请求包的公共包头中。The third identification module is configured to extract the destination node identifier in the sub-request package, and place the destination node identifier in the common header of the merge request package.

结合第三方面或第三方面的第一种可能的实现方式,在第三种可能的实现方式中,所述判断单元包括:With reference to the third aspect or the first possible implementation manner of the third aspect, in a third possible implementation manner, the judging unit includes:

第二获取模块,用于获取各个待发送请求包中携带的目的节点内存地址;The second obtaining module is used to obtain the memory address of the destination node carried in each request packet to be sent;

第一查找模块,用于根据所述目的节点内存地址,在地址归属表中查找所述目的节点内存地址归属的目的节点标识,所述地址归属表为目的节点内存地址与目的节点标识的对应关系表;The first search module is used to search the destination node identifier to which the destination node memory address belongs in the address attribution table according to the destination node memory address, and the address attribution table is the corresponding relationship between the destination node memory address and the destination node identifier surface;

第二判断模块,用于判断所述各个待发送请求包的目的节点标识是否相同。The second judging module is configured to judge whether the destination node identifiers of the request packets to be sent are the same.

结合第三方面的第二种可能的实现方式或第三种可能的实现方式,在第四种可能的实现方式中,所述处理单元得到的所述合并请求包中包括的子请求包包括写请求子包和/或读请求子包,写请求子包包头中包括识别所述写请求子包的写请求标识,所述写请求子包中的写请求信息包括待写入所述目的节点的数据以及待写入的所述目的节点内存地址,读请求子包包头中包括识别所述读请求子包的读请求标识,所述读请求子包中的读请求信息包括待读取数据所处的所述目的节点内存地址,所述装置还包括:With reference to the second possible implementation manner or the third possible implementation manner of the third aspect, in a fourth possible implementation manner, the sub-request package included in the merge request package obtained by the processing unit includes writing request subpackage and/or read request subpackage, the header of the write request subpackage includes a write request identifier identifying the write request subpackage, and the write request information in the write request subpackage includes the information to be written to the destination node data and the memory address of the destination node to be written, the header of the read request sub-packet includes a read request identifier identifying the read request sub-packet, and the read request information in the read request sub-packet includes the location of the data to be read memory address of the destination node, the device also includes:

接收单元,用于接收所述目的节点发送的写请求响应消息,所述写请求响应消息中包含写请求成功的所述写请求子包对应的写请求标识;和/或,用于接收所述目的节点发送的读请求响应消息,所述读请求响应消息中包含读请求成功的所述读请求子包对应的读请求标识,以及读取的有效载荷,所述有效载荷为所述读请求子包中远程内存地址对应的数据。A receiving unit, configured to receive a write request response message sent by the destination node, where the write request response message includes a write request identifier corresponding to the write request subpacket whose write request is successful; and/or, used to receive the The read request response message sent by the destination node, the read request response message includes the read request identifier corresponding to the read request subpacket for which the read request is successful, and the read payload, the payload is the read request subpacket The data corresponding to the remote memory address in the packet.

结合第三方面或第三方面的第一种可能的实现方式或第二种可能的实现方式或第三种可能的实现方式或第四种可能的实现方式,在第五种可能的实现方式中,所述判断单元还包括:In combination with the third aspect or the first possible implementation manner or the second possible implementation manner or the third possible implementation manner or the fourth possible implementation manner of the third aspect, in the fifth possible implementation manner , the judging unit also includes:

第二查找模块,用于根据所述各个待发送请求包对应的目的节点标识,在路由表中查找所述目的节点标识对应的路由端口,所述路由表包含所述目的节点标识对应的路由端口,所述路由端口为所述待发送请求包到达所述目的节点的路径上的端口;The second search module is configured to search the routing table for the routing port corresponding to the destination node ID according to the destination node ID corresponding to each request packet to be sent, and the routing table includes the routing port corresponding to the destination node ID , the routing port is a port on the path where the request packet to be sent reaches the destination node;

第三判断模块,用于判断所述各个待发送请求包的路由端口是否相同。The third judging module is used for judging whether the routing ports of the request packets to be sent are the same.

第四方面,本发明提供一种内存数据的读写处理装置,包括:In a fourth aspect, the present invention provides a device for reading and writing memory data, including:

接收单元,用于接收请求包;a receiving unit, configured to receive the request packet;

判断单元,用于判断接收的请求包中是否携带合并包标识,所述合并包标识用于指示所述请求包为至少两个子请求包组合的合并请求包,所述子请求包包括:读请求子包,和/或写请求子包;A judging unit, configured to judge whether the received request packet carries a combined package identifier, the combined package identifier used to indicate that the request package is a combined request package composed of at least two sub-request packages, and the sub-request package includes: a read request subpackage, and/or write request subpackage;

确定单元,用于当所述请求包中携带合并包标识时,确定所述请求包为合并请求包,所述合并请求包中包括公共包头和子请求包,所述公共包头中包含合并包标识、子请求包个数标识和源节点标识,所述子请求包个数标识用于指示所述合并请求包携带的子请求包的个数,所述子请求包包含子请求包包头和子请求信息;A determining unit, configured to determine that the request package is a merge request package when the request package carries a merge package identifier, the merge request package includes a public header and a sub-request package, and the common header includes a merge package identifier, A sub-request packet number identifier and a source node identifier, the sub-request packet number identifier is used to indicate the number of sub-request packets carried by the merge request packet, and the sub-request packet includes a sub-request packet header and sub-request information;

提取单元,用于根据所述合并请求包中携带的子请求包个数标识和每个子请求包包头,提取所述合并请求包中与所述子请求包个数标识对应个数的子请求包;An extracting unit, configured to extract the number of sub-request packets corresponding to the number of sub-request packets in the merge request packet according to the number of sub-request packets carried in the merge request packet and the header of each sub-request packet ;

处理单元,用于根据所述每个子请求包包头和子请求信息,处理对应的子请求包。The processing unit is configured to process the corresponding sub-request packet according to the header of each sub-request packet and the sub-request information.

在第四方面的第一种可能的实现方式中,所述处理单元包括:In a first possible implementation manner of the fourth aspect, the processing unit includes:

第一处理模块,用于根据写请求子包包头中的写请求标识、所述写请求子包的写请求信息中的待写入数据以及待写入的目的节点内存地址,将所述待写入数据写入所述目的节点内存地址;The first processing module is configured to write the data to be written according to the write request identifier in the header of the write request subpacket, the data to be written in the write request information of the write request subpacket, and the memory address of the destination node to be written. Incoming data is written to the memory address of the destination node;

第二处理模块,用于根据读请求子包包头中的读请求标识,以及所述读请求子包的读请求信息中的待读取数据所处的目的节点内存地址,在所述目的节点内存地址中读取所述待读取数据。The second processing module is configured to, according to the read request identifier in the header of the read request sub-packet and the memory address of the destination node where the data to be read in the read request information of the read request sub-packet is located, in the memory of the destination node Read the data to be read from the address.

结合第四方面的第一种可能的实现方式,在第二种可能的实现方式中,所述装置还包括:With reference to the first possible implementation manner of the fourth aspect, in a second possible implementation manner, the device further includes:

标识写入单元,用于将所述源节点标识写入每个子请求包的子请求包包头中,以便于所述目的节点向所述源节点发送响应消息。The identifier writing unit is configured to write the source node identifier into the sub-request packet header of each sub-request packet, so that the destination node sends a response message to the source node.

结合第四方面的第二种可能的实现方式,在第三种可能的实现方式中,所述判断单元,还用于判断各个待发送的响应消息对应的源节点标识是否相同;With reference to the second possible implementation of the fourth aspect, in a third possible implementation, the judging unit is further configured to judge whether the source node identifiers corresponding to the response messages to be sent are the same;

所述处理单元,还用于将具有相同源节点标识的所述待发送的响应消息作为子响应消息,打包为一个合并响应消息包,所述合并响应消息包中包括写请求子响应消息和/或读请求子响应消息;The processing unit is further configured to pack the to-be-sent response messages with the same source node identifier as sub-response messages into a combined response message package, the combined response message package including the write request sub-response message and/or or read request sub-response message;

所述装置还包括:The device also includes:

发送单元,用于将所述合并响应消息包发送给所述源节点标识对应的源节点。A sending unit, configured to send the combined response message packet to the source node corresponding to the source node identifier.

在第四方面的第四种可能的实现方式中,当所述目的节点为路由端口时,所述处理单元,还用于提取所述合并请求包的公共包头中的源节点标识,写入每个子请求包的包头中。In a fourth possible implementation of the fourth aspect, when the destination node is a routing port, the processing unit is further configured to extract the source node identifier in the common header of the merge request packet, and write In the header of a sub-request packet.

本发明实施例提供的一种内存数据的读写处理方法和装置,源节点获取各个待发送请求包,所述待发送请求包包括:读请求包,和/或写请求包,然后解析所述各个待发送请求包的目的节点标识,并判断所述各个待发送请求包的目的节点标识是否相同,将所述具有相同目的节点标识的至少两个待发送请求包分别作为子请求包,打包为一个合并请求包,将所述合并请求包发送给所述目的节点标识对应的目的节点,所述合并请求包用于指示所述目的节点对所述目的节点的内存数据进行读和/或写操作。本发明实施例解决了现有技术中多个数据量较小的内存数据读写操作浪费较多的开销在数据请求包上,导致传输效率低下的问题,提高了链路的利用效率。In the method and device for reading and writing memory data provided by the embodiments of the present invention, the source node obtains each request packet to be sent, and the request packet to be sent includes: a read request packet and/or a write request packet, and then parses the The destination node identifier of each request packet to be sent, and judge whether the destination node identifier of each request packet to be sent is the same, and at least two request packets to be sent with the same destination node identifier are respectively used as sub-request packets, and are packaged as A merge request packet, the merge request packet is sent to the destination node corresponding to the destination node identifier, and the merge request packet is used to instruct the destination node to perform read and/or write operations on the memory data of the destination node . The embodiment of the present invention solves the problem in the prior art that a plurality of memory data read and write operations with a small amount of data waste more overhead on data request packets, resulting in low transmission efficiency, and improves link utilization efficiency.

附图说明Description of drawings

为了更清楚地说明本发明实施例的技术方案,下面将对本发明实施例中所需要使用的附图作简单地介绍,显而易见地,下面所描述的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the accompanying drawings required in the embodiments of the present invention. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For Those of ordinary skill in the art can also obtain other drawings based on these drawings without making creative efforts.

图1为本发明实施例提供的一种内存数据的读写处理方法的流程图;FIG. 1 is a flow chart of a method for reading and writing memory data provided by an embodiment of the present invention;

图2为一种读请求包格式的示意图;Fig. 2 is a schematic diagram of a read request packet format;

图3为一种写请求包格式的示意图;Fig. 3 is a schematic diagram of a write request packet format;

图4为另一种读请求包格式的示意图;FIG. 4 is a schematic diagram of another read request packet format;

图5为另一种写请求包格式的示意图;FIG. 5 is a schematic diagram of another write request packet format;

图6为本发明实施例提供的一种合并写请求包格式的示意图;FIG. 6 is a schematic diagram of a combined write request packet format provided by an embodiment of the present invention;

图7为本发明实施例提供的一种合并读请求包格式的示意图;FIG. 7 is a schematic diagram of a merged read request packet format provided by an embodiment of the present invention;

图8为本发明实施例提供的一种合并读写请求包格式的示意图;FIG. 8 is a schematic diagram of a combined read-write request packet format provided by an embodiment of the present invention;

图9为本发明实施例提供的另一种合并写请求包格式的示意图;FIG. 9 is a schematic diagram of another combined write request packet format provided by an embodiment of the present invention;

图10为本发明实施例提供的另一种合并读请求包格式的示意图;FIG. 10 is a schematic diagram of another merged read request packet format provided by an embodiment of the present invention;

图11为本发明实施例提供的另一种合并读写请求包格式的示意图;FIG. 11 is a schematic diagram of another combined read-write request packet format provided by an embodiment of the present invention;

图12为本发明实施例提供的另一种内存数据的读写处理方法的流程图;12 is a flow chart of another method for reading and writing memory data provided by an embodiment of the present invention;

图13为本发明实施例提供的又一种内存数据的读写处理方法的流程图;13 is a flow chart of another method for reading and writing memory data provided by an embodiment of the present invention;

图14为本发明实施例提供的一种内存数据的读写处理装置的结构图;FIG. 14 is a structural diagram of a device for reading and writing memory data provided by an embodiment of the present invention;

图15为本发明实施例提供的一种内存数据的读写处理装置中处理单元的结构图;15 is a structural diagram of a processing unit in a device for reading and writing memory data provided by an embodiment of the present invention;

图16为本发明实施例提供的又一种内存数据的读写处理装置的结构图;Fig. 16 is a structural diagram of another device for reading and writing memory data provided by an embodiment of the present invention;

图17为本发明实施例提供的一种内存数据的读写处理装置中判断单元的结构图;17 is a structural diagram of a judging unit in a device for reading and writing memory data provided by an embodiment of the present invention;

图18为本发明实施例提供的另一种内存数据的读写处理装置的结构图;FIG. 18 is a structural diagram of another device for reading and writing memory data provided by an embodiment of the present invention;

图19为本发明实施例提供的一种内存数据的读写处理装置中判断单元的结构图;19 is a structural diagram of a judging unit in a device for reading and writing memory data provided by an embodiment of the present invention;

图20为本发明实施例提供的又另一种内存数据的读写处理装置的结构图;FIG. 20 is a structural diagram of yet another device for reading and writing memory data provided by an embodiment of the present invention;

图21为本发明实施例提供的又另一种内存数据的读写处理装置中处理单元的结构图;FIG. 21 is a structural diagram of a processing unit in yet another device for reading and writing memory data provided by an embodiment of the present invention;

图22为本发明实施例提供的再一种内存数据的读写处理装置的结构图;FIG. 22 is a structural diagram of yet another device for reading and writing memory data provided by an embodiment of the present invention;

图23为本发明实施例提供的再又一种内存数据的读写处理装置的结构图;Fig. 23 is a structural diagram of yet another device for reading and writing memory data provided by an embodiment of the present invention;

图24为本发明实施例提供的一种内存数据的读写处理装置的硬件结构图;FIG. 24 is a hardware structural diagram of a device for reading and writing memory data provided by an embodiment of the present invention;

图25为本发明实施例提供的又一种内存数据的读写处理装置的硬件结构图。FIG. 25 is a hardware structural diagram of another device for reading and writing memory data provided by an embodiment of the present invention.

具体实施方式detailed description

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.

当本地内存与远程内存进行数据交互时,对于数据量较小的内存数据读写操作会浪费较多的开销在数据请求包上,导致传输效率低下,本发明实施例提供一种内存数据的读写处理方法,将具有相同目的节点地址的请求进行合并,来提高链路的利用率,本发明实施例的方法的执行主体源节点可以是计算机节点(亦可称为计算节点),如图1所示,该方法包括以下步骤:When the local memory interacts with the remote memory, more overhead will be wasted on data request packets for data read and write operations on memory with a small amount of data, resulting in low transmission efficiency. The embodiment of the present invention provides a memory data read Write a processing method to combine requests with the same destination node address to improve the utilization rate of the link. The execution subject source node of the method in the embodiment of the present invention can be a computer node (also called a computing node), as shown in Figure 1 As shown, the method includes the following steps:

101、获取各个待发送请求包,所述待发送请求包包括:读请求包,和/或写请求包。101. Acquire each request packet to be sent, where the request packet to be sent includes: a read request packet, and/or a write request packet.

所述源节点获取的各个待发送请求包包括读请求包,和/或写请求包。Each to-be-sent request packet acquired by the source node includes a read request packet and/or a write request packet.

102、解析所述各个待发送请求包的目的节点标识,并判断所述各个待发送请求包的目的节点标识是否相同。102. Analyze the destination node identifiers of the request packets to be sent, and determine whether the destination node identifiers of the request packets to be sent are the same.

其中,可以通过两种方式实现上述步骤102。Wherein, the above step 102 can be realized in two ways.

方式一:先获取各个待发送请求包中携带的目的节点标识,然后判断所述各个待发送请求包的目的节点标识是否相同。Way 1: first obtain the destination node identifiers carried in each request packet to be sent, and then determine whether the destination node identifiers of the request packets to be sent are the same.

在方式一中,在所述源节点向目的节点进行内存数据读写处理之前,参考现有技术中所述源节点向所述目的节点发送内存借用请求,所述目的节点根据自身内存的状态决定接受还是拒绝,当所述目的节点接受所述源节点的请求后,所述目的节点将分配的内存地址和地址长度发送给所述源节点,所述源节点为所述目的节点的这段内存地址分配本地内存地址,并建立地址映射表,所述地址映射表为本地内存地址与所述目的节点标识和所述目的节点的内存地址的映射列表。In the first way, before the source node reads and writes memory data to the destination node, referring to the prior art, the source node sends a memory borrowing request to the destination node, and the destination node decides according to the state of its own memory Accept or reject, when the destination node accepts the request of the source node, the destination node sends the allocated memory address and address length to the source node, and the source node is the memory of the destination node The address allocates a local memory address, and establishes an address mapping table, where the address mapping table is a mapping list of the local memory address, the destination node identifier, and the memory address of the destination node.

当所述源节点向所述目的节点发送读或写请求包时,所述请求包中包括所述源节点标识、所述目的节点标识和所述目的节点的内存地址,其中所述目的节点标识和所述目的节点的内存地址,是由所述源节点在获取到携带有本地内存地址的请求之后,利用所述地址映射表,通过所述本地内存地址查找到的,如图2所示为待发送读请求包,图3所示为待发送写请求包。通过获取图2和/或图3所示的待发送请求包中携带的目的节点标识,并判断所述各个待发送请求包的目的节点标识是否相同。When the source node sends a read or write request packet to the destination node, the request packet includes the source node identifier, the destination node identifier and the memory address of the destination node, wherein the destination node identifier and the memory address of the destination node is obtained by the source node after obtaining the request carrying the local memory address, using the address mapping table to search through the local memory address, as shown in Figure 2 The read request packet to be sent is shown in Figure 3 as the write request packet to be sent. By acquiring the destination node identifiers carried in the request packets to be sent shown in FIG. 2 and/or FIG. 3 , and judging whether the destination node identifiers of the request packets to be sent are the same.

方式二:获取各个待发送请求包中携带的目的节点内存地址;根据所述目的节点内存地址,在地址归属表中查找所述目的节点内存地址归属的目的节点标识,所述地址归属表为目的节点内存地址与目的节点标识的对应关系表;判断所述各个待发送请求包的目的节点标识是否相同。Method 2: Obtain the memory address of the destination node carried in each request packet to be sent; according to the memory address of the destination node, look up the destination node identifier of the memory address of the destination node in the address attribution table, and the address attribution table is the destination node A table of correspondence between node memory addresses and destination node identifiers; judging whether the destination node identifiers of the request packets to be sent are the same.

在方式二中,采用PCIE为例说明,所述待发送读请求包如图4所示,所述待发送写请求包如图5所示,其中,所述待发送读请求包和所述待发送写请求包中携带的地址为所述目的节点内存地址,在地址归属表中查找所述目的节点内存地址归属的目的节点标识,所述地址归属表为目的节点内存地址与目的节点标识的对应关系表,例如,在所述地址归属表中,当所述目的节点内存地址为0H1000-0H1fff时,对应的目的节点标识为1,所述目的节点内存地址为0H2000-0H2fff时,对应的目的节点标识为2,所述目的节点内存地址为0H3000-0H2fff时,对应的目的节点标识为3。当获取到所述待发送请求包中携带的目的节点内存地址后,根据上述地址归属表获取目的节点内存地址对应的目的节点标识。In mode 2, using PCIE as an example, the read request packet to be sent is shown in Figure 4, and the write request packet to be sent is shown in Figure 5, wherein the read request packet to be sent and the pending The address carried in the sending write request packet is the memory address of the destination node, and the destination node identification to which the memory address of the destination node belongs is searched in the address attribution table, and the address attribution table is the correspondence between the memory address of the destination node and the destination node identification relational table, for example, in the address attribution table, when the memory address of the destination node is 0H1000-0H1fff, the corresponding destination node ID is 1; when the memory address of the destination node is 0H2000-0H2fff, the corresponding destination node The identifier is 2, and when the memory address of the destination node is 0H3000-0H2fff, the corresponding destination node identifier is 3. After the memory address of the destination node carried in the request packet to be sent is obtained, the destination node identifier corresponding to the memory address of the destination node is obtained according to the address attribution table.

例如,当所述待发送读请求包中携带的所述目的节点内存地址为0H1001,所述待发送写请求包中携带的所述目的节点内存地址为0H1ff0时,所述待发送读请求包和所述待发送写请求包均存在于所述目的节点标识为1中对应的目的节点内存地址范围内,因此所述待发送读请求包和所述待发送写请求包的目的节点标识相同。For example, when the memory address of the destination node carried in the read request packet to be sent is 0H1001, and the memory address of the destination node carried in the write request packet to be sent is 0H1ff0, the read request packet to be sent and The write request packets to be sent all exist within the memory address range of the destination node corresponding to the destination node ID 1, so the read request packets to be sent and the write request packets to be sent have the same destination node ID.

103、将所述具有相同目的节点标识的至少两个待发送请求包分别作为子请求包,打包为一个合并请求包,所述合并请求包中包括公共包头和至少两个子请求包,所述公共包头中包含合并包标识、子请求包个数标识和源节点标识,所述合并包标识用于指示所述请求包为所述至少两个子请求包组合的合并包,所述子请求包个数标识用于指示所述合并请求包携带的子请求包的个数,所述子请求包包含子请求包包头和子请求信息。103. Pack the at least two to-be-sent request packets with the same destination node identifier as sub-request packets, and package them into a combined request package, where the combined request package includes a public header and at least two sub-request packages, and the common The packet header includes a combined package identifier, a number of sub-request packages and a source node identifier, the combined package identifier is used to indicate that the request package is a combined package of the at least two sub-request packages, and the number of sub-request packages is The identifier is used to indicate the number of sub-request packets carried by the merge request packet, and the sub-request packets include sub-request packet headers and sub-request information.

在将子请求包打包成合并请求包时,在所述合并请求包中包括公共包头和子请求包,所述公共包头中包含合并包标识(Combine,C),用于指示所述请求包为所述至少两个子请求包组合的合并包,并将所述合并包标识置为预定值,所述预定值指示所述请求包为所述至少两个子请求包组合的合并包,例如C=“1”时表示请求包为合并请求包;包括子请求包个数标识(Combined Requests Number,CR NUM),用于指示所述合并请求包携带的子请求包的个数,在打包为合并请求包时,获取子请求包的个数,将所述个数写入所述子请求包个数标识中;还包括源节点标识(Requester ID),用于指示所述合并请求包发出的源节点,也就是本地源节点的标识,另外所述合并请求包的公共包头中还包含各个子请求包包头中的公共信息。所述合并请求包中的子请求包包含子请求包包头和子请求信息,所述子请求包包头包含所述子请求包的类型(Type)以及长度,其中长度具体为事物层包长度(Transaction Lay Packet,TLP length)。其中,类型用于区分所述子请求包是写请求子包还是读请求子包。When the sub-request package is packaged into a merge request package, the merge request package includes a public package header and a sub-request package, and the public package header contains a merge package identifier (Combine, C), which is used to indicate that the request package is all A combined package of the at least two sub-request packages, and set the combined package identifier to a predetermined value, which indicates that the request package is a combined package of the at least two sub-request packages, for example, C="1 " indicates that the request package is a combined request package; it includes the sub-request package number identifier (Combined Requests Number, CR NUM), which is used to indicate the number of sub-request packages carried by the combined request package, when packaged into a combined request package , to obtain the number of sub-request packets, and write the number into the identifier of the number of sub-request packets; it also includes a source node identifier (Requester ID), which is used to indicate the source node from which the merge request packet is sent, and also It is the identifier of the local source node. In addition, the public header of the merge request package also includes the public information in the headers of each sub-request package. The sub-request packet in the merge request packet includes a sub-request packet header and sub-request information, and the sub-request packet header includes the type (Type) and length of the sub-request packet, wherein the length is specifically the transaction layer packet length (Transaction Lay Packet, TLP length). Wherein, the type is used to distinguish whether the sub-request packet is a write request sub-packet or a read request sub-packet.

其中,可以将具有相同目的节点标识的写请求子包打包成一个合并写请求包,或者将具有相同目的节点标识的读请求子包打包成一个合并读请求包,或者为了进一步提高链路利用率,将具有相同目的节点标识的写请求子包和读请求子包打包成一个合并读写请求包,在这里不做限定。Among them, the write request subpackages with the same destination node ID can be packaged into a combined write request package, or the read request subpackets with the same destination node ID can be packaged into a combined read request package, or in order to further improve link utilization , pack the write request sub-package and the read request sub-packet with the same destination node ID into a merged read-write request package, which is not limited here.

通过上述步骤102中的方式一打包得到的合并请求包中,需要提取所述子请求包中的目的节点标识,并将所述目的节点标识置于所述合并请求包的公共包头中。如图6所示,为得到的合并写请求包,如图7所示,为得到的合并读请求包,如图8所示,为得到的合并读写请求包。From the merge request package obtained by packaging the first method in step 102, it is necessary to extract the destination node identifier in the sub-request packet, and place the destination node identifier in the public header of the merge request packet. As shown in FIG. 6 , it is the obtained merged write request packet, as shown in FIG. 7 , it is the obtained merged read request packet, and as shown in FIG. 8 , it is the obtained merged read and write request packet.

通过上述步骤102中的方式二打包得到的合并请求包中,如图9所示为得到的合并写请求包,如图10所示为得到的合并读请求包,如图11所示为得到的合并读写请求包。另外,通过方式二中得到的合并请求包中每个子请求包的包头中还包括请求编码,是所述源节点对子请求包的编码,是每个子请求包的唯一标识。In the combined request package obtained by packaging the second method in step 102 above, the combined write request package obtained is shown in Figure 9, the combined read request package obtained is shown in Figure 10, and the obtained combined read request package is shown in Figure 11. Merge read and write request packets. In addition, the header of each sub-request package in the combined request package obtained in the second method also includes a request code, which is the code of the source node for the sub-request package and is the unique identifier of each sub-request package.

104、将所述合并请求包发送给所述目的节点标识对应的目的节点,所述合并请求包用于指示所述目的节点对所述目的节点的内存数据进行读和/或写操作。104. Send the merge request packet to the destination node corresponding to the destination node identifier, where the merge request packet is used to instruct the destination node to perform read and/or write operations on memory data of the destination node.

本发明实施例提供的一种内存数据的读写处理方法,源节点获取各个待发送请求包,并解析所述各个待发送请求包的目的节点标识,判断所述各个待发送请求包的目的节点标识是否相同,然后将所述具有相同目的节点标识的至少两个待发送请求包分别作为子请求包,打包为一个合并请求包,最终将所述合并请求包发送给所述目的节点标识对应的目的节点,所述合并请求包用于指示所述目的节点对所述目的节点的内存数据进行读和/或写操作。本发明实施例解决了现有技术中多个数据量较小的内存数据访存操作浪费较多的开销在数据请求包上,导致传输效率低下的问题,提高了链路的利用效率。In the method for reading and writing memory data provided by the embodiment of the present invention, the source node obtains each request packet to be sent, and analyzes the destination node identifier of each request packet to be sent, and determines the destination node of each request packet to be sent identify whether they are the same, then use the at least two request packets to be sent with the same destination node identifier as sub-request packets, package them into a merge request packet, and finally send the merge request packet to the corresponding destination node identifier For a destination node, the merge request packet is used to instruct the destination node to perform read and/or write operations on memory data of the destination node. The embodiment of the present invention solves the problem in the prior art that a plurality of memory data access operations with a small amount of data waste more overhead on data request packets, resulting in low transmission efficiency, and improves link utilization efficiency.

本发明实施例还提供一种内存数据的读写处理方法,本发明实施例的方法的执行主体目的节点,可以为一远程计算机节点,如图12所示,该方法包括如下步骤:The embodiment of the present invention also provides a method for reading and writing memory data. The target node of the execution subject of the method of the embodiment of the present invention may be a remote computer node, as shown in FIG. 12 , the method includes the following steps:

1201、接收请求包;1201. Receive a request packet;

1202、判断接收的请求包中是否携带合并包标识,所述合并包标识用于指示所述请求包为至少两个子请求包组合的合并请求包,所述子请求包包括:读请求子包,和/或写请求子包。1202. Determine whether the received request packet carries a combined package identifier, where the combined package identifier is used to indicate that the request package is a combined request package composed of at least two sub-request packages, and the sub-request package includes: a read request sub-packet, and/or write requests subpackage.

当所述目的节点接收到请求包时,先判断所述请求包中是否包含有合并包标识C,例如当判断C=“1”时,表示所述请求包为合并请求包。When the destination node receives the request packet, it first judges whether the request packet contains the merged packet identifier C, for example, when it is judged that C=“1”, it means that the request packet is a merged request packet.

1203、当所述请求包中携带合并包标识时,确定所述请求包为合并请求包,所述合并请求包中包括公共包头和子请求包,所述公共包头中包含合并包标识、子请求包个数标识和源节点标识,所述子请求包个数标识用于指示所述合并请求包携带的子请求包的个数,所述子请求包包含子请求包包头和子请求信息;1203. When the request package carries a merge package identifier, determine that the request package is a merge request package, the merge request package includes a public header and a sub-request package, and the public header includes a merge package identifier, a sub-request package A number identifier and a source node identifier, the sub-request packet number identifier is used to indicate the number of sub-request packets carried by the merge request packet, and the sub-request packet includes a sub-request packet header and sub-request information;

1204、根据所述合并请求包中携带的子请求包个数标识和每个子请求包包头,提取所述合并请求包中与所述子请求包个数标识对应个数的子请求包。1204. According to the identifier of the number of sub-request packets carried in the merge request packet and the header of each sub-request packet, extract the number of sub-request packets corresponding to the identifier of the number of sub-request packets in the merge request packet.

当确定接收的请求包为合并请求包时,所述合并请求包的公共包头中除了包含有合并包标识,还包含子请求包个数标识和源节点标识,其中子请求包个数标识用于指示所述合并请求包携带的子请求包的个数,源节点标识用于指示所述合并请求包发出的源节点。在每个子请求包中包含子请求包包头和子请求信息。When it is determined that the received request package is a merge request package, in addition to the merge package identifier, the common header of the merge request package also includes a sub-request package number identifier and a source node identifier, wherein the sub-request package number identifier is used for Indicates the number of sub-request packets carried by the merge request packet, and the source node identifier is used to indicate the source node from which the merge request packet is sent. Include sub-request packet header and sub-request information in each sub-request packet.

通过所述合并请求包中携带的子请求包个数标识和每个子请求包包头,提取所述合并请求包中与所述子请求包个数标识对应个数的子请求包,其中,可以利用子请求包个数标识和每个子请求包包头中的类型和长度,或者利用子请求包个数标识和每个子请求包包头中的格式、类型和长度,提取所述合并请求包中与所述子请求包个数标识对应个数的子请求包。Through the number of sub-request packets carried in the merge request packet and the header of each sub-request packet, extract the number of sub-request packets corresponding to the number of sub-request packets in the merge request packet, wherein, Sub-request packet number identifier and the type and length in each sub-request packet header, or use the sub-request packet number identifier and the format, type and length in each sub-request packet header to extract the merge request packet and the The number of sub-request packets identifies the corresponding number of sub-request packets.

1205、根据所述每个子请求包包头和子请求信息,处理对应的子请求包。1205. Process the corresponding sub-request packet according to the header of each sub-request packet and the sub-request information.

其中,由于所述合并请求包中可能包含有写请求子包和/或读请求子包,可以根据子请求包包头中的格式和/或类型进行区分写请求子包和读请求子包,从而将不同请求的写请求子包和读请求子包进行不同的处理。Wherein, since the merge request package may contain a write request subpackage and/or a read request subpackage, the write request subpackage and the read request subpackage can be distinguished according to the format and/or type in the header of the subrequest packet, so that The write request sub-package and the read request sub-packet of different requests are processed differently.

参考现有技术中,对于子写请求,根据所述写请求子包中携带的所述目的节点内存地址和有效载荷,将所述有效载荷写入所述目的节点内存地址上;对于子读请求,根据所述读请求子包中携带的所述目的节点内存地址,读取所述目的节点内存地址上的内容,并返回给所述源节点。With reference to the prior art, for a sub-write request, write the payload into the memory address of the destination node according to the memory address and payload of the destination node carried in the sub-packet of the write request; for the sub-read request , according to the memory address of the destination node carried in the read request subpacket, read the content on the memory address of the destination node, and return it to the source node.

本发明实施例提供的一种内存数据的读写处理方法,目的节点判断接收的请求包中是否携带合并包标识,当所述请求包中携带合并包标识时,确定所述请求包为合并请求包,然后根据所述合并请求包中携带的子请求包个数标识和每个子请求包包头,提取所述合并请求包中与所述子请求包个数标识对应个数的子请求包,最终根据所述每个子请求包包头和子请求信息,处理对应的子请求包。本发明实施例解决了现有技术中多个数据量较小的内存数据访存操作浪费较多的开销在数据请求包上,导致传输效率低下的问题,提高了链路的利用效率。In the method for reading and writing memory data provided by an embodiment of the present invention, the destination node judges whether the received request packet carries a merged package identifier, and when the request packet carries the merged packet identifier, determines that the request packet is a merged request package, and then according to the number of sub-request packets carried in the merge request packet and the header of each sub-request packet, extract the sub-request packets corresponding to the number of sub-request packets in the merge request packet, and finally According to the header of each sub-request packet and the sub-request information, the corresponding sub-request packet is processed. The embodiment of the present invention solves the problem in the prior art that a plurality of memory data access operations with a small amount of data waste more overhead on data request packets, resulting in low transmission efficiency, and improves link utilization efficiency.

本发明实施例可以应用于RDMA中,将一计算节点的内存数据中具有相同目的节点的待发送请求包进行打包合并,一起发送给所述目的节点对应的远程计算节点,具体是本地Cache将请求发送给本地内存控制器,进行打包合并处理,然后发送给远程内存控制器进行拆包处理,将得到的请求发送给远程Cache。本实施例以PCIE为例进行说明,图4为标准PCIE中读请求包格式,图5为写请求包格式,其中格式和类型用来区分所述请求包为读请求包还是写请求包,事物层包长度用于表示所述请求包长度,源节点标识用于指示发送所述请求包的源节点,读请求包中的地址表示所述读请求包将要读取的内存数据的地址,所述写请求包中的地址表示所述写请求包中将携带的有效载荷,要写入的内存地址,其他字段的含义可以参考现有技术中PCIE的包格式。下面以上述应用场景为例来详细介绍一种内存数据的读写处理方法,如图13所示,该方法包括以下步骤:The embodiment of the present invention can be applied to RDMA, pack and combine the request packets to be sent with the same destination node in the memory data of a computing node, and send them together to the remote computing node corresponding to the destination node, specifically, the local Cache will request Send it to the local memory controller for packaging and merging processing, then send it to the remote memory controller for unpacking processing, and send the obtained request to the remote Cache. The present embodiment takes PCIE as an example to illustrate, and Fig. 4 is the format of the read request packet in the standard PCIE, and Fig. 5 is the format of the write request packet, wherein the format and type are used to distinguish whether the request packet is a read request packet or a write request packet, and things The layer packet length is used to indicate the length of the request packet, the source node identifier is used to indicate the source node sending the request packet, the address in the read request packet represents the address of the memory data to be read by the read request packet, and the The address in the write request packet indicates the payload to be carried in the write request packet, the memory address to be written, and the meaning of other fields can refer to the packet format of PCIE in the prior art. The following uses the above application scenario as an example to introduce a method for reading and writing memory data in detail, as shown in Figure 13. The method includes the following steps:

1301、源节点获取各个待发送请求包,所述待发送请求包包括:读请求包,和/或写请求包;1301. The source node acquires each to-be-sent request packet, where the to-be-sent request packet includes: a read request packet, and/or a write request packet;

1302、所述源节点解析所述各个待发送请求包的目的节点标识,并判断所述各个待发送请求包的目的节点标识是否相同。1302. The source node parses the destination node identifiers of the request packets to be sent, and judges whether the destination node identifiers of the request packets to be sent are the same.

获取各个待发送请求包中携带的目的节点内存地址;根据所述目的节点内存地址,在地址归属表中查找所述目的节点内存地址归属的目的节点标识,所述地址归属表为目的节点内存地址与目的节点标识的对应关系表;判断所述各个待发送请求包的目的节点标识是否相同。Obtain the memory address of the destination node carried in each request packet to be sent; according to the memory address of the destination node, look up the destination node identification of the memory address of the destination node in the address attribution table, and the address attribution table is the memory address of the destination node A correspondence table with the destination node ID; judging whether the destination node IDs of the request packets to be sent are the same.

所述待发送读请求包如图4所示,所述待发送写请求包如图5所示,其中,所述待发送读请求包和所述待发送写请求包中携带的地址为所述目的节点内存地址,在地址归属表中查找所述目的节点内存地址归属的目的节点标识,所述地址归属表为目的节点内存地址与目的节点标识的对应关系表,例如,在所述地址归属表中,当所述目的节点内存地址为0H1000-0H1fff时,对应的目的节点标识为1,所述目的节点内存地址为0H2000-0H2fff时,对应的目的节点标识为2,所述目的节点内存地址为0H3000-0H2fff时,对应的目的节点标识为3。当获取到所述待发送请求包中携带的目的节点内存地址后,根据上述地址归属表获取目的节点内存地址对应的目的节点标识。The read request packet to be sent is shown in Figure 4, and the write request packet to be sent is shown in Figure 5, wherein the address carried in the read request packet to be sent and the write request packet to be sent is the For the memory address of the destination node, look up the destination node identifier of the memory address of the destination node in the address attribution table, the address attribution table is a correspondence table between the destination node memory address and the destination node identifier, for example, in the address attribution table Among them, when the memory address of the destination node is 0H1000-0H1fff, the corresponding destination node ID is 1, and when the memory address of the destination node is 0H2000-0H2fff, the corresponding destination node ID is 2, and the destination node memory address is When 0H3000-0H2fff, the corresponding destination node ID is 3. After the memory address of the destination node carried in the request packet to be sent is obtained, the destination node identifier corresponding to the memory address of the destination node is obtained according to the address attribution table.

例如,当所述待发送读请求包中携带的所述目的节点内存地址为0H1001,所述待发送写请求包中携带的所述目的节点内存地址为0H1ff0时,所述待发送读请求包和所述待发送写请求包均存在于所述目的节点标识为1中对应的目的节点内存地址范围内,因此所述待发送读请求包和所述待发送写请求包的目的节点标识相同。For example, when the memory address of the destination node carried in the read request packet to be sent is 0H1001, and the memory address of the destination node carried in the write request packet to be sent is 0H1ff0, the read request packet to be sent and The write request packets to be sent all exist within the memory address range of the destination node corresponding to the destination node ID 1, so the read request packets to be sent and the write request packets to be sent have the same destination node ID.

1303、所述源节点将所述具有相同目的节点标识的至少两个待发送请求包分别作为子请求包,打包为一个合并请求包,所述合并请求包中包括公共包头和至少两个子请求包,所述公共包头中包含合并包标识、子请求包个数标识和源节点标识,所述合并包标识用于指示所述请求包为所述至少两个子请求包组合的合并包,所述子请求包个数标识用于指示所述合并请求包携带的子请求包的个数,所述子请求包包含子请求包包头和子请求信息。1303. The source node takes the at least two request packets to be sent with the same destination node ID as sub-request packets, and packs them into a merge request packet, and the merge request packet includes a common header and at least two sub-request packets , the common packet header includes a combined package identifier, a number of sub-request packages and a source node identifier, the combined package identifier is used to indicate that the request package is a combined package of the at least two sub-request packages, and the sub-request package The identifier of the number of request packets is used to indicate the number of sub-request packets carried by the merge request packet, and the sub-request packets include sub-request packet headers and sub-request information.

其中,可以将具有相同目的节点标识的写请求子包打包成一个合并写请求包,或者将具有相同目的节点标识的读请求子包打包成一个合并读请求包,或者为了进一步提高链路利用率,将具有相同目的节点标识的写请求子包和读请求子包打包成一个合并读写请求包,所以所述合并请求包中包括写请求子包和/或读请求子包。Among them, the write request subpackages with the same destination node ID can be packaged into a combined write request package, or the read request subpackets with the same destination node ID can be packaged into a combined read request package, or in order to further improve link utilization , packing the write request sub-package and the read request sub-packet with the same destination node identifier into a combined read-write request package, so the combined request package includes the write request sub-packet and/or the read request sub-packet.

在将子请求包打包成合并请求包时,在所述合并请求包中包括公共包头和子请求包,所述公共包头中包含合并包标识(Combine,C),用于指示所述请求包为多个子请求包组合的合并请求包,例如C=“1”时表示请求包为合并请求包;包括子请求包个数标识(Combined Requests Number,CR NUM),用于指示所述合并请求包携带的子请求包的个数,还包括源节点标识(Requester ID),用于指示所述合并请求包发出的源节点,也就是本地源节点的标识,另外所述合并请求包的公共包头中还包含各个子请求包包头中的公共信息。所述合并请求包中的子请求包包含子请求包包头和子请求信息,所述子请求包包头包含所述子请求包的格式(Fmt),类型(Type)以及长度,其中长度具体为事物层包长度(Transaction Lay Packet,TLP length)。其中,格式和类型用于区分所述子请求包是写请求子包还是读请求子包。When the sub-request package is packaged into a merge request package, the merge request package includes a public header and a sub-request package, and the public header contains a merge package identifier (Combine, C), which is used to indicate that the request package is multiple A combined request package composed of sub-request packages, for example, C=“1” indicates that the request package is a combined request package; it includes the sub-request package number identifier (Combined Requests Number, CR NUM), which is used to indicate the combined requests carried by the combined request package The number of sub-request packages also includes the source node identifier (Requester ID), which is used to indicate the source node from which the merge request package is sent, that is, the identifier of the local source node. In addition, the public header of the merge request package also includes Common information in the header of each sub-request packet. The sub-request package in the merge request package contains the sub-request package header and sub-request information, and the sub-request package header contains the format (Fmt), type (Type) and length of the sub-request package, where the length is specifically the transaction layer Packet length (Transaction Lay Packet, TLP length). Wherein, the format and type are used to distinguish whether the sub-request packet is a write request sub-packet or a read request sub-packet.

另外,每个子请求包的包头中还包括请求编码,是所述源节点对子请求包的编码,是每个子请求包的唯一标识,以便所述源节点在接收到所述目的节点返回的响应消息时,根据所述响应消息中携带的请求编码来确定所述子请求的完成情况。In addition, the header of each sub-request packet also includes a request code, which is the code of the source node for the sub-request packet, and is the unique identifier of each sub-request packet, so that the source node can receive the response returned by the destination node message, the completion status of the sub-request is determined according to the request code carried in the response message.

具体如图10所示,将两个读请求子包合并得到合并读请求包,图中的合并包标识和子请求包个数标识是新添加的额外信息,其中所述子请求包个数标识长度为4比特,可以指示所述合并读请求包中包含的读请求子包的数目为16个。PCIE中本来就包含有请求编码(也就是标记)字段,长度为8比特,在所述合并读请求包中该字段的高4比特是共用的,第0-3比特用来区分不同的读请求子包,可以区分16个读请求子包,与所述子请求包个数标识字段表示的个数相匹配。其中,通信分类(TC)、污染保留位(EP)、属性(Attr)和源节点标识(Requester ID)属于所述合并读请求包中的公共包头;格式(Fmt)、类型(Type)、是否有ECRC(TD)、事物层包长度(TLP length)、请求编码(Request Coding)、最后字节对齐(LastDW BE)和首位字节对齐(1st DW BE)属于读请求子包包头,上述字段的含义可以参考现有技术中PCIE中读请求包格式的。Specifically, as shown in Figure 10, two read request subpackages are combined to obtain a combined read request package. The combined package identifier and subrequest package number identifier in the figure are newly added additional information, wherein the subrequest package number identifies the length is 4 bits, and may indicate that the number of read request sub-packets included in the merged read request packet is 16. PCIE originally contains a request encoding (that is, a tag) field with a length of 8 bits. In the combined read request packet, the upper 4 bits of this field are shared, and the 0-3 bits are used to distinguish different read requests. The sub-packets can distinguish 16 read request sub-packets, which match the number indicated by the sub-request package number identification field. Among them, communication classification (TC), pollution reserved bit (EP), attribute (Attr) and source node identification (Requester ID) belong to the public header in the merged read request packet; format (Fmt), type (Type), whether ECRC (TD), transaction layer packet length (TLP length), request coding (Request Coding), last byte alignment (LastDW BE) and first byte alignment (1st DW BE) belong to the header of the read request subpacket, and the above fields For the meaning, please refer to the format of the read request packet in PCIE in the prior art.

如图9所示,将两个写请求子包合并得到合并写请求包,所述合并写请求包中包含字段的含义与图10所示的合并读请求包中包含字段的含义类似,只是每个写请求子包中还包含有将要写入目的节点的有效载荷。As shown in Figure 9, two write request subpackages are combined to obtain a combined write request package, the meaning of the fields contained in the combined write request package is similar to that of the fields contained in the combined read request package shown in Figure 10, except that each A write request subpacket also contains the payload to be written to the destination node.

为了进一步提高链路利用率,可以将相同目的节点标识的写请求子包和读请求子包打包成一个合并请求包,如图11所示。In order to further improve link utilization, write request sub-packets and read request sub-packets with the same destination node identifier can be packaged into a combined request package, as shown in FIG. 11 .

对于上述合并请求包中的子请求,要按照所述子请求的发送先后顺序进行打包合并。For the sub-requests in the above merge request package, the sub-requests shall be packaged and merged according to the order in which the sub-requests are sent.

1304、所述源节点将所述合并请求包发送给所述目的节点标识对应的目的节点,所述合并请求包用于指示所述目的节点对所述目的节点的内存数据进行读和/或写操作。1304. The source node sends the merge request packet to the destination node identified by the destination node, where the merge request packet is used to instruct the destination node to read and/or write the memory data of the destination node operate.

1305、所述目的节点接收请求包;1305. The destination node receives the request packet;

1306、所述目的节点判断接收的请求包中是否携带合并包标识,所述合并包标识用于指示所述请求包为至少两个子请求包组合的合并请求包,所述子请求包包括:读请求子包,和/或写请求子包。1306. The destination node judges whether the received request packet carries a merged packet identifier, and the merged packet identifier is used to indicate that the request packet is a merged request packet composed of at least two sub-request packets, and the sub-request packet includes: read request subpackage, and/or write request subpackage.

当所述目的节点接收到请求包时,先判断所述请求包中是否包含有合并包标识C,例如当判断C=“1”时,表示所述请求包为合并请求包。When the destination node receives the request packet, it first judges whether the request packet contains the merged packet identifier C, for example, when it is judged that C=“1”, it means that the request packet is a merged request packet.

1307、当所述请求包中携带合并包标识时,确定所述请求包为合并请求包,所述合并请求包中包括公共包头和子请求包,所述公共包头中包含合并包标识、子请求包个数标识和源节点标识,所述子请求包个数标识用于指示所述合并请求包携带的子请求包的个数,所述子请求包包含子请求包包头和子请求信息;1307. When the request package carries a merge package identifier, determine that the request package is a merge request package, the merge request package includes a public header and a sub-request package, and the public header includes a merge package identifier, a sub-request package A number identifier and a source node identifier, the sub-request packet number identifier is used to indicate the number of sub-request packets carried by the merge request packet, and the sub-request packet includes a sub-request packet header and sub-request information;

1308、根据所述合并请求包中携带的子请求包个数标识和每个子请求包包头,提取所述合并请求包中与所述子请求包个数标识对应个数的子请求包。1308. According to the identifier of the number of sub-request packets carried in the merge request packet and the header of each sub-request packet, extract the number of sub-request packets corresponding to the identifier of the number of sub-request packets in the merge request packet.

当判断所述请求包为合并请求包时,根据所述子请求包个数标识,以及每个子请求包的格式、类型以及长度,获取每个子请求包。另外,由于所述合并请求包中可能包含有写请求子包和/或读请求子包,可以根据子请求包包头中的格式和类型进行区分写请求子包和读请求子包,从而将不同请求的写请求子包和读请求子包进行不同的处理。When it is judged that the request packet is a combined request packet, each sub-request packet is obtained according to the identifier of the number of sub-request packets, and the format, type and length of each sub-request packet. In addition, since the merge request package may contain a write request subpacket and/or a read request subpacket, the write request subpackage and the read request subpacket can be distinguished according to the format and type in the sub-request packet header, so that different The write request sub-packet and the read request sub-packet of the request are processed differently.

1309、根据所述每个子请求包包头和子请求信息,处理对应的子请求包。1309. Process the corresponding sub-request packet according to the header of each sub-request packet and the sub-request information.

根据写请求子包包头中的写请求标识、所述写请求子包的写请求信息中的待写入数据以及待写入的目的节点内存地址,将所述待写入数据写入所述目的节点内存地址;和/或,根据读请求子包包头中的读请求标识,以及所述读请求子包的读请求信息中的待读取数据所处的目的节点内存地址,在所述目的节点内存地址中读取所述待读取数据。Write the data to be written into the destination according to the write request identifier in the header of the write request subpacket, the data to be written in the write request information of the write request subpacket, and the memory address of the destination node to be written. node memory address; and/or, according to the read request identifier in the header of the read request subpacket, and the destination node memory address where the data to be read in the read request information of the read request subpacket is located, at the destination node The data to be read is read from the memory address.

进一步地,为了所述目的节点对子请求包进行处理之后,便于向所述源节点发送响应消息,将所述源节点标识写入每个子请求包的子请求包包头中,另外也可将所述合并请求包中的公共包头的其他信息写入每个子请求包的子请求包包头中,使得每个子请求包转换成合并之前的格式。Further, after the destination node processes the sub-request packet, it is convenient to send a response message to the source node, and the source node identifier is written into the sub-request packet header of each sub-request packet, and the Write other information of the public header in the merge request packet into the sub-request packet header of each sub-request packet, so that each sub-request packet is converted into the format before merging.

另外,所述目的节点在对子请求处理之后,可以向所述源节点返回响应消息,以告知所述源节点每个子请求的完成情况。可以通过以下两种方式进行反馈:In addition, after processing the sub-requests, the destination node may return a response message to the source node to inform the source node of the completion of each sub-request. Feedback can be given in two ways:

方式一:method one:

所述目的节点将处理后的子请求包的响应消息分别发送出去:The destination node sends out the response messages of the processed sub-request packets respectively:

获取所述写请求子包中的所述源节点标识;Obtain the source node identifier in the write request subpackage;

向所述源节点标识对应的源节点发送写请求响应消息,所述写请求响应消息中包含写请求成功的所述写请求子包对应的写请求标识。Sending a write request response message to the source node corresponding to the source node identifier, where the write request response message includes the write request identifier corresponding to the write request sub-packet whose write request is successful.

其中,当所述写请求子包为非推送式写请求时,需要所述目的节点向所述源节点发送反馈,或者可以要求完成写请求的写请求子包,均向所述源节点发送响应消息。Wherein, when the write request sub-packet is a non-push write request, the destination node needs to send feedback to the source node, or the write request sub-packet required to complete the write request sends a response to the source node information.

所述源节点接收所述目的节点发送的写请求响应消息,所述写请求响应消息中包含写请求成功的所述写请求子包对应的写请求标识。The source node receives the write request response message sent by the destination node, and the write request response message includes a write request identifier corresponding to the write request sub-packet whose write request is successful.

参考现有技术中,所述源节点在接收到写请求响应消息之后,根据携带的写请求标识,与发送出去的写请求子包中的写请求标识进行对比,可以得到哪些写请求子包在所述目的节点成功写入,哪些写请求子包没有写入,对于没有写请求成功的请求包可以再次发送。Referring to the prior art, after the source node receives the write request response message, it compares the carried write request identifier with the write request identifier in the sent write request subpacket to obtain which write request subpackets are The destination node writes successfully, and which write request subpackages are not written, and the request packets that do not have a successful write request can be sent again.

和/或,and / or,

所述目的节点获取所述读请求子包中的所述源节点标识;The destination node obtains the source node identifier in the read request subpacket;

向所述源节点标识对应的源节点发送读请求响应消息,所述读请求响应消息中包含读请求成功的所述读请求子包对应的请求编码,以及获取的有效载荷,所述有效载荷为所述子读请求获取的数据。Sending a read request response message to the source node corresponding to the source node identifier, the read request response message includes the request code corresponding to the read request subpackage for which the read request is successful, and the obtained payload, and the payload is The data obtained by the sub-read request.

所述源节点接收所述目的节点发送的读请求响应消息,所述读请求响应消息中包含读请求成功的所述读请求子包对应的读请求标识,以及获取的有效载荷,所述有效载荷为所述子读请求获取的数据。The source node receives the read request response message sent by the destination node, and the read request response message includes the read request identifier corresponding to the read request subpacket whose read request is successful, and the obtained payload, and the payload The data fetched for the subread request.

所述读请求子包中的有效载荷为所述目的节点根据所述读请求子包中的远程内存地址获取到的数据,所述目的节点将成功获取到有效载荷的子读请求对应的读请求响应消息发送给所述源节点,所述源节点在接收到所述有效载荷后,根据发送所述读请求子包时,记载的本端哪些地址需要读取数据,按照所述读请求标识将对应的有效载荷读回到相应地址即可。The payload in the read request sub-packet is the data obtained by the destination node according to the remote memory address in the read request sub-packet, and the destination node will successfully obtain the read request corresponding to the sub-read request of the payload The response message is sent to the source node, and after the source node receives the payload, according to which addresses of the local end need to read data recorded when sending the read request subpacket, according to the read request identifier, the The corresponding payload can be read back to the corresponding address.

方式二:Method 2:

判断各个待发送的响应消息对应的源节点标识是否相同;Judging whether the source node identifiers corresponding to the response messages to be sent are the same;

将具有相同源节点标识的所述待发送的响应消息作为子响应消息,打包为一个合并响应消息包,所述合并响应消息包中包括写请求子响应消息和/或读请求子响应消息;Packing the to-be-sent response messages with the same source node identifier as sub-response messages into a combined response message package, the combined response message package includes a write request sub-response message and/or a read request sub-response message;

将所述合并响应消息包发送给所述源节点标识对应的源节点。Send the combined response message packet to the source node corresponding to the source node identifier.

所述源节点在获取到所述合并响应消息包后,根据该包中的写请求标识和/或读请求标识获取对应的响应消息,获取之后的处理方式与方式一中描述的相同,此处不再赘述。After the source node obtains the combined response message packet, it obtains the corresponding response message according to the write request identifier and/or read request identifier in the packet, and the processing method after the acquisition is the same as that described in method 1, here No longer.

本发明实施例中的方法,也可以应用于系统中的多个端口之间的数据传输,根据所述各个待发送请求包对应的目的节点标识,在路由表中查找所述目的节点标识对应的路由端口,所述路由表包含所述目的节点标识对应的路由端口,所述路由端口为所述待发送请求包到达所述目的节点的路径上的端口,判断所述各个待发送请求包的路由端口是否相同,将具有相同路由端口的待发送请求包进行合并,得到合并请求包,并将所述合并请求包发送给所述路由端口。所述路由端口接收到所述合并请求包之后,进行拆包操作,提取所述合并请求包的公共包头中的源节点标识,写入每个子请求包的包头中,然后继续后面的转发操作。The method in the embodiment of the present invention can also be applied to data transmission between multiple ports in the system. According to the destination node identifiers corresponding to the respective request packets to be sent, search the routing table for the destination node identifiers corresponding to the destination node identifiers. Routing port, the routing table includes the routing port corresponding to the destination node identifier, the routing port is the port on the path where the request packet to be sent reaches the destination node, and the routing of each request packet to be sent is determined Whether the ports are the same, combine the request packets to be sent with the same routing port to obtain a combined request package, and send the combined request package to the routing port. After receiving the merge request packet, the routing port performs an unpacking operation, extracts the source node identifier in the common header of the merge request packet, writes it into the header of each sub-request packet, and then continues the following forwarding operation.

本发明实施例提供一种内存数据的读写处理装置14,所述内存数据的读写处理装置14可以存在于计算节点中,也可以就是一个计算节点,如图14所示,所述装置包括获取单元141、判断单元142、处理单元143和发送单元144。An embodiment of the present invention provides a memory data read-write processing device 14, the memory data read-write processing device 14 may exist in a computing node, or may be a computing node, as shown in Figure 14, the device includes An acquiring unit 141 , a judging unit 142 , a processing unit 143 and a sending unit 144 .

其中,获取单元141,用于获取各个待发送请求包,所述待发送请求包包括:读请求包,和/或写请求包;Wherein, the acquiring unit 141 is configured to acquire each request packet to be sent, and the request packet to be sent includes: a read request packet, and/or a write request packet;

判断单元142,用于解析所述各个待发送请求包的目的节点标识,并判断所述各个待发送请求包的目的节点标识是否相同;Judging unit 142, configured to analyze the destination node identifiers of the respective request packets to be sent, and judge whether the destination node identifiers of the respective request packets to be sent are the same;

处理单元143,用于将所述具有相同目的节点标识的至少两个待发送请求包分别作为子请求包,打包为一个合并请求包,所述合并请求包中包括公共包头和至少两个子请求包,所述公共包头中包含合并包标识、子请求包个数标识和源节点标识,所述合并包标识用于指示所述请求包为所述至少两个子请求包组合的合并包,所述子请求包个数标识用于指示所述合并请求包携带的子请求包的个数,所述子请求包包含子请求包包头和子请求信息;The processing unit 143 is configured to pack the at least two to-be-sent request packets with the same destination node identifier as sub-request packets, and package them into a combined request package, wherein the combined request package includes a public header and at least two sub-request packages , the common packet header includes a combined package identifier, a number of sub-request packages and a source node identifier, the combined package identifier is used to indicate that the request package is a combined package of the at least two sub-request packages, and the sub-request package The number of request packets is used to indicate the number of sub-request packets carried by the merge request packet, and the sub-request packets include sub-request packet headers and sub-request information;

发送单元144,用于将所述合并请求包发送给所述目的节点标识对应的目的节点,所述合并请求包用于指示所述目的节点对所述目的节点的内存数据进行读和/或写操作。The sending unit 144 is configured to send the merge request packet to the destination node corresponding to the destination node identifier, the merge request packet is used to instruct the destination node to read and/or write the memory data of the destination node operate.

本发明实施例提供的一种内存数据的读写处理装置,获取各个待发送请求包,并解析所述各个待发送请求包的目的节点标识,判断所述各个待发送请求包的目的节点标识是否相同,然后将所述具有相同目的节点标识的至少两个待发送请求包分别作为子请求包,打包为一个合并请求包,最终将所述合并请求包发送给所述目的节点标识对应的目的节点,所述合并请求包用于指示所述目的节点对所述目的节点的内存数据进行读和/或写操作。本发明实施例解决了现有技术中多个数据量较小的远程数据访存操作浪费较多的开销在数据请求包上,导致传输效率低下的问题,提高了链路的利用效率。A read-write processing device for memory data provided by an embodiment of the present invention obtains each request packet to be sent, and analyzes the destination node identifier of each request packet to be sent, and judges whether the destination node identifier of each request packet to be sent is The same, then the at least two request packets to be sent with the same destination node identifier are respectively used as sub-request packets, packaged into a merge request packet, and finally the merge request packet is sent to the destination node corresponding to the destination node identifier , the merge request packet is used to instruct the destination node to perform read and/or write operations on memory data of the destination node. The embodiment of the present invention solves the problem in the prior art that multiple remote data access operations with small data volumes waste more overhead on data request packets, resulting in low transmission efficiency, and improves link utilization efficiency.

可选的,如图15所示,所述处理单元包括:Optionally, as shown in Figure 15, the processing unit includes:

第一标识模块151,用于将所述合并包标识置为预定值,所述预定值指示所述请求包为所述至少两个子请求包组合的合并包;The first identification module 151 is configured to set the combined package identifier to a predetermined value, the predetermined value indicating that the request package is a combined package of the at least two sub-request packages;

第二标识模块152,用于获取子请求包的个数,将所述个数写入所述子请求包个数标识中。The second identification module 152 is configured to obtain the number of sub-request packets, and write the number into the identifier of the number of sub-request packets.

可选的,如图16所示,所述判断单元包括:Optionally, as shown in Figure 16, the judging unit includes:

第一获取模块161,用于获取各个待发送请求包中携带的目的节点标识;The first obtaining module 161 is used to obtain the destination node identification carried in each request packet to be sent;

第一判断模块162,用于判断所述各个待发送请求包的目的节点标识是否相同;The first judging module 162 is used to judge whether the destination node identifiers of the request packets to be sent are the same;

所述处理单元还包括:The processing unit also includes:

第三标识模块163,用于提取所述子请求包中的目的节点标识,并将所述目的节点标识置于所述合并请求包的公共包头中。The third identification module 163 is configured to extract the destination node identifier in the sub-request packet, and place the destination node identifier in the common header of the merge request packet.

可选的,如图17所示,所述判断单元包括:Optionally, as shown in Figure 17, the judging unit includes:

第二获取模块171,用于获取各个待发送请求包中携带的目的节点内存地址;The second obtaining module 171 is used to obtain the memory address of the destination node carried in each request packet to be sent;

第一查找模块172,用于根据所述目的节点内存地址,在地址归属表中查找所述目的节点内存地址归属的目的节点标识,所述地址归属表为目的节点内存地址与目的节点标识的对应关系表;The first search module 172 is configured to search the address attribution table for the destination node identifier to which the destination node memory address belongs according to the destination node memory address, and the address attribution table is the correspondence between the destination node memory address and the destination node identifier Relational tables;

第二判断模块173,用于判断所述各个待发送请求包的目的节点标识是否相同。The second judging module 173 is configured to judge whether the destination node identifiers of the request packets to be sent are the same.

可选的,所述处理单元得到的所述合并请求包中包括的子请求包包括写请求子包和/或读请求子包,写请求子包包头中包括识别所述写请求子包的写请求标识,所述写请求子包中的写请求信息包括待写入所述目的节点的数据以及待写入的所述目的节点内存地址,读请求子包包头中包括识别所述读请求子包的读请求标识,所述读请求子包中的读请求信息包括待读取数据所处的所述目的节点内存地址,如图18所示,所述装置还包括:Optionally, the sub-request package included in the merge request package obtained by the processing unit includes a write request sub-packet and/or a read request sub-packet, and the write request sub-packet header includes a write request identifying the write request sub-packet. Request identification, the write request information in the write request subpackage includes the data to be written to the destination node and the memory address of the destination node to be written, and the header of the read request subpackage includes a The read request identifier, the read request information in the read request subpackage includes the memory address of the destination node where the data to be read is located, as shown in Figure 18, the device also includes:

接收单元181,用于接收所述目的节点发送的写请求响应消息,所述写请求响应消息中包含写请求成功的所述写请求子包对应的写请求标识;和/或,用于接收所述目的节点发送的读请求响应消息,所述读请求响应消息中包含读请求成功的所述读请求子包对应的读请求标识,以及读取的有效载荷,所述有效载荷为所述读请求子包中远程内存地址对应的数据。The receiving unit 181 is configured to receive a write request response message sent by the destination node, where the write request response message includes a write request identifier corresponding to the write request subpacket whose write request is successful; and/or, used to receive the Describe the read request response message sent by the destination node, the read request response message includes the read request identifier corresponding to the read request subpacket for which the read request is successful, and the read payload, the payload is the read request The data corresponding to the remote memory address in the subpackage.

可选的,如图19所示,所述判断单元还包括:Optionally, as shown in Figure 19, the judging unit further includes:

第二查找模块191,用于根据所述各个待发送请求包对应的目的节点标识,在路由表中查找所述目的节点标识对应的路由端口,所述路由表包含所述目的节点标识对应的路由端口,所述路由端口为所述待发送请求包到达所述目的节点的路径上的端口;The second search module 191 is configured to search the routing table for the routing port corresponding to the destination node ID according to the destination node ID corresponding to each request packet to be sent, and the routing table includes the route corresponding to the destination node ID port, the routing port is a port on the path of the request packet to be sent to the destination node;

第三判断模块192,用于判断所述各个待发送请求包的路由端口是否相同。The third judging module 192 is configured to judge whether the routing ports of the request packets to be sent are the same.

相应地,本发明实施例还提供一种内存数据的读写处理装置20,所述内存数据的读写处理装置20可以存在于计算节点中,也可以就是一个计算节点,如图20所示,所述装置包括接收单元201、判断单元202、确定单元203、提取单元204和处理单元205。Correspondingly, the embodiment of the present invention also provides a memory data read-write processing device 20, and the memory data read-write processing device 20 may exist in a computing node, or may be a computing node, as shown in FIG. 20 , The device includes a receiving unit 201 , a judging unit 202 , a determining unit 203 , an extracting unit 204 and a processing unit 205 .

接收单元201,用于接收请求包;A receiving unit 201, configured to receive a request packet;

判断单元202,用于判断接收的请求包中是否携带合并包标识,所述合并包标识用于指示所述请求包为至少两个子请求包组合的合并请求包,所述子请求包包括:读请求子包,和/或写请求子包;The judging unit 202 is configured to judge whether the received request packet carries a merged packet identifier, the merged packet identifier is used to indicate that the request packet is a merged request packet composed of at least two sub-request packets, and the sub-request packet includes: read request subpackage, and/or write request subpackage;

确定单元203,用于当所述请求包中携带合并包标识时,确定所述请求包为合并请求包,所述合并请求包中包括公共包头和子请求包,所述公共包头中包含合并包标识、子请求包个数标识和源节点标识,所述子请求包个数标识用于指示所述合并请求包携带的子请求包的个数,所述子请求包包含子请求包包头和子请求信息;A determining unit 203, configured to determine that the request package is a merge request package when the request package carries a merge package identifier, the merge request package includes a public header and a sub-request package, and the common header includes a merge package identifier , a sub-request packet number identifier and a source node identifier, the sub-request packet number identifier is used to indicate the number of sub-request packets carried by the merge request packet, and the sub-request packet includes a sub-request packet header and sub-request information ;

提取单元204,用于根据所述合并请求包中携带的子请求包个数标识和每个子请求包包头,提取所述合并请求包中与所述子请求包个数标识对应个数的子请求包;Extraction unit 204, configured to extract the number of sub-requests corresponding to the number of sub-request packets in the merge request packet according to the number of sub-request packets carried in the merge request packet and the header of each sub-request packet Bag;

处理单元205,用于根据所述每个子请求包包头和子请求信息,处理对应的子请求包。The processing unit 205 is configured to process the corresponding sub-request packet according to the header of each sub-request packet and the sub-request information.

本发明实施例提供的一种内存数据的读写处理装置,判断接收的请求包中是否携带合并包标识,当所述请求包中携带合并包标识时,确定所述请求包为合并请求包,然后根据所述合并请求包中携带的子请求包个数标识和每个子请求包包头,提取所述合并请求包中与所述子请求包个数标识对应个数的子请求包,最终根据所述每个子请求包包头和子请求信息,处理对应的子请求包。本发明实施例解决了现有技术中多个数据量较小的远程数据访存操作浪费较多的开销在数据请求包上,导致传输效率低下的问题,提高了链路的利用效率。An embodiment of the present invention provides a device for reading and writing memory data, which determines whether the received request packet carries a merged package identifier, and when the request packet carries the merged packet identifier, determines that the request packet is a merged request packet, Then according to the number of sub-request packets carried in the merge request packet and the header of each sub-request packet, extract the sub-request packets corresponding to the number of sub-request packets in the merge request packet, and finally according to the Describe the header and sub-request information of each sub-request packet, and process the corresponding sub-request packet. The embodiment of the present invention solves the problem in the prior art that multiple remote data access operations with small data volumes waste more overhead on data request packets, resulting in low transmission efficiency, and improves link utilization efficiency.

可选的,如图21所示,所述处理单元包括:Optionally, as shown in Figure 21, the processing unit includes:

第一处理模块211,用于根据写请求子包包头中的写请求标识、所述写请求子包的写请求信息中的待写入数据以及待写入的目的节点内存地址,将所述待写入数据写入所述目的节点内存地址;The first processing module 211 is configured to, according to the write request identifier in the header of the write request sub-packet, the data to be written in the write request information of the write request sub-packet, and the memory address of the destination node to be written, write the data to be written Writing data into the memory address of the destination node;

第二处理模块212,用于根据读请求子包包头中的读请求标识,以及所述读请求子包的读请求信息中的待读取数据所处的目的节点内存地址,在所述目的节点内存地址中读取所述待读取数据。The second processing module 212 is configured to, according to the read request identifier in the header of the read request sub-packet and the memory address of the destination node where the data to be read in the read request information of the read request sub-packet is located, on the destination node The data to be read is read from the memory address.

可选的,如图22所示,所述装置还包括:Optionally, as shown in Figure 22, the device further includes:

标识写入单元221,用于将所述源节点标识写入每个子请求包的子请求包包头中,以便于所述目的节点向所述源节点发送响应消息。The identifier writing unit 221 is configured to write the source node identifier into the sub-request packet header of each sub-request packet, so that the destination node sends a response message to the source node.

可选的,所述判断单元,还用于判断各个待发送的响应消息对应的源节点标识是否相同;Optionally, the judging unit is further configured to judge whether the source node identifiers corresponding to the response messages to be sent are the same;

所述处理单元,还用于将具有相同源节点标识的所述待发送的响应消息作为子响应消息,打包为一个合并响应消息包,所述合并响应消息包中包括写请求子响应消息和/或读请求子响应消息;The processing unit is further configured to pack the to-be-sent response messages with the same source node identifier as sub-response messages into a combined response message package, the combined response message package including the write request sub-response message and/or or read request sub-response message;

如图23所示,所述装置还包括:As shown in Figure 23, the device also includes:

发送单元231,用于将所述合并响应消息包发送给所述源节点标识对应的源节点。The sending unit 231 is configured to send the combined response message packet to the source node corresponding to the source node identifier.

可选的,当所述目的节点为路由端口时,所述处理单元,还用于提取所述合并请求包的公共包头中的源节点标识,写入每个子请求包的包头中。Optionally, when the destination node is a routing port, the processing unit is further configured to extract the source node identifier in the common header of the merge request packet, and write it into the header of each sub-request packet.

上述装置14和装置20的操作过程,参见上述内存数据的读写处理方法的处理过程。For the operation process of the above-mentioned device 14 and device 20, refer to the processing process of the above-mentioned method for reading and writing memory data.

上述图14至图19所示的内存数据的读写处理装置可基于计算机或者其他网络设备的硬件结构来实现,如图24所示,内存数据的读写处理装置24的硬件结构包括存储器241、收发器242、处理器243和总线244。The above-mentioned reading and writing processing device for memory data shown in FIGS. 14 to 19 can be realized based on the hardware structure of a computer or other network equipment. As shown in FIG. 24 , the hardware structure of the reading and writing processing device 24 for memory data includes a memory 241, Transceiver 242 , processor 243 and bus 244 .

其中,处理器243、存储器241和收发器242通过总线244连接。Wherein, the processor 243 , the memory 241 and the transceiver 242 are connected through a bus 244 .

存储器241可以是只读存储器(Read Only Memory,ROM),静态存储设备,动态存储设备或者随机存取存储器(Random Access Memory,RAM)。存储器241可以存储操作系统和其他应用程序的指令以及应用数据。存储器241中存储的指令由处理器243来运行执行。The memory 241 may be a read only memory (Read Only Memory, ROM), a static storage device, a dynamic storage device or a random access memory (Random Access Memory, RAM). The memory 241 may store instructions for an operating system and other application programs as well as application data. The instructions stored in the memory 241 are executed by the processor 243 .

本发明实施例中存储器241可用于存储实现图14至图19所示实施例中各功能单元的指令。In the embodiment of the present invention, the memory 241 may be used to store instructions for implementing each functional unit in the embodiments shown in FIG. 14 to FIG. 19 .

收发器242用来实现内存数据的读写处理装置24与其他设备的通信。The transceiver 242 is used to realize the communication between the memory data read-write processing device 24 and other devices.

本发明实施例中,收发器242用于发送合并请求包和接收响应消息。In the embodiment of the present invention, the transceiver 242 is used to send a merge request packet and receive a response message.

处理器243可以采用通用的中央处理器(Central Processing Unit,CPU),微处理器,应用专用集成电路(Application SpecificIntegrated Circuit,ASIC),或者一个或多个集成电路,用于执行相关程序。The processor 243 may adopt a general-purpose central processing unit (Central Processing Unit, CPU), a microprocessor, an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits for executing related programs.

本发明实施例中,处理器243用于执行存储器241中的指令,具体执行:In the embodiment of the present invention, the processor 243 is used to execute the instructions in the memory 241, specifically:

获取各个待发送请求包,所述待发送请求包包括:读请求包,和/或写请求包;Obtaining each request packet to be sent, the request packet to be sent includes: a read request packet, and/or a write request packet;

解析所述各个待发送请求包的目的节点标识,并判断所述各个待发送请求包的目的节点标识是否相同;Analyzing the destination node identifiers of the respective request packets to be sent, and judging whether the destination node identifiers of the respective request packets to be sent are the same;

将所述具有相同目的节点标识的至少两个待发送请求包分别作为子请求包,打包为一个合并请求包,所述合并请求包中包括公共包头和至少两个子请求包,所述公共包头中包含合并包标识、子请求包个数标识和源节点标识,所述合并包标识用于指示所述请求包为所述至少两个子请求包组合的合并包,所述子请求包个数标识用于指示所述合并请求包携带的子请求包的个数,所述子请求包包含子请求包包头和子请求信息;The at least two request packets to be sent with the same destination node identifier are respectively used as sub-request packets, and packaged into a merge request packet, and the merge request packet includes a public header and at least two sub-request packets, and the public header includes Contains a combined package identifier, a sub-request package number identifier and a source node identifier, the combined package identifier is used to indicate that the request package is a combined package of the at least two sub-request packages, and the sub-request package number identifier is used In order to indicate the number of sub-request packets carried by the merge request packet, the sub-request packet includes a sub-request packet header and sub-request information;

将所述合并请求包通过收发器242发送给所述目的节点标识对应的目的节点,所述合并请求包用于指示所述目的节点对所述目的节点的内存数据进行读和/或写操作。The merge request packet is sent to the destination node corresponding to the destination node identifier through the transceiver 242, and the merge request packet is used to instruct the destination node to perform read and/or write operations on memory data of the destination node.

本发明实施例提供的一种内存数据的读写处理装置,获取各个待发送请求包,并解析所述各个待发送请求包的目的节点标识,判断所述各个待发送请求包的目的节点标识是否相同,然后将所述具有相同目的节点标识的至少两个待发送请求包分别作为子请求包,打包为一个合并请求包,最终将所述合并请求包发送给所述目的节点标识对应的目的节点,所述合并请求包用于指示所述目的节点对所述目的节点的内存数据进行读和/或写操作。本发明实施例解决了现有技术中多个数据量较小的远程数据访存操作浪费较多的开销在数据请求包上,导致传输效率低下的问题,提高了链路的利用效率。A read-write processing device for memory data provided by an embodiment of the present invention obtains each request packet to be sent, and analyzes the destination node identifier of each request packet to be sent, and judges whether the destination node identifier of each request packet to be sent is The same, then the at least two request packets to be sent with the same destination node identifier are respectively used as sub-request packets, packaged into a merge request packet, and finally the merge request packet is sent to the destination node corresponding to the destination node identifier , the merge request packet is used to instruct the destination node to perform read and/or write operations on memory data of the destination node. The embodiment of the present invention solves the problem in the prior art that multiple remote data access operations with small data volumes waste more overhead on data request packets, resulting in low transmission efficiency, and improves link utilization efficiency.

其中,处理器243中的具体处理过程可参考方法实施例部分以及图14至图19所示的装置实施例部分,这里不再赘述。Wherein, for the specific processing process in the processor 243, reference may be made to the method embodiment part and the device embodiment part shown in FIG. 14 to FIG. 19 , which will not be repeated here.

总线244可包括一通路,在内存数据的读写处理装置各个部件(例如处理器243、存储器241和收发器242)之间传送信息。The bus 244 may include a path for transferring information between various components of the processing device (eg, processor 243 , memory 241 , and transceiver 242 ) for reading and writing data in memory.

上述图20至图23所示的内存数据的读写处理装置均可基于计算机的硬件结构来实现,如图25所示,内存数据的读写处理装置25的硬件结构包括存储器251、收发器252,处理器253和总线254。The read-write processing device of memory data shown in above-mentioned Fig. 20 to Fig. 23 all can realize based on the hardware structure of computer, as shown in Figure 25, the hardware structure of the read-write processing device 25 of memory data comprises memory 251, transceiver 252 , processor 253 and bus 254.

其中,处理器253、存储器251和收发器252通过总线254通信连接。Wherein, the processor 253 , the memory 251 and the transceiver 252 are communicatively connected through the bus 254 .

存储器251可以是只读存储器(Read Only Memory,ROM),静态存储设备,动态存储设备或者随机存取存储器(Random Access Memory,RAM)。存储器251可以存储操作系统和其他应用程序的指令以及应用数据。存储器251中存储的指令由处理器253来运行执行。The memory 251 may be a read only memory (Read Only Memory, ROM), a static storage device, a dynamic storage device or a random access memory (Random Access Memory, RAM). The memory 251 may store instructions for an operating system and other application programs as well as application data. The instructions stored in the memory 251 are executed by the processor 253 .

本发明实施例中存储器251可用于存储实现图20至图23所示实施例中各功能单元的指令。In the embodiment of the present invention, the memory 251 may be used to store instructions for implementing each functional unit in the embodiments shown in FIG. 20 to FIG. 23 .

收发器252用来实现内存数据的读写处理装置25与其他设备之间的通信。The transceiver 252 is used to realize the communication between the memory data reading and writing processing device 25 and other devices.

本发明实施例中,收发器252用于接收合并请求包和发送响应消息。In the embodiment of the present invention, the transceiver 252 is used to receive a merge request packet and send a response message.

处理器253可以采用通用的中央处理器(Central Processing Unit,CPU),微处理器,应用专用集成电路(Application Specific Integrated Circuit,ASIC),或者一个或多个集成电路,用于执行相关程序。The processor 253 may adopt a general-purpose central processing unit (Central Processing Unit, CPU), a microprocessor, an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits for executing related programs.

本发明实施例中,处理器253用于执行存储器251中的指令,具体执行:In the embodiment of the present invention, the processor 253 is used to execute the instructions in the memory 251, specifically:

通过收发器252接收请求包;Receive the request packet through the transceiver 252;

判断接收的请求包中是否携带合并包标识,所述合并包标识用于指示所述请求包为至少两个子请求包组合的合并请求包,所述子请求包包括:读请求子包,和/或写请求子包;Judging whether the received request packet carries a combined package identifier, the combined package identifier is used to indicate that the request package is a combined request package composed of at least two sub-request packages, the sub-request package includes: a read request sub-packet, and/ Or write request subpackage;

当所述请求包中携带合并包标识时,确定所述请求包为合并请求包,所述合并请求包中包括公共包头和子请求包,所述公共包头中包含合并包标识、子请求包个数标识和源节点标识,所述子请求包个数标识用于指示所述合并请求包携带的子请求包的个数,所述子请求包包含子请求包包头和子请求信息;When the request package carries a merge package identifier, it is determined that the request package is a merge request package, and the merge request package includes a public header and a sub-request package, and the public header includes a merge package identifier and the number of sub-request packages An identifier and a source node identifier, the identifier of the number of sub-request packets is used to indicate the number of sub-request packets carried by the merge request packet, and the sub-request packets include sub-request packet headers and sub-request information;

根据所述合并请求包中携带的子请求包个数标识和每个子请求包包头,提取所述合并请求包中与所述子请求包个数标识对应个数的子请求包;According to the number of sub-request packets carried in the merge request packet and the header of each sub-request packet, extracting the number of sub-request packets corresponding to the number of sub-request packets in the merge request packet;

根据所述每个子请求包包头和子请求信息,处理对应的子请求包。According to the header of each sub-request packet and the sub-request information, the corresponding sub-request packet is processed.

本发明实施例提供的一种内存数据的读写处理装置,判断接收的请求包中是否携带合并包标识,当所述请求包中携带合并包标识时,确定所述请求包为合并请求包,然后根据所述合并请求包中携带的子请求包个数标识和每个子请求包包头,提取所述合并请求包中与所述子请求包个数标识对应个数的子请求包,最终根据所述每个子请求包包头和子请求信息,处理对应的子请求包。本发明实施例解决了现有技术中多个数据量较小的远程数据访存操作浪费较多的开销在数据请求包上,导致传输效率低下的问题,提高了链路的利用效率。An embodiment of the present invention provides a device for reading and writing memory data, which determines whether the received request packet carries a merged package identifier, and when the request packet carries the merged packet identifier, determines that the request packet is a merged request packet, Then according to the number of sub-request packets carried in the merge request packet and the header of each sub-request packet, extract the sub-request packets corresponding to the number of sub-request packets in the merge request packet, and finally according to the Describe the header and sub-request information of each sub-request packet, and process the corresponding sub-request packet. The embodiment of the present invention solves the problem in the prior art that multiple remote data access operations with small data volumes waste more overhead on data request packets, resulting in low transmission efficiency, and improves link utilization efficiency.

其中,处理器253中的具体处理过程可参考方法实施例部分以及图20至图23所示的装置实施例部分,这里不再赘述。Wherein, for the specific processing process in the processor 253, reference may be made to the method embodiment part and the device embodiment part shown in FIG. 20 to FIG. 23 , which will not be repeated here.

总线254可包括一通路,在内存数据的读写处理装置各个部件(例如处理器253、存储器251和收发器252)之间传送信息。The bus 254 may include a path for transferring information between various components of the processing device (eg, processor 253 , memory 251 , and transceiver 252 ) for reading and writing data in memory.

所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and brevity of description, only the division of the above-mentioned functional modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional modules according to needs. The internal structure of the device is divided into different functional modules to complete all or part of the functions described above. For the specific working process of the above-described system, device, and unit, reference may be made to the corresponding process in the foregoing method embodiments, and details are not repeated here.

在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed system, device and method can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be Incorporation may either be integrated into another system, or some features may be omitted, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.

所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.

所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器(processor)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the essence of the technical solution of the present invention 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 several instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (processor) execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk, and other media that can store program codes. .

以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以所述权利要求的保护范围为准。The above is only a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Anyone skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present invention. Should be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be determined by the protection scope of the claims.

Claims (22)

1.一种内存数据的读写处理方法,其特征在于,包括:1. A method for reading and writing processing of memory data, characterized in that, comprising: 获取各个待发送请求包,所述待发送请求包包括:读请求包,和/或写请求包;Obtaining each request packet to be sent, the request packet to be sent includes: a read request packet, and/or a write request packet; 解析所述各个待发送请求包的目的节点标识,并判断所述各个待发送请求包的目的节点标识是否相同;Analyzing the destination node identifiers of the respective request packets to be sent, and judging whether the destination node identifiers of the respective request packets to be sent are the same; 将所述具有相同目的节点标识的至少两个待发送请求包分别作为子请求包,打包为一个合并请求包,所述合并请求包中包括公共包头和至少两个子请求包,所述公共包头中包含合并包标识、子请求包个数标识和源节点标识,所述合并包标识用于指示所述请求包为所述至少两个子请求包组合的合并包,所述子请求包个数标识用于指示所述合并请求包携带的子请求包的个数,所述子请求包包含子请求包包头和子请求信息;The at least two request packets to be sent with the same destination node identifier are respectively used as sub-request packets, and packaged into a merge request packet, and the merge request packet includes a public header and at least two sub-request packets, and the public header includes Contains a merged package identifier, a sub-request package number identifier and a source node identifier, the merged package identifier is used to indicate that the request package is a combined package of the at least two sub-request packages, and the sub-request package number identifier is used In order to indicate the number of sub-request packets carried by the merge request packet, the sub-request packet includes a sub-request packet header and sub-request information; 将所述合并请求包发送给所述目的节点标识对应的目的节点,所述合并请求包用于指示所述目的节点对所述目的节点的内存数据进行读和/或写操作。Sending the merge request packet to the destination node corresponding to the destination node identifier, where the merge request packet is used to instruct the destination node to perform read and/or write operations on the memory data of the destination node. 2.根据权利要求1所述的内存数据的读写处理方法,其特征在于,所述打包为一个合并请求包包括:2. The method for reading and writing processing of memory data according to claim 1, wherein said packaging as a merge request package comprises: 将所述合并包标识置为预定值,所述预定值指示所述请求包为所述至少两个子请求包组合的合并包;Setting the combined package identifier to a predetermined value, the predetermined value indicating that the request package is a combined package of the at least two sub-request packages; 获取子请求包的个数,将所述个数写入所述子请求包个数标识中。Obtain the number of sub-request packets, and write the number into the number identifier of the sub-request packets. 3.根据权利要求1或2所述的内存数据的读写处理方法,其特征在于,所述解析所述各个待发送请求包的目的节点标识,并判断所述各个待发送请求包的目的节点标识是否相同包括:3. The method for reading and writing processing of memory data according to claim 1 or 2, characterized in that, the parsing of the destination node identification of each request packet to be sent, and judging the destination node of each request packet to be sent Whether the identification is the same includes: 获取各个待发送请求包中携带的目的节点标识;Obtain the destination node identifier carried in each request packet to be sent; 判断所述各个待发送请求包的目的节点标识是否相同;Judging whether the destination node identifiers of the respective request packets to be sent are the same; 所述打包为一个合并请求包包括:The packages packaged as a merge request include: 提取所述子请求包中的目的节点标识,并将所述目的节点标识置于所述合并请求包的公共包头中。Extracting the target node identifier in the sub-request package, and placing the target node identifier in the common header of the merge request package. 4.根据权利要求1或2所述的内存数据的读写处理方法,其特征在于,所述解析所述各个待发送请求包的目的节点标识,并判断所述各个待发送请求包的目的节点标识是否相同包括:4. The method for reading and writing processing of memory data according to claim 1 or 2, characterized in that, the parsing of the destination node identification of each request packet to be sent, and judging the destination node of each request packet to be sent Whether the identification is the same includes: 获取各个待发送请求包中携带的目的节点内存地址;Obtain the memory address of the destination node carried in each request packet to be sent; 根据所述目的节点内存地址,在地址归属表中查找所述目的节点内存地址归属的目的节点标识,所述地址归属表为目的节点内存地址与目的节点标识的对应关系表;According to the memory address of the destination node, look up the destination node identification to which the memory address of the destination node belongs in the address attribution table, where the address attribution table is a correspondence table between the memory address of the destination node and the destination node identification; 判断所述各个待发送请求包的目的节点标识是否相同。It is judged whether the identifiers of the destination nodes of the request packets to be sent are the same. 5.根据权利要求3所述的内存数据的读写处理方法,其特征在于,所述子请求包包括写请求子包和/或读请求子包,写请求子包包头中包括识别所述写请求子包的写请求标识,所述写请求子包中的写请求信息包括待写入所述目的节点的数据以及待写入的所述目的节点内存地址,读请求子包包头中包括识别所述读请求子包的读请求标识,所述读请求子包中的读请求信息包括待读取数据所处的所述目的节点内存地址,所述方法还包括:5. The method for reading and writing processing of memory data according to claim 3, wherein the sub-request package includes a write request sub-packet and/or a read request sub-packet, and the write request sub-packet header includes a The write request identifier of the request subpackage, the write request information in the write request subpackage includes the data to be written to the destination node and the memory address of the destination node to be written, and the header of the read request subpackage includes the identification Describe the read request identifier of the read request subpackage, the read request information in the read request subpackage includes the memory address of the destination node where the data to be read is located, and the method further includes: 接收所述目的节点发送的写请求响应消息,所述写请求响应消息中包含写请求成功的所述写请求子包对应的写请求标识;和/或,Receive a write request response message sent by the destination node, where the write request response message includes a write request identifier corresponding to the write request subpacket whose write request is successful; and/or, 接收所述目的节点发送的读请求响应消息,所述读请求响应消息中包含读请求成功的所述读请求子包对应的读请求标识,以及读取的有效载荷,所述有效载荷为所述读请求子包中远程内存地址对应的数据。Receive the read request response message sent by the destination node, the read request response message includes the read request identifier corresponding to the read request subpacket with a successful read request, and the read payload, the payload is the Read the data corresponding to the remote memory address in the request subpacket. 6.根据权利要求1、2、5任一项所述的内存数据的读写处理方法,其特征在于,所述解析所述各个待发送请求包的目的节点标识,并判断所述各个待发送请求包的目的节点标识是否相同包括:6. The method for reading and writing processing of memory data according to any one of claims 1, 2, and 5, characterized in that, the parsing of the destination node identifiers of each of the request packets to be sent, and judging that each of the request packets to be sent Whether the destination node IDs of the request packets are the same includes: 根据所述各个待发送请求包对应的目的节点标识,在路由表中查找所述目的节点标识对应的路由端口,所述路由表包含所述目的节点标识对应的路由端口,所述路由端口为所述待发送请求包到达所述目的节点的路径上的端口;According to the destination node identifier corresponding to each request packet to be sent, the routing port corresponding to the destination node identifier is searched in the routing table, and the routing table includes the routing port corresponding to the destination node identifier, and the routing port is the routing port corresponding to the destination node identifier. Describe the port on the path where the request packet to be sent reaches the destination node; 判断所述各个待发送请求包的路由端口是否相同。It is judged whether the routing ports of the request packets to be sent are the same. 7.一种内存数据的读写处理方法,其特征在于,包括:7. A method for reading and writing data in memory, comprising: 接收请求包;Receive request packet; 判断接收的请求包中是否携带合并包标识,所述合并包标识用于指示所述请求包为至少两个子请求包组合的合并请求包,所述子请求包包括:读请求子包,和/或写请求子包;Judging whether the received request packet carries a combined package identifier, the combined package identifier is used to indicate that the request package is a combined request package composed of at least two sub-request packages, the sub-request package includes: a read request sub-packet, and/ Or write request subpackage; 当所述请求包中携带合并包标识时,确定所述请求包为合并请求包,所述合并请求包中包括公共包头和子请求包,所述公共包头中包含合并包标识、子请求包个数标识和源节点标识,所述子请求包个数标识用于指示所述合并请求包携带的子请求包的个数,所述子请求包包含子请求包包头和子请求信息;When the request package carries a merge package identifier, it is determined that the request package is a merge request package, and the merge request package includes a public header and a sub-request package, and the public header includes a merge package identifier and the number of sub-request packages An identifier and a source node identifier, the identifier of the number of sub-request packets is used to indicate the number of sub-request packets carried by the merge request packet, and the sub-request packets include sub-request packet headers and sub-request information; 根据所述合并请求包中携带的子请求包个数标识和每个子请求包包头,提取所述合并请求包中与所述子请求包个数标识对应个数的子请求包;According to the number of sub-request packets carried in the merge request packet and the header of each sub-request packet, extracting the number of sub-request packets corresponding to the number of sub-request packets in the merge request packet; 根据所述每个子请求包包头和子请求信息,处理对应的子请求包。According to the header of each sub-request packet and the sub-request information, the corresponding sub-request packet is processed. 8.根据权利要求7所述的内存数据的读写处理方法,其特征在于,所述根据所述每个子请求包包头和子请求信息,处理对应的子请求包包括:8. The method for reading and writing processing of memory data according to claim 7, wherein, according to said each sub-request packet header and sub-request information, processing a corresponding sub-request packet includes: 根据写请求子包包头中的写请求标识、所述写请求子包的写请求信息中的待写入数据以及待写入的目的节点内存地址,将所述待写入数据写入所述目的节点内存地址;和/或,Write the data to be written into the destination according to the write request identifier in the header of the write request subpacket, the data to be written in the write request information of the write request subpacket, and the memory address of the destination node to be written. node memory address; and/or, 根据读请求子包包头中的读请求标识,以及所述读请求子包的读请求信息中的待读取数据所处的目的节点内存地址,在所述目的节点内存地址中读取所述待读取数据。According to the read request identifier in the header of the read request sub-packet and the memory address of the destination node where the data to be read in the read request information of the read request sub-packet is located, read the data to be read in the memory address of the destination node read data. 9.根据权利要求8所述的内存数据的读写处理方法,其特征在于,在所述提取所述合并请求包中与所述子请求包个数标识对应个数的子请求包之后,还包括:9. The method for reading and writing processing of memory data according to claim 8, characterized in that, after the sub-request packets corresponding to the number of sub-request packets identified in the merge request packet are extracted, further include: 将所述源节点标识写入每个子请求包的子请求包包头中,以便于所述目的节点向所述源节点发送响应消息。The source node identifier is written into the sub-request packet header of each sub-request packet, so that the destination node sends a response message to the source node. 10.根据权利要求9所述的内存数据的读写处理方法,其特征在于,所述目的节点向所述源节点发送响应消息包括:10. The method for reading and writing memory data according to claim 9, wherein the destination node sending a response message to the source node comprises: 判断各个待发送的响应消息对应的源节点标识是否相同;Judging whether the source node identifiers corresponding to the response messages to be sent are the same; 将具有相同源节点标识的所述待发送的响应消息作为子响应消息,打包为一个合并响应消息包,所述合并响应消息包中包括写请求子响应消息和/或读请求子响应消息;Packing the to-be-sent response messages with the same source node identifier as sub-response messages into a combined response message package, the combined response message package includes a write request sub-response message and/or a read request sub-response message; 将所述合并响应消息包发送给所述源节点标识对应的源节点。Send the combined response message packet to the source node corresponding to the source node identifier. 11.根据权利要求7所述的内存数据的读写处理方法,其特征在于,当目的节点为路由端口时,在所述提取所述合并请求包中与所述子请求包个数标识对应个数的子请求包之后,还包括:11. The method for reading and writing processing of memory data according to claim 7, characterized in that, when the destination node is a routing port, in the extraction of the combined request package, the number of sub-request packages corresponding to the sub-request package After the number of subrequest packets, it also includes: 提取所述合并请求包的公共包头中的源节点标识,写入每个子请求包的包头中。Extract the source node identifier in the public header of the merge request package, and write it into the header of each sub-request package. 12.一种内存数据的读写处理装置,其特征在于,包括:12. A device for reading and writing data in memory, comprising: 获取单元,用于获取各个待发送请求包,所述待发送请求包包括:读请求包,和/或写请求包;An acquisition unit, configured to acquire each request packet to be sent, wherein the request packet to be sent includes: a read request packet, and/or a write request packet; 判断单元,用于解析所述各个待发送请求包的目的节点标识,并判断所述各个待发送请求包的目的节点标识是否相同;A judging unit, configured to parse the destination node identifiers of the respective request packets to be sent, and judge whether the destination node identifiers of the respective request packets to be sent are the same; 处理单元,用于将所述具有相同目的节点标识的至少两个待发送请求包分别作为子请求包,打包为一个合并请求包,所述合并请求包中包括公共包头和至少两个子请求包,所述公共包头中包含合并包标识、子请求包个数标识和源节点标识,所述合并包标识用于指示所述请求包为所述至少两个子请求包组合的合并包,所述子请求包个数标识用于指示所述合并请求包携带的子请求包的个数,所述子请求包包含子请求包包头和子请求信息;A processing unit, configured to pack the at least two request packets to be sent with the same destination node identifier as sub-request packets into a combined request package, wherein the combined request package includes a common header and at least two sub-request packages, The public packet header includes a merged package identifier, a sub-request packet number identifier, and a source node identifier, and the merged package identifier is used to indicate that the request package is a combined package of the at least two sub-request packages, and the sub-request The packet number identifier is used to indicate the number of sub-request packets carried by the merge request packet, and the sub-request packets include sub-request packet headers and sub-request information; 发送单元,用于将所述合并请求包发送给所述目的节点标识对应的目的节点,所述合并请求包用于指示所述目的节点对所述目的节点的内存数据进行读和/或写操作。A sending unit, configured to send the merge request packet to a destination node corresponding to the destination node identifier, where the merge request packet is used to instruct the destination node to perform read and/or write operations on the memory data of the destination node . 13.根据权利要求12所述的内存数据的读写处理装置,其特征在于,所述处理单元包括:13. The device for reading and writing processing of memory data according to claim 12, wherein the processing unit comprises: 第一标识模块,用于将所述合并包标识置为预定值,所述预定值指示所述请求包为所述至少两个子请求包组合的合并包;A first identification module, configured to set the combined package identifier to a predetermined value, the predetermined value indicating that the request package is a combined package of the at least two sub-request packages; 第二标识模块,用于获取子请求包的个数,将所述个数写入所述子请求包个数标识中。The second identification module is configured to obtain the number of sub-request packets, and write the number into the identifier of the number of sub-request packets. 14.根据权利要求12或13所述的内存数据的读写处理装置,其特征在于,14. The device for reading and writing memory data according to claim 12 or 13, characterized in that, 所述判断单元包括:The judging unit includes: 第一获取模块,用于获取各个待发送请求包中携带的目的节点标识;The first obtaining module is used to obtain the destination node identification carried in each request packet to be sent; 第一判断模块,用于判断所述各个待发送请求包的目的节点标识是否相同;The first judging module is used to judge whether the destination node identifiers of the request packets to be sent are the same; 所述处理单元还包括:The processing unit also includes: 第三标识模块,用于提取所述子请求包中的目的节点标识,并将所述目的节点标识置于所述合并请求包的公共包头中。The third identification module is configured to extract the destination node identifier in the sub-request package, and place the destination node identifier in the common header of the merge request package. 15.根据权利要求12或13所述的内存数据的读写处理装置,其特征在于,所述判断单元包括:15. The device for reading and writing data in memory according to claim 12 or 13, wherein the judging unit comprises: 第二获取模块,用于获取各个待发送请求包中携带的目的节点内存地址;The second obtaining module is used to obtain the memory address of the destination node carried in each request packet to be sent; 第一查找模块,用于根据所述目的节点内存地址,在地址归属表中查找所述目的节点内存地址归属的目的节点标识,所述地址归属表为目的节点内存地址与目的节点标识的对应关系表;The first search module is used to search the destination node identifier to which the destination node memory address belongs in the address attribution table according to the destination node memory address, and the address attribution table is the corresponding relationship between the destination node memory address and the destination node identifier surface; 第二判断模块,用于判断所述各个待发送请求包的目的节点标识是否相同。The second judging module is configured to judge whether the destination node identifiers of the request packets to be sent are the same. 16.根据权利要求14所述的内存数据的读写处理装置,其特征在于,所述处理单元得到的所述合并请求包中包括的子请求包包括写请求子包和/或读请求子包,写请求子包包头中包括识别所述写请求子包的写请求标识,所述写请求子包中的写请求信息包括待写入所述目的节点的数据以及待写入的所述目的节点内存地址,读请求子包包头中包括识别所述读请求子包的读请求标识,所述读请求子包中的读请求信息包括待读取数据所处的所述目的节点内存地址,所述装置还包括:16. The device for reading and writing memory data according to claim 14, wherein the sub-request packets included in the merge request packet obtained by the processing unit include a write request sub-packet and/or a read request sub-packet , the header of the write request sub-packet includes a write request identifier identifying the write request sub-packet, and the write request information in the write request sub-packet includes the data to be written to the destination node and the destination node to be written memory address, the header of the read request sub-packet includes a read request identifier identifying the read request sub-packet, the read request information in the read request sub-packet includes the memory address of the destination node where the data to be read is located, the The device also includes: 接收单元,用于接收所述目的节点发送的写请求响应消息,所述写请求响应消息中包含写请求成功的所述写请求子包对应的写请求标识;和/或,用于接收所述目的节点发送的读请求响应消息,所述读请求响应消息中包含读请求成功的所述读请求子包对应的读请求标识,以及读取的有效载荷,所述有效载荷为所述读请求子包中远程内存地址对应的数据。A receiving unit, configured to receive a write request response message sent by the destination node, where the write request response message includes a write request identifier corresponding to the write request subpacket whose write request is successful; and/or, used to receive the The read request response message sent by the destination node, the read request response message includes the read request identifier corresponding to the read request subpacket for which the read request is successful, and the read payload, the payload is the read request subpacket The data corresponding to the remote memory address in the packet. 17.根据权利要求12、13、16任一项所述的内存数据的读写处理装置,其特征在于,所述判断单元还包括:17. The device for reading and writing memory data according to any one of claims 12, 13, and 16, wherein the judging unit further comprises: 第二查找模块,用于根据所述各个待发送请求包对应的目的节点标识,在路由表中查找所述目的节点标识对应的路由端口,所述路由表包含所述目的节点标识对应的路由端口,所述路由端口为所述待发送请求包到达所述目的节点的路径上的端口;The second search module is configured to search the routing table for the routing port corresponding to the destination node ID according to the destination node ID corresponding to each request packet to be sent, and the routing table includes the routing port corresponding to the destination node ID , the routing port is a port on the path where the request packet to be sent reaches the destination node; 第三判断模块,用于判断所述各个待发送请求包的路由端口是否相同。The third judging module is used for judging whether the routing ports of the request packets to be sent are the same. 18.一种内存数据的读写处理装置,其特征在于,包括:18. A device for reading and writing data in memory, comprising: 接收单元,用于接收请求包;a receiving unit, configured to receive the request packet; 判断单元,用于判断接收的请求包中是否携带合并包标识,所述合并包标识用于指示所述请求包为至少两个子请求包组合的合并请求包,所述子请求包包括:读请求子包,和/或写请求子包;A judging unit, configured to judge whether the received request packet carries a combined package identifier, the combined package identifier used to indicate that the request package is a combined request package composed of at least two sub-request packages, and the sub-request package includes: a read request subpackage, and/or write request subpackage; 确定单元,用于当所述请求包中携带合并包标识时,确定所述请求包为合并请求包,所述合并请求包中包括公共包头和子请求包,所述公共包头中包含合并包标识、子请求包个数标识和源节点标识,所述子请求包个数标识用于指示所述合并请求包携带的子请求包的个数,所述子请求包包含子请求包包头和子请求信息;A determining unit, configured to determine that the request package is a merge request package when the request package carries a merge package identifier, the merge request package includes a public header and a sub-request package, and the common header includes a merge package identifier, A sub-request packet number identifier and a source node identifier, the sub-request packet number identifier is used to indicate the number of sub-request packets carried by the merge request packet, and the sub-request packet includes a sub-request packet header and sub-request information; 提取单元,用于根据所述合并请求包中携带的子请求包个数标识和每个子请求包包头,提取所述合并请求包中与所述子请求包个数标识对应个数的子请求包;An extracting unit, configured to extract the number of sub-request packets corresponding to the number of sub-request packets in the merge request packet according to the number of sub-request packets carried in the merge request packet and the header of each sub-request packet ; 处理单元,用于根据所述每个子请求包包头和子请求信息,处理对应的子请求包。The processing unit is configured to process the corresponding sub-request packet according to the header of each sub-request packet and the sub-request information. 19.根据权利要求18所述的内存数据的读写处理装置,其特征在于,所述处理单元包括:19. The device for reading and writing processing of memory data according to claim 18, wherein the processing unit comprises: 第一处理模块,用于根据写请求子包包头中的写请求标识、所述写请求子包的写请求信息中的待写入数据以及待写入的目的节点内存地址,将所述待写入数据写入所述目的节点内存地址;The first processing module is configured to write the data to be written according to the write request identifier in the header of the write request subpacket, the data to be written in the write request information of the write request subpacket, and the memory address of the destination node to be written. Incoming data is written to the memory address of the destination node; 第二处理模块,用于根据读请求子包包头中的读请求标识,以及所述读请求子包的读请求信息中的待读取数据所处的目的节点内存地址,在所述目的节点内存地址中读取所述待读取数据。The second processing module is configured to, according to the read request identifier in the header of the read request sub-packet and the memory address of the destination node where the data to be read in the read request information of the read request sub-packet is located, in the memory of the destination node Read the data to be read from the address. 20.根据权利要求19所述的内存数据的读写处理装置,其特征在于,所述装置还包括:20. The device for reading and writing data in memory according to claim 19, wherein the device further comprises: 标识写入单元,用于将所述源节点标识写入每个子请求包的子请求包包头中,以便于所述目的节点向所述源节点发送响应消息。The identifier writing unit is configured to write the source node identifier into the sub-request packet header of each sub-request packet, so that the destination node sends a response message to the source node. 21.根据权利要求20所述的内存数据的读写处理装置,其特征在于,21. The device for reading and writing data in memory according to claim 20, characterized in that: 所述判断单元,还用于判断各个待发送的响应消息对应的源节点标识是否相同;The judging unit is also used to judge whether the source node identifiers corresponding to the response messages to be sent are the same; 所述处理单元,还用于将具有相同源节点标识的所述待发送的响应消息作为子响应消息,打包为一个合并响应消息包,所述合并响应消息包中包括写请求子响应消息和/或读请求子响应消息;The processing unit is further configured to pack the to-be-sent response messages with the same source node identifier as sub-response messages into a combined response message package, the combined response message package including the write request sub-response message and/or or read request sub-response message; 所述装置还包括:The device also includes: 发送单元,用于将所述合并响应消息包发送给所述源节点标识对应的源节点。A sending unit, configured to send the combined response message packet to the source node corresponding to the source node identifier. 22.根据权利要求18所述的内存数据的读写处理装置,其特征在于,当目的节点为路由端口时,所述处理单元,还用于提取所述合并请求包的公共包头中的源节点标识,写入每个子请求包的包头中。22. The device for reading and writing processing of memory data according to claim 18, wherein when the destination node is a routing port, the processing unit is also used to extract the source node in the public header of the merge request packet Identifier, written in the header of each subrequest packet.
CN201310376301.XA 2013-08-26 2013-08-26 The read-write processing method and device of a kind of internal storage data Expired - Fee Related CN104424105B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201310376301.XA CN104424105B (en) 2013-08-26 2013-08-26 The read-write processing method and device of a kind of internal storage data
PCT/CN2014/083873 WO2015027806A1 (en) 2013-08-26 2014-08-07 Read and write processing method and device for memory data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310376301.XA CN104424105B (en) 2013-08-26 2013-08-26 The read-write processing method and device of a kind of internal storage data

Publications (2)

Publication Number Publication Date
CN104424105A CN104424105A (en) 2015-03-18
CN104424105B true CN104424105B (en) 2017-08-25

Family

ID=52585534

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310376301.XA Expired - Fee Related CN104424105B (en) 2013-08-26 2013-08-26 The read-write processing method and device of a kind of internal storage data

Country Status (2)

Country Link
CN (1) CN104424105B (en)
WO (1) WO2015027806A1 (en)

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105117230B (en) * 2015-08-31 2018-08-10 深圳神州数码云科数据技术有限公司 A kind of both-end task processing method
CN108984132A (en) * 2018-08-24 2018-12-11 郑州云海信息技术有限公司 A kind of I O scheduling method and device based on persistence memory file system
CN110865769B (en) * 2018-08-28 2023-06-20 阿里巴巴集团控股有限公司 Method for processing read/write request, network storage system and electronic equipment
CN110166341B (en) * 2019-07-01 2021-08-17 联想(北京)有限公司 Server, server cluster and communication method
CN110677220B (en) * 2019-09-09 2022-06-14 无锡江南计算技术研究所 RDMA (remote direct memory Access) message mechanism based on multi-track redundant response and implementation device thereof
CN111294264B (en) * 2020-02-17 2021-12-24 北京和利时系统集成有限公司 Communication method and device based on Modbus TCP protocol
CN114066707B (en) * 2020-08-07 2025-05-27 平头哥(上海)半导体技术有限公司 General purpose graphics processing system, computing device and distributed system
CN113010186B (en) * 2021-02-05 2023-03-21 武汉联特科技股份有限公司 Firmware and application data integration method and system applied to optical module
CN113535083A (en) * 2021-06-08 2021-10-22 平头哥(上海)半导体技术有限公司 Computer system and computer-implemented method for packaging storage access requests
CN113485950A (en) * 2021-06-22 2021-10-08 上海天数智芯半导体有限公司 System and method for merging and sending PCIe memory write requests
CN113836238B (en) * 2021-09-30 2024-12-17 杭州数梦工场科技有限公司 Batch processing method and device for data commands
CN114579487B (en) * 2022-03-10 2024-12-13 苏州登临科技有限公司 A computing chip, an electronic device, and a data transmission method between computing chips
CN117749751A (en) * 2022-09-15 2024-03-22 中兴通讯股份有限公司 Message processing method, electronic device, and computer-readable storage medium
CN116028232B (en) * 2023-02-27 2023-07-14 浪潮电子信息产业股份有限公司 Cross-cabinet server memory pooling method, device, equipment, server and medium
CN115955437B (en) * 2023-03-14 2023-05-30 苏州浪潮智能科技有限公司 Data transmission method, device, equipment and medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6735679B1 (en) * 1998-07-08 2004-05-11 Broadcom Corporation Apparatus and method for optimizing access to memory
CN102609378A (en) * 2012-01-18 2012-07-25 中国科学院计算技术研究所 Message type internal memory accessing device and accessing method thereof
CN102831018A (en) * 2011-06-15 2012-12-19 塔塔咨询服务有限公司 Low latency FIFO messaging system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8249072B2 (en) * 2009-03-12 2012-08-21 Oracle America, Inc. Scalable interface for connecting multiple computer systems which performs parallel MPI header matching
CN102387206A (en) * 2011-10-20 2012-03-21 镇江睿泰信息科技有限公司 Synthesis method and system of concurrent request of Web service

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6735679B1 (en) * 1998-07-08 2004-05-11 Broadcom Corporation Apparatus and method for optimizing access to memory
CN102831018A (en) * 2011-06-15 2012-12-19 塔塔咨询服务有限公司 Low latency FIFO messaging system
CN102609378A (en) * 2012-01-18 2012-07-25 中国科学院计算技术研究所 Message type internal memory accessing device and accessing method thereof

Also Published As

Publication number Publication date
WO2015027806A1 (en) 2015-03-05
CN104424105A (en) 2015-03-18

Similar Documents

Publication Publication Date Title
CN104424105B (en) The read-write processing method and device of a kind of internal storage data
CN106664290B (en) data transmission method and device of photoelectric hybrid network
CN101882126B (en) Device and method for bridging multiple HT (Hyper Transport) buses to single PCIe (Peripheral Component Interface Express) bus
WO2014135038A1 (en) Packet transmission method and device based on pcie bus
US9866639B2 (en) Communication apparatus, information processor, communication method, and computer-readable storage medium
CN118337889B (en) CXL protocol exchange chip and message processing method
CN102821082A (en) Data transmission method, device and system
CN115102780B (en) Data transmission method, related device, system and computer readable storage medium
CN107145311B (en) A kind of IO data processing method and system
CN106484652A (en) A kind of many queue communication method and system based on NTB hardware
CN114238156A (en) Processing system and method of operating a processing system
CN115827682B (en) Database query acceleration engine device, method and storage medium
CN120225998A (en) System and method for ghost bridging
CN107168903A (en) A kind of non-volatile memory medium
CN104038550B (en) Data communications method and its device, storage system
CN113422792B (en) Data transmission method, device, electronic equipment and computer storage medium
US20090285207A1 (en) System and method for routing packets using tags
CN107329917A (en) A kind of data transmission method and device
WO2025200554A1 (en) Storage device access method and apparatus, storage medium, and electronic device
CN114915499B (en) Data transmission method, related device, system and computer readable storage medium
CN103036815B (en) A kind of information technology and communication technology ICT emerging system
EP3631640B1 (en) Communication between field programmable gate arrays
WO2023097903A1 (en) Message transmission method and apparatus, electronic device, and storage medium
CN107317773B (en) On-chip network communication interface and communication method
CN118555252B (en) Routing method, system, electronic device and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20170825

Termination date: 20200826

CF01 Termination of patent right due to non-payment of annual fee