Network acceleration method and device and related product
By performing dual-link encapsulation of data packets using User Datagram Protocol (UDP) and Transmission Control Protocol (TCP) on the accelerator client, the problems of data packet loss and increased latency in single-network acceleration are solved, achieving efficient and low-latency data packet transmission and improving user experience.
Patent Information
- Application Number
- CN202410504385.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-24
- Publication Date
- 2025-10-24
AI Technical Summary
In a single network environment, using UDP link acceleration may result in packet loss due to QoS limitations, while using TCP link acceleration may result in increased latency due to retransmission mechanisms, thus affecting user experience.
A dual-link mechanism using User Datagram Protocol (UDP) and Transmission Control Protocol (TCP) is employed to encapsulate data packets and transmit them through different links. This ensures that data packets are not lost when intercepted by QoS policies and reduces latency through the TCP retransmission mechanism.
It effectively avoids data packet loss, reduces latency, improves user experience, and ensures efficient transmission of data packets under different protocol types.
Smart Images

Figure CN120834997A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, in particular to a network acceleration method and device and related products. BACKGROUND
[0002] At present, when a user uses an application with high latency requirement (such as a game, audio and video call, etc.), the user may experience lag during the use of the terminal, which affects the user experience. Therefore, during the use of the application, the data traffic during the use of the application needs to be accelerated to reduce network latency, thereby reducing lag and improving user experience.
[0003] Single network refers to only one network on a terminal, such as only one of wifi network, wired network, and cellular network. When accelerating the single network, the acceleration is generally performed through an acceleration link of a certain acceleration server, such as using a link with a protocol type of UDP (User Datagram Protocol) or a link with a protocol type of TCP (Transmission Control Protocol) for communication to achieve the purpose of acceleration.
[0004] However, when the single network is accelerated through the UDP link, the data packets sent by the application through the UDP link may be lost due to the QoS (Quality of Service) restriction strategy of the operator, which affects the user experience; when the single network is accelerated through the TCP link, the data transmission efficiency may be low due to the TCP retransmission mechanism, which increases the latency and affects the user experience. SUMMARY
[0005] The embodiments of the present application provide a network acceleration method, device and related products, which are aimed at solving the problem of affecting user experience caused by using a link with a fixed protocol type to transmit data.
[0006] The first aspect of the present application provides a network acceleration method, which is applied to an accelerator client and includes the following steps:
[0007] Obtaining a data packet sent by an application client; the protocol type of the data packet is UDP (User Datagram Protocol) or TCP (Transmission Control Protocol);
[0008] Performing encapsulation processing on the data packet by using UDP and TCP respectively to obtain a first encapsulation packet corresponding to UDP and a second encapsulation packet corresponding to TCP;
[0009] The first encapsulation packet is sent to the accelerator server through a first link corresponding to a user datagram protocol, and the second encapsulation packet is sent to the accelerator server through a second link corresponding to a transmission control protocol; wherein the accelerator server is configured to analyze and process the received first encapsulation packet and / or second encapsulation packet, and send the data packet obtained by the analysis to the application server.
[0010] The second aspect of the present application provides a network acceleration method, applied to an accelerator server, comprising:
[0011] The first encapsulation packet is sent to the accelerator server through a first link corresponding to a user datagram protocol, and the second encapsulation packet is sent to the accelerator server through a second link corresponding to a transmission control protocol; wherein the accelerator server is configured to analyze and process the received first encapsulation packet and / or second encapsulation packet, and send the data packet obtained by the analysis to the application server.
[0012] The first encapsulation packet is sent to the accelerator server through a first link corresponding to a user datagram protocol, and the second encapsulation packet is sent to the accelerator server through a second link corresponding to a transmission control protocol; wherein the accelerator server is configured to analyze and process the received first encapsulation packet and / or second encapsulation packet, and send the data packet obtained by the analysis to the application server.
[0013] The first encapsulation packet is sent to the accelerator server through a first link corresponding to a user datagram protocol, and the second encapsulation packet is sent to the accelerator server through a second link corresponding to a transmission control protocol; wherein the accelerator server is configured to analyze and process the received first encapsulation packet and / or second encapsulation packet, and send the data packet obtained by the analysis to the application server.
[0014] The third aspect of the present application provides a network acceleration device, which is applied to an accelerator client, comprising:
[0015] The first acquisition module is configured to acquire a data packet sent by an application client; the protocol type of the data packet is a user datagram protocol or a transmission control protocol;
[0016] The encapsulation module is configured to encapsulate the data packet by using the user datagram protocol and the transmission control protocol respectively, to obtain a first encapsulation packet corresponding to the user datagram protocol and a second encapsulation packet corresponding to the transmission control protocol;
[0017] The first sending module is configured to send the first encapsulation packet to the accelerator server through a first link corresponding to a user datagram protocol, and send the second encapsulation packet to the accelerator server through a second link corresponding to a transmission control protocol; wherein the accelerator server is configured to analyze and process the received first encapsulation packet and / or second encapsulation packet, and send the data packet obtained by the analysis to the application server.
[0018] The fourth aspect of the present application provides a network acceleration device, which is applied to an accelerator server, comprising:
[0019] The second obtaining module is configured to receive a first encapsulation packet sent by an accelerator client through a first link corresponding to a user datagram protocol, and / or receive a second encapsulation packet sent by the accelerator client through a second link corresponding to a transmission control protocol; the first encapsulation packet is obtained by encapsulating a data packet using the user datagram protocol, and the second encapsulation packet is obtained by encapsulating the data packet using the transmission control protocol; the data packet is sent by an application client to the accelerator client; and the protocol type of the data packet is the user datagram protocol or the transmission control protocol;
[0020] The parsing module is configured to parse the received first encapsulation packet and / or the second encapsulation packet to obtain the data packet.
[0021] The second sending module is configured to send the data packet to an application server.
[0022] The fifth aspect of the present application provides a device, which comprises a processor and a memory:
[0023] The memory is configured to store program code and transmit the program code to the processor.
[0024] The processor is configured to execute the steps of the network acceleration method provided in the first aspect or execute the steps of the network acceleration method provided in the second aspect according to instructions in the program code.
[0025] The sixth aspect of the present application provides a computer readable storage medium, which is configured to store program code, and the program code is configured to execute the steps of the network acceleration method provided in the first aspect or execute the steps of the network acceleration method provided in the second aspect.
[0026] The seventh aspect of the present application provides a computer program product, which comprises a computer program or instructions, and the computer program or instructions are executed to implement the steps of the network acceleration method provided in the first aspect or execute the steps of the network acceleration method provided in the second aspect.
[0027] From the above technical solutions, it can be seen that the embodiments of the present application have the following advantages:
[0028] In the technical solution of the application, the data packets sent by the application client are encapsulated by using the user datagram protocol and the transmission control protocol respectively to obtain a first encapsulated packet corresponding to the user datagram protocol and a second encapsulated packet corresponding to the transmission control protocol, wherein the protocol type of the data packet is the user datagram protocol or the transmission control protocol, then the first encapsulated packet is sent to the accelerator server through a first link corresponding to the user datagram protocol, and the second encapsulated packet is sent to the accelerator server through a second link corresponding to the transmission control protocol; wherein the accelerator server is used for analyzing and processing the received first encapsulated packet and / or second encapsulated packet, and sending the analyzed data packet to the application server.
[0029] In the application embodiment, when the accelerator client sends data packets to the accelerator server, the dual-link mechanism of the user datagram protocol and the transmission control protocol is adopted, when the data type of the data packet is the user datagram protocol, it can be ensured that the data packet can be sent to the accelerator server through the transmission control protocol when the data packet is intercepted by the QoS policy, avoiding data packet loss and improving user experience; at the same time, when the protocol type of the data packet is the transmission control protocol, the data packet is transmitted to the accelerator server through the user datagram protocol with low latency, avoiding the problem of high latency caused by the retransmission mechanism of the transmission control protocol, reducing the latency and improving the user experience. BRIEF DESCRIPTION OF DRAWINGS
[0030] Figure 1 A scene diagram of a network acceleration method provided by the application embodiment is shown in the figure.
[0031] Figure 2 A flowchart of a network acceleration method provided by the application embodiment is shown in the figure.
[0032] Figure 3a A diagram of an encapsulated packet provided by the application embodiment is shown in the figure.
[0033] Figure 3b Another diagram of an encapsulated packet provided by the application embodiment is shown in the figure.
[0034] Figure 4 Another diagram of an encapsulated packet provided by the application embodiment is shown in the figure.
[0035] Figure 5 Another flowchart of a network acceleration method provided by the application embodiment is shown in the figure.
[0036] Figure 6 A diagram of a network acceleration method provided by the application embodiment is shown in the figure.
[0037] Figure 7 A structure diagram of a network acceleration device provided by the application embodiment is shown in the figure.
[0038] Figure 8 Another structural schematic diagram of a network acceleration device provided by an embodiment of the present application is provided.
[0039] Figure 9 A structural schematic diagram of a server in an embodiment of the present application is provided.
[0040] Figure 10 A structural schematic diagram of a terminal device in an embodiment of the present application is provided. DETAILED DESCRIPTION
[0041] Currently, when a user is using a terminal, a user experience may be affected by lag when the user uses an application with high latency requirements (such as a game, audio and video calls, and the like). Therefore, during use of an application, data traffic during use of the application needs to be accelerated to reduce network latency, thereby reducing lag and improving the user experience.
[0042] In related technologies, dual-channel technology or single-channel acceleration link technology has been applied to reduce the latency of an application to achieve the function of network acceleration. The dual-channel or multi-channel acceleration scheme in related technologies is usually accelerated through dual-channel or multi-channel, that is, WiFi+mobile network or wired+WiFi network, which requires multiple networks to be simultaneously supported. The acceleration scheme for a single channel in related technologies is usually accelerated through a certain server acceleration link, and is also single-channel transmission, which relies on an acceleration server and a dedicated line for acceleration, has a high requirement for the quality of the dedicated line, and also increases the cost of network acceleration.
[0043] However, when a single network is accelerated through a UDP link, the application may be affected by the QoS (Quality of Service) restriction strategy of an operator, thereby causing the data packets sent by the application through the UDP link to be lost and affecting the user experience. When a single network is accelerated through a TCP link, the data transmission efficiency may be low due to the TCP retransmission mechanism, thereby increasing the latency and affecting the user experience.
[0044] As an example, when the terminal device only supports WiFi network for communication, the dual-channel or multi-channel acceleration scheme cannot be implemented, and needs to be accelerated through the acceleration link of the acceleration server, such as a UDP link or a TCP link. If the QoS restriction policy of the operator is that UDP data packets with network resource occupation exceeding 100 bandwidth need to be discarded, when the UDP link is used for data transmission, the UDP data packet may be discarded due to the QoS restriction policy, so that the acceleration server cannot receive the UDP data packet, data loss occurs, and user experience is affected. If the TCP link is used for data transmission, since TCP uses a retransmission mechanism, that is, when the TCP sending end sends a data packet, it waits for an acknowledgement (ACK) reply from the receiving end. If no acknowledgement is received within a certain time, the sending end considers that the data packet has been lost or damaged, and triggers the retransmission mechanism. The retransmission mechanism may have a certain impact on applications with high latency requirements, affecting user experience.
[0045] In view of the above problems, a network acceleration method, device and related product are provided in the present application. The method comprises: encapsulating data packets sent by an application client by using a user datagram protocol and a transmission control protocol respectively to obtain a first encapsulated packet corresponding to the user datagram protocol and a second encapsulated packet corresponding to the transmission control protocol, wherein the protocol type of the data packet is the user datagram protocol or the transmission control protocol, then sending the first encapsulated packet to an accelerator server through a first link corresponding to the user datagram protocol, and sending the second encapsulated packet to the accelerator server through a second link corresponding to the transmission control protocol; wherein the accelerator server is used to analyze and process the received first encapsulated packet and / or second encapsulated packet, and send the data packet obtained by analysis to an application server.
[0046] In this way, when the accelerator client sends data packets to the accelerator server, the dual-link mechanism of the user datagram protocol and the transmission control protocol is adopted. When the data type of the data packet is the user datagram protocol, it can be ensured that the data packet can be sent to the accelerator server through the transmission control protocol when it is intercepted by the QoS policy, avoiding data packet loss and improving user experience. At the same time, when the protocol type of the data packet is the transmission control protocol, the data packet is transmitted to the accelerator server with low latency through the user datagram protocol, avoiding the problem of high latency caused by the retransmission mechanism of the transmission control protocol, reducing latency and improving user experience.
[0047] First, some terms that may be involved in the embodiments of the present application are explained.
[0048] Single network: refers to only a single network channel on the terminal, such as only WiFi network, only wired network, only cellular network, etc.
[0049] Cellular network: also known as mobile network, refers to the 2G / 3G / 4G / 5G or subsequent higher iteration version of data transmission network constructed by communication base station provided by the operator.
[0050] APP(Application, application): application installed on mobile phone or computer terminal or embedded in other application programs.
[0051] MTU(Maximum Transmission Unit, maximum transmission unit): it is a concept of data link layer, which refers to the maximum byte length of data frame allowed to be forwarded at one time on the link layer during data communication.
[0052] MSS(Maximum Segment Size, maximum packet segment length): refers to a parameter in TCP protocol in network communication, which is used to determine the maximum size of each TCP segment.
[0053] UDP(User Datagram Protocol, User Datagram Protocol): a simple datagram-oriented transport layer protocol. UDP does not provide reliability, it just sends the datagram from the application layer to the IP layer, but it cannot guarantee that they can reach the destination. Because UDP does not need to establish a connection between the client and the server before transmitting the datagram, and there is no timeout retransmission mechanism, the transmission speed is very fast.
[0054] TCP(Transmission Control Protocol, Transmission Control Protocol): a connection-oriented, reliable, byte-stream-based transport layer communication protocol. In the simplified computer network OSI model, it completes the functions specified by the fourth layer of the transport layer, and the User Datagram Protocol (UDP) is another important transport protocol in the same layer. In the Internet Protocol family (TCP / IP protocol family), TCP protocol serves as the transport layer to provide reliable, connection-oriented, point-to-point, full-duplex data stream transmission services for users.
[0055] Among them, TCP uses three times of handshaking to establish connection and four times of waving to release connection for communication. As an example, the three times of handshaking process is as follows: first step: the client sends a message segment with SYN flag and random sequence number; second step: the server receives it and responds with a SYN+ACK flag, and sends a new random sequence number to the client; third step: the client receives the SYN+ACK message segment sent by the server, and then sends an acknowledgment message segment to the server, with the ACK flag set.
[0056] SYN (synchronize): used to identify a TCP connection setup request, usually initiated by a client, indicating that the client wants to initiate a connection request to the server.
[0057] ACK (acknowledge): used to identify a TCP packet acknowledgement, indicating that the packet has been successfully transmitted.
[0058] IP (Internet Protocol): is the network layer protocol in the TCP / IP system, and is the core protocol of the TCP / IP protocol family, used to transmit datagrams between source and destination hosts. All TCP, UDP, ICMP and IGMP data are transmitted in IP data encapsulation format. IP protocol provides a connectionless, unreliable, best-effort packet transmission service. The main functions of the IP protocol include: packet routing, segmentation and reassembly, and data transmission, etc.
[0059] QoS (Quality of Service): is a security mechanism of the network, and is a technology used to solve network delay and congestion problems. When the network is overloaded or congested, QoS can ensure that important traffic is not delayed or discarded, while ensuring efficient operation of the network. QoS provides management of network resources by controlling various parameters at different levels, so that various types of traffic can be better transmitted in the network. The implementation mechanisms of QoS include classification, marking, queuing and scheduling.
[0060] VPN (Virtual Private Network) is a technology that can establish an encrypted channel on a public network, and through this technology, remote users can access company internal network resources to achieve secure connection and data transmission. In some possible implementations, the accelerator client of the embodiments of the present application can be a VPN-based accelerator client, and the accelerator server can be a VPN-based accelerator server, but is not limited thereto, and is not specifically limited herein.
[0061] Figure 1 An exemplary scenario architecture diagram of a network acceleration method is shown. The diagram includes an application server 101, an accelerator server 102, and various forms of terminal devices 103, which are deployed with an application client 1031 and an accelerator client 1032. Figure 1The application server 101 and the accelerator server 102 shown can be a standalone physical server, or a server cluster or distributed system composed of multiple physical servers. In addition, the server can also be a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs, and basic cloud computing services such as big data and artificial intelligence platforms. Figure 1 The terminal device shown is a device with a display screen, including but not limited to a mobile phone, a tablet, a computer, a computer, a smart voice interaction device, a vehicle-mounted terminal, etc., but is not limited thereto. The terminal device and the server can be directly or indirectly connected through wired or wireless communication, which is not limited in the present application.
[0062] The application client 1031 deployed on the terminal device 103 sends the data packet that needs to be sent to the application server 101 to the accelerator client 1032 deployed on the terminal device 103. The protocol type of the data packet is user datagram protocol or transmission control protocol.
[0063] The accelerator client 1032 obtains the data packet sent by the application client 1031.
[0064] The accelerator client 1032 encapsulates the data packet using the user datagram protocol and the transmission control protocol respectively to obtain a first encapsulation packet corresponding to the user datagram protocol and a second encapsulation packet corresponding to the transmission control protocol. It should be understood that whether the protocol type of the data packet is the user datagram protocol or the transmission control protocol, the accelerator client 1032 will encapsulate the data packet using the user datagram protocol and the transmission control protocol for subsequent transmission using dual links.
[0065] The accelerator client 1032 sends the first encapsulation packet to the accelerator server 102 through the first link corresponding to the user datagram protocol, and sends the second encapsulation packet to the accelerator server 102 through the second link corresponding to the transmission control protocol. It should be understood that by sending the first encapsulation packet and the second data packet to the accelerator server through the first link and the second link respectively, on the one hand, if the first encapsulation packet transmitted under the user datagram protocol is discarded due to QoS restriction policy, the transmission of the second encapsulation packet through the second link corresponding to the transmission control protocol can be realized to avoid data packet loss; on the other hand, when the second encapsulation packet transmitted under the transmission control protocol causes delay due to the retransmission mechanism, the transmission of the first encapsulation packet through the first link corresponding to the user datagram protocol can reduce the delay.
[0066] The accelerator server 102 parses the received first encapsulation packet and / or second encapsulation packet, and sends the parsed data packet to the application server 101.
[0067] That is, in the embodiment of the application, when the accelerator client sends a data packet to the accelerator server, the dual-link mechanism of the user datagram protocol and the transmission control protocol is adopted. When the data type of the data packet is the user datagram protocol, it can be ensured that the data packet can be sent to the accelerator server through the transmission control protocol when the data packet is intercepted by the QoS policy, avoiding data packet loss and improving user experience. At the same time, when the protocol type of the data packet is the transmission control protocol, the data packet is transmitted to the accelerator server through the user datagram protocol with low latency, avoiding the problem of high latency caused by the retransmission mechanism of the transmission control protocol, reducing latency and improving user experience.
[0068] In the application, the relevant data collection and processing should be strictly in accordance with the requirements of relevant national laws and regulations, and the informed consent or separate consent of the subject of personal information should be obtained, and the subsequent data use and processing behavior should be carried out within the scope of authorization of laws and regulations and the subject of personal information.
[0069] Figure 2 A flowchart of a network acceleration method provided by the embodiment of the application is shown in the figure. Figure 2 As shown in the network acceleration method, the network acceleration method can be applied to an accelerator client, and includes the following steps.
[0070] S201: Obtain a data packet sent by an application client.
[0071] The data packet means data that needs to be sent by the application client to the application server, and the protocol type of the data packet is the user datagram protocol or the transmission control protocol. The application client means an application program installed on a terminal device, which is used for communication with the application server. The application server means a program or software installed on a server, which is used to provide corresponding services for the request of the application client.
[0072] It should be understood that in the related art, the application client generally communicates directly with the application server, but when using an application with high latency requirements (such as games, audio and video calls, etc.), it may appear to be stuck, affecting user experience. Therefore, in the embodiment of the application, the accelerator is used to accelerate the application to avoid sticking and improve user experience.
[0073] It should be noted that the accelerator includes an accelerator client deployed on a terminal device and an accelerator server installed on a server. The function of the accelerator is to receive the data packet of the application client through the accelerator client, send the data packet to the accelerator server, and then send the data packet to the application server through the accelerator server, so as to realize network acceleration and avoid sticking.
[0074] S202: encapsulate the data packet using the user datagram protocol and the transmission control protocol respectively to obtain a first encapsulation packet corresponding to the user datagram protocol and a second encapsulation packet corresponding to the transmission control protocol.
[0075] Encapsulation means that each layer of protocol adds a data header in front of its corresponding data part, which is called encapsulation. These headers (also known as headers) contain the control information required by the layer protocol to ensure that the data packet can be correctly and efficiently transmitted to the destination.
[0076] It should be understood that in the related art, the protocol type of the data packet determines the protocol with which the data packet is transmitted, for example, if the protocol type of the data packet is the user datagram protocol, the data packet will be transmitted through the link corresponding to the user datagram protocol, and if the protocol type of the data packet is the transmission control protocol, the data packet will be transmitted through the link corresponding to the transmission control protocol. However, when using the user datagram protocol for transmission, because of the statelessness, applications with high latency requirements can obtain lower latency, but the user datagram protocol may be affected by the QoS restriction strategy, resulting in data packet loss; when using the transmission control protocol for transmission, although it is not affected by the QoS restriction strategy, because of the existence of the retransmission mechanism of the transmission control protocol, applications with high latency requirements cannot obtain lower latency.
[0077] Therefore, in the embodiments of the present application, when the accelerator client receives the data packet sent by the application client, whether the protocol type of the data packet is the user datagram protocol or the transmission control protocol, the data packet will be encapsulated using the user datagram protocol and the transmission control protocol respectively to obtain a first encapsulation packet corresponding to the user datagram protocol and a second encapsulation packet corresponding to the transmission control protocol, so as to realize dual-link transmission of the data packet, and ensure that the UDP data packet (i.e. the data packet with the protocol type of the user datagram protocol) can be transmitted to the accelerator server, and at the same time ensure that the TCP data packet (i.e. the data packet with the protocol type of the transmission control protocol) can be transmitted to the accelerator server with lower latency.
[0078] S203: send the first encapsulation packet to the accelerator server through the first link corresponding to the user datagram protocol, and send the second encapsulation packet to the accelerator server through the second link corresponding to the transmission control protocol.
[0079] It should be understood that in the embodiments of the present application, the first encapsulation packet and the second encapsulation packet are sent to the accelerator server by using the dual-link mechanism of the user datagram protocol and the transmission control protocol, that is, the data packet is sent to the accelerator server, that is, it is ensured that the UDP data packet can transmit data to the accelerator server to avoid UDP data packet loss; at the same time, it is ensured that the TCP data packet can be transmitted to the accelerator server with low delay to reduce the delay.
[0080] The accelerator server is configured to analyze and process the received first encapsulation packet and / or second encapsulation packet, and send the data packet obtained by analysis to the application server. It should be noted that if only the first encapsulation packet or the second encapsulation packet is received, the first encapsulation packet or the second encapsulation packet is analyzed and processed to obtain the original data packet, and the data packet is sent to the application server; if the first encapsulation packet and the second encapsulation packet are received, the two data packets obtained by analysis need to be de-duplicated to avoid repeated sending of data to the application server.
[0081] In addition, it should be noted that in the implementation process of the embodiments of the present application, the protocol type of the data packet itself will not be changed, for example, the protocol type of the data packet sent by the application client is the transmission control protocol, and the protocol type of the data packet received by the application server is still the transmission control protocol.
[0082] The network acceleration method provided by the embodiments of the present application uses the dual-link mechanism of the user datagram protocol and the transmission control protocol when the accelerator client sends the data packet to the accelerator server, and when the data type of the data packet is the user datagram protocol, it can be ensured that the data packet can be sent to the accelerator server through the transmission control protocol when the data packet is intercepted by the QoS policy, avoiding data packet loss and improving user experience; at the same time, when the protocol type of the data packet is the transmission control protocol, the data packet is transmitted to the accelerator server with low delay through the user datagram protocol, avoiding the problem of high delay caused by the retransmission mechanism of the transmission control protocol, reducing the delay and improving the user experience.
[0083] Based on the network acceleration method provided in the above embodiments, in one possible implementation, step S102 can include:
[0084] A1: Obtain the Internet protocol between the accelerator client and the accelerator server, and the control information of the accelerator client.
[0085] It should be understood that the OSI (Open Systems Interconnection) reference model can be divided into seven layers, from low to high, namely: physical layer, data link layer, network layer, transport layer, session layer, presentation layer and application layer. This model divides various processes required for a communication session into 7 relatively independent functional layers, each layer has different functions, and each layer has different protocols, through layer-by-layer encapsulation and analysis of data, to ensure that data can be accurately and reliably transmitted between different network nodes.
[0086] Therefore, in the data encapsulation process, a data header corresponding to each layer protocol needs to be added to the data part corresponding to the data packet, so that during the transmission of the data packet, it can be correctly and efficiently transmitted to the designated destination. In the embodiments of the present application, the Internet protocol, the transmission protocol (i.e. the user datagram protocol or the transmission control protocol) and the control information of the accelerator client are mainly considered. However, it is not limited thereto, and in other implementation manners, other protocols can also be further considered and encapsulated using other protocols, which are not limited herein.
[0087] A2: encapsulating the data packet using the Internet protocol, the control information and the user datagram protocol to obtain a first encapsulated packet; and encapsulating the data packet using the Internet protocol, the control information and the transmission control protocol to obtain a second encapsulated packet.
[0088] It should be understood that in the embodiments of the present application, the data packet needs to be encapsulated using the Internet protocol, the control information, the user datagram protocol and the transmission control protocol, respectively, in order to be transmitted by the first link and the second link subsequently.
[0089] In order to further illustrate the encapsulation process of the data packet, as an example, the encapsulation process of the data packet is described in combination with the Internet protocol, the control information, the user datagram protocol and the transmission control protocol. Figure 3a When the UDP data packet sent by the application client reaches the accelerator client, the UDP data packet is added with the IP header (i.e. the Internet protocol), the accelerator header (i.e. the control information), and the UDP header or the TCP header.
[0090] Among them, the first encapsulated packet encapsulated with the IP header, the accelerator header and the UDP header is sent to the accelerator server by the UDP mode (i.e. the first link corresponding to the UDP protocol), that is, the IP header and the UDP header are added again during external network transmission, which can maintain the low latency effect of UDP. At the same time, the second encapsulated packet encapsulated with the IP header, the accelerator header and the TCP header is sent to the accelerator server by the TCP mode (i.e. the second link corresponding to the TCP protocol), that is, the IP header and the TCP header are added again during external network transmission, which can avoid the problem of data packet loss caused by QoS restriction strategy.
[0091] In another example, in combination with Figure 3b As shown, the application client can send not only UDP packets, but also TCP packets. It should be noted that if the application has high requirements on latency, UDP packets will account for the majority. When the accelerator client receives a TCP packet, it adds an IP header (i.e., an Internet Protocol), an accelerator header (i.e., control information), and a UDP header or a TCP header to the TCP packet. That is, the IP header and the UDP header are added during external network transmission, and the TCP packet can be sent in the form of UDP, i.e., maintaining the stateless effect and maintaining the original TCP characteristics. At the same time, the second encapsulation packet encapsulating the IP header, the accelerator header, and the TCP header is sent to the accelerator server in the form of TCP (i.e., the second link corresponding to the TCP protocol), i.e., the IP header and the TCP header are added during external network transmission, which can avoid the problem of packet loss caused by QoS restriction strategy.
[0092] In the embodiment of the application, when the accelerator client receives the data packet sent by the application client, whether the protocol type of the data packet is a user datagram protocol or a transmission control protocol, the user datagram protocol and the transmission control protocol are used to encapsulate and process the data packet respectively, to obtain a first encapsulation packet corresponding to the user datagram protocol and a second encapsulation packet corresponding to the transmission control protocol, so as to realize double-link transmission of the data packet, ensure that the UDP packet (i.e., the data packet with the protocol type of the user datagram protocol) can be transmitted to the accelerator server, and ensure that the TCP packet (i.e., the data packet with the protocol type of the transmission control protocol) can be transmitted to the accelerator server with low latency.
[0093] In a possible implementation, the control information can include but is not limited to a user identifier, a connection identifier, a sequence number, a protocol type, a compression type, a data packet type, and a data packet length.
[0094] The user identifier indicates the identifier of the application client, the connection identifier indicates the identifier of the connection between the accelerator client and the accelerator server, the sequence number indicates the sequence number of the data packet, the protocol type indicates the type of encapsulation of the data packet, the compression type indicates the type of compression of the data packet, the data packet type indicates the type of the data packet received by the accelerator client, and the data packet length indicates the length of the data packet.
[0095] As an example, the control information (which can also be referred to as an accelerator header) can be implemented by the following code:
[0096] #pragma pack(1)
[0097] struct AhHead{
[0098] uint64_t user_id; / / user identification
[0099] uint64_t connection_id; / / connection identification
[0100] uint64_t seq; / / sequence number
[0101] uint8_t proto_type; / / protocol type, whether it is TCP or UDP, and whether it is compressed
[0102] uint8_t compress_type; / / compression algorithm used, 0 means not compressed
[0103] uint8_t data_type; / / APP application data packet type
[0104] uint16_t data_len; / / APP application data packet length
[0105] }
[0106] #pragma pack()
[0107] Among them, the role of pack is to identify that this protocol is kept 1 byte alignment, no hidden padding alignment length in the middle.
[0108] user_id refers to user identification, used to identify the application client to the accelerator server, wherein different devices, or different login users can be regarded as different users, which can be used as user identification.
[0109] connection_id is the connection identification, used to identify the connection between the accelerator client and the accelerator server. Among them, the connection identification of different protocol types (UDP+TCP) remains the same, so that the accelerator server can be used to distinguish different connections. In addition, the connection identification of different users needs to be kept different, otherwise it will affect the deduplication and packet returning of the acceleration service server. When the accelerator client receives the connection identification in the packet, it also needs to judge whether it is the identification of the application client to avoid receiving the connection identification of the last connection or receiving the data packet of other users. When encountering data packets with different connection identifications, directly discard them, and re-create the connection between the accelerator client and the accelerator server.
[0110] seq is a sequence number, used to identify the sequence number of each data packet, which is incremented for each received data packet, and the sequence numbers of data packets of different protocol types (UDP+TCP) remain consistent. Among them, for the accelerator server and the accelerator client, the sequence number can be used for deduplication, that is, for data packets with the same sequence number, only the data packet corresponding to the first sequence number is received, and other data packets with the same sequence number that arrive later are discarded, so as to realize the processing of the data packet that arrives first, and avoid the problem of receiving duplicate data packets by the application client and the application server. Among them, the deduplication algorithm can be implemented using bitmap, that is, using a bit to indicate whether the data packet has been received. For example, if the maximum sequence number currently received is 100, whether the sequence number 98 has arrived can be represented by the 2nd bit (100-98) of the bit. If a larger sequence number, such as 103, is received, the bitmap needs to be right-shifted by 3 bits, thereby improving the efficiency of deduplication, which is more efficient than using list or bloom filter.
[0111] proto_type refers to the protocol type, which is used to identify whether the communication protocol type between the accelerator client and the accelerator server is TCP or UDP, and in addition, the protocol type can also be used to identify control packets between the accelerator client and the accelerator server, such as heartbeat packets, authentication packets, version verification packets, etc. That is, the protocol type can be understood as the protocol type used for encapsulating the data packet, such as the user datagram protocol or the transmission control protocol.
[0112] compress_type refers to the compression type, and 0 indicates no compression. This identifier indicates whether the data packet is compressed, because the data packet may be compressed in the packet, and the selection of the compression algorithm can be gzip, deflate, zstandard, etc., which is not specifically limited here.
[0113] data_type is the data packet type, which is used to identify whether the received data packet is UDP or TCP, or other IP type protocols, such as ICMP packets.
[0114] data_len is the data packet length, which is used to identify the length of the data packet, and this field can facilitate the accelerator server to intercept the length of the data packet.
[0115] It should be understood that by using the control information for encapsulation, the accelerator server can accurately and efficiently parse the encapsulated packet, improve the parsing efficiency, and avoid data errors.
[0116] Based on the network acceleration method provided in the above embodiment, when the data amount of the data packet is large, if the IP header, the accelerator header and the protocol header are added in the encapsulation process, the packet length (which can also be referred to as the length of the data packet) of the encapsulated data packet can exceed the maximum length allowed by the MTU (the size of the MTU is usually 1500 bytes), and the data packet needs to be packetized, but the packetization method can cause part of the data packet to be lost, thereby affecting the user experience.
[0117] Therefore, in order to solve the above technical problems, before step S202 is performed, the following steps can also be included:
[0118] B1: determining whether the length of the data packet exceeds a preset length.
[0119] The preset length refers to the maximum length allowed by the data packet, and the preset length can be obtained by the maximum length of the MTU, the length of the IP header, the length of the accelerator header and the length of the UDP header / TCP header. As an example, assuming that the length of the MTU is 1500 bytes, the length of the IP header is 20 bytes, the length of the accelerator header is 50 bytes, the length of the UDP header is 8 bytes, and the length of the TCP header is 20 bytes, the preset length can be 1422 bytes (under the UDP protocol) or 1410 bytes (under the TCP protocol).
[0120] It should be understood that by determining whether the length of the data packet exceeds the preset length, it is determined whether the data packet needs to be compressed, so as to avoid packetization due to the long length of the data packet.
[0121] B2: if the length of the data packet exceeds the preset length, performing compression processing on the data packet to obtain a compressed data packet.
[0122] It should be understood that when the length of the data packet exceeds the preset length, the data packet needs to be compressed to ensure that the data packet will not be packetized. The compression process of the data packet is not limited in the embodiments of the present application, and any compression technology or related technology can be used for compression.
[0123] It should be noted that when the length of the data packet exceeds the preset length, the data packet needs to be compressed / decompressed, that is, the accelerator client or the accelerator server needs to compress the data packet when sending the data packet, and the accelerator client or the accelerator server needs to decompress the compressed data packet when receiving the compressed data packet.
[0124] In a possible implementation, step B2 can include:
[0125] C1: determining a compression ratio according to the length of the data packet and the preset length.
[0126] The compression ratio refers to the ratio between the original data size and the compressed data size, that is, the ratio between the data packet and the compressed data packet.
[0127] It should be understood that in the embodiments of the present application, the selected compression algorithm can take into account the compression / decompression rate and the compression ratio, that is, the compression ratio does not need to be too high, only the packet length of the encapsulation packet (the first encapsulation packet or the second encapsulation packet) needs to be ensured to be less than or equal to the maximum length of the MTU, so that the compression / decompression rate can be kept at a relatively high value.
[0128] C2: compressing the data packet based on the compression ratio to obtain a compressed data packet; wherein the length of the compressed data packet is less than or equal to a preset length.
[0129] That is, in the embodiments of the present application, the compression ratio can be determined by the length of the data packet and the preset length, and the data packet is compressed using the compression ratio, so that the length of the compressed data packet is less than or equal to the preset length, and further so that the length of the encapsulation packet encapsulated based on the compressed data packet does not exceed the maximum length of the MTU. Both the bandwidth consumption and the transmission delay can be reduced to improve the transmission rate, and the length of the encapsulation packet can be ensured to be less than one MTU, so that the influence of packet splitting is avoided and the probability of data packet loss is reduced.
[0130] It should be noted that if the data packet is split into two data sub-packets and the two data sub-packets are sent in two data link layer frames, if one of the frames is lost, the two frames need to be retransmitted, that is, one of the data sub-packets is not successfully transmitted, and both of the data sub-packets need to be retransmitted, which may affect the data transmission efficiency. Therefore, in the embodiments of the present application, the data packet exceeding the preset length is compressed to ensure that the length of the encapsulation packet after encapsulation does not exceed one MTU, to avoid the influence of packet splitting, reduce the probability of data packet loss, and improve the data transmission efficiency.
[0131] Based on steps B1-B2, step S202 can include encapsulating the compressed data packet using the user datagram protocol and the transmission control protocol, respectively. That is, when the length of the data packet is greater than the preset length, the data packet is compressed and the obtained compressed data packet is encapsulated to avoid packet splitting caused by a large amount of data in the data packet and to avoid data packet loss.
[0132] It should be noted that the encapsulation process of the compressed data packet is basically the same as the encapsulation process of the uncompressed data packet. Simply put, the compressed data packet is added with an IP header (that is, an Internet Protocol), an accelerator header (that is, control information), and a UDP header or a TCP header to achieve encapsulation of the compressed data packet. For details, please refer to Figure 4The specific encapsulation process can refer to the compression process of the data packet, which will not be described here.
[0133] In addition, in the TCP protocol, the MSS value also affects the length of the data packet, so when the protocol type of the data packet is TCP, the MSS value of the data packet can also be adjusted.
[0134] As a possible implementation, when the protocol type of the data packet is a transmission control protocol, before step B2 is performed, it can also include:
[0135] D1: determining the maximum message segment length when establishing communication with the application client.
[0136] D2: obtaining the Internet protocol between the accelerator client and the accelerator server, and the control information of the accelerator client.
[0137] D3: adjusting the value of the maximum message segment length to a target value according to the length of the data packet, the preset length, the length of the Internet protocol, the length of the control information, and the length of the data protocol; wherein the data protocol is a transmission control protocol or a user datagram protocol.
[0138] The maximum message segment length is also the MSS, and the target value means that the sum of the value of the maximum message length, the value of the IP header, the value of the accelerator header, and the value of the data protocol does not exceed the preset length, and the target value can be the same as the preset length or less than the preset length, which is not limited here.
[0139] It should be understood that when the application client and the accelerator client establish communication based on TCP, the accelerator client will adjust the value of the MSS in the syn-ack reply to the application client after receiving the syn sent by the application client, so as to adjust the MSS to the target value. Before the accelerator header, the length of the MSS is generally the size of the MTU minus the length of the IP header and the length of the TCP header, so after adding the accelerator header, the value of the MSS needs to be adjusted to the target value, so that the overall packet length does not exceed the size of the MTU, to avoid the problem of data loss caused by packeting and improve the reliability of data transmission.
[0140] It should be noted that for data packets with a length less than or equal to the preset length, i.e., the length of the encapsulated packet after adding the IP header, the accelerator header, and the UDP header / TCP header does not exceed the MTU, the data packet can not be compressed. Because when transmitting a large amount of data, the packet length of the data packet is generally filled to the maximum MTU length, if the data packet does not exceed the preset length, it may not be used to transmit a large amount of data, so the data packet is not compressed at this time, which can ensure smaller performance consumption and avoid the problem of data loss caused by packeting.
[0141] Based on the network acceleration method provided in the above embodiment, for the same data packet, the sequence numbers of data packets of different protocol types (UDP+TCP) remain consistent. Therefore, in some possible implementations, after step S201 is performed, the following steps can also be included in order to avoid repeated transmission of the same data packet:
[0142] E1: Determine the sequence number of the data packet, and obtain the historical sequence numbers corresponding to one or more historical data packets sent by the application client.
[0143] It should be understood that when the accelerator client receives the data packet sent by the application client, the sequence number of the data packet and the historical sequence numbers corresponding to the historical data packets sent by the application client before sending the data packet can be obtained, so as to facilitate subsequent judgment of whether the historical sequence numbers are the same as the sequence number of the current data packet.
[0144] E2: Determine whether one or more historical sequence numbers are the same as the sequence number.
[0145] E3: If there is no historical sequence number that is the same as the sequence number, the data packet is encapsulated and processed by using the user datagram protocol and the transmission control protocol, respectively.
[0146] It should be understood that if there is no historical sequence number that is the same as the sequence number of the data packet in the historical sequence numbers, it can be considered that the data packet has not been processed or received, and the data packet can be further processed to accelerate the network.
[0147] E4: If there is a historical sequence number that is the same as the sequence number, the data packet is discarded.
[0148] It should be understood that if there is a historical sequence number that is the same as the sequence number in the multiple historical sequence numbers, it can be considered that the data packet has been sent and processed before this time, and therefore, the current data packet does not need to be processed again and can be directly discarded without subsequent processing, thereby avoiding the problem of repeated data transmission and improving the reliability of transmission.
[0149] Referring to Figure 5 , the figure is a flow diagram of another network acceleration method provided by the embodiments of the present application.
[0150] In combination with Figure 5 , the network acceleration method provided by the embodiments of the present application can be applied to an accelerator server, and includes the following steps.
[0151] S401: Receive a first encapsulated packet sent by an accelerator client through a first link corresponding to a user datagram protocol, and / or receive a second encapsulated packet sent by an accelerator client through a second link corresponding to a transmission control protocol.
[0152] The first encapsulation packet is obtained by encapsulating the data packet using a user datagram protocol, and the second encapsulation packet is obtained by encapsulating the data packet using a transmission control protocol.
[0153] S402: Analyzing the received first encapsulation packet and / or second encapsulation packet to obtain the data packet.
[0154] S403: Sending the data packet to the application server.
[0155] It should be noted that when the accelerator server receives the data packet sent by the application server, the accelerator server can send the data packet to the accelerator client in the same way as the accelerator client sends the data packet to the accelerator server, that is, after receiving the data packet sent by the application server, the accelerator server encapsulates the data packet sent by the application server using a user datagram protocol and a transmission control protocol respectively to obtain a first encapsulation packet corresponding to the user datagram protocol and a second encapsulation packet corresponding to the transmission control protocol, wherein the protocol type of the data packet is the user datagram protocol or the transmission control protocol, and then the accelerator server sends the first encapsulation packet to the accelerator client through a first link corresponding to the user datagram protocol, and sends the second encapsulation packet to the accelerator client through a second link corresponding to the transmission control protocol; wherein the accelerator client is configured to analyze the received first encapsulation packet and / or second encapsulation packet, and send the analyzed data packet to the application client.
[0156] That is, whether the accelerator client sends the data packet to the accelerator server or the accelerator server sends the data packet to the accelerator client, the dual-link mechanism is used for sending, so that when the data type of the data packet is the user datagram protocol, the data packet can be sent to the accelerator client through the transmission control protocol when the data packet is intercepted by the QoS policy, avoiding data packet loss and improving user experience; at the same time, when the protocol type of the data packet is the transmission control protocol, the data packet is transmitted to the accelerator client through the user datagram protocol with low latency, avoiding the problem of high latency caused by the retransmission mechanism of the transmission control protocol, reducing the latency and improving the user experience.
[0157] It should be noted that the network acceleration method applied to the accelerator server and the network acceleration method applied to the accelerator client can use the same implementation process, and the implementation details of the network acceleration method applied to the accelerator server are the same as those of the network acceleration method applied to the accelerator client. For specific explanation and description, please refer to the embodiments of the network acceleration method applied to the accelerator client. Therefore, the details are not repeated here.
[0158] In combination withFigure 6 As shown in the figure, the figure is a schematic diagram of a network acceleration method provided by an embodiment of the application.
[0159] In combination Figure 6 As shown in the figure, the embodiment of the application can be divided into a client side and a server side. Specifically, the accelerator can be divided into an accelerator client and an accelerator server, and the application can be divided into an application client and an application server.
[0160] The accelerator client is a communication bridge between the application client and the accelerator server. On the one hand, the accelerator client is responsible for receiving or sending a UDP data packet or a TCP data packet to the application client. On the other hand, the accelerator client needs to receive and send a first encapsulation packet and / or a second encapsulation packet to the accelerator server through a UDP link and a TCP link (i.e., double links).
[0161] The accelerator server is a communication bridge between the accelerator client and the application server. On the one hand, the accelerator server is responsible for receiving or sending a first encapsulation packet and / or a second encapsulation packet to the accelerator client through a UDP link and a TCP link. On the other hand, the accelerator server is responsible for receiving or sending a UDP data packet or a TCP data packet to the application server.
[0162] That is, in the embodiment of the application, the UDP link and the TCP link between the accelerator client and the accelerator server exist simultaneously for each data packet. After receiving a UDP data packet or a TCP data packet of the application client, the accelerator client encapsulates the UDP data packet or the TCP data packet, and then sends the first encapsulation packet and the second encapsulation packet simultaneously in the form of a UDP link + a TCP link. The UDP link can maintain a low delay, and the TCP link can prevent data loss caused by QoS restriction strategies.
[0163] Based on the network acceleration method provided in the foregoing embodiment, the application also provides a network acceleration device. The following will be described in combination Figure 7 with the accompanying drawings. Figure 7 The structure of the network acceleration device provided by the embodiment of the application is shown in the figure. As shown in the figure, Figure 7 The network acceleration device 700 shown in the figure is applied to an accelerator client and can include:
[0164] The first acquisition module 701 is configured to acquire a data packet sent by an application client. The protocol type of the data packet is a user datagram protocol or a transmission control protocol.
[0165] The encapsulation module 702 is configured to encapsulate the data packet by using the user datagram protocol and the transmission control protocol respectively to obtain a first encapsulation packet corresponding to the user datagram protocol and a second encapsulation packet corresponding to the transmission control protocol.
[0166] The first sending module 703 is configured to send the first encapsulation packet to the accelerator server through a first link corresponding to a user datagram protocol, and send the second encapsulation packet to the accelerator server through a second link corresponding to a transmission control protocol; the accelerator server is configured to analyze and process the received first encapsulation packet and / or the second encapsulation packet, and send the data packet obtained by the analysis to the application server.
[0167] As an example, the encapsulation module 702 includes:
[0168] The obtaining unit is configured to obtain an internet protocol between the accelerator client and the accelerator server, and control information of the accelerator client.
[0169] The encapsulation unit is configured to encapsulate the data packet by using the internet protocol, the control information, a user datagram protocol to obtain the first encapsulation packet, and encapsulate the data packet by using the internet protocol, the control information, a transmission control protocol to obtain the second encapsulation packet.
[0170] As an example, the control information includes a user identifier, a connection identifier, a serial number, a protocol type, a compression type, a data packet type, and a data packet length; the user identifier indicates an identifier of the application client, the connection identifier indicates an identifier of a connection between the accelerator client and the accelerator server, the serial number indicates a serial number of the data packet, the protocol type indicates a type of encapsulation of the data packet, the compression type indicates a type of compression of the data packet, the data packet type indicates a type of the data packet received by the accelerator client, and the data packet length indicates a length of the data packet.
[0171] As an example, before the encapsulation module 702, further includes:
[0172] The judging module is configured to judge whether the length of the data packet exceeds a preset length.
[0173] The compression module is configured to, if the length of the data packet exceeds the preset length, compress the data packet to obtain a compressed data packet.
[0174] The encapsulation module 702 is specifically configured to encapsulate the compressed data packet by using the user datagram protocol and the transmission control protocol.
[0175] As an example, the compression module includes:
[0176] The determining unit is configured to determine a compression ratio according to the length of the data packet and the preset length.
[0177] The compression unit is configured to compress the data packet based on the compression ratio to obtain the compressed data packet; the length of the compressed data packet is less than or equal to the preset length.
[0178] As an example, when the protocol type of the data packet is a transmission control protocol, before the compression module, the network acceleration device further comprises:
[0179] a determination module configured to determine a maximum message segment length when establishing communication with the application client;
[0180] an information acquisition module configured to acquire an internet protocol between the accelerator client and the accelerator server, and control information of the accelerator client;
[0181] an adjustment module configured to adjust the value of the maximum message segment length to a target value according to the length of the data packet, a preset length, the length of the internet protocol, the length of the control information, and the length of a data protocol, wherein the data protocol is a transmission control protocol or a user datagram protocol.
[0182] As an example, after the acquisition module, the network acceleration device further comprises:
[0183] a sequence number determination unit configured to determine a sequence number of the data packet, and acquire historical sequence numbers corresponding to one or more historical data packets sent by the application client respectively;
[0184] a judgment unit configured to judge whether there is a historical sequence number identical to the sequence number in the one or more historical sequence numbers;
[0185] a processing unit configured to, if there is no historical sequence number identical to the sequence number, perform encapsulation processing on the data packet by using a user datagram protocol and a transmission control protocol respectively;
[0186] a discarding unit configured to, if there is a historical sequence number identical to the sequence number, discard the data packet.
[0187] The network acceleration device provided by the embodiments of the present application has the same beneficial effects as the network acceleration method provided by the above embodiments, and thus will not be described again.
[0188] Based on the network acceleration method provided by the above embodiments, the present application further provides a network acceleration device. The following will be described in combination with Figure 8 . Figure 8 Another network acceleration device provided by the embodiments of the present application is shown in a structural schematic diagram. As shown in the network acceleration device 800, the network acceleration device is applied to an accelerator server, and can comprise: Figure 8
[0189] The second obtaining module 801 is configured to receive a first encapsulation packet sent by an accelerator client through a first link corresponding to a user datagram protocol, and / or receive a second encapsulation packet sent by the accelerator client through a second link corresponding to a transmission control protocol; the first encapsulation packet is obtained by encapsulating a data packet by using the user datagram protocol, and the second encapsulation packet is obtained by encapsulating the data packet by using the transmission control protocol; the data packet is a data packet sent by an application client to the accelerator client; the protocol type of the data packet is the user datagram protocol or the transmission control protocol;
[0190] The parsing module 802 is configured to parse the received first encapsulation packet and / or the second encapsulation packet to obtain the data packet.
[0191] The second sending module 803 is configured to send the data packet to an application server.
[0192] The network acceleration device provided by the embodiments of the present application has the same beneficial effects as the network acceleration method provided by the above embodiments, and thus will not be described again.
[0193] The following describes the structures in the forms of a server and a terminal device respectively.
[0194] Figure 9 Fig. 9 is a schematic diagram of a server structure provided by an embodiment of the present application. The server 900 can have great differences due to different configurations or performances, and can include one or more central processing units (CPUs) 922 (for example, one or more processors) and a memory 932, one or more storage media 930 (for example, one or more mass storage devices) storing application programs 942 or data 944. The memory 932 and the storage media 930 can be temporary storage or persistent storage. The programs stored in the storage media 930 can include one or more modules (not shown in the figure), and each module can include a series of instruction operations in the server. Further, the central processing unit 922 can be configured to communicate with the storage media 930 and execute the series of instruction operations in the storage media 930 on the server 900.
[0195] The server 900 can also include one or more power supplies 926, one or more wired or wireless network interfaces 950, one or more input and output interfaces 958, and / or one or more operating systems 941, such as Windows Server TM , Mac OS X TM , Unix TM , Linux TM , FreeBSD TM , etc.
[0196] The CPU 922 is configured to execute the following steps:
[0197] receiving a first encapsulated packet sent by the accelerator client via a first link corresponding to the User Datagram Protocol, and / or receiving a second encapsulated packet sent by the accelerator client via a second link corresponding to the Transmission Control Protocol; the first encapsulated packet is obtained by encapsulating a data packet using the User Datagram Protocol, and the second encapsulated packet is obtained by encapsulating a data packet using the Transmission Control Protocol; the data packet is a data packet sent by the application client to the accelerator client; and the protocol type of the data packet is the User Datagram Protocol or the Transmission Control Protocol;
[0198] Parsing the received first encapsulated packet and / or second encapsulated packet to obtain a data packet;
[0199] Send the data packet to the application server.
[0200] The present application also provides another terminal device, such as Figure 10 For ease of explanation, only the parts related to the embodiments of the present application are shown. For specific technical details not disclosed, please refer to the method part of the embodiments of the present application. The terminal can be any terminal device including a mobile phone, a tablet computer, a personal digital assistant (English full name: Personal Digital Assistant, English abbreviation: PDA), a sales terminal (English full name: Point of Sales, English abbreviation: POS), a car computer, etc., taking the mobile phone as an example:
[0201] Figure 10 The block diagram shows a partial structure of a mobile phone related to the terminal provided in the embodiment of the present application. Figure 10 The mobile phone includes components such as a radio frequency (RF) circuit 1010, a memory 1020, an input unit 1030, a display unit 1040, a sensor 1050, an audio circuit 1060, a wireless fidelity (WiFi) module 1070, a processor 1080, and a power supply 1090. Those skilled in the art will appreciate that Figure 10 The mobile phone structure shown in the figure does not constitute a limitation to the mobile phone, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0202] The following combination Figure 10 A detailed introduction to the various components of a mobile phone:
[0203] The RF circuit 1010 can be configured to receive and send signals during a call or data session, particularly, to receive downlink information from a base station and send uplink data to the base station. Typically, the RF circuit 1010 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (LNA), a duplexer, etc. In addition, the RF circuit 1010 can be configured to communicate with the network and other devices through wireless communication. The wireless communication can use any communication standards or protocols, including but not limited to Global System for Mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Messaging Service (SMS), etc.
[0204] The memory 1020 can be configured to store software programs and modules, and the processor 1080 can be configured to execute various functions of the mobile phone and data processing by running the software programs and modules stored in the memory 1020. The memory 1020 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application program required for a function (such as a sound playing function, an image playing function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory 1020 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state memory device.
[0205] The input unit 1030 can be used to receive inputted digital or character information, and to generate key signal input with respect to user setting of the mobile phone and function control. Specifically, the input unit 1030 can include a touch panel 1031 and other input devices 1032. The touch panel 1031, also called a touch screen, can collect a touch operation (such as an operation of a user using a finger, a stylus, or any suitable object or accessory on or near the touch panel 1031) of the user on or near the touch panel 1031, and drive a corresponding connection device according to a pre-set program. Optionally, the touch panel 1031 can include two parts of a touch detection device and a touch controller. The touch detection device detects a touch position of the user and detects a signal caused by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into touch coordinates, and sends it to the processor 1080, and can receive a command from the processor 1080 and execute it. In addition, the touch panel 1031 can be implemented in various types such as a resistive type, a capacitive type, an infrared type, and a surface acoustic wave type. In addition to the touch panel 1031, the input unit 1030 can also include other input devices 1032. Specifically, the other input devices 1032 can include one or more of a physical keyboard, a function key (such as a volume control key, an on-off key, etc.), a trackball, a mouse, a joystick, etc.
[0206] The display unit 1040 can be used to display information input by the user or information provided to the user, and various menus of the mobile phone. The display unit 1040 can include a display panel 1041, which can be configured in the form of a liquid crystal display (English full name: Liquid Crystal Display, English abbreviation: LCD), an organic light-emitting diode (English full name: Organic Light-Emitting Diode, English abbreviation: OLED), etc. Further, the touch panel 1031 can cover the display panel 1041, and when the touch panel 1031 detects a touch operation on or near it, it is transmitted to the processor 1080 to determine the type of touch event, and then the processor 1080 provides corresponding visual output on the display panel 1041 according to the type of touch event. Although in the above embodiment, the touch panel 1031 and the display panel 1041 are realized as two independent components to realize the input and output functions of the mobile phone, in some embodiments, the touch panel 1031 and the display panel 1041 can be integrated to realize the input and output functions of the mobile phone. Figure 10
[0207] The mobile phone can further include at least one sensor 1050, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor can include an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display panel 1041 according to the brightness of ambient light, and the proximity sensor can turn off the display panel 1041 and / or the backlight when the mobile phone is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally three axes), and when at rest, it can detect the magnitude and direction of gravity, which can be used for identifying the posture of the mobile phone (such as switching between landscape and portrait, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), and the like. As for other sensors that can also be configured on the mobile phone, such as a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, and the like, they will not be described here.
[0208] The audio circuit 1060, the speaker 1061, and the microphone 1062 can provide an audio interface between the user and the mobile phone. The audio circuit 1060 can convert the received audio data into an electrical signal, transmit it to the speaker 1061, and convert it into a sound signal output by the speaker 1061; on the other hand, the microphone 1062 converts the collected sound signal into an electrical signal, which is received by the audio circuit 1060 and converted into audio data, and then output to the processor 1080 for processing, and then transmitted to another mobile phone through the RF circuit 1010, or output to the memory 1020 for further processing.
[0209] WiFi belongs to a short-range wireless transmission technology, and the mobile phone can help the user to send and receive emails, browse web pages, and access streaming media through the WiFi module 1070, which provides the user with wireless broadband Internet access. Although Figure 10 The WiFi module 1070 is shown, but it can be understood that it does not belong to the essential components of the mobile phone, and can be omitted as needed without changing the essence of the application.
[0210] The processor 1080 is the control center of the mobile phone, which connects all parts of the mobile phone through various interfaces and lines, executes various functions of the mobile phone and processes data by running or executing software programs and / or modules stored in the memory 1020 and calling data stored in the memory 1020, thereby collecting overall data and information of the mobile phone. Optionally, the processor 1080 can include one or more processing units; preferably, the processor 1080 can integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communication. It can be understood that the above-mentioned modem processor can also not be integrated into the processor 1080.
[0211] The mobile phone further includes a power supply 1090 (such as a battery) for supplying power to various components, and preferably, the power supply is logically connected to the processor 1080 through a power management system, so that the power management system can be used to manage charging, discharging, power consumption management, and the like.
[0212] Although not shown, the mobile phone can further include a camera, a Bluetooth module, and the like, which will not be described herein.
[0213] In the embodiments of the present application, the processor 1080 included in the terminal further has the following functions:
[0214] obtaining a data packet sent by an application client; the protocol type of the data packet is a user datagram protocol or a transmission control protocol;
[0215] performing encapsulation processing on the data packet by using the user datagram protocol and the transmission control protocol, respectively, to obtain a first encapsulation packet corresponding to the user datagram protocol and a second encapsulation packet corresponding to the transmission control protocol;
[0216] sending the first encapsulation packet to an accelerator server through a first link corresponding to the user datagram protocol, and sending the second encapsulation packet to the accelerator server through a second link corresponding to the transmission control protocol; wherein the accelerator server is configured to perform analysis processing on the received first encapsulation packet and / or second encapsulation packet, and send a data packet obtained by the analysis processing to an application server.
[0217] The embodiments of the present application further provide a computer readable storage medium for storing program codes, the program codes being used to execute any one of the embodiments of the network acceleration method.
[0218] The embodiments of the present application further provide a computer program product including instructions, which, when executed on a computer, cause the computer to execute any one of the embodiments of the network acceleration method.
[0219] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system and device described above can refer to the corresponding process in the foregoing method embodiments, which will not be described herein.
[0220] In several embodiments provided in the present application, it should be understood that the disclosed system and method can be implemented in other manners. For example, the system embodiments described above are merely illustrative. For example, the division of the system is only a logical function division. There can be another division manner for the actual implementation, for example, multiple systems or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections can be indirect couplings or communication connections through some interfaces, devices or units, and can be in electrical, mechanical or other forms.
[0221] The system described as a separate component can or can not be physically separated, and the component displayed as a unit can or can not be a physical unit, that is, it can be located in one place, or it can be distributed on multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.
[0222] In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0223] The integrated unit, if realized in the form of a software functional unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (English full name: Read-Only Memory, English abbreviation: ROM), a random access memory (English full name: Random Access Memory, English abbreviation: RAM), a magnetic disk or an optical disk, and various program code storage media.
[0224] The above examples are only used to illustrate the technical solutions of the present application, but not to limit the same; although the present application has been described in detail with reference to the foregoing examples, it should be understood by those of ordinary skill in the art that: it can still modify the technical solutions recorded in the foregoing examples, or make equivalent replacement for part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A network acceleration method, characterized by, The method is applied to an accelerator client, and comprises: obtaining a data packet sent by an application client; the protocol type of the data packet is a user datagram protocol or a transmission control protocol; performing encapsulation processing on the data packet by using the user datagram protocol and the transmission control protocol respectively to obtain a first encapsulation packet corresponding to the user datagram protocol and a second encapsulation packet corresponding to the transmission control protocol; sending the first encapsulation packet to an accelerator server through a first link corresponding to the user datagram protocol and sending the second encapsulation packet to the accelerator server through a second link corresponding to the transmission control protocol; wherein the accelerator server is configured to perform analysis processing on the received first encapsulation packet and / or second encapsulation packet and send the data packet obtained by the analysis processing to an application server.
2. The method of claim 1, wherein, The method further comprises: obtaining an internet protocol between the accelerator client and the accelerator server and control information of the accelerator client; performing encapsulation processing on the data packet by using the internet protocol, the control information, the user datagram protocol to obtain the first encapsulation packet and performing encapsulation processing on the data packet by using the internet protocol, the control information, the transmission control protocol to obtain the second encapsulation packet.
3. The method of claim 2, wherein, The control information comprises a user identifier, a connection identifier, a serial number, a protocol type, a compression type, a data packet type and a data packet length; the user identifier indicates an identifier of the application client, the connection identifier indicates an identifier of a connection between the accelerator client and the accelerator server, the serial number indicates a serial number of the data packet, the protocol type indicates a type of encapsulation on the data packet, the compression type indicates a type of compression on the data packet, the data packet type indicates a type of the data packet received by the accelerator client, and the data packet length indicates a length of the data packet.
4. The method of claim 1, wherein, Before performing encapsulation processing on the data packet by using the user datagram protocol and the transmission control protocol, the method further comprises: determining whether the length of the data packet exceeds a preset length; if the length of the data packet exceeds the preset length, performing compression processing on the data packet to obtain a compressed data packet; The method further comprises: performing encapsulation processing on the compressed data packet by using the user datagram protocol and the transmission control protocol respectively.
5. The method of claim 4, wherein, The method further comprises: determining a compression ratio according to the length of the data packet and the preset length; performing compression on the data packet based on the compression ratio to obtain the compressed data packet; wherein the length of the compressed data packet is less than or equal to the preset length.
6. The method of claim 4, wherein, When the protocol type of the data packet is the transmission control protocol, before the data packet is compressed to obtain a compressed data packet, the method further comprises: determining a maximum message segment length when establishing communication with the application client; obtaining an internet protocol between the accelerator client and the accelerator server, and control information of the accelerator client; adjusting the value of the maximum message segment length to a target value according to the length of the data packet, the preset length, the length of the internet protocol, the length of the control information, and the length of a data protocol; wherein the data protocol is the transmission control protocol or the user datagram protocol.
7. The method of claim 1, wherein, After obtaining the data packet sent by the application client, the method further comprises: determining a sequence number of the data packet, and obtaining historical sequence numbers corresponding to one or more historical data packets sent by the application client; determining whether one or more of the historical sequence numbers are the same as the sequence number; if there is no historical sequence number that is the same as the sequence number, then using the user datagram protocol and the transmission control protocol to respectively encapsulate the data packet; if there is a historical sequence number that is the same as the sequence number, then discarding the data packet.
8. A network acceleration method, characterized by, The method is applied to an accelerator server, and comprises: receiving a first encapsulated packet sent by an accelerator client through a first link corresponding to a user datagram protocol, and / or receiving a second encapsulated packet sent by the accelerator client through a second link corresponding to a transmission control protocol; the first encapsulated packet is obtained by encapsulating a data packet using the user datagram protocol, and the second encapsulated packet is obtained by encapsulating the data packet using the transmission control protocol; the data packet is sent by an application client to the accelerator client; the protocol type of the data packet is the user datagram protocol or the transmission control protocol; performing analysis processing on the received first encapsulated packet and / or second encapsulated packet to obtain the data packet; sending the data packet to an application server.
9. A network acceleration device, comprising: The device is applied to an accelerator client, and comprises: a first obtaining module configured to obtain a data packet sent by an application client; the protocol type of the data packet is the user datagram protocol or the transmission control protocol; an encapsulating module configured to use the user datagram protocol and the transmission control protocol to respectively encapsulate the data packet to obtain a first encapsulated packet corresponding to the user datagram protocol and a second encapsulated packet corresponding to the transmission control protocol; a first sending module configured to send the first encapsulated packet to an accelerator server through a first link corresponding to the user datagram protocol, and send the second encapsulated packet to the accelerator server through a second link corresponding to the transmission control protocol; wherein the accelerator server is configured to perform analysis processing on the received first encapsulated packet and / or second encapsulated packet, and send the data packet obtained by the analysis processing to an application server.
10. A network acceleration device, comprising: The device is applied to an accelerator server, and comprises: The second obtaining module is configured to receive a first encapsulation packet sent by an accelerator client through a first link corresponding to a user datagram protocol, and / or receive a second encapsulation packet sent by the accelerator client through a second link corresponding to a transmission control protocol; the first encapsulation packet is obtained by encapsulating a data packet using the user datagram protocol, and the second encapsulation packet is obtained by encapsulating the data packet using the transmission control protocol; the data packet is sent by an application client to the accelerator client; and the protocol type of the data packet is the user datagram protocol or the transmission control protocol; The analyzing module is configured to analyze the received first encapsulation packet and / or the second encapsulation packet to obtain the data packet. The second sending module is configured to send the data packet to an application server.
11. A network acceleration device, comprising: The device comprises a processor and a memory: The memory is configured to store program code and transmit the program code to the processor; The processor is configured to execute the steps of the network acceleration method according to the instructions in the program code, or execute the steps of the network acceleration method in claim 8.
12. A computer-readable storage medium, characterized in that, The computer readable storage medium is configured to store program code, and the program code is configured to execute the steps of the network acceleration method according to any one of claims 1 to 7, or execute the steps of the network acceleration method in claim 8.