CN114257662B - Method, device, electronic equipment and storage medium for indicating transmission protocol - Google Patents

Method, device, electronic equipment and storage medium for indicating transmission protocol Download PDF

Info

Publication number
CN114257662B
CN114257662B CN202011017051.7A CN202011017051A CN114257662B CN 114257662 B CN114257662 B CN 114257662B CN 202011017051 A CN202011017051 A CN 202011017051A CN 114257662 B CN114257662 B CN 114257662B
Authority
CN
China
Prior art keywords
transmission protocol
protocol
information
server
client
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.)
Active
Application number
CN202011017051.7A
Other languages
Chinese (zh)
Other versions
CN114257662A (en
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.)
Huawei Device Co Ltd
Petal Cloud Technology Co Ltd
Original Assignee
Petal Cloud 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 Petal Cloud Technology Co Ltd filed Critical Petal Cloud Technology Co Ltd
Priority to CN202011017051.7A priority Critical patent/CN114257662B/en
Publication of CN114257662A publication Critical patent/CN114257662A/en
Application granted granted Critical
Publication of CN114257662B publication Critical patent/CN114257662B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/18Multiprotocol handlers, e.g. single devices capable of handling multiple protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • 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/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/168Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP] specially adapted for link layer protocols, e.g. asynchronous transfer mode [ATM], synchronous optical network [SONET] or point-to-point protocol [PPP]

Landscapes

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

Abstract

The application provides a method, a device, electronic equipment and a storage medium for indicating a transmission protocol, and relates to the technical field of communication, wherein the method comprises the following steps: the method comprises the steps that a server side obtains first information of a first transmission protocol and second information of a second transmission protocol; the server determines a target transmission protocol according to the first information and the second information, wherein the target transmission protocol is the first transmission protocol or the second transmission protocol; the server side sends first indication information to the client side, wherein the first indication information is used for indicating a target transmission protocol. According to the scheme provided by the application, the adaptive transmission protocol can be automatically selected according to the change of various factors in the system environment under the current scene, so that the change is adapted in real time, the communication efficiency is improved, and the phenomena of unresponsiveness in operation, network blocking and the like in the process of protocol switching in the related art are avoided.

Description

Method, device, electronic equipment and storage medium for indicating transmission protocol
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method, an apparatus, and a storage medium for indicating a transmission protocol in the field of communications.
Background
The hypertext transfer protocol (hyper text transfer protocol, HTTP) is a widely used network protocol on the internet. HTTP clients refer to clients adopting the HTTP protocol, for example, a Web browser is an HTTP client, and is mainly used to initiate an HTTP request or access, so as to download data from a server or upload data to the server.
Currently, both clients and servers can support a variety of HTTP protocols, such as HTTP protocols based on the transmission control protocol (transmission control protocol, TCP) and HTTP protocols based on the fast user datagram protocol (user datagram protocol, UDP) network connection (quick UDP Internet connections, QUIC). Some HTTP protocols have a slower transmission speed, and some HTTP protocols have a faster transmission speed, for example, TCP-based HTTP protocols require a three-way handshake before creating a connection, resulting in a slower data transmission speed; the QUIC-based HTTP protocol makes data transmission faster due to the advantages of multiplexing, short round trip transmission time, flexible congestion control, etc. Therefore, a protocol with a faster transmission speed is generally automatically preferred when the client and the server perform data transmission.
However, when the client sends a request through a protocol with a higher transmission speed and has a timeout unresponsiveness, the client can be passively switched to connect with other protocols, and the client surfing experience is affected at this time, for example, the user can obviously perceive that the operation is unresponsive, the network is blocked, and the like. And, after the connection timeout does not respond, the client will usually retry the protocol with the faster transmission speed at regular time, which increases the resource consumption of the client. Therefore, how to reasonably switch the transmission protocol when the client and the server transmit data is a problem to be solved.
Disclosure of Invention
The embodiment of the application provides a method, a device and a storage medium for indicating a transmission protocol, which are used for solving the problem of reasonably switching the transmission protocol when a client and a server perform data transmission.
In a first aspect, the present application provides a method for indicating a transmission protocol, including: the method comprises the steps that a server side obtains first information of a first transmission protocol and second information of a second transmission protocol; the server determines a target transmission protocol according to the first information and the second information, wherein the target transmission protocol is the first transmission protocol or the second transmission protocol; the server side sends first indication information to the client side, wherein the first indication information is used for indicating the target transmission protocol.
The first information is used for indicating a first host capability corresponding to the first transmission protocol, and the second information is used for indicating a second host capability corresponding to the second transmission protocol; and/or the first information is used for indicating a first data volume corresponding to the first transmission protocol, and the second information is used for indicating a second data volume corresponding to the second transmission protocol; and/or, the first information is used for indicating a first transmission quality corresponding to the first transmission protocol, and the second information is used for indicating a second transmission quality corresponding to the second transmission protocol; and/or the first information is used for indicating a first request response rate corresponding to the first transmission protocol, and the second information is used for indicating a second request response rate corresponding to the second transmission protocol.
In the technical scheme, the server comprehensively judges the transmission protocol suitable for data interaction in the current scene based on the data such as network quality, protocol application effect, server host health condition and the like, and then informs the determined transmission protocol to the client, so that the client can select to interact with the server through the transmission protocol, and intelligent scheduling of the transmission protocol is realized. That is, the adaptive transmission protocol can be automatically selected according to the change of various factors in the system environment under the current scene, so as to adapt to the change in real time and improve the communication efficiency. The phenomena of unresponsiveness of operation, network blocking and the like in the process of protocol switching in the related art are avoided, so that the user experience can be improved.
In some possible implementations, the first transmission protocol is the quitc-based HTTP protocol and the second transmission protocol is the transmission control protocol TCP-based HTTP protocol.
In some possible implementations, the first information is used to indicate a first host capability corresponding to the first transmission protocol, and the second information is used to indicate a second host capability corresponding to the second transmission protocol. The server determines a target transmission protocol according to the first information and the second information, and the method comprises the following steps:
If the first host capability is better than the second host capability, the server determines that the first transmission protocol is the target transmission protocol; or if the first host capability is inferior to the second host capability, the server determines that the second transmission protocol is the target transmission protocol.
Illustratively, the first information may include at least one of a central processing unit (central processing unit, CPU) load size, a memory space size, and a number of service processes. Also, the second information may include at least one of a CPU load size, a memory space size, and a number of service processes. It can be understood that if the CPU load of the server host is smaller, the memory space is larger, and the number of service processes is smaller, this indicates that the capability is better.
In the above scheme, the server may determine the protocol with the highest capability corresponding to the host among the multiple protocols supported by the server and the client as the transmission protocol adapted to the current scene, and further instruct the client to switch to the transmission protocol adapted to the current scene, so as to implement intelligent active switching of the transmission protocol, so as to avoid phenomena of unresponsiveness or network blocking in user operation due to passive switching of the transmission protocol in the related art.
In some possible implementations, the first information is used to indicate a first data amount corresponding to the first transmission protocol, and the second information is used to indicate a second data amount corresponding to the second transmission protocol. The server determines a target transmission protocol according to the first information and the second information, and the method comprises the following steps:
if the first data volume is smaller than a preset data volume threshold, the server determines that the first transmission protocol is the target transmission protocol; or if the first data volume is greater than or equal to the preset data volume threshold and the second data volume is less than the preset data volume threshold, the server determines that the second transmission protocol is the target transmission protocol.
Wherein the first data volume may refer to a request concurrency volume of the QUIC protocol.
Through the scheme, the server can determine the QUIC protocol with the request concurrency not reaching the alarm threshold as the transmission protocol adapting to the current scene, or switch to the TCP protocol if the QUIC protocol exceeds the alarm threshold, so that the client can be instructed to switch to the transmission protocol adapting to the current scene, and intelligent active switching of the transmission protocol is realized, so that the phenomena of unresponsiveness of user operation or network blocking and the like caused by passive switching of the transmission protocol in the related technology are avoided.
In some possible implementations, the first information is used to indicate a first transmission quality corresponding to the first transmission protocol, the second information is used to indicate a second transmission quality corresponding to the second transmission protocol, the first transmission quality is represented by a first delay and/or a first packet loss rate, and the second transmission quality is represented by a second delay and/or a second packet loss rate.
The server determines a target transmission protocol according to the first information and the second information, and the method comprises the following steps:
if the first time delay is smaller than the second time delay, the server determines that the first transmission protocol is the target transmission protocol; or if the first time delay is greater than or equal to the second time delay, the server determines that the second transmission protocol is the target transmission protocol.
And/or, the server determines a target transmission protocol according to the first information and the second information, including:
if the first packet loss rate is smaller than the second packet loss rate, the server determines that the first transmission protocol is the target transmission protocol; or if the first packet loss rate is greater than or equal to the second packet loss rate, the server determines that the second transmission protocol is the target transmission protocol.
And/or, the server determines a target transmission protocol according to the first information and the second information, including:
if the first time delay is smaller than the second time delay and the first packet loss rate is smaller than the second packet loss rate, the server determines that the first transmission protocol is the target transmission protocol; or if the first time delay is greater than or equal to the second time delay and the first packet loss rate is greater than or equal to the second packet loss rate, the server determines that the second transmission protocol is the target transmission protocol.
Through the scheme, the server can determine the protocol with the highest corresponding transmission quality in a plurality of protocols supported by the server and the client as the transmission protocol adapting to the current scene, and further can instruct the client to switch to the transmission protocol adapting to the current scene, so as to realize intelligent active switching of the transmission protocol, and avoid the phenomena of unresponsiveness or network blocking and the like of user operation caused by passive switching of the transmission protocol in the related art.
In some possible implementations, the first information is used to indicate a first request response rate corresponding to the first transmission protocol, and the second information is used to indicate a second request response rate corresponding to the second transmission protocol. The server determines a target transmission protocol according to the first information and the second information, and the method comprises the following steps:
If the first request response rate is greater than or equal to the second request response rate, the server determines that the first transmission protocol is the target transmission protocol; or if the first request response rate is smaller than the second request response rate, the server determines that the second transmission protocol is the target transmission protocol.
Through the scheme, the server can determine the protocol with the highest response rate or success rate corresponding to the request from a plurality of protocols supported by the server and the client as the transmission protocol adapting to the current scene, and further can instruct the client to switch to the transmission protocol adapting to the current scene, so that intelligent active switching of the transmission protocol is realized, and the phenomena of unresponsiveness or network blocking and the like in the user operation caused by passive switching of the transmission protocol in the related art are avoided.
The above "greater than" may be replaced with "greater than or equal to", "less than or equal to" may be replaced with "less than" or "greater than or equal to" may be replaced with "greater than", "less than" may be replaced with "less than or equal to".
Of course, the server may also determine the target transport protocol by using at least two of the four implementations. The server side can comprehensively consider the corresponding host capacity, data volume, transmission quality and request response rate in a plurality of protocols supported by the server side and the client side, determine the transmission protocol adapting to the current scene, improve the accuracy of judging the adaptation protocol, further instruct the client side to switch to the transmission protocol adapting to the current scene, realize intelligent active switching of the transmission protocol, and avoid the phenomena of no response or network blocking and the like of user operation caused by passive switching of the transmission protocol in the related technology. That is, the adaptive transmission protocol is automatically selected according to the change of various factors in the system environment in the current scene, so as to adapt to the change in real time and improve the communication efficiency.
In some possible implementations, before the server sends the first indication information to the client, the method further includes: the server receives a first request message sent by the client, wherein the first request message is used for indicating the server to determine the target transmission protocol. The server side sends first indication information to the client side, and the first indication information comprises: the server side sends a first response message of the first request message to the client side, wherein the first response message comprises the first indication information.
In some possible implementations, before the server sends the first indication information to the client, the method further includes: the server receives a second request message sent by the client, wherein the second request message is used for requesting the server to process the first service. The server side sends first indication information to the client side, and the first indication information comprises: the server side sends a second response message of the second request message to the client side, wherein the second response message comprises the processing information of the first service and the first indication information.
Through the scheme, when the server receives the client request, the server determines the optimal transmission protocol (such as TCP protocol or QUIC protocol) adapting to the current scene according to the information related to the transmission protocol in the current scene, and actively informs the optimal transmission protocol of the client, so that the intelligent scheduling of the transmission protocol of the client is realized, the situation that the client can schedule the protocol when the user experience is damaged is avoided, the user experience can be improved, and the behavior that the client needs to retry the transmission protocol at regular time under the condition that the transmission protocol is unavailable is avoided.
In some possible implementations, the first response message or the second response message includes hypertext transfer protocol HTTP response header information; the first indication information is carried in a reserved field in the HTTP response header information.
In the embodiment of the application, the server can comprehensively judge the preferred transmission protocol suitable for data interaction in the current scene based on the data such as network quality, protocol application effect, host health condition and the like, dynamically set the preferred protocol in the Alt-Svc field in the HTTP response header, actively inform the client of the preferred transmission protocol, and further the client can select to interact with the server through the transmission protocol, so that intelligent scheduling of the transmission protocol can be realized.
In some possible implementations, after the server sends the first indication information to the client, the method further includes: the server receives a third request message sent by the client through the target transmission protocol, wherein the third request message is used for requesting the server to process a second service; and the server side sends the processing information of the second service to the client side through the target transmission protocol.
In a second aspect, the present application provides a method of indicating a transmission protocol, the method comprising: the method comprises the steps that a client receives first indication information sent by a server, wherein the first indication information is used for indicating a target transmission protocol; the target transmission protocol is determined by the server according to first information of a first transmission protocol and second information of a second transmission protocol, and the target transmission protocol is the first transmission protocol or the second transmission protocol; and the client determines the target transmission protocol as a transmission protocol for data interaction with the server according to the first indication information.
The first information is used for indicating a first host capability corresponding to the first transmission protocol, and the second information is used for indicating a second host capability corresponding to the second transmission protocol; and/or the first information is used for indicating a first data volume corresponding to the first transmission protocol, and the second information is used for indicating a second data volume corresponding to the second transmission protocol; and/or, the first information is used for indicating a first transmission quality corresponding to the first transmission protocol, and the second information is used for indicating a second transmission quality corresponding to the second transmission protocol; and/or the first information is used for indicating a first request response rate corresponding to the first transmission protocol, and the second information is used for indicating a second request response rate corresponding to the second transmission protocol.
In some possible implementations, the first transmission protocol is the QUIC connection-based hypertext transmission protocol HTTP protocol and the second transmission protocol is the TCP connection-based HTTP protocol.
In some possible implementations, before the client receives the first indication information sent by the server, the method further includes:
the client sends a first request message to the server, wherein the first request message is used for indicating the server to determine the target transmission protocol;
the client receives first indication information sent by the server, including:
the client receives a first response message sent by the server to the first request message, wherein the first response message comprises the first indication information.
In some possible implementations, before the client receives the first indication information sent by the server, the method further includes:
the client sends a second request message to the server, wherein the second request message is used for requesting the server to process a first service;
the client receives first indication information sent by the server, including:
The client receives a second response message sent by the server to the first request message, wherein the second response message comprises the processing information of the first service and the first indication information.
In some possible implementations, the first response message or the second response message includes hypertext transfer protocol HTTP response header information; the first indication information is carried in a reserved field in the HTTP response header information.
In some possible implementations, after the server sends the first indication information to the client, the method further includes:
the client sends a third request message to the server through the target transmission protocol, wherein the third request message is used for requesting the server to process a second service;
and the client receives the processing information of the second service sent by the server through the target transmission protocol.
In a third aspect, the present application provides an apparatus for indicating a transmission protocol, the apparatus comprising means for performing the method in the first aspect described above. The apparatus may correspond to performing the method described in the first aspect, and the relevant descriptions of the units in the apparatus are referred to the description of the first aspect, which is omitted herein for brevity.
The method described in the first aspect may be implemented by hardware, or may be implemented by executing corresponding software by hardware. The hardware or software includes one or more modules or units corresponding to the functions described above. Such as an acquisition module or unit, a processing module or unit, a transceiver module or unit, etc.
In a fourth aspect, the present application provides an apparatus for indicating a transmission protocol, the apparatus comprising means for performing the method in the second aspect described above. The apparatus may correspond to performing the method described in the second aspect, and the relevant descriptions of the units in the apparatus are referred to the description of the second aspect, which is not repeated herein for brevity.
The method described in the second aspect may be implemented by hardware, or may be implemented by executing corresponding software by hardware. The hardware or software includes one or more modules or units corresponding to the functions described above. Such as a transceiver module or unit, a processing module or unit, etc.
In a fifth aspect, the present application provides a method of indicating a transmission protocol, the method comprising:
the method comprises the steps that a server side obtains first information of a first transmission protocol and second information of a second transmission protocol; determining a target transmission protocol according to the first information and the second information; the method comprises the steps that a first indication message is sent to a client, wherein the first indication message is used for indicating the target transmission protocol, and the target transmission protocol is the first transmission protocol or the second transmission protocol;
The client receives the first indication information sent by the server;
the first information is used for indicating a first host capability corresponding to the first transmission protocol, and the second information is used for indicating a second host capability corresponding to the second transmission protocol; and/or the first information is used for indicating a first data volume corresponding to the first transmission protocol, and the second information is used for indicating a second data volume corresponding to the second transmission protocol; and/or, the first information is used for indicating a first transmission quality corresponding to the first transmission protocol, and the second information is used for indicating a second transmission quality corresponding to the second transmission protocol; and/or the first information is used for indicating a first request response rate corresponding to the first transmission protocol, and the second information is used for indicating a second request response rate corresponding to the second transmission protocol.
In some possible implementations, the first transmission protocol is the QUIC connection-based hypertext transmission protocol HTTP protocol and the second transmission protocol is the TCP connection-based HTTP protocol.
In some possible implementations, the first information is used to indicate a first host capability corresponding to the first transmission protocol, and the second information is used to indicate a second host capability corresponding to the second transmission protocol;
The determining a target transmission protocol according to the first information and the second information comprises:
if the first host capability is better than the second host capability, the server determines that the first transmission protocol is the target transmission protocol;
if the first host capability is inferior to the second host capability, the server determines that the second transmission protocol is the target transmission protocol.
In some possible implementations, the first information is used to indicate a first data amount corresponding to the first transmission protocol, and the second information is used to indicate a second data amount corresponding to the second transmission protocol;
the determining a target transmission protocol according to the first information and the second information comprises:
if the first data volume is smaller than a preset data volume threshold, the server determines that the first transmission protocol is the target transmission protocol;
and if the first data volume is greater than or equal to the preset data volume threshold and the second data volume is less than the preset data volume threshold, the server determines that the second transmission protocol is the target transmission protocol.
In some possible implementations, the first information is used to indicate a first transmission quality corresponding to the first transmission protocol, the second information is used to indicate a second transmission quality corresponding to the second transmission protocol, the first transmission quality is represented by a first delay and/or a first packet loss rate, and the second transmission quality is represented by a second delay and/or a second packet loss rate;
The determining a target transmission protocol according to the first information and the second information comprises:
if the first time delay is smaller than the second time delay, the server determines that the first transmission protocol is the target transmission protocol;
if the first time delay is greater than or equal to the second time delay, the server determines that the second transmission protocol is the target transmission protocol; and/or include:
if the first packet loss rate is smaller than the second packet loss rate, the server determines that the first transmission protocol is the target transmission protocol;
if the first packet loss rate is greater than or equal to the second packet loss rate, the server determines that the second transmission protocol is the target transmission protocol; and/or include:
if the first time delay is smaller than the second time delay and the first packet loss rate is smaller than the second packet loss rate, the server determines that the first transmission protocol is the target transmission protocol;
and if the first time delay is greater than or equal to the second time delay and the first packet loss rate is greater than or equal to the second packet loss rate, the server determines that the second transmission protocol is the target transmission protocol.
In some possible implementations, the first information is used to indicate a first request response rate corresponding to the first transmission protocol, and the second information is used to indicate a second request response rate corresponding to the second transmission protocol;
the determining a target transmission protocol according to the first information and the second information comprises:
if the first request response rate is greater than or equal to the second request response rate, the server determines that the first transmission protocol is the target transmission protocol;
and if the first request response rate is smaller than the second request response rate, the server determines that the second transmission protocol is the target transmission protocol.
In some possible implementations, the method further includes:
the client sends a first request message to the server, wherein the first request message is used for indicating the server to determine the target transmission protocol;
the server receives the first request message sent by the client;
the server side sends first indication information to the client side, and the first indication information comprises:
the server side sends a first response message of the first request message to the client side, wherein the first response message comprises the first indication information.
In some possible implementations, the method further includes:
the client sends a second request message to the server, wherein the second request message is used for requesting the server to process a first service;
the server receives the second request message sent by the client;
the server side sends first indication information to the client side, and the first indication information comprises:
the server side sends a second response message of the second request message to the client side, wherein the second response message comprises the processing information of the first service and the first indication information.
In some possible implementations, the first response message or the second response message includes hypertext transfer protocol HTTP response header information;
the first indication information is carried in a reserved field in the HTTP response header information.
In some possible implementations, the method further includes:
the client sends a third request message to the server through the target transmission protocol, wherein the third request message is used for requesting the server to process a second service;
and the server receives the third request message sent by the client and sends the processing information of the second service to the client through the target transmission protocol.
In a sixth aspect, the present application provides an electronic device for indicating a transmission protocol, the electronic device comprising a processor, the processor being coupled to a memory, the memory being for storing a computer program or instructions, the processor being for executing the computer program or instructions stored in the memory, such that the method of the first aspect and possible implementations of the first aspect are performed.
For example, the processor is configured to execute a computer program or instructions stored in the memory, so that the electronic device performs the aspects and the methods in possible implementations of the aspects.
Optionally, the electronic device includes one or more processors.
Optionally, a memory coupled to the processor may also be included in the electronic device.
Alternatively, the electronic device may include one or more memories.
Alternatively, the memory may be integrated with the processor or provided separately.
Optionally, a transceiver may also be included in the electronic device.
In a seventh aspect, the present application provides an electronic device for indicating a transmission protocol, the electronic device comprising a processor coupled to a memory for storing a computer program or instructions, the processor being for executing the computer program or instructions stored by the memory, such that the method of the second aspect and possible implementations of the second aspect described above is performed.
For example, a processor is configured to execute a computer program or instructions stored in a memory, to cause the apparatus to perform the method in the second aspect.
Optionally, the electronic device includes one or more processors.
Optionally, a memory coupled to the processor may also be included in the electronic device.
Alternatively, the electronic device may include one or more memories.
Alternatively, the memory may be integrated with the processor or provided separately.
Optionally, a transceiver may also be included in the electronic device.
In an eighth aspect, a system for indicating a transmission protocol is provided, comprising: the apparatus provided in the third aspect and the apparatus provided in the fourth aspect; or the electronic device provided in the sixth aspect and the electronic device provided in the seventh aspect. The apparatus or electronic device of the system correspondingly performs the method provided in the fifth aspect and possible implementation manners of the fifth aspect.
In a ninth aspect, there is provided a computer-readable storage medium having stored thereon a computer program (which may also be referred to as instructions or code) for implementing the method in the first aspect.
For example, the computer program, when executed by a computer, causes the computer to perform the method of the first aspect.
In a tenth aspect, a computer-readable storage medium is provided, on which a computer program (which may also be referred to as instructions or code) for implementing the method in the second aspect is stored.
For example, the computer program, when executed by a computer, causes the computer to perform the method of the second aspect.
In an eleventh aspect, the present application provides a chip comprising a processor. The processor is configured to read and execute a computer program stored in the memory to perform the method of the first aspect and any possible implementation thereof.
Optionally, the chip further comprises a memory, and the memory is connected with the processor through a circuit or a wire.
Further optionally, the chip further comprises a communication interface.
In a twelfth aspect, the present application provides a chip comprising a processor. The processor is configured to read and execute a computer program stored in the memory to perform the method of the second aspect and any possible implementation thereof.
Optionally, the chip further comprises a memory, and the memory is connected with the processor through a circuit or a wire.
Further optionally, the chip further comprises a communication interface.
In a thirteenth aspect, the present application provides a computer program product comprising a computer program (which may also be referred to as instructions or code) which, when executed by a computer, causes the computer to carry out the method of the first aspect.
In a fourteenth aspect, the present application provides a computer program product comprising a computer program (which may also be referred to as instructions or code) which, when executed by a computer, causes the computer to carry out the method of the second aspect.
It will be appreciated that the advantages of the second to fourteenth aspects may be found in the relevant description of the first aspect, and are not described here again.
Drawings
Fig. 1 is a schematic diagram of protocol layers involved in a method for transmitting a protocol according to an embodiment of the present application.
Fig. 2 is an application scenario schematic diagram of a method for indicating a transmission protocol according to an embodiment of the present application.
Fig. 3 is a flowchart of a related art method for switching a transmission protocol during a data transmission process.
Fig. 4 is a flowchart of a method for indicating a transmission protocol according to an embodiment of the present application.
Fig. 5 is a flowchart of another method for indicating a transmission protocol according to an embodiment of the present application.
Fig. 6 is a flowchart of another method for indicating a transmission protocol according to an embodiment of the present application.
Fig. 7 is a flowchart of another method for indicating a transmission protocol according to an embodiment of the present application.
Fig. 8 is a flowchart of another method for indicating a transmission protocol according to an embodiment of the present application.
Fig. 9 is a flowchart of another method for indicating a transmission protocol according to an embodiment of the present application.
Fig. 10 is a schematic block diagram of corresponding modules of a client and a server in a method for indicating a transmission protocol according to an embodiment of the present application.
Fig. 11 is a schematic block diagram of an apparatus for indicating a transmission protocol according to an embodiment of the present application.
Fig. 12 is a schematic block diagram of another apparatus for indicating a transmission protocol according to an embodiment of the present application.
Fig. 13 is a schematic block diagram of an electronic device provided in an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
To facilitate understanding of embodiments of the present application, some of the terms of embodiments of the present application are explained below to facilitate understanding by those skilled in the art.
1) TCP protocol: the transmission control protocol is a connection-oriented, reliable, byte stream based transport layer communication protocol. In the simplified computer network OSI (open system interconnection, open systems interconnection) reference model, the functions specified by the transport layer can be performed.
2) UDP protocol: the user datagram protocol, a connectionless transport layer protocol in the OSI reference model, provides a transaction-oriented simple unreliable information transport service. UDP provides a method for applications to send encapsulated IP packets without having to establish a connection. Fig. 1 shows a schematic diagram of the distribution of TCP and UDP in the OSI reference model, in which both the TCP protocol and the UDP protocol are located at the transport layer, and at a layer above the network layer IP protocol, as shown in fig. 1. In fig. 1, the secure network transport protocol (Transport Layer Security, TLS) is a protocol built on top of the transport layer TCP protocol, serving the application layer. For convenience of description, fig. 1 shows only a part of the OSI reference model.
3) QUIC protocol: the fast UDP network connection is an efficient and reliable protocol based on the UDP protocol. The QUIC protocol uses the UDP protocol to create a connection between two endpoints and supports multiplexed connections. Compared with the traditional TCP protocol, QUIC is implemented based on user mode, and the main advantages include multiplexing, short Round Trip Time (RTT), connection migration (connection is not easy to break), flexible congestion control (data transmission quantity is improved), and the like.
Fig. 2 illustrates a system architecture diagram according to various exemplary embodiments of the present application. As shown in fig. 2, the system architecture includes a client 10 and a server 20, and a wireless network connection can be established and data interaction can be performed between the client 10 and the server 20. The client 10 and the server 20 may use HTTP protocol to perform data interaction, and transmit HTTP data.
In the embodiment of the present application, as shown in fig. 2, assuming that the client 10 and the server 20 may support both an HTTP protocol based on a TCP connection (also referred to as an HTTP over TCP protocol) and an HTTP protocol based on a qic connection (also referred to as an HTTP over qic protocol), a TCP connection may be established between the client 10 and the server 20, and a qic connection may also be established.
In one aspect, in the case where the client 10 and the server 20 establish a TCP connection, data interaction between the client 10 and the server 20 may be performed through an HTTP protocol based on the TCP connection. On the other hand, in the case where the client 10 and the server 20 establish a QUIC connection, data interaction between the client 10 and the server 20 may be performed through the HTTP protocol based on the QUIC connection.
It should be noted that, in the embodiment of the present application, the specific form of the client 10 is not limited, for example, the client 10 may refer to a terminal device such as a mobile phone, a tablet computer, a personal digital assistant, a smart watch, a netbook, and a wearable electronic device. In addition, the specific form of the server 20 is not particularly limited in the embodiments of the present application, and the server 20 may refer to a single server (e.g. a web server), or may be a server set (e.g. a cloud server) formed by a plurality of servers. The method can be specifically determined according to actual use requirements, and the embodiment of the application is not limited.
Currently, in internet applications, data transmission of Web platforms (precisely client/server applications based on HTTP and its extension protocols) is usually based on the TCP protocol. But the TCP protocol requires a three-way handshake before creating a connection, resulting in a low transfer speed between the HTTP client and the server. Compared with the TCP protocol, the QUIC protocol can establish the HTTP connection only by one round trip, has high transmission speed and supports the concurrent processing of requests. Therefore, the HTTP protocol based on the QUIC connection is usually automatically preferred when the client transmits data with the server.
Fig. 3 shows a flow chart of a method for switching between a client and a server for data interaction using a TCP connection and a QUIC connection in the related art. As shown in FIG. 3, the method 200 includes steps S210-S280 described below.
S210, the client side sends an HTTP request to the server side by adopting a TCP protocol.
S220, the server informs the client of the current QUIC support.
That is, if the server supports the QUIC protocol, the server may inform the client through the response header alt-svc field, and may send an HTTP request to the server using the QUIC protocol.
S230, the client initiates TCP connection and QUIC connection racing.
For example, it is assumed that the client uses the TCP protocol and the quench protocol to send the HTTP request to the server respectively, and if the transmission time period for transmitting the HTTP request to the server through the quench protocol is less than the transmission time period for transmitting the HTTP request to the server through the TCP protocol, that is, the HTTP request transmitted through the quench protocol arrives at the server first, the quench connection is successful.
S240, under the condition that the QUIC connection race is successful, the client sends an HTTP request to the server through the TCP connection.
That is, if the QUIC connection is established first, the client sends an HTTP request using the QUIC protocol, and once does not use the TCP protocol. Thus, the client and the server adopt QUIC protocol to conduct data interaction.
S250, if the request sent using the QUIC protocol is not responsive or the request times out, the client marks that the QUIC connection is not available (e.g., mark brooken).
S260, the client retransmits the HTTP request to the server by adopting the TCP protocol.
S270, the client retries the QUIC connection at regular time.
Wherein the client can retry the quit connection every preset time period (e.g. 5 minutes). Alternatively, the client may retry the QUIC connection every incremental time period (e.g., 5 minutes, 10 minutes, etc.);
s280, if the client side checks that the request is successful through the QUIC protocol, the client side cancels the mark.
That is, once the QUIC retry is successful, the client retransmits the HTTP request to the server using the QUIC protocol and cancels the brooken tag.
However, by the scheme described in the method 200, when the client uses the HTTP protocol based on the qic connection to send a request, a timeout unresponsiveness occurs, that is, the client cannot establish the qic connection with the server, and the client can passively switch to use the HTTP protocol based on the TCP connection, which affects the client surfing experience, for example, the user can obviously perceive that the operation is unresponsive, and the network is blocked. In addition, because the concurrency processing capability of the server is poor when the client and the server establish the TCP connection, once the client is switched to the TCP connection from the QUIC connection, the server cannot process a large number of requests in time when the client initiates an ultra-large flow request, so that the phenomena of unresponsiveness, network blocking and the like of user operation are caused.
Further, after switching from the quitc connection to the TCP connection, the client may retry the quitc connection at a fixed time, and if the quitc connection is retried successfully, the request is sent using the HTTP protocol based on the quitc connection, and if the quitc connection is retried unsuccessfully, the request is sent using the HTTP protocol based on the TCP connection, which may increase the resource consumption of the client.
In view of the above problems, the present application provides a method for indicating a transmission protocol, in which a server comprehensively determines a transmission protocol suitable for data interaction in a current scenario based on data such as network quality, a protocol application effect, a server host health condition, and the like, and then informs a client of the determined transmission protocol, so that the client can select to interact with the server through the transmission protocol, thereby implementing intelligent scheduling of the transmission protocol. That is, the adaptive transmission protocol can be automatically selected according to the change of various factors in the system environment in the current scene, so as to adapt to the change in real time and improve the communication efficiency. The phenomena of unresponsiveness of operation, network blocking and the like in the process of protocol switching in the related art are avoided, so that the user experience can be improved.
Referring to fig. 4, a flowchart of a method for indicating a transmission protocol according to an embodiment of the present application is shown, where the method is applied to the system shown in fig. 2. As shown in fig. 4, the method 300 may include the following steps S310-S340.
S310, the server acquires first information of a first transmission protocol and second information of a second transmission protocol.
S320, the server determines a target transmission protocol according to the first information and the second information.
S330, the server sends the first indication information to the client, and the client receives the first indication information sent by the server.
The first indication information is used for indicating a target transmission protocol.
And S340, the client determines the target transmission protocol as the transmission protocol for data interaction with the server according to the first indication information.
In step S310, the server obtains first information of the first transmission protocol and second information of the second transmission protocol.
Alternatively, the first transmission protocol may be an HTTP protocol based on a qic connection, and the second transmission protocol may be an HTTP protocol based on a TCP connection. Of course, the first transmission protocol and the second transmission protocol may be any other protocols that meet practical requirements, for example, UDP-based data transmission protocol (UDP-based data transfer protocol, UDT), which is not limited in the embodiments of the present application. For convenience of explanation, the following description will exemplarily take the first transmission protocol as the HTTP protocol based on the quit connection (referred to as quit protocol for short), and the second transmission protocol as the HTTP protocol based on the TCP connection (referred to as TCP protocol for short).
The first information of the first transmission protocol refers to information related to data interaction obtained by the server side when the server side and the client side transmit data through the first transmission protocol. The second information of the second transmission protocol refers to information related to data interaction, which is acquired by the server side when the server side and the client side transmit data through the second transmission protocol.
Optionally, the first information may be used to indicate a first host capability corresponding to the first transmission protocol, in other words, the first information is used to indicate a health condition of the server host when the client and the server perform data interaction through the second transmission protocol. The second information may be used to indicate a second host capability corresponding to the second transmission protocol, in other words, the second information is used to indicate a health condition of the server host when the client and the server perform data interaction through the second transmission protocol. For ease of description, the first information and the second information described herein are collectively referred to as host capability information.
For example, the first information may include at least one of a CPU load size, a memory space size, and a number of service processes. Also, the second information may include at least one of a CPU load size, a memory space size, and a number of service processes. It can be understood that if the CPU load of the server host is smaller, the memory space is larger, and the number of service processes is smaller, this indicates that the capability is better.
Optionally, the first information may be used to indicate a first data amount corresponding to the first transmission protocol, in other words, the first information is used to indicate a data amount (also referred to as a request concurrency amount) of receiving multiple requests by the server side simultaneously when the client side and the server side perform data interaction through the first transmission protocol. The second information may be used to indicate a second data amount corresponding to the second transmission protocol, in other words, the second information is used to indicate a data amount (also referred to as a request concurrency amount) of receiving multiple requests by the server side simultaneously when the client side and the server side perform data interaction through the second transmission protocol. It can be understood that, if the request concurrency is greater, the processing capability requirement on the server host is higher, so that the processing capability of the server host is generally limited, and therefore the concurrent request that the server can process is limited, and if the request concurrency received by the server exceeds the preset threshold range, that is, exceeds the processing capability of the server host, the server host can instruct the client to switch the transport protocol, so as to relieve the processing pressure of the server host. For convenience of description, the first information and the second information described herein are collectively referred to as data amount information.
For example, since the transmission modes of the client terminal adopting the TCP protocol to send the request (also called HTTP over TCP request) and adopting the quit protocol to send the request (also called HTTP over quit request) are different, the HTTP over TCP request is serial transmission, the transmission data volume is smaller, the HTTP over quit request is parallel transmission, and the transmission data volume is larger. If the server receives the HTTP over QUIC request sent by the client and the request concurrency exceeds a preset threshold range, namely exceeds the processing capacity of the host, the server host can instruct the client to switch the QUIC protocol to the TCP protocol, namely send the HTTP over TCP request, so that parallel transmission is changed to serial transmission, the data volume to be processed at the server side is reduced, the processing pressure of the server host can be relieved, the phenomena of unresponsiveness, network blocking and the like in operation during protocol switching in the related art are avoided, and the user experience can be improved.
Optionally, the first information may be used to indicate a first transmission quality corresponding to the first transmission protocol, in other words, the first information is used to indicate a data transmission effect when the client and the server perform data interaction through the first transmission protocol. The second information is used for indicating a second transmission quality corresponding to the second transmission protocol, in other words, the second information is used for indicating a data transmission effect when the client and the server perform data interaction through the second transmission protocol. For convenience of description, the first information and the second information described herein may be collectively referred to as transmission quality information.
For example, the first information may include a packet loss rate and/or a transmission duration or delay when the client and the server interact with each other through the first transmission protocol. Likewise, the second information may include a packet loss rate and/or a transmission duration or a delay value when the client and the server perform data interaction through the second transmission protocol. It can be understood that if the packet loss rate is smaller, the transmission duration or the delay value is smaller, which indicates that the data transmission effect is better.
Optionally, the first information may be used to indicate a first request response rate corresponding to the first transmission protocol, in other words, the first information is used to indicate a success rate of the client initiating the request when the client and the server perform data interaction through the first transmission protocol. The second information is used for indicating a second request response rate corresponding to the second transmission protocol, in other words, the second information is used for indicating the success rate of the request initiated by the client when the client and the server perform data interaction through the second transmission protocol. For convenience of description, the first information and the second information described herein may be collectively referred to as request response rate information.
It should be noted that, the foregoing is an exemplary listing of the first information and the second information, and it is to be understood that, in an actual implementation, the embodiments of the present application include, but are not limited to, listing content of the first information and the second information, where the first information and the second information may be any other information that meets an actual use requirement and may be used to indicate parameters related to a transmission protocol, and specifically may be determined according to the actual use requirement, and the embodiments of the present application are not limited.
Optionally, the server may detect the first information and the second information in real time or periodically, or may store the detected first information and second information in the server, so that the server may call when needed to determine the target transmission protocol.
In step S320, the server determines a target transmission protocol according to the first information and the second information.
The server may determine, according to the first information and the second information, whether the first transmission protocol or the second transmission protocol is the target transmission protocol. It should be noted that, the server may acquire all or part of the first information and the second information listed above to determine the target transmission protocol, and may specifically be determined according to the actual use requirement, which is not limited in the embodiments of the present application. The following list several possible implementations of the server-side determining the target transport protocol based on the first information and the second information.
Mode one: it is assumed that the first information is used to indicate a first host capability corresponding to the first transmission protocol, and the second information is used to indicate a second host capability corresponding to the second transmission protocol. In this case, the server may compare the first host capability with the second host capability, and determine the target transport protocol according to the comparison result. For example, the step S320 may specifically include steps S320A and S320B described below.
S320A, if the first host capability is better than the second host capability, the server determines that the first transmission protocol is the target transmission protocol.
And S320B, if the first host capability is inferior to the second host capability, the server determines that the second transmission protocol is the target transmission protocol.
For example, the server may compare the CPU load when sending the request using the QUIC protocol with the CPU load when sending the request using the TCP protocol. On the one hand, if the server side judges that the CPU load capacity when the quit protocol is adopted to send the request is smaller than the CPU load capacity when the TCP protocol is adopted to send the request, this means that compared with the TCP protocol, the host capability or the host health condition of the server side is better when the quit protocol is adopted to send the request, the quit protocol is the currently recommended transmission protocol, and therefore the server side determines the quit protocol as the target transmission protocol. On the other hand, if the server determines that the CPU load is greater when the quench protocol is used to send the request than when the TCP protocol is used to send the request, this indicates that the host capability or the host health condition of the server is better when the TCP protocol is used to send the request than when the quench protocol is used, the TCP protocol is the currently recommended transmission protocol, so the server determines that the TCP protocol is the target transmission protocol.
Through the first mode, the server can determine the protocol with the highest capability corresponding to the host among the protocols supported by the server and the client as the transmission protocol adapting to the current scene, and further can instruct the client to switch to the transmission protocol adapting to the current scene, so as to realize intelligent active switching of the transmission protocol, and avoid the phenomena of unresponsiveness or network blocking and the like in the user operation caused by passive switching of the transmission protocol in the related technology.
Mode two: it is assumed that the first information is used to indicate a first amount of data corresponding to a first transmission protocol and the second information is used to indicate a second amount of data corresponding to a second transmission protocol. In this case, the server may compare the first data amount or the second data amount with a preset data amount threshold, and determine the target transmission protocol according to the comparison result. It should be noted that, since the HTTP over quench request may have a request concurrency phenomenon, it is mainly determined herein whether the request concurrency amount of the HTTP over quench request is greater than or equal to a preset data amount threshold, that is, whether an alarm threshold is exceeded. For example, the step S320 may include steps S320C and S320D described below.
S320C, if the first data volume is smaller than the preset data volume threshold, the server determines that the first transmission protocol is the target transmission protocol.
S320D, if the first data volume is greater than or equal to the preset data volume threshold and the second data volume is less than the preset data volume threshold, the server determines that the second transmission protocol is the target transmission protocol.
For example, assuming that the first data volume is a request concurrency volume of the HTTP over quench request, the server may compare the request concurrency volume with a preset data volume threshold. On the one hand, if the server side judges that the request concurrency of the HTTP over QUIC request is smaller than the preset data quantity threshold, which means that the server side can process a plurality of parallel requests when the QUIC protocol is adopted to send the request, the QUIC protocol is the transmission protocol recommended currently, and therefore the server side determines that the QUIC protocol is the target transmission protocol. On the other hand, if the server side judges that the request concurrency of the HTTP over QUIC request is greater than or equal to the preset data volume threshold, which means that the request concurrency when the QUIC protocol is adopted to send the request exceeds the processing limit of the server side, the QUIC protocol is not suitable for being adopted at the moment, the TCP protocol is the transmission protocol which is recommended currently, and therefore the server side determines the TCP protocol as the target transmission protocol.
It should be noted that, the preset data amount threshold (also referred to as an alarm threshold) may be set according to factors such as processing capability of the server host, and may specifically be determined according to actual use requirements, which is not limited in the embodiments of the present application.
Through the second mode, the server can determine the QUIC protocol with the request concurrency not reaching the alarm threshold as the transmission protocol adapting to the current scene, or switch to the TCP protocol if the QUIC protocol exceeds the alarm threshold, so that the client can be instructed to switch to the transmission protocol adapting to the current scene, and intelligent active switching of the transmission protocol is realized, so that the phenomena of no response or network blocking and the like of user operation caused by passive switching of the transmission protocol in the related technology are avoided.
Mode three: the first information is assumed to be used for indicating a first transmission quality corresponding to a first transmission protocol, and the second information is assumed to be used for indicating a second transmission quality corresponding to a second transmission protocol, wherein the first transmission quality is represented by a first time delay and/or a first packet loss rate, and the second transmission quality is represented by a second time delay and/or a second packet loss rate. In this case, the server may compare the first transmission quality with the second transmission quality, and determine the target transmission protocol according to the comparison result.
In one possible implementation, the delay size is used as a criterion for judging the quality of transmission. For example, the step S320 may specifically include steps S320E and S320F described below.
S320E, if the first time delay is smaller than the second time delay, the server determines that the first transmission protocol is the target transmission protocol.
S320F, if the first time delay is greater than or equal to the second time delay, the server determines that the second transmission protocol is the target transmission protocol.
For example, the server may compare a first time delay when sending a request using the QUIC protocol with a second time delay when sending a request using the TCP protocol. On the one hand, if the server side judges that the first time delay when the QUIC protocol is adopted to send the request is smaller than the second time delay when the TCP protocol is adopted to send the request, this means that compared with the TCP protocol, the end-to-end data transmission speed is faster when the QUIC protocol is adopted to send the request, the network acceleration effect is better, namely the transmission quality is better, the QUIC protocol is the transmission protocol which is recommended currently, and therefore the server side determines that the QUIC protocol is the target transmission protocol. The above process can be known that the method can realize the switching from TCP protocol to QUIC protocol between the client and the server for data transmission, and the transmission speed between the client and the server can be improved because the QUIC protocol has higher transmission speed.
On the other hand, if the server side judges that the first time delay when the QUIC protocol is adopted to send the request is larger than the second time delay when the TCP protocol is adopted to send the request, this means that compared with the QUIC protocol, the end-to-end data transmission speed is faster when the TCP protocol is adopted to send the request, the network acceleration effect is better, namely the transmission quality is better, the TCP protocol is the transmission protocol which is recommended to be adopted currently, and therefore the server side determines that the TCP protocol is the target transmission protocol.
In another possible implementation manner, the size of the packet loss rate is used as a criterion for judging the quality of transmission. For example, the step S320 may include steps S320G and S320H described below.
S320G, if the first packet loss rate is smaller than the second packet loss rate, the server determines that the first transmission protocol is the target transmission protocol.
S320H, if the first packet loss rate is greater than or equal to the second packet loss rate, the server determines that the second transmission protocol is the target transmission protocol.
For example, the server may compare the first packet loss rate when sending the request using the qic protocol with the second packet loss rate when sending the request using the TCP protocol. On the one hand, if the server side judges that the first packet loss rate when the QUIC protocol is adopted to send the request is smaller than the second packet loss rate when the TCP protocol is adopted to send the request, which means that compared with the TCP protocol, the end-to-end data transmission quality is better when the QUIC protocol is adopted to send the request, the QUIC protocol is the transmission protocol which is recommended currently, and therefore the server side determines that the QUIC protocol is the target transmission protocol.
On the other hand, if the server side determines that the first packet loss rate when the quit protocol is adopted to send the request is greater than or equal to the second packet loss rate when the TCP protocol is adopted to send the request, this means that compared with the quit protocol, the end-to-end data transmission quality is better when the TCP protocol is adopted to send the request, the TCP protocol is the currently recommended transmission protocol, and therefore the server side determines that the TCP protocol is the target transmission protocol.
In another possible implementation manner, the delay size and the packet loss rate size are used as the standards for judging the quality of transmission. For example, the step S320 may specifically include steps S320I and S320J described below.
S320I, if the first time delay is smaller than the second time delay and the first packet loss rate is smaller than the second packet loss rate, the server determines that the first transmission protocol is the target transmission protocol.
S320J, if the first time delay is greater than or equal to the second time delay and the first packet loss rate is greater than or equal to the second packet loss rate, the server determines that the second transmission protocol is the target transmission protocol.
For example, the server may compare the first delay when the request is sent using the qic protocol with the second delay when the request is sent using the TCP protocol, and compare the first packet loss rate when the request is sent using the qic protocol with the second packet loss rate when the request is sent using the TCP protocol.
On the one hand, if the server side judges that the first time delay when the QUIC protocol is adopted to send the request is smaller than the second time delay when the TCP protocol is adopted to send the request, and the first packet loss rate when the QUIC protocol is adopted to send the request is smaller than the second packet loss rate when the TCP protocol is adopted to send the request, namely, the time delay of the QUIC protocol is smaller, the packet loss rate is smaller, which means that compared with the TCP protocol, the end-to-end data transmission quality is better when the QUIC protocol is adopted to send the request, the QUIC protocol is the transmission protocol which is currently recommended to be adopted, and therefore the server side determines that the QUIC protocol is the target transmission protocol.
On the other hand, if the server side judges that the first time delay when the QUIC protocol is adopted to send the request is larger than the second time delay when the TCP protocol is adopted to send the request, and the first packet loss rate when the QUIC protocol is adopted to send the request is larger than the second packet loss rate when the TCP protocol is adopted to send the request, namely the time delay of the TCP protocol is smaller, the packet loss rate is smaller, which means that compared with the QUIC protocol, the end-to-end data transmission quality is better when the TCP protocol is adopted to send the request, the TCP protocol is the transmission protocol which is currently recommended to be adopted, and therefore the server side determines the TCP protocol as the target transmission protocol.
In still another aspect, if the first delay when the quit protocol is used to send the request is equal to the second delay when the TCP protocol is used to send the request, and the first packet loss rate when the quit protocol is used to send the request is equal to the second packet loss rate when the TCP protocol is used to send the request, where the quit protocol and the TCP protocol are substantially the same in transmission quality, then the target transmission protocol may be determined according to a preset protocol priority, for example, if the preset quit protocol is higher than the TCP protocol, then the server may determine that the quit protocol is the target transmission protocol, and may specifically be determined according to actual use requirements.
It should be noted that, in the case that the delay size and the packet loss rate size are both used as criteria for judging the quality of transmission, other possible implementation manners exist. For example, if the first delay is smaller than the second delay and the first packet loss rate is greater than the second packet loss rate, and if the delay is taken as a main judgment standard (focusing on the transmission speed), the server may determine that the first transmission protocol is the target transmission protocol; if the packet loss rate is the main criterion (focusing on the data integrity), the server may determine that the second transport protocol is the target transport protocol. For another example, if the first delay is greater than the second delay and the first packet loss rate is less than the second packet loss rate, the server determines that the second transmission protocol is the target transmission protocol, and if the packet loss rate is used as a main judgment standard (focusing on data integrity), the server may determine that the first transmission protocol is the target transmission protocol; if the delay is the main criterion (focusing on the transmission speed), the server may determine that the second transmission protocol is the target transmission protocol.
Through the third mode, the server can determine the protocol with the highest corresponding transmission quality in the multiple protocols supported by the server and the client as the transmission protocol adapting to the current scene, and further can instruct the client to switch to the transmission protocol adapting to the current scene, so as to realize intelligent active switching of the transmission protocol, and avoid the phenomena of unresponsiveness or network blocking and the like in the user operation caused by passive switching of the transmission protocol in the related art.
Mode four: it is assumed that the first information is used to indicate a first request response rate corresponding to the first transmission protocol, and the second information is used to indicate a second request response rate corresponding to the second transmission protocol. In this case, the server may compare the first request response rate with the second request response rate, and determine the target transmission protocol according to the comparison result. For example, the step S320 may specifically include steps S320K and S320L described below.
S320K, if the first request response rate is greater than or equal to the second request response rate, the server determines that the first transmission protocol is the target transmission protocol,
S320L, if the first request response rate is smaller than the second request response rate, the server determines that the second transmission protocol is the target transmission protocol.
For example, the server may compare a first request response rate when sending requests using the QUIC protocol with a second request response rate when sending requests using the TCP protocol. On the one hand, if the server side judges that the first request response rate when the QUIC protocol is adopted to send the request is larger than or equal to the second request response rate when the TCP protocol is adopted to send the request, which means that the success rate of the request is higher when the QUIC protocol is adopted to send the request compared with the TCP protocol, the QUIC protocol is the transmission protocol which is recommended currently, and therefore the server side determines that the QUIC protocol is the target transmission protocol. On the other hand, if the server side determines that the first request response rate when the request is sent by adopting the quit protocol is greater than the second request response rate when the request is sent by adopting the TCP protocol, this means that the request success rate is higher when the request is sent by adopting the TCP protocol than the quit protocol, the TCP protocol is the currently recommended transmission protocol, so the server side determines that the TCP protocol is the target transmission protocol.
Through the fourth mode, the server can determine the protocol with the highest response rate or success rate corresponding to the request from a plurality of protocols supported by the server and the client as the transmission protocol adapting to the current scene, and further can instruct the client to switch to the transmission protocol adapting to the current scene, so as to realize intelligent active switching of the transmission protocol, and avoid the phenomena of unresponsiveness or network blocking and the like in the user operation caused by passive switching of the transmission protocol in the related technology.
Mode five: the server may determine the target transport protocol in at least two of the first, second, third, and fourth modes. Specifically, the server may determine the target transmission protocol according to at least two types of information, including host capability information, data volume information, transmission quality information, and request response rate information, corresponding to the first transmission protocol and the second transmission protocol, respectively.
For example, taking the server side determines the target transmission protocol in any two ways as described above as an example, the server side may compare the first host capability and the first transmission quality when the request is sent using the QUIC protocol with the second host capability and the second transmission quality when the request is sent using the TCP protocol, respectively. On the one hand, if the server side judges that the first host capability is better than the second host capability and the first transmission quality is better than the second transmission quality, this means that compared with the TCP protocol, the end-to-end data transmission effect is better when the quit protocol is adopted to send the request, the quit protocol is the transmission protocol currently recommended to be adopted, so the server side determines the quit protocol as the target transmission protocol. On the other hand, if the server side determines that the first host computer is inferior to the second host computer and the first transmission quality is inferior to the second transmission quality, this indicates that compared with the qic protocol, the end-to-end data transmission effect is better when the TCP protocol is adopted to send the request, and the TCP protocol is the transmission protocol currently recommended to be adopted, so the server side determines that the TCP protocol is the target transmission protocol. In addition, if the server determines that the first host capability is inferior to the second host capability and the first transmission quality is superior to the second transmission quality, the server determines that the QUIC protocol is the target transmission protocol. In addition, if the server side judges that the first host capability is better than the second host capability and the first transmission quality is worse than the second transmission quality, the server side determines that the TCP protocol is the target transmission protocol.
It should be noted that the foregoing determination process and the following determination process are merely exemplary descriptions, and the embodiments of the present application include, but are not limited to, determining, by the server, a determination criterion of a target transmission protocol according to the first information and the second information, for example, when the determination criterion is that the host capability is prioritized, if the server determines that the first host capability is inferior to the second host capability and the first transmission quality is superior to the second transmission quality, the server may determine, by using the server, that the TCP protocol is the target transmission protocol according to the preset determination criterion.
Illustratively, taking the server side determining the target transmission protocol in any of the three manners as an example, the server side may compare the first host capability, the first transmission quality and the first request response rate when the request is sent using the QUIC protocol with the second host capability, the second transmission quality and the second request response rate when the request is sent using the TCP protocol, respectively. On the one hand, if the server side judges that the first host capability is better than the second host capability, the first transmission quality is better than the second transmission quality, and the first request response rate is greater than the second request response rate, this indicates that compared with the TCP protocol, the end-to-end data transmission effect is better when the quit protocol is adopted to send the request, the quit protocol is the currently recommended transmission protocol, and therefore the server side determines the quit protocol as the target transmission protocol. On the other hand, if the server determines that the first host is capable of being inferior to the second host, and the first transmission quality is inferior to the second transmission quality, and the first request response rate is smaller than the second request response rate, this indicates that compared with the qic protocol, the end-to-end data transmission effect is better when the TCP protocol is adopted to send the request, and the TCP protocol is the currently recommended transmission protocol, so the server determines that the TCP protocol is the target transmission protocol. Other possible determination processes may be determined according to preset determination criteria, which are not described herein.
For example, taking the server side determines the target transmission protocol in the four manners as described above as an example, the server side may compare the first host capability, the first transmission quality, and the first request response rate when the request is sent using the QUIC protocol with the second host capability, the second transmission quality, and the second request response rate when the request is sent using the TCP protocol, respectively, and compare the first data amount (request concurrency amount) when the request is sent using the QUIC protocol with the preset data amount threshold. On the one hand, if the server side judges that the first host capability is better than the second host capability, the first transmission quality is better than the second transmission quality, the first request response rate is greater than the second request response rate, and the first data volume is smaller than the preset data volume threshold, this means that compared with the TCP protocol, when the QUIC protocol is adopted to send the request, the end-to-end data transmission effect is better, the QUIC protocol is the transmission protocol currently recommended, and therefore the server side determines the QUIC protocol as the target transmission protocol. On the other hand, if the server side judges that the first data volume is larger than the preset data volume threshold when the QUIC protocol is adopted to send the request, the current request concurrency volume reaches the alarm threshold of the host processing capacity, and the method is not suitable for continuously adopting the QUIC protocol, so that the server side can directly determine the TCP protocol as the target transmission protocol without considering the comparison result of the capability information, the transmission quality information and the request response rate information. Other possible determination processes may be determined according to preset determination criteria, which are not described herein.
Through the fifth mode, the server side can comprehensively consider the capacities, the data amounts, the transmission quality and the request response rates of the corresponding hosts in the multiple protocols supported by the server side and the client side, determine the transmission protocol adapting to the current scene, improve the accuracy of judging the adaptation protocol, further instruct the client side to switch to the transmission protocol adapting to the current scene, realize intelligent active switching of the transmission protocol, and avoid the phenomena of no response or network blocking and the like in the user operation caused by passive switching of the transmission protocol in the related technology. That is, the adaptive transmission protocol is automatically selected according to the change of various factors in the system environment in the current scene, so as to adapt to the change in real time and improve the communication efficiency.
In this embodiment, the "greater than" may be replaced with "greater than or equal to" and "less than or equal to" may be replaced with "less than" or "greater than or equal to" may be replaced with "greater than" and "less than" may be replaced with "less than or equal to". The method can be specifically determined according to actual use requirements, and the embodiment of the application is not limited.
In step S330, the server sends first indication information to the client, and the client receives the first indication information sent by the server.
The first indication information is used for indicating a target transmission protocol.
In this embodiment of the present application, after determining the target transport protocol, the server sends first indication information to the client, and informs the client that the target transport protocol is the currently recommended transport protocol.
In step S340, the client determines, according to the first indication information, the target transmission protocol as a transmission protocol for data interaction with the server.
In this embodiment of the present application, after receiving the first indication information, the client acquires a recommended transmission protocol of the server, for example, the QUIC protocol or the TCP protocol, and may further use the recommended transmission protocol when subsequently sending a request to the server. According to the embodiment of the application, the HTTP over QUIC protocol and the HTTP over TCP protocol are comprehensively considered, and the optimal transmission protocol adapted to the current scene is determined through obtaining the related information and analyzing, so that all the protocols are linked together, and intelligent active switching of the protocols is realized.
According to the method for indicating the transmission protocol, the server side obtains first information of the first transmission protocol and second information of the second transmission protocol; the server determines a target transmission protocol according to the first information and the second information, wherein the target transmission protocol is the first transmission protocol or the second transmission protocol; the server side sends first indication information to the client side, wherein the first indication information is used for indicating a target transmission protocol. According to the scheme, the server comprehensively judges the transmission protocol suitable for data interaction in the current scene based on the data such as network quality, protocol application effect, server host health condition and the like, and then informs the determined transmission protocol to the client, so that the client can select to interact with the server through the transmission protocol, and intelligent scheduling of the transmission protocol can be realized. That is, the adaptive transmission protocol can be automatically selected according to the change of various factors in the system environment in the current scene, so as to adapt to the change in real time and improve the communication efficiency. The phenomena of unresponsiveness of operation, network blocking and the like in the process of protocol switching in the related art are avoided, so that the user experience can be improved.
Optionally, in the embodiment of the present application, the server may actively (e.g. periodically) determine, according to a scene of course, a transmission protocol adapted to the current scene and inform the client to switch to the transmission protocol, or the client may send a request message to the server, to trigger the server to determine the transmission protocol adapted to the current scene. Two possible implementations are given below by way of example, the first implementation is that the client requests the server to determine the transmission protocol adapted to the current scenario, and the second implementation is that the client requests the server to process the service, and the server determines the transmission protocol adapted to the current scenario while processing the service.
First implementation: referring to fig. 4, as shown in fig. 5, before step S310 described above, the method 300 for indicating a transmission protocol provided in the embodiment of the present application may further include step S350 described below.
S350, the client sends a first request message to the server, and the server receives the first request message sent by the client.
The first request message is used for indicating the server to determine a target transmission protocol.
Further, as shown in fig. 5, after the above step S350, the above step S310 may be specifically implemented by the following step S310A, and the above step S330 may be specifically implemented by the following steps S330A and S330B.
S310A, the server side responds to the first request message to acquire first information of a first transmission protocol and second information of a second transmission protocol.
S330A, the server side sends a first response message of the first request message to the client side, wherein the first response message comprises first indication information.
Alternatively, the first response message may include HTTP response header (Headers) information. The first indication information is carried in a reserved field in the HTTP response header information. That is, indication information of the QUIC protocol may be set in a reserved field in the HTTP response header information to indicate that the currently preferred protocol is the QUIC protocol; of course, the indication information of the TCP protocol may also be set to indicate that the currently preferred protocol is the TCP protocol.
Illustratively, assuming that the first indication information indicates the QUIC protocol, the server sets the indication information of the QUIC protocol in a reserved Alt-Svc field in the HTTP response header information.
For example, in response to header information: alt-svc' quic= ": port number"; ma= < max-age >; v= "quit version number'";
wherein, quic= ": port number" is a mandatory option for indicating that the currently preferred protocol is the qic protocol, and the port number provided for client access. v= "quit version number" is a mandatory option for indicating the quit version number supported by the current server.
Wherein ma= < max-age > is an optional item, and is used for indicating the validity period of the current access mode, after the period of time is exceeded, the server will not ensure that the access mode is still available, and the client should reacquire the updated Alt-Svc list. For example, the expiration date is in seconds, and the default value is 24 hours (i.e., 86400 seconds).
The following describes a specific implementation manner of carrying the first indication information through the reserved field in the HTTP response header information in the embodiment of the present application by enumerating two examples.
Example 1: alt-svc' quic= ":443"; v= "43'";
from the above response header information, the currently preferred protocol is the QUIC protocol, the port number accessible to the client is 443, and the QUIC version number supported by the current server is 43.
Example 2: alt-svc' quic= ":443"; ma= 2592000; v= "43'";
from the above response header information, the currently preferred protocol is the QUIC protocol, the number of ports accessible to the client is 443, the validity period of the current access mode is 2592000 seconds, and the QUIC version number supported by the current server is 43.
Also exemplary, assuming that the first indication information indicates a TCP protocol, the server sets the indication information of the TCP protocol in a reserved field in the HTTP response header information.
For example, in response to header information: alt-svc' tcp= ": port number"; ma= < max-age >';
wherein tcp= ": port number" is a mandatory option for indicating that the currently preferred protocol is the TCP protocol and the port number provided for client access. ma= < max-age > is an optional item, and is used for indicating the validity period of the current access mode, after the time is exceeded, the server side will not guarantee that the access mode is still available, and the client side should reacquire the updated Alt-Svc list. For example, the expiration date is in seconds, and the default value is 24 hours (i.e., 86400 seconds).
The following describes a specific implementation manner of carrying the first indication information through the reserved field in the HTTP response header information in the embodiment of the present application by enumerating two examples.
Example 1: alt-svc' tcp= ":443";
as can be seen from the above response header information, the currently preferred protocol is the TCP protocol, and the number of the port accessible to the client is 443.
Example 2: alt-svc' tcp= ":443"; ma=86400;
as can be seen from the above-mentioned response header information, the currently preferred protocol is the TCP protocol, the number of the ports accessible to the client is 443, and the validity period of the current access mode is 86400 seconds.
S330B, the client receives the first response message and acquires the first indication information from the first response message.
The client receives the request response sent by the server, analyzes the Alt-Svc field in the HTTP response header, acquires the preferred protocol recommended by the server (HTTP over QUIC protocol or HTTP over TCP protocol), and decides the preferred protocol of the subsequent request.
In the embodiment of the application, when the server receives the client request, the server can comprehensively judge the preferred transmission protocol suitable for data interaction in the current scene based on the data such as network quality, protocol application effect, host health condition and the like, dynamically set the preferred protocol in the Alt-Svc field in the HTTP response header, actively inform the client of the preferred transmission protocol, and further the client can select to interact with the server through the transmission protocol, so that intelligent scheduling of the transmission protocol can be realized. Therefore, the embodiment of the application can dynamically adjust the communication protocol of the transmission layer to adapt to the change of the system environment, thereby improving the transmission efficiency of the network and improving the experience of users.
In order to better illustrate the method for indicating the transmission protocol provided by the first implementation manner of the embodiment of the present application, the method for indicating the transmission protocol provided by the first implementation manner of the embodiment of the present application is further described below with reference to fig. 6. Fig. 6 is a flowchart of a method for indicating a transmission protocol according to a first implementation of the embodiment of the present application. As shown in fig. 6, the method flow includes steps S401-S407 described below.
S401, the client side sends a preferential protocol detection request (namely the first request message) to the server side at fixed time.
For example, the client may specify a special uniform resource locator (uniform resoure locator, URL) as the protocol preferred probe request.
S402, the server (e.g. server cluster) receives the probe request.
S403, the server side collects server cluster data, and the server side mainly comprises the following three dimensions:
1) Host health (CPU load, memory space, service process, etc. data);
2) Request health status (request success rate, request concurrency amount, etc.);
3) Transmission quality conditions (request end-to-end delay, packet loss rate, etc.).
S404, the server determines a preferred protocol (i.e. the above-mentioned target transmission protocol) according to one or more of the following a) to d):
a) Whether the QUIC protocol is worse than the TCP protocol host, i.e. the host health is worse;
b) Whether the QUIC protocol is lower than the transmission quality of the TCP protocol is judged by comparing the request time delay and/or the packet loss rate and the like;
c) Whether the concurrency of the QUIC protocol request reaches an alarm threshold;
d) Whether the QUIC protocol requests a lower success rate than the TCP protocol.
Here, the quitc protocol refers to an HTTP protocol based on quitc connection, and the TCP protocol refers to an HTTP protocol based on TCP connection.
S405A, if one or more of the above-mentioned a) to d) are not satisfied (corresponding to no in fig. 6), the server preferably uses the HTTP protocol of the QUIC connection.
S405B, if one or more of the above a) to d) are satisfied (corresponding to yes in fig. 6), the server preferably uses HTTP protocol based on TCP connection.
It should be noted that, for the above steps S405A and S405B, the server alternatively executes, and then continues to execute step S406 described below.
S406, the server side loads the preferred protocol through an Alt-Svc field in the HTTP response header, and sends a first response message to the client side.
S407, the client receives the first response message, analyzes the Alt-Svc field in the response header, and selects a preferred protocol as a protocol for data interaction with the server.
Further, the client continues to execute steps S401 to S407 described above.
First implementation: referring to fig. 4, as shown in fig. 7, before step S310 described above, the method 300 for indicating a transmission protocol provided in the embodiment of the present application may further include step S360 described below.
S360, the client sends a second request message to the server, and the server receives the second request message sent by the client.
The second request message is used for requesting the server to process the first service.
Optionally, the client may send the second request message to the server through the first transmission protocol or the second transmission protocol. Specifically, the client may send a second request message to the server through the first transport protocol, or may send a service request (i.e. the second request message) to the server through the second transport protocol, where the server may parse the service request to process a corresponding service when receiving the service request sent by the client, and determine a currently adopted transport protocol (for example, currently adopting a quit protocol) according to the service request, and then determine whether the currently adopted transport protocol is adapted to a current application scenario (for example, determine whether the request concurrency of the quit protocol exceeds an alarm threshold value), that is, determine whether switching of the transport protocol needs to be performed, so as to implement intelligent active scheduling of the transport protocol, and avoid a situation that the protocol scheduling can only be performed when user experience is damaged, so as to improve user experience.
Further, as shown in fig. 7, after the above step S360, the above step S310 may be specifically implemented by the following steps S310B and S310C.
S310B, the server responds to the second request message and processes the first service to obtain the processing information of the first service.
S310C, the server side responds to the second request message to acquire the first information of the first transmission protocol and the second information of the second transmission protocol.
Further, the step S330 may be specifically implemented by the steps S330C and S330D described below.
S330C, the server sends a second response message of the second request message to the client, wherein the second response message comprises the first indication information and the processing information of the first service.
Optionally, the second response message may include HTTP response header information. The first indication information is carried in a reserved field in the HTTP response header information. For the description of the HTTP response header information and the reserved field, reference may be made to the above detailed description of the HTTP response header information and the reserved field, which are not repeated herein.
And S330D, the client receives the second response message and acquires the first indication information from the second response message.
The client receives the request response sent by the server, analyzes the Alt-Svc field in the HTTP response header, acquires the preferred protocol recommended by the server (HTTP over QUIC protocol or HTTP over TCP protocol), and decides the preferred protocol of the subsequent request.
Through the scheme, when the server receives the client request, the server determines the optimal transmission protocol (such as TCP protocol or QUIC protocol) adapting to the current scene according to the information related to the transmission protocol in the current scene, and actively informs the optimal transmission protocol of the client, so that the intelligent scheduling of the transmission protocol of the client is realized, the situation that the client can schedule the protocol when the user experience is damaged is avoided, the user experience can be improved, and the behavior that the client needs to retry the transmission protocol at regular time under the condition that the transmission protocol is unavailable is avoided. That is, the embodiment of the application can automatically select the adaptive transmission protocol according to the change of various factors in the system environment in the current scene, so as to adapt to the change in real time and improve the communication efficiency.
In order to better illustrate the method for indicating the transmission protocol provided by the second implementation manner of the embodiment of the present application, the method for indicating the transmission protocol provided by the second implementation manner of the embodiment of the present application is further described below with reference to fig. 8. Fig. 8 is a flowchart of a method for indicating a transmission protocol according to a second implementation of the embodiment of the present application. As shown in fig. 8, the method flow includes steps S501-S507 described below.
S501, the client sends a service request (namely the second request message) to the server through the QUIC protocol or the TCP protocol.
S502, the service end (for example, a server cluster) receives the service request.
S503, the server collects server cluster data, which mainly comprises the following three dimensions:
1) Host health (CPU load, memory space, service process, etc. data);
2) Request health status (request success rate, request concurrency amount, etc.);
3) Transmission quality conditions (request end-to-end delay, packet loss rate, etc.).
S504, the server determines a preferred protocol (i.e. the above-mentioned target transmission protocol) according to one or more of the following a) to d):
a) Whether the QUIC protocol is worse than the TCP protocol host, i.e. the host health is worse;
b) Whether the QUIC protocol is lower than the transmission quality of the TCP protocol is judged by comparing the request time delay and/or the packet loss rate and the like;
c) Whether the concurrency of the QUIC protocol request reaches an alarm threshold;
d) Whether the QUIC protocol requests a lower success rate than the TCP protocol.
Note that, the quitc protocol referred to herein refers to the HTTP protocol based on quitc connection, and a request transmitted through the quitc protocol is referred to as an HTTP over quitc request. The TCP protocol referred to herein refers to the HTTP protocol based on TCP connections, and requests sent over the TCP protocol are denoted HTTP over TCP requests.
S505A, if one or more of the above-mentioned a) to d) are not satisfied (corresponding to no in fig. 6), the server preferably uses the HTTP protocol of the QUIC connection.
S505B, if one or more of the above a) to d) are satisfied (corresponding to yes in fig. 6), the server preferably uses HTTP protocol based on TCP connection.
It should be noted that, for the above steps S505A and S505B, the server alternatively executes, and then continues to execute step S506 described below.
S506, the server side loads the preferred protocol through the Alt-Svc field in the HTTP response header, and sends a second response message to the client side.
S507, the client receives the second response message, analyzes the Alt-Svc field in the response header, and selects the preferred protocol as the protocol for data interaction with the server.
Further, the client continues to execute steps S501-S507 described above.
It should be noted that the difference between fig. 8 and fig. 6 is that in fig. 6, the client directly requests the server to determine the target transport protocol, and the server determines to adapt to the current scenario and informs the client in response to the probe request. In fig. 8, a client requests a server to process a service, and the server processes the service while determining a transmission protocol adapted to a current scene in response to the service request, and informs the client of the transmission protocol adapted to the current scene when feeding back service processing data.
In some possible implementations, after the server side sends the first indication information to the client side and informs the client side that the target transmission protocol is the currently recommended transmission protocol, the client side performs data interaction with the server side by adopting the transmission protocol adapted to the current scene.
As shown in fig. 9 in conjunction with fig. 4, after the step S340, the method 300 for indicating a transmission protocol according to the embodiment of the present application may further include the following steps S370 to S390.
And S370, the client sends a third request message to the server through the target transmission protocol, and the server receives the third request message sent by the client.
The third request message is used for requesting the server to process the second service.
S380, the server responds to the third request message to process the second service, and processing information of the second service is obtained.
In the embodiment of the application, the client sends out a normal service processing request of the HTTP over QUIC or HTTP over TCP type, and the server receives the service request sent by the client and processes the service request to obtain a service processing result.
S390, the server sends the processing information of the second service to the client through the target transmission protocol.
In the embodiment of the application, the client can adopt the transmission protocol adapting to the current scene according to the first indication information sent by the server, and adopts the transmission protocol currently recommended by the server when sending the request to the client, so that intelligent active switching of the transmission protocol is realized, and the phenomena of unresponsiveness or network blocking and the like in the user operation caused by passive switching of the transmission protocol in the related technology are avoided.
It should be noted that, fig. 9 in the foregoing embodiment of the present application is illustrated in conjunction with fig. 4, and in a specific implementation, fig. 9 may also be implemented in conjunction with any other drawing (for example, fig. 5 and fig. 7) that may be combined.
The scheme provided by the embodiment of the application is mainly used for solving the problems that the client passive sensing QUIC protocol is unavailable, protocol switching is only carried out under the result of poor user experience, and the client needs to retry the QUIC connection at fixed time. In the embodiment of the application, the server actively informs the client of the protocol which should be preferred by the client through the Alt-Svc field in the HTTP response Headers according to the current host and the protocol health condition, so as to realize active prevention and active switching, reduce the resource overhead of the client and improve the user experience.
In order to better illustrate the method for indicating the transmission protocol provided by the embodiment of the present application, the following further describes a core module for implementing the method according to the embodiment of the present application with reference to fig. 10. The main core module of the embodiment of the present application is shown in fig. 10. These core modules are described below.
First client 10
Application (APP) software (software sevelopment kit, SDK) module 101 is responsible for connection racing, message parsing, sending and receiving HTTP over quit requests and HTTP over TCP requests.
The connection establishment and racing means that connection is established with a server by adopting a QUIC and TCP competing mode, which protocol is fast to establish connection, and which protocol is selected. For example, the client 10 sends an HTTP over quench request and an HTTP over TCP request to the server 20, and if a connection is established first by the HTTP over quench request, the client 10 selects the quench protocol to establish a connection with the server 20.
(II) service end 20
Request processing module 201: and realizing message processing and forwarding of the HTTP over QUIC request and the HTTP over TCP request.
Big data module 202: and collecting the application conditions of the server host and the protocol, and performing summarization analysis. For example, the data collected by big data module 202 includes data of the following three aspects:
1) Host health (CPU load, memory space, service process, etc. data);
2) Request health status (request success rate, request amount, etc.);
3) Network acceleration effect (HTTP over QUIC request versus HTTP over TCP request end-to-end delay contrast, packet loss rate).
Protocol preference decision module 203: based on the host and protocol conditions after big data summarization analysis, the decision informs the client of the preferred protocol.
Response head processing module 204: and carrying or setting a preferred protocol through an Alt-Svc field in the HTTP response header information.
Illustratively, in the case that the server 20 receives a request sent by the client 10, the server 20 processes the request through the request processing module 201, and obtains the current server cluster data from the big data module 202; then, the protocol preference decision module 203 decides to inform the client of the preference protocol according to the data acquired by the big data module 202; the response header processing module 204 then carries or sets the preferred protocol through the Alt-Svc field in the HTTP response header information.
The various embodiments described herein may be separate solutions or may be combined according to inherent logic, which fall within the scope of the present application.
It will be appreciated that the methods and operations implemented by the server in the foregoing embodiments of the methods may also be implemented by a component (e.g., a chip or a circuit) that may be used in the server. The methods and operations described above as being implemented by a client in various method embodiments may also be implemented by a component (e.g., a chip or circuit) that may be used in the client.
Having described the method embodiments provided herein, embodiments of the apparatus provided herein are described below. It should be understood that the descriptions of the apparatus embodiments and the descriptions of the method embodiments correspond to each other, and thus, descriptions of details not described may be referred to the above method embodiments, which are not repeated herein for brevity.
The solutions provided by the embodiments of the present application are mainly described above from the perspective of interaction between devices. It is understood that each device, such as a transmitting device or a receiving device, includes a corresponding hardware structure and/or software module for performing each function in order to implement the functions described above. Those of skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as hardware or combinations of hardware and computer software. Whether a function is implemented as hardware or computer software driven hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
According to the embodiment of the present application, according to the above method example, the transmitting end device or the receiving end device may be divided into functional modules, for example, each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing module. The integrated modules may be implemented in hardware or in software functional modules. It should be noted that, in the embodiment of the present application, the division of the modules is merely a logic function division, and other possible division manners may be implemented in practice. The following description will take an example of dividing each functional module into corresponding functions.
Fig. 11 is a schematic block diagram of an apparatus 700 for indicating a transmission protocol according to an embodiment of the present application. The apparatus 700 may be used to perform the actions performed by the server in the method embodiments above. The apparatus 700 comprises an acquisition unit 710, a processing unit 720 and a transceiver unit 730. The acquiring unit 710 is configured to acquire data, and the processing unit 720 is configured to perform the operations related to the processing on the service side in the above method embodiment. The transceiver unit 730 is configured to perform the operations related to the transceiving on the server side in the above method embodiment. The transceiver unit 730 may also be referred to as a communication interface or a communication unit.
The acquiring unit 710 is configured to acquire first information of a first transmission protocol and second information of a second transmission protocol; the processing unit 720 is configured to determine a target transmission protocol according to the first information and the second information, where the target transmission protocol is the first transmission protocol or the second transmission protocol; the transceiver unit 730 is configured to send first indication information to the client, where the first indication information is used to indicate the target transport protocol.
The first information is used for indicating the first host capability corresponding to the first transmission protocol, and the second information is used for indicating the second host capability corresponding to the second transmission protocol; and/or, the first information is used for indicating a first data volume corresponding to a first transmission protocol, and the second information is used for indicating a second data volume corresponding to a second transmission protocol; and/or, the first information is used for indicating a first transmission quality corresponding to the first transmission protocol, and the second information is used for indicating a second transmission quality corresponding to the second transmission protocol; and/or, the first information is used for indicating a first request response rate corresponding to the first transmission protocol, and the second information is used for indicating a second request response rate corresponding to the second transmission protocol.
The device for indicating the transmission protocol can comprehensively judge the transmission protocol suitable for data interaction in the current scene based on the data such as the network quality, the protocol application effect, the health condition of the host computer of the server side and the like, then inform the determined transmission protocol to the client side, and the client side can select to conduct data interaction through the transmission protocol to realize intelligent scheduling of the transmission protocol. That is, the device can automatically select the adaptive transmission protocol according to the change of various factors in the system environment under the current scene, so as to adapt to the change in real time and improve the communication efficiency. The phenomena of unresponsiveness of operation, network blocking and the like in the process of protocol switching in the related art are avoided, so that the user experience can be improved.
As an alternative embodiment, the first transmission protocol may be a hypertext transmission protocol HTTP protocol based on a QUIC connection, and the second transmission protocol may be an HTTP protocol based on a TCP connection.
As an alternative embodiment, the first information may be used to indicate a first host capability corresponding to the first transmission protocol, and the second information may be used to indicate a second host capability corresponding to the second transmission protocol. In this case, the processing unit 720 specifically functions to: if the first host capability is better than the second host capability, determining the first transmission protocol as a target transmission protocol; alternatively, if the first host capability is inferior to the second host capability, the second transport protocol is determined to be the target transport protocol.
As an optional embodiment, the first information is used to indicate a first data amount corresponding to the first transmission protocol, and the second information is used to indicate a second data amount corresponding to the second transmission protocol. In this case, the processing unit 720 specifically functions to: if the first data volume is smaller than the preset data volume threshold value, determining that the first transmission protocol is a target transmission protocol; or if the first data volume is greater than or equal to the preset data volume threshold and the second data volume is less than the preset data volume threshold, determining that the second transmission protocol is the target transmission protocol.
As an optional embodiment, the first information is used to indicate a first transmission quality corresponding to a first transmission protocol, and the second information is used to indicate a second transmission quality corresponding to a second transmission protocol, where, by way of example, the first transmission quality may be indicated by a first delay and/or a first packet loss rate, and the second transmission quality may be indicated by a second delay and/or a second packet loss rate.
In this case, the processing unit 720 specifically functions to: if the first time delay is smaller than the second time delay, determining that the first transmission protocol is a target transmission protocol; if the first time delay is greater than or equal to the second time delay, determining the second transmission protocol as the target transmission protocol.
And/or, the processing unit 720 is specifically configured to: if the first packet loss rate is smaller than the second packet loss rate, determining the first transmission protocol as a target transmission protocol; and if the first packet loss rate is greater than or equal to the second packet loss rate, determining the second transmission protocol as the target transmission protocol.
And/or, the processing unit 720 is specifically configured to: if the first time delay is smaller than the second time delay and the first packet loss rate is smaller than the second packet loss rate, determining the first transmission protocol as a target transmission protocol; and if the first time delay is greater than or equal to the second time delay and the first packet loss rate is greater than or equal to the second packet loss rate, determining the second transmission protocol as the target transmission protocol.
As an optional embodiment, the first information is used to indicate a first request response rate corresponding to the first transmission protocol, and the second information is used to indicate a second request response rate corresponding to the second transmission protocol. In this case, the processing unit 720 specifically functions to: if the first request response rate is greater than or equal to the second request response rate, determining that the first transmission protocol is a target transmission protocol; or if the first request response rate is smaller than the second request response rate, determining that the second transmission protocol is the target transmission protocol.
In some possible implementations, the transceiver unit 730 is further configured to, before sending the first indication information to the client, receive a first request message sent by the client, where the first request message is used to instruct the apparatus 700 to determine the target transmission protocol. The transceiver unit 730 is specifically configured to send a first response message of the first request message to the client, where the first response message includes the first indication information.
In other possible implementations, the transceiver unit 730 is further configured to, before sending the first indication information to the client, receive a second request message sent by the client through the first transport protocol or the second transport protocol, where the second request message is used to request the apparatus 700 to process the first service. The transceiver unit 730 is specifically configured to send a second response message of the second request message to the client, where the second response message includes the processing information of the first service and the first indication information.
In some possible implementations, the first response message or the second response message may include HTTP response header information. The first indication information may be carried in a reserved field in the HTTP response header information.
In some possible implementations, the transceiver unit 730 is further configured to, after sending the first indication information to the client, receive a third request message sent by the client through the target transport protocol, where the third request message is used to request processing of the second service; and is also used to send the processing information of the second service to the client via the target transport protocol.
The apparatus 700 according to the embodiments of the present application may correspond to performing the methods described in the embodiments of the present application, and the foregoing and other operations and/or functions of the units in the apparatus 700 are respectively for implementing the corresponding flows of the methods, and are not described herein for brevity. It should be noted that, in actual implementation, the acquiring unit 710 in fig. 11 may correspond to the big data module 202 in fig. 10; the processing unit 720 in fig. 11 may include the request processing module 201, the protocol preference decision module 203, and the response head processing module 204 in fig. 10.
Fig. 8 is a schematic block diagram of an apparatus 800 for indicating a transmission protocol according to an embodiment of the present application. The apparatus 800 may be used to perform the actions performed by the client in the method embodiments above. The apparatus 800 includes a transceiver unit 810 and a processing unit 820. The transceiver unit 810 is configured to perform the operations related to the transceiving on the client side in the above method embodiment. The transceiver unit 810 may also be referred to as a communication interface or a communication unit. The processing unit 820 is configured to perform data processing, and the processing unit 820 is configured to perform processing-related operations on the client side in the above method embodiment.
The transceiver unit 810 is configured to receive first indication information sent by the server, where the first indication information is used to indicate a target transport protocol, where the target transport protocol is determined by the server according to first information of the first transport protocol and second information of the second transport protocol, and the target transport protocol is the first transport protocol or the second transport protocol.
The processing unit 820 is configured to determine, according to the first indication information, the target transport protocol as a transport protocol for data interaction with the server.
The first information is used for indicating the first host capability corresponding to the first transmission protocol, and the second information is used for indicating the second host capability corresponding to the second transmission protocol; and/or, the first information is used for indicating a first data volume corresponding to a first transmission protocol, and the second information is used for indicating a second data volume corresponding to a second transmission protocol; and/or, the first information is used for indicating a first transmission quality corresponding to the first transmission protocol, and the second information is used for indicating a second transmission quality corresponding to the second transmission protocol; and/or, the first information is used for indicating a first request response rate corresponding to the first transmission protocol, and the second information is used for indicating a second request response rate corresponding to the second transmission protocol.
The device for indicating the transmission protocol can receive the transmission protocol suitable for data interaction in the current scene comprehensively judged by the server based on the network quality, the protocol application effect, the server host health condition and the like, and further can select the transmission protocol to interact with the server to realize intelligent scheduling of the transmission protocol. That is, the device can automatically select the adaptive transmission protocol according to the change of various factors in the system environment under the current scene, so as to adapt to the change in real time and improve the communication efficiency. The phenomena of unresponsiveness of operation, network blocking and the like in the process of protocol switching in the related art are avoided, so that the user experience can be improved.
In some possible implementations, the first transmission protocol may be a hypertext transmission protocol HTTP protocol based on a QUIC connection, and the second transmission protocol may be an HTTP protocol based on a TCP connection.
In some possible implementations, the transceiver unit 810 is further configured to send, before receiving the first indication information sent by the server, a first request message to the server, where the first request message is used to instruct the server to determine the target transmission protocol. The transceiver 810 is specifically configured to receive a first response message sent by the server to the first request message, where the first response message includes first indication information.
In some possible implementations, the transceiver unit 810 is further configured to, before receiving the first indication information sent by the server, send a second request message to the server through the first transmission protocol or the second transmission protocol, where the second request message is used to request the server to process the first service. The transceiver 810 is specifically configured to receive a second response message sent by the server to the first request message, where the second response message includes processing information of the first service and first indication information.
In some possible implementations, the first response message or the second response message may include HTTP response header information. The first indication information may be carried in a reserved field in the HTTP response header information.
In some possible implementations, the transceiver unit 810 is further configured to send, after sending the first indication information to the client, a third request message to the server through the target transport protocol, where the third request message is used to request the server to process the second service; and receiving the processing information of the second service sent by the server through the target transmission protocol.
The apparatus 800 according to the embodiment of the present application may correspond to performing the method described in the embodiment of the present application, and the foregoing and other operations and/or functions of the units in the apparatus 800 are respectively for implementing the corresponding flows of the method, and are not described herein for brevity. In actual implementation, the processing unit 820 in fig. 12 may correspond to the APP SDK101 in fig. 10.
Fig. 13 is a schematic structural diagram of an electronic device 900 provided in an embodiment of the present application. The electronic device 900 includes: processor 910, memory 920, communication interface 930, bus 940.
In one possible implementation, the processor 910 in the electronic device 900 shown in fig. 13 may correspond to the processing unit 720 in the apparatus 700 in fig. 11. The communication interface 930 in the electronic device 900 shown in fig. 13 may correspond to the transceiving unit 730 in the apparatus 700 in fig. 11.
In one possible implementation, the processor 910 in the electronic device 900 shown in fig. 13 may correspond to the processing unit 820 in the apparatus 800 in fig. 12. The communication interface 930 in the electronic device 900 shown in fig. 13 may correspond to the transceiving unit 810 in the apparatus 800 in fig. 12.
Wherein the processor 910 may be coupled to a memory 920. The memory 920 may be used to store the program codes and data. Accordingly, the memory 920 may be a storage unit internal to the processor 910, an external storage unit independent of the processor 910, or a component including a storage unit internal to the processor 910 and an external storage unit independent of the processor 910.
Optionally, the electronic device 900 may also include a bus 940. The memory 920 and the communication interface 930 may be connected to the processor 910 through a bus 940. Bus 940 may be a peripheral component interconnect standard (peripheral component interconnect, PCI) bus or an extended industry standard architecture (extended industry standard architecture, EISA) bus, among others. The bus 940 may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, only one line is shown in fig. 13, but not only one bus or one type of bus.
It should be appreciated that in embodiments of the present application, the processor 910 may employ a central processing unit (central processing unit, CPU). The processor may also be other general purpose processors, digital signal processors (digital signal processor, DSP), application specific integrated circuits (application specific integrated circuit, ASIC), off-the-shelf programmable gate arrays (field programmable gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. Or the processor 810 may employ one or more integrated circuits for executing associated programs to carry out the techniques provided by embodiments of the present application.
The memory 920 may include read only memory and random access memory and provide instructions and data to the processor 910. A portion of the processor 910 may also include nonvolatile random access memory. For example, the processor 910 may also store information of the device type.
When the electronic device 900 is running, the processor 910 executes computer-executable instructions in the memory 920 to perform the operational steps of the methods described above.
It should be understood that the electronic device 900 according to the embodiment of the present application may correspond to the apparatus 700 and the apparatus 800 in the embodiment of the present application, and that the foregoing and other operations and/or functions of each unit in the apparatus 700 and the apparatus 800 are respectively for implementing the corresponding flow of the method, and are not described herein for brevity.
Optionally, in some embodiments, the embodiments further provide a computer readable medium storing a program code, which when run on a computer, causes the computer to perform the method in the above aspects.
Optionally, in some embodiments, embodiments of the present application further provide a computer program product comprising: computer program code which, when run on a computer, causes the computer to perform the method of the above aspects.
In the embodiment of the application, the terminal device or the network device includes a hardware layer, an operating system layer running above the hardware layer, and an application layer running above the operating system layer. The hardware layer may include a central processing unit (central processing unit, CPU), a memory management unit (memory management unit, MMU), and a memory (also referred to as a main memory). The operating system of the operating system layer may be any one or more computer operating systems that implement business processing through processes (processes), for example, a Linux operating system, a Unix operating system, an Android operating system, an iOS operating system, or windows operating system, etc. The application layer may include applications such as a browser, address book, word processor, instant messaging software, and the like.
The present embodiment does not particularly limit the specific structure of the execution body of the method provided in the present embodiment, as long as communication can be performed in the method provided in the present embodiment by running a program in which the code of the method provided in the present embodiment is recorded. For example, the execution body of the method provided in the embodiment of the present application may be a terminal device or a network device, or may be a functional module in the terminal device or the network device that can call a program and execute the program.
Various aspects or features of the present application can be implemented as a method, apparatus, or article of manufacture using standard programming and/or engineering techniques. The term "article of manufacture" as used herein may encompass a computer program accessible from any computer-readable device, carrier, or media. For example, computer-readable media may include, but are not limited to: magnetic storage devices (e.g., hard disk, floppy disk, or magnetic tape, etc.), optical disks (e.g., compact Disk (CD), digital versatile disk (digital versatile disc, DVD), etc.), smart cards, and flash memory devices (e.g., erasable programmable read-only memory (EPROM), cards, sticks, key drives, etc.).
Various storage media described herein can represent one or more devices and/or other machine-readable media for storing information. The term "machine-readable medium" may include, but is not limited to: wireless channels, and various other media capable of storing, containing, and/or carrying instruction(s) and/or data.
It should be appreciated that the processors referred to in the embodiments of the present application may be central processing units (central processing unit, CPU), but may also be other general purpose processors, digital signal processors (digital signal processor, DSP), application specific integrated circuits (application specific integrated circuit, ASIC), off-the-shelf programmable gate arrays (field programmable gate array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
It should also be understood that the memory referred to in the embodiments of the present application may be volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory. The nonvolatile memory may be a read-only memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an electrically Erasable EPROM (EEPROM), or a flash memory. The volatile memory may be random access memory (random access memory, RAM). For example, RAM may be used as an external cache. By way of example, and not limitation, RAM may include the following forms: static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous DRAM (SLDRAM), and direct memory bus RAM (DR RAM).
It should be noted that when the processor is a general purpose processor, DSP, ASIC, FPGA or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, the memory (storage module) may be integrated into the processor.
It should also be noted that the memory described herein is intended to comprise, without being limited to, these and any other suitable types of memory.
Those of ordinary skill in the art will appreciate that the elements and steps of the examples described in connection with the embodiments disclosed herein can be implemented as electronic hardware, or as a combination of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, and are not repeated herein.
In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Furthermore, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interface, device or unit indirect coupling or communication connection, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present application, or the part contributing to the prior art, or the part of the technical solution, may be embodied in the form of a computer software product stored in a storage medium, the computer software product comprising several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in the embodiments of the present application. The foregoing storage medium may include, but is not limited to: a U-disk, a removable hard disk, a read-only memory (ROM), a random access memory (random access memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein in the description of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application.
The foregoing is merely specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily think about changes or substitutions within the technical scope of the present application, and the changes and substitutions are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (22)

1. A method of indicating a transmission protocol, comprising:
the method comprises the steps that a server side obtains first information of a first transmission protocol and second information of a second transmission protocol;
the server determines a target transmission protocol according to the first information and the second information, wherein the target transmission protocol is the first transmission protocol or the second transmission protocol;
the server side sends first indication information to the client side, wherein the first indication information is used for indicating the target transmission protocol;
the first information is used for indicating at least two types of information in a first host capability, a first data volume, a first transmission quality and a first request response rate corresponding to the first transmission protocol, and the second information is used for indicating at least two types of information in a second host capability, a second data volume, a second transmission quality and a second request response rate corresponding to the second transmission protocol.
2. Method according to claim 1, characterized in that the first transmission protocol is the hypertext transfer protocol HTTP protocol based on a fast user datagram protocol network connection qic and the second transmission protocol is the HTTP protocol based on transmission control protocol TCP.
3. The method according to claim 1 or 2, wherein the first information is used to indicate a first host capability corresponding to the first transmission protocol, and the second information is used to indicate a second host capability corresponding to the second transmission protocol;
the server determines a target transmission protocol according to the first information and the second information, and the method comprises the following steps:
if the first host capability is better than the second host capability, the server determines that the first transmission protocol is the target transmission protocol;
if the first host capability is inferior to the second host capability, the server determines that the second transmission protocol is the target transmission protocol.
4. A method according to any one of claims 1 to 3, wherein the first information is used to indicate a first amount of data corresponding to the first transmission protocol and the second information is used to indicate a second amount of data corresponding to the second transmission protocol;
The server determines a target transmission protocol according to the first information and the second information, and the method comprises the following steps:
if the first data volume is smaller than a preset data volume threshold, the server determines that the first transmission protocol is the target transmission protocol;
and if the first data volume is greater than or equal to the preset data volume threshold and the second data volume is less than the preset data volume threshold, the server determines that the second transmission protocol is the target transmission protocol.
5. The method according to any one of claims 1 to 4, wherein the first information is used to indicate a first transmission quality corresponding to the first transmission protocol, the second information is used to indicate a second transmission quality corresponding to the second transmission protocol, the first transmission quality is represented by a first delay and/or a first packet loss rate, and the second transmission quality is represented by a second delay and/or a second packet loss rate;
the server determines a target transmission protocol according to the first information and the second information, and the method comprises the following steps:
if the first time delay is smaller than the second time delay, the server determines that the first transmission protocol is the target transmission protocol;
If the first time delay is greater than or equal to the second time delay, the server determines that the second transmission protocol is the target transmission protocol; and/or include:
if the first packet loss rate is smaller than the second packet loss rate, the server determines that the first transmission protocol is the target transmission protocol;
if the first packet loss rate is greater than or equal to the second packet loss rate, the server determines that the second transmission protocol is the target transmission protocol; and/or include:
if the first time delay is smaller than the second time delay and the first packet loss rate is smaller than the second packet loss rate, the server determines that the first transmission protocol is the target transmission protocol;
and if the first time delay is greater than or equal to the second time delay and the first packet loss rate is greater than or equal to the second packet loss rate, the server determines that the second transmission protocol is the target transmission protocol.
6. The method according to any one of claims 1 to 5, wherein the first information is used to indicate a first request response rate corresponding to the first transmission protocol, and the second information is used to indicate a second request response rate corresponding to the second transmission protocol;
The server determines a target transmission protocol according to the first information and the second information, and the method comprises the following steps:
if the first request response rate is greater than or equal to the second request response rate, the server determines that the first transmission protocol is the target transmission protocol;
and if the first request response rate is smaller than the second request response rate, the server determines that the second transmission protocol is the target transmission protocol.
7. The method according to any one of claims 1 to 6, wherein before the server sends the first indication information to the client, the method further comprises:
the server receives a first request message sent by the client, wherein the first request message is used for indicating the server to determine the target transmission protocol;
the server side sends first indication information to the client side, and the first indication information comprises:
the server side sends a first response message of the first request message to the client side, wherein the first response message comprises the first indication information.
8. The method according to any one of claims 1 to 6, wherein before the server sends the first indication information to the client, the method further comprises:
The server receives a second request message sent by the client, wherein the second request message is used for requesting the server to process a first service;
the server side sends first indication information to the client side, and the first indication information comprises:
the server side sends a second response message of the second request message to the client side, wherein the second response message comprises the processing information of the first service and the first indication information.
9. The method according to claim 7 or 8, wherein the first response message or the second response message comprises hypertext transfer protocol, HTTP, response header information;
the first indication information is carried in a reserved field in the HTTP response header information.
10. The method according to any one of claims 1 to 9, wherein after the server sends the first indication information to the client, the method further comprises:
the server receives a third request message sent by the client through the target transmission protocol, wherein the third request message is used for requesting the server to process a second service;
and the server side sends the processing information of the second service to the client side through the target transmission protocol.
11. An apparatus for indicating a transmission protocol, comprising an acquisition unit, a processing unit and a transceiver unit;
the acquisition unit is used for acquiring first information of a first transmission protocol and second information of a second transmission protocol;
the processing unit is configured to determine a target transmission protocol according to the first information and the second information acquired by the acquiring unit, where the target transmission protocol is the first transmission protocol or the second transmission protocol;
the receiving and transmitting unit is configured to send first indication information determined by the processing unit to a client, where the first indication information is used to indicate the target transmission protocol;
the first information is used for indicating at least two types of information in a first host capability, a first data volume, a first transmission quality and a first request response rate corresponding to the first transmission protocol, and the second information is used for indicating at least two types of information in a second host capability, a second data volume, a second transmission quality and a second request response rate corresponding to the second transmission protocol.
12. The apparatus according to claim 11, characterized in that said first transmission protocol is the hypertext transfer protocol HTTP protocol based on a fast user datagram protocol network connection qic and said second transmission protocol is the HTTP protocol based on a transmission control protocol TCP.
13. The apparatus according to claim 11 or 12, wherein the first information is used to indicate a first host capability corresponding to the first transmission protocol, and the second information is used to indicate a second host capability corresponding to the second transmission protocol;
the processing unit is specifically configured to: if the first host capability is better than the second host capability, determining that the first transmission protocol is the target transmission protocol; and if the first host capability is inferior to the second host capability, determining that the second transmission protocol is the target transmission protocol.
14. The apparatus according to any one of claims 11 to 13, wherein the first information is used to indicate a first amount of data corresponding to the first transmission protocol, and the second information is used to indicate a second amount of data corresponding to the second transmission protocol;
the processing unit is specifically configured to: if the first data volume is smaller than a preset data volume threshold, determining that the first transmission protocol is the target transmission protocol; and if the first data volume is greater than or equal to the preset data volume threshold and the second data volume is less than the preset data volume threshold, determining that the second transmission protocol is the target transmission protocol.
15. The apparatus according to any one of claims 11 to 14, wherein the first information is used to indicate a first transmission quality corresponding to the first transmission protocol, the second information is used to indicate a second transmission quality corresponding to the second transmission protocol, the first transmission quality is represented by a first delay and/or a first packet loss rate, and the second transmission quality is represented by a second delay and/or a second packet loss rate;
the processing unit is specifically configured to: if the first time delay is smaller than the second time delay, determining that the first transmission protocol is the target transmission protocol; if the first time delay is greater than or equal to the second time delay, determining that the second transmission protocol is the target transmission protocol; and/or the number of the groups of groups,
if the first packet loss rate is smaller than the second packet loss rate, determining that the first transmission protocol is the target transmission protocol; if the first packet loss rate is greater than or equal to the second packet loss rate, determining that the second transmission protocol is the target transmission protocol; and/or the number of the groups of groups,
if the first time delay is smaller than the second time delay and the first packet loss rate is smaller than the second packet loss rate, determining that the first transmission protocol is the target transmission protocol; and if the first time delay is greater than or equal to the second time delay and the first packet loss rate is greater than or equal to the second packet loss rate, determining that the second transmission protocol is the target transmission protocol.
16. The apparatus according to any one of claims 11 to 15, wherein the first information is used to indicate a first request response rate corresponding to the first transmission protocol, and the second information is used to indicate a second request response rate corresponding to the second transmission protocol;
the processing unit is specifically configured to: if the first request response rate is greater than or equal to the second request response rate, determining that the first transmission protocol is the target transmission protocol; and if the first request response rate is smaller than the second request response rate, determining that the second transmission protocol is the target transmission protocol.
17. The device according to any one of claims 11 to 16, wherein,
the transceiver unit is further configured to: before first indication information is sent to a client, receiving a first request message sent by the client, wherein the first request message is used for indicating the device to determine the target transmission protocol;
the receiving and transmitting unit is specifically configured to: and sending a first response message of the first request message to the client, wherein the first response message comprises the first indication information.
18. The device according to any one of claims 11 to 16, wherein,
The transceiver unit is further configured to: before sending first indication information to a client, receiving a second request message sent by the client, wherein the second request message is used for requesting the device to process a first service;
the receiving and transmitting unit is specifically configured to: and sending a second response message of the second request message to the client, wherein the second response message comprises the processing information of the first service and the first indication information.
19. The apparatus according to claim 17 or 18, wherein the first response message or the second response message comprises hypertext transfer protocol, HTTP, response header information;
the first indication information is carried in a reserved field in the HTTP response header information.
20. The device according to any one of claims 11 to 19, wherein,
the receiving and transmitting unit is further configured to receive a third request message sent by the client through the target transport protocol after the first indication information is sent to the client, and send processing information of the second service to the client through the target transport protocol, where the third request message is used to request the device to process the second service.
21. An electronic device comprising a processor coupled to a memory for executing a computer program or instructions stored in the memory to implement the method of any one of claims 1 to 10.
22. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program which, when run, implements the method according to any one of claims 1 to 10.
CN202011017051.7A 2020-09-24 2020-09-24 Method, device, electronic equipment and storage medium for indicating transmission protocol Active CN114257662B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011017051.7A CN114257662B (en) 2020-09-24 2020-09-24 Method, device, electronic equipment and storage medium for indicating transmission protocol

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011017051.7A CN114257662B (en) 2020-09-24 2020-09-24 Method, device, electronic equipment and storage medium for indicating transmission protocol

Publications (2)

Publication Number Publication Date
CN114257662A CN114257662A (en) 2022-03-29
CN114257662B true CN114257662B (en) 2024-04-12

Family

ID=80788784

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011017051.7A Active CN114257662B (en) 2020-09-24 2020-09-24 Method, device, electronic equipment and storage medium for indicating transmission protocol

Country Status (1)

Country Link
CN (1) CN114257662B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003501976A (en) * 1999-06-03 2003-01-14 富士通株式会社 Method and apparatus for switching signals of multiple different transmission protocols
JP2003069472A (en) * 2001-08-24 2003-03-07 Matsushita Electric Ind Co Ltd Reception terminal device and communication system
US7920569B1 (en) * 2008-05-05 2011-04-05 Juniper Networks, Inc. Multi-link transport protocol translation
CN102780712A (en) * 2011-05-09 2012-11-14 华为技术有限公司 Conversation switching method and device
CN102791045A (en) * 2011-05-20 2012-11-21 希姆通信息技术(上海)有限公司 Mobile communication terminal and transfer protocol automatic preferentially-selecting method thereof
FR2985878A1 (en) * 2012-03-28 2013-07-19 France Telecom Method for selecting transport protocol for transport of session initiation protocol messages in mobile phone, involves selecting transport protocol based on execution mode of voice over internet protocol application in mobile phone
CN103685281A (en) * 2013-12-18 2014-03-26 中国联合网络通信集团有限公司 Network address protocol switching method and device
WO2016166947A1 (en) * 2015-04-17 2016-10-20 Sony Corporation Transmission device and method, reception device and method
US9961169B1 (en) * 2016-10-31 2018-05-01 International Business Machines Corporation Implementing autoswitching network protocols for optimal efficiency

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100963196B1 (en) * 2006-03-14 2010-06-14 한국과학기술연구원 A intelligent computing device agent system for automatic recognition of multi user computing environment and information sharing setup

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003501976A (en) * 1999-06-03 2003-01-14 富士通株式会社 Method and apparatus for switching signals of multiple different transmission protocols
JP2003069472A (en) * 2001-08-24 2003-03-07 Matsushita Electric Ind Co Ltd Reception terminal device and communication system
US7920569B1 (en) * 2008-05-05 2011-04-05 Juniper Networks, Inc. Multi-link transport protocol translation
CN102780712A (en) * 2011-05-09 2012-11-14 华为技术有限公司 Conversation switching method and device
CN102791045A (en) * 2011-05-20 2012-11-21 希姆通信息技术(上海)有限公司 Mobile communication terminal and transfer protocol automatic preferentially-selecting method thereof
FR2985878A1 (en) * 2012-03-28 2013-07-19 France Telecom Method for selecting transport protocol for transport of session initiation protocol messages in mobile phone, involves selecting transport protocol based on execution mode of voice over internet protocol application in mobile phone
CN103685281A (en) * 2013-12-18 2014-03-26 中国联合网络通信集团有限公司 Network address protocol switching method and device
WO2016166947A1 (en) * 2015-04-17 2016-10-20 Sony Corporation Transmission device and method, reception device and method
US9961169B1 (en) * 2016-10-31 2018-05-01 International Business Machines Corporation Implementing autoswitching network protocols for optimal efficiency

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"Simulation on Data Packet Real-time Transmission Based on Windows Platform";Wang Zi-chao,Cong Jing;《Computer Engineering》;20101031;142-4, 147 *

Also Published As

Publication number Publication date
CN114257662A (en) 2022-03-29

Similar Documents

Publication Publication Date Title
EP3318067B1 (en) A media user client, a media user agent and respective methods performed thereby for providing media from a media server to the media user client
US9641650B2 (en) TCP proxy server
US10536533B2 (en) Optimization of packetized data transmission in TCP-based networks
KR102457792B1 (en) System and method for dynamic channel bonding
CN106612284B (en) Streaming data transmission method and device
US7680141B2 (en) Transmitter device and relay device for performing data transmission control
CN111372323B (en) Connection establishment method, related device and medium
JP7307211B2 (en) Client, Server, Receiving Method and Sending Method
CN111490947A (en) Data packet transmitting method, data packet receiving method, system, device and medium
CN113973136B (en) Traffic scheduling method, device and system
EP3286967B1 (en) Technique for scheduling transmission of content in an access network
JP7099537B2 (en) Communication equipment, communication methods and programs
CN111211933B (en) Method and device for determining quality of transmission link
CN111698275B (en) Data processing method, device and equipment
CN113347681B (en) Data transmission method and device, storage medium and electronic device
EP3264851B1 (en) Data transmission method and device for data service
CN114257662B (en) Method, device, electronic equipment and storage medium for indicating transmission protocol
CN110166518B (en) Session information transmission method, device, storage medium and electronic device
CN112838983A (en) Data transmission method, system, device, proxy server and storage medium
CN114125023B (en) Method and device for determining data connection, storage medium and electronic device
CN113301398B (en) Information processing method and system, server device and client device
US10015288B2 (en) Communication apparatus and control method of communication apparatus
CN110447284A (en) Terminal device, base station equipment, control method and program
JP4930388B2 (en) Communication apparatus and program
Yuan et al. Sidekick:{In-Network} Assistance for Secure {End-to-End} Transport Protocols

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20220507

Address after: 523799 Room 101, building 4, No. 15, Huanhu Road, Songshanhu Park, Dongguan City, Guangdong Province

Applicant after: Petal cloud Technology Co.,Ltd.

Address before: 523808 Southern Factory Building (Phase I) Project B2 Production Plant-5, New Town Avenue, Songshan Lake High-tech Industrial Development Zone, Dongguan City, Guangdong Province

Applicant before: HUAWEI DEVICE Co.,Ltd.

Effective date of registration: 20220507

Address after: 523808 Southern Factory Building (Phase I) Project B2 Production Plant-5, New Town Avenue, Songshan Lake High-tech Industrial Development Zone, Dongguan City, Guangdong Province

Applicant after: HUAWEI DEVICE Co.,Ltd.

Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen

Applicant before: HUAWEI TECHNOLOGIES Co.,Ltd.

GR01 Patent grant
GR01 Patent grant