Communication method and system

By establishing a relay channel in P2P communication to optimize the candidate address exchange path, the problem of time-consuming ICE negotiation process is solved, the signaling server load and connection latency are reduced, and the efficiency and success rate of P2P communication are improved.

CN121567683AActive Publication Date: 2026-02-24SHANGHAI YINGJIAO NETWORK TECH CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202610077416.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-21
Publication Date
2026-02-24
Estimated Expiration
2046-01-21

AI Technical Summary

Technical Problem

In existing P2P real-time communication, the ICE negotiation process takes too long and the signaling server is overloaded, resulting in connection establishment delays and poor user experience.

Method used

By establishing a trunk channel between the calling and called parties, the exchange path of candidate address information is optimized, enabling direct synchronization of candidate address information between clients and avoiding multiple rounds of signaling server relay.

Benefits of technology

It significantly reduces the load on the signaling server and connection establishment latency, improves connection success rate, maintains compatibility between the ICE process and the STUN/TURN protocol, and requires no architectural modifications to the existing system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121567683A_ABST
    Figure CN121567683A_ABST
Patent Text Reader

Abstract

The invention provides a communication method and system, which is used for establishing point-to-point communication connection between a calling terminal and a called terminal, and comprises the following steps: 1, the calling terminal collects calling terminal candidate address information, and the called terminal collects called terminal candidate address information; 2, the calling terminal at least sends the calling terminal relay candidate address to the called terminal through the signaling server; step 3, the called terminal establishes a relay channel between the called terminal and the calling terminal through the relay server based on the calling terminal relay candidate address and the called terminal relay candidate address; a fourth step of enabling the called terminal and the calling terminal to respectively send the rest candidate addresses through the relay channel; a fifth step of performing connectivity check on the calling terminal and the called terminal; and a sixth step of establishing a final transmission path based on a result of the connectivity check. Therefore, the pressure of the signaling server can be effectively reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to a communication method and system. Background Technology

[0002] Currently, P2P (Peer-to-Peer) real-time communication is widely used in scenarios such as audio and video calls, online collaboration, and IoT device interaction. Since terminals are usually located behind different NATs (Network Address Translation) and firewalls, direct connection paths are often difficult to establish. Therefore, mainstream systems generally adopt the ICE (Interactive Connectivity Establishment) mechanism, combined with STUN and TURN protocols, to discover reachable network paths between the two parties, thereby achieving end-to-end communication in complex network environments.

[0003] In conventional ICE (Interruptible Connection) systems, a persistent problem in practical use is the slow connection establishment process, which consumes excessive time during the ICE negotiation phase. When initiating a call, the client first communicates with the STUN and TURN servers to obtain mapping candidate addresses and trunk candidate addresses, respectively. Based on this, a host candidate address is added, constructing three types of ICE candidates. These three types of candidates are then added to the SDP (Software as a Protocol) attributes. Only after this action is completed does the actual SDP offer request begin. The receiver goes through the same process, and the actual P2P connection establishment only begins after both sides have received complete SDP information from the other. In other words, connection establishment occurs only after all candidates have been obtained, resulting in a significant waste of time.

[0004] In contrast, to accelerate call establishment, existing technologies have proposed a connectivity check technique called ICE Trickle. In ICE Trickle, the calling end generates and initiates an SDP Offer (which may contain no or only a few candidates), then collects candidates and sends them to the other end. Upon receiving the SDP Offer, the called end can immediately generate and return an SDP Answer (which may contain no or only a few candidates), then collects candidates and sends them to the other end, initiating the actual P2P connection establishment. For example, consider a typical process using ICE Trickle in WebRTC: When client A initiates a session, it first generates its own session description information (SDP Offer) and sends it to client B via a signaling server. After generating the corresponding session description information (SDP Answer), client B returns it to client A via the signaling server, thus completing the SDP exchange. Simultaneously with or before generating the SDP Offer / Answer, the ICE Agents of client A and client B respectively initiate a candidate address collection process, continuously acquiring their own candidate address information during the candidate address generation process, and exchanging candidate addresses multiple times via the signaling server using a Trickle mechanism. The candidate address information mentioned here includes host candidate addresses, server-reflexive candidate addresses, and relay candidate addresses. After receiving candidate address information sent by the peer, any client updates its local candidate table and performs connectivity checks based on the formed candidate pairs, thereby progressively filtering and determining the final reachable transmission path.

[0005] However, regardless of whether it is a regular ICE or a Trickle ICE, the exchange of candidate address information must and can only rely on the signaling server for multiple rounds of relay. Even if the communication eventually degenerates into a relay mode (Relay→Relay), candidate synchronization still needs to go through multiple rounds of relay by the signaling server, which can easily cause signaling interaction redundancy, excessive server load and a significant increase in connection establishment latency, thereby affecting the user experience. Summary of the Invention

[0006] The problem the invention aims to solve: To address the aforementioned problems, the purpose of this application is to provide a communication method and system that can significantly reduce the load on signaling servers.

[0007] Technical means to solve the problem: This application provides a communication method for establishing a point-to-point communication connection between the calling end and the called end in a system including a calling end, a called end, and a signaling server, comprising: In the first step, the calling end collects calling end candidate address information, which includes at least calling end trunk candidate addresses, and the called end collects called end candidate address information, which includes at least called end trunk candidate addresses. In the second step, the calling end sends the calling end trunk candidate address to the called end at least through the signaling server; The third step is that the called end establishes a trunk channel between the called end and the calling end through a trunk server based on the received trunk candidate address of the calling end and the trunk candidate address of the called end. The fourth step involves the called party sending candidate addresses (excluding the called party's trunk candidate addresses) from the called party's candidate address information to the calling party via the trunk channel, and the calling party sending candidate addresses (not sent to the called party via the signaling server) from the calling party's candidate address information to the called party via the trunk channel. The fifth step involves the calling end and the called end performing connectivity checks based on their respective received candidate addresses to establish a point-to-point communication connection between them; and The sixth step is to establish the final transmission path based on the results of the connectivity check.

[0008] Alternatively, the calling party candidate address information may also include the calling party host candidate address and / or the calling party server reflection candidate address, and the called party candidate address information may also include the called party host candidate address and / or the called party server reflection candidate address.

[0009] Alternatively, the calling party candidate address information may also include the calling party host candidate address, and the called party candidate address information may also include the called party host candidate address. In the second step, the calling end sends the calling end host candidate address and the calling end trunk candidate address together to the called end through the signaling server. The communication method further includes, prior to the third step: The called party sends its candidate host address to the calling party through the signaling server. The calling end and the called end attempt to establish a direct connection based on their respective received host candidate addresses; If the direct connection is successfully established, the calling end and the called end establish a point-to-point communication connection based on the calling end's candidate host address and the called end's candidate host address; and If the direct connection fails to be established, the third step, the fourth step, the fifth step, and the sixth step shall be executed in sequence.

[0010] Alternatively, the communication method may further include, prior to the second step: The calling end, based on the calling end candidate address information, determines whether it might be in a network environment that could cause peer-to-peer connection failure; and If it is determined that the network environment may be in the network environment, in the second step, the calling end only sends the calling end trunk candidate address to the called end through the signaling server, and uses the trunk channel established in the third step as the final transmission path; If it is determined that the network environment may not be present, the second step, the third step, the fourth step, the fifth step, and the sixth step are executed sequentially.

[0011] Alternatively, if it is determined that the network environment may not be present, during the second step, the calling end sends the calling end host candidate address and the calling end trunk candidate address together to the called end through the signaling server. Before performing the third step, The called party sends its candidate host address to the calling party through the signaling server. The calling end and the called end attempt to establish a direct connection based on their respective received host candidate addresses; If the direct connection is successfully established, the calling end and the called end establish a point-to-point communication connection based on the calling end's candidate host address and the called end's candidate host address; and If the direct connection fails to be established, the third step, the fourth step, the fifth step, and the sixth step shall be executed in sequence.

[0012] Alternatively, after the third step, both the calling end and the called end determine whether they might be in a network environment that could cause the point-to-point connection to fail. If it is determined that either the calling end or the called end may be in a predefined network environment, then the relay channel is directly used as the final transmission path. If it is determined that neither the calling end nor the called end may be in a predefined network environment, then the fourth step, the fifth step, and the sixth step are executed sequentially.

[0013] Alternatively, the network environment may include any of the following: symmetric NAT, port-restricted cone NAT, carrier-grade NAT, or a firewall configured with rules to block inbound connections.

[0014] This application also provides a communication system, including: a calling end, a called end, a signaling server, and a trunk server. The calling terminal is configured as follows: Collect at least the calling party candidate address information, including the calling party trunk candidate address; and The signaling server sends at least the calling terminal's trunk candidate address to the called terminal. The called end is configured as follows: Collect called party candidate address information, including at least the called party trunk candidate address; Based on the received calling party trunk candidate address and the called party trunk candidate address, a trunk channel is established between the trunk server and the calling party; and Through the trunk channel, the candidate addresses other than the called party trunk candidate addresses in the called party candidate address information are sent to the calling party. The calling end is further configured to send candidate addresses from the calling end's candidate address information that were not sent to the called end through the signaling server to the called end via the trunk channel, and The calling end and the called end are further configured to perform connectivity checks based on the candidate addresses they receive, and establish a communication connection between them.

[0015] This application also provides a calling client, including a processor and a memory, wherein the memory stores a computer program, and the calling client is configured to perform the following operations when the computer program is executed by the processor: Collect calling party candidate address information, wherein the calling party candidate address information includes at least the calling party trunk candidate address; The signaling server sends at least the calling party trunk candidate address to the called party client. In response to the trunk channel established with the called client via a trunk server, candidate addresses in the calling client's candidate address information that were not sent to the called client via the signaling server are sent to the called client via the trunk channel, wherein the trunk channel is established based on the calling client's trunk candidate address and the called client's trunk candidate address; and A connectivity check is performed based on the candidate address received from the called client, and a communication connection is established with the called client.

[0016] This application also provides a called party client, including a processor and a memory, the memory storing a computer program, the called party client being configured to perform the following operations when the computer program is executed by the processor: Collect candidate address information of the called party, wherein the candidate address information of the called party includes at least the candidate trunk address of the called party; Receive calling client candidate address information from the signaling server, which includes at least the calling client trunk candidate address; Based on the received calling party trunk candidate address and called party trunk candidate address, a trunk channel is established between the trunk server and the calling party client. The candidate addresses, excluding the called party's trunk candidate address, are sent to the calling party's client via the trunk channel from the called party's candidate address information; and A connectivity check is performed based on the candidate address received from the calling client, and a communication connection is established with the calling client.

[0017] This application also provides a signaling server, including a processor and a memory, wherein the memory stores a computer program. The signaling server is configured to perform signaling relay during the establishment of a point-to-point communication connection based on the above-described communication method, and the signaling server is configured to, when the computer program is executed by the processor: Receive calling party candidate address information from the calling party client, which includes at least the calling party's trunk candidate address; and The calling party candidate address information, which includes at least the calling party trunk candidate address, is forwarded to the called party client.

[0018] This application also provides a relay server, including a processor and a memory, wherein the memory stores a computer program. The relay server is configured to perform data relay during the establishment of a point-to-point communication connection based on the above communication method, and the relay server is configured to, when the computer program is executed by the processor: Based on the calling client's trunk candidate address received from the calling client and the called client's trunk candidate address received from the called client, a trunk channel is established between the calling client and the called client; and Through the relay channel, the calling client's candidate address information and the called client's candidate address information are forwarded between the calling client and the called client.

[0019] This application also provides a communication system suite, including the aforementioned calling client, called client, signaling server, and relay server.

[0020] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described communication method.

[0021] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described communication method.

[0022] Effects of the Invention: The communication method and system of this application can optimize the candidate address information exchange path by utilizing a relay channel. By having the called end resolve the relay candidate address and actively establish a relay channel, candidate address information can be directly synchronized between clients. While maintaining the ICE mechanism, multiple rounds of signaling server relay are avoided, significantly reducing signaling interaction overhead. This not only reduces the concurrent pressure on the signaling server but also shortens the connection establishment latency, achieving efficient synchronization of candidate address information and low-latency connection establishment, enhancing the connection success rate in network environments with severe NAT restrictions. Furthermore, because it maintains compatibility with the ICE process and the STUN / TURN protocol, no architectural modifications to existing RTC systems are required, exhibiting good engineering portability, and making it particularly suitable for large-scale real-time audio and video communication and low-latency IoT interaction scenarios. Attached Figure Description

[0023] Figure 1 This is a schematic diagram of the communication structure according to one embodiment of this application.

[0024] Figure 2 This is a flowchart illustrating the establishment of a communication connection according to one embodiment of this application.

[0025] Figure 3 This is a flowchart of a candidate interaction step according to an embodiment of this application.

[0026] Figure 4 This is a flowchart of a candidate interaction step of a variation of an embodiment of this application.

[0027] Figure 5 This is a flowchart of a candidate interaction step in a variation of an embodiment of this application, namely, Example 2.

[0028] Figure 6 This is a flowchart of a candidate interaction step in a variation of an embodiment of this application, specifically step 3.

[0029] Figure 7 This is a flowchart of a candidate interaction step in a variation of an embodiment of this application, specifically step 4.

[0030] Figure 8 This is a flowchart of a candidate interaction step in a variation of an embodiment of this application, namely, Example 5. Detailed Implementation

[0031] Hereinafter, with reference to the accompanying drawings, a communication method according to one embodiment of this application will be described in detail. It should be understood that the following embodiments are for illustrative purposes only and are not intended to limit this application. All other embodiments obtained by those skilled in the art based on the embodiments in this application without inventive effort are within the scope of protection of this application.

[0032] As mentioned earlier, the main difference between conventional ICE and ICE Trickle lies in the timing of candidate address collection and exchange. However, both suffer from the fundamental bottleneck that candidate address exchange relies entirely on signaling server relay. This application improves upon this by optimizing the candidate address exchange path, transmitting candidate information through established relay channels, thereby overcoming the aforementioned bottleneck and reducing signaling load and connection latency. This optimization is independent of the upper-layer collection strategy and can be applied to improve both conventional ICE and ICE Trickle. The following, in conjunction with... Figures 1 to 3 The P2P communication method in this embodiment will be described.

[0033] Furthermore, in this embodiment, to distinguish the differences between the two communicating parties in terms of initiation order, role positioning, and process sequence, the initiator of the session is referred to as the calling party 100, and the receiver of the session is referred to as the called party 200. However, it should be understood that both the calling party 100 and the called party 200 can be implemented by client devices (such as APP, browser, PC terminal, mobile device, etc.), the only difference being the logical roles and states during the session. In addition, the P2P connection establishment in this embodiment is based on ICE technology, which can significantly reduce the communication pressure on the signaling server 300. The following is a necessary explanation of SDP (Session Description Protocol).

[0034] The SDP mentioned in this application is a protocol for describing media information, describing terminal functions and preferences in text format. SDP only contains media metadata of the terminal, not the media data content. The two parties establishing a connection obtain each other's media information such as resolution, encoding format, and encryption algorithm by exchanging SDP. SDP is widely used in Session Initiation Protocol (SIP), RTP, and Real-Time Streaming Protocol (RSP).

[0035] like Figure 2 As shown, in step S1, candidate collection is performed (equivalent to the first step).

[0036] In this embodiment, SDP exchange is the trigger event for collecting ICE candidate addresses. After the SDP exchange (which may not contain any candidate addresses) is completed, the clients of both communicating parties (i.e., the calling party 100 and the called party 200) respectively perform candidate address information collection operations. The candidate address information includes host candidate addresses, server reflection candidate addresses, and trunk candidate addresses.

[0037] Specifically, for example, the calling end 100 and the called end 200 can obtain one or more local IP candidate addresses and port numbers based on their respective local network interfaces to form host candidate addresses representing direct communication paths within the local area network. For example, the calling end 100 and the called end 200 can send a probe request to an external STUN server 500 to obtain the candidate address mapping information of the terminal on the public network side, thereby determining the public network candidate address mapping relationship and generating server reflection candidate addresses. For example, the calling end 100 and the called end 200 can apply for trunk resources from a trunk server 400 to obtain trunk candidate addresses accessible via the public network. In this embodiment, the trunk server 400 can, for example, be a TURN server.

[0038] In step S2, candidate interactions are performed.

[0039] like Figure 3 As shown, in step S21, the calling end 100 uploads candidate address information, including at least the trunk candidate address, to the signaling server 300 (equivalent to the second step).

[0040] The calling client 100 publishes its candidate address information through the signaling server 300, which includes at least trunk candidate addresses. When publishing, the calling client 100 binds the candidate address information with a session ID, which can be, for example, a conference number, device number, room code, or other unique session identifier, so that the signaling server 300 can correctly associate the corresponding candidate address information in subsequent session matching.

[0041] In step S22, the called party 200 obtains the candidate address information of the calling party 100 through the signaling server 300, and establishes a trunk channel based on the trunk candidate address of the calling party 100 (equivalent to the third step).

[0042] After receiving a session identifier (e.g., a room number obtained by scanning a QR code or clicking an invitation link), the called party 200 declares to the signaling server 300 that it is monitoring that session identifier. When the signaling server 300 detects that the calling party 100 corresponding to that session identifier has published candidate address information, it sends a session establishment event notification to the called party 200. Upon receiving the session establishment event, the called party 200 retrieves the candidate address information published by the calling party 100 from the signaling server 300.

[0043] The called end 200 parses the trunk candidate address from the candidate address information of the calling end 100, and then sends a connection establishment request to the trunk server 400 using this trunk candidate address as the communication target, specifying the trunk candidate address of the calling end 100 as the target endpoint. Based on the registration information, the trunk server 400 establishes a trunk channel between the calling end 100 and the called end 200 in its internal forwarding mechanism, enabling bidirectional data communication between them via this trunk channel.

[0044] For ease of understanding, a specific implementation of establishing a relay channel is described here. It should be understood that this specific implementation is only one example, and other implementations may also be used.

[0045] To enable the called party 200 to initiate a trunk channel with the calling party 100, the TURN protocol was extended.

[0046] After obtaining the calling party's trunk candidate address, the called party 200 sends an extended Connect request to the trunk server 400. This request includes XOR-PEER-ADDRESS and CHANNEL-NUMBER, as well as attributes such as SOFTWARE and LIFETIME bound to the current session. The value of XOR-PEER-ADDRESS is the resolved calling party's trunk candidate address (IP and port), and CHANNEL-NUMBER specifies the channel number to which the request is bound.

[0047] After receiving the above Connect request, relay server 400 performs the following operations: Verify the validity of the request and confirm that the calling party 100 has created an allocation resource corresponding to the aforementioned calling party trunk candidate address on the relay server 400 through an Allocate request. Internally, a forwarding binding relationship is established between the calling end 100 and the called end 200, which means that the called end 200 is designated as a permitted peer to the calling end 100; and The called end receives a Connect Success response notifying it that the 200 channel has been successfully established.

[0048] At the same time, the relay server 400 proactively notifies the calling end 100 through a Connection Attempt Indication message that the called end 200 has requested to establish a connection.

[0049] On the other hand, after receiving a Connection Attempt notification from the trunk server 400, the calling end 100 can choose to send a Connection Confirm request to confirm acceptance of the connection, thereby completing the establishment of a bidirectional channel. Afterwards, the calling end 100 and the called end 200 can achieve bidirectional communication via the trunk server 400 by sending data packets encapsulated in a specified CHANNEL-NUMBER channel or using XOR-PEER-ADDRESS.

[0050] In step S23, the called end 200 sends its candidate address information (excluding the trunk candidate address, such as host candidate address and server reflection candidate address) to the calling end 100 through the trunk channel. Simultaneously, the calling end 100 sends its candidate address information (excluding the trunk candidate address, such as host candidate address and server reflection candidate address) to the called end 200 through the trunk channel. Furthermore, after receiving the candidate address information from the called end 200, the calling end 100 updates its local candidate table (set), and the called end 200, after receiving the candidate address information from the calling end 100, updates its local candidate table (equivalent to step four).

[0051] Therefore, the synchronization of candidate address information can be achieved without forwarding through the signaling server 300. In other words, in this embodiment, the signaling server 300 is only responsible for notifying the called party 200 of the session identifier and the candidate address information (specifically, the trunk candidate address) of the calling party 100 in the initial stage, in order to assist in the establishment of the trunk channel.

[0052] In step S3, a connectivity check is performed (equivalent to step 5).

[0053] Both communicating parties generate several candidate pairs based on a synchronized candidate table and sequentially perform connectivity checks. Specifically, connectivity checks are performed, for example, based on a STUN Binding Request mechanism to determine the reachability of communication between candidate pairs. For instance, the calling party 100 sends a test message to the candidate address of the other end (called party 200) of a candidate pair and waits for a STUN Binding Response to determine whether the communication connection of the candidate pair is reachable. If the detection result indicates that a candidate pair link is reachable, it is marked as a valid candidate pair. When at least one valid candidate pair exists, it is considered that the two parties have established a feasible network connectivity relationship. Furthermore, connectivity checks can be performed according to a pre-set priority, which can be synthesized based on the single-end priority of the candidate addresses at both ends of the candidate pair. The synthesis method follows the ICE standard priority calculation formula, using the reachable path with the lowest cost as the preferred data channel. For example, host candidate pairs have priority, server reflection candidate pairs have second priority, and relay candidate pairs have the lowest priority.

[0054] In step S4, the connection is established (equivalent to step six).

[0055] The pair with the highest priority among the valid candidate pairs is selected as the final communication path (Nominated Pair). Once the selected candidate pair is determined, the ICE Agents of both communicating parties switch to the "Connected" state and perform DTLS handshake and security authentication based on the transmission channel corresponding to the selected candidate pair. In other words, in this implementation, data forwarding is only achieved through a relay channel in scenarios where direct connection is unreachable (the two parties cannot directly access each other through their respective private network candidate addresses or NAT mapping candidate addresses on the public network).

[0056] At this point, the P2P communication connection is established, and both parties can transmit media data and control signaling in real time on this channel, achieving low-latency, low-load P2P communication. Compared to current ICE technologies (conventional ICE, Trickle ICE), this implementation method achieves direct exchange of candidate address information through a relay channel, avoiding redundant synchronization steps that are forwarded multiple times by the signaling server 300, which can significantly reduce the load on the signaling server 300 and the P2P connection establishment latency.

[0057] (Variation Example 1)

[0058] like Figure 4 As shown, in step S21a, the calling end 100 uploads candidate address information, including at least host candidate address and trunk candidate address, to the signaling server 300.

[0059] In step S21b, the called party 200 uploads candidate address information, including at least the host candidate address, to the signaling server 300.

[0060] In step S21c, the called party 200 obtains the candidate address information of the calling party 100 through the signaling server 300, which includes at least the host candidate address and the trunk candidate address. The calling party 100 obtains the candidate address information of the called party 200 through the signaling server 300, which includes at least the host candidate address. Both parties attempt to establish a direct connection channel based on the host candidate addresses.

[0061] If the direct connection is successfully established (i.e., yes in step S21c), then point-to-point communication connection is achieved through the direct connection (i.e., step S4).

[0062] If the direct connection fails to be established (i.e., no in step S21c), then proceed to step S22, where the called party 200 establishes a trunk channel based on the trunk candidate address of the calling party 100. In step S23, the called party 200 sends the server reflection candidate address to the calling party 100 through this trunk channel. The subsequent steps are the same as described above and will not be repeated.

[0063] Therefore, by attempting a direct connection using candidate host addresses before establishing a relay channel, this variation 1 can quickly establish point-to-point communication when the network environment supports direct connection, thereby avoiding unnecessary relay overhead and reducing transmission latency and relay server resource consumption; in the event of a direct connection failure, it can fall back to the relay scheme, ensuring the reliability of connection establishment and achieving a balance between performance and stability.

[0064] (Variation Example 2)

[0065] Generally speaking, under the ICE protocol mechanism, the calling end 100 usually does not need to pre-determine whether the current network environment will cause point-to-point connection failure during the candidate address collection stage. Instead, it determines whether a point-to-point connection can be established based on the results of subsequent candidate address connectivity checks.

[0066] However, in complex network environments, this approach often leads to the calling end 100 continuing to collect and send host candidate addresses and server reflection candidate addresses via signaling channels or trunk channels even when it is already foreseeable that point-to-point connections will be difficult to establish. In the subsequent connectivity check phase, a large number of invalid connectivity checks are performed on these candidate addresses, thereby increasing the number of signaling interactions and connectivity check latency, prolonging connection establishment time, and consuming additional network and computing resources.

[0067] Therefore, as Figure 5As shown, in step S12, the calling end 100, based on the collected candidate address information, including at least the type and mapping characteristics of the server-reflected candidate addresses, determines whether the current network environment might be in a state that would cause peer-to-peer connection failure. That is, the calling end 100 determines whether it might be in a network environment that would cause peer-to-peer connection failure.

[0068] Specifically, the calling end 100 can analyze the network environment based on the type composition, quantity distribution, and generation of various candidate addresses, especially the port mapping characteristics of server reflection candidate addresses. For example, preferably, the calling end 100 can determine whether the port mapping of the server reflection candidate address remains stable under different requests or different targets, or whether there is a port change with the target. When the mapping relationship of the server reflection candidate address is unstable, or when there is a lack of host candidate addresses or server reflection candidate addresses that can be used to establish a direct connection, it can be inferred that the current network environment may lead to the failure of point-to-point connections based on server reflection candidate addresses. By making the above judgment based on candidate address information before connectivity checks, the calling end 100 can identify network environments with a low probability of successful point-to-point connections based on server reflection candidate addresses in advance, thereby providing a basis for the selection of subsequent connection establishment strategies.

[0069] If the determination is yes (i.e., yes in step S12), proceed to step S21d.

[0070] In step S21d, the calling end 100 publishes its own candidate address information through the signaling server 300, which may include only trunk candidate addresses.

[0071] In step S22, the called party 200 obtains the trunk candidate address information of the calling party 100 through the signaling server 300 and establishes a trunk channel.

[0072] Then, steps S23 and S3 are omitted, and the process proceeds directly to step S4, where the relay channel is used as the final transmission path. As mentioned earlier, this is because when clients are in network environments that could lead to point-to-point connection failures, it is difficult for clients to establish effective point-to-point connections using host candidate addresses or server-reflected candidate addresses. In this case, sending only the relay candidate address is sufficient to meet the connection establishment requirements, eliminating the need to send host candidate addresses and server-reflected candidate addresses, which are unlikely to succeed in establishing a connection. This means there is no need to resend additional candidate information through the relay channel, thereby reducing signaling overhead and shortening connection establishment latency.

[0073] If the result is negative (i.e., negative in step S12), proceed to step S21 and execute the subsequent steps sequentially.

[0074] (Variation Example 3)

[0075] like Figure 6 As shown, it is also possible to combine Modified Example 1 with Modified Example 2.

[0076] If the result in step S12 is negative, proceed to step S21a. Subsequent steps are the same as in variant example 1, and will not be repeated here.

[0077] (Variation Example 4)

[0078] like Figure 7 As shown, the above-mentioned network environment prediction and judgment can also be performed after step S22.

[0079] In step S22a, the calling end 100 and the called end 200, based on the collected candidate address information, including at least the type and mapping characteristics of the server reflection candidate address, determine whether the current network environment might be in a state that would cause point-to-point connection failure based on host candidate address or server reflection candidate address. That is, the calling end 100 and the called end 200 each determine whether they themselves might be in a network environment that would cause point-to-point connection failure based on host candidate address or server reflection candidate address.

[0080] If either the calling end 100 or the called end 200 may be in the above network environment (i.e., yes in step S22a), it means that the possibility of the two communicating parties establishing a direct channel or a channel based on the server reflection address through the host candidate address or the server reflection candidate address is almost zero. That is, the connectivity check of the relevant candidate pair will inevitably fail. Therefore, the relay channel established in step S22 is directly used as the final transmission channel (i.e., step S4).

[0081] If neither the calling end 100 nor the called end 200 may be in the aforementioned network environment (i.e., no in step S22a), then proceed to step S23. The subsequent steps are the same and will not be repeated.

[0082] Furthermore, network environments that can cause peer-to-peer connection failures based on host candidate addresses or server-reflected candidate addresses include, for example, network environments that are difficult to penetrate with NAT or network environments with strict firewalls (e.g., firewall blocking). However, this is not limited to these; any network environment in which the candidate address exposed by the client cannot be directly accessed by the other end, making the candidate address obtained by STUN unavailable to the other end and preventing both parties from establishing a direct ICE connection, falls under the aforementioned network environments that can cause peer-to-peer connection failures. For example, such network environments can include symmetric NAT, port-restricted cone NAT, carrier-grade NAT, or firewalls configured with rules blocking inbound connections.

[0083] Therefore, by predicting and judging the network environment in advance, it is possible to avoid sending invalid host candidate addresses and server reflection candidate addresses, reduce the amount of data sent for candidate address connectivity checks, reduce the processing pressure on the signaling server, and avoid performing invalid connectivity checks on direct connection paths with low success probability, thereby improving connection establishment efficiency and overall connection establishment success rate.

[0084] (Variation Example 5)

[0085] like Figure 8 As shown, in step S21e, the calling end 100 uploads candidate address information, including at least host candidate address, server reflection candidate address, and relay candidate address, to the signaling server 300.

[0086] In step S22e, the called party 200 obtains the candidate address information of the calling party 100 through the signaling server 300 and updates the local candidate table, and establishes a trunk channel based on the trunk candidate address of the calling party 100.

[0087] In step S23e, the called end 200 sends its candidate address information (including host candidate addresses and server reflection candidate addresses, excluding the trunk candidate addresses) to the calling end 100 through the trunk channel. Upon receiving the candidate address information from the called end 200, the calling end 100 updates its local candidate table (set). The subsequent connectivity checks and connection establishment steps are the same as in the aforementioned implementation and will not be repeated here.

[0088] Therefore, by having the calling party's candidate address information sent through the signaling server, while the called party's candidate address information bypasses the signaling server and is sent through the trunk channel, the processing burden of the signaling server can be effectively reduced, and the time required for candidate address interaction can be reduced, thereby improving the overall efficiency of connection establishment.

[0089] In summary, according to the communication method of this application, by adjusting the above-mentioned candidate interaction path, the "two-way candidate relay" that needs to be continuously executed by the signaling server in the known ICE mechanism is simplified to "one initial notification". This avoids a large number of redundant signaling interaction processes caused by multi-stage and multi-round candidate address round-trip synchronization, thereby significantly reducing the concurrent processing pressure of the signaling server in the candidate interaction stage and effectively alleviating the server bottleneck problem in large-scale collaboration or high-concurrency scenarios.

[0090] Especially in complex network environments with strict NAT, strong firewall filtering, or network rate limiting policies, existing ICE mechanisms often suffer from issues such as unreachable host candidate addresses, incomplete candidate synchronization, or persistent connectivity check failures, making it difficult to establish point-to-point connections. This implementation addresses these problems by enabling the called party to actively establish a trunk channel based on the calling party's trunk candidate address and then using this trunk channel to send candidate address information back. This ensures that the candidate synchronization process always relies on the verified reachable trunk path, thereby guaranteeing complete synchronization of candidate address information in complex network environments. This significantly improves the success rate of point-to-point connection establishment and is superior to the traditional mechanism that passively falls back to the relay after a direct connection failure.

[0091] Furthermore, while optimizing the candidate interaction path, this implementation method still fully retains the existing candidate collection, connectivity check, and candidate priority selection processes in the ICE mechanism, only improving the candidate address exchange path. This simplifies the candidate interaction stage without disrupting the original ICE mechanism. Therefore, this application can be integrated and applied without large-scale modifications to existing WebRTC, RTC SDK, and other system architectures, exhibiting good backward compatibility and engineering feasibility.

[0092] To implement the above communication method, this application also provides a communication system.

[0093] like Figure 1 As shown, the communication system includes at least: a calling end 100, a called end 200, a signaling server 300, and a relay server 400. The calling end 100 and the called end 200 communicate with the signaling server 300 and the relay server 400 respectively through the network. The signaling server 300 is used to provide signaling interaction services during the communication establishment phase, and the relay server 400 is used to provide data relay forwarding capabilities when the point-to-point communication connection has not been established or cannot be established directly.

[0094] In one embodiment, the calling end (i.e., the calling client) 100 can be any terminal device with network communication capabilities, such as, but not limited to, a smart terminal, a computing device, or an embedded communication device. The calling end 100 is configured to perform the following operations during the communication establishment process: Collect candidate address information from the local end. The candidate address information of the calling end includes at least a trunk candidate address. This trunk candidate address is used to indicate the network address information through which the calling end 100 can communicate with the trunk server 400. In some implementations, the candidate address information may also include other types of candidate addresses of the calling end, such as the calling end's host candidate address, server reflection candidate address, or candidate address corresponding to other network paths, but this embodiment does not limit this.

[0095] After collecting the candidate address information, the calling end 100 sends at least the trunk candidate addresses from the candidate address information to the called end 200 through the signaling server 300. That is, the calling end 100 does not send all of its candidate address information through the signaling server 300 at once, but only selects a portion of the address information that includes at least the trunk candidate addresses to send through the signaling server 300.

[0096] In subsequent communication, the calling end 100 is further configured to: after establishing a trunk channel with the called end 200 via the trunk server 400, send candidate addresses from the candidate address information that were not sent to the called end 200 via the signaling server 300 to the called end 200 via the trunk channel. This allows the called end 200 to obtain the remaining candidate address information of the calling end 100 without relying on the signaling server 300.

[0097] In one embodiment, the called end (i.e., the called end client) 200 can also be a terminal device with network communication capabilities, and its type can be the same as or different from the calling end 100. In this embodiment, the called end 200 is configured to perform the following operations: Collect candidate address information from this end, including at least the trunk candidate address from the called end. This trunk candidate address is used to identify the network address used by the called end 200 when communicating through the trunk server 400.

[0098] After receiving the trunk candidate address sent by the calling end 100 through the signaling server 300, the called end 200 establishes a trunk channel with the calling end 100 through the trunk server 400 based on the calling end's trunk candidate address and its own trunk candidate address. This trunk channel is a communication channel between the calling end 100 and the called end 200, through which data is forwarded via the trunk server 400.

[0099] After the trunk channel is established, the called party 200 sends the candidate addresses other than the trunk candidate addresses in the candidate address information to the calling party 100 through the trunk channel. In other words, the called party 200 does not send all of its candidate address information through the signaling server 300, but instead uses the established trunk channel to transmit the remaining candidate address information to the calling party 100.

[0100] In this embodiment, the signaling server 300 exchanges only a portion of the candidate address information, including at least the trunk candidate address, while the remaining candidate address information is exchanged through the trunk channel. Specifically: After successfully establishing a trunk channel between the calling end 100 and the called end 200 based on their respective trunk candidate addresses, both the calling end 100 and the called end 200 use this trunk channel to send their respective candidate address information, which has not yet been sent through the signaling server 300, to each other. In this way, both the calling end 100 and the called end 200 can obtain each other's complete or richer set of candidate addresses.

[0101] After exchanging candidate address information, the calling end 100 and the called end 200 are further configured to perform connectivity checks based on the candidate addresses they have received. The connectivity check is used to detect whether a valid direct communication path can be established between the calling end 100 and the called end 200 under different combinations of candidate addresses.

[0102] Based on the connectivity check results, a point-to-point communication connection is established between the calling end 100 and the called end 200, or a communication connection is established via data forwarding through the relay server 400.

[0103] In the above implementation, by dividing the exchange process of candidate address information into a signaling server stage and a relay channel stage, the communication system can reduce its dependence on the signaling server while ensuring the success rate of communication establishment, thus providing a foundation for the subsequent establishment of point-to-point communication connections.

[0104] In one embodiment of the present invention, a calling client (i.e., calling client 100) is also provided.

[0105] The calling client includes a processor and a memory. The memory stores a computer program that, when executed by the processor, implements the communication control functions of the calling client 100. Specifically, the calling client is configured to perform the following operations when the computer program is executed by the processor: The system collects calling party candidate address information, which includes at least calling party trunk candidate addresses; sends at least the calling party trunk candidate addresses to the called party client via a signaling server; in response to a trunk channel established with the called party client via the trunk server, it sends candidate addresses from the calling party candidate address information that were not sent to the called party client via the signaling server to the called party client via the trunk channel, the trunk channel being established based on the calling party trunk candidate addresses and the called party trunk candidate addresses of the called party client; and performs connectivity checks based on the candidate addresses received from the called party client to establish a communication connection with the called party client.

[0106] In one embodiment of the present invention, a called end client (i.e., called end 200) is also provided.

[0107] The called client also includes a processor and a memory. The memory stores a computer program that, when executed by the processor, implements the communication control functions of the called client. Specifically, the called client is configured to perform the following operations when the computer program is executed by the processor: Collect called party candidate address information, which includes at least called party trunk candidate addresses; receive calling party candidate address information from the calling party client, which includes at least the calling party trunk candidate addresses, from the signaling server; establish a trunk channel between the calling party client and the trunk server based on the received calling party trunk candidate addresses and called party trunk candidate addresses; send candidate addresses other than called party trunk candidate addresses from the called party candidate address information to the calling party client via the trunk channel; and perform connectivity checks based on the candidate addresses received from the calling party client to establish a communication connection with the calling party client.

[0108] In one embodiment of the present invention, a signaling server 300 is also provided.

[0109] The signaling server 300 includes a processor and a memory storing a computer program that, when executed by the processor, performs signaling relay functions during the aforementioned point-to-point communication connection. Specifically, the signaling server 300 is configured such that, when the computer program is executed by the processor: Receive calling client candidate address information, which includes at least the calling client trunk candidate address; and forward the calling client candidate address information, which includes at least the calling client trunk candidate address, to the called client.

[0110] In one embodiment of the present invention, a relay server 400 is also provided.

[0111] The relay server 400 includes a processor and a memory storing a computer program that, when executed by the processor, performs signaling relay functions during the aforementioned point-to-point communication connection. Specifically, the relay server 400 is configured such that, when the computer program is executed by the processor: Based on the calling client's trunk candidate address received from the calling client and the called client's trunk candidate address received from the called client, a trunk channel is established between the calling client and the called client; and through the trunk channel, the calling client's trunk candidate address information and the called client's called client's called client candidate address information are forwarded between the calling client and the called client.

[0112] In one embodiment of the present invention, a communication system kit is also provided.

[0113] The communication system suite includes the aforementioned calling client, called client, signaling server 300, and relay server 400.

[0114] In one embodiment of the present invention, a computer-readable storage medium and a computer program product are also provided.

[0115] This application also provides a computer-readable storage medium storing instructions that, when executed on a terminal device, cause the terminal device to perform the method described above. The computer-readable storage medium may include any entity or device capable of carrying a computer program, such as a recording medium, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory, random access memory, and software distribution medium.

[0116] This application also provides a computer program product, which includes a computer program that, when executed by a processor, causes a terminal device to perform the method described in the above embodiments. The computer program product may exist in the form of source code, object code, executable files, or intermediate code, and may be distributed and deployed via networks, storage media, or other means.

[0117] By implementing the communication method of the present invention in the form of a computer program or program product, the technical solution of the present invention can be flexibly deployed in different terminal devices or server devices in a software manner.

[0118] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as should be understood by those skilled in the art to which embodiments of this application pertain.

[0119] The above detailed embodiments further illustrate the purpose, technical solution, and beneficial effects of this application. It should be understood that the above are merely one specific embodiment of this application and are not limited to the scope of protection of this application. This application can be embodied in various forms without departing from its fundamental characteristics. Therefore, the embodiments described in this application are for illustrative purposes only and not for limitation. Since the scope of this application is defined by the claims rather than the description, and all variations falling within the scope defined by the claims, or their equivalents, should be understood to be included in the claims. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. A communication method for establishing a point-to-point communication connection between the calling end (100) and the called end (200) in a system comprising a calling end (100), a called end (200), and a signaling server (300), characterized in that, include: In the first step, the calling end (100) collects calling end candidate address information including at least the calling end trunk candidate address, and the called end (200) collects called end candidate address information including at least the called end trunk candidate address. In the second step, the calling end (100) sends at least the calling end trunk candidate address to the called end (200) through the signaling server (300). In the third step, the called end (200) establishes a trunk channel between the called end (200) and the calling end (100) through the trunk server (400) based on the received trunk candidate address of the calling end and the trunk candidate address of the called end. The fourth step involves the called party (200) sending candidate addresses other than the called party trunk candidate addresses in the called party candidate address information to the calling party (100) via the trunk channel, and the calling party (100) sending candidate addresses in the calling party candidate address information that were not sent to the called party (200) through the signaling server (300) to the called party (200) via the trunk channel. In the fifth step, the calling end (100) and the called end (200) perform connectivity checks based on the candidate addresses they receive, so as to establish a point-to-point communication connection between them. as well as The sixth step is to establish the final transmission path based on the results of the connectivity check.

2. The communication method according to claim 1, characterized in that, The calling party candidate address information also includes the calling party host candidate address and / or the calling party server reflection candidate address. The called party candidate address information also includes the called party host candidate address and / or the called party server reflection candidate address.

3. The communication method according to claim 1, characterized in that, The calling party candidate address information also includes the calling party host candidate address, and the called party candidate address information also includes the called party host candidate address. In the second step, the calling end (100) sends the calling end host candidate address and the calling end trunk candidate address together to the called end (200) through the signaling server (300). The communication method further includes, prior to the third step: The called party (200) sends the candidate address of the called party host to the calling party (100) through the signaling server (300). The calling end (100) and the called end (200) attempt to establish a direct connection based on the host candidate addresses they each receive; If the direct connection is successfully established, the calling end (100) and the called end (200) establish a point-to-point communication connection between themselves based on the calling end's candidate host address and the called end's candidate host address; and If the direct connection fails to be established, the third step, the fourth step, the fifth step, and the sixth step shall be executed in sequence.

4. The communication method according to claim 2, characterized in that, The communication method further includes, prior to the second step: The calling terminal (100) determines, based on the calling terminal candidate address information, whether it may be in a network environment that could cause point-to-point connection failure; and If it is determined that the network environment may be in the network environment, in the second step, the calling end (100) only sends the calling end trunk candidate address to the called end (200) through the signaling server (300), and uses the trunk channel established in the third step as the final transmission path; If it is determined that the network environment may not be present, the second step, the third step, the fourth step, the fifth step, and the sixth step are executed sequentially.

5. The communication method according to claim 4, characterized in that, If it is determined that the network environment may not be present, when performing the second step, the calling end (100) sends the calling end host candidate address and the calling end trunk candidate address together to the called end (200) through the signaling server (300). Before performing the third step, The called party (200) sends the candidate address of the called party host to the calling party (100) through the signaling server (300). The calling end (100) and the called end (200) attempt to establish a direct connection based on the host candidate addresses they each receive; If the direct connection is successfully established, the calling end (100) and the called end (200) establish a point-to-point communication connection between themselves based on the calling end's candidate host address and the called end's candidate host address; and If the direct connection fails to be established, the third step, the fourth step, the fifth step, and the sixth step shall be executed in sequence.

6. The communication method according to claim 1, characterized in that, After the third step, the calling end (100) and the called end (200) each determine whether they might be in a network environment that could cause the point-to-point connection to fail. If it is determined that either the calling end (100) or the called end (200) may be in a predefined network environment, then the trunk channel is directly used as the final transmission path. If it is determined that neither the calling end (100) nor the called end (200) may be in a predefined network environment, then the fourth step, the fifth step, and the sixth step are executed sequentially.

7. The communication method according to claim 6, characterized in that, The network environment includes any one of symmetric NAT, port-restricted cone NAT, carrier-grade NAT, or a firewall configured with rules to block inbound connections.

8. A communication system, comprising: The calling terminal (100), the called terminal (200), the signaling server (300), and the trunk server (400) are characterized in that, The calling terminal (100) is configured as follows: Collect at least the calling party candidate address information, including the calling party trunk candidate address; and The signaling server (300) sends at least the calling terminal trunk candidate address to the called terminal (200). The called end (200) is configured as follows: Collect called party candidate address information, including at least the called party trunk candidate address; Based on the received calling party trunk candidate address and the called party trunk candidate address, a trunk channel is established between the trunk server (400) and the calling party (100); and Through the trunk channel, the candidate addresses other than the trunk candidate addresses of the called party are sent to the calling party (100) from the candidate address information of the called party. The calling terminal (100) is further configured to send candidate addresses from the calling terminal candidate address information that have not been sent to the called terminal (200) through the signaling server (300) to the called terminal (200) via the trunk channel, and The calling end (100) and the called end (200) are further configured to perform connectivity checks based on the candidate addresses they receive, and establish a communication connection between them.

9. A calling client (100), comprising a processor and a memory, the memory storing a computer program, characterized in that, The calling client (100) is configured to perform the following operations when the computer program is executed by the processor: Collect calling party candidate address information, wherein the calling party candidate address information includes at least the calling party trunk candidate address; The signaling server (300) sends at least the calling party trunk candidate address to the called party client (200). In response to the trunk channel established between the calling client (200) and the called client (200) via a trunk server (400), candidate addresses in the calling client candidate address information that were not sent to the called client (200) via the signaling server (300) are sent to the called client (200) via the trunk channel, the trunk channel being established based on the calling client trunk candidate address and the called client trunk candidate address of the called client (200); and A connectivity check is performed based on the candidate address received from the called client (200), and a communication connection is established with the called client (200).

10. A called-end client (200), comprising a processor and a memory, the memory storing a computer program, characterized in that, The called client (200) is configured to perform the following operations when the computer program is executed by the processor: Collect candidate address information of the called party, wherein the candidate address information of the called party includes at least the candidate trunk address of the called party; Receive from the signaling server (300) the calling client (100) calling client candidate address information, which includes at least the calling client trunk candidate address; Based on the received calling party trunk candidate address and the called party trunk candidate address, a trunk channel is established between the trunk server (400) and the calling party client (100). The candidate addresses other than the called party trunk candidate addresses in the called party candidate address information are sent to the calling party client (100) via the trunk channel; and A connectivity check is performed based on the candidate address received from the calling client (100), and a communication connection is established with the calling client (100).

11. A signaling server (300), comprising a processor and a memory, the memory storing a computer program, characterized in that, The signaling server (300) is configured to perform signaling relay during the establishment of a point-to-point communication connection based on the communication method of any one of claims 1 to 7, and the signaling server (300) is configured to, when the computer program is executed by the processor: Receive calling client candidate address information from calling client (100), which includes at least the calling client trunk candidate address; and The calling party candidate address information, which includes at least the calling party trunk candidate address, is forwarded to the called party client (200).

12. A relay server (400) comprising a processor and a memory, the memory storing a computer program, characterized in that, The relay server (400) is configured to perform data relay during the establishment of a point-to-point communication connection based on the communication method of any one of claims 1 to 7, and the relay server (400) is configured to, when the computer program is executed by the processor: Based on the calling client trunk candidate address received from the calling client (100) and the called client trunk candidate address received from the called client (200), a trunk channel is established between the calling client (100) and the called client (200); and Through the relay channel, the calling client (100)’s calling candidate address information and the called client (200)’s called candidate address information are forwarded between the calling client (100) and the called client (200).

13. A communication system kit, characterized in that, It includes the calling client (100) as described in claim 9, the called client (200) as described in claim 10, the signaling server (300) as described in claim 11, and the relay server (400) as described in claim 12.

14. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 7.

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

Citation Information

Patent Citations

  • Method, terminal and media-relay for establishing a multimedia connection

    CN101272385A

  • Session connection establishment method, apparatus and system

    CN104521211A

  • Peer-to-peer communication for symmetric nat

    CN105659568A

  • Method and apparatus for enabling browser to access IMS network, and communication system

    CN106656930A

  • Media session between network endpoints

    CN108702394A