Method and system for far-field communication between devices
By integrating STUN penetration and RTN real-time network, the RTN network transmission channel is used first and the best channel is selected after STUN penetration, which solves the reliability and cost problems of far-field communication between 1+8+N devices and achieves fast, Low-latency remote data transfer and device discovery.
Patent Information
- Application Number
- PCT/CN2024/077783
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-02-28
- Filing Date
- 2024-02-20
- Publication Date
- 2024-09-06
AI Technical Summary
Existing technology cannot effectively realize fast, reliable and low-cost far-field communication between 1+8+N devices, especially when the network environment changes, resulting in poor user experience, complex device discovery and signaling interactions, and high power consumption. .
Adopting a method that integrates STUN penetration and RTN real-time network, the RTN network transmission channel is used first to establish a connection, and the best transmission channel is selected after STUN penetration. Device discovery, signaling interaction and channel decision-making are realized through the far-field communication SDK, reducing the cost System complexity and cost.
It achieves fast and reliable far-field communication between 1+8+N devices, reduces data transmission delay and cost, improves device discovery efficiency, simplifies system implementation, and takes into account high reliability and low cost requirements.
Smart Images

Figure CN2024077783_06092024_PF_FP
Abstract
Description
Method and system for device far-field communication
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on February 28, 2023, with application number 202310224212.7 and application name “Method and System for Far-Field Communication of Devices”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of communications, and more specifically, to a method and system for far-field communication of devices. Background Art
[0003] The current 1+8+N devices on the market (1 refers to mobile phones, 8 includes PCs, tablets, TVs, speakers, glasses, watches, car computers, and headphones, and N includes other Internet of Things (IoT) devices) require remote communication (or far-field communication) between them. However, there is currently no unified far-field communication solution that can quickly establish far-field communication between all 1+8+N devices while meeting the requirements of high availability (high reliability) and low cost.
[0004] Summary of the Invention
[0005] The present application provides a method and system for far-field communication of devices, which integrates STUN penetration and RTN real-time network. When users transmit data remotely, RTN network transmission channels are used for data transmission first. RTN network connection can be established in a short time, ensuring high reliability of data transmission and rapid establishment of services. There is no need to wait for all network paths to be successfully tried before selection, nor is there any need to wait for the detection results of STUN penetration. At the same time, STUN penetration is performed in parallel using the STUN protocol. When STUN penetration is successful, a public network direct connection transmission channel is established after STUN penetration. The target transmission channel is selected from the two transmission channels according to the selection criteria to continue data transmission, thereby taking into account the requirements of high reliability and low cost of remote data transmission, and realizing far-field communication between any two 1+8+N devices.
[0006] In a first aspect, a system for far-field communication of devices is provided. The system includes: a first terminal device, an RTN server, and a second terminal device. The first terminal device is configured to establish an RTN network transmission channel with the second terminal device, where the RTN network transmission channel is a transmission channel that uses the RTN server as a transit channel. The first terminal device is further configured to establish a public network direct connection transmission channel after STUN penetration with the second terminal device. The first terminal device is further configured to transmit a first portion of data to be transmitted to the second terminal device using the RTN network transmission channel. The first terminal device is further configured to select a target transmission channel between the RTN network transmission channel and the public network direct connection transmission channel after STUN penetration, and transmit the second portion of the data to be transmitted to the second terminal device through the target transmission channel.
[0007] The first aspect provides a far-field communication system for devices, which integrates STUN penetration and the RTN real-time network. When users transmit data remotely, the RTN real-time network is used for data transmission first. The RTN network connection (i.e., the RTN network transmission channel) can be established in a short time, ensuring high reliability of data transmission and rapid establishment of services. There is no need to wait for all network paths to be successfully tried before selecting, nor is there any need to wait for the detection results of STUN penetration. At the same time, the STUN protocol is used to perform P2P penetration (i.e., STUN penetration) in parallel. When P2P penetration is successful, the target transmission channel is selected from the RTN network transmission channel and the public network direct connection transmission channel after STUN penetration to continue transmitting data, thereby taking into account the requirements of high reliability and low cost of remote data transmission, and realizing far-field communication between any two 1+8+N devices.
[0008] Exemplarily, the first terminal device and the second terminal device may both be 1+8+N devices.
[0009] Exemplarily, the data to be transmitted includes at least one of: pictures, audio, video, documents, or applications.
[0010] Exemplarily, the devices performing far-field communication (the first terminal device and the second terminal device) are both integrated with a far-field communication software development kit (SDK). The far-field communication SDK has the following capabilities: device discovery, STUN detection, RTN network access, signaling interaction, channel decision-making, state management, etc. Far-field communication can be easily implemented using one SDK.
[0011] Exemplarily, the far field communication SDK may include the following interfaces: initialization interface (init), device discovery interface (findDevice), RTN connection interface (rtnConnect), STUN binding interface (stunBinding), signaling interaction port (exchangeMessage), RTN sending interface (rtnSend), P2P direct connection sending interface (p2pSend), etc.
[0012] In one possible implementation of the first aspect, a first terminal device transmits a first portion of data to be transmitted to a second terminal device using an RTN network transmission channel. This occurs concurrently with the first and second terminal devices establishing a direct public network transmission channel after STUN traversal. This implementation ensures rapid establishment and transmission of service data, eliminating the need to wait for the direct public network transmission channel to be successfully established after STUN traversal before selecting a channel for data transmission. This ensures high reliability and improves the efficiency of remote data transmission.
[0013] In one possible implementation of the first aspect, the first terminal device and the second terminal device establish an RTN network transmission channel in parallel with establishing a direct public network transmission channel after STUN traversal. This implementation ensures rapid service establishment and reduces the time required to establish the transmission channel, thereby reducing data transmission latency and improving data transmission efficiency.
[0014] Exemplarily, the process of establishing an RTN network transmission channel between a mobile phone (a first terminal device) and a tablet (a second terminal device) includes: the mobile phone and tablet each access the RTN network using a network server to obtain an IP address and port number under the RTN network; and the mobile phone and tablet exchange their respective IP addresses and port numbers under the RTN network via the IoT cloud. The main process of establishing a direct public network transmission channel after STUN penetration between the mobile phone and tablet includes: the mobile phone and tablet each perform STUN penetration using a network server to obtain a public network IP address and port number after STUN penetration; the mobile phone and tablet exchange their respective public network IP addresses and port numbers after STUN penetration via the IoT cloud; and the mobile phone and tablet use the public network IP addresses and port numbers after STUN penetration to attempt to establish a direct public network transmission channel after STUN penetration.
[0015] In a possible implementation of the first aspect, the system further includes an IOT server, and the first terminal device is further used to: send first registration information to the IOT server, the first registration information including the address information and first user information of the first terminal device; the second terminal device is further used to: send second registration information to the IOT server, the second registration information including the address information and second user information of the second terminal device; the first terminal device is further used to: send query information to the IOT server, the query information is used to query the address of the second terminal device; when the first user information and the second user information are the same, the first terminal device is further used to: obtain the address of the second terminal device from the IOT server; the first terminal device is further used to: establish a communication connection with the second terminal device based on the address of the second terminal device. In this implementation, by using the IOT cloud (IOT server) to discover remote communication devices, any peer device that requires remote communication can be found without the need to connect to additional device discovery capabilities, thereby improving the efficiency of device discovery and reducing the complexity of device discovery.
[0016] In one possible implementation of the first aspect, the system further includes an IoT server, wherein the first terminal device is further configured to obtain the IP address and port number of the RTN network allocated to the first terminal device from the RTN server; the first terminal device is further configured to send the IP address and port number of the RTN network allocated to the first terminal device to the IoT server; the second terminal device is further configured to receive the IP address and port number of the RTN network allocated to the first terminal device from the RTN server; the second terminal device is further configured to send the IP address and port number of the RTN network allocated to the second terminal device to the IoT server; and the first terminal device is further configured to receive the IP address and port number of the RTN network allocated to the second terminal device from the IoT server. In this implementation, signaling interaction between devices is performed by reusing IoT cloud channels, i.e., using the IoT cloud to exchange IP addresses and port numbers of respective RTN networks, eliminating the need for an additional ICE signaling interaction server, thereby reducing system implementation complexity.
[0017] In a possible implementation of the first aspect, the first terminal device is further configured to establish an RTN network transmission channel with the second terminal device using the IP address and port number of the second terminal device in the RTN network.
[0018] In one possible implementation of the first aspect, the system further includes a STUN server and an IOT server, wherein the first terminal device is further configured to obtain a public IP address and port number assigned to the first terminal device after STUN penetration from the STUN server; the first terminal device is further configured to send the public IP address and port number of the first terminal device after STUN penetration to the IOT server; the second terminal device is further configured to receive the public IP address and port number of the first terminal device after STUN penetration sent by the IOT server; the second terminal device is further configured to obtain a public IP address and port number assigned to the second terminal device after STUN penetration from the STUN server; the second terminal device is further configured to send the public IP address and port number of the second terminal device after STUN penetration to the IOT server; and the first terminal device is further configured to receive the public IP address and port number of the second terminal device after STUN penetration sent by the IOT server. In this implementation, signaling interaction between devices is performed by reusing an IOT cloud channel, i.e., using the IOT cloud to exchange the public IP addresses and port numbers of the respective tablets after STUN penetration, eliminating the need for an additional ICE signaling interaction server, thereby reducing the complexity of system implementation.
[0019] In a possible implementation of the first aspect, the first terminal device is further configured to establish a public network direct transmission channel after STUN penetration with the second terminal device using the public IP address and port number of the second terminal device after STUN penetration.
[0020] In one possible implementation of the first aspect, the first terminal device is further configured to select a target transmission channel from among the RTN network transmission channel and the public network direct connection transmission channel after STUN traversal, using a selection criterion, for transmitting the second portion of the data to be transmitted to the second terminal device. The selection criterion includes at least one of data transmission rate, transmission channel quality, or network jitter. In this implementation, by selecting the target transmission channel from among the RTN network transmission channel and the public network direct connection transmission channel after STUN traversal, using the selection criterion, data transmission efficiency and reliability can be improved.
[0021] For example, if the selected criterion is data transmission speed, a transmission channel with a higher data transmission speed may be selected as a target transmission channel, and the remaining files to be sent may be continuously transmitted using the target transmission channel.
[0022] For example, if the selected criterion is the transmission channel quality, a transmission channel with better (higher) transmission channel quality may be selected as the target transmission channel, and the remaining files to be sent may be continuously transmitted using the target transmission channel.
[0023] For example, if the selected criterion is network jitter, a transmission channel with smaller (lower) network jitter may be selected as the target transmission channel, and the remaining files to be sent may be continuously transmitted using the target transmission channel.
[0024] Of course, the above-mentioned multiple selection criteria may be comprehensively considered, and a target transmission channel may be determined using multiple selection criteria (or multiple parameters), and the target transmission channel may be used to continue transmitting the remaining files to be sent.
[0025] In one possible implementation of the first aspect, the target transmission channel is a direct public network connection transmission channel after STUN penetration. In this implementation, the RTN network transmission channel can be quickly established, ensuring high data transmission reliability. After the direct public network connection transmission channel after STUN penetration is established, data transmission can be switched to the direct public network connection due to the lower network overhead and cost of the direct public network connection after STUN penetration, thereby reducing data transmission costs and thus meeting the requirements for high reliability and low cost of remote data transmission.
[0026] In a second aspect, a method for device far-field communication is provided. The method can be applied to the device far-field communication system provided in the first aspect. The method includes: establishing an RTN network transmission channel with a first terminal device and a second terminal device, where the RTN network transmission channel is a transmission channel that uses an RTN server as a transit; establishing a public network direct connection transmission channel after STUN penetration with the first terminal device and the second terminal device; transmitting a first part of data to be transmitted to the second terminal device using the RTN network transmission channel; and selecting a target transmission channel between the RTN network transmission channel and the public network direct connection transmission channel after STUN penetration, and transmitting a second part of the data to be transmitted to the second terminal device through the target transmission channel.
[0027] The second aspect provides a method for far-field communication of devices, which integrates STUN penetration and RTN real-time network. When users transmit data remotely, the RTN real-time network is used for data transmission first. The RTN network connection (i.e., RTN network transmission channel) can be established in a short time, ensuring high reliability of data transmission and rapid establishment of services. There is no need to wait for all network paths to be successfully tried before selection, nor is there any need to wait for the detection results of STUN penetration. At the same time, the STUN protocol is used to perform P2P penetration (i.e., STUN penetration) in parallel. When P2P penetration is successful, the target transmission channel is selected from the RTN network transmission channel and the public network direct connection transmission channel after STUN penetration to continue transmitting data, thereby taking into account the requirements of high reliability and low cost of remote data transmission, and realizing far-field communication between any two 1+8+N devices.
[0028] Exemplarily, the data to be transmitted includes at least one of: pictures, audio, video, documents, or applications.
[0029] In one possible implementation of the second aspect, a first terminal device transmits a first portion of the data to be transmitted to a second terminal device using an RTN network transmission channel. This occurs concurrently with the first and second terminal devices establishing a direct public network transmission channel after STUN traversal. This implementation ensures rapid establishment and transmission of service data, eliminating the need to wait for the successful establishment of the direct public network transmission channel after STUN traversal before selecting a channel for data transmission. This ensures high reliability and improves the efficiency of remote data transmission.
[0030] In one possible implementation of the second aspect, the first terminal device and the second terminal device establish an RTN network transmission channel in parallel with establishing a direct public network transmission channel after STUN traversal. This implementation ensures rapid service establishment and reduces the time required to establish the transmission channel, thereby reducing data transmission latency and improving data transmission efficiency.
[0031] In a possible implementation of the second aspect, the method further includes: the first terminal device sends first registration information to the IOT server, the first registration information including the address information and first user information of the first terminal device; the second terminal device sends second registration information to the IOT server, the second registration information including the address information and second user information of the second terminal device; the first terminal device sends query information to the IOT server, the query information is used to query the address of the second terminal device; when the first user information and the second user information are the same, the first terminal device obtains the address of the second terminal device from the IOT server; the first terminal device establishes a communication connection with the second terminal device based on the address of the second terminal device. In this implementation, by using the IOT cloud (IOT server) to discover remote communication devices, any peer device that requires remote communication can be found without the need to connect to additional device discovery capabilities, thereby improving the efficiency of device discovery and reducing the complexity of device discovery.
[0032] In a possible implementation of the second aspect, the method further includes: the first terminal device obtaining an IP address and port number allocated to the first terminal device in the RTN network from an RTN server; the first terminal device sending the IP address and port number of the first terminal device in the RTN network to an IoT server; the second terminal device receiving the IP address and port number of the first terminal device in the RTN network sent by the IoT server; the second terminal device obtaining an IP address and port number allocated to the first terminal device in the RTN network from the RTN server; the second terminal device sending the IP address and port number of the second terminal device in the RTN network to the IoT server; and the first terminal device receiving the IP address and port number of the second terminal device in the RTN network sent by the IoT server. In this implementation, signaling interaction between devices is performed by reusing IoT cloud channels, i.e., using the IoT cloud to exchange IP addresses and port numbers of respective RTN networks, eliminating the need for an additional ICE signaling interaction server, thereby reducing system implementation complexity.
[0033] In a possible implementation of the second aspect, the first terminal device and the second terminal device establish an RTN network transmission channel, including: the first terminal device uses the IP address and port number of the second terminal device in the RTN network to establish the RTN network transmission channel with the second terminal device.
[0034] In a possible implementation of the second aspect, the method further includes: the first terminal device obtaining a public IP address and port number assigned to the first terminal device after STUN penetration from a STUN server; the first terminal device sending the public IP address and port number of the first terminal device after STUN penetration to an IoT server; the second terminal device receiving the public IP address and port number of the first terminal device after STUN penetration sent by the IoT server; the second terminal device obtaining a public IP address and port number assigned to the second terminal device after STUN penetration from the STUN server; the second terminal device sending the public IP address and port number of the second terminal device after STUN penetration to the IoT server; and the first terminal device receiving the public IP address and port number of the second terminal device after STUN penetration sent by the IoT server. In this implementation, signaling interaction between devices is performed by reusing IoT cloud channels, i.e., using the IoT cloud to exchange the public IP addresses and port numbers of their respective tablets after STUN penetration, eliminating the need for an additional ICE signaling interaction server, thereby reducing the complexity of system implementation.
[0035] In a possible implementation of the second aspect, the first terminal device establishes a public network direct connection transmission channel with the second terminal device after STUN penetration, including: the first terminal device uses the public network IP address and port number of the second terminal device after STUN penetration to establish a public network direct connection transmission channel with the second terminal device after STUN penetration.
[0036] In a possible implementation of the second aspect, the method further includes: the first terminal device selecting, from among the RTN network transmission channel and the public network direct connection transmission channel after STUN traversal, a target transmission channel for transmitting the second portion of the data to be transmitted to the second terminal device, using a selection criterion, the selection criterion including at least one of data transmission rate, transmission channel quality, or network jitter. In this implementation, by selecting, from among the RTN network transmission channel and the public network direct connection transmission channel after STUN traversal, the target transmission channel for data transmission using the selection criterion, data transmission efficiency and reliability can be improved.
[0037] In one possible implementation of the second aspect, the target transmission channel is a direct public network transmission channel after STUN penetration. In this implementation, the RTN network transmission channel can be quickly established, ensuring high data transmission reliability. After the direct public network transmission channel after STUN penetration is established, data transmission can be switched to the direct public network connection due to the lower network overhead and cost of the direct public network transmission channel after STUN penetration, thereby reducing data transmission costs and thus meeting the requirements for high reliability and low cost of remote data transmission.
[0038] Exemplarily, the data to be transmitted includes at least one of: pictures, audio, video, documents, or applications.
[0039] In a third aspect, a method for far-field communication between devices is provided, the method including: establishing an RTN network transmission channel between a first terminal device and a second terminal device, the RTN network transmission channel being a transmission channel that uses an RTN server as a transit; establishing a public network direct connection transmission channel after STUN penetration between the first terminal device and the second terminal device; transmitting a first part of data to be transmitted to the second terminal device by using the RTN network transmission channel; and selecting a target transmission channel between the RTN network transmission channel and the public network direct connection transmission channel after STUN penetration, and transmitting a second part of the data to be transmitted to the second terminal device through the target transmission channel.
[0040] The third aspect provides a method for device far-field communication that integrates STUN penetration and the RTN real-time network. The first terminal device transmits data remotely, giving priority to using the RTN real-time network for data transmission. This allows the RTN network connection (i.e., the RTN network transmission channel) to be established in a short period of time, ensuring high data transmission reliability and rapid service establishment. There is no need to wait for all network paths to be successfully tried before selecting another one, nor is there any need to wait for the STUN penetration detection results. Simultaneously, the STUN protocol is used to perform P2P penetration (i.e., STUN penetration) in parallel. When P2P penetration is successful, the target transmission channel is selected from the RTN network transmission channel and the public network direct connection transmission channel after STUN penetration to continue transmitting data, thereby achieving both high reliability and low cost requirements for remote data transmission and enabling far-field communication between any two 1+8+N devices.
[0041] Exemplarily, the devices performing far-field communication (the first terminal device and the second terminal device) are both integrated with a far-field communication software development kit (SDK). The far-field communication SDK has the following capabilities: device discovery, STUN detection, RTN network access, signaling interaction, channel decision-making, state management, etc. Far-field communication can be easily implemented using one SDK.
[0042] Exemplarily, the far field communication SDK may include the following interfaces: initialization interface (init), device discovery interface (findDevice), RTN connection interface (rtnConnect), STUN binding interface (stunBinding), signaling interaction port (exchangeMessage), RTN sending interface (rtnSend), P2P direct connection sending interface (p2pSend), etc.
[0043] In a possible implementation of the third aspect, the first terminal device transmits the first part of the data to be transmitted to the second terminal device using the RTN network transmission channel, and the first terminal device and the second terminal device establish a public network direct connection transmission channel after STUN penetration in parallel.
[0044] In a possible implementation of the third aspect, the first terminal device and the second terminal device establish an RTN network transmission channel in parallel with the first terminal device and the second terminal device establish a public network direct connection transmission channel after STUN penetration.
[0045] In a possible implementation of the third aspect, the method also includes: the first terminal device sends first registration information to the IOT server, the first registration information includes address information and first user information of the first terminal device; the first terminal device sends query information to the IOT server, and the query information is used to query the address of the second terminal device; the first terminal device obtains the address of the second terminal device from the IOT server; the first terminal device establishes a communication connection with the second terminal device based on the address of the second terminal device.
[0046] In a possible implementation of the third aspect, the method further includes: the first terminal device obtaining an IP address and a port number in the RTN network allocated to the first terminal device from the RTN server; the first terminal device sending the IP address and the port number in the RTN network of the first terminal device to the IOT server; and the first terminal device receiving the IP address and the port number in the RTN network of the second terminal device sent by the IOT server.
[0047] In a possible implementation of the third aspect, the first terminal device and the second terminal device establish an RTN network transmission channel, including: the first terminal device uses the IP address and port number of the second terminal device in the RTN network to establish the RTN network transmission channel with the second terminal device.
[0048] In a possible implementation of the third aspect, the method also includes: the first terminal device obtains the public IP address and port number after STUN penetration allocated to the first terminal device from the STUN server; the first terminal device sends the public IP address and port number of the first terminal device after STUN penetration to the IOT server; the first terminal device receives the public IP address and port number of the second terminal device after STUN penetration sent by the IOT server.
[0049] In a possible implementation of the third aspect, the first terminal device and the second terminal device establish a public network direct connection transmission channel after STUN penetration, including: the first terminal device uses the public network IP address and port number of the second terminal device after STUN penetration to establish a public network direct connection transmission channel after STUN penetration with the second terminal device.
[0050] In a possible implementation of the third aspect, the method further includes: the first terminal device selects, by using a selection criterion, a target transmission channel from the RTN network transmission channel and the public network direct connection transmission channel after STUN penetration, to transmit the second part of the data to be transmitted to the second terminal device. The selection criterion includes at least one of a data transmission rate, a transmission channel quality, or a network jitter.
[0051] In a possible implementation of the third aspect, the target transmission channel is a public network direct connection transmission channel after STUN penetration.
[0052] In a possible implementation of the third aspect, the data to be transmitted includes at least one of: pictures, audio, video, documents, or applications.
[0053] Among them, the beneficial effects of various possible implementation methods of the third aspect can refer to the description of the beneficial effects of various possible implementation methods corresponding to the above-mentioned second aspect.
[0054] In a fourth aspect, a communication device is provided, which includes a unit for executing each step in the above third aspect or any possible implementation manner of the third aspect.
[0055] In a fifth aspect, a communication device is provided, which includes at least one processor and a memory, the processor and the memory are coupled, the memory stores program instructions, and when the program instructions stored in the memory are executed by the processor, the method in the above third aspect or any possible implementation of the third aspect is executed.
[0056] In a sixth aspect, a communication device is provided, which includes at least one processor and an interface circuit, and the at least one processor is used to execute the method in the above third aspect or any possible implementation of the third aspect.
[0057] In the seventh aspect, a terminal device is provided, which includes any communication device provided in the fourth aspect, fifth aspect or sixth aspect.
[0058] In an eighth aspect, a communication device is provided, which includes at least one processor and a memory, the processor and the memory are coupled, and the memory stores program instructions. When the program instructions stored in the memory are executed by the processor, the method executed by a server (for example, an IOT server, an RTN server, or a STUN server) in the above second aspect or any possible implementation of the second aspect is executed.
[0059] In the ninth aspect, a communication device is provided, which includes: a unit for executing each step performed by a server (for example, an IOT server, an RTN server, or a STUN server) in the above second aspect or any possible implementation of the second aspect.
[0060] In the tenth aspect, a communication device is provided, which includes at least one processor and an interface circuit, and the at least one processor is used to execute the method performed by a server (for example, an IOT server, an RTN server, or a STUN server) in the above second aspect or any possible implementation of the second aspect.
[0061] In the eleventh aspect, a server is provided, comprising any one of the communication devices provided in the eighth, ninth or tenth aspect.
[0062] Exemplarily, the server may be an IOT server, an RTN server, or a STUN server.
[0063] In the twelfth aspect, a computer program product is provided, which includes a computer program, which, when executed by a processor, is used to execute the method in the second aspect or any possible implementation of the second aspect, or to execute the method in the third aspect or any possible implementation of the third aspect.
[0064] In the thirteenth aspect, a computer-readable storage medium is provided, which stores a computer program. When the computer program is executed, it is used to execute the method in the second aspect or any possible implementation of the second aspect, or to execute the method in the third aspect or any possible implementation of the third aspect.
[0065] In the fourteenth aspect, a chip is provided, which includes: a processor for calling and running a computer program from a memory, so that a communication device equipped with the chip executes the method in the second aspect or any possible implementation of the second aspect, or executes the method in the third aspect or any possible implementation of the third aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] Figure 1 is a system architecture diagram for remote communication based on the ICE framework.
[0067] FIG2 is a schematic diagram of a communication scenario provided by the present application and applicable to an embodiment of the present application.
[0068] FIG3 is a schematic diagram of an example of a far-field communication system architecture of a device provided in this application.
[0069] FIG4 is a schematic flowchart of an example of a method for far-field communication of a device provided in this application.
[0070] FIG5 is a flowchart of an example of a method for far-field communication of devices in a communication system provided in the present application.
[0071] FIG6 is a schematic diagram of an example provided by the present application of a mobile phone and a tablet exchanging their respective public IP addresses and port numbers of the tablet after STUN penetration, as well as the IP addresses and port numbers under the RTN network, through the IOT cloud.
[0072] FIG7 is a flowchart of another example of a method for far-field communication of devices in a communication system provided in the present application.
[0073] FIG8 is a schematic diagram of an example of a direct connection line for P2P penetration and a line for forwarding in an RTN network provided by the present application.
[0074] FIG9 is a schematic block diagram of a communication device according to an embodiment of the present application.
[0075] FIG10 is a schematic block diagram of a communication device provided in an embodiment of the present application.
[0076] FIG11 is a schematic block diagram of a chip system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0077] The technical solution in this application will be described below with reference to the accompanying drawings.
[0078] In the description of the embodiments of this application, unless otherwise specified, " / " represents "or." For example, A / B can represent A or B. "And / or" in this document is simply a description of an association relationship between associated objects, indicating that three relationships can exist. For example, "A and / or B" can represent: A exists alone, A and B exist simultaneously, and B exists alone. Furthermore, in the description of the embodiments of this application, "plurality" means two or more than two.
[0079] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of the technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this embodiment, unless otherwise specified, "plurality" means two or more.
[0080] In addition, various aspects or features of the present application can be implemented as methods, devices or products using standard programming and / or engineering techniques. The term "product" as used in this application covers computer programs that can be accessed from any computer-readable device, carrier or medium. For example, computer-readable media may include, but are not limited to: magnetic storage devices (e.g., hard disks, floppy disks or magnetic tapes, etc.), optical disks (e.g., compact discs (CDs), digital versatile discs (DVDs), etc.), smart cards and flash memory devices (e.g., erasable programmable read-only memories (EPROMs), cards, sticks or key drives, etc.). In addition, the various storage media described herein may represent one or more devices and / or other machine-readable media for storing information. The term "machine-readable medium" may include, but is not limited to, wireless channels and various other media capable of storing, containing and / or carrying instructions and / or data.
[0081] Various aspects or features of the present application can be implemented as methods, devices, or products using standard programming and / or engineering techniques. The term "product" as used in this application covers computer programs that can be accessed from any computer-readable device, carrier, or medium. For example, computer-readable media can include, but are not limited to: magnetic storage devices (e.g., hard disks, floppy disks, or magnetic tapes, etc.), optical disks (e.g., compact discs (CDs), digital versatile discs (DVDs), etc.), smart cards, and flash memory devices (e.g., erasable programmable read-only memories (EPROMs), cards, sticks, or key drives, etc.). In addition, the various storage media described herein can represent one or more devices and / or other machine-readable media for storing information. The term "machine-readable medium" can include, but is not limited to, wireless channels and various other media capable of storing, containing, and / or carrying instructions and / or data.
[0082] The 1+8+N devices currently on the market already have the ability to communicate in the near field. When the devices are in the same local area network or close to each other, they can communicate in the near field. Typical near field communication scenarios include one-touch transmission and multi-screen collaboration. In addition to near field communication, there is also a need for remote communication (or far field communication) between various devices. For example, remote file sharing between mobile phones and tablets, smart screens, remote audio and video transmission between mobile phones and car computers, and file transfer between mobile phones and home storage devices all have remote communication scenarios, such as file transfer, audio and video transmission, signaling transmission, etc. There is an urgent need for a unified far field communication solution to solve the far field communication problems between all 1+8+N devices, to realize the function of quickly establishing far field communication between all 1+8+N devices, and to make far field interconnected communication as convenient and fast as near field communication. In addition, the number of 1+8+N devices, including mobile phones, is huge. When communicating in the far field, not only high availability (high reliability) needs to be considered, but low cost is also an aspect that needs to be considered in order to maximize value.
[0083] When conducting remote communication between 1+8+N devices, some businesses opt for network address translation (NAT) traversal, while others opt for relaying through their own cloud relays. Generally speaking, a relatively complete and close approach to remote file transfer is the Interactive Connectivity Establishment (ICE) framework, and some businesses also utilize ICE concepts for remote file transfer.
[0084] Figure 1 shows an example of a system architecture for remote communication based on the ICE framework. As shown in Figure 1, the ICE framework utilizes the Session Traversal Utilities for NAT (STUN) protocol and the Traversal Using Relays around NAT (TURN) protocol. The main process for remote communication based on the ICE framework includes:
[0085] First, the address information of each device (including the user device) in all paths (transmission paths established using the STUN protocol and transmission paths established using the TURN protocol) is collected. For example, the public network address mapped by the NAT gateway is detected using the STUN protocol, the address of the TURN protocol relay server, or the public network address of the user device itself.
[0086] Then, the signaling server is used to exchange the addresses of the two communicating devices, including the public network address mapped by the NAT gateway detected by the STUN protocol, the public network address of the device itself, and the address of the TURN relay server.
[0087] After the two communicating devices have exchanged their respective addresses, two transmission paths can be established.
[0088] After two transmission paths are successfully established, the connectivity of the transmission paths is checked, for example, by checking them one by one according to a certain priority.
[0089] If the connectivity of the two transmission paths is OK, one of the transmission paths is selected for remote communication.
[0090] As can be seen above, remote communication based on the ICE framework requires checking each path individually, making remote communication establishment slow. This is especially true when network conditions change. The ICE framework takes varying amounts of time to traverse different NAT gateways, resulting in a poor user experience. Furthermore, only one path is ultimately selected for remote communication. For example, if STUN traversal fails, a transmission path established using the TURN protocol is used. This results in high bandwidth costs, and the more devices there are, the higher the cost. If STUN traversal succeeds, a direct connection to the public network, established after successful NAT traversal using the STUN protocol, is used. However, if public network quality is poor, remote communication quality cannot be guaranteed, failing to achieve a balance between high reliability and low cost. Furthermore, relaying using the TURN protocol (i.e., between the NAT gateway and the relay server) is point-to-point. If the NAT gateway and relay server are connected over the public network, transmission quality cannot be guaranteed. Remote communication based on the ICE framework also lacks device discovery capabilities and requires further integration with device discovery capabilities. In order to be efficient, ICE signaling interaction is generally a long connection, so it is necessary to connect to the long connection discovered by the device and the long connection of the ICE signaling interaction server. For power-sensitive devices, maintaining an additional long connection will result in high power consumption overhead.
[0091] Therefore, a technical solution is needed that can simply and quickly implement far-field communication between any 1+8+N devices, and needs to take into account the requirements of high reliability and low cost.
[0092] In view of this, the present application provides a method and system for far-field communication of devices, which includes: multiple terminal devices for far-field communication (such as 1+8+N devices), a network server (or it can also be called a network cloud, a real-time network cloud, etc.), and an IOT server (or it can also be called an IOT cloud). The far-field communication software development kit (SDK) is integrated on the devices for far-field communication. The far-field communication SDK has the following capabilities: device discovery, STUN detection, RTN network access, signaling interaction, channel decision-making, state management, etc. Far-field communication can be easily realized using one SDK. The network server supports the use of STUN penetration to establish a direct public network transmission channel, and supports the establishment of a real-time network (RTN) transmission channel. The IOT server manages all 1+8+N devices and the signaling transmission between devices, and is used for device management discovery and the distribution of device messages, such as supporting device discovery, signaling transmission between devices, and heartbeat management between devices. Device status management, etc. In the above system, a real-time network (RTN) transmission channel and a direct public network transmission channel based on STUN penetration are established simultaneously. The high reliability of the RTN transmission channel is used to ensure successful data transmission. After the direct public network transmission channel based on STUN penetration is successfully established, one of the two channels is selected for continued transmission based on the network quality of the RTN transmission channel and the direct public network transmission channel based on STUN penetration. This allows for simple and fast far-field communication between any two 1+8+N devices while meeting the requirements of high reliability and low cost.
[0093] Referring to Figure 2, Figure 2 shows a schematic diagram of a communication scenario applicable to an embodiment of the present application. As shown in Figure 2, the technical solution provided by this application can be applied to scenarios of far-field communication between all 1+8+N devices such as mobile phones, tablets, personal computers (PCs), smart screens, etc., including remote file transfer, audio and video transmission, signaling transmission, etc. between any two devices. For example, remote file sharing between mobile phones, tablets, PCs, car computers, etc., remote file retrieval between mobile phones and storage devices, etc. Users can perform remote access between 1+8+N devices anytime, anywhere.
[0094] In the following descriptions, unless otherwise specified, the terms "cloud" and "server" are interchangeable, the terms "IoT server" and "IoT cloud" are interchangeable, and the terms "network server" and "real-time network cloud" and "network cloud" are interchangeable.
[0095] First, the device far-field communication system provided by this application is introduced.
[0096] Figure 3 is a schematic diagram of an example of a far-field communication system for a device provided in this application. As shown in Figure 3, the communication system includes: 1+8+N devices for far-field communication (for example, mobile phones, tablets, large-screen devices, PCs, etc.), a network server and an IOT server.
[0097] The 1+8+N devices (also called terminal devices) performing far-field communication are all integrated with the far-field communication SDK. The SDK has the following functions: initiating the STUN penetration protocol (STUN penetration), accessing the RTN network, switching data channels between the RTN network transmission channel and the public network direct connection transmission channel after STUN penetration (channel decision-making), device discovery, and status management. Far-field communication can be easily implemented using a single SDK.
[0098] The network server supports the STUN protocol and the RTN network, and is used to provide RTN network capabilities and STUN protocol implementation functions. For example, the network server may include a STUN server and an RTN server, which respectively provide RTN network capabilities and STUN protocol implementation functions.
[0099] The IoT server manages all 1+8+N devices and the signaling transmission between devices, and is used for device management discovery and device message delivery. For example, the IoT server can support: device discovery, signaling transmission, heartbeat management, device status management, etc.
[0100] In the communication system shown in Figure 3, a communication connection can exist between the 1+8+N devices and the network server, and a communication connection can also exist between the 1+8+N devices and the IoT server (for example, an IoT transmission channel exists). This allows the 1+8+N devices to use the SDK to transmit signaling and data between the network server and the IoT server. The network server includes: a STUN server and an RTN server.
[0101] In the present application, the 1+8+N devices for far-field communication may include: mobile phones, tablet computers, laptops, ultra-mobile personal computers (UMPCs), handheld computers, netbooks, personal digital assistants (PDAs), wearable electronic devices, virtual reality devices, and other IOT (Internet of Things) devices, etc., and the embodiments of the present application are not limited here.
[0102] In the communication system shown in FIG3 , the various devices in the communication system (e.g., the 1+8+N device and the IoT server, or the 1+8+N device and the network server) can be interconnected via a communication network. For example, the communication network can be a wired network or a wireless network. For example, the communication network can be a local area network (LAN) or a wide area network (WAN), such as the Internet. The above-mentioned communication network can be implemented using any known network communication protocol, and the above-mentioned network communication protocol can be various wired or wireless communication protocols, such as Ethernet, universal serial bus (USB), FIREWIRE, global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), Bluetooth, wireless fidelity (Wi-Fi), NFC, voice over Internet protocol (VoIP), communication protocols that support network slicing architecture or any other suitable communication protocols.
[0103] That is, the various devices in the communication system can form a network (ie, networking) according to certain communication protocols and networking strategies, so that the various devices in the system can communicate with each other.
[0104] It should be understood that the communication system shown in FIG3 is merely exemplary and should not impose any limitations on the communication systems applicable to the embodiments of the present application. For example, in other embodiments of the present application, the communication system may include more 1+8+N devices, or may include other servers, etc. The embodiments of the present application are not limited thereto.
[0105] The method for far-field communication of devices provided in this application will be described below with reference to specific examples. The method for far-field communication of devices provided in this application can be applied in the communication system shown in FIG. 3 .
[0106] Assume that terminal device A needs to transfer a file to terminal device B (in a remote file sharing scenario). Terminal device A (the first terminal device) is a mobile phone, and terminal device B (the second terminal device) is a tablet. The phone's device ID is "d001" and its user ID (UID) is "u001." The tablet's device ID is "d002" and its user ID is also "u001." The device ID is a unique device identifier composed of 1+8+N. The file name to be sent is "file001."
[0107] Of course, in other implementations of the present application, the data to be transmitted that terminal device A needs to transmit to terminal device B may also include one or more of: pictures, audio, video, documents, or applications, etc. The embodiment of the present application does not limit the specific type of data to be transmitted.
[0108] First, both the mobile phone and the tablet need to integrate the far field communication SDK. In the embodiment of the present application, the far field communication SDK is cross-operating system, such as supporting Or other operating systems. For example, the Far Field Communication SDK supports at least the following four capabilities:
[0109] First, support for point-to-point (P2P) penetration using the STUN protocol. The phone and tablet each use the Far Field Communication SDK to interact with a STUN server through the standard STUN protocol to discover their respective public network addresses. After successful public network discovery, the phone and tablet attempt to establish a direct P2P public network transmission channel. Once the P2P public network direct transmission channel (also known as the public network direct transmission channel after STUN penetration) is established, the file to be sent is sent directly.
[0110] Second, it supports access to the RTN network. The phone and tablet interact with the RTN server using the Far Field Communication SDK to obtain their respective RTN network addresses. The phone can send data packets to the RTN network, leveraging the RTN network's capabilities (i.e., utilizing the RTN network transmission channel) to transmit data to the tablet.
[0111] Third: It supports the capabilities of device management, status management, and heartbeat management. It can discover any other 1+8+N devices and push signaling messages to the peer device to conduct signaling interaction for the entire far-field communication.
[0112] Fourth: Support for transmission channel switching, supporting switching between the RTN network transmission channel and the public network direct connection transmission channel after STUN penetration, to address network changes and ensure the speed and cost of far-field communication.
[0113] The Far Field Communication SDK is supported by the Real-Time Network Cloud and IoT Cloud. The Real-Time Network Cloud implements the STUN protocol and provides RTN network capabilities. The IoT Cloud primarily manages all 1+8+N devices, working with the SDK to enable device discovery and signaling interaction.
[0114] Illustratively, in an embodiment of the present application, the far field communication SDK may support the interfaces shown in Table 1.
[0115] Table 1
[0116] It should be understood that Table 1 is merely exemplary and should not limit the interfaces supported by the far-field communication SDK in the embodiments of the present application. In other implementations of the present application, the far-field communication SDK may support more interfaces, or the aforementioned interfaces may be named differently. The embodiments of the present application are not limited thereto.
[0117] The following describes the provided method for far-field communication of devices in conjunction with Figures 4 to 8, wherein Figure 4 shows a schematic flow chart of the method for far-field communication of devices provided by this application in the above scenario. Figures 5 and 7 show flow charts of the method for far-field communication of devices in the communication system provided by this application. The steps in Figure 5 mainly include the process of the mobile phone and tablet discovering the devices and establishing two transmission channels, and the steps shown in Figure 7 mainly include the process of the mobile phone sending files to the tablet using these two transmission channels.
[0118] As shown in FIG4 , the method 400 includes:
[0119] At S410, the mobile phone and tablet are registered with the IoT cloud and device discovery is performed.
[0120] In some possible implementations, after booting up, both the phone and tablet call the "init" interface of the Far Field Communication SDK to connect to the IoT Cloud (IoT server). The phone registers its device number "d001" and user ID "u001" with the IoT Cloud, completing device registration. The tablet also registers its device number "d002" and user ID "u001" with the IoT Cloud, completing device registration.
[0121] After the tablet and mobile phone complete device registration, the mobile phone will call the "findDevice" interface of the far-field communication SDK, enter the user ID "u001", and through the IoT transmission channel between the IoT cloud and the IoT cloud, the IoT cloud returns the device number "d002" of the tablet that requires far-field communication to the mobile phone.
[0122] After the phone obtains the tablet's device ID "d002," it calls the "exchangeMessage" interface of the Far Field Communication SDK, inputting the tablet's device ID "d002" and a signaling message, which instructs the tablet to establish a remote connection. This signaling message is transmitted to the IoT cloud via the IoT transmission channel between the IoT cloud and the tablet. The IoT cloud then transmits the signaling message to the tablet via the IoT transmission channel between the IoT cloud and the tablet, thus informing the tablet that the phone needs to establish a communication connection with it.
[0123] By using the IOT cloud to discover remote communication devices, any peer device that requires remote communication can be found without the need to connect to additional device discovery capabilities, which improves the efficiency of device discovery and reduces the complexity of device discovery.
[0124] The process corresponding to the above-mentioned S410 is step 1 shown in FIG5 : device registration discovery.
[0125] It should be understood that in the embodiment of the present application, as a possible implementation method, for S410, for example, it can be executed only once after the mobile phone and tablet are turned on. After the mobile phone and tablet complete the device discovery registration, if the mobile phone has data to be transmitted (such as files, pictures, etc.) that needs to be sent to the tablet, S420 to S460 can be executed directly. In other words, the device registration and discovery process may not be triggered by "there is data that needs to be sent between the mobile phone and the tablet". When the mobile phone has no data to send to the tablet, or when the tablet has no data to send to the mobile phone, the device registration and discovery process can also be executed. S410 does not need to be executed every time there is data to be transmitted. Of course, illustratively, if the mobile phone or tablet is turned off, the device registration and discovery step needs to be re-executed after the mobile phone and tablet are turned off and restarted. That is to say, after the mobile phone and tablet devices discover each other, a long connection can be maintained between the mobile phone and the tablet.
[0126] At step S420 , the mobile phone and tablet use the network server to perform STUN penetration and RTN network access, respectively, to obtain the IP address and port number of the RTN network, as well as the public network IP address and port number after STUN penetration.
[0127] The process of connecting to the RTN network on a mobile phone and tablet:
[0128] In S420, the mobile phone invokes the "rtnConnect" interface of the Far Field Communication SDK and connects to the RTN server in the network server through the transmission channel between the mobile phone and the RTN server. Upon successful connection, the RTN server returns the IP address and port number assigned to the mobile phone on the RTN network to the mobile phone. Assume that the mobile phone's IP address and port number on the RTN network are 124.71.104.60:20100. The tablet invokes the "rtnConnect" interface of the Far Field Communication SDK and connects to the RTN server in the network server through the transmission channel between the mobile phone and the RTN server. Upon successful connection, the RTN server returns the IP address and port number assigned to the tablet on the RTN network to the tablet. Assume that the tablet's IP address and port number on the RTN network are 123.60.78.158:20101. It should be understood that the mobile phone and tablet are simultaneously (and concurrently) connecting to the RTN network.
[0129] The process of STUN penetration on mobile phones and tablets respectively:
[0130] The mobile phone calls the "stunBinding" interface of the Far Field Communication SDK, inputting its private IP address and port number. It then connects to the STUN server via a transmission channel with the network server. The STUN server, following the standard RFC5389 protocol, returns the phone's public IP address and port number after STUN penetration. Assume that the phone's public IP address and port number after STUN penetration are 123.60.99.179:2011. The tablet also calls the "stunBinding" interface of the Far Field Communication SDK, inputting its private IP address and port number. It then connects to the STUN server via a transmission channel with the network server. The STUN server, following the standard RFC5389 protocol, returns the tablet's public IP address and port number after STUN penetration. Assume that the tablet's public IP address and port number after STUN penetration are 123.60.99.180:2012. It should be understood that both the mobile phone and tablet perform STUN penetration simultaneously (in parallel).
[0131] It is understandable that during the STUN penetration process of mobile phones and tablets, multiple detections may be required depending on the NAT gateway to obtain the correct public network device IP address and port number.
[0132] It should also be understood that the mobile phone can perform STUN penetration and RTN network connection simultaneously (in parallel), and the tablet can also perform STUN penetration and RTN network connection simultaneously, or in parallel.
[0133] The process corresponding to the above-mentioned S420 is step 2 shown in FIG5 : STUN penetration and RTN network access.
[0134] It should also be understood that in the embodiment of the present application, STUN penetration can also be replaced by TURN penetration. In this case, the mobile phone and tablet are connected to the relay server in the network server, and TURN penetration is performed respectively to obtain the public IP address and port number after TURN penetration.
[0135] At step S430, the mobile phone and tablet exchange their respective public IP addresses and port numbers of the tablet after STUN penetration, as well as the IP addresses and port numbers of the RTN network, through the IoT cloud.
[0136] In S430, the mobile phone can call the "exchangeMessage" interface of the far-field communication SDK, input the parameters "d002" and "124.71.104.60:20100", and transmit it to the IoT cloud through the transmission channel between the mobile phone and the IoT cloud. The IoT cloud transmits "d002" and "124.71.104.60:20100" to the tablet through the IoT transmission channel between the IoT cloud and the tablet, so that the tablet learns the IP address and port number of the mobile phone under the RTN network. The tablet can also call the "exchangeMessage" interface of the Far Field Communication SDK and input the parameters "d001" and "123.60.78.158:20101". This is then transmitted to the IoT cloud via the communication channel between the tablet and the IoT cloud. The IoT cloud then transmits "d001" and "123.60.78.158:20101" to the mobile phone via the IoT communication channel between the IoT cloud and the mobile phone. The mobile phone then learns the tablet's IP address and port number on the RTN network. This completes the exchange of IP addresses and port numbers between the two devices on the RTN network.
[0137] Of course, the mobile phone can call the "exchangeMessage" interface of the far-field communication SDK, input the parameters "d002" and "123.60.99.179:2011", and transmit it to the IOT cloud through the transmission channel between the mobile phone and the IOT cloud. The IOT cloud transmits "d002" and "123.60.99.179:2011" to the tablet through the IOT transmission channel between the IOT cloud and the tablet, so that the tablet learns the public IP address and port number of the mobile phone after STUN penetration. The tablet can also call the "exchangeMessage" interface of the Far Field Communication SDK and input the parameters "d001" and "123.60.99.180:2012". This is then transmitted to the IoT Cloud via the communication channel between the tablet and the IoT Cloud. The IoT Cloud then transmits "d001" and "123.60.99.180:2012" to the phone via the IoT communication channel between the IoT Cloud and the phone. The phone then learns the tablet's public IP address and port number after STUN traversal. This completes the exchange of the tablet's public IP address and port number between the two devices after STUN traversal.
[0138] The process corresponding to the above-mentioned S430 is step 3 shown in FIG5 : signaling interaction.
[0139] In the embodiment of the present application, signaling interaction between devices is performed by reusing the IoT cloud channel, that is, the public IP address and port number of the tablet after STUN penetration, as well as the IP address and port number under the RTN network, are exchanged using the IoT cloud. There is no need to introduce an additional ICE signaling interaction server, thereby reducing the complexity of system implementation.
[0140] Exemplarily, the process corresponding to the above S430 can be represented by FIG6 . As shown in FIG6 , the mobile phone and the tablet exchange their respective public IP addresses and port numbers of the tablet after STUN penetration, as well as the IP addresses and port numbers under the RTN network, through the IOT cloud.
[0141] S440: The mobile phone sends the file to be sent to the tablet via the RTN network transmission channel and the RTN server.
[0142] In S440, the mobile phone calls the "rtnSend" interface of the Far Field Communication SDK, enters the file "file001" to be sent, and the IP address and port number "123.60.78.158:20101" of the tablet under the RTN network, and starts sending the remote file. The mobile phone sends the file "file001" to be sent to the RTN server through the RTN network transmission channel, and then sends it to the tablet through the RTN server. The tablet then receives the file stream. Due to the high reliability of the RTN network transmission channel, the RTN real-time network is preferentially used for data transmission. The network connection can be established in a very short time (for example, within 2 seconds), ensuring rapid service establishment and high data transmission reliability. There is no need to wait for the public network direct connection transmission channel after STUN penetration to be successfully attempted before selecting, nor is there any need to wait for the detection result of STUN penetration.
[0143] The process corresponding to the above-mentioned S440 is step 4 shown in FIG7 : sending data via the RTN network transmission channel.
[0144] At step S450, the mobile phone and tablet use the public IP address and port number after STUN penetration to try to establish a direct public network transmission channel after STUN penetration.
[0145] After completing the exchange of the tablet's public IP address and port number after STUN penetration between the two devices in S430, the mobile phone uses the tablet's public IP address and port number "123.60.99.180:2012" to attempt to connect directly to the tablet through the public network address.
[0146] It should be understood that in the embodiments of the present application, the process of establishing an RTN network transmission channel between the mobile phone and the tablet (which mainly includes: the mobile phone and the tablet using the network server to respectively access the RTN network and obtain the IP address and port number of the RTN network; and the mobile phone and the tablet exchanging their respective RTN network IP addresses and port numbers through the IoT cloud) and the process of establishing a direct public network transmission channel after STUN penetration between the mobile phone and the tablet (which mainly includes: the mobile phone and the tablet using the network server to respectively perform STUN penetration and obtain the public network IP address and port number after STUN penetration; the mobile phone and the tablet exchanging their respective public network IP addresses and port numbers after STUN penetration through the IoT cloud; and the mobile phone and the tablet attempting to establish a direct public network transmission channel after STUN penetration using the public network IP address and port number after STUN penetration) are performed in parallel (simultaneously). This ensures rapid service establishment, reduces the time spent on establishing the transmission channel, thereby reducing data transmission latency and improving data transmission efficiency.
[0147] It should also be understood that, in the embodiment of the present application, S450 and S440 are performed in parallel (simultaneously), and S450 does not affect the data being transmitted by the RTN network in S440.
[0148] If the mobile phone and tablet can be directly connected successfully, this far-field communication scenario has two remote communication lines, as shown in Figure 8. One is the direct connection line with P2P penetration (that is, the public network direct connection transmission channel after STUN penetration), and the other is the line forwarded through the RTN network (that is, the RTN network transmission channel).
[0149] If the public network direct transmission channel is successfully established after STUN penetration, execute S460:
[0150] At step S460 , the mobile phone selects a transmission channel between the public network direct connection transmission channel after STUN penetration and the RTN network transmission channel to continue transmitting the remaining files to be sent.
[0151] When the public network direct transmission channel is successfully established after STUN penetration, the mobile phone uses the channel decision-making capability of the Far Field Communication SDK to select a transmission channel (i.e., the target transmission channel) between the public network direct transmission channel after STUN penetration and the RTN network transmission channel (i.e., forwarded via the RTN network). For example, the selection criteria (or parameters) may include one or more of: data transmission speed, transmission channel quality, network jitter, etc. Of course, in the embodiment of the present application, the selection criteria may also include other criteria, which are not limited in the embodiment of the present application.
[0152] For example, if the selected criterion is data transmission speed, a transmission channel with a higher data transmission speed may be selected as a target transmission channel, and the remaining files to be sent may be continuously transmitted using the target transmission channel.
[0153] For example, if the selected criterion is the transmission channel quality, a transmission channel with better (higher) transmission channel quality may be selected as the target transmission channel, and the remaining files to be sent may be continuously transmitted using the target transmission channel.
[0154] For example, if the selected criterion is network jitter, a transmission channel with smaller (lower) network jitter may be selected as the target transmission channel, and the remaining files to be sent may be continuously transmitted using the target transmission channel.
[0155] Of course, the above-mentioned multiple selection criteria can also be comprehensively considered, and multiple selection criteria (or multiple parameters) can be used to jointly determine a target transmission channel, and the target transmission channel can be used to continue transmitting the remaining files to be sent.
[0156] For example, as shown in Figure 8, assume that the data transmission rate of the public network direct transmission channel after STUN penetration is 5MB / s, while the data transmission rate of the RTN network transmission channel is 3MB / s. The mobile phone's Far Field Communication SDK can then make a channel decision and switch, selecting the public network direct transmission channel after STUN penetration for file transmission. The mobile phone calls the Far Field Communication SDK's "p2pSend" interface, inputting the remaining data of the file "file001" to be sent, as well as the tablet's public network IP address and port "123.60.99.180:2012" after STUN penetration, to initiate remote file transmission. The tablet's SDK will receive the corresponding file stream. After the entire file is sent, the tablet will receive the complete file "file001." The process corresponding to this is Step 5 in Figure 7: Sending the Remaining Data via the P2P Public Network Direct Connection Channel. In this embodiment of the present application, the P2P Public Network Direct Connection channel can also be referred to as the public network direct transmission channel after STUN penetration.
[0157] After the above S410 to S460, the far-field communication method provided by this application can be used to complete the sending of the file "file001" from the mobile phone to the tablet. In the above S450, due to the different types of NAT gateways, there will be continuous attempts, but in S440, a remote communication connection has been quickly established (that is, an RTN network transmission channel has been established). Since the RTN network transmission channel can be quickly established successfully, the high reliability of data transmission is guaranteed. After the public network direct connection transmission channel after STUN penetration is established, since the network overhead and cost of the public network direct connection transmission channel after STUN penetration are low, it is possible to switch to the public network direct connection for data transmission, reducing the cost of data transmission, thereby meeting the high reliability and low cost requirements of remote data transmission.
[0158] Of course, in an embodiment of the present application, if TURN penetration is performed in S420, after TURN penetration is successful and the transmission channel after TURN penetration is successfully established, the above-mentioned far-field communication scenario also has two remote communication lines, as shown in Figure 7, one is the transmission channel after TURN penetration, and the other is the line forwarded through the RTN network (i.e., the RTN network transmission channel). For the transmission channel after TURN penetration, the mobile phone needs to send the file to be sent to the relay server first, and the relay server forwards it to the tablet. Of course, the mobile phone can also use the channel decision-making ability of the far-field communication SDK to select a transmission channel between the transmission channel after TURN penetration and the RTN network transmission channel to send the remaining data.
[0159] In an embodiment of the present application, as a possible implementation method, the above S420 to S460 are triggered only when the mobile phone has data to send to the tablet (or when the tablet has data to send to the mobile phone).
[0160] Since the public IP address and port number of the device may change after STUN penetration, and the port number of the device in the RTN network may also change, as an optional implementation method, each time there is a service (or data) to be transmitted, the above steps S420 to S460 need to be executed once. In other words, the above steps S420 to S460 need to be executed once for each service.
[0161] Alternatively, as another possible implementation, for example, when service A (e.g., a file) needs to be transmitted, S420 to S460 are executed (S440 to S460 transmits the file). Within a preset time period (e.g., 5 minutes) after executing S420 and S430, service B (e.g., an image) also needs to be transmitted. In this case, since S420 and S430 have already been executed before the preset time period, when transmitting the image, the public IP address and port number of the device after STUN penetration, as well as the IP address and port number of the device on the RTN network, obtained during the execution of S420 and S430 during the file transmission process can be directly used to directly execute S440 to S460 (S440 to S460 transmits the image). That is, during the image transmission process, S420 and S430 can be skipped (S420 and S430 can be skipped), and S440 to S460 can be directly executed. Optionally, business A and business B may correspond to the same application (Application, APP), or business A and business B may correspond to different APPs.
[0162] Of course, the above example is illustrated by taking two businesses (business A and business B) or two APPs as an example. In other implementation methods of the present application, for example, when business A (file transfer) needs to be transmitted, within the preset time length after executing S420 and S430, there may be more other businesses or more other APPs that have data transmission requirements. In this case, these multiple other businesses or multiple other APPs do not need to execute S420 and S430 (skip S420 and S430) during the data transmission process, and can directly execute S440 to S460.
[0163] The method and system for far-field communication of devices provided in this application are designed with a unified far-field communication SDK, which has functions such as device discovery, STUN detection, RTN network access, and signaling interaction. Far-field communication can be easily realized using one SDK. It integrates STUN penetration and RTN real-time network. When users transmit data remotely, the RTN real-time network is used for data transmission first. The RTN network connection can be established in a short time, ensuring the high reliability of data transmission and the rapid establishment of services. There is no need to wait for all network paths to be successfully tried before selecting, nor is there any need to wait for the detection results of STUN crossing. At the same time, P2P penetration is performed in parallel using the STUN protocol. When P2P penetration is successful, according to the network quality, it switches to the public network after P2P penetration for direct data transmission, reducing the cost of data transmission, thereby taking into account the requirements of high reliability and low cost of remote data transmission. Furthermore, by reusing IoT cloud channels for signaling interaction between devices, that is, using the IoT cloud to exchange their respective public IP addresses and port numbers after STUN penetration, as well as the IP addresses and port numbers under the RTN network, there is no need to introduce additional ICE signaling interaction servers. This allows for far-field communication between any two 1+8+N devices, eliminating the need for additional modules to be integrated into the system, reducing the complexity and cost of system implementation.
[0164] It should be understood that the above is only intended to help those skilled in the art better understand the embodiments of the present application, and is not intended to limit the scope of the embodiments of the present application. Based on the above examples given, those skilled in the art can obviously make various equivalent modifications or changes. For example, certain steps in each of the above methods may not be necessary, or certain new steps may be added. Or a combination of any two or any multiple of the above embodiments. Such modifications, changes, or combined solutions also fall within the scope of the embodiments of the present application.
[0165] It should also be understood that the division of the modes, situations, categories and embodiments in the embodiments of the present application is only for the convenience of description and should not constitute a special limitation. The features of various modes, categories, situations and embodiments can be combined without contradiction.
[0166] It should also be understood that the various numerical numbers involved in the embodiments of this application are only for the convenience of description and are not intended to limit the scope of the embodiments of this application. The order of the sequence numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0167] It should also be understood that the above description of the embodiments of the present application focuses on emphasizing the differences between the various embodiments. The same or similar points that are not mentioned can be referenced with each other. For the sake of brevity, they will not be repeated here.
[0168] The above description of the method and system for far-field communication of devices provided in the embodiments of the present application in combination with Figures 2 to 8 describes an embodiment. The following describes a communication device provided in the embodiments of the present application.
[0169] In this embodiment, each device (including the first terminal device, the second terminal device, the IOT server, the RTN server, and the STUN server) can be divided into functional modules according to the above method. For example, each function can be divided into functional modules, or two or more functions can be integrated into one processing module. The above integrated modules can be implemented in the form of hardware. It should be noted that the division of modules in this embodiment is schematic and is only a logical function division. In actual implementation, there may be other division methods.
[0170] It should be noted that the relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module and will not be repeated here.
[0171] The communication device provided in the embodiment of the present application (including the above-mentioned terminal device, server (including IOT server, RTN server, STUN server)) is used to execute the method of far-field communication of the device provided in the above-mentioned method embodiment, so that the same effect as the above-mentioned implementation method can be achieved. In the case of adopting an integrated unit, the terminal device or server may include a processing module, a storage module and a communication module. Among them, the processing module can be used to control and manage the actions of the terminal device or server. For example, it can be used to support the terminal device or server to execute the steps performed by the processing unit. The storage module can be used to support the storage of program code and data, etc. The communication module can be used to support communication between the terminal device or server and other devices.
[0172] The processing module may be a processor or a controller. It may implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. The processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, and so on. The storage module may be a memory. The communication module may specifically be a device that interacts with other terminal devices, such as a radio frequency circuit, a Bluetooth chip, or a Wi-Fi chip.
[0173] For example, FIG9 shows a hardware structure diagram of a communication device 900 provided in this application. The communication device 900 can be the terminal device or server described above. For example, the terminal device can be a 1+8+N device, and the server can include: an IoT server, an RTN server, a STUN server, etc. As shown in FIG9, the communication device 900 may include a processor 910, an external memory interface 920, an internal memory 921, a universal serial bus (USB) interface 930, a charging management module 940, a power management module 941, a battery 942, an antenna 1, an antenna 2, a wireless communication module 950, etc.
[0174] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the communication device 900. In other embodiments of the present application, the communication device 900 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0175] For example, when the communication device 900 is a terminal device, the communication device may further include a display screen.
[0176] The processor 910 may include one or more processing units. For example, the processor 910 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent components or integrated into one or more processors. In some embodiments, the communication device 900 may also include one or more processors 910. The controller may generate an operation control signal based on the instruction opcode and the timing signal to complete the control of instruction fetching and execution.
[0177] In some embodiments, the processor 910 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a SIM card interface, and / or a USB interface. The USB interface 930 is an interface that complies with USB standards and may be a Mini USB interface, a Micro USB interface, a USB Type-C interface, or the like. The USB interface 930 may be used to connect a charger to charge the communication device 900, or may be used to transmit data between the communication device 900 and peripheral devices.
[0178] It is understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is merely an illustrative illustration and does not constitute a structural limitation on the communication device 900. In other embodiments of the present application, the communication device 900 may also adopt a different interface connection method from the above embodiments, or a combination of multiple interface connection methods.
[0179] The wireless communication function of the communication device 900 can be implemented through antenna 1, antenna 2 and wireless communication module 950.
[0180] The wireless communication module 950 can provide wireless communication solutions including Wi-Fi (including Wi-Fi sensing and Wi-Fi AP), Bluetooth (BT), wireless data transmission modules (for example, 433MHz, 868MHz, 919MHz) applied to the communication device 900. The wireless communication module 950 can be one or more devices integrating at least one communication processing module. The wireless communication module 950 receives electromagnetic waves via antenna 1 or antenna 2 (or, antenna 1 and antenna 2), filters and frequency modulates the electromagnetic wave signals, and sends the processed signals to the processor 910. The wireless communication module 950 can also receive the signal to be transmitted from the processor 910, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through antenna 1 or antenna 2.
[0181] The external memory interface 920 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the communication device 900. The external memory card communicates with the processor 910 via the external memory interface 920 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.
[0182] The internal memory 921 can be used to store one or more computer programs, which include instructions. The processor 910 can execute the above instructions stored in the internal memory 921, so that the communication device 900 performs the device far-field communication method provided in some embodiments of the present application, as well as various applications and data processing. The internal memory 921 may include a code storage area and a data storage area. Among them, the code storage area can store an operating system. The data storage area can store data created during the use of the communication device 900, etc. In addition, the internal memory 921 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more disk storage components, flash memory components, universal flash storage (UFS), etc. In some embodiments, the processor 910 can execute the device far-field communication method provided in the embodiment of the present application by executing the instructions stored in the internal memory 921, and / or the instructions stored in the memory provided in the processor 910.
[0183] It should be understood that the specific process of the communication device 900 executing the above-mentioned corresponding steps can be referred to the relevant description of the execution steps of the mobile phone (or tablet) or each server (IOT server, RTN server, STUN server) described in the previous text in combination with Figures 3 to 8. For the sake of brevity, it is not repeated here.
[0184] FIG10 shows a schematic block diagram of another example of a communication device 1000 provided in an embodiment of the present application. The communication device 1000 may correspond to the mobile phone (or tablet) or each server (IOT server, RTN server, STUN server) described in each embodiment of the above method 400. It may also be a chip or component applied to a terminal device or each server, and each module or unit in the communication device 1000 is respectively used to execute each action or processing process performed by the terminal device or each server described in each embodiment of the above method 400. As shown in FIG10 , the communication device 1000 may include: a processing unit 1010 and a communication unit 1020. Optionally, the communication device 1000 may also include a storage unit 1030.
[0185] It should be understood that the specific process of each unit in the communication device 1000 executing the above corresponding steps can be referred to the relevant description of the 1+8+N device or each server executing steps in the various embodiments in combination with Figures 3 to 8 in the previous text. For the sake of brevity, it will not be repeated here.
[0186] Optionally, the communication unit 1020 may include a receiving unit (module) and a sending unit (module) for executing the steps of receiving information and sending information by the terminal device or server in the aforementioned various method embodiments. The storage unit 1030 is used to store instructions executed by the processing unit 1010 and the communication unit 1020. The processing unit 1010, the communication unit 1020, and the storage unit 1030 are communicatively connected, the storage unit 1030 stores instructions, the processing unit 1010 is used to execute the instructions stored in the storage unit, and the communication unit 1020 is used to perform specific signal transmission and reception under the drive of the processing unit 1010.
[0187] It should be understood that the communication unit 1020 may be a transceiver, an input / output interface, or an interface circuit, and may be implemented, for example, by the wireless communication module 950 in the embodiment shown in FIG9 . The storage unit may be a memory, and may be implemented, for example, by the external memory interface 920 and the internal memory 921 in the embodiment shown in FIG9 . The processing unit 1010 may be implemented by the processor 910 in the embodiment shown in FIG9 , or may be implemented by the processor 910, the external memory interface 920, and the internal memory 921.
[0188] It should also be understood that the communication device 1000 shown in Figure 10 can be a terminal device (1+8+N device) or a server (for example, an IOT server, RTN server, STUN server, etc.), or the terminal device or server can include the communication device 1000 shown in Figure 10.
[0189] The embodiment of the present application also provides a chip system, as shown in Figure 11, which includes at least one processor 1110 and at least one interface circuit 1120. The processor 1110 and the interface circuit 1120 can be interconnected via lines. For example, the interface circuit 1120 can be used to receive signals from other devices (such as servers). For another example, the interface circuit 1120 can be used to send signals to other devices (such as processor 1110). Exemplarily, the interface circuit 1120 can read instructions stored in the memory and send the instructions to the processor 1110. When the instructions are executed by the processor 1110, the chip system can execute the various steps performed by the terminal device or each server in the above embodiment. Of course, the chip system can also include other discrete components, which is not specifically limited in the embodiment of the present application.
[0190] It should also be understood that the division of units in the above device is merely a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. Moreover, the units in the device can all be implemented in the form of software called through processing elements; or all be implemented in the form of hardware; or some units can be implemented in the form of software called through processing elements, and some units can be implemented in the form of hardware. For example, each unit can be a separately established processing element, or it can be integrated into a certain chip of the device. In addition, it can also be stored in a memory in the form of a program, and called by a certain processing element of the device to execute the function of the unit. Here, the processing element can also be called a processor, which can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each unit above can be implemented by the integrated logic circuit of the hardware in the processor element or in the form of software called through the processing element. In one example, the unit in any of the above devices may be one or more integrated circuits configured to implement the above method, such as one or more application specific integrated circuits (ASICs), or one or more digital signal processors (DSPs), or one or more field programmable gate arrays (FPGAs), or a combination of at least two of these integrated circuit forms. For another example, when the unit in the device can be implemented in the form of a processing element scheduler, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call a program. For another example, these units can be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0191] The embodiment of the present application also provides a device, which is included in a terminal device (1+8+N device) or a server (IOT server, RTN server, STUN server), and the device has the function of implementing the terminal device or server in any of the methods in the above embodiments. This function can be implemented by hardware, or it can be implemented by hardware executing corresponding software. The hardware or software includes at least one module or unit corresponding to the above function. For example, a display module or unit, a determination module or unit, a calculation module or unit, a sending module or unit, a receiving module or unit, etc.
[0192] The present application also provides a computer-readable storage medium for storing computer program code, wherein the computer program includes instructions for executing any of the above-described methods for far-field communication between devices provided in the present application. The computer-readable storage medium may be a read-only memory (ROM) or a random access memory (RAM), which is not limited in the present application.
[0193] The present application also provides a computer program product, which includes instructions. When the instructions are executed, the terminal and the server perform corresponding operations in the method corresponding to the above-mentioned device far-field communication.
[0194] An embodiment of the present application further provides a chip located in a communication device, the chip comprising: a processing unit and a communication unit. The processing unit may be, for example, a processor, and the communication unit may be, for example, an input / output interface, a pin, or a circuit. The processing unit may execute computer instructions to cause the communication device to perform any of the above-described methods for far-field communication between devices provided in the embodiments of the present application.
[0195] Optionally, the computer instructions are stored in a storage unit.
[0196] Optionally, the storage unit is a storage unit within the chip, such as a register, cache, etc. The storage unit can also be a storage unit located outside the chip within the terminal, such as a ROM or other type of static storage device that can store static information and instructions, random access RAM, etc. The processor mentioned in any of the above can be a CPU, a microprocessor, an ASIC, or one or more integrated circuits for controlling the execution of the program of the above-mentioned feedback information transmission method. The processing unit and the storage unit can be decoupled and respectively set on different physical devices, and connected by wired or wireless means to implement the respective functions of the processing unit and the storage unit to support the system chip to implement the various functions in the above-mentioned embodiments. Alternatively, the processing unit and the memory can also be coupled on the same device.
[0197] Among them, the terminal equipment, each server, computer-readable storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here.
[0198] It will be appreciated that the memory in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a ROM, a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a RAM, which is used as an external cache. There are many different types of RAM, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).
[0199] Various objects such as various messages / information / equipment / network elements / systems / devices / actions / operations / processes / concepts that may appear in this application are named. It can be understood that these specific names do not constitute a limitation on the relevant objects. The names assigned may change with factors such as scenarios, contexts or usage habits. The understanding of the technical meaning of the technical terms in this application should be mainly determined from the functions and technical effects embodied / executed in the technical solutions.
[0200] In the various embodiments of the present application, unless otherwise specified or there is a logical conflict, the terms and / or descriptions between different embodiments are consistent and can be referenced by each other. The technical features in different embodiments can be combined to form new embodiments according to their inherent logical relationships.
[0201] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0202] The methods in the embodiments of the present application can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, they can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instruction is loaded and executed on a computer, the process or function described in the embodiments of the present application is executed in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer program or instruction can be stored in a computer-readable storage medium or transmitted via the computer-readable storage medium. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server that integrates one or more available media.
[0203] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0204] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0205] The units described as separate components may or may not be physically separate, and 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 these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0206] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0207] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a readable storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned readable storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.
[0208] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. A system for far-field communication of devices, characterized in that: The system comprises: a first terminal device, an RTN server and a second terminal device; The first terminal device is used to: establish an RTN network transmission channel with the second terminal device, wherein the RTN network transmission channel is a transmission channel using the RTN server as a transit; The first terminal device is further used to: establish a public network direct connection transmission channel after STUN penetration with the second terminal device; The first terminal device is further used to: transmit a first part of the data to be transmitted to the second terminal device by using the RTN network transmission channel; The first terminal device is further used to: select a target transmission channel from the RTN network transmission channel and the public network direct connection transmission channel after STUN penetration, and transmit the second part of the data to be transmitted to the second terminal device through the target transmission channel.
2. The system according to claim 1, characterized in that The first terminal device transmits the first part of the data to be transmitted to the second terminal device by using the RTN network transmission channel, and the first terminal device and the second terminal device establish a public network direct connection transmission channel after STUN penetration in parallel.
3. The system according to claim 1 or 2, characterized in that: The first terminal device and the second terminal device establish an RTN network transmission channel, and the first terminal device and the second terminal device establish a public network direct connection transmission channel after STUN penetration in parallel.
4. The system according to any one of claims 1 to 3, characterized in that The system also includes an IOT server; The first terminal device is further used to: send first registration information to the IOT server, where the first registration information includes address information and first user information of the first terminal device; The second terminal device is further used to: send second registration information to the IOT server, where the second registration information includes address information and second user information of the second terminal device; The first terminal device is further used to: send query information to the IOT server, where the query information is used to query the address of the second terminal device; When the first user information and the second user information are the same, the first terminal device is further used to: obtain the address of the second terminal device from the IOT server; The first terminal device is further used to establish a communication connection with the second terminal device based on the address of the second terminal device.
5. The system according to any one of claims 1 to 4, characterized in that The system also includes an IOT server; The first terminal device is further used to: obtain from the RTN server an IP address and a port number in the RTN network allocated to the first terminal device; The first terminal device is further used to: send the IP address and port number of the first terminal device in the RTN network to the IOT server; The second terminal device is further used to: receive the IP address and port number of the first terminal device in the RTN network sent by the IOT server; The second terminal device is further used to: obtain from the RTN server an IP address and a port number in the RTN network allocated to the first terminal device; The second terminal device is further used to: send the IP address and port number of the second terminal device in the RTN network to the IOT server; The first terminal device is further used to receive the IP address and port number of the second terminal device in the RTN network sent by the IOT server.
6. The system according to claim 5, characterized in that The first terminal device is further used to establish the RTN network transmission channel with the second terminal device by using the IP address and port number of the second terminal device in the RTN network.
7. The system according to any one of claims 1 to 6, characterized in that The system also includes a STUN server and an IOT server; The first terminal device is further used to: obtain the STUN penetration allocated to the first terminal device from the STUN server Then the public IP address and port number; The first terminal device is further used to: send the public IP address and port number of the first terminal device after STUN penetration to the IOT server; The second terminal device is also used to: receive the public IP address and port number of the first terminal device after STUN penetration sent by the IOT server; The second terminal device is further used to: obtain the public IP address and port number after STUN penetration allocated to the second terminal device from the STUN server; The second terminal device is further used to: send the public IP address and port number of the second terminal device after STUN penetration to the IOT server; The first terminal device is also used to: receive the public IP address and port number of the second terminal device after STUN penetration sent by the IOT server.
8. The system according to claim 7, characterized in that The first terminal device is further used to: use the public network IP address and port number of the second terminal device after the STUN penetration to establish a public network direct connection transmission channel after the STUN penetration with the second terminal device.
9. The system according to any one of claims 1 to 8, characterized in that The first terminal device is also used to: select a target transmission channel from the RTN network transmission channel and the public network direct connection transmission channel after STUN penetration to transmit the second part of the data to be transmitted to the second terminal device using a selection criterion, wherein the selection criterion includes at least one of data transmission rate, transmission channel quality, or network jitter.
10. The system according to any one of claims 1 to 9, characterized in that The target transmission channel is the public network direct connection transmission channel after the STUN penetration.
11. The system according to any one of claims 1 to 10, characterized in that The data to be transmitted includes at least one of: pictures, audio, video, documents, or applications.
12. A method for far-field communication of a device, characterized in that: The method comprises: The first terminal device and the second terminal device establish an RTN network transmission channel, wherein the RTN network transmission channel is a transmission channel using an RTN server as a transit; The first terminal device and the second terminal device establish a public network direct connection transmission channel after STUN penetration; The first terminal device transmits a first part of the data to be transmitted to the second terminal device by using the RTN network transmission channel; The first terminal device selects a target transmission channel from the RTN network transmission channel and the public network direct connection transmission channel after STUN penetration, and transmits the second part of the data to be transmitted to the second terminal device through the target transmission channel.
13. The method according to claim 12, characterized in that The first terminal device transmits the first part of the data to be transmitted to the second terminal device by using the RTN network transmission channel, and the first terminal device and the second terminal device establish a public network direct connection transmission channel after STUN penetration in parallel.
14. The method according to claim 12 or 13, characterized in that The first terminal device and the second terminal device establish an RTN network transmission channel, and the first terminal device and the second terminal device establish a public network direct connection transmission channel after STUN penetration in parallel.
15. The method according to any one of claims 12 to 14, characterized in that The method further comprises: The first terminal device sends first registration information to the IOT server, where the first registration information includes address information and first user information of the first terminal device; The first terminal device sends query information to the IOT server, where the query information is used to query the address of the second terminal device; The first terminal device obtains the address of the second terminal device from the IOT server; The first terminal device establishes a communication connection with the second terminal device based on the address of the second terminal device.
16. The method according to any one of claims 12 to 15, characterized in that The method further comprises: The first terminal device obtains, from the RTN server, an IP address and a port number in the RTN network allocated to the first terminal device; The first terminal device sends the IP address and port number of the first terminal device in the RTN network to the IOT server; The first terminal device receives the IP address of the second terminal device in the RTN network sent by the IOT server. and port number.
17. The method according to claim 16, characterized in that The first terminal device and the second terminal device establish an RTN network transmission channel, including: The first terminal device establishes the RTN network transmission channel with the second terminal device by using the IP address and port number of the second terminal device in the RTN network.
18. The method according to any one of claims 12 to 17, characterized in that The method further comprises: The first terminal device obtains the public IP address and port number after STUN penetration allocated to the first terminal device from the STUN server; The first terminal device sends the public IP address and port number of the first terminal device after STUN penetration to the IOT server; The first terminal device receives the public IP address and port number of the second terminal device after STUN penetration sent by the IOT server.
19. The method according to claim 18, characterized in that The first terminal device and the second terminal device establish a public network direct connection transmission channel after STUN penetration, including: The first terminal device uses the public network IP address and port number of the second terminal device after the STUN penetration to establish a public network direct connection transmission channel after the STUN penetration with the second terminal device.
20. The method according to any one of claims 12 to 19, characterized in that The method further comprises: The first terminal device selects a target transmission channel from the RTN network transmission channel and the public network direct connection transmission channel after STUN penetration to transmit the second part of the data to be transmitted to the second terminal device using a selection criterion, wherein the selection criterion includes at least one of data transmission rate, transmission channel quality, or network jitter.
21. The method according to any one of claims 12 to 20, characterized in that The target transmission channel is the public network direct connection transmission channel after the STUN penetration.
22. The method according to any one of claims 12 to 21, characterized in that The data to be transmitted includes at least one of: pictures, audio, video, documents, or applications.
23. A terminal device, characterized in that: include: Processor and memory; The processor is coupled to a memory, wherein the memory stores program instructions. When the program instructions stored in the memory are executed by the processor, the method according to any one of claims 12 to 22 is performed.
24. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor is caused to perform the method according to any one of claims 12 to 22.
25. A chip, characterized in that: include: A processor, configured to call and run a computer program from a memory, so that a communication device equipped with the chip executes a method as claimed in any one of claims 12 to 22.
Citation Information
Patent Citations
Internet of things device P2P connection method based on NAT penetration adapter
CN103957287A
Upgrading to direct connection for servers behind a network address translation device
US20180337886A1
Distributed system NAT traversal method, apparatus, and device, and storage medium
WO2021056738A1
Cited By
Point-to-point connection method and device based on network address translation and storage medium
CN119299462A
