A data packet transmission method

Through the re -transmission of data in the hardware of the data link layer, the problem of packet loss when the camera sends the image data to the collection card, and realizes the reliable data transmission under high bandwidth, ensuring the normal operation of the business.

CN115173990BActive Publication Date: 2025-01-28HANGZHOU HIKROBOT TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210682235.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-15
Publication Date
2025-01-28
Estimated Expiration
2042-06-15

AI Technical Summary

Technical Problem

When the camera sends image data to the acquisition card based on the CXP protocol, image data is lost due to environmental interference or line abnormalities, and packet loss problems occur, affecting the normal operation of the service.

Method used

Implement data re -transmission at the data link layer, re -transmit the data through hardware, complete the serial number detection of the data packet, send re -order commands, send backup data packets, etc. to avoid software intervention and improve timeliness. DDR cache to avoid bandwidial waste.

Benefits of technology

In the case of maintaining high bandwidth, realize the reliable transmission of data packets, avoid the problem of losing packages, ensure the normal operation of the business, and provide the reliability of the entire system. The transmission method has nothing to do with the medium.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115173990B_ABST
    Figure CN115173990B_ABST
Patent Text Reader

Abstract

The present application provides a data packet transmission method, the method comprising: after receiving a TLP data packet, the first data link layer encapsulates a first sequence number for the TLP data packet; the first data link layer updates the sequence number stored in the first sequence number register to the first sequence number, stores the TLP data packet in a retransmission buffer, and sends the TLP data packet; after receiving the TLP data packet, the second data link layer parses the second sequence number from the TLP data packet; if the second sequence number is greater than the sum of the target sequence number stored in the second sequence number register and a preset value, an RSND data packet encapsulated with the target sequence number is sent to the first data link layer; after receiving the RSND data packet, the first data link layer obtains a TLP data packet whose sequence number is greater than the target sequence number from the retransmission buffer, and retransmits the TLP data packet. Through the technical solution of the present application, data retransmission is realized at the data link layer, packet loss is avoided, and normal operation of the service is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a data packet transmission method. Background Art

[0002] The CXP (CoaXPress) protocol is an asymmetric high-speed serial communication standard over coaxial cable, an asymmetric high-speed point-to-point serial communication digital interface standard, and a digital interface specification developed for the machine vision industry. In it, a device (such as a camera) can be connected to a host (such as an acquisition card in a personal computer) via a coaxial cable. When both the camera and the acquisition card support the CXP protocol, the camera can send image data to the acquisition card based on the CXP protocol, such as sending image data at a speed of up to 10G bits / second.

[0003] When the camera sends image data to the acquisition card based on the CXP protocol, image data may be lost due to environmental interference, line abnormalities, etc., that is, there is a packet loss problem, which affects the normal operation of the business. Summary of the invention

[0004] The present application provides a data packet transmission method, wherein a transmitting end device includes a first data link layer, and a receiving end device includes a second data link layer, and the method includes:

[0005] After receiving the TLP data packet, the first data link layer encapsulates the TLP data packet with a first sequence number; wherein the first sequence number register is used to store the sequence number of the last sent TLP data packet, and the first sequence number is the sum of the sequence number and a preset value;

[0006] The first data link layer updates the sequence number stored in the first sequence number register to the first sequence number, stores the TLP data packet in the retransmission buffer area, and sends the TLP data packet;

[0007] After receiving the TLP data packet, the second data link layer parses the second sequence number from the TLP data packet; if the second sequence number is greater than the sum of the target sequence number stored in the second sequence number register and a preset value, the second data link layer sends an RSND data packet encapsulating the target sequence number to the first data link layer; wherein the second sequence number register is used to store the sequence number of the last successfully received TLP data packet;

[0008] After receiving the RSND data packet, the first data link layer obtains a TLP data packet whose sequence number is greater than the target sequence number from the retransmission buffer area, and retransmits the TLP data packet.

[0009] The present application provides a data packet transmission method, wherein a transmitting end device includes a first data link layer, and a receiving end device includes a second data link layer. The method is applied to the first data link layer, and the method includes:

[0010] After receiving a TLP data packet, encapsulating the TLP data packet with a first sequence number; wherein the transmitting end device maintains a first sequence number register, the first sequence number register is used to store the sequence number of the last sent TLP data packet, and the first sequence number is the sum of the sequence number and a preset value;

[0011] Updating the sequence number stored in the first sequence number register to the first sequence number, storing the TLP data packet in a retransmission buffer, and sending the TLP data packet to the second data link layer;

[0012] If an RSND data packet sent by the second data link layer is received, and the RSND data packet includes a target sequence number, and the target sequence number is the sequence number stored in the second sequence number register maintained by the receiving device, then a TLP data packet with a sequence number greater than the target sequence number is obtained from the retransmission buffer area, and the TLP data packet is retransmitted to the second data link layer.

[0013] The present application provides a data packet transmission method, wherein a transmitting end device includes a first data link layer, and a receiving end device includes a second data link layer. The method is applied to the second data link layer, and the method includes:

[0014] After receiving the TLP data packet, parsing the second sequence number from the TLP data packet;

[0015] If the second sequence number is greater than the sum of the target sequence number stored in the second sequence number register and a preset value, sending an RSND data packet encapsulating the target sequence number to the first data link layer;

[0016] The receiving device maintains a second sequence number register, and the second sequence number register is used to store the sequence number of the last successfully received TLP data packet.

[0017] It can be seen from the above technical solutions that in the embodiment of the present application, data retransmission is implemented at the data link layer. While maintaining high bandwidth, data retransmission is implemented by hardware. The data link layer completes the sequence number detection of the data packet, sends the retransmission command, sends the backup data packet, etc., without the need for software intervention. The timeliness is faster, and there is no need for a large-capacity DDR (Double Data Rate) cache. There is no bandwidth waste, and the reliability of the entire system can be provided. The transmission method is independent of the transmission medium. For example, when the camera sends image data to the acquisition card, if the image data is lost, the camera can be triggered to resend the image data, thereby avoiding the problem of packet loss and ensuring the normal operation of the business. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments of the present application or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings of the embodiments of the present application.

[0019] Figure 1 It is a structural schematic diagram of a data packet transmission system in one embodiment of the present application;

[0020] Figure 2 is a schematic diagram of a seven-layer model and a four-layer model in one embodiment of the present application;

[0021] Figure 3 It is a structural schematic diagram of a data packet transmission system in one embodiment of the present application;

[0022] Figure 4A is a schematic diagram of the format of a DLLP data packet in one embodiment of the present application;

[0023] Figure 4B is a schematic diagram of the format of a CLR data packet in one implementation of the present application;

[0024] Figure 4C It is a schematic diagram of the format of a DONE data packet in one embodiment of the present application;

[0025] Figure 4D This is a schematic diagram of the format of an ACK data packet in one implementation of the present application;

[0026] Figure 4E It is a schematic diagram of the format of an RSND data packet in one embodiment of the present application;

[0027] Figure 5A and Figure 5BIt is a schematic diagram of the format of a TLP data packet in one embodiment of the present application;

[0028] Figure 6 It is a flowchart of a data packet transmission method in one embodiment of the present application;

[0029] Figure 7 is a simplified block diagram of a data link layer retransmission TLP data packet in one embodiment of the present application;

[0030] Figure 8 is a detailed block diagram of a retransmitted TLP data packet at the TX end in one embodiment of the present application;

[0031] Fig. 9 is a detailed block diagram of a retransmitted TLP data packet at the RX end in one embodiment of the present application;

[0032] Fig.10 It is a flowchart of a data packet transmission method in one embodiment of the present application;

[0033] Fig.11 It is a flowchart of a data packet transmission method in one embodiment of the present application. DETAILED DESCRIPTION

[0034] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, rather than limiting the present application. The singular forms of "a", "said" and "the" used in the present application and claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to any or all possible combinations of one or more associated listed items.

[0035] It should be understood that, although the terms first, second, third, etc. may be used to describe various information in the embodiments of the present application, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, in addition, the word "if" used may be interpreted as "at..." or "when..." or "in response to determination".

[0036] The embodiment of the present application proposes a data packet transmission method, which is applied to a system including a transmitting device and a receiving device. For example, the transmitting device can be a camera (such as an industrial camera), and the receiving device can be an acquisition card (such as an acquisition card deployed on an industrial PC); or, the transmitting device can be an acquisition card, and the receiving device can be a camera. For example, when the camera sends image data to the acquisition card, the transmitting device is the camera, and the receiving device is the acquisition card. When the acquisition card sends control data to the camera, the transmitting device is the acquisition card, and the receiving device is the camera. Of course, the camera and the acquisition card are just examples, the transmitting device can be any type of device, and the receiving device can be any type of device, and this embodiment does not limit this.

[0037] See also Figure 1 As shown, it is a structural diagram of a data packet transmission system. The data packet transmission system may include a sending end device and a receiving end device, wherein the sending end device is a camera and the receiving end device is a capture card.

[0038] Exemplarily, the transmitting device and the receiving device can communicate via a target protocol, which can be a high-speed protocol, such as a protocol with a bandwidth increased to 10 Gbps. Of course, the above high-speed protocol is only an example of a target protocol, and this embodiment does not limit this, and it can be any type of protocol.

[0039] When a sending device sends data to a receiving device based on a target protocol, data may be lost due to environmental interference, line abnormalities, etc., that is, there is a packet loss problem, which affects the normal operation of the business.

[0040] In response to the above problems, a retransmission scheme based on the data link layer is proposed in an embodiment of the present application, which is applied to industrial manufacturing fields such as machine vision. The retransmission scheme implements data retransmission at the data link layer. While maintaining high bandwidth, hardware is used to implement data retransmission, thereby providing reliability for the entire system.

[0041] See also Figure 2As shown in the figure, the seven-layer model of OSI (Open System Interconnection) can include application layer, presentation layer, session layer, transport layer, network layer, data link layer and physical layer. The seven-layer model can be simplified into a four-layer model. For example, the four-layer model can include application layer, transport layer, data link layer and physical layer.

[0042] Based on this, see Figure 3 As shown, the sending device (such as a camera) may include an application layer, a transport layer, a data link layer, and a physical layer, and the receiving device (such as an acquisition card) may also include an application layer, a transport layer, a data link layer, and a physical layer. During the transmission of a data packet, the data packet needs to pass through the four-layer architecture protocol, be encapsulated into a complete frame and sent to the other end, that is, transmitted between the sending device and the receiving device.

[0043] The main functions of the application layer are application-related, including read-write control logic, image data transmission, etc. The main functions of the transport layer are data type allocation, end-to-end communication mechanism, etc. The main function of the data link layer is to provide a node-to-node communication mechanism, for retransmission and transmission of special data packets. The main function of the physical layer is to provide the lowest level communication link, to implement link training, rate switching, and bit encoding. Of course, the above are only examples of the functions of the application layer, transport layer, data link layer, and physical layer. This embodiment does not limit the functions of the application layer, transport layer, and physical layer. For the functions of the data link layer, please refer to the subsequent embodiments.

[0044] For the convenience of distinction, in this embodiment, the application layer of the sending end device is called the first application layer, the transport layer of the sending end device is called the first transport layer, the data link layer of the sending end device is called the first data link layer, and the physical layer of the sending end device is called the first physical layer. The application layer of the receiving end device is called the second application layer, the transport layer of the receiving end device is called the second transport layer, the data link layer of the receiving end device is called the second data link layer, and the physical layer of the receiving end device is called the second physical layer.

[0045] Exemplarily, the data link layer can send data packets from the transport layer to the peer end, and can also send data packets generated by itself to the peer end. For data packets from the transport layer, it can be data packets generated by the transport layer or data packets generated by the application layer, and there is no limitation on this. Data packets from the transport layer are recorded as TLP (Transport Layer Packet) data packets. For data packets generated by the data link layer itself, they are actively generated by the data link layer, and the data packets generated by the data link layer itself are recorded as DLLP (Data Link Layer Packet) data packets. In summary, there are two major categories of data packets related to the data link layer: DLLP data packets and TLP data packets.

[0046] Exemplarily, a DLLP packet is a packet initiated by the data link layer, see Figure 4A As shown, it is a schematic diagram of a DLLP data packet. The DLLP data packet may include a DLLP Type field, a DLLP Data field, a CRC field, a SPLP (Start of Physical Layer Packet) field, and an EPLP (End of Physical Layer Packet) field.

[0047] The SPLP field is the packet header added by the physical layer to the DLLP data packet, and the EPLP field is the packet trailer added by the physical layer to the DLLP data packet. There is no restriction on the contents of the SPLP field and the EPLP field.

[0048] In this embodiment, the DLLP data packet can be divided into a CLR data packet, a DONE data packet, an ACK data packet, and an RSND data packet. The DLLP Type field is used to indicate the type of the DLLP data packet, such as whether the DLLP data packet is a CLR data packet, a DONE data packet, an ACK data packet, or an RSND data packet. The DLLP Data field is used to indicate the data content of the DLLP data packet. The CRC field indicates the cyclic redundancy check code of the DLLP data packet, and there is no restriction on the method for obtaining the cyclic redundancy check code. The CLR data packet is a DLLP data packet sent by the sending end device to the receiving end device, and the RSND data packet, the ACK data packet, and the DONE data packet are all DLLP data packets sent by the receiving end device to the sending end device.

[0049] The DLLP Type field is used to indicate the type of the DLLP data packet. See Table 1 for an example of the DLLP Type field. Of course, the values ​​in Table 1 are only examples and are not limiting.

[0050] Table 1

[0051]

[0052] As can be seen from Table 1, when the DLLP Type field is 00000000, it indicates that the DLLP data packet is a CLR data packet, when the DLLP Type field is 00010000, it indicates that the DLLP data packet is a DONE data packet, when the DLLP Type field is 00100000, it indicates that the DLLP data packet is an ACK data packet, and when the DLLP Type field is 00110000, it indicates that the DLLP data packet is a RSND data packet.

[0053] See also Figure 4B , which is a schematic diagram of an example format of a CLR data packet, and the CLR data packet is used to clear the sequence number of the data link layer. The first byte of the CLR data packet is 00000000, which is used to indicate that the DLLP data packet is a CLR data packet, the second byte can be reserved content (Reserved), which can be empty, and the third byte and the fourth byte can be a cyclic redundancy check code.

[0054] See also Figure 4C , which is a schematic diagram of an example format of a DONE packet, where the DONE packet is used to indicate that the data link layer has received the CLR packet and has completed the sequence number clearing. The first byte of the DONE packet is 00010000, which is used to indicate that the DLLP packet is a DONE packet, the second byte is reserved content and can be empty, and the third and fourth bytes are cyclic redundancy check codes.

[0055] See also Figure 4D , which is a schematic diagram of an example format of an ACK data packet, where the ACK data packet is used to indicate that the TLP data packet is correctly received, and the sequence number of the TLP data packet needs to be added to the DLLP Data field of the ACK data packet. The first byte of the ACK data packet is 00100000, which is used to indicate that the DLLP data packet is an ACK data packet, the second byte can be a sequence number (i.e., a sequence number parsed from the TLP data packet), and the third byte and the fourth byte can be a cyclic redundancy check code.

[0056] See also Figure 4E, which is a schematic diagram of an example format of an RSND data packet, wherein the RSND data packet is used to indicate that an error exists in the received TLP data packet, and the sequence number in the last correct TLP data packet is added to the DLLPData field of the RSND data packet. Among them, the first byte of the RSND data packet may be 00110000, which is used to indicate that the DLLP data packet is an RSND data packet, the second byte may be the sequence number, and the third byte and the fourth byte may be the cyclic redundancy check code.

[0057] Exemplarily, a TLP packet is a packet initiated by the transport layer, see Figure 5A As shown, it is a schematic diagram of a TLP data packet, and the TLP data packet may include an SPLP field, an SDLLP field, a TLP data field, an EDLLP field, and an EPLP field. Among them, the TLP data field is used to carry data content (such as image data, etc.), which is a TLP data packet sent from the transport layer to the data link layer, the SPLP field is a header added by the physical layer to the TLP data packet, and the EPLP field is a tail added by the physical layer to the TLP data packet. There is no restriction on the contents of the SPLP field, the EPLP field, and the TLP data field.

[0058] The SDLLP (Start of Data Link Layer Packet) field is the header added by the data link layer to the TLP data packet, and the EDLLP (End of Data Link Layer Packet) field is the trailer added by the data link layer to the TLP data packet. The SDLLP field may include a DLLP Type field and a sequence number field, and the EDLLP field may include a CRC field.

[0059] The DLLP Type field is used to indicate the type of the TLP data packet, that is, to indicate that the data packet is a TLP data packet. The Sequence Number field is used to indicate the sequence number of the TLP data packet, which can be understood as the identifier of the TLP data packet. The CRC field is used to indicate the cyclic redundancy check code of the TLP data packet, and there is no restriction on the method of obtaining the cyclic redundancy check code. The TLP data packet is sent by the sending device to the receiving device.

[0060] The DLLP Type field is used to indicate the type of the TLP data packet. In combination with the DLLP Type field in Table 1, see Table 2 for an example of the DLLP Type field, which is not limited thereto. As can be seen from Table 2, when the DLLP Type field is 10000000, it indicates a TLP data packet.

[0061] Table 2

[0062]

[0063] See also Figure 5B As shown in FIG. 1 , a schematic diagram of an example format of a TLP data packet is shown. The TLP data packet is used to send actual application data (such as image data, etc.). The first two bytes are SDLLP and the last two bytes are EDLLP. The first byte of the TLP data packet is 10000000, which is used to indicate that the data packet is a TLP data packet. The second byte is followed by the actual application data (i.e., the TLP data field, provided by the transport layer). The last two bytes may be a cyclic redundancy check code.

[0064] In the above application scenario, a data packet transmission method is proposed in an embodiment of the present application. The method can be applied to a system including a sending device and a receiving device. For example, when the camera sends a TLP data packet to the acquisition card, the camera acts as a sending device and the acquisition card acts as a receiving device. When the acquisition card sends a TLP data packet to the camera, the acquisition card acts as a sending device and the camera acts as a receiving device.

[0065] In this embodiment, the sending device may include a first application layer, a first transport layer, a first data link layer and a first physical layer, and the receiving device may include a second application layer, a second transport layer, a second data link layer and a second physical layer. In the subsequent process, the processing process of the first data link layer and the second data link layer is taken as an example. Regarding the processing method of other layers, this embodiment does not limit it.

[0066] See also Figure 6 FIG. 4 is a flow chart of the method, which may include:

[0067] Step 601, after receiving a TLP data packet, the first data link layer encapsulates a first sequence number for the TLP data packet; wherein the first sequence number register is used to store the sequence number of the last sent TLP data packet, and the first sequence number is the sum of the sequence number and a preset value (such as 1).

[0068] Step 602: The first data link layer updates the sequence number stored in the first sequence number register to the first sequence number, stores the TLP data packet in the retransmission buffer, and sends the TLP data packet.

[0069] Exemplarily, the first transport layer can send a TLP data packet to the first data link layer, and the first data link layer receives the TLP data packet. For example, after receiving the TLP data packet, the first transport layer sends a query message to the first data link layer, and the first data link layer queries the retransmission buffer (i.e., retransmission buffer) whether there is any remaining storage space to store the TLP data packet. If so, the first data link layer sends an approval message to the first transport layer, and the first transport layer can send the TLP data packet to the first data link layer. If not, the first data link layer sends a rejection message to the first transport layer, and the first transport layer prohibits sending the TLP data packet to the first data link layer, that is, blocks the TLP data packet until there is any remaining storage space in the retransmission buffer to store the TLP data packet, and then resends the TLP data packet to the first data link layer.

[0070] Exemplarily, the transmitting end device may maintain a first sequence number register, which is used to store the sequence number of the last sent TLP data packet. Based on this, after receiving a TLP data packet each time, the first data link layer may determine the first sequence number corresponding to the TLP data packet based on the sequence number stored in the first sequence number register, and encapsulate the first sequence number for the TLP data packet, and the first sequence number is the sum of the sequence number stored in the first sequence number register and 1. Furthermore, the first data link layer may also update the sequence number stored in the first sequence number register to the first sequence number.

[0071] For example, the initial value of the sequence number stored in the first sequence number register is 0 (or other values). When the first data link layer receives the first TLP data packet, the first sequence number encapsulated for the TLP data packet is 1 (0+1), and the sequence number stored in the first sequence number register is updated to 1. When the first data link layer receives the second TLP data packet, the first sequence number encapsulated for the TLP data packet is 2 (1+1), and the sequence number stored in the first sequence number register is updated to 2. When the first data link layer receives the third TLP data packet, the first sequence number encapsulated for the TLP data packet is 3 (2+1), and the sequence number stored in the first sequence number register is updated to 3, and so on.

[0072] For example, see Figure 5A and Figure 5B As shown, after receiving a TLP data packet each time, the first data link layer may encapsulate the SDLLP field and the EDLLP field for the TLP data packet. The SDLLP field may include a DLLP Type field and a sequence number field, and the EDLLP field may include a CRC field.

[0073] The DLLP Type field is 10000000, which is used to indicate that the data packet is a TLP data packet, the sequence number field is the first sequence number corresponding to the TLP data packet, and the CRC field is a cyclic redundancy check code.

[0074] Exemplarily, after receiving a TLP data packet each time, the first data link layer can store the TLP data packet in a retransmission buffer and send the TLP data packet after encapsulating the first sequence number for the TLP data packet (such as encapsulating the SDLLP field and the EDLLP field for the TLP data packet).

[0075] Step 603: After receiving the TLP data packet (ie, the TLP data packet sent by the first data link layer to the second data link layer), the second data link layer parses the second sequence number from the TLP data packet.

[0076] Exemplarily, after receiving the data packet, the second data link layer parses the value of the DLLP Type field of the data packet. If the value of the DLLP Type field (such as 10000000) indicates that the data packet is a TLP data packet, it is determined that the data packet is a TLP data packet, and the second sequence number is parsed from the sequence number field of the TLP data packet.

[0077] Step 604: The second data link layer compares the second sequence number with the sum of the target sequence number and a preset value.

[0078] If the second sequence number is greater than the sum of the target sequence number and the preset value, step 605 may be executed.

[0079] If the second sequence number is equal to the sum of the target sequence number and the preset value, step 607 may be executed.

[0080] If the second sequence number is smaller than the sum of the target sequence number and the preset value, step 609 may be executed.

[0081] Exemplarily, the receiving device may maintain a second sequence number register, which is used to store the sequence number of the last successfully received TLP data packet, and record the sequence number stored in the second sequence number register as the target sequence number. Based on this, after receiving a TLP data packet each time, the second data link layer may parse the second sequence number from the TLP data packet, obtain the target sequence number from the second sequence number register, and compare the second sequence number and the sum of the target sequence number and a preset value (such as 1).

[0082] Exemplarily, a successfully received TLP data packet means: for each TLP data packet received by the second data link layer, if the second sequence number carried in the TLP data packet is equal to the sum of the target sequence number in the second sequence number register and a preset value, then the TLP data packet is regarded as a successfully received TLP data packet, and the second sequence number of the TLP data packet is updated to the second sequence number register. If the second sequence number carried in the TLP data packet is not equal to (such as greater than or less than) the sum of the target sequence number in the second sequence number register and a preset value, then the TLP data packet is not regarded as a successfully received TLP data packet, and the second sequence number of the TLP data packet is not updated to the second sequence number register.

[0083] Step 605: If the second sequence number is greater than the sum of the target sequence number and the preset value, the second data link layer sends an RSND data packet encapsulating the target sequence number to the first data link layer.

[0084] Step 606: After receiving the RSND data packet, the first data link layer obtains a TLP data packet whose sequence number is greater than the target sequence number from the retransmission buffer, and retransmits the TLP data packet.

[0085] For example, if the second sequence number carried by the TLP data packet is 103, and the target sequence number stored in the second sequence number register is 100, that is, the second sequence number is greater than the sum of the target sequence number and 1, it means that the TLP data packets with sequence numbers 101 and 102 have been lost. Therefore, the second data link layer can send an RSND data packet to the first data link layer, and the RSND data packet includes the target sequence number 100. After receiving the RSND data packet, the first data link layer parses the target sequence number 100 from the RSND data packet, and obtains all TLP data packets with sequence numbers greater than the target sequence number 100 from the retransmission buffer, such as the TLP data packet with sequence number 101, the TLP data packet with sequence number 102, and the TLP data packet with sequence number 103.

[0086] Then, the first data link layer may retransmit these TLP data packets, that is, send these TLP data packets to the second data link layer. After receiving the TLP data packets, the second data link layer executes step 603.

[0087] From the above, it can be seen that when the TLP data packets with sequence numbers 101 and 102 are lost, the first data link layer can retransmit the TLP data packets with sequence numbers 101 and 102, thereby avoiding the loss of the TLP data packets.

[0088] For example, see Figure 4A and Figure 4EAs shown, the second data link layer generates an RSND data packet and sends the RSND data packet to the first data link layer. The RSND data packet includes a DLLP Type field, a DLLP Data field, and a CRC field. The DLLP Type field is 00110000, which is used to indicate that the data packet is an RSND data packet, the DLLP Data field is the target sequence number, and the CRC field is a cyclic redundancy check code.

[0089] After receiving the RSND data packet, the first data link layer parses the cyclic redundancy check code from the CRC field of the RSND data packet. If the RSND data packet is determined to be an abnormal data packet (i.e., the CRC check is wrong) based on the cyclic redundancy check code, the RSND data packet can be directly discarded and the TLP data packet is no longer retransmitted. If the RSND data packet is determined to be a normal data packet (i.e., the CRC check is correct) based on the cyclic redundancy check code, the value of the DLLP Type field of the RSND data packet is parsed. If the value indicates that the data packet is an RSND data packet, the DLLP Data field of the RSND data packet is parsed to obtain the target sequence number, and a TLP data packet with a sequence number greater than the target sequence number is obtained from the retransmission buffer, and the TLP data packet is retransmitted.

[0090] Step 607: If the second sequence number is equal to the sum of the target sequence number and the preset value, the second data link layer sends an ACK data packet encapsulated with the second sequence number to the first data link layer, and updates the target sequence number stored in the second sequence number register to the second sequence number (i.e., the second sequence number in the TLP data packet).

[0091] Step 608: After receiving the ACK data packet, the first data link layer deletes the TLP data packets whose sequence numbers are less than or equal to the second sequence number from the retransmission buffer.

[0092] For example, if the second sequence number carried by the TLP data packet is 101, and the target sequence number stored in the second sequence number register is 100, that is, the second sequence number is equal to the sum of the target sequence number and 1, it means that the TLP data packet with the sequence number 101 has been correctly received. Therefore, the second data link layer can send an ACK data packet to the first data link layer, and the ACK data packet includes the second sequence number 101, and the second data link layer updates the target sequence number stored in the second sequence number register to the second sequence number 101.

[0093] After receiving the ACK data packet, the first data link layer parses the second sequence number 101 from the ACK data packet, and deletes TLP data packets with sequence numbers less than or equal to the second sequence number 101 from the retransmission buffer, such as deleting TLP data packets with sequence numbers 101, 100, 99, 98, etc.

[0094] For example, see Figure 4A and Figure 4D As shown, the second data link layer generates an ACK data packet and sends the ACK data packet to the first data link layer. The ACK data packet includes a DLLP Type field, a DLLP Data field, and a CRC field. The DLLP Type field is 00100000, which is used to indicate that the data packet is an ACK data packet, the DLLP Data field is the second sequence number, and the CRC field is a cyclic redundancy check code.

[0095] After the first data link layer receives the ACK data packet, it parses the cyclic redundancy check code from the CRC field of the ACK data packet. If the ACK data packet is determined to be an abnormal data packet based on the cyclic redundancy check code, the ACK data packet is discarded and the TLP data packet is not deleted from the retransmission buffer. If the ACK data packet is determined to be a normal data packet based on the cyclic redundancy check code, the value of the DLLP Type field of the ACK data packet is parsed. If the value indicates that the data packet is an ACK data packet, the DLLPData field of the ACK data packet is parsed to obtain the second sequence number, and the TLP data packet with a sequence number less than or equal to the second sequence number is deleted from the retransmission buffer.

[0096] Exemplarily, when the second sequence number is equal to the sum of the target sequence number and a preset value, it indicates that the second data link layer correctly receives the TLP data packet of the second sequence number. The second data link layer can strip off information such as SDLLP and EDLLP, and send the modified TLP data packet to the second transport layer.

[0097] Step 609: If the second sequence number is less than the sum of the target sequence number and the preset value, the second data link layer sends an ACK data packet encapsulating the second sequence number to the first data link layer.

[0098] Step 610: After receiving the ACK data packet, the first data link layer deletes the TLP data packets whose sequence numbers are less than or equal to the second sequence number from the retransmission buffer.

[0099] For example, if the second sequence number carried by the TLP data packet is 99, and the target sequence number stored in the second sequence number register is 100, that is, the second sequence number is less than the sum of the target sequence number and 1, it means that the TLP data packet with the sequence number of 99 has been correctly received. Therefore, the second data link layer can send an ACK data packet to the first data link layer, and the ACK data packet includes the second sequence number 99. In this case, the second data link layer does not need to update the target sequence number stored in the second sequence number register, that is, it will not be updated to 99. After receiving the ACK data packet, the first data link layer parses the second sequence number 99 from the ACK data packet and deletes the TLP data packets with sequence numbers less than or equal to the second sequence number 99 from the retransmission buffer.

[0100] Step 609-step 610 can refer to step 607-step 608, and will not be repeated here.

[0101] In a possible implementation, for step 603, after the second data link layer receives the TLP data packet, before the second data link layer parses the second sequence number from the TLP data packet, the second data link layer may also parse a cyclic redundancy check code from the TLP data packet. If the TLP data packet is determined to be a normal data packet based on the cyclic redundancy check code, the operation of parsing the second sequence number from the TLP data packet is performed, that is, step 603 and subsequent steps are performed. If the TLP data packet is determined to be an abnormal data packet based on the cyclic redundancy check code, the second data link layer directly reads the target sequence number from the second sequence number register, and sends a RSND data packet encapsulating the target sequence number to the first data link layer.

[0102] For example, see Figure 5A and Figure 5B As shown in the TLP data packet, after receiving the TLP data packet, the second data link layer parses the cyclic redundancy check code from the CRC field of the TLP data packet.

[0103] If the TLP data packet is determined to be an abnormal data packet (i.e., a CRC check error) based on the cyclic redundancy check code, an RSND data packet is generated and sent to the first data link layer, see Figure 4A and Figure 4E As shown, the RSND data packet may include a DLLP Type field, a DLLP Data field and a CRC field. The operation of the first data link layer after receiving the RSND data packet is as described in the above embodiment.

[0104] If the TLP data packet is determined to be a normal data packet (i.e., the CRC check is correct) based on the cyclic redundancy check code, the value of the DLLP Type field of the data packet is parsed. If the value indicates that the data packet is a TLP data packet, the data packet is determined to be a TLP data packet, and the second sequence number is parsed from the sequence number field of the TLP data packet.

[0105] In a possible implementation, the receiving end device (such as the second data link layer) can maintain the RSND flag bit, and the value of the RSND flag bit is a first value (such as 0) or a second value (such as 1). When the value of the RSND flag bit is the first value, it indicates that the RSND data packet is allowed to be sent, and when the value of the RSND flag bit is the second value, it indicates that the RSND data packet is not allowed to be sent. In the initial state, the value of the RSND flag bit is the first value, that is, in the initial state, the RSND data packet is allowed to be sent.

[0106] Based on this, after receiving a TLP data packet, if the second sequence number in the TLP data packet is greater than the sum of the target sequence number and a preset value, the second data link layer determines the value of the RSND flag bit.

[0107] If the value of the RSND flag bit is the first value, that is, the sending of RSND data packets is allowed, the second data link layer will send the RSND data packet encapsulated with the target sequence number to the first data link layer, and then modify the value of the RSND flag bit to the second value, that is, the sending of RSND data packets is no longer allowed.

[0108] If the value of the RSND flag bit is the second value, that is, sending RSND data packets is not allowed, the second data link layer is prohibited from sending RSND data packets encapsulated with the target sequence number to the first data link layer. In other words, even if the second sequence number is greater than the sum of the target sequence number and the preset value, the second data link layer will not send RSND data packets encapsulated with the target sequence number to the first data link layer.

[0109] In addition, after receiving the TLP data packet, if the second sequence number in the TLP data packet is less than or equal to the sum of the target sequence number and the preset value, the second data link layer determines the value of the RSND flag bit.

[0110] If the value of the RSND flag bit is the first value, that is, the sending of the RSND data packet is allowed, the second data link layer keeps the value of the RSND flag bit unchanged at the first value. If the value of the RSND flag bit is the second value, that is, the sending of the RSND data packet is not allowed, the second data link layer modifies the value of the RSND flag bit to the first value, that is, the sending of the RSND data packet is allowed through the RSND flag bit.

[0111] From the above, it can be seen that when the second data link layer receives multiple TLP data packets and the second sequence numbers in the multiple TLP data packets are greater than the sum of the target sequence number and the preset value, the second data link layer can send only one RSND data packet instead of sending multiple RSND data packets, thereby avoiding the first data link layer receiving multiple RSND data packets, resulting in repeated retransmission of TLP data packets.

[0112] For example, the target sequence number stored in the second sequence number register is 100. If the second data link layer receives TLP packets with second sequence numbers of 103, 104, and 105 in sequence, then for the TLP packet with the second sequence number of 103, since the value of the RSND flag is the first value, the second data link layer sends an RSND packet encapsulating the target sequence number 100 to the first data link layer, and modifies the value of the RSND flag to the second value. Then, since the value of the RSND flag is the second value, for the TLP packets with the second sequence numbers of 104 and 105, no RSND packets are sent.

[0113] Until the second data link layer receives the TLP data packet with the second sequence number 101, the second data link layer can send an ACK data packet encapsulated with the second sequence number 101 to the first data link layer, and modify the value of the RSND flag bit to the first value, and then allow the RSND data packet to be sent.

[0114] In a possible implementation, the transmitting end device (such as the first data link layer) may maintain a watchdog timer, and the aging duration of the watchdog timer may be configured based on experience, and is not limited thereto.

[0115] With respect to step 606, after receiving the RSND data packet, the first data link layer obtains the TLP data packet with a sequence number greater than the target sequence number from the retransmission buffer, and retransmits the TLP data packet, the first data link layer may start the watchdog timer. Before the watchdog timer times out, if the ACK data packet returned by the second data link layer is received, the first data link layer turns off the watchdog timer. When the watchdog timer times out, if the ACK data packet returned by the second data link layer is not received, the first data link layer retransmits all TLP data packets in the retransmission buffer and restarts the watchdog timer.

[0116] For example, based on the RSND flag bit, the second data link layer will not send multiple consecutive RSND data packets to the first data link layer, but only send one RSND data packet. Therefore, after the first data link layer receives the RSND data packet and before receiving the ACK data packet, the first data link layer will not receive the RSND data packet again. In this way, after the first data link layer retransmits the TLP data packet, if there is still a TLP data packet lost, resulting in the second data link layer being unable to correctly receive the TLP data packet, then the second data link layer will no longer send the RSND data packet to the first data link layer, nor will it send the ACK data packet to the first data link layer. Therefore, in order to retransmit the TLP data packet, the following method can also be used:

[0117] The first data link layer starts the watchdog timer after retransmitting the TLP data packet. The second data link layer parses the second sequence number from the TLP data packet after receiving the TLP data packet.

[0118] If the second sequence number is greater than the sum of the target sequence number and the preset value, and the RSND flag bit is the second value, the second data link layer will not send an RSND data packet to the first data link layer. Since the first data link layer will not receive either the RSND data packet or the ACK data packet, the watchdog timer will time out. When the watchdog timer times out, the first data link layer retransmits all TLP data packets in the retransmission buffer, restarts the watchdog timer, and repeats the above process.

[0119] If the second sequence number is less than or equal to the sum of the target sequence number and the preset value, the second data link layer will send an ACK data packet to the first data link layer, so that the first data link layer can receive the ACK data packet and turn off the watchdog timer before the watchdog timer times out.

[0120] In a possible implementation, the sending end device maintains a first serial number register and the receiving end device maintains a second serial number register. During operation, the serial numbers in the first serial number register and the second serial number register can be cleared, that is, the serial numbers in the first serial number register and the second serial number register are updated to initial values. The initial value of the serial number can be configured based on experience, such as 0, 1, etc.

[0121] Exemplarily, when it is necessary to clear the sequence number in the first sequence number register, that is, to synchronously clear the sequence number in the first sequence number register and the sequence number in the second sequence number register, the first data link layer sends a CLR data packet to the second data link layer and starts a clear timer. After receiving the CLR data packet, the second data link layer clears the sequence number in the second sequence number register and sends a DONE data packet to the first data link layer. Before the clear timer times out, if the first data link layer receives a DONE data packet, the sequence number in the first sequence number register is cleared and the clear timer is turned off. When the clear timer times out, if the first data link layer does not receive the DONE data packet, the clear timer is restarted and the CLR data packet is resent to the second data link layer, that is, the above process is repeated.

[0122] For example, when the transmitting end device and / or the receiving end device is restarted, the sequence number in the first sequence number register can be cleared, or when the sequence number in the first sequence number register or the second sequence number register is a target value (such as the maximum sequence number, etc.), the sequence number in the first sequence number register can be cleared. Of course, the above are only two examples of the triggering timing of clearing the sequence number, and there is no limitation on this triggering timing.

[0123] When you need to clear the serial number in the first serial number register and the serial number in the second serial number register, refer to Figure 4A and Figure 4B As shown, the first data link layer can generate a CLR data packet and send the CLR data packet to the second data link layer. The CLR data packet can include a DLLP Type field, a DLLP Data field, and a CRC field. Among them, the DLLP Type field is 00000000, which is used to indicate that the data packet is a CLR data packet, the DLLP Data field is empty, and the CRC field is a cyclic redundancy check code.

[0124] After receiving the CLR data packet, the second data link layer parses the cyclic redundancy check code from the CRC field of the CLR data packet. If the CLR data packet is determined to be an abnormal data packet based on the cyclic redundancy check code, the CLR data packet is directly discarded. If the CLR data packet is determined to be a normal data packet based on the cyclic redundancy check code, the value of the DLLP Type field of the CLR data packet is parsed. If the value indicates that the data packet is a CLR data packet, the second data link layer can clear the sequence number in the second sequence number register.

[0125] After the second data link layer clears the sequence number in the second sequence number register, it generates a DONE data packet and sends the DONE data packet to the first data link layer. The DONE data packet may include a DLLP Type field, a DLLP Data field, and a CRC field. The DLLP Type field is 00010000, indicating that the data packet is a DONE data packet, the DLLP Data field is empty, and the CRC field is a cyclic redundancy check code.

[0126] After receiving the DONE data packet, the first data link layer parses the cyclic redundancy check code from the CRC field of the DONE data packet. If the DONE data packet is determined to be an abnormal data packet based on the cyclic redundancy check code, the DONE data packet is directly discarded. If the DONE data packet is determined to be a normal data packet based on the cyclic redundancy check code, the value of the DLLPType field of the DONE data packet is parsed, and if the value indicates that the data packet is a DONE data packet, the first data link layer clears the sequence number in the first sequence number register.

[0127] After the first data link layer sends the CLR data packet to the second data link layer, a clear timer may also be started. Before the clear timer times out, if a DONE data packet is received, the sequence number in the first sequence number register is cleared and the clear timer is turned off. When the clear timer times out, if the DONE data packet is not received, the clear timer is restarted and the CLR data packet is resent.

[0128] In a possible implementation, after receiving a TLP data packet, the first data link layer may encapsulate a first data packet type for the TLP data packet, and the first data packet type indicates that the data packet is a TLP data packet. For example, as shown in Table 2, the first data packet type may be a DLLP Type field, and the value of the DLLP Type field is 10000000, indicating that the data packet is a TLP data packet. When the second data link layer sends an RSND data packet to the first data link layer, the RSND data packet is encapsulated with a second data packet type, and the second data packet type indicates that the data packet is an RSND data packet. For example, as shown in Table 2, the second data packet type may be a DLLP Type field, and the value of the DLLP Type field is 00110000, indicating that the data packet is an RSND data packet. When the second data link layer sends an ACK data packet to the first data link layer, the ACK data packet is encapsulated with a third data packet type, and the third data packet type indicates that the data packet is an ACK data packet. For example, as shown in Table 2, the third data packet type may be a DLLP Type field, and the value of the DLLP Type field is 00100000, indicating that the data packet is an ACK data packet. When the first data link layer sends a CLR data packet to the second data link layer, the fourth data packet type is encapsulated for the CLR data packet, and the fourth data packet type indicates that the data packet is a CLR data packet. For example, as shown in Table 2, the fourth data packet type can be a DLLPType field, and the value of the DLLP Type field is 00000000, indicating that the data packet is a CLR data packet. When the second data link layer sends a DONE data packet to the first data link layer, the fifth data packet type is encapsulated for the DONE data packet, and the fifth data packet type indicates that the data packet is a DONE data packet. For example, as shown in Table 2, the fifth data packet type can be a DLLP Type field, and the value of the DLLP Type field is 00010000, indicating that the data packet is a DONE data packet.

[0129] It can be seen from the above technical solutions that in the embodiments of the present application, data retransmission can be realized at the data link layer. While maintaining high bandwidth, data retransmission can be realized by hardware. The data link layer can detect the serial number of the data packet, send retransmission commands, send backup data packets, etc., without the need for software intervention. The timeliness is faster, no large-capacity DDR cache is required, there will be no bandwidth waste, and the reliability of the entire system can be provided. The transmission method is independent of the transmission medium, and multi-connector data aggregation can be realized on this basis. For example, when the camera sends image data to the acquisition card, if the image data is lost, the camera can be triggered to resend the image data, thereby avoiding the problem of packet loss and ensuring the normal operation of the business.

[0130] The DLLP data packet generated for the data link layer will only occupy 4 bytes. During the normal flow acquisition process, only RSND data packets or ACK data packets will be sent. RSND data packets and ACK data packets only occupy the channel between the receiving device and the sending device, and do not affect the channel between the sending device and the receiving device. In actual use, there will be no bandwidth waste. Each data link layer runs independently and completes retransmission separately. The channels do not affect each other, and multi-connector data transmission aggregation can be achieved.

[0131] The following describes the data packet transmission method of the embodiment of the present application in combination with specific application scenarios.

[0132] See also Figure 7 As shown in the figure, it is a brief block diagram of the data link layer retransmitting TLP data packets. The transmitting device is referred to as the TX end, and the receiving device is referred to as the RX end. When there is a TLP data packet transmission in the transport layer of the TX end, the TLP data packet can be sent to the data link layer. When the TLP data packet passes through the data link layer, the data link layer adds the DLLP Type field, the sequence number field and the CRC field to the TLP data packet. The DLLP Type field is 10000000, the sequence number field is the first sequence number, and the CRC field is the cyclic redundancy check code. The data link layer stores the TLP data packet in the retransmission buffer and sends the TLP data packet to the RX end.

[0133] After receiving the TLP data packet, the data link layer at the RX end performs a CRC check and a data packet check, and sends an ACK data packet or an RSND data packet to the TX end. For example, if the CRC check is wrong, an RSND data packet is sent to the TX end. If the CRC check is correct, a data packet check is performed, that is, the second sequence number is compared with the sum of the target sequence number and the preset value. If the second sequence number is greater than the sum of the target sequence number and the preset value, an RSND data packet can be sent to the TX end; if the second sequence number is less than or equal to the sum of the target sequence number and the preset value, an ACK data packet can be sent to the TX end.

[0134] Among them, the ACK data packet is used to confirm that the TLP data packet with the second sequence number has been received. Therefore, after receiving the ACK data packet, the data link layer at the TX end can delete the TLP data packet with a sequence number less than or equal to the second sequence number from the retransmission buffer. The RSND data packet is used to confirm that the target sequence number and the previous TLP data packet have been received, and the TLP data packet after the target sequence number has not been received and needs to be retransmitted. Therefore, after receiving the RSND data packet, the data link layer at the TX end obtains the TLP data packet with a sequence number greater than the target sequence number from the retransmission buffer and retransmits the TLP data packet.

[0135] After receiving the TLP data packet, the data link layer at the RX end strips the DLLP Type field, sequence number field, and CRC field for the correctly received TLP data packet and sends it to the transport layer at the RX end.

[0136] See also Figure 7 As shown, for the TX end, MUX and De-MUX modules may also be involved, and there is no limitation on this. For the RX end, MUX and De-MUX modules may also be involved, and there is no limitation on this. Among them, MUX may be a multiplexer module, and De-MUX may be a demultiplexer module.

[0137] See also Figure 8 As shown, it is a detailed block diagram of the data link layer retransmitting the TLP data packet at the TX end.

[0138] When the transport layer at the TX end has TLP data packets to transmit, it requests the data link layer to transmit the TLP data packets. If the retransmission buffer (i.e., retransmission buffer) has remaining storage space to store the TLP data packets, the transport layer is allowed to send the TLP data packets to the data link layer. If there is no remaining storage space to store the TLP data packets, the transport layer is prohibited from sending the TLP data packets to the data link layer, i.e., the TLP data packets are blocked.

[0139] The data link layer includes a Seq_num module and a CRC module. When a TLP data packet passes through the data link layer, the Seq_num module adds an SDLLP field to the TLP data packet, that is, adds a DLLP Type field and a sequence number field, and the CRC module adds an EDLLP field to the TLP data packet, that is, adds a CRC field.

[0140] Among them, the Seq_num module contains an 8-bit (8-bit is used as an example here) self-increment counter (i.e., the first sequence number register in the above embodiment). When the value of the counter reaches 255, the next self-increment value becomes 0. When the link is in the initialization state, the value of the counter is initialized to 0. Each value of the counter is a sequence number corresponding to a TLP data packet.

[0141] The data link layer includes TLP Resend Buffer, which is a retransmission buffer. The data link layer stores the TLP data packet in the retransmission buffer and sends the TLP data packet to the RX end.

[0142] The data link layer includes the Clear Seq_num module and the Clear Timmer module. The Clear Seq_num module is a sequence number clearing module. When the link is in the INIT (initialization) state, the Clear Seq_num module will send a CLR data packet to the RX end to notify the data link layer of the RX end to clear the sequence number value and turn on the Clear Timmer module at the same time. The ClearTimmer module is the clearing timer of the above embodiment. When the clearing timer times out, it means that the RX end has not returned the DONE data packet indicating that the clearing is completed. The Clear Seq_num module will resend the CLR data packet. Before the clearing timer times out, if a DONE data packet indicating that the clearing is completed is received, it means that the RX end has completed clearing the sequence number and the INIT state is completed.

[0143] The data link layer includes a Pass CRC module, which is used to perform CRC check on all received data packets. If the CRC check is wrong, the Pass CRC module will discard the data packet. For data packets with correct CRC check, the data packet will be sent to the subsequent module (such as the DONE module).

[0144] The data link layer includes a DONE module, which is used to detect whether a data packet is a DONE data packet. If so, the data packet is sent to the Clear Seq_num module, indicating that the RX end has completed clearing the sequence number. If not, the data packet is sent to the subsequent module (such as the ACK module).

[0145] The data link layer includes an ACK module, which is used to determine whether a data packet is an ACK data packet or an RSND data packet. If it is an ACK data packet, it means that the RX end has correctly received the TLP data packet and needs to clear the TLP data packet in the retransmission buffer. For example, the ACK data packet may include a second sequence number, and the TLP data packet with a sequence number less than or equal to the second sequence number can be deleted from the retransmission buffer.

[0146] The data link layer includes a Resend TLP module. If it is a RSND data packet (i.e., not an ACK data packet), the ResendTLP module needs to resend the TLP data packet in the retransmission buffer. For example, the RSND data packet may include a target sequence number, and the Resend TLP module may obtain a TLP data packet with a sequence number greater than the target sequence number from the retransmission buffer and retransmit the TLP data packet.

[0147] The data link layer includes a Receive Seq_num (RSN[7:0]) register, which is used to record the latest correct Seq_num (sequence number) received. When in the INIT state, this register is assigned a value of all 1s.

[0148] The data link layer includes a Resend Timmer module, which is a watchdog timer. After the Resend TLP module retransmits the TLP data packet, the watchdog timer can be started. Before the watchdog timer times out, if an ACK data packet or an RSND data packet is received, the watchdog timer is turned off, that is, the watchdog timer is cleared. Alternatively, when the watchdog timer times out, if no ACK data packet or RSND data packet is received, that is, no ACK data packet or RSND data packet is received for a long time, the Resend TLP module will resend all TLP data packets in the retransmission buffer.

[0149] The data link layer includes the Resend Counter module, which is a retransmission counting module. When an ACK packet is received, the count value of the Resend Counter module will be cleared to zero. When an RSND packet is received, the Resend Counter module will be counted. When the count value of the Resend Counter module exceeds the set value, an error interrupt signal can be generated to notify the upper layer to perform exception processing.

[0150] See also Fig. 9 As shown, it is a detailed block diagram of the data link layer retransmitting the TLP data packet at the RX end.

[0151] The data link layer includes a Pass CRC module, which is used to perform CRC check on all received data packets. If the CRC check is wrong, the Pass CRC module sends the data packet to the TLP module. If the CRC check is correct, the Pass CRC module sends the data packet to the CLR module.

[0152] The data link layer includes a TLP module, and the TLP module determines whether the data packet with a CRC check error is a TLP data packet. For example, if the DLLP Type field is 10000000 (0X80), it indicates that the data packet is a TLP data packet, otherwise, it indicates that the data packet is not a TLP data packet. Further, if it is a TLP data packet, if the value of RSND Flag (RSND flag bit) is a first value, the RSND data packet is sent by the RSND module, and if the value of RSND Flag is a second value, the RSND module does not send the RSND data packet. If it is not a TLP data packet, the TLP module can discard the data packet.

[0153] The data link layer includes a CLR module. The data packet with a correct CRC check enters the CLR module, and the CLR module determines whether the data packet is a CLR data packet. If it is a CLR data packet, the DONE module sends the DONE data packet, and the CLR module or the DONE module clears the Next Seq_num (NSN [7: 0]) register value, that is, clears the sequence number in Next Seq_num (NSN [7: 0]), and the Next Seq_num (NSN [7: 0]) register is the second sequence number register of the above embodiment. If it is not a CLR data packet, it means that the data packet is a TLP data packet, and the CLR module can send the TLP data packet to the comparison module.

[0154] The data link layer includes a comparison module. After receiving a TLP data packet, the comparison module extracts the Seq_num value (second sequence number) from the TLP data packet and stores it in the Current Seq_num (NSN[7:0]) register. The second sequence number is recorded as the CSN (Current Seq_num, current sequence number) value. The comparison module obtains the Seq_num value (target sequence number) from the Next Seq_num (NSN[7:0]) register. The target sequence number is recorded as the NSN (Next Seq_num, next sequence number) value. The comparison module compares the CSN value with the NSN value. If the CSN value is less than the NSN value + 1, it indicates that a TLP data packet has been received correctly. The ACK module sends an ACK data packet to notify the TX end to clear the TLP data packet in the retransmission buffer.

[0155] If the CSN value is equal to the NSN value + 1, it means that the correct TLP data packet is received, and the TLP data packet is sent to the transport layer. The ACK module sends an ACK data packet to notify the TX end to clear the TLP data packet in the retransmission buffer and update the value in the Current Seq_num (NSN[7:0]) register to the CSN value.

[0156] If the CSN value is greater than the NSN value + 1, it means that there is a TLP data packet missing in the middle, and the RSND module needs to send an RSND data packet to notify the TX end to resend the TLP data packet in the retransmission buffer.

[0157] The data link layer includes the RSND Flag. When the RSND module sends an RSND packet, the RSND Flag is set, and the RSND module no longer sends RSND packets. When the CSN value of the received TLP packet is less than or equal to the NSN value + 1, the RSND Flag is cleared.

[0158] Obviously, the RSND module can query the value of RSND Flag each time it needs to send an RSND data packet. If RSND Flag is set, the RSND module does not send the RSND data packet. If RSND Flag is 0, the RSND module can send the RSND data packet.

[0159] The data link layer includes an RSND module, an ACK module and a DONE module. The RSND module is used to assemble RSND data packets and send RSND data packets. The ACK module is used to assemble ACK data packets and send ACK data packets. The DONE module is used to assemble DONE data packets and send DONE data packets.

[0160] Based on the same application concept as the above method, the embodiment of the present application proposes a data packet transmission method, the sending end device includes a first data link layer, and the receiving end device includes a second data link layer, see Fig.10 FIG. 1 is a flow chart of the method, which is applied to the first data link layer and includes:

[0161] Step 1001, after receiving a TLP data packet, encapsulate a first serial number for the TLP data packet; wherein the sending end device maintains a first serial number register, the first serial number register is used to store the serial number of the last TLP data packet sent, and the first serial number is the sum of the serial number and a preset value.

[0162] Step 1002: Update the sequence number stored in the first sequence number register to the first sequence number, store the TLP data packet in the retransmission buffer area, and send the TLP data packet to the second data link layer.

[0163] Step 1003: If an RSND data packet sent by the second data link layer is received, and the RSND data packet may include a target sequence number, which may be a sequence number stored in a second sequence number register maintained by the receiving device, a TLP data packet with a sequence number greater than the target sequence number is obtained from the retransmission buffer, and the TLP data packet is retransmitted to the second data link layer.

[0164] In one possible implementation, after sending the TLP data packet to the second data link layer, if an ACK data packet sent by the second data link layer is received, and the ACK data packet includes a second sequence number, then the TLP data packets with sequence numbers less than or equal to the second sequence number are deleted from the retransmission buffer; wherein the second sequence number is parsed by the receiving device from the received TLP data packet, and the second sequence number is less than or equal to the sum of the target sequence number in the second sequence number register and a preset value.

[0165] In a possible implementation, after the first data link layer retransmits the TLP data packet to the second data link layer, the first data link layer may also start a watchdog timer; before the watchdog timer times out, if an ACK data packet returned by the second data link layer is received, the watchdog timer may be turned off; when the watchdog timer times out, if an ACK data packet returned by the second data link layer is not received, all TLP data packets in the retransmission buffer may be retransmitted, and the watchdog timer may be restarted.

[0166] In one possible implementation, when it is necessary to clear the sequence number in the first sequence number register, a CLR data packet can also be sent to the second data link layer and a clear timer can be started; before the clear timer times out, if a DONE data packet is received, the sequence number in the first sequence number register is cleared and the clear timer is turned off; when the clear timer times out, if the DONE data packet is not received, the clear timer is restarted and the CLR data packet is sent to the second data link layer again.

[0167] Based on the same application concept as the above method, the embodiment of the present application proposes a data packet transmission method, the sending end device includes a first data link layer, and the receiving end device includes a second data link layer, see Fig.11 FIG. 4 is a flow chart of the method, which is applied to the second data link layer and includes:

[0168] Step 1101: After receiving a TLP data packet, parse the second sequence number from the TLP data packet.

[0169] Step 1102: If the second sequence number is greater than the sum of the target sequence number stored in the second sequence number register and a preset value, an RSND data packet encapsulating the target sequence number is sent to the first data link layer.

[0170] Exemplarily, the receiving device maintains a second sequence number register, and the second sequence number register is used to store the sequence number of the last successfully received TLP data packet.

[0171] In a possible implementation, after parsing the second sequence number from the TLP data packet, if the second sequence number is equal to the sum of the target sequence number and a preset value, an ACK data packet encapsulated with the second sequence number may be sent to the first data link layer, and the target sequence number stored in the second sequence number register is updated to the second sequence number. Alternatively, if the second sequence number is less than the sum of the target sequence number and the preset value, an ACK data packet encapsulated with the second sequence number may be sent to the first data link layer.

[0172] In a possible implementation, when sending an RSND data packet encapsulating a target sequence number to the first data link layer, if the value of the RSND flag bit is the first value, then the RSND data packet encapsulating the target sequence number can be sent to the first data link layer, and the value of the RSND flag bit is modified to the second value. After parsing the second sequence number from the TLP data packet, if the second sequence number is greater than the sum of the target sequence number and a preset value, and the value of the RSND flag bit is the second value, then it is prohibited to send the RSND data packet to the first data link layer; if the second sequence number is equal to the sum of the target sequence number and the preset value, and the value of the RSND flag bit is the second value, then the value of the RSND flag bit is modified to the first value.

[0173] In a possible implementation, after receiving the TLP data packet, a cyclic redundancy check code may be parsed from the TLP data packet; if the TLP data packet is determined to be a normal data packet based on the cyclic redundancy check code, an operation of parsing a second sequence number from the TLP data packet is performed; if the TLP data packet is determined to be an abnormal data packet based on the cyclic redundancy check code, a target sequence number is read from a second sequence number register, and an RSND data packet encapsulated with the target sequence number is sent to the first data link layer.

[0174] In a possible implementation, if a CLR data packet sent by the first data link layer is received, the sequence number in the second sequence number register is cleared, and a DONE data packet is sent to the first data link layer.

[0175] Based on the same application concept as the above method, an embodiment of the present application proposes a data packet transmission system, which may include a sending end device and a receiving end device, the sending end device includes a first data link layer, and the receiving end device includes a second data link layer, wherein:

[0176] The first data link layer is used to encapsulate a first sequence number for a TLP data packet after receiving the TLP data packet; wherein the first sequence number register is used to store the sequence number of the last sent TLP data packet, and the first sequence number is the sum of the sequence number and a preset value;

[0177] The first data link layer is used to update the sequence number stored in the first sequence number register to the first sequence number, store the TLP data packet in the retransmission buffer area, and send the TLP data packet;

[0178] The second data link layer is used to parse the second sequence number from the TLP data packet after receiving the TLP data packet; if the second sequence number is greater than the sum of the target sequence number stored in the second sequence number register and a preset value, send the RSND data packet encapsulating the target sequence number to the first data link layer; the second sequence number register is used to store the sequence number of the last successfully received TLP data packet;

[0179] The first data link layer is used to obtain a TLP data packet with a sequence number greater than the target sequence number from the retransmission buffer after receiving the RSND data packet, and retransmit the TLP data packet.

[0180] Exemplarily, the second data link layer is configured to send an ACK data packet encapsulating the second sequence number to the first data link layer if the second sequence number is equal to the sum of the target sequence number and a preset value, and update the target sequence number stored in the second sequence number register to the second sequence number; or, if the second sequence number is less than the sum of the target sequence number and the preset value, send an ACK data packet encapsulating the second sequence number to the first data link layer;

[0181] The first data link layer is used to delete the TLP data packet with a sequence number less than or equal to the second sequence number from the retransmission buffer after receiving the ACK data packet.

[0182] Exemplarily, the second data link layer is used to send the RSND data packet to the first data link layer and modify the value of the RSND flag bit to the second value if the value of the RSND flag bit is the first value; if the second sequence number is greater than the sum of the target sequence number and a preset value, and the value of the RSND flag bit is the second value, prohibiting the sending of the RSND data packet to the first data link layer; if the second sequence number is equal to the sum of the target sequence number and the preset value, and the value of the RSND flag bit is the second value, modifying the value of the RSND flag bit to the first value.

[0183] Exemplarily, the first data link layer is used to start a watchdog timer; before the watchdog timer times out, if an ACK data packet returned by the second data link layer is received, the watchdog timer is turned off; when the watchdog timer times out, if an ACK data packet returned by the second data link layer is not received, all TLP data packets in the retransmission buffer are retransmitted and the watchdog timer is restarted.

[0184] Exemplarily, the second data link layer is used to parse a cyclic redundancy check code from the TLP data packet; if the TLP data packet is determined to be a normal data packet based on the cyclic redundancy check code, a second sequence number is parsed from the TLP data packet; if the TLP data packet is determined to be an abnormal data packet based on the cyclic redundancy check code, a target sequence number is read from the second sequence number register, and an RSND data packet encapsulated with the target sequence number is sent to the first data link layer.

[0185] Exemplarily, the first data link layer is used to send a CLR data packet to the second data link layer and start a clearing timer when the sequence number in the first sequence number register needs to be cleared;

[0186] The second data link layer is used to clear the sequence number in the second sequence number register after receiving the CLR data packet, and send a DONE data packet to the first data link layer;

[0187] The first data link layer is used to clear the sequence number in the first sequence number register and turn off the clear timer if a DONE data packet is received before the clear timer times out;

[0188] When the clear timer times out, if the DONE data packet is not received, the clear timer is restarted and the CLR data packet is resent to the second data link layer.

[0189] Based on the same application concept as the above method, an embodiment of the present application proposes a sending end device, the sending end device includes a first data link layer, wherein: the first data link layer is used to encapsulate a first sequence number for a TLP data packet after receiving the TLP data packet; wherein the sending end device maintains a first sequence number register, the first sequence number register is used to store the sequence number of the last sent TLP data packet, and the first sequence number is the sum of the sequence number and a preset value;

[0190] Updating the sequence number stored in the first sequence number register to the first sequence number, storing the TLP data packet in a retransmission buffer, and sending the TLP data packet to the second data link layer;

[0191] If an RSND data packet sent by the second data link layer is received, and the RSND data packet includes a target sequence number, and the target sequence number is the sequence number stored in the second sequence number register maintained by the receiving device, then a TLP data packet with a sequence number greater than the target sequence number is obtained from the retransmission buffer area, and the TLP data packet is retransmitted to the second data link layer.

[0192] Based on the same application concept as the above method, a receiving end device is proposed in an embodiment of the present application, wherein the receiving end device includes a second data link layer, wherein: the second data link layer is used to parse a second sequence number from the TLP data packet after receiving the TLP data packet;

[0193] If the second sequence number is greater than the sum of the target sequence number stored in the second sequence number register and a preset value, sending an RSND data packet encapsulating the target sequence number to the first data link layer;

[0194] The receiving device maintains a second sequence number register, and the second sequence number register is used to store the sequence number of the last successfully received TLP data packet.

[0195] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, which may be in the form of a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email transceiver, a game console, a tablet computer, a wearable device or a combination of any of these devices.

[0196] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0197] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the embodiments of the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0198] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0199] Moreover, these computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0200] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0201] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims

1. A data packet transmission method, characterized in that: The method is applied to the field of machine vision, wherein one of the transmitting device and the receiving device is an industrial camera in the field of machine vision, and the other is an acquisition card in the field of machine vision; the transmitting device includes a first data link layer, and the receiving device includes a second data link layer, and the method includes: After receiving a transport layer data packet TLP data packet, the first data link layer encapsulates a first sequence number for the TLP data packet; wherein the first sequence number register is used to store the sequence number of the last sent TLP data packet, and the first sequence number is the sum of the sequence number and a preset value; The first data link layer updates the sequence number stored in the first sequence number register to the first sequence number, stores the TLP data packet in the retransmission buffer area, and sends the TLP data packet; After receiving the TLP data packet, the second data link layer parses the second sequence number from the TLP data packet; if the second sequence number is greater than the sum of the target sequence number stored in the second sequence number register and a preset value, the second data link layer sends an RSND data packet encapsulated with the target sequence number to the first data link layer; if the second sequence number is equal to the sum of the target sequence number and the preset value, the second data link layer sends an ACK data packet encapsulated with the second sequence number to the first data link layer, and updates the target sequence number stored in the second sequence number register to the second sequence number; if the second sequence number is less than the sum of the target sequence number and the preset value, the second data link layer sends an ACK data packet encapsulated with the second sequence number to the first data link layer; wherein the second sequence number register is used to store the sequence number of the last successfully received TLP data packet; after receiving the ACK data packet, the first data link layer deletes the TLP data packets whose sequence numbers are less than or equal to the second sequence number from the retransmission buffer; The second data link layer sends the RSND data packet encapsulating the target sequence number to the first data link layer, including: if the value of the RSND flag bit is the first value, sending the RSND data packet to the first data link layer, and modifying the value of the RSND flag bit to the second value; After the second data link layer parses the second sequence number from the TLP data packet, if the second sequence number is greater than the sum of the target sequence number and the preset value, and the value of the RSND flag bit is the second value, it is prohibited to send the RSND data packet to the first data link layer; if the second sequence number is equal to the sum of the target sequence number and the preset value, and the value of the RSND flag bit is the second value, the value of the RSND flag bit is modified to the first value; After receiving the RSND data packet, the first data link layer obtains the TLP data packet whose sequence number is greater than the target sequence number from the retransmission buffer area, and retransmits the TLP data packet; after retransmitting the TLP data packet, the first data link layer starts the watchdog timer; before the watchdog timer times out, if the ACK data packet returned by the second data link layer is received, the watchdog timer is turned off; when the watchdog timer times out, if the ACK data packet returned by the second data link layer is not received, all TLP data packets in the retransmission buffer area are retransmitted, and the watchdog timer is restarted.

2. The method according to claim 1, characterized in that: After the second data link layer receives the TLP data packet, the method further includes: The second data link layer parses a cyclic redundancy check code from the TLP data packet; If the second data link layer determines that the TLP data packet is a normal data packet based on the cyclic redundancy check code, then performing an operation of parsing a second sequence number from the TLP data packet; If the second data link layer determines that the TLP data packet is an abnormal data packet based on the cyclic redundancy check code, the target sequence number is read from the second sequence number register, and an RSND data packet encapsulating the target sequence number is sent to the first data link layer.

3. The method according to claim 1, characterized in that The method further comprises: When it is necessary to clear the sequence number in the first sequence number register, the first data link layer sends a CLR data packet to the second data link layer and starts a clearing timer; After receiving the CLR data packet, the second data link layer clears the sequence number in the second sequence number register and sends a DONE data packet to the first data link layer; Before the clear timer times out, if the first data link layer receives a DONE data packet, the sequence number in the first sequence number register is cleared and the clear timer is turned off; When the clear timer times out, if the first data link layer has not received the DONE data packet, the clear timer is restarted and the CLR data packet is resent to the second data link layer.

4. The method according to claim 3, characterized in that After receiving the TLP data packet, the first data link layer encapsulates the TLP data packet into a first data packet type, wherein the first data packet type indicates that the data packet is a TLP data packet; When the second data link layer sends the RSND data packet to the first data link layer, the second data packet type is encapsulated into the RSND data packet, where the second data packet type indicates that the data packet is an RSND data packet; When the second data link layer sends an ACK data packet to the first data link layer, the third data packet type is encapsulated into the ACK data packet, and the third data packet type indicates that the data packet is an ACK data packet; When the first data link layer sends a CLR data packet to the second data link layer, the first data link layer encapsulates the CLR data packet into a fourth data packet type, wherein the fourth data packet type indicates that the data packet is a CLR data packet; When the second data link layer sends a DONE data packet to the first data link layer, the fifth data packet type is encapsulated for the DONE data packet, and the fifth data packet type indicates that the data packet is a DONE data packet.

5. The method according to claim 1, characterized in that The sending end device and the receiving end device communicate with each other via a target protocol.

6. A data packet transmission method, characterized in that: The method is applied to the field of machine vision, one of the transmitting device and the receiving device is an industrial camera in the field of machine vision, and the other is an acquisition card in the field of machine vision; the transmitting device includes a first data link layer, the receiving device includes a second data link layer, and the method is applied to the first data link layer, and the method includes: After receiving a transport layer data packet TLP data packet, encapsulating the TLP data packet with a first sequence number; wherein the transmitting end device maintains a first sequence number register, the first sequence number register is used to store the sequence number of the last sent TLP data packet, and the first sequence number is the sum of the sequence number and a preset value; The sequence number stored in the first sequence number register is updated to the first sequence number, the TLP data packet is stored in the retransmission buffer area, and the TLP data packet is sent to the second data link layer; so that after the second data link layer parses the second sequence number from the TLP data packet, if the second sequence number is greater than the sum of the target sequence number stored in the second sequence number register and a preset value, the second data link layer sends an RSND data packet encapsulated with the target sequence number to the first data link layer; if the second sequence number is equal to the sum of the target sequence number and the preset value, the second data link layer sends an ACK data packet encapsulated with the second sequence number to the first data link layer, and updates the target sequence number stored in the second sequence number register to the second sequence number; if the second sequence number is less than the sum of the target sequence number and the preset value, the second data link layer sends an ACK data packet encapsulated with the second sequence number to the first data link layer. ACK data packet with a number; wherein the second sequence number register is used to store the sequence number of the last successfully received TLP data packet; the second data link layer sends an RSND data packet encapsulated with the target sequence number to the first data link layer, including: if the value of the RSND flag bit is the first value, then the RSND data packet is sent to the first data link layer, and the value of the RSND flag bit is modified to the second value; after the second data link layer parses the second sequence number from the TLP data packet, if the second sequence number is greater than the sum of the target sequence number and a preset value, and the value of the RSND flag bit is the second value, then the second data link layer is prohibited from sending the RSND data packet to the first data link layer; if the second sequence number is equal to the sum of the target sequence number and the preset value, and the value of the RSND flag bit is the second value, then the second data link layer modifies the value of the RSND flag bit to the first value; If an ACK data packet sent by the second data link layer is received, and the ACK data packet includes a second sequence number, deleting a TLP data packet whose sequence number is less than or equal to the second sequence number from the retransmission buffer; If an RSND data packet sent by the second data link layer is received, and the RSND data packet includes a target sequence number, a TLP data packet with a sequence number greater than the target sequence number is obtained from the retransmission buffer, and the TLP data packet is retransmitted to the second data link layer; after retransmitting the TLP data packet to the second data link layer, a watchdog timer is started; before the watchdog timer times out, if an ACK data packet returned by the second data link layer is received, the watchdog timer is turned off; when the watchdog timer times out, if an ACK data packet returned by the second data link layer is not received, all TLP data packets in the retransmission buffer are retransmitted, and the watchdog timer is restarted.

7. A data packet transmission method, characterized in that: The method is applied to the field of machine vision, one of the transmitting end device and the receiving end device is an industrial camera in the field of machine vision, and the other is an acquisition card in the field of machine vision; the transmitting end device includes a first data link layer, the receiving end device includes a second data link layer, and the method is applied to the second data link layer, and the method includes: After receiving a transport layer data packet TLP data packet, parsing a second sequence number from the TLP data packet; If the second sequence number is greater than the sum of the target sequence number stored in the second sequence number register and a preset value, an RSND data packet encapsulating the target sequence number is sent to the first data link layer; if the second sequence number is equal to the sum of the target sequence number and the preset value, an ACK data packet encapsulating the second sequence number is sent to the first data link layer, and the target sequence number stored in the second sequence number register is updated to the second sequence number; if the second sequence number is less than the sum of the target sequence number and the preset value, an ACK data packet encapsulating the second sequence number is sent to the first data link layer; The receiving device maintains a second sequence number register, which is used to store the sequence number of the last successfully received TLP data packet; after receiving the ACK data packet, the first data link layer deletes the TLP data packet whose sequence number is less than or equal to the second sequence number from the retransmission buffer; The second data link layer sends the RSND data packet encapsulating the target sequence number to the first data link layer, including: if the value of the RSND flag bit is the first value, sending the RSND data packet to the first data link layer, and modifying the value of the RSND flag bit to the second value; After the second data link layer parses the second sequence number from the TLP data packet, if the second sequence number is greater than the sum of the target sequence number and the preset value, and the value of the RSND flag bit is the second value, the second data link layer is prohibited from sending the RSND data packet to the first data link layer; if the second sequence number is equal to the sum of the target sequence number and the preset value, and the value of the RSND flag bit is the second value, the second data link layer modifies the value of the RSND flag bit to the first value; After receiving the RSND data packet sent by the second data link layer, the first data link layer obtains the TLP data packet whose sequence number is greater than the target sequence number from the retransmission buffer area, and retransmits the TLP data packet; after retransmitting the TLP data packet, the first data link layer starts the watchdog timer; before the watchdog timer times out, if the ACK data packet returned by the second data link layer is received, the watchdog timer is turned off; when the watchdog timer times out, if the ACK data packet returned by the second data link layer is not received, all TLP data packets in the retransmission buffer area are retransmitted, and the watchdog timer is restarted.

Citation Information

Patent Citations

  • Data transmission method, data transmission device and related equipment

    CN114244780A