Data processing method and device, equipment and medium

By compressing and searching session attribute information, object identification information and instance identification information of data packets in the cloud computing network, the problem of large memory overhead caused by server processing duplicate packets and low packet forwarding efficiency is solved, and more efficient packet forwarding is achieved.

CN119676289APending Publication Date: 2025-03-21TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202311221361.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-19
Publication Date
2025-03-21

AI Technical Summary

Technical Problem

In cloud computing networks, servers need to process a large number of duplicate packets, resulting in large memory overhead and affecting packet forwarding efficiency.

Method used

By obtaining the data packets sent by the terminal, extracting session attribute information, object identification information and instance identification information, performing compression processing to generate session identification information, and finding the target session table entry. If the data packet is not duplicated, it is forwarded.

Benefits of technology

Reduces memory overhead, improves packet forwarding efficiency, and enables the gateway to support more concurrent sessions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119676289A_ABST
    Figure CN119676289A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a data processing method and device, equipment and a medium, and the method comprises the steps: obtaining a data package from a terminal, and the data package comprises the session attribute information of the data package and the serial number of the data package; obtaining object identification information of a target to which the data packet belongs and instance identification information to which the data packet belongs according to the session attribute information, and compressing the object identification information and the instance identification information to obtain session identification information; searching a target session table item related to the data packet according to the session identification information; and if it is determined that the data packet is not a repeated data packet according to the searched target session table item and the data packet serial number, forwarding the data packet according to the session attribute information. According to the technical scheme provided by the embodiment of the invention, the memory overhead is effectively reduced, the data packet forwarding efficiency is improved, and the gateway can support more concurrent sessions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer and communication technology, and in particular to a data processing method, a data processing device, an electronic device, and a computer-readable storage medium. Background Art

[0002] In a cloud computing network, in order to effectively ensure that data packets are transmitted to the corresponding server, the terminal can transmit the same data packet to the server through multiple paths, and the server needs to filter out duplicate data packets from the multiple received data packets. The current common practice is that the server directly records a bitmap for each received data packet. This bitmap is used to mark the sequence number of each data packet to indicate whether the data packet has been received; if the data packet has been received, the server discards it; however, since the size of the bitmap depends on the range of the data packet sequence number, it requires a large amount of server memory overhead. Summary of the invention

[0003] The embodiments of the present application provide a data processing method, a data processing device, an electronic device, a computer-readable storage medium, and a computer program product, which can effectively reduce memory overhead, improve the efficiency of data packet forwarding, and enable the gateway to support more concurrent sessions.

[0004] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.

[0005] In a first aspect, an embodiment of the present application provides a data processing method, comprising: obtaining a data packet from a terminal, the data packet including session attribute information of the data packet and a data packet sequence number; obtaining object identification information of a target to which the data packet belongs and instance identification information to which the data packet belongs according to the session attribute information, and compressing the object identification information and the instance identification information to obtain session identification information; searching for a target session table entry related to the data packet according to the session identification information; if the data packet is determined to be a non-duplicate data packet according to the found target session table entry and the data packet sequence number, forwarding the data packet according to the session attribute information.

[0006] In a second aspect, an embodiment of the present application further provides a data processing device, the device comprising: an acquisition module, used to acquire a data packet from a terminal, the data packet comprising session attribute information of the data packet and a data packet sequence number; the acquisition module, further used to acquire object identification information of a target to which the data packet belongs and instance identification information to which the data packet belongs according to the session attribute information, and to compress the object identification information and the instance identification information to obtain session identification information; a search module, used to search for a target session table entry related to the data packet according to the session identification information; and a forwarding module, used to forward the data packet according to the session attribute information if the data packet is determined to be a non-duplicate data packet according to the found target session table entry and the data packet sequence number.

[0007] In a third aspect, an embodiment of the present application provides an electronic device, comprising one or more processors; a storage device for storing one or more computer programs, so that when the one or more computer programs are executed by the one or more processors, the electronic device implements the data processing method as described above.

[0008] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor of an electronic device, the electronic device executes the data processing method as described above.

[0009] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, wherein the computer program is stored in a computer-readable storage medium, and a processor of an electronic device reads and executes the computer program from the computer-readable storage medium, so that the electronic device performs the data processing method as described above.

[0010] In the technical solution provided in the embodiment of the present application, the gateway obtains a data packet from the terminal, the data packet includes session attribute information of the data packet and a data packet sequence number, obtains object identification information of the target to which the data packet belongs and instance identification information to which the data packet belongs according to the session attribute information, compresses the object identification information and the instance identification information to obtain the session identification information, and then searches for the target session table item related to the data packet through the session identification information; if the data packet is determined to be a non-duplicate data packet according to the found target session table item and the data packet sequence number, the data packet is forwarded according to the session attribute information; that is, in the present application, the gateway can reduce memory overhead by compressing the object identification information and the instance identification information to generate shorter session identification information, and searches for the target session table item through the session identification information, thereby realizing the unloading of some session table items, greatly reducing the memory occupied by the session table items, and further reducing the memory overhead of the gateway; in addition, by using the target session table item and the data packet sequence number to determine whether the data packet is a duplicate data packet, those data packets that have been received can be effectively identified and filtered out, thereby improving the efficiency of data packet forwarding, so that the gateway can support more concurrent sessions.

[0011] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] Figure 1 It is a schematic diagram of an implementation environment involved in this application;

[0013] Figure 2 is a flow chart of a data processing method shown in an exemplary embodiment of the present application;

[0014] Figure 3 is a flow chart of a data processing method shown in an exemplary embodiment of the present application;

[0015] Figure 4 is a flow chart of another data processing method shown in an exemplary embodiment of the present application;

[0016] Figure 5 is a flow chart of another data processing method shown in an exemplary embodiment of the present application;

[0017] Figure 6 is a flow chart of another data processing method shown in an exemplary embodiment of the present application;

[0018] Figure 7 is a flow chart of another data processing method shown in an exemplary embodiment of the present application;

[0019] Figure 8is a flow chart of another data processing method shown in an exemplary embodiment of the present application;

[0020] Fig. 9 is a flow chart of another data processing method shown in an exemplary embodiment of the present application;

[0021] Fig.10 is a flow chart of another data processing method shown in an exemplary embodiment of the present application;

[0022] Fig.11 is a flow chart of another data processing method shown in an exemplary embodiment of the present application;

[0023] Fig.12 is a network architecture diagram of data processing shown in another exemplary embodiment of the present application;

[0024] Fig.13 is a structural block diagram of a data processing device shown in an exemplary embodiment of the present application;

[0025] Fig.14 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION

[0026] Here, exemplary embodiments will be described in detail, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims.

[0027] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0028] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.

[0029] It should also be noted that the "multiple" mentioned in this application refers to two or more than two. "And / or" describes the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship.

[0030] The technical solution of the embodiment of the present application can be applied to the technical field involving cloud technology. Before introducing the technical solution of the embodiment of the present application, a brief introduction to cloud technology is given. Cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and network in a wide area network or a local area network to realize data calculation, storage, processing, and sharing.

[0031] Cloud computing is the product of the development and integration of traditional computer and network technologies such as grid computing, distributed computing, parallel computing, utility computing, network storage technologies, virtualization, and load balancing.

[0032] Based on cloud computing, the gateway in the embodiment of the present application can be a multi-network aggregation gateway in a cloud computing scenario.

[0033] In one example, the embodiment of the present application also relates to cloud gaming, which can also be called gaming on demand, which is an online gaming technology based on cloud computing technology. Cloud gaming technology enables thin clients with relatively limited graphics processing and data computing capabilities to run high-quality games. In a cloud gaming scenario, the game is not run on the player's game terminal, but on a cloud server, and the cloud server renders the game scene as a video and audio stream, which is transmitted to the player's game terminal through the network; the player's game terminal does not need to have powerful graphics computing and data processing capabilities, but only needs to have basic streaming media playback capabilities and the ability to obtain player input instructions and send them to the cloud server.

[0034] Based on cloud gaming, in the embodiment of the present application, the terminal is a player game terminal, and the server is a cloud server, so that multiple player game terminals can interact with the cloud server.

[0035] Based on the above cloud computing, the technical solution of the embodiment of the present application is described in detail below:

[0036] See also Figure 1 , Figure 1 1 is a schematic diagram of an implementation environment involved in the present application. The implementation environment includes multiple terminals 10, a gateway 20, and one or more servers 30. The gateway 20 and the multiple terminals 10 communicate with each other via a wireless or wired network, and the gateway 20 and the server 30 communicate with each other via a wireless or wired network.

[0037] The terminal is used to carry data traffic, the server is the business server corresponding to the data traffic, and the gateway can identify duplicate data packets and forward data packets.

[0038] Among them, the terminal sends a data packet through a transmission path; the gateway obtains the data packet from the terminal, the data packet includes session attribute information of the data packet and a data packet sequence number of the data packet, then obtains the object identification information of the target to which the data packet belongs and the instance identification information to which the data packet belongs according to the session attribute information, and compresses the object identification information and the instance identification information to obtain the session identification information, then searches for a target session table entry related to the data packet according to the session identification information; and determines whether the data packet is a duplicate data packet according to the target session table entry and the data packet sequence number. If it is determined that the data packet is not a duplicate data packet, the data packet is forwarded according to the session attribute information.

[0039] The server can obtain the data packet from the terminal through the gateway, and return a response data packet to the terminal, and return the response data packet to the terminal through the gateway.

[0040] The aforementioned terminals may be electronic devices such as smart phones, tablets, laptops, computers, intelligent voice interaction devices, smart home appliances, vehicle-mounted terminals, aircraft, etc.; the gateway may be a multi-channel selection gateway or a multi-network aggregation gateway; the server may be an independent physical server or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network) and big data and intelligent platforms. No restrictions are imposed here.

[0041] It should be noted that in the specific implementation of the present application, if the data in the data package is related to an object, when the embodiment of the present application is applied to a specific product or technology, it is necessary to obtain the permission or consent of the object, and the collection, use and processing of the relevant data need to comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0042] The following is a detailed description of various implementation details of the technical solution of the embodiment of the present application:

[0043] like Figure 2 As shown, Figure 2 is a flowchart of a data processing method according to an embodiment of the present application, which can be applied to Figure 1 In the implementation environment shown, the method may be executed by a gateway, and the data processing method may include steps S210 to S240, which are described in detail as follows:

[0044] S210: Acquire a data packet from a terminal, where the data packet includes session attribute information of the data packet and a data packet sequence number.

[0045] In an embodiment of the present application, the terminal is used to carry the data traffic of an application, and the data packet includes application layer data, i.e., the data traffic of the application; the data packet also includes transport layer data, i.e., session attribute information and a data packet sequence number, and the session attribute information is used to identify the session corresponding to the data packet, and the corresponding session is unique and is configured by the terminal; the data packet sequence number is used to indicate the order of the data packets in the session connection; for example, for the data traffic of the application, the terminal can divide the data traffic into multiple data packets with a sequence, and the data packet sequence number is the sequence number of the divided data traffic.

[0046] Among them, the gateway can receive data packets transmitted by one or more terminals in real time, and can also continuously receive transmission signals transmitted by one or more terminals within a preset time period; it should be noted that the gateway can receive data packets from the same terminal through multiple transmission paths, and these data packets have a sequence, so the gateway needs to identify whether there are duplicate data packets.

[0047] In one example, the session attribute information includes five-tuple information, namely, source IP address (Source IP Address): the sender IP address of the data packet; destination IP address (Destination IP Address): the receiver IP address of the data packet; source port (Source Port): the port number of the application sending the data packet; destination port (Destination Port): the port number of the application receiving the data packet; protocol (Protocol): indicates the type of transport protocol, such as TCP (Transmission Control Protocol, Transmission Control Protocol), UDP (User Datagram Protocol) or QUIC (Quick UDP Internet Connection, a low-latency Internet transport layer protocol based on UDP developed by Google). The session attribute information can also be seven-tuple information, which is not limited here.

[0048] S220: Obtain object identification information of the target to which the data packet belongs and instance identification information to which the data packet belongs according to the session attribute information, and compress the object identification information and the instance identification information to obtain session identification information.

[0049] In an embodiment of the present application, a data packet is sent from a terminal to a server, that is, the target of the data packet is the server and the owner of the data packet is the terminal, then the object identification information of the target to which the data packet belongs is used to indicate the object identification information of the recipient of the data packet, and the object identification information is used to uniquely identify the recipient; the instance identification information to which the data packet belongs is used to indicate the instance identification information of the owner of the data packet, wherein an instance refers to a running application or service, and the instance identification information is used to uniquely identify the instance of the owner.

[0050] The session attribute information can identify the session of the data packet, and the session attribute information includes information on both ends of the session, namely, information on the data packet owner and receiver. Therefore, the object identification information can be obtained through the information on the data packet receiver, and the instance identification information can be obtained through the information on the data packet owner.

[0051] In one example, the object identification information and the instance identification information are preset by the gateway, so the gateway can search for the corresponding object identification information based on the information of the data packet receiver, and search for the corresponding instance identification information based on the information of the data packet owner.

[0052] In the embodiment of the present application, in order to reduce memory overhead, it is also necessary to compress the object identification information and the instance identification information to obtain the session identification information. The compression process may be encoding the object identification information and the instance identification information to reduce the amount of data without losing useful information.

[0053] S230: Search for a target session table entry related to the data packet according to the session identification information.

[0054] In an embodiment of the present application, the gateway can search for a target session table entry related to a data packet through session identification information related to the data packet. The target session table entry is session-related information maintained and updated by the gateway for the data packet. The target session table entry is used for reliable transmission and out-of-order confirmation of data packets.

[0055] S240: If the data packet is determined to be a non-duplicate data packet according to the found target session table entry and the data packet sequence number, the data packet is forwarded according to the session attribute information.

[0056] As described above, since the target session table entry can be used to confirm the disorder of the data packet, it is possible to determine whether the order of the data packet is disordered according to the found target session table entry and the data packet sequence number, and further determine whether the data packet is a duplicate data packet.

[0057] In an embodiment of the present application, if the data packet is a duplicate data packet, the gateway may directly discard the data packet; if the data packet is not a duplicate data packet, the data packet is forwarded according to the session attribute information to forward the data packet to the data packet receiver.

[0058] In one example, when forwarding a data packet, the gateway will perform necessary encapsulation on the data packet, such as adding or modifying the header field, changing the source IP and source port of the data packet to its own IP and port, and encrypting the application layer data in the data packet, and then forwarding the data packet according to the destination IP address and destination port of the data packet.

[0059] In an embodiment of the present application, a gateway obtains a data packet from a terminal, the data packet including session attribute information of the data packet and a data packet sequence number, obtains object identification information of a target to which the data packet belongs and instance identification information to which the data packet belongs according to the session attribute information, compresses the object identification information and the instance identification information to obtain the session identification information, and then searches for a target session table entry related to the data packet through the session identification information; if the data packet is determined to be a non-duplicate data packet according to the found target session table entry and the data packet sequence number, the data packet is forwarded according to the session attribute information, that is, in the present application, the gateway generates shorter session identification information by compressing the object identification information and the instance identification information, thereby reducing memory consumption, and searches for the target session table entry through the session identification information, thereby realizing the unloading of some session table entries, greatly reducing the memory occupied by the session table entries, and further reducing the memory overhead of the gateway; in addition, by using the target session table entry and the data packet sequence number to determine whether the data packet is a duplicate data packet, it is possible to effectively identify and filter out those data packets that have been received, thereby reducing network congestion and improving the efficiency of data packet forwarding, so that the gateway can support more concurrent sessions.

[0060] In one embodiment of the present application, another data processing method is provided, which can be applied to Figure 1 In the implementation environment shown, the method can be executed by a gateway, such as Figure 3 As shown, the data processing method is Figure 2 Based on S210 to S240 shown in Figure 2 The step S220 shown in FIG. 1 is expanded into steps S310 to S340. The session attribute information in S210 includes the destination address and the destination port. Steps S310 to S340 are described in detail as follows:

[0061] S310: Acquire a pre-cached destination session table, where the destination session table is used to store the association relationship between the destination address and destination port of an established session connection and the object identification information.

[0062] In an embodiment of the present application, the gateway pre-caches a destination session table, which is maintained and updated by the gateway and is used to store the association between the destination address and destination port for which a session connection has been established and the object identification information, that is, the gateway has established a session connection with the destination party corresponding to the destination address and destination port before the current moment, and when establishing the session connection, the gateway configures unique object identification information for the destination party to distinguish different destination parties.

[0063] S320: Search, according to the destination session table, for object identification information associated with the destination address and destination port of the data packet.

[0064] After obtaining the destination address and destination port of the data packet, the obtained address and port can be matched with the destination session table to find out whether the destination address and destination port of the data packet have corresponding object identification information. If the corresponding object identification information is found, it means that the gateway has seen the destination address and destination port and established a connection, so the session connection can be directly established through the object identification information without waiting for the destination party to reply.

[0065] S330: If no associated object identification information is found according to the destination session table, the object identification information of the target to which the data packet belongs is configured as initial value information.

[0066] In an embodiment of the present application, if the associated object identification information is not found in the destination session table, it means that the gateway has not seen it. At this time, the object identification information of the target to which the data packet belongs can be configured as initial value information to facilitate subsequent table entry search.

[0067] S340: Acquire instance identification information to which the data packet belongs according to the session attribute information, and compress the object identification information and the instance identification information to obtain session identification information.

[0068] S340 See Figure 4 The embodiment shown.

[0069] It should be noted that Figure 3 For other detailed descriptions of steps S210, S230 to S240, see Figure 2 The steps S210, S230-S240 shown are not described in detail here.

[0070] In an embodiment of the present application, through the association between the destination address and destination port of the established session connection and the object identification information, as well as the destination address and destination port of the data packet, it is possible to quickly determine whether the destination of the data packet has been seen, and then determine the corresponding object identification information, so as to reduce the time for the gateway to subsequently process the session table entry, reduce the waiting time of the data packet in the gateway, and thus reduce the end-to-end transmission delay.

[0071] The present application provides another data processing method, which can be applied to Figure 1 In the implementation environment shown, the method can be executed by a gateway, such as Figure 4 As shown, the data processing method is Figure 2 Based on the above, S220 is expanded to S410 to S440. Steps S410 to S440 are described in detail as follows:

[0072] S410: Acquire a pre-cached data flow session table, where the data flow session table is used to store the association between the source address of the established data flow and the transport layer protocol and instance identification information.

[0073] In an embodiment of the present application, the gateway pre-caches a data flow session table, which is maintained and updated by the gateway and is used to store the association between the source address and transport layer protocol of the established data flow and the instance identification information, that is, the gateway has established a data flow with the instance corresponding to the source address and transport layer protocol before the current moment, and when performing data flow transmission, the gateway configures unique instance identification information for the instance.

[0074] S420: Search, according to the data flow session table, for instance identification information associated with the source address and transport layer protocol of the data packet.

[0075] After obtaining the source address and transport layer protocol of the data packet, the obtained source address and transport layer protocol can be matched with the data flow session table to find out whether the source address and transport layer protocol of the data packet have corresponding instance identification information. If the corresponding instance identification information is found, it means that the gateway has seen the source address and transport layer protocol, and the instance corresponding to the current data packet also runs the same protocol on the same source address, so the subsequent data flow transmission can be directly carried out through the instance identification information.

[0076] S430: If the associated instance identification information is not found according to the data flow pre-session table, the instance identification information to which the data packet belongs is configured as an initial value.

[0077] In an embodiment of the present application, if the associated instance identification information is not found in the data flow session table, it means that the gateway has not seen it. At this time, the instance identification information of the data packet can be configured as initial value information to facilitate subsequent table entry search.

[0078] S440: Obtain object identification information of the target to which the data packet belongs according to the session attribute information, and compress the object identification information and the instance identification information to obtain session identification information.

[0079] For details, please see Figure 3 The embodiment shown.

[0080] It should be noted that Figure 4 For a detailed description of steps S210, S230 to S240, see Figure 2 The steps S210, S230-S240 shown are not described in detail here.

[0081] In an embodiment of the present application, by establishing an association between the source address and transport layer protocol of the data flow and the instance identification information, as well as the source address and transport layer protocol of the data packet, it is possible to quickly determine whether the instance corresponding to the data packet has been seen, and then determine the corresponding instance identification information, so as to reduce the time for the gateway to subsequently process the session table entry, reduce the waiting time of the data packet in the gateway, and thus reduce the end-to-end transmission delay.

[0082] The present application also provides another data processing method, which can be applied to Figure 1 In the implementation environment shown, the method can be executed by a gateway, such as Figure 5 As shown, the data processing method is Figure 2 Based on the above, S220 is expanded to S510 to S530. Steps S510 to S530 are described in detail as follows:

[0083] S510: Obtain object identification information of the target to which the data packet belongs and instance identification information to which the data packet belongs according to the session attribute information.

[0084] For details, please see Figure 3 and Figure 4 The embodiment shown.

[0085] S520: Perform hash calculation on the object identification information and the instance identification information according to a preset hash algorithm to obtain hash data containing a multi-digit number.

[0086] In an embodiment of the present application, a hash calculation is performed on the object identification and instance identification information through a preset hash algorithm to obtain hash data, which includes a multi-digit value; for example, if the preset hash algorithm is CRC32, the obtained hash data is a 32-bit hash value.

[0087] In one example, a preset hash algorithm can be selected based on application needs and performance requirements. For example, if a higher hash strength is required, a more secure hash algorithm such as SHA-256 can be selected.

[0088] S530. Extract the first preset number of bits of data in the hash data according to the characteristic information of the preset hash algorithm to obtain session identification information.

[0089] In the embodiment of the present application, in order to save storage space while still providing sufficient uniqueness and identification, the first preset number of bits of data in the hash data can be extracted to obtain the session identification information. Among them, the characteristics of the hash algorithm are crucial to the selection of the number of bits of the hash value, and different hash algorithms have different distribution characteristics and hash collision probabilities. For example, some hash algorithms may be more suitable for extracting shorter hash values, while other algorithms may require more bits to provide sufficient uniqueness.

[0090] Among them, the characteristic information of the hash algorithm includes distribution characteristics, and the distribution characteristics include uniform distribution. A good hash algorithm should generate uniformly distributed hash values ​​in the input domain, that is, for different inputs, the range of hash values ​​should be covered as evenly as possible; uniform distribution helps reduce the probability of hash collisions because it reduces the possibility of multiple inputs mapping to the same hash value. Hash diffusion: Some hash algorithms have excellent hash diffusion, which means that small changes to the input will result in large changes in the generated hash value, which helps ensure that different inputs produce different hash values, thereby reducing the risk of hash collisions.

[0091] The characteristic information of the hash algorithm also includes the probability of hash collision. A hash collision means that two different input data are mapped to the same hash value; and the collision probability of different hash algorithms is different.

[0092] Therefore, in the embodiment of the present application, the distribution characteristics of the hash algorithm and the hash collision probability can be preset to select the number of bits of the hash value. For example, if the hash algorithm is preset to have a uniform distribution characteristic or a lower collision probability, more bits are used to ensure the uniqueness of the data.

[0093] For example, the preset hash algorithm is CRC32, which still provides approximately 16.77 million (2^24) possible different values ​​in the first 24 bits. The values ​​of the first 24 bits are unique enough, and the possibility of hash collision is relatively low, especially if the CRC32 algorithm itself provides sufficient uniformity.

[0094] It should be noted that Figure 5 For other detailed descriptions of steps S210, S230 to S240 shown in Figure 2 Steps S210, S230-S240 shown in FIG. 1 are not described in detail here.

[0095] In an embodiment of the present application, the gateway can map the original object identification information and instance identification information into shorter session identification information through a hash algorithm, thereby reducing the storage space requirement and improving data compression efficiency. Moreover, according to the characteristic information of a preset hash algorithm, the gateway can extract the first preset number of bits of data in the hash data, thereby further reducing memory overhead while ensuring that the obtained session identification information has sufficient uniqueness and recognizability.

[0096] In one embodiment of the present application, another data processing method is also provided, which can be applied to Figure 1 In the implementation environment shown, the method can be executed by a gateway, such as Figure 6 As shown, the data processing method is Figures 2 to 5Based on the information shown in , S230 is extended to S610-S620; wherein the session attribute information in S210 also includes the source port, and steps S610-S620 are described in detail as follows:

[0097] S610: Acquire a pre-cached session table, where the session table is used to store the session identification information of the current active session and the association relationship between the source port and the session table entry.

[0098] In an embodiment of the present application, the gateway pre-caches a session table, which is maintained and updated by the gateway and is used to store the session identification information of the currently active session and the association relationship between the source port and the session table item, wherein the currently active session refers to the session currently being executed, and the session table item in the session table is the session information corresponding to the active session that can accurately transmit data packets; the gateway uses the session identification information and source port of the currently active session as the key and the corresponding session table item as the value to establish a session table.

[0099] S620: According to the session table, search for a target session table entry associated with the source port of the data packet and the session identification information.

[0100] After the source port and session identification information corresponding to the data packet are obtained, the obtained session identification information and source port may be matched with the session table to find a target session table entry associated with the source port and session identification information of the data packet.

[0101] It should be noted that Figure 6 For other detailed descriptions of steps S210 to S220 and S240 shown in Figure 2 The steps S210 to S220 and S240 shown are not described in detail here.

[0102] In an embodiment of the present application, through the association between the session identification information and the source port of the current active session and the session table entry, as well as the source port and session identification information of the data packet, it is possible to quickly determine whether the session corresponding to the data packet has been seen to be active, and then determine the corresponding target session table entry, so as to effectively unload some session table entries, reduce the processing burden of the gateway, and thus improve the overall performance and throughput.

[0103] In one embodiment of the present application, another data processing method is also provided, which can be applied to Figure 1 In the implementation environment shown, the method can be executed by a gateway, such as Figure 7 As shown, the data processing method is Figure 6 Based on the data shown in , S710 to S730 are added. Among them, the data packet also includes a key field for indicating whether the data packet is a retransmission data packet; the target session table entry includes the expected next data packet sequence number; steps S710 to S730 are described in detail as follows:

[0104] S710: Indicate in a key field of the data packet that the data packet is not a retransmission data packet, and match the data packet sequence number with the expected next data packet sequence number.

[0105] S720: If the sequence number of the data packet is the same as the sequence number of the next expected data packet, determine that the data packet is a non-duplicate data packet, and update the sequence number of the next expected data packet.

[0106] S730: If the data packet sequence number is different from the expected next data packet sequence number, determine that the data packet is a duplicate data packet.

[0107] In an embodiment of the present application, a data packet includes a key field RETRANS, which is used to indicate whether the data packet is retransmitted data. If the value of the RETRANS field is 1, it means that the current data packet has been sent once or more and no confirmation frame or timeout retransmission has been received. At this time, the gateway does not need to update the session status or send a confirmation frame, but only needs to continue forwarding the data packet; if the value of the RETRANS field is 0, it means that the current data packet is the first to be sent, that is, the current data packet is not a retransmitted data packet, and the data packet sequence number of the current data packet needs to be matched with the next sequence number expected by the gateway.

[0108] If the packet sequence number is the same as the next expected packet sequence number, it means that the packet has arrived in the correct order and the packet is not a duplicate packet, and the next expected packet sequence number needs to be updated. If the packet sequence number is different from the next expected packet sequence number, the packet is directly determined to be a duplicate packet.

[0109] In one example, if the sequence number of a data packet is different from the sequence number of the next expected data packet, the data packet may have been confirmed or may have expired. In this case, the duplicate data packet may be processed differently depending on the situation.

[0110] If the data packet sequence number is less than the expected next data packet sequence number, it means that the data packet has been confirmed, that is, it has been received once before. This is a duplicate data packet and can be directly discarded.

[0111] If the current data packet sequence number is greater than the expected next data packet sequence number, it means that the data packet arrives ahead of time. At this time, the sequence number difference between the current data packet sequence number and the expected next data packet sequence number can be calculated, and whether to cache the data packet can be determined based on the sequence number difference and the preset sequence number difference threshold.

[0112] For example, if the sequence number difference between the current data packet j and the expected next data packet sequence number is less than the preset sequence number difference threshold, it is determined that the data packet is not lost, that is, the current data packet j is cached and waits for the next data packet j+1; this caching strategy allows the gateway to wait for related data that may arrive later to minimize the delay of data packets; when subsequent data packets arrive, the gateway can process them together.

[0113] If the sequence number difference between the current data packet j and the expected next data packet sequence number is greater than the preset sequence number difference threshold, it means that the sequence number difference is too large, which may represent a data packet that arrives too early. Processing it may introduce unnecessary delays or resource consumption. Therefore, there is no need to cache the data packet j, and the data packet j can be directly discarded.

[0114] After determining to cache the data packet, the data packet will be processed according to the data packet sequence number of the next non-duplicate data packet. For example, if the data packet sequence number of the next data packet j+1 is the same as the expected next data packet sequence number, it means that the next data packet j+1 is a non-duplicate data packet and arrives in the correct order. It is further determined that the data packet sequence number of the next data packet j+1 is adjacent to the data packet sequence number of the current data packet j, then data packet j and the next data packet j+1 can be sorted, and the data packet sorting can be performed based on their sequence numbers to ensure that they are forwarded in the correct order. For example, since the data packet sequence number of the next data packet j+1 is less than the current data packet sequence number, the next data packet j+1 can be forwarded first, and then the current data packet j is forwarded.

[0115] If the packet sequence number of the next non-repetitive packet j+1 is not adjacent to the packet sequence number of packet j, then packet j can be directly discarded, or it can continue to be cached until the cache time reaches the preset cache upper limit. If the packet is not forwarded, packet j is discarded.

[0116] In an embodiment of the present application, the preset sequence number difference threshold defines the number of early arriving data packets that the gateway is willing to cache, and the preset sequence number difference threshold can be dynamically adjusted according to actual needs. In one example, the preset sequence number difference threshold can be selected according to network performance and application requirements; a larger preset sequence number difference threshold can tolerate more early arriving data packets, but it will also increase memory consumption; a smaller preset sequence number difference threshold may reduce memory overhead, but may cause more data packets to be discarded. For example, in video stream processing, a smaller preset sequence number difference threshold may be more applicable because reducing latency is important for real-time performance; while in file downloading, a larger preset sequence number difference threshold may be more appropriate to improve bandwidth utilization. In another example, the selection of the preset sequence number difference threshold also needs to consider memory overhead. A larger threshold will cause more data packets to be cached, increasing memory overhead; a smaller threshold will reduce memory overhead, but may cause more data packets to be discarded.

[0117] It should be noted that Figure 7 For other detailed descriptions of steps S210-S220, S610-S620, and S240 shown in Figure 6 The steps S210 to S220, S610 to S620, and S240 shown are not repeated here.

[0118] In an embodiment of the present application, when a data packet is not a retransmitted data packet, the relationship between the data packet sequence number of the data packet and the expected next data packet sequence number in the target session table entry is used to determine whether the data packet is a duplicate data packet, which can effectively identify and filter out those data packets that have been received, and reduce the memory and computing resource consumption of the gateway; further, by repeating the data packet and selectively delaying the processing of the data packet according to the sequence number difference, the network bandwidth can be more effectively utilized and unnecessary data packet processing overhead can be reduced; and because in congestion conditions, data packets that arrive ahead of time may introduce more delays and retransmissions, and by selectively delaying the processing of these data packets, the impact of network congestion can be alleviated.

[0119] In one embodiment of the present application, another data processing method is also provided, which can be applied to Figure 1 In the implementation environment shown, the method can be executed by a gateway, such as Figure 8 As shown, the data processing method is Figure 6 Based on the above, S810~S820 are added. The detailed description of S810~S820 is as follows:

[0120] S810: If the target session table entry associated with the source port and session identification information of the data packet is not found according to the session table, a pre-stored full connection table is obtained, where the full connection table is used to store the association relationship between the session attribute information of the established session connection and the global session information.

[0121] In the embodiment of the present application, if the target session table entry is searched from the session table, it means that the session corresponding to the data packet is an inactive session, the data packet belongs to a new session connection, or an abnormal data packet, and the data packet cannot be quickly forwarded. At this time, it is necessary to search for the target session table entry through the pre-stored full connection table; wherein the full connection table is used to store the association between the session attribute information of the established session connection and the global session information, wherein the global session information refers to all session information related to the session attribute information, including but not limited to the session connection identifier, the data flow identifier, the data packet sequence number, etc. In one example, the full connection table can be the sum of the aforementioned destination session table, the data flow session table, and the session table.

[0122] S820: Search for global session information associated with the session attribute information according to the pre-stored full connection table, and search for a target session table entry related to the data packet according to the global session information.

[0123] In the embodiment of the present application, the session attribute information of the data packet is used as a key to search whether there is corresponding global session information in the full connection table. After the global session information is found, it means that the session connection related to the data packet already exists and has corresponding global session information. Then, the target session table entry related to the data packet is searched according to the global session information. For example, if the global session information includes the previous data packet sequence number, the expected data packet sequence number of the target session table entry is determined according to the previous data packet sequence number.

[0124] It should be noted that Figure 8 For other detailed descriptions of steps S210-S220, S610-S620, and S240 shown in Figure 6 The steps S210 to S220, S610 to S620, and S240 shown are not repeated here.

[0125] In an embodiment of the present application, when the session corresponding to the data packet is determined to be an inactive session by uninstalling some session table entries, the corresponding target session table entry is searched from a global direction by establishing an association relationship between the session attribute information of the session connection and the global session information, and the session attribute information of the data packet, to ensure effective and accurate identification of the data packet.

[0126] In one embodiment of the present application, another data processing method is also provided, which can be applied to Figure 1 In the implementation environment shown, the method can be executed by a gateway, such as Fig. 9 As shown, the data processing method is Figure 8 Based on the information shown in , S820 is expanded into steps S910 to S920. Steps S910 to S920 are described in detail as follows:

[0127] S910: If the global session information is not found according to the pre-stored full connection table, a new session corresponding to the data packet is created according to the session attribute information, and the global session information of the new session is obtained.

[0128] S920: Synchronously update the corresponding session table according to the global session information, and search for a target session entry according to the updated session table.

[0129] In an embodiment of the present application, if the corresponding global session information is not found in the full connection table, it means that a new session connection needs to be created for the data packet. At this time, a new session corresponding to the data packet is created based on the session attribute information of the data packet, for example, a handshake is established with the recipient of the data packet, and the global session information of the newly created session is obtained and saved in the full connection table. At the same time, the corresponding session table is synchronously updated according to the global session information, that is, the aforementioned destination session table, data flow session table, and session table are updated. For example, the destination address and destination port are extracted from the global session information, and new object identification information is assigned to the destination address and destination port, and then the association relationship between the destination address and destination port and the newly assigned object identification information is stored in the destination session table.

[0130] Due to the destination session table, the data flow session table and the session table, the session identification information of the data packet can be re-determined based on step S220, and then the target session table entry can be searched based on the re-determined session identification information and the updated session table.

[0131] It should be noted that Fig. 9 For other detailed descriptions of steps S210-S220, S610-S620, S810, and S240 shown in Figure 8 The steps S210 to S220, S610 to S620, S810, and S240 shown are not repeated here.

[0132] In an embodiment of the present application, if the global session information is not searched, a new session corresponding to the data packet is created based on the session attribute information, and the global session information of the new session is obtained to update the corresponding session table, so that subsequent data packets can be processed through the session table, thereby improving the scalability of the gateway.

[0133] The present application embodiment provides another data processing method, which can be applied to Figure 1 In the implementation environment shown, the method can be executed by a gateway, such as Fig.10 As shown, the data processing method will Figure 2 Based on the above, S1010 to S1030 are added, i.e., the process of forwarding the response data packet of the server. Steps S1010 to S1030 are described in detail as follows:

[0134] S1010. Obtain a response data packet from the server; the response data packet includes response session attribute information and a response data packet sequence number.

[0135] S1020: Acquire response session identification information corresponding to the response data packet according to the response session attribute information, and search for a response session table entry related to the response data packet according to the response session identification information.

[0136] S1030: Determine target tunnel information of the response data packet according to the response session entry, and forward the response data packet to the terminal based on the target tunnel information.

[0137] In the embodiment of the present application, when the server processes the data packet of the terminal, it will generate a response data packet and return it to the terminal. At this time, the gateway will obtain the corresponding response session identification information according to the response session attribute of the response data packet, and then search for the response session table entry. For the specific process, please refer to Figures 2 to 6 As shown, no further description is given here.

[0138] It is worth noting that for the data packets sent from the server to the terminal, the gateway may or may not identify whether the data packets are duplicate data packets. If it is to identify whether the data packets are duplicate data packets, the specific process is as described in the above embodiment.

[0139] In an embodiment of the present application, the gateway needs to determine the target tunnel information of the response data packet based on the response session table entry, wherein the response session table entry is the unique identification information of the tunnel to which the data packet belongs, and is used to accurately find out from which tunnel the data packet sent from the server should be sent back, that is, the target tunnel information, which includes the tunnel connection information, source address, source port, etc.

[0140] It should be noted that Fig.10 For more detailed description of steps S210 to S240 shown in Figure 2 The steps S210 to S240 shown are not described in detail here.

[0141] In an embodiment of the present application, for a response data packet sent by the service provider to the terminal, the gateway can also effectively unload the session to accurately query the target tunnel information corresponding to the data packet sent from the server, thereby achieving accurate tunnel forwarding of the data packet.

[0142] The present application embodiment provides another data processing method, which can be applied to Figure 1 In the implementation environment shown, the method can be executed by a gateway, such as Fig.11 As shown, the data processing method is Fig.10 Based on the results shown in Fig.10The S1030 shown is expanded into steps S1110 to S1130. The response session entry includes a tunnel identifier and a data flow identifier; steps S1110 to S1130 are described in detail as follows:

[0143] S1110: Obtain a tunnel information table, where the tunnel information table is used to store the association relationship between currently active tunnel information and tunnel identifiers.

[0144] In an embodiment of the present application, the tunnel information table is maintained and updated by the gateway, and is used to store the association relationship between the currently active tunnel information and the tunnel identifier; wherein the currently active tunnel information refers to the tunnel that is currently transmitting data, and the gateway configures a unique tunnel identifier for the currently active tunnel information, and establishes a corresponding association relationship to obtain the tunnel information table.

[0145] S1120. According to the tunnel information table, search for target tunnel information associated with the tunnel identifier.

[0146] After the tunnel identifier is obtained by responding to the session identifier information, the tunnel identifier is matched with the tunnel information table to find out whether the tunnel information table contains target tunnel information associated with the tunnel identifier.

[0147] S1130. Re-encapsulate the response data packet according to the target tunnel information and the data flow identifier, and forward the re-encapsulated response data packet to the terminal.

[0148] In the embodiment of the present application, the gateway combines the target tunnel information with the data flow identifier and re-encapsulates the response data packet. The data flow identifier is used to uniquely identify each data flow in the connection.

[0149] In one example, the repackaging process of the response data packet includes: updating the source address and source port of the response data packet to the exit address and port of the gateway to ensure that the response data packet is sent correctly; updating the destination address and target port of the response data packet to the tunnel address and tunnel port in the target tunnel information to ensure that the data packet is forwarded according to the target tunnel; updating the connection identifier of the response data packet to the connection identifier in the target tunnel information to ensure that the response data packet is correctly routed to the corresponding connection; at the same time, retaining the data flow identification information to ensure that the response data packet is correctly routed to the corresponding data flow.

[0150] The re-encapsulated data packet can be forwarded to the terminal by the gateway according to the new destination address and port information.

[0151] It should be noted that Fig.11 For a detailed description of steps S210 to S240 and S1010 to S1020, see Fig.10Steps S210 to S240 and S1010 to S1020 shown in FIG. 1 are not described in detail here.

[0152] In an embodiment of the present application, through the association relationship between the currently active tunnel information and the tunnel identifier, as well as the tunnel identifier of the response session table item, the target tunnel information associated with the tunnel identifier can be quickly found to effectively unload some session table items and ensure accurate encapsulation of the response data packet.

[0153] For ease of understanding, the present application also provides a data processing system, which is applied to cloud computing scenarios, such as Fig.12 As shown, it includes a white box programmable switch for implementing a white box programmable switch, a terminal for carrying data traffic, and a target server for providing upper layer services. Among them, the terminal runs the actual APP (application) and the SDK (Software Development Kit) for establishing a multi-path tunnel connection with the white box programmable switch; the target server mainly carries actual business services, such as cloud game servers, etc. The white box switch has the ability to modify the data packet forwarding logic on demand. The switch can accept data packets sent from different devices (such as servers and other switches, etc.), and can also forward data packets according to the business orchestration logic requirements.

[0154] In one example, a white box switch, such as Intel's Tofino switch, needs to be able to support secondary development capabilities, such as programmable packet forwarding processes. The white box switch includes a CPU chip, such as Intel 8310, which needs to be able to support deployment of containers, secondary development, and other capabilities.

[0155] In cloud computing scenarios, white-box programmable switches are mainly used to receive data packets sent from multiple transmission paths. These data packets arrive in a certain order. White-box programmable switches are used to collect these data packets and send the first arriving data packets to the target server first. The same data packets that arrive later need to be identified and discarded. Otherwise, directly forwarding duplicate data packets to the target server will cause the bandwidth required for the target server to receive to double, causing huge bandwidth pressure.

[0156] In order to accurately identify duplicate data packets and reduce memory at the same time, an embodiment of the present application proposes a data processing method based on session table unloading, which can achieve efficient multi-channel selection. The data processing method includes: each terminal will access the SDK, and the SDK will send the same data packet on multiple communication links to increase the probability of the receiving end successfully receiving the data packet. A QUIC communication tunnel will be constructed between the SDK and the acceleration gateway. The QUIC tunnel carries actual user traffic, such as TCP and UDP traffic. The white-box programmable switch determines whether the data packet is a retransmission data packet based on the RETRANS field in the Stream Frame in the tunnel header. If it is a retransmission data packet, it will be forwarded directly. Otherwise, it determines whether the data packet is a duplicate data packet. If it is a duplicate data packet, it will be discarded. Otherwise, it will also be forwarded directly. After the target server receives the data packet sent by the white-box programmable switch, it sends a response data packet. After receiving the response data packet sent by the target server, the white-box programmable switch queries the corresponding QUIC tunnel information according to the 5-tuple information of the data packet, performs QUIC tunnel encapsulation, and then sends the encapsulated data packet to the corresponding SDK. After the SDK decrypts the received data packet from the QUIC tunnel, it feeds the data packet back to the terminal. At this point, a complete data flow is realized.

[0157] The specific operation process of the pipeline of the white box programmable switch receiving the data packet from the SDK is as follows:

[0158] 1) After the port of the white box programmable switch receives the data packet sent by the SDK, it will first extract the key fields in the QUIC packet header and record the contents of the RETRANS field in the Stream Frame header and the data packet sequence number sequence_number.

[0159] QUIC (Quick UDP Internet Connections) is a transport protocol for improving network performance. It is based on the UDP protocol and contains some key fields, some of which are used to manage data streams (Stream) and handle packet retransmissions (Retransmission). The QUIC header includes multiple fields, some of which are important information for identifying and managing data packets. The extraction of these fields usually includes the following: Version number (Version): used to indicate the version of the QUIC protocol to ensure that both parties in communication use the same protocol version. Connection ID (Connection ID): Identifies the connection to which the data packet belongs, which helps to associate the data packet with the correct connection. Packet sequence number: Each QUIC data packet has a unique packet number for sorting and managing the order of data packets. Payload length (Payload Length): Indicates the length of the payload in the data packet so that the data can be parsed correctly. Frame type (Frame Type): Identifies the frame type contained in the data packet, such as STREAM, ACK, PING, etc. Other control bits (Flags): Includes some flag bits to indicate the type and status of the data packet.

[0160] In QUIC, Stream Frame is used to transmit application layer data on the data stream. The RETRANS field is a key field in the Stream Frame header, which is used to indicate whether the data packet is retransmitted data.

[0161] It is understandable that in QUIC, data packets are the basic transmission units used to transmit data on the network, and data streams represent the communication channel between two endpoints and can carry the transmission of application data. QUIC data packets usually contain one or more data frames, and these data frames carry application data on a specific data stream. The data of a data stream can be divided into multiple data packets, and a data packet can contain data from different data streams.

[0162] 2) The white box programmable switch extracts the field information in the inner layer of the data packet for subsequent table query, such as the 5-tuple information of the data packet (source IP address src_ip, destination IP address dst_ip, source port src_port, destination port dst_port, protocol protocol), and the data packet sequence number sequence_number.

[0163] In an embodiment of the present application, the 5-tuple information represents the session to which the data packet belongs. The white-box programmable switch needs to search or create corresponding connections and flow table entries based on this information, and perform routing and forwarding. The data packet sequence number represents the sequence number of the data packet in the connection. The white-box programmable switch needs to perform congestion control and retransmission timeout calculation based on this information.

[0164] like Fig.13 As shown, the data packet from terminal 1 includes the following contents:

[0165] IP Header (out_src_ip=IP2, out_dst_ip=IP3), this is the header of an IP data packet, which contains some meta information about the data packet, such as version, length, source address, destination address, etc. Among them, out_src_ip=IP2, out_dst_ip=IP3 means that this data packet is sent from the source host with IP address IP2 to the destination host with IP address IP3.

[0166] UDP Header (quic_udp_src_port = 100, quic_udp_dst_port = 200): This is a UDP datagram header, which contains some information about the datagram, such as source port, destination port, length, checksum, etc. Among them, quic_udp_src_port = 100, quic_udp_dst_port = 200 means that this datagram is sent from the instance with port number 100 of the source host to the instance with port number 200 of the destination host.

[0167] QUIC Header (QUIC_ID = 0x1): This is a QUIC protocol header, which contains some information about the QUIC connection and stream, such as connection ID, version number, sequence number, frame type, etc. Among them, QUIC_ID-0x1 indicates that this header belongs to the QUIC connection with connection ID 0x1.

[0168] Stream Frame (TCP Stream ID = 0x2, RETRANS = 0x0): This is a frame type in the QUIC protocol, used to transmit application layer data, which contains some information about the stream and data, such as stream ID, offset, length, data, etc. Among them, TCP Stream ID = 0x2 means that this frame belongs to the QUIC stream with stream ID 0x2. RETRANS-0x0 means that this frame has not been retransmitted.

[0169] APP Payload (src_ip = IP2, dst_ip = IP5, dst_port = 8080, src_port = 1010): This is the payload of an application layer packet, which contains information about the application layer protocol or content, and can have different formats, such as JSON, XML, etc. Among them, src_ip = IP2, dst_ip = IP5, dst_port = 8080, src_port = 1010 means that this packet is sent from the source host with IP address IP2 and port number 1010 to the destination host with IP address IP5 and port number 8080.

[0170] 3) The white box programmable switch will query the first table entry pre-session table1 (the aforementioned destination session table) to determine whether the 5-tuple destination address dst_ip and destination port dst_port have corresponding pre-stored identification information and store it in the corresponding field. If pre-session table1 hits, jump to step a); otherwise jump to step b).

[0171] a) Update the oid_final field based on the oid information (Object Identifier) ​​queried from pre-session table1 and go to step 4).

[0172] b) If no oid information is found, set oid_final to the initial value, that is, oid_final = -1.

[0173] In the embodiment of the present application, pre-session table 1 is used to store the mapping relationship between the destination address and port of the previously established connection and the oid information. If the table entry is hit, it means that the white box programmable switch has seen the destination address and destination port, and can directly use the cached oid information for 0-RTT handshake without waiting for the server to reply. Oid_final is a field for storing the finalized oid information; if the table entry is not hit, it means that the white box programmable switch needs to default the oid information corresponding to the destination address and destination port to the initial value.

[0174] 4) Then, continue to query pre-session table2 (the aforementioned data flow session table) to determine whether there is matching table entry information for the protocol protocol and the source IP address src_ip. If pre-session table2 hits, jump to step a); otherwise jump to step b).

[0175] a) Query the iid information (instance identifier) ​​based on pre-session table2, update the iid_final field, and jump to step 5).

[0176] b) If no iid information is found, iid_final is set to the initial value, i.e., iid_final=-1.

[0177] In the embodiment of the present application, pre-session table2 is used to store the mapping relationship between the protocol and source address of the flow that has been established before and the iid. If the table entry is hit, it means that the white box programmable switch has seen the protocol and source address, and can directly use the cached iid for flow creation and transmission; if the table entry is not hit, it means that the white box programmable switch needs to default the iid information of the protocol and source address to the initial value; iid_final is a field used to store the finalized iid information.

[0178] 5) Perform hash calculation on the oid_final and iid_final obtained above to obtain a shorter field hash_id (the aforementioned session identification information).

[0179] The hash algorithm may be a typical open source algorithm, such as CRC16, CRC32, CRC64, etc., and the length of the output hash field is different. In order to improve the compression efficiency, this application takes CRC32 as an example, and can map oid_final (2Bytes) and iid_final (2Bytes) into a new hash field hash_id.

[0180] In the embodiment of the present application, this step is to implement the header compression function of the QUIC protocol. hash_id is the hash value of oid_final and iid_final, which is used to shorten the header length and reduce transmission overhead. In the embodiment of the present application, only the first 24 bits of the output are used as hash_id to improve compression efficiency, that is, hash_id is a 24-bit unsigned integer.

[0181] 6) Substitute the obtained hash_id and source port src_port into the session table for query. If a match is found, jump to step a); otherwise, jump to step d).

[0182] In the embodiment of the present application, this step is to implement the session management function of the QUIC protocol. The session table is a session table that stores the session identification information of the currently active session and the association between the source port and the session table entry. It uses hash_id and src_port as indexes to find or create the corresponding session table entry and perform data packet processing and forwarding.

[0183] a) Query the MAPID, Stream_id, and next_sequence_number information according to the table entry; where next_sequence_number is a 64-bit unsigned integer maintained and updated by the white-box programmable switch, used to indicate the sequence number of the next data packet expected to be received in the stream, for reliable transmission and out-of-order confirmation.

[0184] b) At this time, the value of the RETRANS field before the premise is judged. If it is 1, it means that the current data packet is a retransmission data packet, jump to step 7) and continue to forward the data packet; otherwise, it means that the current data packet is not a retransmission data packet, jump to step c) to determine whether it meets the expected next_sequence_number.

[0185] c) If the sequence_number received in the data packet is equal to the queried next_sequence_number, it means that the data packet is correct, update next_sequence_number=next_sequence_number+1, and jump to step 7) to continue forwarding the data packet; otherwise, if the current data packet is a duplicate packet, it is discarded and the process ends.

[0186] This step is to implement the out-of-order confirmation function of the QUIC protocol. sequence_number indicates the sequence number of the data packet in the stream, and next_sequence_number indicates the sequence number of the next data packet expected to be received in the stream; if the two are equal, it means that the data packet has arrived in the correct order, and the white box programmable switch needs to update next_sequence_number to the next expected sequence number and continue to forward the data packet; if the two are not equal, it means that the data packet has been confirmed or arrived ahead of time, and the white box programmable switch needs to discard the data packet and end the process.

[0187] d) If no session table information is found, the data packet is sent to the CPU of the white box programmable switch for slow path processing, and the process goes to step 7).

[0188] If the session table information is not found, it means that the data packet belongs to a non-existent or closed connection or flow, or is an erroneous or malicious data packet. The white box programmable switch cannot process the data packet directly and needs to send it to the CPU for more complex logic processing, such as handshake, flow creation, error recovery, etc. Then jump to step 7) to continue forwarding the data packet.

[0189] 7) After necessary encapsulation of the data packet, forward the data packet.

[0190] The white-box programmable switch performs necessary encapsulation on the data packet, such as adding or modifying the header field, encrypting or decrypting the payload, etc., and then forwards the data packet according to the destination address and port.

[0191] like Fig.13 As shown, IP Header (src_ip = IP2, dst_ip = IP5): This is the header of an IP data packet, which contains some meta information about the data packet, such as version, length, source address, destination address, etc. Among them, src_ip = IP2 means that this data packet is sent from the source host with IP address IP2, and dst_ip = IP5 means that this data packet is sent to the destination host with IP address P5.

[0192] TCP Header (src_port = 1010, dst_port = 8080): This is a TCP datagram header, which contains some information about the datagram, such as source port, destination port, sequence number, acknowledgment number, window size, etc. Among them, src_port = 1010 means that this datagram is sent from the instance with port number 1010 of the source host, and dst_port = 8080 means that this datagram is sent to the instance with port number 8080 of the destination host.

[0193] The specific process of the pipeline of the white box programmable switch receiving data packets from the target server is as follows:

[0194] 1) After the port of the white box programmable switch receives the data packet sent from the target server, it extracts the field information in the inner layer of the data packet for subsequent table query, such as the 5-tuple information of the data packet and the data packet sequence number sequence_number.

[0195] 2) Then, the white box programmable switch will query the first table entry pre-session table1 to determine whether the destination address dst_ip and destination port dst_port of the 5-tuple have corresponding pre-stored identification information and store it in the corresponding field. If pre-session table1 hits, jump to step a); otherwise jump to step b).

[0196] a) Update the oid_final field based on the oid information queried from pre-session table1 and jump to step 3).

[0197] b) If no oid information is found, set oid_final to the initial value, that is, oid_final = -1.

[0198] 3) Then, continue to query pre-session table2 to determine whether there is matching table entry information for protocol protocol and source IP address src_ip. If pre-session table2 hits, jump to step a); otherwise jump to step b).

[0199] a) Query the iid information based on pre-session table2, update the iid_final field, and jump to step 4).

[0200] b) If no iid information is found, iid_final is set to the initial value, i.e., iid_final=-1.

[0201] 4) Hash the oid_final and iid_final obtained above to obtain a shorter field hashid.

[0202] For the above steps 1) to 4), please refer to the specific process of the data package from the SDK, which will not be repeated here.

[0203] 5) Substitute the obtained hash_id and source port src_port into the session table for query. If a match is found, jump to step a); otherwise, jump to step c).

[0204] a) Query the MAPID, Stream_id, and next_sequence_number information based on the table entry.

[0205] This step is to obtain session-related information. MAPID is a 16-bit unsigned integer generated by the white box programmable switch and assigned to the data packet. It is the unique identifier of the data packet in the tunnel for routing and forwarding. Stream_id is a 32-bit unsigned integer, which is the unique identifier of the stream to which the data packet belongs in the connection, used for multiplexing and transmission.

[0206] b) Let map_id = MAPID; jump to step 6) query the QUIC tunnel information corresponding to the map table.

[0207] This step is to obtain information related to the QUIC tunnel. map_id is a 16-bit unsigned integer generated by the white-box programmable switch and assigned to the data packet; it is the unique identifier of the QUIC tunnel to which the data packet belongs in the white-box programmable switch, and is used to query the map table entry. The map table is a mapping table that stores information about the currently active QUIC tunnel, such as connection ID (cid), source address (src_ip), destination address (dst_ip), source port (quic_udp_src_port), destination port (quic_udp_dst_port), etc.

[0208] c) No session table information is found and the data packet is discarded.

[0209] If no session table information is found, it means that the data packet belongs to a connection or flow that does not exist or has been closed, or it is an erroneous or malicious data packet; the white box programmable switch cannot process the data packet and needs to discard it and end the process.

[0210] 6) According to the map_id information, query the MAP table entry to obtain the cid, src_ip, dst_ip, quic_udp_src_port, and quic_udp_dst_port of the QUIC tunnel; and after combining with the Stream id information, re-encapsulate the data packet and send it to the SDK.

[0211] This step is to implement the routing and forwarding functions of the QUIC protocol. The white box programmable switch queries the MAP table according to the map_id information to obtain information related to the QUIC tunnel; then, according to the Stream id information, it re-encapsulates the data packet, adds or modifies the header field, encrypts or decrypts the payload, etc. Finally, the data packet is sent to the SDK for further processing or forwarding.

[0212] The CPU operation logic of the white box programmable switch is as follows:

[0213] 1) The CPU obtains the data packet sent from the pipeline line and extracts the five-tuple information of the data packet, and queries whether the five-tuple has a corresponding session table entry in the fully connected table in the CPU memory; if it hits, the CPU synchronously sends the session information corresponding to the session table entry to the four table entries on the fast path; if it does not hit, jump to step a).

[0214] This step is to implement the slow path processing function of the white box programmable switch. The CPU is the control plane of the white box programmable switch, responsible for processing complex logic that cannot be completed on the fast path (i.e. pipeline), such as new connections or flows, handshakes, error recovery, etc.

[0215] By obtaining the data packets on the pipeline, the CPU can obtain the five-tuple information of the data packets, namely the source IP address, destination IP address, source port, destination port and protocol. The CPU maintains a fully connected table in memory to store the association between the session attribute information of the established session connection and the global session information. The CPU searches the fully connected table for a corresponding session entry based on the five-tuple information. If so, it means that the connection or flow already exists and has corresponding status information; if not, it means that the connection or flow is newly created and the corresponding session entry needs to be created and synchronized to the fast path.

[0216] a) Create corresponding session information for the five-tuple information, insert it into the fully connected table entry, and simultaneously send pre-session table1, pre-session table2, session table and map-table information to the fast path table entry.

[0217] The CPU creates corresponding session information based on the five-tuple information, including iid, oid, MAPID, hash_id, sequence number, etc., and inserts it into the fully connected table entry. At the same time, the CPU synchronously sends this information to the four tables on the fast path.

[0218] b) Among them, the table entry of pre-session table1 contains the key of destination address dst_ip and destination port dst_port, and the corresponding queried value is oid.

[0219] c) The entry of pre-session table2 contains the key protocol protocol and source IP address src_ip, and the corresponding value is iid.

[0220] d) The session table entry contains the key hash_id, source port src_port, and the corresponding queried values ​​are map_id, stream_id, and next_sequence_nubmer.

[0221] e) The table entry of map-table contains the key map and the value of the queried QUIC cid, src_ip, dst_ip, quic_udp_src_port, quic_udp_dst_port.

[0222] 2) End the current CPU running logic.

[0223] The CPU completes slow path processing of a packet and waits for the next packet to arrive.

[0224] The technical solution provided by the embodiment of the present application reduces the processing burden of the gateway by combining the unloading of session table items and the advancement of small table items, thereby improving the overall performance and throughput; reduces the time for the gateway to process session table items, reduces the waiting time of data packets in the gateway, and thus reduces the end-to-end transmission delay; unloading some session table items can reduce the memory consumption of the gateway, so that the gateway can support more concurrent sessions and improve the scalability of the system; unloading some session table items can reduce the memory and computing resource consumption of the gateway, and reduce equipment costs and operating costs; the multi-channel selective receiving gateway technology based on session table item unloading can be flexibly deployed in different network environments to meet the needs of various application scenarios; the multi-channel selective receiving gateway technology based on session table item unloading can simplify network management and maintenance work and improve operation and maintenance efficiency.

[0225] The device embodiment of the present application is introduced, which can be used to execute the data processing method in the above embodiment of the present application. For details not disclosed in the device embodiment of the present application, please refer to the above embodiment of the data processing method of the present application.

[0226] The present application embodiment provides a data processing device, such as Fig.13 As shown, the device comprises:

[0227] The acquisition module 1310 is used to acquire a data packet from a terminal, where the data packet includes session attribute information of the data packet and a data packet sequence number;

[0228] The acquisition module 1310 is further used to acquire the object identification information of the target to which the data packet belongs and the instance identification information to which the data packet belongs according to the session attribute information, and compress the object identification information and the instance identification information to obtain the session identification information;

[0229] A search module 1320, configured to search a target session table entry related to the data packet according to the session identification information;

[0230] The forwarding module 1330 is configured to forward the data packet according to the session attribute information if it is determined that the data packet is a non-duplicate data packet according to the found target session table entry and the data packet sequence number.

[0231] In one embodiment of the present application, based on the aforementioned scheme, the session attribute information includes a destination address and a destination port; the acquisition module 1310 is further used to obtain a pre-cached destination session table, the destination session table being used to store the association between the destination address and the destination port of an established session connection and the object identification information; according to the destination session table, the object identification information associated with the destination address and the destination port of the data packet is searched; if the associated object identification information is not found according to the destination session table, the object identification information of the target to which the data packet belongs is configured as the initial value information.

[0232] In one embodiment of the present application, based on the aforementioned scheme, the session attribute information includes a source address and a transport layer protocol; the acquisition module 1310 is further used to obtain a pre-cached data flow session table, the data flow session table is used to store the association between the source address and transport layer protocol of the established data flow and the instance identification information; according to the data flow session table, the instance identification information associated with the source address and transport layer protocol of the data packet is searched; if the associated instance identification information is not found according to the data flow pre-session table, the instance identification information to which the data packet belongs is configured as the initial value information.

[0233] In one embodiment of the present application, based on the aforementioned scheme, the acquisition module 1310 is further used to perform a hash calculation on the object identification information and the instance identification information according to a preset hash algorithm to obtain hash data containing multiple digits; according to the characteristic information of the preset hash algorithm, extract the first preset number of digits of data in the hash data to obtain the session identification information.

[0234] In one embodiment of the present application, based on the aforementioned scheme, the session attribute information includes the source port, and the search module 1320 is further used to obtain a pre-cached session table, which is used to store the session identification information of the currently active session and the association relationship between the source port and the session table entry; according to the session table, the target session table entry associated with the source port and session identification information of the data packet is searched.

[0235] In one embodiment of the present application, based on the aforementioned scheme, the data packet also includes a key field for indicating whether the data packet is a retransmitted data packet; the target session table entry includes the expected next data packet sequence number, and the device also includes a determination module for indicating in the key field that the data packet is not a retransmitted data packet, and matching the data packet sequence number with the expected next data packet sequence number; if the data packet sequence number is the same as the expected next data packet sequence number, the data packet is determined to be a non-duplicate data packet, and the expected next data packet sequence number is updated; if the data packet sequence number is different from the expected next data packet sequence number, the data packet is determined to be a duplicate data packet.

[0236] In one embodiment of the present application, based on the aforementioned scheme, the determination module is further used to calculate the sequence number difference between the data packet sequence number and the expected next data packet sequence number when the data packet sequence number is greater than the expected next data packet sequence number; determine whether to cache the data packet based on the relationship between the sequence number difference and a preset sequence number difference threshold; if the data packet is cached, process the data packet based on the data packet sequence number of the next non-duplicate data packet.

[0237] In one embodiment of the present application, based on the aforementioned scheme, the search module 1320 is also used to obtain a pre-stored full-connection table if the target session table entry associated with the source port and session identification information of the data packet is not found according to the session table. The full-connection table is used to store the association relationship between session attribute information of a session connection that has been established and the global session information; according to the pre-stored full-connection table, the global session information associated with the session attribute information is searched, and the target session table entry related to the data packet is searched according to the global session information.

[0238] In one embodiment of the present application, based on the aforementioned scheme, the search module 1320 further creates a new session corresponding to the data packet based on the session attribute information if the global session information is not found according to the pre-stored full connection table, and obtains the global session information of the new session; synchronously updates the corresponding session table according to the global session information, and searches for the target session table entry according to the updated session table.

[0239] In one embodiment of the present application, based on the aforementioned scheme, the acquisition module 1310 is also used to obtain a response data packet from the server; the response data packet includes response session attribute information and a response data packet sequence number, and the response session identification information corresponding to the response data packet is obtained according to the response session attribute information; the search module 1320 is also used to search for a response session table entry related to the response data packet according to the response session identification information; the forwarding module 1330 is also used to determine the target tunnel information of the response data packet according to the response session table entry, and forward the response data packet to the terminal based on the target tunnel information.

[0240] In one embodiment of the present application, based on the aforementioned scheme, the response session table entry includes a tunnel identifier and a data flow identifier; the forwarding module 1330 is further used to obtain a tunnel information table, which is used to store the association between the currently active tunnel information and the tunnel identifier; according to the tunnel information table, the target tunnel information associated with the tunnel identifier is searched; the response data packet is re-encapsulated according to the target tunnel information and the data flow identifier, and the re-encapsulated response data packet is forwarded to the terminal.

[0241] It should be noted that the device provided in the above embodiment and the method provided in the above embodiment belong to the same concept, wherein the specific manner in which each module and unit performs the operation has been described in detail in the method embodiment and will not be repeated here.

[0242] The device provided in the above embodiment can be arranged in a gateway. The device can reduce memory overhead by compressing object identification information and instance identification information to generate shorter session identification information. The target session table item is searched through the session identification information, thereby realizing the unloading of some session table items, greatly reducing the memory occupied by the session table items, and further reducing the memory overhead of the gateway. In addition, by using the target session table item and the data packet sequence number to determine whether the data packet is a duplicate data packet, those data packets that have been received can be effectively identified and filtered out, thereby improving the efficiency of data packet forwarding, so that the gateway can support more concurrent sessions.

[0243] An embodiment of the present application also provides an electronic device, comprising one or more processors and a storage device, wherein the storage device is used to store one or more computer programs, and when the one or more computer programs are executed by one or more processors, the electronic device implements the data processing method as described above.

[0244] Fig.14 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown.

[0245] It should be noted that Fig.14 The computer system 1400 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0246] like Fig.14As shown, the computer system 1400 includes a processor (Central Processing Unit, CPU) 1401, which can perform various appropriate actions and processes according to the program stored in the read-only memory (Read-Only Memory, ROM) 1402 or the program loaded from the storage part 1408 to the random access memory (Random Access Memory, RAM) 1403, such as executing the method in the above embodiment. In RAM 1403, various programs and data required for system operation are also stored. CPU 1401, ROM 1402 and RAM 1403 are connected to each other through bus 1404. Input / output (Input / Output, I / O) interface 1405 is also connected to bus 1404.

[0247] In some embodiments, the following components are connected to the I / O interface 1405: an input section 1406 including a keyboard, a mouse, etc.; an output section 1407 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 1408 including a hard disk, etc.; and a communication section 1409 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1409 performs communication processing via a network such as the Internet. A drive 1410 is also connected to the I / O interface 1405 as needed. A removable medium 1411, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1410 as needed, so that a computer program read therefrom is installed into the storage section 1408 as needed.

[0248] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 1409, and / or installed from a removable medium 1411. When the computer program is executed by a processor (CPU) 1401, various functions defined in the system of the present application are executed.

[0249] It should be noted that the computer-readable medium shown in the embodiment of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with 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 (Erasable Programmable Read Only Memory), a flash memory, an optical fiber, a portable compact disk read-only memory (Compact Disc Read-Only Memory, CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. This propagated data signal can take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. A computer program contained on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0250] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the devices, methods and computer program products according to various embodiments of the present application. Among them, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and a computer program.

[0251] The units or modules involved in the embodiments described in this application may be implemented by software or hardware, and the units or modules described may also be set in a processor. The names of these units or modules do not, in some cases, constitute limitations on the units or modules themselves.

[0252] Another aspect of the present application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the method described above is implemented. The computer-readable storage medium may be included in the electronic device described in the above embodiment, or may exist independently without being assembled into the electronic device.

[0253] Another aspect of the present application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. A processor of an electronic device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the electronic device executes the method provided in the above-mentioned embodiments.

[0254] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.

[0255] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the embodiments disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application, which follow the general principles of the present application and include common knowledge or customary technical means in the art that are not disclosed in the present application.

[0256] The above content is only a preferred exemplary embodiment of the present application and is not intended to limit the implementation scheme of the present application. A person of ordinary skill in the art can easily make corresponding changes or modifications based on the main concept and spirit of the present application. Therefore, the scope of protection of the present application shall be based on the scope of protection required by the claims.

Claims

1. A data processing method, characterized in that: include: Acquire a data packet from a terminal, wherein the data packet includes session attribute information of the data packet and a data packet sequence number; Acquire object identification information of the target to which the data packet belongs and instance identification information to which the data packet belongs according to the session attribute information, and compress the object identification information and the instance identification information to obtain session identification information; Searching for a target session table entry related to the data packet according to the session identification information; If the data packet is determined to be a non-duplicate data packet according to the found target session table entry and the data packet sequence number, the data packet is forwarded according to the session attribute information.

2. The method according to claim 1, characterized in that The session attribute information includes a destination address and a destination port; the step of obtaining object identification information of a target to which the data packet belongs and instance identification information to which the data packet belongs according to the session attribute information includes: Acquire a pre-cached destination session table, wherein the destination session table is used to store an association relationship between a destination address and a destination port of an established session connection and object identification information; According to the destination session table, searching for object identification information associated with the destination address and destination port of the data packet; If no associated object identification information is found according to the destination session table, the object identification information of the target to which the data packet belongs is configured as initial value information.

3. The method according to claim 1, characterized in that The session attribute information includes a source address and a transport layer protocol; the step of obtaining object identification information of a target to which the data packet belongs and instance identification information to which the data packet belongs according to the session attribute information includes: Acquire a pre-cached data flow session table, wherein the data flow session table is used to store the association relationship between the source address of the established data flow and the transport layer protocol and the instance identification information; According to the data flow session table, searching for instance identification information associated with the source address and transport layer protocol of the data packet; If the associated instance identification information is not found according to the data flow pre-session table, the instance identification information to which the data packet belongs is configured as initial value information.

4. The method according to claim 1, characterized in that: The compressing the object identification information and the instance identification information to obtain the session identification information includes: Performing a hash calculation on the object identification information and the instance identification information according to a preset hash algorithm to obtain hash data containing a plurality of digits; According to the characteristic information of the preset hash algorithm, the first preset number of bits of data in the hash data is extracted to obtain the session identification information.

5. The method according to any one of claims 1 to 4, characterized in that: The session attribute information includes a source port; and searching for a target session table entry related to the data packet according to the session identification information includes: Acquire a pre-cached session table, where the session table is used to store session identification information of a currently active session and an association relationship between a source port and a session table entry; According to the session table, a target session table entry associated with the source port of the data packet and the session identification information is searched.

6. The method according to claim 5, characterized in that The data packet also includes a key field for indicating whether the data packet is a retransmission data packet; the target session table entry includes an expected next data packet sequence number, and the method further includes: Indicating in the key field that the data packet is not a retransmission data packet, and matching the data packet sequence number with the expected next data packet sequence number; If the data packet sequence number is the same as the expected next data packet sequence number, determining that the data packet is a non-duplicate data packet, and updating the expected next data packet sequence number; If the data packet sequence number is different from the expected next data packet sequence number, it is determined that the data packet is a duplicate data packet.

7. The method according to claim 6, characterized in that If the data packet sequence number is different from the expected next data packet sequence number, after determining that the data packet is a duplicate data packet, the method further includes: When the data packet sequence number is greater than the expected next data packet sequence number, calculating the sequence number difference between the data packet sequence number and the expected next data packet sequence number; Determining whether to cache the data packet according to a relationship between the sequence number difference and a preset sequence number difference threshold; If the data packet is cached, the data packet is processed according to the data packet sequence number of the next non-repetitive data packet.

8. The method according to claim 5, characterized in that The method further comprises: If the target session table entry associated with the source port of the data packet and the session identification information is not found according to the session table, a pre-stored full connection table is obtained, wherein the full connection table is used to store the association relationship between the session attribute information of the established session connection and the global session information; According to the pre-stored full connection table, the global session information associated with the session attribute information is searched, and the target session table entry related to the data packet is searched according to the global session information.

9. The method according to claim 8, characterized in that The searching, according to the pre-stored full connection table, for global session information associated with the session attribute information, and searching, according to the global session information, for a target session table entry associated with the data packet, comprises: If the global session information is not found according to the pre-stored full connection table, a new session corresponding to the data packet is created according to the session attribute information, and the global session information of the new session is obtained; The corresponding session table is synchronously updated according to the global session information, and the target session table entry is searched according to the updated session table.

10. The method according to claim 1, characterized in that After forwarding the data packet according to the session attribute information, the method further includes: Obtaining a response data packet from the server; the response data packet includes response session attribute information and a response data packet sequence number; Acquire response session identification information corresponding to the response data packet according to the response session attribute information, and search for a response session table entry related to the response data packet according to the response session identification information; The target tunnel information of the response data packet is determined according to the response session entry, and the response data packet is forwarded to the terminal based on the target tunnel information.

11. The method according to claim 10, characterized in that The response session entry includes a tunnel identifier and a data flow identifier; determining target tunnel information of the response data packet according to the response session entry, and forwarding the response data packet to the terminal based on the target tunnel information, including: Acquire a tunnel information table, where the tunnel information table is used to store an association relationship between currently active tunnel information and tunnel identifiers; According to the tunnel information table, searching for target tunnel information associated with the tunnel identifier; The response data packet is re-encapsulated according to the target tunnel information and the data flow identifier, and the re-encapsulated response data packet is forwarded to the terminal.

12. A data processing device, characterized in that: include: An acquisition module, used for acquiring a data packet from a terminal, wherein the data packet includes session attribute information of the data packet and a data packet sequence number; The acquisition module is further used to acquire object identification information of the target to which the data packet belongs and instance identification information to which the data packet belongs according to the session attribute information, and compress the object identification information and the instance identification information to obtain session identification information; A search module, used for searching a target session table entry related to the data packet according to the session identification information; The forwarding module is used for forwarding the data packet according to the session attribute information if it is determined that the data packet is a non-duplicate data packet according to the found target session table entry and the data packet sequence number.

13. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the electronic device to execute the method according to any one of claims 1 to 11.

14. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor of an electronic device, the electronic device executes the method according to any one of claims 1 to 11.

Citation Information

Cited By

  • Data transmission method and system in Internet of Things environment and storage medium

    CN120935210A