TCP transmission method, device, equipment and storage medium

By deploying TCP agents on 5G base stations and counting the frequency of link building, and launching the TCP link release process, the problem of large delay in setting up the TCP connection is solved, and the success rate and user experience of setting up the TCP connection are improved.

CN117377137BActive Publication Date: 2025-04-29CHINA MOBILE ZIJIN INNOVATION INST CO LTD +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311518017.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-14
Publication Date
2025-04-29
Estimated Expiration
2043-11-14

AI Technical Summary

Technical Problem

The TCP connection establishment delay in 5G networks is large, especially when the network is congested, which causes the terminal to be unable to use network services effectively, affecting the user experience.

Method used

Deploy TCP agent on the base station, obtain its current status, and count the link building frequency of the TCP agent instance during the working status. Based on the frequency of link building, the TCP link release process is initiated and TCP connection release control is carried out to reduce connection establishment delay and waste of transmission resources.

Benefits of technology

By reducing the delay in establishing TCP connections and avoiding waste of transmission resources, the success rate and user experience of establishing TCP connections are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117377137B_ABST
    Figure CN117377137B_ABST
Patent Text Reader

Abstract

The present invention discloses a TCP transmission method, device, equipment and storage medium, belonging to the field of communication technology. The present invention applies the TCP transmission method to a base station, a TCP proxy is deployed on the base station, and the current state of the TCP proxy is obtained; when the current state is a working state, the link establishment frequency of the TCP proxy instance in the TCP proxy is counted; based on the link establishment frequency, a TCP link release process is initiated to perform TCP connection release control, thereby reducing the TCP connection establishment delay and reducing the waste of transmission resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technology, and in particular to a TCP transmission method, device, equipment and storage medium. Background Art

[0002] The TCP (Transmission Control Protocol) connection is an asymmetric link connection. One end is the server. After the service is started, the service port is kept open, waiting for the client to initiate a link establishment request. The other end is the client. The communication link is established only when there is a need for data transmission, and the link is closed after the data transmission is completed.

[0003] The success rate of TCP connection establishment has a great impact on the terminal's connection services. If the user fails to establish a TCP connection multiple times, the terminal will be unable to use network services, seriously affecting the user experience. The TCP link in the 5G network application layer involves many communication network elements. From the 5G terminal to the background application server, any delay or congestion in the communication node in the middle will affect the establishment of the terminal TCP link. At present, the TCP connection link on the 5G network has a large connection establishment delay when the network is congested. In addition, the frequent deletion and establishment of TCP links also wastes transmission resources. Summary of the invention

[0004] The main purpose of the present invention is to provide a TCP transmission method, device, equipment and storage medium, aiming to solve the technical problem of large delay in establishing TCP connection in the prior art.

[0005] To achieve the above object, the present invention provides a TCP transmission method, which is applied to a base station, on which a TCP proxy is deployed, and comprises the following steps:

[0006] Get the current status of the TCP proxy;

[0007] When the current state is a working state, counting the link establishment frequency of the TCP proxy instance in the TCP proxy;

[0008] A TCP link release process is initiated based on the link establishment frequency to perform TCP connection release control.

[0009] Optionally, the initiating a TCP link release process based on the link establishment frequency to perform TCP connection release control includes:

[0010] Initiate a TCP link release process to the user terminal based on the link establishment frequency, and release the TCP connection established with the user terminal;

[0011] The release time of releasing the TCP connection established with the user terminal is recorded, and the release control of the TCP connection with the user terminal is completed.

[0012] Optionally, the recording of the release time of the TCP connection established with the user terminal, after completing the TCP connection release control with the user terminal, further includes:

[0013] Get the current time;

[0014] Calculate the time interval in which the user terminal corresponding to each TCP proxy instance has no TCP connection by using the current time and the release time;

[0015] When the time interval is greater than a preset time interval threshold, the TCP proxy is controlled to enter a proxy release state.

[0016] Optionally, after obtaining the current state of the TCP proxy, the method further includes:

[0017] When the current state is the proxy release state, controlling the TCP proxy instance in the TCP proxy to release the TCP connection with the server;

[0018] Release instance resources and complete the release of the TCP connection with the server.

[0019] Optionally, after obtaining the current state of the TCP proxy, the method further includes:

[0020] When the current state is an initial learning state, controlling the TCP proxy to start and creating a TCP proxy instance;

[0021] Obtaining an index queue based on the TCP proxy instance, and setting an index value of the index queue;

[0022] Responding to a first TCP connection establishment request initiated by a user terminal;

[0023] Identify the first TCP connection establishment request to obtain a protocol identifier;

[0024] When the protocol identifier satisfies the first protocol identifier value, obtaining a first handshake message for TCP link establishment;

[0025] Obtaining a to-be-matched index value of the first handshake message;

[0026] A TCP connection is established with the user terminal through the to-be-matched index value.

[0027] Optionally, establishing a TCP connection with the user terminal by using the to-be-matched index value includes:

[0028] Matching the to-be-matched index value with the index value of the index queue;

[0029] When the to-be-matched index value matches the index value of the index queue, a target TCP proxy instance is obtained;

[0030] Record the number of link establishment times of the target TCP proxy instance and update the link establishment time;

[0031] The TCP proxy is controlled to initiate a second handshake message flow and a third handshake message flow to complete the TCP connection with the user terminal.

[0032] Optionally, after establishing a TCP connection with the user terminal through the to-be-matched index value, the method further includes:

[0033] Control the TCP proxy to initiate a second TCP connection establishment request with the server, and establish a TCP connection with the server;

[0034] Controlling the TCP proxy to perform data transmission between the user terminal and the server;

[0035] After the data transmission is completed, controlling the TCP proxy to release the TCP connection between the TCP proxy and the user terminal;

[0036] After the TCP connection with the user terminal is released, the TCP proxy is controlled to release the TCP connection with the server.

[0037] In addition, to achieve the above object, the present invention further provides a TCP transmission device, the TCP transmission device comprising:

[0038] The acquisition module is used to obtain the current status of the TCP proxy;

[0039] A statistics module, used for counting the link establishment frequency of the TCP proxy instance in the TCP proxy when the current state is a working state;

[0040] The release module is used to initiate a TCP link release process based on the link establishment frequency and perform TCP connection release control.

[0041] In addition, to achieve the above-mentioned purpose, the present invention also proposes a TCP transmission device, which includes: a memory, a processor, and a TCP transmission program stored in the memory and executable on the processor, wherein the TCP transmission program is configured to implement the steps of the TCP transmission method described above.

[0042] In addition, to achieve the above-mentioned purpose, the present invention further proposes a storage medium, on which a TCP transmission program is stored, and when the TCP transmission program is executed by a processor, the steps of the TCP transmission method described above are implemented.

[0043] The TCP transmission method of the present invention is applied to a base station, on which a TCP proxy is deployed. The method comprises obtaining the current state of the TCP proxy; when the current state is a working state, counting the link establishment frequency of the TCP proxy instance in the TCP proxy; initiating a TCP link release process based on the link establishment frequency, and performing TCP connection release control, thereby reducing the TCP connection establishment delay and reducing the waste of transmission resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 It is a schematic diagram of the structure of a TCP transmission device in a hardware operating environment involved in an embodiment of the present invention;

[0045] Figure 2 A schematic diagram of a flow chart of a first embodiment of a TCP transmission method of the present invention;

[0046] Figure 3 This is a schematic diagram of the architecture of the TCP proxy deployment on the base station in an embodiment of the TCP transmission method of the present invention;

[0047] Figure 4 A schematic diagram of a flow chart of a second embodiment of a TCP transmission method of the present invention;

[0048] Figure 5 A schematic diagram of a flow chart of a third embodiment of a TCP transmission method of the present invention;

[0049] Figure 6 This is a schematic diagram of the overall process architecture of TCP transmission in an embodiment of a TCP transmission method of the present invention;

[0050] Figure 7 A schematic diagram of a flow chart of a fourth embodiment of a TCP transmission method according to the present invention;

[0051] Figure 8 A schematic diagram of a fifth embodiment of a TCP transmission method according to the present invention;

[0052] Fig. 9 A schematic diagram of a TCP connection establishment architecture between a user terminal and a TCP transmission method according to an embodiment of the present invention;

[0053] Fig.10 It is a structural block diagram of the first embodiment of the TCP transmission device of the present invention.

[0054] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0055] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0056] Reference Figure 1 , Figure 1 The present invention is a schematic diagram of the structure of a TCP transmission device in a hardware operating environment according to an embodiment of the present invention.

[0057] like Figure 1 As shown, the TCP transmission device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (Wireless-Fidelity, Wi-Fi) interface). The memory 1005 may be a high-speed random access memory (Random Access Memory, RAM), or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk storage. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0058] Those skilled in the art will understand that Figure 1 The structure shown in the figure does not constitute a limitation on the TCP transmission device, and may include more or less components than those shown in the figure, or combine certain components, or arrange the components differently.

[0059] like Figure 1 As shown, the memory 1005 as a storage medium may include an operating system, a network communication module, a user interface module, and a TCP transmission program.

[0060] exist Figure 1 In the TCP transmission device shown, the network interface 1004 is mainly used for data communication with the network server; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the TCP transmission device of the present invention can be set in the TCP transmission device, and the TCP transmission device calls the TCP transmission program stored in the memory 1005 through the processor 1001, and executes the TCP transmission method provided by the embodiment of the present invention.

[0061] The embodiment of the present invention provides a TCP transmission method, referring to Figure 2 , Figure 2 It is a flowchart of the first embodiment of the TCP transmission method of the present invention.

[0062] In this embodiment, the TCP transmission method is applied to a base station, a TCP proxy is deployed on the base station, and the method includes the following steps:

[0063] Step S10: Obtain the current state of the TCP proxy.

[0064] It should be noted that the executor of this embodiment is a base station, which is a 5G base station. A TCP proxy is deployed on the base station, which can reduce the delay in establishing a TCP connection and reduce the waste of transmission resources.

[0065] In specific implementation, TCP connections can be divided into long connections and short connections according to the connection cycle or service type. A short connection means that a connection between a client and a server only processes one request and response, and the connection will be disconnected after the request is processed. Its life cycle is short. A long connection means that a connection between a client and a server can continuously process multiple requests and responses, and the connection will be disconnected when there is no data transmission, and its life cycle is relatively long. Since each TCP connection requires a series of network communication processes such as three-way handshakes and four-way handshakes, the cost of establishing and disconnecting TCP connections is relatively large. In a short connection, since each request needs to establish a connection once, the cost of establishing and disconnecting the connection is relatively large. In a long connection, since the connection can be reused, the cost of establishing and disconnecting the connection is relatively small. A long connection (Persistent Connection) will maintain a connection between the client and the server for a long time until one of the parties sends a request to end the connection. In a long connection, the client and the server can communicate multiple times, and multiple requests and responses can be sent on one connection, which reduces the cost of establishing and closing the connection and can improve the efficiency of data transmission. Long connections are suitable for situations where a large amount of data needs to be transferred between the client and the server at one time, such as file transfer, resource download, etc.

[0066] A short connection (Non-Persistent Connection) closes the connection after each request and response between the client and the server. In a short connection, each request and response needs to re-establish the connection, which increases the overhead of connection establishment and closing and reduces the efficiency of data transmission. Short connections are suitable for businesses with relatively small amounts of data transmitted at a time between the client and the server, such as RESTful cloud service interfaces, web browsing, video on demand, real-time games, etc.

[0067] This embodiment optimizes the TCP transmission of 5G base stations, establishes a TCP proxy server on the 5G base station, separates the wired part and the wireless part of the TCP link, and the TCP proxy is a server for the terminal side and a client for the server. The TCP connection between the TCP proxy and the server maintains a long TCP connection when a certain connection frequency threshold is met. It does not follow the TCP connection of the terminal to delete the link, thus shielding the problem of low TCP connection rate caused by TCP link congestion on the network side, and also avoids the waste of transmission resources after the Middle-haul link due to frequent deletion of the established TCP link by the terminal; in addition, the TCP proxy can also pre-allocate uplink resources to the corresponding terminal according to the message flow of the TCP connection three-way handshake, which speeds up the TCP connection establishment process, shortens the TCP connection establishment delay, and improves the TCP connection establishment efficiency.

[0068] The TCP communication link of the 5G network application layer is relatively long overall, involving many network elements and communication nodes. According to the transmission link form, the transmission link can be divided into two parts: wired and wireless, with the base station as the center. The base station to the application server is generally carried by wired links such as optical fiber and twisted pair, which is called a wired link. The wired link has the characteristics of large bandwidth, high reliability, and stable line, and rarely has packet errors and packet loss. The communication link between the base station and the UE uses the 5GNR air interface channel transmission in the 5G network, which is called a wireless link. Compared with the wired network, the wireless link has the characteristics of high bit error rate and large bandwidth changes. Packet errors and packet loss in the wireless link are normal. It can be seen that the transmission characteristics of the wireless link and the wired link are quite different.

[0069] Since wired links are stable, link packet errors and packet loss can be ignored. Once packet loss occurs, it can be considered that network congestion has occurred. For wireless links, packet errors and packet loss are normal link errors in wireless channels, and they do not necessarily mean that network congestion has occurred. TCP is designed based on wired links. It believes that if the network is congested, it will take a long time to recover. A typical example is the slow start algorithm. Once the sender detects message loss (ACK message sequence number is repeated three times), it will consider network congestion to have occurred (because wired networks ignore link message loss). The algorithm will reduce the congestion / send window to 1, and then slowly expand the congestion / send window. This will seriously affect the TCP transmission rate in the case of wireless link packet loss. Similarly, the TCP connection algorithm is also designed based on wired links. There is no timeout retransmission design for the three-way handshake messages. Once a message is lost, it is considered that network congestion has occurred, and the connection is reestablished from the first handshake message. The timer for reestablishing the connection is relatively long (the default time on the Linux system is 1s). However, in fact, the three-way handshake messages of the wireless link can be retransmitted through MAC scheduling to improve the success rate of TCP connection establishment. Therefore, establishing a TCP proxy on the 5G base station can effectively shield the link differences between the two parties. The two TCP links can each use different error control algorithms. The original TCP congestion control algorithm and TCP connection establishment process can continue to be used on the wired link segment, and the three-way handshake messages established by TCP can be retransmitted multiple times through MAC scheduling on the wireless link segment to improve the success rate of TCP establishment, thereby improving the performance of the entire TCP link.

[0070] Since the TCP message of the application layer is not visible to the base station, it is necessary to open the payload on the user plane of the base station. According to the protocol stack structure of the user plane, such as Figure 3 As shown, Figure 3 The schematic diagram of the architecture of TCP proxy deployment on the base station shows that the TCP proxy is set up between the SDAP layer and the GTP-U layer. Because the IP payload is transmitted between the two layers, there is no protocol header of other transport layers, so it is relatively simple to handle. If it is set up at other protocol layers, first, the protocol header of the transport layer needs to be stripped according to the transport protocol. Secondly, if the IP payload is fragmented by other transport layers or the message order is disrupted (PDCP is responsible for payload sorting, and RLC is responsible for payload fragmentation and merging), the TCP proxy cannot handle it or it is very difficult and troublesome to handle it. Therefore, this patent proposal sets up the TCP proxy between SDAP and GTP-U. The TCP message payload between the two is in the form of a complete IP message, which is easy to identify and process. UE is the user terminal, and the core network is the service end. The TCP proxy deployed on the base station establishes connections with the UE and the core network respectively, so as to perform TCP transmission.

[0071] In a specific implementation, the TCP proxy establishes a proxy instance for each TCP link, and the working mode can be determined according to the current state of the TCP proxy.

[0072] The current state of the TCP proxy may include an initial learning state, a working state, and a proxy release state, so the current state of the TCP proxy may be obtained, thereby performing corresponding TCP transmission according to different current states of the TCP proxy.

[0073] Step S20: When the current state is the working state, counting the link establishment frequency of the TCP proxy instance in the TCP proxy.

[0074] It should be understood that when the current state of the TCP proxy is the working state, the link establishment frequency of the TCP proxy instance in the TCP proxy can be counted, and the link establishment frequency is associated with the number of link establishment times and the link establishment time.

[0075] The connection establishment frequency may be the frequency at which the TCP proxy establishes a connection with the server or the user terminal.

[0076] Step S30: Initiate a TCP link release process based on the link establishment frequency and perform TCP connection release control.

[0077] In a specific implementation, the TCP link release process can be initiated by the link establishment frequency. For example, the link establishment frequency is compared with a set threshold, and then the TCP link release process is initiated according to the comparison result to perform TCP connection release control.

[0078] The TCP link release process can release the TCP link between the TCP proxy instance and the user terminal. Each time, only the TCP connection established between the TCP proxy instance and the user terminal is released, and the connection between the TCP proxy instance and the server is not released. This shields the problem of low TCP connection rate caused by TCP link congestion on the network side, improves the success rate of TCP connection establishment, and also avoids the waste of transmission resources after the Middle-haul link due to frequent deletion of established TCP links by user terminals.

[0079] The TCP transmission method of this embodiment is applied to a base station, on which a TCP proxy is deployed. The method includes obtaining the current state of the TCP proxy; when the current state is a working state, counting the link establishment frequency of the TCP proxy instance in the TCP proxy; initiating a TCP link release process based on the link establishment frequency, and performing TCP connection release control, which can reduce the TCP connection establishment delay and reduce the waste of transmission resources.

[0080] refer to Figure 4 , Figure 4 FIG. 4 is a flow chart of a second embodiment of a TCP transmission method according to the present invention.

[0081] Based on the first embodiment, step S30 of the TCP transmission method in this embodiment includes:

[0082] Step S301: Initiate a TCP link release process to a user terminal based on the link establishment frequency, and release the TCP connection established with the user terminal.

[0083] It should be noted that a TCP link release process can be initiated to the user terminal based on the link establishment frequency, thereby releasing the TCP connection established with the user terminal. Before the TCP link is released, a short connection of the wireless link has been established between the TCP agent and the user terminal. Therefore, after the transmission is completed, a TCP link release process is initiated to the user terminal to release the TCP connection established with the user terminal.

[0084] In a specific implementation, the link establishment frequency can be compared with the link establishment frequency threshold set by the system. When the link establishment frequency of the proxy instance is greater than the link establishment frequency threshold N set by the system, the TCP proxy instance enters the working state. The TCP proxy instance entering the working state initiates the TCP link release process to the user terminal.

[0085] It should be noted that the link establishment frequency of each TCP proxy instance = (current time - creation time) / number of link establishments, and the creation time is the time for creating the TCP proxy instance.

[0086] Step S302: Record the release time of the TCP connection established with the user terminal, and complete the TCP connection release control with the user terminal.

[0087] It should be understood that when releasing the TCP connection with the user terminal, in order to facilitate the subsequent statistics of the time interval without TCP connection on the user terminal side, the release time of the TCP connection established with the user terminal can be recorded, and the release time may include the time of the last release of the TCP connection.

[0088] In a specific implementation, when a user terminal initiates a TCP link release process, a TCP proxy instance that enters a working state no longer releases the TCP link between the server and the proxy server, but only releases the TCP connection established with the user terminal each time, thereby improving the success rate of TCP connection establishment.

[0089] This embodiment initiates a TCP link release process to the user terminal based on the link establishment frequency, releases the TCP connection established with the user terminal; records the release time of the TCP connection established with the user terminal, completes the TCP connection release control with the user terminal, and only releases the TCP connection established with the user terminal each time, thereby improving the success rate of TCP connection establishment and thus improving the efficiency of TCP transmission.

[0090] refer to Figure 5 , Figure 5 Schematic diagram of the flow of the third embodiment of the TCP transmission method of the present invention.

[0091] Based on the above first and second embodiments, the TCP transmission method of this embodiment further includes, after step S302:

[0092] Step S31: Get the current time.

[0093] In a specific implementation, the current time may be obtained to determine whether it is necessary to release the TCP connection with the server.

[0094] Step S32: Calculate the time interval during which the user terminal corresponding to each TCP proxy instance has no TCP connection by using the current time and the release time.

[0095] In a specific implementation, the time interval during which the user terminal corresponding to each TCP proxy instance has no TCP connection can be calculated by calculating the current time and the last release time among the release times.

[0096] The time intervals during which the user terminals corresponding to each TCP proxy instance have no TCP connection can be periodically traversed and counted. Time interval = current time - last release time.

[0097] It is understandable that the time interval can be compared with a preset time interval threshold to determine whether the connection release between the TCP proxy and the server is required. The preset time interval threshold can be set to 10s, 20s, etc., which is not limited in this embodiment.

[0098] Step S33: When the time interval is greater than a preset time interval threshold, control the TCP proxy to enter a proxy release state.

[0099] It should be noted that when the time interval is greater than the preset time interval threshold, the TCP proxy is controlled to enter the TCP proxy instance release phase, specifically, the connection between the TCP proxy instance and the server is released.

[0100] In a specific implementation, if the time interval is less than or equal to the preset time interval threshold, the TCP connection between the TCP proxy instance and the server is not released, and the time interval during which the user terminal corresponding to each TCP proxy instance has no TCP connection is continuously counted.

[0101] like Figure 6 As shown, Figure 6The figure is a schematic diagram of the overall process architecture of TCP transmission. The business server is mainly a short connection type server, such as a Web server, RESTful cloud service, etc. The UE is a user terminal. It is specifically divided into the TCP proxy initial learning stage, the TCP proxy working stage and the TCP proxy release stage. During the TCP connection establishment process, different algorithms are used for error management for the wired and wireless connections. The wired segment adopts the traditional TCP connection establishment algorithm. Packet loss is assumed to have occurred network congestion. The three handshake messages in the TCP connection establishment process are not retransmitted. If any message is lost, it is considered that the connection establishment has failed. Wait for 1s to initiate the TCP connection establishment process again until the establishment is successful or the maximum number of connections is reached.

[0102] The wireless segment uses a multiple retransmission algorithm to establish a TCP connection, because packet loss in the wireless link is likely due to occasional errors in the wireless link. The details are as follows: (1) The TCP proxy receives the SYN message from the UE, replies with a SYN ACK, and notifies the MAC (Medium Access Control) module to perform special processing on the message, specifying that the UE replies with an ACK (Acknowledgment) message on a certain uplink resource. (2) When the uplink resource time arrives, if the MAC receives a non-continuous transmission message from the physical layer on the uplink resource, it is considered that the UE has not received the SYN ACK message, and the MAC will continue to resend the message. (3) When the uplink resource time arrives, if the MAC receives a CRC check error message from the physical layer on the uplink resource, it is considered that the UE has received the SYN ACK message but failed to send the ACK message. The MAC will continue to allocate uplink resources to the UE and instruct the UE to resend the message until it is successfully received or the maximum number of transmissions is reached. (4) When the uplink resource time arrives, if the TCP proxy successfully receives the ACK message from the UE, the TCP connection is successfully established and data is transmitted. After receiving the TCP FIN sent by the user terminal, the TCP proxy feedbacks FIN ACK and sends TCP FIN to the server connected to it, and then receives the FIN ACK feedback from the server. The TCP proxy sends TCP FIN to the user terminal and receives the TCP FIN sent by the server. The TCP proxy receives the FIN ACK feedback from the user terminal and feedbacks FIN ACK to the server. During the TCP proxy working phase, if the TCP frequent link establishment threshold is met, the TCP proxy does not disconnect the link with the server, but maintains the connection with the server and waits for the user terminal to disconnect again. The user terminal and the TCP proxy perform a three-way handshake, TCP establishes the link, and data is transmitted. After four handshakes, TCP disconnects the link. During the TCP proxy release phase, the TCP proxy detects that the user terminal disconnection time reaches the threshold, and then initiates the disconnection process with the server. For the wired and wireless TCP links, different algorithms can be used for transmission error management according to their respective transmission characteristics, thereby improving the performance of TCP connection establishment.

[0103] This embodiment obtains the current time; calculates the time interval when the user terminal corresponding to each TCP proxy instance has no TCP connection through the current time and the release time; when the time interval is greater than a preset time interval threshold, controls the TCP proxy to enter the proxy release state, sets the regulation of the TCP proxy entering the proxy release state, deletes the link that does not follow the TCP connection of the user terminal, and improves the success rate of the connection.

[0104] refer to Figure 7 , Figure 7 Schematic diagram of the flow of the fourth embodiment of the TCP transmission method of the present invention.

[0105] Based on the first embodiment, the TCP transmission method of this embodiment further includes, after step S10:

[0106] Step S11: when the current state is the proxy release state, controlling the TCP proxy instance in the TCP proxy to release the TCP connection with the server.

[0107] It should be noted that when the current state is the proxy release state, the TCP proxy instance in the TCP proxy releases the TCP connection with the server, and the TCP proxy instance in the TCP proxy is controlled to release the TCP connection with the server.

[0108] Step S12: Release instance resources and complete the release of the TCP connection with the server.

[0109] It should be noted that after releasing the TCP connection with the server, the instance resources of the connection are released, thereby completing the release of the TCP connection between the TCP proxy and the server.

[0110] In this embodiment, when the current state is the proxy release state, the TCP proxy instance in the TCP proxy is controlled to release the TCP connection with the server; the instance resources are released to complete the release of the TCP connection with the server. The TCP connection can adopt different controls according to the characteristics of each transmission link to improve the connection establishment and data transmission performance of the entire TCP connection.

[0111] refer to Figure 8 , Figure 8 FIG. 5 is a flow chart of a fifth embodiment of a TCP transmission method according to the present invention.

[0112] Based on the first embodiment, the TCP transmission method of this embodiment further includes, after step S10:

[0113] Step S11 ′: when the current state is the initial learning state, control the TCP proxy to start and create a TCP proxy instance.

[0114] It should be noted that the current state may also include an initial learning state. In the initial learning state, it is necessary to control the TCP proxy startup to create a TCP proxy instance to facilitate the subsequent connection establishment between the TCP proxy instance and the user terminal and the server.

[0115] Step S12': obtaining an index queue based on the TCP proxy instance, and setting an index value of the index queue.

[0116] In the specific implementation, after creating the TCP proxy instance, the index queue of the TCP proxy instance is obtained and initialized to be empty, and the index value of the index queue is set. The index of the index queue is the three elements of the TCP connection quintuple, specifically TCP SvrIP, TCP Svr Port, and Client IP.

[0117] Step S13': responding to the first TCP connection establishment request initiated by the user terminal.

[0118] It should be understood that when establishing a TCP connection, the user terminal initiates a TCP connection establishment request, and the first TCP connection establishment request is a TCP connection establishment request initiated by the user terminal.

[0119] Step S14': Identify the first TCP connection establishment request to obtain a protocol identifier.

[0120] In a specific implementation, after receiving the first TCP connection establishment request, the TCP proxy in the base station identifies the first TCP connection establishment request, thereby identifying the protocol identifier in the IP message, and the protocol is indicated as TCP.

[0121] Step S15': when the protocol identifier satisfies the first protocol identifier value, a first handshake message for establishing a TCP link is obtained.

[0122] In a specific implementation, the value of the protocol identifier can be obtained to determine whether the value of the protocol identifier is the first protocol identifier value, where the first protocol identifier value is SYN=1, ACK=0. When the protocol identifier satisfies SYN=1, ACK=0, it is determined to be the first handshake message for TCP link establishment, thereby obtaining the first handshake message for TCP link establishment.

[0123] Step S16': obtaining the to-be-matched index value of the first handshake message.

[0124] It should be noted that three index value elements in the first handshake message, ie, index values ​​to be matched, may be obtained.

[0125] Step S17': establishing a TCP connection with the user terminal through the to-be-matched index value.

[0126] In a specific implementation, a TCP connection with a user terminal may be established through the index value to be matched. For example, the index value to be matched may be matched with an index queue established in advance, thereby establishing a TCP connection.

[0127] Optionally, the step of establishing a TCP connection with the user terminal through the index value to be matched includes: matching the index value to be matched with the index value of the index queue; when the index value to be matched matches the index value of the index queue, obtaining the target TCP proxy instance; recording the number of link establishment times of the target TCP proxy instance and updating the link establishment time; controlling the TCP proxy to initiate a second handshake message process and a third handshake message process to complete the TCP connection with the user terminal.

[0128] It should be noted that the index value to be matched can be matched with the index value in the index queue to determine whether the target TCP proxy instance exists. If the index value to be matched matches the index value of the index queue, it proves that the instance exists, and the target TCP proxy instance is obtained. The number of link establishment times of the target TCP proxy instance is recorded, the number of link establishment times is increased by 1, the latest link establishment time is updated, and TCP is controlled to initiate the second handshake message and the third handshake message process. The TCP proxy acts as a server to implement the three-way handshake message process and establish a TCP connection with the user terminal.

[0129] In the specific implementation, if the index value to be matched does not match the index value of the index queue, it proves that the instance does not exist. The TCP proxy establishes a corresponding index instance for the TCP link and identifies it with the index value of the index queue. The instance is initialized to a learning state and the creation time of the instance is recorded. The number of initialized link creation times is 0.

[0130] It is understandable that in order to further shorten the TCP connection establishment delay of the user terminal, the uplink resource pre-allocation mechanism within the 5G base station can be used to allocate UL grant to the third handshake message in the TCP connection in advance, reducing the SR and BSR protocol processes of the 5G air interface and saving the transmission delay of two air interface messages. Fig. 9 As shown, Fig. 9 Schematic diagram of TCP connection establishment architecture with user terminal. When the TCP proxy receives the TCP connection establishment request message from UE, it receives the first handshake message. Fig. 9 In the TCP SYN, the TCP proxy first responds to the second handshake message to the UE, that is, Fig. 9In the SYNACK, the TCP proxy notifies the MAC module of the base station to allocate UL grant resources to the UE. The resource size = IP header length + TCP header length + SDAP header length + PDCP header length + RLC header length + MAC header length + reserved bytes (12 bytes, TCP or IP extension field) = 64, and notifies the UE through the DCI message. The UE receives the handshake response message. If it follows the original message flow, it should first send an SR, and then send a BSR to apply for uplink resources after receiving the response. After receiving the UL grant, it will then send the third handshake message. However, in this embodiment, since the UL grant resources have been notified to the UE in advance after the second handshake message, that is, the base station has already allocated UL grant resources to the UE at this time, the UE does not need to send SR and BSR for applying for uplink resources, so the UE directly sends the third handshake message. The base station receives the third handshake message, and the TCP connection is successfully established. The TCP connection establishment delay is shortened and the TCP connection establishment efficiency is improved.

[0131] It should be noted that after the TCP connection with the user terminal is successfully established, the TCP proxy, as a client, establishes a TCP connection with the server. After step S17', it also includes: controlling the TCP proxy to initiate a second TCP connection request with the server to establish a TCP connection with the server; controlling the TCP proxy to perform data transmission between the user terminal and the server; after the data transmission is completed, controlling the TCP proxy to release the TCP connection with the user terminal; after the TCP connection with the user terminal is released, controlling the TCP proxy to release the TCP connection with the server.

[0132] It should be understood that when the TCP proxy acts as a client to establish a TCP connection with the server, the TCP proxy initiates a second TCP connection establishment request to establish a TCP connection with the server. After the connection is established, data transmission can be started on the two links. After the data transmission is completed, the TCP proxy first releases the TCP connection between the user terminal, and after the TCP connection between the TCP proxy and the user terminal is released, and the time interval between the user terminal of the TCP proxy instance having no TCP connection is greater than the preset time interval threshold, the TCP proxy releases the TCP connection with the server. It does not follow the terminal's TCP connection to delete the link, thus shielding the problem of low TCP connection rate caused by TCP link congestion on the network side.

[0133] In this embodiment, when the current state is the initial learning state, the TCP proxy is controlled to start and a TCP proxy instance is created; an index queue is obtained based on the TCP proxy instance, and an index value of the index queue is set; a first TCP connection establishment request initiated by a user terminal is responded to; the first TCP connection establishment request is identified to obtain a protocol identifier; when the protocol identifier satisfies the first protocol identifier value, a first handshake message for TCP link establishment is obtained; an index value to be matched of the first handshake message is obtained; a TCP connection with the user terminal is established through the index value to be matched, thereby shortening the TCP connection establishment delay and improving the TCP connection establishment efficiency.

[0134] Reference Fig.10 , Fig.10 It is a structural block diagram of the first embodiment of the TCP transmission device of the present invention.

[0135] like Fig.10 As shown, the TCP transmission device proposed in the embodiment of the present invention includes:

[0136] The acquisition module 10 is used to acquire the current state of the TCP proxy.

[0137] The statistics module 20 is used to count the link establishment frequency of the TCP proxy instance in the TCP proxy when the current state is the working state.

[0138] The release module 30 is used to initiate a TCP link release process based on the link establishment frequency and perform TCP connection release control.

[0139] This embodiment applies the TCP transmission method to a base station, on which a TCP proxy is deployed, and obtains the current state of the TCP proxy; when the current state is a working state, counts the link establishment frequency of the TCP proxy instance in the TCP proxy; and initiates a TCP link release process based on the link establishment frequency to perform TCP connection release control, thereby reducing the TCP connection establishment delay and reducing the waste of transmission resources.

[0140] In one embodiment, the release module 30 is also used to initiate a TCP link release process to the user terminal based on the link establishment frequency, release the TCP connection established between the user terminal; record the release time of the TCP connection established between the user terminal, and complete the TCP connection release control between the user terminal.

[0141] In one embodiment, the release module 30 is also used to obtain the current time; calculate the time interval without TCP connection of the user terminal corresponding to each TCP proxy instance through the current time and the release time; when the time interval is greater than a preset time interval threshold, control the TCP proxy to enter the proxy release state.

[0142] In one embodiment, the acquisition module 10 is further used to control the TCP proxy instance in the TCP proxy to release the TCP connection with the server when the current state is the proxy release state; release instance resources to complete the release of the TCP connection with the server.

[0143] In one embodiment, the acquisition module 10 is also used to control the startup of the TCP proxy and create a TCP proxy instance when the current state is the initial learning state; obtain an index queue based on the TCP proxy instance and set the index value of the index queue; respond to a first TCP connection establishment request initiated by a user terminal; identify the first TCP connection establishment request to obtain a protocol identifier; when the protocol identifier meets the first protocol identifier value, obtain a first handshake message for TCP link establishment; obtain the index value to be matched of the first handshake message; and establish a TCP connection with the user terminal through the index value to be matched.

[0144] In one embodiment, the acquisition module 10 is also used to match the index value to be matched with the index value of the index queue; when the index value to be matched matches the index value of the index queue, obtain the target TCP proxy instance; record the number of link establishment times of the target TCP proxy instance and update the link establishment time; control the TCP proxy to initiate a second handshake message process and a third handshake message process to complete the TCP connection with the user terminal.

[0145] In one embodiment, the acquisition module 10 is also used to control the TCP proxy to initiate a second TCP connection establishment request with the server to establish a TCP connection with the server; control the TCP proxy to transmit data between the user terminal and the server; after the data transmission is completed, control the TCP proxy to release the TCP connection with the user terminal; after the TCP connection with the user terminal is released, control the TCP proxy to release the TCP connection with the server.

[0146] In addition, an embodiment of the present invention further provides a storage medium, on which a TCP transmission program is stored. When the TCP transmission program is executed by a processor, the steps of the TCP transmission method described above are implemented.

[0147] Since the storage medium adopts all the technical solutions of all the above embodiments, it has at least all the beneficial effects brought by the technical solutions of the above embodiments, which will not be described one by one here.

[0148] It should be understood that the above is only an example and does not constitute any limitation on the technical solution of the present invention. In specific applications, technicians in this field can make settings as needed, and the present invention does not limit this.

[0149] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of the present invention. In practical applications, technicians in this field can select part or all of them according to actual needs to achieve the purpose of the present embodiment, and no limitation is made here.

[0150] In addition, for technical details not fully described in this embodiment, reference can be made to the TCP transmission method provided in any embodiment of the present invention, and will not be repeated here.

[0151] In addition, it should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.

[0152] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0153] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory (ROM) / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0154] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A TCP transmission method, characterized in that: The TCP transmission method is applied to a base station, on which a TCP proxy is deployed, and the method comprises: Get the current status of the TCP proxy; When the current state is a working state, counting the link establishment frequency of the TCP proxy instance in the TCP proxy; Initiate a TCP link release process to the user terminal based on the link establishment frequency, and release the TCP connection established with the user terminal; Recording the release time of the TCP connection established with the user terminal, and completing the TCP connection release control with the user terminal; Get the current time; Calculate the time interval in which the user terminal corresponding to each TCP proxy instance has no TCP connection by using the current time and the release time; When the time interval is greater than a preset time interval threshold, the TCP proxy is controlled to enter a proxy release state.

2. The TCP transmission method according to claim 1, characterized in that: After obtaining the current state of the TCP proxy, the method further includes: When the current state is the proxy release state, controlling the TCP proxy instance in the TCP proxy to release the TCP connection with the server; Release instance resources and complete the release of the TCP connection with the server.

3. The TCP transmission method according to claim 1, wherein: After obtaining the current state of the TCP proxy, the method further includes: When the current state is an initial learning state, controlling the TCP proxy to start and creating a TCP proxy instance; Obtaining an index queue based on the TCP proxy instance, and setting an index value of the index queue; Responding to a first TCP connection establishment request initiated by a user terminal; Identify the first TCP connection establishment request to obtain a protocol identifier; When the protocol identifier satisfies the first protocol identifier value, obtaining a first handshake message for TCP link establishment; Obtaining a to-be-matched index value of the first handshake message; A TCP connection is established with the user terminal through the to-be-matched index value.

4. The TCP transmission method according to claim 3, characterized in that: The establishing a TCP connection with the user terminal through the to-be-matched index value includes: Matching the to-be-matched index value with the index value of the index queue; When the to-be-matched index value matches the index value of the index queue, a target TCP proxy instance is obtained; Record the number of link establishment times of the target TCP proxy instance and update the link establishment time; The TCP proxy is controlled to initiate a second handshake message flow and a third handshake message flow to complete the TCP connection with the user terminal.

5. The TCP transmission method according to claim 3, characterized in that: After establishing a TCP connection with the user terminal through the to-be-matched index value, the method further includes: Control the TCP proxy to initiate a second TCP connection establishment request with the server, and establish a TCP connection with the server; Controlling the TCP proxy to perform data transmission between the user terminal and the server; After the data transmission is completed, controlling the TCP proxy to release the TCP connection between the TCP proxy and the user terminal; After the TCP connection with the user terminal is released, the TCP proxy is controlled to release the TCP connection with the server.

6. A TCP transmission device, characterized in that: The TCP transmission device comprises: The acquisition module is used to obtain the current status of the TCP proxy; A statistics module, used for counting the link establishment frequency of the TCP proxy instance in the TCP proxy when the current state is a working state; A release module, configured to initiate a TCP link release process to a user terminal based on the link establishment frequency, and release the TCP connection established with the user terminal; Recording the release time of the TCP connection established with the user terminal, and completing the TCP connection release control with the user terminal; Get the current time; Calculate the time interval in which the user terminal corresponding to each TCP proxy instance has no TCP connection by using the current time and the release time; When the time interval is greater than a preset time interval threshold, the TCP proxy is controlled to enter a proxy release state.

7. A TCP transmission device, characterized in that: The TCP transmission device comprises: a memory, a processor, and a TCP transmission program stored in the memory and executable on the processor, wherein the TCP transmission program is configured to implement the TCP transmission method according to any one of claims 1 to 5.

8. A storage medium, characterized in that: The storage medium stores a TCP transmission program, and when the TCP transmission program is executed by the processor, the TCP transmission method according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • State synchronization method and device based on TCP proxy

    CN105379222A

  • Resource processing method, server, electronic equipment and storage medium

    CN111885103A