TCP connection optimization method, device, system, storage medium and equipment
By initiating a trust connection request when the client confirms that the server meets the trust connection conditions, reducing the number of TCP handshakes, the problem of slow current TCP connection speed is solved, improving HTTP request efficiency and maintaining security and stability.
Patent Information
- Application Number
- CN202211213067.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-30
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2042-09-30
AI Technical Summary
In the scenario where multiple connections have been established and a large amount of data have been transmitted, the communication connection speed based on three-time handshake is slow, which affects the transmission efficiency.
When the client confirms that the server meets the trust connection conditions, it initiates a trust connection request, carries the predetermined negotiation information and agreed time value, reduces the number of handshakes, and directly processes business information. Negotiation information is generated based on locally stored communication records and historical information, and the agreed time value is used to verify timeliness.
Reduces the number of handshakes on TCP connections, reduces RTT, and improves HTTP request efficiency by about 10%, taking into account security, reliability and stability.
Smart Images

Figure CN115529341B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a TCP connection optimization method, device, system, computer-readable storage medium and computer equipment. Background Art
[0002] TCP (Transmission Control Protocol) is a connection-oriented, reliable, byte-stream-based transport layer communication protocol. TCP provides reliable connection services and uses a three-way handshake to establish a connection, and the server must be ready to accept external connections. This is done by calling the socket, bind, and listen functions, which is called passive open. Figure 1 As shown, specifically:
[0003] First handshake: The client performs an active open by calling connect. This causes the client TCP to send a SYN (synchronous) segment (SYN=J), which tells the server the initial sequence number of the data that the client will send in the connection, and enters the SYN_SEND state, waiting for the server's confirmation.
[0004] Second handshake: The server must confirm the client's SYN and send a SYN segment, which contains the initial sequence number of the data that the server will send in the same connection. The server sends SYN and ACK (acknowledgement) to the client's SYN in a single byte, and the server enters the SYN_RECV state.
[0005] The third handshake: The client receives the SYN+ACK from the server and sends a confirmation segment to the server. After this segment is sent, the client and server enter the ESTABLISHED state, completing the three-way handshake.
[0006] The initial sequence number of the client is J, and the initial sequence number of the server is K. The confirmation number in the ACK is the next sequence number expected by the end sending this ACK. Because SYN only occupies one byte of sequence number space, the confirmation number in each SYN ACK is the corresponding initial sequence number plus 1. Similarly, the confirmation number in each FIN (indicating the end) ACK is the FIN sequence number plus 1.
[0007] However, the above connection method lacks flexibility. For the two ends that have established multiple connections and transmitted multiple data, there is mutual trust between the two ends, but the communication connection still needs to be achieved based on the three-way handshake, and the connection speed is slow, which affects the transmission efficiency. Summary of the invention
[0008] In order to solve at least one of the above-mentioned technical defects, the present invention provides a TCP connection optimization method and corresponding apparatus, system, computer-readable storage medium and computer equipment according to the following technical solution.
[0009] According to one aspect, an embodiment of the present invention provides a TCP connection optimization method, comprising the following steps:
[0010] Make sure that the server to be connected meets the trust connection conditions;
[0011] Initiate a trust connection request to the server, the trust connection request carrying predetermined negotiation information, agreed time value and current business information, so that the server, after verifying the security of the client according to the negotiation information and the agreed time value, establishes a TCP connection between the two and processes the current business information;
[0012] The negotiation information is generated according to the locally stored communication record with the server and the historical communication information sent by the server at the end of the last TCP connection.
[0013] In some feasible embodiments, determining that the server to be connected meets the trust connection condition includes:
[0014] Determine that a TCP connection has been established with the server to be connected, and the time between the current time and the end of the last TCP connection with the server is not greater than the agreed time limit.
[0015] In some feasible embodiments, determining that a TCP connection has been established with the server to be connected includes:
[0016] Obtaining the received and stored historical communication information with the server to be connected; searching whether there is data consistent with the historical communication information in the locally stored communication records, and if so, determining that a TCP connection has been established with the server to be connected; or,
[0017] Make sure the server to be connected is pre-marked as a trusted connection target.
[0018] In some feasible embodiments, the negotiation information is generated according to the locally stored communication record with the server and the historical communication information sent by the server at the end of the last TCP connection, including:
[0019] Selecting a communication information with the server from the locally stored communication records;
[0020] Obtain the last communication information from the historical communication information sent by the server at the end of the last TCP connection;
[0021] Negotiation information is generated according to the first communication information and the last communication information.
[0022] In some feasible embodiments, generating negotiation information according to the first communication information and the last communication information includes:
[0023] The first communication information and the last communication information are encrypted and combined according to a predetermined encryption algorithm to generate negotiation information.
[0024] In some feasible embodiments, the agreed time value is sent by the server when the last TCP connection ends.
[0025] In addition, according to another aspect, an embodiment of the present invention provides a TCP connection optimization device, including:
[0026] A condition determination module, used to determine whether the server to be connected meets the trust connection condition;
[0027] A trusted connection module, used to initiate a trusted connection request to the server, wherein the trusted connection request carries predetermined negotiation information, an agreed time value, and current business information, so that the server, after verifying the security of the client according to the negotiation information and the agreed time value, establishes a TCP connection between the two and processes the current business information;
[0028] The negotiation information is generated according to the locally stored communication record with the server and the historical communication information sent by the server at the end of the last TCP connection.
[0029] According to another aspect, an embodiment of the present invention provides a TCP connection optimization system, including: a client and a server;
[0030] The client is used to execute the above-mentioned TCP connection optimization method;
[0031] The server is used to establish a TCP connection between the two and process current business information after verifying the security of the client according to the negotiation information and the agreed time value.
[0032] According to another aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned TCP connection optimization method is implemented.
[0033] According to another aspect, an embodiment of the present invention provides a computer device, wherein the computer includes one or more processors; a memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory and configured to be executed by the one or more processors, and the one or more computer programs are configured to: execute the above-mentioned TCP connection optimization method.
[0034] Compared with the prior art, the present invention has the following beneficial effects:
[0035] The TCP connection optimization method, device, computer-readable storage medium and computer equipment provided by the present invention initiate a trusted connection request to the server when the client confirms that the server meets the trusted connection conditions, and the server directly processes the current business information after successfully verifying the security of the client. The trusted connection can reduce one handshake, and the data request can reduce one RTT (Round Trip Time, the time for a round trip from the client to the server). In theory, the time for the three-way handshake of an HTTP request accounts for between 10% and 30% of the time for the completion of the HTTP request. This method not only takes into account the security, reliability and stability of the three-way handshake of the TCP connection, but also improves the efficiency of HTTP requests by about 10%.
[0036] Additional aspects and advantages of the present invention will be given in part in the following description, which will become obvious from the following description, or may be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0038] Figure 1 A method flow chart of a TCP connection optimization method provided by an embodiment of the present invention;
[0039] Figure 2 A schematic diagram of the structure of a TCP connection optimization device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0040] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be interpreted as limiting the present invention.
[0041] Those skilled in the art will appreciate that, unless otherwise stated, the singular forms "a", "an", "said" and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present invention refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.
[0042] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0043] The TCP connection optimization method, apparatus, computer-readable storage medium, and computer device provided in this application are intended to solve the above technical problems in the prior art.
[0044] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as generally understood by those skilled in the art in the art to which the present invention belongs. It should also be understood that terms such as those defined in general dictionaries should be understood to have meanings consistent with the meanings in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless specifically defined as herein.
[0045] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0046] The embodiment of the present invention provides a TCP connection optimization method, which is applied to a client, such as Figure 1 As shown, the method includes:
[0047] Step S110: Determine whether the server to be connected meets the trust connection condition.
[0048] The TCP connection is established between the client and the server. The TCP connection is initiated by the client to the server. The TCP connection optimization method provided by the embodiment of the present invention occurs in the application scenario where the client and the server are not establishing a connection for the first time. The trusted connection should be established on the basis that the client and the server to be connected have established a TCP connection. The server to be connected has established a TCP connection with the client, which is a condition or one of the conditions for the server to meet the trusted connection. The client and the server can agree to use the communication record when the two established a connection last time as the basis for setting the trusted connection condition for this connection.
[0049] In the application scenario where the client and server establish a connection for the first time, the client and server use a three-way handshake to establish the connection. After the connection is successfully established, the client and server transmit data normally and exchange data. During the data exchange process, the client and server need to record the messages they send and receive respectively. The messages contain a unique message identifier - the message sequence number and the timestamp of the message generation. The client and server both store communication records locally. For the client and server that have established a connection, the information recorded by both for this connection should be exactly the same, including the exchanged messages and the corresponding message sequence number and timestamp.
[0050] The prefix of the message sequence number can be marked as C if it is sent by the client and can be marked as S if it is sent by the server. The prefix of the timestamp can be marked as CT if it is generated by the client and can be marked as ST if it is generated by the server.
[0051] For example, during a connection, the client sent 3 messages and received 4 messages. The message sequence numbers of these 7 messages are C1, S1, C2, S2, C3, S3, S4, and the timestamps are CT1, ST1, CT2, ST2, CT3, ST3, ST4. As mentioned above, each message contains message content, message sequence number and timestamp. Therefore, both the client and the server store 7 messages locally for this connection, corresponding to message sequence numbers C1~C3 and S1~S4, and corresponding timestamps CT1~CT3 and ST1~ST4.
[0052] In this embodiment, the communication record when the client and the server established a connection last time is used as the basis for setting the trust connection condition for this connection.
[0053] In a possible implementation, at the end of each TCP connection between the client and the server, it is agreed that the server randomly extracts one communication information from its communication record, such as the exchanged messages between C1 and CT1, S1 and ST1, and the last communication information, such as the exchanged messages between C3 and CT3, S4 and ST4, as historical communication information and sends them to the client during the four handshakes. In other words, for a connection between a client and a server that is not established for the first time, the client receives and stores the historical communication information sent by the server during the last four handshakes.
[0054] For this embodiment, determining whether a TCP connection has been established with the server to be connected includes:
[0055] Obtaining the received and stored historical communication information with the server to be connected; searching whether there is data consistent with the historical communication information in the locally stored communication records, and if so, determining that a TCP connection has been established with the server to be connected; or,
[0056] Make sure the server to be connected is pre-marked as a trusted connection target.
[0057] In one possible implementation, when a client is currently preparing to initiate a connection request to a server, it should first determine whether it is the first time to establish a TCP connection with the server, specifically, determine whether there is a communication record with the server stored locally or whether there is historical communication information sent by the server stored; if there is no communication record or historical communication information, it is determined that this is the first time that the client and the server have established a TCP connection, and the client only initiates a normal connection request, and subsequently establishes a connection with the server using a three-way handshake; if there is a communication record or historical communication information, it is determined that the client and the server may have established a TCP connection before, and further verifies the server Whether the historical communication information sent at the end of the last TCP connection is consistent with the communication record stored locally by the client. If they are consistent, it means that the client has indeed established a TCP connection with the server, the server can meet the trust connection conditions, the security verification of the server is successful, and the client has confirmed the identity of the server. If they are inconsistent, it means that the client has never established a TCP connection with the server, the server fails to meet the trust connection conditions, the security verification of the server fails, the client cannot confirm the identity of the server, and the client can only initiate a normal connection request, and then use a three-way handshake to establish a connection with the server.
[0058] In a possible implementation, the above-mentioned step of verifying whether the server meets the trust connection condition can also be performed immediately by the client after receiving the historical communication information sent by the server during the last four handshakes, and marking the server as the first connection or the trusted connection according to the verification result. When preparing to initiate a connection request to the server, it is determined whether it meets the trust connection condition according to the mark of the server. If the server is marked as the first connection, the trust connection condition is not met. If it is marked as a trusted connection, the trust connection condition is met.
[0059] Step S120: Initiate a trusted connection request to the server, the trusted connection request carrying predetermined negotiation information, an agreed time value and current business information, so that the server establishes a TCP connection between the two and processes the current business information after verifying the security of the client based on the negotiation information and the agreed time value; wherein the negotiation information is generated based on locally stored communication records with the server and historical communication information sent by the server at the end of the last TCP connection.
[0060] For this embodiment, after determining that the server to be connected meets the trust connection condition, the client initiates a trust connection request to the server. Compared with a common connection request, the trust connection request also carries pre-set negotiation information.
[0061] In one possible implementation, the client randomly extracts communication information from its locally stored communication records with the server, such as the exchanged messages between C2 and CT2, S2 and ST2, and the last communication information in the stored historical communication information sent by the server during the last four waves, such as the exchanged messages between C3 and CT3, S4 and ST4, and merges the information to generate the negotiation information.
[0062] The agreed time limit is used to limit the time limit of the negotiation information, and the client and the server agree on an agreed time limit in advance. The agreed time limit can be set according to actual application requirements, for example, it can be 30 minutes, or a specific time such as one day. The embodiment of the present invention does not limit the specific value of the agreed time limit.
[0063] The current service information is the information that the client wants to transmit to the server in this connection.
[0064] For this embodiment, after receiving the trust connection request initiated by the client, the server extracts the negotiation information, agreed time value and current business information carried by the trust connection request. The server first verifies the agreed time value, and after the verification is successful, further verifies whether the negotiation information is consistent with the communication record stored locally by the server. If they are consistent, it means that the client has indeed established a TCP connection with this server, the security verification of the client is successful, and the server has confirmed the identity of the client. The server can directly process the current business information, and the TCP connection between the client and the server is formally established. If they are inconsistent, the security verification of the client fails, and the server cannot confirm the identity of the client, and the connection is automatically disconnected.
[0065] The TCP connection optimization method provided by the present invention initiates a trust connection request to the server when the client confirms that the server meets the trust connection conditions, and enables the server to directly process the current business information after successfully verifying the security of the client. The trust connection can reduce one handshake, and the data request can reduce one RTT (Round Trip Time, the time for a round trip from the client to the server). In theory, the time for the three-way handshake of an HTTP request accounts for between 10% and 30% of the time for completing an HTTP request. This method not only takes into account the security, reliability and stability of the three-way handshake of a TCP connection, but also improves the efficiency of HTTP requests by about 10%.
[0066] In some embodiments, the step S110 determines that the server to be connected meets the trusted connection conditions, including: determining that a TCP connection has been established with the server to be connected, and the time distance between the current moment and the end of the last TCP connection to the server is not greater than the agreed time value.
[0067] For this embodiment, the trust connection condition also includes an agreed time limit value for limiting time limit. The TCP connection optimization method provided by the embodiment of the present invention occurs in an application scenario where the client and the server are not establishing a connection for the first time. The trust connection should be established on the basis that the agreed time limit is met at the current moment and the client has established a TCP connection with the server to be connected. The time between the current moment and the end of the last TCP connection of the server is not greater than the agreed time limit value, and the server to be connected has established a TCP connection with the client, which is the condition that the server meets the trust connection.
[0068] The time when the last TCP connection with the server ends can be determined according to the timestamp of the last communication in the locally stored communication records.
[0069] The agreed time limit is used to limit the time limit, and the client and the server agree on an agreed time limit in advance. The agreed time limit can be set according to actual application requirements, for example, it can be 30 minutes, or a specific time such as one day. The embodiment of the present invention does not limit the specific value of the agreed time limit.
[0070] For this embodiment, determining whether a TCP connection has been established with the server to be connected includes:
[0071] Obtaining the received and stored historical communication information with the server to be connected; searching whether there is data consistent with the historical communication information in the locally stored communication records, and if so, determining that a TCP connection has been established with the server to be connected; or,
[0072] Make sure the server to be connected is pre-marked as a trusted connection target.
[0073] In one possible implementation, when a client is preparing to initiate a connection request to a server, it should first determine whether the time between the current time and the end of the last TCP connection to the server is greater than the agreed time limit. If so, it means that the time limit has been exceeded and the client and the server are deemed to be establishing a connection for the first time. The client can only initiate a normal connection request and subsequently establish a connection with the server using a three-way handshake.
[0074] If the time between the current time and the end of the last TCP connection to the server is not greater than the agreed time limit, the following steps are continued:
[0075] Determine whether it is the first time to establish a TCP connection with the server, specifically determine whether there is a communication record with the server stored locally or whether there is a historical communication information sent by the server stored; if there is no communication record or historical communication information, it is determined that this is the first time that the client and the server have established a TCP connection, then the client only initiates a normal connection request, and subsequently uses a three-way handshake to establish a connection with the server; if there is a communication record or historical communication information, it is determined that the client and the server may have established a TCP connection before, and further verify whether the historical communication information sent by the server at the end of the last TCP connection is consistent with the communication record stored locally by the client. If they are consistent, it means that the client has indeed established a TCP connection with the server, the server can meet the trust connection conditions, the security verification of the server is successful, and the client has confirmed the identity of the server; if they are inconsistent, it means that the client has never established a TCP connection with the server, the server fails to meet the trust connection conditions, the security verification of the server fails, the client cannot confirm the identity of the server, and the client can only initiate a normal connection request, and subsequently uses a three-way handshake to establish a connection with the server.
[0076] In one possible implementation, the above-mentioned step of verifying whether the server meets the trusted connection conditions can also be performed by the client immediately after receiving the historical communication information sent by the server during the last four handshakes, and marking the server as the first connection or trusted connection according to the verification result. When preparing to initiate a connection request to the server, it should first determine whether the time between the current moment and the end of the last TCP connection of the server is greater than the agreed time limit. If so, it means that the time limit has been exceeded, and it is regarded as the first time that the client and the server have established a connection. The client can only initiate a normal connection request, and then use the three-way handshake method to establish a connection with the server.
[0077] If the time between the current time and the end of the last TCP connection to the server is not greater than the agreed time limit, the following steps are continued:
[0078] Whether the server meets the trust connection condition is determined based on the server's mark. If the server is marked as the first connection, the trust connection condition is not met. If it is marked as a trusted connection, the trust connection condition is met.
[0079] In some embodiments, the historical communication information sent by the server to the client at the end of each TCP connection is encrypted information.
[0080] In a possible implementation, the server encrypts and merges the first communication information and the last communication information randomly extracted from the communication record according to a predetermined encryption algorithm, that is, concatenates two pairs of key strings to obtain encrypted historical communication information. After receiving the encrypted historical communication information, the client decrypts it according to the corresponding decryption algorithm to obtain the historical communication information, and continues to perform the corresponding steps described in the above embodiment.
[0081] In some embodiments, the negotiation information generated by the client and sent to the server is encrypted information.
[0082] In a possible implementation, the client encrypts and combines a communication message randomly selected from the communication record and the last communication message sent by the server at the last four handshakes according to a predetermined encryption algorithm, that is, concatenates two pairs of key strings to generate negotiation information. After receiving the encrypted negotiation information, the server decrypts it according to the corresponding decryption algorithm to obtain the negotiation information, and continues to perform the corresponding steps described in the above embodiment.
[0083] It can be understood that the encryption algorithm involved in the embodiment of the present invention and the necessity of encryption can be determined according to actual conditions. For example, the encryption algorithm can be a symmetric encryption algorithm. The embodiment of the present invention does not limit the specific algorithm used.
[0084] In addition, an embodiment of the present invention provides a TCP connection optimization device, such as Figure 2 As shown, the device comprises:
[0085] A condition determination module 10, used to determine whether the server to be connected meets the trust connection condition;
[0086] A trusted connection module 20 is used to initiate a trusted connection request to the server, wherein the trusted connection request carries predetermined negotiation information, an agreed time value, and current business information, so that the server establishes a TCP connection between the two and processes the current business information after verifying the security of the client according to the negotiation information and the agreed time value;
[0087] The negotiation information is generated according to the locally stored communication record with the server and the historical communication information sent by the server at the end of the last TCP connection.
[0088] In some feasible embodiments, the condition determination module 21 is specifically used to:
[0089] Determine that a TCP connection has been established with the server to be connected, and the time between the current time and the end of the last TCP connection with the server is not greater than the agreed time limit.
[0090] In some feasible embodiments, determining that a TCP connection has been established with the server to be connected includes:
[0091] Obtaining the received and stored historical communication information with the server to be connected; searching whether there is data consistent with the historical communication information in the locally stored communication records, and if so, determining that a TCP connection has been established with the server to be connected; or,
[0092] Make sure the server to be connected is pre-marked as a trusted connection target.
[0093] In some feasible embodiments, the negotiation information is generated according to the locally stored communication record with the server and the historical communication information sent by the server at the end of the last TCP connection, including:
[0094] Selecting a communication information with the server from the locally stored communication records;
[0095] Obtain the last communication information from the historical communication information sent by the server at the end of the last TCP connection;
[0096] Negotiation information is generated according to the first communication information and the last communication information.
[0097] In some feasible embodiments, generating negotiation information according to the first communication information and the last communication information includes:
[0098] The first communication information and the last communication information are encrypted and combined according to a predetermined encryption algorithm to generate negotiation information.
[0099] In some feasible embodiments, the agreed time value is sent by the server when the last TCP connection ends.
[0100] The contents of the method embodiments of the present invention are all applicable to the device embodiments. The functions specifically implemented by the device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method. Please refer to the description in the method embodiments for details, which will not be repeated here.
[0101] In addition, an embodiment of the present invention provides a TCP connection optimization system, including: a client and a server;
[0102] The client is used to execute the above-mentioned TCP connection optimization method;
[0103] The server is used to establish a TCP connection between the two and process current business information after verifying the security of the client according to the negotiation information and the agreed time value.
[0104] The contents of the method embodiments of the present invention are all applicable to the system embodiments. The functions specifically implemented by the system embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method. Please refer to the description in the method embodiments for details, which will not be repeated here.
[0105] In addition, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the TCP connection optimization method described in any of the above embodiments is implemented. Wherein, the computer-readable storage medium includes but is not limited to any type of disk (including floppy disk, hard disk, optical disk, CD-ROM, and magneto-optical disk), ROM (Read-Only Memory), RAM (Random Access Memory), EPROM (EraSable Programmable Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory), flash memory, magnetic card or optical card. That is, the storage device includes any medium that stores or transmits information in a readable form by a device (for example, a computer, a mobile phone), which can be a read-only memory, a disk or an optical disk, etc.
[0106] The contents of the method embodiments of the present invention are all applicable to the storage medium embodiments. The functions specifically implemented by the storage medium embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method. Please refer to the description in the method embodiments for details, which will not be repeated here.
[0107] In addition, an embodiment of the present invention further provides a computer device, which may be a server, a personal computer, a network device, etc. The computer device includes: one or more processors, a memory, and one or more computer programs, wherein the one or more computer programs are stored in the memory and configured to be executed by the one or more processors, and the one or more computer programs are configured to execute the TCP connection optimization method described in any of the above embodiments.
[0108] The contents of the method embodiments of the present invention are all applicable to the computer device embodiments. The functions specifically implemented by the computer device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method. Please refer to the description in the method embodiments for details, which will not be repeated here.
[0109] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0110] The above descriptions are only some embodiments of the present invention. It should be pointed out that, for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A TCP connection optimization method, characterized in that: Applied to the client, including the following steps: Make sure that the server to be connected meets the trust connection conditions; Initiate a trust connection request to the server, the trust connection request carrying predetermined negotiation information, agreed time value and current business information, so that the server, after verifying the security of the client according to the negotiation information and the agreed time value, establishes a TCP connection between the two and processes the current business information; Wherein, the negotiation information is generated based on the locally stored communication record with the server and the historical communication information sent by the server at the end of the last TCP connection; The step of determining that the server to be connected meets the trust connection condition includes: Determine that a TCP connection has been established with the server to be connected, and the time between the current time and the end of the last TCP connection with the server is not greater than the agreed time limit.
2. The TCP connection optimization method according to claim 1, characterized in that: The step of determining that a TCP connection has been established with the server to be connected includes: Obtaining the received and stored historical communication information with the server to be connected; searching whether there is data consistent with the historical communication information in the locally stored communication records, and if so, determining that a TCP connection has been established with the server to be connected; or, Make sure the server to be connected is pre-marked as a trusted connection target.
3. The TCP connection optimization method according to claim 1, characterized in that: The negotiation information is generated based on the locally stored communication record with the server and the historical communication information sent by the server at the end of the last TCP connection, including: Selecting a communication information with the server from the locally stored communication records; Obtain the last communication information from the historical communication information sent by the server at the end of the last TCP connection; Negotiation information is generated according to the first communication information and the last communication information.
4. The TCP connection optimization method according to claim 3, characterized in that: The generating negotiation information according to the first communication information and the last communication information includes: The first communication information and the last communication information are encrypted and combined according to a predetermined encryption algorithm to generate negotiation information.
5. The TCP connection optimization method according to claim 1, characterized in that: The agreed time value is sent by the server when the last TCP connection ends.
6. A TCP connection optimization device, characterized in that: Applied to the client, including: The condition determination module is used to determine that the server to be connected meets the trust connection condition, specifically including: determining that a TCP connection has been established with the server to be connected, and the time between the current time and the end of the last TCP connection with the server is not greater than the agreed time limit; A trusted connection module, used to initiate a trusted connection request to the server, wherein the trusted connection request carries predetermined negotiation information, an agreed time value, and current business information, so that the server, after verifying the security of the client according to the negotiation information and the agreed time value, establishes a TCP connection between the two and processes the current business information; The negotiation information is generated based on the locally stored communication record with the server and the historical communication information sent by the server at the end of the last TCP connection.
7. A TCP connection optimization system, characterized in that: include: Client and server; The client is used to execute the TCP connection optimization method according to any one of claims 1 to 5; The server is used to establish a TCP connection between the two and process current business information after verifying the security of the client according to the negotiation information and the agreed time value.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the TCP connection optimization method according to any one of claims 1 to 5 is implemented.
9. A computer device, characterized in that: It includes: one or more processors; Memory; One or more computer programs, wherein the one or more computer programs are stored in the memory and configured to be executed by the one or more processors, and the one or more computer programs are configured to: execute the TCP connection optimization method according to any one of claims 1 to 5.
