Data transmission method, device, computer equipment, storage medium and product
By directly sending session description information through a connectionless transmission protocol, the data transmission delay problem caused by complex connections in WebRTC is solved, and fast data acquisition and low-latency audio and video communication are achieved.
Patent Information
- Application Number
- CN202210168889.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-23
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2042-02-23
AI Technical Summary
In the existing technology, during the real-time audio and video communication process based on WebRTC, the connection between the client and the server or between the clients is complex, resulting in large data transmission delays. Multiple round trips are required to establish a connection, which takes a long time.
Send session description information through a connectionless transmission protocol (such as UDP), directly establish a communication channel, obtain target data, and reduce the connection establishment process.
It improves the data acquisition speed and reduces the data transmission delay, especially in the field of live video and video communication, reduces the delay in the start of the first frame of video and avoids the black screen phenomenon on the client.
Smart Images

Figure CN116684459B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and specifically to a data transmission method, apparatus, computer equipment, storage medium and product, wherein the storage medium is a computer-readable storage medium and the product is a computer program product. Background Art
[0002] Clients that provide real-time audio and video communication functions can usually implement these functions based on standard Web Real-Time Communication (WebRTC) technology. Based on standard WebRTC, the connection process between the client and the server, or between clients, is complex. It is necessary to first connect through the Transmission Control Protocol (TCP), then send a request for interactive signaling through the Hypertext Transfer Protocol (HTTP), and then establish a communication channel between the client and the server, or between clients, through interactive connectivity. Then, keys are exchanged through the Datagram Transport Layer Security (DTLS) protocol, and then data transmission begins. At this point, the client can obtain data from the server or other clients.
[0003] Due to the complexity of the connection process, multiple round trips of information are required between the client and the server, or between clients, to establish a connection. The connection between the client and the server, or between clients, is slow, and it takes a long time to start data transmission, resulting in large data transmission delays. Summary of the Invention
[0004] The embodiments of the present application provide a data transmission method, apparatus, computer equipment, storage medium and product, which can increase the speed of data acquisition and reduce data transmission delay.
[0005] An embodiment of the present application provides a data transmission method, including:
[0006] In response to the data acquisition instruction, sending first session description information of the communication client to the data association device via a connectionless transmission protocol;
[0007] Acquire second session description information sent by the data association device through the connectionless transmission protocol based on the first session description information, and first data in the target data required by the data acquisition instruction;
[0008] establishing a communication channel between the communication client and the data association device according to the second session description information;
[0009] The second data in the target data sent by the data association device through the communication channel is received to respond to the data acquisition instruction based on the first data and the second data.
[0010] Accordingly, an embodiment of the present application further provides a data transmission device, including:
[0011] an instruction response unit, configured to send first session description information of the communication client to the data association device via a connectionless transmission protocol in response to the data acquisition instruction;
[0012] a first data acquisition unit, configured to acquire second session description information sent by the data association device through the connectionless transmission protocol based on the first session description information, and first data in the target data required by the data acquisition instruction;
[0013] an establishing unit, configured to establish a communication channel between the communication client and the data association device according to the second session description information;
[0014] The second data acquisition unit is configured to receive second data in the target data sent by the data association device through the communication channel, and respond to the data acquisition instruction based on the first data and the second data.
[0015] In one embodiment, the instruction response unit includes:
[0016] an information acquisition subunit, configured to acquire initial first session description information in response to the data acquisition instruction;
[0017] an encoding subunit, configured to encode the initial first session description information to obtain the first session description information;
[0018] The first information sending subunit is configured to send the first session description information to the data association device via the connectionless transmission protocol.
[0019] In one embodiment, the establishing unit includes:
[0020] a decoding subunit, configured to decode the second session description information to obtain initial second session description information;
[0021] The channel establishing subunit is configured to perform interactive connection establishment processing between the communication client and the data association device according to the initial second session description information, so as to establish the communication channel.
[0022] In one embodiment, the channel establishing subunit includes:
[0023] a negotiation submodule, configured to perform session negotiation based on the media information in the initial second session description information, and determine session attribute information for communication between the data association device and the client;
[0024] a communication channel establishing submodule, configured to establish a communication channel with the data association device according to the communication address information in the initial second session description information;
[0025] The second data acquisition unit is further configured to:
[0026] Second data sent by the data association device through the communication channel based on the session attribute information is received.
[0027] In one embodiment, the communication client includes a web instant messaging subroutine and a signaling transmission subroutine, and the instruction response unit includes:
[0028] an acquiring subunit, configured to receive, in response to the data acquiring instruction, the initial first session description information sent by the web instant messaging subprogram via the signaling transmission subprogram;
[0029] an encoding processing subunit, configured to encode the initial first session description information through the signaling transmission subroutine to obtain the first session information;
[0030] The request sending subunit is configured to send a signaling interaction transmission request to a data association device based on the connectionless transmission protocol through the signaling transmission subroutine, wherein the signaling interaction transmission request carries the first session information.
[0031] In one embodiment, the second data acquisition unit includes:
[0032] a backfill subunit, configured to backfill the first data to the web instant messaging subprogram;
[0033] a parsing and processing subunit, configured to perform data parsing on the first data and the second data through the web instant messaging subprogram to obtain processed data;
[0034] A response subunit is used to respond to the data acquisition instruction based on the processed data.
[0035] In one embodiment, the instruction response unit includes:
[0036] a query subunit, configured to query corresponding candidate data-associated devices in response to the data acquisition instruction;
[0037] a device determining subunit, configured to determine the data association device from the candidate data association devices;
[0038] The second information sending subunit is configured to send the first session description information to the data association device via the connectionless transmission protocol.
[0039] Correspondingly, an embodiment of the present application also provides a computer device, including a memory and a processor; the memory stores a computer program, and the processor is used to run the computer program in the memory to execute any data transmission method provided in the embodiment of the present application.
[0040] Accordingly, an embodiment of the present application further provides a computer-readable storage medium, which is used to store a computer program, and the computer program is loaded by a processor to execute any one of the data transmission methods provided in the embodiments of the present application.
[0041] Accordingly, an embodiment of the present application further provides a computer program product, including a computer program, which, when executed by a processor, implements any one of the data transmission methods provided in the embodiments of the present application.
[0042] In an embodiment of the present application, in response to a data acquisition instruction, first session description information of a communication client is sent to a data association device via a connectionless transmission protocol; second session description information sent by the data association device via the connectionless transmission protocol based on the first session description information, as well as first data in target data required by the data acquisition instruction, is acquired; a communication channel is established between the communication client and the data association device based on the second session description information; and second data in the target data sent by the data association device via the communication channel is received, so as to respond to the data acquisition instruction based on the first data and the second data.
[0043] This solution sends first session description information to the data association device via a connectionless transmission protocol. Since the connection transmission protocol provides a method for the communication client and the data association device to send data without establishing a connection, when the data association device receives the first session description information, it can return the first data. The communication client does not need to establish a communication channel with the data association device through round-trip information transmission to obtain the first data. Therefore, this solution can improve the speed of data acquisition and reduce data transmission delay. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0045] Figure 1 This is a scenario diagram of the data transmission method provided in an embodiment of the present application;
[0046] Figure 2 is a flowchart of a data transmission method provided in an embodiment of the present application;
[0047] Figure 3 Schematic diagram of a standard webpage instant messaging method provided by an embodiment of the present application;
[0048] Figure 4 is another flow chart of the data transmission method provided in an embodiment of the present application;
[0049] Figure 5 is a schematic diagram of a data transmission device provided in an embodiment of the present application;
[0050] Figure 6 It is a structural diagram of the computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0051] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without making creative efforts are within the scope of protection of this application.
[0052] The embodiments of the present application provide a data transmission method, apparatus, computer device, and computer-readable storage medium. The data transmission apparatus can be integrated into a computer device, which can be a server, a terminal, or other device.
[0053] The terminal may include a mobile phone, a wearable smart device, a tablet computer, a laptop computer, a personal computer (PC), and a vehicle-mounted computer.
[0054] Among them, the server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, as well as big data and artificial intelligence platforms.
[0055] For example, Figure 1 As shown, in response to a data acquisition instruction, the terminal sends first session description information of the communication client to the data association device through a connectionless transmission protocol; obtains second session description information sent by the data association device through the connectionless transmission protocol based on the first session description information, as well as first data in the target data required by the data acquisition instruction; establishes a communication channel between the communication client and the data association device according to the second session description information; receives second data in the target data sent by the data association device through the communication channel, and responds to the data acquisition instruction based on the first data and the second data.
[0056] This solution sends first session description information to the data association device via a connectionless transmission protocol. Since the connection transmission protocol provides a method for the communication client and the data association device to send data without establishing a connection, when the data association device receives the first session description information, it can return the first data. The communication client does not need to establish a communication channel with the data association device through round-trip information transmission to obtain the first data. Therefore, this solution can improve the speed of data acquisition and reduce data transmission delay.
[0057] It should be noted that the order of description of the following embodiments is not intended to limit the preferred order of the embodiments.
[0058] This embodiment will be described from the perspective of a data transmission device. The data transmission device may be integrated into a computer device, which may be a terminal or other device.
[0059] The embodiment of the present application provides a data transmission method, such as Figure 2 As shown, the specific process of the data transmission method can be as follows:
[0060] 101. In response to a data acquisition instruction, send first session description information of a communication client to a data association device via a connectionless transmission protocol.
[0061] Among them, the communication client may include a client that provides functions such as voice calls and video calls or live broadcasts.
[0062] The data association device may be a device that includes the target data required by the data acquisition instruction. For example, the data association device may be a server that has a specific communication connection with the communication client, or a terminal that has obtained the target data required by the data acquisition instruction from the server.
[0063] The first session description information may include information sent to the data association device for media negotiation based on the Session Description Protocol (SDP). The first session description information may include the media stream type of the communication client, the codec used by each media stream, and the IP and port to be used to receive the media stream.
[0064] The connectionless transmission protocol may also be referred to as the User Datagram Protocol (UDP). UDP provides a method for communication clients to send encapsulated data packets without establishing a connection.
[0065] The target data is the data required for data acquisition.
[0066] For example, the data acquisition instruction may be an instruction that can be triggered by a communication client. For example, a user may choose to make a video call with a contact in the communication client, and the data acquisition instruction is triggered in response to the user's operation.
[0067] In response to the data acquisition instruction, the requested target data is determined, and first session description information of the communication client is sent to the data association device based on a connectionless transmission protocol.
[0068] If the data-associated device is a server having a specific connection with the communication client, the first session description information of the communication client is sent to the server; if the data-associated device is a terminal that has obtained the target data required by the data acquisition instruction from the server, the first session description information of the communication client is sent to the terminal.
[0069] Optionally, to reduce the amount of data processing by the server, when a terminal has already obtained the data required by the data acquisition instruction from the server, data is preferentially acquired from the terminal. That is, the step of "sending the first session description information of the communication client to the data association device via the connectionless transmission protocol in response to the data acquisition instruction" may specifically include:
[0070] In response to the data acquisition instruction, querying the corresponding candidate data association device;
[0071] determining a data association device from candidate data association devices;
[0072] The first session description information is sent to the data association device through a connectionless transmission protocol.
[0073] The candidate data-associated devices may include devices storing target data required by the data acquisition instruction, such as a server having a specific communication connection with the communication client, and a terminal that has obtained the target data required by the data acquisition instruction from the server.
[0074] For example, specifically, in response to a data acquisition instruction, it may be queried whether there are other terminals that have acquired the target data required by the data acquisition instruction from the server. If so, the data-associated device is screened out from them; if not, the server is determined to be the data-associated device.
[0075] The first session description information is sent to the data association device through a connectionless transmission protocol.
[0076] Data-associated devices are screened out from multiple terminals that obtain target data. The terminal closest to the terminal or server where the communication client is located among the multiple terminals can be determined as the data-associated device. Optionally, the terminal with the strongest network signal among the multiple terminals that obtain the target data can be selected. Optionally, the number of devices with which the above-mentioned multiple terminals have established communication connections can be obtained, and the terminal with the smallest number can be determined as the data-associated device. The above-mentioned determination of the data-associated device can be performed independently by the computer device where the communication client is located, or can be performed with the assistance of a gateway server, which is not limited here.
[0077] By determining whether a terminal has obtained the target data from the server, if so, the first session description information is sent to the terminal to establish a communication connection with the terminal, and obtain the target data required for the data acquisition instruction from the terminal, instead of communicating with the server and obtaining the target data from the server, the requests received by the server can be reduced to reduce the request processing load of the server. The server usually needs to process a large number of requests at the same time, and the response speed will be affected. Obtaining target data from other terminals can increase the data acquisition speed and the response speed.
[0078] Optionally, the first session description information may be information obtained by encoding the initial first session description information, so that the first description information can be sent to the data association device in one transmission. That is, the step of "sending the first session description information of the communication client to the data association device through a connectionless transmission protocol in response to the data acquisition instruction" may specifically include:
[0079] Responding to the data acquisition instruction, acquiring initial first session description information;
[0080] Encoding the initial first session description information to obtain first session description information;
[0081] The first session description information is sent to the data association device through a connectionless transmission protocol.
[0082] For example, specifically, in response to a data acquisition instruction, initial first session description information is obtained, and encoding processing is performed on the initial first session description information. The encoding processing may include compression and other processing methods. For example, the initial first session description information is compressed by a table lookup or a compression method such as zlib, so as to compress the initial first session description information to the size of a maximum transmission unit (MTU) to obtain the first session description information.
[0083] In one embodiment, the communication client may include a web instant messaging subroutine and a signaling transmission subroutine. The web instant messaging subroutine may include a Web Real-Time Communication (WebRTC)-related program for establishing a communication channel with a data-related device. WebRTC is an audio and video technology that was open-sourced by Google and promoted for inclusion in the World Wide Web Consortium (W3C) and Internet Engineering Task Force (IETF) standards. It is designed to enable real-time audio and video communication between browsers in a peer-to-peer manner without the need for an intermediary. WebRTC not only supports real-time audio and video communication between browsers, but also between terminals and between terminals and servers. All web applications, as well as applications installed on terminals, terminals, and servers, can access WebRTC to achieve real-time audio and video communication. WebRTC can be applied in many scenarios, such as distance education, telemedicine, entertainment, gaming, office work, and the Internet of Things.
[0084] The signaling transmission subroutine may include a UDP-related program for sending first session description information to the data-associated device to establish a communication channel, and performing connectionless data transmission with the data-associated device before the communication channel is established. Therefore, the step of "sending the first session description information of the communication client to the data-associated device via a connectionless transmission protocol in response to the data acquisition instruction" may specifically include:
[0085] In response to the data acquisition instruction, receiving the initial first session description information sent by the web instant messaging subprogram through the signaling transmission subprogram;
[0086] Encoding the initial first session description information through a signaling transmission subroutine to obtain first session information;
[0087] A signaling interaction transmission request is sent to the data association device through a signaling transmission subroutine based on a connectionless transmission protocol, where the signaling interaction transmission request carries the first session information.
[0088] For example, specifically, in response to the data acquisition instruction, the initial first session description information sent by the web communication subroutine is received through the signaling transmission subroutine, and then the initial first session description is encoded to obtain the first session information, and a signaling interaction transmission request is sent to the data association device based on the connectionless transmission protocol. The signaling interaction transmission request is used to instruct the data association device to return the second session description information and the target data required by the data acquisition instruction based on the first session description information.
[0089] In one embodiment, the communication client may be a client providing a live broadcast function. A user enters a live broadcast room through the communication client. In response to entering the live broadcast room, the communication client triggers a signaling transmission subroutine to begin acquiring target data corresponding to the live broadcast room, thereby displaying the live broadcast content of the live broadcast room on the communication client. The signaling transmission subroutine triggers the web communication subroutine to send initial first session description information. The signaling transmission subroutine receives the initial first session description information sent by the web communication subroutine, compresses the first session description information, and then sends the first session description information to the server based on UDP.
[0090] 102. Acquire, by the data association device, second session description information sent through a connectionless transmission protocol based on the first session description information, and first data in target data required by the data acquisition instruction.
[0091] The second session description information may include information for media negotiation sent by the data association device based on SDP. The second session description information may include the media stream type of the data association device, the encoding set used by each media stream, and the IP and port to be used to receive and send the media stream.
[0092] The first data may be part of the target data.
[0093] Since UDP provides a method for sending data without establishing a connection, after receiving the first session description information, the data association device can return the second session description information for establishing a communication channel between the communication client and the data association device, and return the first data in the target data required by the data acquisition instruction.
[0094] Compared with the traditional WebRTC connection standard, in the embodiment of the present application, the data association device can transmit the target data required for the data acquisition instruction before establishing a communication connection with the data association device, and the data transmission delay is small.
[0095] 103. Establish a communication channel between the communication client and the data association device according to the second session description information.
[0096] The communication channel may include a path for data transmission between the communication client and the data association device.
[0097] For example, the IP address and port number of the data association device may be determined according to the second session description information, and a communication channel may be established between the communication client and the data association device according to the IP address and port.
[0098] In one embodiment, the first session description information is information obtained by encoding. Accordingly, the second session description information may be information obtained by encoding the initial second session description information. When the second session description information is received, decoding may be performed first, and then a communication channel may be established based on the decoded second session description information. That is, the step of "establishing a communication channel between the client and the data association device based on the second session description information" may specifically include:
[0099] Decoding the second session description information to obtain initial second session description information;
[0100] An interactive connection establishment process is performed between the communication client and the data association device according to the initial second session description information to establish a communication channel.
[0101] For example, before sending data through UDP, the communication client and the data association device may encode the data and compress the data to an MTU size before sending it. Therefore, when the communication client receives the second session description information sent by the data association device, it decodes the second session description information according to the encoding method to obtain the initial second session description information.
[0102] According to information such as the IP address and port number in the initial second session description information, an interactive connectivity establishment process is performed between the communication client and the data association device based on an Interactive Connectivity Establishment (ICE) transmission protocol to establish a communication channel between the communication client and the data association device.
[0103] The first session description information and the second session description information may include information such as the name and purpose of the session, session lifetime, media type, transmission protocol, media format, IP address, and port number. Media capability negotiation and establishment of a communication channel between the communication client and the data association device may be performed based on the first session description information and the second session description information. That is, in one embodiment, the step of "performing interactive connectivity establishment processing based on the initial second session description information to establish a communication channel between the client and the data association device" may specifically include:
[0104] Performing session negotiation based on the media information in the initial second session description information to determine session attribute information for communication between the data association device and the client;
[0105] establishing a communication channel with the data association device according to the communication address information in the initial second session description information;
[0106] Receive data sent by the data association device through the communication channel, including:
[0107] The receiving data association device sends data based on session attribute information through the communication channel.
[0108] The media information may include the name and purpose of the session, session lifetime, media type, transmission protocol, and media format.
[0109] The session attribute information may include the name and purpose of the session, the two parties in the session, and the media type.
[0110] For example, a session may refer to an Internet call, a conference call, a video chat, or watching a live broadcast. Based on the media information in the second session description information, session negotiation may be performed with the data-associated device to determine session attribute information for data transmission between the communication client and the data-associated device, thereby resolving a capability imbalance between the communication client and the data-associated device participating in the session. Furthermore, based on the communication address information in the second session description information, a communication channel may be established between the communication client and the data-associated device. For example, the communication channel between the communication client and the data-associated device may be established using Network Address Translation (NAT) traversal technology, or using the ICE transport protocol.
[0111] 104. Receive second data in the target data sent by the data association device through the communication channel, and respond to the data acquisition instruction based on the first data and the second data.
[0112] The second data is part of the target data, the target data may include first data and second data, the first data is part of the target data transmitted based on UDP, and the second data is part of the target data transmitted through the communication channel.
[0113] For example, it may be to receive the second data and respond to the data acquisition instruction based on the first data and the second data. If the data acquisition instruction is triggered by the user entering the live broadcast room, the live video screen corresponding to the live broadcast room can be displayed on the communication client based on the first data and the second data.
[0114] In one embodiment, the target data may be media data transmitted based on the Real-time Transport Protocol (RTP) and the Real-time Control Protocol (RTCP). The first data and the second data may be parsed and processed by the web instant messaging subroutine to obtain data decodable by the communication client and then respond to the data acquisition instruction. That is, the step of "responding to the data acquisition instruction based on the first data and the second data" may specifically include:
[0115] Backfilling the first data to the web page instant messaging subroutine;
[0116] Performing data analysis on the first data and the second data through the webpage instant messaging subroutine to obtain processed data;
[0117] Respond to the data acquisition instruction based on the processed data.
[0118] For example, since the web instant messaging subroutine can parse and process the first data and the second data, the first data transmitted through the UDP protocol is backfilled to the web instant messaging subroutine, so that the web instant messaging subroutine can parse and process the first data to obtain processed data. The communication channel is established by the web instant messaging subroutine, so the second data transmitted through the communication channel can be obtained through the instant messaging subroutine, and the second data can be parsed and processed to obtain processed data.
[0119] Respond to the data acquisition instruction based on the processed data.
[0120] like Figure 3 As shown in the figure, the standard WebRTC connection process is as follows: the communication client first exchanges signals with the server through the Hypertext Transfer Protocol (HTTP), which requires at least a TCP connection and an HTTP connection, that is, at least two round-trip times (RTT). The round-trip time represents the total time from the start of sending data to the sender receiving the confirmation from the receiver (the receiver sends the confirmation immediately after receiving the data).
[0121] The communication channel between the client and server is then established using the ICE transport protocol, which requires one RTT. Finally, the client and server exchange keys using Datagram Transport Layer Security (DTLS), which requires two RTTs. Therefore, a standard WebRTC connection requires at least five RTTs for data to be transmitted between the client and server.
[0122] Compared to the standard WebRTC connection process, in the data transmission method provided in the embodiment of the present application, before the communication client and the data-associated device establish a communication channel, the communication client has already obtained the first data in the target data sent by the data-associated device. When the communication channel is established, the first data can be quickly parsed through data backfill, thereby improving the response speed to the data acquisition instruction. After sending the first session description information to the data-associated device, the first data sent by the data-associated device can be received, thereby achieving data transmission between the communication client and the data-associated device on the basis of 0 RTT, thereby reducing data transmission delay.
[0123] The data transmission method provided in the embodiment of the present application can be applied to the fields of live video and video communication. Since the communication client can obtain the first data based on 0 RTT, the data can be obtained quickly, reducing the delay in the start of the first frame of the video. In addition, due to the fast data acquisition speed, when packet loss occurs, a black screen can be avoided on the client.
[0124] The data transmission method provided in the embodiment of the present application is compatible with the standard Web RTC connection process. The first session description information is sent to the data association device via UDP, replacing the signaling interaction with the server via Hypertext Transfer Protocol (HTTP) in the standard Web RTC connection process. Then, the communication connection between the communication client and the data association device is established through the standard Web RTC connection process (ICE establishment, key exchange, and handshake processes). Optionally, the handshake and key exchange processes with the server in the standard Web RTC connection process can be disabled to reduce the number of interactions between the communication client and the data association device and improve the connection speed.
[0125] As can be seen from the above, the embodiment of the present application sends first session description information of the communication client to the data association device through the connectionless transmission protocol in response to the data acquisition instruction; obtains second session description information sent by the data association device through the connectionless transmission protocol based on the first session description information, as well as first data in the target data required by the data acquisition instruction; establishes a communication channel between the communication client and the data association device according to the second session description information; receives second data in the target data sent by the data association device through the communication channel, and responds to the data acquisition instruction based on the first data and the second data.
[0126] This solution sends first session description information to the data association device via a connectionless transmission protocol. Since the connection transmission protocol provides a method for the communication client and the data association device to send data without establishing a connection, when the data association device receives the first session description information, it can return the first data. The communication client does not need to establish a communication channel with the data association device through round-trip information transmission to obtain the first data. Therefore, this solution can improve the speed of data acquisition and reduce data transmission delay.
[0127] Based on the above embodiments, further detailed description will be given below with examples.
[0128] This embodiment will be described from the perspective of a data transmission system, taking the data transmission system including a communication client and a data association device, the data association device being a server, and the communication client providing video live broadcast and video communication functions as an example. The communication client can be installed in a terminal, and the communication client includes a first web page instant messaging subroutine and a first signaling transmission subroutine. The server has a specific connection with the communication client, and the server includes a second web page instant messaging subroutine and a second signaling transmission subroutine.
[0129] The embodiment of the present application provides a data transmission method, such as Figure 4 As shown, the specific process of the data transmission method can be as follows:
[0130] 201. The communication client responds to a data acquisition instruction through a first signaling transmission subprogram, instructs a first web instant messaging subprogram to generate initial first session description information, and sends the information to the first signaling transmission subprogram.
[0131] For example, a user can choose to make a video call with a contact or choose to enter a live broadcast room in the communication client. The communication client responds to the data acquisition instruction triggered by the user operation through the first signaling transmission subroutine, and instructs the first web instant messaging subroutine to generate the initial first session description information. For example, the initial first session description information can be generated through the CreateOffer() method, and the Offer() method is called to send the initial first session description information.
[0132] 202. The communication client compresses the initial first session description information through a first signaling transmission subroutine to obtain first session description information.
[0133] For example, the initial first session description information may be compressed into binary data through table lookup or compression methods such as zlib, and compressed to an MTU size.
[0134] 203. The communication client sends first session description information to the server based on the connectionless transmission protocol through the first signaling transmission subroutine.
[0135] For example, the communication client sends the first session description information to the server based on UDP through the first information transmission subroutine.
[0136] 204. The server decompresses the received first session description information through the second signaling transmission subprogram to obtain initial first session description information, and sends the initial first session description information to the second web instant messaging subprogram.
[0137] For example, the server decompresses the first session description information according to the compression method of the first session description information to obtain the initial first session description information, and sends the initial first session description information to the second web page instant messaging subroutine, so that the second web page instant messaging subroutine can call the SetRemoteDescription() method to set the media information of the communication client to establish a communication channel between the communication client and the server.
[0138] 205. The server generates initial second session description information through the second web instant messaging subprogram, and sends the initial second session description information to the second signaling transmission subprogram.
[0139] After receiving the first session description information, the server can generate initial second session description information through the second web instant messaging subroutine. For example, the server can generate initial second session description information through the CreateOffer() method and call the Answer() method to send the initial second session description information to the second signaling transmission subroutine.
[0140] 206. The server compresses the initial second session description information through the second signaling transmission subroutine to obtain second session description information, and sends the second session description information to the communication client based on the connectionless transmission protocol.
[0141] The server compresses the initial second session description information through the second signaling transmission subroutine to obtain second session description information, and sends the second session description information to the communication client based on the connectionless transmission protocol.
[0142] 207. The server sends the media data to the communication client via the second webpage instant messaging subprogram.
[0143] For example, in addition to sending the first session description information to the communication client, the server also sends media data to the communication client based on UDP through the second web instant messaging subroutine.
[0144] 208. The communication client receives the second session description information sent by the server through the first signaling transmission subroutine, and decompresses the second session description information to obtain initial second session description information.
[0145] For example, the communication client decompresses the second session description information according to the compression method of the second session description information to obtain the initial second session description information, and sends the initial second session description information to the first web page instant messaging subroutine, so that the first web page instant messaging subroutine can call the SetRemoteDescription() method to set the media information of the communication client.
[0146] 209. The communication client receives the media data sent by the server through the first signaling transmission subroutine and caches the data.
[0147] For example, since a communication channel has not been established between the communication client and the server, the communication client receives media data sent by the server through the first signaling transmission subroutine and caches the data. The communication client can receive the media data sent by the server with 0 RTT.
[0148] 210. The communication client establishes a communication channel with the server based on the second session description information.
[0149] The communication client can establish a communication channel with the data-associated device through the first web instant messaging subroutine through the ICE transmission protocol. For example, the first web instant messaging subroutine calls the SendStunBindingRequest() method to send the candidate address of the communication client to the server, and the second web instant messaging subroutine of the server can call the ReceiveStunBindingRequest() method to receive the candidate address sent by the communication client, and call the SendStunBindingResponse() method to send the candidate address of the server to the communication client for connectivity testing. If the connection is successful, the communication channel between the communication client and the server is established.
[0150] A communication channel may include a path for data transmission between a communication client and a server.
[0151] Optionally, to improve the security of the connection, the communication client may handshake with the server and exchange keys through Datagram Transport Layer Security (DTLS) before transmitting data through the communication channel.
[0152] 211. The server sends media data to the communication client through the communication channel.
[0153] The server can send media data to the communication client through the established communication channel.
[0154] 212. The communication client returns the cached media data to the first web instant messaging subprogram through the first signaling transmission subprogram, so that the first web instant messaging subprogram parses and processes the media data and responds to the data acquisition instruction.
[0155] Since the media data may be data sent based on the Real-time Transport Protocol (RTP) and the Real-time Control Protocol (RTCP), the terminal cannot directly decode the media data and then render and display it. It is necessary to first parse and process the media data through the web instant messaging subroutine to obtain processed data that can be decoded by the communication client. Therefore, it is necessary to backfill the media data cached by the first signaling transmission program to the first web instant messaging subroutine, and respond to the data acquisition instruction after parsing the backfilled media data and the media data sent through the communication channel through the first web instant messaging subroutine.
[0156] Compared with the standard WebRTC connection process, the communication client has already obtained the media data before the communication channel is established. When the communication channel is established, the media data can be parsed and processed. In the fields of live video and video communication, the delay of the first video frame can be reduced. In other data transmission fields, the connection speed and data acquisition speed can be improved.
[0157] Moreover, the data transmission method provided in the embodiment of the present application can be compatible with the standard WebRTC connection process. A third-party client with a standard WebRTC connection function can quickly implement the data transmission method provided in the present application by installing the SDK corresponding to the signaling transmission subroutine.
[0158] In addition, when developing an APP, the first signaling transmission subprogram and the first web page instant messaging subprogram may be integrated to provide a quick connection service through the first signaling transmission subprogram and the first web page instant messaging subprogram.
[0159] As can be seen from the above, in the embodiment of the present application, the communication client responds to the data acquisition instruction through the first signaling transmission subroutine, instructs the first web instant messaging subroutine to generate initial first session description information, and sends it to the first signaling transmission subroutine; the communication client compresses the initial first session description information through the first signaling transmission subroutine to obtain the first session description information; the communication client sends the first session description information to the server based on the connectionless transmission protocol through the first signaling transmission subroutine; the server decompresses the received first session description information through the second signaling transmission subroutine to obtain the initial first session description information, and sends the initial first session description information to the second web instant messaging subroutine; the server generates initial second session description information through the second web instant messaging subroutine, and sends the initial second session description information to the second signaling transmission subroutine; the server decompresses the received first session description information through the second signaling transmission subroutine to obtain the initial first session description information, and sends the initial first session description information to the second web instant messaging subroutine; The second session description information is compressed to obtain the second session description information, and the second session description information is sent to the communication client based on the connectionless transmission protocol; the server sends media data to the communication client through the second web instant messaging subroutine; the communication client receives the second session description information sent by the server through the first signaling transmission subroutine, and decompresses the second session description information to obtain the initial second session description information; the communication client receives the media data sent by the server through the first signaling transmission subroutine and caches the data; the communication client establishes a communication channel with the server based on the second session description information; the server sends the media data to the communication client through the communication channel; the communication client backfills the cached media data to the first web instant messaging subroutine through the first signaling transmission subroutine, and responds to the data acquisition instruction after parsing the media data through the first web instant messaging subroutine.
[0160] This solution sends first session description information to the data association device via a connectionless transmission protocol. Since the connection transmission protocol provides a method for the communication client and the data association device to send data without establishing a connection, when the data association device receives the first session description information, it can return the first data. The communication client does not need to establish a communication channel with the data association device through round-trip information transmission to obtain the first data. Therefore, this solution can improve the speed of data acquisition and reduce data transmission delay.
[0161] In order to facilitate better implementation of the data transmission method provided in the embodiment of the present application, a data transmission device is also provided in one embodiment. The meanings of the terms are the same as those in the above-mentioned data transmission method, and the specific implementation details can be referred to the description in the method embodiment.
[0162] The data transmission device can be integrated into a computer device, such as Figure 5 As shown, the data transmission device may include: an instruction response unit 301, a first data acquisition unit 302, an establishment unit 303, and a second data acquisition unit 304, specifically as follows:
[0163] (1) Instruction response unit 301: configured to respond to a data acquisition instruction and send first session description information of a communication client to a data association device via a connectionless transmission protocol.
[0164] In one embodiment, the instruction response unit 301 includes an information acquisition subunit, an encoding subunit, an encoding subunit, and a first information sending subunit. Specifically:
[0165] An information acquisition subunit: configured to acquire the initial first session description information in response to a data acquisition instruction;
[0166] Encoding subunit: configured to encode the initial first session description information to obtain the first session description information;
[0167] The first information sending subunit is configured to send the first session description information to the data association device via a connectionless transmission protocol.
[0168] In one embodiment, the communication client includes a web instant messaging subroutine and a signaling transmission subroutine, and the instruction response unit 301 includes an acquisition subunit, an encoding processing subunit, and a request sending subunit. Specifically:
[0169] An acquisition subunit: configured to receive, in response to the data acquisition instruction, the initial first session description information sent by the web instant messaging subprogram via the signaling transmission subprogram;
[0170] The encoding processing subunit is configured to encode the initial first session description information through a signaling transmission subroutine to obtain first session information;
[0171] The request sending subunit is configured to send a signaling interaction transmission request to the data association device based on the connectionless transmission protocol through the signaling transmission subroutine, wherein the signaling interaction transmission request carries the first session information.
[0172] In one embodiment, the instruction response unit 301 includes a query subunit, a device determination subunit, and a second information sending subunit. Specifically:
[0173] Query subunit: configured to query corresponding candidate data association devices in response to the data acquisition instruction;
[0174] Device determination subunit: used to determine the data association device from the candidate data association devices;
[0175] The second information sending subunit is configured to send the first session description information to the data association device via a connectionless transmission protocol.
[0176] (2) First data acquisition unit 302: used to acquire second session description information sent by the data association device through a connectionless transmission protocol based on the first session description information, and first data in the target data required by the data acquisition instruction.
[0177] (3) Establishing unit 303: used to establish a communication channel between the communication client and the data association device according to the second session description information.
[0178] In one embodiment, the establishing unit 303 includes a decoding subunit and a channel establishing subunit, specifically:
[0179] Decoding subunit: configured to decode the second session description information to obtain initial second session description information;
[0180] Channel establishment subunit: configured to perform interactive connection establishment processing between the communication client and the data association device according to the initial second session description information, so as to establish a communication channel.
[0181] In one embodiment, the channel establishment subunit includes a negotiation submodule and a communication channel establishment submodule, specifically:
[0182] Negotiation submodule: configured to perform session negotiation based on the media information in the initial second session description information, and determine session attribute information for communication between the data association device and the client;
[0183] Communication channel establishment submodule: used to establish a communication channel with the data association device according to the communication address information in the initial second session description information;
[0184] The second data acquisition unit 304 may be specifically configured to:
[0185] The second data is sent by the data association device through the communication channel based on the session attribute information.
[0186] (4) Second data acquisition unit 304: used to receive second data in the target data sent by the data association device through the communication channel, and respond to the data acquisition instruction based on the first data and the second data.
[0187] In one embodiment, the second data acquisition unit 304 includes a backfill subunit, a parsing subunit, and a response subunit. Specifically:
[0188] Backfill subunit: used for backfilling the first data to the web page instant messaging subprogram;
[0189] The parsing and processing subunit is configured to perform data parsing on the first data and the second data through the web instant messaging subroutine to obtain processed data;
[0190] Response subunit: used to respond to the data acquisition instruction based on the processed data.
[0191] As can be seen from the above, the data transmission device of the embodiment of the present application responds to the data acquisition instruction through the instruction response unit 301 and sends the first session description information of the communication client to the data association device through the connectionless transmission protocol; the first data acquisition unit 302 acquires the second session description information sent by the data association device through the connectionless transmission protocol based on the first session description information, as well as the first data in the target data required by the data acquisition instruction; the establishment unit 303 establishes a communication channel between the communication client and the data association device based on the second session description information; and the second data acquisition unit 304 receives the second data in the target data sent by the data association device through the communication channel, so as to respond to the data acquisition instruction based on the first data and the second data.
[0192] This solution sends first session description information to the data association device via a connectionless transmission protocol. Since the connection transmission protocol provides a method for the communication client and the data association device to send data without establishing a connection, when the data association device receives the first session description information, it can return the first data. The communication client does not need to establish a communication channel with the data association device through round-trip information transmission to obtain the first data. Therefore, this solution can improve the speed of data acquisition and reduce data transmission delay.
[0193] The embodiment of the present application also provides a computer device, which can be a terminal or a server. Figure 6, which shows a schematic diagram of the structure of the computer device involved in the embodiment of the present application, specifically:
[0194] The computer device may include one or more processing core processors 1001, one or more computer readable storage media memories 1002, a power supply 1003, an input unit 1004 and other components. Those skilled in the art will understand that Figure 6 The computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange components differently.
[0195] Processor 1001 is the control center of the computer device. It connects the various components of the entire computer device using various interfaces and lines. By running or executing software programs and / or modules stored in memory 1002 and accessing data stored in memory 1002, it performs various functions of the computer device and processes data, thereby monitoring the computer device as a whole. Optionally, processor 1001 may include one or more processing cores; preferably, processor 1001 may integrate an application processor and a modem processor, wherein the application processor primarily processes the operating system, user interface, and computer programs, while the modem processor primarily handles wireless communications. It is understood that the modem processor may not be integrated into processor 1001.
[0196] The memory 1002 can be used to store software programs and modules. The processor 1001 executes various functional applications and data processing by running the software programs and modules stored in the memory 1002. The memory 1002 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, a computer program required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 1002 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage device. Accordingly, the memory 1002 may also include a memory controller to provide the processor 1001 with access to the memory 1002.
[0197] The computer device also includes a power supply 1003 for supplying power to various components. Preferably, the power supply 1003 can be logically connected to the processor 1001 via a power management system, thereby enabling the power management system to manage charging, discharging, and power consumption. The power supply 1003 can also include one or more DC or AC power supplies, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and other arbitrary components.
[0198] The computer device may further include an input unit 1004, which may be configured to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0199] Although not shown, the computer device may further include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 1001 in the computer device will load the executable files corresponding to one or more computer program processes into the memory 1002 according to the following instructions, and the processor 1001 will run the computer programs stored in the memory 1002 to implement various functions as follows:
[0200] In response to the data acquisition instruction, sending first session description information of the communication client to the data association device via a connectionless transmission protocol;
[0201] Acquire the second session description information sent by the data association device through the connectionless transmission protocol based on the first session description information, and the first data in the target data required by the data acquisition instruction;
[0202] establishing a communication channel between the communication client and the data association device according to the second session description information;
[0203] The receiving device receives second data in the target data sent through the communication channel, so as to respond to the data acquisition instruction based on the first data and the second data.
[0204] The specific implementation of the above operations can be found in the previous embodiments and will not be described in detail here.
[0205] As can be seen from the above, the computer device of the embodiment of the present application can, in response to a data acquisition instruction, send first session description information of the communication client to the data association device through a connectionless transmission protocol; obtain second session description information sent by the data association device through the connectionless transmission protocol based on the first session description information, as well as first data in the target data required by the data acquisition instruction; establish a communication channel between the communication client and the data association device based on the second session description information; receive second data in the target data sent by the data association device through the communication channel, and respond to the data acquisition instruction based on the first data and the second data.
[0206] This solution sends first session description information to the data association device via a connectionless transmission protocol. Since the connection transmission protocol provides a method for the communication client and the data association device to send data without establishing a connection, when the data association device receives the first session description information, it can return the first data. The communication client does not need to establish a communication channel with the data association device through round-trip information transmission to obtain the first data. Therefore, this solution can improve the speed of data acquisition and reduce data transmission delay.
[0207] According to one aspect of the present application, a computer program product is provided, comprising a computer program, the computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in various optional implementations of the above embodiments.
[0208] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be accomplished by a computer program, or by controlling related hardware through a computer program. The computer program may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0209] To this end, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. The computer program can be loaded by a processor to execute any data transmission method provided in the embodiment of the present application.
[0210] The specific implementation of the above operations can be found in the previous embodiments and will not be repeated here.
[0211] The computer-readable storage medium may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0212] Since the computer program stored in the computer-readable storage medium can execute any one of the data transmission methods provided in the embodiments of the present application, the beneficial effects that can be achieved by any one of the data transmission methods provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0213] The above is a detailed introduction to a data transmission method, device, computer equipment and computer-readable storage medium provided in the embodiments of the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core ideas. At the same time, for those skilled in the art, based on the ideas of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A data transmission method, characterized in that: include: In response to the data acquisition instruction, sending first session description information of the communication client to the data association device via a connectionless transmission protocol; obtaining second session description information returned by the data association device to the communication client via the connectionless transmission protocol after receiving the first session description information, and obtaining first data returned by the data association device to the communication client via the connectionless transmission protocol; wherein the first data is part of the target data required by the data acquisition instruction; establishing a communication channel between the communication client and the data association device according to the second session description information; The second data in the target data sent by the data association device through the communication channel is received to respond to the data acquisition instruction based on the first data and the second data.
2. The method according to claim 1, characterized in that The sending, in response to the data acquisition instruction, the first session description information of the communication client to the data association device via the connectionless transmission protocol comprises: Responding to the data acquisition instruction, acquiring initial first session description information; Encoding the initial first session description information to obtain the first session description information; The first session description information is sent to the data association device through the connectionless transmission protocol.
3. The method according to claim 2, characterized in that The establishing a communication channel between the client and the data association device according to the second session description information includes: Decoding the second session description information to obtain initial second session description information; An interactive connection establishment process is performed between the communication client and the data association device according to the initial second session description information to establish the communication channel.
4. The method according to claim 3, characterized in that The performing interactive connection establishment processing according to the initial second session description information to establish a communication channel between the client and the data association device includes: performing session negotiation based on the media information in the initial second session description information to determine session attribute information for communication between the data association device and the communication client; establishing a communication channel with the data association device according to the communication address information in the initial second session description information; The receiving second data in the target data sent by the data association device through the communication channel includes: Second data sent by the data association device through the communication channel based on the session attribute information is received.
5. The method according to claim 1, wherein The communication client includes a web instant messaging subroutine and a signaling transmission subroutine, and in response to the data acquisition instruction, sends first session description information of the communication client to the data association device via a connectionless transmission protocol, including: In response to the data acquisition instruction, receiving, through the signaling transmission subprogram, the initial first session description information sent by the web instant messaging subprogram; encoding the initial first session description information through the signaling transmission subroutine to obtain the first session description information; A signaling interaction transmission request is sent to the data association device through the signaling transmission subroutine based on the connectionless transmission protocol, where the signaling interaction transmission request carries the first session description information.
6. The method according to claim 5, characterized in that The responding to the data acquisition instruction based on the first data and the second data includes: Backfilling the first data to the web page instant messaging subroutine; Performing data analysis on the first data and the second data by the web instant messaging subprogram to obtain processed data; The data acquisition instruction is responded to based on the processed data.
7. The method according to any one of claims 1 to 6, characterized in that In response to the data acquisition instruction, sending first session description information of the communication client to the data association device through a connectionless transmission protocol, including: In response to the data acquisition instruction, querying corresponding candidate data association devices; determining the data association device from the candidate data association devices; The first session description information is sent to the data association device through the connectionless transmission protocol.
8. A data transmission device, characterized in that: include: an instruction response unit, configured to send first session description information of the communication client to the data association device via a connectionless transmission protocol in response to the data acquisition instruction; a first data acquisition unit, configured to acquire second session description information returned by the data association device to the communication client via the connectionless transmission protocol after receiving the first session description information, and to acquire first data returned by the data association device to the communication client via the connectionless transmission protocol; wherein the first data is part of the target data required by the data acquisition instruction; an establishing unit, configured to establish a communication channel between the communication client and the data association device according to the second session description information; The second data acquisition unit is configured to receive second data in the target data sent by the data association device through the communication channel, and respond to the data acquisition instruction based on the first data and the second data.
9. A computer device, characterized in that: It comprises a memory and a processor; the memory stores a computer program, and the processor is used to run the computer program in the memory to execute the data transmission method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium is used to store a computer program, and the computer program is loaded by a processor to execute the data transmission method according to any one of claims 1 to 7.
11. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the data transmission method according to any one of claims 1 to 7 is implemented.