Bluetooth channel establishment method, electronic device and system

By using an automated Bluetooth channel establishment method and exchanging Bluetooth addresses and keys with a device management server, the problems of cumbersome manual operation and low security for users are solved, thus achieving simplified operation and improved security in Bluetooth channel establishment.

CN114640975BActive Publication Date: 2026-06-09HUAWEI TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HUAWEI TECH CO LTD
Filing Date
2020-11-28
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

In existing technologies, establishing a Bluetooth channel between multiple electronic devices requires manual operation by the user, which is cumbersome and has low security.

Method used

When a service requiring Bluetooth communication is detected, the electronic device automatically exchanges Bluetooth address and key with the device management server through existing communication channels (such as Wi-Fi or mobile data channels), automatically establishes a Bluetooth channel, and uses the key for authentication, simplifying user operation and improving security.

Benefits of technology

It simplifies the user operation during the Bluetooth channel establishment process, reduces the leakage of binding information, and improves the security of the Bluetooth channel and the security of data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114640975B_ABST
    Figure CN114640975B_ABST
Patent Text Reader

Abstract

Bluetooth channel establishment method, electronic device and system. The system can include a first electronic device, a second electronic device. A first communication channel is established between the first electronic device and the second electronic device. When detecting that a first service occurs, the first electronic device and the second electronic device can exchange their respective Bluetooth addresses through the first communication channel. The first service requires the first electronic device and the second electronic device to establish a Bluetooth communication connection. The first electronic device can send a Bluetooth channel establishment request to the second electronic device according to the received Bluetooth address. The second electronic device can reply to the first electronic device with a Bluetooth channel establishment request acceptance response after determining that the source address in the Bluetooth channel establishment request is the same as the Bluetooth address received through the first communication channel. The first electronic device and the second electronic device can automatically establish a Bluetooth channel, simplifying the user operation in the Bluetooth channel establishment process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and in particular to Bluetooth channel establishment methods, electronic devices and systems. Background Technology

[0002] With the development of communication technology, multiple electronic devices can establish Bluetooth channels for convenient data exchange. However, currently, establishing a Bluetooth channel between multiple electronic devices often requires manual operation by the user to pair the devices. This is not only cumbersome but also has low security during the Bluetooth channel establishment process. Summary of the Invention

[0003] This application provides a Bluetooth channel establishment method, electronic device, and system that can automatically establish a Bluetooth channel between devices when a first service requiring Bluetooth communication between a first electronic device and a second electronic device is detected. This simplifies user operations during the Bluetooth channel establishment process, reduces the potential leakage of binding information due to manual Bluetooth pairing, and improves security during Bluetooth channel establishment.

[0004] In a first aspect, this application provides a communication system. The communication system includes a first electronic device and a second electronic device. The first electronic device and the second electronic device establish a first communication channel. Specifically: the first electronic device detects the occurrence of a first service. This first service requires the first electronic device and the second electronic device to establish a Bluetooth communication connection. The first electronic device can send a first message to the second electronic device through the first communication channel. The first message may include a first Bluetooth address of the first electronic device. The second electronic device can send a second message to the first electronic device through the first communication channel. The second message may include a second Bluetooth address of the second electronic device. The first electronic device discovers the second electronic device based on the second Bluetooth address. The first electronic device can send a Bluetooth channel establishment request to the second electronic device based on the second Bluetooth address. The second electronic device determines that the source address carried in the Bluetooth channel establishment request is the same as the first Bluetooth address in the first message. Further, the second electronic device can send a Bluetooth channel establishment request to the first electronic device and receive a response. The first electronic device and the second electronic device complete the Bluetooth channel establishment.

[0005] In conjunction with the first aspect, in some embodiments, the communication system described above may further include a server. The first communication channel may be a communication channel established between a first electronic device and a second electronic device via the server. The first electronic device may communicate with the server via a mobile data channel or a Wi-Fi channel. The second electronic device may communicate with the server via a mobile data channel or a Wi-Fi channel. The aforementioned mobile data channel may be a communication channel for transmitting data based on a mobile data service network. The aforementioned Wi-Fi channel may be a communication channel for transmitting data based on a Wi-Fi network.

[0006] The aforementioned server can store the binding relationship between the first electronic device and the second electronic device. Based on this binding relationship, the device management server can send instructions, requests, and other data (such as Bluetooth connection requests) from the first electronic device to the second electronic device. The device management server can also send instructions, requests, and other data (such as the device identifier of the second electronic device) from the second electronic device to the first electronic device. In one possible implementation, the first electronic device can establish a binding relationship with the second electronic device by scanning its QR code. Alternatively, the first electronic device can establish a binding relationship by logging into the same account or a related account as the second electronic device. This application does not limit the specific implementation method for establishing the binding relationship between the first and second electronic devices.

[0007] In some embodiments, the first communication channel may be a point-to-point communication channel established between a first electronic device and a second electronic device. The point-to-point communication channel may include one or more of the following: a WLAN direct connection channel and a near-field communication (NFC) channel.

[0008] In some embodiments, the first communication channel may also be a wired channel connecting the first electronic device and the second electronic device. For example, a communication channel connecting the first electronic device and the second electronic device via a USB interface.

[0009] In conjunction with the first aspect, in some embodiments, the first electronic device can also be used to generate a public key and a private key. The public key can be used for encryption. The private key can be used for decryption. The public key is included in the first message. The second electronic device can also be used to send a first secret key to the first electronic device. This first secret key is included in the second message. The first secret key is obtained by encrypting a second secret key generated by the second electronic device using the public key. The first electronic device can also be used to decrypt the first secret key using the private key to obtain the second secret key. The first electronic device can compare a third secret key with a fourth secret key from the second electronic device. The third secret key can be obtained by the first electronic device based on the second secret key using a first encryption algorithm. The fourth secret key can be obtained by the second electronic device based on the second secret key using the first encryption algorithm. If the third secret key and the fourth secret key are determined to be the same, the first electronic device can confirm that the second electronic device is a trusted device. The second electronic device can also be used to compare a fifth secret key with a sixth secret key from the first electronic device. The fifth secret key can be obtained by the second electronic device based on the second secret key using a first encryption algorithm. The sixth secret key can be obtained by the first electronic device based on the second secret key using the first encryption algorithm. If the fifth key and the sixth key are found to be the same, the second electronic device can confirm that the first electronic device is a trusted device.

[0010] As can be seen from the above communication system, when the first service is detected, the first electronic device can automatically establish a Bluetooth channel with the second electronic device through the first communication channel. The user does not need to manually establish a Bluetooth binding relationship between the devices. This not only simplifies the user operation during the Bluetooth channel establishment process but also reduces the possibility of binding information leakage due to manual Bluetooth binding, thus improving the security of establishing the Bluetooth channel. Furthermore, after establishing the Bluetooth channel, the first and second electronic devices can also authenticate each other using the aforementioned second key. This helps ensure the security of the Bluetooth channel and improves the security of data transmission between devices via the Bluetooth channel.

[0011] In conjunction with the first aspect, in some embodiments, the second electronic device determines that the source address carried in the Bluetooth channel establishment request is different from the first Bluetooth address in the first message. The second electronic device may then send a Bluetooth channel establishment request rejection response to the first electronic device. The establishment of a Bluetooth channel between the first and second electronic devices fails.

[0012] In conjunction with the first aspect, in some embodiments, after detecting that the first service has occurred, if the first electronic device detects that Bluetooth is not enabled, then the first electronic device enables Bluetooth.

[0013] In conjunction with the first aspect, in some embodiments, if the second electronic device detects that Bluetooth is not enabled before sending the second message to the first electronic device through the first communication channel, the second electronic device enables Bluetooth.

[0014] In conjunction with the first aspect, in some embodiments, the first electronic device may turn off Bluetooth after detecting the end of the first service. Alternatively, the first electronic device may unpair its Bluetooth connection with the second electronic device.

[0015] In this method, if the first electronic device turns off Bluetooth, it cannot continue Bluetooth communication. The second electronic device's Bluetooth will also be unable to connect to the first electronic device's Bluetooth. In other words, the Bluetooth channel between the first and second electronic devices is disconnected. This eliminates the need for the user to manually turn off Bluetooth. Furthermore, this method can conserve power for the first electronic device.

[0016] The first electronic device unbinds itself from the second electronic device via Bluetooth. The first electronic device can delete the second electronic device's Bluetooth address, secondary key, and other information. When the Bluetooth binding between the two devices is removed, the first electronic device can no longer exchange data with the second electronic device via Bluetooth. In other words, the Bluetooth channel between the first and second electronic devices is disconnected.

[0017] In conjunction with the first aspect, in some embodiments, the first electronic device can also be used to send a third message to the second electronic device via the first communication channel after detecting the end of the first service. This third message can be used to instruct the second electronic device to turn off Bluetooth. The second electronic device can be used to turn off Bluetooth after receiving the aforementioned third message. Alternatively, the second electronic device can be used to unbind its Bluetooth connection from the first electronic device after receiving the aforementioned third message.

[0018] In some embodiments, the first electronic device and the second electronic device can establish a WLAN direct connection channel through an established communication channel (such as a server-based communication channel, Bluetooth channel, NFC channel, etc.). Specifically, the first electronic device and the second electronic device can first exchange their respective device address identifiers (such as MAC addresses) through the established communication channel. The aforementioned device address identifier can be used to determine the communication address of the electronic device on which the communication channel needs to be established. The first electronic device can discover the second electronic device based on the aforementioned device address identifier of the second electronic device. Further, the first electronic device can request to establish a WLAN direct connection channel with the second electronic device based on the received device address identifier. The second electronic device can agree to establish a WLAN direct connection channel with the first electronic device after confirming that the device address identifier of the device requesting the establishment of the WLAN direct connection channel is the same device address identifier obtained during the aforementioned exchange of device address identifiers.

[0019] Furthermore, the first and second electronic devices can also transmit a shared key through the established communication channel. Based on this shared key, the first and second electronic devices can authenticate each other to ensure that the electronic devices at both ends of the WLAN direct connection channel are trustworthy.

[0020] In some embodiments, a first logical channel is established between a first electronic device and a second electronic device. The first and second electronic devices can establish a second logical channel through this first logical channel. The first and second logical channels can share the same physical channel, such as a Bluetooth channel. In the Bluetooth communication connection process, the physical channel can refer to a Bluetooth physical connection, such as an ACL-based physical connection or an SCO-based physical connection. A logical channel can refer to one or more connections defined in the Bluetooth application specification, such as GAP, SDAP, etc.

[0021] The aforementioned first logical channel can be a logical channel established between the first electronic device and the second electronic device when the first service is detected. When the second service is detected, the first electronic device can establish a second logical channel through the first logical channel. The aforementioned second service is a service that requires the first electronic device and the second electronic device to establish a second logical channel for communication. Data in both the second and first logical channels can be transmitted via Bluetooth.

[0022] When establishing the second logical channel, the application corresponding to the first service on the first electronic device can communicate locally with the application corresponding to the second service on the first electronic device. Similarly, the application corresponding to the first service on the second electronic device can communicate locally with the application corresponding to the second service on the second electronic device. Specifically, the application corresponding to the second service on the first electronic device can exchange its communication addresses (such as the device's physical address and the port number used for communication) with the application corresponding to the second electronic device through the first logical channel. Furthermore, the application corresponding to the second service on the first electronic device can automatically establish the second logical channel with the application corresponding to the second electronic device based on the exchanged communication addresses. Moreover, the application corresponding to the second service on the first electronic device and the application corresponding to the second electronic device can perform authentication between the applications to determine if the applications at both ends of the second logical channel are trusted applications.

[0023] In the above method, when different applications on an electronic device transmit data to a peer electronic device through different logical channels but the same physical channel, the electronic device can use an already established logical channel to assist in establishing another logical channel and perform authentication between applications. This improves the convenience and security of establishing the logical channel.

[0024] Secondly, embodiments of this application provide a Bluetooth channel establishment method. This method is applicable to a first electronic device. A first communication channel is established between the first electronic device and a second electronic device. The method includes: the first electronic device detecting the occurrence of a first service. The first service requires the first electronic device and the second electronic device to establish a Bluetooth communication connection. The first electronic device can send a first message to the second electronic device through the first communication channel and receive a second message from the second electronic device through the first communication channel. The first message may include a first Bluetooth address of the first electronic device. The second message may include a second Bluetooth address of the second electronic device. The first electronic device can discover the second electronic device based on the second Bluetooth address. The first electronic device sends a Bluetooth channel establishment request to the second electronic device according to the second Bluetooth address and receives a Bluetooth channel establishment request acceptance response from the second electronic device. The Bluetooth channel establishment request acceptance response is sent by the second electronic device after determining that the source address carried in the Bluetooth channel establishment request is the same as the first Bluetooth address in the first message. The first electronic device and the second electronic device complete the Bluetooth channel establishment.

[0025] In conjunction with the second aspect, in some embodiments, the first communication channel may be a communication channel established between a first electronic device and a second electronic device via a server. Alternatively, the first communication channel may be a point-to-point communication channel established between the first electronic device and the second electronic device. The aforementioned point-to-point communication channel may include one or more of the following: a Wireless Local Area Network (WLAN) direct connection channel, or a Near Field Communication (NFC) channel.

[0026] In conjunction with the second aspect, in some embodiments, the first electronic device can generate a public key and a private key. The public key is used for encryption. The private key is used for decryption. The public key is contained in a first message. The second message also contains a first secret key. The first secret key is obtained by the second electronic device encrypting its own second secret key using the public key. The first electronic device can decrypt the first secret key using the private key to obtain the second secret key. The first electronic device compares a third secret key with a fourth secret key from the second electronic device. The third secret key is obtained by the first electronic device based on the second secret key using a first encryption algorithm. The fourth secret key is obtained by the second electronic device based on the second secret key using the first encryption algorithm. If the first electronic device determines that the third and fourth secret keys are the same, the first electronic device can confirm that the second electronic device is a trusted device.

[0027] As can be seen from the above method, when a first service requiring a Bluetooth communication connection between the first and second electronic devices is detected, the first electronic device can automatically establish a Bluetooth channel with the second electronic device through the first communication channel. The user does not need to manually establish a Bluetooth binding relationship between the devices. This not only simplifies the user operation during the Bluetooth channel establishment process but also reduces the potential leakage of binding information due to manual Bluetooth binding, thus improving the security of the established Bluetooth channel. Furthermore, after establishing the Bluetooth channel, the first electronic device can also authenticate the second electronic device using the aforementioned second key. This helps ensure the security of the Bluetooth channel and improves the security of data transmission between devices via the Bluetooth channel.

[0028] In conjunction with the second aspect, in some embodiments, after the first electronic device detects that the first service has occurred, if the first electronic device detects that Bluetooth is not enabled, then Bluetooth is enabled.

[0029] In conjunction with the second aspect, in some embodiments, the first electronic device may turn off Bluetooth after detecting the end of the first service.

[0030] In conjunction with the second aspect, in some embodiments, after the first electronic device detects the end of the first service, it can send a third message to the second electronic device through the first communication channel. This third message can be used to instruct the second electronic device to turn off Bluetooth.

[0031] Thirdly, embodiments of this application provide a Bluetooth channel establishment method. This method is applicable to a second electronic device. A first communication channel is established between the second electronic device and a first electronic device. The method includes: the second electronic device receiving a first message from the first electronic device through the first communication channel, and sending a second message to the first electronic device through the first communication channel. The first message includes a first Bluetooth address of the first electronic device. The second message includes a second Bluetooth address of the second electronic device. The second electronic device receives a Bluetooth channel establishment request from the first electronic device. The second electronic device determines that the source address carried in the Bluetooth channel establishment request is the same as the first Bluetooth address in the first message, and sends a Bluetooth channel establishment request to the first electronic device to receive a response. The second electronic device and the first electronic device complete the Bluetooth channel establishment.

[0032] In conjunction with the third aspect, in some embodiments, the first communication channel may be a communication channel established between the first electronic device and the second electronic device through a server. Alternatively, the first communication channel may be a point-to-point communication channel established between the first electronic device and the second electronic device. The aforementioned point-to-point communication channel includes one or more of the following: a Wireless Local Area Network (WLAN) direct connection channel and a Near Field Communication (NFC) channel.

[0033] In conjunction with the third aspect, in some embodiments, the second electronic device receives a public key from the first electronic device and sends a first secret key to the first electronic device. The public key is included in a first message. The first secret key is included in a second message. The first secret key is obtained by the second electronic device encrypting a second secret key it generates using the public key. The second electronic device compares a fifth secret key with a sixth secret key from the first electronic device. The fifth secret key is obtained by the second electronic device based on the second secret key using a first encryption algorithm. The sixth secret key is obtained by the first electronic device based on the second secret key using the first encryption algorithm. The second electronic device determines that the fifth secret key and the sixth secret key are the same, and confirms that the first electronic device is a trusted device.

[0034] As can be seen from the above method, through the first communication channel already established between the first and second electronic devices, the second electronic device can exchange their respective Bluetooth addresses with the first electronic device. If the second electronic device determines that the source address in the received Bluetooth channel establishment request is the same as the Bluetooth address received through the first communication channel, it will automatically establish a Bluetooth channel with the first electronic device that sent the request. This eliminates the need for the user to manually establish a Bluetooth binding relationship between the devices. This not only simplifies the user operation during the Bluetooth channel establishment process but also reduces the potential leakage of binding information due to manual Bluetooth binding, thus improving the security of the established Bluetooth channel. Furthermore, after establishing the Bluetooth channel, the second electronic device can also authenticate the first electronic device using the second key. This helps ensure the security of the Bluetooth channel and improves the security of data transmission between devices via the Bluetooth channel.

[0035] In conjunction with the third aspect, in some embodiments, after the second electronic device receives the first message from the first electronic device through the first communication channel, if it detects that Bluetooth is not enabled, the second electronic device enables Bluetooth.

[0036] In conjunction with the third aspect, in some embodiments, the second electronic device can receive a third message from the first electronic device via the first channel. The second electronic device then turns off Bluetooth according to the instruction of the third message.

[0037] Fourthly, embodiments of this application provide an electronic device. The electronic device may include a communication device, a memory, and a processor. The communication device can be used to establish a communication connection. The memory can be used to store a computer program. The processor can be used to invoke the computer program in the memory, causing the electronic device to execute any of the possible implementations of the second aspect above, or any of the possible implementations of the third aspect above.

[0038] Fifthly, embodiments of this application provide a chip applied to an electronic device. The chip includes one or more processors, which are used to invoke computer instructions to cause the electronic device to execute any of the possible implementations of the second aspect or any of the possible implementations of the third aspect.

[0039] Sixthly, embodiments of this application provide a computer program product containing instructions that, when the computer program product is run on a device, cause the electronic device to execute any possible implementation of the second aspect or any possible implementation of the third aspect.

[0040] In a seventh aspect, embodiments of this application provide a computer-readable storage medium including instructions that, when executed on an electronic device, cause the electronic device to perform any possible implementation of the second aspect or any possible implementation of the third aspect.

[0041] It is understood that the electronic device provided in the fourth aspect, the chip provided in the fifth aspect, the computer program product provided in the sixth aspect, and the computer-readable storage medium provided in the seventh aspect are all used to execute the methods provided in the embodiments of this application. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects in the corresponding methods, and will not be repeated here. Attached Figure Description

[0042] Figure 1 This is a schematic diagram of a communication system provided in an embodiment of this application;

[0043] Figure 2 This is a schematic diagram of another communication system provided in an embodiment of this application;

[0044] Figures 3A to 3F and Figure 4 These are schematic diagrams illustrating some scenarios for establishing a Bluetooth channel, provided in the embodiments of this application;

[0045] Figure 5 This is a flowchart of a method for establishing a Bluetooth channel provided in an embodiment of this application;

[0046] Figure 6 This is a flowchart illustrating a method for authentication between electronic devices that establish a Bluetooth channel, as provided in an embodiment of this application.

[0047] Figures 7A to 7D These are schematic diagrams illustrating some scenarios where Bluetooth channels are used for communication, as provided in the embodiments of this application.

[0048] Figure 8 This is a flowchart illustrating a method for communication using a Bluetooth channel, as provided in an embodiment of this application.

[0049] Figure 9 This is a flowchart of a method for disconnecting a Bluetooth channel provided in an embodiment of this application;

[0050] Figure 10 This is a flowchart of a method for establishing a logical channel provided in an embodiment of this application;

[0051] Figure 11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0052] The technical solutions in the embodiments of this application will be clearly and thoroughly described below with reference to the accompanying drawings. In the description of the embodiments of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B; the word "and / or" in the text is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Furthermore, in the description of the embodiments of this application, "multiple" refers to two or more than two.

[0053] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.

[0054] During the establishment of a Bluetooth communication connection between the first and second electronic devices, both devices have Bluetooth enabled. The first electronic device can send a scan request. This scan request can be used to scan for nearby electronic devices with Bluetooth connectivity. The scan request may include the Bluetooth address of the first electronic device. The second electronic device can send a broadcast data packet. This broadcast data packet is used by the second electronic device to announce to nearby electronic devices that its Bluetooth is connectable. This broadcast data packet may include the Bluetooth address of the second electronic device. When the first electronic device receives the broadcast data packet from the second electronic device, it can send a Bluetooth pairing request to the second device. Upon receiving the Bluetooth pairing request, the second electronic device can reply with a confirmation message. In this way, the first and second electronic devices can successfully pair Bluetooth and establish a Bluetooth channel. This Bluetooth channel can be used for the first and second electronic devices to exchange data (such as text, images, etc.).

[0055] In one possible implementation, during the Bluetooth pairing process described above, the first and second electronic devices can verify user consent to pair via a personal identification number (PIN). Specifically, both the first and second electronic devices have their Bluetooth enabled. The first electronic device can scan for nearby Bluetooth devices and receive broadcast data packets sent by the second electronic device. Based on the broadcast data packets from the second electronic device, the first electronic device can display its Bluetooth name and / or Bluetooth address. In response to a user action on the first electronic device's Bluetooth name and / or Bluetooth address, the first electronic device can send a Bluetooth pairing request to the second electronic device. Both the first and second electronic devices can display a user interface for entering the PIN. Once both devices receive the correct PIN, the second electronic device can send a confirmation message to the first electronic device. The Bluetooth pairing between the two devices is then successful, and a Bluetooth channel can be successfully established.

[0056] In the above method, the user needs to manually turn on Bluetooth and enter a PIN, which is cumbersome. Furthermore, manually entering a PIN is prone to error, and this PIN is often fixed and easily leaked. The security of data transmission between the first and second electronic devices via Bluetooth relies solely on the security of the Bluetooth channel. Therefore, the security of establishing a Bluetooth channel and transmitting data using that channel is relatively low.

[0057] In another possible implementation, the second electronic device can display a QR code for Bluetooth pairing. The first electronic device can pair with the second electronic device via Bluetooth by scanning the QR code. Specifically, both the first and second electronic devices have Bluetooth enabled. The first electronic device can scan the QR code on the second electronic device for Bluetooth pairing. This QR code may contain the Bluetooth address and key of the second electronic device. By scanning the QR code, the first electronic device can obtain the Bluetooth address and key of the second electronic device. The first electronic device can then pair with the second electronic device using the Bluetooth address, thus successfully establishing a Bluetooth channel. Furthermore, the first and second electronic devices can use the aforementioned key for device authentication to ensure the established Bluetooth channel is trustworthy.

[0058] In the above method, users still need to manually turn on Bluetooth and scan the QR code, which is a rather cumbersome process. Furthermore, the QR code displayed on the second electronic device is easily leaked, and the key contained within the QR code is also easily leaked, which is detrimental to the security of establishing a Bluetooth channel between devices.

[0059] This application provides a method for establishing a Bluetooth channel. In this method, both a first electronic device and a second electronic device establish a communication connection with a device management server. When a user operation triggering a first function is received, the first electronic device can turn on Bluetooth and send a Bluetooth connection request to the second electronic device through the device management server. The first function requires the first and second electronic devices to establish a Bluetooth communication connection for data interaction. The Bluetooth connection request may include the Bluetooth address of the first electronic device. Upon receiving the Bluetooth connection request, the second electronic device can turn on Bluetooth. The second electronic device can randomly generate a shared key and send the shared key and its own Bluetooth address to the first electronic device through the device management server. The first electronic device can send a Bluetooth binding request to the second device based on the received Bluetooth address of the second electronic device. This Bluetooth binding request may include the Bluetooth address of the first electronic device. The second electronic device can verify whether the Bluetooth address in the Bluetooth binding request is the same as the Bluetooth address in the Bluetooth connection request. If they are the same, the second electronic device can send a binding agreement message to the first electronic device. In this way, a Bluetooth channel is successfully established between the first and second electronic devices. Furthermore, the first and second electronic devices can also authenticate each other's identities using the shared key to ensure the security of the Bluetooth channel.

[0060] The aforementioned first function can be, for example, the function of a first electronic device (such as a parent's mobile phone) activating, recharging, or deleting a public transport card for a second electronic device (such as a children's watch) via Bluetooth; it can also be, for example, the function of the first electronic device transmitting text, images, or other data to the second electronic device via Bluetooth. This application does not limit the specific type of the aforementioned first function in its embodiments.

[0061] As can be seen from the Bluetooth channel establishment method described above, users no longer need to perform cumbersome operations such as manually turning on Bluetooth and manually establishing Bluetooth pairing relationships between devices when using the first function. This not only simplifies user operations during the Bluetooth connection process but also reduces the potential leakage of pairing information due to manual Bluetooth pairing relationships, thereby improving the security of establishing the Bluetooth channel. Furthermore, after establishing the Bluetooth channel, the first and second electronic devices can also authenticate each other using a shared key. This helps ensure the security of the Bluetooth channel and improves the security of data transmission between devices via the Bluetooth channel.

[0062] Figure 1 An example of a communication system 10 is shown.

[0063] The Bluetooth channel establishment method provided in this application embodiment can be applied to the communication system 10.

[0064] like Figure 1As shown, the communication system 10 may include a first electronic device 100, a second electronic device 200, and a device management server 300. The first electronic device 100 and the second electronic device 200 are within the Bluetooth communication range, meaning they can establish a Bluetooth communication connection. Both the first electronic device 100 and the second electronic device 200 can establish a communication connection with the device management server 300. Both the first electronic device 100 and the second electronic device 200 can communicate with the device management server 300 via mobile data communication (such as 2G / 3G / 4G / 5G) or wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks). This application embodiment does not limit the specific method of communication between the first electronic device 100, the second electronic device 200, and the device management server 300.

[0065] The first electronic device 100 may include a first function. The second electronic device 200 may include a second function. During application, the first and second functions enable data interaction between the first electronic device 100 and the second electronic device 200. Specifically, the data exchanged can be transmitted via a Bluetooth channel between the two devices.

[0066] For example, the first function can be used to control and manage the second function. For instance, the first function is the function of the first electronic device 100 to activate, recharge, and delete a bus card for the second electronic device 200. The second function is the function of the bus card application. Specifically, in response to a user operation on the first electronic device 100 to activate a bus card for the second electronic device 200, the first electronic device 100 can send the relevant information of the activated bus card (such as the card number) to the second electronic device 200 via a Bluetooth channel. The second electronic device 200 can store the aforementioned bus card information. Furthermore, in response to a user operation applying the second function, the second electronic device 200 can display the aforementioned bus card information.

[0067] Alternatively, the first and second functions can be the same function included in different devices. For example, the first function could be the function of sharing pictures from a gallery application via Bluetooth in the first electronic device 100. The second function could be the function of sharing pictures from a gallery application via Bluetooth in the second electronic device 200.

[0068] The device management server 300 can store the binding relationship between the first electronic device 100 and the second electronic device 200. For example, the first electronic device 100 can establish a binding relationship with the second electronic device 200 by scanning a QR code on the second electronic device 200. The device management server 300 can send instructions, requests, and other data (such as Bluetooth connection requests) from the first electronic device 100 to the second electronic device 200. The device management server 300 can also send instructions, requests, and other data (such as the device identifier of the second electronic device 200) from the second electronic device 200 to the first electronic device 100. That is to say, the device management server 300 can be used to transmit data for establishing a Bluetooth channel between the first electronic device 100 and the second electronic device 200.

[0069] In one possible implementation, the device management server 300 may store the device identifier of the first electronic device 100, such as its physical address. Using the device identifier of the first electronic device 100, the device management server 300 can query the device identifiers of all electronic devices bound to the first electronic device 100, such as the device identifier of the second electronic device 200. The device management server 300 can then confirm the binding relationship between the first electronic device 100 and the second electronic device 200. This application embodiment does not limit the method by which the binding relationship between the first electronic device 100 and the second electronic device is established.

[0070] In another possible implementation, the device management server 300 may store a first account and a second account bound to the first account. The first electronic device 100 is logged into the first account, and the second electronic device 200 is logged into the second account. The first electronic device 100 and the second electronic device 200 can establish a binding relationship through the binding relationship between the first account and the second account. For example, the device management server 300 may also store the device identifiers of the devices logged into by the first account and the devices logged into by the second account. When the first account is logged in, the first function on the first electronic device 100 is available. When the second account is logged in, the second function on the second electronic device 200 is available. That is, a user can use the first and second functions by logging into the first account on the first electronic device 100 and the second account on the second electronic device 200.

[0071] Both the first electronic device 100 and the second electronic device 200 can be mobile phones, watches, tablets, laptops, ultra-mobile personal computers (UMPCs), handheld computers, netbooks, personal digital assistants (PDAs), or other electronic devices with Bluetooth communication capabilities. This application does not limit the specific categories of the first electronic device 100 and the second electronic device 200.

[0072] In the aforementioned communication system 10, upon receiving a user operation that triggers the first function, the first electronic device 100 can automatically establish a Bluetooth channel with the second electronic device 200 through the device management server 300. The interaction data between the first and second functions during application can be transmitted through this Bluetooth channel. That is, the first electronic device 100 and the second electronic device 200 can automatically establish a Bluetooth channel through communication channels other than Bluetooth (such as mobile data channels or Wi-Fi channels). This eliminates the need for the user to manually enable Bluetooth or manually establish Bluetooth pairing between the devices. This not only simplifies the user operation during Bluetooth channel establishment but also reduces the potential leakage of pairing information due to manual Bluetooth pairing by the user, thus improving the security of establishing the Bluetooth channel.

[0073] The aforementioned mobile data channel can be a communication channel for transmitting data based on a mobile data service network. The aforementioned Wi-Fi channel can be a communication channel for transmitting data based on a Wi-Fi network.

[0074] The following example uses a mobile phone as the first electronic device 100 and a watch as the second electronic device 200. The user of the first electronic device 100 can be a parent, and the user of the second electronic device 200 can be a child. In other words, the first electronic device 100 can be a parent's mobile phone, and the second electronic device 200 can be a child's watch.

[0075] based on Figure 1 In the scenario where the communication system 10 and mobile phone 100 activate a public transport card for a children's watch 200, as shown, it may have features such as... Figure 2 The communication system 11 shown.

[0076] like Figure 2 As shown, the communication system 11 may include a mobile phone 100, a children's watch 200, a children's cloud server 300, and a public transport card server 400. Among them:

[0077] Mobile phone 100 may include a function to activate a public transport card. Mobile phone 100 can activate a public transport card for children's watch 200. Mobile phone 100 can send the relevant information of the activated public transport card to children's watch 200 via Bluetooth.

[0078] The children's smartwatch 200 may include a public transport card application function. The children's smartwatch 200 can view and use the public transport cards activated by the mobile phone 100. When it receives information related to the activated public transport cards, the children's smartwatch 200 can display this information.

[0079] The mobile phone 100 and the children's watch 200 are within the Bluetooth communication range.

[0080] The children's cloud server 300 is an example of the device management server 300 in the communication system 10. The children's cloud server 300 can store the binding relationship between the mobile phone 100 and the children's watch 200. The binding method between the mobile phone 100 and the children's watch 200 can refer to the binding method of the first electronic device 100 and the second electronic device 200 in the aforementioned embodiments, and will not be repeated here. When the mobile phone 100 and the children's watch 200 need to establish a Bluetooth communication connection (such as when the mobile phone 100 activates a public transport card for the children's watch), the children's cloud server 300 can transmit data for establishing a Bluetooth channel between the two devices. Through the children's cloud server 300, the mobile phone 100 and the children's watch 200 can automatically establish a Bluetooth channel.

[0081] The public transport card server 400 can receive requests to activate public transport cards and store relevant information about the activated public transport cards (such as card number, balance, etc.) and information about the device requesting activation. The public transport card server 400 can send the relevant information of the activated public transport card to the requesting device. In response to a user operation that triggers the above-mentioned public transport card activation function, mobile phone 100 can send a request to the public transport card server 400 to apply for a public transport card for the children's watch 200. Then, the public transport card server 400 can send the relevant information of the activated public transport card to mobile phone 100.

[0082] based on Figure 2 The communication system 11 shown below will be used to describe a Bluetooth channel establishment scenario provided by an embodiment of this application.

[0083] The Bluetooth channel establishment scenario could be the scenario where the aforementioned mobile phone 100 activates a public transport card for the children's watch 200.

[0084] like Figure 3AAs shown, the mobile phone 100 can display the user interface 210 of the first application. This first application can be an application for managing and controlling the children's watch 200 using the mobile phone 100. The first application may include functions for managing and controlling the children's watch 200. For example, the mobile phone 100 can activate a public transport card function for the children's watch 200. A binding relationship is established between the mobile phone 100 and the children's watch 200. The method for establishing this binding relationship can refer to existing methods for binding mobile phones and children's watches; this application embodiment does not limit this approach.

[0085] The children's cloud server 300 can store the binding relationship between the mobile phone 100 and the children's watch 200. The mobile phone 100 can send requests and instructions to the children's watch 200 through the children's cloud server 300 to manage and control the children's watch 200. The children's watch 200 can send data to the mobile phone 100 through the children's cloud server 300, such as reporting status information.

[0086] Figure 3A The user interface 210 shown may include a device binding option 211, a children's watch avatar 212, a children's watch name 213, function controls 214, and a status bar 215. Among these:

[0087] The status bar 215 may include a mobile communication signal strength indicator 215A, a WiFi signal strength indicator 215B, a battery status indicator 215C, and a time indicator 215D. Additionally, if Bluetooth is enabled on the phone 100, the status bar 215 may also include a Bluetooth indicator. Figure 3A As can be seen, the status bar 215 does not include the Bluetooth indicator. This means that Bluetooth is not currently enabled on phone 100.

[0088] The device binding option 211 may include an icon for a children's watch that is bound to the mobile phone 100, and an add control 211D. The add control 211D can be used to add a new children's watch to the mobile phone 100 to establish a binding relationship. The icon for a children's watch bound to the mobile phone 100 may include a first icon 211A, a second icon 211B, and a third icon 211C. Each icon can indicate a children's watch bound to the mobile phone 100.

[0089] As can be seen from the device binding option 211, the mobile phone 100 is currently bound to three children's watches. In response to user actions, such as touch operations, applied to any of the first icon 211A, the second icon 211B, or the third icon 211C, the mobile phone 100 can switch the user interface displayed on the screen. The presented user interface is used to control and manage the children's watches indicated by the corresponding icons.

[0090] For example, the children's watch indicated by the first icon 211A can be the children's watch 200 in the aforementioned embodiments. In response to a user operation on the first icon 211A, the electronic device 100 can display... Figure 3A The user interface 210 shown. The children's watch avatar 212, children's watch name 213, and function controls 214 in the user interface 210 are all related to the children's watch 200.

[0091] Children's watch profile picture 212 and children's watch name 214 can be the profile picture and name of children's watch 200, respectively. For example, the name of children's watch 200 can be "Baby".

[0092] Function control 214 can be used by mobile phone 100 to display relevant functions for managing and controlling children's watch 200. In response to user actions on function control 214, mobile phone 100 can display, for example... Figure 3B The user interface 220 is shown. User interface 220 may include a function display area 223. This function display area 223 may contain multiple controls for controlling and managing the children's watch 200 using the mobile phone 100. For example, a public transport card control 223A. In response to user actions performed on any control in the function display area 223, instructions and requests sent by the mobile phone 100 to the children's cloud server 300 can be forwarded by the children's cloud server 300 to the children's watch 200.

[0093] The aforementioned bus card control 223A can be used by mobile phone 100 to activate a bus card for children's smartwatch 200, recharge the bus card, and delete the bus card.

[0094] The user interface 220 may also include a return control 221 and a title bar 222. The return control 221 can be used by the mobile phone 100 to return to the previous user interface level. For example, in response to a user action on the return control 221, the mobile phone 100 may display something like... Figure 3A The user interface 210 is shown. The title bar 222 can be used to indicate the content of the current user interface. For example, the title bar 222 can be represented by the text "Functions" to indicate that the current user interface contains functions related to the management and control of the children's watch 200 by the mobile phone 100. The title bar 222 can also be represented by icons, etc.

[0095] In response to user actions on the transit card control 223A, the mobile phone can display the following on the user interface 220: Figure 3C The Bluetooth activation prompt box 224 is shown. The function indicated by the bus card control 223A is that during application, the mobile phone 100 and the children's watch 200 need to exchange data via Bluetooth. That is, the mobile phone 100 needs to establish a Bluetooth communication connection with the children's watch 200.

[0096] Bluetooth is currently not enabled on mobile phone 100. The Bluetooth enable prompt 224 mentioned above can be used to indicate that Bluetooth needs to be enabled to use the public transport card function. The Bluetooth enable prompt 224 may include a prompt message 224A, a rejection control 224B, and an agreement control 224C. Among them:

[0097] The prompt 224A can be a text message prompting the user to turn on Bluetooth, such as "This function requires Bluetooth to be turned on." This application embodiment does not limit the specific content of the prompt 224A.

[0098] The denial control 224B can be used to deny Bluetooth from being enabled. In response to a user action on the denial control 224B, the mobile phone 100 can display something like this. Figure 3B The user interface 220 shown.

[0099] The consent control 224C can be used to enable Bluetooth. In response to a user action on the consent control 224C, the mobile phone 100 can enable Bluetooth and display the following: Figure 3D The user interface 230 shown.

[0100] The user interface 230 may include a status bar 215, a return control 231, a title bar 232, and an add control 233.

[0101] Depend on Figure 3D As shown in the status bar 215, it contains the Bluetooth indicator 215E, indicating that Bluetooth on the phone 100 is currently enabled.

[0102] The return control 231 can be used to exit the function of setting up the public transport card. In response to a user action on the return control 231, the mobile phone 100 can display the following: Figure 3B The user interface 220 shown.

[0103] The title bar 232 may contain the text information "bus card". The title bar 232 can be used to indicate that the user interface 230 is a user interface for setting up the bus card for the children's watch 200.

[0104] The add control 233 can be used to add a public transport card to the children's watch 200. The add control 233 may contain the text message "Click to add a public transport card for your child". This application embodiment does not limit the form of the add control 233 described above.

[0105] The user interface 230 may also contain more content, but this application embodiment does not limit this.

[0106] Additionally, in response to a user action on the aforementioned consent control 224C, the mobile phone 100 can also send a Bluetooth connection request to the children's watch 200 via the children's cloud server 300. This Bluetooth connection request may include the Bluetooth address of the mobile phone 100.

[0107] Bluetooth is not currently enabled on the children's watch 200. Upon receiving the aforementioned Bluetooth connection request, the children's watch 200 can display the following: Figure 3E The user interface 240 shown may include a Bluetooth activation prompt 241 and a status bar 242. Wherein:

[0108] The status bar 242 may include a mobile communication signal strength indicator 242A, a battery status indicator 242B, and a battery percentage indicator 242C. If Bluetooth is enabled on the children's watch 200, the status bar 242 may also include a Bluetooth indicator. Figure 3E As can be seen, the status bar 242 does not contain the Bluetooth indicator. This means that Bluetooth is not currently enabled on the children's watch 200.

[0109] The Bluetooth enable prompt box 241 can be used to ask the user of the children's watch 200 whether to enable Bluetooth to establish a Bluetooth communication connection with the mobile phone 100. The Bluetooth enable prompt box 241 may include a prompt message 241A, a rejection control 241B, and an agreement control 241C. Among them:

[0110] The prompt 241A can be a text message prompting the user to enable Bluetooth, such as "Mobile phone 100 requests to establish a Bluetooth connection, do you want to enable Bluetooth?". This application embodiment does not limit the specific content of the above prompt 241A.

[0111] The rejection control 241B can be used to refuse to enable Bluetooth. That is, the children's watch 200 refuses to establish a Bluetooth communication connection with the mobile phone 100. In one possible implementation, in response to a user action on the rejection control 241B, the children's watch 200 can send a message refusing to establish a Bluetooth communication connection to the mobile phone 100 via the children's cloud server 300.

[0112] The consent control 241C can be used to enable Bluetooth. In response to a user action on the consent control 224C, the children's watch 200 can enable Bluetooth and display, as shown below. Figure 3F The user interface 240 is shown. User interface 240 may include state 242. Figure 3F As shown in the status bar 242, it contains the Bluetooth indicator 242D, indicating that Bluetooth on the children's watch 200 is currently enabled.

[0113] Additionally, in response to a user action on the aforementioned consent control 242C, the children's watch 200 can send a message to the mobile phone 100 via the children's cloud server 300 to reply to the aforementioned Bluetooth connection request. This reply message may include the Bluetooth address of the children's watch 200 and a randomly generated shared key from the children's watch 200.

[0114] like Figure 4 As shown, when a reply message is received from the children's watch 200, the mobile phone 100 can send a Bluetooth binding request to the children's watch 200 based on the Bluetooth address of the children's watch 200 in the reply message. This Bluetooth binding request may contain the Bluetooth address of the mobile phone 100. Upon receiving the Bluetooth binding request, the children's watch 200 can determine that the Bluetooth address in the Bluetooth binding request is the same as the Bluetooth address in the Bluetooth connection request. Then, the children's watch 200 can reply to the mobile phone 100 with a message agreeing to the Bluetooth binding. In this way, the Bluetooth channel between the mobile phone 100 and the children's watch is automatically established.

[0115] Furthermore, the mobile phone 100 and the children's watch 200 can authenticate each other using the shared key randomly generated by the children's watch to confirm that both are trusted devices, thereby improving the security of Bluetooth communication.

[0116] The method for automatically establishing a Bluetooth channel and performing identity authentication between the mobile phone 100 and the children's watch 200 will be described in detail in subsequent embodiments, and will not be elaborated here.

[0117] As can be seen from the above scenario, when a user operation is received to trigger the function of setting up a public transport card for the children's watch 200 (such as activating, recharging, or deleting a public transport card), the mobile phone 100 and the children's watch 200 can automatically establish a Bluetooth channel through the children's cloud server 300. The aforementioned function of setting up a public transport card requires the mobile phone 100 and the children's watch 200 to establish a Bluetooth communication connection for data exchange. Users no longer need to manually establish a Bluetooth binding relationship between the mobile phone 100 and the children's watch every time they use this function. This simplifies the user operation during the Bluetooth channel establishment process. Furthermore, during the Bluetooth channel establishment process, the Bluetooth addresses and shared keys between the devices can be transmitted to both devices through the children's cloud server. This reduces the possibility of leakage of binding information due to manual Bluetooth binding by the user, improving the security of establishing the Bluetooth channel.

[0118] In some embodiments, upon receiving the action of the above Figure 3B When the user operates the public transport card control 223A as shown, the Bluetooth of the mobile phone 100 is enabled. Therefore, when the mobile phone 100 receives the user operation applied to the public transport card control 223A, it can display... Figure 3D The user interface 230 shown sends a Bluetooth connection request to the children's watch 200 via the children's cloud server 300. This means the mobile phone 100 no longer needs to ask the user whether to turn on Bluetooth.

[0119] In some embodiments, when the aforementioned Bluetooth connection request is received from the mobile phone 100, the Bluetooth of the children's watch 200 is enabled. Therefore, the children's watch 200 may not display the aforementioned Bluetooth connection request on the currently displayed user interface. Figure 3E The Bluetooth activation prompt box 241 is shown. The children's watch 200 can send a message replying to the Bluetooth connection request to the mobile phone 100 via the children's cloud server 300.

[0120] Understandably, with both mobile phone 100 and children's watch 200's Bluetooth enabled, if mobile phone 100 receives a user operation on the aforementioned public transport card control 223A, mobile phone 100 can automatically establish a Bluetooth channel with children's watch 200 through children's cloud server 300. That is to say, the user does not need to perform any manual operation to bind the Bluetooth between mobile phone 100 and children's watch 200. When the user activates, tops up, or deletes a public transport card for children's watch 200 through mobile phone 100, both mobile phone 100 and children's watch 200 can exchange data through the automatically established Bluetooth channel between the devices.

[0121] Based on the above scenarios, the following describes an implementation method for automatically establishing a Bluetooth channel provided by an embodiment of this application.

[0122] Figure 5 An exemplary flowchart illustrates a method for automatically establishing a Bluetooth channel according to an embodiment of this application. Figure 5 As shown, the method may include steps S101 to S110. Steps S101 to S105 are the process of the first electronic device 100 and the second electronic device 200 exchanging Bluetooth addresses. Steps S106 to S110 are the process of the first electronic device 100 and the second electronic device 200 establishing a Bluetooth binding relationship and performing identity authentication.

[0123] Phase 1 (S101~S105): The first electronic device 100 and the second electronic device 200 exchange Bluetooth addresses.

[0124] S101, the first electronic device 100 receives a user operation that triggers a first function. The first function requires the first electronic device 100 and the second electronic device 200 to establish a Bluetooth communication connection for data interaction.

[0125] It should be noted that the device management server 300 stores the binding relationship between the first electronic device 100 and the second electronic device 200. The first electronic device 100 can send instructions and requests to the second electronic device 200 through the device management server 300. The second electronic device 200 can also send instructions and requests to the first electronic device 100 through the device management server 300. In other words, a communication channel has been established between the first electronic device 100 and the second electronic device 200 through the device management server 300.

[0126] The aforementioned first function could be, for example, the function of the first electronic device 100 setting up a public transport card for the second electronic device 200. The user operation that triggers the first function could be, for example, the aforementioned... Figure 3B The user operation shown is applied to the bus card control 223A.

[0127] In response to the user operation that triggers the first function, the first electronic device 100 can detect whether its Bluetooth is turned on. If it detects that its Bluetooth is not turned on, the first electronic device 100 can display the following on the user interface: Figure 3C The Bluetooth enable prompt box 224 is shown. The first electronic device 100 can perform the following step S102 after enabling Bluetooth. If it detects that its Bluetooth is enabled, the first electronic device 100 can perform the following step S102.

[0128] S102, the first electronic device 100 generates a public key and a private key. The public key is used for encryption. The private key is used for decryption.

[0129] The first electronic device 100 can generate a public key and a private key using an encryption algorithm, such as an asymmetric encryption algorithm. The specific implementation process for generating the public and private keys can refer to existing methods for generating public and private keys, and this application embodiment does not limit this process.

[0130] S103, the first electronic device 100 sends a Bluetooth connection request to the second electronic device 200 through the device management server 300. The Bluetooth connection request includes a first Bluetooth address and the public key from step S102.

[0131] Since the first function requires the establishment of a Bluetooth communication connection between the first electronic device 100 and the second electronic device 200, the first electronic device 100 can use the communication channel established between the two devices through the device management server 300 to send the Bluetooth connection request to the second electronic device 200.

[0132] Specifically, the first electronic device 100 can send the aforementioned Bluetooth connection request to the device management server 300. The device management server 300 can use the communication channel between the first electronic device 100 and the second electronic device 200 to send the Bluetooth connection request from the first electronic device 100 to the second electronic device 200.

[0133] In some embodiments, the Bluetooth connection request may further include a device identifier of the second electronic device 200. When a Bluetooth connection request is received from the first electronic device 100, the device management server 300 can confirm that the electronic device indicated by the device identifier in the Bluetooth connection request is a device bound to the first electronic device 100. Then, the device management server 300 can send the Bluetooth connection request to the second electronic device 200 based on the device identifier.

[0134] The first Bluetooth address in the above connection request is the Bluetooth address of the first electronic device 100.

[0135] S104. The second electronic device 200 turns on Bluetooth broadcast, randomly generates a shared key, and uses the public key to encrypt the shared key to obtain an encrypted shared key.

[0136] Upon receiving a Bluetooth connection request, the second electronic device 200 can detect whether its Bluetooth is enabled. If it detects that its Bluetooth is not enabled, the second electronic device 200 can display the following: Figure 3E The Bluetooth enable prompt box 241 is shown. The second electronic device 200 can broadcast Bluetooth data after Bluetooth is enabled, sending broadcast data packets. If it detects that its own Bluetooth is enabled, the second electronic device 200 can broadcast Bluetooth data, sending broadcast data packets. These broadcast data packets contain its own Bluetooth address.

[0137] Upon receiving a Bluetooth connection request and confirming that its Bluetooth is enabled, the second electronic device 200 can randomly generate a shared key. The second electronic device 200 can then encrypt the shared key using the public key from the Bluetooth connection request to obtain an encrypted shared key.

[0138] The second electronic device 200 can store the first Bluetooth address in the Bluetooth connection request.

[0139] S105, the second electronic device 200 sends a reply message to the first electronic device 100 via the device management server 300, responding to the aforementioned Bluetooth connection request. This reply message includes the second Bluetooth address and an encrypted shared key.

[0140] The second electronic device 200 can send a reply message to the first electronic device 100 in response to the Bluetooth connection request.

[0141] Specifically, the second electronic device 200 can send the aforementioned reply message to the device management server 300. The device management server 300 can use the communication channel between the first electronic device 100 and the second electronic device 200 to send the reply message from the second electronic device 200 to the first electronic device 100.

[0142] In some embodiments, the reply message may further include a device identifier of the first electronic device 100. When a reply message is received from the second electronic device 200, the device management server 300 can confirm that the electronic device indicated by the device identifier in the reply message is the device bound to the second electronic device 200. Then, the device management server 300 can send the reply message to the first electronic device 100 based on the device identifier.

[0143] The second Bluetooth address in the above reply message is the Bluetooth address of the second electronic device 200.

[0144] After steps S101 to S105, the first electronic device 100 and the second electronic device 200 exchange their respective Bluetooth addresses through the device management server 300. The first electronic device 100 can determine which device it wants to establish a Bluetooth communication connection with. The second electronic device 200 can also determine which device it wants to establish a Bluetooth communication connection with. This method simplifies the user operation during the process of establishing a Bluetooth communication connection between the two devices. The user does not need to manually select the device to establish a Bluetooth communication connection.

[0145] Phase 2 (S106~S110): The first electronic device 100 and the second electronic device 200 establish a Bluetooth binding relationship and perform identity authentication.

[0146] S106. Upon receiving the reply message from step S105, the first electronic device 100 scans nearby Bluetooth devices and decrypts the shared key encrypted in the reply message using the private key from step S102.

[0147] Upon receiving the response message in step S105, the first electronic device 100 can send a scan request to scan for nearby Bluetooth devices. These Bluetooth devices can refer to electronic devices in a Bluetooth-connectable state. Bluetooth devices can send broadcast data packets. The first electronic device 100 can determine whether the second electronic device 200 is within its Bluetooth communication range by sending the scan request.

[0148] The first electronic device 100 can receive broadcast data packets sent by one or more nearby Bluetooth devices. One or more Bluetooth devices include a second electronic device 200. When the first electronic device 100 receives the broadcast data packet from the second electronic device 200, the first electronic device 100 can determine that the second electronic device is within its Bluetooth communication range. Then, the first electronic device 100 can perform the following step S107.

[0149] In some embodiments, the first electronic device 100 may begin sending a scan request to scan for nearby Bluetooth devices after Bluetooth is enabled. This application embodiment does not limit the time at which the first electronic device 100 begins sending the scan request.

[0150] S107, the first electronic device 100 sends a Bluetooth binding request based on the second Bluetooth address in the reply message. The Bluetooth binding request contains the first Bluetooth address.

[0151] S108, the second electronic device 200 determines that the Bluetooth address in the Bluetooth binding request is the same as the Bluetooth address in the Bluetooth connection request.

[0152] Upon receiving the aforementioned Bluetooth binding request, the second electronic device 200 can verify whether the electronic device that sent the Bluetooth binding request is the same electronic device with which it wants to establish a Bluetooth communication connection.

[0153] Specifically, the second electronic device 200 can compare whether the Bluetooth address in the Bluetooth pairing request is the same as the Bluetooth address in the aforementioned Bluetooth connection request. When it is determined that the Bluetooth address in the Bluetooth pairing request is the same as the Bluetooth address in the Bluetooth connection request, the second electronic device 200 can perform the following step S109.

[0154] S109. The second electronic device 200 can reply to the first electronic device 100 with a confirmation message of binding based on the first Bluetooth address.

[0155] When the first electronic device 100 receives a confirmation message from the second electronic device 200, the Bluetooth pairing between the first electronic device 100 and the second electronic device 200 is successful. This means a Bluetooth channel has been successfully established between the two devices.

[0156] S110, the first electronic device 100, and the second electronic device 200 use the shared key to perform identity authentication.

[0157] In order to determine whether the electronic devices at both ends of the Bluetooth channel are trusted electronic devices, the first electronic device 100 and the second electronic device 200 can use the shared key for authentication.

[0158] The following describes in detail an implementation method for identity authentication between electronic devices that establish a Bluetooth channel, provided by an embodiment of this application.

[0159] Figure 6 An exemplary flowchart illustrates a method for identity authentication between a first electronic device 100 and a second electronic device 200. This method may include steps S201 to S208. Wherein:

[0160] S201, the first electronic device 100 sends an authentication request to the second electronic device 200. The authentication request may include a first random number and a first device identifier.

[0161] This application does not limit the method by which the first electronic device 100 generates the first random number. The authentication request may include more or less content than just the first random number and the first device identifier.

[0162] S202, the second electronic device 200 sends a reply message to the first electronic device 100. The reply message may include a second random number and a second device identifier.

[0163] This application does not limit the method by which the second electronic device 200 generates the second random number. It is not limited to the second random number and the second device identifier; the response message may also contain more or less content.

[0164] S203. The first electronic device 100 uses a shared key, a first random number, and a second random number to generate an authentication key (master key, MK) using a first encryption algorithm.

[0165] S204, the second electronic device 200 uses a shared key, a first random number, and a second random number to generate MK using a first encryption algorithm.

[0166] The shared key mentioned above is the one described earlier. Figure 5 The shared key generated by the second electronic device 200 in step S104 is shown. The first electronic device 100 can receive the encrypted shared key from the second electronic device 200. The first electronic device 100 decrypts the encrypted shared key to obtain the shared key.

[0167] Both the first electronic device 100 and the second electronic device 200 can generate the aforementioned MK and use it to complete identity authentication. The first encryption algorithm can be, for example, a password-based key derivation function (PBKDF2). The specific process by which the first electronic device 100 and the second electronic device 200 generate the aforementioned MK can refer to the execution process of PBKDF2 in the prior art. This application does not limit the type of the aforementioned first encryption algorithm.

[0168] S205, the second electronic device 200 sends a first encryption parameter to the first electronic device 100. The first encryption parameter is generated by the second electronic device 200 using a second encryption algorithm based on MK, a first random number, a second random number, and a first device identifier.

[0169] The second encryption algorithm described above can be, for example, a hash-based message authentication code (HMAC) algorithm. The specific process by which the second electronic device 200 generates the first encryption parameters can refer to the execution process of the HMAC algorithm in the prior art. This application does not limit the type of the second encryption algorithm described above.

[0170] S206. The first electronic device 100 generates a second encryption parameter based on the locally generated MK, a first random number, a second random number, and a first device identifier using a second encryption algorithm, and determines that the first encryption parameter and the second encryption parameter are the same. The identity authentication of the second electronic device 200 is successful.

[0171] S207, the first electronic device 100 sends a third encryption parameter to the second electronic device 200. This third encryption parameter is generated by the first electronic device 100 using a second encryption algorithm based on MK, a first random number, a second random number, and a second device identifier.

[0172] S208, the second electronic device 200 generates a fourth encryption parameter based on the locally generated MK, the first random number, the second random number, and the second device identifier using the second encryption algorithm, and determines that the third encryption parameter and the fourth encryption parameter are the same. The authentication of the first electronic device 100 is successful.

[0173] The data exchanged between the first electronic device 100 and the second electronic device 200 in steps S201 to S208 above can all be obtained through the aforementioned... Figure 5 The Bluetooth channel established by the method shown is used for transmission.

[0174] As can be seen from steps S206 and S208 above, both the first electronic device 100 and the second electronic device 200 have successfully authenticated each other. The first electronic device 100 and the second electronic device 200 can confirm that the electronic device at the other end of the Bluetooth channel is a trusted electronic device. These two devices can then transmit the data required for the first function during application via the Bluetooth channel.

[0175] In some embodiments, the first electronic device 100 and the second electronic device 200 may further encrypt the data transmitted in the Bluetooth channel to improve the security of Bluetooth communication. Specific encryption methods can refer to existing methods for encrypting data during Bluetooth communication; this application embodiment does not limit such methods.

[0176] Figure 6 The method shown is an exemplary method for identity authentication, and the embodiments of this application do not limit the method for identity authentication between devices.

[0177] Depend on Figure 5 and Figure 6 As shown in the diagram, the first and second electronic devices can automatically establish a Bluetooth channel using other communication channels (such as those established via a device management server). When a user needs to communicate via Bluetooth using the first and second electronic devices, the automatic establishment of a Bluetooth channel simplifies the user's operations during the channel establishment process. Users no longer need to perform tedious operations such as manually enabling Bluetooth and manually establishing Bluetooth pairing relationships between devices. This reduces the risk of binding information leakage that might occur due to manual Bluetooth pairing, thus improving the security of the established Bluetooth channel. Furthermore, after establishing the Bluetooth channel, the first and second electronic devices can also authenticate each other using a shared key. This helps ensure the security of the Bluetooth channel and improves the security of data transmission between devices via the Bluetooth channel.

[0178] In response to a user operation that triggers the first function, the first electronic device 100 and the second electronic device 200 can, according to Figure 5 and Figure 6 The method shown establishes a Bluetooth channel and uses this Bluetooth channel to transmit the data that the first function mentioned above needs to transmit during the application process.

[0179] The following describes the scenario where, after a Bluetooth channel is established between a mobile phone (i.e., the first electronic device) 100 and a children's watch (i.e., the second electronic device) 200, the mobile phone 100 activates a transportation card for the children's watch 200.

[0180] Figures 7A to 7D An exemplary diagram illustrates a scenario where mobile phone 100 activates a public transport card for children's smartwatch 200.

[0181] like Figure 7A As shown, in response to a user action that adds control 233 to user interface 230, mobile phone 100 can display as follows: Figure 7BThe user interface 250 is shown. User interface 250 may include indicators for one or more public transport cards that can be added, such as Beijing public transport card indicator 251, Shanghai public transport card indicator 252, and Shenzhen public transport card indicator 253. User interface 250 may contain more or less content, and this embodiment of the application does not limit this.

[0182] In response to a user action on the Beijing public transport card indicator 251, mobile phone 100 can apply to the public transport card server to activate a Beijing public transport card. When the Beijing public transport card is successfully activated, mobile phone 100 can display the following... Figure 7C The user interface 230 shown may include a bus card quantity indicator 235, a Beijing bus card indicator 234, and an add control 233.

[0183] The aforementioned bus card quantity indicator 235 can be used to indicate the number of bus cards activated on the children's watch 200. For example, the bus card quantity indicator 235 can contain the text information "One in total", which can indicate that there is one bus card on the children's watch 200.

[0184] The Beijing public transport card indicator 234 indicates that the public transport card displayed on the children's watch 200 is a Beijing public transport card. Through user operations on the Beijing public transport card indicator 234, the user can view the balance of the public transport card, recharge the card, or delete the card.

[0185] The user interface 230 may also contain more or less content, which is not limited in this embodiment.

[0186] In addition, once the public transport card applied for by mobile phone 100 from the public transport card server is successfully activated, mobile phone 100 can send the relevant information of the public transport card (such as card number and balance) to children's watch 200 through the Bluetooth channel established in the aforementioned embodiment. Children's watch 200 can store the relevant information of the public transport card from mobile phone 100.

[0187] Figure 7D An example is shown of the user interface 260 of a public transport card present on a children's watch 200. For example... Figure 7D As shown, the user interface 260 may include a title bar 261, a Beijing public transport card indicator 262, and a public transport card quantity identifier 263. The title bar 261 may contain the text "public transport card," indicating that the current user interface contains information related to public transport cards. The Beijing public transport card indicator 262 indicates that the public transport card present on the children's watch 200 is a Beijing public transport card. The public transport card quantity identifier 263 may contain the text "one in total," indicating that one public transport card is present on the children's watch 200.

[0188] The user interface 260 may also contain more or less content, which is not limited in this embodiment.

[0189] Figure 8 An exemplary flowchart illustrates a method for a mobile phone 100 to activate a public transport card for a children's smartwatch 200.

[0190] like Figure 8 As shown, the method includes steps S301 to S305. Wherein:

[0191] S301, Mobile Phone 100 received a user's request to activate a public transport card for Children's Watch 200.

[0192] The above user operation of activating a public transport card can, for example, be applied to, such as... Figure 3B The user operation of the bus card control 223A shown is illustrated.

[0193] Automatically establish a Bluetooth channel between S302, mobile phone 100 and children's watch 200.

[0194] During the aforementioned process of activating the public transport card, mobile phone 100 needs to establish a Bluetooth communication connection with children's watch 200 to transmit data. The mobile phone and children's watch 200 can, as described above... Figure 5 The method shown automatically establishes a Bluetooth channel, which will not be elaborated further here.

[0195] S303, Mobile Phone 100 applies for a bus card from Bus Card Server 400.

[0196] For example, in response to acting on such Figure 7B As shown in the Beijing public transport card indicator 251, user operation allows mobile phone 100 to send a message to public transport card server 400 to apply for a public transport card. This message may include information such as the type of public transport card being applied for.

[0197] S304, the public transport card server 400 sends relevant information about the activated public transport card to the mobile phone 100. This information may include the card number and balance.

[0198] When a message is received from mobile phone 100 requesting a public transport card, public transport card server 400 can activate the public transport card for mobile phone 100. The specific process of public transport card server 400 activating the public transport card can refer to the implementation methods in the prior art, and this application embodiment does not limit it.

[0199] The public transport card server 400 can send relevant information about the activated public transport card (such as card number and balance) to the mobile phone 100. The aforementioned public transport card information may also include more or less information.

[0200] S305 and mobile phone 100 send bus card information to children's watch 200 via Bluetooth.

[0201] In some embodiments, upon receiving a user operation to disable the first function, the first electronic device 100 can configure its own Bluetooth (e.g., disable Bluetooth or unbind Bluetooth from the second electronic device 200) and send an instruction message to the second electronic device 200 to disconnect the Bluetooth channel via the device management server 300. The first electronic device 100 and the second electronic device 200 can disconnect the Bluetooth channel after the first function is disabled.

[0202] Figure 9 An exemplary flowchart of a method for disconnecting a Bluetooth channel is shown in an embodiment of this application.

[0203] like Figure 9 As shown, the method may include steps S401 to S405. Wherein:

[0204] S401, the first electronic device 100 receives a user operation to disable the first function.

[0205] The aforementioned first function requires the first electronic device 100 and the second electronic device 200 to establish a Bluetooth communication connection for data interaction. For example, the first function could be the function of the aforementioned mobile phone 100 setting up a public transport card for the children's watch 200.

[0206] The aforementioned user action of disabling the first function can be, for example, applied to... Figure 3D The user operation of the return control 231 is shown in the user interface 230.

[0207] S402, the first electronic device 100 sends an instruction message to the second electronic device 200 to disconnect the Bluetooth channel through the device management server 300.

[0208] A communication channel still exists between the first electronic device 100 and the second electronic device 200, through the device management server 300. The device management server 300 can use this communication channel to send an instruction message from the first electronic device 100 to the second electronic device 200 indicating that the Bluetooth channel has been disconnected.

[0209] In some embodiments, the Bluetooth channel disconnection indication message may further include the device identifier of the second electronic device 200. Upon receiving the Bluetooth channel disconnection indication message, the device management server 300 may also send the Bluetooth channel disconnection indication message to the second electronic device 200 based on the device identifier.

[0210] S403, the second electronic device 200 sets up Bluetooth.

[0211] In one possible implementation, upon receiving the aforementioned instruction message to disconnect the Bluetooth channel, the second electronic device 200 can turn off its own Bluetooth. Because the second electronic device 200 turns off Bluetooth, it cannot continue Bluetooth communication, and the first electronic device 100's Bluetooth cannot connect to the second electronic device 200's Bluetooth. That is, the Bluetooth channel between the first electronic device 100 and the second electronic device 200 is disconnected.

[0212] In another possible implementation, upon receiving the aforementioned instruction message to disconnect the Bluetooth channel, the second electronic device 200 can unbind its Bluetooth connection from the first electronic device 100. Specifically, the second electronic device 200 can delete information such as the Bluetooth address and shared key of the first electronic device 100. When the Bluetooth binding between the two devices is removed, the second electronic device 200 cannot exchange data with the first electronic device 100 via Bluetooth communication. That is, the Bluetooth channel between the first electronic device 100 and the second electronic device 200 is disconnected.

[0213] S404, the second electronic device 200 sends the Bluetooth setting result to the first electronic device 100 through the device management server 300.

[0214] The result of setting up Bluetooth as described above could be, for example, an instruction for the second electronic device 200 to turn off Bluetooth, or an instruction for the second electronic device 200 to unbind from the first electronic device 100 via Bluetooth.

[0215] In some embodiments, when the second electronic device 200 fails to set up Bluetooth (e.g., fails to successfully turn off Bluetooth or fails to successfully unbind the Bluetooth pairing relationship with the first electronic device 100), the result of setting up Bluetooth may be a message indicating that the second electronic device 200 has failed to set up Bluetooth.

[0216] This application embodiment does not limit the content included in the above Bluetooth setting results.

[0217] S405, the first electronic device 100 sets up Bluetooth.

[0218] The first electronic device 100 can turn off its own Bluetooth or unbind itself from the second electronic device 200 via Bluetooth. Specifically, unbinding the first electronic device 100 from the second electronic device 200 can involve deleting information such as the second electronic device 200's Bluetooth address and shared key.

[0219] In some embodiments, the Bluetooth settings configured by the first electronic device 100 in step S405 and the Bluetooth settings configured by the second electronic device 200 in step S403 can both be either turning off Bluetooth or unbinding the Bluetooth pairing relationship with the peer electronic device.

[0220] It should be noted that if the Bluetooth channel is disconnected due to the first electronic device 100 and the second electronic device 200 turning off Bluetooth, the first electronic device 100 and the second electronic device 200 do not need to re-authenticate their devices when re-establishing the Bluetooth channel. Specifically, when the first electronic device 100 and the second electronic device 200 turn off Bluetooth, the first electronic device 100 does not delete the Bluetooth address, shared key, or other information of the second electronic device 200. The second electronic device 200 also does not delete the Bluetooth address, shared key, or other information of the first electronic device 100. When a user operation triggering the first function is received, the first electronic device 100 and the second electronic device 200 can, according to... Figure 5 The method shown involves exchanging Bluetooth addresses. When the first electronic device 100 determines that its stored Bluetooth address contains the Bluetooth address sent by the second electronic device 200, the first electronic device 100 can send a Bluetooth pairing request to the second electronic device 200. The method for establishing a Bluetooth channel between these two devices can be found in [reference needed]. Figure 5 Steps S107 to S109 in the method shown will not be repeated here.

[0221] When a user operation to terminate the first function is received, the first electronic device 100 and the second electronic device 200 turning off Bluetooth helps save power consumption.

[0222] Understandably, when the distance between the first electronic device 100 and the second electronic device 200 exceeds the maximum distance for Bluetooth communication, the Bluetooth channel between the devices will also be disconnected.

[0223] In the event that the Bluetooth channel is disconnected due to the first electronic device 100 and the second electronic device 200 unbinding from the peer electronic device, the first electronic device 100 and the second electronic device 200 need to re-establish the Bluetooth channel through... Figure 5 The method shown establishes a Bluetooth channel. When unbinding from the peer electronic device, the first electronic device 100 deletes the Bluetooth address, shared key, and other information of the second electronic device 200. The second electronic device 200 also deletes the Bluetooth address, shared key, and other information of the first electronic device 100. Therefore, when these two devices re-establish a Bluetooth communication connection, they can authenticate each other after successfully establishing the Bluetooth channel, ensuring that both ends of the Bluetooth channel are trusted devices.

[0224] In some embodiments, when a user operation to disable the first function is received, the first electronic device 100 and the second electronic device 200 may specifically restore the Bluetooth state to the state before the first function was triggered. Specifically, if the Bluetooth of the first electronic device 100 was enabled before receiving the user operation to trigger the first function, the first electronic device 100 may maintain the Bluetooth enabled state in step S405. If the Bluetooth of the first electronic device 100 was disabled before receiving the user operation to trigger the first function, the first electronic device 100 may maintain the Bluetooth disabled state in step S405. If the Bluetooth of the second electronic device 200 was enabled before receiving the Bluetooth connection request, the second electronic device 200 may maintain the Bluetooth enabled state in step S403. If the Bluetooth of the second electronic device 200 was disabled before receiving the Bluetooth connection request, the second electronic device 200 may disable Bluetooth in step S403.

[0225] As can be seen from the above method, the first electronic device 100 and the second electronic device 200 can automatically establish a Bluetooth channel when the first function is triggered, and automatically disconnect the Bluetooth channel when the first function is turned off. Specifically, automatically disconnecting the Bluetooth channel can be achieved by turning off Bluetooth and / or unbinding the Bluetooth pairing with the peer electronic device. Users do not need to manually turn off Bluetooth or unbind the Bluetooth pairing with the peer electronic device. This simplifies the user operation when disconnecting the Bluetooth channel between devices. Furthermore, turning off Bluetooth on both the first electronic device 100 and the second electronic device 200 saves power.

[0226] The communication channel used to assist in establishing a Bluetooth channel in this application embodiment is not limited. In addition to the communication channel through which the first electronic device 100 and the second electronic device 200 communicate via the device management server 300 in the foregoing embodiments (this communication channel can be a communication channel composed of a mobile data channel and / or a Wi-Fi channel), the first electronic device 100 and the second electronic device 200 can also establish a Bluetooth channel between the devices through other wired channels (such as communication channels connected via a universal serial bus (USB) interface) or wireless channels (such as near field communication (NFC) channels or wireless local area network (WLAN) direct connection channels).

[0227] In other words, when two devices have established a communication channel other than a Bluetooth channel, they can exchange their respective Bluetooth addresses and shared keys for authentication through the established communication channel. Furthermore, the two devices can automatically establish a Bluetooth channel using the exchanged Bluetooth addresses and use the shared key for authentication, thereby improving the security of establishing the Bluetooth channel.

[0228] In addition, the first electronic device 100 and the second electronic device 200 can also disconnect the Bluetooth channel through other communication channels besides the aforementioned Bluetooth channel. The method for disconnecting the Bluetooth channel can be referred to the foregoing. Figure 9 The flowchart shown is not repeated here.

[0229] In some embodiments, the first electronic device 100 and the second electronic device 200 can establish a WLAN direct connection channel through an established communication channel (such as a communication channel based on communication with the device management server 300, a Bluetooth channel, an NFC channel, etc.). Specifically, the first electronic device 100 and the second electronic device 200 can first exchange their respective device address identifiers, such as media access control (MAC) addresses, through an established communication channel. The aforementioned device address identifier can be used to determine the communication address of the electronic device on the communication channel to be established. The aforementioned device address identifier can uniquely identify the electronic device. The first electronic device 100 can discover the second electronic device 200 through the Wi-Fi network. Further, the first electronic device 100 can request the establishment of a WLAN direct connection channel with the second electronic device 200 based on the received device address identifier. After confirming that the device address identifier of the device requesting the establishment of a WLAN direct connection channel is the same as the device address identifier obtained during the aforementioned exchange of device address identifiers, the second electronic device 200 agrees to establish a WLAN direct connection channel with the first electronic device 100.

[0230] Furthermore, the first electronic device 100 and the second electronic device 200 can also transmit a shared key through the established communication channel. Based on the shared key, the first electronic device 100 and the second electronic device 200 can authenticate each other to ensure that the electronic devices at both ends of the WLAN direct connection channel are trustworthy.

[0231] The mobile data channel, Wi-Fi channel, NFC channel, WLAN Direct channel, and Bluetooth channel in the aforementioned embodiments are all physical channels used in the data transmission process. During data transmission, these channels are divided according to different applications, and data from different applications can be transmitted through different logical channels. This avoids interference between data from different applications. However, data from different logical channels can be transmitted to the peer device through the same physical channel.

[0232] To facilitate understanding, the relevant concepts of physical channels and logical channels will be introduced below.

[0233] 1. Physical channel

[0234] A physical channel can be a channel that transmits data based on a physical medium. Such physical media can be, for example, telephone lines, radio waves, optical fibers, coaxial cables, microwaves, etc.

[0235] Once the physical address of the target device for receiving data is determined, the electronic device can transmit data to the target device through a physical channel.

[0236] In the context of Bluetooth, the physical channel can refer to the Bluetooth physical connection. For example, a physical connection based on asynchronous connectionless link (ACL) or a physical connection based on synchronous connection oriented link (SCO).

[0237] 2. Logical Channel

[0238] A logical channel can be a channel that transmits different types of information over a physical channel. A logical channel can be an application-oriented channel. Based on the logical channel's identity (ID), an electronic device can determine the content of the data transmitted in the logical channel (e.g., audio data, image data) and the application to which the data is directed. Specifically, on a logical channel where application A on one electronic device interacts with application B on another electronic device, there can be port number A and port number B. Port number A can be the address of the logical channel on the electronic device where application A resides. Port number B can be the address of the logical channel on the electronic device where application B resides. Based on port number A, the electronic device can transmit data from application A to the peer electronic device via the logical channel. Based on port number B, the peer electronic device can deliver data received from the logical channel to application B. In other words, an electronic device can transmit data from one application to another application on a peer electronic device based on the port numbers of the logical channel at both ends of the data interaction device.

[0239] In the context of Bluetooth, a logical channel can refer to a Bluetooth application profile connection. A Bluetooth application profile defines how an electronic device implements a connection or application. Examples include the Generic Access Profile (GAP) and the Service Discovery Application Profile (SDAP).

[0240] In some embodiments, when a first electronic device and a second electronic device establish a first logical channel, the first electronic device can establish a second logical channel through the first logical channel. The first logical channel can be a logical channel for data exchange between a first function on the first electronic device and a second function on the second electronic device during application. The second logical channel can be a logical channel for data exchange between a third function on the first electronic device and a fourth function on the second electronic device during application. The third function is a function that requires a communication connection between the first and second electronic devices for data exchange. Specifically, the data from the third function during application is sent to the fourth function. The third function can receive data from the fourth function during application through the second logical channel.

[0241] Each of the aforementioned first, second, third, and fourth functions has a corresponding application program. The electronic device executes the instructions within the corresponding application program to achieve the aforementioned first, second, third, and fourth functions.

[0242] The first and second logical channels mentioned above can share the same physical channel, such as a Bluetooth channel.

[0243] Figure 10 An exemplary flowchart illustrates a method for a first electronic device to establish a second logical channel for communication with a second electronic device through a first logical channel.

[0244] like Figure 10 As shown, the method may include steps S501 to S510. Steps S501 to S505 are the process of the first electronic device 100 and the second electronic device 200 exchanging the communication address of the second logical channel. Steps S506 to S510 are the process of the first electronic device 100 and the second electronic device 200 establishing the second logical channel and performing identity authentication.

[0245] Phase 1 (S501~S505): The first electronic device 100 and the second electronic device 200 exchange the communication address of the second logical channel.

[0246] S501, the first electronic device 100 receives a user operation that triggers the third function. The third function is a function that requires the first electronic device 100 and the second electronic device 200 to interact with each other through the second logical channel.

[0247] It should be noted that before receiving the user operation to trigger the third function, the first function of the first electronic device 100 has already been triggered and has not yet ended. That is, a first logical channel is established between the first electronic device 100 and the second electronic device 200. Data on this first logical channel can be transmitted via Bluetooth. The first electronic device 100 and the second electronic device 200 can... Figure 5 The method shown automatically establishes a Bluetooth channel.

[0248] S502, the first electronic device 100 generates a public key and a private key. The public key is used for encryption. The private key is used for decryption.

[0249] The application program corresponding to the third function in the first electronic device 100 can generate a public key and a private key using an encryption algorithm, such as an asymmetric encryption algorithm. The specific implementation process for generating the public and private keys can refer to existing methods for generating public and private keys, and this application embodiment does not limit this process.

[0250] S503, the first electronic device 100 sends a connection request to establish a second logical channel through the first logical channel. This connection request includes a first communication address and a public key. The first communication address is the address of the second logical channel on the first electronic device 100 side.

[0251] The applications corresponding to the first function and the third function can communicate with each other locally. The first electronic device 100 can send a connection request from the application corresponding to the second function, used to establish a second logical channel, to the second electronic device 200 via the first logical channel. This connection request can be transmitted to the second electronic device 200 via a Bluetooth channel. Then, the second electronic device 200 can, based on the port number of the first logical channel on its side, forward the connection request to the application corresponding to the second function. The applications corresponding to the second and fourth functions can communicate with each other locally. The application corresponding to the fourth function can receive the connection request.

[0252] The aforementioned first communication address may include the first physical address of the first electronic device 100 and the first port number of the second logical channel on the side of the first electronic device 100.

[0253] S504, the second electronic device 200 randomly generates a shared key and uses the public key to encrypt the shared key to obtain an encrypted shared key.

[0254] In the second electronic device 200, the application corresponding to the fourth function can randomly generate a shared key. This shared key can be used for authentication between the applications corresponding to the third and fourth functions.

[0255] The public key used to encrypt the shared secret key is the public key generated by the first electronic device 100 in step S502 above.

[0256] In addition, the second electronic device 200 may also store the aforementioned first communication address.

[0257] S505, the second electronic device 200 sends a reply message through the first logical channel. This reply message includes a second communication address and an encrypted shared key. The second communication address is the address of the second logical channel on the second electronic device 200 side.

[0258] The application corresponding to the fourth function can communicate locally with the application corresponding to the second function. The second electronic device 200 can send a reply message from the application corresponding to the fourth function to the first electronic device 100 via a first logical channel. This reply message can be transmitted to the first electronic device 100 via a Bluetooth channel. Then, the first electronic device 100, based on the port number of the first logical channel on its side, delivers the reply message to the application corresponding to the first function. The application corresponding to the first function and the application corresponding to the third function can communicate locally. The application corresponding to the third function can receive the reply message.

[0259] The aforementioned second communication address may include the second physical address of the second electronic device 200 and the second port number of the second logical channel on the side of the second electronic device 200.

[0260] After steps S501 to S505, the first electronic device 100 and the second electronic device 200 exchange the communication addresses of their respective second logical channels through the first logical channel. The application program corresponding to the third function in the first electronic device 100 can determine which application program it needs to establish a logical channel with. Similarly, the application program corresponding to the fourth function in the second electronic device 200 can determine which application program it needs to establish a logical channel with.

[0261] Phase 2 (S506~S510): The first electronic device 100 and the second electronic device 200 establish a second logical channel and perform identity authentication.

[0262] S506, the first electronic device 100 uses its private key to decrypt the encrypted shared key.

[0263] The application program corresponding to the third function in the first electronic device 100 can use the private key to decrypt the encrypted shared key and obtain the shared key.

[0264] S507, the first electronic device 100 sends a binding request for the second logical channel to the second electronic device 200 based on the second communication address. The binding request contains the first communication address.

[0265] The application corresponding to the third function in the first electronic device 100 can send a binding request for the second logical channel to the second electronic device 200 through the physical channel (i.e., the Bluetooth channel) of the first logical channel, based on the second physical address and the second port number in the second communication address.

[0266] S508, the second electronic device 200 determines that the communication address in the binding request is the same as the communication address in the connection request.

[0267] The application program corresponding to the fourth function in the second electronic device 200 can determine that the physical address in the binding request is the same as the physical address in the connection request, and that the port number in the binding request is the same as the port number in the connection request. Therefore, the communication address in the binding request is the same as the communication address in the connection request. The second electronic device 200 can then execute the following step S509.

[0268] S509, the second electronic device 200 replies to the first electronic device 100 with a confirmation message of binding based on the first communication address.

[0269] When the application corresponding to the third function in the first electronic device 100 receives the above-mentioned confirmation binding message, a second logical channel is successfully established between the application corresponding to the third function and the application corresponding to the fourth function.

[0270] S510, the first electronic device 100, and the second electronic device 200 authenticate each other using a shared key through a second logical channel.

[0271] To determine whether the applications at both ends of the second logical channel are trusted, the first electronic device 100 and the second electronic device 200 can authenticate each other using a shared key through the second logical channel. That is, the application corresponding to the third function and the application corresponding to the fourth function authenticate each other using the shared key through the second logical channel.

[0272] Depend on Figure 10As illustrated, when different applications on an electronic device transmit data to a peer electronic device through different logical channels but the same physical channel, the electronic device can use an already established logical channel to assist in establishing another logical channel and perform authentication between applications. This improves the ease and security of establishing the aforementioned logical channels.

[0273] Figure 11 An exemplary schematic diagram of an electronic device 500 provided in an embodiment of this application is shown.

[0274] The electronic device 500 may include a communication device 510, a memory 520, and a processor 530 connected via a bus. Wherein:

[0275] The communication device 510 can be used by the electronic device 500 to communicate with other electronic devices. The communication device 510 may include a mobile communication module 511 and a wireless communication module 512. The mobile communication module 511 can provide wireless communication solutions, including 2G / 3G / 4G / 5G, for use on the electronic device 500. The wireless communication module 512 can provide wireless communication solutions, including WLAN (such as Wi-Fi networks, WLAN Direct), Bluetooth, Global Navigation Satellite System (GNSS), Frequency Modulation (FM), NFC, and Infrared (IR) technologies, for use on the electronic device 500.

[0276] The communication device 510 may also contain more or less content, and this application embodiment does not limit this.

[0277] The memory 520 can be used to store information such as the physical address and Bluetooth address of the electronic device with which a communication connection has been established. The memory 520 also stores a computer program. The processor 530 can be used to execute the computer program in the memory 520, causing the electronic device 500 to perform the aforementioned actions. Figure 5 , Figure 6 , Figure 9 as well as Figure 10 The method shown.

[0278] The electronic device 500 can be either the aforementioned first electronic device 100 or the aforementioned second electronic device 200. The first electronic device 100 and the second electronic device 200 may also include more components, which are not limited in this application embodiment.

[0279] In some embodiments of this application, a first electronic device and a second electronic device establish a first communication channel. This first communication channel can represent a physical channel. Specifically, the first communication channel can be a communication channel established between the first and second electronic devices through a server. The server can be the device management server described in the preceding embodiments. The first electronic device can communicate with the server via a mobile data channel or a Wi-Fi channel. The second electronic device can also communicate with the server via a mobile data channel or a Wi-Fi channel. The first communication channel can also be a point-to-point communication channel between the first and second electronic devices, such as a WLAN direct connection channel or an NFC channel. This point-to-point communication channel can be a channel for direct communication between two devices.

[0280] In some embodiments of this application, a first electronic device detects the occurrence of a first service. Specifically, when a user operation triggering the first service is detected, the first electronic device can detect the occurrence of the first service. This first service requires the first electronic device and a second electronic device to establish a Bluetooth communication connection. The first service may be the service indicated by the data interaction between the first electronic device and the second electronic device when the first function is detected being triggered in the aforementioned embodiments. The Bluetooth communication connection established by the first electronic device and the second electronic device for this first service can refer to a Bluetooth physical connection. For example, an ACL-based physical connection or an SCO-based physical connection.

[0281] In some embodiments of this application, a first electronic device sends a first message to a second electronic device through a first communication channel, and receives a second message from the second electronic device through the first communication channel. The first message may be as described above. Figure 5 The Bluetooth connection request in step S103 shown. This second message can be the aforementioned... Figure 5 The reply message in step S105 shown.

[0282] In some embodiments of this application, the first electronic device discovers the second electronic device based on the second device's second Bluetooth address. Specifically, the first electronic device can scan for nearby Bluetooth devices. The second electronic device can enable Bluetooth broadcasting and send broadcast data packets containing the second Bluetooth address to nearby Bluetooth devices. After receiving the broadcast data packets from the second electronic device, the first electronic device can confirm that the second electronic device is within its Bluetooth communication range.

[0283] In some embodiments of this application, the first electronic device sends a Bluetooth channel establishment request to the second electronic device based on the second Bluetooth address, and receives a Bluetooth channel establishment request acceptance response from the second electronic device. The aforementioned Bluetooth channel establishment request may be one of the aforementioned... Figure 5The Bluetooth pairing request in step S107 shown. The Bluetooth channel establishment request acceptance response can be as described above. Figure 5 The message confirming the binding is shown in step S109.

[0284] In this embodiment, the second electronic device can generate a second key and generate a first key using the public key from the first electronic device. The second key is the shared key in the preceding embodiments. The first key is the encrypted shared key in the preceding embodiments. The first electronic device can obtain a third key and a sixth key based on the second key using a first encryption algorithm. The third key and the sixth key can be the second encryption parameter and the third encryption parameter in the preceding embodiments, respectively. The second electronic device can obtain a fourth key and a fifth key based on the second key using the first encryption algorithm. The fourth key and the fifth key can be the first encryption parameter and the fourth encryption parameter in the preceding embodiments, respectively. This embodiment does not limit the specific type of the first encryption algorithm. The specific implementation process of the first encryption algorithm can refer to the implementation methods in the prior art.

[0285] In some embodiments of this application, the first communication channel mentioned above can represent a first logical channel. Data on this first logical channel can be transmitted via a physical channel, such as via a Bluetooth channel. This first logical channel can be established between a first electronic device and a second electronic device when a user operation triggering a first function is detected. The first electronic device detects that a first service has occurred. This first service can be the third function in the aforementioned embodiments. The Bluetooth communication connection established between the devices for this first service can specifically be a second logical channel with the physical channel for data transmission as the Bluetooth channel. That is, the first logical channel and the second logical channel can share a physical channel. When the shared physical channel is a Bluetooth channel, the aforementioned first logical channel and the aforementioned second logical channel can specifically refer to one or more connections defined in the Bluetooth application specification. For example: GAP, SDAP, etc. Then, the first message sent by the first electronic device can include the first physical address and the first port number of the first electronic device in the aforementioned embodiments. The second message sent by the second electronic device can include the second physical address and the second port number of the second electronic device in the aforementioned embodiments.

[0286] In some embodiments of this application, a first communication channel is established between a first electronic device and a second electronic device. The second electronic device may refer to multiple electronic devices. The first communication channel may include communication channels established between the first electronic device and these multiple electronic devices. The first electronic device may utilize the existing communication channels with these multiple electronic devices to assist in establishing a Bluetooth channel with them.

[0287] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

Claims

1. A communication system, the communication system comprising a first electronic device and a second electronic device, wherein the first electronic device and the second electronic device establish a first communication channel, characterized in that, The first communication channel is a communication channel established between the first electronic device and the second electronic device through a server, and the server stores the device binding relationship between the first electronic device and the second electronic device; The first electronic device detects the occurrence of a first service; the first service requires the first electronic device and the second electronic device to establish a Bluetooth communication connection. The first electronic device generates a public key and a private key, wherein the public key is used for encryption and the private key is used for decryption; The first electronic device sends a first message to the second electronic device through the first communication channel; the first message includes the first Bluetooth address of the first electronic device and the public key; The second electronic device sends a second message to the first electronic device through the first communication channel; the second message includes the second Bluetooth address of the second electronic device and a first key, wherein the first key is obtained by the second electronic device encrypting its own second key using the public key; The first electronic device uses the private key to decrypt the first key to obtain the second key; The first electronic device discovers the second electronic device based on the second Bluetooth address; The first electronic device sends a Bluetooth channel establishment request to the second electronic device based on the second Bluetooth address; The second electronic device determines that the source address carried in the Bluetooth channel establishment request is the same as the first Bluetooth address in the first message, and the second electronic device sends a Bluetooth channel establishment request to the first electronic device to receive a response; The first electronic device and the second electronic device establish a Bluetooth channel; The first electronic device uses the second key based on the Bluetooth channel to confirm that the second electronic device is a trusted device, and the second electronic device uses the second key based on the Bluetooth channel to confirm that the first electronic device is a trusted device; When the first electronic device and the second electronic device mutually confirm that the other is a trusted device, the first electronic device and the second electronic device transmit information associated with the first service based on the Bluetooth channel.

2. The system according to claim 1, characterized in that, The Bluetooth channel includes a first logical channel. The first electronic device detects the occurrence of a second service, which requires the first electronic device and the second electronic device to establish a second logical channel. The first electronic device sends a fourth message to the second electronic device through the first logical channel. The fourth message includes a first communication address, which is the address of the second logical channel on the side of the first electronic device. The second electronic device sends a fifth message to the first electronic device through the first logical channel. The fifth message includes a second communication address, which is the address of the second logical channel on the side of the second electronic device. The first electronic device sends a binding request for the second logical channel to the second electronic device based on the second communication address; The second electronic device determines that the source address carried in the binding request is the same as the first communication address, and the second electronic device sends an acceptance response to the binding request to the first electronic device; The first electronic device and the second electronic device establish the second logical channel; The first electronic device and the second electronic device transmit information associated with the second service based on the second logical channel.

3. The system according to claim 2, characterized in that, Before the first electronic device and the second electronic device transmit the information associated with the second service based on the second logical channel. The first electronic device generates a first public key and a first private key. The first public key is used for encryption, and the first private key is used for decryption. The fourth message also includes the first public key, and the fifth message also includes a seventh key. The seventh key is obtained by the second electronic device encrypting an eighth key generated by the second electronic device using the first public key. The first electronic device uses the first private key to decrypt the seventh key to obtain the eighth key; The first electronic device uses the eighth key based on the second logical channel to determine that the second electronic device is a trusted device, and the second electronic device uses the eighth key based on the second logical channel to confirm that the first electronic device is a trusted device.

4. The system according to any one of claims 1-3, characterized in that, The first electronic device uses the second key to verify that the second electronic device is a trusted device, including: Compare the third key with the fourth key from the second electronic device; the third key is obtained by the first electronic device based on the second key using the first encryption algorithm, and the fourth key is obtained by the second electronic device based on the second key using the first encryption algorithm; If the third key and the fourth key are found to be the same, the second electronic device is confirmed to be a trusted device. The second electronic device uses the second key to verify that the first electronic device is a trusted device, including: Compare the fifth key with the sixth key from the first electronic device; the fifth key is obtained by the second electronic device based on the second key using the first encryption algorithm, and the sixth key is obtained by the first electronic device based on the second key using the first encryption algorithm; If the fifth key and the sixth key are found to be the same, the first electronic device is confirmed to be a trusted device.

5. The system according to any one of claims 1-4, characterized in that, After the first electronic device detects that the first service has occurred, the first electronic device is further configured to: If Bluetooth is detected as not being enabled, enable Bluetooth.

6. The system according to any one of claims 1-5, characterized in that, Before the second electronic device sends the second message to the first electronic device through the first communication channel, the second electronic device is also used to: If Bluetooth is detected as not being enabled, enable Bluetooth.

7. The system according to any one of claims 1-6, characterized in that, The first electronic device is also used for: After detecting the end of the first service, turn off Bluetooth.

8. The system according to any one of claims 1-7, characterized in that, The first electronic device is also used for: After detecting the end of the first service, a third message is sent to the second electronic device through the first communication channel; the third message is used to instruct the second electronic device to turn off Bluetooth; The second electronic device is also used for: After receiving the third message, turn off Bluetooth.

9. A Bluetooth channel establishment method, applicable to a first electronic device, wherein a first communication channel is established between the first electronic device and a second electronic device, characterized in that, The first communication channel is a communication channel established between the first electronic device and the second electronic device through a server, and the server stores the device binding relationship between the first electronic device and the second electronic device; The method includes: The first electronic device detects that a first service has occurred; the first service requires the first electronic device and the second electronic device to establish a Bluetooth communication connection. The first electronic device generates a public key and a private key, wherein the public key is used for encryption and the private key is used for decryption; The first electronic device sends a first message to the second electronic device through the first communication channel, and receives a second message from the second electronic device through the first communication channel; the first message includes the first Bluetooth address of the first electronic device and the public key, and the second message includes the second Bluetooth address of the second electronic device and the first key, wherein the first key is obtained by encrypting the second key using the public key; The first electronic device uses the private key to decrypt the first key to obtain the second key; The first electronic device discovers the second electronic device based on the second Bluetooth address; The first electronic device sends a Bluetooth channel establishment request to the second electronic device based on the second Bluetooth address, and receives a Bluetooth channel establishment request acceptance response from the second electronic device; the Bluetooth channel establishment request acceptance response is sent by the second electronic device after determining that the source address carried in the Bluetooth channel establishment request is the same as the first Bluetooth address in the first message; The first electronic device and the second electronic device establish a Bluetooth channel; The first electronic device uses the second key based on the Bluetooth channel to confirm that the second electronic device is a trusted device; If the second electronic device is confirmed to be a trusted device, the first electronic device transmits information associated with the first service to the second electronic device via the Bluetooth channel.

10. The method according to claim 9, characterized in that, The Bluetooth channel includes a first logical channel, and the method further includes: The first electronic device detects the occurrence of a second service, which requires the first electronic device and the second electronic device to establish a second logical channel. The first electronic device sends a fourth message to the second electronic device through the first logical channel. The fourth message includes a first communication address, which is the address of the second logical channel on the side of the first electronic device. The first electronic device receives a fifth message from the second electronic device through the first logical channel. The fifth message includes a second communication address, which is the address of the second logical channel on the side of the second electronic device. The first electronic device sends a binding request for the second logical channel to the second electronic device based on the second communication address, and receives an acceptance response from the second electronic device for the binding request. The acceptance response for the binding request is sent by the second electronic device after determining that the source address carried in the binding request is the same as the first communication address. The first electronic device and the second electronic device establish the second logical channel; The first electronic device transmits information associated with the second service to the second electronic device based on the second logical channel.

11. The method according to claim 10, characterized in that, Before the first electronic device transmits information associated with the second service to the second electronic device based on the second logical channel, the method further includes: The first electronic device generates a first public key and a first private key. The first public key is used for encryption, and the first private key is used for decryption. The fourth message also includes the first public key, and the fifth message also includes a seventh key. The seventh key is obtained by the second electronic device encrypting an eighth key generated by the second electronic device using the first public key. The first electronic device uses the first private key to decrypt the seventh key to obtain the eighth key; The first electronic device uses the eighth key based on the second logical channel to determine that the second electronic device is a trusted device.

12. The method according to any one of claims 9-11, characterized in that, The first electronic device uses the second key to verify that the second electronic device is a trusted device, specifically including: The first electronic device compares a third key with a fourth key from the second electronic device; the third key is obtained by the first electronic device based on the second key using a first encryption algorithm, and the fourth key is obtained by the second electronic device based on the second key using the first encryption algorithm. The first electronic device determines that the third key and the fourth key are the same, and confirms that the second electronic device is a trusted device.

13. The method according to any one of claims 9-12, characterized in that, After the first electronic device detects that the first service has occurred, the method further includes: The first electronic device turns on Bluetooth when it detects that Bluetooth is not turned on.

14. The method according to any one of claims 9-13, characterized in that, The method further includes: After the first electronic device detects that the first service has ended, the first electronic device turns off Bluetooth.

15. The method according to any one of claims 9-14, characterized in that, The method further includes: After the first electronic device detects that the first service has ended, the first electronic device sends a third message to the second electronic device through the first communication channel; the third message is used to instruct the second electronic device to turn off Bluetooth.

16. A Bluetooth channel establishment method, applicable to a second electronic device, wherein a first communication channel is established between the second electronic device and a first electronic device, characterized in that, The first communication channel is a communication channel established between the first electronic device and the second electronic device through a server, and the server stores the device binding relationship between the first electronic device and the second electronic device; The method includes: The second electronic device receives a first message from the first electronic device through the first communication channel, and sends a second message to the first electronic device through the first communication channel; the first message includes the first Bluetooth address and public key of the first electronic device, and the second message includes the second Bluetooth address and first key of the second electronic device, wherein the first key is obtained by the second electronic device encrypting the second key it generates using the public key; The second electronic device receives a Bluetooth channel establishment request from the first electronic device; The second electronic device determines that the source address carried in the Bluetooth channel establishment request is the same as the first Bluetooth address in the first message, and the second electronic device sends a Bluetooth channel establishment request to the first electronic device to receive a response; The second electronic device establishes a Bluetooth channel with the first electronic device; The second electronic device uses the second key based on the Bluetooth channel to confirm that the first electronic device is a trusted device; If the first electronic device is confirmed to be a trusted device, the second electronic device transmits information related to the first service to the first electronic device based on the Bluetooth channel.

17. The method according to claim 16, characterized in that, The second electronic device uses the second key to verify that the first electronic device is a trusted device, specifically including: The second electronic device compares a fifth key with a sixth key from the first electronic device; the fifth key is obtained by the second electronic device based on the second key using a first encryption algorithm, and the sixth key is obtained by the first electronic device based on the second key using the first encryption algorithm. The second electronic device determines that the fifth key and the sixth key are the same, and confirms that the first electronic device is a trusted device.

18. The method according to claim 16 or 17, characterized in that, After the second electronic device receives the first message from the first electronic device through the first communication channel, the method further includes: The second electronic device turns on Bluetooth if it detects that Bluetooth is not enabled.

19. The method according to any one of claims 16-18, characterized in that, The method further includes: The second electronic device receives a third message from the first electronic device through the first communication channel, and the second electronic device turns off Bluetooth according to the instruction of the third message.

20. An electronic device, characterized in that, The device includes a communication device, a memory, and a processor. The communication device is used to establish a communication connection, the memory is used to store a computer program, and the processor is used to invoke the computer program to cause the electronic device to perform the method according to any one of claims 9-19.