Communication method, system, device, equipment, storage medium and program product
By combining a network address translation device with a probe and a signaling server, the communication challenges of port-restricted cone and symmetric NAT devices are solved, enabling fast and stable data transmission connections and improving the efficiency and success rate of the communication system.
Patent Information
- Application Number
- CN202511191940.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-25
- Publication Date
- 2025-12-12
AI Technical Summary
In existing technologies, port-restricted cone NAT devices have low communication success rates and efficiency with symmetric NAT devices, making it difficult to achieve point-to-point connections.
By combining a network address translation device with a probe and a signaling server, changes in the external network are automatically detected, the network identification information of the client is obtained and transmitted, and a data transmission connection is established.
It improves the success rate and efficiency of communication between port-restricted cone and symmetrical clients, achieves stable point-to-point connections, and enhances the flexibility and adaptability of the communication system in complex network environments.
Smart Images

Figure CN121125681A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to communication methods, systems, devices, equipment, storage media, and program products. Background Technology
[0002] Ubiquitous Real-Time Communication (RTC) is a technology that enables users to transmit and exchange information in real time between two or more communication terminals. In the RTC field, communication terminals typically attempt to establish point-to-point connections using STUN (Simple Traversal of UDP through NATs) or TURN (Traversal Using Relays around NAT) protocols. If the connection succeeds, the terminals can directly transmit audio and video data; if the connection fails, a TURN server is needed for relaying. However, in actual communication, the NAT (Network Address Translation) traversal problem for terminals becomes a key technical challenge.
[0003] According to communication protocol standards (such as RFC3489 and RFC5389), NAT devices can be divided into four types: full cone, IP-restricted cone, port-restricted cone, and symmetric. Among these, port-restricted cone NAT devices and symmetric NAT devices, due to their strict port and IP address restrictions, have become major obstacles to achieving point-to-point communication in the RTC field. For example, communication between symmetric NATs, or between port-restricted cone NATs and symmetric NATs, is often difficult to achieve point-to-point connections.
[0004] Currently, existing technologies have many limitations in handling communication between these two types of NAT devices, which severely affects the success rate and efficiency of device communication. Summary of the Invention
[0005] This application provides communication methods, systems, devices, equipment, storage media, and program products to solve the technical problem of low success rate and efficiency of communication between port-restricted cone NAT devices and symmetric NAT devices in the prior art.
[0006] This application provides a communication method applied to a first network address translation device with a probe. The communication method includes: sending a first network identification information of a first client to a signaling server, the signaling server being used to send the first network identification information to a second client; the second client being a port-restricted cone client or a symmetrical client; receiving the second network identification information of the second client sent by the signaling server; sending the second network identification information to the first client; the first network identification information and the second network identification information being used together to establish a data transmission connection between the first client and the second client.
[0007] According to a communication method provided in this application, after sending the second network identification information to the first client, the method further includes: receiving the first data from the first client and sending the first data to the second network address translation device, wherein the second network address translation device is used to send the first data to the second client.
[0008] According to a communication method provided in this application, after sending the second network identification information to the first client, the method further includes: receiving second data forwarded by the second network address translation device, and sending the second data to the first client.
[0009] According to a communication method provided in this application, before sending the first network identification information of the first client to the signaling server, the method further includes: receiving the first network identification information sent by the first client; and determining a first network address translation mapping table based on the first network identification information.
[0010] According to a communication method provided in this application, after receiving the second network identification information of the second client sent by the signaling server, the method further includes: updating the first network address translation mapping table according to the second network identification information.
[0011] This application also provides a communication method applied to a first client. The communication method includes: sending first network identification information to a first network address translation device, the first network address translation device being used to send the first network identification information to a second client; the second client being a port-limited cone client or a symmetric client; receiving the second network identification information of the second client sent by the first network address translation device; and establishing a data transmission connection with the second client having the first network identification information based on the second network identification information.
[0012] According to a communication method provided in this application, after establishing a data transmission connection with a second client having a first network identifier based on the second network identifier information, the method further includes: sending first data to a first network address translation device, wherein the first network address translation device is used to send the first data to the second client.
[0013] According to a communication method provided in this application, after establishing a data transmission connection with a second client having a first network identifier based on the second network identifier information, the method further includes: receiving second data forwarded by a first network address translation device.
[0014] This application also provides a communication method applied to a second network address translation device. The communication method includes: sending first network identification information of a first client to a second client; sending second network identification information of the second client to a signaling server, the signaling server being used to send the second network identification information to the first client; the first network address translation device being a device with a probe; the first network identification information and the second network identification information being used together to establish a data transmission connection between the first client and the second client; when the first client and the second client establish a data transmission connection based on the first network identification information and the second network identification information, sending second data of the second client to the first network address translation device, the first network address translation device being used to send the second data to the first client.
[0015] According to a communication method provided in this application, before sending the second network identification information of the second client to the signaling server, the method further includes: receiving the second network identification information sent by the second client; and determining a second network address translation mapping table based on the second network identification information.
[0016] According to a communication method provided in this application, the second network address translation device is a device with a probe; before sending the first network identification information of the first client to the second client, the method further includes: receiving the first network identification information sent by the signaling server; and updating the second network address translation mapping table based on the first network identification information.
[0017] According to a communication method provided in this application, after sending the second network identification information of the second client to the signaling server, the method further includes: sending heartbeat information to a first network address translation device, wherein the first network address translation device is used to send heartbeat information to the first client.
[0018] This application also provides a communication method applied to a second client. The communication method includes: sending second network identification information to a second network address translation device, the second network address translation device being used to send the second network identification information to a first client; receiving first network identification information of the first client sent by the second network address translation device; establishing a data transmission connection with the first client having the second network identification information based on the first network identification information, and sending second data to the second network address translation device, the second network address translation device being used to send the second data to the first client.
[0019] According to a communication method provided in this application, the second network address translation device is a device with a probe.
[0020] According to a communication method provided in this application, before establishing a data transmission connection with a first client based on first network identification information, the method further includes: sending heartbeat information to a second network address translation device, wherein the second network address translation device is used to send heartbeat information to the first client.
[0021] This application also provides a communication method applied to a signaling server; the communication method includes: receiving first network identification information of a first client sent by a first network address translation device; sending the first network identification information to a second client through a second network address translation device; receiving second network identification information of a second client sent by the second network address translation device; sending the second network identification information to the first client through the first network address translation device; wherein the first network address translation device and / or the second network address translation device are devices with probes.
[0022] This application also provides a communication system, comprising: a first network address translation device (NAT), which is a device with a probe; the first NAT is used to acquire and forward second network identification information of a second client to a first client, and send the first network identification information of the first client to a signaling server; a first client is used to receive the second network identification information and establish a data transmission connection with the second client based on the second network identification information; a second NAT is used to acquire and forward the first network identification information of the first client to the second client, and send the second network identification information of the second client to a signaling server; a second client is used to receive the first network identification information and establish a data transmission connection with the first client based on the first network identification information; a signaling server is used to receive the first network identification information sent by the first NAT and send the first network identification information to the second NAT; and to receive the second network identification information sent by the second NAT and send the second network identification information to the first NAT.
[0023] This application also provides a communication device deployed on a first network address translation device with a probe. The communication device includes: a first sending module for sending first network identification information of a first client to a signaling server, the signaling server for sending the first network identification information to a second client; a first receiving module for receiving second network identification information of the second client sent by the signaling server; and a second sending module for sending the second network identification information to the first client, wherein the first network identification information and the second network identification information are used together to establish a data transmission connection between the first client and the second client.
[0024] This application also provides a communication device deployed on a first client. The communication device includes: a third sending module for sending first network identification information to a first network address translation device, the first network address translation device for sending the first network identification information to a second client; a second receiving module for receiving the second network identification information of the second client sent by the first network address translation device; and a first connection module for establishing a data transmission connection with the second client having the first network identification information based on the second network identification information.
[0025] This application also provides a communication device deployed on a second network address translation device. The communication device includes: a fourth sending module for sending first network identification information of a first client to a second client; a fifth sending module for sending second network identification information of the second client to a signaling server, the signaling server being used to send the second network identification information to the first client; the first network address translation device is a device with a probe; the first network identification information and the second network identification information are used together to establish a data transmission connection between the first client and the second client; and a sixth sending module for sending second data of the second client to the first network address translation device when the first client and the second client establish a data transmission connection based on the first network identification information and the second network identification information, the first network address translation device being used to send the second data to the first client.
[0026] This application also provides a communication device deployed on a second client. The communication device includes: a seventh sending module for sending second network identification information to a second network address translation device, the second network address translation device being used to send the second network identification information to a first client; the first client is a port-limited cone client or a symmetrical client; a third receiving module for receiving the first network identification information of the first client sent by the second network address translation device; and a second connection module for establishing a data transmission connection with the first client having the second network identification information based on the first network identification information, and sending second data to the second network address translation device, the second network address translation device being used to send the second data to the first client.
[0027] This application also provides a communication device deployed on a signaling server; the communication device includes: a fourth receiving module for receiving first network identification information of a first client sent by a first network address translation device; an eighth sending module for sending the first network identification information to a second client via a second network address translation device; a fifth receiving module for receiving second network identification information of a second client sent by the second network address translation device; and a ninth sending module for sending the second network identification information to the first client via the first network address translation device; wherein the first network address translation device and / or the second network address translation device are devices equipped with probes.
[0028] This application also provides a communication device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement any of the communication methods described above.
[0029] This application also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the communication method as described above.
[0030] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the communication method described above.
[0031] The communication method, system, apparatus, device, storage medium, and program product provided in this application include a communication method applied to a first network address translation device with a probe. The method includes: sending a first network identification information of a first client to a signaling server; the signaling server then sends the first network identification information to a second client; the second client is a port-restricted cone client or a symmetrical client; receiving the second network identification information of the second client sent by the signaling server; and sending the second network identification information to the first client; the first and second network identification information are used together to establish a data transmission connection between the first and second clients. Through this method, this application, using a first network address translation device with a probe, can automatically detect changes in the external network, effectively acquire and transmit the client's network identification information, thereby quickly establishing a data transmission connection, improving communication efficiency and real-time performance; it can solve the communication restriction problem between port-restricted cone and / or symmetrical clients, achieving a stable connection between them and improving the communication success rate. Attached Figure Description
[0032] To more clearly illustrate the technical solutions in this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0033] Figure 1 This is a schematic diagram of the communication system provided in the embodiments of this application.
[0034] Figure 2 This is one of the flowcharts illustrating the communication method provided in the embodiments of this application.
[0035] Figure 3 This is the second flowchart illustrating the communication method provided in the embodiments of this application.
[0036] Figure 4 This is the third flowchart illustrating the communication method provided in the embodiments of this application.
[0037] Figure 5 This is the fourth flowchart illustrating the communication method provided in the embodiments of this application.
[0038] Figure 6 This is the fifth flowchart illustrating the communication method provided in the embodiments of this application.
[0039] Figure 7 This is one of the structural schematic diagrams of the communication device provided in the embodiments of this application.
[0040] Figure 8 This is the second schematic diagram of the communication device provided in the embodiments of this application.
[0041] Figure 9 This is the third schematic diagram of the communication device provided in the embodiments of this application.
[0042] Figure 10 This is the fourth schematic diagram of the communication device provided in the embodiments of this application.
[0043] Figure 11 This is the fifth schematic diagram of the communication device provided in the embodiments of this application.
[0044] Figure 12 This is a schematic diagram of the physical structure of the communication device provided in the embodiments of this application. Detailed Implementation
[0045] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0046] This application provides a communication method and system that enables fast and stable connection between port-restricted cone clients and symmetric clients through a network address translation device with probes.
[0047] Please see Figure 1 , Figure 1 This is a schematic diagram of the communication system provided in an embodiment of this application. The communication system may include a first network address translation device 110, a first client 120, a second network address translation device 130, a second client 140, and a signaling server 150.
[0048] The first network address translation device 110 is a device with a probe; the first network address translation device 110 is used to obtain and forward the second network identification information of the second client 140 to the first client 120, and send the first network identification information of the first client 120 to the signaling server 150.
[0049] The first client 120 is a port-restricted cone client or a symmetric client, and is connected to the first network address translation device 110; the first client 120 is used to receive the second network identification information and establish a data transmission connection with the second client 140 based on the second network identification information.
[0050] The second network address translation device 130 is a device with a probe; the second network address translation device 130 is used to obtain and forward the first network identification information of the first client 120 to the second client 140, and send the second network identification information of the second client 140 to the signaling server 150.
[0051] The second client 140 is a port-restricted cone client or a symmetric client, and is connected to the second network address translation device 130. The second client 140 is used to receive the first network identification information and establish a data transmission connection with the first client 120 based on the first network identification information.
[0052] The signaling server 150 is configured to receive first network identification information sent by the first network address translation device 110 and send the first network identification information to the second network address translation device 130; and to receive second network identification information sent by the second network address translation device 130 and send the second network identification information to the first network address translation device 110.
[0053] In this embodiment, both the first network address translation device 110 and the second network address translation device 130 are probe-equipped devices. These probe-equipped devices have the ability to actively detect and acquire network information, and can actively interact with the signaling server 150 of the external network to obtain network identification information from other clients. Optionally, the network identification information may include information such as the client's IP address and port number.
[0054] The first network address translation device 110 can communicate with the signaling server 150 to obtain the second network identification information of the second client 140, and forward this information to the first client 120 so that the first client 120 can establish a data transmission connection with the second client 140 based on the second network identification information; and the first network address translation device 110 can also collect the first network identification information of the first client 120 and send it to the signaling server 150 so that the second client 140 can obtain the first network identification information.
[0055] The second network address translation device 130 can communicate with the signaling server 150 to obtain the first network identification information of the first client 120 and forward this information to the second client 140 so that the second client 140 can establish a data transmission connection with the first client 120 based on the first network identification information; and the second network address translation device 130 can also collect the second network identification information of the second client 140 and send it to the signaling server 150 so that the first client 120 can obtain the second network identification information.
[0056] The first client 120 and the second client 140 are port-restricted cone clients or symmetric clients, both of which are typically subject to strict NAT restrictions in network communication. Therefore, in this embodiment, by using a NAT device with probes, point-to-point connections between port-restricted cone NAT and symmetric NAT can be achieved, improving the success rate of point-to-point traversal for these two types of clients.
[0057] It should be noted that port-restricted cone clients and symmetric clients refer to the classification of clients based on the type of NAT (Network Address Translation) device they are connected to. Different NAT device types will affect the communication methods and capabilities between clients.
[0058] Specifically, the first client 120 receives the second network identification information of the second client 140 from the first network address translation device 110, and the second client 140 receives the first network identification information of the first client 120 from the second network address translation device 130. The first client 120 and the second client 140 respectively use the received first network identification information and second network identification information to establish a data transmission connection with the other client, and finally realize point-to-point data communication.
[0059] During this process, the signaling server 150 coordinates and manages the communication system: the signaling server 150 receives and forwards the client's network identification information, enabling both parties to obtain each other's connection information. Optionally, the signaling server 150 can also help the client negotiate communication parameters through signaling interaction, ensuring that both parties can establish a valid data transmission connection based on these parameters.
[0060] The present application provides a communication system that, through the cooperation of a network address translation device with a probe and a signaling server, enables port-restricted cone-shaped clients and symmetrical clients to effectively obtain each other's network identification information, thereby enhancing the flexibility and adaptability of the communication system in complex network environments and improving the success rate of point-to-point connections.
[0061] In some embodiments, the network address translation device can transmit NAT port information by sending SIP (Session Initiation Protocol) messages or SDP (Session Description Protocol) messages to the signaling server. SIP and SDP messages can be used to transmit session information and media description information in the communication system. By carrying NAT port information within these messages, NAT traversal can be achieved, allowing the signaling server to obtain and store the client's network identification information.
[0062] For example, the first network address translation device can add first network identification information to the header or a custom field of the SIP message. The first network identification information may include the IP and port information of the NAT, etc.; the first network address translation device may also include the IP and port information of the NAT in the SDP message.
[0063] For example, the second network address translation device can add second network identification information to the header or a custom field of the SIP message. The second network identification information may include the IP and port information of the NAT, etc.; the second network address translation device may also include the IP and port information of the NAT in the SDP message.
[0064] The communication methods executed in each device will be explained in detail below: Please see Figure 2 , Figure 2 This is one of the flowcharts illustrating the communication method provided in this application embodiment. In this embodiment, the communication method is applied to a first network address translation device with a probe, and may specifically include the following steps: S210: The first network identification information of the first client is sent to the signaling server, and the signaling server is used to send the first network identification information to the second client.
[0065] S220: Receive the second network identification information of the second client sent by the signaling server.
[0066] S230: Send the second network identification information to the first client; the first network identification information and the second network identification information are used together to establish a data transmission connection between the first client and the second client.
[0067] The first network address translation device is connected to the first client, which is either a port-restricted cone client or a symmetric client; the second client is either a port-restricted cone client or a symmetric client.
[0068] In this embodiment, the first network identification information is used to identify and locate the network location of the first client. The first network identification information may include information such as the first client's internal IP address, the first client's internal port, the first client's external IP address, and the first client's external port.
[0069] Accordingly, the second network identification information is used to identify and locate the network location of the second client. The second network identification information may include information such as the second client's internal IP address, the second client's internal port, the second client's external IP address, and the second client's external port.
[0070] The first network address translation device sends the first network identification information of the first client to the signaling server, receives the second network identification information of the second client from the signaling server, and sends the second network identification information to the first client, enabling the first client to establish a data transmission connection with the second client based on the received second network identification information. Simultaneously, the second client also establishes a connection with the first client based on the first network identification information obtained from the signaling server.
[0071] Compared with NAT devices of related technologies, the first network address translation device in this embodiment is a device with a probe, which can automatically detect changes in the external network, effectively obtain and transmit network identification information of port-restricted cone clients and symmetric clients, thereby quickly establishing data transmission connections.
[0072] In some embodiments, after sending the second network identification information to the first client, the method further includes: The device receives first data from the first client and sends the first data to the second network address translation device, which is used to send the first data to the second client.
[0073] In this embodiment, the first network address translation device can also receive first data from the first client and send this data to the second client through the second network address translation device, realizing actual communication between the two clients and performing effective data exchange. The first network address translation device plays a role in forwarding data during this process, ensuring that data can be correctly transmitted from the first client to the second client. By effectively managing the data flow, the efficiency of the entire communication system is improved, ensuring that data arrives at its destination in a timely and accurate manner.
[0074] In some embodiments, after sending the second network identification information to the first client, the method further includes: Receive the second data forwarded by the second network address translation device and send the second data to the first client.
[0075] In this embodiment, the first network address translation device can also receive second data sent by the second client through the second network address translation device, and then forward the data to the first client.
[0076] In combination with the above embodiments, this ensures that data can be transmitted bidirectionally between the two clients, thus achieving true two-way communication. Timely data transmission improves the real-time nature and reliability of communication, enhancing the user experience.
[0077] In some embodiments, before sending the first network identification information of the first client to the signaling server, the method further includes: Receive the first network identification information sent by the first client; determine the first network address translation mapping table based on the first network identification information.
[0078] In this embodiment, the first network address translation device can determine a first network address translation mapping table based on the received first network identifier information. The first network address translation mapping table can record the correspondence between the private network address and public network address of the first client, as well as related port information, thus ensuring that interactive data can be accurately transmitted between the first client and the external network.
[0079] In summary, by establishing and maintaining a network address translation mapping table, the first network address translation device can efficiently manage the network address translation process, ensuring that the network identification information of each client is accurately recorded and translated, thereby improving the reliability and efficiency of communication, especially in complex network environments involving NAT traversal.
[0080] In some embodiments, after receiving the second network identification information of the second client sent by the signaling server, the method further includes: Update the first network address translation mapping table based on the second network identifier information.
[0081] In this embodiment, the first network address translation device can use the network identification information received from the second client to update or supplement the mapping table in the first network address translation device. This enables the first network address translation device to dynamically update and maintain the mapping table to reflect the latest network status and connection information of each client in the current network environment.
[0082] Please see Figure 3 , Figure 3 This is a second schematic flowchart of the communication method provided in this application embodiment. In this embodiment, the communication method is applied to a first client and may specifically include the following steps: S310: Send the first network identification information to the first network address translation device, the first network address translation device being used to send the first network identification information to the second client.
[0083] S320: Receives the second network identification information of the second client sent by the first network address translation device.
[0084] S330: Establish a data transmission connection with a second client that has a first network identifier based on the second network identifier information.
[0085] The first client is connected to a first network address translation device with a probe. The first client is either a port-restricted cone client or a symmetrical client. The second client is either a port-restricted cone client or a symmetrical client.
[0086] In this embodiment, the first client sends its first network identification information to the first network address translation device connected to it. Upon receiving this information, the first network address translation device forwards it to the second client via a signaling server, enabling the second client to obtain the first client's network identification information. The first client then receives the second network identification information from the first network address translation device. This second network identification information is also obtained through a signaling server. The first client uses the received second network identification information to establish a data transmission connection with the second client.
[0087] In summary, by using a first network address translation device with a probe, the first client can obtain the second network identification information of the second client, thereby solving the NAT traversal problem between port-restricted cone and symmetric clients, thus quickly establishing a data transmission connection and improving the success rate of communication.
[0088] In some embodiments, after establishing a data transmission connection with a second client having first network identification information based on second network identification information, the method further includes: The first data is sent to the first network address translation device, which is used to send the first data to the second client; And / or, receive second data forwarded by the first network address translation device.
[0089] In this embodiment, the data sending and / or data receiving process of the first client is also described in detail as follows: Data transmission process: The first client transmits the first data to be sent to the first network address translation device. The first network address translation device can convert the source address and port information of the data packet into a public address and port that can be recognized by the external network according to the network address translation mapping table, and then send the converted data packet to the second network address translation device, which then forwards the data packet to the second client.
[0090] Data reception process: The second client transmits the second data to be sent to the second network address translation device. The second network address translation device can convert the destination address and port information of the data packet into the private address and port of the first client according to the network address translation mapping table, and then send the converted data packet to the first network address translation device, which then forwards the data packet to the first client.
[0091] In the above, under port-restricted cone or symmetric NAT environments, the first and second network address translation devices ensure that data can be transmitted smoothly in different network environments of the NAT devices through address translation and packet forwarding. The first and second clients can achieve bidirectional data transmission, ensuring that both parties can continuously exchange information.
[0092] Please see Figure 4 , Figure 4 This is the third flowchart illustrating the communication method provided in this application embodiment. In this embodiment, the communication method is applied to a second network address translation device, and may specifically include the following steps: S410: Send the first network identification information of the first client to the second client.
[0093] S420: The second network identification information of the second client is sent to the signaling server. The signaling server is used to send the second network identification information to the first client. The first network identification information and the second network identification information are used together to establish a data transmission connection between the first client and the second client.
[0094] S430: When the first client and the second client establish a data transmission connection based on the first network identification information and the second network identification information, the second data of the second client is sent to the first network address translation device, and the first network address translation device is used to send the second data to the first client.
[0095] The second network address translation device is connected to the second client, which is either a port-restricted cone client or a symmetrical client; the first client is either a port-restricted cone client or a symmetrical client, and the first network address translation device is a device with a probe.
[0096] In this embodiment, after receiving the first network identification information from the first client via the first network address translation device, the second network address translation device forwards it to the second client. The second network address translation device then sends the second network identification information from the second client to a signaling server, which in turn forwards this information to the first network address translation device, ultimately reaching the first client. Once the first client and the second client successfully establish a data transmission connection based on each other's network identification information, the second network address translation device is responsible for sending the second data from the second client to the first client via the first network address translation device.
[0097] In this embodiment, through the forwarding function of the second network address translation device, the first client and the second client can quickly obtain each other's network identification information, thus speeding up the connection establishment process.
[0098] It should be noted that since the second client actively sends information to the first client, the second client can obtain the first network identification information from the signaling server through the second network address translation device. Therefore, the second network address translation device can also be a device without probes.
[0099] In some embodiments, the second network address translation device may also be a device with a probe, in which case the second network address translation device can passively receive data sent by other clients.
[0100] In some embodiments, before sending the second network identification information of the second client to the signaling server, the method further includes: Receive the second network identification information sent by the second client; determine the second network address translation mapping table based on the second network identification information.
[0101] In this embodiment, the second network address translation device determines or updates its second network address translation mapping table based on the received second network identification information. The second network address translation mapping table records the correspondence between the private network address and the public network address of the second client, as well as the relevant port information, which can ensure that data packets can be correctly address translated and forwarded between the second client and the external network.
[0102] In some embodiments, the second network address translation device is a device with a probe; before sending the first network identification information of the first client to the second client, the method further includes: Receive the first network identification information sent by the signaling server; update the second network address translation mapping table based on the first network identification information.
[0103] In this embodiment, the second network address translation device receives the first network identification information of the first client from the signaling server, and updates the second network address translation mapping table maintained internally according to the first network identification information.
[0104] By updating the mapping table, the second network address translation device can accurately forward data packets from the second client to the first client, improving the accuracy and reliability of communication. In addition, the second network address translation device is allowed to dynamically adjust its mapping table, which can adapt to changes in the network environment and ensure the continuity of communication.
[0105] In some embodiments, after sending the second network identification information of the second client to the signaling server, the method further includes: The heartbeat information is sent to the first network address translation device, which is used to send the heartbeat information to the first client.
[0106] In this embodiment, after the second network identification information of the second client is successfully sent to the signaling server, the first network address translation device performs the operation of sending heartbeat information. Heartbeat information is typically a short, periodically sent data packet used to detect and confirm whether the connection status between devices is normal. This avoids the network device mistakenly judging the connection as disconnected due to idle connection, thereby ensuring the continuous availability of the communication link.
[0107] Please see Figure 5 , Figure 5 This is the fourth flowchart illustrating the communication method provided in this application embodiment. In this embodiment, the communication method is applied to a second client and may specifically include the following steps: S510: Send the second network identification information to the second network address translation device, which is used to send the second network identification information to the first client.
[0108] S520: Receives the first network identification information of the first client sent by the second network address translation device.
[0109] S530: Establish a data transmission connection with a first client having second network identification information based on the first network identification information, and send the second data to the second network address translation device, which is used to send the second data to the first client.
[0110] The second client is connected to the second network address translation device. The second client is either a port-restricted cone client or a symmetrical client. The first client is either a port-restricted cone client or a symmetrical client.
[0111] In this embodiment, the second client sends its own second network identification information to the second network address translation device connected to it. The purpose of this step is to enable the second network address translation device to obtain the network location information of the second client so that the first client can obtain this information through the network address translation device.
[0112] After receiving the first network identifier information from the first client, the second network address translation device forwards it to the second client. The second client receives and stores this information for subsequent connection establishment with the first client.
[0113] Finally, the second client uses the received first network identification information to establish a data transmission connection with the first client. The second client then sends the second data to the first client through the second network address translation device.
[0114] In this embodiment, the second client, through cooperation with the second network address translation device, transmits its network identification information to the first client and obtains network identification information from the first client, thereby enabling direct communication between the two parties. Furthermore, addressing the communication challenges posed by port-restricted cone and symmetric clients, the address translation function of the second network address translation device effectively solves the NAT traversal problem, enabling clients within a private network to establish effective communication connections with other clients. Optionally, the second network address translation device is a device with a probe.
[0115] In some embodiments, before establishing a data transmission connection with the first client based on the first network identification information, the method further includes: The heartbeat information is sent to the second network address translation device, which is used to send the heartbeat information to the first client.
[0116] In this embodiment, before the second client prepares to establish a data transmission connection with the first client, the second client also sends heartbeat information to the first client through the second network address translation device. This step ensures that the communication path is activated and remains active before the connection is established.
[0117] The heartbeat information may not include specific business data. The heartbeat information is mainly used to maintain the active state of the connection and prevent the connection from being disconnected by firewalls or NAT devices in the network due to a long period of no data transmission, thereby ensuring the continuous availability of the communication link.
[0118] For example, by receiving feedback of heartbeat information, such as confirmation, the second network address translation device can promptly detect the connection status of the first client. If no response is received to the heartbeat information, the device can quickly determine that a connection problem may have occurred and take appropriate measures, such as re-establishing the connection or triggering an alarm.
[0119] Please see Figure 6 , Figure 6 This is the fifth flowchart illustrating the communication method provided in this application embodiment. In this embodiment, the communication method is applied to a signaling server and may specifically include the following steps: S610: Receive the first network identification information of the first client sent by the first network address translation device.
[0120] S620: The first network identification information is sent to the second client through the second network address translation device.
[0121] S630: Receives the second network identification information of the second client sent by the second network address translation device.
[0122] S640: The second network identification information is sent to the first client through the first network address translation device.
[0123] The first network address translation device is connected to the first client, which is a port-restricted cone client or a symmetric client; the second network address translation device is connected to the second client, which is a port-restricted cone client or a symmetric client; the first network address translation device and / or the second network address translation device are devices with probes.
[0124] The communication method in this embodiment is applied to a signaling server. The signaling server acts as an information relay station, ensuring that the first client and the second client can obtain each other's network identification information: the signaling server can receive and forward the first network identification information to ensure that the second client can obtain the first client's first network identification information; the signaling server can receive and forward the second network identification information to ensure that the first client can obtain the second client's second network identification information.
[0125] Therefore, the signaling server coordinates the exchange of network identification information between clients, so that even if the first client and the second client are located in different private networks, they can communicate through their respective network address translation devices.
[0126] This method is particularly suitable for communication between port-restricted cone and symmetric clients, which are difficult to connect directly in related communication methods. By relaying through a signaling server, it effectively solves the NAT traversal problem, expands the application scenarios of communication, and enhances the flexibility and adaptability of the communication system under different NAT devices. It effectively improves the communication efficiency and reliability between port-restricted cone and symmetric clients, and provides support for real-time communication in complex network environments.
[0127] To further illustrate the communication method of the embodiments of this application, the communication interaction flow of the overall system is given below for reference. Please continue reading. Figure 1 Port-restricted cone NAT and symmetric NAT can be bypassed by using NAT devices with probes.
[0128] Among them, the first client 120 is a port-restricted cone client of RTC (hereinafter referred to as client A or A), the second client 140 is a symmetric client of RTC (hereinafter referred to as client B or B), the first network address translation device 110 is a device with a probe (hereinafter referred to as NAT device C or C), the second network address translation device 130 is a device with a probe (hereinafter referred to as NAT device D or D), and the signaling server is located on the external network.
[0129] Specifically, this may include the following steps: ① Before client A and client B can communicate with each other, client A needs to communicate with the signaling server and create a NAT mapping table on NAT device C. This NAT mapping table can include information such as A's internal IP address, internal port, external IP address, external port, signaling server IP address, and signaling server port.
[0130] ② Client B needs to communicate with the signaling server and create a NAT mapping table on NAT device D. The NAT mapping table can include information such as B's internal IP address, internal port, external IP address, external port, signaling server IP address, and signaling server port.
[0131] ③ When client B sends data to client A, since client A's NAT table does not contain client B's IP address and port information, the data sent by client B to client A is dropped by client A's NAT because it cannot traverse client A's NAT. Although the data sent by client B cannot traverse client A's NAT, it does add client A's information to client B's NAT table.
[0132] The NAT mapping table of client B can be presented in the form of multiple tables. For example, the first table includes information such as B's internal IP address, internal port, external IP address, external port, signaling server IP address, and signaling server port; the second table includes information such as B's internal IP address, internal port, external IP address, external port, and A's external IP address and external port.
[0133] ④ The NAT device D with a probe sends the IP and port information of client B to the signaling server. Specific implementation: The NAT port information can be transmitted via SIP messages or SDP. The NAT IP and port information can be added to the header or a custom field of the SIP message, or it can be included in the SDP.
[0134] ⑤ The signaling server sends the message containing the IP address and port information of client B to client A through NAT device C with a probe.
[0135] It should be noted that during periods ④ and ⑤, client B needs to continuously send heartbeat messages to client A to ensure that the IP address and port are not changed or closed.
[0136] ⑥ When client B's IP and port information are transmitted to client A, client A sends data to client B. At this time, client B's information is added to client A's NAT mapping table. That is, the NAT mapping table can include A's internal IP, internal port, external IP, external port, signaling server IP, signaling server port, B's external IP, external port, and other information.
[0137] Furthermore, since client B is constantly sending heartbeat messages to client A, when client B sends data to client A, the data can traverse the NAT and reach client A.
[0138] Ultimately, because client B's NAT mapping table contains client A's information, data sent from client A to client B can reach client B normally. Thus, the peer-to-peer connection is successful.
[0139] In summary, this embodiment can solve the communication problem between port-restricted cone NAT and symmetric NAT, achieving a fast and stable connection. Specifically, by modifying the NAT device into a NAT device with probes, the IP address and port of the symmetric NAT client can be obtained. Heartbeat messages are used to prevent IP and port changes and closures, thereby achieving a point-to-point connection between port-restricted cone NAT and symmetric NAT, that is, achieving a stable connection between port-restricted cone NAT and / or symmetric NAT clients, and improving the success rate of communication.
[0140] The communication device provided in this application is described below. The communication device described below can be referred to in correspondence with the communication method described above.
[0141] Please see Figure 7 , Figure 7 This is one of the structural schematic diagrams of the communication device provided in the embodiments of this application.
[0142] In this embodiment, the communication device is deployed on a first network address translation device with probes. The first network address translation device is connected to a first client, which is a port-restricted cone client or a symmetrical client. The communication device includes: The first sending module 710 is used to send the first network identification information of the first client to the signaling server, and the signaling server is used to send the first network identification information to the second client; the second client is a port-restricted cone client or a symmetrical client.
[0143] The first receiving module 720 is used to receive the second network identification information of the second client sent by the signaling server.
[0144] The second sending module 730 is used to send the second network identification information to the first client. The first and second network identification information are used together to establish a data transmission connection between the first and second clients.
[0145] Please see Figure 8 , Figure 8 This is the second schematic diagram of the communication device provided in the embodiments of this application.
[0146] In this embodiment, the communication device is deployed on the first client, which is connected to a first network address translation device with a probe. The first client is a port-restricted cone client or a symmetrical client. The communication device includes: The third sending module 810 is used to send the first network identification information to the first network address translation device, and the first network address translation device is used to send the first network identification information to the second client; the second client is a port-restricted cone client or a symmetric client.
[0147] The second receiving module 820 is used to receive the second network identification information of the second client sent by the first network address translation device.
[0148] The first connection module 830 is used to establish a data transmission connection with a second client that has the first network identification information based on the second network identification information.
[0149] Please see Figure 9 , Figure 9 This is the third schematic diagram of the communication device provided in the embodiments of this application.
[0150] In this embodiment, the communication device is deployed on the second network address translation device, which is connected to the second client. The second client is a port-restricted cone client or a symmetrical client. The communication device includes a fourth sending module 910, a fifth sending module 920, and a sixth sending module 930.
[0151] The fourth sending module 910 is used to send the first network identification information of the first client to the second client; the first client is a port-restricted cone client or a symmetrical client.
[0152] The fifth sending module 920 is used to send the second network identification information of the second client to the signaling server, and the signaling server is used to send the second network identification information to the first client; the first network address translation device is a device with a probe. The first network identification information and the second network identification information are used together to establish a data transmission connection between the first client and the second client.
[0153] The sixth sending module 930 is used to send the second data of the second client to the first network address translation device when the first client and the second client establish a data transmission connection based on the first network identification information and the second network identification information. The first network address translation device is used to send the second data to the first client.
[0154] Please see Figure 10 , Figure 10 This is the fourth schematic diagram of the communication device provided in the embodiments of this application.
[0155] In this embodiment, the communication device is deployed on the second client, which is connected to the second network address translation device. The second client is a port-restricted cone client or a symmetrical client. The communication device includes a seventh sending module 1010, a third receiving module 1020, and a second connecting module 1030.
[0156] The seventh sending module 1010 is used to send the second network identification information to the second network address translation device, and the second network address translation device is used to send the second network identification information to the first client; the first client is a port-restricted cone client or a symmetric client; The third receiving module 1020 is used to receive the first network identification information of the first client sent by the second network address translation device; The second connection module 1030 is used to establish a data transmission connection with a first client having second network identification information based on the first network identification information, and to send the second data to the second network address translation device. The second network address translation device is used to send the second data to the first client.
[0157] Please see Figure 11 , Figure 11 This is the fifth schematic diagram of the communication device provided in the embodiments of this application.
[0158] In this embodiment, the communication device is deployed on the signaling server; the communication device includes a fourth receiving module 1110, an eighth sending module 1120, a fifth receiving module 1130, and a ninth sending module 1140.
[0159] The fourth receiving module 1110 is used to receive the first network identification information of the first client sent by the first network address translation device.
[0160] The eighth sending module 1120 is used to send the first network identification information to the second client through the second network address translation device.
[0161] The fifth receiving module 1130 is used to receive the second network identification information of the second client sent by the second network address translation device.
[0162] The ninth sending module 1140 is used to send the second network identification information to the first client through the first network address translation device.
[0163] The first network address translation device is connected to the first client, which is a port-restricted cone client or a symmetric client; the second network address translation device is connected to the second client, which is a port-restricted cone client or a symmetric client; the first network address translation device and / or the second network address translation device are devices with probes.
[0164] On the other hand, this application also provides a communication device, please refer to... Figure 12 , Figure 12 This is a schematic diagram of the physical structure of the communication device provided in the embodiments of this application, such as... Figure 12 As shown, the communication device may include a memory 1220, a processor 1210, and a computer program stored in the memory 1220 and executable on the processor 1210. When the processor 1210 executes the program, it can implement the communication methods provided by the above methods. The steps and principles have been described in detail in the above methods and will not be repeated here.
[0165] Optionally, the communication device may further include a communication bus 1230 and a communication interface 1240, wherein the processor 1210, the communication interface 1240, and the memory 1220 communicate with each other through the communication bus 1230. The processor 1210 may call the computer program in the memory 1220 to execute the communication methods provided by the above methods.
[0166] Furthermore, the logical instructions in the aforementioned memory 1220 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0167] The communication equipment can be a signaling server, a NAT device, or an RTC client, etc.
[0168] On the other hand, this application also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the communication methods provided by the above methods. The steps and principles of these methods have been described in detail in the above methods and will not be repeated here.
[0169] In another aspect, this application also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the communication methods provided by the above methods. The steps and principles of the communication methods have been described in detail in the above methods and will not be repeated here.
[0170] Non-transitory computer-readable storage media can be any available medium or data storage device that can be accessed by a processor, including but not limited to magnetic storage (e.g., floppy disks, hard disks, magnetic tapes, magneto-optical disks (MOs), etc.), optical storage (e.g., CDs, DVDs, BDs, HVDs, etc.), and semiconductor storage (e.g., ROMs, EPROMs, EEPROMs, non-volatile memory (NAND flash), solid-state drives (SSDs)).
[0171] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0172] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0173] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A communication method, characterized in that, The communication method, applied to a first network address translation device with a probe, includes: The first network identification information of the first client is sent to the signaling server, and the signaling server is used to send the first network identification information to the second client; Receive the second network identification information of the second client sent by the signaling server; The second network identification information is sent to the first client; the first network identification information and the second network identification information are used together to establish a data transmission connection between the first client and the second client.
2. The communication method according to claim 1, characterized in that, After sending the second network identification information to the first client, the method further includes: The device receives first data from the first client and sends the first data to the second network address translation device, which is used to send the first data to the second client.
3. The communication method according to claim 1, characterized in that, After sending the second network identification information to the first client, the method further includes: The system receives second data forwarded by the second network address translation device and sends the second data to the first client.
4. The communication method according to claim 1, characterized in that, Before sending the first network identification information of the first client to the signaling server, the method further includes: Receive the first network identification information sent by the first client; Based on the first network identifier information, a first network address translation mapping table is determined.
5. The communication method according to claim 4, characterized in that, After receiving the second network identification information of the second client sent by the signaling server, the method further includes: The first network address translation mapping table is updated based on the second network identifier information.
6. A communication method, characterized in that, Applied to the first client, the communication method includes: The first network identification information is sent to the first network address translation device, and the first network address translation device is used to send the first network identification information to the second client; Receive the second network identification information of the second client sent by the first network address translation device; A data transmission connection is established with a second client that has the first network identification information based on the second network identification information.
7. The communication method according to claim 6, characterized in that, After establishing a data transmission connection with a second client possessing the first network identifier information based on the second network identifier information, the process further includes: The first data is sent to the first network address translation device, and the first network address translation device is used to send the first data to the second client.
8. The communication method according to claim 6, characterized in that, After establishing a data transmission connection with a second client possessing the first network identifier information based on the second network identifier information, the process further includes: Receive the second data forwarded by the first network address translation device.
9. A communication method, characterized in that, The communication method, applied to a second network address translation device, includes: Send the first network identification information of the first client to the second client; The second network identification information of the second client is sent to the signaling server, and the signaling server is used to send the second network identification information to the first client; the first network identification information and the second network identification information are used together to establish a data transmission connection between the first client and the second client; When the first client and the second client establish a data transmission connection based on the first network identification information and the second network identification information, the second data of the second client is sent to the first network address translation device, and the first network address translation device is used to send the second data to the first client.
10. The communication method according to claim 9, characterized in that, Before sending the second network identification information of the second client to the signaling server, the method further includes: Receive the second network identification information sent by the second client; Based on the second network identifier information, a second network address translation mapping table is determined.
11. The communication method according to claim 10, characterized in that, The second network address translation device is a device with a probe; before sending the first network identification information of the first client to the second client, the method further includes: Receive the first network identification information sent by the signaling server; The second network address translation mapping table is updated based on the first network identification information.
12. The communication method according to claim 9, characterized in that, After sending the second network identification information of the second client to the signaling server, the method further includes: The heartbeat information is sent to the first network address translation device, which is used to send the heartbeat information to the first client.
13. A communication method, characterized in that, Applied to a second client, the communication method includes: The second network identification information is sent to the second network address translation device, which is used to send the second network identification information to the first client; Receive the first network identification information of the first client sent by the second network address translation device; A data transmission connection is established between the first network identifier information and the first client having the second network identifier information, and the second data is sent to the second network address translation device. The second network address translation device is used to send the second data to the first client.
14. The communication method according to claim 13, characterized in that, The second network address translation device is a device with a probe.
15. The communication method according to claim 13, characterized in that, Before establishing a data transmission connection with a first client having the second network identifier information based on the first network identifier information, the method further includes: The heartbeat information is sent to the second network address translation device, which is used to send the heartbeat information to the first client.
16. A communication method, characterized in that, Applied to a signaling server; the communication method includes: Receive the first network identification information of the first client sent by the first network address translation device; The first network identification information is sent to the second client via the second network address translation device; Receive the second network identification information of the second client sent by the second network address translation device; The second network identification information is sent to the first client via the first network address translation device; Wherein, the first network address translation device and / or the second network address translation device are devices with probes.
17. A communication system, characterized in that, include: The first network address translation device is a device with a probe, used to obtain and forward the second network identification information of the second client to the first client, and send the first network identification information of the first client to the signaling server; The first client is configured to receive the second network identification information and establish a data transmission connection with the second client based on the second network identification information; The second network address translation device is a device with a probe, used to obtain and forward the first network identification information of the first client to the second client, and send the second network identification information of the second client to the signaling server; The second client is used to receive the first network identification information and establish a data transmission connection with the first client based on the first network identification information; The signaling server is configured to receive the first network identification information sent by the first network address translation device and send the first network identification information to the second network address translation device; and to receive the second network identification information sent by the second network address translation device and send the second network identification information to the first network address translation device.
18. A communication device, characterized in that, Deployed in a first network address translation device with probes, the communication device includes: The first sending module is used to send the first network identification information of the first client to the signaling server, and the signaling server is used to send the first network identification information to the second client; The first receiving module is used to receive the second network identification information of the second client sent by the signaling server; The second sending module is used to send the second network identification information to the first client; the first network identification information and the second network identification information are used together to establish a data transmission connection between the first client and the second client.
19. A communication device, characterized in that, Deployed on the first client, the communication device includes: The third sending module is used to send the first network identification information to the first network address translation device, and the first network address translation device is used to send the first network identification information to the second client; The second receiving module is used to receive the second network identification information of the second client sent by the first network address translation device; The first connection module is used to establish a data transmission connection with a second client that has the first network identification information based on the second network identification information.
20. A communication device, characterized in that, Deployed in a second network address translation device, the communication device includes: The fourth sending module is used to send the first network identification information of the first client to the second client; The fifth sending module is used to send the second network identification information of the second client to the signaling server, and the signaling server is used to send the second network identification information to the first client; the first network identification information and the second network identification information are used together to establish a data transmission connection between the first client and the second client; The sixth sending module is used to send the second data of the second client to the first network address translation device when the first client and the second client establish a data transmission connection based on the first network identification information and the second network identification information. The first network address translation device is used to send the second data to the first client.
21. A communication device, characterized in that, Deployed on a second client, the communication device includes: The seventh sending module is used to send the second network identification information to the second network address translation device, and the second network address translation device is used to send the second network identification information to the first client; The third receiving module is used to receive the first network identification information of the first client sent by the second network address translation device; The second connection module is used to establish a data transmission connection with a first client having the second network identification information based on the first network identification information, and to send the second data to the second network address translation device. The second network address translation device is used to send the second data to the first client.
22. A communication device, characterized in that, Deployed on the signaling server; The communication device includes: The fourth receiving module is used to receive the first network identification information of the first client sent by the first network address translation device; The eighth sending module is used to send the first network identification information to the second client through the second network address translation device; The fifth receiving module is used to receive the second network identification information of the second client sent by the second network address translation device; The ninth sending module is used to send the second network identification information to the first client through the first network address translation device; Wherein, the first network address translation device and / or the second network address translation device are devices with probes.
23. A communication device, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the communication method as described in any one of claims 1 to 16.
24. A non-transitory 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 communication method as described in any one of claims 1 to 16.
25. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the communication method as described in any one of claims 1 to 16.