Device communication method, related apparatus and communication system

The modem-based data transmission connection is established through the relay server, which solves the problem of service interruption of wearable devices caused by disconnection of Bluetooth connection, realizes stable communication and secure data transmission between devices, and improves the user experience.

WO2025157105A1PCT designated stage Publication Date: 2025-07-31HUAWEI TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/073387
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-01-26
Filing Date
2025-01-20
Publication Date
2025-07-31

AI Technical Summary

Technical Problem

When the wearable device is disconnected from the phone's Bluetooth connection, many services are unavailable, reducing the user experience.

Method used

After the Bluetooth connection is disconnected, a modem-based data transmission connection is established through the relay server to realize communication between devices, including device authentication and channel authentication, to ensure data security and switch transmission methods.

Benefits of technology

Regardless of the distance between devices, communication connections can be maintained, improving the user's experience of using wearable devices, ensuring data security and reducing resource waste.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025073387_31072025_PF_FP_ABST
    Figure CN2025073387_31072025_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the present application are a device communication method, a related apparatus and a communication system. The method can be applied to a communication system comprising a first device and a second device. The second device may be a wearable device. When a Bluetooth connection between the first device and the second device is cut off, by means of a relay server, the first device and the second device can establish a communication connection for transmitting data on the basis of a modem. The communication connection for transmitting data on the basis of a modem can be not limited by the distance between the first device and the second device. In this way, regardless of whether the distance between the first device and the second device is short or long, the second device can both communicate with the first device so as to provide one or more services for users under the assistance of the first device, which can improve the use experience of the users using the second device.
Need to check novelty before this filing date? Find Prior Art

Description

Device communication method, related device and communication system

[0001] This application claims priority to the Chinese patent application with application number 202410117871.5 filed with the State Intellectual Property Office of China on January 26, 2024, and priority to the Chinese patent application with the invention name “Device Communication Method, Related Devices and Communication System”, all contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of terminal technology, and in particular to a device communication method, related apparatus and communication system. Background Art

[0003] With the development of wearable devices, smartwatches, smart bracelets, and other wearable devices are becoming increasingly powerful. Many of these features rely on a Bluetooth connection with a mobile phone. If the distance between the wearable device and the phone is too far (for example, when a user leaves home with only the wearable device and not the phone), the Bluetooth connection between the wearable device and the phone may be lost, temporarily rendering many services on the wearable device unusable. This significantly reduces the user experience with wearable devices. Summary of the Invention

[0004] The present application provides a device communication method, related apparatus, and communication system. After the Bluetooth connection between a first device and a second device is disconnected, the first device and the second device can establish a communication connection based on modem data transmission through a relay server. The above-mentioned communication connection based on modem data transmission can be unrestricted by the distance between the first device and the second device. In this way, regardless of whether the first device and the second device are close or far away, the second device can communicate with the first device, thereby providing one or more services to the user with the assistance of the first device. This can enhance the user experience of using the second device.

[0005] In a first aspect, the present application provides a device communication method. The method can be applied to a communication system, which may include a first device and a second device, and the first device and the second device establish a Bluetooth connection. When the Bluetooth connection is disconnected, the first device requests device authentication from the first server, and the second device requests device authentication from the first server, and the device authentication is used to verify whether the first device and the second device have an associated relationship; when the device authentication is successful, the first device requests channel authentication from the first server, and the second device requests channel authentication from the first server, and the channel authentication is used to verify whether the first device and the second device have the ability to switch between Bluetooth data transmission and data transmission by a modem; when the channel authentication is successful, the first device and the second device establish a first connection, and the first connection is a communication connection based on modem data transmission; when the first connection is successfully established, the first device and the second device transmit data through the first connection.

[0006] The first server may be a relay server. The first device may be an electronic device such as a mobile phone or a tablet computer. The second device may be a wearable device such as a watch or a wristband.

[0007] It can be seen that after the Bluetooth connection is disconnected, the first device and the second device can establish a communication connection based on modem data transmission. The above-mentioned communication connection based on modem data transmission may not be limited by the distance between the first device and the second device. Regardless of whether the first device and the second device are close or far away, the second device can communicate with the first device to provide one or more services to the user with the assistance of the first device. For example, when a user only carries the second device when going out, the user can still view message notifications of social applications in a timely manner and reply to messages through the second device. This can enhance the user experience of using the second device.

[0008] Among them, when establishing a communication connection based on modem data transmission, the first device and the second device can first perform device authentication and channel authentication through the first server. The above-mentioned device authentication can ensure that the two devices establishing the communication connection based on modem data transmission are associated devices, avoid the first device and the second device from sending application data to non-associated devices, and improve the security of application data transmission. The above-mentioned channel authentication can verify whether the two electronic devices have the ability to switch the data originally transmitted by the Bluetooth connection to transmission via the modem after the Bluetooth connection is disconnected. This can reduce the situation where electronic devices request to establish a connection with electronic devices that do not have the ability to switch data transmission methods, and reduce the waste of electronic equipment computing resources, storage resources and other resources.

[0009] In some embodiments, the device authentication request sent by the above-mentioned first device may include one or more items of device information of the first device. The device authentication request sent by the above-mentioned second device may include one or more items of device information of the second device. The above-mentioned device authentication may be used only to determine the identity of the electronic device so that the first server knows the existence of the electronic device and the device information of the electronic device. When receiving device authentication requests from multiple electronic devices, the first server may autonomously verify the association relationship between the multiple electronic devices to determine the electronic devices with an associated relationship. When receiving channel authentication requests from the first device and the second device, the first server may send a message of channel authentication success to the first device and the second device only after determining that the first device and the second device are associated devices.

[0010] In conjunction with the first aspect, in some embodiments, the first connection is a P2P connection.

[0011] When the first connection fails to be established, the first device and the second device establish a second connection through the first server. The second connection includes a data transmission channel between the first device and the first server, and a data transmission channel between the second device and the first server. The first device and the second device transmit data through the second connection.

[0012] It is understandable that the network environment currently located by the first device and / or the second device may not support P2P connections. Therefore, the first device and the second device may not be able to establish a P2P connection. If the P2P connection fails to be established, the first device can establish a data transmission channel with the first server, and the second device can establish a data transmission channel with the first server. In this way, if the Bluetooth connection is disconnected, the first device and the second device can use the first server as a data transfer station to transmit data.

[0013] In combination with the first aspect, in some embodiments, the specific process of establishing a first connection between the first device and the second device can be: the first device establishes a data transmission channel with the first server, and the second device establishes a data transmission channel with the first server, and the first connection includes the data transmission channel between the first device and the first server, and the data transmission channel between the second device and the first server.

[0014] It can be seen that when the Bluetooth connection is disconnected, the first device and the second device can directly establish a communication connection with the first server as a data transfer station.

[0015] In combination with the first aspect, in some embodiments, when the first device detects the Bluetooth broadcast of the second device, and / or the second device detects the Bluetooth broadcast of the first device, the first device and the second device restore the Bluetooth connection.

[0016] Optionally, when the first device and the second device restore the Bluetooth connection, the first device and the second device may disconnect the first connection.

[0017] It can be seen that when the first device and the second device are brought close again after the Bluetooth connection is disconnected, the first device and the second device can restore the Bluetooth connection and switch the data transmission mode to transmit data to each other using the Bluetooth connection.

[0018] In combination with the first aspect, in some embodiments, the first device and the second device both include a first application. When the first device and the second device establish a Bluetooth connection, the first device sends the first data of the first application to the second device through the Bluetooth connection; when the first device and the second device establish a P2P connection, the first device sends the first data to the second device through the P2P connection; when the first device establishes a data transmission channel with the first server, and the second device establishes a data transmission channel with the first server, the first device sends the first data to the first server and instructs the first server to send the first data to the second device, and the second device receives the first data from the first server.

[0019] It can be seen that the first device can decide which communication connection method to use to transmit data to the second device based on the current communication connection method between the first device and the second device. Among them, when the Bluetooth connection between the first device and the second device is disconnected, the first device can still send application data to the second device through a P2P connection or a communication connection with the first server as a data transfer station. The above-mentioned P2P connection and the communication connection with the first server as a data transfer station are not limited by the distance between the first device and the second device. Regardless of whether the first device and the second device are close or far away, the second device can communicate with the first device so as to provide one or more services to the user with the assistance of the first device.

[0020] In some embodiments, the first data is obtained by the first device from the second server corresponding to the first application before the first device sends the first data to the second device.

[0021] In combination with the first aspect, in some embodiments, the first device and the second device both include a first application. When the first device and the second device establish a Bluetooth connection, the second device sends the second data of the first application to the first device through the Bluetooth connection; when the first device and the second device establish a P2P connection, the second device sends the second data to the first device through the P2P connection; when the first device establishes a data transmission channel with the first server, and the second device establishes a data transmission channel with the first server, the second device sends the second data to the first server and instructs the first server to send the second data to the first device, and the first device receives the second data from the first server.

[0022] It can be seen that the second device can decide which communication connection method to use to transmit data to the first device based on the current communication connection method between the second device and the first device. Among them, when the Bluetooth connection between the first device and the second device is disconnected, the second device can still send application data to the second device through a P2P connection or a communication connection with the first server as a data transfer station. The above-mentioned P2P connection and the communication connection with the first server as a data transfer station are not limited by the distance between the first device and the second device. Regardless of whether the first device and the second device are close or far away, the second device can communicate with the first device so as to provide one or more services to the user with the assistance of the first device.

[0023] In some embodiments, the second data is data determined by the second device based on user input. For example, if the first application is a social networking application, the second data may include a message entered by the user on the second device to be sent to a contact. For another example, if the first application is an audio and video application, the second data may include an audio switching instruction determined based on the user's operation to switch audio on the second device.

[0024] In some embodiments, after receiving the second data, the first device may send the second data to a second server corresponding to the first application.

[0025] In combination with the first aspect, in some embodiments, when the device authentication is passed, the first device receives a first device identifier from the first server, and the second device receives a second device identifier from the first server, the first device identifier is used to identify the first device, and the second device identifier is used to identify the second device; wherein, the message from the first device requesting channel authentication to the first server includes the first device identifier, and the message from the second device requesting channel authentication to the first server includes the second device identifier.

[0026] In combination with the first aspect, in some embodiments, when the channel authentication is passed, the first device receives a first channel identifier from the first server and establishes a first signaling link with the first server, the second device receives a second channel identifier from the first server and establishes a second signaling link with the first server, the first channel identifier is used to identify the first signaling link, and the second channel identifier is used to identify the second signaling link; wherein, the first signaling link and the second signaling link are used to establish a first connection between the first device and the second device.

[0027] In conjunction with the first aspect, in some embodiments, the first device and the second device both include a first service, which is used to call a Bluetooth chip or modem to transmit data. The above-mentioned first service can refer to the Bluetooth service or wearable device management service in subsequent embodiments of this application.

[0028] In a second aspect, the present application provides a device communication method. The method can be applied to a first device, wherein the first device establishes a Bluetooth connection with a second device. When the Bluetooth connection is disconnected, the first device requests device authentication from a first server, and the device authentication is used to verify whether the first device and the second device have an associated relationship; when the device authentication is successful, the first device requests channel authentication from the first server, and the channel authentication is used to verify whether the first device has the ability to switch between Bluetooth data transmission and data transmission by a modem; when the channel authentication is successful, the first device and the second device establish a first connection, and the first connection is a communication connection based on modem data transmission; when the first connection is successfully established, the first device transmits data with the second device via the first connection.

[0029] The first server mentioned above may be a relay server.

[0030] It can be seen that after the Bluetooth connection is disconnected, the first device and the second device can establish a communication connection based on modem data transmission. The above-mentioned communication connection based on modem data transmission can be unrestricted by the distance between the first device and the second device. Regardless of whether the first device and the second device are close or far away, the first device can communicate with the second device to assist the second device in providing one or more services to the user. For example, if a user only carries the second device when going out, the user can still view message notifications of social applications in a timely manner and reply to messages through the second device. This can enhance the user experience of using the second device.

[0031] Among them, when establishing a communication connection based on modem data transmission, the first device can first perform device authentication and channel authentication through the first server. The above-mentioned device authentication can ensure that the two devices establishing a communication connection based on modem data transmission are associated devices, avoid the first device sending application data to non-associated devices, and improve the security of application data transmission. The above-mentioned channel authentication can verify whether the two electronic devices have the ability to switch the data originally transmitted by the Bluetooth connection to transmission via the modem after the Bluetooth connection is disconnected. This can reduce the situation where the first device requests to establish a connection with an electronic device that does not have the ability to switch the data transmission mode, and reduce the waste of computing resources, storage resources and other resources of the first device.

[0032] In conjunction with the second aspect, in some embodiments, the first connection is a P2P connection.

[0033] When the first connection fails to be established, the first device establishes a second connection with the second device through the first server. The second connection includes a data transmission channel between the first device and the first server, and a data transmission channel between the second device and the first server. The first device transmits data with the second device through the second connection.

[0034] It is understandable that the network environment currently located by the first device and / or the second device may not support P2P connections. Therefore, the first device and the second device may not be able to establish a P2P connection. If the P2P connection fails to be established, the first device can establish a data transmission channel with the first server. In this way, if the Bluetooth connection is disconnected, the first device can use the first server as a data transfer station to transmit data to the second device.

[0035] In combination with the second aspect, in some embodiments, the specific process of establishing a first connection between the first device and the second device may be: the first device establishes a first connection with the second device through the first server, and the first connection includes a data transmission channel between the first device and the first server, and a data transmission channel between the second device and the first server.

[0036] It can be seen that when the Bluetooth connection is disconnected, the first device and the second device can directly establish a communication connection with the first server as a data transfer station.

[0037] In combination with the second aspect, in some embodiments, when the first device detects the Bluetooth broadcast of the second device, the first device and the second device restore the Bluetooth connection.

[0038] Optionally, when the first device and the second device restore the Bluetooth connection, the first device and the second device may disconnect the first connection.

[0039] It can be seen that when the first device and the second device are brought close again after the Bluetooth connection is disconnected, the first device and the second device can restore the Bluetooth connection and switch the data transmission mode to transmit data to each other using the Bluetooth connection.

[0040] In combination with the second aspect, in some embodiments, the first device includes a first application. When the first device and the second device establish a Bluetooth connection, the first device sends first data of the first application to the second device through the Bluetooth connection; when the first device and the second device establish a P2P connection, the first device sends first data to the second device through the P2P connection; when the first device establishes a data transmission channel with the first server, the first device sends first data to the first server and instructs the first server to send the first data to the second device.

[0041] It can be seen that the first device can decide which communication connection method to use to transmit data to the second device based on the current communication connection method between the first device and the second device. Among them, when the Bluetooth connection between the first device and the second device is disconnected, the first device can still send application data to the second device through a P2P connection or a communication connection with the first server as a data transfer station. The above-mentioned P2P connection and the communication connection with the first server as a data transfer station are not limited by the distance between the first device and the second device. Regardless of whether the first device and the second device are close or far away, the second device can communicate with the first device so as to provide one or more services to the user with the assistance of the first device.

[0042] In combination with the second aspect, in some embodiments, the first device includes a first application. When the first device and the second device establish a Bluetooth connection, the first device receives second data of the first application from the second device via the Bluetooth connection; when the first device and the second device establish a P2P connection, the first device receives second data from the second device via the P2P connection; when the first device establishes a data transmission channel with the first server, the first device receives second data from the second device from the first server.

[0043] In combination with the second aspect, in some embodiments, when the device authentication is passed, the first device receives a first device identifier from the first server, where the first device identifier is used to identify the first device; wherein the message from the first device to the first server requesting channel authentication includes the first device identifier.

[0044] In combination with the second aspect, in some embodiments, when the channel authentication is passed, the first device receives a first channel identifier from the first server and establishes a first signaling link with the first server, and the first channel identifier is used to identify the first signaling link; wherein, the first signaling link is used to establish a first connection between the first device and the second device.

[0045] In conjunction with the second aspect, in some embodiments, the first device may be a mobile phone. The second device may be a wearable device, such as a watch or a wristband. The first data may be obtained by the first device from a second server corresponding to the first application before the first device sends the first data to the second device. After receiving the second data, the first device sends the second data to the second server corresponding to the first application.

[0046] In conjunction with the second aspect, in some embodiments, the first device may be a wearable device, such as a watch or bracelet. The second device may be a mobile phone. The first data is determined by the first device based on user input before sending the first data to the second device. For example, the first application is a social application. The first data may include a message entered by the user on the first device to be sent to a contact. For another example, the first application is an audio and video application. The first data may include an audio switching instruction determined based on the user's operation to switch audio on the first device.

[0047] In conjunction with the second aspect, in some embodiments, the first device includes a first service, which is used to call a Bluetooth chip or modem to transmit data. The above-mentioned first service can refer to the Bluetooth service or wearable device management service in subsequent embodiments of this application.

[0048] In a third aspect, the present application provides a device communication method. The method can be applied to a server. The server can respond to the device authentication request of the first device and the second device, and verify whether the first device and the second device have an associated relationship; when the first device and the second device have an associated relationship, the server sends a message that the device authentication is passed to the first device and the second device; the server responds to the channel authentication request of the first device and the second device, and verifies whether the first device and the second device have a first capability of switching between Bluetooth data transmission and data transmission by a modem; when the first device and the second device have the first capability, the server sends a message that the channel authentication is passed to the first device and the second device; the server responds to the request of the first device and the second device to establish a first connection, sends a first message to the first device, and sends a second message to the second device, the first message and the second message are used for the first device and the second device to establish a first connection, and the first connection is a communication connection based on modem transmission of data.

[0049] The server may be a relay server. The first device may be an electronic device such as a mobile phone or tablet computer. The second device may be a wearable device such as a watch or a bracelet.

[0050] As can be seen, the server can assist the first device and the second device in establishing a communication connection based on modem data transmission. This communication connection based on modem data transmission is not limited by the distance between the first and second devices. After the Bluetooth connection is disconnected, the first and second devices can still use the communication connection based on modem data transmission to transmit data. In this way, regardless of whether the first and second devices are close or far apart, the second device can communicate with the first device to provide one or more services to the user with the assistance of the first device.

[0051] Among them, the server can first perform device authentication and channel authentication on the first device and the second device. The above-mentioned device authentication can ensure that the two devices establishing a communication connection based on modem data transmission are associated devices, preventing the first device and the second device from sending application data to unassociated devices, and improving the security of application data transmission. The above-mentioned channel authentication can verify whether the two electronic devices have the ability to switch the data originally transmitted by the Bluetooth connection to transmission via the modem after the Bluetooth connection is disconnected. This can reduce the situation where electronic devices request to establish a connection with electronic devices that do not have the ability to switch data transmission methods, and reduce the waste of electronic equipment computing resources, storage resources and other resources.

[0052] In combination with the third aspect, in some embodiments, the first connection is a P2P connection, the first message includes the IP address of the second device (e.g., external IP address, internal IP address), and the second message includes the IP address of the first device (e.g., external IP address, internal IP address).

[0053] Before the server sends the first message to the first device and the second message to the second device, it may obtain the IP address of the first device and the IP address of the second device. The IP address of the first device may be obtained from the request sent by the first device to establish a first connection with the second device. The IP address of the second device may be obtained from the request sent by the second device to establish a first connection with the first device.

[0054] It can be seen that the server can provide an address exchange function to assist the first device and the second device in establishing a P2P connection.

[0055] In combination with the third aspect, in some embodiments, the server establishes a first data transmission channel with the first device; the server establishes a second data transmission channel with the second device, and the first connection includes the first data transmission channel and the second data transmission channel.

[0056] In combination with the third aspect, in some embodiments, the server receives first data sent by the first device through the first data transmission channel, and sends the first data to the second device through the second data transmission channel.

[0057] In combination with the third aspect, in some embodiments, the server receives second data sent by the second device through the second data transmission channel, and sends the second data to the first device through the first data transmission channel.

[0058] It can be seen that the server can provide a data forwarding function, and can forward the first data of the first device to the second device, and forward the second data of the second device to the first device.

[0059] In combination with the third aspect, in some embodiments, the server responds to the device authentication requests of the third device and the fourth device, and verifies whether the third device and the fourth device have an associated relationship; when the third device and the fourth device have an associated relationship, the server sends a message that the device authentication is successful to the third device and the fourth device; the server responds to the channel authentication requests of the third device and the fourth device, and verifies whether the third device and the fourth device have the first capability; when the third device and the fourth device have the first capability, the server sends a message that the channel authentication is successful to the third device and the fourth device; when a request to establish a P2P connection is received from the third device, and a request to establish a P2P connection is not received from the fourth device within a first time period, the server sends a message indicating that the P2P connection failed to the third device, and the first time period includes the time period after the server receives the request to establish a P2P connection from the third device.

[0060] In conjunction with the third aspect, in some embodiments, after the server sends a message indicating a P2P connection failure to the third device, the server may establish a third data transmission channel with the third device; the server may establish a fourth data transmission channel with the fourth device, and the third data transmission channel and the fourth data transmission channel are used for data transmission between the third device and the fourth device. The establishment method of the third data transmission channel and the fourth data transmission can refer to the establishment method of the first data transmission channel and the second data transmission.

[0061] In combination with the third aspect, in some embodiments, the device authentication success message sent by the server to the first device includes a first device identifier, and the device authentication success message sent by the server to the second device includes a second device identifier, the first device identifier is used to identify the first device, and the second device identifier is used to identify the second device; wherein, the channel authentication request from the first device includes the first device identifier, and the channel authentication request from the second device includes the second device identifier.

[0062] In combination with the third aspect, in some embodiments, when the first device and the second device have the first capability, the server sends a first channel identifier to the first device and sends a second channel identifier to the second device, the first channel identifier is used to identify the first signaling link, and the second channel identifier is used to identify the second signaling link; the server establishes a first signaling link with the first device and establishes a second signaling link with the second device, and the first signaling link and the second signaling link are used to establish a first connection between the first device and the second device.

[0063] In a fourth aspect, the present application provides an electronic device. The electronic device may include a memory and a processor. The memory may be used to store a computer program. The processor may be used to invoke the computer program, causing the electronic device to execute any possible implementation method as described in the second aspect.

[0064] In a fifth aspect, the present application provides a communication system. The communication system may include a first device and a second device. The first device and the second device establish a Bluetooth connection. The first device can be used to request device authentication from the first server after the Bluetooth connection is disconnected, and the second device can be used to request device authentication from the first server after the Bluetooth connection is disconnected. Device authentication is used to verify whether the first device and the second device have an associated relationship; the first device can be used to request channel authentication from the first server after the device authentication is passed, and the second device can be used to request channel authentication from the first server after the device authentication is passed. Channel authentication is used to verify whether the first device and the second device have the ability to switch between Bluetooth data transmission and data transmission by a modem; the first device and the second device can be used to establish a first connection after the channel authentication is passed, and the first connection is a communication connection based on modem data transmission; the first device and the second device can be used to transmit data through the first connection after the first connection is successfully established.

[0065] In a sixth aspect, the present application provides a server. The server may include a memory and a processor, wherein the memory may be used to store a computer program; and the processor may be used to call the computer program so that the server executes any possible implementation method as described in the third aspect.

[0066] In a seventh aspect, the present application provides a computer-readable storage medium comprising instructions, which, when executed on an electronic device, enables the electronic device to execute any possible implementation method as in the second aspect.

[0067] In an eighth aspect, the present application provides a computer program product, which may include computer instructions. When the computer instructions are run on an electronic device, the electronic device executes any possible implementation method as in the second aspect.

[0068] In a ninth aspect, the present application provides a chip, which is applied to an electronic device. The chip includes one or more processors, and the processor is used to call computer instructions to enable the electronic device to execute any possible implementation method as in the second aspect.

[0069] It is understandable that the electronic device provided in the fourth aspect, the communication system provided in the fifth aspect, the server provided in the sixth aspect, the computer-readable storage medium provided in the seventh aspect, the computer program product provided in the eighth aspect, and the chip provided in the ninth aspect are all used to execute the methods provided in the embodiments of the present application. Therefore, the beneficial effects that can be achieved can be referred to the beneficial effects of the corresponding methods and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0070] FIG1 is an architecture diagram of a communication system provided in an embodiment of the present application;

[0071] FIG2A is a schematic structural diagram of an electronic device 100 provided in an embodiment of the present application;

[0072] FIG2B is a schematic structural diagram of another electronic device 100 provided in an embodiment of the present application;

[0073] FIG3A is a schematic structural diagram of an electronic device 200 provided in an embodiment of the present application;

[0074] FIG3B is a schematic structural diagram of another electronic device 200 provided in an embodiment of the present application;

[0075] FIG4 is a schematic structural diagram of a relay server 300 provided in an embodiment of the present application;

[0076] FIG5 is a schematic diagram of a communication system provided in an embodiment of the present application;

[0077] FIG6 is a schematic diagram of another communication system provided in an embodiment of the present application;

[0078] FIG7 is a flow chart of a device communication method provided in an embodiment of the present application;

[0079] FIG8 is a flow chart of a device communication method provided in an embodiment of the present application;

[0080] 9 is a flow chart of a method for establishing a communication connection based on modem data transmission according to an embodiment of the present application;

[0081] FIG10 is a flow chart of a method for establishing a P2P connection provided in an embodiment of the present application;

[0082] FIG11 is a flowchart of another method for establishing a communication connection based on modem data transmission provided by an embodiment of the present application. DETAILED DESCRIPTION

[0083] The technical solutions in the embodiments of the present application are described below in conjunction with the drawings in the embodiments of the present application. Among them, in the description of the embodiments of the present application, the terms used in the following embodiments are only for the purpose of describing specific embodiments, and are not intended to be used as limitations on the present application. As used in the specification and claims of the present application, the singular expressions "a", "said", "above", "the" and "this" are intended to also include expressions such as "one or more", unless there is a clear contrary indication in the context. It should also be understood that in the following embodiments of the present application, "at least one", "one or more" refer to one or more (including two). The term "and / or" is used to describe the association relationship of associated objects, indicating that three relationships can exist; for example, A and / or B can represent: the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural. The character " / " generally indicates that the associated objects before and after are in an "or" relationship.

[0084] References to "one embodiment" or "some embodiments" etc. described in this specification mean that the specific features, structures or characteristics described in conjunction with the embodiment are included in one or more embodiments of the present application. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. appearing in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in another way. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in another way. The term "connected" includes direct and indirect connections, unless otherwise stated. "First" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated.

[0085] In the embodiments of this application, words such as "exemplarily" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplarily" or "for example" in the embodiments of this application should not be interpreted as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplarily" or "for example" is intended to present the relevant concepts in a concrete manner.

[0086] The present application provides a device communication method that can be applied to a communication system including an electronic device 100 and an electronic device 200. The electronic device 200 can be a wearable device, such as a smart watch, a smart bracelet, etc. The electronic device 100 can communicate with an application server and send data from the application server to the electronic device 200. In particular, when a Bluetooth connection is established between the electronic device 100 and the electronic device 200, the electronic device 100 and the electronic device 200 can transmit data via the Bluetooth connection. When the above-mentioned Bluetooth connection is disconnected, the electronic device 100 and the electronic device 200 can establish a first connection and transmit data via the first connection. The first connection can be a communication connection based on modem data transmission. For example, the first connection can be a peer to peer (P2P) connection. Alternatively, the first connection is a communication connection with a relay server as a data transfer station, which can include a data transmission channel between the electronic device 100 and the relay server, and a data transmission channel between the electronic device 200 and the relay server.

[0087] The above-mentioned communication connection based on modem data transmission (such as P2P connection, communication connection with relay server as data transfer station) may not be restricted by the distance between electronic device 100 and electronic device 200. In the case where only electronic device 100 can communicate with the application server and the user only carries electronic device 200, electronic device 200 can also receive data from the application server through P2P connection or relay server. In this way, no matter whether the distance between electronic device 100 and electronic device 200 is close or far, the user can view the application message notification in time through electronic device 200 and reply to the message. This can enhance the user experience of using electronic device 200.

[0088] The communication system 10 involved in this application is introduced below.

[0089] As shown in FIG. 1 , a communication system 10 may include an electronic device 100 , an electronic device 200 , a relay server 300 , and an application server 400 .

[0090] Application server 400 can be an application server for any application. For example, application server 400 can be an application server for a social networking application. Application server 400 can store and manage social accounts for the social networking application and provide social communication services for different social accounts. For another example, application server 400 can also be an application server for an audio and video application. Application server 400 can store audio and video resources and distribute them to user devices.

[0091] In some embodiments, the electronic device 100 may have an application corresponding to the application server 400 installed. A communication connection may be established between the electronic device 100 and the application server 400. For example, the application server 400 may be a social application. A social account associated with the social application may be logged into the electronic device 100. The application server 400 may send a message to the electronic device 100 that needs to be delivered to the social account logged into the electronic device 100. After receiving a message entered by a user in the social application, the electronic device 100 may send the message to the application server 400 to instruct the application server 400 to send the message to the corresponding social account.

[0092] In some embodiments, when the distance between the electronic device 100 and the electronic device 200 is within the distance range of Bluetooth transmission, a Bluetooth connection may be established between the electronic device 100 and the electronic device 200 .

[0093] When the Bluetooth connection between electronic device 100 and electronic device 200 is disconnected, electronic device 100 and electronic device 200 can establish a P2P connection through relay server 300. Alternatively, electronic device 100 establishes a data transmission channel with relay server 300, and electronic device 200 also establishes a data transmission channel with relay server 300. Furthermore, relay server 300 can serve as a data transfer station. Electronic device 100 and electronic device 200 can transmit data to each other through relay server 300.

[0094] In some embodiments, the relay server 300 may be a cloud server, or a physical server. The relay server 300 may be a standalone server, or a server cluster consisting of multiple servers. The embodiments of the present application do not limit the form of the relay server 300. The relay server 300 may be used to provide security authentication, address exchange, data forwarding, and other functions.

[0095] Among them, the security authentication function can be used to perform security authentication on the electronic device 100 and the electronic device 200 before the relay server 300 assists the electronic device 100 and the electronic device 200 to establish a P2P connection, or before the relay server 300 acts as a transfer station to assist the electronic device 100 and the electronic device 200 in data transmission. The above-mentioned security authentication may include device authentication and channel authentication. Device authentication can be used to verify the identity of the electronic device 100 and the electronic device 200, and determine whether the electronic device 100 and the electronic device 200 have an associated relationship. The electronic device 100 and the electronic device 200 have an associated relationship, which may include: the device account logged in the electronic device 100 is the same as the device account logged in the electronic device 200, the electronic device 100 and the electronic device 200 have established other binding relationships, etc. The embodiment of the present application does not limit the associated relationship between the electronic device 100 and the electronic device 200. Channel authentication can be used to verify whether the electronic device 100 and the electronic device 200 have the ability to switch between Bluetooth transmission and data transmission by a modem. Among them, the electronic device 100 (or electronic device 200) has the ability to switch between Bluetooth transmission and data transmission by a modem, which can mean that the electronic device 100 (or electronic device 200) can transmit data to the target device via a Bluetooth connection, and when the Bluetooth connection between itself and the target device is disconnected, the data originally transmitted by the Bluetooth connection continues to be transmitted to the target device via the modem.

[0096] The above-mentioned data transmission via a modem may mean that when sending data, the data to be sent is modulated by the modem and then converted into electromagnetic waves and radiated out via the antenna. When receiving data, the modem is used to demodulate the received electromagnetic wave signal. The above-mentioned communication method for transmitting data via a modem may include: a communication method based on mobile communication technology (such as 2G / 3G / 4G / 5G), a communication method based on wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), etc. The embodiments of the present application do not limit the above-mentioned communication method for transmitting data via a modem.

[0097] The relay server 300 is not limited to performing device authentication and channel authentication on the electronic device 100 and the electronic device 200 . The relay server 300 can also respond to requests for device authentication and channel authentication from other devices and perform device authentication and channel authentication on other devices.

[0098] The address exchange function can be used by the relay server 300 to assist two electronic devices (such as electronic device 100 and electronic device 200) in establishing a P2P connection. When receiving a request from electronic device 100 and electronic device 200 to establish a P2P connection, the relay server 300 can obtain the address of electronic device 100 and the address of electronic device 200, and send the address of electronic device 100 to electronic device 200, and send the address of electronic device 200 to electronic device 100. In this way, electronic device 100 and electronic device 200 can establish a P2P connection based on the address of the other end to achieve point-to-point communication. In some embodiments, the address of the electronic device 100 may include the Internet Protocol (IP) address of the electronic device 100, for example, the external network address (or external IP address) of the electronic device 100. Optionally, the address of the electronic device 100 may also include the intranet address (or internal IP address) of the electronic device 100. Similarly, the address of the electronic device 200 may include the IP address of the electronic device 200, for example, the external network address of the electronic device 200. Optionally, the address of the electronic device 200 may also include the intranet address of the electronic device 200 .

[0099] The data forwarding function can be used to enable the relay server 300 to act as a data transfer station for two electronic devices (e.g., the electronic device 100 and the electronic device 200), forwarding data from one electronic device to the other. When providing the data forwarding function, the relay server 300 can establish data transmission channels with each of the two electronic devices. The relay server 300 can use the data transmission channels between the relay server 300 and the two electronic devices to forward data.

[0100] In some embodiments, the electronic device 200 may also have an application corresponding to the application server 400 installed. For example, the application corresponding to the application server 400 is the first application. The electronic device 200 can be bound to the application account logged in by the first application in the electronic device 100. The present embodiment of the application does not limit the method of binding the above application accounts. For example, the electronic device 200 can bind the application account logged in by the first application in the electronic device 100 by scanning a QR code on the electronic device 100.

[0101] When electronic device 100 receives data from application server 400, it can send the data to electronic device 200. When electronic device 200 receives data entered by a user in an application corresponding to application server 400, it can send the data to electronic device 100. Then, electronic device 100 can send the data sent by electronic device 200 to application server 400. It can be seen that electronic device 200 can communicate with application server 400 through electronic device 100.

[0102] For example, electronic device 100 is a mobile phone. Electronic device 200 is a watch. Both the mobile phone and the watch may have social applications installed. The mobile phone can communicate with the application server 400 of the social application and log in to the corresponding social account. The watch can be bound to the social account logged in to the social application on the mobile phone through the mobile phone. When the mobile phone receives a message from the application server 400, the mobile phone can send the data to the watch. In addition, the user can reply to the message in the social application on the watch. The watch can send the reply message entered by the user to the mobile phone, and the mobile phone will send the reply message to the application server 400. In this way, the user can quickly view the messages in the social application and reply on the watch without opening the mobile phone.

[0103] In some embodiments, the electronic device 100 and the electronic device 200 are of different device types. Although both the electronic device 100 and the electronic device 200 have the application corresponding to the application server 400 installed, the application installation package of the application in the electronic device 100 and the electronic device 200 (for example, The package (Android Package, APK) can be different. The application installation package can also be called an application package or other names.

[0104] The communication system 10 is not limited to the electronic devices and servers shown in FIG. 1 , and may include more or fewer devices.

[0105] The structure of the device involved in this application is introduced below.

[0106] FIG. 2A exemplarily shows a schematic structural diagram of an electronic device 100 .

[0107] As shown in Figure 2A, the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.

[0108] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 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.

[0109] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors. In some embodiments, the processor 110 may be a system on chip (SOC).

[0110] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0111] Processor 110 may also include a memory for storing instructions and data. In some examples, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the instruction or data again, it can directly retrieve it from the memory. This avoids repeated accesses, reduces processor 110 latency, and thus improves system efficiency.

[0112] In the present application, the memory may store a computer program configured to cause a controller or processor to implement the device communication method of the present application via an interface or protocol. For example, the computer program stored in the memory may be configured to: establish a Bluetooth connection with another device; detect whether a Bluetooth connection is disconnected; establish a P2P connection with another device after the Bluetooth connection with the other device is disconnected; or connect to another device via a relay server 300; determine the current connection mode between the device and the other device and use the current connection mode to transmit data with the other device; and the like.

[0113] USB interface 130 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. USB interface 130 can be used to connect a charger to charge electronic device 100, transfer data between electronic device 100 and peripheral devices, or connect headphones to play audio.

[0114] The charging management module 140 is used to receive charging input from a charger. The charger can be a wireless charger or a wired charger. While charging the battery 142, the charging management module 140 can also power the electronic device through the power management module 141.

[0115] The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to provide power to the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, and the wireless communication module 160.

[0116] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0117] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.

[0118] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

[0119] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium- or high-frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is passed to the application processor. The application processor outputs sound signals through an audio device (not limited to the speaker 170A, the receiver 170B, etc.) or displays images or videos through the display 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be provided in the same device as the mobile communication module 150 or other functional modules (such as the wireless communication module 160). The modem processor may also be referred to as a modem.

[0120] The wireless communication module 160 can provide wireless communication solutions including WLAN (such as Wi-Fi network, P2P network), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (IR), etc. applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signal, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0121] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150 , and antenna 2 is coupled to wireless communication module 160 , so that electronic device 100 can communicate with the network and other devices through wireless communication technology.

[0122] The electronic device 100 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing that connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering.

[0123] The display screen 194 is used to display images, videos, etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194 , where N is a positive integer greater than 1.

[0124] The electronic device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.

[0125] The ISP is used to process data fed back by the camera 193. For example, when taking a photo, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, which is then transmitted to the ISP for processing and converted into an image visible to the naked eye.

[0126] The camera 193 is used to capture still images or videos. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0127] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0128] The NPU is a neural network (NN) computing processor. Drawing on the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it rapidly processes input information and can continuously self-learn. The NPU can enable intelligent cognitive applications in electronic device 100, such as image recognition, face recognition, speech recognition, and text comprehension.

[0129] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 via the external memory interface 120 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.

[0130] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area can store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0131] The electronic device 100 can implement audio functions such as music playback and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0132] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some examples, the audio module 170 can be set in the processor 110, or some functional modules of the audio module 170 can be set in the processor 110. The speaker 170A, also known as the "speaker", is used to convert audio electrical signals into sound signals. The receiver 170B, also known as the "earpiece", is used to convert audio electrical signals into sound signals. The microphone 170C, also known as the "microphone" or "microphone", is used to convert sound signals into electrical signals. The headphone jack 170D is used to connect wired headphones.

[0133] The sensor module 180 may include a pressure sensor, a gyro sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a gravity sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, and the like.

[0134] Buttons 190 include a power button, a volume button, etc. Motor 191 can generate vibration prompts. Indicator 192 can be an indicator light that can be used to indicate charging status, power changes, messages, missed calls, notifications, etc.

[0135] The SIM card interface 195 is used to connect a SIM card. A SIM card can be connected to and disconnected from the electronic device 100 by inserting or removing it from the SIM card interface 195. The electronic device 100 may support one or N SIM card interfaces, where N is a positive integer greater than 1. The electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communications. In some examples, the electronic device 100 uses an eSIM, or embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.

[0136] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. Taking the system as an example, the software structure of the electronic device 100 is exemplarily described.

[0137] FIG. 2B exemplarily shows a structural diagram of another electronic device 100 .

[0138] The layered architecture divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, The system is divided into four layers: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer. In addition to software, electronic device 100 also includes hardware devices. The hardware devices in electronic device 100 can be divided into hardware layers. Electronic device 100 can use software to drive the hardware devices in the hardware layer to implement corresponding functions.

[0139] The hardware layer may include hardware devices such as a Bluetooth chip and a modem. The Bluetooth chip can be used to send and receive Bluetooth signals. The modem can be used to modulate the transmitted signals and demodulate the received signals. The modem can be described in the embodiment described in FIG. 2A .

[0140] The application layer can include a series of application packages.

[0141] As shown in Figure 2B, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, short message, and social applications. Among them, the Bluetooth application can be used to provide functions for turning Bluetooth on or off, establishing and disconnecting Bluetooth connections with other devices. The social application can be used to provide social communication services (such as sending short messages, making and receiving voice / video calls, content sharing, etc.).

[0142] The application framework layer provides APIs and programming frameworks for applications in the application layer. The application framework layer includes some predefined functions.

[0143] As shown in Figure 2B, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, an activity manager, a Bluetooth service, a wearable device management service, a network management interface, etc.

[0144] The window manager is used to manage window programs. The window manager can obtain the display size, determine whether there is a status bar, lock the screen, take screenshots, etc.

[0145] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0146] The view system includes visual controls, such as those for displaying text and images. The view system is used to build applications. A display interface can consist of one or more views. For example, a display interface containing a text notification icon might include a view for displaying text and a view for displaying images.

[0147] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including answering, hanging up, etc.).

[0148] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0149] The Notification Manager allows applications to display notification information in the status bar (such as the pull-down notification bar). It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the Notification Manager is used to notify the completion of downloads, message reminders, etc. The Notification Manager can also be used to display notifications in the form of icons or scrolling text in the status bar at the top of the system, such as notifications from applications running in the background, or notifications that appear on the screen in the form of dialog windows. For example, text messages can be displayed in the status bar, prompts can be sounded, electronic devices can vibrate, indicator lights can flash, etc.

[0150] The Activity Manager is responsible for managing activities, starting, switching, and scheduling components in the system, as well as managing and scheduling applications. The Activity Manager can be called by upper-level applications to open corresponding activities.

[0151] Android Runtime includes core libraries and a virtual machine. Android Runtime is responsible for scheduling and management of the Android system.

[0152] The Bluetooth service may be used to provide a data transmission interface for applications in the application layer (eg, Bluetooth applications, social applications, etc.), so that the applications can transmit application data to the Bluetooth service.

[0153] The Bluetooth service can also be used to call the Bluetooth chip to establish a Bluetooth connection between the electronic device 100 and other devices (such as the electronic device 200). The Bluetooth service can send application data to the Bluetooth chip so that the application data can be sent to other devices via the Bluetooth connection.

[0154] A network management interface (network socket) can be used to provide modem functionality. A network management interface may also be referred to as a network interface.

[0155] In some embodiments, the Bluetooth service may call the modem through the network management interface to send application data to other devices through the modem.

[0156] In some embodiments, the Bluetooth service can also detect in real time whether the Bluetooth connection between the electronic device 100 and other devices is disconnected. If the Bluetooth connection is disconnected, the Bluetooth service can instruct the mobile communication module or wireless communication module in the electronic device 100 (see the structural diagram of the electronic device 100 shown in Figure 2A) to establish a modem-based communication connection with the other device, for example, a P2P connection, a connection using the relay server 300 as a data transfer station, etc.

[0157] The Bluetooth service can receive application data applied in the application layer. The Bluetooth service can determine the communication connection mode between the electronic device 100 and the target device of the application data. The target device of the above-mentioned application data may refer to the electronic device that needs to receive the application data. If a Bluetooth connection is established between the electronic device 100 and the target device of the application data, the Bluetooth service can transmit the application data to the Bluetooth chip so that the application data can be sent to the target device via the Bluetooth connection. If a connection based on modem communication is established between the electronic device 100 and the target device of the application data, the Bluetooth service can transmit the application data to the modem through the network management interface so that the application data can be sent to the target device using the connection based on modem communication.

[0158] The wearable device management service can be used to provide a data transmission interface for applications in the above-mentioned application layer (for example, social applications, etc.), so that applications can transmit application data to the wearable device management service. The wearable device management service can call the Bluetooth chip to send application data to other devices through the Bluetooth chip. The wearable device management service can also call the modem through the network management interface to send application data to other devices through the modem. Similar to the Bluetooth service, the wearable device management service decides whether the application data from the application in the application layer will be transmitted through the Bluetooth chip or through the modem. For details, please refer to the aforementioned introduction to the Bluetooth service. I will not go into details here. The wearable device management service can also be called the wearable device engine (Wear Engine) and other names.

[0159] The data transmission interfaces provided by Bluetooth service and wearable device management service are different. This allows different applications in the application layer to choose. For example, the data transmission interface provided by Bluetooth service can be The system's native interface can be used by one or more applications that have not updated the data transmission interface. These one or more applications do not need to be adapted and modified for the solution of this application. The data transmission interface provided by the wearable device management service can be different from A new interface for the system's native interface. After one or more applications have adapted to the new interface, they can use it to transmit application data to the wearable device management service.

[0160] In some embodiments, the electronic device 100 may include one of a Bluetooth service and a wearable device management service, or may include both a Bluetooth service and a wearable device management service.

[0161] In some embodiments, the Bluetooth service and the wearable device management service may be included in a service in the application framework layer, for example, Service A. Service A may provide a data transmission interface to applications in the application layer. Applications in the application layer may send application data to Service A based on the data transmission interface provided by Service A. The Bluetooth service may invoke a Bluetooth chip. The wearable device management service may invoke a modem via a network management interface. Optionally, the network management interface and the wearable device management service may be combined into a single module. Service A may determine the communication connection method between the electronic device 100 and the target device for the application data. If a Bluetooth connection is established between the electronic device 100 and the target device for the application data, Service A may transmit the application data to the Bluetooth chip via the Bluetooth service, so that the application data can be sent to the target device via the Bluetooth connection. If a modem-based communication connection is established between the electronic device 100 and the target device for the application data, Service A may transmit the application data to the modem via the wearable device management service and the network management interface, so that the application data can be sent to the target device via the modem-based communication connection.

[0162] In some embodiments, the Bluetooth service may include a wearable device management service, wherein the Bluetooth service calls the modem through the network management interface, which may be completed by the wearable device management service in the Bluetooth service.

[0163] Alternatively, the wearable device management service may include a Bluetooth service. The embodiment of the present application does not limit the relationship between the Bluetooth service and the wearable device management service.

[0164] The core library consists of two parts: one is the function that needs to be called by the Java language, and the other is the Android core library.

[0165] The application layer and application framework layer run in a virtual machine. The virtual machine executes Java files in the application layer and application framework layer as binary files. The virtual machine manages object lifecycles, stack management, thread management, security and exception management, and garbage collection.

[0166] The system library can include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.

[0167] The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.

[0168] The media library supports playback and recording of a variety of common audio and video formats, as well as static image files. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0169] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0170] A 2D graphics engine is a drawing engine for 2D drawings.

[0171] The kernel layer is the layer between hardware and software. The kernel layer includes at least display driver, camera driver, audio driver, and sensor driver.

[0172] The structure shown in FIG2B does not limit the electronic device 100. The electronic device 100 may include more or fewer modules than shown in FIG2B, or combine some modules, or split some modules, or arrange the modules differently.

[0173] The electronic device 100 shown in FIG2A and FIG2B may be a mobile phone, a tablet computer, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), etc. The embodiment of the present application does not limit the specific type of the electronic device 100.

[0174] FIG. 3A exemplarily shows a schematic structural diagram of an electronic device 200 .

[0175] As shown in FIG3A , the electronic device 200 may include a wireless communication module 210 , an application processor 220 , a memory 230 , a sensor 240 , a micro-controller unit (MCU) 250 , a display screen 260 , etc. These components may be coupled via a bus.

[0176] The application processor 220 may also be referred to as a main processor. The application processor 220 may be a processor with powerful processing capabilities and rich storage and peripheral resources. For example, the application processor 220 may be a system on a chip (SOC) that integrates multiple processors.

[0177] The application processor 220 may include one or more interfaces, such as an inter-integrated circuit (I2C) interface, an inter-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 and output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.

[0178] The application processor 220 may also be connected to the memory 230. The memory 230 may include a program storage area and a user data storage area. The program storage area may store an operating system and one or more application programs (such as a camera application and a phone application), and the data storage area may store data (such as photos and contacts) created by the user while using the electronic device 200. The memory 230 may be a high-speed random access memory or a non-volatile memory such as a disk, flash memory, or universal flash storage (UFS). The memory 230 may also be an external memory card such as a Micro SD card.

[0179] MCU250 may include a reduced-size central processing unit (CPU), necessary memory and peripherals, such as read-only memory (ROM), random access memory (RAM), pseudo static read access memory (PSRAM), general-purpose input and output (GPIO) interfaces, serial ports, timers, etc. MCU250 may also be connected to memory 230 to store applications running on MCU250 and user data. MCU250 may be used as a coprocessor for application processor 220 to assist application processor 220 in completing processing tasks that it is unable to perform or performs inefficiently, such as signal transmission between devices, management of connected devices, Bluetooth communication management, audio processing, etc., thereby reducing the burden on application processor 220, reducing power consumption, and improving device battery life.

[0180] For example, when electronic device 200 is in low-power mode, application processor 220 enters sleep mode to save power. At this time, MCU 250 can monitor whether a touch signal is received from a touch-sensitive sensor provided on display screen 260. This touch signal may be generated by a user's touch operation. If a touch signal is received, MCU 250 can wake up application processor 220 and illuminate display screen 260.

[0181] The application processor 220 and MCU250 can run different tasks relatively independently, and can be isolated from each other and run different operating systems or bare metal programs. For example, the application processor 220 runs a Linux operating system, while the MCU250 runs a lightweight operating system such as a real-time operating system (RTOS). The two can communicate through a bus, shared memory, etc. In some embodiments, although the application processor 220 and MCU250 run different systems, the application processor 220 can serve as the main core to control the normal operation of the entire device. For example, the Linux operating system running on the application processor 220 can be loaded with an MCU driver to control the operation of the MCU250.

[0182] The electronic device 200 can implement complex displays through the application processor 220 and the display screen 260, such as real-time refresh of the game application interface, preview display of the camera application, and interface updates following user touch operations. The electronic device 200 can also implement simple displays through the MCU 250 and the display screen 260, such as only displaying the current time in low-power mode. The display screen 260 can be used to display images, videos, etc. The display screen 260 can be a liquid crystal display (LCD), an organic light-emitting diode (OLED) display, an active-matrix organic light-emitting diode or active-matrix organic light-emitting diode (AMOLED) display, a flexible light-emitting diode (FLED) display, a quantum dot light-emitting diode (QLED) display, etc.

[0183] The wireless communication module 210 may include a 2G / 3G / 4G / 5G mobile communication module, a Wi-Fi communication module, a P2P communication module, a Bluetooth communication module, a GNSS communication module, an FM communication module, an NFC communication module, an IR communication module, and the like. The wireless communication module 210 may also be a communication device integrating multiple communication processing modules. The wireless communication module 210 receives electromagnetic waves via an antenna, frequency-modulates and filters the electromagnetic wave signals, and transmits the processed signals to the application processor 220 or the MCU 250. The wireless communication module 210 may also receive signals to be transmitted from the application processor 220 or the MCU 250, frequency-modulate them, amplify them, and convert them into electromagnetic waves for radiation via the antenna.

[0184] The received signals from the 2G / 3G / 4G / 5G mobile communication module, Wi-Fi communication module, and P2P communication module are demodulated into low-frequency baseband signals by a modem and then transmitted to the baseband processor for processing. After processing by the baseband processor, the low-frequency baseband signals are passed to the application processor 220. The application processor 220 outputs sound through an audio device (not limited to a speaker or receiver) or displays images or videos on a display screen. The signals to be transmitted from the 2G / 3G / 4G / 5G mobile communication module, Wi-Fi communication module, and P2P communication module are also modulated into medium- and high-frequency signals by a modem before being transmitted through an antenna.

[0185] The sensor 240 may include a gyro sensor, an acceleration sensor, a pressure sensor, a proximity light sensor, an ambient light sensor, a temperature sensor, a distance sensor, a touch-sensitive sensor provided on the display screen 260 , and the like.

[0186] The structure shown in FIG3A does not limit the electronic device 200. The electronic device 200 may include more or fewer components than those shown in FIG3A, or may combine or separate certain components, or may have different component arrangements. The components shown in FIG3A may be implemented in hardware, software, or a combination of software and hardware.

[0187] For example, the electronic device 200 is not limited to the dual processors shown in FIG3A . Alternatively, one of the processors in the electronic device 200 may be a dual-core processor. For example, this processor may include two processing units. One of these two processing units may serve as a main processing unit, while the other may serve as a co-processing unit. When the electronic device 200 is in low power consumption mode, the main processing unit in the electronic device 200 may be in a dormant state to conserve power.

[0188] The software system of the electronic device 200 can adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. Taking the system as an example, the software structure of the electronic device 200 is exemplified.

[0189] FIG3B exemplarily shows a structural diagram of another electronic device 200 .

[0190] The layered architecture divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, The system is divided into four layers, from top to bottom: application layer, application framework layer, Android runtime (Android Runtime) and system library, and kernel layer.

[0191] The electronic device 200 includes two processors: an application processor (AP) and a microcontroller (MCU). As shown in the structure of FIG3A , the AP and MCU can be isolated from each other and can both independently run operating systems. Based on the above layered architecture, the operating system running on the AP may include an application layer, an application framework layer, an Android runtime and system libraries, and a kernel layer. The operating system running on the MCU may also include an application layer, an application framework layer, an Android runtime and system libraries, and a kernel layer.

[0192] For the various layers of the operating system running on the AP, reference may be made to the introduction of FIG. 2B .

[0193] The MCU serves as a coprocessor of the AP, and the contents of each layer of the operating system running on the MCU can be less than that of the AP.

[0194] Exemplarily, the application layer in the MCU may include fewer applications than the application layer in the AP. For example, the application layer of the MCU may include applications such as gallery, calendar, map, WLAN, short message, Bluetooth application, social application, etc., but does not include applications such as camera, music, call, navigation, etc. The application framework layer in the MCU may include fewer modules than the application framework layer in the AP. For example, the application framework layer of the MCU may include window manager, content provider, resource manager, activity manager, view system, Bluetooth service, wearable device management service, network management interface, but does not include phone manager. The system library in the MCU may include fewer modules than the system library in the AP. For example, the system library of the MCU may include surface manager, two-dimensional graphics engine, media library, but does not include three-dimensional graphics processing library. The kernel layer in the MCU may include fewer modules than the kernel layer in the AP. For example, the kernel layer of the MCU may include display driver, sensor driver, audio driver, but does not include camera driver.

[0195] The above contents of the MCU are merely exemplary descriptions of the present application and should not be construed as limiting the present application. The operating system running on the MCU may also include more or less contents.

[0196] In some embodiments, one or more applications in electronic device 200 may run only on the AP, only on the MCU, or both. That is, the AP's application layer may include applications not found in the MCU's application layer. The MCU's application layer may also include applications not found in the AP's application layer. The AP's application layer and the MCU's application layer may also include one or more identical applications.

[0197] The contents of the operating system running on the MCU can also be referred to the introduction of FIG2B , which will not be described in detail here.

[0198] In addition to the software programs in the AP and MCU described above, electronic device 200 also includes hardware devices. The hardware devices in electronic device 200 can be divided into hardware layers. In electronic device 200, the AP can drive the hardware devices in the hardware layer through the software programs running on the AP, and the MCU can drive the hardware devices in the hardware layer through the software programs running on the MCU.

[0199] The hardware layer may include hardware devices such as a Bluetooth chip and a modem. The Bluetooth chip can be used to send and receive Bluetooth signals. The modem can be used to modulate the transmitted signals and demodulate the received signals. The modem can be described in the embodiment described in FIG. 2A .

[0200] The structure shown in FIG3B does not constitute a limitation on the electronic device 200 . The electronic device 200 may include more or fewer modules than those shown in FIG3B , or may combine certain modules, or separate certain modules, or arrange the modules differently.

[0201] In some embodiments, the application layer of the AP and the application layer of the MCU can communicate. For example, when the electronic device 200 is in low power mode, the AP in the electronic device 200 is in a dormant state. At this time, the electronic device 200 receives data sent by the electronic device 100, and the MCU in the electronic device 200 can first process the received data and then decide whether to wake up the AP. If the data is transmitted via a Bluetooth connection, the Bluetooth chip in the hardware layer of the electronic device 200 can receive the data and send the data to the Bluetooth service or wearable device management service in the application framework layer of the MCU. If the data is transmitted by a connection based on modem communication, the modem in the hardware layer of the electronic device 200 can receive the data and send the data to the Bluetooth service or wearable device management service through the network management interface in the MCU. Furthermore, the Bluetooth service or wearable device management service in the MCU can transmit the data to the corresponding application in the application layer.

[0202] Among them, the MCU can determine whether it can independently process the above-mentioned data from the electronic device 100. If the MCU cannot process the data independently, the MCU can wake up the AP and hand over the data to the AP for processing. For example, the above-mentioned data from the electronic device 100 is a message of a social application. After receiving the message, the electronic device 200 needs to light up the screen to display the message notification. Then, when the above-mentioned message is transmitted to the application framework layer of the MCU via the hardware layer, and then to the social application of the application layer in the MCU, the social application in the MCU can send the message to the social application in the AP. After the AP is awakened, the social application in the AP can call the corresponding modules of the application framework layer, system library, and kernel layer in the AP according to the message to light up the screen of the electronic device 200 to display the message notification of the social application.

[0203] In some embodiments, the application framework layer of the AP can communicate with the application framework layer of the MCU. When the electronic device 200 receives data from the electronic device 100 in sleep mode, the MCU in the electronic device 200 can determine whether it can process the data independently. If the MCU cannot process the data independently, the MCU can wake up the AP and hand over the data to the AP for processing. For example, when the above data is transmitted to the application framework layer of the MCU via the hardware layer, the Bluetooth service or wearable device management service of the MCU can send the data to the application framework layer in the AP (such as the Bluetooth service or wearable device management service in the AP). After the AP is awakened, the application framework layer in the AP can transmit the data to the corresponding application in the application layer of the AP.

[0204] In some embodiments, when a Bluetooth connection is established between the electronic device 100 and the electronic device 200, and the electronic device 200 is in sleep mode, the MCU in the electronic device 200 can detect in real time whether the Bluetooth connection is disconnected. When it is detected that the Bluetooth connection is disconnected, the MCU in the electronic device 200 can establish a P2P connection with the electronic device 100 or establish a data transmission channel with the relay server 300 to achieve a communication connection between the electronic device 200 and the electronic device 100. Alternatively, when it is detected that the Bluetooth connection is disconnected, the MCU in the electronic device 200 can wake up the AP, and the electronic device 200 can use the AP to establish a P2P connection with the electronic device 100 or establish a data transmission channel with the relay server 300 to achieve a communication connection between the electronic device 200 and the electronic device 100.

[0205] Among them, if the MCU in the electronic device 200 can run the corresponding program, so that the electronic device 200 establishes a P2P connection with the electronic device 100 or establishes a data transmission channel with the relay server 300, the Bluetooth service or wearable device management service in the MCU can send a Bluetooth connection disconnection message to the application layer application in the MCU (such as Bluetooth application, social application), and call the modem through the network management interface in the MCU to establish a P2P connection with the electronic device 100 or establish a data transmission channel with the relay server 300.

[0206] If the MCU in the electronic device 200 needs to wake up the AP, the AP runs the corresponding program to enable the electronic device 200 to establish a P2P connection with the electronic device 100 or a data transmission channel with the relay server 300. The Bluetooth service (or wearable device management service) in the MCU can send a Bluetooth connection disconnection message to the Bluetooth service (or wearable device management service) in the AP. The Bluetooth service (or wearable device management service) in the AP can send a Bluetooth connection disconnection message to the application in the application layer of the AP and call the modem through the network management interface in the AP to establish a P2P connection with the electronic device 100 or a data transmission channel with the relay server 300.

[0207] The above-mentioned communication between the AP and the application layer in the MCU and the communication between the application framework layers are merely exemplary descriptions of the present application and should not constitute a limitation to the present application.

[0208] The electronic device 200 shown in FIG3A and FIG3B can be a wearable device such as a smart watch or a smart bracelet, an Internet of Things (IoT) device, etc. The embodiment of the present application does not limit the specific type of the electronic device 200.

[0209] FIG4 exemplarily shows a schematic structural diagram of the relay server 300 .

[0210] As shown in FIG4 , the relay server 300 may include: one or more processors 310, a memory 311, a communication interface 312, a transmitter 314, a receiver 315, a coupler 316, and an antenna 317. These components may be connected via a bus 313 or other means. FIG4 illustrates the example of a bus connection.

[0211] The communication interface 312 can be used for the relay server 300 to communicate with other electronic devices, such as the electronic device 100 and the electronic device 200 shown in Figure 1. Specifically, the communication interface 312 can be a 3G communication interface, a long-term evolution (LTE) (4G) communication interface, a 5G communication interface, a WLAN communication interface, a WAN communication interface, etc. Not limited to a wireless communication interface, the relay server 300 can also be configured with a wired communication interface 312 to support wired communication.

[0212] In some embodiments of the present application, the transmitter 314 and the receiver 315 can be regarded as a wireless modem. The transmitter 314 can be used to transmit and process the signal output by the processor 310. The receiver 315 can be used to receive signals. In the relay server 300, the number of transmitters 314 and receivers 315 can be one or more. The antenna 317 can be used to convert electromagnetic energy in the transmission line into electromagnetic waves in free space, or to convert electromagnetic waves in free space into electromagnetic energy in the transmission line. The coupler 316 can be used to divide the mobile communication signal into multiple paths and distribute them to multiple receivers 315. It can be understood that the antenna 317 of the relay server 300 can be implemented as a large-scale antenna array.

[0213] Memory 311 is coupled to processor 310 and is used to store various software programs and / or multiple sets of instructions. Specifically, memory 311 may include high-speed random access memory and may also include non-volatile memory, such as one or more disk storage devices, flash memory devices, or other non-volatile solid-state storage devices.

[0214] The memory 311 can store an operating system (hereinafter referred to as system), for example The memory 311 may also store a network communication program, which can be used to communicate with one or more electronic devices (such as the electronic device 100).

[0215] In an embodiment of the present application, the memory 311 can be used to store device information (such as device account information, device identification, etc.) of the electronic device that requests security authentication (such as device authentication, channel authentication) from the relay server 300, and the address (such as IP address) of the electronic device that requests the relay server 300 to establish a P2P connection with other devices.

[0216] Optionally, when the relay server 300 acts as a data transfer station to transmit data between the electronic device 100 and the electronic device 200, the memory 311 may store data that the electronic device 100 wants to send to the electronic device 200, and data that the electronic device 200 wants to send to the electronic device 100.

[0217] In the embodiments of the present application, the processor 310 may be configured to read and execute computer-readable instructions. Specifically, the processor 310 may be configured to call a program stored in the memory 311 and execute the instructions contained in the program. The program may be, for example, a program for implementing device authentication, channel authentication, address exchange, data transfer, or the like, as provided in one or more embodiments of the present application.

[0218] It should be noted that the relay server 300 shown in FIG4 is only one implementation of the embodiment of the present application. In actual applications, the relay server 300 may also include more or fewer components, which is not limited here.

[0219] FIG5 exemplarily shows a schematic diagram of a communication system provided by the present application.

[0220] As shown in FIG. 5 , the communication system may include an electronic device 100 , an electronic device 200 , and a relay server 300 .

[0221] The relay server 300 may include a security authentication module, an address exchange module, and a data forwarding module. The security authentication module may be used to provide a security authentication function. The address exchange module may be used to provide an address exchange function. The data forwarding function may be used to provide a data forwarding function. The security authentication, address exchange, and data forwarding functions described above can be found in the description of the preceding embodiments and will not be further elaborated here.

[0222] Electronic device 100 may include an application, a Bluetooth service, a network management interface, a Bluetooth chip, and a modem. Electronic device 200 may also include an application, a Bluetooth service, a network management interface, a Bluetooth chip, and a modem. For details, please refer to the description of Figures 2B and 3B above.

[0223] In some embodiments, the application in the electronic device 200 shown in Figure 5 can be an application on the AP, or can be an application on the MCU. The Bluetooth service and network management interface in the electronic device 200 shown in Figure 5 can belong to the application framework layer in the AP, or can belong to the application framework layer in the MCU.

[0224] In some embodiments, when the distance between the electronic device 100 and the electronic device 200 is within the Bluetooth transmission range, the electronic device 100 and the electronic device 200 can establish a Bluetooth connection. When the electronic device 100 and the electronic device 200 have established a Bluetooth connection, the application in the electronic device 100 can send application data to the Bluetooth service. The Bluetooth service in the electronic device 100 can send the application data to the Bluetooth chip. The Bluetooth chip in the electronic device 100 can send the application data to the electronic device 200 via the Bluetooth connection. The Bluetooth chip in the electronic device 200 can receive the above-mentioned application data from the electronic device 100 and send the application data to the Bluetooth service. The Bluetooth service in the electronic device 200 can send the application data to the corresponding application.

[0225] When the Bluetooth connection between the electronic device 100 and the electronic device 200 is disconnected, and a P2P connection is established between the electronic device 100 and the electronic device 200, the electronic device 100 and the electronic device 200 can transmit data through the P2P connection. Among them, the application in the electronic device 100 can still send application data to the Bluetooth service. The Bluetooth service in the electronic device 100 can send the application data to the modem through the network management interface. The modem in the electronic device 100 can modulate the application data and send the modulated application data to the electronic device 200 through the P2P connection. The modem in the electronic device 200 can receive the above-mentioned application data from the electronic device 100, demodulate the application data, and send the demodulated application data to the Bluetooth service through the network management interface. Then, the Bluetooth service in the electronic device 200 can send the application data to the corresponding application.

[0226] When the Bluetooth connection between electronic device 100 and electronic device 200 is disconnected, and a data transmission channel is established between electronic device 100 and relay server 300, and electronic device 200 and relay server 300, the two electronic devices 100 and 200 can transmit data through relay server 300. After the Bluetooth service in electronic device 100 receives the application data of the application, it can send the application data to the modem via the network management interface. The modem in electronic device 100 can send the application data to relay server 300 via the data transmission channel between electronic device 100 and relay server 300. The data forwarding module in relay server 300 can send the application data from electronic device 100 to electronic device 200 via the data transmission channel between electronic device 200 and relay server 300. The modem in electronic device 200 can receive the application data forwarded via relay server 300 and send the application data to the Bluetooth service via the network management interface. The Bluetooth service in electronic device 200 can then send the application data to the corresponding application.

[0227] Similarly, when the electronic device 200 needs to send data to the electronic device 100, the electronic device 200 can send the data to the electronic device 100 via Bluetooth connection, P2P connection, or relay server 300. The specific process can refer to the process of the electronic device 100 sending data to the electronic device 200.

[0228] FIG6 exemplarily shows a schematic diagram of another communication system provided by the present application.

[0229] As shown in Figure 6, the communication system may include an electronic device 100, an electronic device 200, and a relay server 300. The electronic device 100, the electronic device 200, and the relay server 300 may all refer to the introduction of Figure 5 above. Different from Figure 5, the electronic device 100 and the electronic device 200 include a wearable device management service. The electronic device 100 can use the wearable device management service to send the application data of the application to the electronic device 200 via the Bluetooth chip or modem. The electronic device 200 can also use the wearable device management service to send the application data of the application to the electronic device 100 via the Bluetooth chip or modem. The specific data transmission process can refer to the process of data transmission based on the Bluetooth service in Figure 5 above. It will not be repeated here.

[0230] In some embodiments, the application in the electronic device 200 shown in FIG6 can be an application on the AP or an application on the MCU. The wearable device management service and network management interface in the electronic device 200 shown in FIG6 can belong to the application framework layer in the AP or the application framework layer in the MCU.

[0231] In some embodiments, the data transmission interface provided by the Bluetooth service to the application program may be an operating system (eg, The application does not need to be modified to adapt to the solution of this application. The data transmission interface provided by the wearable device management service to the application can be a new interface that is different from the above-mentioned native interface. After adapting to the above-mentioned new interface, the application can transmit the application data to the wearable device management service, and then the wearable device management service will send the application data to other devices.

[0232] As can be seen from the communication systems shown in Figures 5 and 6 above, upper-layer applications in electronic devices 100 and 200 can be aware of the actual data transmission method without the application being aware of the application. After the application sends the application data to the Bluetooth service or wearable device management service, the Bluetooth service or wearable device management service can determine the application data transmission method based on the current connection method between electronic devices 100 and 200.

[0233] It should be noted that the processing of application data by the Bluetooth service or wearable device management service shown in Figures 5 and 6, the processing of application data by the Bluetooth chip, and the processing of application data by the modem are not limited to the processing of application data by the Bluetooth service or wearable device management service shown in Figures 5 and 6. In the process of transmitting application data from the application in the electronic device 100 to the application in the electronic device 200 (or from the application in the electronic device 200 to the application in the electronic device 100), the application data can also undergo more processing.

[0234] FIG7 exemplarily shows a flow chart of a device communication method provided in the present application.

[0235] As shown in FIG. 7 , the method may include steps S711 to S718 .

[0236] S711 : The electronic device 100 establishes a Bluetooth connection with the electronic device 200 .

[0237] S712: Detect whether the Bluetooth connection between the electronic device 100 and the electronic device 200 is disconnected.

[0238] In some embodiments, when the electronic device 100 and the electronic device 200 have established a Bluetooth connection, in order to maintain the Bluetooth connection, the electronic device 100 and the electronic device 200 may send Bluetooth heartbeat packets to each other at intervals. The Bluetooth heartbeat packet can be used to maintain the validity of the Bluetooth connection. When the electronic device 100 does not receive the Bluetooth heartbeat packet from the electronic device 200 within a preset time period, the electronic device 100 may determine that the Bluetooth connection between the electronic device 100 and the electronic device 200 is disconnected. When the electronic device 200 does not receive the Bluetooth heartbeat packet from the electronic device 100 within a preset time period, the electronic device 200 may determine that the Bluetooth connection between the electronic device 100 and the electronic device 200 is disconnected.

[0239] In addition to detecting whether the Bluetooth connection is disconnected by using the Bluetooth heartbeat packet, the electronic device 100 and the electronic device 200 may also detect whether the Bluetooth connection is disconnected by using other methods, which are not limited in the present embodiment.

[0240] S713 : The electronic device 100 and the electronic device 200 transmit data via the Bluetooth connection.

[0241] If a Bluetooth connection is maintained between the electronic device 100 and the electronic device 200 (ie, the Bluetooth connection is not disconnected), the electronic device 100 can send data to the electronic device 200 via the Bluetooth connection, and the electronic device 200 can also send data to the electronic device 100 via the Bluetooth connection.

[0242] S714 : The electronic device 100 establishes a P2P connection with the electronic device 200 .

[0243] If the Bluetooth connection between the electronic device 100 and the electronic device 200 is disconnected, the electronic device 100 and the electronic device 200 may try to establish a P2P connection.

[0244] In some embodiments, the electronic device 100 and the electronic device 200 can establish a P2P connection with the help of the relay server 300. The process of establishing a P2P connection between the electronic device 100 and the electronic device 200 will be described in detail in subsequent embodiments.

[0245] S715 : Detect whether the electronic device 100 and the electronic device 200 have successfully established a P2P connection.

[0246] In some embodiments, the network environments in which electronic device 100 and electronic device 200 are located both support P2P connections. Electronic device 100 and electronic device 200 can successfully establish a P2P connection. If the network environments in which either or both of electronic device 100 and electronic device 200 are located do not support P2P connections, electronic device 100 and electronic device 200 cannot successfully establish a P2P connection. For example, if the network address translation (NAT) gateway of electronic device 200 does not support the P2P protocol, electronic device 200 cannot establish a P2P connection with other devices.

[0247] Therefore, the electronic device 100 and / or the electronic device 200 may detect whether the P2P connection between the electronic device 100 and the electronic device 200 is successfully established.

[0248] S716 : The electronic device 100 and the electronic device 200 transmit data via a P2P connection.

[0249] If the electronic device 100 and the electronic device 200 successfully establish a P2P connection, the electronic device 100 can send data to the electronic device 200 through the P2P connection, and the electronic device 200 can also send data to the electronic device 100 through the P2P connection.

[0250] S717 . The electronic device 100 establishes a data transmission channel with the relay server 300 , and the electronic device 200 establishes a data transmission channel with the relay server 300 .

[0251] If the electronic device 100 and the electronic device 200 fail to successfully establish a P2P connection, the electronic device 100 may establish a data transmission channel with the relay server 300, and the electronic device 200 may establish a data transmission channel with the relay server 300. The data transmission channel between the electronic device 100 and the relay server 300 may be used for the electronic device 100 and the relay server 300 to transmit application data. The data transmission channel between the electronic device 200 and the relay server 300 may be used for the electronic device 200 and the relay server 300 to transmit application data. For example, the above-mentioned application data may include, but is not limited to: application data of social applications (such as messages from contacts), application data of audio and video applications (such as audio fluctuation data, video fluctuation data), etc.

[0252] S718 , the electronic device 100 and the electronic device 200 transmit data through the relay server 300 .

[0253] When a data transmission channel is established between the electronic device 100 and the relay server 300 , and a data transmission channel is established between the electronic device 200 and the relay server 300 , the electronic device 100 and the electronic device 200 may transmit data through the relay server 300 .

[0254] The above steps S714 to S715 are optional. In some embodiments, when the Bluetooth connection between the electronic device 100 and the electronic device 200 is disconnected, the electronic device 100 and the electronic device 200 may directly execute step S717.

[0255] FIG8 exemplarily shows a flow chart of a device communication method provided in the present application.

[0256] As shown in FIG. 8 , the method may include steps S811 to S815 .

[0257] S811: The first device detects that there is first data in the first application to be sent to the second device.

[0258] S812: The first device determines a data transmission mode between the first device and the second device.

[0259] The first device may have a first application installed therein. When detecting first data in the first application to be sent to the second device, the first device may determine a data transmission method between the first device and the second device.

[0260] If a Bluetooth connection is established between the first device and the second device, the data transmission method between the first device and the second device is a method of transmitting data via the Bluetooth connection. The electronic device 100 may execute the following step S813.

[0261] If a P2P connection is established between the first device and the second device, the data transmission method between the first device and the second device is a method of transmitting data via the P2P connection. The electronic device 100 may execute the following step S814.

[0262] If a data transmission channel is established between the first device and the relay server 300, the data transmission mode between the first device and the second device is a mode of transmitting data through the relay server 300. The electronic device 100 may perform the following step S815.

[0263] S813. The first device sends the first data to the second device based on the Bluetooth connection.

[0264] S814: The first device sends first data to the second device based on the P2P connection.

[0265] S815. The first device sends the first data to the relay server 300, and the relay server 300 sends the first data to the second device.

[0266] In some embodiments, the first device may be the electronic device 100 (such as a mobile phone) shown in FIG. 1 above. The second device may be the electronic device 200 (such as a watch or a bracelet) shown in FIG. 1 above. The above-mentioned first data may be obtained by the first device from the application server of the first application. For example, the first application is a social application. The first data may include messages sent to the social account by contacts of the social account logged in to the first application on the first device. For another example, the first application is an audio and video application. The first data may include audio playback data and / or video playback data.

[0267] In some embodiments, the first device may be the electronic device 200 shown in FIG. 1 . The second device may be the electronic device 100 shown in FIG. 1 . The first data may be determined by the first device based on user input. For example, the first application may be a social application. The first data may include a message entered by the user on the first device to be sent to a contact. For another example, the first application may be an audio or video application. The first data may include an audio switching instruction determined based on the user's operation of switching audio on the first device.

[0268] The first device may include the Bluetooth service and / or the wearable device management service shown in Figure 2B. Steps S811 and S812 may be performed by the Bluetooth service or the wearable device management service in the first device.

[0269] As can be seen from the methods shown in Figures 7 and 8 above, if the Bluetooth connection between the electronic device 100 and the electronic device 200 is disconnected, the electronic device 100 and the electronic device 200 can also establish a communication connection based on modem data transmission. For example, a P2P connection, a communication connection with the relay server 300 as a data transfer station. The above-mentioned communication connection based on modem data transmission may not be limited by the distance between the electronic device 100 and the electronic device 200. Regardless of whether the electronic device 100 and the electronic device 200 are close or far away, the electronic device 200 can communicate with the electronic device 100 so as to provide one or more services to the user with the assistance of the electronic device 100. For example, when a user only carries the electronic device 200 out, the user can still check the message notifications of the social application in time through the electronic device 200 and reply to the messages. This can enhance the user experience of using the electronic device 200.

[0270] The following describes the process of establishing a communication connection based on modem data transmission in this application.

[0271] FIG9 exemplarily shows a flow chart of a method for establishing a communication connection based on modem data transmission provided by the present application.

[0272] As shown in Figure 9, the communication connection based on modem data transmission can be a P2P connection. The method for establishing the connection may include three stages:

[0273] Phase 1: Device Authentication (S911-S915)

[0274] S911 : The electronic device 100 requests the relay server 300 for device authentication.

[0275] S912 : The electronic device 200 requests the relay server 300 for device authentication.

[0276] In some embodiments, when the electronic device 100 detects that the Bluetooth connection between the electronic device 100 and the electronic device 200 is disconnected (e.g., no Bluetooth heartbeat packet is received from the electronic device 200 within a preset time period), the electronic device 100 may request device authentication from the relay server 300. The device authentication request of the electronic device 100 may include device information of the electronic device 100, for example, device account information of the electronic device 100.

[0277] When the electronic device 200 detects that the Bluetooth connection between the electronic device 100 and the electronic device 200 is disconnected (for example, no Bluetooth heartbeat packet from the electronic device 100 is received within a preset time period), the electronic device 200 may request device authentication from the relay server 300. The device authentication request of the electronic device 200 may include device information of the electronic device 200, for example, device account information of the electronic device 200.

[0278] In addition to the device account information, the device authentication request of the electronic device 100 and the electronic device 200 may also include other information, which is not limited in the embodiment of the present application.

[0279] S913 : The relay server 300 detects that the electronic device 100 and the electronic device 200 are associated devices.

[0280] In some embodiments, upon receiving a device authentication request from electronic device 100, relay server 300 may store the device information of electronic device 100. Upon receiving a device authentication request from electronic device 200, relay server 300 may store the device information of electronic device 200. Based on the device information of electronic device 100 and electronic device 200, relay server 300 may detect whether electronic device 100 and electronic device 200 are associated devices. For example, upon detecting that the device accounts of electronic device 100 and electronic device 200 are the same, relay server 300 may determine that electronic device 100 and electronic device 200 are associated devices.

[0281] When the electronic device 100 and the electronic device 200 are associated devices, the relay server 300 may generate a device identifier for the electronic device 100 and a device identifier for the electronic device 200. The device identifier of the electronic device 100 may be used by the relay server 300 to identify the electronic device 100. The device identifier of the electronic device 100 may be a first device identifier. The device identifier of the electronic device 200 may be used by the relay server 300 to identify the electronic device 200. The device identifier of the electronic device 200 may be a second device identifier.

[0282] S914 : The relay server 300 sends a message to the electronic device 100 indicating that the device authentication has been passed.

[0283] S915 : The relay server 300 sends a message to the electronic device 200 indicating that the device authentication has been passed.

[0284] When the electronic device 100 and the electronic device 200 are associated devices, the relay server 300 may send device authentication success messages to the electronic device 100 and the electronic device 200, respectively. The device authentication success message sent by the relay server 300 to the electronic device 100 may include the device identifier (e.g., first device identifier) ​​of the electronic device 100. The device authentication success message sent by the relay server 300 to the electronic device 200 may also include the device identifier (e.g., second device identifier) ​​of the electronic device 200.

[0285] In some embodiments, the device authentication request sent by the electronic device 100 in step S911 may include one or more pieces of device information of the electronic device 200. Thus, based on the device authentication request of the electronic device 100, the relay server 300 may search for the electronic device 200 to detect whether the electronic device 200 is an associated device of the electronic device 100. Optionally, the device authentication request sent by the electronic device 200 in step S912 may include one or more pieces of device information of the electronic device 100. Thus, based on the device authentication request of the electronic device 200, the relay server 300 may search for the electronic device 100 to detect whether the electronic device 100 is an associated device of the electronic device 200.

[0286] As can be seen, the above device authentication can be used to verify whether electronic device 100 and electronic device 200 are associated. If electronic device 100 and electronic device 200 are associated (i.e., electronic device 100 and electronic device 200 are associated devices), device authentication for both electronic device 100 and electronic device 200 is successful. This device authentication ensures that the other device is the intended device when two devices establish a communication connection based on modem data transmission. This improves the security of application data transmission.

[0287] Phase 2: Channel Authentication (S916-S920)

[0288] S916 : The electronic device 100 requests the relay server 300 for channel authentication.

[0289] After the electronic device 100 receives the message indicating that the device authentication has passed, the electronic device 100 may request channel authentication from the relay server 300. In some embodiments, the channel authentication request of the electronic device 100 may include a device identification of the electronic device 100.

[0290] Among them, if the electronic device 100 has the ability to switch between Bluetooth data transmission and data transmission by modem, the electronic device 100 can send a channel authentication request to the relay server 300. Specifically, the above-mentioned channel authentication request can be initiated by the Bluetooth service or wearable device management service in the electronic device 100. Referring to Figure 5 or Figure 6 above, if the Bluetooth service or wearable device management service in the electronic device 100 can call the Bluetooth chip and call the modem through the network management interface, then the Bluetooth service or wearable device management service in the electronic device 100 can call the modem through the network management interface and send the above-mentioned channel authentication request to the relay server 300.

[0291] Therefore, the relay server 300 can verify whether the electronic device 100 has the ability to switch between Bluetooth data transmission and modem data transmission according to whether the electronic device 100 sends the above-mentioned channel authentication request.

[0292] S917 : The electronic device 200 requests the relay server 300 for channel authentication.

[0293] After the electronic device 200 receives the message indicating that the device authentication is passed, the electronic device 200 may request channel authentication from the relay server 300. In some embodiments, the channel authentication request of the electronic device 200 may include a device identification of the electronic device 200.

[0294] Among them, if the electronic device 200 has the ability to switch between Bluetooth data transmission and data transmission by modem, the electronic device 200 can send a channel authentication request to the relay server 300. Specifically, the above-mentioned channel authentication request can be initiated by the Bluetooth service or wearable device management service in the electronic device 200. Referring to Figure 5 or Figure 6 above, if the Bluetooth service or wearable device management service in the electronic device 200 can call the Bluetooth chip and call the modem through the network management interface, then the Bluetooth service or wearable device management service in the electronic device 200 can call the modem through the network management interface and send the above-mentioned channel authentication request to the relay server 300.

[0295] Therefore, the relay server 300 can verify whether the electronic device 200 has the ability to switch between Bluetooth data transmission and modem data transmission according to whether the electronic device 200 sends the above-mentioned channel authentication request.

[0296] S918 : The relay server 300 determines that the channel authentication between the electronic device 100 and the electronic device 200 is successful, and generates a channel identifier.

[0297] As can be seen from steps S916 and S917, the electronic device 100 sending the channel authentication request may indicate that the electronic device 100 has the ability to switch between Bluetooth data transmission and modem data transmission. The electronic device 200 sending the channel authentication request may indicate that the electronic device 200 has the ability to switch between Bluetooth data transmission and modem data transmission.

[0298] Therefore, upon receiving a channel authentication request from the electronic device 100, the relay server 300 can determine that the channel authentication of the electronic device 100 has been passed, and then generate a channel identifier corresponding to the electronic device 100, for example, a first channel identifier. In some embodiments, the first channel identifier can be used to establish a signaling link, for example, a first signaling link, between the electronic device 100 and the relay server 300. The first signaling link can be used for signaling transmission between the electronic device 100 and the relay server 300. Signaling can refer to control instructions in a communication system. In addition to transmitting user information (such as device information, application data, etc.), it is a control signal required to ensure the orderly operation of the communication network to ensure normal communication. Signaling is different from user information. User information is transmitted directly from the sender to the receiver through the communication network, while signaling generally needs to be transmitted between different links in the communication network (such as base stations, mobile stations, and mobile control switching centers). Each link performs analysis and processing, and through interaction, a series of operations and controls are formed. Signaling can be used to ensure the effective and reliable transmission of user information. In other words, signaling can be regarded as the control system of the entire communication network.

[0299] Upon receiving the channel authentication request from the electronic device 200, the relay server 300 may determine that the channel authentication of the electronic device 200 has been passed, and then generate a channel identifier corresponding to the electronic device 200, for example, a second channel identifier. In some embodiments, the second channel identifier may be used to establish a signaling link, for example, a second signaling link, between the electronic device 200 and the relay server 300. The second signaling link may be used for signaling transmission between the electronic device 200 and the relay server 300.

[0300] S919 : The relay server 300 sends a channel identifier to the electronic device 100 .

[0301] The channel identifier sent by the relay server 300 to the electronic device 100 may be a first channel identifier. The electronic device 100 may establish a first signaling link with the relay server 300 based on the first channel identifier. The signaling transmitted between the electronic device 100 and the relay server 300 over the first signaling link may include an instruction from the electronic device 100 requesting to establish a communication connection with the electronic device 200 based on modem data transmission. In other words, the first signaling link may be used for the electronic devices 100 and 200 to establish a communication connection based on modem data transmission.

[0302] S920 : The relay server 300 sends a channel identifier to the electronic device 200 .

[0303] The channel identifier sent by the relay server 300 to the electronic device 100 may be a second channel identifier. The electronic device 100 may establish a second signaling link with the relay server 300 based on the second channel identifier. The signaling transmitted between the electronic device 200 and the relay server 300 via the second signaling link may include an instruction from the electronic device 200 requesting to establish a communication connection with the electronic device 100 based on modem data transmission. In other words, the second signaling link may be used for the electronic devices 100 and 200 to establish a communication connection based on modem data transmission.

[0304] The first channel identifier and the second channel identifier are different. The first signaling link and the second signaling link are also different. The embodiment of the present application does not limit the specific content of the first channel identifier and the second channel identifier.

[0305] It can be seen that the above-mentioned channel authentication can be used to verify whether an electronic device (such as electronic device 100, electronic device 200) has the ability to switch between transmitting data via Bluetooth and transmitting data by a modem. This capability can be referred to as a first capability. Referring to Figure 5 or Figure 6, the electronic device 100 has the first capability (i.e., the electronic device 100 channel authentication is passed), which may indicate that there is a path between the Bluetooth service or wearable device management service in the electronic device 100 and the Bluetooth chip, and there is also a path between the Bluetooth service or wearable device management service and the modem. Similarly, the electronic device 200 has the first capability (i.e., the electronic device 200 channel authentication is passed), which may indicate that there is a path between the Bluetooth service or wearable device management service in the electronic device 200 and the Bluetooth chip, and there is also a path between the Bluetooth service or wearable device management service and the modem.

[0306] The aforementioned channel authentication can determine whether two devices have the ability to switch data transmission modes (i.e., switching data originally transmitted via Bluetooth to be transmitted to the target device via a modem, or vice versa). This can reduce the number of electronic devices requesting connections with electronic devices that do not have the ability to switch data transmission modes, thereby reducing the waste of electronic devices' computing resources, storage resources, and other resources.

[0307] In some embodiments, the device authentication described above may be used only to determine the identity of the electronic device. For example, upon receiving a device authentication request from electronic device 100, the relay server 300 may store the device information of electronic device 100, generate a device identifier (such as a first device identifier) ​​for electronic device 100, and execute step S914 described above. The device authentication request from electronic device 100 may inform the relay server 300 of the existence of electronic device 100 and its device information. Upon receiving a device authentication request from electronic device 200, the relay server 300 may store the device information of electronic device 200, generate a device identifier (such as a second device identifier) ​​for electronic device 200, and execute step S915 described above. The device authentication request from electronic device 200 may inform the relay server 300 of the existence of electronic device 200 and its device information. The relay server 300 may verify the associations between electronic devices stored in the relay server 300 to determine the associated electronic devices. In other words, step S913 may be executed after step S915.

[0308] When it is determined that the electronic device 100 and the electronic device 200 are associated devices and channel authentication requests are received from the electronic device 100 and the electronic device 200, the relay server 300 can determine that the channel authentication of the electronic device 100 and the electronic device 200 is passed, and then execute the above steps S919 and S920.

[0309] The above-mentioned device authentication may also be referred to as first-level authentication, etc. The above-mentioned channel authentication may also be referred to as second-level authentication, etc.

[0310] Phase 3: Address Exchange (S921-S925)

[0311] S921 : The electronic device 100 sends a message requesting to establish a P2P connection with the electronic device 200 to the relay server 300 based on the channel identifier.

[0312] S922 : The electronic device 200 sends a message requesting to establish a P2P connection with the electronic device 100 to the relay server 300 based on the channel identifier.

[0313] After the electronic device 100 and the electronic device 200 pass the device authentication and the channel authentication, the electronic device 100 and the electronic device 200 may establish a P2P connection with the relay server 300 .

[0314] The electronic device 100 sends a message to the relay server 300 requesting to establish a P2P connection with the electronic device 200 based on the channel identifier (such as the first channel identifier). Specifically, the electronic device 100 sends a message to the relay server 300 requesting to establish a P2P connection with the electronic device 200 through the signaling link (such as the first signaling link) between the electronic device 100 and the relay server 300.

[0315] The electronic device 200 sends a message to the relay server 300 requesting to establish a P2P connection with the electronic device 100 based on the channel identifier (such as the second channel identifier). Specifically, the electronic device 200 sends a message to the relay server 300 requesting to establish a P2P connection with the electronic device 100 through the signaling link (such as the second signaling link) between the electronic device 200 and the relay server 300.

[0316] Among them, if the network environment in which the electronic device 100 is located supports P2P connection, the electronic device 100 can execute step S921. Otherwise, the electronic device 100 does not execute step S921. The relay server 300 does not receive the request from the electronic device 100 to establish a P2P connection with the electronic device 200. Similarly, if the network environment in which the electronic device 200 is located supports P2P connection, the electronic device 200 can execute step S922. Otherwise, the electronic device 200 does not execute step S922. The relay server 300 does not receive the request from the electronic device 200 to establish a P2P connection with the electronic device 100.

[0317] S923 : The relay server 300 sends the address of the electronic device 200 to the electronic device 100 .

[0318] S924 : The relay server 300 sends the address of the electronic device 100 to the electronic device 200 .

[0319] The relay server 300 may obtain the addresses of the electronic device 100 and the electronic device 200. In some embodiments, the address of the electronic device 100 may include the external network IP address of the electronic device 100. The address of the electronic device 200 may include the external network IP address of the electronic device 200.

[0320] In response to the message that the electronic device 100 requests to establish a P2P connection with the electronic device 200, the relay server 300 may send the address of the electronic device 200 to the electronic device 100. In response to the message that the electronic device 200 requests to establish a P2P connection with the electronic device 100, the relay server 300 may send the address of the electronic device 100 to the electronic device 200.

[0321] S925 : The electronic device 100 and the electronic device 200 successfully establish a P2P connection.

[0322] When electronic device 100 receives the address of electronic device 200, and electronic device 200 receives the address of electronic device 100, electronic device 100 and electronic device 200 can successfully establish a P2P connection. Electronic device 100 can penetrate the NAT gateway of electronic device 200 based on the address of electronic device 200 and send data directly to electronic device 200. Electronic device 200 can penetrate the NAT gateway of electronic device 100 based on the address of electronic device 100 and send data directly to electronic device 100.

[0323] As can be seen from the method shown in Figure 9 above, when establishing a communication connection based on modem data transmission, the electronic device 100 and the electronic device 200 can first perform security authentication (such as device authentication and channel authentication) through the relay server 300. After the security authentication is passed, the electronic device 100 and the electronic device 200 can then perform specific steps for establishing a communication connection through the relay server 300 (as shown in steps S921 to S922 in Figure 9). The above security authentication can ensure that the two devices that establish a communication connection based on modem data transmission are associated devices, avoiding the electronic device 100 or the electronic device 200 from sending application data to non-associated devices, thereby improving the security of application data transmission. In addition, the above security authentication can verify whether the two electronic devices have the ability to switch the data originally transmitted by the Bluetooth connection to transmission via the modem after the Bluetooth connection is disconnected. This can reduce the situation where electronic devices request to establish a connection with electronic devices that do not have the ability to switch data transmission modes, and reduce the waste of electronic device computing resources, storage resources and other resources.

[0324] FIG10 exemplarily shows a flow chart of a method for establishing a P2P connection provided by the present application.

[0325] As shown in Figure 10, NAT1 can be a device capable of implementing NAT technology, such as a NAT gateway of electronic device 100. NAT2 can be a device capable of implementing NAT technology, such as a NAT gateway of electronic device 200. NAT technology can be used to connect external and internal networks, achieving IP multiplexing. External networks can also be called public networks. Internal networks can also be called private networks. Multiple electronic devices may be connected to a single NAT gateway. A NAT gateway can assign different port numbers to multiple electronic devices connected to the same NAT gateway, so that data from the public network can be distributed to which electronic device based on the port number.

[0326] S1011 : The electronic device 100 sends a message for registering with the relay server 300 to NAT1 .

[0327] Before requesting to establish a P2P connection with electronic device 200, electronic device 100 may first register and log in with relay server 300 to announce its identity to relay server 300. Since electronic device 100 is located in the intranet where NAT1 resides, electronic device 100 may send the registration and login message to relay server 300 to NAT1. For example, the intranet IP address of electronic device 100 is IP address 1. In the data packet corresponding to the registration and login message of electronic device 100, the source address may be IP address 1.

[0328] S1012 : NAT1 assigns port number 1 to the electronic device 100 .

[0329] The port number 1 may be assigned to the electronic device 100 by NAT1 after receiving the message for registering and logging in to the relay server 300, or may have been assigned to the electronic device 100 before receiving the message for registering and logging in to the relay server 300. The embodiment of the present application does not limit the time when NAT1 assigns the port number 1 to the electronic device 100. The port number 1 may be a random port number.

[0330] S1013 , NAT1 sends a message to the relay server 300 based on port number 1 , requesting the electronic device 100 to register and log in.

[0331] Upon receiving the message for registering with relay server 300, NAT1 may translate the source address in the data packet corresponding to the registration message. For example, NAT1's public IP address is IP address 2. NAT1 may translate the source address in the data packet from IP address 1 to "IP address 2: port number 1." "IP address 2: port number 1" may be the public IP address of electronic device 100.

[0332] NAT1 can send the registration and login message after the source address translation to relay server 300. In this way, relay server 300 can determine that the registration and login message is sent to itself by "IP address 2: port number 1". Relay server 300 can store "IP address 2: port number 1".

[0333] In some embodiments, the above steps S1011 to S1013 may be performed before step S911 shown in FIG. 9 .

[0334] S1014 : The electronic device 200 sends a message to NAT2 for registering with the relay server 300 .

[0335] Similarly, before requesting to establish a P2P connection with electronic device 100, electronic device 200 can first register and log in with relay server 300 to announce its identity to relay server 300. Because electronic device 200 is in the internal network where NAT2 is located, electronic device 200 can send the above registration and login message to relay server 300 to NAT2. For example, the internal network IP address of electronic device 200 is IP address 3. The source address in the data packet corresponding to the registration and login message of electronic device 200 can be IP address 3.

[0336] S1015 , NAT2 assigns port number 2 to the electronic device 200 .

[0337] The port number 2 may be assigned to the electronic device 200 by NAT2 after receiving the message for registering and logging in to the relay server 300, or may have been assigned to the electronic device 200 before receiving the message for registering and logging in to the relay server 300. The embodiment of the present application does not limit the time when NAT2 assigns the port number 2 to the electronic device 200. The port number 2 may be a random port number.

[0338] S1016 , NAT2 sends a message to the relay server 300 based on port number 2, requesting the electronic device 200 to register and log in.

[0339] Upon receiving the message for registering with relay server 300, NAT2 can translate the source address in the data packet corresponding to the registration message. For example, NAT2's public IP address is IP address 4. NAT2 can translate the source address in the data packet from IP address 3 to "IP address 4: port number 2." "IP address 4: port number 2" can be the public IP address of electronic device 200.

[0340] NAT2 can send the registration and login message after the source address translation to relay server 300. In this way, relay server 300 can determine that the registration and login message is sent to itself by "IP address 4: port number 2". Relay server 300 can store "IP address 4: port number 2".

[0341] In some embodiments, steps S1014 to S1016 may be performed before step S912 shown in FIG. 9 .

[0342] S1017 : The electronic device 100 requests the relay server 300 to obtain the address of the electronic device 200 through NAT1 .

[0343] The electronic device 100 can send a request to NAT1 to obtain the address of the electronic device 200. In the data packet corresponding to the request, the source address is the above-mentioned IP address 1. Upon receiving the request, NAT1 can convert the source address in the data packet corresponding to the request, and convert the source address from the above-mentioned IP address 1 to "IP address 2: port number 1". NAT1 can send the request after the above-mentioned source address conversion to the relay server 300. The above-mentioned request to obtain the address of the electronic device 200 may also include the intranet IP address of the electronic device 100 (such as IP address 1), and one or more pieces of device information of the electronic device 200. In this way, the relay server 300 can determine that the device corresponding to "IP address 2: port number 1" requests to obtain the address of the electronic device 200.

[0344] In some embodiments, step S1017 may be a specific implementation of step S921 shown in FIG9 . The first signaling link between the electronic device 100 and the relay server 300 in step S921 may include a signaling link between the electronic device 100 and NAT1 and a signaling link between NAT1 and the relay server 300. The request to obtain the address of the electronic device 200 may be transmitted to the relay server 300 via the first signaling link.

[0345] S1018 : The electronic device 200 requests the relay server 300 to obtain the address of the electronic device 100 through NAT2.

[0346] The electronic device 200 can send a request to NAT2 to obtain the address of the electronic device 100. In the data packet corresponding to the request, the source address is the above-mentioned IP address 3. Upon receiving the request, NAT2 can convert the source address in the data packet corresponding to the request, and convert the source address from the above-mentioned IP address 3 to "IP address 4: port number 2". NAT2 can send the request after the above-mentioned source address conversion to the relay server 300. The above-mentioned request to obtain the address of the electronic device 100 may also include the intranet address of the electronic device 200 (such as IP address 3) and one or more pieces of device information of the electronic device 100. In this way, the relay server 300 can determine that the device corresponding to "IP address 4: port number 2" requests to obtain the address of the electronic device 100.

[0347] In some embodiments, step S1018 may be a specific implementation of step S922 shown in FIG9 . The second signaling link between the electronic device 200 and the relay server 300 in step S922 may include a signaling link between the electronic device 200 and NAT2 and a signaling link between NAT2 and the relay server 300. The request to obtain the address of the electronic device 100 may be transmitted to the relay server 300 via the second signaling link.

[0348] S1019 : The relay server 300 records the addresses of the electronic device 100 and the electronic device 200 .

[0349] The relay server 300 can obtain the external IP address and the internal IP address of the electronic device 100 according to the request for obtaining the address of the electronic device 200 in step S1017. The relay server 300 can store the external IP address and the internal IP address of the electronic device 100.

[0350] The relay server 300 can obtain the external IP address and the internal IP address of the electronic device 200 in response to the request for obtaining the address of the electronic device 100 in step S1018. The relay server 300 can store the external IP address and the internal IP address of the electronic device 200.

[0351] S1020 : The relay server 300 sends the address of the electronic device 200 to the electronic device 100 through NAT1 .

[0352] In response to the request for obtaining the address of the electronic device 200 in step S1017, the relay server 300 can send the address (such as the intranet IP address and the extranet IP address) of the electronic device 200 to the address "IP address 2: port number 1" (i.e., NAT1). NAT1 can send the address of the electronic device 200 to the electronic device 100 based on the port number 1 in the address "IP address 2: port number 1".

[0353] S1021 : The relay server 300 sends the address of the electronic device 100 to the electronic device 200 via NAT2.

[0354] In response to the request for obtaining the address of the electronic device 100 in step S1018, the relay server 300 can send the address (such as the intranet IP address and the extranet IP address) of the electronic device 100 to the address "IP address 4: port number 2" (i.e., NAT2). NAT2 can send the address of the electronic device 100 to the electronic device 200 based on the port number 2 in the address "IP address 4: port number 2".

[0355] Subsequently, electronic device 100 can send data to electronic device 200 based on the address of electronic device 200. Electronic device 200 can send data to electronic device 100 based on the address of electronic device 100. If electronic device 100 and electronic device 200 receive data from each other, they can remember the first return packet address information of the other party, identify the other party's identity, and then confirm that the P2P connection is successfully established. Once the P2P connection is successfully established, electronic device 100 and electronic device 200 can, based on the other party's address, penetrate the other party's NAT gateway and send data to each other via the P2P connection.

[0356] In some embodiments, the electronic device 100 can also create a local port to detect data received by different ports. Different ports can correspond to different applications in the electronic device 100. When a data packet is received, the electronic device 100 can send the data to the destination port according to the destination port number in the data packet. The application corresponding to the destination port can obtain data from the destination port. Similarly, the electronic device 200 can also create a local port to detect data received by different ports, thereby transmitting the data to the application corresponding to the port. The embodiment of the present application does not limit the time when the electronic device 100 and the electronic device 200 create local ports.

[0357] FIG11 exemplarily shows a flow chart of another method for establishing a communication connection based on modem data transmission provided by the present application.

[0358] As shown in FIG11 , the communication connection based on modem data transmission can be a communication connection with relay server 300 as a data transfer station. In some embodiments, when the Bluetooth connection between electronic device 100 and electronic device 200 is disconnected, electronic device 100 and electronic device 200 can first attempt to establish a P2P connection. If the P2P connection fails to be established, electronic device 100 and electronic device 200 can then establish a communication connection with relay server 300 as a data transfer station.

[0359] S1111 : The electronic device 100 requests the relay server 300 for device authentication.

[0360] S1112 : The electronic device 200 requests the relay server 300 for device authentication.

[0361] S1113 : The relay server 300 detects that the electronic device 100 and the electronic device 200 are associated devices.

[0362] S1114 : The relay server 300 sends a message to the electronic device 100 indicating that the device authentication has been passed.

[0363] S1115 : The relay server 300 sends a message to the electronic device 200 indicating that the device authentication has been passed.

[0364] S1116 : The electronic device 100 requests the relay server 300 for channel authentication.

[0365] S1117 : The electronic device 200 requests the relay server 300 for channel authentication.

[0366] S1118 : The relay server 300 determines that the channel authentication between the electronic device 100 and the electronic device 200 is successful, and generates a channel identifier.

[0367] S1119 : The relay server 300 sends a channel identifier to the electronic device 100 .

[0368] S1120 : The relay server 300 sends a channel identifier to the electronic device 200 .

[0369] S1121 : The electronic device 100 sends a message requesting to establish a P2P connection with the electronic device 200 to the relay server 300 based on the channel identifier.

[0370] The above steps S1111 to S1121 may refer to steps S911 to S921 shown in FIG. 9 .

[0371] S1122: The relay server 300 does not receive a request from the electronic device 200 to establish a P2P connection within a preset time period.

[0372] In some embodiments, the network environment in which the electronic device 200 is located does not support P2P connection. For example, if the NAT2 of the electronic device 200 does not support the P2P protocol, the electronic device 200 cannot perform step S1018 shown in Figure 10 (that is, step S922 shown in Figure 9). Therefore, the relay server 300 cannot receive the request from the electronic device 200 to establish a P2P connection within the preset time period. The above-mentioned preset time period may include the time period after the relay server 300 receives the message from the electronic device 100 requesting to establish a P2P connection with the electronic device 200. Optionally, the above-mentioned preset time period may also include the time period before the relay server 300 receives the message from the electronic device 100 requesting to establish a P2P connection with the electronic device 200. The embodiment of the present application does not limit the duration of the above-mentioned preset time period.

[0373] S1123 : The relay server 300 sends a message to the electronic device 100 indicating that the P2P connection establishment has failed.

[0374] If the relay server 300 does not receive a request from the electronic device 200 to establish a P2P connection within a preset time period, it may indicate that the electronic device 200 is currently unable to establish a P2P connection. Therefore, the relay server 300 may send a message to the electronic device 100 indicating that the P2P connection establishment has failed.

[0375] S1124 : The electronic device 100 establishes a data transmission channel with the relay server 300 .

[0376] When the electronic device 100 is unable to establish a P2P connection with the electronic device 200, the electronic device 100 may establish a data transmission channel with the relay server 300. The data transmission channel between the electronic device 100 and the relay server 300 may be a first data transmission channel. The first data transmission channel may be used for transmitting application data between the electronic device 100 and the relay server 300. In some embodiments, the first data transmission channel and the signaling link (such as the first signaling link) between the aforementioned electronic device 100 and the relay server 300 are different communication channels. Alternatively, the first data transmission channel and the first signaling link may also share the same communication channel. The embodiment of the present application does not limit the method for establishing the above-mentioned first data transmission channel.

[0377] In some embodiments, if the first data transmission channel and the first signaling link are different communication channels, the instruction to establish the first data transmission channel between the electronic device 100 and the relay server 300 may be transmitted through the first signaling link.

[0378] S1125 . The electronic device 200 establishes a data transmission channel with the relay server 300 .

[0379] Since the network environment in which the electronic device 200 is located does not support P2P connection, the electronic device 200 can establish a data transmission channel with the relay server 300. The data transmission channel between the electronic device 200 and the relay server 300 can be a second data transmission channel. The second data transmission channel can be used for the electronic device 200 and the relay server 300 to transmit application data. In some embodiments, the second data transmission channel and the signaling link (such as the second signaling link) between the aforementioned electronic device 200 and the relay server 300 are different communication channels. Alternatively, the second data transmission channel and the second signaling link can also share the same communication channel. The embodiment of the present application does not limit the method for establishing the above-mentioned second data transmission channel.

[0380] In some embodiments, if the second data transmission channel and the second signaling link are separate communication channels, the instruction to establish the second data transmission channel between the electronic device 200 and the relay server 300 may be transmitted through the second signaling link.

[0381] Step S1125 may be performed after step S1120. In some embodiments, step S1122 is optional. Upon receiving a message from the electronic device 200 requesting to establish a data transmission channel, the relay server 300 may execute step S1123 and send a message to the electronic device 100 indicating that the P2P connection establishment failed.

[0382] When the electronic device 100 establishes a first data transmission channel with the relay server 300, and the electronic device 200 establishes a second data transmission channel with the relay server 300, the electronic device 100 and the electronic device 200 can use the relay server 300 as a data transfer station and be connected through the first data transmission channel and the second data transmission channel.

[0383] In some embodiments, the electronic device 100 may send data to be sent to the electronic device 200 to the relay server 300 via a first data transmission channel. The data sent to the relay server 300 may include one or more items of device information of the electronic device 200, so that the relay server 300 can determine that the data is sent to the electronic device 200. For example, the device information of the electronic device 200 in the above data may include the device identification of the electronic device 200. The relay server 300 may send the data to the electronic device 200 via a second data transmission channel. The relay server 300 may perform decoding and recognition on the data sent by the electronic device 100 to identify the device information of the electronic device 200 contained in the data. Then, the relay server 300 may perform encoding and other processing on the data and send the encoded data to the electronic device 200.

[0384] Similarly, the electronic device 200 can send data to be sent to the electronic device 100 to the relay server 300 via the second data transmission channel. The data sent to the relay server 300 can include one or more items of device information of the electronic device 100, so that the relay server 300 can determine that the data is sent to the electronic device 100. For example, the device information of the electronic device 100 in the above data may include the device identification of the electronic device 100. The relay server 300 can send the data to the electronic device 100 via the first data transmission channel.

[0385] In some embodiments, when the Bluetooth connection between the electronic device 100 and the electronic device 200 is disconnected, the electronic device 100 and the electronic device 200 can directly establish a communication connection with the relay server 300 as a data transfer station.

[0386] Specifically, the electronic device 100 and the electronic device 200 can request device authentication from the relay server 300. When the device authentication of the electronic device 100 and the electronic device 200 are both passed, the electronic device 100 and the electronic device 200 can request channel authentication from the relay server 300. When the channel authentication of the electronic device 100 and the electronic device 200 are both passed, the electronic device 100 can establish a data transmission path with the relay server 300, and the electronic device 200 can also establish a data transmission path with the relay server 300. The specific methods of the above-mentioned device authentication, channel authentication and establishment of the data transmission path can be referred to the introduction of the aforementioned embodiment. They will not be repeated here.

[0387] In some embodiments, when a P2P connection is established between electronic device 100 and electronic device 200, or when electronic device 100 and relay server 300 establish a data transmission channel, electronic device 200 and relay server 300 establish a data transmission channel, electronic device 100 and electronic device 200 can still turn on Bluetooth, detect nearby Bluetooth devices, and send Bluetooth broadcasts to announce their presence to nearby Bluetooth devices. When electronic device 100 detects the Bluetooth broadcast of electronic device 200, electronic device 100 can establish a Bluetooth connection with electronic device 200. Alternatively, when electronic device 200 detects the Bluetooth broadcast of electronic device 100, electronic device 200 can establish a Bluetooth connection with electronic device 100. Optionally, when the Bluetooth connection is established, electronic device 100 and electronic device 200 can disconnect the P2P connection, or electronic device 100 disconnects the data transmission channel with relay server 300 and electronic device 200 disconnects the data transmission channel with relay server 300.

[0388] That is, when the Bluetooth connection between the electronic device 100 and the electronic device 200 is disconnected, the electronic device 100 and the electronic device 200 can establish a communication connection based on modem transmission data with the help of the relay server 300. In this way, when the distance between the electronic device 100 and the electronic device 200 exceeds the distance range of Bluetooth transmission, the electronic device 100 and the electronic device 200 can use the communication connection based on modem transmission to transmit data. When the electronic device 100 and the electronic device 200 are close again, the electronic device 100 and the electronic device 200 can restore the Bluetooth connection and switch the data transmission mode, using the Bluetooth connection to transmit data to each other.

[0389] It should be noted that, without causing any contradiction or conflict, any feature in any embodiment of the present application, or any part of any feature, can be combined, and the combined technical solution is also within the scope of the embodiments of the present application.

[0390] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A device communication method, characterized in that, The method is applied to a communication system, which includes a first device and a second device. A Bluetooth connection is established between the first device and the second device. The method includes: When the Bluetooth connection is disconnected, the first device requests device authentication from a first server, and the second device requests the device authentication from the first server. The device authentication is used to verify whether the first device and the second device have an associated relationship; When the device authentication is passed, the first device requests channel authentication from the first server, and the second device requests the channel authentication from the first server. The channel authentication is used to verify whether the first device and the second device have the ability to switch between transmitting data via Bluetooth and transmitting data via a modem; When the channel authentication is passed, the first device and the second device establish a first connection, which is a communication connection for transmitting data based on a modem; When the first connection is successfully established, the first device and the second device transmit data via the first connection.

2. The method according to claim 1, wherein The first connection is a P2P connection.

3. The method according to claim 2, wherein The method further includes: When the establishment of the first connection fails, the first device and the second device establish a second connection via the first server. The second connection includes a data transmission channel between the first device and the first server, and a data transmission channel between the second device and the first server; The first device and the second device transmit data via the second connection.

4. The method according to claim 1, characterized in that, The establishment of the first connection between the first device and the second device specifically includes: The first device establishes a data transmission channel with the first server, and the second device establishes a data transmission channel with the first server. The first connection includes a data transmission channel between the first device and the first server, and a data transmission channel between the second device and the first server.

5. The method according to any one of claims 1-4, characterized in that, After the Bluetooth connection is disconnected, the method further includes: When the first device detects the Bluetooth broadcast of the second device, and / or, the second device detects the Bluetooth broadcast of the first device, the first device and the second device restore the Bluetooth connection.

6. The method according to any one of claims 3 to 5, characterized in that, Both the first device and the second device include a first application. The method further includes: When a Bluetooth connection is established between the first device and the second device, the first device sends first data of the first application to the second device via the Bluetooth connection; When a P2P connection is established between the first device and the second device, the first device sends the first data to the second device via the P2P connection; When the first device establishes a data transmission channel with the first server and the second device establishes a data transmission channel with the first server, the first device sends the first data to the first server and instructs the first server to send the first data to the second device. The second device receives the first data from the first server.

7. The method according to claim 6, wherein The first data is obtained by the first device from a second server corresponding to the first application before sending the first data to the second device.

8. The method according to any one of claims 3-7, characterized in that, Both the first device and the second device include a first application, and the method further includes: When a Bluetooth connection is established between the first device and the second device, the second device sends second data of the first application to the first device through the Bluetooth connection; When a P2P connection is established between the first device and the second device, the second device sends the second data to the first device through the P2P connection; When a data transmission channel is established between the first device and the first server, and a data transmission channel is established between the second device and the first server, the second device sends the second data to the first server and instructs the first server to send the second data to the first device, and the first device receives the second data from the first server.

9. The method according to claim 8, wherein The second data is data determined by the second device according to user input.

10. The method according to claim 8 or 9, characterized in that After the first device receives the second data, the method further includes: The first device sends the second data to a second server corresponding to the first application.

11. The method according to any one of claims 1-10, characterized in that, The method further includes: When the device authentication is passed, the first device receives a first device identifier from the first server, and the second device receives a second device identifier from the first server. The first device identifier is used to identify the first device, and the second device identifier is used to identify the second device; Among them, the message for the first device to request channel authentication from the first server includes the first device identifier, and the message for the second device to request channel authentication from the first server includes the second device identifier.

12. The method according to any one of claims 1-11, characterized in that, The method further includes: When the channel authentication is passed, the first device receives a first channel identifier from the first server and establishes a first signaling link with the first server, and the second device receives a second channel identifier from the first server and establishes a second signaling link with the first server. The first channel identifier is used to identify the first signaling link, and the second channel identifier is used to identify the second signaling link; Among them, the first signaling link and the second signaling link are used for the first device and the second device to establish the first connection.

13. The method according to any one of claims 1 to 12, characterized in that The first device is a mobile phone, and the second device is a wearable device.

14. The method according to any one of claims 1 to 13, characterized in that, Both the first device and the second device include a first service, and the first service is used to call a Bluetooth chip or a modem to transmit data.

15. A device communication method, characterized in that, The method is applied to a first device, and a Bluetooth connection is established between the first device and a second device. The method includes: When the Bluetooth connection is disconnected, the first device requests device authentication from a first server, and the device authentication is used to verify whether there is an association relationship between the first device and the second device; When the device authentication is passed, the first device requests channel authentication from the first server, and the channel authentication is used to verify whether the first device has the ability to switch between transmitting data via Bluetooth and transmitting data via a modem; When the channel authentication is passed, the first device and the second device establish a first connection, and the first connection is a communication connection based on data transmission via a modem; When the first connection is successfully established, the first device transmits data to the second device via the first connection.

16. The method according to claim 15, wherein The first connection is a P2P connection.

17. The method according to claim 16, wherein The method further includes: When the establishment of the first connection fails, the first device establishes a second connection with the second device via the first server, and the second connection includes a data transmission channel between the first device and the first server, and a data transmission channel between the second device and the first server; The first device transmits data to the second device via the second connection.

18. The method according to claim 15, wherein The establishment of the first connection between the first device and the second device specifically includes: The first device establishes the first connection with the second device via the first server, and the first connection includes a data transmission channel between the first device and the first server, and a data transmission channel between the second device and the first server.

19. The method according to any one of claims 15 - 18, characterized in that, After the Bluetooth connection is disconnected, the method further includes: When the first device detects the Bluetooth broadcast of the second device, the first device and the second device resume the Bluetooth connection.

20. The method according to any one of claims 17-19, characterized in that The first device includes a first application, and the method further includes: When the first device and the second device have a Bluetooth connection established, the first device sends the first data of the first application to the second device via the Bluetooth connection; When the first device and the second device have a P2P connection established, the first device sends the first data to the second device via the P2P connection; When the first device has a data transmission channel established with the first server, the first device sends the first data to the first server and instructs the first server to send the first data to the second device.

21. The method according to any one of claims 17-20, characterized in that, The first device includes a first application, and the method further includes: When the first device and the second device have a Bluetooth connection established, the first device receives the second data of the first application from the second device via the Bluetooth connection; When the first device and the second device have a P2P connection established, the first device receives the second data from the second device via the P2P connection; When the first device has a data transmission channel established with the first server, the first device receives the second data from the second device from the first server.

22. The method according to any one of claims 15-21, characterized in that, The method further includes: When the device authentication is passed, the first device receives a first device identifier from the first server, and the first device identifier is used to identify the first device; Among them, the message in which the first device requests channel authentication from the first server includes the first device identifier.

23. The method according to any one of claims 15-22, characterized in that, The method further includes: When the channel authentication is passed, the first device receives a first channel identifier from the first server and establishes a first signaling link with the first server, where the first channel identifier is used to identify the first signaling link; Among them, the first signaling link is used for the first device and the second device to establish the first connection.

24. The method according to any one of claims 15 - 23, characterized in that, The first device is a mobile phone.

25. The method according to claim 24, wherein The first data is obtained by the first device from the second server corresponding to the first application before sending the first data to the second device.

26. The method according to claim 24 or 25, wherein The method further includes: After receiving the second data, the first device sends the second data to the second server corresponding to the first application.

27. The method according to any one of claims 15-23, characterized in that, The first device is a wearable device.

28. The method according to claim 27, wherein The first data is determined by the first device according to user input before sending the first data to the second device.

29. The method according to any one of claims 15 - 28, characterized in that, The first device includes a first service, and the first service is used to call a Bluetooth chip or a modem to transmit data.

30. A device communication method, characterized in that, The method is applied to a server, and the method includes: The server responds to the device authentication requests of the first device and the second device, and verifies whether the first device and the second device have an associated relationship; When the first device and the second device have an associated relationship, the server sends a message indicating that the device authentication is passed to the first device and the second device; The server responds to the channel authentication requests of the first device and the second device, and verifies whether the first device and the second device have a first ability to switch between transmitting data via Bluetooth and transmitting data via a modem; When the first device and the second device have the first ability, the server sends a message indicating that the channel authentication is passed to the first device and the second device; The server responds to the request of the first device and the second device to establish a first connection, sends a first message to the first device, and sends a second message to the second device. The first message and the second message are used for the first device and the second device to establish the first connection, and the first connection is a communication connection based on transmitting data via a modem.

31. The method according to claim 30, wherein The first connection is a P2P connection. The first message includes the IP address of the second device, and the second message includes the IP address of the first device.

32. The method according to claim 31, wherein Before sending the first message to the first device and sending the second message to the second device, the method further includes: The server obtains the IP address of the first device and the IP address of the second device.

33. The method according to claim 30, wherein The method further includes: The server establishes a first data transmission channel with the first device; The server establishes a second data transmission channel with the second device, and the first connection includes the first data transmission channel and the second data transmission channel.

34. The method according to claim 33, wherein The method further includes: The server receives the first data sent by the first device through the first data transmission channel and sends the first data to the second device through the second data transmission channel.

35. The method according to claim 33 or 34, characterized in that, The method further includes: The server receives the second data sent by the second device through the second data transmission channel, and sends the second data to the first device through the first data transmission channel.

36. The method according to any one of claims 30 - 35, characterized in that, The method further includes: The server responds to the device authentication requests of the third device and the fourth device, and verifies whether the third device and the fourth device have an associated relationship; When the third device and the fourth device have an associated relationship, the server sends a message indicating that the device authentication is passed to the third device and the fourth device; The server responds to the channel authentication requests of the third device and the fourth device, and verifies whether the third device and the fourth device have the first capability; When the third device and the fourth device have the first capability, the server sends a message indicating that the channel authentication is passed to the third device and the fourth device; When the request for establishing a P2P connection from the third device is received and the request for establishing a P2P connection from the fourth device is not received within a first time period, the server sends a message indicating that the P2P connection fails to the third device, and the first time period includes the time period after the server receives the request for establishing a P2P connection from the third device.

37. The method according to claim 36, wherein After the server sends the message indicating that the P2P connection fails to the third device, the method further includes: The server establishes a third data transmission channel with the third device; The server establishes a fourth data transmission channel with the fourth device, and the third data transmission channel and the fourth data transmission channel are used for the third device and the fourth device to transmit data.

38. The method according to any one of claims 30 - 37, characterized in that, The message indicating that the device authentication is passed sent by the server to the first device includes a first device identifier, and the message indicating that the device authentication is passed sent by the server to the second device includes a second device identifier. The first device identifier is used to identify the first device, and the second device identifier is used to identify the second device; Wherein, the channel authentication request from the first device includes the first device identifier, and the channel authentication request from the second device includes the second device identifier.

39. The method according to any one of claims 30 - 38, characterized in that, The method further includes: When the first device and the second device have the first capability, the server sends a first channel identifier to the first device and sends a second channel identifier to the second device. The first channel identifier is used to identify a first signaling link, and the second channel identifier is used to identify a second signaling link; The server establishes the first signaling link with the first device and establishes the second signaling link with the second device. The first signaling link and the second signaling link are used for the first device and the second device to establish the first connection.

40. An electronic device, characterized in that, The electronic device includes a memory and a processor. Wherein, the memory is used to store a computer program; the processor is used to call the computer program so that the electronic device executes the method according to any one of claims 15-29.

41. A computer-readable storage medium stores instructions, characterized in that, When the instruction runs on the electronic device, the electronic device executes the method according to any one of claims 15-29.

42. A computer program product, characterized in that, The computer program product includes computer instructions, which, when running on an electronic device, cause the electronic device to execute the method according to any one of claims 15-29.

43. A server, characterized in that, The server includes a memory and a processor. The memory is used to store a computer program, and the processor is used to call the computer program, causing the server to execute the method according to any one of claims 30-39.

Citation Information

Patent Citations

  • Equipment communication method, related device and communication system

    CN120390313A

  • Data interaction method, electronic equipment and computer readable storage medium

    CN115914983A

  • Data transmission method, terminal and system

    CN119172735A

  • Information synchronization method, terminal equipment and wearable intelligent equipment

    CN119277505A

  • Methods and devices to establish and maintain connections with multiple communication devices

    US20230309163A1