Data interaction method and system, electronic equipment and storage medium
By setting independent sequence number spaces for the data requester and data responder in RDMA technology, and setting message sequence numbers in the data packets, the problem of discontinuous sequence numbers between the data requester and data responder is solved, and the correct association and transmission of data packets are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING BITINTELLIGENCE INFORMATION TECHNOLOGY CO LTD
- Filing Date
- 2024-11-13
- Publication Date
- 2026-05-15
AI Technical Summary
In existing RDMA technology, the sequence numbers assigned to the data requester and data responder are not continuous, leading to data packet loss and out-of-order delivery, which increases processing complexity.
An independent sequence number space is established between the data requester and the data responder. A first sequence number and a second sequence number are set in the data packet for request and response data packets, respectively. The message sequence number is set in the extended header for association to ensure the continuity of the sequence number.
It ensures the continuity of sequence numbers between data requesters and data responders, guaranteeing the correct association and transmission of data packets and avoiding issues such as data packet loss and out-of-order delivery.
Smart Images

Figure CN122053005A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data transmission technology, and more specifically, to a data interaction method and system, an electronic device, and a storage medium. Background Technology
[0002] RDMA (Remote Direct Memory Access) technology is widely used for data transfer between dedicated chips in GPUs (Graphics Processing Units) or AI (Artificial Intelligence). However, in existing RDMA technologies, the sequence number of the response data packet is assigned by the data requester. This results in discontinuous sequence numbers between the data requester and the data responder. When data packets are lost on either the data requester or the data responder, it makes handling packet loss and out-of-order arrival in the RDMA protocol more complex and difficult. Summary of the Invention
[0003] The present invention aims to solve at least one of the technical problems existing in the prior art or related art.
[0004] Therefore, the first aspect of the present invention proposes a data interaction method.
[0005] A second aspect of the present invention proposes a data interaction method.
[0006] A third aspect of the present invention proposes a data interaction system.
[0007] A fourth aspect of the present invention proposes a data interaction system.
[0008] The fifth aspect of the present invention provides an electronic device.
[0009] A sixth aspect of the present invention provides a storage medium.
[0010] In view of this, according to a first aspect of the present invention, a data interaction method is proposed for a data requester, comprising: determining a first sequence number in a first sequence number space; allocating the first sequence number to a data packet to obtain a request data packet; sending the request data packet to a data responder; receiving a response data packet sent by the data responder; parsing the response data packet to determine a message sequence number in the extended header of the response data packet; and determining that the response data packet is a data packet corresponding to the request data packet based on the message sequence number being the same as or corresponding to the first sequence number.
[0011] The data interaction method provided by this invention is mainly used by the data requester and includes: establishing an RDMARC (Remote Direct Memory Access Reliable Connection) connection between the data requester and the data responder, which is typically referred to as a QP (QueuePair) on both sides. The data requester can use the QP to initiate RDMA operations including SEND, WRITE, and READ, and the responder will then react to these operations and send corresponding responses. After the connection is established between the data requester and the data responder, the data requester determines the data packets to be sent to the data responder, where the data packets can be of types such as SEND, WRITE, and READ. Then, the data requester determines a first sequence number in a first sequence number space, where the first sequence number refers to the PSN (packet sequence number) in RDMA technology. The obtained first sequence number is then assigned to a data packet to obtain a request data packet. When there are multiple data packets, there are also multiple determined first sequence numbers, which are assigned sequentially to each data packet. Different types of data packets use the same first sequence number space. After obtaining the request data packet, it is sent to the data responder. Then, the response data packets sent by the data responder are received. There can be one or more response data packets, and each response data packet includes a second sequence number from a second sequence number space. That is, the first and second sequence numbers come from two independent sequence number spaces. After obtaining the response data packet, it is parsed to determine the message sequence number (MSN) in the extended header (AETH, Acknowledge Extended Transport Header). Then, when the message sequence number is the same as or has a one-to-one correspondence with the first sequence number (in this invention, "the same as the first sequence number" means either identical to or has a one-to-one correspondence with the first sequence number), it indicates that the response data packet is the data packet returned by the data responder in response to the request data packet. That is, the response data packet with the same message sequence number as the first sequence number corresponds to the request data packet. In other words, the data responder uses the first sequence number of the request data packet as the message sequence number in the extended header of the response data packet, enabling the data requester to accurately find the corresponding data packet in the data returned by the data responder.Furthermore, when the data responder returns multiple response data packets, the data requester can parse the response data packets sequentially. When the data requester finds the first data packet, where the message sequence number of the first data packet is the same as or has a one-to-one correspondence with the first sequence number of the request data packet, and simultaneously finds the second data packet, where the message sequence number of the second data packet is the same as or has a one-to-one correspondence with the first sequence number of the request data packet, it indicates that all response data packets between the first and second data packets are data packets corresponding to the request data packet. In this invention, by setting the data requester and data responder to use independent sequence number spaces, the sequence numbers of the data requester and data responder become continuous. Simultaneously, this invention sets the data requester to determine the response data packet corresponding to the request data packet through the message sequence number, thereby establishing an association between the request data packet and the response data packet, avoiding the problem that the request data packet and response data packet cannot be associated due to the data requester and data responder using independent sequence number spaces. Therefore, this invention solves the problem caused by the discontinuous sequence numbers of the data requester and data responder.
[0012] The data interaction method of the present invention may also have the following technical features:
[0013] In some technical solutions, optionally, before the step of parsing the response data packet and determining the message sequence number in the extended header of the response data packet, the steps include: obtaining a second sequence number of the response data packet; generating an acknowledgment message based on the second sequence number; and sending the acknowledgment message to the data responder.
[0014] In this technical solution, before parsing the response data packet and determining the message sequence number in the extended header of the response data packet, the process includes: firstly, obtaining the second sequence number of the response data packet, where the second sequence number is allocated by the data responder according to the second sequence number space. Then, generating an acknowledgment message based on the second sequence number, where the acknowledgment message refers to an ACK (Acknowledge character) message. Finally, sending the acknowledgment message to the data responder, by generating the acknowledgment message based on the second sequence number and sending it to the data responder, allows the data responder to know that the data requester has received the response data packet sent by the data responder.
[0015] In some technical solutions, optionally, the step of generating an acknowledgment message based on the second sequence number includes: using the second sequence number as the sequence number of the acknowledgment message; determining the value of the selective acknowledgment option in the acknowledgment message based on the second sequence number; and generating the acknowledgment message based on the value of the selective acknowledgment option and the sequence number.
[0016] In this technical solution, the steps for generating an acknowledgment message based on the second sequence number include: First, using the second sequence number as the sequence number of the acknowledgment message. It's understood that the data requester needs to add a sequence number to the data packet when sending it. Therefore, to distinguish the acknowledgment message from the regular request data packet, the sequence number of the acknowledgment message cannot be obtained from the first sequence number space; instead, the second sequence number in the response data packet is directly used as the sequence number of the acknowledgment message. Then, the value of the Selective Acknowledgment (SACK) option in the acknowledgment message is determined based on the second sequence number. The SACK option includes the sequence number range of successfully received data packets. For example, if the data responseer sends 100 data packets to the data requester, with each data packet having a second sequence number from 1 to 100, but the data requester did not receive data packets with second sequence numbers 4 and 78, then the values in the SACK option would be [1:3], [5:77], and [79:100]. Finally, an acknowledgment message is generated based on the value of the selective acknowledgment option and the sequence number. By adding a selective acknowledgment mechanism to the acknowledgment message, the accuracy of the existing acknowledgment mechanism is improved.
[0017] According to a second aspect of the present invention, a data interaction method is proposed, mainly for a data responder, comprising: receiving a request data packet sent by a data requester; parsing the request data packet to determine a first sequence number in the request data packet; determining a data packet based on the request data packet; determining a second sequence number in a second sequence number space; allocating the second sequence number to the data packet to obtain a response data packet; using the first sequence number or a number corresponding to the first sequence number as a message sequence number in the extended header of the response data packet; and sending the response data packet to the data requester.
[0018] The data interaction method provided by this invention is mainly used by the data responder. The method primarily includes: firstly, establishing an RDMARC (Remote Direct Memory Access Reliable Connection) connection between the data requester and the data responder, typically referred to as a QP (Queue Pair). The data requester can use the QP to initiate RDMA operations including SEND, WRITE, and READ. The responder then reacts to these operations and sends corresponding responses. After the connection is established between the data requester and the data responder, the data responder first receives the request data packet sent by the data requester. This request data packet can be of types such as SEND, WRITE, and READ. The request data packet is then parsed to determine its first sequence number and content. Finally, based on the content of the request data packet, the data packet to be sent to the data requester is determined. Then, a second sequence number is determined in the second sequence number space, which is independent of the first sequence number space. The second sequence number refers to the PSN (packet sequence number) in RDMA technology. When there are multiple packets, the data responder sequentially determines the second sequence number for the same data in the second sequence number space. After obtaining the second sequence number, it is assigned to the packet to obtain the response packet. Then, to associate the response packet with the request packet, the first sequence number in the request packet, or a number that has a one-to-one correspondence with the first sequence number, is used as the message sequence number (MSN) in the extended header (AETH, Acknowledge Extended Transport Header) of the response packet. Finally, the response packet is sent to the data requester. In this invention, by setting the data requester and data responder to use independent sequence number spaces, the sequence numbers of the data requester and data responder become consecutive. Furthermore, this invention establishes an association between the request and response data packets by using the first sequence number in the request data packet as the message sequence number in the response data packet. This avoids the problem of the request and response data packets being unable to be associated because they use separate sequence number spaces. Therefore, this invention solves the problem caused by the independent sequence numbers between the data requester and the data responder.
[0019] In some technical solutions, optionally, before the step of determining the data packet based on the request data packet, the steps include: generating an acknowledgment message based on the first sequence number; and sending the acknowledgment message to the data requester.
[0020] In this technical solution, before determining the response data packet based on the request data packet, the process includes: firstly, generating an acknowledgment message based on a first sequence number, where the acknowledgment message refers to an ACK (Acknowledge character) message. Then, sending the acknowledgment message to the data requester ensures that the data responseer has received the request data packet sent by the data requester.
[0021] In some technical solutions, optionally, the step of generating an acknowledgment message based on the first sequence number includes: using the first sequence number as the sequence number of the acknowledgment message; determining the value of the selective acknowledgment option in the acknowledgment message based on the first sequence number; and generating the acknowledgment message based on the value of the selective acknowledgment option and the sequence number.
[0022] In this technical solution, the steps for generating an acknowledgment message based on the first sequence number include: First, using the first sequence number as the sequence number of the acknowledgment message. It's understood that the data responder needs to add a sequence number to the data packet when sending it. Therefore, to distinguish the acknowledgment message from the regular response data packet, the sequence number of the acknowledgment message cannot be obtained from the second sequence number space; instead, the first sequence number in the request data packet is directly used as the sequence number of the acknowledgment message. Then, the value of the Selective Acknowledgment (SACK) option in the acknowledgment message is determined based on the first sequence number. The SACK option includes the sequence number range of successfully received data packets. For example, if the data requester sends 50 data packets to the data responder, with each data packet having a first sequence number from 1 to 50, but the data responder did not receive the data packet with a first sequence number of 3, then the value in the SACK option would be [1:2] or [4:50]. Finally, the acknowledgment message is generated based on the value of the selective acknowledgment option and the sequence number. By adding a selective acknowledgment mechanism to the acknowledgment message, the accuracy of the existing acknowledgment mechanism is improved.
[0023] According to a third aspect of the present invention, a data interaction system is proposed, primarily for use by a data requester. The data interaction system includes: a first determining module for determining a first sequence number in a first sequence number space; a first allocation module for allocating the first sequence number to a data packet to obtain a request data packet; a first sending module for sending the request data packet to a data responder; a first receiving module for receiving a response data packet sent by the data responder; a first parsing module for parsing the response data packet and determining the message sequence number in the extended header of the response data packet; and a second determining module for determining that the response data packet corresponds to the request data packet based on whether the message sequence number is the same as or corresponds to the first sequence number.
[0024] The data interaction system provided by this invention is mainly used by the data requester and includes: a first determining module, a first allocating module, a first sending module, a first receiving module, a first parsing module, and a second determining module. After a connection is established between the data requester and the data responder, the first determining module determines a first sequence number in a first sequence number space, where the first sequence number refers to the PSN (packet sequence number) in RDMA technology. Then, the first allocating module allocates the obtained first sequence number to a data packet to obtain a request data packet. When there are multiple data packets, there are also multiple determined first sequence numbers, and these multiple first sequence numbers are allocated sequentially to each data packet. Different types of data packets use the same first sequence number space. After obtaining the request data packet, the first sending module sends the request data packet to the data responder. Then, the first receiving module receives the response data packet sent by the data responder. The number of response data packets can be one or more, and the response data packet includes a second sequence number, which comes from a second sequence number space. That is, the first sequence number and the second sequence number come from two independent sequence number spaces. After receiving the response data packet, the first parsing module parses the response data packet to determine the message sequence number (MSN) in the extended header (AETH, Acknowledge Extended Transport Header) of the response data packet. Then, the second determining module determines the response data packet as the data packet returned by the data response provider in response to the request data packet when the message sequence number is the same as or has a one-to-one correspondence with the first sequence number. In other words, the data response provider uses the first sequence number of the request data packet as the message sequence number in the extended header of the response data packet, thus enabling the data requester to accurately find the corresponding data packet in the data returned by the data response provider. Furthermore, when the data responder returns multiple response data packets, the data requester can parse the response data packets sequentially. When the data requester finds the first data packet, where the message sequence number of the first data packet is the same as or has a one-to-one correspondence with the first sequence number of the request data packet, and at the same time, the data requester also finds the second data packet, where the message sequence number of the second data packet is the same as or has a one-to-one correspondence with the first sequence number of the request data packet, it means that all response data packets between the first and second data packets are data packets corresponding to the request data packets.In this invention, by setting up separate sequence number spaces for the data requester and data responder, the sequence numbers of the data requester and data responder become consecutive. Simultaneously, this invention sets up the data requester to determine the response data packet corresponding to the request data packet through the message sequence number, thereby establishing an association between the request data packet and the response data packet. This avoids the problem of the request data packet and response data packet being unable to be associated due to the use of separate sequence number spaces. Therefore, this invention solves the problem caused by the non-consecutive sequence numbers of the data requester and data responder.
[0025] According to a fourth aspect of the present invention, a data interaction system is provided, primarily for use by a data responder. The data interaction system includes: a second receiving module for receiving a request data packet sent by a data requester; a second parsing module for parsing the request data packet and determining a first sequence number in the request data packet; a third determining module for determining a data packet based on the request data packet; a fourth determining module for determining a second sequence number in a second sequence number space; a second allocation module for allocating the second sequence number to a data packet to obtain a response data packet; a first processing module for using the first sequence number or a number corresponding to the first sequence number as a message sequence number in the extended header of the response data packet; and a second sending module for sending the response data packet to the data requester.
[0026] The data interaction system provided by this invention is mainly used by the data responder and mainly includes: a second receiving module, a second parsing module, a third determining module, a fourth determining module, a second allocation module, a first processing module, and a second sending module. After a connection is established between the data requester and the data responder, the second receiving module can receive the request data packet sent by the data requester. The request data packet can be of types such as SEND, WRITE, and READ. Then, the second parsing module parses the request data packet to determine the first sequence number and the specific content of the request data packet. Next, the third determining module determines the data packet to be sent to the data requester based on the specific content of the request data packet. Then, the fourth determining module determines the second sequence number in the second sequence number space. The second sequence number space is independent of the first sequence number space. The second sequence number refers to the PSN (packet sequence number) in RDMA technology. When there are multiple data packets, the data responder will sequentially determine the second sequence number of the same data in the second sequence number space. After obtaining the second sequence number, the second allocation module allocates the second sequence number to the data packet to obtain the response data packet. Then, to associate the response data packet with the request data packet, the first processing module uses the first sequence number in the request data packet, or a number that has a one-to-one correspondence with the first sequence number, as the message sequence number (MSN) in the extended header (AETH, Acknowledge Extended Transport Header) of the response data packet. Finally, the second sending module sends the response data packet to the data requester. In this invention, by setting the data requester and data responder to use independent sequence number spaces, the sequence numbers of the data requester and data responder become consecutive. Simultaneously, by using the first sequence number in the request data packet as the message sequence number in the response data packet, the association between the request data packet and the response data packet is established, avoiding the problem that the request data packet and response data packet cannot be associated because the data requester and data responder use independent sequence number spaces. Therefore, this invention solves the problem caused by the independent sequence numbers between the data requester and data responder.
[0027] According to a fifth aspect of the present invention, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the data interaction method as described above.
[0028] The electronic device provided by the present invention, when the processor executes the computer program, implements the steps of the above-mentioned data interaction method, and can achieve the technical effects of any of the above technical solutions, which will not be repeated here.
[0029] According to a sixth aspect of the invention, a storage medium is provided on which a computer program is stored, wherein the computer program, when executed by a processor, implements the steps of the data interaction method as described above.
[0030] The storage medium provided by this invention enables the computer program to implement the steps of the above-described data interaction method when executed by a processor, and can achieve the technical effects of any of the above technical solutions, which will not be elaborated further here.
[0031] Additional aspects and advantages of the invention will become apparent in the following description or may be learned by practice of the invention. Attached Figure Description
[0032] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which:
[0033] Figure 1 One of the flowcharts of a data interaction method according to an embodiment of the present invention is shown;
[0034] Figure 2 This diagram illustrates a process flow diagram of a data interaction method according to an embodiment of the present invention before the step of parsing the response data packet and determining the message sequence number in the extended header of the response data packet;
[0035] Figure 3 A flowchart illustrating the step of generating an acknowledgment message based on a second sequence number in a data interaction method according to an embodiment of the present invention is shown.
[0036] Figure 4 A second schematic flowchart of a data interaction method according to an embodiment of the present invention is shown;
[0037] Figure 5 This diagram illustrates a flow chart of a data interaction method according to an embodiment of the present invention, prior to the step of determining a data packet based on a request data packet.
[0038] Figure 6 A flowchart illustrating the step of generating an acknowledgment message based on a first sequence number in a data interaction method according to an embodiment of the present invention is shown.
[0039] Figure 7 This shows one of the schematic diagrams illustrating the principle of RDMA technology in related technologies;
[0040] Figure 8 This is the second schematic diagram illustrating the principle of RDMA technology in related technologies;
[0041] Figure 9 This is the third schematic diagram illustrating the principle of RDMA technology in related technologies;
[0042] Figure 10 One of the schematic diagrams illustrating the principle of RDMA technology according to an embodiment of the present invention is shown;
[0043] Figure 11 A second schematic diagram illustrating the principle of RDMA technology according to an embodiment of the present invention is shown.
[0044] Figure 12 The third schematic diagram illustrates the principle of RDMA technology according to an embodiment of the present invention;
[0045] Figure 13 The fourth schematic diagram of the principle of RDMA technology in related technologies is shown;
[0046] Figure 14 The fifth schematic diagram of the principle of RDMA technology in related technologies is shown;
[0047] Figure 15 The fourth schematic diagram illustrates the principle of RDMA technology according to an embodiment of the present invention;
[0048] Figure 16 The fifth schematic diagram illustrates the principle of RDMA technology according to an embodiment of the present invention;
[0049] Figure 17 A schematic diagram of the RDMA technology according to an embodiment of the present invention is shown in Figure 6.
[0050] Figure 18 The seventh schematic diagram illustrates the principle of RDMA technology according to an embodiment of the present invention;
[0051] Figure 19 One of the schematic block diagrams of a data interaction system according to an embodiment of the present invention is shown;
[0052] Figure 20 A second schematic block diagram of a data interaction system according to an embodiment of the present invention is shown;
[0053] Figure 21 A schematic block diagram of an electronic device according to an embodiment of the present invention is shown. Detailed Implementation
[0054] To better understand the above-mentioned objectives, features, and advantages of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that, unless otherwise specified, the embodiments of the present invention and the features thereof can be combined with each other.
[0055] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and therefore the scope of protection of the invention is not limited to the specific embodiments disclosed below.
[0056] Figure 1 One of the flowcharts of a data interaction method according to an embodiment of the present invention is shown.
[0057] The data interaction method is primarily used by the data requester, and includes the following:
[0058] Step 102: Determine the first sequence number in the first sequence number space;
[0059] Step 104: Assign the first sequence number to the data packet to obtain the request data packet;
[0060] Step 106: Send the request data packet to the data responder;
[0061] Step 108: Receive the response data packet sent by the data responder;
[0062] Step 110: Parse the response data packet to determine the message sequence number in the extended header of the response data packet;
[0063] Step 112: If the message sequence number is the same as the first sequence number or the message sequence number corresponds to the first sequence number, then determine that the response data packet is the data packet corresponding to the request data packet.
[0064] The data interaction method provided by this invention is mainly used by the data requester and includes: establishing an RDMARC (Remote Direct Memory Access Reliable Connection) connection between the data requester and the data responder, which is typically referred to as a QP (QueuePair) on both sides. The data requester can use the QP to initiate RDMA operations including SEND, WRITE, and READ, and the responder will then react to these operations and send corresponding responses. After the connection is established between the data requester and the data responder, the data requester determines the data packets to be sent to the data responder, where the data packets can be of types such as SEND, WRITE, and READ. Then, the data requester determines a first sequence number in a first sequence number space, where the first sequence number refers to the PSN (packet sequence number) in RDMA technology. The obtained first sequence number is then assigned to a data packet to obtain a request data packet. When there are multiple data packets, there are also multiple determined first sequence numbers, which are assigned sequentially to each data packet. Different types of data packets use the same first sequence number space. After obtaining the request data packet, it is sent to the data responder. Then, the response data packets sent by the data responder are received. There can be one or more response data packets, and each response data packet includes a second sequence number from a second sequence number space. That is, the first and second sequence numbers come from two independent sequence number spaces. After obtaining the response data packet, it is parsed to determine the message sequence number (MSN) in the extended header (AETH, Acknowledge Extended Transport Header). Then, when the message sequence number is the same as or has a one-to-one correspondence with the first sequence number (in this invention, "the same as the first sequence number" means either identical to or has a one-to-one correspondence with the first sequence number), it indicates that the response data packet is the data packet returned by the data responder in response to the request data packet. That is, the response data packet with the same message sequence number as the first sequence number corresponds to the request data packet. In other words, the data responder uses the first sequence number of the request data packet as the message sequence number in the extended header of the response data packet, enabling the data requester to accurately find the corresponding data packet in the data returned by the data responder.Furthermore, when the data responder returns multiple response data packets, the data requester can parse the response data packets sequentially. When the data requester finds the first data packet, where the message sequence number of the first data packet is the same as or has a one-to-one correspondence with the first sequence number of the request data packet, and simultaneously finds the second data packet, where the message sequence number of the second data packet is the same as or has a one-to-one correspondence with the first sequence number of the request data packet, it indicates that all response data packets between the first and second data packets are data packets corresponding to the request data packet. In this invention, by setting the data requester and data responder to use independent sequence number spaces, the sequence numbers of the data requester and data responder become continuous. Simultaneously, this invention sets the data requester to determine the response data packet corresponding to the request data packet through the message sequence number, thereby establishing an association between the request data packet and the response data packet, avoiding the problem that the request data packet and response data packet cannot be associated due to the data requester and data responder using independent sequence number spaces. Therefore, this invention solves the problem caused by the discontinuous sequence numbers of the data requester and data responder.
[0065] Figure 2 This diagram illustrates a flowchart of a data interaction method according to an embodiment of the present invention, prior to the step of parsing a response data packet and determining the message sequence number in the extended header of the response data packet; wherein, prior to the step of parsing the response data packet and determining the message sequence number in the extended header of the response data packet, the method includes:
[0066] Step 202: Obtain the second sequence number of the response data packet;
[0067] Step 204: Generate an acknowledgment message based on the second sequence number;
[0068] Step 206: Send an acknowledgment message to the data responder.
[0069] In this embodiment, before parsing the response data packet and determining the message sequence number in the extended header of the response data packet, the method includes: firstly, obtaining the second sequence number of the response data packet, wherein the second sequence number is allocated by the data responder according to the second sequence number space of the response data packet. Then, generating an acknowledgment message based on the second sequence number, wherein the acknowledgment message refers to an ACK (Acknowledge character) message. Finally, sending the acknowledgment message to the data responder, by generating the acknowledgment message based on the second sequence number and sending the acknowledgment message to the data responder, enables the data responder to know that the data requester has received the response data packet sent by the data responder.
[0070] Figure 3A flowchart illustrating the step of generating an acknowledgment message based on a second sequence number in a data interaction method according to an embodiment of the present invention is shown; wherein, the step of generating an acknowledgment message based on the second sequence number includes:
[0071] Step 302: Use the second sequence number as the sequence number of the acknowledgment message;
[0072] Step 304: Determine the value of the selective acknowledgment option in the acknowledgment message based on the second sequence number;
[0073] Step 306: Generate an acknowledgment message based on the value and sequence number of the selective acknowledgment option.
[0074] In this embodiment, the step of generating an acknowledgment message based on the second sequence number includes: First, using the second sequence number as the sequence number of the acknowledgment message. It is understood that the data requester needs to add a sequence number to the data packet when sending it. Therefore, to distinguish the acknowledgment message from the regular request data packet, the sequence number of the acknowledgment message cannot be obtained from the first sequence number space; instead, the second sequence number in the response data packet is directly used as the sequence number of the acknowledgment message. Then, the value of the Selective Acknowledgment (SACK) option in the acknowledgment message is determined based on the second sequence number. The SACK option includes the sequence number range of successfully received data packets. For example, if the data responseer sends 100 data packets to the data requester, with each data packet having a second sequence number from 1 to 100, but the data requester did not receive data packets with second sequence numbers 4 and 78, then the values in the SACK option would be [1:3], [5:77], and [79:100]. Finally, an acknowledgment message is generated based on the value of the selective acknowledgment option and the sequence number. By adding a selective acknowledgment mechanism to the acknowledgment message, the accuracy of the existing acknowledgment mechanism is improved.
[0075] Figure 4 A second flowchart illustrating a data interaction method according to an embodiment of the present invention is shown; wherein the data interaction method is mainly used by the data responder, and the method includes:
[0076] Step 402: Receive the request data packet sent by the data requester;
[0077] Step 404: Parse the request data packet to determine the first sequence number in the request data packet;
[0078] Step 406: Determine the data packet based on the request data packet;
[0079] Step 408: Determine the second serial number in the second serial number space;
[0080] Step 410: Assign the second sequence number to the data packet to obtain the response data packet;
[0081] Step 412: Use the first sequence number or the number corresponding to the first sequence number as the message sequence number in the extended header of the response data packet;
[0082] Step 414: Send the response data packet to the data requester.
[0083] In this embodiment, the data interaction method is primarily used by the data responder. This method mainly includes: firstly, establishing an RDMARC (Remote Direct Memory Access Reliable Connection) connection between the data requester and the data responder, typically referred to as a QP (Queue Pair). The data requester can use the QP to initiate RDMA operations including SEND, WRITE, and READ. The responder then reacts to these operations and sends corresponding responses. After the connection is established between the data requester and the data responder, the data responder first receives the request data packet sent by the data requester. This request data packet can be of types such as SEND, WRITE, and READ. The request data packet is then parsed to determine its first sequence number and content. Finally, based on the content of the request data packet, the data packet to be sent to the data requester is determined. Then, a second sequence number is determined in the second sequence number space, which is independent of the first sequence number space. The second sequence number refers to the PSN (packet sequence number) in RDMA technology. When there are multiple packets, the data responder sequentially determines the second sequence number for the same data in the second sequence number space. After obtaining the second sequence number, it is assigned to the packet to obtain the response packet. Then, to associate the response packet with the request packet, the first sequence number in the request packet, or a number that has a one-to-one correspondence with the first sequence number, is used as the message sequence number (MSN) in the extended header (AETH, Acknowledge Extended Transport Header) of the response packet. Finally, the response packet is sent to the data requester. In this invention, by setting the data requester and data responder to use independent sequence number spaces, the sequence numbers of the data requester and data responder become consecutive. Furthermore, this invention establishes an association between the request and response data packets by using the first sequence number in the request data packet as the message sequence number in the response data packet. This avoids the problem of the request and response data packets being unable to be associated because they use separate sequence number spaces. Therefore, this invention solves the problem caused by the independent sequence numbers between the data requester and the data responder.
[0084] Figure 5The diagram illustrates a flow chart of a data interaction method according to an embodiment of the present invention, prior to the step of determining a data packet based on a request data packet; wherein, prior to the step of determining a response data packet based on a request data packet, the method includes:
[0085] Step 502: Generate an acknowledgment message based on the first sequence number;
[0086] Step 504: Send an acknowledgment message to the data requester.
[0087] In this embodiment, before determining the data packet based on the request data packet, the method includes: firstly, generating an acknowledgment message based on a first sequence number, wherein the acknowledgment message refers to an ACK (Acknowledge character) message. Then, sending the acknowledgment message to the data requester ensures that the data responseer has received the request data packet sent by the data requester.
[0088] Figure 6 A flowchart illustrating the step of generating an acknowledgment message based on a first sequence number in a data interaction method according to an embodiment of the present invention is shown; wherein, the step of generating an acknowledgment message based on the first sequence number includes:
[0089] Step 602: Use the first sequence number as the sequence number of the acknowledgment message;
[0090] Step 604: Determine the value of the selective acknowledgment option in the acknowledgment message based on the first sequence number;
[0091] Step 606: Generate an acknowledgment message based on the value and sequence number of the selective acknowledgment option.
[0092] In this embodiment, the step of generating an acknowledgment message based on the first sequence number includes: First, using the first sequence number as the sequence number of the acknowledgment message. It is understood that the data responder needs to add a sequence number to the data packet when sending it. Therefore, to distinguish the acknowledgment message from the regular response data packet, the sequence number of the acknowledgment message cannot be obtained from the second sequence number space; instead, the first sequence number in the request data packet is directly used as the sequence number of the acknowledgment message. Then, the value in the Selective Acknowledgment (SACK) option in the acknowledgment message is determined based on the first sequence number. The SACK option includes the sequence number range of successfully received data packets. For example, if the data requester sends 50 data packets to the data responder, with each data packet having a first sequence number from 1 to 50, but the data responder did not receive the data packet with a first sequence number of 3, then the value in the SACK option would be [1:2] or [4:50]. By adding a selective acknowledgment mechanism to the acknowledgment message, the accuracy of the existing acknowledgment mechanism is improved.
[0093] The data interaction method provided by this invention primarily targets RDMA (Remote Direct Memory Access) technology. In related technologies, firstly, an RDMARC (Remote Direct Memory Access Reliable Connection) is established between the data requester and the data responder, typically referred to as a QP (Queue Pair) in each direction. The requesting party can use the QP to initiate RDMA operations including SEND, WRITE, and READ. The data responder then reacts to these operations and sends corresponding responses. Figure 7 This shows one of the schematic diagrams illustrating the principle of RDMA technology in related technologies. Figure 7This demonstrates how a requester sends a WRITE message followed by a SEND message to a responder. The WRITE message consists of four packets: a Write first, two Write middle, and a Write last. The SEND message consists of three packets: a Send first, a Send middle, and a Send last. Upon receiving data from the requester, the responder returns an ACK (Acknowledgement) to confirm that certain packets have been received. An ACK with PSN=2 indicates that the responder has received all packets with a PSN (Packet Sequence Number) no greater than 2. Similarly, an ACK with PSN=4 indicates that the responder has received all packets with a PSN no greater than 4, and an ACK with PSN=7 indicates that the responder has received all packets with a PSN no greater than 7. Figure 7 As shown, an ACK with PSN=4 indicates that the entire WRITE message has been received, and an ACK with PSN=7 indicates that the entire SEND message has been received. Thus, through the packet sequence number (PSN) and ACK, the RDMA protocol can confirm whether each packet has been successfully delivered to the data responder.
[0094] like Figure 8 As shown, Figure 8 This demonstrates a data requester sending a READ Request message, followed by a SEND message. The READ Request message requests a READ Response message consisting of four data packets from the data responder. After sending the READ Request, the data requester sends a SEND message containing three data packets to the data responder. Figure 8It can be seen that the sequence number (PSN) of the READ Response packet is assigned by the data requester. The data requester reserves these PSNs based on the number of READ Response packets. This leaves a "hole" for the data requester. It's noteworthy that the PSN of the subsequent SEND Request packet starts from 5 (equal to the READ Request PSN plus the number of READ Response packets), not 2. The advantage of the data requester reserving the sequence number for the READ Response is that the data requester can easily associate the Response packet with the original READ Request, since the sequence number of the Response packet is assigned by the requester. However, the following problems exist: First, the Response packet is sent from the data responder to the data requester. However, the data requester does not send any ACK confirmation to the data responder, so the data responder cannot know whether these Response packets have been received by the data requester. Second, because the sequence number of the READ Response packet is assigned by the data requester, this results in a discontinuous sequence number space between the data requester and the data responder. This discontinuous sequence number space presents challenges for the RDMA protocol. Figure 9 As shown, at the data response side, READ Response packets and WRITE packets reside in different PSN spaces. Therefore, when packet loss occurs in both spaces, it becomes difficult to merge the packet loss information from the two independent spaces and apply it to a simple, consistent retransmission algorithm. For example, in Figure 9 In this scenario, when packets with PSNs of 4, 101, 102, and 103 are lost, should the responding party first retransmit the packet with PSN 4 or the packet with PSN 101? On one hand, the packet with PSN 101 should be retransmitted first because duplicate ACKs target the WRITE sequence number space. On the other hand, all these packets belong to the same QP, so the packet with PSN 4 should be retransmitted first. This demonstrates that the challenges posed by the discontinuous sequence number space make designing a reliable RDMA protocol more complex and difficult.
[0095] Therefore, this invention introduces a Unified PSN mechanism to overcome the problems caused by the separation of different PSN spaces in the original RDMA specification. Specifically, within a QP, all RDMA operations use a single PSN space. The data requester and data responder of a connection each maintain their own independent PSN space. The Unified PSN space can be applied to... Figure 8 The scenario is shown. The sequence number of the data packet is as follows: Figure 10 As shown. On the data requester's side, the sequence numbers of the READ request and the subsequent SEND data packet become consecutive, without gaps. On the data responder's side, the READ Response data packet is assigned a sequence number from the data responder's sequence number space. Therefore, the sequence number of the READ Response data packet is independent of the data requester's sequence number space. In this invention, all RDMA operations on the same data requester or data responder share the same sequence number space, regardless of what kind of RDMA operation they are.
[0096] Furthermore, in the original RDMA specification, the data requester could easily associate the READ Response packet with the READ Request packet because the READ Response packet carried a sequence number (PSN) assigned by the data requester. For example... Figure 8 As shown, when the data requester receives READ Response packets with sequence numbers 1 to 4, it knows that these READ Response packets are responses to the READ Request with sequence number 1. However... Figure 10 In this context, the sequence numbers of the READResponse packets, from 100 to 103, are assigned by the data responder, not the data requester. Therefore, the data requester lacks sufficient knowledge to associate the READ Response packets with the original READ Request.
[0097] Therefore, this invention uses a Message Sequence Number (MSN) to establish the association between READResponse packets and READ Requests. Specifically, in the original RDMA specification, the first and last packets in the READResponse carry an AETH (Acknowledgment Extension Header) containing a Message Sequence Number (MSN). The data requester uses this MSN to map ACK packets (in the original RDMA specification, the first and last READ Response packets are considered ACK packets) to the corresponding request. In this invention, as... Figure 11 As shown, MSN carries the READ Request serial number (PSN). Figure 11 In this context, MSN=1, where 1 is the sequence number of the READ Request. When the data requester receives a READ Response message with MSN=1, it can determine which READ Request this READ Response belongs to.
[0098] Furthermore, in this invention, an ACK message is added to the READ Request data packet and the READ Response data packet. For example... Figure 12 As shown, since the PSN of the READ Request is 1, the PSN of the READ Request ACK (read request acknowledgment message) is also 1, indicating that the data responder has received the READ Request. Because the READ Response packet is treated as a data packet rather than an ACK message, an additional READ Request ACK is needed to acknowledge the READ Request. Figure 12 The image shows four READ Response ACK messages, used to acknowledge four corresponding READ Response packets. The frequency of READ Response ACK generation can be configured, allowing one READ Response ACK to acknowledge multiple READ Response packets.
[0099] exist Figure 13 and Figure 14 The format used is the ACK message format defined in the original RDMA specification. Figure 13 and Figure 14 As can be seen, an ACK consists of a BTH (Base Transport Header) and an AETH (Acknowledge Extended Transport Header). The newly added READ Request ACK message also follows the format of a regular ACK message, where the PSN contained in the READ Request ACK message is the PSN of the READ Request packet. The newly added READResponse ACK message also follows the format of a regular ACK message. The PSN contained in the READResponse ACK message is the PSN of the READResponse packet. Therefore, by adopting a unified PSN, the previously mentioned challenge of designing a reliable RDMA protocol due to the discontinuous sequence number space is resolved.
[0100] Furthermore, in network environments where packet loss occurs, the Go-Back-N mechanism defined in RDMA is not efficient in terms of bandwidth utilization. Therefore, a Selective Acknowledgement (SACK) mechanism can be introduced to enhance the existing ACK mechanism.
[0101] Specifically, the format of the SACK_1 packet is the same as that of the ACK message. SACK_1 reuses the reserved values of Syndrome in AETH, such as... Figure 15 As shown, the Syndrome value reserved in the RDMA specification of related technologies is 010xxxxx. Therefore, 01000000 can be used to identify SACK_1. Of course, we can also choose other values within the reserved range.
[0102] Figure 16 This is an example illustrating how SACK_1 works, such as... Figure 16 As shown, packets with PSNs of 2 and 3 were discarded. Therefore, for each subsequent received packet, the data responder generates a SACK_1 packet, where the PSN of ACK is 1, and the PSN of SACK corresponds to the PSN of the currently received packet.
[0103] Furthermore, the SACK mechanism can be extended to use the SACK_n packet format to acknowledge multiple received packets at once. For example... Figure 17 As shown, Figure 17 The SACK_n message format is based on AETH and SACKETH (Selective Acknowledgement Extended Transport Header), meaning it uses AETH and a newly introduced SACKETH extension header. The Syndrome value 01000001 can be optionally used to represent SACK_n. The MSN field is reinterpreted as the number of SACKETH entries. Each SACKETH uses the format [start, end] to describe a received PSN range. All packets contained within the [start, end] range have been received by the data receiver.
[0104] Specifically, such as Figure 18 As shown, a WRITE message consists of 128 packets, where packets with PSNs of 2 and 100 are lost. A single SACK_n packet can describe this situation, containing two SACKETH fields: one SACKETH indicates that packets within the PSN range [3:99] have been received; the other SACKETH indicates that packets within the PSN range [101:128] have been received. The generation of SACK packets depends on the specific implementation. It can be configured to trigger a SACK packet immediately upon receiving out-of-order packets for fast retransmission, or only when the number of out-of-order packets reaches a predetermined threshold, or a predefined timeout occurs, or a predefined number of packets are received.
[0105] Figure 19 This diagram illustrates one embodiment of a data interaction system according to the present invention; wherein, the data interaction system 190 is mainly used by a data requester, and the data interaction system 190 includes:
[0106] The first determining module 1902 is used to determine the first serial number in the first serial number space;
[0107] The first allocation module 1904 is used to allocate the first sequence number into the data packet to obtain the request data packet;
[0108] The first sending module 1906 is used to send the request data packet to the data responder;
[0109] The first receiving module 1908 is used to receive response data packets sent by the data responder;
[0110] The first parsing module 1910 is used to parse the response data packet and determine the message sequence number in the extended header of the response data packet;
[0111] The second determining module 1912 is used to determine that the response data packet is the data packet corresponding to the request data packet if the message sequence number is the same as or corresponds to the first sequence number.
[0112] The data interaction system 190 provided by this invention is mainly used by the data requester and includes: a first determining module 1902, a first allocating module 1904, a first sending module 1906, a first receiving module 1908, a first parsing module 1910, and a second determining module 1912. After a connection is established between the data requester and the data responder, the first determining module 1902 determines a first sequence number in a first sequence number space, where the first sequence number refers to the PSN (packet sequence number) in RDMA technology. Then, the first allocating module 1904 allocates the obtained first sequence number to a data packet to obtain a request data packet. When there are multiple data packets, there are also multiple determined first sequence numbers, and these multiple first sequence numbers are allocated sequentially to each data packet. Different types of data packets use the same first sequence number space. After obtaining the request data packet, the first sending module 1906 sends the request data packet to the data responder. Then, the first receiving module 1908 receives the response data packet sent by the data responder. The number of response data packets can be one or more, and each response data packet includes a second sequence number. The second sequence number comes from a second sequence number space, meaning the first and second sequence numbers come from two independent sequence number spaces. After receiving the response data packet, the first parsing module 1910 parses the response data packet to determine the message sequence number (MSN) in the extended header (AETH, Acknowledge Extended Transport Header) of the response data packet. Then, the second determining module 1912 determines the response data packet when the message sequence number is the same as or has a one-to-one correspondence with the first sequence number. In this invention, "same as" means either the same as or has a one-to-one correspondence with the first sequence number. The response data packet is the data packet returned by the data responder in response to the request data packet; that is, the response data packet with the same message sequence number as the first sequence number corresponds to the request data packet. In other words, the data responder uses the first sequence number of the request data packet as the message sequence number in the extended header of the response data packet, enabling the data requester to accurately find the corresponding data packet in the data returned by the data responder.Furthermore, when the data responder returns multiple response data packets, the data requester can parse the response data packets sequentially. When the data requester finds the first data packet, where the message sequence number of the first data packet is the same as or has a one-to-one correspondence with the first sequence number of the request data packet, and simultaneously finds the second data packet, where the message sequence number of the second data packet is the same as or has a one-to-one correspondence with the first sequence number of the request data packet, it indicates that all response data packets between the first and second data packets are data packets corresponding to the request data packet. In this invention, by setting the data requester and data responder to use independent sequence number spaces, the sequence numbers between the data requester and data responder become continuous. Simultaneously, this invention sets the data requester to determine the response data packet corresponding to the request data packet through the message sequence number, thereby establishing the association between the request data packet and the response data packet, avoiding the problem that the request data packet and response data packet cannot be associated due to the use of independent sequence number spaces by the data requester and data responder. Therefore, this invention solves the problem caused by the discontinuous sequence numbers of the data requester and data responder.
[0113] In some embodiments, optionally, the data interaction system 190 further includes: a first acquisition module, configured to acquire a second sequence number of a response data packet; a first generation module, configured to generate an acknowledgment message based on the second sequence number; and a third sending module, configured to send the acknowledgment message to the data responder.
[0114] In this embodiment, the data interaction system 190 further includes a first acquisition module, a first generation module, and a third sending module. The first acquisition module acquires a second sequence number of the response data packet, where the second sequence number is allocated by the data responder according to a second sequence number space. The first generation module then generates an acknowledgment message based on the second sequence number, where the acknowledgment message refers to an ACK (Acknowledge character) message. The third sending module then sends the acknowledgment message to the data responder. By generating an acknowledgment message based on the second sequence number and sending it to the data responder, the data responder can know that the data requester has received the response data packet sent by the data responder.
[0115] In some embodiments, optionally, the first generation module is specifically configured to use the first sequence number as the sequence number of the acknowledgment message; determine the value of the selective acknowledgment option in the acknowledgment message based on the first sequence number; and generate the acknowledgment message based on the value of the selective acknowledgment option and the sequence number.
[0116] In this embodiment, the first generation module is specifically used to use the first sequence number as the sequence number of the acknowledgment message. It is understood that the data responder needs to add a sequence number to the data packet when sending it. Therefore, to distinguish the acknowledgment message from the regular response data packet, the sequence number of the acknowledgment message cannot be obtained from the second sequence number space; instead, the first sequence number in the request data packet is directly used as the sequence number of the acknowledgment message. Then, the value of the Selective Acknowledgment (SACK) option in the acknowledgment message is determined based on the first sequence number. The SACK option includes the sequence number range of successfully received data packets and the sequence number range of data packets not yet received. For example, if the data requester sends 50 data packets to the data responder, with each data packet having a first sequence number from 1 to 50, but the data responder did not receive the data packet with a first sequence number of 3, then the value in the SACK option would be [1:2] or [4:50]. Finally, the acknowledgment message is generated based on the value of the selective acknowledgment option and the sequence number. By adding a selective acknowledgment mechanism to the acknowledgment message, the accuracy of the existing acknowledgment mechanism is improved.
[0117] Figure 20 A second schematic block diagram of a data interaction system according to an embodiment of the present invention is shown; wherein, the data interaction system 200 is mainly used by the data responder, and the data interaction system 200 includes:
[0118] The second receiving module 2002 is used to receive the request data packet sent by the data requester;
[0119] The second parsing module 2004 is used to parse the request data packet and determine the first sequence number in the request data packet;
[0120] The third determining module 2006 is used to determine the data packet based on the request data packet;
[0121] The fourth determining module 2008 is used to determine the second serial number in the second serial number space;
[0122] The second allocation module 2010 is used to allocate the second sequence number to the data packet to obtain the response data packet;
[0123] The first processing module 2012 is used to use the first sequence number or the number corresponding to the first sequence number as the message sequence number in the extended header of the response data packet;
[0124] The second sending module 2014 is used to send the response data packet to the data requester.
[0125] The data interaction system 200 provided by this invention is mainly used by the data responder and mainly includes: a second receiving module 2002, a second parsing module 2004, a third determining module 2006, a fourth determining module 2008, a second allocation module 2010, a first processing module 2012, and a second sending module 2014. After a connection is established between the data requester and the data responder, the second receiving module 2002 can receive the request data packet sent by the data requester. The request data packet can be a data packet of type SEND, WRITE, or READ. Then, the second parsing module 2004 parses the request data packet to determine the first sequence number and the specific content of the request data packet. Then, the third determining module 2006 determines the data packet to be sent to the data requester based on the specific content of the request data packet. Then, the fourth determining module 2008 determines the second sequence number in the second sequence number space. The second sequence number space is independent of the first sequence number space. The second sequence number refers to the PSN (packet sequence number) in RDMA technology. When there are multiple data packets, the data responder sequentially determines the second sequence number of the same data in the second sequence number space. After obtaining the second sequence number, the second allocation module 2010 allocates the second sequence number to the data packet, thereby obtaining the response data packet. Then, in order to associate the response data packet with the request data packet, the first processing module 2012 uses the first sequence number in the request data packet, or a number that has a one-to-one correspondence with the first sequence number, as the message sequence number (MSN) in the extended header (AETH, Acknowledge Extended Transport Header) of the response data packet. Finally, the second sending module 2014 sends the response data packet to the data requester. In this invention, by setting the data requester and data responder to use independent sequence number spaces, the sequence numbers between the data requester and data responder become continuous. At the same time, by using the first sequence number in the request data packet as the message sequence number in the response data packet, the association relationship between the request data packet and the response data packet is established, avoiding the problem that the request data packet and the response data packet cannot be associated because the data requester and data responder use independent sequence number spaces. Therefore, this invention solves the problem caused by the independent serial numbers between the data requester and the data responder.
[0126] In some embodiments, the data interaction system 200 may optionally include: a second generation module for generating an acknowledgment message based on a first sequence number; and a fourth sending module for sending the acknowledgment message to the data requester.
[0127] In this embodiment, the data interaction system 200 further includes a second generation module and a fourth sending module. The second generation module generates an acknowledgment message based on a first sequence number, where the acknowledgment message refers to an ACK (Acknowledge character) message. The fourth sending module then sends the acknowledgment message to the data requester. By generating an acknowledgment message based on the first sequence number and sending it to the data requester, the data requester can know that the data responder has received the request data packet sent by the data requester.
[0128] In some embodiments, optionally, the second generation module is specifically configured to use the first sequence number as the sequence number of the acknowledgment message; determine the value of the selective acknowledgment option in the acknowledgment message based on the first sequence number; and generate an acknowledgment message based on the value of the selective acknowledgment option and the sequence number.
[0129] In this embodiment, the second generation module is specifically used to use the first sequence number as the sequence number of the acknowledgment message. It is understood that the data responder needs to add a sequence number to the data packet when sending it. Therefore, to distinguish the acknowledgment message from the regular response data packet, the sequence number of the acknowledgment message cannot be obtained from the second sequence number space; instead, the first sequence number in the request data packet is directly used as the sequence number of the acknowledgment message. Then, the value of the Selective Acknowledgment (SACK) option in the acknowledgment message is determined based on the first sequence number. The SACK option includes the sequence number range of successfully received data packets and the sequence number range of data packets not yet received. For example, if the data requester sends 50 data packets to the data responder, with each data packet having a first sequence number from 1 to 50, but the data responder did not receive the data packet with a first sequence number of 3, then the value in the SACK option would be [1:2] or [4:50]. Finally, the acknowledgment message is generated based on the value of the selective acknowledgment option and the sequence number. By adding a selective acknowledgment mechanism to the acknowledgment message, the accuracy of the existing acknowledgment mechanism is improved.
[0130] Figure 21 A schematic block diagram of an electronic device according to an embodiment of the present invention is shown; wherein, the electronic device 210 includes a memory 2102, a processor 2104, and a computer program stored in the memory 2102 and executable on the processor 2104, wherein the processor 2104 executes the computer program to implement the steps of the data interaction method as described above.
[0131] The electronic device 210 provided by the present invention, when the processor 2104 executes the computer program to implement the above-described data interaction method, can achieve the technical effects of any of the above embodiments, and will not be described again.
[0132] One embodiment of the present invention provides a storage medium on which a computer program is stored, which, when executed by a processor, implements the steps of the data interaction method as described above.
[0133] The storage medium provided by the present invention, when the computer program is executed by the processor, implements the steps of the above data interaction method, and can achieve the technical effects of any of the above embodiments, which will not be repeated here.
[0134] In the description of this specification, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance, unless otherwise expressly specified and limited. The terms "connection," "installation," and "fixing," etc., should be interpreted broadly. For example, "connection" can mean a fixed connection, a detachable connection, or an integral connection; it can mean a direct connection or an indirect connection through an intermediate medium. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.
[0135] In the description of this specification, the terms "one embodiment," "some embodiments," "specific embodiment," etc., refer to a specific feature, structure, material, or characteristic described in connection with that embodiment or example, which is included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0136] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A data interaction method for a data requester, characterized in that, include: Determine the first sequence number in the first sequence number space; The first sequence number is assigned to the data packet to obtain the request data packet; Send the request data packet to the data responder; Receive the response data packet sent by the data responder; The response data packet is parsed to determine the message sequence number in the extended header of the response data packet; If the message sequence number is the same as or corresponds to the first sequence number, then the response data packet is determined to be a data packet corresponding to the request data packet.
2. The data interaction method according to claim 1, characterized in that, Before the step of parsing the response data packet and determining the message sequence number in the extended header of the response data packet, the data interaction method further includes: Obtain the second sequence number of the response data packet; Generate an acknowledgment message based on the second sequence number; The confirmation message is sent to the data responder.
3. The data interaction method according to claim 2, characterized in that, The step of generating an acknowledgment message based on the second sequence number includes: Use the second sequence number as the sequence number of the acknowledgment message; The value of the selective acknowledgment option in the acknowledgment message is determined based on the second sequence number; The confirmation message is generated based on the value of the selective confirmation option and the sequence number.
4. A data interaction method for a data responder, characterized in that, include: Receive request data packets sent by the data requester; The request data packet is parsed to determine the first sequence number in the request data packet; Determine the data packet based on the request data packet; Determine the second sequence number in the second sequence number space; The second sequence number is assigned to the data packet to obtain a response data packet; Use the first sequence number or the number corresponding to the first sequence number as the message sequence number in the extended header of the response data packet; The response data packet is sent to the data requester.
5. The data interaction method according to claim 4, characterized in that, Prior to the step of determining the data packet based on the request data packet, the data interaction method further includes: Generate an acknowledgment message based on the first sequence number; The confirmation message is sent to the data requester.
6. The data interaction method according to claim 5, characterized in that, The step of generating an acknowledgment message based on the first sequence number includes: Use the first sequence number as the sequence number of the acknowledgment message; The value of the selective acknowledgment option in the acknowledgment message is determined based on the first sequence number; The confirmation message is generated based on the value of the selective confirmation option and the sequence number.
7. A data interaction system for a data requester, characterized in that, include: A first determining module, the first determining module is used to determine a first serial number in a first serial number space; The first allocation module is used to allocate the first sequence number into the data packet to obtain the request data packet; A first sending module is configured to send the request data packet to the data responder; The first receiving module is used to receive the response data packet sent by the data responder; The first parsing module is used to parse the response data packet and determine the message sequence number in the extended header of the response data packet; The second determining module is used to determine that the response data packet is a data packet corresponding to the request data packet based on the fact that the message sequence number is the same as the first sequence number or the message sequence number corresponds to the first sequence number.
8. A data interaction system for a data responder, characterized in that, include: The second receiving module is used to receive request data packets sent by the data requester; The second parsing module is used to parse the request data packet and determine the first sequence number in the request data packet; The third determining module is used to determine the data packet based on the request data packet; The fourth determining module is used to determine the second serial number in the second serial number space; The second allocation module is used to allocate the second sequence number to the data packet to obtain a response data packet; A first processing module is configured to use the first sequence number or the number corresponding to the first sequence number as the message sequence number in the extended header of the response data packet. The second sending module is used to send the response data packet to the data requester.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the data interaction method as described in any one of claims 1 to 3, and / or the steps of the data interaction method as described in any one of claims 4 to 6.
10. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the data interaction method as described in any one of claims 1 to 3, and / or the steps of the data interaction method as described in any one of claims 4 to 6.