Data transmission method, apparatus, device, storage medium, and computer program product

CN117640594BActive Publication Date: 2026-10-27TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210958709.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-09
Publication Date
2026-10-27
Estimated Expiration
2042-08-09

AI Technical Summary

Technical Problem

但这种方式体验较差,需要有一个等待过程,耗时过长,数据传输延时较大,不适于低延时场景

Benefits of technology

[0073]上述数据传输方法、装置、计算机设备、存储介质和计算机程序产品,在源端与目的端的信令交互阶段,利用面向无连接的传输层协议与面向有连接的传输层协议各自的优缺点进行互补,通过无连接传输通道与有连接传输通道的双通道信令交互,提升信令交互成功率的同时,同时实现无连接传输通道与有连接传输通道各自的连通性探测,具体而言:目的端在接收源端分别基于面向无连接的传输层协议与面向有连接的传输层协议发送的关于通信会话的会话邀请的情况下,收集该两个会话邀请中用于传输会话数据的源端候选地址,根据本地的目的端候选地址生成响应于该会话邀请的会话应答,分别通过面向无连接的传输层协议与面向有连接的传输层协议将该会话应答返回源端,以便于源端能够基于会话应答的传输状态,确定关于该通信会话的无连接传输通道与有连接传输通道各自的连通性探测结果,从而能够基于该连通性探测结果,根据源端候选地址与目的端候选地址自适应选择其中一种建立与源端之间的数据传输通道,从而在数据传输阶段,基于建立的数据传输通道与目的端之间传输该通信会话的会话数据,整个过程中源端无需在等待超时后再尝试通过其它方式建立连接,而是在实现信令交互的同时直接完成两类通道的连通性探测,极大降低数据传输的延时,提升服务体验。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117640594B_ABST
    Figure CN117640594B_ABST
Patent Text Reader

Abstract

The application relates to a data transmission method and device, computer equipment, a storage medium and a computer program product. The method comprises the following steps: generating a session invitation of a communication session, sending the session invitation to a destination end based on a connectionless transmission layer protocol and a connection-oriented transmission layer protocol respectively, determining the connectivity detection results of the connectionless transmission channel and the connection-oriented transmission channel of the communication session according to the transmission state of the session response fed back by the destination end to the session invitation, establishing a data transmission channel between the destination end according to the connectivity detection results, and transmitting session data of the communication session between the destination end through the data transmission channel. The method realizes the connectivity detection of the connectionless transmission channel and the connection-oriented transmission channel while improving the success rate of signaling interaction and reducing the delay of data transmission through the double-channel signaling interaction of the connectionless transmission channel and the connection-oriented transmission channel.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a data transmission method, apparatus, computer equipment, storage medium, and computer program product. Background Technology

[0002] WebRTC (Web Real-Time Communication) is a real-time communication technology applicable to real-time audio and video communication, such as pulling audio and video streams. UDP (User Datagram Protocol) is a connectionless transport layer communication protocol with advantages of fast transmission, high efficiency, and low latency, but disadvantages of unreliability and weak network penetration. TCP (Transmission Control Protocol) is a connection-oriented, reliable, byte-stream-based transport layer communication protocol with advantages of reliable transmission and strong network penetration, but disadvantages of slow transmission, low efficiency, and high latency.

[0003] WebRTC requires two types of interaction over the network: signaling and data transmission. Based on the characteristics of UDP and TCP, the WebRTC standard generally uses a TCP-based transport protocol for signaling and a UDP-based real-time transport protocol for data transmission. However, UDP is subject to limitations in many scenarios and certain network environments. For example, different regions and operators may impose rate limits or direct restrictions on UDP; furthermore, UDP may be directly blocked under certain internal network security policies, significantly impacting WebRTC-based data transmission.

[0004] Currently, the solution is to switch to another protocol for playback after a timeout. However, this method offers a poor user experience, requiring a long waiting period and incurring significant data transmission latency, making it unsuitable for low-latency scenarios. Summary of the Invention

[0005] Therefore, it is necessary to provide a data transmission method, apparatus, computer equipment, computer-readable storage medium, and computer program product that can reduce data transmission latency in response to the above-mentioned technical problems.

[0006] This application provides a data transmission method. The method includes:

[0007] A session invitation for generating a communication session is sent to the destination based on both a connectionless transport layer protocol and a connection-oriented transport layer protocol.

[0008] Based on the transmission status of the session response returned by the destination to the session invitation, determine the connectivity detection results of the connectionless transmission channel and the connection-oriented transmission channel for the communication session.

[0009] Based on the connectivity detection results, establish a data transmission channel with the destination.

[0010] The communication session data is transmitted between the communication session and the destination through the data transmission channel.

[0011] This application also provides a data transmission apparatus. The apparatus includes:

[0012] The session invitation sending module is used to generate a session invitation for a communication session and send the session invitation to the destination based on both connectionless and connection-oriented transport layer protocols.

[0013] The connectivity detection module is used to determine the connectivity detection results of the connectionless transmission channel and the connection-oriented transmission channel for the communication session based on the transmission status of the session response fed back by the destination to the session invitation.

[0014] A connection establishment module is used to establish a data transmission channel with the destination end based on the connectivity detection results;

[0015] The transmission module is used to transmit session data of the communication session with the destination through the data transmission channel.

[0016] In one embodiment, the session invitation sending module is further configured to create a communication session in response to a trigger operation that pulls a media stream from the server; obtain session description information of the communication session; and generate a session invitation for the communication session based on the session description information.

[0017] In one embodiment, the session invitation sending module is further configured to compress the session invitation to obtain binary data; and send the binary data to the destination based on a connectionless transport layer protocol and a connection-oriented transport layer protocol, respectively.

[0018] In one embodiment, the session invitation sending module is further configured to encapsulate the session invitation into a first interactive signaling according to the connectionless transport layer protocol; encapsulate the session invitation into a second interactive signaling according to the connection-oriented transport layer protocol; send the first interactive signaling to the destination via the connectionless transport layer protocol and send the second interactive signaling to the destination via the connection-oriented transport layer protocol.

[0019] In one embodiment, the connectivity detection module is further configured to: if only a session response is received from the destination end in response to the first interactive signaling via a connectionless transport layer protocol, then save the candidate address of the destination end used for transmitting session data in the session response and determine that the connectionless transmission channel for the communication session is in a connected state; if only a session response is received from the destination end in response to the second interactive signaling via a connection-oriented transport layer protocol, then save the candidate address of the destination end used for transmitting session data in the session response and determine that the connection-oriented transmission channel for the communication session is in a connected state.

[0020] In one embodiment, the connection establishment module is further configured to, if the connectionless transmission channel for the communication session is in a connected state, initiate a connection check request for the candidate address combination formed by the first address in the source candidate address and the second address in the destination candidate address; and when a connection check response is received from the destination in response to the connection check request, establish a connectionless data transmission channel with the destination based on the candidate address combination.

[0021] In one embodiment, the connection establishment module is further configured to, if the connection-oriented transmission channel for the communication session is in a connected state, initiate a connection check request for the candidate address combination formed by the first address in the source candidate address and the second address in the destination candidate address; and when a connection check response is received from the destination in response to the connection check request, establish a connection-oriented data transmission channel with the destination based on the candidate address combination.

[0022] In one embodiment, the connectivity detection module is further configured to, if after receiving a session response from the destination end to the first interactive signaling via a connectionless transport layer protocol and saving the candidate address of the destination end used for transmitting session data in the session response, receive a candidate address from the destination end to the second interactive signaling via a connection-oriented transport layer protocol, then save the candidate address and determine that both the connectionless transmission channel and the connection-oriented transmission channel of the communication session are in a connected state.

[0023] This application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:

[0024] A session invitation for generating a communication session is sent to the destination based on both a connectionless transport layer protocol and a connection-oriented transport layer protocol.

[0025] Based on the transmission status of the session response returned by the destination to the session invitation, determine the connectivity detection results of the connectionless transmission channel and the connection-oriented transmission channel for the communication session.

[0026] Based on the connectivity detection results, establish a data transmission channel with the destination.

[0027] The communication session data is transmitted between the communication session and the destination through the data transmission channel.

[0028] This application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:

[0029] A session invitation for generating a communication session is sent to the destination based on both a connectionless transport layer protocol and a connection-oriented transport layer protocol.

[0030] Based on the transmission status of the session response returned by the destination to the session invitation, determine the connectivity detection results of the connectionless transmission channel and the connection-oriented transmission channel for the communication session.

[0031] Based on the connectivity detection results, establish a data transmission channel with the destination.

[0032] The communication session data is transmitted between the communication session and the destination through the data transmission channel.

[0033] This application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps:

[0034] A session invitation for generating a communication session is sent to the destination based on both a connectionless transport layer protocol and a connection-oriented transport layer protocol.

[0035] Based on the transmission status of the session response returned by the destination to the session invitation, determine the connectivity detection results of the connectionless transmission channel and the connection-oriented transmission channel for the communication session.

[0036] Based on the connectivity detection results, establish a data transmission channel with the destination.

[0037] The communication session data is transmitted between the communication session and the destination through the data transmission channel.

[0038] The aforementioned data transmission methods, apparatus, computer equipment, storage media, and computer program products, in the signaling interaction phase between the source and destination, complement each other by utilizing the advantages and disadvantages of connectionless and connection-oriented transport layer protocols. Through dual-channel signaling interaction via both connectionless and connection-oriented transmission channels, the success rate of signaling interaction is improved while simultaneously enabling connectivity detection for both channels. Specifically: the source generates a session invitation for a communication session, sending the session invitation to the destination based on both the connectionless and connection-oriented transport layer protocols. By inquiring about the transmission status of the session response, the connectivity detection results for both the connectionless and connected transmission channels of the communication session are determined. Based on these connectivity detection results, either the connectionless or connected transmission channel can be adaptively selected to seamlessly establish a connection with the destination. During the data transmission phase, session data is transmitted between the destination and the established data transmission channel. Throughout this process, there is no need to wait for a timeout and then attempt to establish a connection through other means. Instead, connectivity detection for both types of channels is completed simultaneously with signaling interaction, significantly reducing data transmission latency and improving the service experience.

[0039] This application provides a data transmission method. The method includes:

[0040] It sequentially receives session invitations regarding communication sessions sent by the source end based on connectionless transport layer protocols and connection-oriented transport layer protocols, respectively.

[0041] Collect the candidate source addresses used for transmitting session data in the session invitation;

[0042] Generate a session response in response to the session invitation based on the candidate destination address;

[0043] The session response is returned to the source end via both a connectionless transport layer protocol and a connection-oriented transport layer protocol, respectively, so as to establish a data transmission channel between the source end and the destination end based on the source end candidate address and the destination end candidate address.

[0044] The communication session data is transmitted between the source end and the data transmission channel.

[0045] A data transmission apparatus, the apparatus comprising:

[0046] The session invitation receiving module is used to sequentially receive session invitations about communication sessions sent by the source end based on connectionless transport layer protocols and connection-oriented transport layer protocols, respectively.

[0047] The source address addition module is used to collect candidate source addresses for transmitting session data in the session invitation;

[0048] The session response generation module is used to generate a session response in response to the session invitation based on the candidate address of the destination.

[0049] The session response sending module is used to return the session response to the source end through a connectionless transport layer protocol and a connection-oriented transport layer protocol, respectively, so as to establish a data transmission channel with the source end based on the source end candidate address and the destination end candidate address;

[0050] The transmission module is used to transmit session data of the communication session with the source end through the data transmission channel.

[0051] In one embodiment, the session invitation receiving module is further configured to sequentially receive binary data about the communication session sent by the source end based on a connectionless transport layer protocol and a connection-oriented transport layer protocol, respectively, wherein the binary data is a compressed session invitation; and decompress the binary data to obtain the session invitation about the communication session.

[0052] In one embodiment, the session response sending module is further configured to compress the session response to obtain binary data; and send the binary data to the source end based on a connectionless transport layer protocol and a connection-oriented transport layer protocol, respectively.

[0053] In one embodiment, the session response sending module is further configured to encapsulate the session response into a third interactive signaling according to the connectionless transport layer protocol; encapsulate the session response into a fourth interactive signaling according to the connection-oriented transport layer protocol; send the third interactive signaling to the source end through the connectionless transport layer protocol and send the fourth interactive signaling to the source end through the connection-oriented transport layer protocol.

[0054] In one embodiment, the apparatus further includes a connection establishment module, configured to receive a connection check request initiated by the source end based on a first address among the source end candidate addresses and a second address among the destination end candidate addresses; when it is detected that the first address and the second address belong to a candidate address combination for the communication session, the module sends a connection check response back to the source end to determine the data transmission channel between the source end and the first address and the second address.

[0055] This application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:

[0056] It sequentially receives session invitations regarding communication sessions sent by the source end based on connectionless transport layer protocols and connection-oriented transport layer protocols, respectively.

[0057] Collect the candidate source addresses used for transmitting session data in the session invitation;

[0058] Generate a session response in response to the session invitation based on the candidate destination address;

[0059] The session response is returned to the source end via both a connectionless transport layer protocol and a connection-oriented transport layer protocol, respectively, so as to establish a data transmission channel between the source end and the destination end based on the source end candidate address and the destination end candidate address.

[0060] The communication session data is transmitted between the source end and the data transmission channel.

[0061] This application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:

[0062] It sequentially receives session invitations regarding communication sessions sent by the source end based on connectionless transport layer protocols and connection-oriented transport layer protocols, respectively.

[0063] Collect the candidate source addresses used for transmitting session data in the session invitation;

[0064] Generate a session response in response to the session invitation based on the candidate destination address;

[0065] The session response is returned to the source end via both a connectionless transport layer protocol and a connection-oriented transport layer protocol, respectively, so as to establish a data transmission channel between the source end and the destination end based on the source end candidate address and the destination end candidate address.

[0066] The communication session data is transmitted between the source end and the data transmission channel.

[0067] This application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps:

[0068] It sequentially receives session invitations regarding communication sessions sent by the source end based on connectionless transport layer protocols and connection-oriented transport layer protocols, respectively.

[0069] Collect the candidate source addresses used for transmitting session data in the session invitation;

[0070] Generate a session response in response to the session invitation based on the candidate destination address;

[0071] The session response is returned to the source end via both a connectionless transport layer protocol and a connection-oriented transport layer protocol, respectively, so as to establish a data transmission channel between the source end and the destination end based on the source end candidate address and the destination end candidate address.

[0072] The communication session data is transmitted between the source end and the data transmission channel.

[0073] The aforementioned data transmission methods, apparatus, computer equipment, storage media, and computer program products, in the signaling interaction phase between the source and destination, complement each other by leveraging the advantages and disadvantages of connectionless and connection-oriented transport layer protocols. Through dual-channel signaling interaction via both connectionless and connection-oriented transmission channels, the success rate of signaling interaction is improved, while simultaneously enabling connectivity detection for both channels. Specifically, when the destination receives session invitations regarding a communication session from the source based on both connectionless and connection-oriented transport layer protocols, it collects the candidate source addresses for transmitting session data from these invitations and generates a session response in response to the invitation based on its local candidate destination address. The session response is returned to the source end via both connectionless and connection-oriented transport layer protocols. This allows the source end to determine the connectivity detection results for both the connectionless and connection-oriented transport channels of the communication session based on the transmission status of the session response. Based on these connectivity detection results, the source end can adaptively select one of the candidate addresses (source and destination) to establish a data transmission channel with the source end. During the data transmission phase, session data is transmitted between the source and destination ends via the established data transmission channel. Throughout this process, the source end does not need to wait for a timeout before attempting to establish a connection through other methods; instead, it directly completes connectivity detection for both types of channels while simultaneously performing signaling interaction. This significantly reduces data transmission latency and improves the service experience. Attached Figure Description

[0074] Figure 1 This is an application environment diagram of a data transmission method in one embodiment;

[0075] Figure 2 This is a schematic diagram illustrating a scenario where UDP is restricted in related technologies;

[0076] Figure 3 This is an illustration of another scenario where UDP is restricted in related technologies;

[0077] Figure 4A timing diagram illustrating the establishment of a real-time communication session in related technologies;

[0078] Figure 5 This is a timing diagram of a data transmission method in one embodiment;

[0079] Figure 6 This is a flowchart illustrating a data transmission method in one embodiment;

[0080] Figure 7 This is a flowchart illustrating a data transmission method in a specific embodiment.

[0081] Figure 8 This is a flowchart illustrating the data transmission method in another embodiment;

[0082] Figure 9 This is a structural block diagram of a data transmission device in one embodiment;

[0083] Figure 10 This is a structural block diagram of a data transmission device in another embodiment;

[0084] Figure 11 This is an internal structural diagram of a computer device in one embodiment;

[0085] Figure 12 This is a diagram of the internal structure of a computer device in another embodiment. Detailed Implementation

[0086] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0087] The concepts involved in the embodiments of this application will be explained and described as follows:

[0088] WebRTC: Web Real-Time Communication, is a real-time communication technology that can be applied to real-time audio and video communication, such as streaming audio and video streams. Real-time communication can be introduced on the client side based on WebRTC.

[0089] RTT: Round-Trip Time, an important performance metric.

[0090] SDP: Session Description Protocol.

[0091] ICE: Interactive Connectivity Establishment.

[0092] UDP: User Datagram Protocol, a connectionless transport layer protocol that provides a simple, unreliable, transaction-oriented message delivery service.

[0093] TCP: Transmission Control Protocol, a connection-oriented, reliable, byte-stream-based transport layer communication protocol.

[0094] DTLS: Datagram Transport Layer Security, a data transport layer security protocol for UDP.

[0095] TLS, Transport Layer Security, is a security protocol for the TCP data transmission layer.

[0096] MTU, Maximum Transmission Unit.

[0097] QoS, Quality of Service, is a service quality indicator.

[0098] The data transmission method provided in this application can be applied to cloud technology, which refers to a hosting technology that unifies hardware, software, and network resources within a wide area network (WAN) or local area network (LAN) to achieve data computation, storage, processing, and sharing. Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, and application technology applied in the cloud computing business model. It can form resource pools, be used on demand, and is flexible and convenient. Cloud computing technology will become an important support. The backend services of technical network systems require a large amount of computing and storage resources, such as video websites, image websites, and many portal websites. With the rapid development and application of the internet industry, every item may have its own identification mark in the future, requiring transmission to the backend system for logical processing. Data of different levels will be processed separately, and various industry data will require strong system support, which can only be achieved through cloud computing. For example, the data transmission method provided in this application can be used in cloud live streaming scenarios and cloud video scenarios.

[0099] The data transmission method provided in this application embodiment can be applied to, for example... Figure 1In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or placed on the cloud or other servers. In one embodiment, a client running on terminal 102 can be an instant messaging client, a live video streaming client, etc. This client, acting as the source, generates a session invitation for a communication session and sends the invitation to server 104, acting as the destination, based on both connectionless and connection-oriented transport layer protocols. According to the transmission status of the session response from the destination, the client determines the connectivity detection results for both the connectionless and connection-oriented transport channels for the communication session. Then, based on the connectivity detection results, a data transmission channel can be established between the client and the destination, and session data for the communication session can be transmitted through this channel.

[0100] The terminal 102 can be, but is not limited to, various desktop computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, and smart in-vehicle devices. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted devices. The server 104 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The terminal can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, etc., but is not limited to these. The terminal and server can be directly or indirectly connected via wired or wireless communication, which is not limited herein.

[0101] The data transmission method provided in this application can be implemented based on real-time communication technology, such as WebRTC. This data transmission method can be integrated into the client as a WebRTC SDK to communicate with the standard WebRTC interface. WebRTC is a real-time communication technology that allows clients and servers, or clients and clients, to establish peer-to-peer connections without an intermediary, enabling the transmission of video and / or audio streams or other arbitrary data. UDP is a connectionless transport layer communication protocol with advantages of fast transmission, high efficiency, and low latency, but also disadvantages of unreliability and weak network penetration. TCP is a connection-oriented, reliable, byte-stream-based transport layer communication protocol with advantages of reliable transmission and strong network penetration, but also disadvantages of slow transmission, low efficiency, and high latency. WebRTC commonly uses the UDP-based RTP / RTCP transport protocol. Generally, during the signaling interaction phase of a WebRTC-based communication session, a reliable TCP-based transport protocol, such as HTTP or WebSocket, is used for signaling interaction, while during the data transmission phase, a UDP-based transport protocol is used to establish the connection and transmit data.

[0102] However, UDP is subject to certain limitations in some network environments. For example, ... Figure 2 As shown, this is one scenario where UDP is restricted in related technologies. In this scenario, due to the restrictions of the internal network firewall security policy, UDP is highly likely to be blocked by the firewall security policy. Terminals on the internal network are basically unable to interact with the external network via UDP and can only interact with the external network via TCP. For example, ... Figure 3 As shown, this is another scenario where UDP is restricted in related technologies. In this scenario, due to abnormal client scheduling or heavy load on the local operator server, the client cannot connect to the local operator server and instead connects directly to other cross-domain or cross-operator servers. In this case, data transmission using UDP across cross-domain or cross-operator servers will be restricted.

[0103] In a specific application scenario, such as live video streaming, a live video streaming system typically needs to provide users with high-quality, ultra-low latency live streaming services. This usually requires starting the video stream pull via a low-latency UDP protocol. However, when the aforementioned UDP protocols are limited, transmission will fail, directly resulting in the failure to start the live stream. Currently, the solution for this scenario is to switch to other protocols for transmission, such as switching to HTTP / FLV when the timeout for starting the stream fails. However, this method requires a waiting process; the UDP connection times out before switching to HTTP / FLV playback, which is too time-consuming, resulting in slow start times and a very poor live streaming service experience.

[0104] In real-time communication technology, the establishment of a communication session typically involves two phases:

[0105] Signaling Interaction Phase: This phase is used by both communicating parties to negotiate and understand each other's information, such as session-related information of the communication session and media-related information of the transmitted media data. Media-related information includes the transport protocol, transport address and port, codec, and other parameters, etc. Signaling interaction can be achieved based on session description protocols such as SDP. Session description protocols are used to exchange information between the two ends in real-time communication technology. One end uses SDP to inform the other end which parameters to use in the media session. Typically, an SDP serving WebRTC can be divided into the following two parts: Session-level description information, including descriptions of the session and time, specifically including version information, session identifier, session name, session time, etc.; and Media-level information, including descriptions of audio and video media and the network, specifically including audio and video information, media type and parameters, candidate addresses and ports for transmitting media data, network protocol type and parameters, audio and video encoding types and parameters, etc.

[0106] Connection establishment and data transmission phase: Based on the session information and media transmission information negotiated in the first phase, a connection is established between one end and the other end, and the transmission of session data is initiated.

[0107] like Figure 4The diagram illustrates a data transmission channel for establishing a real-time communication session between a source and a destination in related technologies. This real-time communication session can be a WebRTC-based session. First, the source sets up and saves a local SDP containing candidate addresses that can be used for data transmission. Then, it sends a session invitation SDP containing this SDP to the destination (in an end-to-end scenario, this offer SDP is sent to the destination via a signaling server; in an end-to-server scenario, it is sent directly to the server). After receiving the session invitation, the destination saves the candidate addresses of the source and triggers the setting and saving of its local SDP, which contains candidate addresses that can be used for data transmission. The destination then creates a session response answer SDP and sends its candidate addresses that can be used for data transmission to the source (in an end-to-end scenario, this answer SDP is sent to the source via a signaling server; in an end-to-server scenario, it is sent directly to the server), thus exchanging candidate addresses. Then, the source end can initiate a connection check request (Stun BindingRequest) based on at least one candidate address combination formed by the two candidate addresses and the candidate address combination with the highest priority. The connection status of the candidate address combination is recorded according to the connection check response (Stun Binding Response) of the destination end. If the connection status is ready to send, data is transmitted between the source end and the destination end through the data transmission channel formed by the candidate address combination. If the destination end does not respond with a session acknowledgment or a connection check response, retransmission is required until timeout. Only after timeout will switching to other transmission protocols be considered.

[0108] like Figure 4 In the WebRTC standard interaction flow shown, the session invitation SDP and session response SDP in the signaling interaction phase are sent using a TCP-based transport protocol, while the data transmission in the connection establishment and data transmission phases are sent using a UDP-based transport protocol. However, as described above, UDP is often limited or unavailable. Since it is impossible to know in advance whether UDP is available, the failure rate of signaling interaction is low, and switching to other protocols after a timeout takes a long time, resulting in poor quality of low-latency data transmission service.

[0109] like Figure 5 The diagram shown is a schematic representation of a data transmission method provided in an embodiment of this application. (Refer to...) Figure 5The source end sets and saves a local SDP containing candidate addresses that can be used for data transmission. Then, it sends a session invitation offer (also called offer SDP) containing this SDP to the destination end using both UDP-based and TCP-based transport protocols. When the destination end receives both SDPs, it can save the candidate addresses of the source end and trigger the setting and saving of its own local SDP containing candidate addresses that can be used for data transmission. The destination end then creates a session response answer (also called answer SDP) and sends its candidate addresses that can be used for data transmission to the source end using both UDP-based and TCP-based transport protocols, thus exchanging candidate addresses. If the source receives the answerSDP, it indicates that the transmission channel based on the corresponding transport protocol is in a connected state. Then, the source can directly form at least one candidate address combination based on the candidate addresses at both ends and the corresponding transport protocol. Based on the candidate address combination with the highest priority, the source initiates a connection check request (Stun BindingRequest) using the transport protocol (TCP or UDP) corresponding to that combination. The source records the connection status of the candidate address combination according to the connection check response (Stun Binding Response) of the destination. If the connection status of the candidate address combination is in a send-ready state, data is transmitted between the source and the destination through the data transmission channel based on UDP or TCP formed by the candidate address combination.

[0110] Compared to Figure 4 The signaling interaction phase shown uses TCP to transmit interaction signaling. Figure 5 The interactive process shown utilizes the complementary advantages and disadvantages of connectionless and connection-oriented transport layer protocols during the signaling interaction phase between the source and destination. Through dual-channel signaling interaction via connectionless and connection-oriented transport channels, the success rate of signaling interaction is improved while simultaneously enabling connectivity detection for both channels. This allows the source to directly and seamlessly determine which protocol to use to establish a connection with the destination based on the detection results, without waiting, resulting in very low data transmission latency.

[0111] The data transmission method provided in this application involves the source end generating a session invitation for a communication session and sending the session invitation to the destination end based on both a connectionless transport layer protocol and a connection-oriented transport layer protocol. Based on the transmission status of the session response from the destination end to the session invitation, the connectivity detection results for the connectionless and connection-oriented transmission channels of the communication session are determined. This allows for the adaptive selection of either a connectionless or connection-oriented transmission channel to seamlessly establish a connection with the destination end based on the connectivity detection results. During the data transmission phase, session data is transmitted between the source and destination ends via the established data transmission channel. Throughout this process, there is no need to wait for a timeout before attempting to establish a connection through other means; instead, connectivity detection for both types of channels is completed directly while signaling interaction is implemented, significantly reducing data transmission latency and improving the service experience.

[0112] In one embodiment, such as Figure 6 As shown, a data transmission method is provided, which is applied to... Figure 1 Taking terminal 102 as an example, the explanation includes the following steps:

[0113] Step 602: Generate a session invitation for the communication session and send the session invitation to the destination based on both connectionless and connection-oriented transport layer protocols.

[0114] This application's embodiments involve a source and a destination. The source is the party initiating the session invitation, and the destination is the party responding to the session. It should be noted that after a data transmission channel is successfully established between the source and destination, session data can be sent from the source to the destination, or vice versa. The source and destination can be a client and a server (end-to-server scenario), or a client and a client (end-to-end scenario). Typically, before transmitting data or establishing a data transmission channel, a communication session needs to be established between the source and destination. This communication session has a session identifier to represent the interaction of session data between the source and destination.

[0115] A session invitation is an instruction initiated by the source end to indicate the session description information of the source end. Specifically, it can be an offer initiated by the source end, which carries the source end's SDP, called the offer SDP. Similarly, a session response is an instruction returned by the destination end to indicate the destination end's session description information. Specifically, it can be an answer returned by the source end, which carries the destination end's SDP, called the answer SDP. SDPs are used to exchange information between the two ends in real-time communication technology. One end uses the SDP to inform the other end which parameters to use in the media session. In one embodiment, in an end-to-server scenario, the terminal pulls a media stream from the server through a client. In response to the triggering operation of pulling the media stream from the server, the terminal can create a communication session, obtain the session description information of the communication session, and generate a session invitation based on the session description information. In another embodiment, in an end-to-end scenario, the terminal, as the source end, forwards the generated session invitation request to the peer end through the server. After receiving the session invitation, the peer end generates a corresponding session response and forwards the generated session response request to the source end through the server.

[0116] In one embodiment, the method is applied to the WebRTC framework. In an end-to-end scenario, the source terminal can set its local SDP by calling peerConnection.addIceCandidate in the WebRTC standard framework, setting the local SDP for the source peerConnection object, and then calling the peerConnection.createOffer method to create a session invitation offer SDP containing the local SDP. After successful creation, the SDP is sent to the server, requesting the server to forward it to the destination. Upon receiving the session invitation SDP, the destination calls `peerConnection.setRemoteDescription` to save the source's SDP, assigns the source's SDP to its `peerConnection` object, then calls `peerConnection.addIceCandidate` to obtain the destination's local SDP, saves the destination's local SDP to its `peerConnection` object, and calls `peerConnection.createAnswer` to create a session response SDP (`answerSDP`). After successful creation, it is sent to the server, requesting the server to forward it to the source. The source calls `peerConnection.setRemoteDescription` to save the destination's SDP, assigning the destination's SDP to its `peerConnection` object. This enables SDP information exchange between the source and destination. This SDP contains candidate addresses for data transmission that both parties can use, facilitating the exchange of candidate addresses. Each `peerConnection` object on both the source and destination sides contains its own and the other party's candidate address information, which can be used for subsequent connection checks.

[0117] In one embodiment, in an end-to-server scenario, the source terminal can set its local session description information (SDP) by calling the WebRTC standard interface `peerConnection.addIceCandidate`. Since the terminal connects directly to the server, requesting or uploading data from the server, this SDP may not contain candidate address information for data transmission. The terminal calls the `peerConnection.createOffer` method to create an offer SDP containing its local SDP. After successful creation, it sends the offer SDP to the server. The server calls `setRemoteDescription` to save the source SDP, then calls `peerConnection.addIceCandidate` to obtain its local SDP, saves the destination SDP, creates an answer signaling message containing the SDP, and sends the answer SDP to the terminal. The terminal then calls `setRemoteDescription` to save the server's SDP. The terminal obtains the candidate destination address for data transmission from the server's SDP, thus also achieving candidate address exchange.

[0118] Here are some examples:

[0119] The candidate addresses for the source are:

[0120] UDP: 192.168.1.100:60001, 172.168.40.6:60002;

[0121] TCP: 192.168.1.100:60003, 172.168.40.6:60004;

[0122] The candidate address for the destination is:

[0123] UDP: 183.60.131.111: 8000, 183.60.131.112: 8000;

[0124] TCP: 183.60.131.113: 8080, 183.60.131.114: 8080;

[0125] If the source does not receive a UDP answer from the destination, the source can determine that the UDP-based transport channel is unreachable and can directly generate four TCP-based candidate address combinations, with the following priorities from highest to lowest:

[0126] 192.168.1.100:60003 and 183.60.131.113:8080;

[0127] 172.168.40.6:60004 and 183.60.131.113:8080;

[0128] 192.168.1.100:60003 and 183.60.131.114:8080;

[0129] 172.168.40.6:60004 and 183.60.131.114:8080;

[0130] The source end can perform connection checks sequentially according to priority, and obtain the address combination used for data transmission when the connection status is "ready to send". The source end does not need to wait for the UDP connection to time out before considering switching the transport protocol, reducing the latency of data transmission.

[0131] It is understood that in the embodiments of this application, the connection-oriented transport layer protocol does not necessarily refer to TCP alone, but can also be other TCP-based transport protocols such as HTTP (Hypertext Transfer Protocol, a simple request-response protocol that typically runs on top of TCP) and WebSocket (a protocol for full-duplex communication over a single TCP connection). Similarly, the connectionless transport layer protocol does not necessarily refer to UDP alone, but can also be other UDP-based transport protocols such as QUIC (Quick UDP Internet Connection, a low-latency Internet transport layer protocol based on UDP) and SRT (Secure Reliable Transport, an open-source Internet transport protocol based on the UDT protocol). Most embodiments in this application are simplified and directly use TCP and UDP for illustration.

[0132] In one embodiment, to facilitate transmission, the terminal can also compress the session invitation to obtain binary data, thereby compressing the session invitation into binary data within one MTU (typically 1200 bytes), and then sending the compressed binary data to the destination based on both connectionless and connection-oriented transport layer protocols. The compression method used is not limited here.

[0133] In one embodiment, the terminal encapsulates the session invitation into a first interactive signaling according to a connectionless transport layer protocol, and encapsulates the session invitation into a second interactive signaling according to a connection-oriented transport layer protocol. The terminal then sends the first interactive signaling to the destination via the connectionless transport layer protocol and the second interactive signaling to the destination via the connection-oriented transport layer protocol. Further optionally, the terminal generates corresponding first interactive signaling based on the binary data corresponding to the session invitation, and generates corresponding second interactive signaling based on the binary data corresponding to the session invitation.

[0134] Step 604: Based on the transmission status of the session response to the session invitation from the destination, determine the connectivity detection results for the connectionless transmission channel and the connection-oriented transmission channel of the communication session.

[0135] It should be noted that the source sends session invitations through both connectionless and connection-oriented transport layer protocols. If the connectionless transmission channel from the source to the destination is open, the destination can receive the session invitation. If the connection-oriented transmission channel from the source to the destination is open, the destination can receive the session invitation. Otherwise, the destination cannot receive the session invitation or can only receive one of the session invitations.

[0136] When the destination receives a session invitation transmitted by the source using a connectionless transport layer protocol, the destination will respond with a corresponding session response using the connectionless transport layer protocol. When the destination receives a session invitation sent by the source using a connection-oriented transport layer protocol, the destination will respond with a corresponding session response using the connection-oriented transport layer protocol.

[0137] Therefore, if the connectionless transmission channel from the destination to the source is in a connected state, the source can receive the session response. If the connectionable transmission channel from the destination to the source is in a connected state, the source can receive the session response. Otherwise, the source cannot receive the session invitation or can only receive one of the session responses.

[0138] Therefore, if the source end can receive a session response from the destination end via a connectionless transport layer protocol, it indicates that both the connectionless transmission channels from the source end to the destination end and from the destination end to the source end are connected; that is, the connectionless transmission channel between the source end and the destination end is connected. Conversely, if the source end can receive a session response from the destination end via a connection-oriented transport layer protocol, it indicates that both the connection-oriented transmission channels from the source end to the destination end and from the destination end to the source end are connected; that is, the connection-oriented transmission channel between the source end and the destination end is connected.

[0139] Therefore, the transmission status of the session response from the destination to the session invitation can include the following four types: no session response received from the destination; only a session response received from the destination via a connectionless transport layer protocol; only a session response received from the destination via a connection-oriented transport layer protocol; and both session responses from the destination via connectionless and connection-oriented transport layer protocols (possibly in a specific order). Based on these four different transmission statuses, the source terminal can determine the connectivity detection results for both the connectionless and connection-oriented transmission channels of the communication session, namely: both the connectionless and connection-oriented transmission channels are in a connectionless state; only the connectionless transmission channel is in a connected state; only the connection-oriented transmission channel is in a connected state; and both the connectionless and connection-oriented transmission channels are in a connected state.

[0140] It can be seen that during the signaling interaction phase between the source and destination, the advantages and disadvantages of connectionless and connection-oriented transport layer protocols are complemented by using dual-channel signaling interaction through both connectionless and connection-oriented transmission channels. This improves the success rate of signaling interaction while simultaneously enabling connectivity detection for both channels. Subsequently, the terminal can directly initiate corresponding connection checks based on the detection results, eliminating the need to switch transport protocols only after a connection timeout.

[0141] In one embodiment, if the terminal only receives a session response from the destination end via a connectionless transport layer protocol in response to the first interactive signaling, it saves the candidate address of the destination end used for transmitting session data in the session response and determines that the connectionless transmission channel for the communication session is in a connected state. Specifically, the terminal can save the candidate address of the destination end in the session response by calling `peerConnection.setRemoteDescription`, and assign the candidate address to the peerConnection object of the source end. This peerConnection object can be used to generate candidate address combinations later. It is understood that since the session response is fed back via a connectionless transport layer protocol, the candidate address in the session response is a network address that can be used by the connectionless transmission channel of the communication session.

[0142] In one embodiment, if the terminal only receives a session response from the destination end via a connection-oriented transport layer protocol in response to the second interactive signaling, it saves the candidate address of the destination end used for transmitting session data in the session response and determines that the connection-oriented transmission channel for the communication session is in a connected state. Specifically, the terminal can save the candidate address of the destination end in the session response by calling `peerConnection.setRemoteDescription`, and assign the candidate address to the `peerConnection` object of the source end. This `peerConnection` object can be used to generate candidate address combinations later. It is understood that since the session response is fed back via a connection-oriented transport layer protocol, the candidate address in the session response is a network address that can be used by the connection-oriented transmission channel of the communication session.

[0143] In one embodiment, if the terminal receives a session response from the destination end via a connectionless transport layer protocol to the first interactive signaling, and also receives a session response from the destination end via a connection-oriented transport layer protocol to the second interactive signaling, then the terminal retains the destination candidate address used for transmitting session data in both session responses, and determines that both the connectionless and connection-oriented transmission channels for the communication session are in a connected state. Specifically, if the terminal first receives a session response, it can save the candidate address in the session response by calling peerConnection.setRemoteDescription. Subsequently, if the terminal receives remote candidate address information sent by the destination end, it directly saves the candidate address information by calling peerConnection.addIceCandidate, and assigns the newly received candidate address to the peerConnection object of the source end.

[0144] It should be noted that if the destination receives compressed binary data, it needs to decompress the binary data before obtaining the corresponding session invitation. Similarly, for ease of transmission, the destination can also compress the generated session response to obtain the corresponding binary data, and then send back the session response through both connectionless and connection-oriented transport layer protocols. In this case, the source also needs to decompress the received binary data to obtain the corresponding session response.

[0145] Step 606: Based on the connectivity detection results, establish a data transmission channel with the destination.

[0146] Specifically, after obtaining the connectivity detection results, the terminal can determine in advance which of the connectionless transmission channels and the connected transmission channels can successfully establish a connection, and then adaptively select one of them to establish a connection as needed.

[0147] Before establishing a connection, the terminal can perform a connection check based on candidate address combinations to determine the final path for transmitting session data. During the signaling interaction phase described above, the terminal obtains candidate addresses from both the local and destination ends. The terminal can combine these candidate addresses to obtain at least one candidate address combination and sort them by priority. The priority is determined based on parameters such as address type and media type, taking into account factors like latency, bandwidth resources, and packet loss. Typically, host-type candidate addresses have higher priority. Each candidate address combination can potentially be used to transmit session data. The terminal initiates a connection check request to the destination end for the highest priority candidate address combination according to their priority order. If a connection check response is received from the destination end, it indicates that the candidate address combination is connected, and both ends can use it to transmit session data. Otherwise, if a connection check response is not received from the destination end, or if the connection check response times out, the source end can obtain the next pair of candidate address combinations and initiate a connection check request for that next pair. In this way, the final path and channel for transmitting session data can be determined.

[0148] In one embodiment, if the connectionless transmission channel for the communication session is in a connected state, a connection check request is initiated based on the candidate address combination formed by the first address in the source candidate address and the second address in the destination candidate address; when a connection check response is received from the destination in response to the connection check request, a connectionless data transmission channel is established between the destination and the candidate address combination.

[0149] In one embodiment, if the connection-oriented transmission channel for the communication session is in a connected state, a connection check request is initiated based on the candidate address combination formed by the first address in the source candidate address and the second address in the destination candidate address; when a connection check response is received from the destination in response to the connection check request, a connection-oriented data transmission channel is established between the destination and the candidate address combination.

[0150] In one embodiment, if both the connectionless and connection-oriented transmission channels for a communication session are connected, the terminal can choose one to establish a data transmission channel as appropriate. Generally, due to the lower latency of the connectionless transmission channel, session data is preferentially transmitted through it. However, the terminal can also select based on factors such as the order in which session responses are received on each channel, round-trip time, and transmission quality (determined by frame rate and transmission quality parameters in the SDP). For example, even if the transmission quality of the connectionless transmission channel is poor, the connection-oriented transmission channel can still be established to transmit session data.

[0151] Step 608: Transmit session data of the communication session with the destination through the data transmission channel.

[0152] After successfully establishing a data transmission channel between the source and destination, session data of the communication session can be transmitted between the source and destination, such as the live media stream to be pulled in this communication session.

[0153] like Figure 7 The diagram shown is a flowchart of a data transmission method in a specific embodiment. (Refer to...) Figure 7 This application describes in detail the data transmission method provided in its embodiments from both ends. (Refer to...) Figure 7 The client acts as the source and the server as the destination. The source includes the standard WebRTC framework and the WebRTC SDK integrated in the client. Similarly, the destination includes the standard WebRTC framework and the WebRTC SDK integrated in the client. The method in this embodiment can be implemented using the WebRTC SDK.

[0154] Specifically, at the source end, upon receiving a pull request via the WebRTC SDK, a call to the WebRTC framework's standard interface peerConnection.addIceCandidate can be triggered to set the local SDP. Based on this SDP, a session invitation offer SDP is created by calling the WebRTC framework's standard interface peerConnection.createOffer. After successful creation, to facilitate transmission, the session invitation offer SDP is compressed into binary data, and the binary data is transmitted to the server side simultaneously via UDP and TCP (here, UDP transmission can use pure UDP or other UDP-based protocols such as QUIC, SRT, etc., and TCP transmission can use pure TCP or other TCP-based protocols such as HTTP, WebSocket, etc.).

[0155] Next, the destination WebRTC SDK creates a session response based on the arrival status of the binary data sent by the source: If binary data transmitted via UDP is received, the WebRTC SDK adds the server's UDP candidate address by calling `peerConnection.addIceCandidate`, decompresses the received binary data to obtain the offer SDP, and then saves the source's UDP candidate address by calling `peerConnection.setRemoteDescription`. In addition, the destination also creates a session response SDP based on the server's UDP candidate address by calling `peerConnection.createAnswer`, performs binary compression to obtain binary data, and returns it to the source via UDP.

[0156] If binary data transmitted via TCP is received, the WebRTC SDK adds a server-side TCP candidate address by calling `peerConnection.addIceCandidate`, decompresses the received binary data to obtain the offer SDP, and then saves the source-side TCP candidate address by calling `peerConnection.setRemoteDescription`. Additionally, the destination calls `peerConnection.createAnswer` to create a session response SDP based on the server-side TCP candidate address, performs binary compression to obtain binary data, and returns it to the source via TCP.

[0157] If, on the destination side, the binary data sent by the source is received later than the answer SDP is sent, it means that two binary data are received one after the other. In this case, the WebRTC SDK on the destination side directly calls peerConnection.addIceCandidate to add the candidate address received later and sends the candidate address separately to the source side.

[0158] Examples of UDP and TCP candidates are as follows: They can be sent via SDP answer or directly to the source:

[0159] a=candidate:1 1UDP 2130806431 183.60.131.113 8000typ host

[0160] a=candidate:2 1TCP 2111832063 183.60.131.113 8080typ host tcptypeactive

[0161] The first is a UDP candidate address, and the second is a TCP candidate address.

[0162] After receiving the binary data of the answer SDP, the source end decompresses and restores the answer SDP. Based on the candidate addresses of the destination end, it calls peerConnection.setRemoteDescription to save the destination end's SDP and assigns the destination end's SDP to the peerConnection object of the source end. This triggers standard WebRTC to initiate a connection check based on the combination of the candidate addresses from both sides in the peerConnection object.

[0163] If the source subsequently receives a candidate destination address from the destination, it sets the new candidate address to standard WebRTC by calling `peerConnection.addIceCandidate`. Standard WebRTC can then initiate a connection check to the new destination address. After the connection check passes, the server can adaptively select any connection for data transmission based on the transmission status.

[0164] In one specific embodiment, the data transmission method includes the following steps:

[0165] In response to a triggering operation that retrieves a media stream from the server, a communication session is created;

[0166] Obtain the session description information of the communication session;

[0167] Generate a session invitation for the communication session based on the session description information;

[0168] The session invitation is compressed to obtain binary data;

[0169] According to the connectionless transport layer protocol, the session invitation is encapsulated as the first interactive signaling;

[0170] According to the connection-oriented transport layer protocol, the session invitation is encapsulated as a second interactive signaling;

[0171] Send the first interactive signaling to the destination via a connectionless transport layer protocol and send the second interactive signaling to the destination via a connection-oriented transport layer protocol;

[0172] If only a session response is received from the destination via a connectionless transport layer protocol in response to the first interactive signaling, then the candidate address of the destination used for transmitting session data in the session response is saved, and it is determined that the connectionless transmission channel for the communication session is in a connected state.

[0173] If only a session response is received from the destination via a connection-oriented transport layer protocol in response to the second interactive signaling, then the candidate address of the destination used for transmitting session data in the session response is saved, and it is determined that the connection-oriented transmission channel for the communication session is in a connected state.

[0174] If, after receiving a session response from the destination end in response to the first interactive signaling via a connectionless transport layer protocol and saving the candidate address of the destination end used for transmitting session data in the session response, a candidate address is received from the destination end in response to the second interactive signaling via a connection-oriented transport layer protocol, then the candidate address is saved, and it is determined that both the connectionless transmission channel and the connection-oriented transmission channel for the communication session are in a connected state.

[0175] If the connectionless transmission channel for the communication session is in a connected state, a connection check request is initiated based on the candidate address combination formed by the first address in the source candidate address and the second address in the destination candidate address; when a connection check response is received from the destination in response to the connection check request, a connectionless data transmission channel is established between the destination and the candidate address combination.

[0176] If the connection-oriented transmission channel for the communication session is in a connected state, a connection check request is initiated based on the candidate address combination formed by the first address in the source candidate address and the second address in the destination candidate address; when a connection check response is received from the destination in response to the connection check request, a connection-oriented data transmission channel is established between the destination and the candidate address combination.

[0177] If both the connectionless and connectionless transmission channels for a communication session are in a connected state, then one of them is adaptively selected to establish a data transmission channel based on its respective transmission quality.

[0178] Session data of the communication session is transmitted between the device and the destination via the data transmission channel.

[0179] The aforementioned data transmission method leverages the complementary advantages and disadvantages of UDP and TCP. Through dual-channel signaling interaction between UDP and TCP, it achieves UDP and TCP connectivity detection. WebRTC adaptively selects either UDP or TCP to establish a connection for media data transmission, thus automatically adapting to various network scenarios. This improves the service quality of WebRTC-based services and overcomes the problems of successful signaling interaction but failed data transmission due to UDP communication failure, or the excessive latency caused by switching to other transmission protocols after timeout. It compensates for the shortcomings of relying solely on UDP for data transmission, improves QoS indicators and product technology completeness, and ultimately enhances the product experience.

[0180] This application also provides a data transmission method that can be applied to, for example... Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or placed on the cloud or other servers. In one embodiment, server 104, acting as the destination, sequentially receives session invitations from terminal 102, acting as the source, based on both connectionless and connection-oriented transport layer protocols. Server 104 collects candidate source addresses from the session invitations for transmitting session data, generates session responses in response to the session invitations based on the candidate destination addresses, and returns the session responses to the source via both connectionless and connection-oriented transport layer protocols. This establishes a data transmission channel between server 104 and the source based on the candidate source and destination addresses, and the session data of the communication session is transmitted between server 104 and the source through this data transmission channel.

[0181] In one embodiment, such as Figure 8 As shown, a data transmission method is provided, which is applied to... Figure 1 Taking server 104 as an example, it should be noted that the implementation details of this data transmission method can be found in the preceding description. The method specifically includes the following steps:

[0182] Step 802: Receive session invitations for communication sessions sent by the source end, respectively based on connectionless transport layer protocols and connection-oriented transport layer protocols.

[0183] It is understood that the source sends session invitations using both connectionless and connection-oriented transport layer protocols. If the connectionless transmission channel from the source to the destination is open, the destination can receive the session invitation. If the connection-oriented transmission channel from the source to the destination is open, the destination can also receive the session invitation. Otherwise, the destination cannot receive the session invitation or can only receive one type of session invitation. This embodiment illustrates this using the example of the destination receiving both types of session invitations.

[0184] Step 804: Collect candidate source addresses for transmitting session data from the session invitation.

[0185] Step 806: Generate a session response in response to the session invitation based on the candidate address of the destination.

[0186] Step 808: The session response is returned to the source end through both the connectionless transport layer protocol and the connection-oriented transport layer protocol, so as to establish a data transmission channel between the source end and the destination end based on the source end candidate address and the destination end candidate address.

[0187] After receiving the session invitation offer SDP, the destination server calls peerConnection.setRemoteDescription to save the source SDP, assigns the source SDP to the destination peerConnection object, then calls peerConnection.addIceCandidate to obtain the destination's local SDP, saves the destination's local SDP to the destination peerConnection object, calls peerConnection.createAnswer to create a session response answerSDP, and sends it to the terminal after successful creation.

[0188] It is understandable that when the destination receives a session invitation from the source via a connectionless transport layer protocol, the destination will respond with a corresponding session response via the connectionless transport layer protocol. When the destination receives a session invitation from the source via a connection-oriented transport layer protocol, the destination will respond with a corresponding session response via the connection-oriented transport layer protocol.

[0189] If the connectionless transmission channel from the destination to the source is open, the source can receive the session response. If the connectionable transmission channel from the destination to the source is open, the source can receive the session response. Otherwise, the source cannot receive the session invitation or can only receive one of the session responses.

[0190] If the source end receives a session response from the destination end via a connectionless transport layer protocol, it indicates that both the connectionless transmission channels from the source to the destination and from the destination to the source are connected; that is, the connectionless transmission channel between the source and the destination is connected. Conversely, if the source end receives a session response from the destination end via a connection-oriented transport layer protocol, it indicates that both the connection-oriented transmission channels from the source to the destination and from the destination to the source are connected; that is, the connection-oriented transmission channel between the source and the destination is connected.

[0191] Therefore, the transmission status of the session response from the destination to the session invitation can include the following four types: no session response received from the destination; only a session response received from the destination via a connectionless transport layer protocol; only a session response received from the destination via a connection-oriented transport layer protocol; and both session responses from the destination via connectionless and connection-oriented transport layer protocols (possibly in a specific order). Based on these four different transmission statuses, the source terminal can determine the connectivity detection results for both the connectionless and connection-oriented transmission channels of the communication session, namely: both the connectionless and connection-oriented transmission channels are in a connectionless state; only the connectionless transmission channel is in a connected state; only the connection-oriented transmission channel is in a connected state; and both the connectionless and connection-oriented transmission channels are in a connected state.

[0192] Step 810: Transmit session data of the communication session with the source end through the data transmission channel.

[0193] In one embodiment, the server acting as the destination receives binary data about the communication session sent by the source end, respectively based on a connectionless transport layer protocol and a connection-oriented transport layer protocol. The binary data is a compressed session invitation. The server decompresses the binary data to obtain the session invitation about the communication session.

[0194] In this embodiment, to facilitate transmission, the source end can also compress the session invitation to obtain binary data, thereby compressing the session invitation into binary data within one MTU (generally 1200 bytes). Then, based on the connectionless transport layer protocol and the connection-oriented transport layer protocol respectively, the compressed binary data is sent to the destination end. After receiving the binary data, the destination end performs decompression processing to restore the session invitation.

[0195] In one embodiment, returning a session response to the source end via a connectionless transport layer protocol and a connection-oriented transport layer protocol respectively includes: compressing the session response to obtain binary data, and sending the binary data to the source end via the connectionless transport layer protocol and the connection-oriented transport layer protocol respectively.

[0196] To facilitate transmission, the destination end can also compress the generated session response to obtain the corresponding binary data, and then send back the session response through the connectionless transport layer protocol and the connection-oriented transport layer protocol respectively. In this case, the source end also needs to decompress the received binary data in order to obtain the corresponding session response.

[0197] In one embodiment, returning a session response to the source end via a connectionless transport layer protocol and a connection-oriented transport layer protocol respectively includes: encapsulating the session response into a third interactive signaling according to the connectionless transport layer protocol, encapsulating the session response into a fourth interactive signaling according to the connection-oriented transport layer protocol, sending the third interactive signaling to the source end via the connectionless transport layer protocol, and sending the fourth interactive signaling to the source end via the connection-oriented transport layer protocol.

[0198] Before establishing a connection, the terminal can perform a connection check based on candidate address combinations to determine the final path for transmitting session data. During the signaling interaction phase described above, the terminal obtains candidate addresses from both the local and destination ends. The terminal can combine these candidate addresses to obtain at least one candidate address combination and sort them by priority. The priority is determined based on parameters such as address type and media type, taking into account factors like latency, bandwidth resources, and packet loss. Typically, host-type candidate addresses have higher priority. Each candidate address combination can potentially be used to transmit session data. The terminal initiates a connection check request to the destination end for the highest priority candidate address combination according to their priority order. If a connection check response is received from the destination end, it indicates that the candidate address combination is connected, and both ends can use it to transmit session data. Otherwise, if a connection check response is not received from the destination end, or if the connection check response times out, the source end can obtain the next pair of candidate address combinations and initiate a connection check request for that next pair. In this way, the final path and channel for transmitting session data can be determined.

[0199] In one embodiment, establishing a data transmission channel with a source end based on a source end candidate address and a destination end candidate address includes: receiving a connection check request initiated by the source end based on a first address from the source end candidate addresses and a second address from the destination end candidate addresses; when the first address and the second address are found to be a candidate address combination related to a communication session, sending a connection check response back to the source end to determine the data transmission channel with the source end formed by the first address and the second address. When both the first address and the second address are candidate addresses oriented towards connection-oriented transmission, the data transmission channel is a connection-oriented data transmission channel; when both the first address and the second address are candidate addresses oriented towards connectionless transmission, the data transmission channel is a connectionless data transmission channel.

[0200] In a specific embodiment, the data transmission method is described from the perspectives of both the source and destination ends, and specifically includes the following steps:

[0201] The source responds to the trigger operation of pulling media stream from the server, creates a communication session, obtains the session description information of the communication session, generates a session invitation for the communication session based on the session description information, compresses the session invitation, and obtains binary data.

[0202] The source end sends binary data to the destination end based on connectionless transport layer protocols and connection-oriented transport layer protocols, respectively.

[0203] If the target end receives binary data transmitted via a connectionless transport layer protocol, it decompresses the data to obtain a session invitation transmitted via the connectionless transport layer protocol, retrieves the connectionless source candidate address from the session invitation, and saves it. The destination end sets the connectionless destination candidate address, creates a session response based on the destination candidate address, and sends the session response back to the source end via the connectionless transport layer protocol.

[0204] If the target end receives binary data transmitted via a connection-oriented transport layer protocol, it decompresses the data to obtain a session invitation transmitted via the connection-oriented transport layer protocol, retrieves the connection-oriented source candidate address from the session invitation, and saves it. The destination end sets the connection-oriented destination candidate address, creates a session response based on the destination candidate address, and sends the session response back to the source end via the connection-oriented transport layer protocol.

[0205] If the source end only receives a session response from the destination end via a connectionless transport layer protocol, it saves the candidate address of the destination end used to transmit session data in the session response and determines that the connectionless transmission channel for the communication session is in a connected state.

[0206] If the source end only receives a session response from the destination end via a connection-oriented transport layer protocol, it saves the candidate address of the destination end used to transmit session data in the session response and determines that the connection-oriented transmission channel for the communication session is in a connected state.

[0207] If the source end receives a session response from the destination end via a connectionless transport layer protocol and saves the candidate address of the destination end used for transmitting session data in the session response, and then receives a candidate address from the destination end via a connection-oriented transport layer protocol, then it saves the candidate address and determines that both the connectionless and connection-oriented transmission channels for the communication session are in a connected state.

[0208] If the connectionless transmission channel for the communication session is in a connected state, the source end initiates a connection check request for the candidate address combination formed by the first address in the source end's candidate address and the second address in the destination end's candidate address; when the source end receives the connection check response from the destination end in response to the connection check request, a connectionless data transmission channel is established between the source end and the destination end based on the candidate address combination.

[0209] If the connection-oriented transmission channel for the communication session is in a connected state, the source end initiates a connection check request for the candidate address combination formed by the first address in the source end's candidate address and the second address in the destination end's candidate address. When the source end receives the connection check response from the destination end in response to the connection check request, a connection-oriented data transmission channel is established between the source end and the destination end based on the candidate address combination.

[0210] Session data of a communication session is transmitted between the source and destination via a data transmission channel.

[0211] The aforementioned data transmission method, in the signaling interaction phase between the source and destination, leverages the complementary advantages and disadvantages of connectionless and connection-oriented transport layer protocols. Through dual-channel signaling interaction via both connectionless and connection-oriented transport channels, it improves the success rate of signaling interaction while simultaneously enabling connectivity detection for both channels. Specifically, when the destination receives session invitations for communication sessions from the source based on both connectionless and connection-oriented transport layer protocols, it collects candidate source addresses for transmitting session data from these invitations. Based on its local candidate destination addresses, it generates session responses to these invitations and transmits the responses via connectionless and connection-oriented transport layer protocols respectively. The transport layer protocol and the connection-oriented transport layer protocol return the session response to the source, so that the source can determine the connectivity detection results of the connectionless and connection-oriented transport channels for the communication session based on the transmission status of the session response. Based on the connectivity detection results, the source can adaptively select one of the candidate addresses of the source and destination to establish a data transmission channel with the source. During the data transmission phase, the session data of the communication session is transmitted between the source and the destination based on the established data transmission channel. Throughout the process, the source does not need to wait for a timeout and then try to establish a connection through other means. Instead, it directly completes the connectivity detection of the two types of channels while realizing signaling interaction, which greatly reduces the latency of data transmission and improves the service experience.

[0212] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0213] Based on the same inventive concept, this application also provides a data transmission apparatus for implementing the data transmission method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, specific limitations in one or more data transmission apparatus embodiments provided below can be found in the limitations of the data transmission method described above, and will not be repeated here.

[0214] In one embodiment, such as Figure 9 As shown, a data transmission device 900 is provided, including: a session invitation sending module 902, a connectivity detection module 904, a connection establishment module 906, and a transmission module 908, wherein:

[0215] The session invitation sending module 902 is used to generate a session invitation for a communication session and send the session invitation to the destination based on both connectionless and connection-oriented transport layer protocols.

[0216] The connectivity detection module 904 is used to determine the connectivity detection results of the connectionless transmission channel and the connection-oriented transmission channel for the communication session based on the transmission status of the session response fed back by the destination to the session invitation.

[0217] The connection establishment module 906 is used to establish a data transmission channel with the destination based on the connectivity detection results;

[0218] The transmission module 908 is used to transmit session data of the communication session with the destination through the data transmission channel.

[0219] In one embodiment, the session invitation sending module 902 is further configured to create a communication session in response to a trigger operation that pulls a media stream from the server; obtain session description information of the communication session; and generate a session invitation for the communication session based on the session description information.

[0220] In one embodiment, the session invitation sending module 902 is further configured to compress the session invitation to obtain binary data; and send the binary data to the destination based on the connectionless transport layer protocol and the connection-oriented transport layer protocol, respectively.

[0221] In one embodiment, the session invitation sending module 902 is further configured to encapsulate the session invitation into a first interactive signaling according to a connectionless transport layer protocol; encapsulate the session invitation into a second interactive signaling according to a connection-oriented transport layer protocol; send the first interactive signaling to the destination via a connectionless transport layer protocol and send the second interactive signaling to the destination via a connection-oriented transport layer protocol.

[0222] In one embodiment, the connectivity detection module 904 is further configured to: if only a session response from the destination to the first interactive signaling via a connectionless transport layer protocol is received, then save the candidate address of the destination used for transmitting session data in the session response and determine that the connectionless transmission channel for the communication session is in a connected state; if only a session response from the destination to the second interactive signaling via a connection-oriented transport layer protocol is received, then save the candidate address of the destination used for transmitting session data in the session response and determine that the connection-oriented transmission channel for the communication session is in a connected state.

[0223] In one embodiment, the connection establishment module 906 is further configured to, if the connectionless transmission channel for the communication session is in a connected state, initiate a connection check request for the candidate address combination formed by the first address in the source candidate address and the second address in the destination candidate address; and when a connection check response is received from the destination in response to the connection check request, establish a connectionless data transmission channel with the destination based on the candidate address combination.

[0224] In one embodiment, the connection establishment module 906 is further configured to, if the connection-oriented transmission channel for the communication session is in a connected state, initiate a connection check request for the candidate address combination formed by the first address in the source candidate address and the second address in the destination candidate address; and when a connection check response is received from the destination in response to the connection check request, establish a connection-oriented data transmission channel with the destination based on the candidate address combination.

[0225] In one embodiment, the connectivity detection module 904 is further configured to, if after receiving a session response from the destination end to the first interactive signaling via a connectionless transport layer protocol and saving the candidate address of the destination end used for transmitting session data in the session response, receive a candidate address from the destination end to the second interactive signaling via a connection-oriented transport layer protocol, save the candidate address and determine that both the connectionless transmission channel and the connection-oriented transmission channel of the communication session are in a connected state.

[0226] The aforementioned data transmission device 900, during the signaling interaction phase between the source and destination, leverages the complementary advantages and disadvantages of connectionless and connection-oriented transport layer protocols. Through dual-channel signaling interaction via both connectionless and connection-oriented transmission channels, it improves the success rate of signaling interaction while simultaneously probing the connectivity of both channels. Specifically, the source generates a session invitation for a communication session and sends it to the destination based on both the connectionless and connection-oriented transport layer protocols. The device then responds to the session invitation based on the session reply from the destination. The transmission status is determined to establish connectivity detection results for both the connectionless and connected transmission channels for the communication session. Based on these results, either the connectionless or connected transmission channel can be adaptively selected to seamlessly establish a connection with the destination. During data transmission, session data is transmitted between the destination and the established data transmission channel. This eliminates the need to wait for timeouts before attempting to establish a connection through other means; connectivity detection for both channels is completed simultaneously with signaling interaction, significantly reducing data transmission latency and improving the service experience.

[0227] Each module in the aforementioned data transmission device 900 can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.

[0228] In one embodiment, such as Figure 10 As shown, a data transmission device 1000 is provided, including: a session invitation receiving module 1002, a source address adding module 1004, a session response generating module 1006, a session response sending module 1008, and a transmission module 1010, wherein:

[0229] The session invitation receiving module 1002 is used to sequentially receive session invitations about communication sessions sent by the source end based on connectionless transport layer protocols and connection-oriented transport layer protocols, respectively.

[0230] The source address addition module 1004 is used to collect candidate source addresses for transmitting session data in the session invitation;

[0231] The session response generation module 1006 is used to generate a session response in response to the session invitation based on the candidate address of the destination.

[0232] The session response sending module 1008 is used to return the session response to the source end through the connectionless transport layer protocol and the connection-oriented transport layer protocol respectively, so as to establish a data transmission channel with the source end based on the source end candidate address and the destination end candidate address.

[0233] The transmission module 1010 is used to transmit session data of a communication session with the source end through a data transmission channel.

[0234] In one embodiment, the session invitation receiving module 1002 is further configured to sequentially receive binary data about the communication session sent by the source end based on a connectionless transport layer protocol and a connection-oriented transport layer protocol, respectively, wherein the binary data is a compressed session invitation; and decompress the binary data to obtain the session invitation about the communication session.

[0235] In one embodiment, the session response sending module 1008 is further configured to compress the session response to obtain binary data; and send the binary data to the source end based on the connectionless transport layer protocol and the connection-oriented transport layer protocol, respectively.

[0236] In one embodiment, the session response sending module 1008 is further configured to encapsulate the session response into a third interactive signaling according to a connectionless transport layer protocol; encapsulate the session response into a fourth interactive signaling according to a connection-oriented transport layer protocol; send the third interactive signaling to the source end via a connectionless transport layer protocol; and send the fourth interactive signaling to the source end via a connection-oriented transport layer protocol.

[0237] In one embodiment, the apparatus further includes a connection establishment module, configured to receive a connection check request initiated by the source end based on a first address in the source end candidate addresses and a second address in the destination end candidate addresses; when the first address and the second address are found to be a candidate address combination for a communication session, the module sends a connection check response back to the source end to determine the data transmission channel between the source end and the first address and the second address.

[0238] The aforementioned data transmission device 1000, during the signaling interaction phase between the source and destination, leverages the complementary advantages and disadvantages of connectionless and connection-oriented transport layer protocols. Through dual-channel signaling interaction via both connectionless and connection-oriented transmission channels, it improves the success rate of signaling interaction while simultaneously enabling connectivity detection for both channels. Specifically, when the destination receives session invitations for communication sessions from the source based on both connectionless and connection-oriented transport layer protocols, it collects candidate source addresses for transmitting session data from these invitations. Based on its local candidate destination address, it generates a session response to the invitation and transmits the response via both connectionless and connection-oriented transport layer protocols. The transport layer protocol and the connection-oriented transport layer protocol return the session response to the source, so that the source can determine the connectivity detection results of the connectionless and connection-oriented transport channels for the communication session based on the transmission status of the session response. Based on the connectivity detection results, the source can adaptively select one of the candidate addresses of the source and the candidate address of the destination to establish a data transmission channel with the source. In the data transmission phase, the session data of the communication session is transmitted between the source and the destination based on the established data transmission channel. Throughout the process, the source does not need to wait for a timeout and then try to establish a connection through other means. Instead, it directly completes the connectivity detection of the two types of channels while realizing signaling interaction, which greatly reduces the latency of data transmission and improves the service experience.

[0239] Each module in the aforementioned data transmission device 1000 can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.

[0240] In one embodiment, a computer device is provided, the computer device may be... Figure 1 The internal structure of server 104 shown can be illustrated as follows: Figure 11As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores session data such as media resource data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a data transmission method.

[0241] In one embodiment, a computer device is provided, the computer device may be... Figure 1 The internal structure of the terminal 102 shown can be illustrated as follows: Figure 12 As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a data transmission method. The display unit of the computer device is used to form a visually visible image. It can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.

[0242] Those skilled in the art will understand that Figure 11 , 12The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0243] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the data transmission method described in any one or more of the above embodiments.

[0244] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the data transmission method described in any one or more of the above embodiments.

[0245] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of the data transmission method described in any one or more of the above embodiments.

[0246] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data shall comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0247] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0248] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0249] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A data transmission method, characterized in that, The method includes: During the signaling interaction phase, a session invitation for a communication session is generated based on the session description protocol. The session invitation is sent to the destination based on both the connectionless transport layer protocol and the connection-oriented transport layer protocol. The session invitation is an instruction initiated by the source end to indicate the session description information of the source end. Based on the transmission status of the session response fed back by the destination to the session invitation, the connectivity detection results of the connectionless transmission channel and the connection-oriented transmission channel for the communication session are determined respectively. The session response is an instruction fed back by the destination to indicate the session description information of the destination. The connectivity detection results are used to characterize the connectivity status corresponding to the transmission protocol type. Based on the connectivity detection results, establish a data transmission channel with the destination. During the data transmission phase, session data of the communication session is transmitted between the communication session and the destination through the data transmission channel.

2. The method according to claim 1, characterized in that, The session invitation for generating a communication session based on the session description protocol includes: In response to a triggering operation that retrieves a media stream from the server, a communication session is created; The session description information of the communication session is obtained based on the session description protocol; Based on the session description information, a session invitation for the communication session is generated.

3. The method according to claim 1, characterized in that, Sending the session invitation to the destination based on connectionless and connection-oriented transport layer protocols respectively includes: The session invitation is compressed to obtain binary data; The binary data is sent to the destination based on both connectionless and connection-oriented transport layer protocols.

4. The method according to claim 1, characterized in that, Sending the session invitation to the destination based on connectionless and connection-oriented transport layer protocols respectively includes: According to the connectionless transport layer protocol, the session invitation is encapsulated as a first interactive signaling; According to the connection-oriented transport layer protocol, the session invitation is encapsulated as a second interactive signaling; The first interactive signaling is sent to the destination via a connectionless transport layer protocol, and the second interactive signaling is sent to the destination via a connection-oriented transport layer protocol.

5. The method according to claim 4, characterized in that, The step of determining the connectivity detection results of the connectionless and connection-oriented transmission channels for the communication session based on the transmission status of the session response returned by the destination to the session invitation includes: If only a session response is received from the destination end in response to the first interactive signaling via a connectionless transport layer protocol, then the candidate address of the destination end used for transmitting session data in the session response is saved, and it is determined that the connectionless transmission channel for the communication session is in a connected state. If only a session response is received from the destination end in response to the second interactive signaling via a connection-oriented transport layer protocol, then the candidate address of the destination end used for transmitting session data in the session response is saved, and it is determined that the connection-oriented transmission channel for the communication session is in a connected state.

6. The method according to claim 5, characterized in that, Establishing a data transmission channel with the destination based on the connectivity detection results includes: If the connectionless transmission channel for the communication session is in a connected state, a connection check request is initiated for the candidate address combination formed by the first address in the source candidate address and the second address in the destination candidate address. When a connection check response is received from the destination in response to the connection check request, a connectionless data transmission channel is established between the destination and the candidate address combination.

7. The method according to claim 5, characterized in that, Establishing a data transmission channel with the destination based on the connectivity detection results includes: If the connection transmission channel for the communication session is in a connected state, a connection check request is initiated for the candidate address combination formed by the first address in the source candidate address and the second address in the destination candidate address. When a connection check response is received from the destination in response to the connection check request, a connection-oriented data transmission channel is established between the destination and the candidate address combination.

8. The method according to claim 4, characterized in that, The step of determining the connectivity detection results of the connectionless and connection-oriented transmission channels for the communication session based on the transmission status of the session response returned by the destination to the session invitation includes: If, after receiving a session response from the destination end to the first interactive signaling via a connectionless transport layer protocol and saving the candidate address of the destination end used for transmitting session data in the session response, a candidate address is then received from the destination end to the second interactive signaling via a connection-oriented transport layer protocol, the candidate address is saved, and it is determined that both the connectionless transmission channel and the connection-oriented transmission channel for the communication session are in a connected state.

9. A data transmission method, characterized in that, The method includes: During the signaling interaction phase, the system sequentially receives session invitations from the source end, which are based on connectionless transport layer protocols and connection-oriented transport layer protocols, respectively. The session invitations are generated by the source end based on a session description protocol and are instructions used to indicate the session description information of the source end. Collect the candidate source addresses used for transmitting session data in the session invitation; A session response to the session invitation is generated based on the candidate address of the destination. The session response is an instruction fed back by the destination to indicate the session description information of the destination. The session response is returned to the source end via both a connectionless transport layer protocol and a connection-oriented transport layer protocol, respectively, so as to establish a data transmission channel between the source end and the destination end based on the source end candidate address and the destination end candidate address. During the data transmission phase, the session data of the communication session is transmitted between the source end and the data transmission channel.

10. The method according to claim 9, characterized in that, The sequential receipt of session invitations regarding communication sessions sent by the source end based on connectionless transport layer protocols and connection-oriented transport layer protocols respectively includes: The system sequentially receives binary data about a communication session sent by the source end based on a connectionless transport layer protocol and a connection-oriented transport layer protocol, respectively. The binary data is a compressed session invitation. The binary data is decompressed to obtain a session invitation for the communication session.

11. The method according to claim 9, characterized in that, The step of returning the session response to the source end via a connectionless transport layer protocol and a connection-oriented transport layer protocol, respectively, includes: The session response is compressed to obtain binary data; The binary data is sent to the source end based on a connectionless transport layer protocol and a connection-oriented transport layer protocol, respectively.

12. The method according to claim 9, characterized in that, The step of returning the session response to the source end via a connectionless transport layer protocol and a connection-oriented transport layer protocol, respectively, includes: According to the connectionless transport layer protocol, the session response is encapsulated as a third interactive signaling; According to the connection-oriented transport layer protocol, the session response is encapsulated as a fourth interactive signaling; The third interactive signaling is sent to the source end via a connectionless transport layer protocol, and the fourth interactive signaling is sent to the source end via a connection-oriented transport layer protocol.

13. The method according to claim 9, characterized in that, The step of establishing a data transmission channel with the source end based on the source end candidate address and the destination end candidate address includes: Receive a connection check request initiated by the source end based on the first address in the source end candidate addresses and the second address in the destination end candidate addresses; When it is detected that the first address and the second address belong to the candidate address combination for the communication session, a connection check response is sent back to the source end to determine the data transmission channel between the source end formed by the first address and the second address.

14. A data transmission device, characterized in that, The device includes: The session invitation sending module is used to generate a session invitation for a communication session based on the session description protocol during the signaling interaction phase. The session invitation is sent to the destination based on both the connectionless transport layer protocol and the connection-oriented transport layer protocol. The session invitation is an instruction initiated by the source end to indicate the session description information of the source end. The connectivity detection module is used to determine the connectivity detection results of the connectionless transmission channel and the connection-oriented transmission channel of the communication session based on the transmission status of the session response fed back by the destination to the session invitation. The session response is an instruction fed back by the destination to indicate the session description information of the destination. The connectivity detection results are used to characterize the connectivity status corresponding to the transmission protocol type. A connection establishment module is used to establish a data transmission channel with the destination end based on the connectivity detection results; The transmission module is used to transmit session data of the communication session with the destination end through the data transmission channel during the data transmission phase.

15. The apparatus according to claim 14, characterized in that, The session invitation sending module is also used to create a communication session in response to a trigger operation that pulls a media stream from the server; obtain session description information of the communication session based on a session description protocol; and generate a session invitation for the communication session based on the session description information.

16. The apparatus according to claim 14, characterized in that, The session invitation sending module is further configured to compress the session invitation to obtain binary data; and send the binary data to the destination based on the connectionless transport layer protocol and the connection-oriented transport layer protocol, respectively.

17. The apparatus according to claim 14, characterized in that, The session invitation sending module is further configured to encapsulate the session invitation into a first interactive signaling according to the connectionless transport layer protocol; encapsulate the session invitation into a second interactive signaling according to the connection-oriented transport layer protocol; send the first interactive signaling to the destination through the connectionless transport layer protocol and send the second interactive signaling to the destination through the connection-oriented transport layer protocol.

18. The apparatus according to claim 17, characterized in that, The connectivity detection module is further configured to, if only a session response is received from the destination end in response to the first interactive signaling via a connectionless transport layer protocol, save the candidate address of the destination end used for transmitting session data in the session response and determine that the connectionless transmission channel for the communication session is in a connected state. If only a session response is received from the destination via a connection-oriented transport layer protocol in response to the second interactive signaling, then the candidate address of the destination used for transmitting session data in the session response is saved, and it is determined that the connection-oriented transmission channel for the communication session is in a connected state.

19. The apparatus according to claim 18, characterized in that, The connection establishment module is further configured to, if the connectionless transmission channel for the communication session is in a connected state, initiate a connection check request for the candidate address combination formed by the first address in the source candidate address and the second address in the destination candidate address; When a connection check response is received from the destination in response to the connection check request, a connectionless data transmission channel is established between the destination and the candidate address combination.

20. The apparatus according to claim 18, characterized in that, The connection establishment module is further configured to, if the connection transmission channel for the communication session is in a connected state, initiate a connection check request for the candidate address combination formed by the first address in the source candidate address and the second address in the destination candidate address; When a connection check response is received from the destination in response to the connection check request, a connection-oriented data transmission channel is established between the destination and the candidate address combination.

21. The apparatus according to claim 17, characterized in that, The connectivity detection module is further configured to, if after receiving a session response from the destination end to the first interactive signaling via a connectionless transport layer protocol and saving the candidate address of the destination end used for transmitting session data in the session response, receive a candidate address from the destination end to the second interactive signaling via a connection-oriented transport layer protocol, save the candidate address and determine that both the connectionless transmission channel and the connection-oriented transmission channel of the communication session are in a connected state.

22. A data transmission device, characterized in that, The device includes: The session invitation receiving module is used to sequentially receive session invitations about communication sessions sent by the source end during the signaling interaction phase, respectively based on a connectionless transport layer protocol and a connection-oriented transport layer protocol. The session invitation is generated by the source end based on a session description protocol and is an instruction used to indicate the session description information of the source end. The source address addition module is used to collect candidate source addresses for transmitting session data in the session invitation; The session response generation module is used to generate a session response in response to the session invitation based on the candidate address of the destination. The session response is an instruction fed back by the destination to indicate the session description information of the destination. The session response sending module is used to return the session response to the source end through a connectionless transport layer protocol and a connection-oriented transport layer protocol, respectively, so as to establish a data transmission channel with the source end based on the source end candidate address and the destination end candidate address; The transmission module is used to transmit session data of the communication session with the source end through the data transmission channel during the data transmission phase.

23. The apparatus according to claim 22, characterized in that, The session invitation receiving module is further configured to sequentially receive binary data about the communication session sent by the source end based on a connectionless transport layer protocol and a connection-oriented transport layer protocol, respectively, wherein the binary data is a compressed session invitation; and decompress the binary data to obtain the session invitation about the communication session.

24. The apparatus according to claim 22, characterized in that, The session response sending module is further configured to compress the session response to obtain binary data; and send the binary data to the source end based on the connectionless transport layer protocol and the connection-oriented transport layer protocol, respectively.

25. The apparatus according to claim 22, characterized in that, The session response sending module is further configured to encapsulate the session response into a third interactive signaling according to the connectionless transport layer protocol; encapsulate the session response into a fourth interactive signaling according to the connection-oriented transport layer protocol; send the third interactive signaling to the source end through the connectionless transport layer protocol and send the fourth interactive signaling to the source end through the connection-oriented transport layer protocol.

26. The apparatus according to claim 22, characterized in that, The device further includes: A connection establishment module is configured to receive a connection check request initiated by the source end based on a first address among the source end candidate addresses and a second address among the destination end candidate addresses; when it is detected that the first address and the second address belong to a candidate address combination for the communication session, a connection check response is sent back to the source end to determine the data transmission channel between the source end and the first address and the second address.

27. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 13.

28. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 13.

29. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 13.

Citation Information

Patent Citations

  • Method and system for realizing rapid routing of KAD network nodes

    CN112039775A