Data transmission methods, devices and equipment

By adopting a packet-based retransmission method, the control logic of the link layer retry scheme is simplified, the efficiency and speed of data transmission are improved, and the complex retransmission management problem in the existing technology is solved.

CN121585329BActive Publication Date: 2026-04-03GETONG INTELLIGENT TECHNOLOGY (SHANGHAI) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-01-27
Publication Date
2026-04-03

Smart Images

  • Figure CN121585329B_ABST
    Figure CN121585329B_ABST
Patent Text Reader

Abstract

This application provides a data transmission method, apparatus, and device. The method includes: sequentially sending data packet fragments from a data buffer to a peer; receiving a response from the peer, wherein the response includes a response sequence number and a reception status; if the reception status is "correct reception," releasing the data packet corresponding to the response sequence number and the sequence number preceding it from the data buffer; if the reception status is "error reception" and the last fragment of the currently sent data packet has been sent, sequentially sending the response sequence number and the data packet following it to the peer, thereby performing packet-based transmission. This packet-based transmission ensures the accuracy of data transmission.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data transmission technology, and in particular to a data transmission method, apparatus and device. Background Technology

[0002] With the rapid development of high-speed network interconnection technology, end-to-end data reliability is becoming increasingly important. One existing scheme is Link Layer Retry (LLR), which requires maintaining a state machine to control whether to retransmit, resulting in very complex control logic. Summary of the Invention

[0003] Based on a first aspect of the embodiments of this application, a data transmission method is provided, comprising: sequentially sending fragments of data packets in a data buffer to a peer end; wherein, a data packet includes at least one fragment; the header fragment of the data packet carries a sequence number of the data packet; the data packets are sequentially buffered in the data buffer according to the sequence number order; receiving a response from the peer end; wherein, the response includes a response sequence number and a reception status; if the reception status is "correct reception", releasing the data packets corresponding to the response sequence number and the sequence numbers preceding the response sequence number in the data buffer; if the reception status is "error reception" and the tail fragment of the currently sent data packet has been sent, sequentially sending the response sequence number and the data packets following the response sequence number to the peer end to perform packet-level transmission.

[0004] According to a second aspect of the embodiments of this application, a data transmission apparatus is provided, the apparatus comprising: a sending module configured to: sequentially send fragments of data packets in a data buffer to a peer end; wherein, a data packet includes at least one fragment; the header fragment of the data packet carries a sequence number of the data packet; the data packets are sequentially buffered in the data buffer according to the sequence number order; a receiving module configured to: receive a response from the peer end; wherein, the response includes a response sequence number and a receiving status; a releasing module configured to: release the data packets corresponding to the response sequence number and the sequence numbers preceding the response sequence number in the data buffer when the receiving status is correct reception; the sending module is further configured to: sequentially send the response sequence number and the data packets following the response sequence number to the peer end when the receiving status is incorrect reception and the tail fragment of the currently sent data packet has been sent, to perform packet-level transmission.

[0005] Based on a third aspect of the embodiments of this application, a data transmission device is provided, comprising: a memory for storing one or more programs; a processor; and, when the one or more programs are executed by the processor, implementing the data transmission method as described above.

[0006] The technical solutions provided by the embodiments of this specification may include the following beneficial effects: retransmission is performed on a packet-by-packet basis, retransmission is performed at the packet boundary, the retransmission management logic is simplified, the retransmission response speed is improved, and the retransmission delay is reduced when retransmission is performed on a packet-by-packet basis.

[0007] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this specification. Attached Figure Description

[0008] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments of the present invention or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For those skilled in the art, other drawings can be obtained from these drawings of the embodiments of the present invention.

[0009] Figure 1 This is a schematic diagram illustrating a data transmission method according to an exemplary embodiment of this specification.

[0010] Figure 2 This is a schematic diagram of a cache illustrated in this specification according to an exemplary embodiment.

[0011] Figure 3 This is a schematic diagram of cache interaction illustrated in this specification according to an exemplary embodiment.

[0012] Figure 4 This is a schematic diagram illustrating another data transmission method according to an exemplary embodiment of this specification.

[0013] Figure 5 This is a schematic diagram illustrating another data transmission method according to an exemplary embodiment of this specification. Detailed Implementation

[0014] The exemplary embodiments will now be described in detail. When the description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this specification; they are merely exemplary embodiments of apparatuses and methods consistent with some aspects of this specification.

[0015] The terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of this specification. The singular forms “a,” “described,” and “the” as used herein are also intended to include the plural forms unless the context clearly indicates otherwise.

[0016] It should be understood that the terms "first," "second," "third," etc., may be used in this specification to describe various information or structural modules for the purpose of more clearly describing the solution. These terms should not be construed as indicating or implying relative importance or implicitly specifying the number, order, or position of the indicated technical features. Therefore, a feature defined with "first," "second," "third," etc., may explicitly or implicitly include one or more of that feature. In the description of this specification, unless otherwise stated, "a plurality of" means two or more; "if" can be interpreted as "when," "when," or "in response to determination."

[0017] In this specification, "and / or" describes the relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following associated objects are in an "or" relationship.

[0018] The embodiments described in this specification will now be described in detail.

[0019] like Figure 1 As shown, Figure 1 This is a flowchart illustrating a data transmission method according to an exemplary embodiment, comprising the following steps:

[0020] Step 102: Send the data packet fragments in the data buffer to the other end in sequence.

[0021] In some alternative embodiments of this disclosure, the data packet includes at least one fragment. The header fragment of the data packet carries the sequence number of the data packet. The data packets are cached sequentially in the data buffer according to the sequence number.

[0022] In some optional embodiments of this disclosure, the data packet fragments can be categorized into three types: header fragments, body fragments, and tail fragments. A header fragment is a fragment with a start of packet (SOP), including a header field containing the source address, destination address, sequence number, length, and reserved fields. A tail fragment is a fragment with an end of packet (EOP), typically containing a verification code, such as a Cyclic Redundancy Check (CRC) code. Body fragments are fragments between the header and tail fragments, and there can be multiple body fragments used to carry the data of the data packet. Some data packets are small enough that a single fragment can contain the entire packet.

[0023] In some optional embodiments of this disclosure, the method may further include: allocating cache space for the data cache. The capacity of the data cache can be obtained from the round-trip time and transmission bandwidth. The number of sequence numbers used by the data cache can be obtained from the capacity of the data cache and the data bit width stored.

[0024] In some optional embodiments of this disclosure, the data buffer can be located in static random-access memory (SRAM). The SRAM can be the SRAM in the local interconnect chip or an external SRAM independent of the interconnect chip. Data transmitted from upstream or upper layers is written into the data buffer. The capacity C of the data buffer can be obtained from the round-trip time (RTT) and the transmission bandwidth (Mbps). The round-trip time refers to the total time consumed from when a data packet is sent from the sender to the receiver, and then from when the receiver returns an acknowledgment to the sender. The formula for calculating the capacity C of the data buffer is: C = RTT x Mbps. The number of sequence numbers used by the data buffer can be obtained from the capacity C of the data buffer and the stored data bit width W. The stored data bit width is usually consistent at the sender and receiver. The formula for calculating the depth N of the data buffer is: N = C / W = (RTT x Mbps) / W. The number of sequence numbers Nseq used in the data buffer can be N+1, that is, Nseq = C / W+1 = (RTT x Mbps) / W+1. This determined data buffer capacity fully considers the amount of data flowing in during the round-trip time, and allocating such a large data buffer capacity is sufficient to accommodate the current transmission bandwidth and the data flowing in during the round-trip time. The number of sequence numbers used in the data buffer also considers the extreme case, where each data packet occupies one fragment.

[0025] It's important to note that during initialization, the local end uses sequence number 0 to establish a handshake with the peer, followed by the use of sequence numbers 2 through N for data packet transmission. After the first cycle, sequence numbers 1 through N are used for data packet transmission, and subsequent cycles continuously use sequence numbers 1 through N. Because sequence number 0 is required, the number of sequence numbers used in the data buffer is one greater than the total depth of the data buffer, ranging from 0 to N. From the second cycle onwards, the range of sequence numbers used can be 1 through N. This ensures that the sequence numbers in the data buffer are non-repeating and sufficient for use. The maximum sequence number N can be stored in a register. The term "cycle" refers to the process where, when the data transmission volume is large and the sequence number reaches the maximum, the next sequence number restarts from 1.

[0026] In some optional embodiments of this disclosure, each data packet carries its sequence number in the header fragment, while the body fragment and tail fragment do not, thereby reducing the amount of data transmitted. The data buffer can be a columnar buffer, with each row containing one storage data bit width, see [reference needed]. Figure 2 Before a data packet enters the data buffer, the sequence number assigned to the packet is filled into the packet's header fragment. Then, the various fragments of the packet are written into the data buffer in sequence. Therefore, data packets are buffered sequentially in the order of their sequence numbers. Each fragment occupies one storage data bit width in the data buffer, and the storage data bit width is greater than or equal to the length of one fragment. Optionally, the storage data bit width can be equal to the length of one fragment (e.g., 1024 bits), which can make full use of the data buffer. The sequence number to be assigned can be stored in a register. Each time a packet's header fragment is received, the value in the register is assigned to that packet as its sequence number. Then, the next sequence number to be assigned is calculated, and the register is updated using the next sequence number to be assigned. If the current sequence number to be assigned is 0 or the maximum sequence number, the next sequence number to be assigned is the current sequence number plus 2; if the current sequence number to be assigned is any sequence number other than 0 or the maximum sequence number, the next sequence number to be assigned is the current sequence number plus 1. For sequence number 0, it will be used when establishing a connection with the other end through a handshake, such as when initializing the first packet. Subsequent data transmission will use sequence numbers 2 to N. After the first cycle, sequence numbers 1 to N will be used again for data transmission.

[0027] Step 104: Receive the response from the other end.

[0028] In some optional embodiments of this disclosure, the response may include a response sequence number and a reception status. The reception status includes correct reception and incorrect reception, which can be represented by 1 bit. For example, 0 indicates correct reception and 1 indicates incorrect reception. After receiving the data packet, the peer can determine whether the sequence number of the received data packet is correct and whether the data packet is erroneous. If it is correct, it returns a response indicating correct reception; if it is erroneous, it returns a response indicating incorrect reception.

[0029] Step 106: If the reception status is "correct reception", release the data packets corresponding to the response sequence number and the sequence numbers preceding that response sequence number from the data buffer.

[0030] In some optional embodiments of this disclosure, the peer end may reply with a response for each data packet, the response containing the sequence number of the data packet and its reception status (correct reception or incorrect reception). Alternatively, the peer end may reply with a response only after a preset number of data packets (e.g., 10) have been correctly received, this response containing the sequence number of the last correctly received data packet and its correct reception status. If a data packet is incorrectly received (incorrect sequence number or incorrect data packet), the peer end immediately returns a response for that data packet, carrying the sequence number of the erroneous data packet and its incorrect reception status. This response method can both inform the local end of the data packet reception status at the peer end and reduce the data overhead of the response.

[0031] In some optional embodiments of this disclosure, if the reception status in the response is "correct reception," the data packets corresponding to the response sequence number and the sequence numbers preceding that response sequence number in the data buffer can be released. When the local end receives a response with a "correct reception" status, it can be assumed that the data packets corresponding to the response sequence number and the sequence numbers preceding that response sequence number have been correctly received by the peer. Therefore, the fragments of the data packets corresponding to the response sequence number and the sequence numbers preceding that response sequence number in the data buffer can be released. This way, even if the response to a preceding data packet is lost, the local end can know from the subsequently received responses that the peer has correctly received the preceding data packets, resulting in better robustness of the entire transmission logic. Optionally, the position of the tail fragment corresponding to the response sequence number can be found in the data buffer using a binary search method or similar approach, and that position and the fragments preceding that position can be released.

[0032] In some optional embodiments of this disclosure, if the local end has already sent data packets with sequence numbers 2, 3, 4, 5, and 6 to the peer end, and now receives a response (5, 0), where 5 is the response sequence number and 0 indicates correct reception, then the local end can release the fragments of data packets with sequence numbers 2 to 5.

[0033] Step 108: If the reception status is "error reception" and the tail fragment of the currently sent data packet has been sent, send the response sequence number and the data packets following the response sequence number to the peer in sequence to perform packet-based transmission.

[0034] In some optional embodiments of this disclosure, if the reception status is "error reception," the local end can know that the data packet corresponding to the sequence number before the response sequence number in the response has been correctly received by the peer end, and the fragments of the correctly received data packet can be released from the data buffer. Before the tail fragment of the currently sent data packet is sent and the header fragment of the next data packet to be sent is sent, the response sequence number and the fragments of the data packet following that response sequence number are sequentially sent to the peer end, starting from the position of the header fragment corresponding to the response sequence number in the data buffer, to complete retransmission at the packet boundary. If an error response is received when the tail fragment of the currently sent data packet is sent, retransmission can begin immediately with minimal delay. If the header fragment of the current data packet has just been sent, retransmission must wait until the current data packet is sent before starting, and in the most extreme case, it may take a transmission time of a maximum packet length (e.g., the current data packet is 10000B) before retransmission can begin. Optionally, the position of the header fragment corresponding to the response sequence number can be found in the data buffer using a binary search method, and the fragments following that position can be sent to complete the retransmission. Whether a data packet is sent for the first time or retransmitted, transmission is performed at the packet level.

[0035] In some optional embodiments of this disclosure, if the local end has already sent data packets with sequence numbers 2, 3, 4, 5, 6 to the peer end, and is now sending the header fragment of data packet with sequence number 7, and receives a response (4, 1), where 4 is the response sequence number and 1 indicates erroneous reception, it means that data packets with sequence numbers 2 and 3 have been correctly received by the peer end, and the local end can release the fragments of data packets with sequence numbers 2 and 3. If data packet with sequence number 4 is received incorrectly by the peer end, it could be that the data packet with sequence number 4 was lost and not received by the peer end, or that the data packet with sequence number 4 failed the verification. In both cases, the peer end will return a response (4, 1). The peer end will delete the fragment of the erroneous data packet with sequence number 4, and consider the subsequent data packets with sequence numbers 5 and 6 to be erroneous and discard them. The currently received fragment with sequence number 7 is also erroneous and will be discarded upon receipt. Since this disclosure performs scheduling at the packet level, the local end needs to retransmit data packets with sequence numbers 4, 5, 6, and 7 after the data packet with sequence number 7 has been sent.

[0036] It should be noted that there are no restrictions on the execution order of steps 106 and 108 above. The entity executing each of the above steps can be an interconnect chip, a chip or device integrating interconnect chip functionality, or a device with a built-in interconnect chip. An interconnect chip is an integrated circuit responsible for enabling high-speed, reliable data transmission within a chip, between chips, or between devices. It can include network communication integrated circuits, high-speed interface chips, inter-chip interconnect chips, interconnect enhancement chips, interconnect IP (on-chip interconnect), etc. The functionality of an interconnect chip can be integrated into chips such as system-on-a-chip (SoC), CPU / GPU / accelerators, and network device chips, or into devices such as optical modules. Devices with built-in interconnect chips can include mobile phones, tablets, televisions, personal computers, servers, switches, routers, automobiles, etc.

[0037] The data transmission method of this disclosure can be applied to the data link layer of Ethernet. This solves the problem that data transmission in the Ethernet Media Access Control Layer (MAC) must be continuous and cannot send fragmented packets. The data transmission method of this disclosure can also be applied to other layers of the Internet, becoming a universal data transmission scheme.

[0038] The data transmission method of this disclosure performs retransmission on a packet-by-packet basis, and performs retransmission at the packet boundary, which simplifies the retransmission management logic, reduces the circuit complexity inside the interconnect chip, improves the retransmission response speed, and reduces the retransmission delay on a packet-by-packet basis.

[0039] In some optional embodiments of this disclosure, the method further includes: allocating cache space for a first cache. The first cache and the data cache may reside in two separate SRAMs. The depth of the first cache is one greater than the depth of the data cache. The number of sequence numbers in the first cache may be equal to the number of sequence numbers used by the data cache. In some optional embodiments of this disclosure, the data cache uses sequence numbers 0, 2, 3, 4, ..., N in the first round, and cyclically uses sequence numbers 1 to N starting from the second round. The number of sequence numbers used in each round is equal to the depth N of the data cache, but the range of the sequence numbers used is 0 to N, for a total of N+1. The first cache needs to record the addresses of the header fragments of all sequence numbers in the data cache; therefore, the depth of the first cache needs to be one greater than the depth N of the data cache. See also... Figure 2The first buffer can include two columns: one column for sequence numbers, already filled with 0 to N, and the other column for recording the addresses of packet header fragments in the data buffer. Alternatively, the first buffer can be a single column, using addresses in the SRAM where it resides as sequence numbers. This associates each sequence number with an SRAM address in the first buffer. Then, the address of the packet header fragment corresponding to that sequence number in the data buffer is written to the address corresponding to that sequence number in the first buffer. Because the first buffer records addresses rather than data, the data width stored in the first buffer can be much smaller than that stored in the data buffer, for example, 10 bits.

[0040] In some optional embodiments of this disclosure, the process of writing data packets to the data buffer further includes: recording the correspondence between the addresses of the header fragments of the data packets in the data buffer and the sequence numbers of the data packets in the first buffer. Since the sequence numbers in the first buffer are pre-configured, the addresses of the header fragments of the data packets in the data buffer are simply filled into the positions corresponding to the sequence numbers of the data packets.

[0041] By recording the correspondence between the sequence number of the data packet and the address of the header fragment in the data buffer in the first buffer, when a retransmission occurs, the starting position of the data buffer that needs to be retransmitted can be quickly determined through the first buffer, which speeds up the retransmission response and reduces latency.

[0042] like Figure 2 As shown, an interconnect chip simultaneously comprises both a transmitting and receiving side. The transmitting side includes a data buffer and a first buffer. The data buffer has three pointers: a write pointer (wr_ptr), a read pointer (rd_ptr), and a release pointer (rls_ptr). The write pointer is used to write data packets from upstream or upper layers into the data buffer; each time a fragment is written, the buffer counter (buffer_cnt) is incremented by 1. The read pointer is used to read fragments from the data buffer to send to the peer; each time a fragment is read, the buffer counter (buffer_cnt) is decremented by 1, thus accurately maintaining the amount of data in the data buffer for subsequent scheduling. The release pointer is used to release fragments of data packets that have been correctly received by the peer from the data buffer, efficiently reusing the data buffer space.

[0043] In some optional embodiments of this disclosure, step 108 may include:

[0044] Step 1081: Assign the address of the header fragment corresponding to the response sequence number in the first cache in the data cache to the read pointer;

[0045] Step 1082: Starting from the position of the read pointer in the data buffer, read and send fragments sequentially to the other end.

[0046] In some optional embodiments of this disclosure, the address of the corresponding header fragment in the data buffer is retrieved from the first buffer using the response sequence number. This address is then assigned to the read pointer, allowing the transmission of the response sequence number and subsequent data packets to the peer starting from the position of the read pointer. This achieves the purpose of retransmitting data packets starting from the response sequence number. Since the first buffer records the correspondence between the sequence numbers of each data packet and the addresses of the header fragments in the data buffer, the read pointer can quickly locate the address of the header fragment corresponding to the response sequence number. The retransmission of data packets can be completed by consuming the read latency of two SRAM reads (one from the first buffer and one from the data buffer), reducing retransmission latency.

[0047] In some optional embodiments of this disclosure, the method may further include: jumping the read pointer from the tail fragment of the currently sent data packet to the header fragment corresponding to the response sequence number, deleting fragments that flowed out but were not sent during the process, and pausing the buffer counter `buffer_cnt` to count the read pointer until the read pointer moves to the tail fragment of the currently sent data packet. The buffer counter is used to record the number of unsent fragments in the data buffer. Since a fragment occupies one storage bit width in the data buffer, the number of unsent fragments reflects the amount of data in the data buffer. The closer the number of unsent fragments is to the depth of the data buffer, the fuller the data buffer is.

[0048] In some optional embodiments of this disclosure, if the local end has already sent data packets with sequence numbers 2, 3, 4, 5, and 6 to the peer end, and is currently sending the body fragment of the data packet with sequence number 7, and receives a response (4, 1), it indicates that the data packet with sequence number 4 was incorrectly received by the peer end. Data packets with sequence numbers 5 through 7, upon arrival at the peer end, will also be considered erroneous and discarded. Therefore, the local end needs to retransmit the data packets with sequence numbers 4 through 7. First, wait for the tail fragment of the currently sent data packet with sequence number 7 to finish sending, then immediately jump the read pointer from the tail fragment of the data packet with sequence number 7 to the head fragment of the data packet with sequence number 4. During the process of the read pointer jumping from the tail fragment of the currently sent data packet with sequence number 7 to the head fragment corresponding to the response sequence number 4, due to the certain read delay of SRAM reading, the first 2-3 fragments of the next data packet (i.e., the data packet with sequence number 8) will still flow out from the SRAM output register. These extra outflowing fragments need to be directly deleted without sending to avoid generating residual packets. Additionally, it is necessary to pause the buffer counter's read count of the read pointer. Because the data packets to be retransmitted (sequence numbers 4-7) have already been read before, continuing the read count would cause errors in the data buffer's data volume statistics, leading to scheduling errors later. This pause in the buffer counter's read count continues until the read pointer moves to the tail fragment of the currently sent data packet (sequence number 7). During this process, the buffer counter's write count continues. The sequence number of the currently sent data packet (7) can be recorded in a register. When the read pointer moves to the tail fragment of the currently sent data packet (sequence number 7), it means that all the data packets that need to be retransmitted have been sent. The data packet to be read next (sequence number 8) is being sent for the first time, and the buffer counter's read count should be restarted.

[0049] In some optional embodiments of this disclosure, since the read latency of each SRAM is fixed, a preset number (e.g., 2) of fragments flowing out of the SRAM's output register can be deleted starting from the clock when the read pointer retransmits. A retransmission flag can be set to control the read count of the read pointer. When the read pointer begins to retransmit, the retransmission flag is set to 1, disabling the read count. After all retransmitted data packets have been sent, the retransmission flag is set to 0, enabling the read count. This effectively blocks the read count of fragments flowing out of the SRAM's output register and pauses the read count of retransmitted data packet fragments.

[0050] In some optional embodiments of this disclosure, the method further includes allocating cache space for the second cache. The data cache, the first cache, and the second cache may reside in three SRAMs. These three SRAMs may all be on-chip interconnects, or they may all be external SRAMs independent of the interconnects. Alternatively, one or two of the three SRAMs may be on-chip interconnects, and the remaining SRAMs may be external SRAMs independent of the interconnects. The depth of the second cache may be one greater than the depth of the data cache. The number of sequence numbers in the second cache may be equal to the number of sequence numbers used by the data cache. See also... Figure 2 The second buffer can include two columns: one column for sequence numbers, already filled with 0 to N, and the other column for recording the address of the tail fragment of the data packet in the data buffer. Alternatively, the second buffer can be a single column, using the address in the SRAM where the second buffer resides as the sequence number. This associates each sequence number with an SRAM address in the second buffer, and then writes the address of the tail fragment of the data packet corresponding to that sequence number in the data buffer into the address corresponding to that sequence number in the second buffer. The data bit width stored in the second buffer can be the same as that stored in the first buffer.

[0051] In some optional embodiments of this disclosure, the process of writing data packets to the data buffer further includes: recording the correspondence between the address of the tail fragment of the data packet in the data buffer and the sequence number of the data packet in the second buffer. Since the sequence number in the second buffer is pre-configured, the address of the tail fragment of the data packet in the data buffer can be filled into the position corresponding to the sequence number of the data packet.

[0052] By recording the correspondence between the sequence number of the data packet and the address of the tail fragment in the data buffer in the second buffer, when it is determined that the other end has correctly received the data packet, the position of the tail fragment of the correctly received data packet can be quickly determined through the second buffer, reducing latency.

[0053] In some optional embodiments of this disclosure, step 106 may include:

[0054] Step 1061: Assign the address of the tail fragment corresponding to the response sequence number in the second cache in the data cache to the release pointer;

[0055] Step 1062: Release the address pointed to by the release pointer and the fragments preceding that address in the data cache.

[0056] In some optional embodiments of this disclosure, the address of the corresponding tail fragment in the data cache is retrieved from the second cache using the response sequence number. This address is then assigned to the release pointer, releasing the address pointed to by the release pointer and all fragments preceding that address, thus achieving timely reclamation of the data cache space. Since the second cache records the correspondence between the sequence numbers of each data packet and the addresses of the tail fragments in the data cache, the release pointer can quickly locate the address of the tail fragment corresponding to the response sequence number. The release of the data packet can be completed by consuming the read latency of two SRAM reads (one from the second cache and one from the data cache), reducing release latency.

[0057] Please see Figure 3 This diagram illustrates the interaction between the data cache, the first cache, and the second cache in this embodiment of the present disclosure. When upstream or upper-layer data flows in, sequence numbers to be assigned are added to the header fragments of the data packets. Each fragment of the data packet is sequentially written into the data cache, and the correspondence between the address of the header fragment in the data cache and its sequence number is recorded in the first cache. When writing the tail fragment, the correspondence between the address of the tail fragment in the data cache and its sequence number is recorded in the second cache. A response is received from the peer. When the response reception status is "error reception," the address of the header fragment corresponding to the response sequence number in the response is found in the first cache and assigned to the read pointer to complete the subsequent retransmission operation. When the response reception status is "correct reception," the address of the tail fragment corresponding to the response sequence number in the response is found in the second cache and assigned to the release pointer to complete the subsequent release operation.

[0058] In some optional embodiments of this disclosure, when a data packet in the data cache is released, the addresses of the header fragments of the data packet recorded in the first cache and the addresses of the tail fragments of the data packet recorded in the second cache can be deleted. Alternatively, the addresses in the first and second caches can be left undeleted. In the next round, when the addresses of the header and tail fragments of a data packet with the corresponding sequence number are available in the data cache, the address of the header fragment in the data cache is used to overwrite the previous record in the first cache, and the address of the tail fragment in the data cache is used to overwrite the previous record in the second cache. This saves one deletion operation and simplifies the entire process.

[0059] In some optional embodiments of this disclosure, data packets in the data buffer can be fragmented and sent while being written to. Alternatively, if a scheduling policy is met, the data packets in the data buffer can be scheduled and sent according to the scheduling policy. The scheduling policy may include at least one of the following: whole packet scheduling, threshold scheduling.

[0060] In some optional embodiments of this disclosure, when the scheduling policy is whole-packet scheduling, and if the scheduling policy is met, scheduling and sending data packets in the data buffer according to the scheduling policy may include: determining whether the header and tail fragments of the currently to-be-sent data packet have been written to the data buffer; if so, sequentially reading and sending the fragments of the currently to-be-sent data packet to the peer end. Then, the next to-be-sent data packet is taken as the new currently to-be-sent data packet, and the determination of whether the header and tail fragments of the new currently to-be-sent data packet have been written to the data buffer is repeated. Whole-packet scheduling is based on packets, requiring that the header and tail fragments of a data packet be written to the data buffer before reading and sending.

[0061] Under whole-packet scheduling, if there are unsent whole packets in the data buffer, they will be read and sent in sequence according to their sequence numbers. The output data packets will be reliably transmitted to the other end with no idle packets. This method is very suitable for tasks with fixed and known requirements and absolute stable performance, long-running, computationally intensive tasks, as well as communication-intensive tasks that are sensitive to network latency.

[0062] In some optional embodiments of this disclosure, when the scheduling strategy is threshold scheduling, if a threshold is used, and the data packets in the data cache are scheduled and sent according to the scheduling strategy under the condition that the scheduling strategy is met, it may include: if the value in the cache counter is greater than the threshold, sequentially reading and sending all fragments of the currently to-be-sent data packet to the peer end. After the tail fragment of the currently to-be-sent data packet is sent, if the value in the cache counter is still greater than the threshold, then the next to-be-sent data packet is taken as the new currently to-be-sent data packet, and sequentially reading and sending all fragments of the new currently to-be-sent data packet to the peer end continues until the tail fragment of the new currently to-be-sent data packet is sent, and the value in the cache counter is less than or equal to the threshold. Threshold scheduling can be based on a pre-set threshold (e.g., if the data cache depth is 100, the threshold is 70), using the value recorded in the cache counter to compare with the threshold. When the value is greater than the threshold, reading and sending of the data packet can be started, even if the data packet has not yet been completely written. In the threshold scheduling embodiments of this disclosure, after the data packet starts to be sent, it will continue to be sent until the tail fragment of the data packet is sent, rather than stopping immediately after the value recorded in the cache counter drops to the threshold. After the tail fragment of the data packet is sent, reading from the data buffer will stop if the value in the buffer counter is less than or equal to the threshold.

[0063] In some optional embodiments of this disclosure, when the scheduling policy is threshold scheduling, if a proportional threshold is used, scheduling and sending data packets in the data cache according to the scheduling policy, under the condition that the scheduling policy is met, may include: if the ratio of the value in the cache counter to the depth of the data cache is greater than the proportional threshold, sequentially reading and sending all fragments of the currently to-be-sent data packet to the peer end. After the tail fragment of the currently to-be-sent data packet is sent, if the ratio of the value in the cache counter to the depth of the data cache is still greater than the proportional threshold, then the next to-be-sent data packet is taken as the new currently to-be-sent data packet, and sequentially reading and sending all fragments of the new currently to-be-sent data packet to the peer end continues until the tail fragment of the new currently to-be-sent data packet is sent, and the ratio of the value in the cache counter to the depth of the data cache is less than or equal to the proportional threshold. Threshold scheduling can be a pre-set proportional threshold (e.g., 70%), using the ratio of the value recorded in the cache counter to the depth of the data cache compared with the proportional threshold. When the ratio is greater than the proportional threshold, reading and sending of the data packet can be initiated, even if the data packet has not yet been completely written.

[0064] Under threshold scheduling, if the amount of data in the data cache reaches the threshold scheduling condition, reading and sending of the current data packet can begin even if it has not been completely written, thus avoiding head-of-line congestion caused by long packets. This approach is highly suitable for tasks with large load fluctuations, tasks with resource requirements that are difficult to predict accurately, and tasks with workloads that are primarily short-term, interactive, and data-intensive.

[0065] In some optional embodiments of this disclosure, when the scheduling strategy is whole-packet scheduling or threshold scheduling, if a threshold is used, scheduling and sending data packets in the data buffer according to the scheduling strategy, provided the scheduling policy is met, may include: determining whether the header and tail fragments of the currently to-be-sent data packet have been written to the data buffer; if yes, sequentially reading and sending the fragments of the currently to-be-sent data packet to the peer; if no, determining whether the value in the buffer counter is greater than the threshold; if yes, sequentially reading and sending the fragments of the currently to-be-sent data packet to the peer, until the tail fragment of the currently to-be-sent data packet is sent completely. Then, the next to-be-sent data packet is used as the new currently to-be-sent data packet, and the determination of whether the header and tail fragments of the new currently to-be-sent data packet have been written to the data buffer is continued.

[0066] In some optional embodiments of this disclosure, when the scheduling strategy is whole-packet scheduling and threshold scheduling, if a proportional threshold is used, scheduling and sending data packets in the data buffer according to the scheduling strategy, under the condition that the scheduling strategy is met, may include: determining whether the header and tail fragments of the current data packet to be sent have been written to the data buffer; if yes, then sequentially reading and sending the fragments of the current data packet to be sent to the other end; if no, determining whether the ratio of the value in the buffer counter to the depth of the data buffer is greater than the proportional threshold; if yes, then sequentially reading and sending the fragments of the current data packet to be sent to the other end, until the tail fragment of the current data packet to be sent is sent completely. Then, the next data packet to be sent is taken as the new current data packet to be sent, and the determination of whether the header and tail fragments of the new current data packet to be sent have been written to the data buffer is continued.

[0067] In some optional embodiments of this disclosure, when the scheduling strategy is whole-packet scheduling or threshold scheduling, and the data packets in the data buffer are scheduled and sent according to the scheduling strategy, the following steps may be taken: determining whether the header and tail fragments of the current data packet to be sent have been written to the data buffer; if yes, then sequentially reading and sending the fragments of the current data packet to be sent to the other end; if no, determining whether the value in the buffer counter is greater than a threshold or whether the ratio of the value in the buffer counter to the depth of the data buffer is greater than a proportional threshold; if yes, then sequentially reading and sending the fragments of the current data packet to be sent to the other end until the tail fragment of the current data packet to be sent is sent. Then, the next data packet to be sent is taken as the new current data packet to be sent, and the determination of whether the header and tail fragments of the new current data packet to be sent have been written to the data buffer is continued.

[0068] The scheduling strategy combining whole-packet scheduling and threshold scheduling integrates the advantages of both scheduling modes. If the data packet to be sent is a short packet, it can be read and sent immediately. If the data packet to be sent is a long packet, it will not wait indefinitely for the long packet to be written completely. Instead, it will start reading and sending the long packet as soon as the threshold scheduling condition is met, until the long packet is completely sent, avoiding congestion at the head of the queue caused by waiting for the long packet to be written completely. The scheduling strategy combining whole-packet scheduling and threshold scheduling in this embodiment of the disclosure takes into account the timeliness of packet transmission while ensuring packet integrity. Data is first buffered in the data buffer. Combining whole-packet scheduling and threshold scheduling, it better manages the traffic situation during transmission. The output data packet will be transmitted to the other end with no idle space in the packet, which is more friendly to protocols that strictly require continuous message transmission.

[0069] In some alternative embodiments of this disclosure, see Figure 4 This is a flowchart illustrating another data transmission method according to an exemplary embodiment.

[0070] When inputting data, step 201 is to determine whether the current fragment is the head fragment.

[0071] If so, then 202, add the sequence number to be assigned to the current fragment and update the sequence number to be assigned.

[0072] If not, then 203. Write the current shard to the data cache and update the write pointer.

[0073] 204. Determine if the current fragment is the head fragment.

[0074] If so, then 205, record the correspondence between the address and sequence number of the current fragment in the data cache in the first cache.

[0075] If not, then 206. Determine if the current fragment is the tail fragment.

[0076] If so, then 207. Record the correspondence between the address and sequence number of the current fragment in the data cache in the second cache.

[0077] 208. Determine whether the scheduling strategy is met.

[0078] If not, then 209. Set the next fragment as the new current fragment and continue with 201.

[0079] If so, then 210. Read and send the data packets in the data buffer according to the scheduling policy, and update the read pointer.

[0080] 211. Receive the response from the other end. The response includes the response sequence number and the reception status.

[0081] 212. If the reception status is correct, read the address of the tail fragment corresponding to the response sequence number in the data buffer from the second buffer, assign the address to the release pointer, and release the address in the data buffer pointed to by the release pointer and the fragments before that address.

[0082] 213. In the case of receiving an error, read the address of the header fragment corresponding to the response sequence number in the data buffer from the first buffer, assign the address to the read pointer, and start reading from the position of the read pointer in the data buffer and send the fragments sequentially to the other end.

[0083] In some alternative embodiments of this disclosure, the response may be carried in the header fragment of a peer data packet sent by the peer, or in a No Operation (NOP) packet sent by the peer.

[0084] In some optional embodiments of this disclosure, when the local end and the remote end exchange data packets, the response generated by the remote end includes a response sequence number and a reception status, which can be carried in the header fragment of the remote end data packet sent by the remote end to the local end. The header fragment of the remote end data packet already contains the sequence number field of the remote end data packet, and the response can be carried using the first 16 bits of the reserved fields in the header fragment. Since the remote end data packet itself is intended for the local end, using the reserved fields in the header fragment of the remote end data packet to carry the response does not affect the transmission of normal data packets, does not consume bandwidth, and can promptly inform the local end of the response, resulting in very high timeliness. It should be noted that before the remote end sends the remote end data packet to the local end, the remote end also needs to use sequence number 0 to establish a connection with the local end first, and then use sequence numbers 2 to the maximum sequence number to send the remote end data packet, and after one cycle, it cyclically uses sequence numbers 1 to the maximum sequence number to send the remote end data packet.

[0085] In some optional embodiments of this disclosure, when the peer is in an idle state at the boundary of sending peer data packets and there are no peer data packets to be sent, the peer can use a NOP packet to carry the response in order to send the response to the local end in a timely manner. The no-operation packet is relatively small; one fragment can hold one NOP packet. The response sequence number and reception status can both be carried in the header of the NOP packet. Upon receiving the NOP packet, the local end can obtain the response from the header and promptly know the reception status of the data packets previously sent to the peer, facilitating timely retransmission or release of the data buffer. After receiving the response from the NOP packet, the local end can discard the NOP packet without further forwarding it, thus not affecting the transmission of data packets.

[0086] In some optional embodiments of this disclosure, the local end can not only act as a sender to send data packets to the peer, but also as a receiver to receive data packets sent by the peer. See also Figure 5 It may also include:

[0087] Step 302: If the header fragment of the data packet from the other end is received, check whether the sequence number in the header fragment is consistent with the expected sequence number.

[0088] If not, then in step 304, reply to the peer with a local response. This local response includes the expected sequence number and the reception status indicating an error.

[0089] If so, then in step 306, continue receiving fragments of the peer data packet until the tail fragment of the peer data packet is received. The tail fragment contains a checksum, such as a CRC code.

[0090] Step 308: Use the checksum in the tail fragment to verify the peer data packet.

[0091] Step 310: If the peer data packet is erroneous, reply to the peer with a response from this end. This response includes the expected sequence number and the reception status of the erroneous reception.

[0092] In some optional embodiments of this disclosure, the expected sequence number is the sequence number that the local end expects to receive. The local end maintains and records the expected sequence number, which can be temporarily stored in a register on the local end. When the sequence number of the peer data packet received by the local end matches the expected sequence number, and the data of the peer data packet is verified to be error-free, the next expected sequence number consecutive to the expected sequence number is calculated. If the current expected sequence number is 0 or the maximum sequence number, the next expected sequence number is the current expected sequence number plus 2. If the current expected sequence number is any sequence number other than 0 or the maximum sequence number, the next expected sequence number is the current expected sequence number plus 1. The register is updated using the next expected sequence number. If the peer data packet is correct, the local end can reply to the peer end with a response, which includes the expected sequence number and a received status indicating correct reception. The local end updates the expected sequence number and the register. Alternatively, after correctly receiving a preset number (e.g., 10) of peer data packets, a local response can be sent back to the peer. This local response includes the sequence number of the last correctly received peer data packet and the reception status. For each correctly received peer data packet, the expected sequence number and register are updated. If the sequence number in the header fragment of a received peer data packet does not match the expected sequence number, it indicates packet loss. In this case, a local response can be immediately sent back to the peer, including the expected sequence number and the reception status of the erroneous reception. If the sequence number in the header fragment of a received peer data packet matches the expected sequence number, other fragments of the peer data packet must be received until the tail fragment is received. The checksum in the tail fragment is used to verify the peer data packet. If an error is found, a local response is immediately sent back to the peer, including the expected sequence number and the reception status of the erroneous reception.

[0093] The method in this embodiment of the disclosure performs a first check on the sequence number in the header fragment of the peer data packet. This allows for timely detection of whether the received peer data packet is the expected packet. If an error is found, an immediate response is given. After the sequence number check, a second check is performed on the peer data packet to promptly detect any errors in the received packet. If an error is found, an immediate response is given. By performing two checks on the peer data packet, the reliability of end-to-end data transmission is ensured.

[0094] In some alternative embodiments of this disclosure, see Figure 2On the receiving side, a receive buffer is also configured, with its own write, read, and release pointers. Upon receiving fragments of a data packet from the peer, the received fragments are written sequentially to the receive buffer, starting from the first fragment and following the write pointer until the last fragment is written. After verification, the fragments are read using the read pointer and reassembled into a complete data packet for transmission to the upper layer. Finally, the fragments in the receive buffer are released using the release pointer. Because the data buffer needs to handle incoming data and cache fragments of already sent data packets, it requires a relatively large buffer depth. The receive buffer, however, only needs to cache fragments of received data packets. Once the data packet is complete and correct, it can be transmitted upwards, and the receive buffer can be released. Data packets with incorrect sequence numbers, those that have erroneous sequence numbers, or those sent after the erroneous sequence number are discarded. Therefore, the depth of the receive buffer can be less than the depth of the sending side's data buffer. For example, the depth of the receive buffer can be half, one-third, or two-fifths of the sending side's data buffer depth.

[0095] In some optional embodiments of this disclosure, when the local end has header fragments of data packets to be sent to the peer end, the local end's response is carried in the header fragments to be sent. When the local end is in an idle state at the boundary of sending data packets, the reply to the peer end is a no-operation packet, wherein the local end's response is carried in the no-operation packet.

[0096] In some optional embodiments of this disclosure, when the local end and the remote end exchange data packets, the local end's response, including the expected sequence number and reception status, can be carried in the header fragment of the data packet to be sent to the remote end. The header fragment already contains the sequence number field of the local end's data packet, and the local end's response can be carried using the first 16 bits of the reserved fields in the header fragment. Since the data packet itself is about to be sent, using the reserved fields of the data packet header fragment to carry the local end's response does not affect the transmission of normal data packets, does not consume bandwidth, and can promptly inform the remote end of the local end's response, resulting in very high timeliness.

[0097] In some optional embodiments of this disclosure, when the local end is in an idle state at the boundary of a data packet transmission, and there are no data packets to be sent, a NOP packet can be used to carry the local end's response in order to promptly send the local end's response to the peer end. The expected sequence number and reception status of the local end's response can both be carried in the header of the NOP packet. Upon receiving the NOP packet, the peer end obtains the local end's response from the header, allowing it to promptly know the reception status of the data packets previously sent to the local end, facilitating timely retransmission or release of its data buffer. After receiving the local end's response from the NOP packet, the peer end can discard the NOP packet without further forwarding it, thus not affecting data packet transmission.

[0098] In some optional embodiments of this disclosure, the method may further include: if the local end receives a preset number of data packets that do not contain the expected sequence number after replying to the peer end with its own response, it retransmits its own response to the peer end. The local end's response includes the expected sequence number and a message indicating incorrect reception. After replying to the peer end with its own response, the local end can record the number of times data packets with the expected sequence number were not correctly received by the peer end using the retransmission count. When the retransmission count is greater than or equal to the preset count, it indicates that the previously sent local end's response may not have been received by the peer end, and the local end retransmits its own response to the peer end so that the peer end retransmits the data packets with the expected sequence number.

[0099] In some optional embodiments of this disclosure, the method may further include: if the local end fails to receive a data packet with the expected sequence number after sending a local response to the peer end within a preset time threshold, it retransmits its local response to the peer end. The local response includes the expected sequence number and a message indicating a reception error. If the local end fails to receive a data packet with the expected sequence number after sending a local response to the peer end within a preset time threshold, it indicates that the previously sent local response may not have been received by the peer end. In this case, the local end will retransmit its local response to the peer end so that the peer end can retransmit the data packet with the expected sequence number.

[0100] In some optional embodiments of this disclosure, the local end may periodically send a request to the peer end to retrieve a response; or, if the local end has not received a response from the peer end after sending the tail fragment of a data packet to the peer end for a preset time period, it may send a request to retrieve a response to the peer end. The request to retrieve a response may include the smallest sequence number for which the local end has not yet received a response. Upon receiving the request to retrieve a response, the peer end compares the sequence number in the request to the peer end's expected sequence number. If the sequence number in the request is less than the peer end's expected sequence number, it indicates that the data packet with that sequence number was correctly received by the peer end, and the peer end may reply with a response for that smallest sequence number or not. If the sequence number in the request is equal to the peer end's expected sequence number, it indicates that the data packet with that sequence number was sent by the local end to the peer end but was not correctly received by the peer end, and the peer end may reply with a response containing the peer end's expected sequence number and a reception status of "error reception". The request to retrieve a response may be carried in the header fragment of a data packet to be sent to the peer end, or it may be carried in a no-operation packet sent from the local end to the peer end. Therefore, if a data packet is not correctly received by the other end, the local end can retransmit it in a timely manner, further ensuring the reliability of data transmission.

[0101] It should be noted that since an interconnect chip has both a transmitting side and a receiving side role, transmitting and receiving can be performed simultaneously or sequentially. As a result, there is no requirement for the execution order of steps 302 and 102, and they can also be performed simultaneously or sequentially. This disclosure does not impose any restrictions on this.

[0102] Since an interconnect chip simultaneously functions as both a transmitter and a receiver, those skilled in the art can, based on the above description of the embodiments of this disclosure, collect, summarize, and supplement the operations performed by the local end and the remote end, the information maintained, and the rules followed, according to the transmitter and receiver. The embodiments of this disclosure will not elaborate further.

[0103] The data transmission method of this disclosure can be applied to interconnect chips, chips or devices that integrate interconnect chip functions, or devices with built-in interconnect chips.

[0104] Accordingly, this specification also provides a data transmission device, which includes:

[0105] The sending module is configured to send data packet fragments from the data buffer to the peer in sequence. Each data packet includes at least one fragment. The header fragment of the data packet carries the sequence number of the data packet. The data packets are buffered sequentially in the data buffer according to their sequence numbers.

[0106] The receiving module is configured to receive responses from the peer. The response includes a response sequence number and a receiving status.

[0107] The release module is configured to release the data packets corresponding to the response sequence number and the sequence number preceding the response sequence number in the data buffer when the reception status is "correct reception".

[0108] The sending module is also configured to: when the reception status is error reception and the tail fragment of the currently sent data packet has been sent, sequentially send the response sequence number and the data packet following the response sequence number to the peer end to perform packet-level transmission.

[0109] In some optional embodiments of this disclosure, the data transmission apparatus may further include: a first recording module configured to: record in a first buffer the correspondence between the address of the header fragment of the data packet in the data buffer and the sequence number of the data packet.

[0110] The sending module can also be configured to: assign the address of the header fragment corresponding to the response sequence number in the first buffer to the read pointer in the data buffer; starting from the position of the read pointer in the data buffer, read and send fragments sequentially to the other end.

[0111] In some optional embodiments of this disclosure, the data transmission apparatus may further include: a second recording module configured to: record in a second buffer the correspondence between the address of the tail fragment of the data packet in the data buffer and the sequence number of the data packet.

[0112] The release module can also be configured to: assign the address of the tail fragment corresponding to the response sequence number in the second cache in the data cache to the release pointer; and release the address in the data cache pointed to by the release pointer and the fragments before that address.

[0113] In some optional embodiments of this disclosure, the data transmission apparatus may further include a configuration module configured to allocate cache space for a data cache, a first cache, and a second cache, respectively. The capacity of the data cache is obtained from the round-trip time and transmission bandwidth; the number of sequence numbers used by the data cache is obtained from the capacity of the data cache and the data bit width stored; the depth of both the first cache and the second cache is 1 greater than the depth of the data cache; and the number of sequence numbers in both the first cache and the second cache is equal to the number of sequence numbers used by the data cache.

[0114] In some optional embodiments of this disclosure, the data transmission apparatus may further include a control module configured to: jump the read pointer from the tail fragment of the currently transmitted data packet to the header fragment corresponding to the response sequence number, delete fragments that flowed out but were not transmitted during the process, and pause the read counting of the read pointer by the buffer counter until the read pointer moves to the tail fragment of the currently transmitted data packet. The buffer counter is used to record the number of untransmitted fragments in the data buffer.

[0115] In some optional embodiments of this disclosure, the data transmission apparatus may further include a scheduling module configured to schedule and send data packets in the data buffer according to a scheduling policy, provided that the scheduling policy is met. The scheduling policy includes at least one of the following: whole packet scheduling and threshold scheduling.

[0116] In some optional embodiments of this disclosure, the data transmission apparatus may further include: a checking module configured to: upon receiving a header fragment of a peer data packet, check whether the sequence number in the header fragment matches the expected sequence number; if not, invoke the sending module to reply to the peer with a local response; wherein the local response includes the expected sequence number and a reception status indicating erroneous reception; if yes, continue receiving fragments of the peer data packet until the tail fragment of the peer data packet is received; wherein the tail fragment contains a checksum; use the checksum in the tail fragment to verify the peer data packet; and if the peer data packet is erroneous, invoke the sending module to reply to the peer with a local response; wherein the local response includes the expected sequence number and a reception status indicating erroneous reception.

[0117] The specific implementation process of the functions and roles of each module in the above device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.

[0118] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of the solution in this specification according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0119] This disclosure also provides a data transmission device, including: a memory for storing one or more programs; a processor; and when the processor executes the one or more programs, it implements the data transmission method described above. Since it essentially corresponds to the method embodiment, relevant details can be found in the description of the method embodiment.

[0120] Data transmission devices can be interconnect chips, or devices with built-in interconnect chips or integrated interconnect chip functionality. Examples include mobile phones, tablets, televisions, personal computers, servers, switches, routers, and automobiles.

[0121] Those skilled in the art can flexibly select and combine the contents of various embodiments of this disclosure as needed, thereby creating more solutions. This disclosure does not list all such recombined solutions, and all solutions formed by various recombinations should be included within the protection scope of this disclosure.

[0122] The foregoing has described exemplary embodiments of this specification. It should be understood that in some cases, the modules described in this specification may be divided in a manner different from that in the embodiments, and the described actions or steps may be performed in a different order than that in the embodiments, while still achieving the desired result. Furthermore, the processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0123] Other embodiments of this specification will readily occur to those skilled in the art upon consideration of the specification and practice of the invention claimed herein. This specification is intended to cover any variations, uses, or adaptations that follow the general principles of this specification and include common knowledge or customary techniques in the art not illustrated herein.

[0124] The above description is merely a preferred embodiment of this specification and is not intended to limit this specification. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this specification should be included within the scope of protection of this specification.

Claims

1. A data transmission method, characterized in that, The method includes: The data packets in the data buffer are sent to the other end in sequence; wherein, the data packet includes at least one fragment; the header fragment of the data packet carries the sequence number of the data packet; the data packets are cached in the data buffer in the order of the sequence number; Receive a response from the peer; wherein the response includes a response sequence number and a reception status; If the reception status is "correct reception", release the data packets corresponding to the response sequence number and the sequence number preceding the response sequence number from the data buffer. If the reception status is erroneous and the tail fragment of the currently transmitted data packet has been sent, the response sequence number and the data packets following the response sequence number are sequentially sent to the peer to perform packet-level transmission. In the case of an erroneous reception, the method further includes: jumping the read pointer from the tail fragment of the currently sent data packet to the head fragment corresponding to the response sequence number, deleting fragments that flowed out but were not sent during the process, and pausing the buffer counter's read count of the read pointer until the read pointer moves to the tail fragment of the currently sent data packet; wherein, the buffer counter is used to record the number of fragments that have not been sent in the data buffer.

2. The method according to claim 1, characterized in that, Also includes: The first cache records the correspondence between the addresses of the header fragments of the data packet in the data cache and the sequence numbers of the data packet; The step of sequentially sending the response sequence number and subsequent data packets to the peer includes: Assign the address of the header fragment corresponding to the response sequence number in the first cache in the data cache to the read pointer; Starting from the position of the read pointer in the data cache, fragments are read and sent sequentially to the peer.

3. The method according to claim 2, characterized in that, Also includes: The second buffer records the correspondence between the address of the tail fragment of the data packet in the data buffer and the sequence number of the data packet; Releasing the data packets corresponding to the response sequence number and the sequence numbers preceding that response sequence number from the data cache includes: Assign the address of the tail fragment corresponding to the response sequence number in the second cache in the data cache to the release pointer; Release the address in the data cache pointed to by the release pointer and the fragment preceding that address.

4. The method according to claim 3, characterized in that, Also includes: Allocate cache space for the data cache, the first cache, and the second cache respectively; The capacity of the data cache is obtained from the round-trip time and transmission bandwidth; the number of sequence numbers used by the data cache is obtained from the capacity of the data cache and the data bit width; the depth of the first cache and the second cache are both 1 greater than the depth of the data cache; the number of sequence numbers in the first cache and the second cache are both equal to the number of sequence numbers used by the data cache.

5. The method according to any one of claims 1-4, characterized in that, Also includes: If the scheduling policy is met, the data packets in the data buffer are scheduled to be sent according to the scheduling policy; wherein the scheduling policy includes at least one of the following: whole packet scheduling, threshold scheduling.

6. The method according to claim 5, characterized in that, When the scheduling policy is threshold scheduling, the step of scheduling and sending data packets in the data buffer according to the scheduling policy, if the scheduling policy is met, includes: If the value in the buffer counter is greater than a threshold, all fragments of the currently to-be-sent data packet are read sequentially and sent to the peer; wherein, the buffer counter is used to record the number of fragments in the data buffer that have not been sent; or If the ratio of the value in the cache counter to the depth of the data cache is greater than a proportional threshold, all fragments of the currently to-be-sent data packet are read sequentially and sent to the peer.

7. The method according to claim 5, characterized in that, When the scheduling policy is whole-packet scheduling and threshold scheduling, the step of scheduling and sending data packets in the data buffer according to the scheduling policy when the scheduling conditions are met includes: Determine whether the header and tail fragments of the data packet to be sent have been written to the data buffer; if so, read them sequentially and send the fragments of the data packet to be sent to the peer. If not, determine whether the value in the cache counter is greater than a threshold or whether the ratio of the value in the cache counter to the depth of the data cache is greater than a proportional threshold; if so, sequentially read and send fragments of the currently to-be-sent data packet to the peer, until the tail fragment of the currently to-be-sent data packet is sent; wherein, the cache counter is used to record the number of fragments in the data cache that have not been sent.

8. The method according to claim 5, characterized in that, The response is carried in the header fragment of the peer data packet sent by the peer, or in the no-operation packet sent by the peer.

9. The method according to any one of claims 1-4, characterized in that, Also includes: Upon receiving a header fragment of a data packet from the peer, check whether the sequence number in the header fragment matches the expected sequence number. If not, then reply to the peer with a local response; wherein the local response includes the expected sequence number and the reception status of the erroneous reception; If so, continue receiving fragments of the peer data packet until the tail fragment of the peer data packet is received; wherein the tail fragment contains a checksum. The checksum in the tail fragment is used to verify the peer data packet; If the peer data packet is erroneous, the local end responds to the peer end; wherein the local end response includes the expected sequence number and the reception status of the erroneous reception.

10. The method according to claim 9, characterized in that, If the local end has a header fragment of a data packet that is about to be sent to the peer end, the local end's response is carried in the header fragment that is about to be sent; When the local end is in an idle state at the boundary of sending data packets, it replies to the peer end with a no-operation packet; wherein the local end's response is carried in the no-operation packet.

11. A data transmission device, characterized in that, The device includes: The sending module is configured to: send data packet fragments in the data buffer to the peer in sequence; wherein, the data packet includes at least one fragment; the header fragment of the data packet carries the sequence number of the data packet; the data packets are buffered in the data buffer in the order of the sequence number; The receiving module is configured to receive a response from the peer; wherein the response includes a response sequence number and a receiving status. The release module is configured to: release the data packets corresponding to the response sequence number and the sequence number preceding the response sequence number in the data buffer when the reception status is correct reception; The sending module is further configured to: when the receiving status is erroneous reception and the tail fragment of the currently sent data packet has been sent, sequentially send the response sequence number and the data packets following the response sequence number to the peer end to perform packet-level transmission. The control module is configured to: when the reception status is an error reception, jump the read pointer from the tail fragment of the currently sent data packet to the head fragment corresponding to the response sequence number to delete the fragments that flowed out but were not sent during the process, and pause the read count of the read pointer by the buffer counter until the read pointer moves to the tail fragment of the currently sent data packet; wherein, the buffer counter is used to record the number of fragments that have not been sent in the data buffer.

12. A data transmission device, characterized in that, include: Memory, used to store one or more programs; processor; When the one or more programs are executed by the processor, the data transmission method as described in any one of claims 1-10 is implemented.

Citation Information

Patent Citations

  • Sending method and sending device of file transmission, electronic equipment and readable medium

    CN109617945A

  • Data caching method and device, electronic equipment and readable medium

    CN116955225A