WO2015027806A1 - Read and write processing method and device for memory data - Google Patents

Read and write processing method and device for memory data Download PDF

Info

Publication number
WO2015027806A1
WO2015027806A1 PCT/CN2014/083873 CN2014083873W WO2015027806A1 WO 2015027806 A1 WO2015027806 A1 WO 2015027806A1 CN 2014083873 W CN2014083873 W CN 2014083873W WO 2015027806 A1 WO2015027806 A1 WO 2015027806A1
Authority
WO
WIPO (PCT)
Prior art keywords
request
sub
packet
request packet
destination node
Prior art date
Application number
PCT/CN2014/083873
Other languages
French (fr)
Chinese (zh)
Inventor
董建波
张立新
侯锐
李晔
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2015027806A1 publication Critical patent/WO2015027806A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/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

Definitions

  • the present invention relates to the field of computer system technologies, and in particular, to a method and apparatus for reading and writing memory data.
  • RDMA Remote Direct Memory Access
  • the data exchange granularity between memory and Cache is a Cache Line with a size of 64 Bytes (bytes) or 128 Bytes, if each Cache Line's data is packed into a request. Packets are sent out.
  • This small-scale data transfer has a certain amount of link bandwidth waste.
  • the packet header of PCIE Peripheral Component Interface Express
  • Embodiments of the present invention provide a method and apparatus for reading and writing memory data, which improves link utilization efficiency.
  • the present invention provides a method for reading and writing memory data, including: acquiring each to-be-sent request packet, where the to-be-sent request packet includes: a read request packet, and/or a write request packet;
  • the at least two to-be-sent request packets having the same destination node identifier are respectively packaged as a sub-request packet, and the merge request packet includes a common header and at least two sub-request packets, where the common header is included.
  • the packaging into a merge request packet includes:
  • the parsing the target node identifiers of the to-be-sent request packets, and determining the to-be-sent requests Whether the destination node identifier of the packet is the same includes:
  • the packaging into a merge request package includes:
  • the parsing the target node identifiers of the to-be-sent request packets, and determining the to-be-sent requests Whether the destination node identifier of the packet is the same includes:
  • the destination node memory address searching, according to the destination node memory address, the destination node identifier of the destination node's memory address in the address attribution table, where the address attribution table is a correspondence table between the destination node memory address and the destination node identifier;
  • the sub-request packet includes a write request sub-packet and/or a read request sub-package
  • the request sub-packet header includes a write request identifier that identifies the write request sub-packet, and the write request information in the write request sub-package includes data to be written to the destination node and a memory address of the destination node to be written.
  • the read request sub-packet header includes a read request identifier that identifies the read request sub-packet, and the read request information in the read request sub-package includes a memory address of the destination node where the data to be read is located, and the method further Includes:
  • the read request response message includes a read request identifier corresponding to the read request sub-package with a successful read request, and a read payload, where the payload is Read the data corresponding to the remote memory address in the request subpackage.
  • And parsing the destination node identifiers of the to-be-sent request packets, and determining whether the destination node identifiers of the to-be-sent request packets are the same include: Determining, according to the destination node identifier corresponding to each to-be-sent request packet, a routing port corresponding to the destination node identifier in the routing table, where the routing table includes a routing port corresponding to the destination node identifier, where the routing port is Determining a port on the path of the sending request packet to the destination node;
  • the present invention provides a method for reading and writing memory data, including: receiving a request packet;
  • the request packet When the request packet carries the merged package identifier, the request packet is determined to be a merge request packet, where the merge request packet includes a common header and a sub-request packet, where the common header includes the merge packet identifier and the number of sub-request packets.
  • the identifier of the sub-request packet 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;
  • Corresponding sub-request packets are processed according to each of the sub-request packet headers and sub-request information.
  • the processing, by the sub-request packet header and sub-request information, processing the corresponding sub-request packet includes:
  • the destination node memory address is read in the destination node memory address Read the data.
  • the source node identifier is written into a sub-request packet header of each sub-request packet such that the destination node sends a response message to the source node.
  • the sending, by the destination node, the response message to the source node includes:
  • the response message to be sent with the same source node identifier is packaged as a sub-response message packet, and the merge response message packet includes a write request sub-response message and/or a read request sub-response message.
  • the destination node when the destination node is a routing port, extracting, in the extracting the request packet, a number of sub-request packets corresponding to the number of the sub-request packets After that, it also includes:
  • the source node identifier in the common header of the merge request packet is extracted and written in the header of each subrequest packet.
  • the present invention provides an apparatus for reading and writing memory data, including: an obtaining unit, configured to acquire each to-be-sent request packet, where the to-be-sent request packet includes: a read request packet, and/or a write request packet;
  • a determining unit configured to parse the destination node identifiers of the to-be-sent request packets, and determine whether the destination node identifiers of the to-be-sent request packets are the same;
  • a processing unit configured to package the at least two to-be-sent request packets having the same destination node identifier as a sub-request packet, and the merge request packet includes a common header and at least two sub-request packets.
  • the common packet header includes a merge packet identifier, a sub-request packet number identifier, and a source node identifier, where the merge packet identifier is used to indicate that the request packet is a merge packet of the at least two sub-request packet combinations, and the sub-request Packet number identifier is used to indicate a number of sub-request packets carried by the merge request packet, where the sub-request packet includes a sub-request packet header 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 .
  • the processing unit includes: a first identifier module, configured to set the merged packet identifier to a predetermined value, where the predetermined value indicates that the request packet is a merged package of at least two sub-request package combinations;
  • the second identifier module is configured to obtain the number of the sub-request packets, and write the number into the sub-request packet number identifier.
  • the determining unit includes:
  • a first obtaining module configured to obtain a destination node identifier carried in each to-be-sent request packet;
  • a first determining module configured to determine whether the destination node identifiers of the to-be-sent request packets are the same;
  • the processing unit further includes:
  • a third identifier module configured to extract a destination node identifier in the sub-request packet, and place the destination node identifier in a common header of the merge request packet.
  • the determining unit includes:
  • a second acquiring module configured to obtain a memory address of the destination node carried in each request packet to be sent
  • a first search module configured to search, according to the destination node memory address, a destination node identifier of the destination node memory address in the address attribution table, where the address attribution table is a correspondence between the destination node memory address and the destination node identifier Table
  • the second determining module is configured to determine whether the destination node identifiers of the to-be-sent request packets are the same.
  • the sub-request packet included in the merge request packet obtained by the processing unit includes writing a request sub-packet and/or a read request sub-package
  • the write request sub-packet header includes a write request identifier for identifying the write request sub-packet
  • the write request information in the write request sub-package includes a write request information to be written to the destination node
  • the read request sub-packet header includes a read request identifier identifying the read request sub-packet
  • the read request information in the read request sub-package includes the data to be read
  • the device further 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 sub-package with a successful write request; and/or, a read request response message sent by the destination node, where the read request response message includes a read request identifier corresponding to the read request sub-package with a successful read request, and a read payload, where the payload is the read requester
  • the determining unit further includes:
  • a second search module configured to search, according to the destination node identifier corresponding to each to-be-sent request packet, a routing port corresponding to the destination node identifier in a routing table, where the routing table includes a routing port corresponding to the destination node identifier
  • the routing port is a port on the path of the to-be-sent request packet to the destination node;
  • the third determining module is configured to determine whether the routing ports of the to-be-sent request packets are the same.
  • a fourth aspect of the present invention provides a memory data read/write processing apparatus, including: a receiving unit, configured to receive a request packet;
  • a determining unit configured to determine whether the received request packet carries a merged package identifier, where the merged package identifier is used to indicate that the request packet is a combined request packet of at least two sub-request packet combinations,
  • the sub-request package includes: a read request sub-package, and/or a write request sub-package;
  • a determining unit configured to: when the request packet carries a merged package identifier, determine that the request packet is a merge request packet, where the merge request packet includes a common header and a subrequest package, where the common header includes a merge packet identifier, a sub-request packet number identifier and a source node identifier, where the sub-request packet number identifier is used to indicate a number of sub-request packets carried by the merge request packet, where the sub-request packet includes a sub-request packet header and sub-request information;
  • An extracting unit configured to extract, according to the number of sub-request packets and the sub-request packet header carried in the merge request packet, a sub-request packet corresponding to the number of the sub-request packet identifiers in the merge request packet ;
  • a processing unit configured to process the corresponding sub-request packet according to each of the sub-request packet header and sub-request information.
  • the processing unit includes: a first processing module, configured to identify, according to a write request identifier in the write request sub-packet header, the write request information of the write request sub-packet The data to be written and the memory address of the destination node to be written, and the data to be written is written into the memory address of the destination node;
  • a second processing module configured to: according to the read request identifier in the read request sub-packet header, and the memory address of the destination node where the data to be read in the read request information of the read request sub-package is located, in the destination node memory The data to be read is read in the address.
  • the device further includes:
  • an identifier writing unit configured to write the source node identifier into a sub-request packet header of each sub-request packet, so that the destination node sends a response message to the source node.
  • the determining unit is further configured to determine whether the source node identifiers corresponding to the respective response messages to be sent are the same;
  • the processing unit is further configured to package the to-be-sent response message with the same source node identifier as a sub-response message, into a merge response message packet, and the merge response message
  • the packet includes a write request sub-response message and/or a read request sub-response message;
  • the device also includes:
  • a sending unit configured to send the merge response message packet to a source node corresponding to the source node identifier.
  • the processing unit is further configured to extract a source node identifier in a common header of the merge request packet, and write each The header of the sub-request package.
  • the source node acquiring each to-be-sent request packet, the to-be-sent request packet includes: a read request packet, and/or a write request packet, and then parsing the And determining, by the target node identifiers of the to-be-sent request packets, the destination node identifiers of the respective to-be-sent request packets are the same, and the at least two to-be-sent request packets having the same destination node identifier are respectively packaged as sub-request packets.
  • 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 that the memory data read/write operation with a small amount of data is small in the prior art, which wastes more overhead on the data request packet, resulting in low transmission efficiency and improves the utilization efficiency of the link.
  • FIG. 1 is a flow chart of a method for reading and writing memory data according to an embodiment of the present invention
  • 2 is a schematic diagram of a read request packet format
  • 3 is a schematic diagram of a write request packet format
  • Figure 4 is a schematic diagram of another read request packet format
  • Figure 5 is a schematic diagram of another write request packet format
  • FIG. 6 is a schematic diagram of a merge write request packet format according to an embodiment of the present invention
  • FIG. 7 is a schematic diagram of a merge read request packet format according to an embodiment of the present invention
  • FIG. 8 is a schematic diagram of a merge provided by an embodiment of the present invention
  • FIG. 9 is a schematic diagram of another merge write request packet format according to an embodiment of the present invention
  • FIG. 10 is a schematic diagram of another merge read request packet format according to an embodiment of the present invention
  • 1 is a schematic diagram of another merging read and write request packet format provided by an embodiment of the present invention
  • FIG. 1 is a flowchart of another method for reading and writing memory data according to an embodiment of the present invention
  • FIG. 13 is a flow chart of still another method for reading and writing memory data according to an embodiment of the present invention.
  • FIG. 14 is a structural diagram of an apparatus for reading and writing memory data according to an embodiment of the present invention.
  • FIG. 15 is a structural diagram of a processing unit in a memory data read/write processing apparatus according to an embodiment of the present invention.
  • FIG. 16 is a structural diagram of another apparatus for reading and writing memory data according to an embodiment of the present invention.
  • FIG. 1 is a structural diagram of a determining unit in a memory data read/write processing apparatus according to an embodiment of the present invention
  • FIG. 18 is a structural diagram of another apparatus for reading and writing memory data according to an embodiment of the present invention.
  • FIG. 19 is a structural diagram of a determining unit in a memory data read/write processing apparatus according to an embodiment of the present invention.
  • FIG. 20 is a structural diagram of still another apparatus for reading and writing memory data according to an embodiment of the present invention
  • FIG. FIG. 2 is a structural diagram of a processing unit in another read/write processing device for memory data according to an embodiment of the present disclosure
  • FIG. 22 is a structural diagram of still another apparatus for reading and writing memory data according to an embodiment of the present invention.
  • FIG. 2 is a structural diagram of another apparatus for reading and writing memory data according to an embodiment of the present invention.
  • 24 is a hardware structural diagram of a device for reading and writing memory data according to an embodiment of the present invention.
  • FIG. 25 is a hardware structural diagram of another apparatus for reading and writing memory data according to an embodiment of the present invention.
  • the embodiment of the present invention provides a memory data read.
  • the write processing method is to combine the requests with the same destination node address to improve the utilization of the link.
  • the execution source source node of the method of the embodiment of the present invention may be a computer node (also referred to as a computing node), as shown in FIG. 1 . As shown, the method includes the following steps:
  • each to-be-sent request packet includes: a read request packet, and/or a write request packet.
  • Each of the to-be-sent request packets acquired by the source node includes a read request packet, and/or a write request packet.
  • the target node identifiers of the to-be-sent request packets are parsed, and the destination node identifiers of the to-be-sent request packets are determined to be the same.
  • step 012 can be implemented in two ways.
  • Manner 1 First, obtain the destination node identifiers carried in each of the to-be-sent request packets, and then determine whether the destination node identifiers of the to-be-sent request packets are the same.
  • the source node before the source node performs the read/write processing of the memory data to the destination node, the source node sends a memory borrowing request to the destination node according to the prior art, and the destination node determines according to the state of the memory. Accepting or rejecting, after the destination node accepts the request of the source node, the destination node sends the allocated memory address and the address length to the source node, where 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 and the destination node identifier and the memory address of the destination node.
  • the request packet 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 a memory address of the destination node, where the destination node identifier And the memory address of the destination node is obtained by the source node by using the address mapping table after obtaining the request that carries the local memory address, as shown in FIG. 2
  • Figure 3 shows the write request packet to be sent.
  • the destination node identifiers carried in the to-be-sent request packets shown in FIG. 2 and/or FIG. 3 are obtained, and the destination node identifiers of the respective to-be-sent request packets are determined to be the same.
  • Manner 2 obtaining a destination node memory address carried in each request packet to be sent; searching for 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 for the purpose a correspondence table between the node memory address and the destination node identifier; determining whether the destination node identifiers of the respective to-be-sent request packets are the same.
  • the PC IE is used as an example to illustrate that the read request packet to be sent is as shown in FIG. 4, and the write request packet to be sent is as shown in FIG. 5, wherein the read request packet and the to-be-sent are sent.
  • the address carried in the write request packet is the destination node memory address, and the destination node identifier of the destination node memory address is searched in the address attribution table, where the address attribution table is a correspondence table between the node memory address and the destination node identifier.
  • the corresponding destination node identifier is 1, and the destination node memory address is When the value is 0H2000-0H2fff, the corresponding destination node ID is 2. When the destination node memory address is 0H3000-0H2fff, the corresponding destination node identifier is 3. After obtaining the memory address of the destination node carried in the to-be-sent request packet, the destination node identifier corresponding to the memory address of the destination node is obtained according to the address attribution table.
  • the read request packet to be sent and The to-be-sent write request packet is in the range of the destination node memory address corresponding to the destination node identifier 1 , and therefore the to-be-sent read request packet and the destination node identifier of the to-be-sent write request packet are the same.
  • the at least two to-be-sent request packets having the same destination node identifier are respectively packaged as a sub-request packet, and the merge request packet includes a common packet header and at least two sub-request packets.
  • the header includes a merge packet identifier, a sub-request packet number identifier, and a source node identifier, where the merge packet identifier is used to indicate that the request packet is a combined packet of the at least two sub-request packets, and the number of the sub-request packets
  • the 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.
  • the time indicates that the request packet is a merge request packet, and includes a number of sub-request packets carried by the merge request packet, which is used when the package request is a merge request packet.
  • 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 a type of the sub-request packet
  • Type and length, where the length is specifically Trans a c t i on Lay Pa cke t (TLP l eng th ).
  • the type is used to distinguish whether the sub-request packet is a write request sub-package or a read request sub-package.
  • the write request sub-packets with the same destination node identifier may be packaged into one merge write request packet, or the read request sub-packets with the same destination node identifier may be packaged into one merge read request packet, or to further improve link utilization.
  • the write request sub-packet and the read request sub-package with the same destination node identifier are packaged into one merge read-write request packet, which is not limited herein.
  • the destination node identifier in the sub-request packet needs to be extracted, and the destination node identifier is placed in the common header of the merge request packet.
  • FIG. 6 for the obtained merge write request packet, as shown in FIG. 7, for the obtained merge read request packet, as shown in FIG. 8, the obtained merge read/write request packet.
  • each sub-request packet in the merge request packet obtained by the second method further includes a request code, which is a code of the source node to the sub-request packet, and is a unique identifier of each sub-request packet.
  • the merging request packet is sent to the destination node corresponding to the destination node identifier, where the merging 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 source node acquires each to-be-sent request packet, and parses the destination node identifier of each to-be-sent request packet, and determines the destination node of each to-be-sent request packet. Whether the identifiers are the same, and then the at least two to-be-sent request packets having the same destination node identifier are respectively packaged as a sub-request packet. And requesting the packet, and finally 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. .
  • the embodiment of the invention solves the problem that the memory data access operation with less data volume is less wasted on the data request packet in the prior art, resulting in low transmission efficiency and improving the utilization efficiency of the link.
  • the embodiment of the present invention further provides a method for reading and writing memory data.
  • the target node of the method 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:
  • the request packet When the request packet carries the merged package identifier, determine that the request packet is a merge request packet, where the merge request packet includes a common header and a subrequest package, where the common header includes a merge package identifier and a subrequest And the number of the sub-request packets is used to indicate the number of sub-request packets carried by the merge request packet, where the sub-request packet includes a sub-request packet header and sub-request information;
  • the common packet header of the merge request packet includes, in addition to the merge packet identifier, a sub-request packet number identifier and a source node identifier, where the sub-request packet number identifier is used for And indicating a number of sub-request packets carried by the merge request packet, where the source node identifier is used to indicate a source node that is sent by the merge request packet.
  • Sub-request packet headers and sub-request information are included in each sub-request packet.
  • the merge request packet may include a write request sub-packet and/or a read request sub-package
  • the write request sub-packet and the read request sub-package may be distinguished according to the format and/or type in the sub-request packet header, thereby The write request sub-packets and read request sub-packets of different requests are processed differently.
  • the payload is written to the memory address of the destination node according to the memory address and payload of the destination node carried in the write request sub-packet; And reading, according to the memory address of the destination node carried in the read request sub-packet, content on the memory address of the destination node, and returning the content to the source node.
  • the destination node determines whether the received request packet carries the merged package identifier, and when the request packet carries the merged package identifier, determining that the request packet is a merge request a packet, and then, according to the number of sub-request packets carried in the merge request packet and each sub-request packet header, extracting a sub-request packet corresponding to the number of the sub-request packet identifiers in the merge request packet, and finally Corresponding sub-request packets are processed according to each of the sub-request packet headers and sub-request information.
  • the embodiment of the present invention solves the problem that the memory data access operation with less data volume is less wasted on the data request packet in the prior art, resulting in low transmission efficiency and improved link utilization efficiency.
  • the embodiment of the present invention can be applied to the RDMA, and the to-be-sent request packets having the same destination node in the memory data of a computing node are packaged and combined, and sent together to the remote computing node corresponding to the destination node, specifically, the local Ca che will The request is sent to the local memory controller, packaged and merged, and then sent to the remote memory controller for unpacking, which will get The request is sent to the remote Cache.
  • a PC IE is taken as an example for description.
  • FIG. 4 is a read request packet format in a standard PC IE
  • FIG. 5 is a write request packet format, where a format and a type are used to distinguish whether the request packet is a read request packet or a write request packet.
  • the transaction layer packet length is used to indicate the request packet length
  • the source node identifier is used to indicate the source node that sends the request packet
  • the address in the read request packet indicates the address of the memory data to be read by the read request packet.
  • the address in the write request packet indicates the payload to be carried in the write request packet, and the memory address to be written.
  • the meanings of other fields may refer to the packet format of the PC IE in the prior art.
  • the following application scenario is taken as an example to describe a method for reading and writing memory data in detail. As shown in FIG. 13 , the method includes the following steps:
  • 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;
  • the source node parses the destination node identifiers of the to-be-sent request packets, and determines whether the destination node identifiers of the to-be-sent request packets are the same.
  • the read request packet to be sent is as shown in FIG. 4, and the write request packet to be sent is as shown in FIG. 5, wherein the address to be sent in the read request packet and the to-be-sent write request packet is a destination node memory address, where the destination node identifier of the destination node is located in the address attribution table, where 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.
  • the destination node memory address is OH I OOO-OH1 fff
  • the corresponding destination node identifier is 1 and the destination node memory address is 0H2000-0H2f ff
  • the corresponding destination node identifier is 2
  • the purpose When the node memory address is 0H 3000-0H2f ff, the corresponding destination node ID is 3.
  • the destination node identifier corresponding to the memory address of the destination node is obtained according to the address attribution table. For example, when the memory address of the destination node carried in the read request packet to be sent is
  • the to-be-sent read request packet and the to-be-sent write request packet are both present in the destination node identifier 1
  • the target node has a memory address range, and therefore the read request packet to be sent and the destination node identifier of the to-be-sent write request packet are the same.
  • the source node separately encapsulates the at least two to-be-sent request packets having the same destination node identifier as a sub-request packet into a merge request packet, where the merge request packet includes a common packet header and at least two sub-request packets.
  • the common packet header includes a merge packet identifier, a sub-request packet number identifier, and a source node identifier, where the merge packet identifier is used to indicate that the request packet is a merge packet of the at least two sub-request packet combinations, and the sub-packet
  • 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 packet includes a sub-request packet header and sub-request information.
  • the write request sub-packets with the same destination node identifier may be packaged into one merge write request packet, or the read request sub-packets with the same destination node identifier may be packaged into one merge read request packet, or to further improve link utilization.
  • the write request sub-packet and the read request sub-packet having the same destination node identifier are packaged into one merge read-write request packet, so the merge request packet includes a write request sub-packet and/or a read request sub-packet.
  • the number of the sub-request packets further includes a source node identifier (Requester ID), which is used to indicate the source node that is sent by the merge request packet, that is, the identifier of the local source node, and the common header of the merge request packet further includes The public information in the header of each sub-request.
  • the sub-request packet in the merge request packet includes a sub-request packet header and sub-request information, where the sub-request packet header includes a format (Fmt), a type (Type), and a length of the sub-request packet, wherein the length is specifically a transaction layer Packet length (Transaction Lay Packet, TLP length ).
  • the format and type are used to distinguish whether the sub-request packet is a write request sub-package or a read request sub-package.
  • each sub-request packet further includes a request encoding, which is a coding of the sub-request packet by the source node, and is a unique identifier of each sub-request packet, so that the source node receives the response returned by the destination node.
  • request encoding is a coding of the sub-request packet by the source node, and is a unique identifier of each sub-request packet, so that the source node receives the response returned by the destination node.
  • the completion of the sub-request is determined according to the request code carried in the response message.
  • the two read request sub-packets are combined to obtain a combined read request packet, where the merged package identifier and the number of the sub-request packet identifiers are newly added additional information, where the number of the sub-request packets is identified. It is 4 bits, and it can be indicated that the number of read request sub-packets included in the combined read request packet is 16.
  • the PCIE originally contains a request encoding (ie, tag) field, which is 8 bits in length. In the combined read request packet, the upper 4 bits of the 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, and match the number represented by the sub-request packet number identification field.
  • the communication classification (TC), the pollution reservation bit (EP), the attribute (Attr), and the source node identifier (Requester ID) belong to a common header in the combined read request packet; format (Fmt), type (Type), whether ECRC (TD), TLP length, Request Coding, Last DW BE, and First Byte Alignment (1st DW BE) belong to the read request sub-packet header, the above fields
  • the meaning can be referred to the read request packet format in the PCIE in the prior art.
  • the two write request sub-packets are combined to obtain a merge write request packet, and the meaning of the field included in the merge write request packet is similar to the meaning of the field included in the merge read request packet shown in FIG. 10, except that The write request subpackage also contains the payload to be written to the destination node.
  • the write request sub-packet and the read request sub-packet of the same destination node identifier may be packaged into one merge request packet, as shown in FIG.
  • the package merge is performed in the order in which the sub-requests are sent. 1304, the source node sends 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 read and/or read memory data of the destination node. Write operation.
  • the destination node receives a request packet.
  • the destination node determines whether the received request packet carries a merged package identifier, where the merged package identifier is used to indicate that the request packet is a combined request packet of at least two sub-request packet combinations, where the sub-request package includes: Read request sub-packages, and/or write request sub-packages.
  • the request packet When the request packet carries the merged package identifier, determine that the request packet is a merge request packet, where the merge request packet includes a common header and a subrequest package, where the common header includes a merge package identifier and a subrequest. And the number of the sub-request packets is used to indicate the number of sub-request packets carried by the merge request packet, where the sub-request packet includes a sub-request packet header and sub-request information;
  • each sub-request packet is obtained according to the number of the sub-request packets, and the format, type, and length of each sub-request packet.
  • the merge request packet may include a write request sub-packet and/or a read request sub-package
  • the write request sub-package and the read request sub-package may be distinguished according to the format and type in the sub-request packet header, thereby being different.
  • the requested write request sub-packet and the read request sub-package are processed differently.
  • the destination node processes the sub-request packet, it is convenient to send a response message to the source node, and write the source node identifier into a sub-request packet header of each sub-request packet, or The other information of the common header in the merge request packet is written into the sub-request packet header of each sub-request packet, so that each sub-request packet is converted into the format before the merge.
  • the destination node may return a response message to the source node to inform the source node of the completion status of each sub-request.
  • the destination node sends the response message of the processed sub-request packet separately: acquiring the source node identifier in the write request sub-package;
  • the destination node When the write request sub-packet is a non-push-type write request, the destination node needs to send feedback to the source node, or may request a write request sub-packet that completes the write request, and sends a response to the source node. Message.
  • the source node receives 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 sub-package with a successful write request.
  • the source node After receiving the write request response message, the source node compares with the write request identifier in the sent write request sub-packet according to the carried write request identifier, and obtains which write request sub-packets are available. The destination node is successfully written, which write request sub-packets are not written, and the request packet for which no write request is successful may be sent again.
  • the response message includes a request code corresponding to the read request sub-packet whose read request is successful, and an acquired payload, where the payload is data acquired by the sub-read request.
  • the source node Receiving, by the source node, a read request response message sent by the destination node, where the read request response message includes a read request identifier corresponding to the read request sub-package with a successful read request, and the acquired payload, the payload The data obtained for the sub-read request.
  • the payload in the read request sub-packet is data obtained by the destination node according to the remote memory address in the read request sub-package, and the destination node will successfully obtain the read request corresponding to the sub-read request of the payload.
  • the corresponding payload can be read back to the corresponding address.
  • the response message to be sent with the same source node identifier is packaged as a sub-response message packet, and the merge response message packet includes a write request sub-response message and/or a read request sub-response message.
  • the source node After obtaining the merge response message packet, the source node obtains a corresponding response message according to the write request identifier and/or the read request identifier in the packet, and the processing manner after the acquisition is the same as that described in the first method, where No longer.
  • the method in the embodiment of the present invention may also be applied to data transmission between multiple ports in the system, and searching for the destination node identifier in the routing table according to the destination node identifier corresponding to each to-be-sent request packet.
  • the routing table includes a routing port corresponding to the destination node identifier, where the routing port is a port on the path of the to-be-sent request packet to the destination node, and determining a route of each to-be-sent request packet If the ports are the same, the to-be-sent request packets with the same routing port are merged to obtain a merge request packet, and the merge request packet is sent to the routing port.
  • the routing port receives the merge request After the packet is requested, the unpacking operation is performed, the source node identifier in the common header of the merge request packet is extracted, written in the header of each sub-request packet, and then the subsequent forwarding operation is continued.
  • the embodiment of the present invention provides a memory data read/write processing device 14.
  • the memory data read/write processing device 14 may be present in a computing node, or may be a computing node, as shown in FIG.
  • the acquisition unit 141, the determination unit 142, the processing unit 143, and the transmission unit 144 are included.
  • the obtaining unit 141 is configured to obtain each to-be-sent request packet, where the to-be-sent request packet includes: a read request packet, and/or a write request packet;
  • the determining unit 1 42 is configured to parse the destination node identifiers of the to-be-sent request packets, and determine whether the destination node identifiers of the to-be-sent request packets are the same;
  • the processing unit 14 3 is configured to package the at least two to-be-sent request packets having the same destination node identifier as a sub-request packet into a merge request packet, where the merge request packet includes a common header and at least two sub-requests. a packet, where the common packet header includes a merge packet identifier, a sub-request packet number identifier, and a source node identifier, where the merge packet identifier is used to indicate that the request packet is a merge packet of the at least two sub-request packet combinations, 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 packet includes a sub-request packet header and sub-request information;
  • the sending unit 144 is configured to 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 read and/or write the memory data of the destination node. operating.
  • the device for reading and writing the memory data acquires each to-be-sent request packet, and parses the destination node identifier of each to-be-sent request packet, and determines whether the destination node identifier of each to-be-sent request packet is The same, the at least two to-be-sent request packets having the same destination node identifier are respectively packaged as a sub-request packet, and the merge request packet is finally sent to the destination node corresponding to the destination node identifier.
  • the merge request packet is used to indicate that the destination node performs the memory data of the destination node. Read and / or write operations.
  • the embodiment of the invention solves the problem that the remote data access operation with a small amount of data is wasted more on the data request packet in the prior art, resulting in low transmission efficiency and improving the utilization efficiency of the link.
  • the processing unit includes:
  • the first identifier module 151 is configured to set the merged packet identifier to a predetermined value, where the predetermined value indicates that the request packet is a merged package of the at least two sub-request packet combinations;
  • the second identifier module 152 is configured to obtain the number of sub-request packets, and write the number into the identifier of the sub-request packet.
  • the determining unit includes:
  • the first obtaining module 161 is configured to obtain a destination node identifier carried in each request packet to be sent;
  • the first determining module 162 is configured to determine whether the destination node identifiers of the to-be-sent request packets are the same;
  • the processing unit further includes:
  • the third identifier module 163 is configured to extract a destination node identifier in the sub-request packet, and place the destination node identifier in a common header of the merge request packet.
  • the determining unit includes:
  • the second obtaining module 171 is configured to obtain a memory address of the destination node carried in each request packet to be sent;
  • the first search module 172 is configured to search, according to the destination node memory address, the destination node identifier of the destination node memory address in the address attribution table, where the address attribution table is a correspondence between the destination node memory address and the destination node identifier. Relational tables;
  • the second determining module 173 is configured to determine whether the destination node identifiers of the to-be-sent request packets are the same.
  • the sub-request packet included in the merge request packet obtained by the processing unit includes a write request sub-packet and/or a read request sub-packet
  • the write request sub-packet header includes a write that identifies the write request sub-packet.
  • Requesting an identifier the write request information in the write request sub-package includes a to-be-written target
  • the read request sub-packet header includes a read request identifier identifying the read request sub-packet
  • the read request information in the read request sub-package includes a to-be-read The memory address of the destination node where the data is located, as shown in FIG. 18, the device further includes:
  • 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 sub-package with a successful write request; and/or, a read request response message sent by the destination node, where the read request response message includes a read request identifier corresponding to the read request sub-package with a successful read request, and a read payload, where the payload is the read request The data corresponding to the remote memory address in the subpackage.
  • the determining unit further includes:
  • the second search module 191 is configured to search for a routing port corresponding to the destination node identifier in the routing table according to the destination node identifier corresponding to the to-be-sent request packet, where the routing table includes a route corresponding to the destination node identifier. a port, where the routing port is a port on a path of the to-be-sent request packet to the destination node;
  • the third determining module 192 is configured to determine whether the routing ports of the to-be-sent request packets are the same.
  • the embodiment of the present invention further provides a memory data read/write processing device 20, wherein the memory data read/write processing device 20 may exist in a computing node, or may be a computing node, as shown in FIG.
  • the apparatus includes a receiving unit 201, a determining unit 202, a determining unit 203, an extracting unit 204, and a processing unit 205.
  • the receiving unit 201 is configured to receive a request packet.
  • the determining unit 202 is configured to determine whether the received request packet carries a merged package identifier, where the merged package identifier is used to indicate that the request packet is a combined request packet of at least two sub-request packet combinations, where the sub-request package includes: Requesting a sub-package, and/or writing a request sub-package;
  • the determining unit 203 is configured to: when the request packet carries the merged package identifier, determine that the request packet is a merge request packet, where the merge request packet includes a common header and a sub-request packet, where The common packet header includes a merging packet identifier, a sub-request packet number identifier, and a source node identifier, where the sub-request packet number identifier is used to indicate the number of sub-request packets carried by the merging request packet, and the sub-request packet Contains subrequest packet header and subrequest information;
  • the extracting unit 2 04 is configured to extract, according to the number of sub-request packets carried in the merge request packet and each sub-request packet header, the number of the number of the sub-request packet identifiers in the merge request packet Request package
  • the processing unit 2 05 is configured to process the corresponding sub-request packet according to each of the sub-request packet header and sub-request information.
  • the apparatus for reading and writing the memory data determines whether the received request packet carries the merged package identifier, and when the request packet carries the merged package identifier, determining that the request packet is a merge request packet, And then, according to the number of sub-request packets carried in the merge request packet and each sub-request packet header, extracting a sub-request packet corresponding to the number of the sub-request packet identifiers in the merge request packet, and finally according to the Each sub-request packet header and sub-request information is processed, and the corresponding sub-request packet is processed.
  • the embodiment of the invention solves the problem that the remote data access operation with a small amount of data is wasteful on the data request packet in the prior art, which causes the transmission efficiency to be low, and improves the utilization efficiency of the link.
  • the processing unit includes:
  • the first processing module 2 1 1 is configured to: according to the write request identifier in the write request sub-packet header, the to-be-written data in the write request information of the write request sub-packet, and the memory address of the destination node to be written, Writing the write data to the memory address of the destination node;
  • the second processing module 2 1 2 is configured to: according to the read request identifier in the read request sub-packet header, and the memory address of the destination node where the data to be read in the read request information of the read request sub-package is located, The data to be read is read in the destination node memory address.
  • the device further includes:
  • the identifier writing unit 22 1 is configured to write the source node identifier into a sub-request packet header of each sub-request packet, so that the destination node sends a response message to the source node.
  • the determining unit is further configured to determine, according to each response message to be sent, Whether the source node identifiers are the same;
  • the processing unit is further configured to package the to-be-sent response message with the same source node identifier as a sub-response message, and the merge response message packet includes a write request sub-response message and/or Or read the request sub-response message;
  • the device further includes:
  • the sending unit 231 is configured to send the merge response message packet to a source node corresponding to the source node identifier.
  • the processing unit is further configured to extract a source node identifier in a common header of the merge request packet, and write the header of each sub-request packet.
  • the read/write processing device for the memory data shown in FIG. 14 to FIG. 19 can be implemented based on the hardware structure of a computer or other network device. As shown in FIG. 24, the hardware structure of the read/write processing device 24 for the in-memory data includes the memory 241. Transceiver 242, processor 243, and bus 244.
  • the processor 243, the memory 241, and the transceiver 242 are connected by a bus 244.
  • the memory 241 may be a Read Only Memory (ROM), a static storage device, a dynamic storage device, or a Random Access Memory (RAM).
  • ROM Read Only Memory
  • RAM Random Access Memory
  • the memory 241 can store instructions of the operating system and other applications as well as application data. The instructions stored in the memory 241 are executed by the processor 243 for execution.
  • the memory 241 in the embodiment of the present invention can be used to store instructions for implementing the functional units in the embodiments shown in FIGS. 14 to 19.
  • the transceiver 242 is used to implement communication between the read/write processing device 24 of the memory data and other devices.
  • the transceiver 242 is configured to send a merge request packet and receive a response message.
  • the processor 243 can use a general-purpose central processing unit (Central Processing) Unit, CPU), processor, Application Specific Integrated Circuit (ASIC), or one or more integrated circuits for executing related programs.
  • CPU Central Processing
  • ASIC Application Specific Integrated Circuit
  • the processor 243 is configured to execute the instructions in the memory 241, and specifically:
  • each to-be-sent request packet includes: a read request packet, and/or a write request packet;
  • the at least two to-be-sent request packets having the same destination node identifier are respectively packaged as a sub-request packet, and the merge request packet includes a common header and at least two sub-request packets, where the common header is included.
  • the merge request packet is used to instruct the destination node to perform a read and/or write operation on the memory data of the destination node.
  • the device for reading and writing the memory data acquires each to-be-sent request packet, and parses the destination node identifier of each to-be-sent request packet, and determines whether the destination node identifier of each to-be-sent request packet is The same, the at least two to-be-sent request packets having the same destination node identifier are respectively packaged as a sub-request packet, and the merge request packet is finally sent to the destination node corresponding to the destination node identifier.
  • the merge request packet is used to instruct the destination node to perform a read and/or write operation on the memory data of the destination node.
  • the embodiment of the invention solves the problem that the remote data access operation with a small amount of data is wasted more on the data request packet in the prior art, resulting in low transmission efficiency and improving the utilization efficiency of the link.
  • the specific processing procedure in the processor 243 can refer to the method embodiment part and the apparatus embodiment part shown in FIG. 14 to FIG. 19, and details are not described herein again.
  • Bus 244 can include a path for communicating information between various components of the read and write processing device of memory data, such as processor 243, memory 241, and transceiver 242.
  • the read/write processing device for the memory data shown in FIG. 20 to FIG. 23 described above can be implemented based on the hardware configuration of the computer.
  • the hardware structure of the read/write processing device 25 for the in-memory data includes the memory 251 and the transceiver 252. , processor 253 and bus 254.
  • the processor 253, the memory 251, and the transceiver 252 are communicatively coupled via a bus 254.
  • the memory 251 may be a read only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM).
  • the memory 251 can store instructions of the operating system and other applications as well as application data.
  • the instructions stored in the memory 251 are executed by the processor 253 for execution.
  • the memory 251 in the embodiment of the present invention can be used to store instructions for implementing the functional units in the embodiments shown in Figs. 20 to 23.
  • the transceiver 252 is used to implement communication between the read and write processing device 25 of the memory data and other devices.
  • the transceiver 252 is configured to receive a merge request packet and send a response message.
  • the processor 253 can use a general-purpose central processing unit (CPU), a processor, an application specific integrated circuit (ASIC), or one or more integrated circuits for executing related programs.
  • CPU central processing unit
  • ASIC application specific integrated circuit
  • the processor 253 is configured to execute the instructions in the memory 251, and specifically:
  • the request packet carries a merged package identifier, where the merged package identifier is used to indicate that the request packet is a merge request packet of at least two sub-request packet combinations, where the sub-request package includes: a read request sub-package, and/ Or write a request sub-package;
  • the request packet is determined to be a merge request packet, where the merge request packet includes a common header and a sub-request packet, where the common header includes the merge packet identifier and the number of sub-request packets.
  • the identifier of the sub-request packet 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;
  • Corresponding sub-request packets are processed according to each of the sub-request packet headers and sub-request information.
  • the apparatus for reading and writing the memory data provided by the embodiment of the present invention determines whether the received request packet carries the merged package identifier, and when the request packet carries the merged package identifier, determining that the request packet is a merge request packet, And then, according to the number of sub-request packets carried in the merge request packet and each sub-request packet header, extracting a sub-request packet corresponding to the number of the sub-request packet identifiers in the merge request packet, and finally according to the Each sub-request packet header and sub-request information is processed, and the corresponding sub-request packet is processed.
  • the embodiment of the invention solves the problem that the remote data access operation with a small amount of data is wasteful on the data request packet in the prior art, which causes the transmission efficiency to be low, and improves the utilization efficiency of the link.
  • the specific processing procedure in the processor 253 can be referred to the method embodiment part and the apparatus embodiment part shown in FIG. 20 to FIG. 23, and details are not described herein again.
  • Bus 254 can include a path for communicating information between various components of the memory data read and write processing device, such as processor 253, memory 251, and transceiver 252.
  • the division of the modules or units is only a logical function division. In actual implementation, there may be another division manner, for example, multiple units or components may be used. Combined or can be integrated into another system, or some features can be ignored, or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
  • the units described as separate components may or may not be physically separate.
  • the components displayed as units may or may not be physical units, i.e., may be located in one place, or may be distributed over multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may contribute to the prior art or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium. , including a number of instructions to make a computer device
  • the foregoing storage medium includes: a USB flash drive, a removable hard disk, a read only memory (ROM, Rea d-Only Memory), a random access memory (RAM, Random Acce ss Memory), a magnetic disk or an optical disk, and the like.
  • the medium of the code includes: a USB flash drive, a removable hard disk, a read only memory (ROM, Rea d-Only Memory), a random access memory (RAM, Random Acce ss Memory), a magnetic disk or an optical disk, and the like.

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

A read and write processing method and device for memory data, which relate to the technical field of computer systems, and solve the problem in the prior art that the transmission efficiency is low due to the fact that access operations of a plurality of memory data with smaller data amount waste more overhead on a data request packet. The method comprises: a source node acquiring various request packets to be sent; parsing destination node identifiers of the various request packets to be sent, and judging whether the destination node identifiers of the various request packets to be sent are the same or not; packaging the at least two request packets to be sent with the same destination node identifier into a merged request packet by respectively taking them as sub-request packets; and sending the merged request packet to a destination node corresponding to the destination node identifier, the merged request packet being used for indicating the destination node to conduct a read and/or write operation on the memory data of the destination node. The method is applied to the process of read and write processing of the memory data.

Description

一种内存数据的读写处理方法和装置 本申请要求于 2013 年 8 月 26 日提交中国专利局、 申请号为 201310376301.X、发明名称为"一种内存数据的读写处理方法和装置,,的中国专 利申请的优先权, 其全部内容通过引用结合在本申请中。  The present invention claims to be submitted to the Chinese Patent Office on August 26, 2013, and the application number is 201310376301.X, and the invention name is "a method and device for reading and writing memory data, Priority of the Chinese Patent Application, the entire contents of which is incorporated herein by reference.
技术领域 Technical field
本发明涉及计算机系统技术领域, 尤其涉及一种内存数据的读写处 理方法和装置。  The present invention relates to the field of computer system technologies, and in particular, to a method and apparatus for reading and writing memory data.
背景技术 Background technique
在多节点计算机系统中, 本地和远程节点之间的数据交互效率直接 影响整个系统的' 1"生能。 远程直接内存访问 ( 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 '1' energy of the entire system. Remote Direct Memory Access (RDMA) is the rapid movement of memory data from a system to a system. In the remote system memory, without affecting the operating system, for example, without the CPU intervention, the memory data of one node is directly transferred to the physical memory of another node, thereby reducing the impact of data transmission on the processing components. Improve 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 data exchange granularity between memory and Cache is a Cache Line with a size of 64 Bytes (bytes) or 128 Bytes, if each Cache Line's data is packed into a request. Packets are sent out. This small-scale data transfer has a certain amount of link bandwidth waste. For example, the packet header of PCIE (Peripheral Component Interface Express) may have 16 Bytes, and if Payload (effective) The payload is 16 bytes, and the link bandwidth utilization is only 50%. Therefore, multiple remote data access operations with small data volume waste more overhead on the data request packet, resulting in inefficient transmission.
发明内容 本发明的实施例提供一种内存数据的读写处理方法和装置, 提高了 链路的利用效率。 Summary of the invention Embodiments of the present invention provide a method and apparatus for reading and writing memory data, which improves link utilization efficiency.
为达到上述目的, 本发明的实施例釆用如下技术方案:  In order to achieve the above object, embodiments of the present invention use the following technical solutions:
第一方面, 本发明提供了一种内存数据的读写处理方法, 包括: 获取各个待发送请求包,所述待发送请求包包括:读请求包,和 /或写 请求包;  In a first aspect, the present invention provides a method for reading and writing memory data, including: acquiring each to-be-sent request packet, where the to-be-sent request packet includes: a read request packet, and/or a write request packet;
解析所述各个待发送请求包的目的节点标识,并判断所述各个待发 送请求包的目的节点标识是否相同;  Parsing the destination node identifiers of the to-be-sent request packets, and determining whether the destination node identifiers of the respective to-be-sent request packets are the same;
将所述具有相同目的节点标识的至少两个待发送请求包分别作为子 请求包, 打包为一个合并请求包, 所述合并请求包中包括公共包头和至 少两个子请求包, 所述公共包头中包含合并包标识、 子请求包个数标识 和源节点标识, 所述合并包标识用于指示所述请求包为所述至少两个子 请求包组合的合并包, 所述子请求包个数标识用于指示所述合并请求包 携带的子请求包的个数,所述子请求包包含子请求包包头和子请求信息; 将所述合并请求包发送给所述目的节点标识对应的目的节点, 所述 合并请求包用于指示所述目的节点对所述目的节点的内存数据进行读和 /或写操作。  The at least two to-be-sent request packets having the same destination node identifier are respectively packaged as a sub-request packet, and the merge request packet includes a common header and at least two sub-request packets, where the common header is included. The merging packet identifier, the sub-request packet number identifier, and the source node identifier, where the merging packet identifier is used to indicate that the request packet is a combined packet of the at least two sub-request packet combinations, and the sub-request packet number identifier is used by And indicating the number of the sub-request packets carried by the merge request packet, where the sub-request packet includes a sub-request packet header and sub-request information; and 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 a merge request packet includes:
将所述合并包标识置为预定值, 所述预定值指示所述请求包为所述 至少两个子请求包组合的合并包;  And setting the merged packet identifier to a predetermined value, where the predetermined value indicates that the request packet is a merged package of the at least two sub-request packet combinations;
获取子请求包的个数, 将所述个数写入所述子请求包个数标识中。 结合第一方面或第一方面的第一种可能的实现方式, 在第二种可能 的实现方式中,所述解析所述各个待发送请求包的目的节点标识,并判断 所述各个待发送请求包的目的节点标识是否相同包括:  Obtaining the number of sub-request packets, and writing the number into the sub-request packet number identifier. With reference to the first aspect or the first possible implementation manner of the first aspect, in a second possible implementation manner, the parsing the target node identifiers of the to-be-sent request packets, and determining the to-be-sent requests Whether the destination node identifier of the packet is the same includes:
获取各个待发送请求包中携带的目的节点标识;  Obtaining the destination node identifier carried in each request packet to be sent;
判断所述各个待发送请求包的目的节点标识是否相同; 所述打包为一个合并请求包包括: Determining whether the destination node identifiers of the to-be-sent request packets are the same; The packaging into a merge request package includes:
提取所述子请求包中的目的节点标识, 并将所述目的节点标识置于 所述合并请求包的公共包头中。  Extracting the destination node identifier in the sub-request packet, and placing the destination node identifier in a common header of the merge request packet.
结合第一方面或第一方面的第一种可能的实现方式, 在第三种可能 的实现方式中,所述解析所述各个待发送请求包的目的节点标识,并判断 所述各个待发送请求包的目的节点标识是否相同包括:  With reference to the first aspect, or the first possible implementation manner of the first aspect, in a third possible implementation manner, the parsing the target node identifiers of the to-be-sent request packets, and determining the to-be-sent requests Whether the destination node identifier of the packet is the same includes:
获取各个待发送请求包中携带的目的节点内存地址;  Obtaining a memory address of the destination node carried in each request packet to be sent;
根据所述目的节点内存地址, 在地址归属表中查找所述目的节点内 存地址归属的目的节点标识, 所述地址归属表为目的节点内存地址与目 的节点标识的对应关系表;  And searching, according to the destination node memory address, the destination node identifier of the destination node's memory address in the address attribution table, where the address attribution table is a correspondence table between the destination node memory address and the destination node identifier;
判断所述各个待发送请求包的目的节点标识是否相同。  Determining whether the destination node identifiers of the respective to-be-sent request packets are the same.
结合第一方面的第二种可能的实现方式或第三种可能的实现方式, 在第四种可能的实现方式中,所述子请求包包括写请求子包和 /或读请求 子包, 写请求子包包头中包括识别所述写请求子包的写请求标识, 所述 写请求子包中的写请求信息包括待写入所述目的节点的数据以及待写入 的所述目的节点内存地址, 读请求子包包头中包括识别所述读请求子包 的读请求标识, 所述读请求子包中的读请求信息包括待读取数据所处的 所述目的节点内存地址, 所述方法还包括:  In conjunction with the second possible implementation or the third possible implementation of the first aspect, in a fourth possible implementation, the sub-request packet includes a write request sub-packet and/or a read request sub-package, The request sub-packet header includes a write request identifier that identifies the write request sub-packet, and the write request information in the write request sub-package includes data to be written to the destination node and a memory address of the destination node to be written. The read request sub-packet header includes a read request identifier that identifies the read request sub-packet, and the read request information in the read request sub-package includes a memory address of the destination node where the data to be read is located, and the method further Includes:
接收所述目的节点发送的写请求响应消息, 所述写请求响应消息中 包含写请求成功的所述写请求子包对应的写请求标识; 和 /或,  Receiving 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 sub-package with a successful write request; and/or,
接收所述目的节点发送的读请求响应消息, 所述读请求响应消息中 包含读请求成功的所述读请求子包对应的读请求标识, 以及读取的有效 载荷, 所述有效载荷为所述读请求子包中远程内存地址对应的数据。  Receiving a read request response message sent by the destination node, where the read request response message includes a read request identifier corresponding to the read request sub-package with a successful read request, and a read payload, where the payload is Read the data corresponding to the remote memory address in the request subpackage.
结合第一方面或第一方面的第一种可能的实现方式或第二种可能的 实现方式或第三种可能的实现方式或第四种可能的实现方式, 在第五种 可能的实现方式中, 所述解析所述各个待发送请求包的目的节点标识, 并判断所述各个待发送请求包的目的节点标识是否相同包括: 根据所述各个待发送请求包对应的目的节点标识, 在路由表中查找 所述目的节点标识对应的路由端口, 所述路由表包含所述目的节点标识 对应的路由端口, 所述路由端口为所述待发送请求包到达所述目的节点 的路径上的端口; In combination with the first aspect or the first possible implementation or the second possible implementation or the third possible implementation or the fourth possible implementation of the first aspect, in a fifth possible implementation manner And parsing the destination node identifiers of the to-be-sent request packets, and determining whether the destination node identifiers of the to-be-sent request packets are the same include: Determining, according to the destination node identifier corresponding to each to-be-sent request packet, a routing port corresponding to the destination node identifier in the routing table, where the routing table includes a routing port corresponding to the destination node identifier, where the routing port is Determining a port on the path of the sending request packet to the destination node;
判断所述各个待发送请求包的路由端口是否相同。  Determining whether the routing ports of the respective to-be-sent request packets are the same.
第二方面, 本发明提供一种内存数据的读写处理方法, 包括: 接收请求包;  In a second aspect, the present invention provides a method for reading and writing memory data, including: receiving a request packet;
判断接收的请求包中是否携带合并包标识, 所述合并包标识用于指 示所述请求包为至少两个子请求包组合的合并请求包, 所述子请求包包 括: 读请求子包,和 /或写请求子包;  Determining whether the received request packet carries a merged package identifier, where the merged package identifier is used to indicate that the request packet is a merge request packet of at least two sub-request packet combinations, where the sub-request package includes: a read request sub-package, and/ Or write a request sub-package;
当所述请求包中携带合并包标识时,确定所述请求包为合并请求包, 所述合并请求包中包括公共包头和子请求包, 所述公共包头中包含合并 包标识、 子请求包个数标识和源节点标识, 所述子请求包个数标识用于 指示所述合并请求包携带的子请求包的个数, 所述子请求包包含子请求 包包头和子请求信息;  When the request packet carries the merged package identifier, the request packet is determined to be a merge request packet, where the merge request packet includes a common header and a sub-request packet, where the common header includes the merge packet identifier and the number of sub-request packets. The identifier of the sub-request packet 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;
根据所述合并请求包中携带的子请求包个数标识和每个子请求包包 头, 提取所述合并请求包中与所述子请求包个数标识对应个数的子请求 包;  And extracting, according to the number of the sub-request packets and the sub-request packet headers carried in the merge request packet, a sub-request packet corresponding to the number of the sub-request packet identifiers in the merge request packet;
根据所述每个子请求包包头和子请求信息, 处理对应的子请求包。 在第二方面的第一种可能的实现方式中, 所述根据所述每个子请求 包包头和子请求信息, 处理对应的子请求包包括:  Corresponding sub-request packets are processed according to each of the sub-request packet headers and sub-request information. In a first possible implementation manner of the second aspect, the processing, by the sub-request packet header and sub-request information, processing the corresponding sub-request packet includes:
根据写请求子包包头中的写请求标识、 所述写请求子包的写请求信 息中的待写入数据以及待写入的目的节点内存地址, 将所述待写入数据 写入所述目的节点内存地址; 和 /或,  Writing the data to be written into the destination according to the write request identifier in the write request sub-packet header, 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 Node memory address; and/or,
根据读请求子包包头中的读请求标识, 以及所述读请求子包的读请 求信息中的待读取数据所处的目的节点内存地址, 在所述目的节点内存 地址中读取所述待读取数据。 结合第二方面的第一种可能的实现方式, 在第二种可能的实现方式 中, 在所述提取所述合并请求包中与所述子请求包个数标识对应个数的 子请求包之后, 还包括: Reading, according to the read request identifier in the read request sub-packet header, and the destination node memory address of the read request information of the read request sub-packet, the destination node memory address is read in the destination node memory address Read the data. With reference to the first possible implementation manner of the second aspect, in a second possible implementation manner, after the extracting the sub-request packet corresponding to the number of sub-request packets in the merge request packet , Also includes:
将所述源节点标识写入每个子请求包的子请求包包头中, 以便于所 述目的节点向所述源节点发送响应消息。  The source node identifier is written into a sub-request packet header of each sub-request packet such that the destination node sends a response message to the source node.
结合第二方面的第二种可能的实现方式, 在第三种可能的实现方式 中, 所述目的节点向所述源节点发送响应消息包括:  With the second possible implementation of the second aspect, in a third possible implementation, the sending, by the destination node, the response message to the source node includes:
判断各个待发送的响应消息对应的源节点标识是否相同;  Determining whether the source node identifiers corresponding to the respective response messages to be sent are the same;
将具有相同源节点标识的所述待发送的响应消息作为子响应消息, 打包为一个合并响应消息包, 所述合并响应消息包中包括写请求子响应 消息和 /或读请求子响应消息;  The response message to be sent with the same source node identifier is packaged as a sub-response message packet, and the merge response message packet includes a write request sub-response message and/or a read request sub-response message.
将所述合并响应消息包发送给所述源节点标识对应的源节点。  Sending the merge response message packet to a source node corresponding to the source node identifier.
在第二方面的第四种可能的实现方式中, 当所述目的节点为路由端 口时, 在所述提取所述合并请求包中与所述子请求包个数标识对应个数 的子请求包之后, 还包括:  In a fourth possible implementation manner of the second aspect, when the destination node is a routing port, extracting, in the extracting the request packet, a number of sub-request packets corresponding to the number of the sub-request packets After that, it also includes:
提取所述合并请求包的公共包头中的源节点标识, 写入每个子请求 包的包头中。  The source node identifier in the common header of the merge request packet is extracted and written in the header of each subrequest packet.
第三方面, 本发明提供一种内存数据的读写处理装置, 包括: 获取单元, 用于获取各个待发送请求包,所述待发送请求包包括: 读 请求包,和 /或写请求包;  In a third aspect, the present invention provides an apparatus for reading and writing memory data, including: an obtaining unit, configured to acquire each to-be-sent request packet, where the to-be-sent request packet includes: a read request packet, and/or a write request packet;
判断单元,用于解析所述各个待发送请求包的目的节点标识,并判断 所述各个待发送请求包的目的节点标识是否相同;  a determining unit, configured to parse the destination node identifiers of the to-be-sent request packets, and determine whether the destination node identifiers of the to-be-sent request packets are the same;
处理单元, 用于将所述具有相同目的节点标识的至少两个待发送请 求包分别作为子请求包, 打包为一个合并请求包, 所述合并请求包中包 括公共包头和至少两个子请求包, 所述公共包头中包含合并包标识、 子 请求包个数标识和源节点标识, 所述合并包标识用于指示所述请求包为 所述至少两个子请求包组合的合并包, 所述子请求包个数标识用于指示 所述合并请求包携带的子请求包的个数, 所述子请求包包含子请求包包 头和子请求信息; a processing unit, configured to package the at least two to-be-sent request packets having the same destination node identifier as a sub-request packet, and the merge request packet includes a common header and at least two sub-request packets. The common packet header includes a merge packet identifier, a sub-request packet number identifier, and a source node identifier, where the merge packet identifier is used to indicate that the request packet is a merge packet of the at least two sub-request packet combinations, and the sub-request Packet number identifier is used to indicate a number of sub-request packets carried by the merge request packet, where the sub-request packet includes a sub-request packet header 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 identifier module, configured to set the merged packet identifier to a predetermined value, where the predetermined value indicates that the request packet is a merged package of at least two sub-request package combinations;
第二标识模块, 用于获取子请求包的个数, 将所述个数写入所述子 请求包个数标识中。  The second identifier module is configured to obtain the number of the sub-request packets, and write the number into the sub-request packet number identifier.
结合第三方面或第三方面的第一种可能的实现方式, 在第二种可能 的实现方式中, 所述判断单元包括:  With reference to the third aspect or the first possible implementation manner of the third aspect, in a second possible implementation manner, the determining unit includes:
第一获取模块,用于获取各个待发送请求包中携带的目的节点标识; 第一判断模块, 用于判断所述各个待发送请求包的目的节点标识是 否相同;  a first obtaining module, configured to obtain a destination node identifier carried in each to-be-sent request packet; a first determining module, configured to determine whether the destination node identifiers of the to-be-sent request packets are the same;
所述处理单元还包括:  The processing unit further includes:
第三标识模块, 用于提取所述子请求包中的目的节点标识, 并将所 述目的节点标识置于所述合并请求包的公共包头中。  And a third identifier module, configured to extract a destination node identifier in the sub-request packet, and place the destination node identifier in a common header of the merge request packet.
结合第三方面或第三方面的第一种可能的实现方式, 在第三种可能 的实现方式中, 所述判断单元包括:  With reference to the third aspect or the first possible implementation manner of the third aspect, in a third possible implementation, the determining unit includes:
第二获取模块, 用于获取各个待发送请求包中携带的目的节点内存 地址;  a second acquiring module, configured to obtain a memory address of the destination node carried in each request packet to be sent;
第一查找模块, 用于根据所述目的节点内存地址, 在地址归属表中 查找所述目的节点内存地址归属的目的节点标识, 所述地址归属表为目 的节点内存地址与目的节点标识的对应关系表;  a first search module, configured to search, according to the destination node memory address, a destination node identifier of the destination node memory address in the address attribution table, where the address attribution table is a correspondence between the destination node memory address and the destination node identifier Table
第二判断模块, 用于判断所述各个待发送请求包的目的节点标识是 否相同。 结合第三方面的第二种可能的实现方式或第三种可能的实现方式, 在第四种可能的实现方式中, 所述处理单元得到的所述合并请求包中包 括的子请求包包括写请求子包和 /或读请求子包,写请求子包包头中包括 识别所述写请求子包的写请求标识, 所述写请求子包中的写请求信息包 括待写入所述目的节点的数据以及待写入的所述目的节点内存地址, 读 请求子包包头中包括识别所述读请求子包的读请求标识, 所述读请求子 包中的读请求信息包括待读取数据所处的所述目的节点内存地址, 所述 装置还包括: The second determining module is configured to determine whether the destination node identifiers of the to-be-sent request packets are the same. With reference to the second possible implementation manner of the third aspect, or the third possible implementation manner, in a fourth possible implementation manner, the sub-request packet included in the merge request packet obtained by the processing unit includes writing a request sub-packet and/or a read request sub-package, the write request sub-packet header includes a write request identifier for identifying the write request sub-packet, and the write request information in the write request sub-package includes a write request information to be written to the destination node The data and the destination node memory address to be written, the read request sub-packet header includes a read request identifier identifying the read request sub-packet, and the read request information in the read request sub-package includes the data to be read The destination node memory address, the device further 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 sub-package with a successful write request; and/or, a read request response message sent by the destination node, where the read request response message includes a read request identifier corresponding to the read request sub-package with a successful read request, and a read payload, where the payload is the read requester The data corresponding to the remote memory address in the package.
结合第三方面或第三方面的第一种可能的实现方式或第二种可能的 实现方式或第三种可能的实现方式或第四种可能的实现方式, 在第五种 可能的实现方式中, 所述判断单元还包括:  In combination with the third aspect or the first possible implementation or the second possible implementation or the third possible implementation or the fourth possible implementation of the third aspect, in a fifth possible implementation manner The determining unit further includes:
第二查找模块, 用于根据所述各个待发送请求包对应的目的节点标 识, 在路由表中查找所述目的节点标识对应的路由端口, 所述路由表包 含所述目的节点标识对应的路由端口, 所述路由端口为所述待发送请求 包到达所述目的节点的路径上的端口;  a second search module, configured to search, according to the destination node identifier corresponding to each to-be-sent request packet, a routing port corresponding to the destination node identifier in a routing table, where the routing table includes a routing port corresponding to the destination node identifier The routing port is a port on the path of the to-be-sent request packet to the destination node;
第三判断模块, 用于判断所述各个待发送请求包的路由端口是否相 同。  The third determining module is configured to determine whether the routing ports of the to-be-sent request packets are the same.
第四方面, 本发明提供一种内存数据的读写处理装置, 包括: 接收单元, 用于接收请求包;  A fourth aspect of the present invention provides a memory data read/write processing apparatus, including: a receiving unit, configured to receive a request packet;
判断单元, 用于判断接收的请求包中是否携带合并包标识, 所述合 并包标识用于指示所述请求包为至少两个子请求包组合的合并请求包, 所述子请求包包括: 读请求子包,和 /或写请求子包; a determining unit, configured to determine whether the received request packet carries a merged package identifier, where the merged package identifier is used to indicate that the request packet is a combined request packet of at least two sub-request packet combinations, The sub-request package includes: a read request sub-package, and/or a write request sub-package;
确定单元, 用于当所述请求包中携带合并包标识时, 确定所述请求 包为合并请求包, 所述合并请求包中包括公共包头和子请求包, 所述公 共包头中包含合并包标识、 子请求包个数标识和源节点标识, 所述子请 求包个数标识用于指示所述合并请求包携带的子请求包的个数, 所述子 请求包包含子请求包包头和子请求信息;  a determining unit, configured to: when the request packet carries a merged package identifier, determine that the request packet is a merge request packet, where the merge request packet includes a common header and a subrequest package, where the common header includes a merge packet identifier, a sub-request packet number identifier and a source node identifier, where the sub-request packet number identifier is used to indicate a number of sub-request packets carried by the merge request packet, where the sub-request packet includes a sub-request packet header and sub-request information;
提取单元, 用于根据所述合并请求包中携带的子请求包个数标识和 每个子请求包包头, 提取所述合并请求包中与所述子请求包个数标识对 应个数的子请求包;  An extracting unit, configured to extract, according to the number of sub-request packets and the sub-request packet header carried in the merge request packet, a sub-request packet corresponding to the number of the sub-request packet identifiers in the merge request packet ;
处理单元, 用于根据所述每个子请求包包头和子请求信息, 处理对 应的子请求包。  And a processing unit, configured to process the corresponding sub-request packet according to each of the sub-request packet header and sub-request information.
在第四方面的第一种可能的实现方式中, 所述处理单元包括: 第一处理模块, 用于根据写请求子包包头中的写请求标识、 所述写 请求子包的写请求信息中的待写入数据以及待写入的目的节点内存地 址, 将所述待写入数据写入所述目的节点内存地址;  In a first possible implementation manner of the fourth aspect, the processing unit includes: a first processing module, configured to identify, according to a write request identifier in the write request sub-packet header, the write request information of the write request sub-packet The data to be written and the memory address of the destination node to be written, and the data to be written is written into the memory address of the destination node;
第二处理模块, 用于根据读请求子包包头中的读请求标识, 以及所 述读请求子包的读请求信息中的待读取数据所处的目的节点内存地址, 在所述目的节点内存地址中读取所述待读取数据。  a second processing module, configured to: according to the read request identifier in the read request sub-packet header, and the memory address of the destination node where the data to be read in the read request information of the read request sub-package is located, in the destination node memory The data to be read is read in the address.
结合第四方面的第一种可能的实现方式, 在第二种可能的实现方式 中, 所述装置还包括:  With reference to the first possible implementation of the fourth aspect, in a second possible implementation, the device further includes:
标识写入单元, 用于将所述源节点标识写入每个子请求包的子请求 包包头中, 以便于所述目的节点向所述源节点发送响应消息。  And an identifier writing unit, configured to write the source node identifier into a 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 fourth aspect, in a third possible implementation manner, the determining unit is further configured to determine whether the source node identifiers corresponding to the respective response messages to be sent are the same;
所述处理单元, 还用于将具有相同源节点标识的所述待发送的响应 消息作为子响应消息, 打包为一个合并响应消息包, 所述合并响应消息 包中包括写请求子响应消息和 /或读请求子响应消息; The processing unit is further configured to package the to-be-sent response message with the same source node identifier as a sub-response message, into a merge response message packet, and the merge response message The packet includes a write request sub-response message and/or a read request sub-response message;
所述装置还包括:  The device also includes:
发送单元, 用于将所述合并响应消息包发送给所述源节点标识对应 的源节点。  And a sending unit, configured to send the merge response message packet to a source node corresponding to the source node identifier.
在第四方面的第四种可能的实现方式中, 当所述目的节点为路由端 口时, 所述处理单元, 还用于提取所述合并请求包的公共包头中的源节 点标识, 写入每个子请求包的包头中。  In a fourth possible implementation manner of the fourth aspect, when the destination node is a routing port, the processing unit is further configured to extract a source node identifier in a common header of the merge request packet, and write each The header of the sub-request package.
本发明实施例提供的一种内存数据的读写处理方法和装置, 源节点 获取各个待发送请求包,所述待发送请求包包括:读请求包,和 /或写请求 包,然后解析所述各个待发送请求包的目的节点标识,并判断所述各个待 发送请求包的目的节点标识是否相同, 将所述具有相同目的节点标识的 至少两个待发送请求包分别作为子请求包, 打包为一个合并请求包, 将 所述合并请求包发送给所述目的节点标识对应的目的节点, 所述合并请 求包用于指示所述目的节点对所述目的节点的内存数据进行读和 /或写 操作。 本发明实施例解决了现有技术中多个数据量较小的内存数据读写 操作浪费较多的开销在数据请求包上, 导致传输效率低下的问题, 提高 了链路的利用效率。  The method and device for reading and writing memory data provided by the embodiment of the present invention, the source node acquiring each to-be-sent request packet, the to-be-sent request packet includes: a read request packet, and/or a write request packet, and then parsing the And determining, by the target node identifiers of the to-be-sent request packets, the destination node identifiers of the respective to-be-sent request packets are the same, and the at least two to-be-sent request packets having the same destination node identifier are respectively packaged as sub-request packets. 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 that the memory data read/write operation with a small amount of data is small in the prior art, which wastes more overhead on the data request packet, resulting in low transmission efficiency and improves the utilization efficiency of the link.
附图说明 DRAWINGS
为了更清楚地说明本发明实施例或现有技术中的技术方案, 下面将 对实施例或现有技术描述中所需要使用的附图做一简单地介绍, 显而易 见地, 下面描述中的附图是本发明的一些实施例, 对于本领域普通技术 人员来讲, 在不付出创造性劳动的前提下, 还可以根据这些附图获得其 他的附图。  In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, a brief description of the drawings used in the embodiments or the prior art description will be briefly made. Obviously, the drawings in the following description It is a certain embodiment of the present invention, and other drawings can be obtained from those skilled in the art without any creative work.
图 1 为本发明实施例提供的一种内存数据的读写处理方法的流程 图;  1 is a flow chart of a method for reading and writing memory data according to an embodiment of the present invention;
图 2为一种读请求包格式的示意图; 图 3为一种写请求包格式的示意图; 2 is a schematic diagram of a read request packet format; 3 is a schematic diagram of a write request packet format;
图 4为另一种读请求包格式的示意图;  Figure 4 is a schematic diagram of another read request packet format;
图 5为另一种写请求包格式的示意图;  Figure 5 is a schematic diagram of another write request packet format;
图 6为本发明实施例提供的一种合并写请求包格式的示意图; 图 7为本发明实施例提供的一种合并读请求包格式的示意图; 图 8为本发明实施例提供的一种合并读写请求包格式的示意图; 图 9为本发明实施例提供的另一种合并写请求包格式的示意图; 图 1 0为本发明实施例提供的另一种合并读请求包格式的示意图; 图 1 1为本发明实施例提供的另一种合并读写请求包格式的示意图; 图 1 2 为本发明实施例提供的另一种内存数据的读写处理方法的流 程图;  FIG. 6 is a schematic diagram of a merge write request packet format according to an embodiment of the present invention; FIG. 7 is a schematic diagram of a merge read request packet format according to an embodiment of the present invention; FIG. 8 is a schematic diagram of a merge provided by an embodiment of the present invention; FIG. 9 is a schematic diagram of another merge write request packet format according to an embodiment of the present invention; FIG. 10 is a schematic diagram of another merge read request packet format according to an embodiment of the present invention; 1 is a schematic diagram of another merging read and write request packet format provided by an embodiment of the present invention; FIG. 1 is a flowchart of another method for reading and writing memory data according to an embodiment of the present invention;
图 1 3 为本发明实施例提供的又一种内存数据的读写处理方法的流 程图;  FIG. 13 is a flow chart of still another method for reading and writing memory data according to an embodiment of the present invention;
图 14 为本发明实施例提供的一种内存数据的读写处理装置的结构 图;  FIG. 14 is a structural diagram of an apparatus for reading and writing memory data according to an embodiment of the present invention;
图 1 5 为本发明实施例提供的一种内存数据的读写处理装置中处理 单元的结构图;  FIG. 15 is a structural diagram of a processing unit in a memory data read/write processing apparatus according to an embodiment of the present invention;
图 1 6 为本发明实施例提供的又一种内存数据的读写处理装置的结 构图;  FIG. 16 is a structural diagram of another apparatus for reading and writing memory data according to an embodiment of the present invention;
图 1 7 为本发明实施例提供的一种内存数据的读写处理装置中判断 单元的结构图;  FIG. 1 is a structural diagram of a determining unit in a memory data read/write processing apparatus according to an embodiment of the present invention;
图 1 8 为本发明实施例提供的另一种内存数据的读写处理装置的结 构图;  FIG. 18 is a structural diagram of another apparatus for reading and writing memory data according to an embodiment of the present invention;
图 1 9 为本发明实施例提供的一种内存数据的读写处理装置中判断 单元的结构图;  FIG. 19 is a structural diagram of a determining unit in a memory data read/write processing apparatus according to an embodiment of the present invention;
图 20 为本发明实施例提供的又另一种内存数据的读写处理装置的 结构图; 图 2 1 为本发明实施例提供的又另一种内存数据的读写处理装置中 处理单元的结构图; FIG. 20 is a structural diagram of still another apparatus for reading and writing memory data according to an embodiment of the present invention; FIG. FIG. 2 is a structural diagram of a processing unit in another read/write processing device for memory data according to an embodiment of the present disclosure;
图 22 为本发明实施例提供的再一种内存数据的读写处理装置的结 构图;  FIG. 22 is a structural diagram of still another apparatus for reading and writing memory data according to an embodiment of the present invention;
图 2 3 为本发明实施例提供的再又一种内存数据的读写处理装置的 结构图;  FIG. 2 is a structural diagram of another apparatus for reading and writing memory data according to an embodiment of the present invention; FIG.
图 24 为本发明实施例提供的一种内存数据的读写处理装置的硬件 结构图;  24 is a hardware structural diagram of a device for reading and writing memory data according to an embodiment of the present invention;
图 25为本发明实施例提供的又一种内存数据的读写处理装置的硬件 结构图。  FIG. 25 is a hardware structural diagram of another apparatus for reading and writing memory data according to an embodiment of the present invention.
具体实施方式 detailed description
下面将结合本发明实施例中的附图, 对本发明实施例中的技术方案 进行清楚、 完整地描述, 显然, 所描述的实施例仅仅是本发明一部分实 施例, 而不是全部的实施例。 基于本发明中的实施例, 本领域普通技术 人员在没有做出创造性劳动前提下所获得的所有其他实施例, 都属于本 发明保护的范围。  The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are only a part of the embodiments of the present invention, but not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
当本地内存与远程内存进行数据交互时, 对于数据量较小的内存数 据读写操作会浪费较多的开销在数据请求包上, 导致传输效率低下, 本 发明实施例提供一种内存数据的读写处理方法, 将具有相同目的节点地 址的请求进行合并, 来提高链路的利用率, 本发明实施例的方法的执行 主体源节点可以是计算机节点 (亦可称为计算节点) , 如图 1 所示, 该 方法包括以下步骤:  When the local memory and the remote memory perform data interaction, the memory data read and write operation with a small amount of data wastes a lot of overhead on the data request packet, resulting in inefficient transmission. The embodiment of the present invention provides a memory data read. The write processing method is to combine the requests with the same destination node address to improve the utilization of the link. The execution source source node of the method of the embodiment of the present invention may be a computer node (also referred to as a computing node), as shown in FIG. 1 . As shown, the method includes the following steps:
1 01、 获取各个待发送请求包,所述待发送请求包包括: 读请求包, 和 /或写请求包。  1 01. Acquire each to-be-sent request packet, where the to-be-sent request packet includes: a read request packet, and/or a write request packet.
所述源节点获取的各个待发送请求包包括读请求包,和 /或写请求 包。 1 02、 解析所述各个待发送请求包的目的节点标识,并判断所述各个 待发送请求包的目的节点标识是否相同。 Each of the to-be-sent request packets acquired by the source node includes a read request packet, and/or a write request packet. The target node identifiers of the to-be-sent request packets are parsed, and the destination node identifiers of the to-be-sent request packets are determined to be the same.
其中, 可以通过两种方式实现上述步骤 1 02。  The above step 012 can be implemented in two ways.
方式一: 先获取各个待发送请求包中携带的目的节点标识, 然后判 断所述各个待发送请求包的目的节点标识是否相同。  Manner 1: First, obtain the destination node identifiers carried in each of the to-be-sent request packets, and then determine whether the destination node identifiers of the to-be-sent request packets are the same.
在方式一中,在所述源节点向目的节点进行内存数据读写处理之前, 参考现有技术中所述源节点向所述目的节点发送内存借用请求, 所述目 的节点根据自身内存的状态决定接受还是拒绝, 当所述目的节点接受所 述源节点的请求后, 所述目的节点将分配的内存地址和地址长度发送给 所述源节点, 所述源节点为所述目的节点的这段内存地址分配本地内存 地址, 并建立地址映射表, 所述地址映射表为本地内存地址与所述目的 节点标识和所述目的节点的内存地址的映射列表。  In the first method, before the source node performs the read/write processing of the memory data to the destination node, the source node sends a memory borrowing request to the destination node according to the prior art, and the destination node determines according to the state of the memory. Accepting or rejecting, after the destination node accepts the request of the source node, the destination node sends the allocated memory address and the address length to the source node, where 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 and 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 a memory address of the destination node, where the destination node identifier And the memory address of the destination node is obtained by the source node by using the address mapping table after obtaining the request that carries the local memory address, as shown in FIG. 2 To read the read request packet, Figure 3 shows the write request packet to be sent. The destination node identifiers carried in the to-be-sent request packets shown in FIG. 2 and/or FIG. 3 are obtained, and the destination node identifiers of the respective to-be-sent request packets are determined to be the same.
方式二: 获取各个待发送请求包中携带的目的节点内存地址; 根据 所述目的节点内存地址, 在地址归属表中查找所述目的节点内存地址归 属的目的节点标识, 所述地址归属表为目的节点内存地址与目的节点标 识的对应关系表;判断所述各个待发送请求包的目的节点标识是否相同。  Manner 2: obtaining a destination node memory address carried in each request packet to be sent; searching for 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 for the purpose a correspondence table between the node memory address and the destination node identifier; determining whether the destination node identifiers of the respective to-be-sent request packets are the same.
在方式二中,釆用 PC I E为例说明,所述待发送读请求包如图 4所示, 所述待发送写请求包如图 5所示, 其中, 所述待发送读请求包和所述待 发送写请求包中携带的地址为所述目的节点内存地址, 在地址归属表中 查找所述目的节点内存地址归属的目的节点标识, 所述地址归属表为目 的节点内存地址与目的节点标识的对应关系表, 例如, 在所述地址归属 表中, 当所述目的节点内存地址为 OHIOOO-OHlfff 时, 对应的目的节点 标识为 1, 所述目的节点内存地址为 0H2000-0H2fff 时, 对应的目的节 点标识为 2, 所述目的节点内存地址为 0H3000-0H2fff 时, 对应的目的 节点标识为 3。 当获取到所述待发送请求包中携带的目的节点内存地址 后, 根据上述地址归属表获取目的节点内存地址对应的目的节点标识。 In the second method, the PC IE is used as an example to illustrate that the read request packet to be sent is as shown in FIG. 4, and the write request packet to be sent is as shown in FIG. 5, wherein the read request packet and the to-be-sent are sent. The address carried in the write request packet is the destination node memory address, and the destination node identifier of the destination node memory address is searched in the address attribution table, where the address attribution table is a correspondence table between the node memory address and the destination node identifier. For example, in the address attribution table, when the destination node memory address is OHIOOO-OHlfff, the corresponding destination node identifier is 1, and the destination node memory address is When the value is 0H2000-0H2fff, the corresponding destination node ID is 2. When the destination node memory address is 0H3000-0H2fff, the corresponding destination node identifier is 3. After obtaining the memory address of the destination node carried in the to-be-sent request packet, the destination node identifier corresponding to the memory address of the destination node is obtained according to the address attribution table.
例如, 当所述待发送读请求包中携带的所述目的节点内存地址为 0H1001, 所述待发送写请求包中携带的所述目的节点内存地址为 OHlffO 时, 所述待发送读请求包和所述待发送写请求包均存在于所述目的节点 标识为 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 OH1ff0, the read request packet to be sent and The to-be-sent write request packet is in the range of the destination node memory address corresponding to the destination node identifier 1 , and therefore the to-be-sent read request packet and the destination node identifier of the to-be-sent write request packet are the same.
103、将所述具有相同目的节点标识的至少两个待发送请求包分别作 为子请求包, 打包为一个合并请求包, 所述合并请求包中包括公共包头 和至少两个子请求包, 所述公共包头中包含合并包标识、 子请求包个数 标识和源节点标识, 所述合并包标识用于指示所述请求包为所述至少两 个子请求包组合的合并包, 所述子请求包个数标识用于指示所述合并请 求包携带的子请求包的个数, 所述子请求包包含子请求包包头和子请求 信息。  103. The at least two to-be-sent request packets having the same destination node identifier are respectively packaged as a sub-request packet, and the merge request packet includes a common packet header and at least two sub-request packets. The header includes a merge packet identifier, a sub-request packet number identifier, and a source node identifier, where the merge packet identifier is used to indicate that the request packet is a combined packet of the at least two sub-request packets, and the number of the sub-request packets The 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.
在将子请求包打包成合并请求包时, 在所述合并请求包中包括公共 包头和子请求包, 所述公共包头中包含合并包标识 (Combine, C) , 用 于指示所述请求包为所述至少两个子请求包组合的合并包, 并将所述合 并包标识置为预定值, 所述预定值指示所述请求包为所述至少两个子请 求包组合的合并包, 例如 C= "1" 时表示请求包为合并请求包; 包括子 请求包个数标识 (Combined Requests Number, CR NUM ) , 用于指示所 述合并请求包携带的子请求包的个数, 在打包为合并请求包时, 获取子 请求包的个数, 将所述个数写入所述子请求包个数标识中; 还包括源节 点标识 (Requester ID) , 用于指示所述合并请求包发出的源节点, 也 就是本地源节点的标识, 另外所述合并请求包的公共包头中还包含各个 子请求包包头中的公共信息。 所述合并请求包中的子请求包包含子请求 包包头和子请求信息, 所述子请求包包头包含所述子请求包的类型When the sub-request packet is packaged into a merge request packet, a common header and a sub-request packet are included in the merge request packet, and the common packet header includes a merge package identifier (Combine, C) for indicating that the request packet is Determining a combined packet of at least two sub-request packet combinations, and setting the merged packet identifier to a predetermined value, where the predetermined value indicates that the request packet is a combined packet of the at least two sub-request packet combinations, for example, C= "1 The time indicates that the request packet is a merge request packet, and includes a number of sub-request packets carried by the merge request packet, which is used when the package request is a merge request packet. And obtaining the number of the sub-request packets, and writing the number into the sub-request packet number identifier; further including a source node identifier (Requester ID), configured to indicate the source node sent by the merge request packet, It is the identifier of the local source node, and the common header of the merge request packet also contains the public information in each sub-request packet header. 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 a type of the sub-request packet
( Type ) 以及长度, 其中长度具体为事物层包长度 ( Trans a c t i on Lay Pa cke t , TLP l eng th ) 。 其中, 类型用于区分所述子请求包是写请求子 包还是读请求子包。 (Type) and length, where the length is specifically Trans a c t i on Lay Pa cke t (TLP l eng th ). The type is used to distinguish whether the sub-request packet is a write request sub-package or a read request sub-package.
其中, 可以将具有相同目的节点标识的写请求子包打包成一个合并 写请求包, 或者将具有相同目的节点标识的读请求子包打包成一个合并 读请求包, 或者为了进一步提高链路利用率, 将具有相同目的节点标识 的写请求子包和读请求子包打包成一个合并读写请求包, 在这里不做限 定。  Wherein, the write request sub-packets with the same destination node identifier may be packaged into one merge write request packet, or the read request sub-packets with the same destination node identifier may be packaged into one merge read request packet, or to further improve link utilization. The write request sub-packet and the read request sub-package with the same destination node identifier are packaged into one merge read-write request packet, which is not limited herein.
通过上述步骤 102 中的方式一打包得到的合并请求包中, 需要提取 所述子请求包中的目的节点标识, 并将所述目的节点标识置于所述合并 请求包的公共包头中。 如图 6所示, 为得到的合并写请求包, 如图 7所 示, 为得到的合并读请求包, 如图 8所示, 为得到的合并读写请求包。  In the merge request packet obtained by the method in the above step 102, the destination node identifier in the sub-request packet needs to be extracted, and the destination node identifier is placed in the common header of the merge request packet. As shown in FIG. 6, for the obtained merge write request packet, as shown in FIG. 7, for the obtained merge read request packet, as shown in FIG. 8, the obtained merge read/write request packet.
通过上述步骤 1 02 中的方式二打包得到的合并请求包中, 如图 9所 示为得到的合并写请求包, 如图 10 所示为得到的合并读请求包, 如图 11所示为得到的合并读写请求包。 另外, 通过方式二中得到的合并请求 包中每个子请求包的包头中还包括请求编码, 是所述源节点对子请求包 的编码, 是每个子请求包的唯一标识。  In the merge request packet obtained by the method 2 packaged in the above step 102, as shown in FIG. 9, the obtained merge write request packet is as shown in FIG. 10, and the obtained merge read request packet is obtained as shown in FIG. The merge read and write request packet. In addition, the header of each sub-request packet in the merge request packet obtained by the second method further includes a request code, which is a code of the source node to the sub-request packet, and is a unique identifier of each sub-request packet.
104、 将所述合并请求包发送给所述目的节点标识对应的目的节点, 所述合并请求包用于指示所述目的节点对所述目的节点的内存数据进行 读和 /或写操作。  The merging request packet is sent to the destination node corresponding to the destination node identifier, where the merging 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 method for reading and writing the memory data provided by the embodiment of the present invention, the source node acquires each to-be-sent request packet, and parses the destination node identifier of each to-be-sent request packet, and determines the destination node of each to-be-sent request packet. Whether the identifiers are the same, and then the at least two to-be-sent request packets having the same destination node identifier are respectively packaged as a sub-request packet. And requesting the packet, and finally 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. . The embodiment of the invention solves the problem that the memory data access operation with less data volume is less wasted on the data request packet in the prior art, resulting in low transmission efficiency and improving the utilization efficiency of the link.
本发明实施例还提供一种内存数据的读写处理方法, 本发明实施例 的方法的执行主体目的节点, 可以为一远程计算机节点, 如图 1 2所示, 该方法包括如下步骤:  The embodiment of the present invention further provides a method for reading and writing memory data. The target node of the method 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:
1 201、 接收请求包;  1 201. Receive a request packet.
1 202、 判断接收的请求包中是否携带合并包标识, 所述合并包标识 用于指示所述请求包为至少两个子请求包组合的合并请求包, 所述子请 求包包括: 读请求子包,和 /或写请求子包。  1 202. Determine whether the received request packet carries a merged package identifier, where the merged package identifier is used to indicate that the request packet is a merge request packet of at least two sub-request packet combinations, where the sub-request package includes: a read request sub-package , and / or write request sub-package.
当所述目的节点接收到请求包时, 先判断所述请求包中是否包含有 合并包标识 C , 例如当判断 C= " 1 " 时, 表示所述请求包为合并请求包。  When the destination node receives the request packet, it first determines whether the request packet includes the merged package identifier C. For example, when it is determined that C= "1", the request packet is a merge request packet.
1 203、 当所述请求包中携带合并包标识时, 确定所述请求包为合并 请求包, 所述合并请求包中包括公共包头和子请求包, 所述公共包头中 包含合并包标识、 子请求包个数标识和源节点标识, 所述子请求包个数 标识用于指示所述合并请求包携带的子请求包的个数, 所述子请求包包 含子请求包包头和子请求信息;  1 203. When the request packet carries the merged package identifier, determine that the request packet is a merge request packet, where the merge request packet includes a common header and a subrequest package, where the common header includes a merge package identifier and a subrequest And the number of the sub-request packets is used to indicate the number of sub-request packets carried by the merge request packet, where the sub-request packet includes a sub-request packet header and sub-request information;
1 204、 根据所述合并请求包中携带的子请求包个数标识和每个子请 求包包头, 提取所述合并请求包中与所述子请求包个数标识对应个数的 子请求包。  1 204. Extract, according to the number of sub-request packets carried in the merge request packet, and each sub-request packet header, and extract a sub-request packet corresponding to the number of sub-request packets in the merge request packet.
当确定接收的请求包为合并请求包时, 所述合并请求包的公共包头 中除了包含有合并包标识, 还包含子请求包个数标识和源节点标识, 其 中子请求包个数标识用于指示所述合并请求包携带的子请求包的个数, 源节点标识用于指示所述合并请求包发出的源节点。 在每个子请求包中 包含子请求包包头和子请求信息。 通过所述合并请求包中携带的子请求包个数标识和每个子请求包包 头, 提取所述合并请求包中与所述子请求包个数标识对应个数的子请求 包, 其中, 可以利用子请求包个数标识和每个子请求包包头中的类型和 长度, 或者利用子请求包个数标识和每个子请求包包头中的格式、 类型 和长度, 提取所述合并请求包中与所述子请求包个数标识对应个数的子 请求包。 When it is determined that the received request packet is a merge request packet, the common packet header of the merge request packet includes, in addition to the merge packet identifier, a sub-request packet number identifier and a source node identifier, where the sub-request packet number identifier is used for And indicating a number of sub-request packets carried by the merge request packet, where the source node identifier is used to indicate a source node that is sent by the merge request packet. Sub-request packet headers and sub-request information are included in each sub-request packet. Extracting, by using the number of sub-request packets carried in the merge request packet, and each sub-request packet header, a sub-request packet corresponding to the number of the sub-request packet identifiers in the merge request packet, where Sub-request packet number identification and type and length in each sub-request packet header, or using the sub-request packet number identifier and the format, type and length in each sub-request packet header, extracting the merge request packet from the The number of sub-request packets identifies the corresponding number of sub-request packets.
1 2 05、 根据所述每个子请求包包头和子请求信息, 处理对应的子请 求包。  1 2 05. Process the corresponding sub-request packet according to each sub-request packet header and sub-request information.
其中, 由于所述合并请求包中可能包含有写请求子包和 /或读请求子 包,可以根据子请求包包头中的格式和 /或类型进行区分写请求子包和读 请求子包,从而将不同请求的写请求子包和读请求子包进行不同的处理。  Wherein, since the merge request packet may include a write request sub-packet and/or a read request sub-package, the write request sub-packet and the read request sub-package may be distinguished according to the format and/or type in the sub-request packet header, thereby The write request sub-packets and read request sub-packets of different requests are processed differently.
参考现有技术中, 对于子写请求, 根据所述写请求子包中携带的所 述目的节点内存地址和有效载荷, 将所述有效载荷写入所述目的节点内 存地址上; 对于子读请求, 根据所述读请求子包中携带的所述目的节点 内存地址, 读取所述目的节点内存地址上的内容, 并返回给所述源节点。  Referring to the prior art, for a sub-write request, the payload is written to the memory address of the destination node according to the memory address and payload of the destination node carried in the write request sub-packet; And reading, according to the memory address of the destination node carried in the read request sub-packet, content on the memory address of the destination node, and returning the content to the source node.
本发明实施例提供的一种内存数据的读写处理方法, 目的节点判断 接收的请求包中是否携带合并包标识, 当所述请求包中携带合并包标识 时, 确定所述请求包为合并请求包, 然后根据所述合并请求包中携带的 子请求包个数标识和每个子请求包包头, 提取所述合并请求包中与所述 子请求包个数标识对应个数的子请求包, 最终根据所述每个子请求包包 头和子请求信息, 处理对应的子请求包。 本发明实施例解决了现有技术 中多个数据量较小的内存数据访存操作浪费较多的开销在数据请求包 上, 导致传输效率低下的问题, 提高了链路的利用效率。  The method for reading and writing the memory data provided by the embodiment of the present invention, the destination node determines whether the received request packet carries the merged package identifier, and when the request packet carries the merged package identifier, determining that the request packet is a merge request a packet, and then, according to the number of sub-request packets carried in the merge request packet and each sub-request packet header, extracting a sub-request packet corresponding to the number of the sub-request packet identifiers in the merge request packet, and finally Corresponding sub-request packets are processed according to each of the sub-request packet headers and sub-request information. The embodiment of the present invention solves the problem that the memory data access operation with less data volume is less wasted on the data request packet in the prior art, resulting in low transmission efficiency and improved link utilization efficiency.
本发明实施例可以应用于 RDMA中,将一计算节点的内存数据中具有 相同目的节点的待发送请求包进行打包合并, 一起发送给所述目的节点 对应的远程计算节点,具体是本地 Ca che将请求发送给本地内存控制器, 进行打包合并处理, 然后发送给远程内存控制器进行拆包处理, 将得到 的请求发送给远程 Cache。 本实施例以 PC IE为例进行说明, 图 4为标准 PC IE中读请求包格式, 图 5为写请求包格式, 其中格式和类型用来区分 所述请求包为读请求包还是写请求包, 事物层包长度用于表示所述请求 包长度, 源节点标识用于指示发送所述请求包的源节点, 读请求包中的 地址表示所述读请求包将要读取的内存数据的地址, 所述写请求包中的 地址表示所述写请求包中将携带的有效载荷, 要写入的内存地址, 其他 字段的含义可以参考现有技术中 PC IE的包格式。下面以上述应用场景为 例来详细介绍一种内存数据的读写处理方法, 如图 1 3所示, 该方法包括 以下步骤: The embodiment of the present invention can be applied to the RDMA, and the to-be-sent request packets having the same destination node in the memory data of a computing node are packaged and combined, and sent together to the remote computing node corresponding to the destination node, specifically, the local Ca che will The request is sent to the local memory controller, packaged and merged, and then sent to the remote memory controller for unpacking, which will get The request is sent to the remote Cache. In this embodiment, a PC IE is taken as an example for description. FIG. 4 is a read request packet format in a standard PC IE, and FIG. 5 is a write request packet format, where a format and a type are used to distinguish whether the request packet is a read request packet or a write request packet. The transaction layer packet length is used to indicate the request packet length, the source node identifier is used to indicate the source node that sends the request packet, and the address in the read request packet indicates the address of the memory data to be read by the read request packet. The address in the write request packet indicates the payload to be carried in the write request packet, and the memory address to be written. The meanings of other fields may refer to the packet format of the PC IE in the prior art. The following application scenario is taken as an example to describe a method for reading and writing memory data in detail. As shown in FIG. 13 , the method includes the following steps:
1 301、 源节点获取各个待发送请求包,所述待发送请求包包括: 读请 求包,和 /或写请求包;  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;
1 302、所述源节点解析所述各个待发送请求包的目的节点标识,并判 断所述各个待发送请求包的目的节点标识是否相同。  1302. The source node parses the destination node identifiers of the to-be-sent request packets, and determines whether the destination node identifiers of the to-be-sent request packets are the same.
获取各个待发送请求包中携带的目的节点内存地址; 根据所述目的 节点内存地址, 在地址归属表中查找所述目的节点内存地址归属的目的 节点标识, 所述地址归属表为目的节点内存地址与目的节点标识的对应 关系表; 判断所述各个待发送请求包的目的节点标识是否相同。  Obtaining a destination node memory address carried in each of the to-be-sent request packets; searching, according to the destination node memory address, the destination node identifier of the destination node memory address in the address attribution table, where the address attribution table is the destination node memory address Corresponding relationship table with the destination node identifier; determining whether the destination node identifiers of the respective to-be-sent request packets are the same.
所述待发送读请求包如图 4所示,所述待发送写请求包如图 5所示, 其中, 所述待发送读请求包和所述待发送写请求包中携带的地址为所述 目的节点内存地址, 在地址归属表中查找所述目的节点内存地址归属的 目的节点标识, 所述地址归属表为目的节点内存地址与目的节点标识的 对应关系表, 例如, 在所述地址归属表中, 当所述目的节点内存地址为 OH I OOO-OHl f f f 时, 对应的目的节点标识为 1 , 所述目的节点内存地址为 0H2000-0H2f f f 时, 对应的目的节点标识为 2 , 所述目的节点内存地址为 0H 3000-0H2f f f 时, 对应的目的节点标识为 3。 当获取到所述待发送请求 包中携带的目的节点内存地址后, 根据上述地址归属表获取目的节点内 存地址对应的目的节点标识。 例如, 当所述待发送读请求包中携带的所述目的节点内存地址为The read request packet to be sent is as shown in FIG. 4, and the write request packet to be sent is as shown in FIG. 5, wherein the address to be sent in the read request packet and the to-be-sent write request packet is a destination node memory address, where the destination node identifier of the destination node is located in the address attribution table, where 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. When the destination node memory address is OH I OOO-OH1 fff, the corresponding destination node identifier is 1 and the destination node memory address is 0H2000-0H2f ff, the corresponding destination node identifier is 2, the purpose When the node memory address is 0H 3000-0H2f ff, the corresponding destination node ID is 3. After obtaining the memory address of the destination node carried in the to-be-sent request packet, the destination node identifier corresponding to the memory address of the destination node is obtained according to the address attribution table. For example, when the memory address of the destination node carried in the read request packet to be sent is
0H1001, 所述待发送写请求包中携带的所述目的节点内存地址为 OHlffO 时, 所述待发送读请求包和所述待发送写请求包均存在于所述目的节点 标识为 1 中对应的目的节点内存地址范围内, 因此所述待发送读请求包 和所述待发送写请求包的目的节点标识相同。 0H1001, when the memory address of the destination node carried in the to-be-sent write request packet is OH1ff0, the to-be-sent read request packet and the to-be-sent write request packet are both present in the destination node identifier 1 The target node has a memory address range, and therefore the read request packet to be sent and the destination node identifier of the to-be-sent write request packet are the same.
1303、 所述源节点将所述具有相同目的节点标识的至少两个待发送 请求包分别作为子请求包, 打包为一个合并请求包, 所述合并请求包中 包括公共包头和至少两个子请求包, 所述公共包头中包含合并包标识、 子请求包个数标识和源节点标识, 所述合并包标识用于指示所述请求包 为所述至少两个子请求包组合的合并包, 所述子请求包个数标识用于指 示所述合并请求包携带的子请求包的个数, 所述子请求包包含子请求包 包头和子请求信息。  1303. The source node separately encapsulates the at least two to-be-sent request packets having the same destination node identifier as a sub-request packet into a merge request packet, where the merge request packet includes a common packet header and at least two sub-request packets. The common packet header includes a merge packet identifier, a sub-request packet number identifier, and a source node identifier, where the merge packet identifier is used to indicate that the request packet is a merge packet of the at least two sub-request packet combinations, and the sub-packet 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 packet includes a sub-request packet header and sub-request information.
其中, 可以将具有相同目的节点标识的写请求子包打包成一个合并 写请求包, 或者将具有相同目的节点标识的读请求子包打包成一个合并 读请求包, 或者为了进一步提高链路利用率, 将具有相同目的节点标识 的写请求子包和读请求子包打包成一个合并读写请求包, 所以所述合并 请求包中包括写请求子包和 /或读请求子包。  Wherein, the write request sub-packets with the same destination node identifier may be packaged into one merge write request packet, or the read request sub-packets with the same destination node identifier may be packaged into one merge read request packet, or to further improve link utilization. The write request sub-packet and the read request sub-packet having the same destination node identifier are packaged into one merge read-write request packet, so the merge request packet includes a write request sub-packet and/or a 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 packet is packaged into a merge request packet, a common header and a sub-request packet are included in the merge request packet, and the common packet header includes a merge packet identifier (Combine, C) for indicating that the request packet is A merge request packet of a sub-request packet combination, for example, C= "1" indicates that the request packet is a merge request packet; and includes a combined request number (CR NUM ) for indicating the carry request packet The number of the sub-request packets further includes a source node identifier (Requester ID), which is used to indicate the source node that is sent by the merge request packet, that is, the identifier of the local source node, and the common header of the merge request packet further includes The public information in the header of each sub-request. The sub-request packet in the merge request packet includes a sub-request packet header and sub-request information, where the sub-request packet header includes a format (Fmt), a type (Type), and a length of the sub-request packet, wherein the length is specifically a transaction layer Packet length (Transaction Lay Packet, TLP length ). The format and type are used to distinguish whether the sub-request packet is a write request sub-package or a read request sub-package.
另外, 每个子请求包的包头中还包括请求编码, 是所述源节点对子 请求包的编码, 是每个子请求包的唯一标识, 以便所述源节点在接收到 所述目的节点返回的响应消息时, 根据所述响应消息中携带的请求编码 来确定所述子请求的完成情况。  In addition, the header of each sub-request packet further includes a request encoding, which is a coding of the sub-request packet by the source node, and is a unique identifier of each sub-request packet, so that the source node receives the response returned by the destination node. In the message, the completion 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 )、 最后字节对齐 (Last DW BE) 和首位字节对齐 ( 1st DW BE) 属于读请求 子包包头, 上述字段的含义可以参考现有技术中 PCIE 中读请求包格式 的。  Specifically, as shown in FIG. 10, the two read request sub-packets are combined to obtain a combined read request packet, where the merged package identifier and the number of the sub-request packet identifiers are newly added additional information, where the number of the sub-request packets is identified. It is 4 bits, and it can be indicated that the number of read request sub-packets included in the combined read request packet is 16. The PCIE originally contains a request encoding (ie, tag) field, which is 8 bits in length. In the combined read request packet, the upper 4 bits of the 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, and match the number represented by the sub-request packet number identification field. Wherein, the communication classification (TC), the pollution reservation bit (EP), the attribute (Attr), and the source node identifier (Requester ID) belong to a common header in the combined read request packet; format (Fmt), type (Type), whether ECRC (TD), TLP length, Request Coding, Last DW BE, and First Byte Alignment (1st DW BE) belong to the read request sub-packet header, the above fields The meaning can be referred to the read request packet format in the PCIE in the prior art.
如图 9所示, 将两个写请求子包合并得到合并写请求包, 所述合并 写请求包中包含字段的含义与图 10 所示的合并读请求包中包含字段的 含义类似, 只是每个写请求子包中还包含有将要写入目的节点的有效载 荷。  As shown in FIG. 9, the two write request sub-packets are combined to obtain a merge write request packet, and the meaning of the field included in the merge write request packet is similar to the meaning of the field included in the merge read request packet shown in FIG. 10, except that The write request subpackage also contains the payload to be written to the destination node.
为了进一步提高链路利用率, 可以将相同目的节点标识的写请求子 包和读请求子包打包成一个合并请求包, 如图 11所示。  To further improve the link utilization, the write request sub-packet and the read request sub-packet of the same destination node identifier may be packaged into one merge request packet, as shown in FIG.
对于上述合并请求包中的子请求, 要按照所述子请求的发送先后顺 序进行打包合并。 1 304、 所述源节点将所述合并请求包发送给所述目的节点标识对应 的目的节点, 所述合并请求包用于指示所述目的节点对所述目的节点的 内存数据进行读和 /或写操作。 For the sub-requests in the above-mentioned merge request packet, the package merge is performed in the order in which the sub-requests are sent. 1304, the source node sends 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 read and/or read memory data of the destination node. Write operation.
1 305、 所述目的节点接收请求包;  1 305. The destination node receives a request packet.
1 306、 所述目的节点判断接收的请求包中是否携带合并包标识, 所 述合并包标识用于指示所述请求包为至少两个子请求包组合的合并请求 包, 所述子请求包包括: 读请求子包,和 /或写请求子包。  1 306. The destination node determines whether the received request packet carries a merged package identifier, where the merged package identifier is used to indicate that the request packet is a combined request packet of at least two sub-request packet combinations, where the sub-request package includes: Read request sub-packages, and/or write request sub-packages.
当所述目的节点接收到请求包时, 先判断所述请求包中是否包含有 合并包标识 C , 例如当判断 C= " 1 " 时, 表示所述请求包为合并请求包。  When the destination node receives the request packet, it first determines whether the request packet includes the merged package identifier C. For example, when it is determined that C= "1", the request packet is a merge request packet.
1 307、 当所述请求包中携带合并包标识时, 确定所述请求包为合并 请求包, 所述合并请求包中包括公共包头和子请求包, 所述公共包头中 包含合并包标识、 子请求包个数标识和源节点标识, 所述子请求包个数 标识用于指示所述合并请求包携带的子请求包的个数, 所述子请求包包 含子请求包包头和子请求信息;  1 307. When the request packet carries the merged package identifier, determine that the request packet is a merge request packet, where the merge request packet includes a common header and a subrequest package, where the common header includes a merge package identifier and a subrequest. And the number of the sub-request packets is used to indicate the number of sub-request packets carried by the merge request packet, where the sub-request packet includes a sub-request packet header and sub-request information;
1 308、 根据所述合并请求包中携带的子请求包个数标识和每个子请 求包包头, 提取所述合并请求包中与所述子请求包个数标识对应个数的 子请求包。  1 308. Extract, according to the number of sub-request packets carried in the merge request packet and each sub-request packet header, a sub-request packet corresponding to the number of sub-request packet identifiers in the merge request packet.
当判断所述请求包为合并请求包时, 根据所述子请求包个数标识, 以及每个子请求包的格式、 类型以及长度, 获取每个子请求包。 另外, 由于所述合并请求包中可能包含有写请求子包和 /或读请求子包,可以根 据子请求包包头中的格式和类型进行区分写请求子包和读请求子包, 从 而将不同请求的写请求子包和读请求子包进行不同的处理。  When it is determined that the request packet is a merge request packet, each sub-request packet is obtained according to the number of the sub-request packets, and the format, type, and length of each sub-request packet. In addition, since the merge request packet may include a write request sub-packet and/or a read request sub-package, the write request sub-package and the read request sub-package may be distinguished according to the format and type in the sub-request packet header, thereby being different. The requested write request sub-packet and the read request sub-package are processed differently.
1 309、 根据所述每个子请求包包头和子请求信息, 处理对应的子请 求包。  1 309. Process the corresponding sub-request packet according to each sub-request packet header and sub-request information.
根据写请求子包包头中的写请求标识、 所述写请求子包的写请求信 息中的待写入数据以及待写入的目的节点内存地址, 将所述待写入数据 写入所述目的节点内存地址; 和 /或, 根据读请求子包包头中的读请求标 识, 以及所述读请求子包的读请求信息中的待读取数据所处的目的节点 内存地址, 在所述目的节点内存地址中读取所述待读取数据。 Writing the data to be written into the destination according to the write request identifier in the write request sub-packet header, 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 Node memory address; and/or, according to the read request header in the read request sub-packet header And the memory address of the destination node where the data to be read is located in the read request information of the read request sub-packet, and the data to be read is read in the memory address of the destination node.
进一步地, 为了所述目的节点对子请求包进行处理之后, 便于向所 述源节点发送响应消息, 将所述源节点标识写入每个子请求包的子请求 包包头中, 另外也可将所述合并请求包中的公共包头的其他信息写入每 个子请求包的子请求包包头中, 使得每个子请求包转换成合并之前的格 式。  Further, after the destination node processes the sub-request packet, it is convenient to send a response message to the source node, and write the source node identifier into a sub-request packet header of each sub-request packet, or The other information of the common header in the merge request packet is written into the sub-request packet header of each sub-request packet, so that each sub-request packet is converted into the format before the merge.
另外, 所述目的节点在对子请求处理之后, 可以向所述源节点返回 响应消息, 以告知所述源节点每个子请求的完成情况。 可以通过以下两 种方式进行反馈:  In addition, after processing the sub-request, the destination node may return a response message to the source node to inform the source node of the completion status of each sub-request. There are two ways to get feedback:
方式一:  method one:
所述目的节点将处理后的子请求包的响应消息分别发送出去: 获取所述写请求子包中的所述源节点标识;  The destination node sends the response message of the processed sub-request packet separately: acquiring the source node identifier in the write request sub-package;
向所述源节点标识对应的源节点发送写请求响应消息, 所述写请求 响应消息中包含写请求成功的所述写请求子包对应的写请求标识。  Sending a write request response message to the source node corresponding to the source node identifier, where the write request response message includes a write request identifier corresponding to the write request sub-package with a successful write request.
其中, 当所述写请求子包为非推送式写请求时, 需要所述目的节点 向所述源节点发送反馈, 或者可以要求完成写请求的写请求子包, 均向 所述源节点发送响应消息。  When the write request sub-packet is a non-push-type write request, the destination node needs to send feedback to the source node, or may request a write request sub-packet that completes the write request, and sends a response to the source node. Message.
所述源节点接收所述目的节点发送的写请求响应消息, 所述写请求 响应消息中包含写请求成功的所述写请求子包对应的写请求标识。  The source node receives 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 sub-package with a successful write request.
参考现有技术中, 所述源节点在接收到写请求响应消息之后, 根据 携带的写请求标识,与发送出去的写请求子包中的写请求标识进行对比, 可以得到哪些写请求子包在所述目的节点成功写入, 哪些写请求子包没 有写入, 对于没有写请求成功的请求包可以再次发送。  Referring to the prior art, after receiving the write request response message, the source node compares with the write request identifier in the sent write request sub-packet according to the carried write request identifier, and obtains which write request sub-packets are available. The destination node is successfully written, which write request sub-packets are not written, and the request packet for which no write request is successful may be sent again.
和 /或,  and / or,
所述目的节点获取所述读请求子包中的所述源节点标识;  Obtaining, by the destination node, the source node identifier in the read request sub-package;
向所述源节点标识对应的源节点发送读请求响应消息, 所述读请求 响应消息中包含读请求成功的所述读请求子包对应的请求编码, 以及获 取的有效载荷, 所述有效载荷为所述子读请求获取的数据。 Sending a read request response message to the source node corresponding to the source node identifier, the read request The response message includes a request code corresponding to the read request sub-packet whose read request is successful, and an acquired payload, where the payload is data acquired by the sub-read request.
所述源节点接收所述目的节点发送的读请求响应消息, 所述读请求 响应消息中包含读请求成功的所述读请求子包对应的读请求标识, 以及 获取的有效载荷, 所述有效载荷为所述子读请求获取的数据。  Receiving, by the source node, a read request response message sent by the destination node, where the read request response message includes a read request identifier corresponding to the read request sub-package with a successful read request, and the acquired payload, the payload The data obtained for the sub-read request.
所述读请求子包中的有效载荷为所述目的节点根据所述读请求子包 中的远程内存地址获取到的数据, 所述目的节点将成功获取到有效载荷 的子读请求对应的读请求响应消息发送给所述源节点, 所述源节点在接 收到所述有效载荷后, 根据发送所述读请求子包时, 记载的本端哪些地 址需要读取数据, 按照所述读请求标识将对应的有效载荷读回到相应地 址即可。  The payload in the read request sub-packet is data obtained by the destination node according to the remote memory address in the read request sub-package, and the destination node will successfully obtain the read request corresponding to the sub-read request of the payload. Sending, by the source node, the source node, after receiving the payload, according to which addresses of the local end need to read data when the read request sub-packet is sent, according to the read request identifier The corresponding payload can be read back to the corresponding address.
方式二:  Method 2:
判断各个待发送的响应消息对应的源节点标识是否相同;  Determining whether the source node identifiers corresponding to the respective response messages to be sent are the same;
将具有相同源节点标识的所述待发送的响应消息作为子响应消息, 打包为一个合并响应消息包, 所述合并响应消息包中包括写请求子响应 消息和 /或读请求子响应消息;  The response message to be sent with the same source node identifier is packaged as a sub-response message packet, and the merge response message packet includes a write request sub-response message and/or a read request sub-response message.
将所述合并响应消息包发送给所述源节点标识对应的源节点。  Sending the merge response message packet to a source node corresponding to the source node identifier.
所述源节点在获取到所述合并响应消息包后, 根据该包中的写请求 标识和 /或读请求标识获取对应的响应消息,获取之后的处理方式与方式 一中描述的相同, 此处不再赘述。  After obtaining the merge response message packet, the source node obtains a corresponding response message according to the write request identifier and/or the read request identifier in the packet, and the processing manner after the acquisition is the same as that described in the first method, where No longer.
本发明实施例中的方法, 也可以应用于系统中的多个端口之间的数 据传输, 根据所述各个待发送请求包对应的目的节点标识, 在路由表中 查找所述目的节点标识对应的路由端口, 所述路由表包含所述目的节点 标识对应的路由端口, 所述路由端口为所述待发送请求包到达所述目的 节点的路径上的端口,判断所述各个待发送请求包的路由端口是否相同, 将具有相同路由端口的待发送请求包进行合并, 得到合并请求包, 并将 所述合并请求包发送给所述路由端口。 所述路由端口接收到所述合并请 求包之后, 进行拆包操作, 提取所述合并请求包的公共包头中的源节点 标识, 写入每个子请求包的包头中, 然后继续后面的转发操作。 本发明实施例提供一种内存数据的读写处理装置 14 , 所述内存数据 的读写处理装置 14可以存在于计算节点中, 也可以就是一个计算节点, 如图 1 4所示, 所述装置包括获取单元 141、 判断单元 142、 处理单元 14 3 和发送单元 144。 The method in the embodiment of the present invention may also be applied to data transmission between multiple ports in the system, and searching for the destination node identifier in the routing table according to the destination node identifier corresponding to each to-be-sent request packet. a routing port, the routing table includes a routing port corresponding to the destination node identifier, where the routing port is a port on the path of the to-be-sent request packet to the destination node, and determining a route of each to-be-sent request packet If the ports are the same, the to-be-sent request packets with the same routing port are merged to obtain a merge request packet, and the merge request packet is sent to the routing port. The routing port receives the merge request After the packet is requested, the unpacking operation is performed, the source node identifier in the common header of the merge request packet is extracted, written in the header of each sub-request packet, and then the subsequent forwarding operation is continued. The embodiment of the present invention provides a memory data read/write processing device 14. The memory data read/write processing device 14 may be present in a computing node, or may be a computing node, as shown in FIG. The acquisition unit 141, the determination unit 142, the processing unit 143, and the transmission unit 144 are included.
其中, 获取单元 141 , 用于获取各个待发送请求包,所述待发送请求 包包括: 读请求包,和 /或写请求包;  The obtaining unit 141 is configured to obtain each to-be-sent request packet, where the to-be-sent request packet includes: a read request packet, and/or a write request packet;
判断单元 1 42 , 用于解析所述各个待发送请求包的目的节点标识,并 判断所述各个待发送请求包的目的节点标识是否相同;  The determining unit 1 42 is configured to parse the destination node identifiers of the to-be-sent request packets, and determine whether the destination node identifiers of the to-be-sent request packets are the same;
处理单元 14 3 , 用于将所述具有相同目的节点标识的至少两个待发 送请求包分别作为子请求包, 打包为一个合并请求包, 所述合并请求包 中包括公共包头和至少两个子请求包,所述公共包头中包含合并包标识、 子请求包个数标识和源节点标识, 所述合并包标识用于指示所述请求包 为所述至少两个子请求包组合的合并包, 所述子请求包个数标识用于指 示所述合并请求包携带的子请求包的个数, 所述子请求包包含子请求包 包头和子请求信息;  The processing unit 14 3 is configured to package the at least two to-be-sent request packets having the same destination node identifier as a sub-request packet into a merge request packet, where the merge request packet includes a common header and at least two sub-requests. a packet, where the common packet header includes a merge packet identifier, a sub-request packet number identifier, and a source node identifier, where the merge packet identifier is used to indicate that the request packet is a merge packet of the at least two sub-request packet combinations, 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 packet includes a sub-request packet header 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, where the merge request packet is used to instruct the destination node to read and/or write the memory data of the destination node. operating.
本发明实施例提供的一种内存数据的读写处理装置, 获取各个待发 送请求包,并解析所述各个待发送请求包的目的节点标识,判断所述各个 待发送请求包的目的节点标识是否相同, 然后将所述具有相同目的节点 标识的至少两个待发送请求包分别作为子请求包, 打包为一个合并请求 包, 最终将所述合并请求包发送给所述目的节点标识对应的目的节点, 所述合并请求包用于指示所述目的节点对所述目的节点的内存数据进行 读和 /或写操作。本发明实施例解决了现有技术中多个数据量较小的远程 数据访存操作浪费较多的开销在数据请求包上, 导致传输效率低下的问 题, 提高了链路的利用效率。 The device for reading and writing the memory data provided by the embodiment of the present invention acquires each to-be-sent request packet, and parses the destination node identifier of each to-be-sent request packet, and determines whether the destination node identifier of each to-be-sent request packet is The same, the at least two to-be-sent request packets having the same destination node identifier are respectively packaged as a sub-request packet, and the merge request packet is finally sent to the destination node corresponding to the destination node identifier. The merge request packet is used to indicate that the destination node performs the memory data of the destination node. Read and / or write operations. The embodiment of the invention solves the problem that the remote data access operation with a small amount of data is wasted more on the data request packet in the prior art, resulting in low transmission efficiency and improving the utilization efficiency of the link.
可选的, 如图 15所示, 所述处理单元包括:  Optionally, as shown in FIG. 15, the processing unit includes:
第一标识模块 151, 用于将所述合并包标识置为预定值, 所述预定 值指示所述请求包为所述至少两个子请求包组合的合并包;  The first identifier module 151 is configured to set the merged packet identifier to a predetermined value, where the predetermined value indicates that the request packet is a merged package of the at least two sub-request packet combinations;
第二标识模块 152, 用于获取子请求包的个数, 将所述个数写入所 述子请求包个数标识中。  The second identifier module 152 is configured to obtain the number of sub-request packets, and write the number into the identifier of the sub-request packet.
可选的, 如图 16所示, 所述判断单元包括:  Optionally, as shown in FIG. 16, the determining unit includes:
第一获取模块 161, 用于获取各个待发送请求包中携带的目的节点 标识;  The first obtaining module 161 is configured to obtain a destination node identifier carried in each request packet to be sent;
第一判断模块 162, 用于判断所述各个待发送请求包的目的节点标 识是否相同;  The first determining module 162 is configured to determine whether the destination node identifiers of the to-be-sent request packets are the same;
所述处理单元还包括:  The processing unit further includes:
第三标识模块 163, 用于提取所述子请求包中的目的节点标识, 并 将所述目的节点标识置于所述合并请求包的公共包头中。  The third identifier module 163 is configured to extract a destination node identifier in the sub-request packet, and place the destination node identifier in a common header of the merge request packet.
可选的, 如图 17所示, 所述判断单元包括:  Optionally, as shown in FIG. 17, the determining unit includes:
第二获取模块 171, 用于获取各个待发送请求包中携带的目的节点 内存地址;  The second obtaining module 171 is configured to obtain a memory address of the destination node carried in each request packet to be sent;
第一查找模块 172, 用于根据所述目的节点内存地址, 在地址归属 表中查找所述目的节点内存地址归属的目的节点标识, 所述地址归属表 为目的节点内存地址与目的节点标识的对应关系表;  The first search module 172 is configured to search, according to the destination node memory address, the destination node identifier of the destination node memory address in the address attribution table, where the address attribution table is a correspondence between the destination node memory address and the destination node identifier. Relational tables;
第二判断模块 173, 用于判断所述各个待发送请求包的目的节点标 识是否相同。  The second determining module 173 is configured to determine whether the destination node identifiers of the to-be-sent request packets are the same.
可选的, 所述处理单元得到的所述合并请求包中包括的子请求包包 括写请求子包和 /或读请求子包,写请求子包包头中包括识别所述写请求 子包的写请求标识, 所述写请求子包中的写请求信息包括待写入所述目 的节点的数据以及待写入的所述目的节点内存地址, 读请求子包包头中 包括识别所述读请求子包的读请求标识, 所述读请求子包中的读请求信 息包括待读取数据所处的所述目的节点内存地址, 如图 18所示, 所述装 置还包括: Optionally, the sub-request packet included in the merge request packet 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 that identifies the write request sub-packet. Requesting an identifier, the write request information in the write request sub-package includes a to-be-written target The data of the node and the memory address of the destination node to be written, the read request sub-packet header includes a read request identifier identifying the read request sub-packet, and the read request information in the read request sub-package includes a to-be-read The memory address of the destination node where the data is located, as shown in FIG. 18, the device further 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 sub-package with a successful write request; and/or, a read request response message sent by the destination node, where the read request response message includes a read request identifier corresponding to the read request sub-package with a successful read request, and a read payload, where the payload is the read request The data corresponding to the remote memory address in the subpackage.
可选的, 如图 19所示, 所述判断单元还包括:  Optionally, as shown in FIG. 19, the determining unit further includes:
第二查找模块 191 , 用于根据所述各个待发送请求包对应的目的节 点标识, 在路由表中查找所述目的节点标识对应的路由端口, 所述路由 表包含所述目的节点标识对应的路由端口, 所述路由端口为所述待发送 请求包到达所述目的节点的路径上的端口;  The second search module 191 is configured to search for a routing port corresponding to the destination node identifier in the routing table according to the destination node identifier corresponding to the to-be-sent request packet, where the routing table includes a route corresponding to the destination node identifier. a port, where the routing port is a port on a path of the to-be-sent request packet to the destination node;
第三判断模块 192 , 用于判断所述各个待发送请求包的路由端口是 否相同。  The third determining module 192 is configured to determine whether the routing ports of the to-be-sent request packets are the same.
相应地, 本发明实施例还提供一种内存数据的读写处理装置 20 , 所 述内存数据的读写处理装置 20可以存在于计算节点中,也可以就是一个 计算节点, 如图 20所示, 所述装置包括接收单元 201、 判断单元 202、 确定单元 203、 提取单元 204和处理单元 205。  Correspondingly, the embodiment of the present invention further provides a memory data read/write processing device 20, wherein the memory data read/write processing device 20 may exist in a computing node, or may be a computing node, as shown in FIG. The apparatus includes a receiving unit 201, a determining unit 202, a determining unit 203, an extracting unit 204, and a processing unit 205.
接收单元 201 , 用于接收请求包;  The receiving unit 201 is configured to receive a request packet.
判断单元 202 , 用于判断接收的请求包中是否携带合并包标识, 所 述合并包标识用于指示所述请求包为至少两个子请求包组合的合并请求 包, 所述子请求包包括: 读请求子包,和 /或写请求子包;  The determining unit 202 is configured to determine whether the received request packet carries a merged package identifier, where the merged package identifier is used to indicate that the request packet is a combined request packet of at least two sub-request packet combinations, where the sub-request package includes: Requesting a sub-package, and/or writing a request sub-package;
确定单元 203 , 用于当所述请求包中携带合并包标识时, 确定所述 请求包为合并请求包, 所述合并请求包中包括公共包头和子请求包, 所 述公共包头中包含合并包标识、 子请求包个数标识和源节点标识, 所述 子请求包个数标识用于指示所述合并请求包携带的子请求包的个数, 所 述子请求包包含子请求包包头和子请求信息; The determining unit 203 is configured to: when the request packet carries the merged package identifier, determine that the request packet is a merge request packet, where the merge request packet includes a common header and a sub-request packet, where The common packet header includes a merging packet identifier, a sub-request packet number identifier, and a source node identifier, where the sub-request packet number identifier is used to indicate the number of sub-request packets carried by the merging request packet, and the sub-request packet Contains subrequest packet header and subrequest information;
提取单元 2 04 , 用于根据所述合并请求包中携带的子请求包个数标 识和每个子请求包包头, 提取所述合并请求包中与所述子请求包个数标 识对应个数的子请求包;  The extracting unit 2 04 is configured to extract, according to the number of sub-request packets carried in the merge request packet and each sub-request packet header, the number of the number of the sub-request packet identifiers in the merge request packet Request package
处理单元 2 05 , 用于根据所述每个子请求包包头和子请求信息, 处 理对应的子请求包。  The processing unit 2 05 is configured to process the corresponding sub-request packet according to each of the sub-request packet header and sub-request information.
本发明实施例提供的一种内存数据的读写处理装置, 判断接收的请 求包中是否携带合并包标识, 当所述请求包中携带合并包标识时, 确定 所述请求包为合并请求包, 然后根据所述合并请求包中携带的子请求包 个数标识和每个子请求包包头, 提取所述合并请求包中与所述子请求包 个数标识对应个数的子请求包, 最终根据所述每个子请求包包头和子请 求信息, 处理对应的子请求包。 本发明实施例解决了现有技术中多个数 据量较小的远程数据访存操作浪费较多的开销在数据请求包上, 导致传 输效率低下的问题, 提高了链路的利用效率。  The apparatus for reading and writing the memory data provided by the embodiment of the present invention determines whether the received request packet carries the merged package identifier, and when the request packet carries the merged package identifier, determining that the request packet is a merge request packet, And then, according to the number of sub-request packets carried in the merge request packet and each sub-request packet header, extracting a sub-request packet corresponding to the number of the sub-request packet identifiers in the merge request packet, and finally according to the Each sub-request packet header and sub-request information is processed, and the corresponding sub-request packet is processed. The embodiment of the invention solves the problem that the remote data access operation with a small amount of data is wasteful on the data request packet in the prior art, which causes the transmission efficiency to be low, and improves the utilization efficiency of the link.
可选的, 如图 2 1所示, 所述处理单元包括:  Optionally, as shown in FIG. 21, the processing unit includes:
第一处理模块 2 1 1 , 用于根据写请求子包包头中的写请求标识、 所 述写请求子包的写请求信息中的待写入数据以及待写入的目的节点内存 地址, 将所述待写入数据写入所述目的节点内存地址;  The first processing module 2 1 1 is configured to: according to the write request identifier in the write request sub-packet header, the to-be-written data in the write request information of the write request sub-packet, and the memory address of the destination node to be written, Writing the write data to the memory address of the destination node;
第二处理模块 2 1 2 , 用于根据读请求子包包头中的读请求标识, 以 及所述读请求子包的读请求信息中的待读取数据所处的目的节点内存地 址, 在所述目的节点内存地址中读取所述待读取数据。  The second processing module 2 1 2 is configured to: according to the read request identifier in the read request sub-packet header, and the memory address of the destination node where the data to be read in the read request information of the read request sub-package is located, The data to be read is read in the destination node memory address.
可选的, 如图 2 2所示, 所述装置还包括:  Optionally, as shown in FIG. 2, the device further includes:
标识写入单元 22 1 , 用于将所述源节点标识写入每个子请求包的子 请求包包头中, 以便于所述目的节点向所述源节点发送响应消息。  The identifier writing unit 22 1 is configured to write the source node identifier into a sub-request packet header of each sub-request packet, so that the destination node sends a response message to the source node.
可选的, 所述判断单元, 还用于判断各个待发送的响应消息对应的 源节点标识是否相同; Optionally, the determining unit is further configured to determine, according to each response message to be sent, Whether the source node identifiers are the same;
所述处理单元, 还用于将具有相同源节点标识的所述待发送的响应 消息作为子响应消息, 打包为一个合并响应消息包, 所述合并响应消息 包中包括写请求子响应消息和 /或读请求子响应消息;  The processing unit is further configured to package the to-be-sent response message with the same source node identifier as a sub-response message, and the merge response message packet includes a write request sub-response message and/or Or read the request sub-response message;
如图 23所示, 所述装置还包括:  As shown in FIG. 23, the device further includes:
发送单元 231, 用于将所述合并响应消息包发送给所述源节点标识 对应的源节点。  The sending unit 231 is configured to send the merge response message packet to a 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 a source node identifier in a common header of the merge request packet, and write the header of each sub-request packet.
上述装置 14和装置 20的操作过程, 参见上述内存数据的读写处理 方法的处理过程。 上述图 14至图 19所示的内存数据的读写处理装置可基于计算机或 者其他网络设备的硬件结构来实现, 如图 24所示, 内存数据的读写处理 装置 24的硬件结构包括存储器 241、收发器 242、处理器 243和总线 244。  For the operation of the above device 14 and device 20, refer to the processing of the above-mentioned read and write processing method of the memory data. The read/write processing device for the memory data shown in FIG. 14 to FIG. 19 can be implemented based on the hardware structure of a computer or other network device. As shown in FIG. 24, the hardware structure of the read/write processing device 24 for the in-memory data includes the memory 241. Transceiver 242, processor 243, and bus 244.
其中, 处理器 243、 存储器 241和收发器 242通过总线 244连接。 存储器 241可以是只读存储器 ( Read Only Memory, ROM) , 静态存 储设备, 动态存储设备或者随机存取存储器 (Random Access Memory, RAM)。 存储器 241可以存储操作系统和其他应用程序的指令以及应用数 据。 存储器 241中存储的指令由处理器 243来运行执行。  The processor 243, the memory 241, and the transceiver 242 are connected by a bus 244. The memory 241 may be a Read Only Memory (ROM), a static storage device, a dynamic storage device, or a Random Access Memory (RAM). The memory 241 can store instructions of the operating system and other applications as well as application data. The instructions stored in the memory 241 are executed by the processor 243 for execution.
本发明实施例中存储器 241可用于存储实现图 14至图 19所示实施 例中各功能单元的指令。  The memory 241 in the embodiment of the present invention can be used to store instructions for implementing the functional units in the embodiments shown in FIGS. 14 to 19.
收发器 242 用来实现内存数据的读写处理装置 24 与其他设备的通 信。  The transceiver 242 is used to implement communication between the read/write processing device 24 of the memory data and other devices.
本发明实施例中,收发器 242用于发送合并请求包和接收响应消息。 处理器 243 可以釆用通用的中央处理器 ( Central Processing Unit, CPU ) , 处理器, 应用专用集成电路 ( Application Specific Integrated Circuit, ASIC ) , 或者一个或多个集成电路, 用于执行相 关程序。 In the embodiment of the present invention, the transceiver 242 is configured to send a merge request packet and receive a response message. The processor 243 can use a general-purpose central processing unit (Central Processing) Unit, CPU), processor, 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 configured to execute the instructions in the memory 241, and specifically:
获取各个待发送请求包,所述待发送请求包包括:读请求包,和 /或写 请求包;  Obtaining each to-be-sent request packet, where the to-be-sent request packet includes: a read request packet, and/or a write request packet;
解析所述各个待发送请求包的目的节点标识,并判断所述各个待发 送请求包的目的节点标识是否相同;  Parsing the destination node identifiers of the to-be-sent request packets, and determining whether the destination node identifiers of the respective to-be-sent request packets are the same;
将所述具有相同目的节点标识的至少两个待发送请求包分别作为子 请求包, 打包为一个合并请求包, 所述合并请求包中包括公共包头和至 少两个子请求包, 所述公共包头中包含合并包标识、 子请求包个数标识 和源节点标识, 所述合并包标识用于指示所述请求包为所述至少两个子 请求包组合的合并包, 所述子请求包个数标识用于指示所述合并请求包 携带的子请求包的个数,所述子请求包包含子请求包包头和子请求信息; 将所述合并请求包通过收发器 242发送给所述目的节点标识对应的 目的节点, 所述合并请求包用于指示所述目的节点对所述目的节点的内 存数据进行读和 /或写操作。  The at least two to-be-sent request packets having the same destination node identifier are respectively packaged as a sub-request packet, and the merge request packet includes a common header and at least two sub-request packets, where the common header is included. The merging packet identifier, the sub-request packet number identifier, and the source node identifier, where the merging packet identifier is used to indicate that the request packet is a combined packet of the at least two sub-request packet combinations, and the sub-request packet number identifier is used by And indicating the number of sub-request packets carried by the merge request packet, where the sub-request packet includes a sub-request packet header and sub-request information; and sending the merge request packet to the destination node identifier through the transceiver 242. a node, the merge request packet is used to instruct the destination node to perform a read and/or write operation on the memory data of the destination node.
本发明实施例提供的一种内存数据的读写处理装置, 获取各个待发 送请求包,并解析所述各个待发送请求包的目的节点标识,判断所述各个 待发送请求包的目的节点标识是否相同, 然后将所述具有相同目的节点 标识的至少两个待发送请求包分别作为子请求包, 打包为一个合并请求 包, 最终将所述合并请求包发送给所述目的节点标识对应的目的节点, 所述合并请求包用于指示所述目的节点对所述目的节点的内存数据进行 读和 /或写操作。本发明实施例解决了现有技术中多个数据量较小的远程 数据访存操作浪费较多的开销在数据请求包上, 导致传输效率低下的问 题, 提高了链路的利用效率。 其中, 处理器 243 中的具体处理过程可参考方法实施例部分以及图 14至图 19所示的装置实施例部分, 这里不再赘述。 The device for reading and writing the memory data provided by the embodiment of the present invention acquires each to-be-sent request packet, and parses the destination node identifier of each to-be-sent request packet, and determines whether the destination node identifier of each to-be-sent request packet is The same, the at least two to-be-sent request packets having the same destination node identifier are respectively packaged as a sub-request packet, and the merge request packet is finally sent to the destination node corresponding to the destination node identifier. The merge request packet is used to instruct the destination node to perform a read and/or write operation on the memory data of the destination node. The embodiment of the invention solves the problem that the remote data access operation with a small amount of data is wasted more on the data request packet in the prior art, resulting in low transmission efficiency and improving the utilization efficiency of the link. The specific processing procedure in the processor 243 can refer to the method embodiment part and the apparatus embodiment part shown in FIG. 14 to FIG. 19, and details are not described herein again.
总线 244可包括一通路, 在内存数据的读写处理装置各个部件 (例 如处理器 243、 存储器 241和收发器 242 ) 之间传送信息。  Bus 244 can include a path for communicating information between various components of the read and write processing device of memory data, such as processor 243, memory 241, and transceiver 242.
上述图 20至图 23所示的内存数据的读写处理装置均可基于计算机 的硬件结构来实现, 如图 25所示, 内存数据的读写处理装置 25的硬件 结构包括存储器 251、 收发器 252, 处理器 253和总线 254。  The read/write processing device for the memory data shown in FIG. 20 to FIG. 23 described above can be implemented based on the hardware configuration of the computer. As shown in FIG. 25, the hardware structure of the read/write processing device 25 for the in-memory data includes the memory 251 and the transceiver 252. , processor 253 and bus 254.
其中, 处理器 253、 存储器 251和收发器 252通过总线 254通信连 接。  The processor 253, the memory 251, and the transceiver 252 are communicatively coupled via a bus 254.
存储器 251可以是只读存储器 (Read Only Memory, ROM) , 静态 存储设备, 动态存储设备或者随机存取存储器( Random Access Memory, RAM) 。 存储器 251可以存储操作系统和其他应用程序的指令以及应用 数据。 存储器 251中存储的指令由处理器 253来运行执行。  The memory 251 may be a read only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 251 can store instructions of the operating system and other applications as well as application data. The instructions stored in the memory 251 are executed by the processor 253 for execution.
本发明实施例中存储器 251可用于存储实现图 20至图 23所示实 施例中各功能单元的指令。  The memory 251 in the embodiment of the present invention can be used to store instructions for implementing the functional units in the embodiments shown in Figs. 20 to 23.
收发器 252用来实现内存数据的读写处理装置 25与其他设备之间 的通信。  The transceiver 252 is used to implement communication between the read and write processing device 25 of the memory data and other devices.
本发明实施例中, 收发器 252 用于接收合并请求包和发送响应消 息。  In the embodiment of the present invention, the transceiver 252 is configured to receive a merge request packet and send a response message.
处理器 253 可以釆用通用的中央处理器 ( Central Processing Unit, CPU ) , 处理器, 应用专用集成电路 ( Application Specific Integrated Circuit, ASIC ) , 或者一个或多个集成电路, 用于执行相 关程序。  The processor 253 can use a general-purpose central processing unit (CPU), a processor, an 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 configured to execute the instructions in the memory 251, and specifically:
通过收发器 252接收请求包;  Receiving a request packet through the transceiver 252;
判断接收的请求包中是否携带合并包标识, 所述合并包标识用于指 示所述请求包为至少两个子请求包组合的合并请求包, 所述子请求包包 括: 读请求子包,和 /或写请求子包; 当所述请求包中携带合并包标识时,确定所述请求包为合并请求包, 所述合并请求包中包括公共包头和子请求包, 所述公共包头中包含合并 包标识、 子请求包个数标识和源节点标识, 所述子请求包个数标识用于 指示所述合并请求包携带的子请求包的个数, 所述子请求包包含子请求 包包头和子请求信息; Determining whether the received request packet carries a merged package identifier, where the merged package identifier is used to indicate that the request packet is a merge request packet of at least two sub-request packet combinations, where the sub-request package includes: a read request sub-package, and/ Or write a request sub-package; When the request packet carries the merged package identifier, the request packet is determined to be a merge request packet, where the merge request packet includes a common header and a sub-request packet, where the common header includes the merge packet identifier and the number of sub-request packets. The identifier of the sub-request packet 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;
根据所述合并请求包中携带的子请求包个数标识和每个子请求包包 头, 提取所述合并请求包中与所述子请求包个数标识对应个数的子请求 包;  And extracting, according to the number of the sub-request packets and the sub-request packet headers carried in the merge request packet, a sub-request packet corresponding to the number of the sub-request packet identifiers in the merge request packet;
根据所述每个子请求包包头和子请求信息, 处理对应的子请求包。 本发明实施例提供的一种内存数据的读写处理装置, 判断接收的请 求包中是否携带合并包标识, 当所述请求包中携带合并包标识时, 确定 所述请求包为合并请求包, 然后根据所述合并请求包中携带的子请求包 个数标识和每个子请求包包头, 提取所述合并请求包中与所述子请求包 个数标识对应个数的子请求包, 最终根据所述每个子请求包包头和子请 求信息, 处理对应的子请求包。 本发明实施例解决了现有技术中多个数 据量较小的远程数据访存操作浪费较多的开销在数据请求包上, 导致传 输效率低下的问题, 提高了链路的利用效率。  Corresponding sub-request packets are processed according to each of the sub-request packet headers and sub-request information. The apparatus for reading and writing the memory data provided by the embodiment of the present invention determines whether the received request packet carries the merged package identifier, and when the request packet carries the merged package identifier, determining that the request packet is a merge request packet, And then, according to the number of sub-request packets carried in the merge request packet and each sub-request packet header, extracting a sub-request packet corresponding to the number of the sub-request packet identifiers in the merge request packet, and finally according to the Each sub-request packet header and sub-request information is processed, and the corresponding sub-request packet is processed. The embodiment of the invention solves the problem that the remote data access operation with a small amount of data is wasteful on the data request packet in the prior art, which causes the transmission efficiency to be low, and improves the utilization efficiency of the link.
其中, 处理器 253 中的具体处理过程可参考方法实施例部分以及图 20至图 23所示的装置实施例部分, 这里不再赘述。  The specific processing procedure in the processor 253 can be referred to the method embodiment part and the apparatus embodiment part shown in FIG. 20 to FIG. 23, and details are not described herein again.
总线 254可包括一通路, 在内存数据的读写处理装置各个部件 (例 如处理器 253、 存储器 251和收发器 252 ) 之间传送信息。  Bus 254 can include a path for communicating information between various components of the memory data read and write processing device, such as processor 253, memory 251, and transceiver 252.
所属领域的技术人员可以清楚地了解到, 为描述的方便和简洁, 仅 以上述各功能模块的划分进行举例说明, 实际应用中, 可以根据需要而 将上述功能分配由不同的功能模块完成, 即将装置的内部结构划分成不 同的功能模块, 以完成以上描述的全部或者部分功能。 上述描述的系统, 装置和单元的具体工作过程, 可以参考前述方法实施例中的对应过程, 在此不再赘述。 在本申请所提供的几个实施例中, 应该理解到, 所揭露的系统, 装 置和方法, 可以通过其它的方式实现。 例如, 以上所描述的装置实施例 仅仅是示意性的, 例如, 所述模块或单元的划分, 仅仅为一种逻辑功能 划分, 实际实现时可以有另外的划分方式, 例如多个单元或组件可以结 合或者可以集成到另一个系统, 或一些特征可以忽略, 或不执行。 另一 点, 所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过 一些接口, 装置或单元的间接耦合或通信连接, 可以是电性, 机械或其 它的形式。 It will be apparent to those skilled in the art that, for convenience and brevity of description, only the division of each functional module described above is exemplified. In practical applications, the above-mentioned function assignment can be completed by different functional modules as needed. The internal structure of the device is divided into different functional modules to perform all or part of the functions described above. For the specific working process of the system, the device and the unit described above, refer to the corresponding process in the foregoing method embodiment, and details are not described herein again. In the several embodiments provided by the present application, it should be understood that the disclosed system, apparatus, and method may be implemented in other manners. For example, the device embodiments described above are merely illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be another division manner, for example, multiple units or components may be used. Combined or can be integrated into another system, or some features can be ignored, or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开 的, 作为单元显示的部件可以是或者也可以不是物理单元, 即可以位于 一个地方, 或者也可以分布到多个网络单元上。 可以根据实际的需要选 择其中的部分或者全部单元来实现本实施例方案的目的。  The units described as separate components may or may not be physically separate. The components displayed as units may or may not be physical units, i.e., may be located in one place, or may be distributed over multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solution of the embodiment.
另外, 在本发明各个实施例中的各功能单元可以集成在一个处理单 元中, 也可以是各个单元单独物理存在, 也可以两个或两个以上单元集 成在一个单元中。 上述集成的单元既可以采用硬件的形式实现, 也可以 釆用软件功能单元的形式实现。  In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品 销售或使用时, 可以存储在一个计算机可读取存储介质中。 基于这样的 理解, 本发明的技术方案本质上或者说对现有技术做出贡献的部分或者 该技术方案的全部或部分可以以软件产品的形式体现出来, 该计算机软 件产品存储在一个存储介质中, 包括若干指令用以使得一台计算机设备 The integrated unit, if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may contribute to the prior art or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium. , including a number of instructions to make a computer device
(可以是个人计算机, 服务器, 或者网络设备等)或处理器( p roce s s or ) 执行本发明各个实施例所述方法的全部或部分步骤。 而前述的存储介质 包括: U盘、 移动硬盘、 只读存储器 (ROM , Rea d-On l y Memory ) 、 随机 存取存储器 ( RAM , Random Acce s s Memory ) 、 磁碟或者光盘等各种可以 存储程序代码的介质。 (may be a personal computer, a server, or a network device, etc.) or a processor (p roce s s or ) performs all or part of the steps of the method of the various embodiments of the present invention. The foregoing storage medium includes: a USB flash drive, a removable hard disk, a read only memory (ROM, Rea d-Only Memory), a random access memory (RAM, Random Acce ss Memory), a magnetic disk or an optical disk, and the like. The medium of the code.
以上所述, 仅为本发明的具体实施方式, 但本发明的保护范围并不 局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内, 可轻易想到变化或替换, 都应涵盖在本发明的保护范围之内。 因此, 本 发明的保护范围应以所述权利要求的保护范围为准。 The above description is only a specific embodiment of the present invention, but the scope of protection of the present invention is not It is to be understood that those skilled in the art are susceptible to variations and substitutions within the scope of the present invention. Therefore, the scope of the invention should be determined by the scope of the appended claims.

Claims

权利 要求 书 claims
1、 一种内存数据的读写处理方法, 其特征在于, 包括: 1. A method for reading and writing memory data, which is characterized by including:
获取各个待发送请求包,所述待发送请求包包括:读请求包,和 /或写请 求包; Obtain each request packet to be sent, which includes: a read request packet, and/or a write request packet;
解析所述各个待发送请求包的目的节点标识,并判断所述各个待发送 请求包的目的节点标识是否相同; Analyze the destination node identification of each request packet to be sent, and determine whether the destination node identification of each request packet to be sent is the same;
将所述具有相同目的节点标识的至少两个待发送请求包分别作为子请 求包, 打包为一个合并请求包, 所述合并请求包中包括公共包头和至少两 个子请求包, 所述公共包头中包含合并包标识、 子请求包个数标识和源节 点标识, 所述合并包标识用于指示所述请求包为所述至少两个子请求包组 合的合并包, 所述子请求包个数标识用于指示所述合并请求包携带的子请 求包的个数, 所述子请求包包含子请求包包头和子请求信息; The at least two request packets to be sent with the same destination node identification are respectively used as sub-request packets and packaged into a merge request packet. The merge request packet includes a common header and at least two sub-request packets. In the common header 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 packet is a merged package that is a combination of the at least two sub-request packages. The sub-request package number identifier is 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;
将所述合并请求包发送给所述目的节点标识对应的目的节点, 所述合 并请求包用于指示所述目的节点对所述目的节点的内存数据进行读和 /或 写操作。 The merge request packet is sent to the destination node corresponding to the destination node identification, and the merge request packet is used to instruct the destination node to read and/or write the memory data of the destination node.
2、 根据权利要求 1所述的内存数据的读写处理方法, 其特征在于, 所 述打包为一个合并请求包包括: 2. The memory data reading and writing processing method according to claim 1, characterized in that the packaging into a merge request package includes:
将所述合并包标识置为预定值, 所述预定值指示所述请求包为所述至 少两个子请求包组合的合并包; Set the merged packet identifier to a predetermined value, and the predetermined value indicates that the request packet is a merged packet that is a combination of the at least two sub-request packets;
获取子请求包的个数, 将所述个数写入所述子请求包个数标识中。 Obtain the number of sub-request packets, and write the number into the sub-request packet number identifier.
3、根据权利要求 1或 2所述的内存数据的读写处理方法,其特征在于, 所述解析所述各个待发送请求包的目的节点标识,并判断所述各个待发送 请求包的目的节点标识是否相同包括: 3. The memory data reading and writing processing method according to claim 1 or 2, characterized in that: parsing the destination node identification of each request packet to be sent, and determining the destination node of each request packet to be sent. Whether the logos are the same includes:
获取各个待发送请求包中携带的目的节点标识; Obtain the destination node identification carried in each request packet to be sent;
判断所述各个待发送请求包的目的节点标识是否相同; Determine whether the destination node identifiers of each request packet to be sent are the same;
所述打包为一个合并请求包包括: The package as a merge request package includes:
提取所述子请求包中的目的节点标识, 并将所述目的节点标识置于所 述合并请求包的公共包头中。 Extract the destination node identifier in the sub-request packet, and place the destination node identifier in the in the public header of the merge request packet.
4、根据权利要求 1或 2所述的内存数据的读写处理方法,其特征在于, 所述解析所述各个待发送请求包的目的节点标识,并判断所述各个待发送 请求包的目的节点标识是否相同包括: 4. The method for reading and writing memory data according to claim 1 or 2, characterized in that: parsing the destination node identification of each request packet to be sent, and determining the destination node of each request packet to be sent. Whether the logos 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, search the destination node identifier to which the memory address of the destination node belongs in the address ownership table. The address ownership table is a correspondence table between the memory address of the destination node and the destination node identifier;
判断所述各个待发送请求包的目的节点标识是否相同。 Determine whether the destination node identifiers of each request packet to be sent are the same.
5、根据权利要求 3或 4所述的内存数据的读写处理方法,其特征在于, 所述子请求包包括写请求子包和 /或读请求子包,写请求子包包头中包括识 别所述写请求子包的写请求标识, 所述写请求子包中的写请求信息包括待 写入所述目的节点的数据以及待写入的所述目的节点内存地址, 读请求子 包包头中包括识别所述读请求子包的读请求标识, 所述读请求子包中的读 请求信息包括待读取数据所处的所述目的节点内存地址,所述方法还包括: 接收所述目的节点发送的写请求响应消息, 所述写请求响应消息中包 含写请求成功的所述写请求子包对应的写请求标识; 和 /或, 5. The memory data reading and writing processing method according to claim 3 or 4, characterized in that: the sub-request packet includes a write request sub-packet and/or a read request sub-packet, and the write request sub-packet header includes a header identifying the Describe the write request identification of the write request sub-packet. The write request information in the write request sub-package includes the data to be written to the destination node and the memory address of the destination node to be written. The read request sub-packet header includes Identify the read request identifier of the read request sub-packet, and 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 method further includes: receiving the message sent by the destination node. The write request response message contains the write request identifier corresponding to the write request sub-package for which the write request is successful; and/or,
接收所述目的节点发送的读请求响应消息, 所述读请求响应消息中包 含读请求成功的所述读请求子包对应的读请求标识,以及读取的有效载荷, 所述有效载荷为所述读请求子包中远程内存地址对应的数据。 Receive a read request response message sent by the destination node. The read request response message includes a read request identifier corresponding to the read request subpackage for which the read request is successful, and a read payload, where the payload is the Read the data corresponding to the remote memory address in the request subpackage.
6、 根据权利要求 1-5任一项所述的内存数据的读写处理方法, 其特征 在于,所述解析所述各个待发送请求包的目的节点标识,并判断所述各个待 发送请求包的目的节点标识是否相同包括: 6. The method for reading and writing memory data according to any one of claims 1 to 5, characterized in that: parsing the destination node identification of each request packet to be sent, and judging the request packet to be sent. Whether the destination node identifiers are the same include:
根据所述各个待发送请求包对应的目的节点标识, 在路由表中查找所 述目的节点标识对应的路由端口, 所述路由表包含所述目的节点标识对应 的路由端口, 所述路由端口为所述待发送请求包到达所述目的节点的路径 上的端口; 判断所述各个待发送请求包的路由端口是否相同。 According to the destination node identifier corresponding to each request packet to be sent, search the routing port corresponding to the destination node identifier in the routing table. The routing table contains the routing port corresponding to the destination node identifier, and the routing port is the routing port. The port on the path on which the request packet to be sent reaches the destination node; Determine whether the routing ports of each request packet to be sent are the same.
7、 一种内存数据的读写处理方法, 其特征在于, 包括: 7. A method for reading and writing memory data, which is characterized by including:
接收请求包; Receive request packet;
判断接收的请求包中是否携带合并包标识, 所述合并包标识用于指示 所述请求包为至少两个子请求包组合的合并请求包, 所述子请求包包括: 读请求子包,和 /或写请求子包; Determine whether the received request packet carries a merge packet identifier. The merge packet identifier is used to indicate that the request packet is a merge request packet composed of at least two sub-request packets. The sub-request packet includes: a read request sub-packet, and/ Or write request sub-package;
当所述请求包中携带合并包标识时, 确定所述请求包为合并请求包, 所述合并请求包中包括公共包头和子请求包, 所述公共包头中包含合并包 标识、 子请求包个数标识和源节点标识, 所述子请求包个数标识用于指示 所述合并请求包携带的子请求包的个数, 所述子请求包包含子请求包包头 和子请求信息; When the request packet carries a merge packet identifier, it is determined that the request packet is a merge request packet. The merge request packet includes a common header and a sub-request packet. The public header includes a merge packet identifier and the number of sub-request packets. Identifier and 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;
根据所述合并请求包中携带的子请求包个数标识和每个子请求包包 头,提取所述合并请求包中与所述子请求包个数标识对应个数的子请求包; 根据所述每个子请求包包头和子请求信息, 处理对应的子请求包。 According to the sub-request packet number identifier carried in the merge request packet and the header of each sub-request packet, extract the number of sub-request packets in the merge request packet corresponding to the sub-request packet number identifier; Sub-request packet header and sub-request information, and process the corresponding sub-request packet.
8、 根据权利要求 7所述的内存数据的读写处理方法, 其特征在于, 所 述根据所述每个子请求包包头和子请求信息, 处理对应的子请求包包括: 根据写请求子包包头中的写请求标识、 所述写请求子包的写请求信息 中的待写入数据以及待写入的目的节点内存地址, 将所述待写入数据写入 所述目的节点内存地址; 和 /或, 8. The memory data reading and writing processing method according to claim 7, characterized in that, processing the corresponding sub-request packet according to each sub-request packet header and sub-request information includes: According to the write request sub-packet header The write request identifier, the data to be written in the write request information of the write request sub-package and the memory address of the destination node to be written, the data to be written is written into the memory address of the destination node; 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, the read request is read in the memory address of the destination node. Read data.
9、 根据权利要求 8所述的内存数据的读写处理方法, 其特征在于, 在 所述提取所述合并请求包中与所述子请求包个数标识对应个数的子请求包 之后, 还包括: 9. The memory data reading and writing processing method according to claim 8, characterized in that, after extracting the number of sub-request packets corresponding to the sub-request packet number identifier in the merge request packet, 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.
1 0、 根据权利要求 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 includes:
判断各个待发送的响应消息对应的源节点标识是否相同; Determine whether the source node identifiers corresponding to each response message to be sent are the same;
将具有相同源节点标识的所述待发送的响应消息作为子响应消息, 打 包为一个合并响应消息包, 所述合并响应消息包中包括写请求子响应消息 和 /或读请求子响应消息; The response message to be sent with the same source node identification is used as a sub-response message and packaged into a merged response message package. The merged response message package includes a write request sub-response message and/or a read request sub-response message;
将所述合并响应消息包发送给所述源节点标识对应的源节点。 Send the merge response message package to the source node corresponding to the source node identification.
1 1、 根据权利要求 7所述的内存数据的读写处理方法, 其特征在于, 当所述目的节点为路由端口时, 在所述提取所述合并请求包中与所述子请 求包个数标识对应个数的子请求包之后, 还包括: 1 1. The memory data reading and writing processing method according to claim 7, characterized in that, when the destination node is a routing port, the number of sub-request packets in the extraction of the merge request packet is After identifying the corresponding number of sub-request packets, it also includes:
提取所述合并请求包的公共包头中的源节点标识, 写入每个子请求包 的包头中。 Extract the source node identifier from the common header of the merge request package and write it into the header of each sub-request package.
1 2、 一种内存数据的读写处理装置, 其特征在于, 包括: 1 2. A device for reading and writing memory data, which is characterized by including:
获取单元, 用于获取各个待发送请求包,所述待发送请求包包括: 读请 求包,和 /或写请求包; The acquisition unit is used to acquire each request packet to be sent, which includes: a read request packet, and/or a write request packet;
判断单元,用于解析所述各个待发送请求包的目的节点标识,并判断所 述各个待发送请求包的目的节点标识是否相同; A judgment unit configured to parse the destination node identifiers of each request packet to be sent, and determine whether the destination node identifiers of each request packet to be sent are the same;
处理单元, 用于将所述具有相同目的节点标识的至少两个待发送请求 包分别作为子请求包, 打包为一个合并请求包, 所述合并请求包中包括公 共包头和至少两个子请求包, 所述公共包头中包含合并包标识、 子请求包 个数标识和源节点标识, 所述合并包标识用于指示所述请求包为所述至少 两个子请求包组合的合并包, 所述子请求包个数标识用于指示所述合并请 求包携带的子请求包的个数, 所述子请求包包含子请求包包头和子请求信 息; A processing unit configured to package the at least two request packets to be sent with the same destination node identification as sub-request packets into a merge request packet, where the merge request packet includes a common header and at least two sub-request packets, The public header includes a merged packet identifier, a sub-request packet number identifier and a source node identifier. The merged packet identifier is used to indicate that the request packet is a merged packet that is a combination of the at least two sub-request packets. 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 packet includes a sub-request packet header and sub-request information;
发送单元, 用于将所述合并请求包发送给所述目的节点标识对应的目 的节点, 所述合并请求包用于指示所述目的节点对所述目的节点的内存数 据进行读和 /或写操作。 A sending unit, configured to send the merge request packet to the destination node corresponding to the destination node identification, and the merge request packet is used to instruct the destination node to read and/or write the memory data of the destination node. .
1 3、 根据权利要求 1 2所述的内存数据的读写处理装置, 其特征在于, 所述处理单元包括: 13. The device for reading and writing memory data according to claim 12, characterized in that the processing unit includes:
第一标识模块, 用于将所述合并包标识置为预定值, 所述预定值指示 所述请求包为所述至少两个子请求包组合的合并包; A first identification module, configured to set the merged packet ID to a predetermined value, the predetermined value indicating that the request packet is a merged packet that is a combination of the at least two sub-request packets;
第二标识模块, 用于获取子请求包的个数, 将所述个数写入所述子请 求包个数标识中。 The second identification module is used to obtain the number of sub-request packets, and write the number into the sub-request packet number identification.
14、 根据权利要求 1 2或 1 3所述的内存数据的读写处理装置, 其特征 在于, 14. The memory data reading and writing processing device according to claim 12 or 13, characterized in that,
所述判断单元包括: The judgment unit includes:
第一获取模块, 用于获取各个待发送请求包中携带的目的节点标识; 第一判断模块, 用于判断所述各个待发送请求包的目的节点标识是否 相同; The first acquisition module is used to obtain the destination node identification carried in each request packet to be sent; the first judgment module is used to determine whether the destination node identification of each request packet to be sent is the same;
所述处理单元还包括: The processing unit also includes:
第三标识模块, 用于提取所述子请求包中的目的节点标识, 并将所述 目的节点标识置于所述合并请求包的公共包头中。 The third identification module is used 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.
1 5、 根据权利要求 1 2或 1 3所述的内存数据的读写处理装置, 其特征 在于, 所述判断单元包括: 15. The memory data reading and writing processing device according to claim 12 or 13, characterized in that the judgment unit includes:
第二获取模块, 用于获取各个待发送请求包中携带的目的节点内存地 址; The second acquisition 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 ownership table according to the destination node memory address. The address ownership table is the corresponding relationship between the destination node memory address and the destination node identifier. surface;
第二判断模块, 用于判断所述各个待发送请求包的目的节点标识是否 相同。 The second judgment module is used to judge whether the destination node identifiers of each request packet to be sent are the same.
1 6、 根据权利要求 1 4或 1 5所述的内存数据的读写处理装置, 其特征 在于, 所述处理单元得到的所述合并请求包中包括的子请求包包括写请求 子包和 /或读请求子包,写请求子包包头中包括识别所述写请求子包的写请 求标识, 所述写请求子包中的写请求信息包括待写入所述目的节点的数据 以及待写入的所述目的节点内存地址, 读请求子包包头中包括识别所述读 请求子包的读请求标识, 所述读请求子包中的读请求信息包括待读取数据 所处的所述目的节点内存地址, 所述装置还包括: 16. The device for reading and writing memory data according to claim 14 or 15, characterized in that, the sub-request packet included in the merge request packet obtained by the processing unit includes a write request sub-packet and/or Or a read request sub-packet, and the write request sub-packet header includes a write request identifying the write request sub-packet. Find the identification. The write request information in the write request sub-package includes the data to be written to the destination node and the memory address of the destination node to be written. The read request sub-packet header includes identification of the read request sub-packet. 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, and the device further includes:
接收单元, 用于接收所述目的节点发送的写请求响应消息, 所述写请 求响应消息中包含写请求成功的所述写请求子包对应的写请求标识; 和 / 或, 用于接收所述目的节点发送的读请求响应消息, 所述读请求响应消息 中包含读请求成功的所述读请求子包对应的读请求标识, 以及读取的有效 载荷, 所述有效载荷为所述读请求子包中远程内存地址对应的数据。 A receiving unit, configured to receive a write request response message sent by the destination node, where the write request response message contains a write request identifier corresponding to the write request subpackage for which the write request is successful; and/or, configured 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 sub-packet for which the read request is successful, and the read payload, where the payload is the read request sub-packet. The data corresponding to the remote memory address in the package.
1 7、 根据权利要求 1 2-1 6任一项所述的内存数据的读写处理装置, 其 特征在于, 所述判断单元还包括: 17. The memory data reading and writing processing device according to any one of claims 12-16, characterized in that the judgment unit further includes:
第二查找模块,用于根据所述各个待发送请求包对应的目的节点标识, 在路由表中查找所述目的节点标识对应的路由端口, 所述路由表包含所述 目的节点标识对应的路由端口, 所述路由端口为所述待发送请求包到达所 述目的节点的路径上的端口; The second search module is configured to search for the routing port corresponding to the destination node identifier in the routing table according to the destination node identifier corresponding to each request packet to be sent. The routing table includes the routing port corresponding to the destination node identifier. , the routing port is a port on the path of the request packet to be sent to the destination node;
第三判断模块,用于判断所述各个待发送请求包的路由端口是否相同。 The third judgment module is used to judge whether the routing ports of each request packet to be sent are the same.
1 8、 一种内存数据的读写处理装置, 其特征在于, 包括: 18. A device for reading and writing memory data, which is characterized by including:
接收单元, 用于接收请求包; Receiving unit, used to receive request packets;
判断单元, 用于判断接收的请求包中是否携带合并包标识, 所述合并 包标识用于指示所述请求包为至少两个子请求包组合的合并请求包, 所述 子请求包包括: 读请求子包,和 /或写请求子包; A judgment unit, used to judge whether the received request packet carries a merge packet identifier, where the merge packet identifier is used to indicate that the request packet is a merge request packet composed of at least two sub-request packets, and the sub-request packet includes: Read request subpackage, and/or write request subpackage;
确定单元, 用于当所述请求包中携带合并包标识时, 确定所述请求包 为合并请求包, 所述合并请求包中包括公共包头和子请求包, 所述公共包 头中包含合并包标识、 子请求包个数标识和源节点标识, 所述子请求包个 数标识用于指示所述合并请求包携带的子请求包的个数, 所述子请求包包 含子请求包包头和子请求信息; Determining unit, configured to determine that the request packet is a merge request packet when the request packet carries a merge packet identifier, the merge request packet includes a common header and a sub-request packet, and the public header includes the merge packet 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. The sub-request packet includes a sub-request packet header and sub-request information;
提取单元, 用于根据所述合并请求包中携带的子请求包个数标识和每 个子请求包包头, 提取所述合并请求包中与所述子请求包个数标识对应个 数的子请求包; An extraction unit, configured to extract information based on the number of sub-request packets carried in the merge request packet and the number of each sub-request packet. Sub-request packet header, extract the number of sub-request packets corresponding to the sub-request packet number identifier in the merge request packet;
处理单元, 用于根据所述每个子请求包包头和子请求信息, 处理对应 的子请求包。 A processing unit, configured to process the corresponding sub-request packet according to the header and sub-request information of each sub-request packet.
1 9、 根据权利要求 1 8所述的内存数据的读写处理装置, 其特征在于, 所述处理单元包括: 19. The device for reading and writing memory data according to claim 18, characterized in that the processing unit includes:
第一处理模块, 用于根据写请求子包包头中的写请求标识、 所述写请 求子包的写请求信息中的待写入数据以及待写入的目的节点内存地址, 将 所述待写入数据写入所述目的节点内存地址; The first processing module is configured to write the to-be-written data according to the write request identifier in the write request sub-packet header, the data to be written in the write request information of the write request sub-package, and the memory address of the destination node to be written. The incoming data is written into the memory address of the destination node;
第二处理模块, 用于根据读请求子包包头中的读请求标识, 以及所述 读请求子包的读请求信息中的待读取数据所处的目的节点内存地址, 在所 述目的节点内存地址中读取所述待读取数据。 The second processing module is configured to, based on the read request identification in the read request sub-packet header 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 The data to be read is read from the address.
20、 根据权利要求 1 9所述的内存数据的读写处理装置, 其特征在于, 所述装置还包括: 20. The device for reading and writing memory data according to claim 19, characterized in that the device further includes:
标识写入单元, 用于将所述源节点标识写入每个子请求包的子请求包 包头中, 以便于所述目的节点向所述源节点发送响应消息。 An identity writing unit is configured to write the source node identity 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 memory data according to claim 20, characterized in that the judgment unit is also used to judge whether the source node identifiers corresponding to each response message to be sent are the same;
所述处理单元, 还用于将具有相同源节点标识的所述待发送的响应消 息作为子响应消息, 打包为一个合并响应消息包, 所述合并响应消息包中 包括写请求子响应消息和 /或读请求子响应消 , ■ The processing unit is also configured to package the response message to be sent with the same source node identification as a sub-response message into a merged response message package, where the merged response message package includes a write request sub-response message and/ Or read request sub-response message, ■
所述装置还包括: The device also includes:
发送单元, 用于将所述合并响应消息包发送给所述源节点标识对应的 源节点。 A sending unit, configured to send the merge response message packet to the source node corresponding to the source node identification.
22、 根据权利要求 1 8所述的内存数据的读写处理装置, 其特征在于, 当所述目的节点为路由端口时, 所述处理单元, 还用于提取所述合并请求 包的公共包头中的源节点标识, 写入每个子请求包的包头中。 22. The device for reading and writing memory data according to claim 18, characterized in that when the destination node is a routing port, the processing unit is also used to extract the merge request The source node identifier in the public header of the package is written into the header of each sub-request package.
PCT/CN2014/083873 2013-08-26 2014-08-07 Read and write processing method and device for memory data WO2015027806A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310376301.X 2013-08-26
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 (1)

Publication Number Publication Date
WO2015027806A1 true WO2015027806A1 (en) 2015-03-05

Family

ID=52585534

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/083873 WO2015027806A1 (en) 2013-08-26 2014-08-07 Read and write processing method and device for memory data

Country Status (2)

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

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110865769A (en) * 2018-08-28 2020-03-06 阿里巴巴集团控股有限公司 Method for processing read/write request, network storage system and electronic equipment

Families Citing this family (10)

* 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
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
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
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

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100232448A1 (en) * 2009-03-12 2010-09-16 Sugumar Rabin A 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
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 (1)

* 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

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100232448A1 (en) * 2009-03-12 2010-09-16 Sugumar Rabin A Scalable Interface for Connecting Multiple Computer Systems Which Performs Parallel MPI Header Matching
CN102831018A (en) * 2011-06-15 2012-12-19 塔塔咨询服务有限公司 Low latency FIFO messaging system
CN102387206A (en) * 2011-10-20 2012-03-21 镇江睿泰信息科技有限公司 Synthesis method and system of concurrent request of Web service
CN102609378A (en) * 2012-01-18 2012-07-25 中国科学院计算技术研究所 Message type internal memory accessing device and accessing method thereof

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110865769A (en) * 2018-08-28 2020-03-06 阿里巴巴集团控股有限公司 Method for processing read/write request, network storage system and electronic equipment
CN110865769B (en) * 2018-08-28 2023-06-20 阿里巴巴集团控股有限公司 Method for processing read/write request, network storage system and electronic equipment

Also Published As

Publication number Publication date
CN104424105A (en) 2015-03-18
CN104424105B (en) 2017-08-25

Similar Documents

Publication Publication Date Title
WO2015027806A1 (en) Read and write processing method and device for memory data
US11467975B2 (en) Data processing method and NVMe storage device
US20240171507A1 (en) System and method for facilitating efficient utilization of an output buffer in a network interface controller (nic)
WO2017067391A1 (en) Data sharing method and device for virtual machines
US9813283B2 (en) Efficient data transfer between servers and remote peripherals
WO2018137217A1 (en) Data processing system, method, and corresponding device
US11755513B2 (en) Data processing and writing method based on virtual machine memory identification field and devise
WO2016187813A1 (en) Data transmission method and device for photoelectric hybrid network
WO2021047120A1 (en) Resource allocation method in fpga heterogeneous accelerator card cluster, device, and medium
WO2015081515A1 (en) Data processing method, device, storage controller and equipment cabinet
US20240039995A1 (en) Data access system and method, device, and network adapter
WO2012139474A1 (en) Data acquisition method, device and system
WO2014075255A1 (en) Method, apparatus and system for communication based on pcie switch
CN111459417A (en) NVMeoF storage network-oriented lock-free transmission method and system
EP3051426B1 (en) Method, device, and system for accessing memory
CN103888364A (en) Message shunting method and device
WO2020248996A1 (en) Qos processing and control methods and network interface controller
CN108063737A (en) A kind of FCoE storage area networks read request processing method and system
WO2022141322A1 (en) System on chip and related method
CN107615259B (en) Data processing method and system
CN114238156A (en) Processing system and method of operating a processing system
CN113778937A (en) System and method for performing transaction aggregation in a network on chip (NoC)
CN117971135B (en) Storage device access method and device, storage medium and electronic device
CN117369734B (en) Storage resource management system, method and storage virtualization system
CN113422792B (en) Data transmission method, device, electronic equipment and computer storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14840574

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14840574

Country of ref document: EP

Kind code of ref document: A1