Data transmission method and apparatus, device, and system
By dynamically selecting the transport layer protocol on the client side, the problems of long data acquisition time and low data rate in client-server communication are solved, and efficient data transmission under different network quality conditions is achieved.
Patent Information
- Application Number
- PCT/CN2025/101439
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-06-19
- Filing Date
- 2025-06-17
- Publication Date
- 2025-12-26
AI Technical Summary
When a client communicates with a server based on a single transport layer protocol, it cannot fully utilize network quality, resulting in longer data acquisition times and lower transmission rates.
The client can dynamically select the appropriate protocol (such as TCP or QUIC) from multiple transport layer protocols to communicate with the server by calling the API, based on network quality, thus enabling flexible protocol switching.
It effectively shortens the time for the client to obtain data from the server, improves the data transmission rate, and adapts to changes in network quality.
Smart Images

Figure CN2025101439_26122025_PF_FP_ABST
Abstract
Description
Data transmission method, device, equipment and system
[0001] The present application claims priority from the Chinese patent application No. 202410798690.3 filed on June 19, 2024, and entitled "Data transmission method, device, equipment and system", the contents of which are incorporated herein by reference in its entirety. TECHNICAL FIELD
[0002] The present application relates to the field of communication, in particular to a data transmission method, device, equipment and system. BACKGROUND
[0003] Generally, data transmission between a client and a server is based on a communication protocol provided by an Open System Interconnect (OSI) reference model. The transport layer includes a Transmission Control Protocol (TCP), a User Datagram Protocol (UDP) and a Quick UDP Internet Connections (QUIC) protocol.
[0004] Currently, the client is configured with multiple transport layer protocols. The client requests the required data from the server based on one transport layer protocol, which cannot fully utilize the multiple transport layer protocols, resulting in a long time for the client to obtain data from the server. SUMMARY
[0005] The present application provides a data transmission method, device, equipment and system, thereby shortening the time for the client to obtain data from the server.
[0006] In a first aspect, a data transmission method is provided. The method comprises: a client invoking an Application Programming Interface (API), selecting a first transport layer protocol from multiple transport layer protocols according to a switching strategy, sending a first request to a server, instructing the server to transmit data in the first transport layer protocol, and then the client receiving first data transmitted by the server based on the first transport layer protocol. The switching strategy is used to instruct the selection of a transport layer protocol used by the client to request data from the server based on network quality between the client and the server. The API is used to select a transport layer protocol used by the client to request data from the server according to the switching strategy.
[0007] The data transmission method provided in the application, the client selects a transport layer protocol from a plurality of transport layer protocols configured by the client according to the network quality between the client and the server by calling the API, and instructs the server to transmit data based on the selected transport layer protocol, so that the client can obtain the required data from the server as soon as possible. That is, when the client uses the API provided in the application, the transport layer protocol used by the client to request data from the server can be dynamically selected, the plurality of transport layer protocols configured by the client can be flexibly switched according to the network quality, and the selected transport layer protocol is used to request data from the server. Therefore, the time length for the client to obtain data from the server can be effectively shortened, the data transmission rate of the client to obtain data from the server is improved, and the problem that the time for the client to obtain data from the server is long and the data transmission rate is low based on one transport layer protocol for transmission under different network qualities is avoided.
[0008] In a possible implementation, the operating system of the client includes the API. The API is called to determine the first transport layer protocol in the plurality of transport layer protocols according to the switching strategy, including: the API is called to obtain the network quality between the client and the server; and the first transport layer protocol in the plurality of transport layer protocols is determined according to the network quality.
[0009] In another possible implementation, the API is called to obtain the network quality between the client and the server, including: the API is called to obtain the network characteristics between the client and the server; and the network quality is determined according to the network characteristics between the client and the server.
[0010] The application provides a system-level interface to implement a system-level transport layer protocol selection function, improve the universality of the data transmission method provided in the application, and enable the client to call the interface to obtain the network characteristics between the client and the server, and select a transport layer protocol from a plurality of transport layer protocols according to the network quality determined based on the network characteristics, so as to transmit data based on the selected transport layer protocol, and shorten the time length for the client to obtain data from the server.
[0011] In another possible implementation, the network characteristics include at least one of a packet loss rate, a bandwidth, or a round-trip time (RTT).
[0012] The network characteristics such as the packet loss rate, the bandwidth, or the round-trip time can be used to evaluate the pros and cons of the network quality, the transport layer protocol used for transmitting data is selected based on the network quality determined based on the network characteristics, the transport layer protocol suitable for transmitting data under the current network quality can be accurately selected, the time length for the client to obtain data from the server is shortened, and the data transmission rate of the client to obtain data from the server is improved.
[0013] In another possible implementation, the switching strategy indicates to determine one of the plurality of transport layer protocols according to a comparison result of the network quality and the threshold; and the determining the first transport layer protocol of the plurality of transport layer protocols according to the network quality comprises: determining the first transport layer protocol of the plurality of transport layer protocols according to a comparison result of the network quality and the first threshold.
[0014] The threshold can refer to an evaluation limit of the network quality, and the threshold provides a criterion for switching the transport layer protocol according to the network quality. The scheme of determining the transport layer protocol used for transmitting data according to the threshold comparison manner has a simple algorithm, thereby reducing the calculation overhead and power consumption.
[0015] The first threshold can include one or more. For example, the first threshold can refer to a threshold of the network quality. For another example, the first threshold includes a packet loss rate threshold, a bandwidth threshold, or a round-trip delay threshold. The packet loss rate, the bandwidth, or the round-trip delay included in the network characteristic is compared with the packet loss rate threshold, the bandwidth threshold, or the round-trip delay threshold, respectively, to determine the first transport layer protocol of the plurality of transport layer protocols.
[0016] In another possible implementation, the API is invoked to determine the first transport layer protocol of the plurality of transport layer protocols according to the switching strategy, which comprises: when the client requests the first data from the server, the API is invoked to determine the first transport layer protocol of the plurality of transport layer protocols according to the switching strategy.
[0017] Therefore, when the client needs to request data from the server, the transport layer protocol used for requesting data from the server is selected in real time according to the switching strategy, the computing resources are reasonably used, and the utilization rate of the computing resources is improved.
[0018] In another possible implementation, the first transport layer protocol of the plurality of transport layer protocols is determined according to the switching strategy, which comprises: the first transport layer protocol of the plurality of transport layer protocols is determined according to the network quality and a congestion control method used by the server.
[0019] The congestion control algorithm is an important technology for preventing network congestion and improving network transmission performance in a computer network. The selection of the transport layer protocol according to the congestion control method used by the server and the network quality can improve the selection accuracy of the transport layer protocol, further shorten the time length for the client to obtain data from the server, and improve the data transmission rate of the client to obtain data from the server.
[0020] In another possible implementation, the switching strategy indicates adjusting the threshold according to the congestion control method, and determining one of the plurality of transport layer protocols according to the comparison result of the network quality and the threshold, and determining the first transport layer protocol of the plurality of transport layer protocols according to the network quality and the congestion control algorithm used by the server, comprises: determining whether to adjust the first threshold according to the congestion control algorithm; when the first threshold does not need to be adjusted, determining the first transport layer protocol of the plurality of transport layer protocols according to the comparison result of the network quality and the first threshold; when the first threshold is adjusted to a second threshold, determining the first transport layer protocol of the plurality of transport layer protocols according to the comparison result of the network quality and the second threshold; the second threshold is smaller than the first threshold.
[0021] For example, when the congestion control algorithm is Cubic, the first transport layer protocol of the plurality of transport layer protocols is determined according to the comparison result of the network quality and the first threshold; when the congestion control algorithm is a bottleneck bandwidth and round-trip time (BBR) based congestion control algorithm, the first threshold is adjusted to a second threshold, and the first transport layer protocol of the plurality of transport layer protocols is determined according to the comparison result of the network quality and the second threshold.
[0022] In this way, the threshold is adjusted according to the congestion control algorithm, that is, the switching standard of the transport layer protocol is adjusted, so that the client selects a more accurate and more suitable transport layer protocol under different network qualities, further shortens the time length of the client obtaining data from the server, and improves the data transmission rate of the client obtaining data from the server.
[0023] In another possible implementation, the method further comprises: determining the congestion control algorithm used by the server according to the message information of the message received by the client. The message information includes at least one of the message interval or the change in the number of received messages within the round-trip delay.
[0024] Since the server uses different congestion control algorithms to send data packets at different intervals or send different numbers of messages within a round-trip delay, the client predicts the congestion control algorithm used by the server according to the packet arrival interval or the number of received messages within the round-trip delay, thereby ensuring the accuracy of the selection of the transport layer protocol, further shortening the time length of the client obtaining data from the server, and improving the data transmission rate of the client obtaining data from the server.
[0025] In another possible implementation, after receiving the first response sent by the server, the method further comprises: calling an API to determine a second transport layer protocol of the plurality of transport layer protocols according to the switching strategy; sending a second request to the server, the second request including information of the second transport layer protocol; receiving a second response sent by the server, the second response including second data transmitted based on the second transport layer protocol.
[0026] Therefore, under different network qualities between the client and the server, the client switches and flexibly uses the multiple transport layer protocols configured by the client according to the switching strategy, which can effectively shorten the time length of the client obtaining data from the server and improve the data transmission rate of the client obtaining data from the server.
[0027] In another possible implementation, the multiple transport layer protocols include a TCP and a QUIC protocol.
[0028] The data transmission method provided in the application does not need to pre-configure the transport layer protocol used by the client to request data from the server, and the client can call an API to select a transport layer protocol from the multiple transport layer protocols according to the network quality between the client and the server. For example, in the case of good network quality such as high bandwidth, small packet loss rate, and short round-trip delay, the client selects TCP from the multiple transport layer protocols, and requests the server to transmit data to the client based on TCP; in the case of poor network quality such as low bandwidth, large packet loss rate, and long round-trip delay, the client selects QUIC from the multiple transport layer protocols, and requests the server to transmit data to the client based on QUIC.
[0029] Therefore, when the client requests data from the server using the API provided in the application, the client can dynamically select the transport layer protocol used by the client to request data from the server, such as selecting TCP or QUIC to request data from the server. Understandably, when the client requests data from the server again after the client requests the server to transmit data to the client based on TCP last time, the client selects QUIC from the multiple transport layer protocols according to the network quality between the client and the server, and requests the server to transmit data to the client based on QUIC. For another example, when the client requests data from the server again after the client requests the server to transmit data to the client based on QUIC last time, the client selects TCP from the multiple transport layer protocols according to the network quality between the client and the server, and requests the server to transmit data to the client based on TCP. Therefore, the client can flexibly select TCP and QUIC to switch from TCP to QUIC, and also switch from QUIC to TCP. The application does not limit the direction of switching the multiple transport layer protocols. Therefore, the appropriate transport layer protocol is selected based on the network quality, so that the client obtains data from the server as soon as possible, effectively shortens the time length of the client obtaining data from the server, and improves the data transmission rate of the client obtaining data from the server.
[0030] In another possible implementation, the data requested by the client from the server includes data related to a first application, and the first application is any one of the multiple applications installed on the client.
[0031] Therefore, the system-level interface is provided, and the universality of the data transmission method is improved. Any application can obtain the network characteristic between the client and the server, select one of the plurality of transport layer protocols according to the network quality determined by the network characteristic, and transmit data based on the selected transport layer protocol. In this way, the transmission time of the server to the client is shortened, and the data transmission rate of the client to obtain data from the server is improved.
[0032] The data transmission method provided by the application can enable the client to select one of the plurality of transport layer protocols according to the network quality to request data from the server, flexibly use the plurality of transport layer protocols configured by the client, and shorten the time of the client to obtain data from the server. In some embodiments, in the case that the network quality between the client and the server is extremely low, other protocols in addition to the TCP and QUIC protocols can be selected to request data from the server.
[0033] In another possible implementation, the method further includes: calling an API, determining a third transport layer protocol in the plurality of transport layer protocols according to the switching strategy; sending a third request to the server, the third request including information of the third transport layer protocol; and receiving a third response sent by the server, the third response including third data transmitted based on the third transport layer protocol. The third transport layer protocol can be UDP.
[0034] For example, in the case that the network quality between the client and the server is extremely low, such as a large packet loss rate, a narrow bandwidth, a large RTT, etc., the client uses the QUIC protocol to request data, and the time of the client to obtain data from the server is still long, the client uses the UDP to request data from the server.
[0035] In a second aspect, a data transmission apparatus is provided, and the data transmission apparatus includes a module for executing the method in the first aspect or any possible design in the first aspect. For example, the data transmission apparatus includes a processing module and a communication module.
[0036] The processing module is configured to call an API and determine a first transport layer protocol in the plurality of transport layer protocols according to a switching strategy. The switching strategy is used to indicate that the transport layer protocol used by the client to request data from the server is selected from the plurality of transport layer protocols based on the network quality between the client and the server. The API is used to select the transport layer protocol used by the client to request data from the server according to the switching strategy. The communication module is configured to send a first request to the server, the first request including information of the first transport layer protocol. The communication module is further configured to receive a first response sent by the server, the first response including first data transmitted based on the first transport layer protocol.
[0037] In a possible implementation, the operating system of the client comprises an API. The processing module is configured to invoke the API to determine the first transport layer protocol from the plurality of transport layer protocols according to the switching policy, and has the following technical features: configured to invoke the API to obtain the network quality between the client and the server; and configured to determine the first transport layer protocol from the plurality of transport layer protocols according to the network quality.
[0038] In another possible implementation, the processing module is configured to invoke the API to obtain the network quality between the client and the server, and has the following technical features: configured to invoke the API to obtain the network characteristic between the client and the server; and configured to determine the network quality according to the network characteristic between the client and the server.
[0039] In another possible implementation, the network characteristic comprises at least one of a packet loss rate, a bandwidth, or a round-trip delay.
[0040] In another possible implementation, the switching policy indicates to determine one of the plurality of transport layer protocols according to a comparison result of the network quality and a threshold value; and the processing module is configured to determine the first transport layer protocol from the plurality of transport layer protocols according to the network quality, and has the following technical features: configured to determine the first transport layer protocol from the plurality of transport layer protocols according to a comparison result of the network quality and a first threshold value.
[0041] In another possible implementation, the processing module is configured to invoke the API to determine the first transport layer protocol from the plurality of transport layer protocols according to the switching policy, and has the following technical features: configured to invoke the API to determine the first transport layer protocol from the plurality of transport layer protocols according to the switching policy when the client requests the first data from the server.
[0042] In another possible implementation, the processing module is configured to determine the first transport layer protocol from the plurality of transport layer protocols according to the switching policy, and has the following technical features: configured to determine the first transport layer protocol from the plurality of transport layer protocols according to the network quality and a congestion control method used by the server.
[0043] In another possible implementation, the switching policy indicates to adjust a threshold value according to the congestion control method, and to determine one of the plurality of transport layer protocols according to a comparison result of the network quality and the threshold value; and the processing module is configured to determine the first transport layer protocol from the plurality of transport layer protocols according to the network quality and the congestion control algorithm used by the server, and has the following technical features: configured to determine whether to adjust a first threshold value according to the congestion control algorithm; configured to determine the first transport layer protocol from the plurality of transport layer protocols according to a comparison result of the network quality and the first threshold value when the first threshold value is not required to be adjusted; and configured to determine the first transport layer protocol from the plurality of transport layer protocols according to a comparison result of the network quality and a second threshold value when the first threshold value is adjusted to the second threshold value; the second threshold value is smaller than the first threshold value.
[0044] In a possible implementation, when the processing module determines the first transport layer protocol from the plurality of transport layer protocols according to the network quality and the congestion control algorithm used by the server, the processing module is configured to: when the congestion control algorithm is Cubic, determine the first transport layer protocol from the plurality of transport layer protocols according to a comparison result of the network quality and a first threshold; and when the congestion control algorithm is BBR, adjust the first threshold to a second threshold, and determine the first transport layer protocol from the plurality of transport layer protocols according to a comparison result of the network quality and the second threshold.
[0045] In a possible implementation, the processing module is further configured to determine the congestion control algorithm used by the server according to packet information of the packet received by the client, the packet information including at least one of a packet interval or a change in a number of packets received within a round-trip delay.
[0046] In a possible implementation, after receiving the first response sent by the server, the processing module is further configured to: invoke an API to determine a second transport layer protocol from the plurality of transport layer protocols according to the switching strategy; and the communication module is further configured to: send, to the server, a second request including information of the second transport layer protocol; and receive a second response sent by the server, the second response including second data transmitted based on the second transport layer protocol.
[0047] In a possible implementation, the plurality of transport layer protocols include TCP and QUIC.
[0048] In a possible implementation, the data requested by the client from the server includes data related to a first application, and the first application is any one of a plurality of applications installed on the client.
[0049] In a possible implementation, the processing module is further configured to: invoke an API to determine a third transport layer protocol from the plurality of transport layer protocols according to the switching strategy; and the communication module is further configured to: send, to the server, a third request including information of the third transport layer protocol; and receive a third response sent by the server, the third response including third data transmitted based on the third transport layer protocol. The third transport layer protocol can be UDP.
[0050] In a third aspect, a chip system is provided, which includes a processor and a power supply circuit, the power supply circuit being configured to supply power to the processor, and the processor being configured to execute the operation steps of the method in the first aspect or any possible implementation manner of the first aspect.
[0051] In a fourth aspect, a computer device is provided, which includes a memory and a plurality of processors, the memory being configured to store a set of computer instructions, and the processors being configured to execute the set of computer instructions, so that the computer device executes the operation steps of the method in the first aspect or any possible implementation manner of the first aspect.
[0052] Fifthly, a communication system is provided, including a client and a server, the client including a processor and a memory; the processor is configured to execute instructions stored in the memory to cause the client to perform operational steps of the method as described in the first aspect or any possible implementation of the first aspect, and to obtain data from the server.
[0053] A sixth aspect provides a computer-readable storage medium comprising: computer software instructions; which, when executed in a processor, cause the processor to perform operational steps of the method as described in the first aspect or any possible implementation thereof.
[0054] In a seventh aspect, a computer program product is provided that, when run on a computer, causes the computer to perform the operational steps of the method as described in the first aspect or any possible implementation thereof.
[0055] The technical effects of any of the design methods in aspects two through seven can be found in aspect one or in different design methods in aspect one, and will not be repeated here.
[0056] Based on the implementation methods provided in the above aspects, this application can be further combined to provide more implementation methods. Attached Figure Description
[0057] Figure 1 is a schematic diagram of the response completion time of a transport layer protocol provided in this application;
[0058] Figure 2 is a schematic diagram of the architecture of a communication system provided in this application;
[0059] Figure 3 is a flowchart illustrating a data transmission method provided in this application;
[0060] Figure 4 is a schematic diagram of the change of the switching boundary of a transport layer protocol provided in this application;
[0061] Figure 5 is a flowchart illustrating another data transmission method provided in this application;
[0062] Figure 6 is a flowchart illustrating another data transmission method provided in this application;
[0063] Figure 7 is a schematic diagram of a data transmission device provided in this application;
[0064] Figure 8 is a structural schematic diagram of a computer device provided in this application. Detailed Implementation
[0065] To facilitate understanding, the main terms used in this application will be explained first.
[0066] Open System Interconnect (OSI): provides a framework of functional architecture for open interconnection information systems. From low to high, they are: physical layer, data link layer, network layer, transport layer, session layer, presentation layer and application layer.
[0067] Among them, the bottom layer includes physical layer, data link layer, network layer and transport layer, which are related to data transmission. The high layer includes session layer, presentation layer and application layer, which contains application level data.
[0068] Transport Layer is one of the key layers in the entire network architecture, which is mainly responsible for providing reliable and effective message transmission services between processes in two hosts. For example, the transport layer provides connection establishment, data packet error handling, data packet order, etc. A host runs multiple processes, and the transport layer has multiplexing and demultiplexing functions. The transport layer provides transparent data transmission between terminal devices and provides reliable data transmission services to the upper layer. The transport layer ensures the reliability of data transmission through flow control, segmentation, reassembly and error control on a given link. Some transport layer protocols are link-oriented, meaning that the transport layer can keep track of segments and retransmit failed segments.
[0069] Transport layer protocols include Transmission Control Protocol (TCP), User Datagram Protocol (UDP) and Quick UDP Internet Connections (QUIC) protocol.
[0070] Transmission Control Protocol: a connection-oriented, reliable, byte-stream-based transport layer communication protocol. A transport protocol designed to provide reliable end-to-end byte streams over an unreliable interconnection network.
[0071] User Datagram Protocol: provides a datagram mode of packet switching computer communication in an environment of a set of interconnected computer networks.
[0072] Quick UDP Internet Connections: a general user-space reliable transport protocol. Based on UDP, it takes advantage of the speed and efficiency of UDP, integrates the advantages of TCP, Transport Layer Security (TLS) and Hypertext Transfer Protocol (HTTP)2 and optimizes the transport layer protocol.
[0073] Under different network qualities between the client and the server, the client obtains data from the server, and the time length of transmitting data based on different transport layer protocols is different. For example, as shown in FIG. 1, under the network of 2G or 3G, the end-to-end response completion time of QUIC is better than that of TCP, and under the network of 4G or WiFi, the end-to-end response completion time of QUIC is slightly worse than that of TCP.
[0074] Packet Loss Rate: refers to the ratio of the number of lost data packets in the network transmission process to the total number of transmitted data packets.
[0075] Bandwidth: can refer to network bandwidth, which refers to the amount of data that can be transmitted per unit of time (generally 1 second). The larger the bandwidth, the more data can be transmitted per unit of time (generally 1 second). Network bandwidth is an important indicator for measuring network characteristics.
[0076] Round-Trip Time (RTT): refers to the time required for data to be transmitted from the sending end to the receiving end and the sending end to receive the acknowledgment from the receiving end.
[0077] In order to solve the problem that the client takes a long time to obtain data from the server, the present application provides a data transmission method, that is, the client calls an API, selects a first transport layer protocol from a plurality of transport layer protocols according to a switching strategy, sends a first request to the server, instructs the server to transmit data in the first transport layer protocol, and then the client receives first data transmitted by the server based on the first transport layer protocol. The switching strategy is used to instruct the selection of a transport layer protocol used by the client to request data from the server from a plurality of transport layer protocols based on the network quality between the client and the server. The API is used to select the transport layer protocol used by the client to request data from the server according to the switching strategy.
[0078] The data transmission method provided by the present application, the client selects a transport layer protocol from a plurality of transport layer protocols configured by the client according to the network quality between the client and the server by calling the API, instructs the server to transmit data based on the selected transport layer protocol, so that the client obtains the required data from the server as soon as possible. That is, when the client uses the API provided by the present application, the client can dynamically select the transport layer protocol used by the client to request data from the server, flexibly switch the plurality of transport layer protocols configured by the client according to the network quality, and request data from the server using the selected transport layer protocol. Therefore, the time length of the client obtaining data from the server can be effectively shortened, the data transmission rate of the client obtaining data from the server can be improved, and the problem that the client takes a long time to obtain data from the server and the data transmission rate is low based on one transport layer protocol under different network qualities can be avoided.
[0079] The present application can be applied to time delay sensitive application scenarios. For example, the application scenarios of the present application include Internet of Things, including Industrial Internet of Things (IIoT) (such as wireless control in industrial manufacturing or production process), motion control of unmanned cars and unmanned aircrafts, and haptic interaction type applications such as remote repair, remote medical treatment, etc. The main features of these services are ultra-high reliability, low delay, small amount of transmission data, and burstiness.
[0080] For another example, the application scenarios of the present application include that a user uses a client to watch a video. The client downloads video resources from a server in time so as to shorten the time length of the client to obtain data from the server, which helps to improve the user's watching experience.
[0081] The embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0082] The data transmission method provided by the present application can be applied to a Client-Server (C / S) architecture. The client can be referred to as a local computer or a local device or a local computer or a local device. The server can be referred to as a remote computer or a remote device or a storage server or a network storage server.
[0083] For example, the client and the server support multiple protocols and various operating systems. For example, the protocols include Network File System (NFS), Common Internet File System (CIFS), File Transfer Protocol (FTP), Hypertext Transfer Protocol (HTTP), TCP, UDP and QUIC protocol, etc.
[0084] FIG. 2 is a schematic diagram of an architecture of a communication system provided by the present application. As shown in FIG. 2, the communication system 200 includes a client 210 and multiple servers 220.
[0085] The server 220 can be a computing node providing computing functions. The computing node can also be referred to as a computing server. Multiple servers providing computing functions can form a computing cluster. For example, the server 220 can include a central processing unit (CPU), a graphics processing unit (GPU), a data processing unit (DPU), a neural processing unit (NPU), an embedded neural-network processing unit (NPU), and other computing units with computing capabilities to provide high-performance computing.
[0086] The server 220 can also be a storage node providing storage functions. The storage node can also be referred to as a storage server. Multiple servers providing storage functions can form a storage cluster. For example, the server 220 can include one or more controllers, network cards, and multiple hard disks. The hard disks are used to store data. The hard disks can be magnetic disks or other types of storage media, such as solid-state disks or shingled magnetic recording hard disks. The network cards are used to communicate with the computing nodes or the client 210. The controllers are used to write data into the hard disks or read data from the hard disks according to read / write data requests sent by the computing nodes. In the process of reading and writing data, the controllers need to convert the addresses carried in the read / write data requests into addresses recognizable by the hard disks.
[0087] FIG. 2 is only a schematic diagram, and the embodiments of the present application do not limit the number of devices included in the communication system. For example, the communication system can include multiple clients. One client can be connected to multiple servers. One server can also be connected to multiple clients. The present application does not limit the connection mode of the client and the server. Optionally, the communication system can also include other devices, such as network devices (e.g., switches, routers) and wireless access network devices. The wireless access network device is an access device through which a terminal device accesses a mobile communication system in a wireless manner, and can be a base station, an evolved NodeB (eNodeB), a transmission reception point (TRP), a next-generation NodeB (gNB) in a 5G mobile communication system, a base station in a future mobile communication system, or an access node in a WiFi system. The client and the multiple servers are connected through the network devices and / or the wireless access network devices, and data is transmitted through the network devices.
[0088] The application does not limit the form of the client. The client, also known as the user end, refers to a program corresponding to the server, which provides local services for the client. For example, a domain name system (DNS) client, a web client, a game client, a mobile client, etc.
[0089] In other embodiments, the client can also refer to a physical device corresponding to the server. For example, the client includes a terminal, a mobile phone, a tablet computer (Pad), a computer with wireless transceiver function, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, an extended reality (ER) device, a camera, a vehicle-mounted terminal, a wireless terminal in industrial control, a wireless terminal in self driving, a wireless terminal in remote medical surgery, a wireless terminal in smart grid, a wireless terminal in transportation safety, a wireless terminal in smart city, a wireless terminal in smart home, etc.
[0090] The application does not limit the operating system installed on the client. The operating system can include, but is not limited to OS, , etc.
[0091] The client 210 communicates with multiple servers 220 through a network 230. The network 230 can refer to an enterprise internal network (such as a local area network (Local Area Network, LAN)) or the Internet.
[0092] The application does not limit the protocol for communication between the client and the server. In some embodiments, the client and the server communicate based on the TCP, UDP or QUIC protocol.
[0093] In this application, when the client 210 requests data from the server 220, the client calls the API, determines the network quality according to the network characteristics between the client and the server, selects one of the multiple transport layer protocols according to the network quality, sends a request to the server 220, and receives data transmitted by the server 220 based on the transport layer protocol selected by the client.
[0094] Next, the data transmission method is described in detail in combination with the drawings.
[0095] FIG. 3 is a flowchart of a data transmission method provided by the present application. Here, the client 210 requests data from the server 220 as an example for description. As shown in FIG. 3, the method includes the following steps.
[0096] Step 310, calling an API, determining a first transport layer protocol from a plurality of transport layer protocols according to a switching strategy.
[0097] The client configures a plurality of transport layer protocols. For example, the plurality of transport layer protocols includes TCP and QUIC. In the embodiment of the present application, the client can select a transport layer protocol from the plurality of transport layer protocols configured by the client, and request the server to transmit data to the client according to the selected transport layer protocol. For example, the client selects TCP, and requests the server to transmit data to the client based on TCP. For another example, the client selects QUIC, and requests the server to transmit data to the client based on QUIC.
[0098] In some embodiments, when the client requests data from the server for the first time, the client can request data from the server based on a default transport layer protocol. For example, when the client requests data from the server for the first time, the client requests the server to transmit data to the client based on TCP. When the client requests data from the server for the second time and subsequent times, a transport layer protocol used for transmitting data is selected from the plurality of transport layer protocols configured by the client according to a switching strategy.
[0099] The plurality of requests described in the present application can refer to a plurality of requests required to be sent by the client to the server when the client requests a service data from the server.
[0100] In some embodiments, when the client requests a service data from the server, a plurality of requests may be required to be sent by the client to the server to obtain complete data. For example, the service data can refer to a video, the client requests a video from the server, and the client needs to send a plurality of requests to the server to request the server to send video data. The client downloads the video while playing the video, and the user can watch the video online. When the client requests data from the server for the first time, the client requests the server to transmit data to the client based on TCP. When the client requests data from the server for the second time and subsequent times, a transport layer protocol used for transmitting data is selected from the plurality of transport layer protocols configured by the client according to a switching strategy.
[0101] The switching strategy is used to indicate the network quality between the client and the server to select a transport layer protocol used by the client to request data from the server from a plurality of transport layer protocols.
[0102] In a first possible implementation, the client first acquires the network quality between the client and the server, and determines the transport layer protocol used for transmitting the first data according to the network quality between the client and the server, that is, selects the first transport layer protocol used for transmitting the first data from the plurality of transport layer protocols configured by the client. The first transport layer protocol can be any one of the plurality of transport layer protocols.
[0103] In some embodiments, the network feature is used to indicate the network quality between the client and the server. The network feature includes at least one of a packet loss rate, a bandwidth, or an RTT. The client determines the network quality according to the network feature between the client and the server. For example, the network quality is determined according to at least one of the packet loss rate, the bandwidth, or the RTT between the client and the server. Wherein, the smaller the packet loss rate, the better the network quality, and the larger the packet loss rate, the worse the network quality. The larger the bandwidth, the better the network quality, and the smaller the bandwidth, the worse the network quality. The smaller the RTT, the better the network quality, and the larger the RTT, the worse the network quality.
[0104] For example, the packet loss rate, the bandwidth, or the RTT is input into a network quality evaluation model, and a network quality score is output. The higher the network quality score, the better the network quality. For example, a high network quality score indicates good network quality. A low network quality score indicates poor network quality.
[0105] The network feature such as the packet loss rate, the bandwidth, or the RTT is a system-level parameter. In some embodiments, the client provides a system-level API that is open to all third-party application developers. When the client runs an application and requests data from the server, the API can be called, that is, a transport layer protocol used for transmitting data is automatically selected from the plurality of transport layer protocols according to the switching strategy, without additional work of the application, so that the client receives data transmitted by the server based on the selected transport layer protocol without user awareness. For example, the client calls the API to acquire the network feature between the client and the server, determines the network quality according to the network feature between the client and the server, and determines the transport layer protocol used for transmitting the first data according to the network quality between the client and the server. The API is used to select the transport layer protocol used by the client to request data from the server according to the switching strategy. Thus, under different network qualities between the client and the server, the plurality of transport layer protocols configured by the client are flexibly used, the time length for the client to acquire data from the server is shortened, and the data transmission rate for the client to acquire data from the server is improved. For any application, the client can acquire the required data from the server as soon as possible, and the user experience is improved.
[0106] The operating system provides a kernel mode and a user mode, also referred to as a kernel state and a user state. The operating system can allow an application to run in the kernel state or the user state to limit the system authority of the application, improve the stability and security of the system. The authority of the application running in the kernel state is greater than the authority of the application running in the user state. The API provided in the application is a system-level interface. The operating system can allow the application to run in the kernel state, and call the API provided in the application, so that the application running on the client can obtain the network characteristics such as the packet loss rate, the bandwidth, or the RTT, and improve the universality of the data transmission method provided in the application.
[0107] The application does not limit the specific setting mode of the API. For example, a new API is separately set in the operating system of the client, and the API is used to indicate selection of TCP or QUIC. For another example, the value of a parameter in the API provided by the operating system of the client is set. When the values of the parameters are different, the API indicates different functions. For an example, when the value of the parameter is 0, it indicates that only TCP is used to transmit data; when the value of the parameter is 1, it indicates that only QUIC is used to transmit data; and when the value of the parameter is 2, it indicates selection of TCP or QUIC to transmit data.
[0108] Optionally, the network characteristics can also include a scene type. The scene type includes a high-speed scene (for example, a high-speed rail scene) and a low-speed scene (for example, a car scene or a walking scene). The transmission layer protocol used to transmit the first data is determined according to the scene.
[0109] In some other embodiments, the switching strategy indicates that one of the plurality of transmission layer protocols is determined according to a comparison result of the network quality and the threshold value. The client determines a first transmission layer protocol in the plurality of transmission layer protocols according to a comparison result of the network quality and a first threshold value. The first threshold value can include one or more.
[0110] For example, the first threshold value can be a threshold value of the network quality. After the client determines the current network quality according to at least one of the packet loss rate, the bandwidth, or the RTT between the client and the server, the current network quality is compared with the first threshold value, and a first transmission layer protocol in the plurality of transmission layer protocols is determined according to a comparison result of the current network quality and the first threshold value.
[0111] For an example, when the current network quality is greater than the first threshold value, it indicates that the network quality between the client and the server is good, TCP is selected from the plurality of transmission layer protocols, and the server is requested to transmit data to the client based on TCP; and when the current network quality is less than the first threshold value, it indicates that the network quality between the client and the server is poor, QUIC is selected from the plurality of transmission layer protocols, and the server is requested to transmit data to the client based on QUIC.
[0112] For example, in a high-speed scenario, the client frequently performs network switching and the network quality is poor. The client can use QUIC to request the server to transmit data to the client based on QUIC. In a low-speed scenario, the client does not frequently perform network switching or does not perform network switching. The client can use TCP to request the server to transmit data to the client based on TCP.
[0113] Optionally, when the current network quality is equal to the first threshold, TCP or QUIC is selected from the plurality of transport layer protocols, and the server is requested to transmit data to the client based on TCP or QUIC.
[0114] For example, the first threshold includes a packet loss rate threshold, a bandwidth threshold, or a round-trip time threshold. The network features obtained by the client include a packet loss rate, a bandwidth, or a round-trip time. At least one of the packet loss rate and the packet loss rate threshold, the bandwidth and the bandwidth threshold, or the round-trip time and the round-trip time threshold is compared. At least one of the comparison result of the packet loss rate, the comparison result of the bandwidth, or the comparison result of the round-trip time is used to determine the first transport layer protocol from the plurality of transport layer protocols.
[0115] For example, when the bandwidth is greater than the bandwidth threshold, it indicates that the network quality between the client and the server is good. TCP is selected from the plurality of transport layer protocols, and the server is requested to transmit data to the client based on TCP. Conversely, when the bandwidth is less than the bandwidth threshold, it indicates that the network quality between the client and the server is poor. QUIC is selected from the plurality of transport layer protocols, and the server is requested to transmit data to the client based on QUIC.
[0116] When the packet loss rate is less than the packet loss rate threshold, it indicates that the network quality between the client and the server is good. TCP is selected from the plurality of transport layer protocols, and the server is requested to transmit data to the client based on TCP. Conversely, when the packet loss rate is greater than the packet loss rate threshold, it indicates that the network quality between the client and the server is poor. QUIC is selected from the plurality of transport layer protocols, and the server is requested to transmit data to the client based on QUIC.
[0117] When the RTT is less than the RTT threshold, it indicates that the network quality between the client and the server is good. TCP is selected from the plurality of transport layer protocols, and the server is requested to transmit data to the client based on TCP. Conversely, when the RTT is greater than the RTT threshold, it indicates that the network quality between the client and the server is poor. QUIC is selected from the plurality of transport layer protocols, and the server is requested to transmit data to the client based on QUIC.
[0118] The application does not limit the combination of the packet loss rate, the bandwidth, and the round-trip time for determining the network quality. Any one or more of the packet loss rate, the bandwidth, and the round-trip time can be used to determine the network quality.
[0119] For example, when the bandwidth is greater than the bandwidth threshold value and the packet loss rate is less than the packet loss rate threshold value, it indicates that the network quality between the client and the server is good, and TCP is selected from the plurality of transport layer protocols, and the server is requested to transmit data to the client based on TCP.
[0120] When the bandwidth is greater than the bandwidth threshold value, the packet loss rate is less than the packet loss rate threshold value, and the round-trip delay is less than the round-trip delay threshold value, it indicates that the network quality between the client and the server is good, and TCP is selected from the plurality of transport layer protocols, and the server is requested to transmit data to the client based on TCP.
[0121] For example, the network quality satisfies the following formula (1).
[0122] Y = aX1 + bX2 + cX3 Formula (1)
[0123] Wherein, Y represents the network quality, X1 represents the packet loss rate, X2 represents the bandwidth, and X3 represents the round-trip delay, and a, b, and c are constants.
[0124] Optionally, at least one of the packet loss rate, the bandwidth, and the round-trip delay between the client and the server within a period of time can be statistically calculated (for example, variance, average difference, etc.), and the network quality can be determined.
[0125] In a second possible implementation, the server transmits data using different congestion control algorithms, and different congestion control algorithms have different transmission performances in different network environments. The switching strategy indicates that the threshold value is adjusted according to the congestion control method, and one of the plurality of transport layer protocols is determined according to the comparison result of the network quality and the threshold value.
[0126] When the client requests the first data from the server, a first transport layer protocol in the plurality of transport layer protocols is determined according to the network quality and the congestion control method used by the server.
[0127] The client first determines whether to adjust the threshold value used by the selected transport layer protocol according to the congestion control method used by the server. If the threshold value is not adjusted, the first transport layer protocol in the plurality of transport layer protocols is determined according to the comparison between the threshold value and the network quality. If the threshold value is adjusted, the first transport layer protocol in the plurality of transport layer protocols is determined according to the comparison between the adjusted threshold value and the network quality.
[0128] For example, when the congestion control algorithm is Cubic, because Cubic is poor in anti-weak network capability, a larger threshold is set, the threshold of the transmission layer protocol switching is raised, a stricter switching standard is used to select the transmission layer protocol used for transmitting data, so that the client is more likely to perform transmission layer protocol switching, and the time length of the client obtaining data from the server is shortened. In the case of good network quality such as high bandwidth, small packet loss rate, and short round-trip time, the client selects TCP from multiple transmission layer protocols, and requests the server to transmit data to the client based on TCP; in the case of poor network quality such as low bandwidth, large packet loss rate, and long round-trip time, the client selects QUIC from multiple transmission layer protocols, and requests the server to transmit data to the client based on QUIC. If the threshold is large, the threshold does not need to be adjusted, and if the threshold is small, the threshold can be increased.
[0129] Understandably, because the time length of the client obtaining data from the server based on QUIC is shorter than the time length of the client obtaining data from the server based on TCP in the case of poor network quality, when the congestion control algorithm is Cubic, a larger threshold is set to make the client more likely to select QUIC, and the client obtains data from the server based on QUIC, which can effectively shorten the time length of the client obtaining data from the server and improve the data transmission rate of the client obtaining data from the server.
[0130] The threshold can refer to an evaluation threshold of network quality, and provides a standard for transmission layer protocol switching based on network quality. Because the threshold is large, in the case of slightly poor network quality, such as slightly decreased bandwidth, slightly smaller packet loss rate, and slightly increased RTT, the client can request the server to transmit data to the client based on QUIC.
[0131] For example, as shown in (a) of FIG. 4, in the case of the client requesting the server to transmit data to the client based on TCP, the client determines that the congestion control algorithm is Cubic, and when the network quality is slightly poor, the client switches TCP to QUIC and requests the server to transmit data to the client based on QUIC.
[0132] When the congestion control algorithm is a bottleneck bandwidth and round-trip time (BBR) based congestion control algorithm, since the BBR has strong anti-weak network capability, a smaller threshold is set, the threshold of the transmission layer protocol switching is reduced, and a wider switching standard is used to select the transmission layer protocol used for transmitting data, so that the client obtains data from the server for a shorter time. In the case of poor network quality such as low bandwidth, high packet loss rate, and long round-trip time, the threshold is adjusted, such as being reduced. For example, when the client determines the first transmission layer protocol in the plurality of transmission layer protocols according to the comparison result of the network quality and the first threshold, and the congestion control algorithm is BBR, the first threshold is adjusted to a second threshold, and the first transmission layer protocol in the plurality of transmission layer protocols is determined according to the comparison result of the network quality and the second threshold. The second threshold is smaller than the first threshold, which means that the standard of switching the transmission layer protocol is lowered, so that the client flexibly switches the plurality of transmission layer protocols configured by the client according to the real-time network quality, shortens the time of obtaining data from the server, and improves the data transmission rate of obtaining data from the server.
[0133] It can be understood that, since the BBR has strong anti-weak network capability, the time of obtaining data from the server based on TCP by the client may still be short in the case of poor network quality. In the case of very poor network quality, such as very small bandwidth, very high packet loss rate, and very long RTT, the client selects QUIC and obtains data from the server based on QUIC, which can effectively shorten the time of obtaining data from the server and improve the data transmission rate of obtaining data from the server. Avoiding frequent transmission layer protocol switching of the client, wasting computing resources and increasing power consumption.
[0134] For example, as shown in (b) of FIG. 4, in the case that the client requests the server to transmit data to the client based on TCP, the client determines that the congestion control algorithm is BBR, and when the network quality is very poor, the client switches TCP to QUIC and requests the server to transmit data to the client based on QUIC.
[0135] As can be seen from (a) and (b) of FIG. 4, when the congestion control algorithm is Cubic, the network quality is slightly reduced (for example, the packet loss rate is small, and the bandwidth is slightly reduced), the client is more likely to switch the transmission layer protocol, and the client obtains data from the server based on QUIC. When the congestion control algorithm is BBR, the network quality is significantly reduced (for example, the packet loss rate is large, and the bandwidth is significantly reduced), the client switches the transmission layer protocol, and the client obtains data from the server based on QUIC.
[0136] In some embodiments, the client receives the packets at different intervals because the server sends the packets at different intervals according to different congestion control algorithms. For example, the packet arrival intervals (or inter-packet intervals) of Cubic and BBR are different. The client can determine the congestion control algorithm used by the server according to the packet arrival intervals of the server to the client, i.e., the client can perceive the congestion control algorithm used by the server according to the packet arrival intervals of the server to the client.
[0137] For example, the client collects the timestamps of the packet arrivals, determines the packet arrival intervals according to the difference between the timestamps of two packet arrivals, and determines the congestion control algorithm according to whether the packet arrival interval is close to or far from a packet arrival interval threshold. For example, the packet arrival interval is close to the packet arrival interval threshold, and the congestion control algorithm is BBR. For example, the packet arrival interval is far from the packet arrival interval threshold, and the congestion control algorithm is Cubic. The packet arrival interval threshold can be obtained according to the RTT and the number of packets received within the RTT.
[0138] In some other embodiments, the client can determine the congestion control algorithm used by the server according to the number of packets sent within the RTT because the number of packets sent within the RTT is different when the server sends the packets according to different congestion control algorithms.
[0139] For example, the client can call the API to obtain the network characteristics between the client and the server, and determine the packet arrival interval or the number of packets sent within the RTT according to the network characteristics.
[0140] For example, the threshold is pre-configured as 60. Assuming that the client requests data from the server, and the server transmits data to the client based on TCP. The client obtains the current network quality according to the network characteristics, compares the current network quality with the threshold 60, and determines whether to switch the transport layer protocol based on whether the current network quality is greater than or equal to the threshold. For example, the current network quality is greater than or equal to the threshold, and the client does not need to switch the transport layer protocol, and requests the server to transmit data to the client based on TCP. For example, the current network quality is less than the threshold, and the client switches the transport layer protocol TCP to QUIC, and requests the server to transmit data to the client based on QUIC.
[0141] Optionally, the client perceives that the congestion control algorithm is Cubic, does not need to modify the threshold, and compares the current network quality with the threshold 60. The client perceives that the congestion control algorithm is BBR, modifies the threshold to 40, and compares the current network quality with the threshold 40. For example, the current network quality is greater than or equal to the threshold, and the client does not need to switch the transport layer protocol, and requests the server to transmit data to the client based on TCP. For example, the current network quality is less than the threshold, and the client switches the transport layer protocol TCP to QUIC, and requests the server to transmit data to the client based on QUIC.
[0142] For another example, assuming that the client requests data from the server, and requests the server to transmit data to the client based on QUIC. The client obtains the current network quality according to the network characteristics, compares the current network quality with the threshold 60, and the current network quality is greater than or equal to the threshold, indicating that the network quality is good, and the transport layer protocol QUIC is switched to TCP, and the server is requested to transmit data to the client based on TCP. The current network quality is less than the threshold, indicating that the network quality is poor, and the transport layer protocol does not need to be switched, and the server is requested to transmit data to the client based on QUIC.
[0143] The client perceives that the congestion control algorithm is Cubic, and does not need to modify the threshold, and compares the current network quality with the threshold 60. The client perceives that the congestion control algorithm is BBR, and modifies the threshold to 40, compares the current network quality with the threshold 40, and the current network quality is greater than or equal to the threshold, and the transport layer protocol QUIC is switched to TCP, and the server is requested to transmit data to the client based on TCP; the current network quality is less than the threshold, and the transport layer protocol does not need to be switched, and the server is requested to transmit data to the client based on QUIC.
[0144] The data transmission method provided in the application does not need to pre-configure the transport layer protocol used by the client to request data from the server, and the client can call the API to select a transport layer protocol from a plurality of transport layer protocols according to the network quality between the client and the server. That is, when the client requests data from the server using the API provided in the application, the client can dynamically select the transport layer protocol used by the client to request data from the server, such as selecting TCP or QUIC protocol to request data from the server. Understandably, when the client requests data from the server again after the client requests data from the server based on TCP last time, QUIC is selected from a plurality of transport layer protocols according to the network quality between the client and the server, and the server is requested to transmit data to the client based on QUIC. For another example, when the client requests data from the server again after the client requests data from the server based on QUIC last time, TCP is selected from a plurality of transport layer protocols according to the network quality between the client and the server, and the server is requested to transmit data to the client based on TCP. Then the client can flexibly select TCP and QUIC protocol, realize switching from TCP to QUIC, and also switch from QUIC to TCP. The direction of switching of the plurality of transport layer protocols is not limited in the application. Therefore, the appropriate transport layer protocol is selected based on the network quality, so that the client can obtain data from the server as soon as possible, effectively shorten the time length of the client obtaining data from the server, and improve the data transmission rate of the client obtaining data from the server.
[0145] Step 320, the client sends a first request to the server.
[0146] After the client determines the first transport layer protocol used to request the first data, the client sends a first request to the server, the first request including information of the first transport layer protocol. For example, the first request includes an identification of the first transport layer protocol. The identification of the first transport layer protocol can be set in a packet header. The specific setting position of the identification of the first transport layer protocol can refer to the transport layer protocol specification. Optionally, the first request can also include a request method, a request target and a protocol version.
[0147] The request method indicates an action that the client hopes the server to perform, such as GET, POST or PUT, etc. The GET request is used to obtain data from the server. The POST request is used to send data to the server to create a new resource or modify the state of an existing resource. The PUT request is also used to send data to the server, but PUT is different from POST. The PUT request is used to modify an existing resource.
[0148] The request target represents a uniform resource locator (URL) path of a resource that the client hopes to access.
[0149] The protocol version specifies the HTTP protocol version used.
[0150] Step 330, the server sends a first response to the client.
[0151] After the server receives the first request, the server transmits the first data to the client based on the first transport layer protocol. For example, the server sends a first response to the client, the first response including the first data transmitted based on the first transport layer protocol.
[0152] For example, the first request includes an identification of TCP, and the server transmits the first data based on TCP. The first request includes an identification of QUIC, and the server transmits the first data based on QUIC.
[0153] Step 340, the client receives the first response sent by the server.
[0154] The client receives the first response sent by the server, and obtains the first data requested by the client.
[0155] Compared with using only one transport layer protocol (such as TCP or QUIC) to transmit data, the time length of the client obtaining data from the server can be longer. The data transmission method provided in the application is that the client selects a transport layer protocol from a plurality of transport layer protocols configured by the client according to the network quality between the client and the server by calling an API, and instructs the server to transmit data based on the selected transport layer protocol, that is, the network quality is adaptively selected to select the transport layer protocol used for transmitting data, so that the client obtains the required data from the server as soon as possible. That is, when the client uses the API provided in the application, the transport layer protocol used by the client to request data from the server can be dynamically selected, the plurality of transport layer protocols configured by the client are flexibly switched according to the network quality, and the selected transport layer protocol is used to request data from the server. Therefore, the time length of the client obtaining data from the server can be effectively shortened, the data transmission rate of the client obtaining data from the server is improved, and the problem that the time length of the client obtaining data from the server is longer and the data transmission rate is lower based on one transport layer protocol for transmission under different network qualities is avoided.
[0156] It should be noted that after receiving the first response sent by the server, when the client requests second data from the server, a second transport layer protocol in the plurality of transport layer protocols can be determined according to the switching strategy; a second request is sent to the server, the second request including information of the second transport layer protocol; a second response sent by the server is received, the second response including second data transmitted based on the second transport layer protocol.
[0157] In some embodiments, when the client requests data from the server, an API is called, and one transport layer protocol in the plurality of transport layer protocols is determined according to the switching strategy; or after the client receives the response, an API is called, one transport layer protocol in the plurality of transport layer protocols is determined according to the switching strategy, and the determined transport layer protocol is stored, so that when the client initiates a data request again, the determined transport layer protocol is directly used.
[0158] For example, FIG. 5 is a flowchart of another data transmission method provided in the application. The flowchart of the client requesting first data from the server and the client requesting second data from the server is shown.
[0159] When the client initiates a data request, an API is called to select a default transport layer protocol or a transport layer protocol according to network quality, and a first request is sent to the server. After the client receives a first response fed back by the server, the first data is fed back to the application. Then, the client acquires flow information according to the received message, for example, acquires network characteristics such as packet loss rate, bandwidth, round-trip delay, acquires network quality and congestion control algorithm according to the network characteristics, and selects a transport layer protocol according to the network quality and the congestion control algorithm. If the network quality is good, there is no need to switch the transport layer protocol, and if the network quality is poor, the transport layer protocol is switched, and the stored transport layer protocol used for transmitting data is updated, so that when the client requests data again, the determined transport layer protocol is directly used.
[0160] When the client initiates a data request again, the transport layer protocol that can be used is acquired from the storage medium, and data is requested from the server. As shown in FIG. 5, when the client initiates a data request again, the determined transport layer protocol is acquired, that is, the determined transport layer protocol that can be used is acquired from the storage medium, second data is requested from the server, and the second data transmitted by the server based on the determined transport layer protocol acquired by the client is acquired.
[0161] Alternatively, after the client receives the first response fed back by the server, the transport layer protocol used by the client when requesting data again can also be determined without calculation. When the client initiates a data request again, the client calls an API to acquire flow information, for example, acquires network characteristics such as packet loss rate, bandwidth, round-trip delay, acquires network quality and congestion control algorithm according to the network characteristics, determines whether to switch the transport layer protocol according to the network quality and the congestion control algorithm, and determines the transport layer protocol used for requesting data from the server. For example, as shown in FIG. 6, when the client initiates a data request again, an API is called to acquire network quality and congestion control algorithm in real time, a transport layer protocol is selected according to the network quality and the congestion control algorithm, second data is requested from the server according to the selected transport layer protocol, and the second data transmitted by the server based on the determined transport layer protocol acquired by the client is acquired.
[0162] The method of selecting a transport layer protocol according to network quality and congestion control algorithm can refer to the description of the above embodiments, and will not be described here.
[0163] In other embodiments, in the case that the network quality between the client and the server is extremely low, for example, the packet loss rate is large, the bandwidth is narrow, the RTT is large, the client uses the QUIC protocol to request data, and the duration of the client acquiring data from the server is still long, the client uses the UDP to request data from the server.
[0164] The number of times of switching the transport layer protocol is not limited in the present application. The client determines whether to switch the transport layer protocol used for transmitting data according to network quality.
[0165] In addition, the data (e.g., the first data, the second data) requested by the client from the server according to the embodiments of the present application can include data related to an application, which is any one of a plurality of applications installed on the client, such as an instant messaging application, a web application, and the like. The client runs the application, and can invoke an API, i.e., automatically selects one of the plurality of transport layer protocols to be used for transmitting data from the plurality of transport layer protocols according to a switching policy, and transmits data to the server according to the selected transport layer protocol.
[0166] It can be understood that, in order to implement the functions in the above-described embodiments, the client and the server (e.g., a storage server) include hardware structures and / or software modules corresponding to the respective functions. Those skilled in the art should easily understand that, in combination with the units and method steps of the examples described in the embodiments disclosed in the present application, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is implemented in the form of hardware or computer software driving hardware depends on the specific application scenario and design constraints of the technical solution.
[0167] The data transmission method according to the embodiments of the present application is described in detail above in combination with FIGS. 1 to 6. The apparatuses according to the embodiments of the present application will be described below in combination with FIG. 7. These apparatuses can be used to implement the functions of the client in the above-described method embodiments, and thus can also achieve the beneficial effects possessed by the above-described method embodiments. In the present embodiment, the apparatus can be a device as shown in FIG. 2, and can also be a module (e.g., a chip) applied to the client.
[0168] As shown in FIG. 7, the data transmission apparatus 700 includes a communication module 710, a processing module 720, and a storage module 730. The data transmission apparatus 700 is used to implement the functions of the client in the above-described method embodiment shown in FIG. 3.
[0169] The processing module 720 is configured to invoke an API and determine a first transport layer protocol from a plurality of transport layer protocols according to a switching policy. The switching policy is used to indicate that the transport layer protocol used for the client to request data from the server is selected from the plurality of transport layer protocols based on network quality between the client and the server. The API is used to select the transport layer protocol used for the client to request data from the server according to the switching policy. For example, the processing module 720 is configured to perform step 310 in FIG. 3.
[0170] The communication module 710 is configured to send a first request to the server, and the first request includes information of the first transport layer protocol. For example, the communication module 710 is configured to perform step 320 in FIG. 3.
[0171] The communication module 710 is further configured to receive a first response sent by the server, the first response comprising first data transmitted based on a first transport layer protocol. For example, the communication module 710 is configured to perform step 340 in FIG. 3.
[0172] Optionally, the processing module 720 is configured to invoke an API to obtain a network quality between the client and the server, and determine the first transport layer protocol from the plurality of transport layer protocols according to the network quality.
[0173] Optionally, the processing module 720 is configured to invoke an API to obtain a network characteristic between the client and the server, and determine the network quality according to the network characteristic between the client and the server.
[0174] The storage module 730 is configured to store the plurality of transport layer protocols, the network characteristic, and the like, so as to facilitate the client to select a transport layer protocol for requesting data from the server.
[0175] It should be understood that the data transmission apparatus 700 of the embodiments of the present application can be implemented by an application-specific integrated circuit (ASIC) or a programmable logic device (PLD), which can be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof. When the data transmission method shown in FIG. 3 is implemented by software, each module thereof can also be a software module, and the data transmission apparatus 700 and each module thereof can also be a software module.
[0176] When the data transmission method shown in FIG. 3 is implemented by hardware, each module thereof can also be a hardware module, and the data transmission apparatus 700 and each module thereof can also be a hardware module.
[0177] The data transmission apparatus 700 according to the embodiments of the present application can correspond to the method described in the embodiments of the present application, and the above and other operations and / or functions of each unit in the data transmission apparatus 700 are respectively for implementing the corresponding flow of each method in FIG. 3, and for brevity, will not be repeated here.
[0178] FIG. 8 is a structural schematic diagram of a computer device 800 provided in the present application. As shown in FIG. 8, the computer device 800 includes a processor 810, a bus 820, a memory 830, a communication interface 840, and a memory unit 850 (which can also be referred to as a main memory unit). The processor 810, the memory 830, the memory unit 850, and the communication interface 840 are connected through the bus 820.
[0179] It should be understood that, in the present embodiment, the processor 810 can be a CPU, and the processor 810 can also be other general-purpose processors, digital signal processors (DSPs), ASICs, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and the like. The general-purpose processor can be a microprocessor or any conventional processor, and the like.
[0180] The processor can also be a graphics processing unit (GPU), a neural network processing unit (NPU), a microprocessor, an ASIC, or one or more integrated circuits for controlling program execution of the solutions of the present application.
[0181] The communication interface 840 is configured to realize communication between the computer device 800 and external devices or apparatuses. In the present application, when the computer device 800 is configured to realize the function of the client shown in FIG. 3, the communication interface 840 is configured to send a request and receive data. When the computer device 800 is configured to realize the function of the client shown in FIG. 3, the processor 810 is configured to call an API and select a first transport layer protocol from a plurality of transport layer protocols according to a switching strategy. The communication interface 840 is configured to send a first request to a server, the first request including information of the first transport layer protocol, and receive a first response sent by the server, the first response including first data transmitted based on the first transport layer protocol.
[0182] Bus 820 can include a pathway that carries information between the aforementioned components (e.g., processor 810, memory unit 850, and storage 830). Bus 820 can include, in addition to a data bus, a power bus, a control bus, and a state signal bus, among others. However, for clarity, the various buses are referred to as bus 820 in the figure. Bus 820 can be a Peripheral Component Interconnect Express (PCIe) bus, or an extended industry standard architecture (EISA) bus, a unified bus (Ubus or UB), a compute express link (CXL), a cache coherent interconnect for accelerators (CCIX), among others. Bus 820 can be divided into an address bus, a data bus, a control bus, among others.
[0183] As an example, computer device 800 can include multiple processors. The processors can be a multi-CPU processor. A processor here can refer to one or more devices, circuits, and / or computing units for processing data (e.g., computer program instructions).
[0184] It is worth noting that in FIG. 8, only an example is taken that computer device 800 includes 1 processor 810 and 1 storage 830, and here, processor 810 and storage 830 are respectively used to indicate a type of device or equipment. In specific embodiments, the number of each type of device or equipment can be determined according to business needs.
[0185] The memory unit 850 can be a pool of volatile memory or a pool of non-volatile memory, or can include both volatile and non-volatile memory. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable ROM (PROM), an erasable PROM (EPROM), an electrically EPROM (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM) used as an external cache. By way of example and not limitation, many forms of RAM can be used, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchlink DRAM (SLDRAM), and direct rambus RAM (DR RAM). The memory unit 850 is used to store a plurality of transport layer protocols, network features, etc.
[0186] The memory 830 can correspond to the storage medium used to store a plurality of transport layer protocols, network features, computer instructions, etc. in the above-mentioned method embodiments, for example, a magnetic disk such as a mechanical hard disk or a solid state disk.
[0187] The above-mentioned computer device 800 can be a general-purpose device or a special-purpose device. For example, the computer device 800 can be an edge device (for example, a box carrying a chip with processing capability) and the like. Alternatively, the computer device 800 can also be a server or other device with computing capability.
[0188] It should be understood that the computer device 800 according to the present embodiment can correspond to the data transmission apparatus 700 in the present embodiment, and can correspond to performing the corresponding subject matter according to any one of the methods in FIG. 3, and the above-mentioned and other operations and / or functions of each module in the data transmission apparatus 700 are respectively for realizing the corresponding flow of each method in FIG. 3, and for the sake of brevity, will not be repeated here.
[0189] The steps of the method in the embodiments can be implemented by hardware, or by a combination of software and hardware. The software instructions can be composed of one or more pieces of software modules. The software modules can be stored in any suitable storage medium or device, such as a random access memory (RAM), a flash memory, a read-only memory (ROM), a programmable ROM (PROM), an erasable PROM (EPROM), an electrically EPROM (EEPROM), a register, a hard disk, a floppy disk, a CD-ROM, or any other form of storage medium known in the art. An exemplary storage medium is coupled to a processor, such that the processor can read information from, and write information to, the storage medium. Of course, the storage medium can be a component of the processor. The processor and the storage medium can be located in an ASIC. The ASIC can be located in a computing device. Of course, the processor and the storage medium can also be present as discrete components in a computing device.
[0190] The application also provides a chip system, which comprises a processor and a power supply circuit. The power supply circuit is configured to supply power to the processor. The processor is configured to execute the operation steps of the method in the possible implementation manners of the above embodiments.
[0191] In the above embodiments, all or part of the embodiments can be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer programs or instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present application are performed. The computer can be a general purpose computer, a special purpose computer, a computer network, a network device, a user equipment or other programmable apparatus. The computer programs or instructions can be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer programs or instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center through wired or wireless manner. The computer readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center and the like integrated with one or more available media. The available media can be a magnetic medium, for example, a floppy disk, a hard disk, a magnetic tape; or an optical medium, for example, a digital video disc (digital video disc, DVD); or a semiconductor medium, for example, a solid state disk (solid state drive, SSD). The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto, any person skilled in the art can easily think of various equivalent modifications or replacements within the technical range disclosed in the present application, and these modifications or replacements should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A data transmission method, characterized in that, include: The API is invoked to determine the first transport layer protocol among multiple transport layer protocols based on a switching strategy. The switching strategy is used to indicate the transport layer protocol used by the client to request data from the server based on the network quality between the client and the server. The API is used to select the transport layer protocol used by the client to request data from the server according to the switching strategy. Send a first request to the server, the first request including information of the first transport layer protocol; Receive a first response sent by the server, the first response including first data transmitted based on the first transport layer protocol.
2. The method according to claim 1, characterized in that, The client's operating system includes the API; The application programming interface (API) is invoked to determine the first transport layer protocol among multiple transport layer protocols based on the switching strategy, including: Call the API to obtain the network quality between the client and the server; The first transport layer protocol among the plurality of transport layer protocols is determined based on the network quality.
3. The method according to claim 2, characterized in that, Calling the API to obtain the network quality between the client and the server includes: Call the API to obtain the network characteristics between the client and the server; The network quality is determined based on the network characteristics between the client and the server.
4. The method according to claim 3, characterized in that, The network characteristics include at least one of packet loss rate, bandwidth, or round-trip time (RTT).
5. The method according to any one of claims 2-4, characterized in that, The switching strategy indicates that one of the multiple transport layer protocols is determined based on a comparison of network quality and thresholds. Determining the first transport layer protocol among the plurality of transport layer protocols based on the network quality includes: The first transport layer protocol among the plurality of transport layer protocols is determined based on the comparison result between the network quality and the first threshold.
6. The method according to any one of claims 1-5, characterized in that, The application programming interface (API) is invoked to determine the first transport layer protocol among multiple transport layer protocols based on the switching strategy, including: When the client requests the first data from the server, it calls the API to determine the first transport layer protocol among the multiple transport layer protocols according to the switching strategy.
7. The method according to any one of claims 1-6, characterized in that, The first transport layer protocol among multiple transport layer protocols is determined according to the switching strategy, including: The first transport layer protocol among the plurality of transport layer protocols is determined based on the network quality and the congestion control method used by the server.
8. The method according to claim 7, characterized in that, The switching strategy indicates that the threshold is adjusted according to the congestion control method, and one of the multiple transport layer protocols is determined based on the comparison result of network quality and the threshold. The first transport layer protocol among the plurality of transport layer protocols is determined based on the network quality and the congestion control method used by the server, including: Determine whether to adjust the first threshold based on the congestion control algorithm used by the server; When there is no need to adjust the first threshold, the first transport layer protocol among multiple transport layer protocols is determined based on the comparison result between the network quality and the first threshold. When the first threshold is adjusted to the second threshold, the first transport layer protocol among multiple transport layer protocols is determined based on the comparison result between the network quality and the second threshold; the second threshold is less than the first threshold.
9. The method according to claim 8, characterized in that, The first transport layer protocol among the plurality of transport layer protocols is determined based on the network quality and the congestion control algorithm used by the server, including: When the congestion control algorithm is Cubic, the first transport layer protocol among the plurality of transport layer protocols is determined based on the comparison result between the network quality and the first threshold. When the congestion control algorithm is BBR, the first threshold is adjusted to the second threshold, and the first transport layer protocol among the plurality of transport layer protocols is determined based on the comparison result between the network quality and the second threshold.
10. The method according to any one of claims 7-9, characterized in that, The method further includes: The congestion control algorithm used by the server is determined based on the message information received by the client, wherein the message information includes at least one of the changes in the number of received messages within the message interval or round-trip time.
11. The method according to any one of claims 1-10, characterized in that, After receiving the first response sent by the server, the method further includes: The API is invoked to determine the second transport layer protocol among the plurality of transport layer protocols according to the switching strategy; Send a second request to the server, the second request including information of the second transport layer protocol; Receive a second response from the server, the second response including second data transmitted based on the second transport layer protocol.
12. The method according to any one of claims 1-11, characterized in that, The data requested by the client from the server includes data related to a first application, which is any one of the multiple applications installed by the client.
13. The method according to any one of claims 1-12, characterized in that, The multiple transport layer protocols include Transmission Control Protocol (TCP) and Fast User Datagram Protocol (QUIC) for network connectivity.
14. A data transmission device, characterized in that, Includes modules for performing the operational steps of the method as described in any one of claims 1 to 13.
15. A chip system, characterized in that, The chip system includes a processor and a power supply circuit, the power supply circuit being used to supply power to the processor, the processor being used to perform the operational steps of the method as described in any one of claims 1 to 13.
16. A computer device, characterized in that, The computer device includes a processor and memory; The processor is configured to execute instructions stored in the memory to cause the computing device to perform the operational steps of the method as described in any one of claims 1 to 13.
17. A communication system, characterized in that, It includes a client and a server; the client includes a processor and memory. The processor is configured to execute instructions stored in the memory to cause the client to perform the operational steps of the method as described in any one of claims 1 to 13 to obtain data from the server.
18. A computer program product containing instructions, characterized in that, When the instruction is executed by the client, the client performs the operational steps of the method as described in any one of claims 1 to 13.
19. A computer-readable storage medium, characterized in that, It includes computer program instructions, which, when executed by a client, cause the client to perform the operational steps of the method as described in any one of claims 1 to 13.
Citation Information
Patent Citations
Self-adaption method on basis of TCP (Transmission Control Protocol) and UDP (User Datagram Protocol) transmission supported by streaming media
CN103078831A
Data transmission method and related equipment
CN114844960A
Device for obtaining content by choosing the transport protocol according to the available bandwidth
US20140330887A1
Methods and Apparatuses for Establishing a Transport Protocol Connection
US20240121329A1