Transport protocol determination method and device, equipment, storage medium and computer program product
By calculating the target round-trip delay between the server and the client, and selecting the most suitable protocol from multiple transmission protocols, the problem of inaccurate determination of transmission protocols in the prior art is solved, and the efficiency of data transmission is improved.
Patent Information
- Application Number
- CN202411986013.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2025-04-15
AI Technical Summary
When data transmission is carried out through the desktop cloud, the determination of the transmission protocol in the prior art is not accurate enough, resulting in inefficient transmission efficiency in the event of network congestion or jitter.
By determining the first round trip delay and the second round trip delay between the server and the client, combining the historical round trip delay, the target round trip delay is calculated, and based on this, the most suitable target transmission protocol is selected from the multiple transmission protocols.
It improves the efficiency of data transmission, avoids the problem of repeated switching of transmission protocols when network state changes, and ensures the accuracy of transmission protocols.
Smart Images

Figure CN119835348A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a method, apparatus, device, storage medium and computer program product for determining a transmission protocol. Background Art
[0002] With the development of science and technology, desktop cloud has been increasingly widely used in daily life as a new data transmission tool. At present, in the relevant technology, when data is transmitted through desktop cloud, a manually configured transmission protocol is usually used, or the transmission protocol is determined according to the current network status of the server, and then the transmission protocol is used for data transmission. However, when the transmission protocol is manually configured, the change of network status is not taken into account, and the data transmission efficiency will be very poor when the network is congested; and determining the transmission protocol only according to the current network status will cause the transmission protocol to be repeatedly switched when the network jitters, thereby affecting the data transmission efficiency. Based on this, how to select a suitable transmission protocol when performing data transmission and improve the data transmission efficiency is an urgent problem to be solved. Summary of the invention
[0003] In order to solve the above-mentioned technical problems, the embodiments of the present application hope to provide a transmission protocol determination method, device, equipment, storage medium and computer program product, which solves the problem of inaccurate transmission protocol determined during data transmission in the related technology, thereby improving data transmission efficiency.
[0004] The technical solution of this application is implemented as follows:
[0005] A method for determining a transmission protocol, the method comprising:
[0006] Determine a first round-trip delay and a second round-trip delay between a server and a client; wherein the first round-trip delay is a round-trip delay corresponding to when the server sends information to the client; and the second round-trip delay is a round-trip delay corresponding to when the client sends information to the server;
[0007] Determining a target round-trip delay based on the first round-trip delay and the second round-trip delay;
[0008] Based on the first duration, the target time and the target round-trip delay, the target transmission protocol is determined from multiple transmission protocols; wherein the first duration is the time required to switch from the first working mode to the second working mode; the target time is the time to switch to the first working mode; and the second working mode is a working mode capable of switching the transmission protocol used for data transmission.
[0009] In the above solution, determining the target round-trip delay based on the first round-trip delay and the second round-trip delay includes:
[0010] Obtaining a historical round-trip delay between the server and the client; wherein the historical round-trip delay is a round-trip delay corresponding to when the server sends historical information to the client;
[0011] Determine a third round-trip delay between the server and the client based on the first round-trip delay and the historical round-trip delay;
[0012] The target round trip delay is determined based on the second round trip delay and the third round trip delay.
[0013] In the above solution, the target transmission protocol is determined from a plurality of transmission protocols based on the first duration, the target time and the target round trip delay, including:
[0014] Determine a transmission protocol to be determined from a plurality of transmission protocols based on the target round trip delay;
[0015] The target transmission protocol is determined based on the first duration, the target time and the to-be-determined transmission protocol.
[0016] In the above solution, determining the transmission protocol to be determined from multiple transmission protocols based on the target round-trip delay includes:
[0017] If the target round-trip delay is greater than a first threshold, determining a first transmission protocol as the transmission protocol to be determined; wherein the multiple transmission protocols include the first transmission protocol;
[0018] If the target round-trip delay is less than or equal to the first threshold, the to-be-determined transmission protocol is determined from the multiple transmission protocols based on the target round-trip delay and the second threshold; wherein the first threshold is greater than the second threshold.
[0019] In the above solution, based on the target round-trip delay and the second threshold, determining the to-be-determined transmission protocol from the multiple transmission protocols includes:
[0020] If the target round-trip delay is less than the second threshold, determining the second transmission protocol as the to-be-determined transmission protocol;
[0021] If the target round-trip delay is greater than or equal to the second threshold, determine that the currently used basic transmission protocol is the transmission protocol to be determined; wherein the multiple transmission protocols include the second transmission protocol and the basic transmission protocol.
[0022] In the above solution, determining the target transmission protocol based on the first duration, the target time and the transmission protocol to be determined includes:
[0023] If the to-be-determined transmission protocol is the same as the currently used basic transmission protocol, determining the basic transmission protocol as the target transmission protocol;
[0024] If the to-be-determined transmission protocol is different from the basic transmission protocol, the target transmission protocol is determined from the basic transmission protocol and the to-be-determined transmission protocol based on the first duration and the target time.
[0025] In the above solution, based on the first duration and the target time, determining the target transmission protocol from the basic transmission protocol and the transmission protocol to be determined includes:
[0026] Determine a second duration based on the target time, the current time, and the first duration;
[0027] If the second time duration is less than or equal to a third threshold, determining that the to-be-determined transmission protocol is the target transmission protocol;
[0028] If the second duration is greater than the third threshold, the basic transmission protocol is determined to be the target transmission protocol.
[0029] In the above scheme, the method further includes:
[0030] If it is determined that the to-be-determined transmission protocol is the target transmission protocol, increasing the first duration;
[0031] If it is determined that the currently used transmission protocol is the target transmission protocol, the first duration is reduced.
[0032] A transmission protocol determination device, the device comprising:
[0033] A first determining unit is used to determine a first round-trip delay and a second round-trip delay between a server and a client; wherein the first round-trip delay is a round-trip delay corresponding to when the server sends information to the client; and the second round-trip delay is a round-trip delay corresponding to when the client sends information to the server;
[0034] A second determining unit, configured to determine a target round trip delay based on the first round trip delay and the second round trip delay;
[0035] The third determination unit is used to determine the target transmission protocol from multiple transmission protocols based on the first duration, the target time and the target round-trip delay; wherein the first duration is the time required to switch from the first working mode to the second working mode; the target time is the time to switch to the first working mode; and the second working mode is a working mode that can switch the transmission protocol used for data transmission.
[0036] A server, comprising: a processor, a memory and a communication bus;
[0037] The communication bus is used to realize the communication connection between the processor and the memory;
[0038] The processor is used to execute the transmission protocol determination program in the memory to implement the steps of the above-mentioned transmission protocol determination method.
[0039] A computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the above-mentioned transmission protocol determination method.
[0040] A computer program product comprises a computer program, wherein the computer program implements the above-mentioned transmission protocol determination method when executed by a processor.
[0041] The transmission protocol determination method, apparatus, device, storage medium and computer program product provided in the embodiments of the present application can determine the first round-trip delay corresponding to when the server sends information to the client, and the second round-trip delay corresponding to when the client sends information to the server, and determine the target round-trip delay based on the first round-trip delay and the second round-trip delay. Then, based on the first time required to switch from the first working mode to the second working mode, the target time to switch to the first working mode and the target round-trip delay, determine the target transmission protocol from multiple transmission protocols; wherein the second working mode is a working mode that can switch the transmission protocol for data transmission; in this way, the target round-trip delay of the server at the current moment can be determined in combination with the first round-trip delay of the server and the second round-trip delay of the client, and then the target transmission protocol is determined in combination with the target time, the first time and the target round-trip delay, that is, when determining the transmission protocol, the network status of the server, the network status of the client and the time required to enter the second working mode capable of switching the transmission protocol from the first working mode to the second working mode capable of switching the transmission protocol are considered at the same time, instead of relying entirely on human experience as in the related art, or only considering the network status of the server. In this way, the problem of inaccurate transmission protocol determination in the process of data transmission in the related art is solved, and the data transmission efficiency is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 A flow chart of a method for determining a transmission protocol provided in an embodiment of the present application;
[0043] Figure 2 A flowchart of another transmission protocol determination method provided in an embodiment of the present application;
[0044] Figure 3A flow chart for calculating the round-trip delay in a transmission protocol determination method provided in an embodiment of the present application;
[0045] Figure 4 A schematic diagram of the structure of a transmission protocol determination device provided in an embodiment of the present application;
[0046] Figure 5 A schematic diagram of the structure of a server provided in an embodiment of the present application. DETAILED DESCRIPTION
[0047] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0048] It should be understood that the "embodiments of the present application" or "the aforementioned embodiments" mentioned throughout the specification mean that specific features, structures or characteristics related to the embodiments are included in at least one embodiment of the present application. Therefore, "in the embodiments of the present application" or "in the aforementioned embodiments" appearing throughout the specification may not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics may be combined in one or more embodiments in any suitable manner. In the various embodiments of the present application, the size of the sequence numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. The above-mentioned sequence numbers of the embodiments of the present application are for description only and do not represent the advantages and disadvantages of the embodiments.
[0049] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0050] The present application embodiment provides a method for determining a transmission protocol, referring to Figure 1 As shown, the method comprises the following steps:
[0051] Step 101: Determine a first round-trip delay and a second round-trip delay between a server and a client.
[0052] The first round-trip delay is the round-trip delay corresponding to when the server sends information to the client; the second round-trip delay is the round-trip delay corresponding to when the client sends information to the server.
[0053] In an embodiment of the present application, the first round-trip time (RTT) may refer to the time required from the server sending information to the client to the time when the confirmation information sent by the client is received; the second RTT may refer to the time required from the client sending information to the server to the time when the confirmation information sent by the server is received.
[0054] In an embodiment of the present application, a first round-trip delay corresponding to the server can be determined, and a second round-trip delay sent by the client can be received.
[0055] Step 102: Determine a target round trip delay based on the first round trip delay and the second round trip delay.
[0056] In an embodiment of the present application, the historical round-trip delay corresponding to the server sending historical information to the client, that is, the historical RTT, can be obtained. Then, the final stable round-trip delay of the server (that is, the target round-trip delay) can be determined based on the historical round-trip delay, the first round-trip delay and the second round-trip delay.
[0057] It should be noted that the historical RTT may refer to the time required from the server sending historical information to the client to receiving confirmation information sent by the client.
[0058] Step 103: Determine a target transmission protocol from multiple transmission protocols based on the first duration, the target time, and the target round-trip delay.
[0059] Among them, the first duration is the time required to switch from the first working mode to the second working mode; the target time is the time to switch to the first working mode; the second working mode is a working mode that can switch the transmission protocol used for data transmission.
[0060] In an embodiment of the present application, multiple transmission protocols may include Transmission Control Protocol (TCP) and User Datagram Protocol (UDP); the first working mode may refer to a silent working mode in which the transmission protocol cannot be switched, then the first duration is essentially the duration of the silent working mode.
[0061] It should be noted that the server will switch from the second working mode to the silent working mode only after switching the transmission protocol; the first duration can be set according to actual needs. Preferably, the first duration can be set to 1 minute.
[0062] In an embodiment of the present application, a transmission protocol to be determined can be determined from multiple transmission protocols according to the target round-trip delay, and then the target transmission protocol ultimately used for data transmission is determined according to the first duration, the target time and the transmission protocol to be determined.
[0063] It should be noted that the server selects the target transmission protocol with T as the decision cycle. For example, if the decision cycle T is 3 ms, the target round trip delay is calculated every 3 ms, and the target transmission protocol is determined according to the target round trip delay.
[0064] The transmission protocol determination method provided in the embodiment of the present application can combine the first round-trip delay of the server and the second round-trip delay of the client to determine the target round-trip delay of the server at the current moment, and then determine the target transmission protocol in combination with the target moment, the first duration and the target round-trip delay. That is, when determining the transmission protocol, the network status of the server, the network status of the client and the duration required to enter the second working mode capable of switching the transmission protocol from the first working mode are simultaneously considered, instead of relying entirely on human experience or only considering the network status of the server as in the related art. In this way, the problem of inaccurate determination of the transmission protocol in the process of data transmission in the related art is solved, and the data transmission efficiency is improved.
[0065] Based on the above embodiments, the embodiments of the present application provide a method for determining a transmission protocol, which can be applied to a server. Figure 2 As shown, the method comprises the following steps:
[0066] Step 201: The server determines a first round-trip delay and a second round-trip delay between the server and the client.
[0067] The first round-trip delay is the round-trip delay corresponding to when the server sends information to the client; the second round-trip delay is the round-trip delay corresponding to when the client sends information to the server.
[0068] In an embodiment of the present application, the first round-trip delay may be determined by the server itself; the second round-trip delay may be determined by the client itself and sent to the server.
[0069] In the embodiments of the present application, Figure 3 As shown, the server can send a detection message carrying a sending timestamp to the client, and after receiving the detection message sent by the server, the client will return the second round-trip delay and the sending timestamp calculated by itself to the server in the response message, and then the server can determine the receiving timestamp of the received response message, and then determine the first round-trip delay according to the sending timestamp and the receiving timestamp. The calculation formula of the first round-trip delay can be shown as formula (1).
[0070] SRTT=rx_timestamp-tx_timestamp formula (1)
[0071] Among them, SRTT represents the first round-trip delay, tx_timestamp represents the sending timestamp of the detection information, and rx_timestamp represents the receiving timestamp of the response information.
[0072] It should be noted that the process of determining the second round-trip delay is the same as the process of determining the first round-trip delay, except that the second round-trip delay is determined by the client, that is, the client sends a detection message carrying a sending timestamp to the server, and determines the receiving timestamp of the response message carrying the sending timestamp sent by the server, and then calculates the difference between the sending timestamp and the receiving timestamp to obtain the second round-trip delay.
[0073] Step 202: The server obtains the historical round-trip delay between the server and the client.
[0074] The historical round-trip delay is the round-trip delay corresponding to when the server sends historical information to the client.
[0075] In the embodiment of the present application, the historical round trip delay may refer to the round trip delay between the server and the client that was last determined by the server before the first round trip delay was determined. It should be noted that the historical round trip delay may be stored in a database.
[0076] It should be noted that the method for determining the historical round-trip delay is the same as the method for determining the first round-trip delay in step 201 .
[0077] Step 203: The server determines a third round-trip delay between the server and the client based on the first round-trip delay and the historical round-trip delay.
[0078] In the embodiment of the present application, the fourth round-trip delay between the server and the client at the previous moment of the current moment can be obtained from the database, and then the first round-trip delay, the historical round-trip delay and the fourth round-trip delay are calculated to obtain the third round-trip delay. The calculation formula of the third round-trip delay can be shown as the following formula (2):
[0079]
[0080] Among them, MRTT represents the third round-trip delay; MRTTLast represents the fourth round-trip delay; SRTT represents the first round-trip delay; SRTTLast represents the historical round-trip delay; a and b are empirical values.
[0081] Step 204: The server determines a target round trip delay based on the second round trip delay and the third round trip delay.
[0082] In the embodiment of the present application, the target round-trip delay can be determined according to the second round-trip delay and the third round-trip delay using formula (3), that is, the round-trip delay with a smaller delay value is determined from the second round-trip delay and the third round-trip delay as the target round-trip delay.
[0083] PredictRTT=min(MRTT,PRTT) Formula (3)
[0084] Among them, PredictRTT represents the target round-trip delay; PRTT represents the second round-trip delay; MRTT represents the third round-trip delay.
[0085] In an embodiment of the present application, by combining the current network status of the server, the current network status of the client and the historical network status of the server, the stable round-trip delay between the server and the client is determined, and then the final data transmission protocol is determined based on the stable round-trip delay. In this way, the accuracy of the determined round-trip delay can be improved, and then the accuracy of the determined transmission protocol can be improved, thereby avoiding repeated switching of the transmission protocol when network jitter occurs.
[0086] Step 205: The server determines a transmission protocol to be determined from multiple transmission protocols based on the target round-trip delay.
[0087] In the embodiment of the present application, the to-be-determined transmission protocol may be determined from a plurality of transmission protocols including the TCP protocol and the UDP protocol based on the target round-trip delay and the first threshold.
[0088] In the embodiment of the present application, step 205 can be implemented through steps 205a to 205b.
[0089] Step 205a: If the target round-trip delay is greater than the first threshold, the server determines the first transmission protocol as the transmission protocol to be determined.
[0090] The multiple transmission protocols include a first transmission protocol.
[0091] In the embodiment of the present application, the first transmission protocol may refer to the UDP protocol. Specifically, the target round-trip delay and the first threshold may be compared, and if the comparison result indicates that the target round-trip delay is greater than the first threshold, the UDP protocol may be directly determined as the transmission protocol to be determined.
[0092] It should be noted that the first threshold can be set according to historical data and actual needs. Preferably, the first threshold can be set to 10ms.
[0093] Step 205b: If the target round-trip delay is less than or equal to the first threshold, the server determines the to-be-determined transmission protocol from a plurality of transmission protocols based on the target round-trip delay and the second threshold.
[0094] The first threshold is greater than the second threshold.
[0095] In an embodiment of the present application, if the comparison result indicates that the target round-trip delay is less than or equal to the first threshold, the target round-trip delay and the second threshold may be compared, and the transmission protocol to be determined is determined based on the comparison result.
[0096] In the embodiment of the present application, step 205b can be implemented through steps 205b1 to 205b2.
[0097] Step 205b1: If the target round-trip delay is less than the second threshold, the server determines the second transmission protocol as the transmission protocol to be determined.
[0098] In the embodiment of the present application, the second transmission protocol may refer to the TCP protocol. Specifically, if it is determined that the target round trip delay is less than the second threshold, the TCP protocol may be directly determined as the transmission protocol to be determined.
[0099] It should be noted that the second threshold value may also be set according to historical data and actual needs. Preferably, the second threshold value may be set to 6 ms.
[0100] Step 205b2: If the target round-trip delay is greater than or equal to the second threshold, the server determines that the currently used basic transmission protocol is the transmission protocol to be determined.
[0101] The multiple transmission protocols include a second transmission protocol and a basic transmission protocol.
[0102] In the embodiment of the present application, the basic transmission protocol may refer to the data transmission protocol currently used by the server. Specifically, if the target round-trip delay is greater than or equal to the second threshold, the currently used basic transmission protocol may be directly determined as the transmission protocol to be determined.
[0103] It should be noted that the basic transmission protocol may be the first transmission protocol, may be the second transmission protocol, or may be other transmission protocols among the multiple transmission protocols.
[0104] Step 206: The server determines the target transmission protocol based on the first duration, the target time, and the transmission protocol to be determined.
[0105] In an embodiment of the present application, the transmission protocol to be determined may be compared with the basic transmission protocol currently used by the server, and the final target transmission protocol may be determined based on the comparison result, the target time and the first duration.
[0106] In the embodiment of the present application, step 206 can be implemented through steps 206a to 206b.
[0107] Step 206a: If the transmission protocol to be determined is the same as the currently used basic transmission protocol, the server determines the basic transmission protocol as the target transmission protocol.
[0108] In an embodiment of the present application, if the transmission protocol to be determined happens to be the basic transmission protocol, it means that the current network status of the server is relatively stable. At this time, the basic transmission protocol can be directly determined, that is, the transmission protocol to be determined is the target transmission protocol.
[0109] Step 206b: If the transmission protocol to be determined is different from the basic transmission protocol, the server determines the target transmission protocol from the basic transmission protocol and the transmission protocol to be determined based on the first duration and the target time.
[0110] In an embodiment of the present application, if the determined transmission protocol to be determined is different from the basic transmission protocol currently used by the server, it means that the current network status of the server fluctuates. At this time, it can be determined based on the target time and the first duration whether the server is currently in the second working mode capable of switching the transmission protocol, and the target transmission protocol can be determined from the basic transmission protocol and the transmission protocol to be determined based on the determination result.
[0111] In the embodiment of the present application, "determining the target transmission protocol from the basic transmission protocol and the transmission protocol to be determined based on the first duration and the target time" in step 206b can be implemented through steps 206b1 to 206b3.
[0112] Step 206b1: The server determines a second duration based on the target time, the current time, and the first duration.
[0113] In an embodiment of the present application, the second duration may refer to the duration between the current moment and the first moment, and the first moment may refer to the moment when entering the second working mode. That is to say, the second duration is essentially a countdown to entering the second working mode; for example, if the second duration is determined to be 2ms, it means that the server has 2ms left to enter the second working mode.
[0114] Specifically, the third duration between the target moment and the current moment can be determined, and the obtained third duration is subtracted from the first duration to obtain the target duration. Afterwards, if the target duration is determined to be 0ms, the target duration is directly determined to be the second duration, that is, the second duration is determined to be 0ms; correspondingly, if the target duration is not 0ms, the target duration and the decision cycle T are calculated, that is, the target duration is subtracted from the decision cycle T to obtain the second duration.
[0115] Exemplarily, if the determined target duration is 4 ms and the decision cycle T is 3 ms, the second duration is 1 ms.
[0116] Step 206b2: If the second duration is less than or equal to the third threshold, the server determines that the transmission protocol to be determined is the target transmission protocol.
[0117] In the embodiment of the present application, if it is determined that the second duration is less than or equal to the third threshold, it means that the current working mode of the server (i.e., the first working mode) is the second working mode capable of switching the transmission protocol. At this time, the transmission protocol to be determined can be directly determined as the target transmission protocol, and the transmission protocol can be switched to the target transmission protocol. Preferably, the third threshold can be set to 0.
[0118] It should be noted that after the server switches the transmission protocol, it will immediately enter the first working mode, that is, the silent working mode.
[0119] In other embodiments of the present application, step 206b21 may be performed after step 206b2.
[0120] Step 20621: If the transmission protocol to be determined is determined to be the target transmission protocol, the server increases the first duration.
[0121] In an embodiment of the present application, if it is determined that the transmission protocol to be determined is the target transmission protocol, it means that the current network status of the server has changed significantly and the transmission protocol needs to be switched. Therefore, in order to ensure that the transmission protocol is not switched frequently, after it is determined that the transmission protocol will be switched, the time required to switch from the first working mode (i.e., the silent working mode) to the second working mode (i.e., the first duration) can be increased to avoid switching the transmission protocol again in a short time.
[0122] Preferably, the duration of the silent working mode can be increased by 1 minute, that is, if the original duration of the silent working mode is 1 minute, then after increasing by 1 minute, the duration of the silent working mode becomes 2 minutes.
[0123] Step 206b3: If the second duration is greater than the third threshold, the server determines the basic transmission protocol as the target transmission protocol.
[0124] In an embodiment of the present application, if the second time duration is not the third threshold, that is, not 0, it indicates that the server is in the first working mode where the transmission protocol cannot be switched. At this time, the server cannot switch the transmission protocol, and directly determines the currently used basic transmission protocol as the target transmission protocol. That is to say, the transmission protocol is not switched at this time.
[0125] In other embodiments of the present application, step 206b31 may be performed after step 206b3.
[0126] Step 206b31: If the basic transmission protocol is determined to be the target transmission protocol, the server reduces the first duration.
[0127] In an embodiment of the present application, if the basic transmission protocol is determined to be the target transmission protocol, it means that the network status of the server is relatively stable, which means that the risk of frequent switching of the transmission protocol is relatively small. At this time, the first duration can be reduced.
[0128] The transmission protocol determination method provided in the embodiment of the present application can combine the first round-trip delay of the server and the second round-trip delay of the client to determine the target round-trip delay of the server at the current moment, and then determine the target transmission protocol in combination with the target moment, the first duration and the target round-trip delay. That is, when determining the transmission protocol, the network status of the server, the network status of the client and the duration required to enter the second working mode capable of switching the transmission protocol from the first working mode are simultaneously considered, instead of relying entirely on human experience or only considering the network status of the server as in the related art. In this way, the problem of inaccurate determination of the transmission protocol in the process of data transmission in the related art is solved, and the data transmission efficiency is improved.
[0129] Based on the above embodiments, the present application provides a transmission protocol determination device, which can be applied to Figure 1 and 2 In the transmission protocol determination method provided in the corresponding embodiment, refer to Figure 5 As shown, the transmission protocol determination device 3 may include: a first determination unit 31, a second determination unit 32 and a third determination unit 33, wherein:
[0130] The first determining unit 31 is used to determine a first round-trip delay and a second round-trip delay between the server and the client; wherein the first round-trip delay is the round-trip delay corresponding to when the server sends information to the client; the second round-trip delay is the round-trip delay corresponding to when the client sends information to the server;
[0131] A second determining unit 32, configured to determine a target round trip delay based on the first round trip delay and the second round trip delay;
[0132] The third determination unit 33 is used to determine the target transmission protocol from multiple transmission protocols based on the first duration, the target time and the target round-trip delay; wherein the first duration is the time required to switch from the first working mode to the second working mode; the target time is the time to switch to the first working mode; and the second working mode is a working mode that can switch the transmission protocol used for data transmission.
[0133] In other embodiments of the present application, the second determining unit 32 is further configured to perform the following steps:
[0134] Obtain the historical round-trip delay between the server and the client; wherein the historical round-trip delay is the round-trip delay corresponding to when the server sends historical information to the client;
[0135] Determine a third round-trip delay between the server and the client based on the first round-trip delay and the historical round-trip delay;
[0136] A target round trip delay is determined based on the second round trip delay and the third round trip delay.
[0137] In other embodiments of the present application, the third determining unit 33 is further configured to perform the following steps:
[0138] Determine a transmission protocol to be determined from a plurality of transmission protocols based on a target round trip delay;
[0139] Based on the first duration, the target time, and the transmission protocol to be determined, a target transmission protocol is determined.
[0140] In other embodiments of the present application, the third determining unit 33 is further configured to perform the following steps:
[0141] If the target round-trip delay is greater than a first threshold, determining the first transmission protocol as the transmission protocol to be determined; wherein the plurality of transmission protocols include the first transmission protocol;
[0142] If the target round-trip delay is less than or equal to a first threshold, a transmission protocol to be determined is determined from a plurality of transmission protocols based on the target round-trip delay and a second threshold; wherein the first threshold is greater than the second threshold.
[0143] In other embodiments of the present application, the third determining unit 33 is further configured to perform the following steps:
[0144] If the target round-trip delay is less than the second threshold, determining the second transmission protocol as the transmission protocol to be determined;
[0145] If the target round-trip delay is greater than or equal to the second threshold, the currently used basic transmission protocol is determined to be the transmission protocol to be determined; wherein the multiple transmission protocols include the second transmission protocol and the basic transmission protocol.
[0146] In other embodiments of the present application, the third determining unit 33 is further configured to perform the following steps:
[0147] If the transmission protocol to be determined is the same as the currently used basic transmission protocol, the basic transmission protocol is determined as the target transmission protocol;
[0148] If the transmission protocol to be determined is different from the basic transmission protocol, the target transmission protocol is determined from the basic transmission protocol and the transmission protocol to be determined based on the first duration and the target time.
[0149] In other embodiments of the present application, the third determining unit 33 is further configured to perform the following steps:
[0150] Determine a second duration based on the target time, the current time, and the first duration;
[0151] If the second duration is less than or equal to the third threshold, determining that the transmission protocol to be determined is the target transmission protocol;
[0152] If the second duration is greater than the third threshold, the basic transmission protocol is determined as the target transmission protocol.
[0153] In other embodiments of the present application, the third determining unit 33 is further configured to perform the following steps:
[0154] If the to-be-determined transmission protocol is determined to be the target transmission protocol, the first duration is increased;
[0155] If it is determined that the currently used transmission protocol is the target transmission protocol, the first duration is reduced.
[0156] The transmission protocol determination device provided in the embodiment of the present application can determine the target round-trip delay of the server at the current moment in combination with the first round-trip delay of the server and the second round-trip delay of the client, and then determine the target transmission protocol in combination with the target moment, the first duration and the target round-trip delay. That is, when determining the transmission protocol, the network status of the server, the network status of the client and the duration required to enter the second working mode capable of switching the transmission protocol from the first working mode are simultaneously considered, instead of relying entirely on human experience or only considering the network status of the server as in the related art. In this way, the problem of inaccurate determination of the transmission protocol in the process of data transmission in the related art is solved, and the data transmission efficiency is improved.
[0157] Based on the above embodiments, the embodiments of the present application provide a server, which can be applied to Figure 1 and 2 In the transmission protocol determination method provided in the corresponding embodiment, refer to Figure 5 As shown, the server 4 may include: a processor 41, a memory 42 and a communication bus 43, wherein:
[0158] The communication bus 43 is used to realize the communication connection between the processor 41 and the memory 42;
[0159] The processor 41 is used to execute the transmission protocol determination program in the memory 42 to implement the following steps:
[0160] Determine a first round-trip delay and a second round-trip delay between the server and the client; wherein the first round-trip delay is the round-trip delay corresponding to when the server sends information to the client; the second round-trip delay is the round-trip delay corresponding to when the client sends information to the server;
[0161] Determining a target round trip delay based on the first round trip delay and the second round trip delay;
[0162] Based on the first duration, the target time and the target round-trip delay, the target transmission protocol is determined from multiple transmission protocols; wherein the first duration is the time required to switch from the first working mode to the second working mode; the target time is the time to switch to the first working mode; and the second working mode is a working mode capable of switching the transmission protocol used for data transmission.
[0163] In other embodiments of the present application, the processor 41 is used to execute the transmission protocol determination program in the memory 42 to determine the target round-trip delay based on the first round-trip delay and the second round-trip delay, so as to implement the following steps:
[0164] Obtain the historical round-trip delay between the server and the client; wherein the historical round-trip delay is the round-trip delay corresponding to when the server sends historical information to the client;
[0165] Determine a third round-trip delay between the server and the client based on the first round-trip delay and the historical round-trip delay;
[0166] A target round trip delay is determined based on the second round trip delay and the third round trip delay.
[0167] In other embodiments of the present application, the processor 41 is used to execute the transmission protocol determination program in the memory 42 to determine the target transmission protocol from multiple transmission protocols based on the first duration, the target time, and the target round-trip delay, so as to implement the following steps:
[0168] Determine a transmission protocol to be determined from a plurality of transmission protocols based on a target round trip delay;
[0169] Based on the first duration, the target time, and the transmission protocol to be determined, a target transmission protocol is determined.
[0170] In other embodiments of the present application, the processor 41 is used to execute the transmission protocol determination program in the memory 42 to determine the transmission protocol to be determined from multiple transmission protocols based on the target round-trip delay, so as to implement the following steps:
[0171] If the target round-trip delay is greater than a first threshold, determining the first transmission protocol as the transmission protocol to be determined; wherein the plurality of transmission protocols include the first transmission protocol;
[0172] If the target round-trip delay is less than or equal to a first threshold, a transmission protocol to be determined is determined from a plurality of transmission protocols based on the target round-trip delay and a second threshold; wherein the first threshold is greater than the second threshold.
[0173] In other embodiments of the present application, the processor 41 is used to execute the transmission protocol determination program in the memory 42 to determine the transmission protocol to be determined from multiple transmission protocols based on the target round-trip delay and the second threshold, so as to implement the following steps:
[0174] If the target round-trip delay is less than the second threshold, determining the second transmission protocol as the transmission protocol to be determined;
[0175] If the target round-trip delay is greater than or equal to the second threshold, the currently used basic transmission protocol is determined to be the transmission protocol to be determined; wherein the multiple transmission protocols include the second transmission protocol and the basic transmission protocol.
[0176] In other embodiments of the present application, the processor 41 is used to execute the transmission protocol determination program in the memory 42 to determine the target transmission protocol based on the first duration, the target time and the transmission protocol to be determined, so as to implement the following steps:
[0177] If the transmission protocol to be determined is the same as the currently used basic transmission protocol, the basic transmission protocol is determined as the target transmission protocol;
[0178] If the transmission protocol to be determined is different from the basic transmission protocol, the target transmission protocol is determined from the basic transmission protocol and the transmission protocol to be determined based on the first duration and the target time.
[0179] In other embodiments of the present application, the processor 41 is used to execute the transmission protocol determination program in the memory 42 to determine the target transmission protocol from the basic transmission protocol and the transmission protocol to be determined based on the first duration and the target time, so as to implement the following steps:
[0180] Determine a second duration based on the target time, the current time, and the first duration;
[0181] If the second duration is less than or equal to the third threshold, determining that the transmission protocol to be determined is the target transmission protocol;
[0182] If the second duration is greater than the third threshold, the basic transmission protocol is determined as the target transmission protocol.
[0183] In other embodiments of the present application, the processor 41 is used to execute the transmission protocol determination program in the memory 42 to implement the following steps:
[0184] If the to-be-determined transmission protocol is determined to be the target transmission protocol, the first duration is increased;
[0185] If it is determined that the currently used transmission protocol is the target transmission protocol, the first duration is reduced.
[0186] The server provided in the embodiment of the present application can determine the target round-trip delay of the server at the current moment in combination with the first round-trip delay of the server and the second round-trip delay of the client, and then determine the target transmission protocol in combination with the target moment, the first duration and the target round-trip delay. That is, when determining the transmission protocol, the network status of the server, the network status of the client and the duration required to enter the second working mode capable of switching the transmission protocol from the first working mode are simultaneously considered, rather than relying entirely on human experience or only considering the network status of the server as in the related art. In this way, the problem of inaccurately determined transmission protocols in the process of data transmission in the related art is solved, and the data transmission efficiency is improved.
[0187] Based on the foregoing embodiments, the embodiments of the present application provide a computer-readable storage medium, which stores one or more programs, and the one or more programs can be executed by one or more processors to implement Figure 1 and 2 The corresponding embodiment provides steps of the transmission protocol determination method.
[0188] Based on the above embodiments, an embodiment of the present application provides a computer program product, the computer program product includes a computer program, the computer program is executed by a processor to achieve Figure 1 and 2 The corresponding embodiment provides steps of the transmission protocol determination method.
[0189] It should be noted that the above-mentioned computer-readable storage medium can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory (Flash Memory), a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM) and other memories; it can also be various electronic devices including one or any combination of the above-mentioned memories, such as mobile phones, computers, tablet devices, personal digital assistants, etc.
[0190] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0191] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0192] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0193] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0194] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0195] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
Claims
1. A method for determining a transmission protocol, characterized in that: The method comprises: Determine a first round-trip delay and a second round-trip delay between a server and a client; wherein the first round-trip delay is a round-trip delay corresponding to when the server sends information to the client; and the second round-trip delay is a round-trip delay corresponding to when the client sends information to the server; Determining a target round-trip delay based on the first round-trip delay and the second round-trip delay; Based on the first duration, the target time and the target round-trip delay, the target transmission protocol is determined from multiple transmission protocols; wherein the first duration is the time required to switch from the first working mode to the second working mode; the target time is the time to switch to the first working mode; and the second working mode is a working mode capable of switching the transmission protocol used for data transmission.
2. The method according to claim 1, characterized in that The determining a target round trip delay based on the first round trip delay and the second round trip delay includes: Obtaining a historical round-trip delay between the server and the client; wherein the historical round-trip delay is a round-trip delay corresponding to when the server sends historical information to the client; Determine a third round-trip delay between the server and the client based on the first round-trip delay and the historical round-trip delay; The target round trip delay is determined based on the second round trip delay and the third round trip delay.
3. The method according to claim 1, characterized in that The determining of a target transmission protocol from a plurality of transmission protocols based on the first duration, the target time, and the target round-trip delay includes: Determine a transmission protocol to be determined from a plurality of transmission protocols based on the target round trip delay; The target transmission protocol is determined based on the first duration, the target time and the to-be-determined transmission protocol.
4. The method according to claim 3, characterized in that The determining a transmission protocol to be determined from a plurality of transmission protocols based on the target round trip delay comprises: If the target round-trip delay is greater than a first threshold, determining a first transmission protocol as the transmission protocol to be determined; wherein the multiple transmission protocols include the first transmission protocol; If the target round-trip delay is less than or equal to the first threshold, the to-be-determined transmission protocol is determined from the multiple transmission protocols based on the target round-trip delay and the second threshold; wherein the first threshold is greater than the second threshold.
5. The method according to claim 4, characterized in that Determining the to-be-determined transmission protocol from the multiple transmission protocols based on the target round-trip delay and the second threshold includes: If the target round-trip delay is less than the second threshold, determining the second transmission protocol as the to-be-determined transmission protocol; If the target round-trip delay is greater than or equal to the second threshold, determine that the currently used basic transmission protocol is the transmission protocol to be determined; wherein the multiple transmission protocols include the second transmission protocol and the basic transmission protocol.
6. The method according to claim 3, characterized in that: The determining the target transmission protocol based on the first duration, the target time, and the to-be-determined transmission protocol includes: If the to-be-determined transmission protocol is the same as the currently used basic transmission protocol, determining the basic transmission protocol as the target transmission protocol; If the to-be-determined transmission protocol is different from the basic transmission protocol, the target transmission protocol is determined from the basic transmission protocol and the to-be-determined transmission protocol based on the first duration and the target time.
7. The method according to claim 6, characterized in that Determining the target transmission protocol from the basic transmission protocol and the transmission protocol to be determined based on the first duration and the target time includes: Determine a second duration based on the target time, the current time, and the first duration; If the second time duration is less than or equal to a third threshold, determining that the to-be-determined transmission protocol is the target transmission protocol; If the second duration is greater than the third threshold, the basic transmission protocol is determined to be the target transmission protocol.
8. The method according to claim 7, characterized in that The method further comprises: If it is determined that the to-be-determined transmission protocol is the target transmission protocol, increasing the first duration; If it is determined that the currently used transmission protocol is the target transmission protocol, the first duration is reduced.
9. A transmission protocol determination device, characterized in that: The device comprises: A first determining unit is used to determine a first round-trip delay and a second round-trip delay between a server and a client; wherein the first round-trip delay is a round-trip delay corresponding to when the server sends information to the client; and the second round-trip delay is a round-trip delay corresponding to when the client sends information to the server; A second determining unit, configured to determine a target round trip delay based on the first round trip delay and the second round trip delay; The third determination unit is used to determine the target transmission protocol from multiple transmission protocols based on the first duration, the target time and the target round-trip delay; wherein the first duration is the time required to switch from the first working mode to the second working mode; the target time is the time to switch to the first working mode; and the second working mode is a working mode that can switch the transmission protocol used for data transmission.
10. A server, characterized in that: The server includes: a processor, a memory and a communication bus; The communication bus is used to realize the communication connection between the processor and the memory; The processor is used to execute the transmission protocol determination program in the memory to implement the steps of the transmission protocol determination method according to any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the transmission protocol determination method according to any one of claims 1 to 8.
12. A computer program product, comprising a computer program, characterized in that: When the computer program is executed by a processor, the computer program implements the transmission protocol determination method according to any one of claims 1 to 8.