Bluetooth pairing methods, devices, systems, and storage media
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HUAWEI TECH CO LTD
- Filing Date
- 2021-11-01
- Publication Date
- 2026-05-26
AI Technical Summary
Existing Bluetooth headsets require users to manually enter pairing mode before first use, which prevents many users from completing the pairing process and affects the user experience.
By establishing a connection with the Bluetooth device through a second electronic device, a notification message is sent to the Bluetooth device to instruct it to enter pairing mode, and pairing information is obtained by generating a QR code or sharing information, simplifying the pairing process.
Pairing can be completed without requiring manual operation of the Bluetooth device, improving the pairing efficiency and user experience for Bluetooth devices that are not being used for the first time.
Smart Images

Figure CN116074793B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a Bluetooth pairing method, device, system, and storage medium. Background Technology
[0002] Bluetooth technology is a short-range wireless communication technology that is widely used in communication devices, such as smartphones and Bluetooth headsets.
[0003] Before a Bluetooth headset and a smartphone can communicate via Bluetooth for the first time, they need to be paired. Only after pairing can normal calls, audio, and other services be performed. During pairing, the Bluetooth headset needs to be in pairing mode, scanning and responding to queries sent by the smartphone, thus enabling the smartphone to discover the Bluetooth headset.
[0004] Currently, for Bluetooth headsets that are not being used for the first time, when the headset needs to communicate with an unpaired device, the user needs to manually operate a physical button on the headset to put it into pairing mode before it can pair with other unpaired devices. However, many users are unaware that this manual operation is required, causing the headset to fail to communicate with other devices. Summary of the Invention
[0005] This application provides a Bluetooth pairing method, device, system, and storage medium, enabling successful pairing of electronic devices and Bluetooth devices used for the first time.
[0006] In a first aspect, a Bluetooth pairing method is provided, applied to a communication system. The communication system includes a first electronic device, a second electronic device, and a Bluetooth device. The second electronic device and the Bluetooth device are paired, while the first electronic device and the Bluetooth device are not paired. The Bluetooth pairing method includes: the second electronic device and the Bluetooth device establishing a Bluetooth connection; the second electronic device sending a notification message to the Bluetooth device, the notification message instructing the Bluetooth device to enter pairing mode; the Bluetooth device entering pairing mode according to the notification message; the first electronic device obtaining pairing information from the second electronic device, the Bluetooth device, or a third electronic device, the pairing information including the Bluetooth address of the Bluetooth device; and the first electronic device sending a pairing request to the Bluetooth device based on the Bluetooth address of the Bluetooth device.
[0007] The Bluetooth pairing method provided in the first aspect utilizes a second electronic device in addition to the first electronic device and the Bluetooth device. This second electronic device can control the Bluetooth device to enter pairing mode, avoiding the need for user interaction to trigger pairing and eliminating the inconvenience of user operation. Furthermore, the first electronic device can obtain the Bluetooth device's Bluetooth address without sending a query request, simplifying the message flow of the pairing process. This improves the feasibility and efficiency of pairing previously used Bluetooth devices with unpaired electronic devices, enhancing the user experience.
[0008] In one possible implementation, the second electronic device sends a notification message to the Bluetooth device, including: the second electronic device receiving a first operation from the user; and the second electronic device responding to the first operation by sending a notification message to the Bluetooth device.
[0009] In this implementation, the second electronic device sends a notification message to the Bluetooth device based on the user's operation, which improves the flexibility of operation.
[0010] In one possible implementation, the second electronic device sends a notification message to the Bluetooth device, including: the second electronic device sending an L2CAP_ECHO_REQ message to the Bluetooth device, the L2CAP_ECHO_REQ message including the notification message; and the Bluetooth device sending an L2CAP_ECHO_RSP message to the second electronic device.
[0011] In this implementation, the second electronic device sends notification information to the Bluetooth device through an echo request, and the Bluetooth device confirms that it has successfully received the notification information through an echo response, thereby improving the success rate of the second electronic device sending notification information.
[0012] In one possible implementation, the first electronic device obtains pairing information from the second electronic device, including: the second electronic device generating QR code information based on the pairing information and displaying the QR code information; and the first electronic device scanning the QR code information and parsing the QR code information to obtain the pairing information.
[0013] In this implementation, the first electronic device does not need to communicate with the second electronic device. It can obtain pairing information in a visual form by scanning or taking pictures, thereby obtaining the pairing information. The first electronic device obtains pairing information from the second electronic device, involving fewer devices, fewer processing steps, and a simpler implementation method.
[0014] In one possible implementation, before the second electronic device generates QR code information based on the pairing information, the second electronic device further includes receiving a second operation from the user.
[0015] In this implementation, the second electronic device is triggered by the user's operation to generate QR code information based on the pairing information, which improves the flexibility of operation.
[0016] In one possible implementation, the first electronic device obtains pairing information from the second electronic device, including: the second electronic device and the first electronic device establishing a communication connection; the second electronic device sending pairing information to the Bluetooth device through the communication connection; and the first electronic device receiving the pairing information.
[0017] In this implementation, the second electronic device provides pairing information to the first electronic device through a communication connection with the first electronic device. This involves a small number of devices and is simple to implement.
[0018] In one possible implementation, before the second electronic device and the first electronic device establish a communication connection, the method further includes receiving a third operation from the user.
[0019] In one possible implementation, the communication connection includes any one of the following: Bluetooth connection, WiFi connection, or cellular communication connection.
[0020] In this implementation, communication connections can be of various types, which improves the flexibility of implementation.
[0021] In one possible implementation, the first electronic device obtains pairing information from the Bluetooth device, including: after the Bluetooth device enters pairing mode according to the notification information, it generates QR code information based on the pairing information and displays the QR code information; the first electronic device scans the QR code information and parses the QR code information to obtain the pairing information.
[0022] In this implementation, the first electronic device does not need to communicate with the Bluetooth device. It can obtain pairing information in a visual form from the Bluetooth device by scanning or taking pictures, thereby improving the security of the first electronic device in obtaining pairing information and making the implementation more diverse.
[0023] In one possible implementation, the third electronic device communicates with the Bluetooth device, and the first electronic device obtains pairing information from the third electronic device, including: after the Bluetooth device enters pairing mode according to the notification information, it generates QR code information based on the pairing information; the Bluetooth device sends the QR code information to the third electronic device; after the third electronic device receives the QR code information, it displays the QR code information; and the first electronic device scans the QR code information and parses the QR code information to obtain pairing information.
[0024] In this implementation, the Bluetooth device provides pairing information to the third electronic device. The first electronic device does not need to communicate with the third electronic device; it can obtain the pairing information in a visual form by scanning or taking pictures, thereby improving the security of the first electronic device obtaining the pairing information and making the implementation more diverse.
[0025] In one possible implementation, the pairing information also includes the Bluetooth device's capability information.
[0026] Secondly, a Bluetooth pairing method is provided, applied to a second electronic device, wherein the second electronic device and a Bluetooth device have been paired. The Bluetooth pairing method includes: establishing a Bluetooth connection with the Bluetooth device; and sending a notification message to the Bluetooth device, the notification message being used to instruct the Bluetooth device to enter pairing mode.
[0027] In one possible implementation, sending notification information to a Bluetooth device includes: receiving a first operation from the user; and in response to the first operation, sending notification information to the Bluetooth device.
[0028] In one possible implementation, sending notification information to the Bluetooth device includes: sending an L2CAP_ECHO_REQ message to the Bluetooth device, the L2CAP_ECHO_REQ message including notification information; and receiving an L2CAP_ECHO_RSP message sent by the Bluetooth device.
[0029] One possible implementation also includes: generating QR code information based on pairing information, including the Bluetooth address of the Bluetooth device; and displaying the QR code information.
[0030] In one possible implementation, before generating QR code information based on pairing information, the process also includes receiving a second operation from the user.
[0031] One possible implementation further includes: establishing a communication connection with a first electronic device, wherein the first electronic device and the Bluetooth device are not paired; and sending pairing information to the Bluetooth device through the communication connection, wherein the pairing information includes the Bluetooth address of the Bluetooth device.
[0032] In one possible implementation, before establishing a communication connection with the first electronic device, the method further includes receiving a third operation from the user.
[0033] In one possible implementation, the communication connection includes any one of the following: Bluetooth connection, WiFi connection, or cellular communication connection.
[0034] In one possible implementation, sending pairing information to a Bluetooth device via a communication connection includes: generating sharing information based on the pairing information; and sending the sharing information to the Bluetooth device via the communication connection.
[0035] In one possible implementation, the pairing information also includes the Bluetooth device's capability information.
[0036] Thirdly, a Bluetooth pairing method is provided, applied to a Bluetooth device, wherein the Bluetooth device is not paired with a first electronic device, and the Bluetooth device is paired with a second electronic device. The Bluetooth pairing method includes: establishing a Bluetooth connection with the second electronic device; receiving a notification message sent by the second electronic device, the notification message being used to instruct the Bluetooth device to enter pairing mode; entering pairing mode according to the notification message; and receiving a pairing request sent by the first electronic device.
[0037] In one possible implementation, receiving notification information sent by the second electronic device includes: receiving an L2CAP_ECHO_REQ message sent by the second electronic device, the L2CAP_ECHO_REQ message including notification information; and sending an L2CAP_ECHO_RSP message to the second electronic device.
[0038] In one possible implementation, after entering pairing mode based on the notification information, the process further includes: generating QR code information based on pairing information, which includes the Bluetooth address of the Bluetooth device; and sending the QR code information to a third electronic device.
[0039] In one possible implementation, after entering pairing mode based on the notification information, the process further includes: generating QR code information based on the pairing information, which includes the Bluetooth address of the Bluetooth device; and displaying the QR code information.
[0040] In one possible implementation, the pairing information also includes the Bluetooth device's capability information.
[0041] Fourthly, a Bluetooth pairing method is provided, applied to a first electronic device, wherein the first electronic device is not paired with a Bluetooth device, and the Bluetooth device is paired with a second electronic device. The Bluetooth pairing method includes: obtaining pairing information from the second electronic device, the Bluetooth device, or a third electronic device, wherein the pairing information includes the Bluetooth address of the Bluetooth device; the third electronic device communicating with the Bluetooth device; and sending a pairing request to the Bluetooth device according to the Bluetooth address of the Bluetooth device.
[0042] In one possible implementation, the pairing information also includes the Bluetooth device's capability information.
[0043] In one possible implementation, obtaining pairing information from a second electronic device includes: scanning a QR code displayed on the second electronic device, the QR code being generated by the second electronic device based on pairing information; and parsing the QR code to obtain the pairing information.
[0044] In one possible implementation, obtaining pairing information from the second electronic device includes: establishing a communication connection with the second electronic device; and obtaining pairing information from the second electronic device through the communication connection.
[0045] In one possible implementation, obtaining pairing information from a second electronic device via a communication connection includes: receiving shared information sent by the second electronic device; the shared information being generated by the second electronic device based on the pairing information; and parsing the shared information to obtain the pairing information.
[0046] In one possible implementation, the communication connection includes any one of the following: Bluetooth connection, WiFi connection, or cellular communication connection.
[0047] In one possible implementation, obtaining pairing information from a Bluetooth device or a third electronic device includes: scanning a QR code displayed by the Bluetooth device or the third electronic device, wherein the QR code is generated by the Bluetooth device based on pairing information; and parsing the QR code to obtain pairing information.
[0048] Fifthly, an electronic device is provided, applied to a third electronic device, the third electronic device communicating with a Bluetooth device, the Bluetooth pairing method including: receiving QR code information sent by the Bluetooth device, the QR code information being generated by the Bluetooth device based on pairing information, the pairing information including the Bluetooth address of the Bluetooth device; and displaying the QR code information.
[0049] In one possible implementation, the pairing information also includes the Bluetooth device's capability information.
[0050] In a sixth aspect, an electronic device is provided as a second electronic device, which is paired with a Bluetooth device. The second electronic device includes: a processing module for establishing a Bluetooth connection with the Bluetooth device; and a sending module for sending notification information to the Bluetooth device, the notification information being used to instruct the Bluetooth device to enter pairing mode.
[0051] In one possible implementation, the processing module is further configured to: receive a first operation from the user; and the sending module is further configured to, in response to the first operation, send a notification message to the Bluetooth device.
[0052] One possible implementation also includes a receiving module; a sending module for sending an L2CAP_ECHO_REQ message to the Bluetooth device, the L2CAP_ECHO_REQ message including notification information; and a receiving module for receiving an L2CAP_ECHO_RSP message sent by the Bluetooth device.
[0053] In one possible implementation, the processing module is further configured to: generate QR code information based on pairing information, including the Bluetooth address of the Bluetooth device; and display the QR code information.
[0054] In one possible implementation, the processing module is further configured to receive a second operation from the user before generating QR code information based on the pairing information.
[0055] In one possible implementation, the processing module is further configured to: establish a communication connection with the first electronic device, wherein the first electronic device and the Bluetooth device are not paired; and the sending module is further configured to send pairing information to the Bluetooth device through the communication connection, wherein the pairing information includes the Bluetooth address of the Bluetooth device.
[0056] In one possible implementation, the processing module is further configured to receive a third operation from the user before establishing a communication connection with the first electronic device.
[0057] In one possible implementation, the communication connection includes any one of the following: Bluetooth connection, WiFi connection, or cellular communication connection.
[0058] In one possible implementation, the processing module is further configured to generate shared information based on the pairing information; and the sending module is configured to send the shared information to the Bluetooth device via a communication connection.
[0059] In one possible implementation, the pairing information also includes the Bluetooth device's capability information.
[0060] In a seventh aspect, a Bluetooth device is provided, wherein the Bluetooth device is not paired with a first electronic device, but is paired with a second electronic device. The Bluetooth device includes: a processing module for establishing a Bluetooth connection with the second electronic device; a receiving module for receiving notification information sent by the second electronic device, the notification information being used to instruct the Bluetooth device to enter a pairing mode; the processing module is further configured to enter the pairing mode according to the notification information; and the receiving module is further configured to receive a pairing request sent by the first electronic device.
[0061] One possible implementation further includes a sending module; a receiving module for receiving an L2CAP_ECHO_REQ message sent by the second electronic device, the L2CAP_ECHO_REQ message including notification information; and a sending module for sending an L2CAP_ECHO_RSP message to the second electronic device.
[0062] One possible implementation also includes a sending module; a processing module, which is further configured to generate QR code information based on pairing information after entering pairing mode according to notification information, the pairing information including the Bluetooth address of the Bluetooth device; and a sending module, which is configured to send the QR code information to a third electronic device.
[0063] In one possible implementation, the processing module is further configured to: after entering pairing mode based on notification information, generate QR code information based on pairing information, the pairing information including the Bluetooth address of the Bluetooth device; and display the QR code information.
[0064] In one possible implementation, the pairing information also includes the Bluetooth device's capability information.
[0065] Eighthly, an electronic device is provided as a first electronic device, wherein the first electronic device is not paired with a Bluetooth device, and the Bluetooth device is paired with a second electronic device. The first electronic device includes: a processing module for obtaining pairing information from the second electronic device, the Bluetooth device, or a third electronic device, the pairing information including the Bluetooth address of the Bluetooth device; the third electronic device communicating with the Bluetooth device; and a sending module for sending a pairing request to the Bluetooth device according to the Bluetooth address of the Bluetooth device.
[0066] In one possible implementation, the pairing information also includes the Bluetooth device's capability information.
[0067] In one possible implementation, the processing module is specifically used to: scan the QR code information displayed by the second electronic device, the QR code information being generated by the second electronic device based on pairing information; and parse the QR code information to obtain the pairing information.
[0068] In one possible implementation, the processing module is used to: establish a communication connection with the second electronic device; and obtain pairing information from the second electronic device through the communication connection.
[0069] One possible implementation further includes a receiving module; the receiving module is used to receive shared information sent by the second electronic device; the shared information is generated by the second electronic device based on pairing information; and a processing module is used to parse the shared information to obtain pairing information.
[0070] In one possible implementation, the communication connection includes any one of the following: Bluetooth connection, WiFi connection, or cellular communication connection.
[0071] In one possible implementation, the processing module is used to: scan the QR code information displayed by the Bluetooth device or a third electronic device, wherein the QR code information is generated by the Bluetooth device based on pairing information; and parse the QR code information to obtain the pairing information.
[0072] In a ninth aspect, an electronic device is provided as a third electronic device that communicates with a Bluetooth device. The third electronic device includes: a receiving module for receiving QR code information sent by the Bluetooth device, wherein the QR code information is generated by the Bluetooth device based on pairing information, and the pairing information includes the Bluetooth address of the Bluetooth device; and a processing module for displaying the QR code information.
[0073] In one possible implementation, the pairing information also includes the Bluetooth device's capability information.
[0074] In a tenth aspect, an electronic device is provided, as a second electronic device, the electronic device including a processor, the processor being configured to couple with a memory, read instructions from the memory, and cause the electronic device to execute the method provided in the second aspect according to the instructions.
[0075] Eleventhly, a Bluetooth device is provided, the Bluetooth device including a processor, the processor being configured to couple with a memory, read instructions from the memory, and cause the Bluetooth device to perform the method provided in the third aspect according to the instructions.
[0076] In a twelfth aspect, an electronic device is provided, as a first electronic device, the electronic device including a processor for coupling with a memory, reading instructions from the memory, and causing the electronic device to perform the method provided in the fourth aspect according to the instructions.
[0077] In a thirteenth aspect, an electronic device is provided as a third electronic device, the electronic device including a processor for coupling with a memory, reading instructions from the memory, and causing the electronic device to execute the method provided in the fifth aspect according to the instructions.
[0078] In a fourteenth aspect, a communication system is provided, comprising a second electronic device provided in a tenth aspect, a Bluetooth device provided in an eleventh aspect, and a first electronic device provided in a twelfth aspect.
[0079] In one possible implementation, the communication system also includes a third electronic device provided in aspect thirteen.
[0080] In a fifteenth aspect, a program is provided that, when executed by a processor, performs the methods provided in the first, second, third, fourth, or fifth aspects.
[0081] In a sixteenth aspect, a computer-readable storage medium is provided, wherein instructions are stored therein, which, when executed on a computer or processor, implement the methods provided in the first, second, third, fourth, or fifth aspects.
[0082] In a seventeenth aspect, a program product is provided, the program product comprising a computer program stored in a readable storage medium, wherein at least one processor of a device can read the computer program from the readable storage medium, and the at least one processor executes the computer program to cause the device to implement the methods provided in the first, second, third, fourth, or fifth aspects. Attached Figure Description
[0083] Figure 1 This is a schematic diagram of a Bluetooth communication scenario;
[0084] Figure 2 for Figure 1 A message exchange diagram illustrating the pairing process between Bluetooth devices and electronic devices.
[0085] Figures 3A-3B A diagram illustrating how a user operates a Bluetooth device to enter pairing mode;
[0086] Figures 4A to 4C A set of interface diagrams after enabling Bluetooth on an electronic device;
[0087] Figure 5 This is a schematic diagram of a Bluetooth communication scenario applicable to the embodiments of this application;
[0088] Figure 6 A message interaction diagram for a Bluetooth pairing method provided in an embodiment of this application;
[0089] Figures 7A to 7F A set of interface diagrams for a second electronic device;
[0090] Figures 8A to 8F This is a schematic diagram of another set of interfaces for the second electronic device;
[0091] Figure 9 A message interaction diagram illustrating the sending of notification information by a second electronic device as provided in this application embodiment;
[0092] Figure 10A A schematic diagram of the data packet format corresponding to the L2CAP_ECHO_REQ message provided in the embodiments of this application;
[0093] Figure 10B A schematic diagram of the data packet format corresponding to the L2CAP_ECHO_RSP message provided in the embodiments of this application;
[0094] Figure 11 A message interaction diagram for the first electronic device to obtain configuration information provided in the embodiments of this application;
[0095] Figure 12 Another message interaction diagram for the Bluetooth pairing method provided in the embodiments of this application;
[0096] Figure 13 Another message interaction diagram for the first electronic device to obtain configuration information provided in the embodiments of this application;
[0097] Figure 14 Another message interaction diagram for the Bluetooth pairing method provided in the embodiments of this application;
[0098] Figure 15 This application provides another message interaction diagram for a first electronic device to obtain configuration information in an embodiment of the present application.
[0099] Figure 16 Another message interaction diagram for the Bluetooth pairing method provided in the embodiments of this application;
[0100] Figure 17 This application provides another message interaction diagram for a first electronic device to obtain configuration information in an embodiment of the present application.
[0101] Figure 18 A schematic diagram of the device provided in an embodiment of this application;
[0102] Figure 19 Another schematic diagram of the device provided in the embodiments of this application;
[0103] Figure 20 This is another structural schematic diagram of the device provided in the embodiments of this application. Detailed Implementation
[0104] The embodiments of this application are described below with reference to the accompanying drawings.
[0105] The Bluetooth pairing method provided in this application is applicable to the pairing process between devices in Bluetooth communication. First, the pairing process is described.
[0106] In Bluetooth communication, two devices need to pair before they can communicate for the first time. After pairing, the devices store information such as the Bluetooth device address (BD_ADDR) and key, enabling Bluetooth communication. Subsequently, if the stored Bluetooth address and key information are not cleared, the two devices can send Bluetooth connection requests based on the Bluetooth address when communicating again, without needing to go through the pairing process again.
[0107] For example, Figure 1 This is a schematic diagram illustrating a Bluetooth communication scenario. For example... Figure 1 As shown, both electronic device 100 and Bluetooth device 200 support Bluetooth functionality, and electronic device 100 and Bluetooth device 200 can communicate via Bluetooth.
[0108] The types and names of electronic devices 100 and Bluetooth devices 200 are not limited. Examples of electronic devices include: mobile phones, tablets, laptops, PDAs, wearable devices, smart screens, educational equipment, Internet of Things (IoT) devices, or wireless terminals in smart homes. Optionally, electronic device 100 may have a display screen. Examples of Bluetooth devices include: Bluetooth headsets, Bluetooth speakers, and Bluetooth styluses.
[0109] For ease of explanation, this application embodiment uses a mobile phone as the electronic device 100 and a Bluetooth headset as the Bluetooth device 200 as an example for illustration.
[0110] The message flow during the pairing process is explained below. For ease of understanding, the pairing process can include a device discovery phase and a pairing phase. In the device discovery phase, the electronic device discovers pairable Bluetooth devices and exchanges relevant information required for the pairing phase, such as the Bluetooth device's Bluetooth address. In the pairing phase, the electronic device and the Bluetooth device can exchange information such as keys for subsequent Bluetooth communication.
[0111] Figure 2 for Figure 1 A diagram illustrating message interactions between Bluetooth devices and electronic devices during the pairing process. (Example:) Figure 2 As shown, the pairing process between devices in Bluetooth communication may include:
[0112] S21. The Bluetooth device responds to the user's operation on the Bluetooth device and enters pairing mode.
[0113] Specifically, the user needs to operate the Bluetooth device to put it into pairing mode. When in pairing mode, the Bluetooth device can search for inquiry requests sent by electronic devices and respond with inquiry responses, thus enabling the electronic device to discover the Bluetooth device. The user's actions on the Bluetooth device may differ depending on its usage status.
[0114] Optionally, in one implementation, this is for the scenario of using the Bluetooth earphones for the first time after unpacking. For example... Figure 3A As shown on the left, the Bluetooth headset includes a lid 201 and a housing 202. The Bluetooth headset has never been opened or used since leaving the factory. Figure 3A As shown on the right, when the Bluetooth earbuds are first opened and used, they can be triggered to enter pairing mode. Accordingly, the Bluetooth earbuds respond to the user's input and enter pairing mode.
[0115] Optionally, another implementation is for scenarios where the Bluetooth headset is not being used for the first time. For example... Figure 3B As shown on the left, the Bluetooth headset has been opened and used, and has communicated with at least one electronic device via Bluetooth. Figure 3B As shown on the right, when the Bluetooth headset needs to communicate with an electronic device that has never been paired before, or with an electronic device that has been paired in the past but needs to be re-paired, the user can press the physical button 203 on the housing 202 to trigger the Bluetooth headset to enter pairing mode. Correspondingly, the Bluetooth headset enters pairing mode in response to the user pressing the physical button 203.
[0116] It should be noted that the names of the pairing modes are not limited in the embodiments of this application. For example, the pairing mode can also be called the pairing state or the inquiry scan state.
[0117] S22. The electronic device sends an inquiry request. Correspondingly, Bluetooth devices in pairing mode around the electronic device can scan for and receive the inquiry request.
[0118] Specifically, after an electronic device turns on Bluetooth, it can enter inquiry mode and send inquiry requests to nearby devices. If nearby Bluetooth devices are in pairing mode, they can scan for these requests and send an inquiry response back to the electronic device, thus enabling the electronic device to discover the Bluetooth device.
[0119] The execution order of S21 and S22 is not specified. For example, if the user first triggers the Bluetooth earbuds to enter pairing mode by pressing the physical button on the Bluetooth earbud case, and then the electronic device turns on the Bluetooth function, then S21 is executed first, followed by S22. Alternatively, if the electronic device turns on the Bluetooth function first, and then the user triggers the Bluetooth earbuds to enter pairing mode upon first opening the case and using the earbuds, then S22 is executed first, followed by S21.
[0120] The query request includes the Bluetooth address of the electronic device. The Bluetooth address can be found in the relevant content of the Bluetooth protocol, which will not be repeated here.
[0121] Optionally, the electronic device may send a query request according to the first cycle. Optionally, a Bluetooth device in pairing mode may scan for query requests according to the second cycle. Optionally, the first cycle and the second cycle may be the same or different.
[0122] S23. The Bluetooth device sends an inquiry response to the electronic device. Correspondingly, the electronic device receives the inquiry response sent by the Bluetooth device.
[0123] The query response includes the Bluetooth address of the Bluetooth device.
[0124] Specifically, when a Bluetooth device in pairing mode scans a query request sent by an electronic device, it can return a query response to the electronic device based on the Bluetooth address of the electronic device in the query request. In this way, the electronic device can discover the Bluetooth device and continue the subsequent pairing process with the electronic device.
[0125] It should be noted that the device discovery phase includes, but is not limited to, S21 to S23. For example, during the device discovery phase, the electronic device and the Bluetooth device can also obtain at least one of the following information through message exchange: the Bluetooth device's device name, the electronic device's device supported feature information, and the Bluetooth device's device supported feature information. The device supported feature information can also be referred to as capability information, and can be found in the Bluetooth protocol's documentation on device features; it will not be elaborated upon here.
[0126] Through the device discovery phase, electronic devices can discover nearby pairable Bluetooth devices. For example, Figure 4A This diagram illustrates an interface of an electronic device during the device discovery phase. Figure 4A As shown, the phone's Bluetooth main interface 40 includes a Bluetooth function switch 41, an open detection switch 42, a "Device Name" tab 43, a "Received Files" tab 44, paired devices 45, and available devices 46. The "Device Name" tab 43 indicates that the phone's name is "Phone 2". Paired devices 45 displays devices that Phone 2 has successfully paired with in the past, such as Phone 1. Available devices 46 displays currently pairable devices discovered by Phone 2, such as Bluetooth headsets. Figure 4A As shown, the user can click on the Bluetooth headset in available devices 46 to pair the mobile phone 2 with the Bluetooth headset. Correspondingly, the mobile phone 2 responds to the user's action and begins the pairing phase of the pairing process.
[0127] Optionally, the phone 2 can also display a prompt message before pairing with the Bluetooth headset. For example, the user clicks... Figure 4A After selecting Bluetooth headsets from available devices 46, the changes to the Bluetooth main interface 40 can be seen in [link to relevant documentation]. Figure 4B .like Figure 4B As shown, a pairing pop-up window 47 appears on the Bluetooth main interface 40 of mobile phone 2. The user operates by viewing the prompts in the pairing pop-up window 47. For example, the prompts include: "To pair with the following device: Bluetooth headset". The pairing pop-up window 47 also includes a cancel button and a pairing button. The user can click the pairing button 48 to pair mobile phone 2 with the Bluetooth headset. Correspondingly, mobile phone 2 responds to the user's click of the pairing button 48 by executing the message flow of the pairing phase, as detailed in S24.
[0128] S24. The electronic device sends a pairing request to the Bluetooth device. Correspondingly, the Bluetooth device receives the pairing request from the electronic device.
[0129] S25. The Bluetooth device sends a pairing response to the electronic device. Correspondingly, the electronic device receives the pairing response sent by the Bluetooth device.
[0130] Specifically, during the pairing phase, the electronic device can send a pairing request to the Bluetooth device based on the Bluetooth address of the Bluetooth device, and the Bluetooth device can send a pairing response to the electronic device based on the Bluetooth address of the electronic device. The pairing request and pairing response are used to exchange configuration information, which is used to determine the pairing method and assign keys.
[0131] Optionally, the configuration information may include the input / output capabilities of the electronic device. Different electronic devices have different types and hardware configurations, resulting in different input / output capabilities. For example, input / output capabilities may indicate at least one of the following: whether the electronic device can input, the input method when the electronic device can input, whether the electronic device can display, etc. Optionally, the input / output capabilities of the electronic device may include any of the following: no input and no output, only display screen, with display screen and the option to select "yes / no", only keyboard, and with both keyboard and display screen.
[0132] It should be noted that the pairing phase includes, but is not limited to, S24 and S25. For example, during the pairing phase, it is also necessary to determine the pairing algorithm between the electronic device and the Bluetooth device, establish an encrypted link, and transmit keys, etc. Please refer to the content on pairing authentication in the Bluetooth protocol, which will not be repeated here.
[0133] After an electronic device and a Bluetooth device complete pairing, the device stores information such as keys, enabling subsequent Bluetooth communication between them. For example, Figure 4C This diagram illustrates one interface of an electronic device after it has paired with a Bluetooth device. Compared to... Figure 4A ,like Figure 4C As shown, in the Bluetooth main interface 40, the paired devices 45 include mobile phone 1 and Bluetooth headset, indicating that mobile phone 2 and Bluetooth headset have completed pairing and can communicate via Bluetooth in the future.
[0134] S26. After the electronic device and the Bluetooth device are paired, a Bluetooth connection can be established to conduct business.
[0135] In this application embodiment, the type of service is not limited. For example, call services and audio services. Optionally, call services include, but are not limited to, voice calls or video calls; audio services include, but are not limited to, playing music, notification tones, navigation tones, alarm clocks, games, videos, etc.
[0136] pass Figure 2The message flow of the pairing process shown illustrates that for a Bluetooth device to pair with an electronic device, the Bluetooth device must be in pairing mode. This allows the Bluetooth device to scan for query requests sent by the electronic device and respond with a query response. Correspondingly, the electronic device discovers a pairable Bluetooth device, obtains the Bluetooth device's Bluetooth address from the query response, and can then send a pairing request to the Bluetooth device based on its Bluetooth address to continue the pairing process.
[0137] Currently, controlling Bluetooth earbuds to enter pairing mode requires user interaction. When using a Bluetooth device for the first time, opening the case triggers pairing mode. This initial use is only possible once. In most scenarios, the Bluetooth device is already in use, requiring the user to manually press a physical button on the charging case to enter pairing mode. However, many users are unaware of this procedure, resulting in earbuds that are not used for the first time failing to enter pairing mode and complete the pairing process with electronic devices. This prevents subsequent Bluetooth communication and services, severely impacting the user experience.
[0138] This application provides a Bluetooth pairing method that utilizes a third-party device (other than the electronic device and the Bluetooth device) to control the Bluetooth device into pairing mode. This avoids the need for user interaction with the Bluetooth device to trigger pairing, eliminating the inconvenience of user operation. Furthermore, the electronic device can obtain the Bluetooth device's Bluetooth address without sending a query request, simplifying the pairing process and improving the feasibility and convenience of pairing previously unpaired Bluetooth devices with unpaired electronic devices, thus enhancing the user experience.
[0139] For ease of explanation, the electronic device that needs to be paired with the Bluetooth device is referred to as the first electronic device, and the third-party device other than the first electronic device and the Bluetooth device is referred to as the second electronic device. The Bluetooth device and the second electronic device have been successfully paired in the past and the data has not been cleared.
[0140] For example, Figure 5 This is a schematic diagram illustrating a Bluetooth communication scenario applicable to embodiments of this application. For example... Figure 5As shown, the scenario includes a Bluetooth device, a first electronic device, and a second electronic device. The Bluetooth device and the second electronic device can communicate via Bluetooth. Optionally, the first electronic device and the second electronic device may or may not communicate. Optionally, the communication between the first electronic device and the second electronic device includes, but is not limited to, at least one of the following: wired communication, Bluetooth communication, wireless fidelity (WiFi) communication, near field communication (NFC), or cellular communication.
[0141] Optional, in Figure 5 In this scenario, a third electronic device may also be included. The Bluetooth device and the third electronic device can communicate. Communication between the Bluetooth device and the third electronic device includes, but is not limited to, at least one of the following: wired communication, Bluetooth communication, WiFi communication, or NFC communication. Optionally, the first electronic device and the third electronic device may or may not communicate. Communication between the first electronic device and the third electronic device includes, but is not limited to, at least one of the following: wired communication, Bluetooth communication, WiFi communication, NFC communication, or cellular communication.
[0142] The types and names of the first electronic device, the second electronic device, and the third electronic device can be found in [reference needed]. Figure 1 The electronic device 100 is included. Optionally, the third electronic device may also be a device for displaying relevant information about the Bluetooth device, such as a display screen or monitor. This application embodiment does not limit the number of the first, second, and third electronic devices.
[0143] The technical solution of this application will be described in detail below through specific embodiments. The following embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.
[0144] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the embodiments of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0145] Figure 6 This is a message interaction diagram for a Bluetooth pairing method provided in an embodiment of this application. The Bluetooth pairing method provided in this embodiment is applicable to... Figure 5 In the scenario shown, the executing entity involves a Bluetooth device, a first electronic device, and a second electronic device. Optionally, the executing entity may also involve a third electronic device. For ease of explanation, in some examples, the Bluetooth device is a Bluetooth headset, the first electronic device is mobile phone 1, the second electronic device is mobile phone 2, and the third electronic device is a display 3. Figure 6 As shown, the Bluetooth pairing method provided in this embodiment may include:
[0146] S61. The Bluetooth device establishes a Bluetooth connection with the second electronic device.
[0147] Optionally, Bluetooth connections may include asynchronous connection-oriented (ACL) connections. ACL connections are physical layer connections in the Bluetooth protocol; please refer to the relevant content in the Bluetooth protocol documentation, which will not be elaborated upon here.
[0148] Optionally, a Bluetooth connection may also include at least one of the following: a synchronous connection-oriented link (SCO) connection, an advanced audio distribution profile (A2DP) connection, or a hands-free profile (HFP) connection. SCO connections are physical layer connections in the Bluetooth protocol, while A2DP and HFP connections are application layer connections in the Bluetooth protocol. Please refer to the relevant content in the Bluetooth protocol documentation; they will not be elaborated upon here.
[0149] In this embodiment, the time required for the Bluetooth device to establish a Bluetooth connection with the second electronic device in the application scenario is not limited.
[0150] Optionally, in one application scenario, the Bluetooth device and the second electronic device are not currently connected via Bluetooth. The Bluetooth device only establishes a Bluetooth connection with the second electronic device when it needs to pair with the first electronic device. For example, mobile phone 2 may not currently have its Bluetooth function turned on. When the Bluetooth headset needs to pair with mobile phone 1, the user turns on the Bluetooth function of mobile phone 2, and mobile phone 2 can automatically establish a Bluetooth connection with the Bluetooth headset.
[0151] Optionally, in another application scenario, when a Bluetooth device needs to pair with a first electronic device, the Bluetooth device has already established a Bluetooth connection with a second electronic device. For example, if a user is listening to music playing on mobile phone 2 through Bluetooth headphones, the Bluetooth headphones also need to be paired with mobile phone 1.
[0152] S62, the second electronic device sends a notification message to the Bluetooth device, the notification message instructing the Bluetooth device to enter pairing mode. Correspondingly, the Bluetooth device receives the notification message sent by the second electronic device.
[0153] By sending a notification message to the Bluetooth device via a second electronic device, the Bluetooth device is instructed to enter pairing mode. This avoids the need for the user to operate the Bluetooth device to enter pairing mode, reduces the inconvenience of operating the Bluetooth device, and improves the user experience of using the Bluetooth device.
[0154] Optionally, in one implementation, the second electronic device can send a notification message to the Bluetooth device immediately after establishing a Bluetooth connection with the Bluetooth device. For example, if a user wants to pair a Bluetooth headset with mobile phone 1, the user is usually aware of the second electronic device in the environment where the Bluetooth headset and mobile phone 1 are located, such as mobile phone 2. For instance, both mobile phone 1 and mobile phone 2 are mobile phones used by user 1; or, user 1 uses mobile phone 1 and knows that user 2 uses mobile phone 2. Thus, when user 1 needs to pair the Bluetooth headset with mobile phone 1, the Bluetooth function of mobile phone 2 can be turned on, mobile phone 2 can establish a Bluetooth connection with the Bluetooth headset, and mobile phone 2 can send a notification message to the Bluetooth headset, instructing the Bluetooth headset to enter pairing mode.
[0155] Alternatively, in another implementation, the second electronic device can be triggered to send a notification message to the Bluetooth device by the user performing a first operation on the second electronic device.
[0156] In this embodiment, the user's first operation on the second electronic device is not limited. For example, the user's first operation can be any of the following: a touch operation performed by the user on the relevant interface displayed on the second electronic device, a gesture operation performed by the user on the display screen of the second electronic device, an operation performed by the user on the physical buttons of the second electronic device, voice input by the user through the microphone of the second electronic device, or image input by the user through the camera of the second electronic device. Optionally, the second electronic device may have an application (APP) installed for managing Bluetooth devices. In this embodiment, the name and function of the APP are not limited, nor are the content and layout of the relevant interface of the APP.
[0157] The following example illustrates this.
[0158] Optional, in one example, such as Figure 7A As shown, mobile phone 2 is currently running a system application, displaying the Bluetooth main interface 70 within the system application. The paired device 71 on the Bluetooth main interface 70 indicates that mobile phone 2 is currently connected to both mobile phone 1 and the Bluetooth headset via Bluetooth. The user can tap the Bluetooth headset on the paired device 71 to trigger mobile phone 2 to send a notification message to the Bluetooth headset. Correspondingly, mobile phone 2 responds to the user's action and sends a notification message to the Bluetooth headset.
[0159] Optionally, the Bluetooth main interface 70 includes prompts to guide the user through the initial operation. For example, in Figure 7A In the image, there is a prompt message at the bottom of the Bluetooth earphone: "Click on the Bluetooth earphone to enter pairing mode".
[0160] Optionally, the second electronic device may display a prompt message to the user before sending the notification message to the Bluetooth device. For example, such as... Figure 7A As shown, when the user taps the Bluetooth headset in the paired device 71, it triggers mobile phone 2 to send a notification message to the Bluetooth headset. Correspondingly, as... Figure 7B As shown, in response to the user's operation, mobile phone 2 displays a pop-up window 72 on the Bluetooth main interface 70. The user performs operations by viewing the prompt information in pop-up window 72. For example, the prompt information includes: "Bluetooth headset enters pairing mode." Pop-up window 72 also includes a cancel button and an confirm button. The user can click the confirm button 73 to trigger mobile phone 2 to send a notification message to the Bluetooth headset. Correspondingly, in response to the user clicking the confirm button 73, mobile phone 2 sends a notification message to the Bluetooth headset, instructing the Bluetooth headset to enter pairing mode.
[0161] Optionally, in another example, Figure 8A Another interface diagram of mobile phone 2 is shown. Figure 8A and Figure 7A The difference is: in Figure 7A In the middle, phone 2 runs the system application, displaying the Bluetooth main interface 70 within the system application; while... Figure 8A In this embodiment, mobile phone 2 runs a third-party application used to manage other devices communicating with mobile phone 2. This application does not limit the name, function, or interface layout of the third-party application. For example, such as... Figure 8A As shown, mobile phone 2 currently displays the "My Devices" interface 80 from a third-party application. Devices communicating with mobile phone 2 include: door lock 001, Bluetooth headset, home gateway 1, and mobile phone 1. A button 85 is located to the right of the Bluetooth headset in interface 80. The user can click button 85 to trigger mobile phone 2 to send a notification message to the Bluetooth headset. Correspondingly, mobile phone 2 responds to the user's action by displaying a pop-up window 81 in interface 80. (See [link to relevant documentation]). Figure 8B See pop-up 81 for details. Figure 7B The pop-up window 72 works on a similar principle and will not be elaborated here. Optionally, the interface 80 includes prompts to guide the user to perform the first operation. For example, in Figure 8A In the middle, there is a prompt message at the bottom of the Bluetooth earphone: "Click the button on the right to enter pairing mode for the Bluetooth earphone."
[0162] It needs to be explained that, Figures 7A-7B , Figures 8A-8B This is merely an example and does not limit the relevant interface or the user's first action. For example, in Figure 7A or Figure 8A In the process, users can access the Bluetooth headset's settings interface through relevant operations. By performing the first operation in the settings interface, the phone 2 can be triggered to send a notification message to the Bluetooth headset.
[0163] Optionally, the notification information can be carried in the interactive message defined in the Bluetooth protocol, or it can be carried in the private message defined between the second electronic device and the Bluetooth device. This embodiment does not limit the name of the message or the way the notification information is carried in the message.
[0164] Optionally, the second electronic device may send notification information via the echo (echo or ECHO) channel of the Logical Link Control and Adaptation Layer Protocol (L2CAP). The ECHO protocol can be found in the CORE Host section of the Bluetooth protocol, for example, Part A, Section 4.8.
[0165] For example, Figure 9 This is a message interaction diagram for sending notification information to a second electronic device provided in an embodiment of this application.
[0166] like Figure 9 As shown, the second electronic device sending notification information to the Bluetooth device may include:
[0167] S91, the second electronic device sends an L2CAP_ECHO_REQ (Logical Link Control and Adaptation Protocol Echo Request) message to the Bluetooth device. The L2CAP_ECHO_REQ message includes notification information. Correspondingly, the Bluetooth device receives the L2CAP_ECHO_REQ message sent by the second electronic device.
[0168] S92. The Bluetooth device sends an L2CAP_ECHO_RSP (Logical Link Control and Adaptation Protocol Echo Response) message to the second electronic device. The L2CAP_ECHO_RSP message is used to indicate that the Bluetooth device has received the L2CAP_ECHO_REQ message.
[0169] Specifically, in the ECHO protocol, an echo request (ECHO_REQ or L2CAP_ECHO_REQ) is typically used to request a response from a remote L2CAP entity. Echo requests can be used to test the link or to transmit specific information using optional data fields. Upon receiving a valid echo request packet, the L2CAP entity responds with an echo response packet (ECHO_RSP or L2CAP_ECHO_RSP). In this embodiment, the specific information is notification information.
[0170] For example, Figure 10A This is a schematic diagram of the data packet format corresponding to the L2CAP_ECHO_REQ message provided in the embodiments of this application. Figure 10BThis is a schematic diagram illustrating the format of the data packet corresponding to the L2CAP_ECHO_RSP message provided in an embodiment of this application. For example... Figure 10A As shown, the left side of the packet corresponding to the L2CAP_ECHO_REQ message is the least significant bit (LSB), and the right side is the most significant bit (MSB). The packet includes a Code field, an Identifier field, a Length field, and a Data field. The Data field is optional. Custom information can be carried in the optional Data field of the packet provided by the ECHO protocol. In this embodiment, notification information can be carried in the Data field. Figure 10B The format of the data packet corresponding to the L2CAP_ECHO_RSP message shown is the same as... Figure 10A The data packets corresponding to the L2CAP_ECHO_REQ messages shown are similar in format, with the identifier field and encoding field matching in the L2CAP_ECHO_RSP and L2CAP_ECHO_REQ messages. For example, Figure 10A and Figure 10B The identifier field in each field has the same value. For example, Figure 10A The encoding field in the code is 0x08. Figure 10B The encoding field in it takes the value 0x09.
[0171] S63, Bluetooth devices enter pairing mode based on notification information.
[0172] S64. The first electronic device obtains pairing information from the second electronic device, the Bluetooth device, or the third electronic device. The pairing information includes the Bluetooth address of the Bluetooth device.
[0173] Optionally, in the first implementation, since the Bluetooth device and the second electronic device have been successfully paired and the second electronic device stores the Bluetooth address of the Bluetooth device, the first electronic device can obtain the Bluetooth address of the Bluetooth device from the second electronic device.
[0174] In this implementation, the second electronic device notifies the Bluetooth device to enter pairing mode, and the second electronic device provides pairing information to the first electronic device. Pairing between the first electronic device and the Bluetooth device is achieved solely through the second electronic device, involving fewer devices, fewer processing steps, and a simple implementation method.
[0175] Optionally, the first electronic device and the second electronic device can communicate via wired or wireless means. Through the communication connection between the first and second electronic devices, the second electronic device sends pairing information to the first electronic device, and correspondingly, the first electronic device receives the pairing information sent by the second electronic device. Optionally, wireless communication includes, but is not limited to, any of the following: Bluetooth communication, WiFi communication, NFC communication, or cellular communication.
[0176] Optionally, the first electronic device and the second electronic device do not communicate. The second electronic device displays pairing information in a visual format, and the first electronic device obtains the pairing information by scanning or photographing the visual pairing information and processing it. Optionally, the visual pairing information is generated based on the pairing information, for example, including but not limited to any one of the following: a QR code or a barcode.
[0177] Optionally, in the second implementation, the third electronic device can obtain pairing information, and the first electronic device can obtain pairing information from the third electronic device. This embodiment does not limit the method by which the third electronic device obtains pairing information. For example, the Bluetooth device and the third electronic device can communicate via Bluetooth, and the third electronic device stores pairing information such as the Bluetooth address of the Bluetooth device. Alternatively, the Bluetooth device can send pairing information to the third electronic device. Optionally, to improve the security of the pairing information, the Bluetooth device can send the pairing information to the third electronic device only after receiving a notification message from the second electronic device.
[0178] In this implementation, the second electronic device notifies the Bluetooth device to enter pairing mode, and the third electronic device provides pairing information to the first electronic device. The first electronic device and the Bluetooth device need to use the second and third electronic devices to pair, making the implementation flexible.
[0179] Optionally, the first electronic device and the third electronic device can communicate via wired or wireless means. Through the communication connection between the first and third electronic devices, the third electronic device sends pairing information to the first electronic device, and correspondingly, the first electronic device receives the pairing information sent by the third electronic device. Optionally, wireless communication includes, but is not limited to, any of the following: Bluetooth communication, WiFi communication, NFC communication, or cellular communication.
[0180] Optionally, the first electronic device and the third electronic device do not communicate. The third electronic device displays pairing information in a visual format, and the first electronic device obtains the pairing information by scanning or photographing the visual pairing information and processing it. Optionally, the visual pairing information is generated based on the pairing information, for example, including but not limited to any one of the following: a QR code or a barcode.
[0181] Optionally, the third electronic device is an external display device for the Bluetooth device. After receiving the notification information sent by the second electronic device and entering pairing mode, the Bluetooth device generates visual pairing information based on the pairing information and sends this visual pairing information to the third electronic device. Correspondingly, the third electronic device receives and displays the visual pairing information sent by the Bluetooth device.
[0182] Optionally, in the third implementation, the first electronic device can obtain pairing information from the Bluetooth device. In this implementation, the Bluetooth device may have a display screen. After receiving a notification message from the second electronic device and entering pairing mode, the Bluetooth device can generate and display visual pairing information based on the pairing information. Correspondingly, the first electronic device can obtain the pairing information by scanning or photographing the visual pairing information and processing it. Optionally, the visual pairing information includes, but is not limited to, any one of the following: a QR code or a barcode.
[0183] In this implementation, the second electronic device notifies the Bluetooth device to enter pairing mode, and the Bluetooth device provides pairing information to the first electronic device. Pairing between the first electronic device and the Bluetooth device only requires the second electronic device, which involves a small number of devices and is simple to implement.
[0184] It should be noted that this embodiment does not limit the execution order of S62-S63 and S64. For example, S62 can be executed first, in which the second electronic device notifies the Bluetooth device to enter pairing mode, and then S64 can be executed, allowing the first electronic device to obtain pairing information. Alternatively, S64 can be executed first, allowing the first electronic device to obtain pairing information, and then S62 can be executed, in which the second electronic device notifies the Bluetooth device to enter pairing mode. Furthermore, S62 and S64 can be executed simultaneously.
[0185] S65. The first electronic device sends a pairing request to the Bluetooth device based on the Bluetooth address of the Bluetooth device. Correspondingly, the Bluetooth device receives the pairing request sent by the first electronic device.
[0186] S66. The Bluetooth device sends a pairing response to the first electronic device. Correspondingly, the first electronic device receives the pairing response sent by the Bluetooth device.
[0187] The pairing request and pairing response can be found in the following documents: Figure 2 The explanations of S24 and S25 will not be repeated here.
[0188] As can be seen, the Bluetooth pairing method provided in this embodiment includes a Bluetooth device, a second electronic device that has been successfully paired with the Bluetooth device, and a first electronic device that needs to be paired with the Bluetooth device in the application environment. After the Bluetooth device and the second electronic device establish a Bluetooth connection, the second electronic device sends a notification message to the Bluetooth device, instructing the Bluetooth device to enter pairing mode. Moreover, the first electronic device can obtain pairing information from the second electronic device, the Bluetooth device, or other devices in the application environment, so that the first electronic device and the Bluetooth device can complete pairing based on the pairing information. The Bluetooth pairing method provided in this embodiment, by using a second electronic device other than the first electronic device and the Bluetooth device to notify the Bluetooth device to enter pairing mode, avoids the need for the user to operate the Bluetooth device to trigger the Bluetooth device to enter pairing mode, eliminating the inconvenience of the user operating the Bluetooth device. Moreover, compared with the existing pairing process, the first electronic device does not need to send a query request to the Bluetooth device to obtain the Bluetooth address when the Bluetooth device is in pairing mode, which simplifies the message flow of the pairing process, improves the feasibility and convenience of pairing a non-first-time Bluetooth device with a first electronic device that has not been paired, and improves the user experience of using Bluetooth headsets.
[0189] Optionally, in S64, the pairing information may also include Bluetooth device capability information.
[0190] Obtaining the capability information of a Bluetooth device facilitates subsequent pairing between the first electronic device and the Bluetooth device, improving the accuracy and compatibility of the pairing process.
[0191] The capability information can be found in [link / reference]. Figure 2 The information regarding device support features is not repeated here.
[0192] Optionally, the capability information can also indicate that the Bluetooth device supports the ability to enter pairing mode by receiving notification information sent by a second electronic device.
[0193] It should be noted that this embodiment does not limit the order in which the first electronic device obtains the Bluetooth address and capability information of the Bluetooth device in S64. Optionally, in the first implementation, the first electronic device can obtain both the Bluetooth address and capability information of the Bluetooth device simultaneously. Optionally, in this implementation, if the first electronic device obtains pairing information by scanning visual pairing information, the visual pairing information is generated based on the Bluetooth address and capability information of the Bluetooth device. Optionally, in the second implementation, the first electronic device can obtain the Bluetooth address of the Bluetooth device first, and then obtain the capability information of the Bluetooth device. Optionally, in the third implementation, the first electronic device can obtain the capability information of the Bluetooth device first, and then obtain the Bluetooth address of the Bluetooth device. Optionally, if the first electronic device obtains the Bluetooth address and capability information of the Bluetooth device through message interaction with the second or third electronic device, the Bluetooth address and capability information can be carried in a single interaction message or in separate interaction messages.
[0194] Optionally, in S65, the first electronic device sending a pairing request to the Bluetooth device based on the Bluetooth device's Bluetooth address may include:
[0195] The first electronic device sends a pairing request to the Bluetooth device based on the Bluetooth address and capability information of the Bluetooth device.
[0196] Pairing the first electronic device with the Bluetooth device using the Bluetooth address and capability information of the Bluetooth device improves the accuracy and compatibility of the pairing process.
[0197] Below, based on Figure 6 The illustrated embodiment provides a specific implementation of how the first electronic device obtains pairing information from the second electronic device, the Bluetooth device, or the third electronic device in step S64. For ease of explanation, the pairing information includes the Bluetooth address and capability information of the Bluetooth device as an example.
[0198] Optionally, in one embodiment, in S64, the first electronic device obtains pairing information by scanning the visual pairing information displayed by the second electronic device. For ease of explanation, the visual pairing information is QR code information. Figure 11 As shown, in S64, the first electronic device obtaining pairing information from the second electronic device may include:
[0199] S111, The second electronic device generates QR code information based on the Bluetooth address and capability information of the Bluetooth device.
[0200] Specifically, the second electronic device communicates with the Bluetooth device via Bluetooth and stores the Bluetooth address and capability information of the Bluetooth device. The second electronic device can generate QR code information based on the Bluetooth address and capability information of the Bluetooth device, which can then be provided to the first electronic device. The generation of the QR code information can employ existing algorithms, which will not be described in detail in this embodiment.
[0201] S111 is executed after S61, but the execution order between S111 and S62 to S63 is not limited.
[0202] Optionally, in the first implementation, S111 is executed before S62, and S111 is triggered when the Bluetooth device establishes a Bluetooth connection with the second electronic device in S61. For example, a user uses mobile phone 1 and mobile phone 2. Mobile phone 2 has been successfully paired with a Bluetooth headset, while mobile phone 1 has never been paired with a Bluetooth headset. Thus, when the user needs to pair the Bluetooth headset with mobile phone 1, they can turn on the Bluetooth function of mobile phone 2, establish a Bluetooth connection with the Bluetooth headset, and trigger mobile phone 2 to generate QR code information based on the Bluetooth address and capability information of the Bluetooth headset.
[0203] Optionally, in the second implementation, S111 is executed before S62, and the second electronic device is triggered to execute S111 by the user performing a second operation on the second electronic device.
[0204] For example, such as Figure 7A As shown, mobile phone 2 is currently running a system application, displaying the Bluetooth main interface 70 within the system application. The paired device 71 on the Bluetooth main interface 70 indicates that mobile phone 2 has established Bluetooth connections with both mobile phone 1 and the Bluetooth headset. The user can tap the Bluetooth headset on the paired device 71 to trigger mobile phone 2 to generate a QR code based on the headset's Bluetooth address and capability information. Accordingly, mobile phone 2 generates the QR code in response to the user's action.
[0205] Optionally, the Bluetooth main interface 70 includes prompts to guide the user through a second operation. For example, it may display the prompt "Click on the Bluetooth headset to share the pairing information of the Bluetooth headset".
[0206] Optionally, the second electronic device may display a prompt message to the user before generating the QR code information based on the Bluetooth address and capability information of the Bluetooth device.
[0207] For example, in one example, such as Figure 7A As shown, the user clicks on the Bluetooth headset in the paired device 71. Correspondingly, as... Figure 7CAs shown, in response to the user's operation, mobile phone 2 displays a pop-up window 74 on the Bluetooth main interface 70. The user performs operations by viewing the prompts in pop-up window 74. For example, the prompts include: "Displaying Bluetooth headset pairing information." Pop-up window 74 also includes a cancel button and an confirm button. The user can click the confirm button to trigger mobile phone 2 to generate QR code information based on the Bluetooth address and capability information of the Bluetooth headset. Correspondingly, mobile phone 2 generates QR code information based on the Bluetooth address and capability information of the Bluetooth headset in response to the user clicking the confirm button.
[0208] For example, in another example, such as Figure 7A As shown, the user clicks on the Bluetooth headset in the paired device 71. Correspondingly, as... Figure 7D As shown, in response to the user's operation, mobile phone 2 displays a pop-up window 75 on the Bluetooth main interface 70. The user operates by viewing the prompts in pop-up window 75. For example, the prompts include: "Sharing Bluetooth headset pairing information." Pop-up window 75 includes various methods for sharing pairing information, such as displaying a QR code, Bluetooth sharing, WiFi sharing, and network sharing. Bluetooth sharing refers to providing pairing information to mobile phone 1 via Bluetooth communication between mobile phone 2 and mobile phone 1; WiFi sharing refers to providing pairing information to mobile phone 1 via WiFi communication between mobile phone 2 and mobile phone 1; and network sharing refers to providing pairing information to mobile phone 1 via cellular communication between mobile phone 2 and mobile phone 1. Pop-up window 75 also includes a cancel button and an confirm button, used to cancel and confirm the sharing of pairing information, respectively. The user can click the selection control 76 for displaying a QR code to choose the sharing method. Figure 7E As shown, the display state of selection control 76 changes, and the user continues to click the OK button, triggering mobile phone 2 to generate QR code information based on the Bluetooth address and capability information of the Bluetooth headset. Correspondingly, mobile phone 2 responds to the user's operation by generating QR code information based on the Bluetooth address and capability information of the Bluetooth headset.
[0209] Optionally, the second operation and the first operation can be the same operation. For example, such as Figure 7A As shown, when a user clicks on the paired Bluetooth headset in the Bluetooth main interface 70, it triggers mobile phone 2 to generate QR code information based on the Bluetooth headset's Bluetooth address and capability information. Simultaneously, mobile phone 2 sends a notification message to the Bluetooth headset. For example, as... Figure 7B As shown, when the user clicks the "OK" button 73 in pop-up window 72, it triggers phone 2 to send a notification message to the Bluetooth headset. Simultaneously, phone 2 generates a QR code based on the Bluetooth headset's Bluetooth address and capability information. For example, as... Figure 7CAs shown, when the user clicks the "OK" button in pop-up window 74, phone 2 generates a QR code based on the Bluetooth address and capability information of the Bluetooth headset. Simultaneously, phone 2 sends a notification to the Bluetooth headset. For example, as... Figure 7E As shown, the user selects the selection control 76 in the pop-up window 75 and clicks the OK button, triggering mobile phone 2 to generate QR code information based on the Bluetooth address and capability information of the Bluetooth headset. At the same time, mobile phone 2 sends a notification message to the Bluetooth headset.
[0210] Optionally, in the third implementation, S111 is executed after S62, and S111 is triggered when the second electronic device sends a notification message to the Bluetooth device in S62.
[0211] Optionally, in the fourth implementation, S111 is executed after S62, and the second electronic device is triggered to execute S111 by the user performing a second operation on the second electronic device.
[0212] It needs to be explained that, Figures 7A to 7E This is merely an example and does not limit the user's second operation on the second electronic device. For example, the user's second operation can be any of the following: touch operation on the relevant interface displayed on the second electronic device, gesture operation on the screen of the second electronic device, operation on the physical buttons on the second electronic device, voice input via the microphone of the second electronic device, or image input via the camera of the second electronic device. Optionally, the second electronic device may have an app installed for managing Bluetooth devices. This embodiment does not limit the name and function of the app, nor does it limit the content and layout of the app's relevant interface.
[0213] S112, The second electronic device displays QR code information.
[0214] In this embodiment, the interface and layout for displaying QR code information on the second electronic device are not limited.
[0215] For example, in one example, such as Figure 7F As shown, mobile phone 2 is currently running a system application, displaying the Bluetooth main interface 70 within the system application. The Bluetooth main interface 70 includes a QR code interface 77. The QR code interface 77 includes QR code information and prompt information. The QR code information is generated by mobile phone 2 based on the Bluetooth address and capability information of the Bluetooth headset. The prompt information includes: "Please scan the QR code." Users can perform actions by viewing the prompt information in the QR code interface 77; for example, by using mobile phone 1 to scan the QR code information, mobile phone 1 can obtain the pairing information for the Bluetooth headset.
[0216] Optionally, in another example, such as Figure 8C As shown. Figure 8C and Figure 7F The difference is: in Figure 7F In the middle, phone 2 runs the system application, displaying the Bluetooth main interface 70 within the system application; while... Figure 8C In this context, mobile phone 2 runs a third-party application used to manage other devices communicating with it. Mobile phone 2 is currently displaying the "My Devices" interface 80 from the third-party application, which includes a QR code interface 82. The QR code interface 82 can be found in [reference needed]. Figure 7F The principle behind the QR code interface 77 is similar, so it will not be elaborated here.
[0217] S113. The first electronic device scans the QR code information displayed by the second electronic device.
[0218] In this embodiment, the process of the first electronic device running the scanning function is not limited. For example, the first electronic device can run an APP with scanning function and start the scanning function through human-computer interaction with the user.
[0219] S114. The first electronic device parses the QR code information to obtain the Bluetooth address and capability information of the Bluetooth device.
[0220] As can be seen, in the Bluetooth pairing method provided in this embodiment, the first electronic device obtains the pairing information of the Bluetooth device from the second electronic device. Since the second electronic device communicates with the Bluetooth headset via Bluetooth, and the second electronic device stores the Bluetooth address and capability information of the Bluetooth device, it does not need to be obtained through additional methods. The second electronic device generates and displays visual pairing information based on the pairing information of the Bluetooth device. The first electronic device does not need to communicate with the second electronic device; it can obtain the visual pairing information through scanning or taking a picture, thereby obtaining the pairing information. The Bluetooth pairing method provided in this embodiment, where the first electronic device obtains pairing information from the second electronic device, involves fewer devices, fewer processing steps, and is simple to implement.
[0221] For example, taking a Bluetooth headset as the Bluetooth device, mobile phone 1 as the first electronic device, and mobile phone 2 as the second electronic device, combined with... Figure 12 The process of the Bluetooth pairing method provided in this embodiment will be described by way of example.
[0222] like Figure 12 As shown, the Bluetooth pairing method provided in this embodiment may include:
[0223] 11. Mobile phone 2 and Bluetooth headset establish Bluetooth connection.
[0224] 12. Mobile Phone 2 obtains the Bluetooth address and capability information of the Bluetooth headset, generates a QR code based on the Bluetooth address and capability information of the Bluetooth headset, and displays the QR code.
[0225] 13. Mobile phone 2 sends a notification message to the Bluetooth headset, which instructs the Bluetooth headset to enter pairing mode.
[0226] 14. The Bluetooth headset receives a notification message sent by mobile phone 2 and enters pairing mode according to the notification message.
[0227] 15. Start the scanning function on mobile phone 1 and scan the QR code displayed on mobile phone 2.
[0228] 16. Mobile phone 1 parses the scanned QR code to obtain the Bluetooth address and capability information of the Bluetooth headset.
[0229] 17. Based on the Bluetooth address and capability information of the Bluetooth headset, mobile phone 1 sends a pairing request to the Bluetooth headset to initiate pairing.
[0230] 18. After receiving the pairing request from mobile phone 1, the Bluetooth headset sends a pairing response to the mobile phone.
[0231] Optionally, in another embodiment, in S64, the first electronic device obtains pairing information from the second electronic device via a communication connection with the second electronic device. Figure 13 As shown, in S64, the first electronic device obtaining pairing information from the second electronic device may include:
[0232] S131. The second electronic device and the first electronic device establish a communication connection. The communication connection includes any one of the following: Bluetooth connection, WiFi connection, or cellular communication connection.
[0233] This embodiment does not limit the time for the second electronic device and the first electronic device to establish a communication connection, nor does it limit the execution order between S131 and S62-S63.
[0234] Optionally, in the first implementation, the second electronic device and the first electronic device have not yet established a communication connection. After the Bluetooth device establishes a Bluetooth connection with the second electronic device in S61, the second electronic device and the first electronic device establish a communication connection. Optionally, S131 can be executed before S62, after S62, or simultaneously with S62.
[0235] In the first implementation, optionally, S131 is executed before S62, and after the Bluetooth device establishes a Bluetooth connection with the second electronic device in S61, the second electronic device is triggered to execute S131. This implementation is suitable for scenarios where only the first electronic device, the second electronic device, and the Bluetooth device exist in the environment. For example, a user uses mobile phone 1 and mobile phone 2. Mobile phone 2 has successfully paired with a Bluetooth headset, while mobile phone 1 has never paired with a Bluetooth headset. When the user needs to pair the Bluetooth headset with mobile phone 1, the Bluetooth headset is powered on, and the user turns on the Bluetooth function of mobile phone 1 and mobile phone 2. In this way, mobile phone 2 can search for mobile phone 1 through Bluetooth technology. After mobile phone 2 establishes a Bluetooth connection with the Bluetooth headset, it can trigger mobile phone 2 to establish a communication connection with mobile phone 1, so as to send pairing information of the Bluetooth device to mobile phone 1 subsequently. Optionally, mobile phone 1, mobile phone 2, and the Bluetooth headset can log in to the same user account.
[0236] In the first implementation, optionally, S131 is executed before S62, and the second electronic device is triggered to execute S131 by the user performing a third operation on the second electronic device.
[0237] It should be noted that this embodiment does not limit the user's third operation on the second electronic device, and it can be any operation used for sharing files or information between devices. For example, the third operation is the user transferring a file from mobile phone 2 to mobile phone 1 via Bluetooth. Another example is the user sending a message from mobile phone 2 to mobile phone 1 via a mobile network using a chat app. Optionally, the user's third operation can be any of the following: touch operation performed by the user on the relevant interface displayed on the second electronic device, gesture operation performed by the user on the display screen of the second electronic device, operation performed by the user on the physical buttons on the second electronic device, voice input by the user through the microphone of the second electronic device, or image input by the user through the camera of the second electronic device. Optionally, the second electronic device may have an app installed for managing Bluetooth devices. This embodiment does not limit the name and function of the app, nor does it limit the content and layout of the app's relevant interface.
[0238] Optionally, the interface of the second electronic device may include prompts to guide the user to perform a third operation. In this embodiment, the content of the prompts is not limited.
[0239] For example, such as Figure 8AAs shown, phone 2 runs a third-party application used to manage other devices communicating with it. Phone 2 currently displays the "My Devices" interface 80 within this third-party application. Interface 80 includes phone 1, which is currently not connected to phone 2. The user can tap phone 1 to trigger phone 2 to establish a communication connection with it, allowing phone 2 to subsequently send Bluetooth pairing information to phone 1. Correspondingly, phone 2 responds to the user's action and establishes a communication connection with phone 1. This scenario is suitable when the user knows they need to share Bluetooth headset pairing information with phone 1.
[0240] Optionally, a prompt message may be displayed to the user before the second electronic device establishes a communication connection with the first electronic device.
[0241] For example, such as Figure 8A As shown, the user taps phone 1. Correspondingly, as... Figure 8D As shown, in response to the user's operation, mobile phone 2 displays pop-up window 83 on interface 80. Pop-up window 83 can be found in [reference needed]. Figure 7E The description of pop-up window 75 is similar in principle and will not be repeated here. The user can click the WiFi sharing selection control 84, enabling phone 2 to send pairing information to phone 1 via WiFi communication between phone 2 and phone 1. For example... Figure 8E As shown, the display state of selection control 84 changes, and the user continues to click the OK button, triggering mobile phone 2 and mobile phone 1 to establish a WiFi connection. Correspondingly, mobile phone 2 responds to the user's operation and establishes a WiFi connection with mobile phone 1.
[0242] In the first implementation, optionally, S131 is executed after S62, and S131 is triggered when the second electronic device sends a notification message to the Bluetooth device in S62. This implementation is suitable for scenarios where only the first electronic device, the second electronic device, and the Bluetooth device exist in the environment.
[0243] In the first implementation, optionally, S131 is executed after S62, and the second electronic device is triggered to execute S131 by the user performing a third operation on the second electronic device.
[0244] For example, an interface change process is as follows: Figure 8A As shown, when the user clicks button 85, it triggers phone 2 to send a notification message to the Bluetooth headset, and simultaneously triggers phone 2 to share pairing information. Phone 2 responds to the user's click of button 85 as follows: Figure 8D As shown, a pop-up window 83 appears on interface 80. The user can click the WiFi sharing selection control 84 to allow phone 2 to share pairing information via WiFi communication. Figure 8EAs shown, the display state of the selection control 84 changes. The user continues to click the OK button. Correspondingly, mobile phone 2, in response to the user's click of the OK button, searches for nearby devices capable of WiFi communication and displays a list of WiFi devices 86. Figure 8F As shown. In the WiFi device list 86, the devices that mobile phone 2 can communicate with via WiFi include mobile phone 1, mobile phone 3, and mobile phone 4. Each mobile phone has a selection control 87 on its right side. The user can click the selection control 87 on the right side of mobile phone 1, and then click the share button 88 to trigger mobile phone 2 and mobile phone 1 to establish a WiFi connection. Correspondingly, mobile phone 2 responds to the user's operation and establishes a WiFi connection with mobile phone 1. In this implementation, mobile phone 2 can search for and display nearby communicable devices and show the user a device list so that the user can select the device to share the pairing information of the Bluetooth headset, which is convenient for the user operation.
[0245] Optionally, in the second implementation, when the Bluetooth device needs to pair with the first electronic device, the second electronic device and the first electronic device have already established a communication connection. For example, when a user needs to pair mobile phone 1 with a Bluetooth headset, mobile phone 1 and mobile phone 2 have already transmitted audio files via Bluetooth.
[0246] S132, The second electronic device generates sharing information based on the Bluetooth address and capability information of the Bluetooth device.
[0247] Specifically, the second electronic device communicates with the Bluetooth device via Bluetooth and stores the Bluetooth device's Bluetooth address and capability information. The second electronic device then generates shared information based on the Bluetooth device's Bluetooth address and capability information.
[0248] This embodiment does not limit the form of the shared information. For example, the shared information can be any of the following forms: text format, file format, or image.
[0249] Optionally, the second electronic device can encrypt the Bluetooth address and capability information of the Bluetooth device to generate shared information. This embodiment does not limit the encryption algorithm.
[0250] S133. The second electronic device sends shared information to the first electronic device via a communication connection. Correspondingly, the first electronic device receives the shared information sent by the second electronic device via a communication connection.
[0251] S134. The first electronic device parses the shared information to obtain the Bluetooth address and capability information of the Bluetooth device.
[0252] Optionally, the first electronic device can decrypt the shared information to obtain the Bluetooth address and capability information of the Bluetooth device. The decryption algorithm used by the first electronic device matches the encryption algorithm used by the second electronic device.
[0253] Optionally, in one implementation, after receiving the shared information, the first electronic device automatically parses the shared information to obtain the Bluetooth address and capability information of the Bluetooth device. This method is simple to implement.
[0254] Optionally, in another implementation, after the first electronic device receives the shared information, the user needs to interact with the second electronic device. The second electronic device then responds to the user's action by parsing the shared information. For example, the first electronic device stores the received shared information in a default folder. The user can open the default folder and click on the shared information. The second electronic device responds to the user's click by parsing the shared information. This method is more flexible and improves the accuracy and security of the second electronic device's parsing of shared information.
[0255] As can be seen, in the Bluetooth pairing method provided in this embodiment, the first electronic device obtains the pairing information of the Bluetooth device from the second electronic device. Since the second electronic device and the Bluetooth headset communicate via Bluetooth, the second electronic device stores the Bluetooth address and capability information of the Bluetooth device, eliminating the need for additional methods to obtain this information. The second electronic device provides the pairing information to the first electronic device through its communication connection with the first electronic device. The Bluetooth pairing method provided in this embodiment, where the first electronic device obtains the pairing information from the second electronic device, involves a small number of devices and is simple to implement.
[0256] For example, taking a Bluetooth headset as the Bluetooth device, mobile phone 1 as the first electronic device, and mobile phone 2 as the second electronic device, combined with... Figure 14 The process of the Bluetooth pairing method provided in this embodiment will be described by way of example.
[0257] like Figure 14 As shown, the Bluetooth pairing method provided in this embodiment may include:
[0258] 21. Mobile phone 2 and Bluetooth headset establish a Bluetooth connection.
[0259] 22. Mobile phone 2 sends a notification message to the Bluetooth headset, which instructs the Bluetooth headset to enter pairing mode.
[0260] 23. Mobile phone 2 generates sharing information based on the Bluetooth address and capability information of the Bluetooth headset.
[0261] 24. Mobile phone 2 sends shared information to mobile phone 1 through the communication connection between mobile phone 1 and mobile phone 2.
[0262] 25. The Bluetooth headset receives a notification from mobile phone 2 and enters pairing mode based on the notification.
[0263] 26. Mobile phone 1 receives the shared information sent by mobile phone 2, parses the shared information, and obtains the Bluetooth address and capability information of the Bluetooth headset.
[0264] 27. Based on the Bluetooth address and capability information of the Bluetooth headset, mobile phone 1 sends a pairing request to the Bluetooth headset to initiate pairing.
[0265] 28. After receiving the pairing request from mobile phone 1, the Bluetooth headset sends a pairing response to the mobile phone.
[0266] Optionally, in another embodiment, the third electronic device serves as an external display device for the Bluetooth device. In S64, the first electronic device can obtain pairing information by scanning the visual pairing information displayed by the third electronic device. S64 is executed after S62. For ease of explanation, the visual pairing information is QR code information. Figure 15 As shown, in S64, the first electronic device obtains pairing information from the third electronic device, which may include:
[0267] S151. The Bluetooth device generates QR code information based on the Bluetooth address and capability information of the Bluetooth device.
[0268] S152, The Bluetooth device sends QR code information to the third electronic device, and the third electronic device receives the QR code information sent by the Bluetooth device.
[0269] S153, The third electronic device displays QR code information.
[0270] In this embodiment, the interface and layout for displaying QR code information on the third electronic device are not limited.
[0271] S154. The first electronic device scans the QR code information displayed by the third electronic device.
[0272] In this embodiment, the process of the first electronic device running the scanning function is not limited. For example, the first electronic device can run an APP with scanning function and start the scanning function through human-computer interaction with the user.
[0273] S155. The first electronic device parses the QR code information to obtain the Bluetooth address and capability information of the Bluetooth device.
[0274] As can be seen, in the Bluetooth pairing method provided in this embodiment, the first electronic device obtains the pairing information of the Bluetooth device from the third electronic device. After receiving the notification information sent by the second electronic device, the Bluetooth device determines that it needs to enter pairing mode. The Bluetooth device can generate visual pairing information based on its Bluetooth address and capability information, and display it through the third electronic device. Since the pairing information is determined and provided by the Bluetooth device, the security of the first electronic device obtaining the pairing information is improved. The first electronic device does not need to communicate with the third electronic device; it can obtain the visual pairing information by scanning or taking pictures, thereby obtaining the pairing information. The Bluetooth pairing method provided in this embodiment improves the security of the first electronic device obtaining the pairing information and is more flexible in its implementation.
[0275] For example, taking a Bluetooth headset as the Bluetooth device, a mobile phone 1 as the first electronic device, a mobile phone 2 as the second electronic device, and a display 3 as the third electronic device, combined with... Figure 16 The process of the Bluetooth pairing method provided in this embodiment will be described by way of example.
[0276] like Figure 16 As shown, the Bluetooth pairing method provided in this embodiment may include:
[0277] 31. Mobile phone 2 and Bluetooth headset establish a Bluetooth connection.
[0278] 32. Mobile phone 2 sends a notification message to the Bluetooth headset, which instructs the Bluetooth headset to enter pairing mode.
[0279] 33. The Bluetooth headset receives a notification from mobile phone 2, enters pairing mode according to the notification, and generates a QR code based on the Bluetooth address and capability information of the Bluetooth headset.
[0280] 34. The Bluetooth headset sends a QR code to the display 3.
[0281] 35. Display 3 receives the QR code sent by the Bluetooth headset and displays the QR code.
[0282] 36. Mobile phone 1 starts the scanning function and scans the QR code displayed on display 3.
[0283] 37. Mobile phone 1 parses the scanned QR code to obtain the Bluetooth address and capability information of the Bluetooth headset.
[0284] 38. Based on the Bluetooth address and capability information of the Bluetooth headset, mobile phone 1 sends a pairing request to the Bluetooth headset to initiate pairing.
[0285] 39. After receiving the pairing request from mobile phone 1, the Bluetooth headset sends a pairing response to the mobile phone.
[0286] Optionally, in another embodiment, the Bluetooth device itself may have a display screen. In S64, the first electronic device can obtain pairing information by scanning the visual pairing information displayed by the Bluetooth device. S64 is executed after S62. For ease of explanation, the visual pairing information is QR code information. Figure 17 As shown in S64, the first electronic device obtaining pairing information from the Bluetooth device may include:
[0287] S171. The Bluetooth device generates QR code information based on the Bluetooth address and capability information of the Bluetooth device.
[0288] S172, Bluetooth devices display QR code information.
[0289] In this embodiment, no limitations are placed on the interface and layout for displaying QR code information on Bluetooth devices.
[0290] S173. The first electronic device scans the QR code information displayed by the Bluetooth device.
[0291] In this embodiment, the process of the first electronic device running the scanning function is not limited. For example, the first electronic device can run an APP with scanning function and start the scanning function through human-computer interaction with the user.
[0292] S174. The first electronic device parses the QR code information to obtain the Bluetooth address and capability information of the Bluetooth device.
[0293] As can be seen, in the Bluetooth pairing method provided in this embodiment, the first electronic device obtains pairing information from the Bluetooth device. After the Bluetooth device receives a notification message from the second electronic device, it determines that it needs to enter pairing mode. The Bluetooth device can generate and display visual pairing information based on its Bluetooth address and capability information. Since the pairing information is determined and provided by the Bluetooth device, the security of the first electronic device obtaining the pairing information is improved. The first electronic device does not need to communicate with the Bluetooth device; it can obtain visual pairing information through scanning or taking pictures, thereby acquiring the pairing information. The Bluetooth pairing method provided in this embodiment improves the security of the first electronic device obtaining pairing information and offers greater flexibility in implementation.
[0294] It is understood that the first electronic device, the second electronic device, the Bluetooth device, and the third electronic device, in order to achieve the above-mentioned functions, include hardware and / or software modules corresponding to perform each function. Based on the algorithm steps of the various examples described in conjunction with the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is implemented in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in conjunction with the embodiments, but such implementation should not be considered beyond the scope of this application.
[0295] This application embodiment can divide the first electronic device, second electronic device, Bluetooth device, and third electronic device into functional modules according to the above method example. For example, each function can be divided into a separate functional module, or two or more functions can be integrated into one module. It should be noted that the module division in this application embodiment is illustrative and only represents one logical functional division; other division methods may be used in actual implementation. It should also be noted that the module names in this application embodiment are illustrative, and the module names are not limited in actual implementation.
[0296] For example, Figure 18 This is a schematic diagram of a device provided in an embodiment of this application. The device can be a first electronic device, a second electronic device, a Bluetooth device, and a third electronic device as described in this application. Figure 18 As shown, the device may include: a receiving module 1801, a processing module 1802, and a transmitting module 1803.
[0297] Optionally, in one implementation, Figure 18 The device shown is a second electronic device used to perform the operations of the second electronic device in the above method embodiments, and its technical principle and effect are similar. The second electronic device is paired with the Bluetooth device, and the second electronic device includes:
[0298] Processing module 1802 is used to establish a Bluetooth connection with the Bluetooth device;
[0299] The sending module 1803 is used to send notification information to the Bluetooth device, the notification information being used to instruct the Bluetooth device to enter pairing mode.
[0300] Optionally, the processing module 1802 is further configured to: receive a first operation from the user;
[0301] The sending module 1803 is further configured to send the notification information to the Bluetooth device in response to the first operation.
[0302] Optionally, a receiving module 1801 may also be included;
[0303] The sending module 1803 is used to send an L2CAP_ECHO_REQ message to the Bluetooth device, the L2CAP_ECHO_REQ message including the notification information;
[0304] The receiving module 1801 is used to receive the L2CAP_ECHO_RSP message sent by the Bluetooth device.
[0305] Optionally, the processing module 1802 is further configured to:
[0306] A QR code is generated based on the pairing information, which includes the Bluetooth address of the Bluetooth device.
[0307] Display the QR code information.
[0308] Optionally, the processing module 1802 is further configured to: receive a second operation from the user before generating QR code information based on the pairing information.
[0309] Optionally, the processing module 1802 is further configured to: establish a communication connection with a first electronic device, wherein the first electronic device and the Bluetooth device are not paired;
[0310] The sending module 1803 is further configured to send pairing information to the Bluetooth device through the communication connection, the pairing information including the Bluetooth address of the Bluetooth device.
[0311] Optionally, the processing module 1802 is further configured to: receive a third operation from the user before establishing a communication connection with the first electronic device.
[0312] Optionally, the communication connection includes any one of the following: Bluetooth connection, WiFi connection, or cellular communication connection.
[0313] Optionally, the processing module 1802 is further configured to generate shared information based on the pairing information;
[0314] The sending module 1803 is used to send the shared information to the Bluetooth device through the communication connection.
[0315] Optionally, the pairing information may also include the capability information of the Bluetooth device.
[0316] Optionally, in one implementation, Figure 18 The device shown is a Bluetooth device used to perform the operations of the Bluetooth device in the above method embodiments, and its technical principle and effect are similar. Specifically, the Bluetooth device is not paired with the first electronic device, but is paired with the second electronic device. The Bluetooth device includes:
[0317] Processing module 1802 is used to establish a Bluetooth connection with the second electronic device;
[0318] The receiving module 1801 is used to receive notification information sent by the second electronic device, the notification information being used to instruct the Bluetooth device to enter pairing mode;
[0319] The processing module 1802 is also used to enter the pairing mode according to the notification information;
[0320] The receiving module 1801 is also used to receive a pairing request sent by the first electronic device.
[0321] Optionally, a sending module 1803 may also be included;
[0322] The receiving module 1801 is used to receive an L2CAP_ECHO_REQ message sent by the second electronic device, wherein the L2CAP_ECHO_REQ message includes the notification information;
[0323] The sending module 1803 is used to send an L2CAP_ECHO_RSP message to the second electronic device.
[0324] Optionally, a sending module 1803 may also be included;
[0325] The processing module 1802 is further configured to generate QR code information based on the pairing information after entering the pairing mode according to the notification information, wherein the pairing information includes the Bluetooth address of the Bluetooth device.
[0326] The sending module 1803 is used to send the QR code information to a third electronic device.
[0327] Optionally, the processing module 1802 is further configured to:
[0328] After entering pairing mode according to the notification information, a QR code is generated based on the pairing information, which includes the Bluetooth address of the Bluetooth device.
[0329] Display the QR code information.
[0330] Optionally, the pairing information may also include the capability information of the Bluetooth device.
[0331] Optionally, in one implementation, Figure 18 The device shown is a first electronic device used to perform the operations of the first electronic device in the above method embodiments, and its technical principle and effect are similar. The first electronic device is not paired with a Bluetooth device, while the Bluetooth device is paired with a second electronic device. The first electronic device includes:
[0332] Processing module 1802 is configured to obtain pairing information from the second electronic device, the Bluetooth device, or the third electronic device, wherein the pairing information includes the Bluetooth address of the Bluetooth device; the third electronic device communicates with the Bluetooth device;
[0333] The sending module 1803 is used to send a pairing request to the Bluetooth device according to the Bluetooth address of the Bluetooth device.
[0334] Optionally, the pairing information may also include the capability information of the Bluetooth device.
[0335] Optionally, the processing module 1802 is specifically used for:
[0336] Scan the QR code information displayed by the second electronic device, which is generated by the second electronic device based on the pairing information;
[0337] The QR code information is parsed to obtain the pairing information.
[0338] Optionally, the processing module 1802 is used for:
[0339] Establish a communication connection with the second electronic device;
[0340] The pairing information is obtained from the second electronic device through the communication connection.
[0341] Optionally, a receiving module 1801 may also be included;
[0342] The receiving module 1801 is used to receive shared information sent by the second electronic device; the shared information is generated by the second electronic device based on the pairing information;
[0343] The processing module 1802 is used to parse the shared information and obtain the pairing information.
[0344] Optionally, the communication connection includes any one of the following: Bluetooth connection, WiFi connection, or cellular communication connection.
[0345] Optionally, the processing module 1802 is used for:
[0346] Scan the QR code information displayed by the Bluetooth device or the third electronic device, wherein the QR code information is generated by the Bluetooth device based on the pairing information;
[0347] The QR code information is parsed to obtain the pairing information.
[0348] Optionally, in one implementation, Figure 18The device shown is a third electronic device used to perform the operations of the third electronic device in the above method embodiments, and its technical principle and effect are similar. The third electronic device communicates with a Bluetooth device and includes:
[0349] The receiving module 1801 is used to receive QR code information sent by the Bluetooth device. The QR code information is generated by the Bluetooth device based on pairing information, which includes the Bluetooth address of the Bluetooth device.
[0350] Processing module 1802 is used to display QR code information.
[0351] Optionally, the pairing information may also include Bluetooth device capability information.
[0352] Please refer to Figure 19 This illustration shows the structure of a device provided in an embodiment of this application. The device can be a first electronic device, a second electronic device, a third electronic device, or a Bluetooth device. The device includes: a processor 1901, a receiver 1902, a transmitter 1903, a memory 1904, and a bus 1905. The processor 1901 includes one or more processing cores. The processor 1901 executes various application functions and information processing by running software programs and modules. The receiver 1902 and the transmitter 1903 can be implemented as a communication component, which can be a baseband chip. The memory 1904 is connected to the processor 1901 via the bus 1905. The memory 1904 can be used to store at least one program instruction, and the processor 1901 is used to execute at least one program instruction to implement the technical solution of the above embodiment. Its implementation principle and technical effects are similar to those of the related embodiments of the above method, and will not be repeated here.
[0353] When the device is powered on, the processor reads the software program from the memory, interprets and executes the program's instructions, and processes the program's data. When data needs to be transmitted via the antenna, the processor performs baseband processing on the data to be transmitted and outputs the baseband signal to the control circuit in the control circuitry. The control circuit then performs radio frequency (RF) processing on the baseband signal and transmits the RF signal outward as electromagnetic waves through the antenna. When data is sent to the device, the control circuit receives the RF signal through the antenna, converts it into a baseband signal, and outputs the baseband signal to the processor. The processor converts the baseband signal back into data and processes that data.
[0354] Those skilled in the art will understand that, for ease of explanation, Figure 19 Only one memory and processor are shown. In actual devices, multiple processors and memories may exist. Memory may also be referred to as storage medium or storage device, etc., and this application does not limit this.
[0355] As an optional implementation, the processor may include a baseband processor and a central processing unit (CPU). The baseband processor is primarily used for processing communication data, while the CPU is primarily used for executing software programs and processing the data within those programs. Those skilled in the art will understand that the baseband processor and CPU can be integrated into a single processor or can be separate processors interconnected via technologies such as buses. Those skilled in the art will also understand that the device may include multiple baseband processors to adapt to different network standards, and the device may include multiple CPUs to enhance its processing capabilities. The various components of the device can be connected via various buses. The baseband processor can also be described as a baseband processing circuit or a baseband processing chip. The CPU can also be described as a central processing circuit or a central processing chip. The function of processing communication protocols and communication data can be built into the processor or stored in memory as software programs, with the processor executing the software programs to implement the baseband processing function. The memory can be integrated into the processor or located independently outside the processor. The memory includes a cache, which can store frequently accessed data / instructions.
[0356] In the embodiments of this application, the processor may be a general-purpose processor, a digital signal processor, an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components, capable of implementing or executing the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly manifested as being executed by a hardware processor, or executed by a combination of hardware and software modules within the processor.
[0357] In the embodiments of this application, the memory can be non-volatile memory, such as a hard disk drive (HDD) or a solid-state drive (SS), or it can be volatile memory, such as random-access memory (RAM). Memory is any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, and is not limited thereto.
[0358] The memory in the embodiments of this application can also be a circuit or any other device capable of performing storage functions, used to store program instructions and / or data. The methods provided in the various embodiments of this application can be implemented entirely or partially through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, network equipment, user equipment, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be magnetic media (e.g., floppy disk, hard disk, magnetic tape), optical media (e.g., digital video disc (DWD), or semiconductor media (e.g., SSD), etc.
[0359] Optional, Figure 20 This is another structural schematic diagram of the device provided in this application embodiment. The device can be a Bluetooth device, such as a Bluetooth headset. The Bluetooth headset may include at least one processor 101, at least one memory 102, a wireless communication module 103, an audio module 104, a power module 105, and an input / output interface 106, etc. The processor may include one or more interfaces for connecting to other components of the Bluetooth headset. The Bluetooth headset is stored in a headset case. The following describes a similar design. Figure 20 This section provides a detailed introduction to each component of the Bluetooth headset.
[0360] The memory 102 can be used to store program code, such as code for physical connections between the Bluetooth headset and multiple electronic devices, business specification connections between the headset and electronic devices, processing audio services of electronic devices (e.g., music playback, making / receiving calls), and program code for charging the Bluetooth headset and wireless pairing between the Bluetooth headset and other electronic devices. The memory 102 can also be used to store other information, such as the priority of the electronic devices.
[0361] The processor 101 can be used to execute the aforementioned application code and call relevant modules to implement the functions of the Bluetooth headset in this embodiment. For example, it can implement functions such as physical connection between the Bluetooth headset and multiple electronic devices, service specification connection, audio playback, and making / receiving phone calls.
[0362] Processor 101 may include one or more processing units, which may be independent devices or integrated into one or more processors 101. Specifically, processor 101 may be an integrated control chip or may consist of circuitry including various active and / or passive components, and the circuitry is configured to perform the functions belonging to processor 101 as described in the embodiments of this application.
[0363] The wireless communication module 103 can be used to support data exchange between Bluetooth headsets and other electronic devices or headset boxes via wireless communication technology, such as BT, WLAN (like Wi-Fi), Zigbee, FM, NFC, IR, or general 2.4G / 5G wireless communication technology.
[0364] In some embodiments, the wireless communication module 103 can be a Bluetooth chip. A Bluetooth headset can use this Bluetooth chip to pair with and establish a wireless connection with the Bluetooth chips of other electronic devices, enabling wireless communication and business processing between the Bluetooth headset and these devices. Typically, the Bluetooth chip supports basic rate (BR) / enhanced data rate (EDR) Bluetooth and BLE, for example, it can send / receive page messages and BLE broadcast messages.
[0365] In addition, the wireless communication module 103 may also include an antenna. The wireless communication module 103 receives electromagnetic waves through the antenna, modulates and filters the electromagnetic wave signals, and sends the processed signal to the processor 101. The wireless communication module 103 may also receive signals to be transmitted from the processor 101, modulate and amplify them, and then convert them into electromagnetic waves for radiation through the antenna.
[0366] The audio module 104 can be used to manage audio data and realize the input and output of audio streams for the Bluetooth headset. For example, the audio module 104 can obtain audio streams from or transmit audio streams to the wireless communication module 103, enabling functions such as making and receiving calls, playing music, activating / deactivating the voice assistant of the electronic device connected to the headset, and receiving / sending user voice data through the Bluetooth headset. The audio module 104 may include a speaker (or earpiece, receiver) assembly for outputting audio streams, a microphone (or microphone), and a microphone recording circuit that works with the microphone. The speaker can be used to convert audio electrical signals into sound signals and play them. The microphone can be used to convert sound signals into audio electrical signals.
[0367] The power module 105 can be used to provide system power to the Bluetooth headset, powering various modules of the Bluetooth headset; and supporting the Bluetooth headset to receive charging input, etc. The power module 105 may include a power management unit (PMU) and a battery. The PMU can receive external charging input; transform the electrical signal input from the charging circuit and provide it to the battery for charging; it can also transform the electrical signal provided by the battery and provide it to other modules such as the audio module 104 and the wireless communication module 103; and it can prevent the battery from overcharging, over-discharging, short-circuiting, or experiencing overcurrent. In some embodiments, the power module 105 may also include a wireless charging coil for wirelessly charging the Bluetooth headset. Additionally, the power management unit can also be used to monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage current, impedance).
[0368] Multiple input / output interfaces 106 can be used to provide a wired connection for charging or communication between the Bluetooth headset and the charging case. In some embodiments, the input / output interface can be a USB interface. In other embodiments, the input / output interface 106 can be a headset electrical connector, which allows the Bluetooth headset to establish an electrical connection with the electrical connector in the charging case when the Bluetooth headset is placed in the charging case, thereby charging the battery in the Bluetooth headset. In other embodiments, after the electrical connection is established, the Bluetooth headset can also communicate data with the charging case, for example, it can receive pairing commands from the charging case.
[0369] Additionally, the Bluetooth headset may include a sensor 107. For example, this sensor 107 may be a distance sensor or a proximity light sensor, which can be used to determine whether the Bluetooth headset is being worn by a user. Exemplarily, the Bluetooth headset can use the distance sensor to detect whether there is an object nearby, thereby determining whether the Bluetooth headset is being worn by a user. Upon determining that the Bluetooth headset is being worn, the Bluetooth headset can turn on its speaker.
[0370] For example, the sensor 107 may also include a bone conduction sensor, integrated into a bone conduction headset. Using this bone conduction sensor, the Bluetooth headset can acquire vibration signals from the bone fragments of the human vocal cords, analyze the voice signals, and realize voice functionality, thereby receiving user voice commands. The Bluetooth headset can also perform voice authentication based on the user's voice signals acquired by the bone conduction headset, for example, to authenticate user identity in business scenarios such as payment transactions.
[0371] For example, the sensor 107 may also include: a touch sensor for detecting user touch operations; a fingerprint sensor for detecting user fingerprints and identifying user identity; an ambient light sensor that can adaptively adjust some parameters (such as volume) according to the perceived brightness of ambient light; and other possible sensors.
[0372] In some embodiments, the touch sensor can detect touch operations such as single click, double click, multiple clicks, long press, and heavy pressure, and can also perform user fingerprint recognition to authenticate user identity in business scenarios such as payment transactions.
[0373] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on Bluetooth headsets. They may have more... Figure 20 The Bluetooth headset may include more or fewer components, or combine two or more components, or have different component configurations. For example, the outer surface of the headset may also include components such as a button 108, indicator lights (which can indicate battery level, incoming / outgoing calls, pairing mode, etc.), a display screen (which can display relevant information to the user), and a dustproof mesh (which can be used with the earpiece). The button 108 can be a physical button or a touch button (used in conjunction with a touch sensor), used to trigger operations such as power on / off, pause, play, record, initiate pairing, and reset.
[0374] In some embodiments, Bluetooth earphones are typically housed within an earphone case. The earphone case may contain one or more magnets to attract the earphones into a cavity within the case. The earphone case may include a battery and multiple input / output ports. In some embodiments, the input / output ports may be in-car electrical connectors. Once a pair of in-car electrical connectors in the earphone case establishes an electrical connection with two earphone electrical connectors in the earphones, the earphone case can charge the battery in the earphones using its own battery.
[0375] In other embodiments, the earphone case may be equipped with at least one touch control, which can be used to trigger functions such as pairing reset of the Bluetooth earphones or charging the Bluetooth earphones. The earphone case may also be equipped with one or more power indicator lights to indicate to the user the battery level in the earphone case and the battery level in each earphone.
[0376] This application provides a computer program product that, when run on a device, causes the device to execute the technical solutions described in the above embodiments. Its implementation principle and technical effects are similar to those of the related embodiments described above, and will not be repeated here. The device can be a first electronic device, a second electronic device, a third electronic device, or a Bluetooth device.
[0377] This application provides a computer-readable storage medium storing program instructions. When executed by a device, the program instructions cause the device to perform the technical solution described in the above embodiments. Its implementation principle and technical effects are similar to those of the related embodiments described above, and will not be repeated here. The device may be a first electronic device, a second electronic device, a third electronic device, or a Bluetooth device.
[0378] In summary, the above 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 Bluetooth pairing method, characterized in that, Applied to a communication system, the communication system including a first electronic device, a second electronic device, and a Bluetooth device, wherein the second electronic device and the Bluetooth device are paired, and the first electronic device and the Bluetooth device are not paired, the method includes: The second electronic device and the Bluetooth device establish a Bluetooth connection; The second electronic device sends a notification message to the Bluetooth device, the notification message being used to instruct the Bluetooth device to enter pairing mode, the pairing mode being used for the Bluetooth device to exchange configuration information with other unpaired devices, the configuration information being used to determine the pairing method and assign a key; The Bluetooth device enters pairing mode based on the notification information; The first electronic device obtains pairing information from the second electronic device, the Bluetooth device, or the third electronic device, wherein the pairing information includes the Bluetooth address of the Bluetooth device; The first electronic device sends a pairing request to the Bluetooth device based on the Bluetooth address of the Bluetooth device.
2. The method according to claim 1, characterized in that, The second electronic device sends a notification message to the Bluetooth device, including: The second electronic device receives the user's first operation; In response to the first operation, the second electronic device sends a notification message to the Bluetooth device.
3. The method according to claim 1 or 2, characterized in that, The second electronic device sends a notification message to the Bluetooth device, including: The second electronic device sends a Logical Link Control and Adaptation Protocol Echo Request (L2CAP_ECHO_REQ) message to the Bluetooth device, the L2CAP_ECHO_REQ message including the notification information; The Bluetooth device sends a Logical Link Control and Adaptation Protocol Echo Response (L2CAP_ECHO_RSP) message to the second electronic device.
4. The method according to any one of claims 1-3, characterized in that, The first electronic device obtains pairing information from the second electronic device, including: The second electronic device generates QR code information based on the pairing information and displays the QR code information; The first electronic device scans the QR code information and parses the QR code information to obtain the pairing information.
5. The method according to claim 4, characterized in that, Before the second electronic device generates QR code information based on the pairing information, it further includes: The second electronic device receives a second operation from the user.
6. The method according to any one of claims 1-3, characterized in that, The first electronic device obtains pairing information from the second electronic device, including: The second electronic device establishes a communication connection with the first electronic device; The second electronic device sends the pairing information to the Bluetooth device through the communication connection; The first electronic device receives the pairing information.
7. The method according to claim 6, characterized in that, Before the second electronic device and the first electronic device establish a communication connection, the following is also included: Receive the user's third action.
8. The method according to claim 6, characterized in that, The communication connection includes any one of the following: Bluetooth connection, Wi-Fi connection, or cellular communication connection.
9. The method according to any one of claims 1-3, characterized in that, The first electronic device obtains pairing information from the Bluetooth device, including: After the Bluetooth device enters pairing mode according to the notification information, it generates QR code information based on the pairing information and displays the QR code information. The first electronic device scans the QR code information and parses the QR code information to obtain the pairing information.
10. The method according to any one of claims 1-3, characterized in that, The third electronic device communicates with the Bluetooth device, and the first electronic device obtains pairing information from the third electronic device, including: After the Bluetooth device enters pairing mode according to the notification information, it generates QR code information based on the pairing information. The Bluetooth device sends the QR code information to the third electronic device; After receiving the QR code information, the third electronic device displays the QR code information; The first electronic device scans the QR code information and parses the QR code information to obtain the pairing information.
11. The method according to any one of claims 1-10, characterized in that, The pairing information also includes the capability information of the Bluetooth device.
12. A Bluetooth pairing method, characterized in that, Applied to a second electronic device, which is paired with a Bluetooth device, the method includes: Establish a Bluetooth connection with the Bluetooth device; A notification message is sent to the Bluetooth device, which instructs the Bluetooth device to enter pairing mode. The pairing mode is used for the Bluetooth device to exchange configuration information with other unpaired devices. The configuration information is used to determine the pairing method and assign a key.
13. The method according to claim 12, characterized in that, Sending notification information to the Bluetooth device includes: Receive the user's first action; In response to the first operation, the notification information is sent to the Bluetooth device.
14. The method according to claim 12 or 13, characterized in that, Sending notification information to the Bluetooth device includes: Send a Logical Link Control and Adaptation Protocol Echo Request (L2CAP_ECHO_REQ) message to the Bluetooth device, wherein the L2CAP_ECHO_REQ message includes the notification information; Receive the Logical Link Control and Adaptation Protocol Echo Response (L2CAP_ECHO_RSP) message sent by the Bluetooth device.
15. The method according to any one of claims 12-14, characterized in that, Also includes: A QR code is generated based on the pairing information, which includes the Bluetooth address of the Bluetooth device. The QR code information is displayed.
16. The method according to claim 15, characterized in that, Before generating QR code information based on pairing information, the process also includes: Receive the user's second action.
17. The method according to any one of claims 12-14, characterized in that, Also includes: A communication connection is established with a first electronic device, where the first electronic device and the Bluetooth device are not paired. The pairing information, including the Bluetooth address of the Bluetooth device, is sent to the Bluetooth device via the communication connection.
18. The method according to claim 17, characterized in that, Before establishing a communication connection with the first electronic device, the method further includes: Receive the user's third action.
19. The method according to claim 17, characterized in that, The communication connection includes any one of the following: Bluetooth connection, Wi-Fi connection, or cellular communication connection.
20. The method according to claim 17, characterized in that, Sending pairing information to the Bluetooth device via the communication connection includes: Shared information is generated based on the pairing information; The shared information is sent to the Bluetooth device through the communication connection.
21. The method according to any one of claims 15-20, characterized in that, The pairing information also includes the capability information of the Bluetooth device.
22. A Bluetooth pairing method, characterized in that, Applied to Bluetooth devices, wherein the Bluetooth device is not paired with a first electronic device, and the Bluetooth device is paired with a second electronic device, the method includes: Establish a Bluetooth connection with the second electronic device; The device receives a notification message sent by the second electronic device. The notification message is used to instruct the Bluetooth device to enter pairing mode. The pairing mode is used for the Bluetooth device to exchange configuration information with other unpaired devices. The configuration information is used to determine the pairing method and assign a key. Enter pairing mode according to the notification information; Receive the pairing request sent by the first electronic device.
23. The method according to claim 22, characterized in that, The receipt of notification information sent by the second electronic device includes: Receive a Logical Link Control and Adaptation Protocol Echo Request (L2CAP_ECHO_REQ) message sent by the second electronic device, wherein the L2CAP_ECHO_REQ message includes the notification information; Send a Logical Link Control and Adaptation Protocol Echo Response (L2CAP_ECHO_RSP) message to the second electronic device.
24. The method according to claim 22 or 23, characterized in that, After entering pairing mode based on the notification information, the process further includes: A QR code is generated based on the pairing information, which includes the Bluetooth address of the Bluetooth device. The QR code information is sent to a third electronic device.
25. The method according to claim 22 or 23, characterized in that, After entering pairing mode based on the notification information, the process further includes: A QR code is generated based on the pairing information, which includes the Bluetooth address of the Bluetooth device. The QR code information is displayed.
26. The method according to claim 24 or 25, characterized in that, The pairing information also includes the capability information of the Bluetooth device.
27. A Bluetooth pairing method, characterized in that, Applied to a first electronic device, wherein the first electronic device is not paired with a Bluetooth device, and the Bluetooth device is paired with a second electronic device, the method includes: The third electronic device obtains pairing information from the second electronic device, the Bluetooth device, or the third electronic device, the pairing information including the Bluetooth address of the Bluetooth device; the third electronic device communicates with the Bluetooth device. The Bluetooth device sends a pairing request to the Bluetooth device in pairing mode based on the Bluetooth address of the Bluetooth device. The pairing mode is used for the Bluetooth device to exchange configuration information with other unpaired devices. The configuration information is used to determine the pairing method and assign a key.
28. The method according to claim 27, characterized in that, The pairing information also includes the capability information of the Bluetooth device.
29. The method according to claim 27 or 28, characterized in that, Obtaining pairing information from the second electronic device includes: Scan the QR code information displayed by the second electronic device, which is generated by the second electronic device based on the pairing information; The QR code information is parsed to obtain the pairing information.
30. The method according to claim 27 or 28, characterized in that, Obtaining pairing information from the second electronic device includes: Establish a communication connection with the second electronic device; The pairing information is obtained from the second electronic device through the communication connection.
31. The method according to claim 30, characterized in that, The step of obtaining the pairing information from the second electronic device through the communication connection includes: Receives shared information sent by the second electronic device; the shared information is generated by the second electronic device based on the pairing information; The shared information is parsed to obtain the pairing information.
32. The method according to claim 30, characterized in that, The communication connection includes any one of the following: Bluetooth connection, Wi-Fi connection, or cellular communication connection.
33. The method according to claim 27 or 28, characterized in that, Obtaining pairing information from the Bluetooth device or a third electronic device includes: Scan the QR code information displayed by the Bluetooth device or the third electronic device, wherein the QR code information is generated by the Bluetooth device based on the pairing information; The QR code information is parsed to obtain the pairing information.
34. An electronic device, characterized in that, The electronic device includes a processor configured to be coupled to a memory, read instructions from the memory, and cause the electronic device to perform the method as described in any one of claims 12-21, or to perform the method as described in any one of claims 27-33, according to the instructions.
35. A Bluetooth device, characterized in that, The Bluetooth device includes a processor configured to be coupled to a memory, read instructions from the memory, and cause the Bluetooth device to perform the method as described in any one of claims 22-26 according to the instructions.
36. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed on the device, cause the device to perform the method as described in any one of claims 12-21, or the method as described in any one of claims 22-26, or the method as described in any one of claims 27-33.