TCP mirror image data processing method and device, chip and medium

The process of TCP mirror packets through the FPGA chip solves the problem of indiscriminate reordering efficiency caused by high CPU occupancy in high-speed network environments, and realizes data transmission with low latency.

CN120186239APending Publication Date: 2025-06-20YUSUR TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510318187.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-18
Publication Date
2025-06-20

AI Technical Summary

Technical Problem

In a high-speed network environment, the CPU needs a high occupancy rate to handle out-of-order TCP network data packets, resulting in the indis-order reordering of the CPU and the inability to meet the low-latency data transmission requirements.

Method used

Through the FPGA chip, the server is connected to the server using the preset bus interface to identify and process TCP mirror packets, and the process is realized out-of-order reordering is realized, reducing the CPU usage rate and improving processing efficiency.

Benefits of technology

It reduces the occupancy rate of the central processor, improves the out-of-order reordering efficiency of TCP mirror packets, and meets the data transmission needs of low-latency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120186239A_ABST
    Figure CN120186239A_ABST
Patent Text Reader

Abstract

The invention relates to a TCP mirror image data processing method and device, a chip and a medium, and the method comprises the steps: recognizing a target ISN number of a target TCP mirror image packet sent to a preset buffer area, and enabling a TCP quintuple of the target TCP mirror image packet to be consistent with a reference TCP quintuple of current TCP connection; determining an initial ISN number corresponding to the preset buffer area, and determining whether the target TCP mirror image packet satisfies a preset sending condition according to the initial ISN number and the target ISN number; and when a preset sending condition is satisfied, sending the corresponding target TCP mirror image packet to the server. In the technical scheme, the out-of-order rearrangement processing of the TCP mirror image packet is carried out based on the heterogeneous architecture, the occupancy rate of a central processing unit is reduced, the out-of-order rearrangement efficiency of the TCP mirror image packet is improved, and the low-delay data transmission requirement is met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of communication technologies, and in particular, to a method, apparatus, chip, and medium for processing TCP mirror data. Background Art

[0002] When Transmission Control Protocol (TCP) network packets are transmitted, there may be different delays due to interference such as the transmission environment, resulting in the TCP network packets received by the Central Processing Unit (CPU) being out of order. Therefore, it is a common communication scenario to reorder the out-of-order TCP network packets and then send them to the backend.

[0003] In related technologies, the out-of-order TCP network packets received are reordered in the CPU of the server. However, in a high-speed network environment, the number of TCP network packets is large, and corresponding buffer areas need to be constructed in the CPU to store the TCP network packets and perform out-of-order reordering processing on the TCP network packets. As a result, the occupancy rate of the CPU is relatively high. When the CPU occupancy rate is high, the efficiency of out-of-order reordering by the CPU may be low, and the low-latency transmission requirement for TCP network packets in the communication scenario cannot be met. Summary of the Invention

[0004] To solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides a method, apparatus, chip, and medium for processing TCP mirror data.

[0005] An embodiment of the present disclosure provides a method for processing TCP mirror data. The method is applied to an FPGA chip, and the FPGA chip is connected to a server through a preset bus interface. The method includes the following steps: identifying a target ISN number of a target TCP mirror packet sent to a preset buffer area, where the TCP quintuple of the target TCP mirror packet is consistent with a reference TCP quintuple of a current TCP connection; determining a starting ISN number corresponding to the preset buffer area, and determining whether the target TCP mirror packet meets a preset sending condition according to the starting ISN number and the target ISN number; and when the preset sending condition is met, sending the corresponding target TCP mirror packet to the server.

[0006] An embodiment of the present disclosure provides an apparatus for processing TCP mirror data. The apparatus is applied to an FPGA chip, and the FPGA chip is connected to a server through a preset bus interface. The apparatus includes: an identification module, configured to identify a target ISN number of a target TCP mirror packet sent to a preset buffer, where a TCP quintuple of the target TCP mirror packet is consistent with a reference TCP quintuple of a current TCP connection; a determination module, configured to determine a starting ISN number corresponding to the preset buffer, and determine whether the target TCP mirror packet meets a preset sending condition according to the starting ISN number and the target ISN number; and a processing module, configured to send a corresponding target TCP mirror packet to the server when the preset sending condition is met.

[0007] An embodiment of the present disclosure further provides an FPGA chip. The FPGA chip is connected to a server through a preset bus interface, and the FPGA chip is configured to execute the above TCP mirror data processing method.

[0008] An embodiment of the present disclosure further provides a computer-readable storage medium. The storage medium stores a computer program, and the computer program is configured to execute the TCP mirror data processing method provided by the embodiment of the present disclosure.

[0009] The technical solution provided by the embodiment of the present disclosure has the following advantages compared with the prior art:

[0010] In the TCP mirror data processing method of the embodiment of the present disclosure, a target ISN number of a target TCP mirror packet sent to a preset buffer is identified, where a TCP quintuple of the target TCP mirror packet is consistent with a reference TCP quintuple of a current TCP connection. A starting ISN number corresponding to the preset buffer is determined, and it is determined whether the target TCP mirror packet meets a preset sending condition according to the starting ISN number and the target ISN number. When the preset sending condition is met, a corresponding target TCP mirror packet is sent to the server. In this technical solution, out-of-order rearrangement processing of TCP mirror packets is performed based on a heterogeneous architecture, reducing the occupancy rate of the central processing unit, improving the out-of-order rearrangement efficiency of TCP mirror packets, and meeting the low-latency data transmission requirements. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] In combination with the accompanying drawings and with reference to the following specific embodiments, the above and other features, advantages, and aspects of the various embodiments of the present disclosure will become more apparent. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic, and the original elements and elements are not necessarily drawn to scale.

[0012] Figure 1 It is a deployment architecture diagram of a TCP mirror data processing system provided by an embodiment of the present disclosure;

[0013] Figure 2 Flow diagram of a method for processing TCP mirror data provided by an embodiment of the present disclosure;

[0014] Figure 3 Schematic diagram of a processing scenario for TCP mirror data provided by an embodiment of the present disclosure;

[0015] Figure 4 Deployment architecture diagram of another processing system for TCP mirror data provided by an embodiment of the present disclosure;

[0016] Figure 5 Schematic diagram of another processing scenario for TCP mirror data provided by an embodiment of the present disclosure;

[0017] Figure 6 Flow diagram of another method for processing TCP mirror data provided by an embodiment of the present disclosure;

[0018] Figure 7 Schematic diagram of another processing scenario for TCP mirror data provided by an embodiment of the present disclosure;

[0019] Figure 8 Flow diagram of another method for processing TCP mirror data provided by an embodiment of the present disclosure;

[0020] Figure 9 Schematic diagram of another processing scenario for TCP mirror data provided by an embodiment of the present disclosure;

[0021] Figure 10 Schematic diagram of another processing scenario for TCP mirror data provided by an embodiment of the present disclosure;

[0022] Figure 11 Flow diagram of another method for processing TCP mirror data provided by an embodiment of the present disclosure;

[0023] Figure 12 Schematic diagram of another processing scenario for TCP mirror data provided by an embodiment of the present disclosure;

[0024] Figure 13 Schematic diagram of another processing scenario for TCP mirror data provided by an embodiment of the present disclosure;

[0025] Figure 14 Schematic diagram of the structure of a processing device for TCP mirror data provided by an embodiment of the present disclosure. Detailed implementation manners

[0026] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although some embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Instead, these embodiments are provided to more thoroughly and completely understand the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for illustrative purposes and are not used to limit the protection scope of the present disclosure.

[0027] It should be understood that the various steps recited in the method embodiments of the present disclosure may be executed in a different order and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this regard.

[0028] As used herein, the term "including" and its variations are open-ended, that is, "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0029] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order of the functions performed by these devices, modules or units or their interdependent relationships.

[0030] It should be noted that the modifications of "one" and "plural" mentioned in the present disclosure are illustrative rather than restrictive. Those skilled in the art should understand that unless otherwise clearly specified in the context, it should be understood as "one or more".

[0031] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only for illustrative purposes and are not used to limit the scope of these messages or information.

[0032] To solve the above problems, an embodiment of the present disclosure proposes a technical solution for processing TCP network packets based on a heterogeneous architecture relying on a Field Programmable Gate Array (FPGA) chip. In this solution, a TCP mirror packet of the TCP network packet is obtained, and a hardware-friendly out-of-order rearrangement method is implemented to replace the existing CPU-based out-of-order processing. Moreover, the obtained packet is the TCP mirror packet of the TCP network packet, that is, the corresponding TCP mirror packet is obtained by copying the TCP network packet. Without being affected by the TCP transmission protocol, data rearrangement processing of the TCP mirror packet can be achieved. On the basis of offloading the out-of-order rearrangement task of the TCP mirror packet in the CPU, the relevant protocol stack is crossed.

[0033] Among them, referring to Figure 1 , the server includes a CPU and a corresponding memory space. The processing method of the TCP mirror data can be executed by the FPGA chip. The FPGA chip can be regarded as an acceleration card for out-of-order rearrangement of TCP network packets. Specifically, executable code for executing the processing method of the TCP mirror data can be written in the FPGA chip. This executable code can exist as an acceleration core in the acceleration card. Among them, the FPGA chip is connected to the server through a bus interface, and this bus interface can be a standard PCIe interface, etc. The PCIe interface is a type of PCI computer bus. It follows the existing PCI programming concepts and communication standards, but is based on a faster serial communication system. The FPGA chip may also include a network interface. The FPGA chip can obtain the TCP mirror packet of the relevant TCP network packet in the current network environment through the network interface or the bus interface with the server.

[0034] First, the processing method of the TCP mirror data of the embodiments of the present disclosure will be described with reference to the embodiments. Figure 2 is a schematic flowchart of a processing method of TCP mirror data provided by an embodiment of the present disclosure. This method can be executed by a device for processing TCP mirror data, where the device can be implemented by software and / or hardware and is generally integrated in the FPGA chip, such as Figure 2 shown. This method includes:

[0035] Step 201, obtain the reference TCP quintuple of the current TCP connection through the server, and obtain candidate TCP mirror packets.

[0036] In an embodiment of the present disclosure, the server side can send the reference TCP quintuple of the current TCP connection through the bus interface.

[0037] In this embodiment, the candidate TCP mirror packets of the TCP packets of the TCP connection in the network environment can be directly transmitted to the acceleration card through the bus interface or through the network interface.

[0038] That is, in some possible examples, a candidate TCP mirror packet is obtained through a preset network interface. In this embodiment, the acceleration card directly reads the corresponding candidate TCP mirror packet in the network environment.

[0039] In some possible examples, the mirror data packet in the CPU can be copied to obtain a candidate TCP mirror packet. Furthermore, the copied candidate TCP mirror packet is obtained through the bus interface.

[0040] Step 202: Filter the candidate TCP mirror packets according to the reference TCP quintuple to obtain the target TCP mirror packet corresponding to the current TCP connection.

[0041] Since the obtained TCP mirror packets may come from multiple TCP connections, in an embodiment of the present disclosure, the candidate TCP mirror packets are filtered according to the reference TCP quintuple to obtain the target TCP mirror packet corresponding to the current TCP connection, where the current TCP connection can be understood as the TCP connection for which the server is currently performing out-of-order rearrangement processing, etc.

[0042] Among them, the TCP quintuple refers to five parameters used to uniquely identify a TCP connection in TCP / IP network communication. These five parameters include the source IP address, source port, destination IP address, destination port, and transport layer protocol. The following is a detailed introduction to each parameter. Among them, the data packet mentioned below can be the corresponding TCP mirror packet:

[0043] 1) Source IP Address

[0044] The source IP address refers to the IP address of the host that sends the data packet. In network communication, it is used to identify the sending end of the data packet. The source IP address is represented by a 32-bit unsigned integer (UINT32) and occupies 4 bytes in memory.

[0045] 2) Source Port

[0046] The source port is used to identify the application or service that sends the data packet. Under the same IP address, different applications use different port numbers for communication. The source port is represented by a 16-bit unsigned integer (UINT16) and occupies 2 bytes in memory.

[0047] 3) Destination IP Address

[0048] The destination IP address refers to the IP address of the host that receives the data packet. In network communication, it is used to identify the receiving end of the data packet. The destination IP address is represented by a 32-bit unsigned integer (UINT32) and occupies 4 bytes in memory.

[0049] 4) Destination Port

[0050] The destination port is used to identify the application or service that receives the data packet. Under the same IP address, different applications communicate using different port numbers. The destination port is represented by a 16-bit unsigned integer (UINT16) and occupies 2 bytes in memory.

[0051] 5) Transport Protocol

[0052] The transport protocol is used to identify the type of transport protocol used by the data packet, such as TCP (protocol number 6) or UDP (protocol number 17). In network communication, different protocols handle data packets differently. The transport protocol is represented by an 8-bit unsigned integer (UINT8) and occupies 1 byte in memory.

[0053] That is, as shown in Table 1 below, in some possible embodiments, the FPGA chip can be configured as an acceleration core to correspond to the reference TCP five-tuple. Among them, the 32-bit IP address is separated by 8 bits, and the value of the five-tuple can be 0. If it is 0, it means to ignore this condition. The acceleration core will filter the target TCP mirror packets that meet the configured reference TCP five-tuple.

[0054] As shown in the example of Table 1, only the candidate TCP mirror packets with the source IP must be 172.24.16.35, the source PORT must be 19999, and the transport layer protocol must be TCP can pass the filter. Under this condition, any destination IP and destination PORT meet the filtering conditions:

[0055] Table 1

[0056]

[0057]

[0058] Of course, in an embodiment of the present disclosure, the obtained TCP mirror packets may come from TCP packets such as handshakes and wave-offs. Therefore, in order to further ensure that the source of the candidate TCP mirror packets corresponds to the corresponding TCP connection, in this embodiment, the header of the candidate TCP mirror packet can also be read, and the PSH value of the candidate TCP mirror packet can be determined according to the header. When the PSH value is 1, the corresponding candidate TCP mirror packet is filtered, and the candidate TCP mirror packet with the PSH value of 0 is directly filtered.

[0059] It should be noted that in the specific implementation process, different methods can be adopted to filter candidate TCP mirror packets based on the reference TCP five-tuple according to different application scenarios. The examples are as follows:

[0060] In some possible examples, the reference TCP five-tuple is configured in the FPGA chip, that is, the initialization configuration work is carried out in the FPGA chip. The reference TCP five-tuple includes the source IP address, source port, destination IP address, destination port, and transport layer protocol. The candidate TCP mirror packets are filtered according to the configured reference TCP five-tuple to obtain the target TCP mirror packets corresponding to the current TCP connection after filtering.

[0061] In some possible examples, the filtering of candidate TCP mirror packets can be implemented through a state machine. In this example, a preset state machine is constructed. In this embodiment, the relevant input data can be shifted and stored in the buffer variable of the preset state machine. This buffer variable is sufficient to accommodate the five-tuple part in the TCP protocol.

[0062] In the initialization state, the acceleration core will continuously match the reference TCP five-tuple based on the buffer variable, which is a sliding matching process. If the match is successful, the body length and protocol header length of the target TCP mirror packet are recorded, and the time required to wait for the body data of the target TCP mirror packet to start output is calculated, and then enter the locked and waiting state.

[0063] When waiting for the body data of the target TCP mirror packet based on the waiting time, after the waiting is completed, the acceleration core will jump to the output state. In the output state, the acceleration core will integrate and output the target TCP mirror packet according to the pre-recorded body length of the target TCP mirror packet.

[0064] That is, in this embodiment, as Figure 3As shown, when the preset state machine corresponding to the reference TCP quintuple is in the enabled state bit (for example, taking the state bit as locked, when locked is 0, it is determined that the preset state machine is in the enabled state bit), a candidate TCP mirror packet is obtained, and the TCP quintuple of the candidate TCP mirror packet is slid and matched with the reference TCP quintuple. When the matching result of the sliding match is successful, the state bit of the preset state machine is updated to the locked state bit (for example, taking the state bit as locked, when locked is 1, it is determined that the preset state machine is in the locked state bit). The candidate TCP mirror packet is continuously read from the end position of the sliding match. For example, the body length and protocol header length of the candidate TCP mirror packet can be obtained and recorded based on the protocol header of the candidate TCP mirror packet. The remaining bytes to be read are determined based on the end position of the sliding match, and the remaining waiting time is determined based on the number of bytes to be read. The protocol header of the remaining candidate TCP mirror packets is continuously read within this waiting time. After the waiting is completed, the body data of the candidate TCP mirror packet is read, etc. Thus, the body data of the read candidate TCP mirror packets is integrated, etc., and the candidate TCP mirror packet is sent to the preset buffer for out-of-order rearrangement processing. Among them, if the length of the body data of the read candidate TCP mirror packet is consistent with the previously recorded body length of the candidate TCP mirror packet, the state bit of the preset state machine is updated to the enabled state bit.

[0065] Step 203: Perform out-of-order rearrangement processing on the target TCP mirror packet and send the out-of-order rearranged target TCP mirror packet to the server.

[0066] In an embodiment of the present disclosure, the obtained target TCP mirror packet is subjected to out-of-order rearrangement processing, and the out-of-order rearranged target TCP mirror packet is sent to the server. Since the out-of-order rearrangement occurs in the heterogeneous structure FPGA chip, the task offloading of the out-of-order rearrangement of the CPU in the server is realized, greatly reducing the occupancy rate of the CPU and improving the out-of-order rearrangement efficiency.

[0067] In this embodiment, referring to Figure 4 , the acceleration core in the FPGA chip can obtain two functional modules according to the pre-coding. Among them, one functional module is the quintuple filtering module, which is used to filter the obtained candidate TCP mirror packets according to the input reference TCP quintuple, and after filtering out the target TCP mirror packets that meet the reference TCP quintuple, enter another functional module - the out-of-order rearrangement module. The out-of-order rearrangement module performs out-of-order rearrangement on the obtained target TCP mirror packet and sends the out-of-order rearranged target TCP mirror packet to the server. Among them, the out-of-order rearrangement module can provide a read interface, and the server reads the out-of-order rearranged target TCP mirror packet based on this read interface.

[0068] In one embodiment of the present disclosure, for the convenience of data read-back of the server, the target ISN number of the target TCP mirror packet may also be determined, and the data length (payload length) of the data content of the target TCP mirror packet may be determined. A protocol header of the target TCP mirror packet is generated according to the target ISN number and the data length, and the target TCP mirror packet is updated according to the protocol header and the data content (payload). Furthermore, the updated target TCP mirror packet is sent to the server. Among them, the format of the updated target TCP mirror packet is: custom protocol header (ISN number + payload length) + payload content.

[0069] Based on the custom protocol header of the updated target TCP mirror packet, the server can quickly determine whether the target TCP mirror packet after out-of-order rearrangement by the FPGA is accurate, and quickly locate the payload content based on the payload length, improving the processing convenience of the server, simplifying the processing logic of the CPU, and further reducing the resource occupancy rate of the CPU.

[0070] In one embodiment of the present disclosure, when the server determines that the order of the ISN numbers is incorrect based on the custom protocol header of the updated target TCP mirror packet, an alarm reminder can be quickly sent to facilitate the quick discovery of the out-of-order rearrangement problem and ensure the reliability and integrity of the sent target TCP mirror packet.

[0071] For example, in this embodiment, if in the reference TCP quintuple of the currently initialized TCP connection, the source IP is 172.24.16.35, the source PORT is 19999, and the transport layer protocol is TCP, the 7 candidate TCP mirror packets obtained are as shown in Table 2 below:

[0072] Table 2

[0073]

[0074] When filtering the candidate TCP mirror packets, the candidate TCP mirror packets with transmission sequence numbers 1, 2, and 3 are filtered according to the reference TCP quintuple and the PAH value. Candidate TCP mirror packet 1 is filtered because it does not match the protocol type of the reference TCP quintuple, candidate TCP mirror packet 2 is filtered because the PSH bit is not 1, and candidate TCP mirror packet 3 is filtered because it does not match the source IP of the reference TCP quintuple. The out-of-order rearrangement results of the candidate TCP mirror packets with sequence numbers 4, 7, 6, and 5 after filtering are as shown in Table 3 below:

[0075] Table 3

[0076]

[0077]

[0078] In this embodiment, the target TCP mirror packet in Table 3 can be sent to the server in the format of a custom protocol header (ISN number + payload length) + payload content. That is, the necessary metadata in the target TCP mirror packet is retained to ensure that the target TCP mirror packet after out-of-order rearrangement can be accurately transmitted to the backend system.

[0079] In summary, for the method for processing TCP mirror data according to the embodiments of the present disclosure, the FPGA chip obtains the reference TCP quintuple of the current TCP connection through the server, and obtains candidate TCP mirror packets. The candidate TCP mirror packets are filtered according to the reference TCP quintuple to obtain the target TCP mirror packet corresponding to the current TCP connection. Furthermore, the target TCP mirror packet is processed for out-of-order rearrangement, and the target TCP mirror packet after out-of-order rearrangement is sent to the server. In this technical solution, the processing of TCP mirror packets is based on a heterogeneous architecture, which reduces the occupancy rate of the central processing unit, improves the data processing efficiency of TCP mirror packets, and meets the low-latency data transmission requirements.

[0080] During the actual execution process, the out-of-order rearrangement module in the acceleration core is used to process the out-of-order problem of the target TCP mirror packet. It receives the out-of-order target TCP mirror packet and reorders it according to the sequence number ISN to ensure that the output target TCP mirror packet is in order.

[0081] A preset buffer for the current TCP connection is pre-constructed in the FPGA chip, and the filtered target TCP mirror packet is stored in the preset buffer. Among them, the preset buffer calibrates the starting ISN number corresponding to the starting pointer of the preset buffer according to the target ISN number of the first received target TCP mirror packet. Furthermore, the tail ISN number is determined according to the storage space of the preset buffer set in the FPGA. The preset buffer is used to store TCP mirror packets within the corresponding ISN number range.

[0082] For example, if the target ISN number of the target TCP mirror packet obtained is 500, and the preset buffer currently supports storing TCP mirror packets in the ISN number range of 500 - 1500, then the target TCP mirror packet is written to the head of the preset buffer. Furthermore, the corresponding target TCP mirror packet is sent to the server. If the SEQ range corresponding to the TCP mirror packet is 500 - 600, after sending the target TCP mirror packet, the currently supported ISN number range of the preset buffer is updated to 600 - 1600. That is, the supported ISN number range of the preset buffer is continuously updated until there is no written data in the head buffer, and the output stops.

[0083] Refer to Figure 5, if the ISN number corresponding to the current header buffer is 500 and the storage space of the preset buffer is 1001 bytes, then the buffer window size corresponding to the preset buffer is the window with the ISN number range: 500 - 1500. In this embodiment, when a target TCP mirror packet with an ISN number of 600 and a length of 100 bytes is obtained, the target TCP mirror packet is written at the corresponding position in the buffer (the black dots in the figure represent writing the target TCP mirror packet to the corresponding buffer). If a target TCP mirror packet with an ISN number of 900 and a length of 100 bytes is obtained, the target TCP mirror packet is written at the corresponding position in the buffer. If a target TCP mirror packet with an ISN number of 500 and a length of 100 bytes is further obtained, since the starting ISN number of the header buffer in the current buffer is 500, therefore, the target TCP mirror packets with ISN numbers from 500 to 700 are output, and the starting ISN number of the header buffer is updated to 700. At this time, the updated ISN number range is 700 - 1700.

[0084] The following refers to specific embodiments to illustrate the out-of-order rearrangement processing method for TCP mirror data in the embodiments of the present disclosure.

[0085] Figure 6 Another processing method for TCP mirror data provided according to the embodiments of the present disclosure. In this method, an out-of-order rearrangement method for TCP mirror data is proposed, as Figure 6 shown, this method includes:

[0086] Step 601, identify the target ISN number of the target TCP mirror packet sent to the preset buffer, where the TCP quintuple of the target TCP mirror packet is consistent with the reference TCP quintuple of the current TCP connection.

[0087] It can be understood that the target TCP mirror packet in this embodiment is filtered based on the filtering method in the above embodiment. In this embodiment, the target ISN number of the target TCP mirror packet is extracted.

[0088] Step 602, determine the starting ISN number corresponding to the preset buffer, and determine whether the target TCP mirror packet meets the preset sending condition according to the starting ISN number and the target ISN number.

[0089] In this embodiment, determine the starting ISN number corresponding to the preset buffer. As mentioned in the above embodiment, the starting ISN number is the ISN number corresponding to the next target TCP mirror packet to be sent. Among them, referring to Figure 5 , the corresponding starting ISN number is 500, etc.

[0090] In this embodiment, it is possible to determine whether the starting ISN number is the same as the target ISN number. When they are the same, it is determined that the target TCP mirror packet meets the preset sending condition, and thus, the target TCP mirror packet can be directly sent.

[0091] If the starting ISN number and the target ISN number are different, the target TCP mirror packet is written into the preset buffer according to the target ISN number, that is, the starting write position is determined in the preset buffer according to the target ISN number, and the corresponding target TCP mirror packet is written starting from the starting write position. Continuing to refer to Figure 5 , after obtaining a target TCP mirror packet with a target ISN number of 600 and a length of 100 bytes, the target TCP mirror packet is written at the corresponding position in the buffer with an ISN number of 600.

[0092] Step 603, when the preset sending condition is met, send the corresponding target TCP mirror packet to the server.

[0093] In an embodiment of the present disclosure, after the preset sending condition is met, the corresponding target TCP mirror packet is sent to the server. The target mirror packet is the re-ordered and in-sequence target TCP mirror packet. In this embodiment, it is also determined whether there are other TCP mirror packets arranged continuously with the target TCP mirror packet in the preset buffer. For example, continuing to refer to Figure 5 , after obtaining a target TCP mirror packet with a target ISN number of 500, since the target TCP mirror packet is also written in the corresponding buffer with an ISN number range of 600 - 700 in the preset buffer, other TCP mirror packets include the target TCP mirror packets with an ISN number range of 600 - 700. When there are other TCP mirror packets, the target TCP mirror packet and other TCP mirror packets are sent to the server, that is, the continuous TCP mirror packets are sent, ensuring in-sequence sending. When there are no other TCP mirror packets, that is, the corresponding TCP mirror packets are not written in the corresponding buffer of 600 - 700, the target TCP mirror packet is directly sent to the server.

[0094] Among them, after sending the target TCP mirror packet, the ISN number of the preset buffer needs to be updated. Among them, in some possible embodiments, the ISN number of the preset buffer can be updated as a whole. Determine the starting ISN number of the next target TCP mirror packet to be written in the preset buffer, and update the starting ISN number of the next target TCP mirror packet to the starting ISN number of the preset buffer. That is, after updating the starting ISN number of the preset buffer, each other ISN number is updated in sequence. Continuing to refer to Figure 5 , after updating the starting ISN number of the preset buffer to 700, the subsequent ISN numbers are updated one by one, and the updated ISN number range is 700 - 1700.

[0095] In one embodiment of the present disclosure, the preset buffer is a circular buffer. In the circular buffer, the pointer position of the preset pointer points to the corresponding starting ISN number, and there is no need to update the subsequent ISN numbers one by one. In this embodiment, read the pointer position of the preset pointer, determine the starting ISN number corresponding to the preset buffer according to the pointer position. When updating the preset buffer according to the updated starting ISN number and the tail ISN number, directly update the pointer position of the preset pointer to the buffer position corresponding to the updated starting ISN number, and update the pointer position of the preset pointer to the position where the starting ISN number of the next target TCP mirror packet to be written is located, and use the next ISN number after the original tail ISN number of the preset buffer as the starting ISN number to update the ISN number of the buffer corresponding to the sent target TCP mirror packet.

[0096] For example, referring to Figure 5 , as shown, set a preset pointer "pointer" to identify the head of the preset buffer. After updating from ① to ② in Figure 5 , the starting ISN number corresponding to the head of the buffer should change from 500 to 700. If the preset buffer is a circular buffer, directly point the "pointer" to the position of 700 in ① as the head of the preset buffer. At this time, the ISN number corresponding to the end of the physical address of the preset buffer is still the original 1500, and the ISN end of the preset buffer corresponding to the target TCP mirror packet sent before the "pointer" is 1700. In this way, the circular buffer can flexibly adjust the storage range and efficiently manage the reception and processing of out-of-order packets.

[0097] In some possible embodiments, due to the limited cache space size of the preset buffer, it is possible to have an out-of-window situation. An out-of-window situation refers to an out-of-order TCP packet whose ISN exceeds the buffer range, and the out-of-window situation is judged based on the ISN number of the incoming relevant TCP mirror packet and the current buffer window range. That is, referring to Figure 7 , assume that the current starting ISN number is 500 and the ISN number range is 500 - 1500. If the target ISN number of the obtained target TCP mirror packet + data_len (i.e., the byte length of the obtained target TCP mirror packet) > 1500 (out-of-window at the back) or ISN < 500 (out-of-window at the front), it is determined as an out-of-window situation. In this embodiment, the out-of-window target TCP mirror packet can be directly output, but at this time, there may be out-of-order rearranged target TCP mirror packets sent from the preset buffer.

[0098] In order to distinguish the target TCP mirror packet of the out-of-window and the target TCP mirror packet after out-of-order rearrangement, before the target TCP mirror packet is sent to the central processing unit, arbitration processing needs to be performed on the target TCP mirror packet, that is, to determine whether the target TCP mirror packet to be sent is the out-of-window target TCP mirror packet. If it is the out-of-window target TCP mirror packet, the out-of-window target TCP mirror packet is input into the arbitration module preset in the FPGA chip, and the out-of-window target TCP mirror packet and the out-of-window rearranged target TCP mirror packet are output to the corresponding output channels through the arbitration module. In some possible examples, the first preset priority of the out-of-window target TCP mirror packet can be determined, the second preset priority of the out-of-window rearranged target TCP mirror packet can be determined, and the corresponding out-of-window target TCP mirror packet and the out-of-window rearranged target TCP mirror packet are output in turn by the arbitration module in the order of decreasing priority.

[0099] In summary, for the method for processing TCP mirror data in the embodiments of the present disclosure, the target ISN number of the target TCP mirror packet sent to the preset buffer is identified, where the TCP quintuple of the target TCP mirror packet is consistent with the reference TCP quintuple of the current TCP connection, the starting ISN number corresponding to the preset buffer is determined, and it is determined whether the target TCP mirror packet meets the preset sending condition according to the starting ISN number and the target ISN number. When the preset sending condition is met, the corresponding target TCP mirror packet is sent to the server. In this technical solution, out-of-order rearrangement processing of TCP mirror packets is performed based on a heterogeneous architecture, reducing the occupancy rate of the central processing unit, improving the out-of-order rearrangement efficiency of TCP mirror packets, and meeting the low-latency data transmission requirements.

[0100] When performing out-of-order rearrangement on the target TCP mirror packet, there may be a problem of timeout without sending. For example, in the case of the above-mentioned post-out-of-window situation, the post-out-of-window target TCP mirror packet will be directly output. As the out-of-order rearrangement progresses, the ISN number of the preset buffer is continuously updated, and an exception will occur when the post-out-of-window target TCP mirror packet is required as the in-order target TCP mirror packet. At this time, since the target TCP mirror packet has been directly output, the in-order target TCP mirror packet will be lost, and the preset buffer will always cache other target TCP mirror packets, causing the out-of-order rearrangement module to break down.

[0101] Another example is that the in-order target TCP mirror packet arrives after a long delay, and other already written target TCP mirror packets in the preset buffer will not be read out for a long time, resulting in data accumulation. Target TCP mirror packets that have not been processed for a long time will accumulate delays, affecting the overall performance of the system and the real-time nature of data transmission.

[0102] To solve the above timeout problem, the present disclosure also proposes a method for processing TCP mirror data to solve the timeout problem. This method is also applied to an FPGA chip, and the FPGA chip is connected to a server through a preset bus interface. The FPGA chip is used to receive the target TCP mirror packet of the current TCP connection processed by the server, where the TCP five-tuple of the target TCP mirror packet is consistent with the reference TCP five-tuple of the current TCP connection.

[0103] As Figure 8 shown, the method includes:

[0104] Step 801, count the write waiting duration of the current starting ISN number waiting to write a TCP mirror packet in a preset buffer in the FPGA chip.

[0105] In an embodiment of the present disclosure, a preset timer can be set in advance to start timing from 0 every time the starting ISN number in the preset buffer is updated. In this embodiment, according to the preset timer, count the write waiting duration of the current starting ISN number waiting to write a TCP mirror packet in the preset buffer in the FPGA chip.

[0106] Step 802, determine whether the write waiting duration is greater than a preset duration threshold.

[0107] Among them, the preset duration threshold can be set according to the size of the buffer space of the preset buffer, etc. Among them, the larger the preset buffer space, the longer the corresponding preset duration threshold can be set, etc.

[0108] Step 803, when it is greater than the preset duration threshold, determine the smallest ISN number among all the ISN numbers for writing the target TCP mirror packet in the preset buffer.

[0109] In this embodiment, when the write waiting duration is greater than the preset duration threshold, it indicates that the above timeout phenomenon occurs. Therefore, in order to ensure the order of out-of-order rearrangement, determine the smallest ISN number among all the ISN numbers for writing the target TCP mirror packet in the preset buffer.

[0110] In some possible embodiments, the first ISN numbers of all target TCP mirror packets written into the preset buffer can be identified, and the smallest ISN number is determined among the first ISN numbers. This smallest ISN number corresponds to the nearest buffer position for writing the target TCP mirror packet.

[0111] In this embodiment, refer to Figure 9, a pre-designed timer counter can be maintained in the FPGA chip. The counter continuously counts down until the target TCP mirror packet corresponding to the starting ISN number arrives. When the counted value of the counter exceeds the preset duration threshold, the minimum value among all the first ISN numbers written into the target TCP mirror packet is determined to be 600.

[0112] In some possible embodiments, the second ISN number of the next target TCP mirror packet to be written after the current starting ISN number in the preset buffer is identified, and the second ISN number is determined as the minimum ISN number. For example, referring to the above Figure 9 , it is determined that the second ISN number of the next target TCP mirror packet to be written after the ISN number of 500 is 600.

[0113] Step 804: Update the current starting ISN number of the preset buffer to the minimum ISN number, perform out-of-order rearrangement processing on the target TCP mirror packet according to the updated preset buffer, and send the out-of-order rearranged target TCP mirror packet to the server.

[0114] In the embodiments of the present disclosure, after determining the minimum ISN number, the current starting ISN number of the preset buffer is updated to the minimum ISN number, that is, the ISN numbers that have waited for the target TCP mirror packet for a long time are skipped. In this embodiment, all the ISN numbers of the preset buffer can be updated with the minimum ISN number as the starting ISN number. Furthermore, out-of-order rearrangement processing is performed on the target TCP mirror packet according to the updated preset buffer, and the out-of-order rearranged target TCP mirror packet is sent to the server.

[0115] In this embodiment, if the pointer position of the preset pointer is used to point to the current starting ISN number, the pointer position of the preset pointer can be controlled to be located at the corresponding position of the current starting ISN number in the preset buffer. After updating the current starting ISN number of the preset buffer to the minimum ISN number, the pointer position of the preset pointer is updated to the corresponding position of the minimum ISN number in the preset buffer.

[0116] In the actual execution process, in order to ensure that the current starting ISN number is updated only in the case of timeout, in an embodiment of the present disclosure, before updating the current starting ISN number of the preset buffer to the minimum ISN number, the number of data packets of the target TCP mirror packet already written in the preset buffer can be further determined, and it is determined whether the number of data packets is greater than the preset data packet number threshold. Among them, the preset data packet number threshold can be calibrated according to the scenario. Among them, when the number of data packets is greater than the preset data packet number threshold, the current starting ISN number of the preset buffer is further updated to the minimum ISN number.

[0117] In one embodiment of the present disclosure, the number of bytes written in the preset buffer can also be determined. When it is determined that the number of bytes is greater than the preset byte number threshold, the current starting ISN number of the preset buffer is further updated to the minimum ISN number when it is greater than the preset byte number threshold. The preset byte number threshold can be set according to the scenario requirements. For example, the preset byte number can be 200, etc.

[0118] That is, in this embodiment, referring to Figure 10 , a pre-designed counter sum_byte is maintained inside the FPGA chip to record the number of bytes written in the preset buffer. The preset byte number threshold is MAX_BYTE. When sum_byte > MAX_BYTE, the current starting ISN number of the preset buffer is further updated to the minimum ISN number. In this embodiment, it is pre-marked in the bitmap whether the corresponding TCP mirror packet has been written in the corresponding address in the preset buffer. At this time, the target TCP mirror packet that has been stored in the buffer recently is searched through the bitmap, and the pointer position of the preset pointer pointer is updated to here, and the target TCP mirror packet that has been stored in the buffer recently is output, so as to maintain the stable operation of the preset buffer.

[0119] In some possible embodiments, when the above-mentioned write waiting duration is greater than the preset duration threshold, if it is determined that the number of data packets of the written target TCP mirror packet is greater than the preset data packet number threshold, and / or the number of bytes written is greater than the preset byte number threshold, then the current starting ISN number of the preset buffer is updated to the minimum ISN number; that is, multiple judgment conditions are combined to jointly process and maintain the normal operation of the buffer.

[0120] In some possible embodiments, even if the write waiting duration is not greater than the preset duration threshold, but the number of bytes written is greater than the preset byte number threshold, and / or the number of data packets of the written target TCP mirror packet is greater than the preset data packet number threshold, then the current starting ISN number of the preset buffer can also be updated to the minimum ISN number. Thus, even in some scenarios where the preset duration threshold is set relatively large, the memory overflow problem of the preset buffer can be detected in time, the problem that the target TCP mirror packet has no output in the preset buffer for a long time can be avoided, and the output delay of the target TCP mirror packet is reduced.

[0121] In some possible embodiments, even if the number of bytes written is not greater than the preset byte number threshold, and / or the number of data packets of the written target TCP mirror packet is not greater than the preset data packet number threshold, but the write waiting duration is greater than the preset duration threshold, then the current starting ISN number of the preset buffer can also be updated to the minimum ISN number. Thus, the timeout problem is solved in advance, and the problem of no data output for a long time is avoided.

[0122] Thus, in this technical solution, by combining two protection mechanisms of timeout and memory overflow, various abnormal scenarios of the preset buffer can be flexibly handled to ensure the stable and efficient operation of the preset buffer. The proposed protection mechanism can effectively manage the preset buffer, ensure the stable operation of the out-of-order rearrangement function, and prevent it from being interfered by small-probability abnormal scenarios, thereby optimizing the TCP out-of-order processing function under the heterogeneous architecture.

[0123] In summary, for the method for processing TCP mirror data according to the embodiments of the present disclosure, the write waiting duration of the current starting ISN number waiting to write the TCP mirror packet in the preset buffer in the FPGA chip is counted, and it is determined whether the write waiting duration is greater than the preset duration threshold. When it is greater than the preset duration threshold, the minimum ISN number among all the ISN numbers for writing the target TCP mirror packet is determined in the preset buffer. Furthermore, the current starting ISN number of the preset buffer is updated to the minimum ISN number, and the out-of-order rearrangement processing of the target TCP mirror packet is performed according to the updated preset buffer, and the out-of-order rearranged target TCP mirror packet is sent to the server. In this technical solution, the timeout problem of the preset buffer is timely detected, and the current starting ISN number that has not been received after timeout is updated to ensure the stable operation of the out-of-order rearrangement function based on the heterogeneous structure.

[0124] Based on the above embodiments, the TCP processed by the server may change. Therefore, the reference TCP quintuple constructed according to the original TCP connection can obviously no longer be used to receive the TCP mirror packets of the new TCP connection. In this case, TCP reconnection processing is required.

[0125] The following describes the method for processing TCP mirror data for TCP reconnection processing according to the embodiments of the present disclosure with reference to the embodiments. In this method, for the convenience of description, the current TCP connection is represented as the original TCP connection, and the preset buffer of the original TCP connection is represented as the first buffer.

[0126] Figure 11 As shown in Figure 11 is a flowchart of the method for processing TCP mirror data according to another embodiment of the present disclosure. The method includes:

[0127] Step 1110, in response to obtaining the first current TCP mirror packet, determine whether the preset TCP reconnection condition is satisfied according to the first current TCP mirror packet.

[0128] In the technical solution of the present disclosure, the first current TCP mirror packet is obtained. The first current TCP mirror packet can be the current TCP mirror packet obtained through the network interface or the bus interface, and it is determined whether the preset TCP reconnection condition is satisfied according to the first current TCP mirror packet.

[0129] It should be noted that in different application scenarios, the method for determining whether the preset TCP reconnection condition is satisfied based on the first current TCP mirror packet is different. The examples are as follows:

[0130] In an embodiment of the present disclosure, the first TCP five-tuple corresponding to the original TCP connection is determined, the second TCP five-tuple of the first current TCP mirror packet is extracted, and it is determined whether the first TCP five-tuple is consistent with the second TCP five-tuple. Among them, when it is inconsistent with the second TCP five-tuple, it is determined that the preset TCP reconnection condition is satisfied.

[0131] In this embodiment, in order to improve the comparison efficiency, any five-tuple parameter of the first TCP five-tuple and the second TCP five-tuple can be directly compared. For example, it can only be identified whether the destination ports in the first TCP five-tuple and the second TCP five-tuple are consistent. If they are inconsistent, it is directly determined that the first TCP five-tuple and the second TCP five-tuple are inconsistent.

[0132] That is, in this embodiment, referring to Figure 12 , it is directly determined in the five-tuple filtering module of the FPGA chip whether the destination port in the second TCP five-tuple has changed relative to the first TCP five-tuple.

[0133] In an embodiment of the present disclosure, the current ISN number of the first current TCP mirror packet is obtained, and it is determined whether the current ISN number belongs to all the ISN numbers corresponding in the first buffer. When it does not belong to all the ISN numbers corresponding in the first buffer, it is determined that the preset TCP reconnection condition is satisfied.

[0134] That is, in this embodiment, continuing to refer to Figure 12 , it is determined in the out-of-order rearrangement module whether the current ISN number of the first current TCP mirror packet has changed significantly.

[0135] In this embodiment, the minimum ISN number difference between the current ISN number and all ISN numbers can also be calculated, and it is determined whether the minimum ISN number difference is greater than the preset ISN number difference threshold. That is, when the current ISN number has changed significantly, if the small ISN number difference is greater than the preset ISN number difference threshold, it is determined that the current ISN number has changed significantly, and thus, it is determined that the preset TCP reconnection condition is satisfied.

[0136] Of course, in an embodiment of the present disclosure, in order to improve the sensitivity of reconnection recognition, when the current ISN number does not belong to all the ISN numbers corresponding in the first buffer, the maximum ISN number difference between the current ISN number and all ISN numbers can also be calculated, and it is determined whether the maximum ISN number difference is greater than the preset ISN number difference threshold. When it is greater than the preset ISN number difference threshold, it is determined that the preset TCP reconnection condition is satisfied.

[0137] Among them, the method for determining whether the preset reconnection condition is satisfied based on the five-tuple and the ISN number can be executed singly, that is, if any of the above conditions is satisfied, it is considered that the preset reconnection condition is satisfied, or it can be executed jointly, that is, only when both of the above conditions are satisfied is it considered that the preset reconnection condition is satisfied.

[0138] Step 1120, when the preset TCP reconnection condition is satisfied, construct a second buffer in the FPGA chip, and identify whether the first buffer contains the target TCP mirror packet to be output.

[0139] In an embodiment of the present disclosure, when the preset TCP reconnection condition is satisfied, a second buffer is constructed in the FPGA chip, and it is identified whether the first buffer contains the target TCP mirror packet to be output. Among them, the second buffer can be the RAM area in the FPGA.

[0140] Step 1130, when the first buffer contains the target TCP mirror packet to be output, open the read interface of the first buffer and the write interface of the second buffer, and close the read interface of the second buffer and the write interface of the first buffer. Among them, the corresponding TCP mirror packet is sent to the server through the read interface, and the corresponding TCP mirror packet is written into the corresponding buffer through the write interface.

[0141] Step 1140, in response to the first buffer not containing the target TCP mirror packet to be output, close the read interface of the first buffer, and open the read interface of the second buffer to send the corresponding TCP mirror packet to the server through the read interface of the second buffer.

[0142] In this embodiment, when the first buffer contains the target TCP mirror packet to be output, open the read interface of the first buffer and the write interface of the second buffer, and close the read interface of the second buffer and the write interface of the first buffer. Among them, the corresponding TCP mirror packet is sent to the server through the read interface, and the corresponding TCP mirror packet is written into the corresponding buffer through the write interface. In response to the first buffer not containing the target TCP mirror packet to be output, close the read interface of the first buffer, and open the read interface of the second buffer to send the corresponding TCP mirror packet to the server through the read interface of the second buffer.

[0143] That is, in this embodiment, in response to obtaining the second current TCP mirror packet, identify the third TCP five-tuple of the second current TCP mirror packet, and determine whether the third TCP five-tuple is consistent with the second TCP five-tuple. When it is consistent with the second TCP five-tuple, write the second TCP five-tuple into the second buffer through the write interface of the second buffer. Among them, after reconnection, the first TCP five-tuple is also updated, that is, the first TCP five-tuple corresponding to the original TCP connection pre-configured in the FPGA chip is deleted, and the second TCP five-tuple is configured in the FPGA chip.

[0144] That is, in this embodiment, referring to Figure 13 , if the first buffer is RAM1 and the second buffer is RAM2, when the preset TCP reconnection condition is satisfied, the relevant reconnection control module will newly establish a reconnection buffer RAM2, and store the TCP mirror packets (including the first current TCP mirror packet) obtained after reconnection into RAM2. Through the control of the read-write interface, only write operations are performed without read operations. At the same time, through the control of the read-write interface, control RAM1 to stop writing operations and only perform read operations to quickly read out all the target TCP mirror packets in the first buffer. When the target TCP mirror packets in RAM1 are emptied, open the read interface of RAM2, and the central processing unit obtains the corresponding target TCP mirror packets from the read interface. The whole process is managed based on the ping-pong control channel. After reconnection, RAM2 will be used as the new preset buffer.

[0145] In an embodiment of the present disclosure, if reconnection occurs again, restore the use of RAM1 as the preset buffer and repeat the above reconnection processing logic. That is, in this embodiment, after opening the read interface of the second buffer, in response to obtaining the third current TCP mirror packet, determine whether the preset TCP reconnection condition is satisfied. When the preset TCP reconnection condition is satisfied and the second buffer contains the TCP mirror packets to be output, open the read interface of the second buffer and the write interface of the first buffer, and close the read interface of the first buffer and the write interface of the second buffer. In response to the second buffer not containing the TCP mirror packets to be output, close the read interface of the second buffer and open the read interface of the first buffer to send the corresponding TCP mirror packets to the server through the read interface of the first buffer.

[0146] In this technical solution, the out-of-order processing under the heterogeneous architecture is for mirror data and does not pass through the protocol stack. Therefore, when TCP reconnection occurs, it must be able to identify the reconnection and track the out-of-order rearrangement to ensure that the new connection after TCP reconnection can perform out-of-order processing normally. Thus, in this embodiment, it is realized that the normal out-of-order rearrangement operation (whether before or after reconnection) is not affected during the process of handling reconnection, ensuring a smooth transition during reconnection, avoiding packet loss and packet leakage phenomena, and thus greatly improving the reliability and stability of the heterogeneous structure.

[0147] In summary, for the method for processing TCP mirror data according to the embodiments of the present disclosure, in response to obtaining a first current TCP mirror packet, it is determined whether a preset TCP reconnection condition is satisfied according to the first current TCP mirror packet. When the preset TCP reconnection condition is satisfied, a second buffer is constructed in the FPGA chip, and it is identified whether the first buffer contains a target TCP mirror packet to be output. When the first buffer contains a target TCP mirror packet to be output, the read interface of the first buffer and the write interface of the second buffer are opened, and the read interface of the second buffer and the write interface of the first buffer are closed. Among them, the corresponding TCP mirror packet is sent to the server through the read interface, and the corresponding TCP mirror packet is written into the corresponding buffer through the write interface. Furthermore, in response to the first buffer not containing the target TCP mirror packet to be output, the read interface of the first buffer is closed, and the read interface of the second buffer is opened to send the corresponding TCP mirror packet to the server through the read interface of the second buffer. In this technical solution, out-of-order rearrangement processing based on a heterogeneous structure is implemented, and it is ensured that normal out-of-order rearrangement operations are not affected during reconnection, achieving a smooth transition, ensuring the continuity and integrity of out-of-order rearrangement processing, thereby improving the reliability and stability of the heterogeneous structure.

[0148] To implement the above embodiments, the present disclosure also proposes a device for processing TCP mirror data.

[0149] Figure 14 FIG. is a schematic structural diagram of a device for processing TCP mirror data provided by an embodiment of the present disclosure. The device can be implemented by software and / or hardware and is generally integrated in an FPGA chip. The FPGA chip is connected to the server through a preset bus interface. Among them, as Figure 14 shown, the device includes: an identification module 1410, a determination module 1420, and a processing module 1430. Among them,

[0150] The identification module 1410 is configured to identify the target ISN number of the target TCP mirror packet sent to the preset buffer, where the TCP quintuple of the target TCP mirror packet is consistent with the reference TCP quintuple of the current TCP connection;

[0151] The determination module 1420 is configured to determine the starting ISN number corresponding to the preset buffer, and determine whether the target TCP mirror packet satisfies the preset sending condition according to the starting ISN number and the target ISN number;

[0152] The processing module 1430 is configured to send the corresponding target TCP mirror packet to the server when the preset sending condition is satisfied.

[0153] The device for processing TCP mirror data provided by the embodiments of the present disclosure can execute the method for processing TCP mirror data provided by any embodiment of the present disclosure, and has corresponding functional modules and beneficial effects for executing the method.

[0154] To implement the above embodiments, the present disclosure also provides a computer program product, including a computer program / instructions, which, when executed by a processor, implement the method for processing TCP mirror data in the above embodiments.

[0155] To implement the above embodiments, the present disclosure also provides an FPGA chip. The FPGA chip is connected to a server through a preset bus interface, and the FPGA chip is configured to execute any of the above methods for processing TCP mirror data.

[0156] Specifically, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments of the present disclosure include a computer program product that includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes program codes for executing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a memory, or installed from a ROM. When the computer program is executed by a processor, it executes the above functions defined in the method for processing TCP mirror data in the embodiments of the present disclosure.

[0157] It should be noted that the above-mentioned computer-readable medium in the present disclosure may be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present disclosure, the computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium may also be any computer-readable medium other than the computer-readable storage medium, and the computer-readable signal medium may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0158] The above-mentioned computer-readable medium may be included in the above FPGA chip; or it may exist independently and not be assembled into the electronic device.

[0159] The above-mentioned computer-readable medium carries one or more programs, and when the one or more programs are executed by the electronic device, the electronic device is caused to execute the above-mentioned method for processing centralized TCP mirror data.

[0160] The FPGA chip can write computer program code for performing the operations of the present disclosure in one or more programming languages or combinations thereof. The above-mentioned programming languages include, but are not limited to, Verilog, VHDL, etc. The program code can be executed entirely on the user's computer, partially on the user's computer, executed as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network - including a local area network (LAN) or a wide area network (WAN) - or, alternatively, can be connected to an external computer (e.g., by connecting through the Internet using an Internet service provider).

[0161] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code that contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than that marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and the combination of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.

[0162] The units involved in the embodiments described in the present disclosure can be implemented in software or in hardware. Among them, the name of the unit does not constitute a limitation to the unit itself in some cases.

[0163] The functions described above herein can be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that can be used include: field programmable gate arrays (FPGA), application specific integrated circuits (ASIC), application specific standard products (ASSP), system on a chip (SOC), complex programmable logic devices (CPLD), and so on.

[0164] In the context of the present disclosure, a machine-readable medium may be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of the machine-readable storage medium would include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0165] The above description is only a preferred embodiment of the present disclosure and an explanation of the applied technical principles. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above technical features, and should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosure concept. For example, the technical solutions formed by mutually replacing the above features with the technical features (but not limited to) having similar functions disclosed in the present disclosure.

[0166] In addition, although the operations are depicted in a particular order, this should not be construed as requiring that the operations be performed in the particular order shown or in sequential order. In certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although a number of specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features described in the context of separate embodiments may also be implemented in combination in a single embodiment. Conversely, the various features described in the context of a single embodiment may also be implemented separately or in any suitable sub-combination in multiple embodiments.

[0167] Although the subject matter has been described in language specific to structural features and / or methodological acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms for implementing the claims.

Claims

1. A method for processing TCP mirror data, characterized in that: The method is applied to an FPGA chip, the FPGA chip is connected to a server via a preset bus interface, and the method comprises the following steps: Identify a target ISN number of a target TCP mirrored packet sent to a preset buffer, wherein a TCP quintuple of the target TCP mirrored packet is consistent with a reference TCP quintuple of the current TCP connection; Determine the starting ISN number corresponding to the preset buffer, and determine whether the target TCP mirror packet meets the preset sending condition according to the starting ISN number and the target ISN number; When the preset sending condition is met, the corresponding target TCP mirror packet is sent to the server.

2. The method according to claim 1, characterized in that The determining whether the target TCP mirrored packet meets a preset sending condition according to the starting ISN number and the target ISN number includes: Determine whether the starting ISN number and the target ISN number are consistent, wherein: When the target ISN number is consistent with the target ISN number, it is determined that the target TCP mirrored packet meets the preset sending condition.

3. The method according to claim 2, characterized in that Also includes: When the starting ISN number and the target ISN number are inconsistent, the target TCP mirror packet is written into the preset buffer according to the target ISN number.

4. The method according to claim 2, characterized in that The sending of the corresponding target TCP mirror packet to the server includes: Determining whether the preset buffer contains other TCP mirror packets that are arranged continuously with the target TCP mirror packet; When the other TCP mirrored packets are included, sending the target TCP mirrored packet and the other TCP mirrored packets to the server; When the other TCP mirror packets are not included, the target TCP mirror packet is sent to the server.

5. The method according to claim 1, characterized in that After sending the corresponding target TCP mirror packet to the server, the method further includes: Determine the starting ISN number of the next target TCP mirror packet to be written corresponding to the preset buffer; The starting ISN number of the next target TCP mirror packet to be written is updated to the starting ISN number of the preset buffer.

6. The method according to claim 5, characterized in that Also includes: Update the original tail ISN number of the preset buffer according to the updated start ISN number; The other ISN numbers in the preset buffer are updated according to the updated starting ISN number and the updated tail ISN number.

7. The method according to claim 5, characterized in that The preset buffer is a ring buffer, The determining the starting ISN number corresponding to the preset buffer zone includes: Reading a pointer position of a preset pointer, and determining a starting ISN number corresponding to the preset buffer according to the pointer position; After the updating of other ISN numbers in the preset buffer according to the updated start ISN number and the updated tail ISN number, the method further includes: Determine the starting ISN number of the next target TCP mirror packet to be written corresponding to the preset buffer; update the pointer position of the preset pointer to the position of the starting ISN number of the next target TCP mirror packet to be written; The ISN number of the buffer corresponding to the sent target TCP mirror packet is updated by taking the next ISN number of the original tail ISN number of the preset buffer as the starting ISN number.

8. A device for processing TCP mirror data, characterized in that: The device is applied to an FPGA chip, and the FPGA chip is connected to a server via a preset bus interface. The device includes: An identification module, used to identify a target ISN number of a target TCP mirror packet sent to a preset buffer, wherein a TCP quintuple of the target TCP mirror packet is consistent with a reference TCP quintuple of a current TCP connection; A determination module, used to determine a starting ISN number corresponding to the preset buffer, and determine whether the target TCP mirror packet meets a preset sending condition according to the starting ISN number and the target ISN number; The processing module is used to send the corresponding target TCP mirror packet to the server when the preset sending condition is met.

9. An FPGA chip, characterized in that: The FPGA chip is connected to the server via a preset bus interface, and the FPGA chip is used to execute the TCP mirror data processing method described in any one of claims 1-7 above.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is used to execute the TCP mirror data processing method described in any one of claims 1 to 7.