CN111224999A - Transmission protocol switching method, device, equipment and storage medium - Google Patents

Transmission protocol switching method, device, equipment and storage medium Download PDF

Info

Publication number
CN111224999A
CN111224999A CN202010071748.6A CN202010071748A CN111224999A CN 111224999 A CN111224999 A CN 111224999A CN 202010071748 A CN202010071748 A CN 202010071748A CN 111224999 A CN111224999 A CN 111224999A
Authority
CN
China
Prior art keywords
protocol
sequence number
transmission
server
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
CN202010071748.6A
Other languages
Chinese (zh)
Inventor
朱玉荣
刘洪献
张俊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Anhui Wenxiang Information Technology Co Ltd
Original Assignee
Anhui Wenxiang Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Anhui Wenxiang Information Technology Co Ltd filed Critical Anhui Wenxiang Information Technology Co Ltd
Priority to CN202010071748.6A priority Critical patent/CN111224999A/en
Publication of CN111224999A publication Critical patent/CN111224999A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/08Protocols for interworking; Protocol conversion

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Communication Control (AREA)

Abstract

The embodiment of the application discloses a transmission protocol switching method, a transmission protocol switching device, transmission protocol switching equipment and a storage medium. If the current network state is in an active state, the server may send a response message to the client within a preset time. And when the client determines that the corresponding information is received within the preset time, the current network state is good, and the first transmission protocol is continuously used for data transmission. And when the client determines that the corresponding information is not received within the preset time, the client indicates that the current network state is not in an active state, the client switches the transmission protocol and transmits data by using the switched transmission protocol. Namely, the client can switch the transmission protocol in real time according to the change of the network state, so that the normal transmission of data is ensured.

Description

Transmission protocol switching method, device, equipment and storage medium
Technical Field
The present application relates to the field of internet communication protocol technologies, and in particular, to a method, an apparatus, a device, and a storage medium for switching a transmission protocol.
Background
The communication system interconnection reference model has a seven-layer structure, namely an application layer, a presentation layer, a session layer, a transmission layer, a network layer, a data link layer and a physical layer from top to bottom. The transport layer defines end-to-end communication between host applications, and the two most common protocols of the transport layer are a Transmission Control Protocol (TCP) and a User Datagram Protocol (UDP), respectively.
In particular, TCP is a connection-oriented transport layer protocol that provides reliable transport services; UDP is a connectionless-oriented transport layer protocol, and the transmission reliability is not guaranteed. In practical application, the client uses a transport layer protocol for data transmission, however, when the network status changes, the user is required to manually configure the data transmission protocol, which causes data transmission interruption.
Disclosure of Invention
In view of this, embodiments of the present application provide a method, an apparatus, a device, and a storage medium for switching a transmission protocol, so as to automatically switch the transmission protocol according to a network state and ensure normal transmission of data.
In order to solve the above problem, the technical solution provided by the embodiment of the present application is as follows:
in a first aspect of an embodiment of the present application, a method for switching a transport protocol is provided, where the method is applied to a client, and the method includes:
sending heartbeat request information to a server through a first transmission protocol, wherein the heartbeat request information comprises an identifier of the client;
determining whether response information sent by the server after the heartbeat request is received within preset time;
if the response information sent by the server is not received within the preset time, switching to a second transmission protocol, and using the second transmission protocol to carry out data transmission; the first transmission protocol and the second transmission protocol are different transmission protocols;
and if the response information sent by the server is received within the preset time, using the first transmission protocol to carry out data transmission.
In one possible implementation, the first transport protocol and the second transport protocol are switched between a TCP protocol and a UDP protocol.
In one possible implementation manner, when the data transmission is performed using the UPD protocol, the performing data transmission includes:
and carrying out data transmission by using the UDP protocol and the KCP protocol.
In one possible implementation manner, the data transmission using the UDP protocol and the KCP protocol includes:
adding a sequence number field in the data to be transmitted, wherein the sequence number field is used for representing the sequence of each data to be transmitted;
sending the data to be transmitted including the sequence number field to the server;
receiving confirmation information sent by the server, wherein the confirmation information comprises the sequence number field;
and determining whether to retransmit the data according to the sequence number field in the data to be transmitted and the sequence number field in the confirmation information.
In one possible implementation, when the TCP protocol is used for data transmission, the method further includes:
sending a connection establishing request to the server, wherein the connection establishing request comprises a first sending sequence number;
receiving first reply information sent by the server after receiving the connection establishment request, wherein the first reply information comprises a second sending sequence number and a first confirmation sequence number, and the first confirmation sequence number is equal to the first sending sequence number plus 1;
and sending second reply information to the server to realize the connection establishment with the server, wherein the second reply information comprises a third sending sequence number and a second confirmation sequence number, and the second confirmation sequence number is equal to the second sending sequence number increased by 1.
In a second aspect of the embodiments of the present application, there is provided a transport protocol switching apparatus, where the apparatus is applied to a client, and the apparatus includes:
a first sending unit, configured to send heartbeat request information to a server through a first transmission protocol, where the heartbeat request information includes an identifier of the client;
a determining unit, configured to determine whether response information sent by the server after receiving the heartbeat request is received within a preset time;
the switching unit is used for switching to a second transmission protocol when the determination result of the determining unit does not receive the response information sent by the server within the preset time;
a transmission unit, configured to perform data transmission using the second transmission protocol, where the first transmission protocol and the second transmission protocol are different transmission protocols;
the transmission unit is further configured to use the first transmission protocol for data transmission when the determination result of the determination unit is that the response information sent by the server is received within the preset time.
In one possible implementation, the first transport protocol and the second transport protocol are switched between a TCP protocol and a UDP protocol.
In a possible implementation manner, when the UPD protocol is used for data transmission, the transmission unit is specifically configured to use the UDP protocol and the KCP protocol for data transmission.
In one possible implementation manner, the transmission unit includes:
the adding subunit is used for adding sequence number fields in the data to be transmitted, and the sequence number fields are used for representing the sequence of each piece of data to be transmitted;
the sending subunit is configured to send the data to be transmitted, which includes the sequence number field, to the server;
a receiving subunit, configured to receive acknowledgement information sent by the server, where the acknowledgement information includes the sequence number field;
and the determining subunit is used for determining whether to retransmit the data according to the sequence number field in the data to be transmitted and the sequence number field in the confirmation information.
In one possible implementation, when the TCP protocol is used for data transmission, the apparatus further comprises:
a second sending unit, configured to send a connection establishment request to the server, where the connection establishment request includes a first sending sequence number;
a receiving unit, configured to receive first reply information sent by the server after receiving the connection establishment request, where the first reply information includes a second sending sequence number and a first acknowledgement sequence number, and the first acknowledgement sequence number is equal to the first sending sequence number plus 1;
and the third sending unit is used for sending second reply information to the server so as to establish connection with the server, wherein the second reply information comprises a third sending sequence number and a second confirmation sequence number, and the second confirmation sequence number is equal to the increment of the second sending sequence number by 1.
In a third aspect of the present application, a computer-readable storage medium is provided, where instructions are stored, and when the instructions are executed on a terminal device, the instructions cause the terminal device to execute the transport protocol switching method according to the first aspect.
In a fourth aspect of the embodiments of the present application, an apparatus for implementing transport protocol switching is provided, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method for switching transmission protocols according to the first aspect when executing the computer program.
Therefore, the embodiment of the application has the following beneficial effects:
in the embodiment of the application, the client sends heartbeat request information to the server based on the currently used first transmission protocol so as to check whether the current network state is in an active state. If the current network state is in an active state, the server may send a response message to the client within a preset time. And when the client determines that the corresponding information is received within the preset time, the current network state is good, and the first transmission protocol is continuously used for data transmission. And when the client determines that the corresponding information is not received within the preset time, the client indicates that the current network state is not in an active state, the client switches the transmission protocol and transmits data by using the switched transmission protocol. Namely, the client can switch the transmission protocol in real time according to the change of the network state, so that the normal transmission of data is ensured.
Drawings
Fig. 1 is a schematic view of an application scenario provided in an embodiment of the present application;
fig. 2 is a flowchart of a method for switching a transmission protocol according to an embodiment of the present application;
fig. 3 is a structural diagram of a transport protocol switching apparatus according to an embodiment of the present application;
fig. 4 is a structural diagram of a device for implementing transport protocol switching according to an embodiment of the present application.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, embodiments accompanying the drawings are described in detail below.
To facilitate understanding of the technical solutions provided in the embodiments of the present application, refer to the application scenario embodiment shown in fig. 1, where the method for switching a transmission protocol provided in this embodiment may be applied to the client 10.
In practical application, the client 10 may send heartbeat request information to the server 20 according to a preset period, so that the server may send response information in time after receiving the heartbeat request information. If the network state is active, the server 20 may send a response message to the client 10 in time, and the client 10 determines that the response message is received within a preset time, and continues to transmit data using the current first transmission protocol without switching the transmission protocol. If the network status is in an inactive state, the server 20 may not be able to timely send the response message to the client 10, and the client 10 determines that the response message is not received within the preset time, and performs the transmission protocol switching, and performs the data transmission using the second transmission protocol.
Those skilled in the art will appreciate that the block diagram shown in fig. 1 is only one example in which embodiments of the present application may be implemented. The scope of applicability of the embodiments of the present application is not limited in any way by this framework.
It is noted that the client 10 may be hosted by a terminal, which may be any user equipment now existing, developing, or later developed that is capable of interacting with each other through any form of wired and/or wireless connection (e.g., Wi-Fi, LAN, cellular, coaxial cable, etc.), including but not limited to: smart wearable devices, smart phones, non-smart phones, tablets, laptop personal computers, desktop personal computers, minicomputers, midrange computers, mainframe computers, and the like, either now in existence, under development, or developed in the future. The embodiments of the present application are not limited in any way in this respect. It should be further noted that the server 20 in the embodiment of the present application may be an example of an existing, developing or future-developed device capable of data transmission and reception. The embodiments of the present application are not limited in any way in this respect.
Based on the above description, the following describes, with reference to the accompanying drawings, a transport protocol switching method provided in an embodiment of the present application, where as shown in a flowchart of a method shown in fig. 2, the method may be applied to a client, and the method may include:
s201: and sending heartbeat request information to the server through a first transmission protocol.
In this embodiment, the client defaults to data transmission using the first transmission protocol, and may send heartbeat request information to the server in real time or according to a preset period during the data transmission process, so as to monitor changes in the current network state. The heartbeat request information comprises the identification of the client, so that the server can acquire the client to which the heartbeat request information received by the server belongs.
Wherein the first transport protocol may be a TCP protocol, which is a connection-oriented, reliable process-to-process communication protocol. The TCP protocols can provide a duplex service, i.e. data can be transmitted in both directions at the same time, and each TCP protocol has a sending buffer and a receiving buffer for temporarily storing data. The first transmission protocol may also be a UDP protocol, which is a connectionless and reliability-uncertain transmission protocol that is located in a transmission layer with a TCP protocol, and although reliability cannot be guaranteed, delay is small in a data transmission process, and data transmission efficiency is high.
S202: determining whether response information sent by the server after receiving the heartbeat request is received within a preset time, if not, executing S203; if so, S204 is performed.
It can be understood that, if the network status is more active, the server may send a response message to the client in time, which indicates that the client may receive the response message sent by the server within the preset time, and then S204 is performed. If the network state is an inactive state, the server cannot timely send or cannot send response information to the client, and the client cannot receive the response information sent by the server within the preset time, then S203 is executed.
The preset time may be set according to an actual application situation, for example, 1 second, 2 seconds, and the like, and this embodiment is not limited herein.
S203: and switching to a second transmission protocol, and transmitting data by using the second transmission protocol.
That is, if the client does not receive the response message sent by the server within the preset time, the client switches to the second transmission protocol, so as to transmit data by using the second transmission protocol. Wherein the first transmission protocol and the second transmission protocol are different transmission protocols. It is to be understood that the second transport protocol may be a UDP protocol when the first transport protocol is a TCP protocol, and a TCP protocol when the first transport protocol is a UDP protocol. That is, the first transport protocol and the second transport protocol are switched between the TCP protocol and the UDP protocol.
It should be noted that, when data transmission is performed by using the TCP protocol, because the TCP protocol is a connection-oriented protocol, before data transmission is performed by using the TCP protocol, the client needs the server to establish a connection, specifically:
1) and sending a connection establishment request to the server.
In this embodiment, when the client performs data transmission by using the TCP protocol, a connection establishment request is first sent to the server, where the connection establishment request includes a first sending sequence number. Specifically, the client sends a synchronization Sequence number (SYN) message to the server, where the SYN message carries a first sending Sequence number seq ═ x.
2) And receiving first reply information sent by the server after receiving the connection establishment request.
After receiving a setup request sent by a client, a server sends first reply information to the client, wherein the first reply information comprises a second sending sequence number and a first confirmation signal, and the first confirmation sequence number is equal to the first sending sequence number plus 1. Specifically, the server replies a SYN + ACK message to the client, where the second sending sequence number seq ═ y in the SYN message, and the first acknowledgement sequence number ACK ═ x +1 in the ACK message.
3) And sending the second reply message to the server to realize the connection establishment with the server.
And the client sends second reply information to the server after receiving the first reply information sent by the server, wherein the second reply information comprises a second confirmation signal, and the second confirmation signal is equal to the second sending sequence number increased by 1. Specifically, the client sends an ACK message to the server, where the ACK message includes the second acknowledgement signal ACK ═ y + 1.
Through the signaling interaction, the client and the server successfully establish connection, and then data transmission can be carried out by utilizing a TCP protocol.
S204: the data transmission is performed using the first transmission protocol.
And if the response information sent by the server is received within the preset time, continuing to use the first transmission protocol for data transmission.
It can be understood that the UDP protocol is a connectionless protocol, the transmission process is unreliable, packet loss occurs, and the like, and in order to ensure that the packet loss request can be known when the UDP protocol is used for transmission, the UDP protocol and the KCP protocol can be used in combination, and data transmission is performed by using the UDP protocol and the KCP protocol. Wherein the kcp protocol is a reliable transport layer protocol of the transport layer. Specifically, this can be achieved by:
1) and adding a sequence number field in the data to be transmitted, wherein the sequence number field is used for representing the sequence of each data to be transmitted.
2) And sending the data to be transmitted including the sequence number field to the server.
In this embodiment, before data transmission, the client adds a sequence number field to the data to be transmitted, where the sequence number field is used to indicate the sequence of each data to be transmitted. Specifically, the sequence number field is sequentially increased according to the transmission order of each data to be transmitted. And meanwhile, the server which adds the sequence number field and transmits the data to be transmitted.
3) And receiving confirmation information sent by the server, wherein the confirmation information comprises a sequence number field.
After receiving the data to be transmitted sent by the client, the server extracts the sequence number field from the data to be transmitted, generates confirmation information and sends the confirmation information to the client so as to inform the client that the data to be transmitted is correctly received. Because the confirmation information includes the sequence number field, the client can confirm that the server has received the data to be transmitted corresponding to the sequence number field according to the sequence number field.
4) And determining whether to retransmit the data according to the sequence number field in the data to be transmitted and the sequence number field in the confirmation information.
It can be understood that, since the sequence number field in the to-be-transmitted data is the same as the sequence number field in the acknowledgement information, after the client receives the acknowledgement information, it can determine which to-be-transmitted data is lost according to the sequence number field in the to-be-transmitted data sent by the client and the sequence number field in the acknowledgement information, and then determine data retransmission. For example, the client sends the data to be transmitted with sequence number fields 1, 2, 3, 4, and 5 to the server, but if the sequence number field of the received acknowledgement information is 1, 2, 4, and 5, it indicates that the data to be transmitted with sequence number field 3 is not correctly received by the server, and the data to be transmitted with sequence number field 3 may be retransmitted.
Based on the above description, the client sends heartbeat request information to the server based on the currently used first transmission protocol to check whether the current network status is in an active state. If the current network state is in an active state, the server may send a response message to the client within a preset time. And when the client determines that the corresponding information is received within the preset time, the current network state is good, and the first transmission protocol is continuously used for data transmission. And when the client determines that the corresponding information is not received within the preset time, the client indicates that the current network state is not in an active state, the client switches the transmission protocol and transmits data by using the switched transmission protocol. Namely, the client can switch the transmission protocol in real time according to the change of the network state, so that the normal transmission of data is ensured.
Based on the foregoing method embodiment, an embodiment of the present application provides a device for switching a transport protocol, and as shown in fig. 3, the device is applied to a client, and the device may include:
a first sending unit 301, configured to send heartbeat request information to a server through a first transmission protocol, where the heartbeat request information includes an identifier of the client;
a determining unit 302, configured to determine whether response information sent by the server after receiving the heartbeat request is received within a preset time;
a switching unit 303, configured to switch to a second transmission protocol if the determination result of the determining unit is that the response information sent by the server is not received within the preset time;
a transmission unit 304, configured to perform data transmission using the second transmission protocol, where the first transmission protocol and the second transmission protocol are different transmission protocols;
the transmission unit is further configured to use the first transmission protocol for data transmission when the determination result of the determination unit is that the response information sent by the server is received within the preset time.
In some possible implementations, the first transport protocol and the second transport protocol switch between a TCP protocol and a UDP protocol.
In some possible implementations, when the UPD protocol is used for data transmission, the transmission unit is specifically configured to use the UDP protocol and the KCP protocol for data transmission.
In some possible implementations, the transmission unit includes:
the adding subunit is used for adding sequence number fields in the data to be transmitted, and the sequence number fields are used for representing the sequence of each piece of data to be transmitted;
the sending subunit is configured to send the data to be transmitted, which includes the sequence number field, to the server;
a receiving subunit, configured to receive acknowledgement information sent by the server, where the acknowledgement information includes the sequence number field;
and the determining subunit is used for determining whether to retransmit the data according to the sequence number field in the data to be transmitted and the sequence number field in the confirmation information.
In some possible implementations, when the first transmission protocol is a UDP protocol and the second transmission protocol is a TCP protocol, after the switching to the second transmission protocol, the apparatus further includes:
a second sending unit, configured to send a connection establishment request to the server, where the connection establishment request includes a first sending sequence number;
a receiving unit, configured to receive first reply information sent by the server after receiving the connection establishment request, where the first reply information includes a second sending sequence number and a first acknowledgement sequence number, and the first acknowledgement sequence number is equal to the first sending sequence number plus 1;
and the third sending unit is used for sending second reply information to the server so as to establish connection with the server, wherein the second reply information comprises a third sending sequence number and a second confirmation sequence number, and the second confirmation sequence number is equal to the increment of the second sending sequence number by 1.
It should be noted that, implementation of each unit in this embodiment may refer to the above method embodiment, and this embodiment is not described herein again.
In addition, an embodiment of the present application provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and when the instructions are executed on a terminal device, the terminal device is caused to execute the transmission protocol switching method.
The embodiment of the application provides a device for realizing transmission protocol switching, which comprises: the processor executes the computer program to realize the transmission protocol switching method.
Specifically, refer to fig. 4, which is a schematic structural diagram of an apparatus for implementing a transport protocol switching according to an embodiment of the present application. The switching device 400 shown in fig. 4 comprises at least one processor 401, and at least one memory 402, a bus 403, connected to the processor 401; the processor 401 and the memory 402 complete communication with each other through the bus 403; the processor 401 is configured to call program instructions in the memory 402 to execute the transport protocol switching method according to any one of the above embodiments.
Based on the above description, the client sends heartbeat request information to the server based on the currently used first transmission protocol to check whether the current network status is in an active state. If the current network state is in an active state, the server may send a response message to the client within a preset time. And when the client determines that the corresponding information is received within the preset time, the current network state is good, and the first transmission protocol is continuously used for data transmission. And when the client determines that the corresponding information is not received within the preset time, the client indicates that the current network state is not in an active state, the client switches the transmission protocol and transmits data by using the switched transmission protocol. Namely, the client can switch the transmission protocol in real time according to the change of the network state, so that the normal transmission of data is ensured.
It should be noted that, in the present specification, the embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other. For the system or the device disclosed by the embodiment, the description is simple because the system or the device corresponds to the method disclosed by the embodiment, and the relevant points can be referred to the method part for description.
It should be understood that in the present application, "at least one" means one or more, "a plurality" means two or more. "and/or" for describing an association relationship of associated objects, indicating that there may be three relationships, e.g., "a and/or B" may indicate: only A, only B and both A and B are present, wherein A and B may be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. "at least one of the following" or similar expressions refer to any combination of these items, including any combination of single item(s) or plural items. For example, at least one (one) of a, b, or c, may represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", wherein a, b, c may be single or plural.
It is further noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (12)

1. A method for switching transmission protocols is applied to a client, and comprises the following steps:
sending heartbeat request information to a server through a first transmission protocol, wherein the heartbeat request information comprises an identifier of the client;
determining whether response information sent by the server after the heartbeat request is received within preset time;
if the response information sent by the server is not received within the preset time, switching to a second transmission protocol, and using the second transmission protocol to transmit data, wherein the first transmission protocol and the second transmission protocol are different transmission protocols;
and if the response information sent by the server is received within the preset time, using the first transmission protocol to carry out data transmission.
2. The method of claim 1, wherein the first transport protocol and the second transport protocol are switched between a TCP protocol and a UDP protocol.
3. The method according to claim 2, wherein when the UPD protocol is used for data transmission, performing data transmission comprises:
and carrying out data transmission by using the UDP protocol and the KCP protocol.
4. The method of claim 3, wherein the data transmission using the UDP protocol and the KCP protocol comprises:
adding a sequence number field in the data to be transmitted, wherein the sequence number field is used for representing the sequence of each data to be transmitted;
sending the data to be transmitted including the sequence number field to the server;
receiving confirmation information sent by the server, wherein the confirmation information comprises the sequence number field;
and determining whether to retransmit the data according to the sequence number field in the data to be transmitted and the sequence number field in the confirmation information.
5. The method of claim 2, wherein when using the TCP protocol for data transmission, the method further comprises:
sending a connection establishing request to the server, wherein the connection establishing request comprises a first sending sequence number;
receiving first reply information sent by the server after receiving the connection establishment request, wherein the first reply information comprises a second sending sequence number and a first confirmation sequence number, and the first confirmation sequence number is equal to the first sending sequence number plus 1;
and sending second reply information to the server to realize the connection establishment with the server, wherein the second reply information comprises a second confirmation sequence number, and the second confirmation sequence number is equal to the second sending sequence number increased by 1.
6. A transport protocol switching apparatus, wherein the apparatus is applied to a client, the apparatus comprising:
a first sending unit, configured to send heartbeat request information to a server through a first transmission protocol, where the heartbeat request information includes an identifier of the client;
a determining unit, configured to determine whether response information sent by the server after receiving the heartbeat request is received within a preset time;
the switching unit is used for switching to a second transmission protocol when the determination result of the determining unit does not receive the response information sent by the server within the preset time;
a transmission unit, configured to perform data transmission using the second transmission protocol, where the first transmission protocol and the second transmission protocol are different transmission protocols;
the transmission unit is further configured to use the first transmission protocol for data transmission when the determination result of the determination unit is that the response information sent by the server is received within the preset time.
7. The apparatus of claim 6, wherein the first transport protocol and the second transport protocol switch between a TCP protocol and a UDP protocol.
8. The apparatus according to claim 7, wherein the transmission unit is specifically configured to use the UDP protocol and the KCP protocol for data transmission when using the UPD protocol for data transmission.
9. The apparatus of claim 8, wherein the transmission unit comprises:
the adding subunit is used for adding sequence number fields in the data to be transmitted, and the sequence number fields are used for representing the sequence of each piece of data to be transmitted;
the sending subunit is configured to send the data to be transmitted, which includes the sequence number field, to the server;
a receiving subunit, configured to receive acknowledgement information sent by the server, where the acknowledgement information includes the sequence number field;
and the determining subunit is used for determining whether to retransmit the data according to the sequence number field in the data to be transmitted and the sequence number field in the confirmation information.
10. The apparatus of claim 7, wherein when the TCP protocol is used for data transmission, the apparatus further comprises:
a second sending unit, configured to send a connection establishment request to the server, where the connection establishment request includes a first sending sequence number;
a receiving unit, configured to receive first reply information sent by the server after receiving the connection establishment request, where the first reply information includes a second sending sequence number and a first acknowledgement sequence number, and the first acknowledgement sequence number is equal to the first sending sequence number plus 1;
and the third sending unit is used for sending second reply information to the server so as to establish connection with the server, wherein the second reply information comprises a third sending sequence number and a second confirmation sequence number, and the second confirmation sequence number is equal to the increment of the second sending sequence number by 1.
11. A computer-readable storage medium having stored therein instructions that, when run on a terminal device, cause the terminal device to perform the transport protocol switching method of any one of claims 1-5.
12. An apparatus for implementing transport protocol switching, comprising: a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the transport protocol switching method of any one of claims 1-5 when executing the computer program.
CN202010071748.6A 2020-01-21 2020-01-21 Transmission protocol switching method, device, equipment and storage medium Withdrawn CN111224999A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010071748.6A CN111224999A (en) 2020-01-21 2020-01-21 Transmission protocol switching method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010071748.6A CN111224999A (en) 2020-01-21 2020-01-21 Transmission protocol switching method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN111224999A true CN111224999A (en) 2020-06-02

Family

ID=70829594

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010071748.6A Withdrawn CN111224999A (en) 2020-01-21 2020-01-21 Transmission protocol switching method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111224999A (en)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112040564A (en) * 2020-08-25 2020-12-04 北京大米科技有限公司 Information transmission method, readable storage medium and electronic device
CN113259391A (en) * 2021-06-25 2021-08-13 北京华云安信息技术有限公司 Data transmission method and device applied to multi-level node network
CN113595837A (en) * 2021-09-28 2021-11-02 季华实验室 Communication protocol management method, device, electronic equipment and storage medium
CN113810349A (en) * 2020-06-17 2021-12-17 腾讯科技(深圳)有限公司 Data transmission method and device and computer equipment
CN114040351A (en) * 2021-10-21 2022-02-11 郑州大学第一附属医院 Wearable children breathe monitored control system based on near field communication
CN114079643A (en) * 2020-08-21 2022-02-22 北京金山云网络技术有限公司 Method, device, gateway equipment and computer readable medium for transmitting data
CN114095363A (en) * 2021-11-11 2022-02-25 珠海格力节能环保制冷技术研究中心有限公司 Communication method, device and system, upper computer and lower computer
CN114124868A (en) * 2021-11-23 2022-03-01 北京百度网讯科技有限公司 Instant communication method, device, system, equipment and storage medium
CN114500568A (en) * 2022-01-19 2022-05-13 许昌许继软件技术有限公司 File synchronization method and device among multi-stage inspection platforms
CN114500528A (en) * 2021-12-28 2022-05-13 天翼云科技有限公司 Data transmission method and device based on cloud platform
CN115474212A (en) * 2022-08-17 2022-12-13 广州爱浦路网络技术有限公司 Optimization method, system, electronic device and storage medium for CDN network transmission

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120191871A1 (en) * 2009-06-11 2012-07-26 Cdnetworks Co., Ltd. Method and Apparatus for Selecting Optimum Transfer Protocol
CN104717041A (en) * 2015-04-01 2015-06-17 北京百度网讯科技有限公司 Method and device for transmitting data
JP2015170955A (en) * 2014-03-06 2015-09-28 富士通株式会社 Communication method, communication control program, and communication apparatus
CN109525661A (en) * 2018-11-14 2019-03-26 北京奇艺世纪科技有限公司 Data transmission method and device
CN109547454A (en) * 2018-12-06 2019-03-29 空网科技(北京)有限公司 Terminal device and data transmission method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120191871A1 (en) * 2009-06-11 2012-07-26 Cdnetworks Co., Ltd. Method and Apparatus for Selecting Optimum Transfer Protocol
JP2015170955A (en) * 2014-03-06 2015-09-28 富士通株式会社 Communication method, communication control program, and communication apparatus
CN104717041A (en) * 2015-04-01 2015-06-17 北京百度网讯科技有限公司 Method and device for transmitting data
CN109525661A (en) * 2018-11-14 2019-03-26 北京奇艺世纪科技有限公司 Data transmission method and device
CN109547454A (en) * 2018-12-06 2019-03-29 空网科技(北京)有限公司 Terminal device and data transmission method

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
JUNJI MANABE,ET AL.: "A_Chunked_File_Transfer_Method_Dynamically_Selecting_One_from_TCP_and_UDP_According_to_Network_Conditions", 《2012 THIRD INTERNATIONAL CONFERENCE ON NETWORKING AND COMPUTING》 *
屈军锁等: "一种可靠数据传输技术的设计与实现", 《西安邮电大学学报》 *
左佳丽等: "数据传输模式自适应切换的设计与实现", 《计算机测量与控制》 *

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113810349B (en) * 2020-06-17 2023-05-12 腾讯科技(深圳)有限公司 Data transmission method, device, computer equipment and storage medium
CN113810349A (en) * 2020-06-17 2021-12-17 腾讯科技(深圳)有限公司 Data transmission method and device and computer equipment
CN114079643A (en) * 2020-08-21 2022-02-22 北京金山云网络技术有限公司 Method, device, gateway equipment and computer readable medium for transmitting data
CN112040564A (en) * 2020-08-25 2020-12-04 北京大米科技有限公司 Information transmission method, readable storage medium and electronic device
CN112040564B (en) * 2020-08-25 2023-02-28 北京大米科技有限公司 Information transmission method, readable storage medium and electronic device
CN113259391A (en) * 2021-06-25 2021-08-13 北京华云安信息技术有限公司 Data transmission method and device applied to multi-level node network
CN113595837B (en) * 2021-09-28 2021-12-14 季华实验室 Communication protocol management method, device, electronic equipment and storage medium
CN113595837A (en) * 2021-09-28 2021-11-02 季华实验室 Communication protocol management method, device, electronic equipment and storage medium
CN114040351A (en) * 2021-10-21 2022-02-11 郑州大学第一附属医院 Wearable children breathe monitored control system based on near field communication
CN114040351B (en) * 2021-10-21 2023-04-18 郑州大学第一附属医院 Wearable children breathe monitored control system based on near field communication
CN114095363A (en) * 2021-11-11 2022-02-25 珠海格力节能环保制冷技术研究中心有限公司 Communication method, device and system, upper computer and lower computer
CN114124868A (en) * 2021-11-23 2022-03-01 北京百度网讯科技有限公司 Instant communication method, device, system, equipment and storage medium
CN114500528A (en) * 2021-12-28 2022-05-13 天翼云科技有限公司 Data transmission method and device based on cloud platform
CN114500568A (en) * 2022-01-19 2022-05-13 许昌许继软件技术有限公司 File synchronization method and device among multi-stage inspection platforms
CN115474212A (en) * 2022-08-17 2022-12-13 广州爱浦路网络技术有限公司 Optimization method, system, electronic device and storage medium for CDN network transmission

Similar Documents

Publication Publication Date Title
CN111224999A (en) Transmission protocol switching method, device, equipment and storage medium
CN110417915B (en) Push message transmission method and device, storage medium and electronic equipment
US9462053B2 (en) Method and apparatus for connection establishment
US20040186918A1 (en) Method and apparatus for dispatching incoming data in a multi-application terminal
US20070240209A1 (en) Session persistence on a wireless network
JP2008085906A (en) Packet loss rate calculation system
US9571409B2 (en) Maximum transmission unit negotiation method and data terminal
CN107567107B (en) Data transmission method and device
JP2008015593A (en) Repeater, program, relay method and communication system
WO2017088815A1 (en) Status detection method and wireless network node
CN112436924B (en) Data transmission method and electronic equipment
WO2018076580A1 (en) Two-sided acceleration transmission method and system for wireless network
CN105407149B (en) Information push method and device
CN112565441A (en) Data communication method and electronic equipment
CN110234101B (en) Wireless transmission method, equipment and system for reliably transmitting data
CN111385068B (en) Data transmission method, device, electronic equipment and communication system
WO2019001352A1 (en) Method, device, and system for transmitting data
CN114389758A (en) Data transmission method and device
CN107431965B (en) Method and device for realizing Transmission Control Protocol (TCP) transmission
JP2014146876A (en) Message distribution system and message distribution method
JP2004187099A (en) Communication control method, communication system and communication equipment
JP4805072B2 (en) Communications system
CN112770412B (en) Packet data network PDN activation method and device thereof
CN110266778B (en) Many-to-many long connection network communication device and equipment
CN110572465B (en) Message transmission method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WW01 Invention patent application withdrawn after publication

Application publication date: 20200602

WW01 Invention patent application withdrawn after publication