Equipment communication method, related device and communication system
Establishing a modem data transmission connection through the relay server solves the problem of disconnection of the wearable device from the mobile phone Bluetooth connection, realizing data transmission and function use at long distances, improving user experience and improving security.
Patent Information
- Application Number
- CN202410117871.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-26
- Publication Date
- 2025-07-29
AI Technical Summary
When the wearable device is disconnected from the phone's Bluetooth connection, many functions are unavailable, reducing the user experience.
The modem-based communication connection is established through the relay server to realize data transmission, including device authentication and channel authentication, to ensure the security and data transmission capabilities of the associated devices.
After the Bluetooth connection is disconnected, users can still view and reply to message notifications through wearable devices, improving user experience and reducing resource waste.
Smart Images

Figure CN120390313A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of terminal technologies, and in particular, to a device communication method, related devices, and a communication system. Background Art
[0002] With the development of wearable devices, the functions of wearable devices such as smart watches and smart bracelets are becoming more and more powerful. Many functions of wearable devices rely on their Bluetooth connection to mobile phones. When the distance between the wearable device and the mobile phone is too far (for example, when the user only brings the wearable device but not the mobile phone when going out), the Bluetooth connection between the wearable device and the mobile phone is disconnected, which will cause many services of the wearable device to be temporarily unavailable. This greatly reduces the user experience of using the wearable device. Summary of the Invention
[0003] This application provides a device communication method, related devices, and a communication system. After the Bluetooth connection between the first device and the second device is disconnected, the first device and the second device can establish a communication connection for transmitting data based on a modem through a relay server. The above communication connection for transmitting data based on a modem is not limited by the distance between the first device and the second device. In this way, whether the first device and the second device are close or far apart, 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. This can improve the user experience of using the second device.
[0004] In a first aspect, this 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 a Bluetooth connection is established between the first device and the second device. 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. The device authentication is used to verify whether the first device and the second device have an associated relationship; when the device authentication passes, the first device requests channel authentication from the first server, and the second device requests 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 passes, the first device and the second device establish a first connection, and the first connection 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 through the first connection.
[0005] The above 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 bracelet.
[0006] It can be seen that after the Bluetooth connection between the first device and the second device is disconnected, a communication connection for transmitting data based on a modem can be established. The above communication connection for transmitting data based on a modem can be not restricted by the distance between the first device and the second device. Whether the first device and the second device 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. For example, in the case where the user only carries the second device out, the user can still view the message notifications of the social application in a timely manner through the second device and reply to the messages. This can improve the user experience of using the second device.
[0007] Among them, when establishing a communication connection for transmitting data based on a modem, the first device and the second device can first perform device authentication and channel authentication through the first server. The above device authentication can ensure that the two devices establishing the communication connection for transmitting data based on a modem are associated devices, avoiding the first device and the second device from sending application data to non-associated devices, and improving the security of application data transmission. The above channel authentication can verify whether the two electronic devices have the ability to switch the data originally transmitted by the Bluetooth connection to be transmitted through the modem after the Bluetooth connection is disconnected. This can reduce the situation where an electronic device requests to establish a connection with an electronic device that does not have the ability to switch the data transmission method, and reduce the waste of resources such as computing resources and storage resources of the electronic device.
[0008] In some embodiments, the device authentication request sent by the first device may include one or more device information of the first device. The device authentication request sent by the second device may include one or more device information of the second device. The above device authentication can be only used 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 the device authentication requests of multiple electronic devices, the first server can independently verify the association relationship between these multiple electronic devices to determine the associated electronic devices. When receiving the channel authentication requests of the first device and the second device, the first server can send a message indicating that the channel authentication is passed to the first device and the second device only after determining that the first device and the second device are associated devices.
[0009] Combined with the first aspect, in some embodiments, the first connection is a P2P connection.
[0010] When the establishment of the first connection fails, 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.
[0011] It is understandable that the network environment in which the first device and / or the second device is currently located may not support P2P connection. Therefore, the first device and the second device may not be able to establish a P2P connection. In the case where the establishment of the P2P connection fails, 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, in the case where 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.
[0012] In combination with the first aspect, in some embodiments, the specific process for the first device and the second device to establish the first connection may be as follows: 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 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.
[0013] 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 the data transfer station.
[0014] In combination with the first aspect, in some embodiments, when the first device detects the Bluetooth broadcast of the second device, and / or, when the second device detects the Bluetooth broadcast of the first device, the first device and the second device restore the Bluetooth connection.
[0015] Optionally, when the first device and the second device restore the Bluetooth connection, the first device and the second device can disconnect the above-mentioned first connection.
[0016] It can be seen that when the first device and the second device get closer again after the Bluetooth connection is disconnected, the first device and the second device can restore the Bluetooth connection and switch the data transmission method to use the Bluetooth connection to transmit data to each other.
[0017] In combination with the first aspect, in some embodiments, both the first device and the second device include the 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.
[0018] It can be seen that the first device can decide what communication connection method to use to transmit data to the second device according to 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 P2P connection and the communication connection with the first server as a data transfer station are not restricted by the distance between the first device and the second device. Whether the first device and the second device 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.
[0019] In some embodiments, the above 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.
[0020] Combined with the first aspect, in some embodiments, both the first device and the second device include the first application. When a Bluetooth connection is established between the first device and the second device, the second device sends the 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.
[0021] It can be seen that the second device can decide what communication connection method to use to transmit data to the first device according to 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 P2P connection and the communication connection with the first server as a data transfer station are not restricted by the distance between the first device and the second device. Whether the first device and the second device 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.
[0022] In some embodiments, the second data is data determined by the second device according to user input. For example, the first application is a social application. The second data may include a message that the user inputs in the second device and needs to send to a certain contact. For another example, the first application is an audio and video application. The second data may include an audio switching instruction determined according to the user's operation of switching audio in the second device.
[0023] In some embodiments, after the first device receives the second data, it may send the second data to the second server corresponding to the first application.
[0024] In combination with the first aspect, in some embodiments, when the device authentication is passed, the first device receives the first device identifier from the first server, and the second device receives the 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 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.
[0025] In combination with the first aspect, in some embodiments, when the channel authentication is passed, the first device receives the first channel identifier from the first server and establishes a first signaling link with the first server, and the second device receives the 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 for the first device and the second device to establish a first connection.
[0026] In combination with the first aspect, in some embodiments, 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. The above-mentioned first service may refer to the Bluetooth service or the wearable device management service in the subsequent embodiments of the present application.
[0027] In a second aspect, the present application provides a device communication method. The method can be applied to the first device. The first device has a Bluetooth connection with the second device. When the Bluetooth connection is disconnected, the first device requests 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. 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. The first connection is a communication connection based on transmitting data via a modem; when the first connection is successfully established, the first device transmits data to the second device via the first connection.
[0028] The above-mentioned first server may be a relay server.
[0029] It can be seen that after the Bluetooth connection between the first device and the second device is disconnected, a communication connection for transmitting data based on a modem can be established. The above communication connection for transmitting data based on a modem can be independent of the distance between the first device and the second device. Whether the first device and the second device are close or far apart, 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, when the user only takes the second device out, the user can still view the message notifications of the social application in a timely manner through the second device and reply to the messages. This can enhance the user experience of using the second device.
[0030] Among them, when establishing a communication connection for transmitting data based on a modem, the first device can first perform device authentication and channel authentication through the first server. The above device authentication can ensure that the two devices establishing the communication connection for transmitting data based on a modem are associated devices, avoiding the first device from sending application data to non-associated devices and improving the security of application data transmission. The above channel authentication can verify whether the two electronic devices have the ability to switch the data originally transmitted through the Bluetooth connection to be transmitted through 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 method, and reduce the waste of resources such as the computing resources and storage resources of the first device.
[0031] Combined with the second aspect, in some embodiments, the first connection is a P2P connection.
[0032] When the establishment of the first connection fails, 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 to the second device through the second connection.
[0033] It can be understood that the current network environment where the first device and / or the second device is located may not support the P2P connection. Therefore, the first device and the second device may not be able to establish a P2P connection. In the case where the establishment of the P2P connection fails, the first device can establish a data transmission channel with the first server. In this way, in the case where 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.
[0034] Combined with the second aspect, in some embodiments, the specific process of the first device and the second device establishing the first connection may be: the first device establishes the first connection with the second device through 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.
[0035] 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 the data transfer station.
[0036] Combined 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.
[0037] Optionally, when the first device and the second device restore the Bluetooth connection, the first device and the second device can disconnect the above-mentioned first connection.
[0038] It can be seen that when the first device and the second device get 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 method, using the Bluetooth connection to transmit data to each other.
[0039] Combined with the second aspect, in some embodiments, the first device includes a first application. When the first device and the second device have 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 have a P2P connection, the first device sends the first data to the second device through 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.
[0040] It can be seen that the first device can decide what communication connection method to use to transmit data to the second device according to the current communication connection method with 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 the P2P connection or the communication connection with the first server as the data transfer station. Both the above-mentioned P2P connection and the communication connection with the first server as the data transfer station are not limited by the distance between the first device and the second device. Whether the first device and the second device 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.
[0041] Combined with the second aspect, in some embodiments, the first device includes a first application. When the first device and the second device have a Bluetooth connection, the first device receives the second data of the first application from the second device through the Bluetooth connection; when the first device and the second device have a P2P connection, the first device receives the second data from the second device through 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.
[0042] 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, and the first device identifier is used to identify the first device; wherein, the message for the first device to request channel authentication from the first server includes the first device identifier.
[0043] 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 for the first device and the second device to establish a first connection.
[0044] In combination 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 bracelet. Among them, the above-mentioned first data may be obtained by the first device from the second server corresponding to the first application before sending 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.
[0045] In combination with the second aspect, in some embodiments, the first device may be a wearable device, such as a watch or a bracelet. The second device may be a mobile phone. The first data is determined by the first device according to 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 that the user enters in the first device and needs to send to a certain contact. For another example, the first application is an audio and video application. The first data may include an audio switching instruction determined according to the user's operation of switching audio in the first device.
[0046] In combination with the second aspect, in some embodiments, the first device includes a first service, and the first service is used to call a Bluetooth chip or a modem to transmit data. The above-mentioned first service may refer to the Bluetooth service or the wearable device management service in the subsequent embodiments of the present application.
[0047] In a third aspect, the present application provides a device communication method. This method can be applied to a server. The server can respond to the device authentication requests of a first device and a 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 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, where 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 data transmission via a modem.
[0048] The above server can be a relay server. The first device can be an electronic device such as a mobile phone or a tablet computer. The second device can be a wearable device, such as a watch or a bracelet.
[0049] It can be seen that the above server can assist the first device and the second device in establishing a communication connection based on data transmission via a modem. The communication connection based on data transmission via a modem can be not limited by the distance between the first device and the second device. After the Bluetooth connection between the first device and the second device is disconnected, the first device and the second device can still use the communication connection based on data transmission via a modem to transmit data. In this way, whether the first device and the second device 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.
[0050] Among them, the server can first perform device authentication and channel authentication on the first device and the second device. The above device authentication can ensure that the two devices establishing a communication connection based on data transmission via a modem 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 channel authentication can verify whether two electronic devices have the ability to switch the data originally transmitted via Bluetooth to be transmitted via a modem after the Bluetooth connection is disconnected. This can reduce the situation where an electronic device requests to establish a connection with an electronic device that does not have the ability to switch the data transmission method, and reduce the waste of resources such as computing resources and storage resources of the electronic device.
[0051] 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 (for example, an external network IP address, an internal network IP address), and the second message includes the IP address of the first device (for example, an external network IP address, an internal network IP address).
[0052] 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 a 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 a request sent by the second device to establish a first connection with the first device.
[0053] 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.
[0054] 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.
[0055] In combination with the third aspect, in some embodiments, 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.
[0056] In combination with the third aspect, in some embodiments, 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.
[0057] It can be seen that the server can provide a data forwarding function, which 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.
[0058] 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 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 a 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 a request to establish a P2P connection from the third device is received and a request to establish 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 to establish a P2P connection from the third device.
[0059] In connection with the third aspect, in some embodiments, after the server sends a message indicating the failure of the P2P connection 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 the third device and the fourth device to transmit data. The establishment methods of the third data transmission channel and the fourth data transmission may refer to the establishment methods of the foregoing first data transmission channel and the second data transmission
[0060] In connection with the third aspect, in some embodiments, the message indicating the successful device authentication sent by the server to the first device includes the first device identifier, and the message indicating the successful device authentication sent by the server to the second device includes the 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; among them, 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.
[0061] In connection 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 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 a 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 a first connection.
[0062] In a fourth aspect, the present application provides an electronic device. The electronic device may include a memory and a processor. Among them, the memory can be used to store a computer program. The processor can be used to call the computer program so that the electronic device executes any possible implementation method in the second aspect.
[0063] 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. The 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. 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; the first device and the second device can be used to establish a first connection after the channel authentication is passed. The first connection is a communication connection based on transmitting data via a modem; the first device and the second device can be used to transmit data via the first connection after the first connection is successfully established.
[0064] In a sixth aspect, the present application provides a server. The server may include a memory and a processor. Among them, the memory can be used to store a computer program, and the processor can be used to call the computer program so that the server executes any possible implementation method in the third aspect.
[0065] In a seventh aspect, the present application provides a computer-readable storage medium, including instructions that, when running on an electronic device, cause the electronic device to execute any possible implementation method in the second aspect.
[0066] In an eighth aspect, the present application provides a computer program product that may include computer instructions that, when running on an electronic device, cause the electronic device to execute any possible implementation method in the second aspect.
[0067] In a ninth aspect, the present application provides a chip that is applied to an electronic device. The chip includes one or more processors that are used to call computer instructions so that the electronic device executes any possible implementation method in the second aspect.
[0068] It can be understood that the electronic device provided in the above 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 method provided in the embodiments of the present application. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method, which will not be elaborated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] Figure 1 is an architecture diagram of a communication system provided by an embodiment of the present application;
[0070] Figure 2A is a schematic structural diagram of an electronic device 100 provided by an embodiment of the present application;
[0071] Figure 2B is another schematic structural diagram of an electronic device 100 provided by an embodiment of the present application;
[0072] Figure 3A is a schematic structural diagram of an electronic device 200 provided by an embodiment of the present application;
[0073] Figure 3B is another schematic structural diagram of an electronic device 200 provided by an embodiment of the present application;
[0074] Figure 4 is a schematic structural diagram of a relay server 300 provided by an embodiment of the present application;
[0075] Figure 5 It is a schematic diagram of a communication system provided by an embodiment of the present application;
[0076] Figure 6 It is a schematic diagram of another communication system provided by an embodiment of the present application;
[0077] Figure 7 It is a flowchart of a device communication method provided by an embodiment of the present application;
[0078] Figure 8 It is a flowchart of a device communication method provided by an embodiment of the present application;
[0079] Figure 9 It is a flowchart of a method for establishing a communication connection for transmitting data based on a modem provided by an embodiment of the present application;
[0080] Figure 10 It is a flowchart of a method for establishing a P2P connection provided by an embodiment of the present application;
[0081] Figure 11 It is a flowchart of another method for establishing a communication connection for transmitting data based on a modem provided by an embodiment of the present application. Detailed implementation manners
[0082] Next, in combination with the accompanying drawings in the embodiments of the present application, the technical solutions in the embodiments of the present application will be described. 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 limit the present application. As used in the specification and the appended claims of the present application, the singular forms "a", "the", "above-mentioned", "this" and "this one" are also intended to include, for example, the expression form of "one or more", unless there is a clear indication to the contrary in the context. It should also be understood that in the following embodiments of the present application, "at least one" and "one or more" mean one or more than two (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 mean: A exists alone, A and B exist simultaneously, and B exists alone, where A and B can be singular or plural. The character " / " generally means that the associated objects before and after are in an "or" relationship.
[0083] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, statements such as "in one embodiment", "in some embodiments", "in other some embodiments", "in still other embodiments", etc. that appear in different places in this specification are not necessarily all referring to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized. The terms "comprising", "including", "having" and their variants mean "including but not limited to", unless otherwise specifically emphasized. The term "connection" includes direct connection and indirect connection, unless otherwise stated. "First" and "second" are only used for descriptive purposes and should not be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features.
[0084] In the embodiments of the present application, words such as "exemplarily" or "for example" are used to represent examples, illustrations or explanations. Any embodiment or design solution described as "exemplarily" or "for example" in the embodiments of the present application should not be construed as being more preferred or more advantageous than other embodiments or design solutions. Rather, the use of words such as "exemplarily" or "for example" is intended to present the relevant concepts in a specific manner.
[0085] The present application provides a device communication method, which 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. Among them, 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 through the Bluetooth connection. When the above Bluetooth connection is disconnected, the electronic device 100 and the electronic device 200 can establish a first connection and transmit data through the first connection. The first connection can be a communication connection for transmitting data based on a modem. For example, the first connection can be a peer-to-peer (P2P) connection. Or, the first connection is a communication connection with a relay server as a data transfer station, and can include a data transfer channel between the electronic device 100 and the relay server and a data transfer channel between the electronic device 200 and the relay server.
[0086] The above communication connections for transmitting data based on a modem (such as a P2P connection or a communication connection using a relay server as a data transfer station) can be independent of the distance between the electronic device 100 and the electronic device 200. When only the electronic device 100 can communicate with the application server and the user only carries the electronic device 200, the electronic device 200 can also receive data from the application server through a P2P connection or a relay server. In this way, whether the electronic device 100 and the electronic device 200 are close or far apart, the user can view the message notifications of the application in a timely manner through the electronic device 200 and reply to the messages. This can improve the user experience of using the electronic device 200.
[0087] The following introduces the communication system 10 involved in this application.
[0088] As Figure 1 shown, the communication system 10 may include an electronic device 100, an electronic device 200, a relay server 300, and an application server 400.
[0089] The application server 400 can be the application server of any application. For example, the application server 400 can be the application server of a social application. The application server 400 can store and manage social accounts of the social application and provide services for different social accounts to conduct social communications. For another example, the application server 400 can also be the application server of an audio-video application. The application server 400 can store audio-video resources and distribute the audio-video resources to the user's device.
[0090] In some embodiments, an application corresponding to the application server 400 can be installed in the electronic device 100. A communication connection can be established between the electronic device 100 and the application server 400. For example, the application server 400 is a social application. A social account of the social application is logged in on the electronic device 100. The application server 400 can send a message that needs to be transmitted to the social account logged in on the electronic device 100 to the electronic device 100. After receiving the message input by the user in the social application, the electronic device 100 can send the message to the application server 400 to instruct the application server 400 to send the message to the corresponding social account.
[0091] In some embodiments, when the distance between the electronic device 100 and the electronic device 200 is within the range of Bluetooth transmission, a Bluetooth connection can be established between the electronic device 100 and the electronic device 200.
[0092] 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 P2P connection through the relay server 300. Alternatively, the electronic device 100 establishes a data transmission channel with the relay server 300, and the electronic device 200 also establishes a data transmission channel with the relay server 300. Furthermore, the relay server 300 can act as a data transfer station. The electronic device 100 and the electronic device 200 can transmit data to the peer device through the relay server 300.
[0093] In some embodiments, the relay server 300 can be a cloud server, or it can also be a physical entity server with a physical entity. The relay server 300 can be an independent server, or it can also be a server cluster composed of multiple servers. The embodiments of the present application do not limit the form of existence of the relay server 300. The relay server 300 can be used to provide functions such as a security authentication function, an address exchange function, and a data forwarding function.
[0094] Among them, the security authentication function can be used to authenticate 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 security authentication can include device authentication and channel authentication. The device authentication can be used to verify the identities 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 having an associated relationship can include: the device accounts logged in on the electronic device 100 and the electronic device 200 being the same, the electronic device 100 and the electronic device 200 establishing other binding relationships, etc. The embodiments of the present application do not limit the associated relationship between the electronic device 100 and the electronic device 200. The 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 the electronic device 200) having the ability to switch between Bluetooth transmission and data transmission by a modem can mean that the electronic device 100 (or the electronic device 200) can transmit data to a target device through a Bluetooth connection and, when the Bluetooth connection between itself and the target device is disconnected, continue to transmit the data originally transmitted through the Bluetooth connection to the target device through the modem.
[0095] The above data transmission through the modem can 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 communication method of transmitting data through the modem as described above can include: communication methods based on mobile communication technologies (such as 2G / 3G / 4G / 5G), communication methods based on wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), and so on. The embodiments of the present application do not limit the communication method of transmitting data through the modem as described above.
[0096] 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 from other devices for device authentication and channel authentication and perform device authentication and channel authentication on other devices.
[0097] The address exchange function can be used for the relay server 300 to assist two electronic devices (such as the electronic device 100 and the electronic device 200) in establishing a P2P connection. Among them, when receiving a request from the electronic device 100 and the electronic device 200 to establish a P2P connection, the relay server 300 can obtain the address of the electronic device 100 and the address of the electronic device 200, and send the address of the electronic device 100 to the electronic device 200 and send the address of the electronic device 200 to the electronic device 100. In this way, the electronic device 100 and the electronic device 200 can establish a P2P connection according to the address of the peer end and achieve point-to-point communication. In some embodiments, the address of the above electronic device 100 may include the internet protocol address (IP address) of the electronic device 100. For example, the external network address (or called the external network IP address) of the electronic device 100. Optionally, the address of the electronic device 100 may also include the internal network address (or called the internal network IP address) of the electronic device 100. Similarly, the address of the above 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 internal network address of the electronic device 200.
[0098] The data forwarding function can be used for the relay server 300 to act as a data transfer station for two electronic devices (such as the electronic device 100 and the electronic device 200) and forward the data of one electronic device to the other electronic device. Among them, when providing the data forwarding function, the relay server 300 can establish data transmission channels with these two electronic devices respectively. The relay server 300 can use the data transmission channels between the relay server 300 and these two electronic devices to forward data.
[0099] In some embodiments, an application corresponding to the application server 400 may also be installed in the electronic device 200. For example, the application corresponding to the application server 400 is the first application. The electronic device 200 may be bound to the application account logged in to the first application in the electronic device 100. The embodiments of the present application do not limit the method for binding the above application accounts. For example, the electronic device 200 may bind the application account logged in to the first application in the electronic device 100 by scanning a QR code through the electronic device 100.
[0100] When receiving data from the application server 400, the electronic device 100 may send the data to the electronic device 200. When the electronic device 200 receives data input by the user in the application corresponding to the application server 400, the electronic device 200 may send the data to the electronic device 100. Then, the electronic device 100 may send the data sent by the above electronic device 200 to the application server 400. It can be seen that the electronic device 200 can communicate with the application server 400 through the electronic device 100.
[0101] For example, the electronic device 100 is a mobile phone. The electronic device 200 is a watch. Social applications may be installed in both the mobile phone and the watch. 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 bind the social account logged in to the social application in the mobile phone through the mobile phone. When the mobile phone receives a message from the application server 400, the mobile phone may send the data to the watch. Moreover, the user can reply to the message in the social application on the watch. The watch can send the reply message input by the user to the mobile phone, and the mobile phone sends the reply message to the application server 400. In this way, the user can quickly view and reply to the messages in the social application on the watch without having to turn on the mobile phone.
[0102] In some embodiments, the device types of the electronic device 100 and the electronic device 200 are different. Although applications corresponding to the application server 400 are installed in both the electronic device 100 and the electronic device 200, the application installation packages of this application in the electronic device 100 and the electronic device 200 (for example, package (Android Package, APK)) may be different. This application installation package may also be referred to by other names such as application program package.
[0103] not limited to Figure 1 For the electronic devices and servers described above, the communication system 10 may further include more or fewer devices.
[0104] The following introduces the structure of the devices involved in the present application.
[0105] Figure 2AThe structural schematic diagram of the electronic device 100 is exemplarily shown.
[0106] As Figure 2A shown, 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, a headphone interface 170D, a sensor module 180, a key 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.
[0107] It can be understood that the structure schematically shown in the embodiments of the present application does 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 in the figure, or combine some components, or split some components, or have different component arrangements. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0108] 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), etc. Among them, different processing units may be independent devices or integrated in one or more processors. In some embodiments, the processor 110 may be a system on chip (SOC).
[0109] Among them, the controller may be the nerve center and command center of the electronic device 100. The controller may generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching instructions and executing instructions.
[0110] A memory can also be provided in the processor 110 for storing instructions and data. In some examples, the memory in the processor 110 is a cache memory. This memory can hold the instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use the instruction or data again, it can directly call it from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0111] In this application, the memory can store a computer program for enabling a controller or processor to implement the device communication method of this application through an interface or protocol. Exemplarily, the computer program stored in the memory can be used for: establishing a Bluetooth connection with other devices, detecting whether the Bluetooth connection is disconnected, establishing a P2P connection with other devices or connecting with other devices through the relay server 300 after the Bluetooth connection with other devices is disconnected, determining the current connection method between itself and other devices to use the currently existing connection method to transmit data with other devices, and so on.
[0112] The USB interface 130 is an interface that conforms to the USB standard specification, and can specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used for data transmission between the electronic device 100 and peripheral devices. It can also be used to connect headphones to play audio through the headphones.
[0113] The charging management module 140 is used to receive a charging input from a charger. Among them, the charger can be a wireless charger or a wired charger. While charging the battery 142, the charging management module 140 can also supply power to the electronic device through the power management module 141.
[0114] 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 inputs from the battery 142 and / or the charging management module 140 and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, the wireless communication module 160, etc.
[0115] The wireless communication function of the electronic device 100 can be implemented through antenna 1, antenna 2, the mobile communication module 150, the wireless communication module 160, the modulation and demodulation processor, and the baseband processor, etc.
[0116] Antenna 1 and Antenna 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization rate of the antennas. For example, Antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0117] The mobile communication module 150 can provide solutions for wireless communications such as 2G / 3G / 4G / 5G applied to the electronic device 100. The mobile communication module 150 can include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves through Antenna 1, filter, amplify and process the received electromagnetic waves, and then 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 through Antenna 1 for radiation. In some embodiments, at least some functional modules of the mobile communication module 150 can be disposed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 can be disposed in the same device.
[0118] The modulation and demodulation processor can include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. Subsequently, the demodulator 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 transmitted to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, receiver 170B, etc.), or displays an image or video through the display screen 194. In some embodiments, the modulation and demodulation processor can be an independent device. In some other embodiments, the modulation and demodulation processor can be independent of the processor 110 and be disposed in the same device as the mobile communication module 150 or other functional modules (such as the wireless communication module 160). The modulation and demodulation processor can also be referred to as a modem.
[0119] The wireless communication module 160 may provide wireless communication solutions applied to the electronic device 100, including WLAN (such as Wi-Fi network, P2P network), Bluetooth (BT), Global Navigation Satellite System (GNSS), Frequency Modulation (FM), Near Field Communication (NFC), Infrared (IR), etc. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering processing on the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 may also receive the signals to be sent from the processor 110, perform frequency modulation and amplification on them, and convert them into electromagnetic waves through the antenna 2 for radiation.
[0120] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technologies.
[0121] The electronic device 100 realizes the display function through the GPU, the display screen 194, and the application processor, etc. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering.
[0122] The display screen 194 is used to display images, videos, etc. In some embodiments, the electronic device 100 may include one or N display screens 194, where N is a positive integer greater than 1.
[0123] The electronic device 100 can realize the shooting function through the ISP, the camera 193, the video codec, the GPU, the display screen 194, and the application processor, etc.
[0124] The ISP is used to process the data fed back by the camera 193. For example, when taking a photo, the shutter is opened, and the light passes through the lens and is transmitted to the camera sensor. The optical signal is converted into an electrical signal, and the camera sensor transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye.
[0125] The camera 193 is used to capture static images or videos. In some embodiments, the electronic device 100 may include one or N cameras 193, where N is a positive integer greater than 1.
[0126] 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, etc.
[0127] The NPU is a neural-network (NN) computing processor. By learning from the biological neural network structure, such as the transmission mode between human brain neurons, it can quickly process the input information and can also continuously self-learn. Through the NPU, applications such as intelligent cognition of the electronic device 100 can be realized, such as image recognition, face recognition, speech recognition, text understanding, etc.
[0128] 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 through the external memory interface 120 to implement the data storage function. For example, files such as music and videos are saved in the external memory card.
[0129] The internal memory 121 can be used to store computer-executable program code, and the executable program code includes 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 can include a program storage area and a data storage area. Among them, the program storage area can store the operating system, application programs required for at least one function (such as the sound playback function, the image playback function, etc.). The data storage area can store the data created during the use of the electronic device 100 (such as audio data, phone book, etc.). In addition, the internal memory 121 can include high-speed random access memory and can also include non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0130] The electronic device 100 can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone interface 170D, and the application processor, etc. For example, music playback, recording, etc.
[0131] 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.
[0132] 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.
[0133] 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.
[0134] 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.
[0135] 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 exemplified.
[0136] Figure 2B A structural diagram of another electronic device 100 is exemplarily shown.
[0137] 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, which are, from top to bottom, the application layer, the application framework layer, the Android Runtime and system libraries, and the kernel layer. In addition to software, the electronic device 100 also includes hardware devices. The hardware devices in the electronic device 100 can be divided into a hardware layer. The electronic device 100 can drive the hardware devices in the hardware layer through software to implement corresponding functions.
[0138] 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 signal to be sent and demodulate the received signal. The modem can refer to the introduction of the foregoing Figure 2A embodiment.
[0139] The application layer may include a series of application packages.
[0140] As Figure 2B shown, the application packages may include applications such as a camera, a gallery, a calendar, a call, a map, a navigation, a WLAN, a Bluetooth application, music, a short message, and a social application. Among them, the Bluetooth application can be used to provide functions such as turning on or off the Bluetooth function, establishing a Bluetooth connection with other devices, or disconnecting a Bluetooth connection. The social application can be used to provide social communication services (such as sending short messages, making voice / video calls, receiving voice / video calls, content sharing, etc.).
[0141] The application framework layer provides APIs and programming frameworks for the applications in the application layer. The application framework layer includes some predefined functions.
[0142] As Figure 2B shown, the application framework layer may include a window manager, a content provider, a view system, a telephone manager, a resource manager, a notification manager, an activity manager, a Bluetooth service, a wearable device management service, a network management interface, etc.
[0143] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.
[0144] The content provider is used to store and obtain data and make these data accessible to applications. The data may include videos, images, audio, dialed and received calls, browsing history and bookmarks, phone books, etc.
[0145] The view system includes visible controls, such as controls for displaying text, controls for displaying pictures, etc. The view system can be used to build applications. The display interface can be composed of one or more views. For example, a display interface including a short message notification icon may include a view for displaying text and a view for displaying pictures.
[0146] The telephone manager is used to provide the communication function of the electronic device 100. For example, the management of call states (including connection, disconnection, etc.).
[0147] The resource manager provides various resources for applications, such as localized strings, icons, pictures, layout files, video files, and so on.
[0148] The notification manager enables 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, which can automatically disappear after a short stay without user interaction. For example, the notification manager is used to inform the completion of a download, message reminder, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as the notification of a background-running application, or a notification that appears in the form of a dialogue window on the screen. For example, it prompts text information in the status bar, emits a prompt tone, vibrates the electronic device, blinks the indicator light, etc.
[0149] The activity manager is responsible for managing activities, and is responsible for the startup, switching, scheduling of various components in the system, as well as the management and scheduling of applications. The activity manager can be called by upper-layer applications to open the corresponding activity.
[0150] Android Runtime includes core libraries and a virtual machine. Android Runtime is responsible for the scheduling and management of the Android system.
[0151] The Bluetooth service can be used to provide a data transmission interface for applications in the above application layer (for example, Bluetooth applications, social applications, etc.), so that applications can transmit application data to the Bluetooth service.
[0152] 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 through the Bluetooth connection.
[0153] The network management interface (network socket) can be used to provide the function of calling the modem. The network management interface can also be called by other names such as network interface.
[0154] In some embodiments, the Bluetooth service can call the modem through the network management interface so as to send application data to other devices through the modem.
[0155] 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 the wireless communication module in the electronic device 100 (see the schematic structural diagram of the electronic device 100 shown in Figure 2A ) to establish a connection for communication based on the modem with other devices. For example, a P2P connection, a connection with the relay server 300 as the data transfer station, and so on.
[0156] The Bluetooth service can receive the application data of the application in the application layer. The Bluetooth service can determine the communication connection method between the electronic device 100 and the target device of the application data. The target device of the above application data can 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 as to send the application data to the target device through the Bluetooth connection. If a connection for communication based on the modem 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 as to send the application data to the target device using the connection for communication based on the modem.
[0157] The wearable device management service can be used to provide a data transmission interface for the applications (such as social applications, etc.) in the above application layer, for the applications to transmit the application data to the wearable device management service. The wearable device management service can call the Bluetooth chip to send the 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 the application data to other devices through the modem. Similar to the Bluetooth service, the wearable device management service decides whether to transmit the application data from the applications in the application layer through the Bluetooth chip or through the modem. Specifically, reference can be made to the foregoing introduction to the Bluetooth service. Details are not described herein again. The wearable device management service can also be called by names such as Wear Engine.
[0158] The data transmission interfaces provided by the Bluetooth service and the wearable device management service are different. This can be used for different applications in the application layer to make selections. For example, the data transmission interface provided by the Bluetooth service can be the native interface of the system, which can be used by one or more applications that have not updated the data transmission interface. These one or more applications may 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 a new interface different from the native interface of the system. After one or more applications are adapted to the above new interface, they can transmit the application data to the wearable device management service through the new interface.
[0159] In some embodiments, the electronic device 100 may include one of a Bluetooth service and a wearable device management service, or may include both the Bluetooth service and the wearable device management service.
[0160] In some embodiments, the Bluetooth service and the wearable device management service may be included in a certain service in the application framework layer, for example, Service A. Service A may provide a data transmission interface to applications in the application layer. The applications in the application layer may send application data to Service A based on the data transmission interface provided by Service A. Among them, the Bluetooth service may call a Bluetooth chip. The wearable device management service may call a modem through a network management interface. Optionally, the network management interface and the wearable device management service may be combined into one module. Service A may determine the communication connection method between the electronic device 100 and the target device of the application data. If a Bluetooth connection is established between the electronic device 100 and the target device of the application data, Service A may transmit the application data to the Bluetooth chip through the Bluetooth service, so as to send the application data to the target device through the Bluetooth connection. If a connection for communication based on the modem is established between the electronic device 100 and the target device of the application data, Service A may transmit the application data to the modem through the wearable device management service and the network management interface, so as to send the application data to the target device using the connection for communication based on the modem.
[0161] In some embodiments, the Bluetooth service may include the wearable device management service. Among them, the Bluetooth service's calling of the modem through the network management interface may be completed by the wearable device management service in the Bluetooth service.
[0162] Alternatively, the wearable device management service may include the Bluetooth service. The embodiments of the present application do not limit the relationship between the Bluetooth service and the wearable device management service.
[0163] The core library includes two parts: one part is the functional functions that need to be called by the Java language, and the other part is the core library of Android.
[0164] The application layer and the application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as management of object life cycles, stack management, thread management, security and exception management, and garbage collection.
[0165] The system library may include multiple functional modules. For example: surface manager, Media Libraries, three-dimensional graphics processing library (e.g., OpenGL ES), two-dimensional graphics engine (e.g., SGL), etc.
[0166] The surface manager is used to manage the display subsystem and provides the fusion of 2D and 3D layers for multiple applications.
[0167] The media library supports the playback and recording of a variety of common audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video coding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0168] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing, etc.
[0169] The 2D graphics engine is a drawing engine for 2D drawing.
[0170] The kernel layer is the layer between hardware and software. The kernel layer at least includes a display driver, a camera driver, an audio driver, and a sensor driver.
[0171] Figure 2B The schematic structure does not limit the electronic device 100. The electronic device 100 may include more or fewer modules than Figure 2B shown, or combine certain modules, or split certain modules, or have different module arrangements.
[0172] The above Figure 2A and Figure 2B The electronic device 100 shown may be a mobile phone, a tablet computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), etc. The embodiments of the present application do not limit the specific type of the electronic device 100.
[0173] Figure 3A An exemplary schematic diagram of the structure of the electronic device 200 is shown.
[0174] As Figure 3A shown, 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 through a bus.
[0175] The application processor 220 may also be referred to as the 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-chip (SOC) integrated with multiple processors.
[0176] 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 / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0177] 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. Among them, the program storage area may store an operating system and one or more application programs (such as a camera application, a phone application), and the data storage area may store data created by the user during the use of the electronic device 200 (such as photos, contacts). The memory 230 may be a high-speed random access memory or a non-volatile memory, such as a magnetic disk, a flash memory, a universal flash storage (UFS), etc. The memory 230 may also be an external memory card, such as a Micro SD card.
[0178] The MCU 250 may include a scaled-down central processing unit (CPU), necessary memory, and peripherals, such as a read-only memory (ROM), a random access memory (RAM), a pseudo static random access memory (PSRAM), a general-purpose input / output (GPIO) interface, a serial port, a timer, etc. The MCU 250 may also be connected to the memory 230 to store application programs and user data running on the MCU 250. The MCU 250 can be used as a coprocessor of the application processor 220 to assist the application processor 220 in completing processing tasks that it cannot execute or executes inefficiently, such as signal transmission between devices, management of access devices, Bluetooth communication management, audio processing, etc., so as to reduce the burden on the application processor 220, reduce power consumption, and improve the battery life of the device.
[0179] Exemplarily, when the electronic device 200 is in the low-power mode, the application processor 220 enters the sleep state to save power consumption; at this time, the MCU 250 can monitor whether a touch signal arrives at the touch sensor provided on the display screen 260. The touch signal can be generated by the user's touch operation. If a touch signal arrives, the MCU 250 can wake up the application processor 220 to light up the display screen 260.
[0180] The application processor 220 and the MCU 250 can run different tasks relatively independently, and the two can be isolated from each other and run different operating systems or bare-metal programs. For example, the Linux operating system runs on the application processor 220, while a lightweight operating system such as a real-time operating system (RTOS) runs on the MCU 250. The two can communicate with each other through a bus, shared memory, etc. In some embodiments, although different systems run on the application processor 220 and the MCU 250, the application processor 220 can be used 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 MCU 250.
[0181] The electronic device 200 can achieve complex displays through the application processor 220 and the display screen 260, such as real-time refresh of the game application interface, preview screen display of the camera application, and updating the interface following the user's touch operation. The electronic device 200 can also achieve simple displays through the MCU 250 and the display screen 260, such as only displaying the current time in the 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 screen, an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED) display screen, a flexible light-emitting diode (FLED) display screen, a quantum dot light-emitting diode (QLED) display screen, etc.
[0182] The wireless communication module 210 may include mobile communication modules such as 2G / 3G / 4G / 5G, Wi-Fi communication module, P2P communication module, Bluetooth communication module, GNSS communication module, FM communication module, NFC communication module, IR communication module, etc. 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, performs frequency modulation and filtering processing on the electromagnetic wave signals, and sends the processed signals to the application processor 220 or the MCU 250. The wireless communication module 210 may also receive signals to be sent from the application processor 220 or the MCU 250, perform frequency modulation and amplification on them, and convert them into electromagnetic waves through the antenna for radiation.
[0183] Among them, the received signals of the 2G / 3G / 4G / 5G mobile communication module, Wi-Fi communication module, and P2P communication module also need to be demodulated into low-frequency baseband signals by a modem and then transmitted to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signals are transmitted to the application processor 220. The application processor 220 outputs sound through an audio device (not limited to speakers, receivers, etc.), or displays images or videos through a display screen. The signals to be sent by the 2G / 3G / 4G / 5G mobile communication module, Wi-Fi communication module, and P2P communication module also need to be modulated into medium-high frequency signals by a modem and then transmitted through the antenna.
[0184] The sensor 240 may include a gyroscope sensor, an acceleration sensor, a pressure sensor, a proximity light sensor, an ambient light sensor, a temperature sensor, a distance sensor, and a touch-sensitive sensor provided on the display screen 260, etc.
[0185] Figure 3A The schematic structure does not limit the electronic device 200. The electronic device 200 may include more or fewer components than Figure 3A shown, or combine some components, or split some components, or have different component arrangements. Figure 3A The components shown may be implemented in hardware, software, or a combination of software and hardware.
[0186] For example, without limitation Figure 3A shown in the dual processors, the electronic device 200 may also have only one processor. Optionally, one processor in the electronic device 200 may be a dual-core processor. For example, this one processor may include two processing units. One of the two processing units may be used as the main processing unit, and the other processing unit may be used as the coprocessing unit. When the electronic device 200 is in the low-power mode, the main processing unit in the electronic device 200 may be in the sleep state to save power consumption.
[0187] The software system of the electronic device 200 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservices architecture, or a cloud architecture. In the embodiments of this application, taking the system as an example, the software structure of the electronic device 200 will be exemplarily described.
[0188] Figure 3B An exemplary structural schematic diagram of another electronic device 200 is shown.
[0189] The layered architecture divides the software into several layers, and each layer has 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 are the application layer, the application framework layer, Android Runtime and system libraries, and the kernel layer.
[0190] Among them, the electronic device 200 includes two processors: an application processor (AP) and a microprocessor (MCU). From the Figure 3A structure shown above, the AP and the MCU can be isolated from each other and can each independently run an operating system. Based on the above layered architecture, the operating system running on the AP may include the application layer, the application framework layer, Android Runtime and system libraries, and the kernel layer. The operating system running on the MCU may also include the application layer, the application framework layer, Android Runtime and system libraries, and the kernel layer.
[0191] Each layer of the operating system running on the AP may refer to the Figure 2B introduction above.
[0192] As a coprocessor of the AP, the content included in each layer of the operating system running on the MCU may be less than that of the AP.
[0193] Exemplarily, the applications included in the application layer of the MCU can be fewer than those included in the application layer of the AP. For example, the application layer of the MCU can include applications such as a gallery, a calendar, a map, WLAN, short messages, Bluetooth applications, and social applications, but does not include applications such as a camera, music, calls, and navigation. The modules included in the application framework layer of the MCU can be fewer than those included in the application framework layer of the AP. For example, the application framework layer of the MCU can include a window manager, a content provider, a resource manager, an activity manager, a view system, a Bluetooth service, a wearable device management service, and a network management interface, but does not include a phone manager. The modules included in the system library of the MCU can be fewer than those included in the system library of the AP. For example, the system library of the MCU can include a surface manager, a 2D graphics engine, and a media library, but does not include a 3D graphics processing library. The modules included in the kernel layer of the MCU can be fewer than those included in the kernel layer of the AP. For example, the kernel layer of the MCU can include a display driver, a sensor driver, and an audio driver, but does not include a camera driver.
[0194] The content included in the above MCU is only an exemplary illustration of this application and should not constitute a limitation to this application. The operating system running on the MCU can also include more or less content.
[0195] In some embodiments, one or more applications in the electronic device 200 can run only on the AP, or only on the MCU, or can run on both the AP and the MCU. That is, the application layer of the AP can include applications that are not in the application layer of the MCU. The application layer of the MCU can also include applications that are not in the application layer of the AP. The application layer of the AP and the application layer of the MCU can also include one or more identical applications.
[0196] The content included in the operating system running on the MCU can also refer to the introduction in the foregoing Figure 2B and will not be elaborated here.
[0197] In addition to the software programs in the AP and the MCU described above, the electronic device 200 also includes hardware devices. The hardware devices in the electronic device 200 can be divided into a hardware layer. In the electronic device 200, the AP can drive the hardware devices in the hardware layer through the software program running on the AP, and the MCU can drive the hardware devices in the hardware layer through the software program running on the MCU.
[0198] The hardware layer can 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 signal to be sent and demodulate the received signal. The modem can refer to the introduction in the foregoing Figure 2A embodiment.
[0199] Figure 3B The schematic structure does not limit the electronic device 200, and the electronic device 200 may include more or fewer modules than Figure 3B those shown, or combine certain modules, or split certain modules, or have different module arrangements.
[0200] In some embodiments, the application layer of the AP and the application layer of the MCU can communicate. Exemplarily, when the electronic device 200 is in the low-power mode, the AP in the electronic device 200 is in the sleep state. At this time, when the electronic device 200 receives the data sent by the electronic device 100, 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 through 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 the wearable device management service in the application framework layer of the MCU. If the data is transmitted by a connection based on a modem for 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 the wearable device management service through the network management interface in the MCU. Further, the Bluetooth service or the wearable device management service in the MCU can transmit the data to the corresponding application in the application layer.
[0201] Among them, the MCU can determine whether it can independently process the above data from the electronic device 100. If the MCU cannot independently process the data, the MCU can wake up the AP and hand over the data to the AP for processing. For example, the above data from the electronic device 100 is a message of a social application. After the electronic device 200 receives the message, it needs to turn on the screen to display the message notification. Then, when the above message is transmitted through the hardware layer to the application framework layer of the MCU and then to the social application in the application layer of the MCU, the social application in the MCU can send the message to the social application in the AP. After the AP is woken up, the social application in the AP can call the corresponding modules in the application framework layer, the system library, and the kernel layer in the AP according to the message to turn on the screen of the electronic device 200 to display the message notification of the social application.
[0202] In some embodiments, the application framework layer of the AP and the application framework layer of the MCU can communicate. When the electronic device 200 receives data from the electronic device 100 in the 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 the 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 the wearable device management service in the AP). After the AP is woken up, the application framework layer in the AP can transmit the data to the corresponding application in the application layer of the AP.
[0203] 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 the 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 implement the 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 implement the communication connection between the electronic device 200 and the electronic device 100.
[0204] Among them, if the MCU in the electronic device 200 can run the corresponding program to establish a P2P connection between the electronic device 200 and the electronic device 100 or establish a data transmission channel with the relay server 300, the Bluetooth service or the wearable device management service in the MCU can send a message indicating that the Bluetooth connection is disconnected to the applications in the application layer of the MCU (such as the Bluetooth application, the 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.
[0205] If the MCU in the electronic device 200 needs to wake up the AP, the AP runs the corresponding program to establish a P2P connection between the electronic device 200 and the electronic device 100 or establish a data transmission channel with the relay server 300. The Bluetooth service (or wearable device management service) in the MCU can send a message of disconnecting the Bluetooth connection 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 message of disconnecting the Bluetooth connection 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 establish a data transmission channel with the relay server 300.
[0206] The communication between the application layer in the above AP and MCU and the communication between the application framework layers are only exemplary descriptions of this application and should not limit this application.
[0207] The above Figure 3A and Figure 3B The electronic device 200 shown can be a wearable device such as a smart watch or a smart bracelet, an Internet of Things (IoT) device, etc. The embodiments of this application do not limit the specific type of the electronic device 200.
[0208] Figure 4 The structural schematic diagram of the relay server 300 is exemplarily shown.
[0209] As Figure 4 shown, 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 can be connected through a bus 313 or other means. Figure 4 Taking the connection through the bus as an example for illustration. Among them:
[0210] The communication interface 312 can be used for the relay server 300 to communicate with other electronic devices, such as Figure 1 the electronic device 100, the electronic device 200, etc. shown. 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 wireless communication interfaces, the relay server 300 can also be configured with a wired communication interface 312 to support wired communication.
[0211] 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 perform transmission processing on the signals output by the processor 310. The receiver 315 can be used to receive signals. In the relay server 300, the number of the transmitter 314 and the receiver 315 can each be one or more. The antenna 317 can be used to convert the electromagnetic energy in the transmission line into electromagnetic waves in free space, or convert the 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 it to multiple receivers 315. It can be understood that the antenna 317 of the relay server 300 can be implemented as a massive antenna array.
[0212] The memory 311 is coupled to the processor 310 and is used to store various software programs and / or multiple sets of instructions. Specifically, the memory 311 can include a high-speed random access memory, and can also include non-volatile memory, such as one or more disk storage devices, flash memory devices or other non-volatile solid-state storage devices.
[0213] The memory 311 can store an operating system (hereinafter referred to as the system), such as and other embedded operating systems. The memory 311 can also store a network communication program, which can be used to communicate with one or more electronic devices (such as the electronic device 100).
[0214] In the embodiments of the present application, the memory 311 can be used to store the device information (such as device account information, device identifier, 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 to establish a P2P connection with other devices from the relay server 300.
[0215] Optionally, when the relay server 300 serves as a data transfer station for data transmission between the electronic device 100 and the electronic device 200, the memory 311 can store the data that the electronic device 100 wants to send to the electronic device 200, and the data that the electronic device 200 wants to send to the electronic device 100.
[0216] In the embodiments of the present application, the processor 310 can be used to read and execute computer-readable instructions. Specifically, the processor 310 can be used to call the program stored in the memory 311 and execute the instructions included in the program. The program can be, for example, an implementation program for device authentication, an implementation program for channel authentication, an implementation program for address exchange, an implementation program for data transfer, etc. provided by one or more embodiments of the present application.
[0217] It should be noted that Figure 4The relay server 300 shown is merely one implementation of the embodiments of the present application. In actual applications, the relay server 300 may also include more or fewer components, which are not limited here.
[0218] Figure 5 Exemplarily shown is a schematic diagram of a communication system provided by the present application.
[0219] As Figure 5 shown, the communication system may include an electronic device 100, an electronic device 200, and a relay server 300.
[0220] The relay server 300 may include a security authentication module, an address exchange module, and a data forwarding module. Among them, the security authentication module can be used to provide a security authentication function. The address exchange module can be used to provide an address exchange function. The data forwarding function can be used to provide a data forwarding function. The above security authentication function, address exchange function, and data forwarding function can refer to the introduction in the foregoing embodiments. Details are not elaborated here.
[0221] The electronic device 100 may include an application program, a Bluetooth service, a network management interface, a Bluetooth chip, and a modem. The electronic device 200 may also include an application program, a Bluetooth service, a network management interface, a Bluetooth chip, and a modem. Specifically, reference can be made to the introduction in the foregoing Figure 2B and Figure 3B .
[0222] In some embodiments, Figure 5 the application program in the shown electronic device 200 may be an application program on the AP or an application program on the MCU. Figure 5 The Bluetooth service and the network management interface in the shown electronic device 200 may belong to the application framework layer in the AP or the application framework layer in the MCU.
[0223] In some embodiments, when the distance between the electronic device 100 and the electronic device 200 is within the Bluetooth transmission distance range, the electronic device 100 and the electronic device 200 may establish a Bluetooth connection. When the electronic device 100 and the electronic device 200 have established a Bluetooth connection, the application program in the electronic device 100 may send application data to the Bluetooth service. The Bluetooth service in the electronic device 100 may send the application data to the Bluetooth chip. The Bluetooth chip in the electronic device 100 may send the application data to the electronic device 200 through the Bluetooth connection. The Bluetooth chip in the electronic device 200 may receive the above application data from the electronic device 100 and send the application data to the Bluetooth service. The Bluetooth service in the electronic device 200 may send the application data to the corresponding application program.
[0224] 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 application data from the electronic device 100 described above, 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.
[0225] When the Bluetooth connection between the electronic device 100 and the electronic device 200 is disconnected and a data transmission channel is established between the electronic device 100 and the relay server 300, and a data transmission channel is also established between the electronic device 200 and the relay server 300, the electronic device 100 and the electronic device 200 can transmit data through the relay server 300. Among them, after the Bluetooth service in the electronic device 100 receives the application data of the application, it can send the application data to the modem through the network management interface. The modem in the electronic device 100 can send the application data to the relay server 300 through the data transmission channel between the electronic device 100 and the relay server 300. The data forwarding module in the relay server 300 can send the application data from the electronic device 100 described above to the electronic device 200 through the data transmission channel between the electronic device 200 and the relay server 300. The modem in the electronic device 200 can receive the application data forwarded by the relay server 300 described above and send the 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] 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 through the Bluetooth connection, or the P2P connection, or the relay server 300. The specific process can refer to the process of the electronic device 100 sending data to the electronic device 200 above.
[0227] Figure 6 An exemplary schematic diagram of another communication system provided by the present application is shown.
[0228] As Figure 6As shown, the communication system may include electronic device 100, electronic device 200, and relay server 300. Electronic device 100, electronic device 200, and relay server 300 may all refer to the foregoing Figure 5 introduction. Different from Figure 5 , electronic device 100 and electronic device 200 include a wearable device management service. Electronic device 100 may send the application data of an application to electronic device 200 through the wearable device management service via a Bluetooth chip or a modem. Electronic device 200 may also send the application data of an application to electronic device 100 through the wearable device management service via a Bluetooth chip or a modem. The specific data transmission process may refer to the foregoing Figure 5 process of data transmission based on Bluetooth service. Details are not described herein again.
[0229] In some embodiments, Figure 6 the application in the electronic device 200 shown may be an application on the AP or may be an application on the MCU. Figure 6 The wearable device management service and the network management interface in the electronic device 200 shown may belong to the application framework layer in the AP or may belong to the application framework layer in the MCU.
[0230] In some embodiments, the data transmission interface provided by the Bluetooth service to the application may be a native interface of the operating system (such as system) in electronic device 100 or electronic device 200. The application may not need to be adaptively modified for the solution of this application. The data transmission interface provided by the wearable device management service to the application may be a new interface different from the above native interface. After the application adapts to the above new interface, it may transmit the application data to the wearable device management service, and then the wearable device management service may send the application data to other devices.
[0231] From the communication system shown in the foregoing Figure 5 and Figure 6 , it can be seen that the upper-layer applications in electronic device 100 and electronic device 200 may not need to be aware of the actual data transmission method. After the application sends the application data to the Bluetooth service or the wearable device management service, the Bluetooth service or the wearable device management service may determine the data transmission method according to the current connection method between electronic device 100 and electronic device 200.
[0232] It should be noted that, not limited to Figure 5 and Figure 6During the process of the application data being transmitted 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, such as the processing of the application data by the Bluetooth service or wearable device management service shown, the processing of the application data by the Bluetooth chip, and the processing of the application data by the modem.
[0233] Figure 7 Exemplarily shown is a flowchart of a device communication method provided by this application.
[0234] As Figure 7 shown, the method may include steps S711 to S718.
[0235] S711. The electronic device 100 and the electronic device 200 establish a Bluetooth connection.
[0236] S712. Detect whether the Bluetooth connection between the electronic device 100 and the electronic device 200 is disconnected.
[0237] In some embodiments, when the electronic device 100 and the electronic device 200 establish a Bluetooth connection, in order to maintain the Bluetooth connection, the electronic device 100 and the electronic device 200 can send Bluetooth heartbeat packets to each other at regular 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 can 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 can determine that the Bluetooth connection between the electronic device 100 and the electronic device 200 is disconnected.
[0238] In addition to detecting whether the Bluetooth connection is disconnected through the above-mentioned Bluetooth heartbeat packet, the electronic device 100 and the electronic device 200 can also use other methods to detect whether the Bluetooth connection is disconnected. The embodiments of this application do not limit this.
[0239] S713. The electronic device 100 and the electronic device 200 transmit data through the Bluetooth connection.
[0240] If the Bluetooth connection is maintained between the electronic device 100 and the electronic device 200 (i.e., the Bluetooth connection is not disconnected), the electronic device 100 can send data to the electronic device 200 through this Bluetooth connection, and the electronic device 200 can also send data to the electronic device 100 through this Bluetooth connection.
[0241] S714. The electronic device 100 and the electronic device 200 establish a P2P connection.
[0242] 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 attempt to establish a P2P connection.
[0243] 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 specifically introduced in subsequent embodiments. It will not be elaborated here for now.
[0244] S715. Detect whether the P2P connection between the electronic device 100 and the electronic device 200 is successfully established.
[0245] In some embodiments, the network environments where the electronic device 100 and the electronic device 200 are located both support P2P connections. The electronic device 100 and the electronic device 200 can successfully establish a P2P connection. If either one of the electronic device 100 and the electronic device 200 or the network environments where both are located do not support P2P connections, then the electronic device 100 and the electronic device 200 cannot successfully establish a P2P connection. For example, if the network address translation (NAT) gateway of the electronic device 200 does not support the P2P protocol, then the electronic device 200 cannot establish a P2P connection with other devices.
[0246] Therefore, the electronic device 100 and / or the electronic device 200 can detect whether the P2P connection between the electronic device 100 and the electronic device 200 is successfully established.
[0247] S716. The electronic device 100 and the electronic device 200 transmit data through the P2P connection.
[0248] If the P2P connection between the electronic device 100 and the electronic device 200 is successfully established, 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.
[0249] 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.
[0250] If the P2P connection between the electronic device 100 and the electronic device 200 fails to be successfully established, the electronic device 100 can establish a data transmission channel with the relay server 300, and the electronic device 200 can establish a data transmission channel with the relay server 300. Among them, the data transmission channel between the electronic device 100 and the relay server 300 can 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 can be used for the electronic device 200 and the relay server 300 to transmit application data. For example, the above application data can include but is not limited to: application data of social applications (such as messages of contacts), application data of audio and video applications (such as audio fluctuation data, video fluctuation data), and so on.
[0251] S718. The electronic device 100 and the electronic device 200 transmit data through the relay server 300.
[0252] 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 can transmit data through the relay server 300.
[0253] The above steps S714 - 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 can directly execute step S717.
[0254] Figure 8 An exemplary flowchart of a device communication method provided by the present application is shown.
[0255] As Figure 8 shown, the method may include steps S811 - S815.
[0256] S811. The first device detects first data in a first application to be sent to the second device.
[0257] S812. The first device determines the data transmission method between the first device and the second device.
[0258] The first application may be installed in the first device. When the first data to be sent to the second device in the first application is detected, the first device can determine the data transmission method between the first device and the second device.
[0259] Among them, 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 the method of transmitting data through the Bluetooth connection. The electronic device 100 can execute the following step S813.
[0260] 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 to transmit data through the P2P connection. The electronic device 100 may execute the following step S814.
[0261] 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 to transmit data through the relay server 300. The electronic device 100 may execute the following step S815.
[0262] S813. The first device sends the first data to the second device based on the Bluetooth connection.
[0263] S814. The first device sends the first data to the second device based on the P2P connection.
[0264] 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.
[0265] In some embodiments, the first device may be the aforementioned Figure 1 shown electronic device 100 (such as a mobile phone). The second device may be the aforementioned Figure 1 shown electronic device 200 (such as a watch or a bracelet). The above 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 by contacts logged in to the social account in the first application on the first device to the social account. For another example, the first application is an audio-video application. The first data may include audio playback data and / or video playback data.
[0266] In some embodiments, the first device may be the aforementioned Figure 1 shown electronic device 200. The second device may be the aforementioned Figure 1 shown electronic device 100. The above first data may be determined by the first device according to user input. For example, the first application is a social application. The first data may include messages that the user inputs in the first device and needs to send to a certain contact. For another example, the first application is an audio-video application. The first data may include an audio switching instruction determined according to the user's operation of switching audio on the first device.
[0267] The first device may include the aforementioned Figure 2B shown Bluetooth service and / or wearable device management service. The above step S811 and step S812 may be executed by the Bluetooth service or the wearable device management service in the first device.
[0268] From the above Figure 7 and Figure 8As can be seen from the method shown, 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 still establish a communication connection for transmitting data based on a modem. For example, a P2P connection, a communication connection with the relay server 300 as a data transfer station. The above communication connection for transmitting data based on a modem can be not limited by the distance between the electronic device 100 and the electronic device 200. Whether the electronic device 100 and the electronic device 200 are close or far apart, the electronic device 200 can communicate with the electronic device 100 to provide one or more services to the user with the assistance of the electronic device 100. For example, when the user only takes the electronic device 200 out, the user can still view the message notifications of the social application in time through the electronic device 200 and reply to the messages. This can improve the user experience of using the electronic device 200.
[0269] The process of establishing a communication connection for transmitting data based on a modem in the present application will be introduced below.
[0270] Figure 9 A flowchart of a method for establishing a communication connection for transmitting data based on a modem provided by the present application is exemplarily shown.
[0271] As Figure 9 shown, the communication connection for transmitting data based on a modem can be a P2P connection. The method for establishing this connection can include three stages:
[0272] Stage 1, device authentication (S911~S915)
[0273] S911, the electronic device 100 requests device authentication from the relay server 300.
[0274] S912, the electronic device 200 requests device authentication from the relay server 300.
[0275] 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 (such as not receiving the Bluetooth heartbeat packet of the electronic device 200 within a preset time period), the electronic device 100 can request device authentication from the relay server 300. The device authentication request of the above electronic device 100 can include the device information of the electronic device 100, for example, the device account information of the electronic device 100.
[0276] 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 of 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 the device information of the electronic device 200. For example, the device account information of the electronic device 200.
[0277] In addition to the above device account information, the device authentication requests of the electronic device 100 and the electronic device 200 may also include other information. This application embodiment does not limit this.
[0278] S913. The relay server 300 detects that the electronic device 100 and the electronic device 200 are associated devices.
[0279] In some embodiments, when receiving the device authentication request of the electronic device 100, the relay server 300 may store the device information of the electronic device 100. When receiving the device authentication request of the electronic device 200, the relay server 300 may store the device information of the electronic device 200. According to the device information of the electronic device 100 and the electronic device 200, the relay server 300 may detect whether the electronic device 100 and the electronic device 200 are associated devices. For example, when detecting that the device accounts of the electronic device 100 and the electronic device 200 are the same, the relay server 300 may determine that the electronic device 100 and the electronic device 200 are associated devices.
[0280] In the case where the electronic device 100 and the electronic device 200 are associated devices, the relay server 300 may generate a device identifier of the electronic device 100 and a device identifier of 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 the 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 the second device identifier.
[0281] S914. The relay server 300 sends a message indicating that device authentication is passed to the electronic device 100.
[0282] S915. The relay server 300 sends a message indicating that device authentication is passed to the electronic device 200.
[0283] When the electronic device 100 and the electronic device 200 are associated devices, the relay server 300 may send messages indicating that device authentication has passed to the electronic device 100 and the electronic device 200 respectively. Among them, the message indicating that device authentication has passed sent by the relay server 300 to the electronic device 100 may include the device identifier of the above-mentioned electronic device 100 (such as the first device identifier). The message indicating that device authentication has passed sent by the relay server 300 to the electronic device 200 may include the device identifier of the above-mentioned electronic device 200 (such as the second device identifier).
[0284] In some embodiments, the device authentication request sent by the electronic device 100 in the above step S911 may include one or more pieces of device information of the electronic device 200. In this way, according to 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 the above step S912 may include one or more pieces of device information of the electronic device 100. In this way, according to 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.
[0285] It can be seen that the above device authentication can be used to verify whether the electronic device 100 and the electronic device 200 have an associated relationship. If the electronic device 100 and the electronic device 200 have an associated relationship (that is, the electronic device 100 and the electronic device 200 are associated devices), then the device authentication of both the electronic device 100 and the electronic device 200 passes. The above device authentication can ensure that the peer device is the desired device when two devices establish a communication connection for transmitting data based on the modem. This can improve the security of application data transmission.
[0286] Phase 2, Channel Authentication (S916 - S920)
[0287] S916. The electronic device 100 requests channel authentication from the relay server 300.
[0288] After receiving the message indicating that 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 the device identifier of the electronic device 100.
[0289] Among them, if the electronic device 100 has the ability to switch between transmitting data via Bluetooth and transmitting data via the modem, the electronic device 100 may send a channel authentication request to the relay server 300. Specifically, the above channel authentication request may be initiated by the Bluetooth service or the wearable device management service in the electronic device 100. Referring to the foregoing Figure 5Or Figure 6 If the Bluetooth service or the wearable device management service in the electronic device 100 can both call the Bluetooth chip and call the modem through the network management interface, the Bluetooth service or the wearable device management service in the electronic device 100 can call the modem through the network management interface and send the above channel authentication request to the relay server 300.
[0290] Therefore, the relay server 300 can check whether the electronic device 100 has the ability to switch between Bluetooth data transmission and data transmission by the modem according to whether the electronic device 100 sends the above channel authentication request.
[0291] S917. The electronic device 200 requests channel authentication from the relay server 300.
[0292] After the electronic device 200 receives the message that the device authentication is passed, the electronic device 200 can request channel authentication from the relay server 300. In some embodiments, the channel authentication request of the electronic device 200 may include the device identifier of the electronic device 200.
[0293] Among them, if the electronic device 200 has the ability to switch between Bluetooth data transmission and data transmission by the modem, the electronic device 200 can send a channel authentication request to the relay server 300. Specifically, the above channel authentication request may be initiated by the Bluetooth service or the wearable device management service in the electronic device 200. Refer to the foregoing Figure 5 Or Figure 6 If the Bluetooth service or the wearable device management service in the electronic device 200 can both call the Bluetooth chip and call the modem through the network management interface, the Bluetooth service or the wearable device management service in the electronic device 200 can call the modem through the network management interface and send the above channel authentication request to the relay server 300.
[0294] Therefore, the relay server 300 can check whether the electronic device 200 has the ability to switch between Bluetooth data transmission and data transmission by the modem according to whether the electronic device 200 sends the above channel authentication request.
[0295] S918. The relay server 300 determines that the channel authentication of the electronic device 100 and the electronic device 200 is passed and generates a channel identifier.
[0296] As can be seen from the above steps S916 and S917, the electronic device 100 sending the above channel authentication request can indicate that the electronic device 100 has the ability to switch between transmitting data via Bluetooth and transmitting data via the modem. The electronic device 200 sending the above channel authentication request can indicate that the electronic device 200 has the ability to switch between transmitting data via Bluetooth and transmitting data via the modem.
[0297] Therefore, when receiving the channel authentication request of the electronic device 100, the relay server 300 can determine that the channel authentication of the electronic device 100 is passed, and then generate a channel identifier corresponding to the electronic device 100, for example, the first channel identifier. In some embodiments, the above first channel identifier can be used for the electronic device 100 and the relay server 300 to establish a signaling link, for example, the first signaling link. 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 a communication system, in addition to transmitting user information (such as device information, application data, etc.), in order to make the communication network work orderly and ensure normal communication, control signals required are used. Signaling is different from user information. User information is directly transmitted from the sending end to the receiving end through the communication network, while signaling usually needs to be transmitted between different links of the communication network (such as base stations, mobile stations, and mobile control switching centers, etc.). Each link analyzes and processes it and forms a series of operations and controls through interaction. Signaling can be used to ensure the effective and reliable transmission of user information. That is to say, signaling can be regarded as the control system of the entire communication network.
[0298] When receiving the channel authentication request of the electronic device 200, the relay server 300 can determine that the channel authentication of the electronic device 200 is passed, and then generate a channel identifier corresponding to the electronic device 200, for example, the second channel identifier. In some embodiments, the above second channel identifier can be used for the electronic device 200 and the relay server 300 to establish a signaling link, for example, the second signaling link. The second signaling link can be used for signaling transmission between the electronic device 200 and the relay server 300.
[0299] S919. The relay server 300 sends the channel identifier to the electronic device 100.
[0300] The channel identifier sent by the relay server 300 to the electronic device 100 can be the first channel identifier. The electronic device 100 can establish the 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 through the first signaling link can include an instruction for the electronic device 100 to request to establish a communication connection for transmitting data via the modem with the electronic device 200. That is to say, the first signaling link can be used for the electronic device 100 and the electronic device 200 to establish a communication connection for transmitting data via the modem.
[0301] The S920 and the relay server 300 send a channel identifier to the electronic device 200.
[0302] 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 for the electronic device 200 to request to establish a communication connection for transmitting data based on a modem with the electronic device 100. That is to say, the second signaling link can be used for the electronic device 100 and the electronic device 200 to establish a communication connection for transmitting data based on a modem.
[0303] The above-mentioned first channel identifier is different from the second channel identifier. The first signaling link is also different from the second signaling link. The embodiments of the present application do not limit the specific content of the above-mentioned first channel identifier and second channel identifier.
[0304] It can be seen that the above-mentioned channel authentication can be used to verify whether an electronic device (such as the electronic device 100, the electronic device 200) has the ability to switch between transmitting data via Bluetooth and transmitting data via a modem. This ability may be referred to as a first ability. Refer to Figure 5 or Figure 6 , if the electronic device 100 has the first ability (i.e., the channel authentication of the electronic device 100 passes), it can indicate that there is a path between the Bluetooth service or the wearable device management service in the electronic device 100 and the Bluetooth chip, and there is also a path between the Bluetooth service or the wearable device management service and the modem. Similarly, if the electronic device 200 has the first ability (i.e., the channel authentication of the electronic device 200 passes), it can indicate that there is a path between the Bluetooth service or the wearable device management service in the electronic device 200 and the Bluetooth chip, and there is also a path between the Bluetooth service or the wearable device management service and the modem.
[0305] The above-mentioned channel authentication can determine whether two devices have the ability to switch the data transmission method (that is, switch the data originally transmitted via a Bluetooth connection to be transmitted to the target device via a modem, or switch the data originally transmitted via a modem to be transmitted to the target device via a Bluetooth connection). This can reduce the situation where an electronic device requests to establish a connection with an electronic device that does not have the ability to switch the data transmission method, and reduce the waste of resources such as the computing resources and storage resources of the electronic device.
[0306] In some embodiments, the above device authentication can be used only to determine the identity of the electronic device. For example, when receiving a device authentication request from the electronic device 100, the relay server 300 can store the device information of the electronic device 100, generate a device identifier of the electronic device 100 (such as a first device identifier), and execute the above step S914. The device authentication request of the above electronic device 100 can let the relay server 300 know the existence of the electronic device 100 and the device information of the electronic device 100. When receiving a device authentication request from the electronic device 200, the relay server 300 can store the device information of the electronic device 200, generate a device identifier of the electronic device 200 (such as a second device identifier), and execute the above step S915. The device authentication request of the above electronic device 200 can let the relay server 300 know the existence of the electronic device 200 and the device information of the electronic device 200. The relay server 300 can verify the association relationship between the electronic devices stored in the relay server 300 to determine the electronic devices with an association relationship. That is to say, step S913 can be executed after step S915.
[0307] In the case where it is determined that the electronic device 100 and the electronic device 200 are associated devices and channel authentication requests from the electronic device 100 and the electronic device 200 are received, the relay server 300 can determine that the channel authentication of the electronic device 100 and the electronic device 200 passes, and then execute the above steps S919 and S920.
[0308] The above device authentication can also be called by names such as primary authentication. The above channel authentication can also be called by names such as secondary authentication.
[0309] Phase 3, Address Exchange (S921~S925)
[0310] 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.
[0311] 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.
[0312] After the device authentication and channel authentication of the above electronic device 100 and the electronic device 200 both pass, the electronic device 100 and the electronic device 200 can establish a P2P connection with the help of the relay server 300.
[0313] 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 a channel identifier (such as a first channel identifier). Specifically, the electronic device 100 sends a message requesting to establish a P2P connection with the electronic device 200 to the relay server 300 through a signaling link (such as a first signaling link) between the electronic device 100 and the relay server 300.
[0314] 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 a channel identifier (such as a second channel identifier). Specifically, the electronic device 200 sends a message requesting to establish a P2P connection with the electronic device 100 to the relay server 300 through a signaling link (such as a second signaling link) between the electronic device 200 and the relay server 300.
[0315] Wherein, if the network environment where 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 a request from the electronic device 100 to establish a P2P connection with the electronic device 200. Similarly, if the network environment where 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 a request from the electronic device 200 to establish a P2P connection with the electronic device 100.
[0316] S923. The relay server 300 sends the address of the electronic device 200 to the electronic device 100.
[0317] S924. The relay server 300 sends the address of the electronic device 100 to the electronic device 200.
[0318] The relay server 300 can 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.
[0319] In response to the message from the electronic device 100 requesting to establish a P2P connection with the electronic device 200, the relay server 300 can send the address of the electronic device 200 to the electronic device 100. In response to the message from the electronic device 200 requesting to establish a P2P connection with the electronic device 100, the relay server 300 can send the address of the electronic device 100 to the electronic device 200.
[0320] S925. The electronic device 100 and the electronic device 200 successfully establish a P2P connection.
[0321] 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.
[0322] From the above Figure 9 As can be seen from the method shown, 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 (such as Figure 9 The above-mentioned security authentication can ensure that the two devices establishing a communication connection based on modem data transmission are associated devices, preventing electronic device 100 or electronic device 200 from sending application data to non-associated devices, thereby improving the security of application data transmission. In addition, the above-mentioned 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 methods, thereby reducing the waste of electronic device computing resources, storage resources and other resources.
[0323] Figure 10 The flowchart of the method for establishing a P2P connection provided by the present application is exemplified.
[0324] like Figure 10 As shown, 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 networks 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.
[0325] S1011 : The electronic device 100 sends a message for registering with the relay server 300 to NAT1 .
[0326] Before the electronic device 100 requests to establish a P2P connection with the electronic device 200, it can first register and log in to the relay server 300 to announce its identity to the relay server 300. Since the electronic device 100 is in the internal network where NAT1 is located, the electronic device 100 can send the message of registering and logging in to the relay server 300 to NAT1. For example, the internal network IP address of the electronic device 100 is IP address 1. In the data packet corresponding to the message of the electronic device 100 registering and logging in, the source address can be IP address 1.
[0327] S1012. NAT1 assigns port number 1 to the electronic device 100.
[0328] The above port number 1 can be assigned to the electronic device 100 by NAT1 after receiving the above message for registering and logging in to the relay server 300, or it can also be a port number that has been assigned to the electronic device 100 before receiving the above 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 port number 1 to the electronic device 100. The above port number 1 can be a random port number.
[0329] S1013. NAT1 sends the message that the electronic device 100 requests to register and log in to the relay server 300 based on port number 1.
[0330] When receiving the above message for registering and logging in to the relay server 300, NAT1 can convert the source address in the data packet corresponding to the registration and login message. For example, the external network IP address of NAT1 is IP address 2. NAT1 can convert the source address in the data packet from the above IP address 1 to "IP address 2: port number 1". "IP address 2: port number 1" can be the external network IP address of the electronic device 100.
[0331] NAT1 can send the registration and login message with the source address converted as above to the relay server 300. In this way, the relay server 300 can determine that the registration and login message is sent to itself by "IP address 2: port number 1". The relay server 300 can store "IP address 2: port number 1".
[0332] In some embodiments, the above steps S1011 - S1013 can be executed before the step S911 shown above. Figure 9 shown above.
[0333] S1014. The electronic device 200 sends a message for registering and logging in to the relay server 300 to NAT2.
[0334] Similarly, before the electronic device 200 requests to establish a P2P connection with the electronic device 100, it can first register and log in to the relay server 300 to announce its identity to the relay server 300. Since the electronic device 200 is in the internal network where NAT2 is located, the electronic device 200 can send the message of registering and logging in to the relay server 300 to NAT2. For example, the internal network IP address of the electronic device 200 is IP address 3. In the data packet corresponding to the message of the electronic device 200 registering and logging in, the source address can be IP address 3.
[0335] S1015. NAT2 assigns port number 2 to the electronic device 200.
[0336] The above port number 2 can be assigned to the electronic device 200 by NAT2 after receiving the above message for registering and logging in to the relay server 300, or it can also be a port number that has been assigned to the electronic device 200 before receiving the above 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 port number 2 to the electronic device 200. The above port number 2 can be a random port number.
[0337] S1016. NAT2 sends the message that the electronic device 200 requests to register and log in to the relay server 300 based on port number 2.
[0338] When receiving the above message for registering and logging in to the relay server 300, NAT2 can convert the source address in the data packet corresponding to the message of registering and logging in. For example, the external network IP address of NAT2 is IP address 4. NAT2 can convert the source address in the data packet from the above IP address 3 to "IP address 4: port number 2". "IP address 4: port number 2" can be the external network IP address of the electronic device 200.
[0339] NAT2 can send the message of registering and logging in after the above source address conversion to the relay server 300. In this way, the relay server 300 can determine that the message of registering and logging in is sent to itself by "IP address 4: port number 2". The relay server 300 can store "IP address 4: port number 2".
[0340] In some embodiments, the above steps S1014 - S1016 can be executed before the step S912 shown above. Figure 9 shown above.
[0341] S1017. The electronic device 100 requests the relay server 300 to obtain the address of the electronic device 200 through NAT1.
[0342] The electronic device 100 may send a request to the NAT1 to obtain the address of the electronic device 200. In the data packet corresponding to the request, the source address is the above IP address 1. When receiving the request, the NAT1 may convert the source address in the data packet corresponding to the request, converting the source address from the above IP address 1 to "IP address 2: port number 1". The NAT1 may send the request after the above source address conversion to the relay server 300. The above request to obtain the address of the electronic device 200 may further include the internal network 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 may determine that the device corresponding to "IP address 2: port number 1" requests to obtain the address of the electronic device 200.
[0343] In some embodiments, this step S1017 may be the specific implementation of the foregoing Figure 9 shown step S921. Among them, the first signaling link between the electronic device 100 and the relay server 300 in the above step S921 may include the signaling link between the electronic device 100 and the NAT1 and the signaling link between the NAT1 and the relay server 300. The above request to obtain the address of the electronic device 200 may be transmitted to the relay server 300 through the above first signaling link.
[0344] S1018. The electronic device 200 requests to obtain the address of the electronic device 100 from the relay server 300 through the NAT2.
[0345] The electronic device 200 may send a request to the NAT2 to obtain the address of the electronic device 100. In the data packet corresponding to the request, the source address is the above IP address 3. When receiving the request, the NAT2 may convert the source address in the data packet corresponding to the request, converting the source address from the above IP address 3 to "IP address 4: port number 2". The NAT2 may send the request after the above source address conversion to the relay server 300. The above request to obtain the address of the electronic device 100 may further include the internal network 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 may determine that the device corresponding to "IP address 4: port number 2" requests to obtain the address of the electronic device 100.
[0346] In some embodiments, this step S1018 may be the specific implementation of the foregoing Figure 9 shown step S922. Among them, the second signaling link between the electronic device 200 and the relay server 300 in the above step S922 may include the signaling link between the electronic device 200 and the NAT2 and the signaling link between the NAT2 and the relay server 300. The above request to obtain the address of the electronic device 100 may be transmitted to the relay server 300 through the above second signaling link.
[0347] S1019. The relay server 300 records the addresses of the electronic device 100 and the electronic device 200.
[0348] Based on the request to obtain the address of the electronic device 200 in the above step S1017, the relay server 300 can obtain the external network IP address and the internal network IP address of the electronic device 100. The relay server 300 can store the external network IP address and the internal network IP address of the electronic device 100.
[0349] Based on the request to obtain the address of the electronic device 100 in the above step S1018, the relay server 300 can obtain the external network IP address and the internal network IP address of the electronic device 200. The relay server 300 can store the external network IP address and the internal network IP address of the electronic device 200.
[0350] S1020. The relay server 300 sends the address of the electronic device 200 to the electronic device 100 through NAT1.
[0351] In response to the request to obtain the address of the electronic device 200 in the above step S1017, the relay server 300 can send the address of the electronic device 200 (such as the internal network IP address and the external network IP address) 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 according to the port number 1 in the address "IP address 2: port number 1".
[0352] S1021. The relay server 300 sends the address of the electronic device 100 to the electronic device 200 through NAT2.
[0353] In response to the request to obtain the address of the electronic device 100 in the above step S1018, the relay server 300 can send the address of the electronic device 100 (such as the internal network IP address and the external network IP address) 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 according to the port number 2 in the address "IP address 4: port number 2".
[0354] Subsequently, the electronic device 100 can send data to the electronic device 200 according to the address of the electronic device 200. The electronic device 200 can send data to the electronic device 100 according to the address of the electronic device 100. If the electronic device 100 and the electronic device 200 mutually receive the data of each other, they can remember the first return packet address information of each other, identify the identity of each other, and then confirm that the P2P connection is successfully established. When the P2P connection is successfully established, the electronic device 100 and the electronic device 200 can penetrate the NAT gateways of each other according to the addresses of each other and send data to each other through the P2P connection.
[0355] In some embodiments, the electronic device 100 may also create a local port to detect data received on different ports. Among them, different ports may correspond to different application programs in the electronic device 100. When a data packet is received, the electronic device 100 may send the data to the destination port according to the destination port number in the data packet. The application program corresponding to the destination port may obtain the data from the destination port. Similarly, the electronic device 200 may also create a local port to detect data received on different ports, so as to transmit the data to the application program corresponding to the port. The embodiments of the present application do not limit the time for the electronic device 100 and the electronic device 200 to create local ports.
[0356] Figure 11 Exemplarily shown is another flowchart of a method for establishing a communication connection for transmitting data based on a modem provided by the present application.
[0357] As Figure 11 shown, the communication connection for transmitting data based on the modem may be a communication connection with the relay server 300 as the data transfer station. 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 first attempt to establish a P2P connection. If the P2P connection establishment fails, the electronic device 100 and the electronic device 200 may establish a communication connection with the relay server 300 as the data transfer station.
[0358] S1111. The electronic device 100 requests device authentication from the relay server 300.
[0359] S1112. The electronic device 200 requests device authentication from the relay server 300.
[0360] S1113. The relay server 300 detects that the electronic device 100 and the electronic device 200 are associated devices.
[0361] S1114. The relay server 300 sends a message indicating that the device authentication is passed to the electronic device 100.
[0362] S1115. The relay server 300 sends a message indicating that the device authentication is passed to the electronic device 200.
[0363] S1116. The electronic device 100 requests channel authentication from the relay server 300.
[0364] S1117. The electronic device 200 requests channel authentication from the relay server 300.
[0365] S1118. The relay server 300 determines that the channel authentication of the electronic device 100 and the electronic device 200 is passed, and generates a channel identifier.
[0366] S1119. The relay server 300 sends a channel identifier to the electronic device 100.
[0367] S1120. The relay server 300 sends a channel identifier to the electronic device 200.
[0368] 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.
[0369] The above steps S1111 to S1121 can refer to the steps S911 to S921 shown above. Figure 9 shown in steps S911 - S921.
[0370] 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.
[0371] In some embodiments, the network environment where the electronic device 200 is located does not support P2P connections. For example, if the NAT2 of the electronic device 200 does not support the P2P protocol, the electronic device 200 cannot perform the steps S1018 shown above (that is, the steps S922 shown above). Therefore, the relay server 300 cannot receive a request from the electronic device 200 to establish a P2P connection within a preset time period. The above preset time period may include the time period after the relay server 300 receives a message from the electronic device 100 requesting to establish a P2P connection with the electronic device 200. Optionally, the above preset time period may further include the time period before the relay server 300 receives a message from the electronic device 100 requesting to establish a P2P connection with the electronic device 200. The duration of the above preset time period is not limited in the embodiments of the present application. Figure 10 shown in Figure 9 shown in steps S922).
[0372] S1123. The relay server 300 sends a message indicating that the P2P connection establishment has failed to the electronic device 100.
[0373] The relay server 300 not receiving a request from the electronic device 200 to establish a P2P connection within a preset time period may indicate that the electronic device 200 is currently unable to establish a P2P connection. Therefore, the relay server 300 can send a message indicating that the P2P connection establishment has failed to the electronic device 100.
[0374] S1124. The electronic device 100 establishes a data transmission channel with the relay server 300.
[0375] When the electronic device 100 fails to establish a P2P connection with the electronic device 200, the electronic device 100 can establish a data transmission channel with the relay server 300. The data transmission channel between the electronic device 100 and the relay server 300 can be the first data transmission channel. The first data transmission channel can be used for the electronic device 100 and the relay server 300 to transmit application data. 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 can also share the same communication channel. The embodiments of the present application do not limit the establishment method of the above-mentioned first data transmission channel.
[0376] In some embodiments, if the first data transmission channel and the first signaling link are different communication channels, the instruction for the electronic device 100 and the relay server 300 to establish the first data transmission channel can be transmitted through the first signaling link.
[0377] S1125. The electronic device 200 establishes a data transmission channel with the relay server 300.
[0378] Since the network environment where 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 the 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 embodiments of the present application do not limit the establishment method of the above-mentioned second data transmission channel.
[0379] In some embodiments, if the second data transmission channel and the second signaling link are different communication channels, the instruction for the electronic device 200 and the relay server 300 to establish the second data transmission channel can be transmitted through the second signaling link.
[0380] Step S1125 can be executed after step S1120. In some embodiments, the above step S1122 is optional. If the relay server 300 receives a message requesting to establish a data transmission channel from the electronic device 200, it can execute step S1123 and send a message indicating that the P2P connection establishment has failed to the electronic device 100.
[0381] 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 connect through the first data transmission channel and the second data transmission channel.
[0382] In some embodiments, the electronic device 100 can send the data to be sent to the electronic device 200 to the relay server 300 through the first data transmission channel. The data sent to the relay server 300 may include one or more 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 identifier of the electronic device 200. The relay server 300 can send the data to the electronic device 200 through the second data transmission channel. Among them, the relay server 300 can perform processing such as decoding and recognition on the data sent by the electronic device 100 to identify the device information of the electronic device 200 included in the data. Then, the relay server 300 can perform processing such as encoding on the data and send the encoded data to the electronic device 200.
[0383] Similarly, the electronic device 200 can send the data to be sent to the electronic device 100 to the relay server 300 through the second data transmission channel. The data sent to the relay server 300 may include one or more 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 identifier of the electronic device 100. The relay server 300 can send the data to the electronic device 100 through the first data transmission channel.
[0384] 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 the data transfer station.
[0385] Specifically, the electronic device 100 and the electronic device 200 can request device authentication from the relay server 300. When the device authentication of both the electronic device 100 and the electronic device 200 passes, the electronic device 100 and the electronic device 200 can request channel authentication from the relay server 300. When the channel authentication of both the electronic device 100 and the electronic device 200 passes, 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 for the above device authentication, channel authentication, and establishing a data transmission path can refer to the introduction in the foregoing embodiments. Details are not described here again.
[0386] In some embodiments, when a P2P connection is established between the electronic device 100 and the electronic device 200, or when 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, the electronic device 100 and the 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 the electronic device 100 detects the Bluetooth broadcast of the electronic device 200, the electronic device 100 can establish a Bluetooth connection with the electronic device 200. Alternatively, when the electronic device 200 detects the Bluetooth broadcast of the electronic device 100, the electronic device 200 can establish a Bluetooth connection with the electronic device 100. Optionally, when the electronic device 100 and the electronic device 200 establish a Bluetooth connection, the electronic device 100 and the electronic device 200 can disconnect the P2P connection, or the electronic device 100 disconnects the data transmission channel with the relay server 300 and the electronic device 200 disconnects the data transmission channel with the relay server 300.
[0387] That is to say, 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 for data transmission based on a modem 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 get closer again, the electronic device 100 and the electronic device 200 can restore the Bluetooth connection and switch the data transmission method to use the Bluetooth connection to transmit data to each other.
[0388] It should be noted that, without 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.
[0389] 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 foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions 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, characterized in that, 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, wherein 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 resume the Bluetooth connection.
6. The method according to any one of claims 3-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 has established a data transmission channel with the first server and the second device has established 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, characterized in that, 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 to 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 to 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-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-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 established a Bluetooth connection, 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 established a P2P connection, the first device sends the first data to the second device via the P2P connection; When the first device has established 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.
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 established a Bluetooth connection, 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 established a P2P connection, the first device receives the second data from the second device via the P2P connection; When the first device has established a data transmission channel 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; Wherein, the message for the first device to request 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, characterized in that 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, characterized in that, 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, characterized in that, 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 receiving the request from the third device to establish a P2P connection and not receiving the request from the fourth device to establish a P2P connection within the 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 from the third device to establish a P2P connection.
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 described in any one of claims 15-29.
43. A server, characterized in that, The server includes a memory and a processor. Among them, the memory is used to store a computer program; the processor is used to call the computer program, so that the server executes the method described in any one of claims 30-39.
Citation Information
Cited By
Device communication method, related apparatus and communication system
WO2025157105A1