Data packet transmission method and device

The AI ​​decision model determines the encapsulation strategy in network communication, which solves the problem of poor packet transmission accuracy of UDP protocol under poor network conditions, and achieves more efficient and reliable packet transmission.

CN119520630APending Publication Date: 2025-02-25ULTRAPOWER SOFTWARE +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411616578.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-13
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

In the existing network communication technology, the UDP protocol lacks error detection and correction mechanisms, resulting in poor packet transmission accuracy under poor network conditions and cannot meet the needs of secure transmission.

Method used

The AI ​​decision model determines the target encapsulation strategy based on the network status of the target network, generates encapsulation parameters including packet sequence number, response confirmation number, packet verification value and secure metadata, and optimizes packet transmission.

Benefits of technology

It improves the accuracy and security of data packet transmission, combines the efficiency of UDP protocol and the reliability of TCP protocol, and adapts to diversified network communication needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119520630A_ABST
    Figure CN119520630A_ABST
Patent Text Reader

Abstract

The invention provides a data packet transmission method and device, and the method comprises the steps: obtaining an original data packet which is a data packet sent by a client to opposite-end equipment; determining a target encapsulation strategy based on the network state of the target network by using a preset algorithm and / or a preset model and adopting an AI decision model; wherein the generation strategies of the packaging parameters corresponding to different packaging strategies are different, and / or the data formats of the packaging parameters corresponding to different packaging strategies are different; the original data packet is packaged into a to-be-transmitted data packet, a header of the to-be-transmitted data packet carries a target packaging parameter, and the target packaging parameter is generated based on a target packaging strategy; and sending the to-be-transmitted data packet to the opposite terminal device based on the target communication protocol. According to the method, the performance and the security of network communication can be optimized through the step of intelligently deciding the encapsulation strategy, and the method can be combined with the high efficiency of the UDP protocol and the reliability of the TCP protocol so as to adapt to diversified network communication requirements.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] With the rapid development of information technology, the network security situation has become more complex. In addition, with the advancement of enterprise management methods such as cloud computing, the Internet of Things and remote office, enterprises have further increased their requirements for data protection and remote access security. Therefore, the selection of network communication technology solutions has become particularly critical.

[0003] In the existing network communication technology solutions, the communication between the client and the peer device generally uses the UDP protocol as the transport layer protocol. In actual application, the client can send and receive data through the UDP protocol. Since the UDP protocol is a connectionless transport layer protocol, the client does not need to establish a connection with the peer device in advance to send data. This data transmission method shows efficient transmission performance in the fields of real-time communication, multimedia transmission and game applications.

[0004] However, since this data transmission method lacks error detection and correction mechanisms, when the network conditions are poor, problems such as packet loss, disorder or duplicate delivery may occur during the data transmission process. The packet transmission accuracy is poor and it cannot meet the needs of secure transmission. Summary of the invention

[0005] The embodiments of the present application provide a method and device for transmitting a data packet to solve the problem of poor transmission accuracy of the traditional method.

[0006] In a first aspect, an embodiment of the present application provides a data packet transmission method, which is applied to a network communication system, wherein the network communication system includes at least a plurality of clients and peer devices, and the clients and peer devices rely on a target network for data transmission;

[0007] The method includes: obtaining an original data packet, which is a data packet sent by a client to a peer device; using a preset algorithm and / or a preset model, and adopting an AI decision model to determine a target encapsulation strategy based on the network status of the target network; wherein the generation strategies of encapsulation parameters corresponding to different encapsulation strategies are different, and / or the data formats of encapsulation parameters corresponding to different encapsulation strategies are different; the encapsulation parameters at least include a data packet sequence number, a response confirmation number, a data packet check value and / or security metadata; the generation strategy at least includes a response confirmation number generation strategy, and / or a data packet check value generation strategy; encapsulating the original data packet into a data packet to be transmitted, wherein the header of the data packet to be transmitted carries the target encapsulation parameters, and the target encapsulation parameters are generated based on the target encapsulation strategy; and sending the data packet to be transmitted to the peer device based on the target communication protocol.

[0008] In one achievable manner, the preset model is a first dynamic network model; the steps of using a preset algorithm and / or a preset model and adopting an AI decision model to determine a target encapsulation strategy based on the network status of the target network include: acquiring network status parameters in real time, the network status parameters at least including bandwidth utilization, real-time packet loss rate and / or network delay; inputting the network status parameters into the first dynamic network model, and using the first dynamic network model to predict future network delays and / or future transmission rates; when the future network delay is greater than or equal to a first delay threshold, or when the future transmission rate is less than a first rate threshold, determining that the data format of the data packet sequence number is a first sequence number format, determining that the generation strategy of the response confirmation number is a first response generation strategy, and determining that the generation strategy of the data packet check value is a first check generation strategy; the first sequence number format is not With a timestamp; the first response generation strategy includes generating a response confirmation number based on a first response mechanism; when the future network delay is less than the first delay threshold, or when the future transmission rate is greater than or equal to the first rate threshold, the data format of the data packet sequence number is determined to be the second sequence number format, the generation strategy of the response confirmation number is determined to be the second response generation strategy, and the generation strategy of the data packet check value is determined to be the second check generation strategy; the second sequence number format is timestamp; the second response generation strategy includes generating a response confirmation number based on the second response mechanism, the response timeout corresponding to the first response mechanism is less than the response timeout corresponding to the second response mechanism, and the number of data packet retransmissions corresponding to the first response mechanism is greater than the number of data packet retransmissions corresponding to the second response mechanism; the calculation steps of the second check generation strategy are more than the calculation steps of the first check generation strategy.

[0009] In one achievable manner, the step of using a preset algorithm and / or a preset model and adopting an AI decision model to determine a target encapsulation strategy based on the network status of the target network also includes: using a preset algorithm to determine whether there is a security threat event in the target network; when there is a security threat event in the target network, determining that the data format of the data packet sequence number is the second sequence number format, determining that the generation strategy of the response confirmation number is the third response generation strategy, and determining that the data format of the security metadata is the first security meta-format; the third response generation strategy includes generating a response confirmation number based on a third response mechanism, and the third response mechanism has an encryption confirmation step; when there is no security threat event in the target network, determining that the data format of the data packet sequence number is the first sequence number format, determining that the generation strategy of the response confirmation number is the fourth response generation strategy, and determining that the data format of the security metadata is the second security meta-format; the fourth response generation strategy includes generating a response confirmation number based on a fourth response mechanism, and the fourth response mechanism does not have an encryption confirmation step; the length of the security metadata corresponding to the second security meta-format is less than the length of the security metadata corresponding to the first security meta-format.

[0010] In one feasible manner, before the step of encapsulating the original data packet into a data packet to be transmitted, it also includes: assigning a unique data packet sequence number to the original data packet, wherein the data packet sequence number conforms to a first sequence number format or a second sequence number format; establishing a simulated response system, and, based on a first response mechanism, or a second response mechanism, or a third response mechanism, or a fourth response mechanism, sending the original data packet carrying the data packet sequence number to the simulated response system; upon receiving a confirmation frame from the simulated response system, generating a response confirmation number based on a first response generation strategy, and / or a second response generation strategy, and / or a third response generation strategy, and / or a fourth response generation strategy; and calculating a data packet check value of the original data packet based on a first check generation strategy or a second check generation strategy.

[0011] In one feasible method, when there is a security threat event in the target network, before the step of determining that the data format of the data packet sequence number is a second sequence number format, it also includes: obtaining network traffic characteristics, the network traffic characteristics at least including traffic peaks; based on the network traffic characteristics, using a preset algorithm to determine whether there is a security threat event in the target network.

[0012] In one feasible method, using a preset algorithm to determine whether a target network has a security threat event includes: determining the current size of a sending window, the size of the sending window is used to control the maximum amount of data when sending a data packet to be transmitted to a peer device; based on network status parameters, determining whether the target network is in a congested state; if the target network is in a congested state, inputting the current size of the sending window and the network status parameters into a first decision model, and using the first decision model to adjust the size of the sending window, the first decision model being established based on a deep Q network.

[0013] In one feasible method, after the step of adjusting the size of the sending window using the first decision model, it also includes: determining whether the real-time packet loss rate is greater than a preset packet loss rate threshold; if the real-time packet loss rate is greater than the preset packet loss rate threshold, using the first decision model to determine a target time point for retransmitting the data packet to be transmitted; when the target time point arrives, retransmitting the lost data packet to be transmitted to the other device.

[0014] In an achievable manner, the expression of the first dynamic network model is: y=w1*x1+w2*x2+…+wn*xn+b;

[0015] Where y represents the future network delay or future transmission rate, x1, x2 and xn represent bandwidth utilization, real-time packet loss rate or network delay; w1, w2 and wn represent weights, and b is the intercept;

[0016] The expression of the first decision model is:

[0017] Q1'(s_t,a_t)=Q1(s_t,a_t)+x*[r_t+n*max(Q1(s_{t+1},a')-Q1(s_t,a_t))];

[0018] Wherein, s_t represents the network state parameters; a_t represents the action of adjusting the size of the sending window in the st state, including increasing the size of the sending window, reducing the size of the sending window, or keeping the size of the sending window unchanged; Q1'(s_t, a_t) represents the expected cumulative return of executing action a_t in the st state; r_t represents the immediate reward; x represents the learning rate; n represents the discount factor; max(Q1(s_{t+1}, a') represents the Q1 value that is expected to bring the maximum return among all the actions of adjusting the size of the sending window when the network state parameters change.

[0019] In one feasible method, before the step of sending the data packet to be transmitted to the opposite device based on the target communication protocol, it also includes: obtaining the network transmission rate in real time, and obtaining the maximum rate threshold; inputting the network transmission rate and the maximum rate threshold into the second decision model, and adjusting the network transmission rate using the second decision model, and the second decision model is established based on the deep Q network.

[0020] In a second aspect, an embodiment of the present application further provides a data packet transmission device, which is applied to a network communication system, wherein the network communication system includes at least a plurality of clients and peer devices, and the clients and peer devices rely on a target network for data transmission;

[0021] The device includes: an acquisition module, which is used to acquire an original data packet, where the original data packet is a data packet sent by a client to a peer device; a strategy determination module, which is used to use a preset algorithm and / or a preset model and an AI decision model to determine a target encapsulation strategy based on the network status of the target network; wherein the generation strategies of encapsulation parameters corresponding to different encapsulation strategies are different, and / or the data formats of encapsulation parameters corresponding to different encapsulation strategies are different; the encapsulation parameters at least include a data packet sequence number, a response confirmation number, a data packet check value and / or security metadata; the generation strategy at least includes a response confirmation number generation strategy and / or a data packet check value generation strategy; an encapsulation module, which is used to encapsulate the original data packet into a data packet to be transmitted, wherein the header of the data packet to be transmitted carries the target encapsulation parameters, and the target encapsulation parameters are generated based on the target encapsulation strategy; a transmission module, which is used to send the data packet to be transmitted to the peer device based on the target communication protocol.

[0022] From the above content, it can be seen that the embodiment of the present application provides a data packet transmission method and device, the method includes: obtaining the original data packet, the original data packet is the data packet sent by the client to the opposite device; using the preset algorithm and / or the preset model, the AI ​​decision model is used to determine the target encapsulation strategy based on the network status of the target network; wherein the generation strategy of the encapsulation parameters corresponding to different encapsulation strategies is different, and / or the data format of the encapsulation parameters corresponding to different encapsulation strategies is different; the encapsulation parameters at least include the data packet sequence number, the response confirmation number, the data packet check value and / or the security metadata; the generation strategy at least includes the generation strategy of the response confirmation number, and / or the generation strategy of the data packet check value; encapsulating the original data packet into a data packet to be transmitted, wherein the header of the data packet to be transmitted carries the target encapsulation parameters, and the target encapsulation parameters are generated based on the target encapsulation strategy; sending the data packet to be transmitted to the opposite device based on the target communication protocol. The method provided by the embodiment of the present application can optimize the performance and security of network communication through the steps of intelligent decision-making encapsulation strategy, and can combine the efficiency of UDP protocol with the reliability of TCP protocol, so as to adapt to the diversified network communication needs. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 A schematic diagram of the structure of a network communication system provided in an embodiment of the present application;

[0024] Figure 2 A schematic diagram of a flow chart of a data packet transmission method provided in an embodiment of the present application;

[0025] Figure 3 A schematic diagram of a process for determining a target packaging strategy provided in an embodiment of the present application;

[0026] Figure 4 A schematic diagram of a process for encapsulating a data packet provided in an embodiment of the present application;

[0027] Figure 5 A schematic diagram of the structure of a data packet transmission system provided in an embodiment of the present application;

[0028] Figure 6 A schematic diagram of the structure of a data packet transmission device provided in an embodiment of the present application.

[0029] Among them, 100-client; 200-peer device; 201-SDP controller; 202-SDP gateway; 203-business resources; 300-user equipment; 1001-data encapsulation module; 1002-AI decision module; 1002a-AI decision submodule; 1002b-traffic shaping optimization module; 1002c-congestion control module; 1003-security threat identification and defense module; 1004-network communication module; 2001-acquisition module; 2002-determination module; 2003-encapsulation module; 2004-transmission module; 2031-host; 2032-database. DETAILED DESCRIPTION

[0030] In order to enable those skilled in the art to better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work should fall within the scope of protection of the present application.

[0031] Before introducing the technical solutions of the embodiments of the present application, the terms involved in the embodiments of the present application are first introduced by way of example.

[0032] Software-Defined Perimeter (SDP) architecture: A zero-trust network access security model proposed by the International Cloud Security Alliance (CSA). The SDP architecture is used to significantly reduce the risk of network attacks by hiding network resources and only allowing authenticated and authorized users to access. The SDP architecture is mainly composed of the following core components: SDP client, SDP controller, and SDP gateway. Among them, the SDP client is installed on the user device, such as a laptop, smartphone, or tablet. The SDP client is a bridge between the user and the SDP network, and is used to initiate secure communication with the SDP controller to verify the user's identity and access. When the SDP client initiates a connection request, the SDP controller is used to verify the user's identity and permissions, and decide whether to allow access based on the preset policy. In addition, the SDP controller is also used to coordinate the communication between the SDP client and the SDP gateway to ensure that only authenticated and authorized clients can establish a connection to the SDP gateway. The SDP gateway is a physical or virtual device that provides network access control. It is located between the protected resources and the external network and is used for instructions from the SDP controller to dynamically create and destroy encrypted tunnels to specific network resources.

[0033] With the rapid development of information technology, the network security situation has become more complex. In addition, with the advancement of enterprise management methods such as cloud computing, the Internet of Things and remote office, enterprises have further increased their requirements for data protection and remote access security. Therefore, the selection of network communication technology solutions has become particularly critical.

[0034] In the existing network communication technology solutions, the communication between the client and the peer device generally uses the UDP protocol as the transport layer protocol. In actual application, the client can send and receive data through the UDP protocol. Since the UDP protocol is a connectionless transport layer protocol, the client does not need to establish a connection with the peer device in advance to send data. This data transmission method shows efficient transmission performance in the fields of real-time communication, multimedia transmission and game applications.

[0035] However, since this data transmission method lacks error detection and correction mechanisms, when the network conditions are poor, problems such as packet loss, disorder or duplicate delivery may occur during the data transmission process. The packet transmission accuracy is poor and it cannot meet the needs of secure transmission.

[0036] The embodiments of the present application provide a data packet transmission method and device. Based on the transmission method, the data packet transmission accuracy can be improved, and the transmission security can be improved.

[0037] Figure 1 A schematic diagram of the structure of a network communication system provided in an embodiment of the present application.

[0038] The data packet transmission method provided in the embodiment of the present application can be applied to the communication process of the network communication system. Figure 1 As shown, the network communication system may include multiple clients 100 and peer devices 200. The client 100 and the peer device 200 can rely on the target network for data transmission. Among them, the client 100 may refer to an SDP client running on a user device 300, and the user device 300 is, for example, a laptop, a smart phone, or a tablet computer. In other words, the user device 300 and the peer device 200 can form a network communication system based on the SDP architecture. The peer device 200 may specifically refer to an SDP controller 201, an SDP gateway 202, and / or a business resource 203 to achieve dynamic, fine-grained access control. Exemplarily, the business resource 203 may specifically include a host 2031 and a database 2032, which is not specifically limited in the embodiments of the present application.

[0039] In some implementations, when the network communication system is applied to the internal environment of a company or enterprise, the target network may refer to the company intranet (or referred to as an enterprise intranet, local area network, etc.). At this time, the SDP architecture can provide a more flexible and secure access control mechanism. In the specific application process, after the SDP client (client 100) is installed on the device (user device 300) of an employee or authorized user, these devices can communicate with the SDP controller 201 and the SDP gateway 202 through the company intranet (target network). The SDP controller 201 can dynamically allow or deny access requests based on preset policies and user identity authentication results, and the SDP gateway 202 can be responsible for establishing an encrypted tunnel to ensure the security of data transmission.

[0040] It can be understood that the data packet transmission method provided in the embodiment of the present application can be specifically deployed on a device having a client 100 installed, so that the client 100 (user device 300) transmits data packets to the opposite device 200 using the data packet transmission method.

[0041] Figure 2 A flowchart of a method for transmitting data packets provided in an embodiment of the present application.

[0042] like Figure 2 As shown, the data packet transmission method provided in the embodiment of the present application includes the following steps S100-S400.

[0043] S100: Acquire an original data packet, where the original data packet is a data packet sent by the client 100 to the peer device 200.

[0044] In the embodiment of the present application, the original data packet sent by the device (user device 300) of the client 100 to the SDP controller 201, the SDP gateway 202 and / or the service resource 203 can be monitored and captured. The original data packet can specifically be a data packet based on the UDP protocol. Exemplarily, the original data packet can include multiple types of data such as user requests and data exchange information, which is not specifically limited in the embodiment of the present application.

[0045] S200: Utilizing a preset algorithm and / or a preset model, an AI decision model is adopted to determine a target encapsulation strategy based on the network status of the target network; wherein, different encapsulation strategies correspond to different encapsulation parameter generation strategies, and / or, different encapsulation strategies correspond to different encapsulation parameter data formats; the encapsulation parameters include at least a data packet sequence number, a response confirmation number, a data packet check value and / or security metadata; the generation strategy includes at least a response confirmation number generation strategy, and / or, a data packet check value generation strategy.

[0046] The embodiment of the present application can dynamically determine the target encapsulation strategy that best suits the current network conditions based on the current network status of the target network, such as network congestion, network delay, and packet loss rate. The encapsulation strategy provided by the embodiment of the present application can have differences in the generation strategy of the encapsulation parameters, and can also have differences in the data format of the encapsulation parameters. Exemplarily, the embodiment of the present application selects different generation algorithms for response confirmation numbers, different methods for calculating data packet check values, etc. to generate encapsulation strategies. Further, the encapsulation parameters include but are not limited to data packet sequence numbers, response confirmation numbers, data packet check values, and security metadata, wherein the data packet sequence number can be used to reconstruct the order of the data packet, the response confirmation number can be used to ensure that the data packet is correctly received, the data packet check value can be used to verify data integrity, and the security metadata is, for example, an encryption key identifier, access control information, etc., which can be used to improve the security of data transmission.

[0047] S300: Encapsulate the original data packet into a data packet to be transmitted, wherein the header of the data packet to be transmitted carries a target encapsulation parameter, and the target encapsulation parameter is generated based on a target encapsulation policy.

[0048] Among them, the User Datagram Protocol (UDP) is a connectionless transport layer protocol used to provide connectionless data transmission services. The data packet to be transmitted can be composed of two parts: a UDP header and a UDP data area. When encapsulating a data packet, the embodiment of the present application can embed a target encapsulation parameter in the UDP header to optimize the header structure based on the original low-latency advantage of the UDP protocol, so that the transmission of the data packet to be transmitted is more reliable.

[0049] It is worth noting that the data packet to be transmitted can also be called an optimized UDP data packet, or can also be called a UDP data packet encapsulated based on the Transmission Control Protocol (TCP).

[0050] S400: Sending the data packet to be transmitted to the opposite device 200 based on the target communication protocol.

[0051] In the embodiment of the present application, the target communication protocol may be the TCP protocol, which is a connection-oriented, reliable, byte stream-based transport layer communication protocol. In the embodiment of the present application, based on the TCP protocol, a reliable communication connection can be established between the client 100 (user device 300) and the peer device 200 to transmit data packets, which can ensure that the data arrives at the peer device 200 in order and improve the accuracy of data transmission.

[0052] As can be seen from the above content, the embodiment of the present application provides a data packet transmission method, the method comprising: obtaining an original data packet, the original data packet is a data packet sent by the client 100 to the opposite device 200; using a preset algorithm and / or a preset model, using an AI decision model to determine a target encapsulation strategy based on the network status of the target network; wherein the generation strategy of the encapsulation parameters corresponding to different encapsulation strategies is different, and / or the data format of the encapsulation parameters corresponding to different encapsulation strategies is different; the encapsulation parameters at least include a data packet sequence number, a response confirmation number, a data packet check value and / or security metadata; the generation strategy at least includes a response confirmation number generation strategy, and / or a data packet check value generation strategy; encapsulating the original data packet into a data packet to be transmitted, wherein the header of the data packet to be transmitted carries a target encapsulation parameter, and the target encapsulation parameter is generated based on the target encapsulation strategy; and sending the data packet to be transmitted to the opposite device 200 based on the target communication protocol. The method provided in the embodiment of the present application can optimize the performance and security of network communication through the steps of intelligent decision encapsulation strategy, and can combine the efficiency of the UDP protocol with the reliability of the TCP protocol, thereby adapting to diverse network communication needs.

[0053] Figure 3 A schematic diagram of a process for determining a target encapsulation strategy provided in an embodiment of the present application.

[0054] like Figure 3 As shown, step S200 may include the following steps S201-S204.

[0055] S201: Acquire network status parameters in real time, where the network status parameters at least include bandwidth utilization, real-time packet loss rate and / or network delay.

[0056] In the embodiment of the present application, a network monitoring tool may be used to monitor network status parameters in real time. The network monitoring tool may be, for example, Speedtest, Fast.com, or iPerf, etc. The embodiment of the present application does not specifically limit this.

[0057] It is understandable that parameters such as bandwidth utilization, real-time packet loss rate and network delay can reflect the current health status and performance of the target network. Different network states will affect the security, integrity and orderliness of data packet transmission to varying degrees. Therefore, the embodiments of the present application can adjust the encapsulation strategy based on the network state.

[0058] S202: Input the network status parameters into the first dynamic network model, and use the first dynamic network model to predict future network delay and / or future transmission rate.

[0059] The preset model can be established using a machine learning or deep learning model, and can be specifically a first dynamic network model, which can be used to predict the trend of network status changes. In the embodiment of the present application, the first dynamic network model can be specifically used to predict future network delays or future transmission rates.

[0060] In the embodiment of the present application, the expression of the first dynamic network model may be: y=w1*x1+w2*x2+…+wn*xn+b;

[0061] Among them, y can represent the target variable to be predicted, that is, the future network delay or the future transmission rate, x1, x2, ..., xn represent input features, such as bandwidth utilization, real-time packet loss rate or network delay. w1, w2, ..., wn represent the weights of the corresponding input features, which are specifically used to represent the degree of influence of each input feature on the target variable. b is the intercept, which represents the value of the target variable when all target features are 0.

[0062] In the training phase, an optimal set of weights w and intercepts b can be determined through historical data sets to minimize the error between the model prediction value and the actual value. In this way, the first dynamic network model can be used to predict the development trend of network conditions, thereby guiding the formulation of transmission strategies.

[0063] For example, the first dynamic network model predicts that the next network delay may increase. At this time, the AI ​​decision model can be used to adjust the encapsulation strategy to adapt to possible adverse network environments and ensure the best performance balance under different network conditions. Among them, the AI ​​decision model can be a model for intelligent decision-making provided in an embodiment of the present application, which can be specifically established based on a deep Q network (DQN). The target encapsulation strategy can be determined based on the AI ​​decision model. The specific application process of the AI ​​decision model will be described in detail below and will not be repeated here.

[0064] S203: When the future network delay is greater than or equal to the first delay threshold, or the future transmission rate is less than the first rate threshold, the data format of the data packet sequence number is determined to be the first sequence number format, the generation strategy of the response confirmation number is determined to be the first response generation strategy, and the generation strategy of the data packet check value is determined to be the first check generation strategy; the first sequence number format does not carry a timestamp; the first response generation strategy includes generating a response confirmation number based on a first response mechanism.

[0065] It is worth noting that step S203 and the following step S204 can be executed by an AI decision model.

[0066] Furthermore, if the future network delay is greater than or equal to the first delay threshold and the future transmission rate is less than the first rate threshold, it can indicate that the future network condition is relatively poor. Therefore, the first sequence number format without a timestamp can be used to assign a data packet sequence number to the original data packet to avoid the problem of discontinuous or repeated sequence number generation. It is worth noting that the first sequence number format can also constrain the data packet sequence number to be distributed in a single-digit increasing manner.

[0067] Exemplarily, the first delay threshold may be 100 ms, 110 ms or 120 ms, and the first rate threshold may be 5 Mbps or 6 Mbps, which is not specifically limited in the embodiments of the present application.

[0068] The first response generation strategy is established based on the first response mechanism, and the first response mechanism is used to limit the response timeout time and the number of data packet retransmissions. In this way, a response confirmation number that conforms to the network status can be generated. It should be noted that the response confirmation number is generated after the response process of the first response mechanism is completed. Different response mechanisms generate different response confirmation numbers, and the differences can be reflected in the encoding method of the response confirmation number, etc.

[0069] The first checksum generation strategy may be to generate a data packet checksum value based on a checksum algorithm with fewer calculation steps, such as a CRC-8 algorithm or a Fletcher checksum algorithm.

[0070] S204: When the future network delay is less than the first delay threshold, or when the future transmission rate is greater than or equal to the first rate threshold, the data format of the data packet sequence number is determined to be a second sequence number format, the generation strategy of the response confirmation number is determined to be a second response generation strategy, and the generation strategy of the data packet check value is determined to be a second check generation strategy; the second sequence number format has a timestamp, and the second response generation strategy includes generating a response confirmation number based on a second response mechanism.

[0071] The future network delay being less than the first delay threshold and the future transmission rate being greater than or equal to the first rate threshold may indicate that the future network condition is relatively good. Therefore, a second sequence number format with a timestamp may be used to assign a data packet sequence number to the original data packet to improve the accuracy of the peer device 200 in sorting the data packets.

[0072] The second response generation strategy is established based on the second response mechanism, and the second response mechanism is used to limit the response timeout and the number of data packet retransmissions. Furthermore, the response confirmation number is generated after the response process of the second response mechanism is completed. The response timeout corresponding to the first response mechanism is less than the response timeout corresponding to the second response mechanism, and the number of data packet retransmissions corresponding to the first response mechanism is greater than the number of data packet retransmissions corresponding to the second response mechanism. In this way, different response confirmation number generation strategies can be selected based on differences in network environments.

[0073] The second checksum generation strategy can be to generate a data packet check value based on a checksum algorithm with more calculation steps. The specific calculation steps can be more than the calculation steps of the first checksum generation strategy, such as the CRC-32 algorithm or the SHA-256 hash algorithm, to enhance the error detection capability of the peer device 200.

[0074] Furthermore, step S200 may also include the following steps S205-S207.

[0075] S205: Determine whether there is a security threat event in the target network using a preset algorithm;

[0076] Among them, security threat events such as DDoS attacks or data injections can be analyzed through deep learning algorithms to discover potential security threats. The analysis of network traffic characteristics will be described in detail below and will not be repeated here.

[0077] If there is a security threat event in the target network, using a more complex second sequence number format with a timestamp to assign a packet sequence number to the original data packet can improve the security of data packet transmission.

[0078] S206: When there is a security threat event in the target network, the data format of the data packet sequence number is determined to be the second sequence number format, the generation strategy of the response confirmation number is determined to be the third response generation strategy, and the data format of the security metadata is determined to be the first security metadata format; the third response generation strategy includes generating a response confirmation number based on a third response mechanism, and the third response mechanism has an encryption confirmation step.

[0079] The third response generation strategy is established based on the third response mechanism, and the third response mechanism is used to limit the specific encryption steps in the response process. In this way, a response confirmation number that conforms to the network status can be generated. The response confirmation number is generated after the response process of the third response mechanism is completed. In this way, the security of data packet transmission can be improved.

[0080] The first security meta-format includes, for example, an encryption key identifier, an identity verification tag, and access control information, etc., to ensure that the data packet can only be decrypted and read by an authorized party.

[0081] S207: When there is no security threat event in the target network, determine that the data format of the data packet sequence number is the first sequence number format, determine that the generation strategy of the response confirmation number is the fourth response generation strategy, and determine that the data format of the security metadata is the second security metadata format.

[0082] Among them, the fourth response generation strategy includes generating a response confirmation number based on a fourth response mechanism, and the fourth response mechanism does not have an encryption confirmation step; the length of the security metadata corresponding to the second security meta-format is less than the length of the security metadata corresponding to the first security meta-format.

[0083] If there is no security threat event in the target network, then using a simpler first sequence number format without a timestamp to assign a data packet sequence number to the original data packet can increase the speed of data packet transmission.

[0084] The fourth response generation strategy is established based on the fourth response mechanism, and the fourth response mechanism is used to limit the specific encryption steps in the response process. In this way, a response confirmation number that conforms to the network status can be generated. The response confirmation number is generated after the response process based on the fourth response mechanism is completed. In this way, the speed of data packet transmission can be improved.

[0085] The length of the security metadata corresponding to the second security meta-format may be smaller than the length of the security metadata corresponding to the first security meta-format, so that the speed of data packet transmission may be increased.

[0086] It is worth noting that steps S205-S207 can be performed after steps S201-S204 to achieve real-time update of the target encapsulation strategy. It is understandable that based on the real-time network status, the first response mechanism, the second response mechanism, the third response mechanism and the fourth response mechanism can be used alone or in combination to generate a combined confirmation number so that the confirmation number conforms to the network status.

[0087] It is worth noting that steps S206-S207 can also be performed by an AI decision model. Moreover, steps S206-S207 are only exemplary representations of the decision results of the AI ​​decision model. In actual application, the AI ​​decision model can select the strategy with the maximum expected benefit as output to maintain network performance and reliability.

[0088] Exemplarily, based on the processing of the original data by the data encapsulation module, TCP-related information can be embedded in the UDP packet, and the traffic in the network communication process can be optimized and the transmission rate can be adjusted through AI decision-making. According to changes in the network status, the data transmission can be continuously adjusted. Finally, based on the security threat identification and defense module, the data traffic in the network process is analyzed, and the information is fed back to the AI ​​decision-making module again. The AI ​​decision-making module collects corresponding information and further optimizes encapsulation strategies, traffic control and other strategies to improve the security and stability of the entire system and the security protection capabilities of network communications.

[0089] Figure 4 A schematic diagram of the process of encapsulating data packets provided in an embodiment of the present application.

[0090] Furthermore, the following steps S501-S504 may be included before step S300.

[0091] S501: Allocate a unique data packet sequence number to an original data packet, wherein the data packet sequence number complies with a first sequence number format or a second sequence number format.

[0092] The embodiment of the present application can introduce a TCP-like sequence number mechanism to assign a unique protective gear package sequence number to each original data packet to be sent to ensure that the receiving end (opposite device 200) can reassemble the data stream in order. Since the first sequence number format and the second sequence number format are determined based on a prediction algorithm, after the data packet sequence number is assigned, the uniqueness of the sequence number can be ensured under multiple concurrent connections, and retransmission events caused by sequence number conflicts can be reduced.

[0093] S502: Establishing a simulated response system, and sending the original data packet carrying the data packet sequence number to the simulated response system based on the first response mechanism, the second response mechanism, the third response mechanism or the fourth response mechanism.

[0094] Among them, the simulated response system is determined based on the target communication protocol. When the target communication protocol is the TCP protocol, the simulated response system is a response system that simulates the response steps of the TCP protocol to simulate the response process between the client 100 (user device 300) and the peer device 200 when the data packet to be transmitted is sent to the peer device 200.

[0095] The step of sending the original data packet carrying the data packet sequence number to the analog answering system is the step of establishing a response with the analog answering system.

[0096] S503: after receiving the confirmation frame of the simulated answering system, generate an answer confirmation number based on the first answer generation strategy, and / or the second answer generation strategy, and / or the third answer generation strategy, and / or the fourth answer generation strategy.

[0097] It can be understood that the generation strategy of the response confirmation number adopted in step S503 corresponds to the response mechanism in step S502.

[0098] In some implementations, the embodiments of the present application can automatically trigger a retransmission step when a confirmation frame from the simulated response system is not received within a preset time.

[0099] S504: Calculate a data packet check value of the original data packet based on the first check generation strategy or the second check generation strategy.

[0100] It is understandable that the generation strategy of the packet checksum is different, and the specific calculation steps are also different. For example, the steps of calculating the Fletcher checksum may be: initialize two 16-bit accumulators, then traverse all bytes in the packet, accumulate them into the first accumulator, and accumulate the accumulator value into the second accumulator. Perform a modulo operation on the values ​​of each accumulator to obtain the final packet checksum.

[0101] It can be understood that calculating the data packet check value can ensure that the data packet to be transmitted will not be changed during the transmission process.

[0102] It is worth noting that in step S501, whether the data packet sequence number specifically conforms to the first sequence number format or the second sequence number format is determined by steps S201-S207. Correspondingly, how to select the response mechanism in step S502, how to select the generation strategy in steps S503 and S504 can all be determined by steps S201-S207. In some implementations, the embodiments of the present application can also set a default format and a default generation strategy to transmit data packets using the default format and the default generation strategy when the sequence number format and the generation strategy cannot be determined.

[0103] Furthermore, before step S400, the following steps S601-S603 are also included.

[0104] S601: Determine the current size of the sending window. The size of the sending window is used to control the maximum amount of data when sending a data packet to be transmitted to the opposite device 200.

[0105] The size of the send window can also be called the size of the send window, which specifically refers to the maximum amount of data that the sender (client 100) can send continuously without receiving confirmation from the receiver (opposite device 200). Correspondingly, the receive window is the limit of how much data the receiver notifies the sender that it can receive. The size of the send window cannot exceed the size of the receive window to ensure that the amount of data sent does not exceed the processing capacity of the receiver.

[0106] S602: Based on the network status parameters, determine whether the target network is in a congested state.

[0107] In an embodiment of the present application, whether the target network is in a congested state can be determined based on changes in network status parameters within a period of time. For example, an increase in data packet network delay and an increase in real-time packet loss rate can be used as judgment conditions.

[0108] S603: If the target network is in a congested state, the current size of the sending window and the network state parameters are input into a first decision model, and the size of the sending window is adjusted using the first decision model, where the first decision model is established based on a deep Q network.

[0109] The step of adjusting the size of the sending window using the first decision model includes increasing the size of the sending window, decreasing the size of the sending window, or keeping the size of the sending window unchanged. Specifically, the first decision model uses network state parameters to predict the benefits that different sending window size adjustment strategies may bring in the future (such as increased throughput, reduced packet loss rate, etc.). Ultimately, the first decision model can select a strategy with the largest expected benefit as output, that is, the adjusted sending window size.

[0110] In the embodiment of the present application, the expression of the first decision model is:

[0111] Q1'(s_t,a_t)=Q1(s_t,a_t)+x*[r_t+n*max(Q1(s_{t+1},a')-Q1(s_t,a_t))];

[0112] Wherein, s_t represents the network state parameter; a_t represents the action of adjusting the size of the sending window in the st state, including increasing the size of the sending window, reducing the size of the sending window, or keeping the size of the sending window unchanged; Q1'(s_t, a_t) represents the expected cumulative reward of executing action a_t in the st state; r_t represents the immediate reward, that is, the network feedback after executing action a_t (such as the number of successfully transmitted data packets, packet loss, etc.); x represents the learning rate, which determines the influence of new information on the existing Q1 value. The learning rate is between 0 and 1. The larger the value, the easier it is for the first decision model to learn new experience; n represents the discount factor, that is, the importance of future rewards. The discount factor is between 0 and 1. The closer the value of the discount factor is to 1, the more the first decision model attaches importance to long-term rewards; max(Q1(s_{t+1}, a') represents the Q1 value that is expected to bring the maximum reward among all the actions of adjusting the size of the sending window when the network state parameters change.

[0113] The training process of the first decision model may include the following steps S6031-S6033.

[0114] S6031: Initialize Q1 value;

[0115] S6032-a: Get real-time network status parameter s_t;

[0116] S6032-b: Select an action a_t;

[0117] S6032-c: Execute the action and observe the result to obtain the immediate reward r_t and the new network state s_{t+1}.

[0118] S6032-d: Update the value of Q(s_t, a_t) based on the expression of the first decision model.

[0119] S6033: Loop through steps S6032-a, S6032-b, S6032-c and S6032-d until the model converges or reaches a preset number of training times.

[0120] In this way, the first decision model can derive a strategy for how to adjust the sending window size under different network states (corresponding to different network state parameters) to maximize long-term rewards through continuous learning and updating. When facing different network conditions, it can independently decide whether to increase or decrease the sending window, thereby effectively controlling congestion and improving network transmission efficiency and stability. In this way, by dynamically adjusting the size of the sending window, data transmission efficiency can be optimized and the probability of data packet loss and retransmission can be reduced.

[0121] It is understandable that if the target network is not in a congested state, the size of the sending window may not be adjusted.

[0122] Furthermore, the following steps S604-S606 may be included after step S603.

[0123] S604: Determine whether the real-time packet loss rate is greater than a preset packet loss rate threshold.

[0124] Exemplarily, the preset packet loss rate threshold may be 1%, 3% or 5%, which is not specifically limited in the embodiments of the present application.

[0125] S605: If the real-time packet loss rate is greater than a preset packet loss rate threshold, a first decision model is used to determine a target time point for retransmitting the data packet to be transmitted.

[0126] The first decision model can predict the packet loss situation based on the real-time packet loss rate, and then arrange the retransmission task in advance or optimize the retransmission timing.

[0127] S606: When the target time point arrives, retransmit the lost data packet to be transmitted to the opposite device 200.

[0128] When the target time point arrives, the retransmission mechanism will be triggered to resend the lost data packets to be transmitted to the opposite device 200.

[0129] In some implementations, after the data packet is retransmitted, if the peer device 200 still does not confirm, the first decision model can recalculate the target time point for the next retransmission or take other measures, thereby reducing waiting and network burden.

[0130] Furthermore, the following steps S701-S702 may be included before step S400.

[0131] S701: Obtain the network transmission rate in real time, and obtain the maximum rate threshold.

[0132] Among them, the maximum rate threshold can be 100Mbps, which is not specifically limited in the embodiment of the present application.

[0133] S702: Input the network transmission rate and the maximum rate threshold into a second decision model, and use the second decision model to adjust the network transmission rate, where the second decision model is established based on a deep Q network.

[0134] The second decision model can predict the optimal adjustment strategy based on the real-time network transmission rate. The strategy may include adjusting bandwidth allocation, reconfiguring network resources, adjusting traffic scheduling, etc., to optimize the network transmission rate and thus optimize network performance.

[0135] In some implementations, steps S701 - S702 may be performed in parallel with steps S601 - S603 .

[0136] In the embodiment of the present application, step S205 may include the following steps S2051-S5052.

[0137] S2051: Obtain network traffic characteristics, where the network traffic characteristics at least include traffic peak values.

[0138] In some implementations, network traffic characteristics may also include an average value of traffic, a fluctuation range, and a traffic change trend, etc., which is not specifically limited in the embodiments of the present application.

[0139] S2052: Based on the network traffic characteristics, use a preset algorithm to determine whether there is a security threat event in the target network.

[0140] The preset algorithm may be a rule-based detection method, a machine learning model or other data analysis technology. Based on the preset algorithm, the security status of the current network may be determined based on the similarity between known security threat features and network traffic features.

[0141] In some implementations, after step S2052, if there is a security threat event, relevant information of the security threat event can be fed back to the AI ​​decision model so that the AI ​​decision model executes steps S206-S207.

[0142] In some implementations, step S2051 and step S2052 may be performed after steps S701-S702 and steps S601-S603.

[0143] It should be noted that in the embodiments of the present application, the AI ​​decision model, the first decision model and the second decision model can all be constructed based on the following deep Q network training method.

[0144] S801: Define state space.

[0145] Define the state space in the network communication system, including the current network status (such as bandwidth utilization, network latency, real-time packet loss rate, etc.), packet queue length, application requirements (such as data volume, real-time, priority), and security threat level.

[0146] It is understandable that the state spaces of the AI ​​decision model, the first decision model and the second decision model may be different.

[0147] S802: Define action space.

[0148] The action space is the set of decision actions that the model may take, such as choosing different generation strategies, data formats, and adjusting the sending window size.

[0149] S803: Setting a reward function.

[0150] The embodiments of the present application can design a reward function according to the goals and requirements of network communication, for example, giving positive rewards for good performance such as reducing delays, increasing throughput, improving data transmission success rate, and reducing packet loss rate, and negative penalties otherwise.

[0151] S804: Build a deep Q network.

[0152] Specifically, a deep neural network model can be built as an approximator of the Q-value function, where the input layer corresponds to the state space and the output layer corresponds to the Q-value estimate of each action.

[0153] The model iterative training process is as follows:

[0154] S805: Collect data, the data includes instant rewards and new network status, and the new network status corresponds to new network status parameters.

[0155] S806: Experience playback.

[0156] Specifically, the (state, action, reward, new state) quadruple may be stored in the experience replay buffer.

[0157] S807: Network update.

[0158] Specifically, the following steps S8071-S8073 may be included.

[0159] S8071: Randomly extract a preset number of samples from the experience replay buffer as training data.

[0160] S8072: Update the Q value based on the target formula.

[0161] The target formula is: Q(s,a)=r+γa′maxQ(s′,a′).

[0162] Among them, Q(s′,a′) is the target network's estimate of the maximum Q value of all actions a' taken in the new state s'. Q(s,a) refers to the expected total reward that can be obtained after performing action a in state s. s is the current state; a is the action taken in the current state; r is the reward obtained immediately after performing action a; γ is a discount factor with a value range of 0 to 1, which is used to weigh the importance of current rewards and future rewards; s′ is the new state transferred to after performing action a; a′ is the action that can maximize the Q value among all possible actions in the new state s'; maxa′Q(s′,a′) is the maximum Q value of all possible actions in the new state s'.

[0163] S8073: Optimizing the weight parameters of a deep Q-network using gradient descent.

[0164] Then minimize the gap between the predicted Q value and the target Q value to achieve back propagation training.

[0165] In some implementations, the target network may be updated every certain number of iterations.

[0166] S808: Making decisions based on the deep Q network.

[0167] In the actual decision-making process, the current network state can be input into the trained deep Q network to calculate the Q value of all actions. The action with the highest Q value is selected for execution, and the new state and immediate reward generated by this decision are recorded and added to the experience playback buffer to provide data for the next round of iterative training.

[0168] In this way, through the AI ​​decision model, the first decision model and the second decision model with the deep Q network as the core, the encapsulation, traffic shaping and congestion control strategies can be intelligently and dynamically adjusted according to the ever-changing network environment and application requirements to achieve the optimization of network communication performance and security.

[0169] Figure 5 A schematic diagram of the structure of a data packet transmission system provided in an embodiment of the present application.

[0170] like Figure 5 As shown, the embodiment of the present application also provides a data packet transmission system, which may specifically include a data encapsulation module 1001, an AI decision module 1002, a security threat identification and defense module 1003 and a network communication module 1004. Among them, the AI ​​decision module may specifically include an AI decision submodule 1002a, a traffic shaping optimization module 1002b and a congestion control module 1002c. The data encapsulation module 1001 can be used to execute steps S501-S504. The AI ​​decision submodule 1002a can be deployed with an AI decision model to execute steps S201-S207. The traffic shaping optimization module 1002b can be deployed with a second decision model to execute steps S701-S702. The congestion control module 1002c can be deployed with a first decision model to execute steps S601-S605. The security threat identification and defense module 1003 can be used to execute steps S801-S802, and then feedback the information of the security threat event to the AI ​​decision submodule 1002a. The network communication module 1004 is used to execute step S400.

[0171] From the above content, it can be seen that the embodiment of the present application provides a data packet transmission method and system, which can intelligently encapsulate the data packets to be transmitted through the AI ​​algorithm, simulate and implement some characteristics of the TCP protocol, such as sequence number, confirmation response, checksum, etc., to enhance the reliability of data transmission. In addition, the method can realize dynamic strategy selection, specifically using AI technology (such as deep Q learning) to analyze network status and demand in real time, calculate the encapsulation strategy Q value, traffic shaping Q value and congestion control Q value, and select the optimal network communication strategy based on this. Further, the method can also realize network adaptability optimization, specifically, it can dynamically adjust the encapsulation strategy, traffic shaping parameters and congestion control strategy according to real-time network conditions, realize the effective use of network resources, and reduce network congestion and data loss. In addition, the method provided in the embodiment of the present application can also improve the security of network communication through AI decision-making technology, intelligently respond to network attacks and abnormal behaviors, and ensure the security and integrity of data transmission.

[0172] Figure 6 A schematic diagram of the structure of a data packet transmission device provided in an embodiment of the present application.

[0173] like Figure 6 As shown, the embodiment of the present application also provides a data packet transmission device, which is applied to a network communication system, the network communication system at least includes a plurality of clients and peer devices, and the clients and peer devices rely on a target network for data transmission;

[0174] The device includes:

[0175] The acquisition module 2001 is used to acquire an original data packet, where the original data packet is a data packet sent by the client to the peer device;

[0176] The strategy determination module 2002 is used to use a preset algorithm and / or a preset model to determine a target encapsulation strategy based on the network status of the target network using an AI decision model; wherein different encapsulation strategies correspond to different encapsulation parameters, and / or different encapsulation strategies correspond to different encapsulation parameters. The data format is different; the encapsulation parameters include at least a data packet sequence number, a response confirmation number, a data packet check value, and / or security metadata; the generation strategy includes at least a response confirmation number generation strategy, and / or a data packet check value generation strategy;

[0177] The encapsulation module 2003 is used to encapsulate the original data packet into a data packet to be transmitted, wherein the header of the data packet to be transmitted carries a target encapsulation parameter, and the target encapsulation parameter is generated based on the target encapsulation strategy;

[0178] The transmission module 2004 is used to send the data packet to be transmitted to the opposite end device based on the target communication protocol.

[0179] In some implementations, the preset model is a first dynamic network model; the strategy determination module 2002 is specifically used to: obtain network status parameters in real time, the network status parameters at least including bandwidth utilization, real-time packet loss rate and / or network delay; input the network status parameters into the first dynamic network model, and use the first dynamic network model to predict future network delay and / or future transmission rate; when the future network delay is greater than or equal to the first delay threshold, or when the future transmission rate is less than the first rate threshold, determine that the data format of the data packet sequence number is the first sequence number format, determine that the generation strategy of the response confirmation number is the first response generation strategy, and determine that the generation strategy of the data packet check value is the first check generation strategy; the first sequence number format does not carry a timestamp; the first response generation strategy includes a basis A response confirmation number is generated based on a first response mechanism; when the future network delay is less than the first delay threshold, or when the future transmission rate is greater than or equal to the first rate threshold, the data format of the data packet sequence number is determined to be a second sequence number format, the generation strategy of the response confirmation number is determined to be a second response generation strategy, and the generation strategy of the data packet check value is determined to be a second check generation strategy; the second sequence number format carries a timestamp; the second response generation strategy includes generating a response confirmation number based on the second response mechanism, the response timeout period corresponding to the first response mechanism is less than the response timeout period corresponding to the second response mechanism, and the number of data packet retransmissions corresponding to the first response mechanism is greater than the number of data packet retransmissions corresponding to the second response mechanism; the calculation steps of the second check generation strategy are more than the calculation steps of the first check generation strategy.

[0180] In some implementations, the policy determination module 2002 is also used to: use a preset algorithm to determine whether there is a security threat event in the target network; when there is a security threat event in the target network, determine that the data format of the data packet sequence number is the second sequence number format, determine that the generation strategy of the response confirmation number is the third response generation strategy, and determine that the data format of the security metadata is the first security meta-format; the third response generation strategy includes generating a response confirmation number based on a third response mechanism, and the third response mechanism has an encryption confirmation step; when there is no security threat event in the target network, determine that the data format of the data packet sequence number is the first sequence number format, determine that the generation strategy of the response confirmation number is the fourth response generation strategy, and determine that the data format of the security metadata is the second security meta-format; the fourth response generation strategy includes generating a response confirmation number based on a fourth response mechanism, and the fourth response mechanism does not have an encryption confirmation step; the length of the security metadata corresponding to the second security meta-format is less than the length of the security metadata corresponding to the first security meta-format.

[0181] In some implementations, the encapsulation module 2003 is also used to: assign a unique data packet sequence number to the original data packet, wherein the data packet sequence number conforms to the first sequence number format or the second sequence number format; establish a simulated response system, and, based on the first response mechanism, or the second response mechanism, or the third response mechanism, or the fourth response mechanism, send the original data packet carrying the data packet sequence number to the simulated response system; upon receiving a confirmation frame from the simulated response system, generate a response confirmation number based on the first response generation strategy, and / or the second response generation strategy, and / or the third response generation strategy and / or the fourth response generation strategy; and calculate the data packet check value of the original data packet based on the first check generation strategy or the second check generation strategy.

[0182] In some implementations, the policy determination module 2002 is also used to obtain network traffic characteristics, which at least include traffic peaks; based on the network traffic characteristics, a preset algorithm is used to determine whether there is a security threat event in the target network.

[0183] In some implementations, the policy determination module 2002 is also used to determine the current size of the sending window, and the size of the sending window is used to control the maximum amount of data when sending data packets to be transmitted to the peer device; based on the network status parameters, determine whether the target network is in a congested state; if the target network is in a congested state, input the current size of the sending window and the network status parameters into the first decision model, and use the first decision model to adjust the size of the sending window, and the first decision model is established based on the deep Q network.

[0184] In some implementations, the policy determination module 2002 is also used to determine whether the real-time packet loss rate is greater than a preset packet loss rate threshold; if the real-time packet loss rate is greater than the preset packet loss rate threshold, the first decision model is used to determine the target time point for retransmitting the data packet to be transmitted; the transmission module 2004 can also be used to retransmit the lost data packet to be transmitted to the other device when the target time point arrives.

[0185] In some implementations, the expression of the first dynamic network model is: y=w1*x1+w2*x2+…+wn*xn+b;

[0186] Where y represents the future network delay or future transmission rate, x1, x2 and xn represent bandwidth utilization, real-time packet loss rate or network delay; w1, w2 and wn represent weights, and b is the intercept;

[0187] The expression of the first decision model is:

[0188] Q1'(s_t,a_t)=Q1(s_t,a_t)+x*[r_t+n*max(Q1(s_{t+1},a')-Q1(s_t,a_t))];

[0189] Wherein, s_t represents the network state parameters; a_t represents the action of adjusting the size of the sending window in the st state, including increasing the size of the sending window, reducing the size of the sending window, or keeping the size of the sending window unchanged; Q1'(s_t, a_t) represents the expected cumulative return of executing action a_t in the st state; r_t represents the immediate reward; x represents the learning rate; n represents the discount factor; max(Q1(s_{t+1}, a') represents the Q1 value that is expected to bring the maximum return among all the actions of adjusting the size of the sending window when the network state parameters change.

[0190] In some implementations, the policy determination module 2002 is also used to obtain the network transmission rate in real time, and to obtain the maximum rate threshold; the network transmission rate and the maximum rate threshold are input into the second decision model, and the network transmission rate is adjusted using the second decision model, and the second decision model is established based on a deep Q network.

[0191] In a specific implementation, the present invention further provides a computer storage medium, wherein the computer storage medium may store a program, and when the program is executed, the program may include some or all of the steps in each embodiment of the data packet transmission method provided by the present invention. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM).

[0192] It is easy to understand that those skilled in the art can combine, split, reorganize, etc. the embodiments of the present application to obtain other embodiments based on the several embodiments provided in the present application, and these embodiments do not exceed the protection scope of the present application.

[0193] The above specific implementation methods further explain in detail the purpose, technical solutions and beneficial effects of the embodiments of the present application. It should be understood that the above are only specific implementation methods of the embodiments of the present application and are not used to limit the protection scope of the embodiments of the present application. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solutions of the embodiments of the present application should be included in the protection scope of the embodiments of the present application.

Claims

1. A data packet transmission method, characterized in that: The method is applied to a network communication system, which at least includes a plurality of clients and peer devices, and the clients and peer devices rely on a target network for data transmission; The method comprises: Acquire an original data packet, where the original data packet is a data packet sent by the client to the peer device; Utilizing a preset algorithm and / or a preset model, an AI decision model is adopted to determine a target encapsulation strategy based on the network status of the target network; wherein, different encapsulation strategies correspond to different encapsulation parameter generation strategies, and / or, different encapsulation strategies correspond to different encapsulation parameter data formats; the encapsulation parameters include at least a data packet sequence number, a response confirmation number, a data packet check value, and / or security metadata; the generation strategy includes at least a generation strategy for the response confirmation number, and / or, a generation strategy for the data packet check value; Encapsulating the original data packet into a data packet to be transmitted, wherein a header of the data packet to be transmitted carries a target encapsulation parameter, and the target encapsulation parameter is generated based on the target encapsulation strategy; The data packet to be transmitted is sent to the opposite device based on the target communication protocol.

2. The data packet transmission method according to claim 1, characterized in that: The preset model is a first dynamic network model; the step of using a preset algorithm and / or a preset model and adopting an AI decision model to determine a target encapsulation strategy based on the network status of the target network includes: Acquire network status parameters in real time, wherein the network status parameters at least include bandwidth utilization, real-time packet loss rate and / or network delay; Inputting the network state parameters into the first dynamic network model, and using the first dynamic network model to predict future network delay and / or future transmission rate; When the future network delay is greater than or equal to a first delay threshold, or when the future transmission rate is less than a first rate threshold, determining that the data format of the data packet sequence number is a first sequence number format, determining that the generation strategy of the response confirmation number is a first response generation strategy, and determining that the generation strategy of the data packet check value is a first check generation strategy; the first sequence number format does not carry a timestamp; the first response generation strategy includes generating the response confirmation number based on a first response mechanism; When the future network delay is less than the first delay threshold, or when the future transmission rate is greater than or equal to the first rate threshold, determining that the data format of the data packet sequence number is a second sequence number format, determining that the generation strategy of the response confirmation number is a second response generation strategy, and determining that the generation strategy of the data packet check value is a second check generation strategy; the second sequence number format carries the timestamp; the second response generation strategy includes generating the response confirmation number based on a second response mechanism; The response timeout corresponding to the first response mechanism is smaller than the response timeout corresponding to the second response mechanism, the number of data packet retransmissions corresponding to the first response mechanism is larger than the number of data packet retransmissions corresponding to the second response mechanism; the second verification generation strategy has more calculation steps than the first verification generation strategy.

3. The data packet transmission method according to claim 2, characterized in that: The step of using a preset algorithm and / or a preset model to determine a target encapsulation strategy based on the network status of the target network using an AI decision model also includes: Determine whether there is a security threat event in the target network by using the preset algorithm; When there is a security threat event in the target network, determining that the data format of the data packet sequence number is the second sequence number format, determining that the generation strategy of the response confirmation number is the third response generation strategy, and determining that the data format of the security metadata is the first security metadata format; the third response generation strategy includes generating the response confirmation number based on a third response mechanism, and the third response mechanism has an encryption confirmation step; When the security threat event does not exist in the target network, the data format of the data packet sequence number is determined to be the first sequence number format, the generation strategy of the response confirmation number is determined to be the fourth response generation strategy, and the data format of the security metadata is determined to be the second security meta-format; the fourth response generation strategy includes generating the response confirmation number based on a fourth response mechanism, and the fourth response mechanism does not have the encryption confirmation step; the length of the security metadata corresponding to the second security meta-format is less than the length of the security metadata corresponding to the first security meta-format.

4. The data packet transmission method according to claim 3, characterized in that: Before the step of encapsulating the original data packet into a data packet to be transmitted, the method further includes: Assigning a unique data packet sequence number to the original data packet, wherein the data packet sequence number conforms to the first sequence number format or the second sequence number format; Establishing a simulated response system, and, based on the first response mechanism, the second response mechanism, the third response mechanism, or the fourth response mechanism, sending the original data packet carrying the data packet sequence number to the simulated response system; After receiving the confirmation frame of the simulated answering system, generating the answering confirmation number based on the first answering generation strategy, and / or the second answering generation strategy, and / or the third answering generation strategy and / or the fourth answering generation strategy; The data packet check value of the original data packet is calculated based on the first check generation strategy or the second check generation strategy.

5. The data packet transmission method according to claim 3, characterized in that: The using the preset algorithm to determine whether the target network has the security threat event includes: Acquire network traffic characteristics, wherein the network traffic characteristics at least include traffic peak values; Based on the network traffic characteristics, the preset algorithm is used to determine whether the target network has the security threat event.

6. The data packet transmission method according to claim 2, characterized in that: Before the step of sending the data packet to be transmitted to the opposite end device based on the target communication protocol, the method further includes: Determine a current size of a sending window, wherein the size of the sending window is used to control a maximum amount of data when sending the data packet to be transmitted to the opposite end device; Based on the network status parameter, determining whether the target network is in a congested state; If the target network is in a congested state, the current size of the sending window and the network state parameters are input into a first decision model, and the size of the sending window is adjusted using the first decision model, where the first decision model is established based on a deep Q network.

7. The data packet transmission method according to claim 6, characterized in that: After the step of adjusting the size of the sending window by using the first decision model, the method further includes: Determine whether the real-time packet loss rate is greater than a preset packet loss rate threshold; If the real-time packet loss rate is greater than the preset packet loss rate threshold, using the first decision model to determine a target time point for retransmitting the data packet to be transmitted; When the target time point arrives, the lost data packet to be transmitted is retransmitted to the opposite device.

8. The data packet transmission method according to claim 7, characterized in that: The expression of the first dynamic network model is: y=w1*x1+w2*x2+…+wn*xn+b; Wherein, y represents the future network delay or the future transmission rate, x1, x2 and xn represent the bandwidth utilization, the real-time packet loss rate or the network delay; w1, w2 and wn represent weights, and b is the intercept; The expression of the first decision model is: Q1'(s_t,a_t)=Q1(s_t,a_t)+x*[r_t+n*max(Q1(s_{t+1},a')-Q1(s_t,a_t))]; Wherein, s_t represents the network state parameter; a_t represents the action of adjusting the size of the sending window in the st state, including increasing the size of the sending window, reducing the size of the sending window, or keeping the size of the sending window unchanged; Q1'(s_t, a_t) represents the expected cumulative reward of executing action a_t in the st state; r_t represents the immediate reward; x represents the learning rate; n represents the discount factor; max(Q1(s_{t+1}, a') represents the Q1 value that is expected to bring the maximum reward among all the actions of adjusting the size of the sending window when the network state parameters change.

9. The data packet transmission method according to claim 1, characterized in that: Before the step of sending the data packet to be transmitted to the opposite end device based on the target communication protocol, the method further includes: Obtain network transmission rate in real time, and obtain the maximum rate threshold; The network transmission rate and the maximum rate threshold are input into a second decision model, and the network transmission rate is adjusted using the second decision model, where the second decision model is established based on a deep Q network.

10. A data packet transmission device, characterized in that: The device is applied to a network communication system, which at least includes a plurality of clients and peer devices, and the clients and peer devices rely on a target network for data transmission; The device comprises: An acquisition module, used for acquiring an original data packet, wherein the original data packet is a data packet sent by the client to the opposite device; A policy determination module, for determining a target encapsulation policy based on the network status of the target network using a preset algorithm and / or a preset model and an AI decision model; wherein different encapsulation policies correspond to different encapsulation parameters, and / or different encapsulation policies correspond to different encapsulation parameters, and the data formats are different; the encapsulation parameters include at least a data packet sequence number, a response confirmation number, a data packet check value, and / or security metadata; the generation policy includes at least a generation policy for the response confirmation number and / or a generation policy for the data packet check value; An encapsulation module, used for encapsulating the original data packet into a data packet to be transmitted, wherein the header of the data packet to be transmitted carries a target encapsulation parameter, and the target encapsulation parameter is generated based on the target encapsulation strategy; The transmission module is used to send the data packet to be transmitted to the opposite device based on the target communication protocol.