WO2023071993A1 - Bluetooth pairing method, device, system, and storage medium - Google Patents

Bluetooth pairing method, device, system, and storage medium Download PDF

Info

Publication number
WO2023071993A1
WO2023071993A1 PCT/CN2022/127076 CN2022127076W WO2023071993A1 WO 2023071993 A1 WO2023071993 A1 WO 2023071993A1 CN 2022127076 W CN2022127076 W CN 2022127076W WO 2023071993 A1 WO2023071993 A1 WO 2023071993A1
Authority
WO
WIPO (PCT)
Prior art keywords
bluetooth
electronic device
information
pairing
bluetooth device
Prior art date
Application number
PCT/CN2022/127076
Other languages
French (fr)
Chinese (zh)
Inventor
苏炯金
林健新
李建刚
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2023071993A1 publication Critical patent/WO2023071993A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/14Direct-mode setup

Definitions

  • the embodiment of the present application relates to the technical field of communication, and in particular to a Bluetooth pairing method, device, system and storage medium.
  • Bluetooth (Bluetooth) technology is a short-distance wireless communication technology, which is widely used in communication devices, such as smart phones, Bluetooth headsets, and the like.
  • the Bluetooth headset Before the first Bluetooth communication between the Bluetooth headset and the smartphone, it needs to be paired. After pairing, normal calls, audio and other services can be performed. When the Bluetooth headset is paired, it needs to be in the pairing mode, scan and reply the query request sent by the smart phone, so that the smart phone can find the Bluetooth headset.
  • Embodiments of the present application provide a Bluetooth pairing method, device, system, and storage medium, which realize successful pairing between an electronic device and a Bluetooth device that is not used for the first time.
  • a Bluetooth pairing method is provided, which is 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 have been paired, and the first electronic device and the Bluetooth device Not paired.
  • the Bluetooth pairing method includes: the second electronic device establishes a Bluetooth connection with the Bluetooth device; the second electronic device sends notification information to the Bluetooth device, and the notification information is used to instruct the Bluetooth device to enter the pairing mode; the Bluetooth device enters the pairing mode according to the notification information; the first electronic The device obtains pairing information from the second electronic device or the Bluetooth device or the third electronic device, and the pairing information includes the Bluetooth address of the Bluetooth device; the first electronic device sends a pairing request to the Bluetooth device according to the Bluetooth address of the Bluetooth device.
  • the second electronic device can control the Bluetooth device to enter the pairing mode, which avoids the need for the user to operate the Bluetooth device. Trigger the Bluetooth device to enter the pairing mode, eliminating the inconvenience for the user to operate the Bluetooth device.
  • the first electronic device can obtain the Bluetooth address of the Bluetooth device without sending a query request to the Bluetooth device, which simplifies the message flow of the pairing process and improves the possibility of completing the pairing process between a Bluetooth device that is not used for the first time and an electronic device that has not been paired. Realization and efficiency have improved the user experience.
  • the sending the notification information to the Bluetooth device by the second electronic device includes: the second electronic device receives a first operation of the user; and the second electronic device sends the notification information to the Bluetooth device in response to the first operation.
  • the user's operation triggers the second electronic device to send notification information to the Bluetooth device, which improves operational flexibility.
  • the second electronic device sends notification information to the Bluetooth device, including: the second electronic device sends an L2CAP_ECHO_REQ message to the Bluetooth device, where the L2CAP_ECHO_REQ message includes notification information; and the Bluetooth device sends an L2CAP_ECHO_RSP message to the second electronic device.
  • the second electronic device sends notification information to the Bluetooth device through the echo request, confirms that the Bluetooth device successfully receives the notification information through the echo response, and improves the success rate of the second electronic device sending notification information.
  • the first electronic device acquires the pairing information from the second electronic device, including: the second electronic device generates two-dimensional code information according to the pairing information, and displays the two-dimensional code information; the first electronic device scans the two-dimensional Code information, and parse the QR code information to obtain pairing information.
  • the first electronic device does not need to communicate with the second electronic device, and can obtain pairing information in a visualized form by scanning or taking pictures, and then obtain the pairing information.
  • the first electronic device obtains the pairing information from the second electronic device, involving a small number of devices, few processing steps, and a simple implementation.
  • the method before the second electronic device generates the two-dimensional code information according to the pairing information, the method further includes: the second electronic device receives a second operation of the user.
  • the user's operation triggers the second electronic device to generate two-dimensional code information according to the pairing information, which improves the flexibility of operation.
  • the acquiring the pairing information from the second electronic device by the first electronic device includes: establishing a communication connection between the second electronic device and the first electronic device; and sending the pairing information to the Bluetooth device by the second electronic device through the communication connection; The first electronic device receives pairing information.
  • the second electronic device provides pairing information to the first electronic device through a communication connection with the first electronic device, and the number of devices involved is small, and the implementation manner is simple.
  • the method before establishing the communication connection between the second electronic device and the first electronic device, the method further includes: receiving a third operation of the user.
  • the communication connection includes any one of the following: a Bluetooth connection, a WiFi connection, or a cellular communication connection.
  • the first electronic device acquires pairing information from the Bluetooth device, including: after the Bluetooth device enters the pairing mode according to the notification information, generates two-dimensional code information according to the pairing information, and displays the two-dimensional code information; the first electronic device The device scans the QR code information, and parses the QR code information to obtain pairing information.
  • the first electronic device does not need to communicate with the Bluetooth device, and can obtain pairing information in visual form from the Bluetooth device by scanning or taking pictures, and then obtain the pairing information, which improves the efficiency of the first electronic device to obtain pairing information.
  • the implementation methods are more diverse.
  • the third electronic device communicates with the Bluetooth device, and the first electronic device acquires pairing information from the third electronic device, including: after the Bluetooth device enters the pairing mode according to the notification information, generates two-dimensional code information according to the pairing information ;
  • the Bluetooth device sends two-dimensional code information to the third electronic device;
  • the third electronic device displays the two-dimensional code information after receiving the two-dimensional code information;
  • the first electronic device scans the two-dimensional code information, and analyzes the two-dimensional code information to obtain pairing information .
  • 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, and can obtain pairing information in a visualized form by scanning or taking pictures, and then obtain pairing information, which improves the security of the first electronic device to obtain pairing information, and the implementation methods are more diverse sex.
  • the pairing information further includes capability information of the Bluetooth device.
  • a Bluetooth pairing method is provided, which is applied to a second electronic device.
  • the second electronic device has been paired with the Bluetooth device.
  • the Bluetooth pairing method includes: establishing a Bluetooth connection with the Bluetooth device; sending notification information to the Bluetooth device, and the notification information Used to instruct a Bluetooth device to enter pairing mode.
  • sending the notification information to the Bluetooth device includes: receiving a first operation of the user; and sending the notification information to the Bluetooth device in response to the first operation.
  • sending notification information to the Bluetooth device includes: sending an L2CAP_ECHO_REQ message to the Bluetooth device, where the L2CAP_ECHO_REQ message includes notification information; and receiving an L2CAP_ECHO_RSP message sent by the Bluetooth device.
  • the method further includes: generating two-dimensional code information according to the pairing information, where the pairing information includes the Bluetooth address of the Bluetooth device; and displaying the two-dimensional code information.
  • the method before generating the two-dimensional code information according to the pairing information, the method further includes: receiving a second user operation.
  • the method further includes: establishing a communication connection with the first electronic device, and the first electronic device is not paired with the Bluetooth device; sending pairing information to the Bluetooth device through the communication connection, and the pairing information includes the Bluetooth address of the Bluetooth device.
  • the method before establishing a communication connection with the first electronic device, the method further includes: receiving a third operation of the user.
  • the communication connection includes any one of the following: a Bluetooth connection, a WiFi connection, or a cellular communication connection.
  • sending the pairing information to the Bluetooth device through the communication connection includes: generating shared information according to the pairing information; and sending the shared information to the Bluetooth device through the communication connection.
  • the pairing information further includes capability information of the Bluetooth device.
  • a Bluetooth pairing method is provided, which is applied to a Bluetooth device.
  • the Bluetooth device is not paired with the first electronic device, and the Bluetooth device is paired with the second electronic device.
  • the Bluetooth pairing method includes: establishing a Bluetooth connection with the second electronic device ; Receive notification information sent by the second electronic device, the notification information is used to instruct the Bluetooth device to enter the pairing mode; enter the pairing mode according to the notification information; receive a pairing request sent by the first electronic device.
  • receiving the notification information sent by the second electronic device includes: receiving an L2CAP_ECHO_REQ message sent by the second electronic device, where the L2CAP_ECHO_REQ message includes the notification information; and sending an L2CAP_ECHO_RSP message to the second electronic device.
  • the method further includes: generating two-dimensional code information according to the pairing information, where the pairing information includes the Bluetooth address of the Bluetooth device; and sending the two-dimensional code information to the third electronic device.
  • the method further includes: generating two-dimensional code information according to the pairing information, where the pairing information includes the Bluetooth address of the Bluetooth device; and displaying the two-dimensional code information.
  • the pairing information further includes capability information of the Bluetooth device.
  • a Bluetooth pairing method is provided, which is applied to a first electronic device.
  • the first electronic device is not paired with the Bluetooth device, and the Bluetooth device is paired with the second electronic device.
  • the Bluetooth pairing method includes: from the second electronic device or The Bluetooth device or the third electronic device acquires pairing information, and the pairing information includes the Bluetooth address of the Bluetooth device; the third electronic device communicates with the Bluetooth device; and sends a pairing request to the Bluetooth device according to the Bluetooth address of the Bluetooth device.
  • the pairing information further includes capability information of the Bluetooth device.
  • obtaining the pairing information from the second electronic device includes: scanning the two-dimensional code information displayed by the second electronic device, the two-dimensional code information is generated by the second electronic device according to the pairing information; parsing the two-dimensional code information to obtain pairing information.
  • obtaining the pairing information from the second electronic device includes: establishing a communication connection with the second electronic device; and obtaining the pairing information from the second electronic device through the communication connection.
  • obtaining pairing information from the second electronic device through a communication connection includes: receiving shared information sent by the second electronic device; the shared information is generated by the second electronic device according to the pairing information; parsing the shared information to obtain pairing information.
  • the communication connection includes any one of the following: a Bluetooth connection, a WiFi connection, or a cellular communication connection.
  • obtaining the pairing information from the Bluetooth device or the third electronic device includes: scanning the two-dimensional code information displayed by the Bluetooth device or the third electronic device, where the two-dimensional code information is generated by the Bluetooth device according to the pairing information; Analyze the QR code information to obtain pairing information.
  • an electronic device which is applied to a third electronic device, and the third electronic device communicates with a Bluetooth device.
  • the Bluetooth pairing method includes: receiving two-dimensional code information sent by the Bluetooth device, and the two-dimensional code information is used by the Bluetooth device according to The pairing information is generated, and the pairing information includes the Bluetooth address of the Bluetooth device; display the QR code information.
  • the pairing information further includes capability information of the Bluetooth device.
  • an electronic device As the second electronic device, the second electronic device has been paired with the Bluetooth device, and the second electronic device includes: a processing module, configured to establish a Bluetooth connection with the Bluetooth device; a sending module, configured to Notification information is sent to the Bluetooth device, and the notification information is used to instruct the Bluetooth device to enter a pairing mode.
  • the processing module is further configured to: receive a first operation of the user; and the sending module is further configured to send notification information to the Bluetooth device in response to the first operation.
  • it also includes a receiving module; a sending module, configured to send an L2CAP_ECHO_REQ message to the Bluetooth device, where the L2CAP_ECHO_REQ message includes notification information; and a receiving module, configured to receive an L2CAP_ECHO_RSP message sent by the Bluetooth device.
  • the processing module is further configured to: generate two-dimensional code information according to the pairing information, where the pairing information includes the Bluetooth address of the Bluetooth device; and display the two-dimensional code information.
  • the processing module is further configured to: before generating the two-dimensional code information according to the pairing information, receive a second user operation.
  • the processing module is also used to: establish a communication connection with the first electronic device, and the first electronic device is not paired with the Bluetooth device; the sending module is also used to send pairing information to the Bluetooth device through the communication connection, and the pairing The information includes the Bluetooth address of the Bluetooth device.
  • the processing module is further configured to: before establishing a communication connection with the first electronic device, receive a third operation of the user.
  • the communication connection includes any one of the following: a Bluetooth connection, a WiFi connection, or a cellular communication connection.
  • the processing module is further configured to generate shared information according to the pairing information; the sending module is configured to send the shared information to the Bluetooth device through a communication connection.
  • the pairing information further includes capability information of the Bluetooth device.
  • a Bluetooth device is provided.
  • the Bluetooth device is not paired with the first electronic device, and the Bluetooth device is paired with the second electronic device.
  • the Bluetooth device includes: a processing module, configured to establish a Bluetooth connection with the second electronic device; receiving The module is configured to receive the notification information sent by the second electronic device, the notification information is used to instruct the Bluetooth device to enter the pairing mode; the processing module is also used to enter the pairing mode according to the notification information; the receiving module is also used to receive the notification information sent by the first electronic device. pairing request.
  • it further includes a sending module; a receiving module, configured to receive the L2CAP_ECHO_REQ message sent by the second electronic device, where the L2CAP_ECHO_REQ message includes notification information; and a sending module, configured to send the L2CAP_ECHO_RSP message to the second electronic device.
  • it also includes a sending module; a processing module is also used to generate two-dimensional code information according to the pairing information after entering the pairing mode according to the notification information, and the pairing information includes the Bluetooth address of the Bluetooth device; the sending module uses to send the two-dimensional code information to the third electronic device.
  • the processing module is further configured to: after entering the pairing mode according to the notification information, generate two-dimensional code information according to the pairing information, where the pairing information includes the Bluetooth address of the Bluetooth device; and display the two-dimensional code information.
  • the pairing information further includes capability information of the Bluetooth device.
  • an electronic device As the first electronic device, the first electronic device is not paired with the Bluetooth device, and the Bluetooth device is paired with the second electronic device.
  • the first electronic device includes: a processing module configured to obtain The second electronic device or the Bluetooth device or the third electronic device acquires pairing information, and the pairing information includes the Bluetooth address of the Bluetooth device; the third electronic device communicates with the Bluetooth device; the sending module is used to send a pairing request to the Bluetooth device according to the Bluetooth address of the Bluetooth device .
  • the pairing information further includes capability information of the Bluetooth device.
  • the processing module is specifically configured to: scan the two-dimensional code information displayed by the second electronic device, the two-dimensional code information is generated by the second electronic device according to the pairing information; analyze the two-dimensional code information to obtain the pairing information .
  • the processing module is configured to: establish a communication connection with the second electronic device; obtain pairing information from the second electronic device through the communication connection.
  • the receiving module is configured to receive the shared information sent by the second electronic device; the shared information is generated by the second electronic device according to the pairing information; the processing module is configured to parse the shared information, Get pairing information.
  • the communication connection includes any one of the following: a Bluetooth connection, a WiFi connection, or a cellular communication connection.
  • the processing module is configured to: scan the two-dimensional code information displayed by the Bluetooth device or the third electronic device, the two-dimensional code information is generated by the Bluetooth device according to the pairing information; analyze the two-dimensional code information to obtain the pairing information .
  • an electronic device As the third electronic device, the third electronic device communicates with the Bluetooth device, and the third electronic device includes: a receiving module for receiving the two-dimensional code information sent by the Bluetooth device, the two-dimensional code The information is generated by the Bluetooth device according to the pairing information, and the pairing information includes the Bluetooth address of the Bluetooth device; the processing module is used to display the two-dimensional code information.
  • the pairing information further includes capability information of the Bluetooth device.
  • an electronic device As a second electronic device, the electronic device includes a processor, and the processor is configured to be coupled with a memory, read instructions in the memory, and make the electronic device execute the method provided in the second aspect according to the instructions.
  • a Bluetooth device includes a processor, and the processor is configured to be coupled with a memory, read instructions in the memory, and make the Bluetooth device execute the method provided in the third aspect according to the instructions.
  • an electronic device is provided.
  • the electronic device includes a processor, and the processor is used to be coupled with the memory, and read instructions in the memory and make the electronic device execute the method provided in the fourth aspect according to the instructions .
  • an electronic device is provided.
  • the electronic device includes a processor, and the processor is used to be coupled with the memory, and read instructions in the memory and make the electronic device execute the method provided in the fifth aspect according to the instructions .
  • a fourteenth aspect provides a communication system, and the communication system includes the second electronic device provided in the tenth aspect, the bluetooth device provided in the eleventh aspect, and the first electronic device provided in the twelfth aspect.
  • the communication system further includes the third electronic device provided in the thirteenth aspect.
  • a fifteenth aspect provides a program, which is used to execute the method provided in the first aspect, the second aspect, the third aspect, the fourth aspect or the fifth aspect when executed by a processor.
  • a computer-readable storage medium is provided. Instructions are stored in the computer-readable storage medium. When the instructions are run on a computer or a processor, the first aspect, the second aspect, the third aspect, and the fourth aspect are realized. Aspect or the method provided by the fifth aspect.
  • a program product includes a computer program, the computer program is stored in a readable storage medium, and at least one processor of the device can read the computer program from the readable storage medium. program, the at least one processor executes the computer program so that the device implements the method provided in the first aspect, the second aspect, the third aspect, the fourth aspect or the fifth aspect.
  • FIG. 1 is a schematic diagram of a scenario of Bluetooth communication
  • FIG. 2 is a message interaction diagram between the Bluetooth device and the electronic device in the pairing process in FIG. 1;
  • 3A-3B are schematic diagrams of the user operating the Bluetooth device to enter the pairing mode
  • 4A to 4C are schematic diagrams of a set of interfaces after the Bluetooth function is enabled on the electronic device
  • FIG. 5 is a schematic diagram of a scene of Bluetooth communication applicable to the embodiment of the present application.
  • FIG. 6 is a message interaction diagram of the Bluetooth pairing method provided by the embodiment of the present application.
  • FIGS. 7A to 7F are schematic diagrams of a group of interfaces of the second electronic device
  • 8A to 8F are schematic diagrams of another set of interfaces of the second electronic device.
  • FIG. 9 is a message interaction diagram for sending notification information by the second electronic device provided in the embodiment of the present application.
  • FIG. 10A is a schematic diagram of the format of the data packet corresponding to the L2CAP_ECHO_REQ message provided by the embodiment of the present application;
  • FIG. 10B is a schematic diagram of the format of the data packet corresponding to the L2CAP_ECHO_RSP message provided by the embodiment of the present application;
  • FIG. 11 is a message interaction diagram for obtaining configuration information by the first electronic device provided in the embodiment of the present application.
  • FIG. 12 is another message interaction diagram of the Bluetooth pairing method provided by the embodiment of the present application.
  • FIG. 13 is another message interaction diagram for obtaining configuration information by the first electronic device provided in the embodiment of the present application.
  • FIG. 14 is another message interaction diagram of the Bluetooth pairing method provided by the embodiment of the present application.
  • FIG. 15 is another message interaction diagram for obtaining configuration information by the first electronic device provided in the embodiment of the present application.
  • FIG. 16 is another message interaction diagram of the Bluetooth pairing method provided by the embodiment of the present application.
  • FIG. 17 is another message interaction diagram for obtaining configuration information by the first electronic device provided in the embodiment of the present application.
  • FIG. 18 is a schematic structural diagram of a device provided by an embodiment of the present application.
  • Fig. 19 is another schematic structural diagram of the device provided by the embodiment of the present application.
  • Fig. 20 is another schematic structural diagram of the device provided by the embodiment of the present application.
  • the Bluetooth pairing method provided in the embodiment of the present application is applicable to a pairing process between devices in Bluetooth communication. First, the pairing process is introduced.
  • Bluetooth communication before two devices conduct Bluetooth communication for the first time, they need to go through a pairing process first. After the pairing of the two devices is completed, information such as the Bluetooth device address (BD_ADDR) and key are stored in the device, so that Bluetooth communication can be performed. Subsequently, if the Bluetooth address, key and other information stored in the two devices are not cleared, when the Bluetooth communication is performed again, the two devices can send a Bluetooth connection request according to the Bluetooth address, and there is no need to perform the pairing process again.
  • BD_ADDR Bluetooth device address
  • key key and other information stored in the two devices are not cleared, when the Bluetooth communication is performed again, the two devices can send a Bluetooth connection request according to the Bluetooth address, and there is no need to perform the pairing process again.
  • FIG. 1 is a schematic diagram of a scenario of Bluetooth communication. As shown in FIG. 1 , both the electronic device 100 and the Bluetooth device 200 support the Bluetooth function, and the electronic device 100 and the Bluetooth device 200 can perform Bluetooth communication.
  • the types and names of the electronic device 100 and the Bluetooth device 200 are not limited.
  • examples of some electronic devices are: mobile phones, tablet computers, notebook computers, handheld computers, wearable devices, smart screens, teaching equipment, Internet of Things (internet of things, IOT) devices, or smart home (smart home) wireless terminals, etc.
  • the electronic device 100 has a display screen.
  • Examples of some bluetooth devices are: bluetooth earphones, bluetooth speakers, bluetooth stylus and so on.
  • the embodiment of the present application takes the electronic device 100 as a mobile phone and the Bluetooth device 200 as a Bluetooth headset as an example for description.
  • the pairing process may include a device discovery phase and a pairing phase.
  • the electronic device can discover a Bluetooth device that can be paired, and exchange relevant information required in the pairing phase with the Bluetooth device, for example, the Bluetooth address of the Bluetooth device.
  • the electronic device and the Bluetooth device can exchange information such as keys for subsequent Bluetooth communication.
  • FIG. 2 is a diagram of message interaction between the Bluetooth device and the electronic device in FIG. 1 during the pairing process.
  • the pairing process between devices in Bluetooth communication may include:
  • the Bluetooth device enters a pairing mode in response to the user's operation on the Bluetooth device.
  • the user needs to operate the Bluetooth device so that the Bluetooth device enters a pairing mode.
  • the Bluetooth device When the Bluetooth device is in the pairing mode, it can search for an inquiry request (inquiry request) sent by the electronic device, and reply an inquiry response (inquiry response) to the electronic device, so that the electronic device can discover the Bluetooth device.
  • the usage status of the Bluetooth device is different, the user may operate the Bluetooth device differently.
  • the Bluetooth headset is first unpacked and used.
  • the Bluetooth headset includes a case cover 201 and a case body 202 .
  • the bluetooth headset has never been used out of the box after leaving the factory.
  • the Bluetooth headset can be triggered to enter a pairing mode.
  • the Bluetooth headset enters the pairing mode in response to the user's operation.
  • the Bluetooth headset is not used for the first time.
  • the Bluetooth headset has been used out of the box, and Bluetooth communication has been performed with at least one electronic device.
  • the user can press the box body 202
  • the physical button 203 on the keyboard triggers the Bluetooth headset to enter pairing mode.
  • the Bluetooth headset enters the pairing mode in response to the operation of pressing the physical button 203 by the user.
  • the embodiment of the present application does not limit the name of the pairing mode.
  • the pairing mode may also be called a pairing state or an inquiry scan (inquiry scan) state.
  • the electronic device sends an inquiry request (inquiry request).
  • the Bluetooth devices in the pairing mode around the electronic device can scan the query request and receive the query request.
  • the electronic device After the electronic device turns on the bluetooth function, it can enter an inquiry state and send an inquiry request to surrounding devices.
  • the inquiry request can be scanned, and an inquiry response (inquiry response) can be returned to the electronic device, so that the electronic device can discover the Bluetooth device.
  • the execution order of S21 and S22 is not limited.
  • the user first triggers the Bluetooth headset to enter the pairing mode by pressing a physical button on the Bluetooth headset box, and then the electronic device turns on the Bluetooth function, that is, first executes S21 and then executes S22.
  • the electronic device first turns on the bluetooth function, and then the user opens the box and uses the bluetooth earphone for the first time to trigger the bluetooth earphone to enter the pairing mode, that is, first execute S22 and then execute S21.
  • the query request includes the bluetooth address of the electronic device, and the bluetooth address can refer to related content in the bluetooth protocol, which will not be repeated here.
  • the electronic device may send the query request according to the first cycle.
  • the Bluetooth device in the pairing mode may scan for query requests according to the second cycle.
  • the first period and the second period may be the same or different.
  • the Bluetooth device sends an inquiry response (inquiry response) to the electronic device.
  • the electronic device receives the inquiry response sent by the Bluetooth device.
  • the query response includes the Bluetooth address of the Bluetooth device.
  • the Bluetooth device in the pairing mode scans the query request sent by the electronic device, it can return a query response to the electronic device according to the Bluetooth address of the electronic device in the query request, so that the electronic device can discover the Bluetooth device and continue to communicate with the electronic device.
  • the device goes through the subsequent pairing process.
  • the stage of discovering devices includes but not limited to S21-S23.
  • the electronic device and the Bluetooth device can also obtain at least one of the following information through message interaction: the device name of the Bluetooth device, the device supported feature information of the electronic device, and the device information of the Bluetooth device. Support feature information.
  • the device support feature information may also be referred to as capability information, and reference may be made to the content about device features in the Bluetooth protocol, which will not be repeated here.
  • FIG. 4A shows a schematic interface of an electronic device in a device discovery stage.
  • the bluetooth main interface 40 of the mobile phone includes a switch control 41 of the bluetooth function, a switch control 42 of open detection, a "device name” tab 43, a "received file” tab 44, and a paired device 45 and 46 devices available. It can be known from the "device name" tab 43 that the name of the mobile phone is "mobile phone 2".
  • Paired devices 45 shows devices that have been successfully paired with phone 2 in history, eg, phone 1 .
  • the available devices 46 display currently pairable devices discovered by the mobile phone 2, for example, Bluetooth headsets.
  • the user can click on the Bluetooth headset in the available devices 46 to pair the mobile phone 2 with the Bluetooth headset.
  • the mobile phone 2 starts the pairing stage in the pairing process in response to the user's operation.
  • a prompt message may also be displayed before the mobile phone 2 and the Bluetooth headset are paired.
  • the changes of the Bluetooth main interface 40 can be seen in FIG. 4B .
  • the mobile phone 2 pops up a pairing window 47 in the Bluetooth main interface 40 .
  • the user operates by viewing the prompt information in the pairing pop-up window 47 .
  • the prompt information includes: "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 make the mobile phone 2 pair with the Bluetooth headset.
  • the mobile phone 2 executes the message flow of the pairing phase, see S24 for details.
  • the electronic device sends a pairing request (pairing request) to the Bluetooth device.
  • the Bluetooth device receives the pairing request sent by the electronic device.
  • the Bluetooth device sends a pairing response (pairing response) to the electronic device.
  • the electronic device receives the pairing response sent by the Bluetooth device.
  • the electronic device may send a pairing request to the Bluetooth device according to the Bluetooth address of the Bluetooth device, and the Bluetooth device may send a pairing response to the electronic device according to the Bluetooth address of the electronic device, and the pairing request and the pairing response are used to exchange configuration information, Configuration information is used to determine the pairing method and distribute keys.
  • the configuration information may include the input and output capabilities of the electronic device.
  • Different electronic devices have different types, different hardware configurations, and different input and output capabilities.
  • the input/output capability may indicate at least one of the following: whether the electronic device can input, an input method when the electronic device can input, whether the electronic device can display, and so on.
  • the input and output capabilities of the electronic device may include any of the following: no input and no output, only a display screen, a display screen with the option of "yes/no", a keyboard only, a keyboard and a display screen .
  • the pairing stage includes but not limited to S24-S25.
  • the pairing phase it is also necessary to determine the pairing algorithm of the electronic device and the Bluetooth device, establish an encrypted link, transmit a key, etc., and refer to the content about pairing authentication in the Bluetooth protocol, which will not be repeated here.
  • FIG. 4C shows a schematic diagram of an interface of the electronic device after the electronic device and the Bluetooth device are paired.
  • the paired devices 45 include the mobile phone 1 and the Bluetooth headset, indicating that the mobile phone 2 and the Bluetooth headset have been paired, and subsequent Bluetooth communication can be performed.
  • call service includes but are not limited to: voice calls or video calls; audio services include but are not limited to: playing music, notification sounds, navigation sounds, alarm clocks, games, videos, etc.
  • the Bluetooth device needs to be in a pairing mode, so that the Bluetooth device can scan the query request sent by the electronic device and reply with a query response.
  • the electronic device discovers a Bluetooth device that can be paired, obtains the Bluetooth address of the Bluetooth device from the query response sent by the Bluetooth device, and then sends a pairing request to the Bluetooth device according to the Bluetooth address of the Bluetooth device to continue the pairing process.
  • controlling the Bluetooth headset to enter the pairing mode requires the user to operate the Bluetooth headset.
  • the Bluetooth device When the Bluetooth device is used for the first time, the user opens the box to trigger the Bluetooth headset to enter the pairing mode.
  • the first use of the Bluetooth headset is only once. In most application scenarios, the Bluetooth device is in use. At this time, the user needs to manually operate the physical button on the Bluetooth headset box to allow the Bluetooth headset to enter the pairing mode.
  • many users are not aware of this operation, resulting in the non-first-use Bluetooth headsets being unable to enter the pairing mode, unable to complete the pairing process with electronic devices, and therefore unable to perform subsequent Bluetooth communications and services, seriously affecting the use of Bluetooth headsets by users feel.
  • the embodiment of the present application provides a Bluetooth pairing method.
  • the third-party device can control the Bluetooth device to enter the pairing mode, avoiding that the user must operate the Bluetooth device to trigger
  • the Bluetooth device enters the pairing mode, which eliminates the inconvenience for the user to operate the Bluetooth device.
  • the electronic device can obtain the Bluetooth address of the Bluetooth device without sending a query request to the Bluetooth device, which simplifies the message flow of the pairing process and improves the feasibility of completing the pairing process between a Bluetooth device that is not used for the first time and an electronic device that has not been paired. And convenience, enhance the user experience.
  • the electronic device that needs to be paired with the Bluetooth device is called the first electronic device, and the third-party device other than the first electronic device and the Bluetooth device is called the second electronic device.
  • the history of the Bluetooth device and the second electronic device The pairing is successful and the data has not been cleared.
  • FIG. 5 is a schematic diagram of a scene of Bluetooth communication applicable to the embodiment of the present application.
  • the scene includes a Bluetooth device, a first electronic device, and a second electronic device.
  • the Bluetooth device and the second electronic device can perform Bluetooth communication.
  • the first electronic device and the second electronic device may or may not communicate.
  • 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 (wireless fidelity, WiFi) communication, near field communication (near field communication, NFC) or cellular communication.
  • the scene may further include a third electronic device.
  • the bluetooth device can communicate with the third electronic device.
  • the 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.
  • the first electronic device and the third electronic device may or may not communicate.
  • the 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.
  • the third electronic device may also be a device for displaying related information of the Bluetooth device, for example, a display screen or a monitor.
  • the embodiment of the present application does not limit the number of the first electronic device, the second electronic device, and the third electronic device.
  • FIG. 6 is a message interaction diagram of the Bluetooth pairing method provided by the embodiment of the present application.
  • the Bluetooth pairing method provided in this embodiment is applicable to the scenario shown in FIG. 5 , and the execution subject involves the Bluetooth device, the first electronic device, and the second electronic device.
  • the execution subject may also involve a third electronic device.
  • the Bluetooth device is a Bluetooth headset
  • the first electronic device is a mobile phone 1
  • the second electronic device is a mobile phone 2
  • the third electronic device is a display 3 .
  • the Bluetooth pairing method provided in this embodiment may include:
  • the Bluetooth device establishes a Bluetooth connection with the second electronic device.
  • the Bluetooth connection may include an asynchronous connection-oriented (ACL) connection.
  • ACL asynchronous connection-oriented
  • the ACL connection is a connection on the physical layer in the Bluetooth protocol, and reference may be made to related content in the Bluetooth protocol, so details will not be repeated here.
  • the Bluetooth connection may also include at least one of the following: a synchronous connection-oriented connection (synchronous connection-oriented link, SCO) connection, an advanced audio distribution profile (A2DP) connection, or a hands-free profile ( hands-free profile, HFP) connection.
  • a synchronous connection-oriented connection synchronous connection-oriented link, SCO
  • A2DP advanced audio distribution profile
  • HFP hands-free profile
  • this embodiment does not limit the time for establishing the Bluetooth connection between the Bluetooth device and the second electronic device in the application scenario.
  • no Bluetooth connection is currently established between the Bluetooth device and the second electronic device.
  • the Bluetooth device needs to be paired with the first electronic device, the Bluetooth device establishes a Bluetooth connection with the second electronic device.
  • the mobile phone 2 does not currently have the Bluetooth function turned on.
  • the Bluetooth headset needs to be paired with the mobile phone 1, the user turns on the Bluetooth function of the mobile phone 2, and the mobile phone 2 can automatically establish a Bluetooth connection with the Bluetooth headset.
  • the Bluetooth device when the Bluetooth device needs to be paired with the first electronic device, the Bluetooth device has established a Bluetooth connection with the second electronic device. For example, the user is listening to the music played on the mobile phone 2 through the Bluetooth headset. At this time, the Bluetooth headset needs to be paired with the mobile phone 1 .
  • the second electronic device sends notification information to the Bluetooth device, where the notification information is used to instruct the Bluetooth device to enter a pairing mode.
  • the Bluetooth device receives the notification information sent by the second electronic device.
  • the second electronic device may be triggered to send notification information to the Bluetooth device.
  • a user wants to pair a Bluetooth headset with a mobile phone 1 .
  • the user usually knows the second electronic device in the environment, for example, the mobile phone 2 .
  • mobile phone 1 and mobile phone 2 are mobile phones used by user 1; or, user 1 uses mobile phone 1, and user 1 knows that user 2 uses mobile phone 2.
  • the Bluetooth function of the mobile phone 2 can be turned on, and the mobile phone 2 establishes a Bluetooth connection with the Bluetooth headset, and triggers the mobile phone 2 to send a notification message to the Bluetooth headset, indicating that the Bluetooth headset enters pairing mode.
  • the user may perform a first operation on the second electronic device, thereby triggering the second electronic device to send notification information to the Bluetooth device.
  • this embodiment does not limit the first operation performed by the user on the second electronic device.
  • the user's first operation may be any of the following: a touch operation performed by the user on the relevant interface displayed by the second electronic device, a gesture operation performed by the user on the display screen of the second electronic device, An operation performed by a physical button on the second electronic device, a user inputs voice through a microphone of the second electronic device, or a user inputs an image through a camera of the second electronic device.
  • the second electronic device may be installed with an application program (application, APP) for managing Bluetooth devices. This embodiment does not limit the name and function of the APP, and does not limit the content and layout of the relevant interface of the APP. .
  • the mobile phone 2 is currently running a system application, and displays a Bluetooth main interface 70 in the system application. It can be known from the paired device 71 in the Bluetooth main interface 70 that currently, the mobile phone 2 has been connected to the mobile phone 1 and the Bluetooth earphone via Bluetooth. The user can click on the Bluetooth headset in the paired device 71 to trigger the mobile phone 2 to send notification information to the Bluetooth headset. Correspondingly, the mobile phone 2 sends notification information to the Bluetooth headset in response to the user's operation.
  • the Bluetooth main interface 70 includes prompt information for guiding the user to perform the first operation. For example, in FIG. 7A , there is a prompt message "click the Bluetooth headset to enter pairing mode" below the Bluetooth headset.
  • the second electronic device may display prompt information to the user.
  • the user clicks on the Bluetooth headset in the paired device 71 to trigger the mobile phone 2 to send notification information to the Bluetooth headset.
  • the mobile phone 2 pops up a pop-up window 72 in the Bluetooth main interface 70 in response to the user's operation.
  • the user operates by viewing the prompt information in the pop-up window 72 .
  • the prompt information includes: "The Bluetooth headset enters pairing mode”.
  • the pop-up window 72 also includes a cancel button and a confirm button.
  • the user can click the OK button 73 to trigger the mobile phone 2 to send notification information to the Bluetooth headset.
  • the mobile phone 2 sends notification information to the Bluetooth headset in response to the user's operation of clicking the OK button 73, instructing the Bluetooth headset to enter the pairing mode.
  • FIG. 8A shows another interface diagram of the mobile phone 2 .
  • the difference between Fig. 8A and Fig. 7A is: in Fig. 7A, the mobile phone 2 runs the system application program, and displays the bluetooth main interface 70 in the system application program; while in Fig. 8A, the mobile phone 2 runs the third-party application program, and the third-party application program Other equipment for managing communication with the mobile phone 2.
  • the embodiment of the present application does not limit the name, function and interface layout of the third-party application program.
  • the mobile phone 2 currently displays the "My Devices" interface 80 in the third-party application program, and the devices communicating with the mobile phone 2 include: door lock 001, Bluetooth headset, home gateway 1 and mobile phone 1.
  • the interface 80 includes prompt information for guiding the user to perform the first operation. For example, in FIG. 8A , there is a prompt message "click the right button, and the Bluetooth headset enters pairing mode" below the Bluetooth headset.
  • FIGS. 7A to 7B and FIGS. 8A to 8B are only examples, and do not limit the relevant interface and the first operation of the user.
  • the user can enter the setting interface of the Bluetooth headset through relevant operations, and perform the first operation in the setting interface to trigger the mobile phone 2 to send notification information to the Bluetooth headset.
  • the notification information can be carried in the interactive message defined in the Bluetooth protocol, or in the private message defined between the second electronic device and the Bluetooth device.
  • the name of the message and the notification information are included in the message The way of carrying is not limited.
  • the second electronic device may send the notification information through an echo (echo or Echo or ECHO) channel of a logical link control and adaptation layer protocol (L2CAP).
  • ECHO protocol can refer to the CORE Host (core host) chapter of the Bluetooth protocol, for example, Section 4.8 of PartA.
  • FIG. 9 is a message interaction diagram for sending notification information by the second electronic device provided in the embodiment of the present application.
  • the notification information sent by the second electronic device to the Bluetooth device may include:
  • the second electronic device sends an L2CAP_ECHO_REQ (Logical Link Control and Adaptation Protocol Echo Request) message to the Bluetooth device, where the L2CAP_ECHO_REQ message includes notification information.
  • the Bluetooth device receives the L2CAP_ECHO_REQ message sent by the second electronic device.
  • the Bluetooth device sends an L2CAP_ECHO_RSP (Logical Link Control and Adaptation Protocol Echo Response) message to the second electronic device, where the L2CAP_ECHO_RSP message is used to indicate that the Bluetooth device has received the L2CAP_ECHO_REQ message.
  • L2CAP_ECHO_RSP Logical Link Control and Adaptation Protocol Echo Response
  • an echo request (Echo request or ECHO_REQ or L2CAP_ECHO_REQ) is usually used to request a response from a remote L2CAP entity, and the echo request can be used to test a link or transmit specific information using an optional data field.
  • the L2CAP entity After the L2CAP entity receives a valid echo request packet, it responds with an echo response (Echo response or ECHO_RSP or L2CAP_ECHO_RSP) packet.
  • the specific information is notification information.
  • FIG. 10A is a schematic diagram of the format of the data packet corresponding to the L2CAP_ECHO_REQ message provided by the embodiment of the present application
  • FIG. 10B is a schematic diagram of the format of the data packet corresponding to the L2CAP_ECHO_RSP message provided by the embodiment of the present application.
  • the left side of the data packet (Packet) corresponding to the L2CAP_ECHO_REQ message is the least significant bit (least significant bit, LSB), and the right side is the most significant bit (most significant bit, MSB)
  • the data packet includes: encoding ( Code) field, identifier (Identifier) field, length (Length) field and data (Data) field.
  • the data field is an optional field.
  • user-defined information can be carried in the optional data field.
  • the notification information may be carried in the data field.
  • the format of the data packet corresponding to the L2CAP_ECHO_RSP message shown in FIG. 10B is similar to the format of the data packet corresponding to the L2CAP_ECHO_REQ message shown in FIG. 10A , wherein the identifier field in the L2CAP_ECHO_RSP message matches the L2CAP_ECHO_REQ message, and the encoding field matches.
  • the value of the identifier field in FIG. 10A and FIG. 10B is the same.
  • the encoding field in FIG. 10A takes a value of 0x08
  • the encoding field in FIG. 10B takes a value of 0x09.
  • the Bluetooth device enters a pairing mode according to the notification information.
  • the first electronic device acquires pairing information from the second electronic device or the Bluetooth device or the third electronic device, where the pairing information includes a Bluetooth address of the Bluetooth device.
  • the second electronic device since the Bluetooth device and the second electronic device have been paired successfully, the second electronic device stores the Bluetooth address of the Bluetooth device, and the first electronic device can obtain the Bluetooth address of the Bluetooth device from the second electronic device. Bluetooth address.
  • the second electronic device notifies the Bluetooth device to enter the pairing mode, and the second electronic device provides pairing information to the first electronic device, and the first electronic device and the Bluetooth device are paired only by means of the second electronic device,
  • the number of devices involved is small, the processing steps are few, and the implementation method is simple.
  • the first electronic device and the second electronic device may perform wired communication or wireless communication, and through the communication connection between the first electronic device and the second electronic device, the second electronic device sends pairing information to the first electronic device, Correspondingly, the first electronic device receives the pairing information sent by the second electronic device.
  • the wireless communication includes but is not limited to any one of the following: Bluetooth communication, WiFi communication, NFC communication or cellular communication.
  • the first electronic device and the second electronic device do not communicate, and the second electronic device displays the pairing information in a visualized form.
  • Form pairing information is processed to obtain pairing information.
  • the pairing information in a visualized form is generated according to the pairing information, for example, including but not limited to any one of the following: two-dimensional code or barcode.
  • the third electronic device may obtain pairing information, and the first electronic device may obtain pairing information from the third electronic device.
  • the third electronic device does not limit the manner in which the third electronic device acquires the pairing information.
  • the Bluetooth device and the third electronic device can perform Bluetooth communication, and the third electronic device stores pairing information such as the Bluetooth address of the Bluetooth device.
  • the Bluetooth device may send pairing information to the third electronic device.
  • the Bluetooth device may send the pairing information to the third electronic device after receiving the notification information sent by the second electronic device.
  • the second electronic device notifies the Bluetooth device to enter the pairing mode
  • 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 electronic device and the second electronic device to pair Three electronic devices, flexible implementation.
  • the first electronic device and the third electronic device may perform wired communication or wireless communication, and through the communication connection between the first electronic device and the third electronic device, the third electronic device sends pairing information to the first electronic device, Correspondingly, the first electronic device receives the pairing information sent by the third electronic device.
  • the wireless communication includes but is not limited to any one of the following: Bluetooth communication, WiFi communication, NFC communication or cellular communication.
  • the first electronic device and the third electronic device do not communicate, and the third electronic device displays the pairing information in a visualized form.
  • the pairing information of the form is processed, and the pairing information can be obtained.
  • the pairing information in a visualized form is generated according to the pairing information, for example, including but not limited to any one of the following: two-dimensional code or barcode.
  • the third electronic device is an external display device of the Bluetooth device.
  • the Bluetooth device After receiving the notification information sent by the second electronic device, the Bluetooth device enters the pairing mode, generates pairing information in a visualized form according to the pairing information, and sends the pairing information in a visualized form to the third electronic device.
  • the third electronic device receives and displays the pairing information in visual form sent by the Bluetooth device.
  • the first electronic device may acquire pairing information from the Bluetooth device.
  • the bluetooth device may have a display screen, and after receiving the notification information sent by the second electronic device and entering the pairing mode, the bluetooth device may generate and display pairing information in a visual form according to the pairing information.
  • the first electronic device can obtain the pairing information by scanning the pairing information in the visualized form or taking a picture of the pairing information in the visualized form and processing the pairing information in the visualized form.
  • the pairing information in a visual form includes but is not limited to any one of the following: two-dimensional code or barcode.
  • the Bluetooth device is notified by the second electronic device to enter the pairing mode, and the Bluetooth device provides pairing information to the first electronic device, and the pairing between the first electronic device and the Bluetooth device only relies on the second electronic device, and the number of devices involved Less, simple implementation.
  • this embodiment does not limit the execution sequence between S62-S63 and S64.
  • S62 is executed first, and the second electronic device notifies the Bluetooth device to enter the pairing mode, and then S64 is executed, and the first electronic device can obtain pairing information.
  • S64 is executed first, and the first electronic device may acquire pairing information, and then S62 is executed, and the second electronic device notifies the Bluetooth device to enter the pairing mode.
  • S62 and S64 may be executed simultaneously.
  • the first electronic device sends a pairing request to the Bluetooth device according to the Bluetooth address of the Bluetooth device.
  • the Bluetooth device receives the pairing request sent by the first electronic device.
  • the Bluetooth device sends a pairing response to the first electronic device.
  • the first electronic device receives the pairing response sent by the Bluetooth device.
  • the application environment of 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.
  • the Bluetooth device After the Bluetooth device establishes a Bluetooth connection with the second electronic device, the second electronic device sends notification information to the Bluetooth device, instructing the Bluetooth device to enter a pairing mode.
  • the first electronic device can obtain pairing information from the second electronic device or the Bluetooth device or other devices in the application environment, so that the first electronic device and the Bluetooth device can complete pairing according to the pairing information.
  • the Bluetooth pairing method provided in this embodiment notifies the Bluetooth device to enter the pairing mode by means of the second electronic device except the first electronic device and the Bluetooth device, which avoids that the user must operate the Bluetooth device to trigger the Bluetooth device to enter the pairing mode, Eliminates the inconvenience for the user to operate the Bluetooth device.
  • the first electronic device can obtain the Bluetooth address of the Bluetooth device without sending a query request to the Bluetooth device when the Bluetooth device is in the pairing mode, which simplifies the message flow of the pairing process and improves the The realization and convenience of completing the pairing process between the Bluetooth device that is not used for the first time and the first electronic device that has not been paired improves the user's experience of using the Bluetooth headset.
  • the pairing information may also include capability information of the Bluetooth device.
  • Acquiring the capability information of the Bluetooth device facilitates subsequent pairing between the first electronic device and the Bluetooth device, and improves the accuracy and adaptability of pairing between the first electronic device and the Bluetooth device.
  • the capability information may also indicate that the Bluetooth device supports the capability of entering the pairing mode by receiving notification information sent by the second electronic device.
  • this embodiment does not limit the order in which the first electronic device acquires the Bluetooth address and capability information of the Bluetooth device in S64.
  • the first electronic device may acquire the Bluetooth address and capability information of the Bluetooth device at the same time.
  • the pairing information in a visualized form is generated according to the Bluetooth address and capability information of the Bluetooth device.
  • the first electronic device may first obtain the Bluetooth address of the Bluetooth device, and then obtain the capability information of the Bluetooth device.
  • the first electronic device may first obtain the capability information of the Bluetooth device, and then obtain the Bluetooth address of the Bluetooth device.
  • the Bluetooth address and capability information may be carried in an interaction message, or They are respectively carried in different interaction messages.
  • the first electronic device sends a pairing request to the Bluetooth device according to the Bluetooth address of the Bluetooth device, which may include:
  • the first electronic device sends a pairing request to the Bluetooth device according to the Bluetooth address and capability information of the Bluetooth device.
  • the pairing between the first electronic device and the Bluetooth device is performed through the Bluetooth address and capability information of the Bluetooth device, which improves the accuracy and adaptability of the pairing between the first electronic device and the Bluetooth device.
  • the first electronic device acquires pairing information from the second electronic device or the Bluetooth device or the third electronic device in S64 is provided.
  • the pairing information includes the Bluetooth address and capability information of the Bluetooth device.
  • the first electronic device obtains the pairing information by scanning the pairing information displayed by the second electronic device in a visualized form.
  • the pairing information in a visualized form is QR code information.
  • the first electronic device acquires pairing information from the second electronic device, which may include:
  • the second electronic device generates two-dimensional code information according to the Bluetooth address and capability information of the Bluetooth device.
  • the second electronic device performs Bluetooth communication with the Bluetooth device, and stores the Bluetooth address and capability information of the Bluetooth device.
  • the second electronic device may generate two-dimensional code information according to the Bluetooth address and capability information of the Bluetooth device, so as to provide it to the first electronic device later.
  • existing algorithms may be used to generate the two-dimensional code information, which will not be described in detail in this embodiment.
  • S111 is executed after S61, but the execution sequence between S111 and S62-S63 is not limited.
  • S111 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 S111.
  • the user uses mobile phone 1 and mobile phone 2, and mobile phone 2 has successfully paired with the Bluetooth headset, but mobile phone 1 has never been paired with the Bluetooth headset.
  • the Bluetooth function of the mobile phone 2 can be turned on, and the mobile phone 2 establishes a Bluetooth connection with the Bluetooth headset, triggering the mobile phone 2 to generate two-dimensional code information according to the Bluetooth address and capability information of the Bluetooth headset.
  • 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.
  • the mobile phone 2 is currently running a system application program, and displays a Bluetooth main interface 70 in the system application program.
  • the paired device 71 in the Bluetooth main interface 70 it can be known that the mobile phone 2 has been connected with the mobile phone 1 and the Bluetooth headset.
  • the user can click on the Bluetooth headset in the paired device 71 to trigger the mobile phone 2 to generate two-dimensional code information according to the Bluetooth address and capability information of the Bluetooth headset.
  • the mobile phone 2 generates two-dimensional code information in response to the user's operation.
  • the Bluetooth main interface 70 includes prompt information for guiding the user to perform the second operation. For example, a prompt message "click on the Bluetooth headset to share the pairing information of the Bluetooth headset" may be displayed.
  • the second electronic device may display prompt information to the user.
  • the user clicks on the Bluetooth headset in the paired device 71 .
  • the mobile phone 2 pops up a pop-up window 74 in the Bluetooth main interface 70 in response to the user's operation.
  • the user operates by viewing the prompt information in the pop-up window 74 .
  • the prompt information includes: "display pairing information of the Bluetooth headset".
  • the pop-up window 74 also includes a cancel button and a confirm button.
  • the user can click the OK button to trigger the mobile phone 2 to generate two-dimensional code information according to the Bluetooth address and capability information of the Bluetooth headset.
  • the mobile phone 2 generates two-dimensional code information according to the Bluetooth address and capability information of the Bluetooth headset in response to the user's operation of clicking the OK button.
  • the user clicks on the Bluetooth headset in the paired device 71 .
  • the mobile phone 2 pops up a pop-up window 75 in the Bluetooth main interface 70 in response to the user's operation.
  • the user operates by viewing the prompt information in the pop-up window 75 .
  • the prompt information includes: "Share the pairing information of the Bluetooth headset”.
  • the pop-up window 75 includes multiple ways of sharing pairing information, for example, displaying a QR code, Bluetooth sharing, WiFi sharing and network sharing.
  • Bluetooth sharing refers to providing pairing information to mobile phone 1 through Bluetooth communication between mobile phone 2 and mobile phone 1
  • WiFi sharing refers to providing pairing information to mobile phone 1 through WiFi communication between mobile phone 2 and mobile phone 1
  • network sharing refers to Pairing information is provided to mobile phone 1 through cellular communication between mobile phone 2 and mobile phone 1.
  • the pop-up window 75 also includes a cancel button and a confirm button, which are used to cancel the sharing of the pairing information and confirm the sharing of the pairing information.
  • the user can click the selection control 76 displaying the two-dimensional code mode to select the two-dimensional code sharing mode. As shown in FIG.
  • the display state of the selection control 76 changes, and the user continues to click the OK button, triggering the mobile phone 2 to generate two-dimensional code information according to the Bluetooth address and capability information of the Bluetooth headset.
  • the mobile phone 2 generates two-dimensional code information according to the Bluetooth address and capability information of the Bluetooth headset in response to the user's operation.
  • the second operation and the first operation may be the same operation.
  • the user clicks on the Bluetooth headset in the paired device 71 in the Bluetooth main interface 70, and triggers the mobile phone 2 to generate two-dimensional code information according to the Bluetooth address and capability information of the Bluetooth headset.
  • the Bluetooth headset sends a notification message.
  • FIG. 7A the user clicks on the Bluetooth headset in the paired device 71 in the Bluetooth main interface 70, and triggers the mobile phone 2 to generate two-dimensional code information according to the Bluetooth address and capability information of the Bluetooth headset.
  • the OK button 73 in the pop-up window 72 to trigger the mobile phone 2 to send notification information to the Bluetooth headset, and at the same time, trigger the mobile phone 2 to generate two-dimensional code information according to the Bluetooth address and capability information of the Bluetooth headset.
  • the headset sends a notification message.
  • S111 is executed after S62, and after the second electronic device sends notification information to the Bluetooth device in S62, the second electronic device is triggered to execute S111.
  • 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.
  • FIGS. 7A to 7E are only examples, and do not limit the second operation of the user on the second electronic device.
  • the user's second operation may be any of the following: a touch operation performed by the user on the relevant interface displayed by the second electronic device, a gesture operation performed by the user on the display screen of the second electronic device, An operation performed by a physical button on the second electronic device, a user inputs voice through a microphone of the second electronic device, or a user inputs an image through a camera of the second electronic device.
  • the second electronic device may be installed with an APP for managing the Bluetooth device.
  • the name and function of the APP are not limited, and the content and layout of the relevant interface of the APP are not limited.
  • the second electronic device displays the two-dimensional code information.
  • this embodiment does not limit the interface and interface layout of the second electronic device for displaying the two-dimensional code information.
  • the mobile phone 2 is currently running a system application program, and displays the Bluetooth main interface 70 in the system application program.
  • the Bluetooth main interface 70 includes a two-dimensional code interface 77 .
  • the two-dimensional code interface 77 includes two-dimensional code information and prompt information.
  • the two-dimensional code information is generated by the mobile phone 2 according to the Bluetooth address and capability information of the Bluetooth headset.
  • the prompt information includes: "Please scan the QR code”. The user operates by viewing the prompt information in the two-dimensional code interface 77, for example, using the mobile phone 1 to scan the two-dimensional code information, so that the mobile phone 1 can obtain the pairing information of the Bluetooth headset.
  • Fig. 8C shows the mobile phone 2 running the system application program, and displays the bluetooth main interface 70 in the system application program; while in Fig. 8C, the mobile phone 2 runs the third-party application program, and the third-party application program It is used to manage other devices communicating with the mobile phone 2.
  • the mobile phone 2 currently displays the “My Device” interface 80 in the third-party application program, and the interface 80 includes a two-dimensional code interface 82 .
  • the two-dimensional code interface 82 refer to the two-dimensional code interface 77 in FIG. 7F , the principle is similar and will not be repeated here.
  • the first electronic device scans the two-dimensional code information displayed by the second electronic device.
  • this embodiment does not limit the process of running the scanning function on the first electronic device.
  • the first electronic device may run an APP with the scanning function, and activate the scanning function through human-computer interaction with the user.
  • the first electronic device parses the two-dimensional code information to obtain the Bluetooth address and capability information of the Bluetooth device.
  • 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 perform Bluetooth communication, the Bluetooth address and capability information of the Bluetooth device is stored in the second electronic device, which does not need to be obtained through an additional method.
  • the second electronic device generates and displays pairing information in a visualized form according to the pairing information of the Bluetooth device.
  • the first electronic device does not need to communicate with the second electronic device, and can obtain pairing information in a visualized form by scanning or taking pictures, and then obtain the pairing information.
  • the first electronic device obtains pairing information from the second electronic device, the number of devices involved is small, the processing steps are few, and the implementation is simple.
  • the flow of the Bluetooth pairing method provided in this embodiment is exemplarily described with reference to FIG. 12 .
  • the Bluetooth pairing method provided in this embodiment may include:
  • the mobile phone 2 establishes a Bluetooth connection with the Bluetooth headset.
  • the mobile phone 2 acquires the Bluetooth address and capability information of the Bluetooth headset, generates a QR code according to the Bluetooth address and capability information of the Bluetooth headset, and displays the QR code.
  • the mobile phone 2 sends notification information to the Bluetooth headset, and the notification information is used to instruct the Bluetooth headset to enter the pairing mode.
  • the Bluetooth headset receives the notification information sent by the mobile phone 2, and enters the pairing mode according to the notification information.
  • Mobile phone 1 starts the scanning function, and scans the QR code displayed on mobile phone 2.
  • the mobile phone 1 parses the scanned QR code to obtain the Bluetooth address and capability information of the Bluetooth headset.
  • the mobile phone 1 sends a pairing request to the Bluetooth headset according to the Bluetooth address and capability information of the Bluetooth headset, and initiates pairing.
  • the Bluetooth headset After receiving the pairing request sent by mobile phone 1, the Bluetooth headset sends a pairing response to the mobile phone.
  • the first electronic device acquires pairing information from the second electronic device through a communication connection with the second electronic device.
  • the first electronic device acquires pairing information from the second electronic device, which may include:
  • the second electronic device establishes a communication connection with the first electronic device.
  • the communication connection includes any one of the following: Bluetooth connection, WiFi connection or cellular communication connection.
  • the time for establishing a communication connection between the second electronic device and the first electronic device is not limited, and the execution sequence between S131 and S62-S63 is not limited.
  • the second electronic device and the first electronic device have not currently established a communication connection.
  • the Bluetooth device establishes a Bluetooth connection with the second electronic device in S61
  • the second electronic device and the first electronic device The device establishes a communication connection.
  • S131 may be performed before S62, may be performed after S62, or may be performed simultaneously with S62.
  • S131 is performed 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 applicable to a scenario where only the first electronic device, the second electronic device and the Bluetooth device exist in the environment.
  • the user uses mobile phone 1 and mobile phone 2, and mobile phone 2 has successfully paired with the Bluetooth headset, but mobile phone 1 has never been paired with the Bluetooth headset.
  • the Bluetooth headset is powered on, and the user turns on the Bluetooth functions of the mobile phone 1 and the mobile phone 2. In this way, the mobile phone 2 can search for the mobile phone 1 through the Bluetooth technology.
  • the mobile phone 2 After the mobile phone 2 establishes a Bluetooth connection with the Bluetooth headset, it can trigger the mobile phone 2 to establish a communication connection with the mobile phone 1, so as to send pairing information of the Bluetooth device to the mobile phone 1 subsequently.
  • the mobile phone 1, the mobile phone 2 and the Bluetooth headset can log in to the same user account.
  • S131 is performed before S62, and the second electronic device is triggered to perform S131 by the user performing a third operation on the second electronic device.
  • the third operation performed by the user on the second electronic device is not limited, and may be any operation for sharing files or information between devices.
  • the third operation is an operation in which the user transmits a file to the mobile phone 1 on the mobile phone 2 via Bluetooth.
  • the third operation is an operation in which the user uses a chat app on the mobile phone 2 to send information to the mobile phone 1 through the mobile network.
  • the user's third operation may be any of the following: a touch operation performed by the user on a relevant interface displayed on the second electronic device, a gesture operation performed by the user on the display screen of the second electronic device, The user operates the physical keys on the second electronic device, the user inputs voice through the microphone of the second electronic device, or the user inputs images through the camera of the second electronic device.
  • the second electronic device may be installed with an APP for managing the Bluetooth device. This embodiment does not limit the name and function of the APP, and does not limit the content and layout of the relevant interface of the APP.
  • the relevant interface of the second electronic device may include prompt information for guiding the user to perform the third operation, and the content of the prompt information is not limited in this embodiment.
  • the mobile phone 2 runs a third-party application program, and the third-party application program is used to manage other devices communicating with the mobile phone 2, and the mobile phone 2 currently displays the "my device" interface 80 in the third-party application program .
  • the interface 80 includes the mobile phone 1, and the mobile phone 1 is not connected to the mobile phone 2 currently.
  • the user can click on the mobile phone 1 to trigger the mobile phone 2 to establish a communication connection with the mobile phone 1, so that the subsequent mobile phone 2 can send the Bluetooth device pairing information to the mobile phone 1.
  • the mobile phone 2 establishes a communication connection with the mobile phone 1 in response to the user's operation. This scenario is applicable when the user knows that the pairing information of the Bluetooth headset needs to be shared with the mobile phone 1 .
  • the second electronic device may display prompt information to the user.
  • the user clicks on the mobile phone 1 .
  • the mobile phone 2 pops up a pop-up window 83 on the interface 80 in response to the user's operation.
  • the pop-up window 83 refer to the description of the pop-up frame 75 in FIG. 7E , the principle is similar, and will not be repeated here.
  • the user can click the selection control 84 for WiFi sharing, so that the mobile phone 2 can send pairing information to the mobile phone 1 through the WiFi communication between the mobile phone 2 and the mobile phone 1 .
  • the selection control 84 for WiFi sharing
  • the display state of the selection control 84 changes, and the user continues to click the OK button, which triggers the mobile phone 2 to establish a WiFi connection with the mobile phone 1 .
  • the mobile phone 2 establishes a WiFi connection with the mobile phone 1 in response to the user's operation.
  • S131 is performed after S62, and after the second electronic device sends notification information to the Bluetooth device in S62, the second electronic device is triggered to perform S131.
  • This implementation is applicable to a scenario where only the first electronic device, the second electronic device and the Bluetooth device exist in the environment.
  • S131 is performed after S62, and the second electronic device is triggered to perform S131 by the user performing a third operation on the second electronic device.
  • an interface change process is as follows: as shown in FIG. 8A , the user clicks the button 85 to trigger the mobile phone 2 to send notification information to the Bluetooth headset, and at the same time, trigger the mobile phone 2 to share the pairing information.
  • the mobile phone 2 responds to the user's operation of clicking the button 85 , as shown in FIG. 8D , a pop-up window 83 pops up on the interface 80 .
  • the user can click the selection control 84 for WiFi sharing, so that the mobile phone 2 can share the pairing information through WiFi communication.
  • the display state of the selection control 84 changes, and the user continues to click the OK button.
  • the mobile phone 2 searches for surrounding devices that can perform WiFi communication in response to the operation of the user clicking the OK button, and displays a WiFi device list 86.
  • the devices that the mobile phone 2 can perform WiFi communication include mobile phone 1 , mobile phone 3 and mobile phone 4 .
  • Each handset has selection controls 87 on the right side. The user can click the selection control 87 on the right side of the mobile phone 1, and then click the sharing button 88 to trigger the mobile phone 2 and the mobile phone 1 to establish a WiFi connection.
  • the mobile phone 2 establishes a WiFi connection with the mobile phone 1 in response to the user's operation.
  • the mobile phone 2 can search for and display the surrounding communicable devices and display a device list to the user, so that the user can select a device to share the pairing information of the Bluetooth headset, which is convenient for the user to operate.
  • the second electronic device when the Bluetooth device needs to be paired with the first electronic device, the second electronic device has established a communication connection with the first electronic device. For example, when the user needs to pair the mobile phone 1 with the Bluetooth headset, the mobile phone 1 and the mobile phone 2 have already transmitted audio files through the Bluetooth connection.
  • the second electronic device generates shared information according to the Bluetooth address and capability information of the Bluetooth device.
  • the second electronic device performs Bluetooth communication with the Bluetooth device, and stores the Bluetooth address and capability information of the Bluetooth device.
  • the second electronic device generates shared information according to the Bluetooth address and capability information of the Bluetooth device.
  • shared information can be in any of the following forms: text format, file format, or image.
  • the second electronic device may encrypt the Bluetooth address and capability information of the Bluetooth device to generate shared information.
  • This embodiment does not limit the encryption algorithm.
  • the second electronic device sends the sharing information to the first electronic device through the communication connection.
  • the first electronic device receives the sharing information sent by the second electronic device through the communication connection.
  • the first electronic device parses the shared information to obtain the Bluetooth address and capability information of the Bluetooth device.
  • the first electronic device may 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.
  • the first electronic device after receiving the shared information, automatically parses the shared information to obtain the Bluetooth address and capability information of the Bluetooth device. This method is simple to implement.
  • the first electronic device after receiving the shared information, requires the user to operate the second electronic device, so that the second electronic device parses the shared information in response to the user's operation.
  • the first electronic device stores the shared information in a default folder after receiving it. Users can open the default folder and click Share Information.
  • the second electronic device analyzes the shared information in response to the user's click operation. This method is more flexible, and improves the accuracy and security of the second electronic device in parsing the shared information.
  • 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 perform Bluetooth communication, the Bluetooth address and capability information of the Bluetooth device is stored in the second electronic device, which does not need to be obtained through an additional method.
  • the second electronic device provides pairing information to the first electronic device through a communication connection with the first electronic device.
  • the first electronic device obtains pairing information from the second electronic device, the number of devices involved is small, and the implementation method is simple.
  • the flow of the Bluetooth pairing method provided in this embodiment is exemplarily described with reference to FIG. 14 .
  • the Bluetooth pairing method provided in this embodiment may include:
  • the mobile phone 2 establishes a Bluetooth connection with the Bluetooth headset.
  • the mobile phone 2 sends notification information to the Bluetooth headset, and the notification information is used to instruct the Bluetooth headset to enter the pairing mode.
  • the mobile phone 2 generates shared information according to the Bluetooth address and capability information of the Bluetooth headset.
  • the mobile phone 2 sends the shared information to the mobile phone 1 through the communication connection with the mobile phone 1 .
  • the Bluetooth headset receives the notification information sent by the mobile phone 2, and enters the pairing mode according to the notification information.
  • the mobile phone 1 receives the shared information sent by the mobile phone 2, analyzes the shared information, and obtains the Bluetooth address and capability information of the Bluetooth headset.
  • the mobile phone 1 sends a pairing request to the Bluetooth headset according to the Bluetooth address and capability information of the Bluetooth headset, and initiates pairing.
  • the Bluetooth headset After receiving the pairing request sent by the mobile phone 1, the Bluetooth headset sends a pairing response to the mobile phone.
  • the third electronic device is used as an external display device of the Bluetooth device.
  • the first electronic device may acquire pairing information by scanning the pairing information displayed by the third electronic device in a visual form, S64 is executed after S62.
  • the pairing information in a visualized form is QR code information.
  • the first electronic device acquires pairing information from the third electronic device, which may include:
  • the Bluetooth device generates two-dimensional code information according to the Bluetooth address and capability information of the Bluetooth device.
  • the bluetooth device sends the two-dimensional code information to the third electronic device, and correspondingly, the third electronic device receives the two-dimensional code information sent by the bluetooth device.
  • the third electronic device displays the two-dimensional code information.
  • this embodiment does not limit the interface and interface layout of the third electronic device for displaying the two-dimensional code information.
  • the first electronic device scans the two-dimensional code information displayed by the third electronic device.
  • this embodiment does not limit the process of running the scanning function on the first electronic device.
  • the first electronic device may run an APP with the scanning function, and activate the scanning function through human-computer interaction with the user.
  • the first electronic device parses the two-dimensional code information to obtain the Bluetooth address and capability information of the Bluetooth device.
  • 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 the pairing mode.
  • the bluetooth device can generate pairing information in a visual form according to the bluetooth address and capability information of the bluetooth device, and display it through the third electronic device. Since the pairing information is determined to be provided by the Bluetooth device, the security of obtaining the pairing information by the first electronic device is improved.
  • the first electronic device does not need to communicate with the third electronic device, and can obtain pairing information in a visualized form by scanning or taking pictures, and then obtain the pairing information.
  • the Bluetooth pairing method provided in this embodiment improves the security of the pairing information obtained by the first electronic device, and the implementation method is more flexible.
  • the Bluetooth device as a Bluetooth headset
  • the first electronic device as a mobile phone 1
  • the second electronic device as a mobile phone 2
  • the third electronic device as a display 3
  • the flow of the Bluetooth pairing method provided in this embodiment is described in conjunction with FIG. 16 Give an example.
  • the Bluetooth pairing method provided in this embodiment may include:
  • the mobile phone 2 establishes a Bluetooth connection with the Bluetooth headset.
  • the mobile phone 2 sends notification information to the Bluetooth headset, and the notification information is used to instruct the Bluetooth headset to enter the pairing mode.
  • the Bluetooth headset receives the notification information sent by the mobile phone 2, enters the pairing mode according to the notification information, and generates a QR code according to the Bluetooth address and capability information of the Bluetooth headset.
  • the Bluetooth headset sends a QR code to the display 3 .
  • the display 3 receives the two-dimensional code sent by the Bluetooth headset, and displays the two-dimensional code.
  • the mobile phone 1 activates the scanning function, and scans the QR code displayed on the display 3 .
  • the mobile phone 1 parses the scanned QR code to obtain the Bluetooth address and capability information of the Bluetooth headset.
  • the mobile phone 1 sends a pairing request to the Bluetooth headset according to the Bluetooth address and capability information of the Bluetooth headset, and initiates pairing.
  • the Bluetooth headset After receiving the pairing request sent by the mobile phone 1, the Bluetooth headset sends a pairing response to the mobile phone.
  • the Bluetooth device itself may have a display screen.
  • the first electronic device may obtain pairing information by scanning the pairing information in visual form displayed by the Bluetooth device. S64 is performed after S62.
  • the pairing information in a visualized form is QR code information.
  • the first electronic device acquires pairing information from the Bluetooth device, which may include:
  • the Bluetooth device generates two-dimensional code information according to the Bluetooth address and capability information of the Bluetooth device.
  • the Bluetooth device displays the two-dimensional code information.
  • this embodiment does not limit the interface and interface layout of the bluetooth device displaying the two-dimensional code information.
  • the first electronic device scans the two-dimensional code information displayed by the Bluetooth device.
  • this embodiment does not limit the process of running the scanning function on the first electronic device.
  • the first electronic device may run an APP with the scanning function, and activate the scanning function through human-computer interaction with the user.
  • the first electronic device parses the two-dimensional code information to obtain the Bluetooth address and capability information of the Bluetooth device.
  • the first electronic device acquires pairing information of the Bluetooth device from the Bluetooth device. After receiving the notification information sent by the second electronic device, the Bluetooth device determines that it needs to enter the pairing mode.
  • the Bluetooth device can generate and display pairing information in a visualized form according to the Bluetooth address and capability information of the Bluetooth device. Since the pairing information is determined to be provided by the Bluetooth device, the security of obtaining the pairing information by the first electronic device is improved.
  • the first electronic device does not need to communicate with the Bluetooth device, and can obtain pairing information in a visualized form by scanning or taking pictures, and then obtain the pairing information.
  • the Bluetooth pairing method provided in this embodiment improves the security of the pairing information obtained by the first electronic device, and the implementation method is more flexible.
  • the first electronic device, the second electronic device, the bluetooth device and the third electronic device include corresponding hardware and/or software modules for performing respective functions.
  • the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed by hardware or computer software drives hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions in combination with the embodiments for each specific application, but such implementation should not be regarded as exceeding the scope of the present application.
  • the embodiment of the present application can divide the functional modules of the first electronic device, the second electronic device, the Bluetooth device and the third electronic device according to the above method example, for example, each functional module can be divided corresponding to each function, or two or More than two functions are integrated in one module.
  • each functional module can be divided corresponding to each function, or two or More than two functions are integrated in one module.
  • the division of modules in the embodiment of the present application is schematic, and is only a logical function division, and there may be other division methods in actual implementation.
  • the names of the modules in the embodiments of the present application are illustrative, and the names of the modules are not limited during actual implementation.
  • FIG. 18 is a schematic structural diagram of a device provided in an embodiment of the present application, and the device may be the first electronic device, the second electronic device, the Bluetooth device, and the third electronic device in the embodiment of the present application.
  • the device may include: a receiving module 1801 , a processing module 1802 and a sending module 1803 .
  • the device shown in FIG. 18 is a second electronic device, configured to perform operations of the second electronic device in the foregoing method embodiments, and the technical principles and technical effects are similar.
  • the second electronic device has been paired with the Bluetooth device, and the second electronic device includes:
  • a processing module 1802 configured to establish a Bluetooth connection with the Bluetooth device
  • the sending module 1803 is configured to send notification information to the Bluetooth device, where the notification information is used to instruct the Bluetooth device to enter a pairing mode.
  • the processing module 1802 is further configured to: receive a user's first operation;
  • the sending module 1803 is further configured to send the notification information to the Bluetooth device in response to the first operation.
  • a receiving module 1801 is also included;
  • the sending module 1803 is configured to send an L2CAP_ECHO_REQ message to the Bluetooth device, where the L2CAP_ECHO_REQ message includes the notification information;
  • the receiving module 1801 is configured to receive the L2CAP_ECHO_RSP message sent by the Bluetooth device.
  • processing module 1802 is also used for:
  • the pairing information including the Bluetooth address of the Bluetooth device
  • the processing module 1802 is further configured to: before generating the two-dimensional code information according to the pairing information, receive a second user operation.
  • the processing module 1802 is further configured to: establish a communication connection with a first electronic device, and the first electronic device is not paired with the Bluetooth device;
  • the sending module 1803 is further configured to send pairing information to the Bluetooth device through the communication connection, where the pairing information includes the Bluetooth address of the Bluetooth device.
  • the processing module 1802 is further configured to: receive a third user operation before establishing a communication connection with the first electronic device.
  • the communication connection includes any one of the following: Bluetooth connection, WiFi connection or cellular communication connection.
  • processing module 1802 is further configured to generate shared information according to the pairing information
  • the sending module 1803 is configured to send the sharing information to the Bluetooth device through the communication connection.
  • the pairing information also includes capability information of the Bluetooth device.
  • the device shown in FIG. 18 is a Bluetooth device, configured to perform the operations of the Bluetooth device in the foregoing method embodiments, and the technical principles and technical effects are similar.
  • the Bluetooth device is not paired with the first electronic device, and the Bluetooth device is paired with the second electronic device, and the Bluetooth device includes:
  • a processing module 1802 configured to establish a Bluetooth connection with the second electronic device
  • a receiving module 1801 configured to receive notification information sent by the second electronic device, where the notification information is used to instruct the Bluetooth device to enter a pairing mode;
  • the processing module 1802 is further configured to enter a pairing mode according to the notification information
  • the receiving module 1801 is further configured to receive the pairing request sent by the first electronic device.
  • a sending module 1803 is also included;
  • the receiving module 1801 is configured to receive the L2CAP_ECHO_REQ message sent by the second electronic device, where the L2CAP_ECHO_REQ message includes the notification information;
  • the sending module 1803 is configured to send an L2CAP_ECHO_RSP message to the second electronic device.
  • a sending module 1803 is also included;
  • the processing module 1802 is further configured to generate two-dimensional code information according to the pairing information after entering the pairing mode according to the notification information, and the pairing information includes the Bluetooth address of the Bluetooth device;
  • the sending module 1803 is configured to send the two-dimensional code information to a third electronic device.
  • processing module 1802 is also used for:
  • the pairing information After entering the pairing mode according to the notification information, generate two-dimensional code information according to the pairing information, the pairing information including the Bluetooth address of the Bluetooth device;
  • the pairing information also includes capability information of the Bluetooth device.
  • the device shown in FIG. 18 is a first electronic device, configured to perform operations of the first electronic device in the foregoing method embodiments, and the technical principles and technical effects are similar.
  • the first electronic device is not paired with the Bluetooth device, and the Bluetooth device is paired with the second electronic device, and the first electronic device includes:
  • a processing module 1802 configured to acquire pairing information from the second electronic device or the Bluetooth device or a third electronic device, the pairing information includes the Bluetooth address of the Bluetooth device; the third electronic device and the Bluetooth device communication;
  • the sending module 1803 is configured to send a pairing request to the Bluetooth device according to the Bluetooth address of the Bluetooth device.
  • the pairing information also includes capability information of the Bluetooth device.
  • processing module 1802 is specifically configured to:
  • the two-dimensional code information is generated by the second electronic device according to the pairing information
  • processing module 1802 is used for:
  • the pairing information is acquired from the second electronic device through the communication connection.
  • a receiving module 1801 is also included;
  • the receiving module 1801 is configured to receive sharing information sent by the second electronic device; the sharing information is generated by the second electronic device according to the pairing information;
  • the processing module 1802 is configured to parse the shared information to obtain the pairing information.
  • the communication connection includes any one of the following: Bluetooth connection, WiFi connection or cellular communication connection.
  • processing module 1802 is used for:
  • the two-dimensional code information is generated by the Bluetooth device according to the pairing information
  • the device shown in FIG. 18 is a third electronic device, configured to perform operations of the third electronic device in the foregoing method embodiments, and the technical principles and technical effects are similar.
  • the third electronic device communicates with the Bluetooth device, and the third electronic device includes:
  • the receiving module 1801 is configured to receive the two-dimensional code information sent by the Bluetooth device, the two-dimensional code information is generated by the Bluetooth device according to the pairing information, and the pairing information includes the Bluetooth address of the Bluetooth device;
  • the processing module 1802 is configured to display two-dimensional code information.
  • the pairing information also includes capability information of the Bluetooth device.
  • FIG. 19 shows a structure of a device provided by an embodiment of the present application.
  • the device may 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, and the processor 1901 executes applications of various functions and information processing by running software programs and modules.
  • the receiver 1902 and the transmitter 1903 can be realized as a communication component, and the communication component can be a baseband chip.
  • the memory 1904 is connected to the processor 1901 through a bus 1905 .
  • the memory 1904 may be used to store at least one program instruction, and the processor 1901 may be used to execute the at least one program instruction, so as to implement the technical solutions of the foregoing embodiments. Its implementation principle and technical effect are similar to those of the related embodiments of the method above, and will not be repeated here.
  • the processor can read the software program in the memory, interpret and execute the instructions of the software program, and process the data of the software program.
  • the processor performs baseband processing on the data to be sent, and then outputs the baseband signal to the control circuit in the control circuit. send.
  • the control circuit receives the radio frequency signal through the antenna, converts the radio frequency signal into a baseband signal, and outputs the baseband signal to the processor, and the processor converts the baseband signal into data and processes the data.
  • FIG. 19 only shows a memory and a processor. In an actual device, there may be multiple processors and memories.
  • a storage may also be called a storage medium or a storage device, etc., which is not limited in this embodiment of the present application.
  • the processor may include a baseband processor and a central processing unit, the baseband processor is mainly used for processing communication data, and the central processing unit is mainly used for executing software programs and processing data of the software programs.
  • the baseband processor and the central processing unit may be integrated into one processor, or may be independent processors interconnected through technologies such as a bus.
  • the device may include multiple baseband processors to adapt to different network standards, the device may include multiple central processors to enhance its processing capability, and various components of the device may be connected through various buses.
  • the baseband processor may also be expressed as a baseband processing circuit or a baseband processing chip.
  • the central processing unit may also be expressed as a central processing circuit or a central processing chip.
  • the function of processing the communication protocol and communication data can be built in the processor, or can be stored in the memory in the form of a software program, and the processor executes the software program to realize the baseband processing function.
  • the memory can be integrated in the processor, or it can be independent from the processor.
  • the memory includes a high-speed cache, which can store frequently accessed data/instructions.
  • the processor may be a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, and may implement or Execute the methods, steps and logic block diagrams disclosed in the embodiments of the present application.
  • a general purpose processor may be a microprocessor or any conventional processor or the like. The steps of the methods disclosed in connection with the embodiments of the present application may be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules in the processor.
  • the memory may be a non-volatile memory, such as a hard disk (hard disk drive, HDD) or a solid-state drive (solid-state drive, SS), etc., or a volatile memory (volatile memory), such as Random-access memory (RAM).
  • a memory is, without limitation, any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer.
  • the memory in the embodiment of the present application may also be a circuit or any other device capable of implementing a storage function, and is used for storing program instructions and/or data.
  • the methods provided in the various embodiments of the present application may be fully or partially implemented by software, hardware, firmware or any combination thereof. When implemented using software, it may be implemented in whole or in part 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 the computer, the processes or functions according to the embodiments of the present application will be generated in whole or in part.
  • the computer may be a general purpose computer, a special purpose computer, a computer network, network equipment, user equipment or other programmable devices.
  • the computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website, computer, server or data center Transmission to another website site, computer, server, or data center by wired (such as coaxial cable, optical fiber, digital subscriber line (DSL) or wireless (such as infrared, wireless, microwave, etc.).
  • the readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that includes one or more available media integrated.
  • the available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape, etc.) ), optical media (for example, digital video disc (DWD), or semiconductor media (for example, SSD), etc.
  • FIG. 20 is another schematic structural diagram of a device provided in an embodiment of the present application, and the device may be a Bluetooth device, for example, 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 supply module 105, an input/output interface 106, and the like.
  • the processor may include one or more interfaces for connecting with other components of the Bluetooth headset.
  • the Bluetooth headset is stored through the headset box. The components of the Bluetooth headset will be specifically introduced below in conjunction with FIG. 20 .
  • the memory 102 can be used to store program codes, such as for the physical connection between the Bluetooth headset and multiple electronic devices, as well as the service specification connection between the electronic devices, and the processing of audio services of the electronic devices (such as music playing, receiving, etc.). / phone calls, etc.), and the program codes for charging the Bluetooth headset, wireless pairing and connection between the Bluetooth headset and other electronic devices, etc.
  • the memory 102 can also be used to store other information, such as the priority of the electronic device.
  • the processor 101 may be configured to execute the above application codes, and call related modules to realize the functions of the Bluetooth headset in the embodiment of the present application. For example, realize the physical connection between the Bluetooth headset and multiple electronic devices, business standard connection, audio playback, answering/calling and other functions.
  • the processor 101 may include one or more processing units, and different processing units may be independent devices, or may be integrated in one or more processors 101 .
  • the processor 101 may be an integrated control chip, or may be composed of a circuit including various active and/or passive components, and the circuit is configured to execute the functions belonging to the processor 101 described in the embodiments of this application.
  • the wireless communication module 103 can be used to support the data exchange between the Bluetooth headset and other electronic devices or earphone boxes through wireless communication technology, such as BT, WLAN (such as Wi-Fi), Zigbee, FM, NFC, IR , or general 2.4G/5G wireless communication technology, etc.
  • wireless communication technology such as BT, WLAN (such as Wi-Fi), Zigbee, FM, NFC, IR , or general 2.4G/5G wireless communication technology, etc.
  • the wireless communication module 103 may be a Bluetooth chip.
  • the bluetooth earphone can be paired with the bluetooth chip of other electronic devices and establish a wireless connection through the bluetooth chip, so as to realize wireless communication and business processing between the bluetooth earphone and other electronic devices through the wireless connection.
  • the Bluetooth chip can support basic rate (basic rate, BR)/enhanced data rate (enhanced data rate, EDR) Bluetooth and BLE, for example, it can receive/send paging (page) information, receive/send BLE broadcast messages, etc.
  • the wireless communication module 103 may further include an antenna.
  • the wireless communication module 103 receives electromagnetic waves via the antenna, frequency-modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 101 .
  • the wireless communication module 103 can also receive the signal to be sent from the processor 101, frequency-modulate it, amplify it, and convert it into electromagnetic wave and radiate it through the antenna.
  • the audio module 104 can be used to manage audio data, and realize input and output audio streams of Bluetooth earphones.
  • the audio module 104 can obtain the audio stream from the wireless communication module 103, or transfer the audio stream to the wireless communication module 103, so as to realize making and receiving calls, playing music, starting/closing the voice assistant of the electronic device connected to the earphone, receiving /Send the user's voice data and other functions.
  • the audio module 104 may include a speaker (or earpiece, receiver) assembly for outputting audio streams, a microphone (or microphone, microphone), a microphone receiving circuit matched with the microphone, and the like. Loudspeakers can be used to convert audio electrical signals into sound signals and play them back. Microphones can be used to convert sound signals into audio electrical signals.
  • the power supply module 105 can be used to provide the system power supply of the Bluetooth headset, supply power for each module of the Bluetooth headset; support the Bluetooth headset to receive charging input, etc.
  • the power module 105 may include a power management unit (power management unit, PMU) and a battery.
  • the power management unit can receive an external charging input; transform the electrical signal input from the charging circuit and supply it to the battery for charging; it can also transform the electrical signal provided by the battery and provide it to the audio module 104, the wireless communication module 103, etc. modules; and to prevent battery overcharge, overdischarge, short circuit or overcurrent, etc.
  • the power module 105 may also include a wireless charging coil for wirelessly charging the Bluetooth headset.
  • the power management unit can also be used to monitor parameters such as battery capacity, battery cycle times, and battery health status (leakage, impedance).
  • Multiple input/output interfaces 106 can be used to provide a wired connection for charging or communication between the Bluetooth headset and the headset box.
  • the input/output interface may be a USB interface.
  • the input/output interface 106 can be an earphone electrical connector.
  • the Bluetooth earphone When the Bluetooth earphone is placed in the earphone box, the Bluetooth earphone can establish an electrical connection with the electrical connector in the earphone box through the earphone electrical connector, thereby Charge the battery in the Bluetooth headset.
  • the Bluetooth earphone can also perform data communication with the earphone box, for example, can receive a pairing instruction from the earphone box.
  • the Bluetooth headset may further include a sensor 107 .
  • the sensor 107 can be a distance sensor or a proximity light sensor, which can be used to determine whether the Bluetooth headset is worn by the user.
  • the Bluetooth headset can use a distance sensor to detect whether there is an object near the Bluetooth headset, so as to determine whether the Bluetooth headset is worn by the user. When it is determined that the Bluetooth headset is worn, the Bluetooth headset can turn on the speaker.
  • the sensor 107 may also include a bone conduction sensor, combined into a bone conduction earphone.
  • the Bluetooth headset can obtain the vibration signal of the vibrating bone of the human voice, analyze the voice signal, realize the voice function, and receive the user's voice command.
  • the Bluetooth headset can also perform voice authentication based on the user's voice signal obtained by the bone conduction headset, so as to authenticate the user's identity in business scenarios such as payment transactions.
  • the sensor 107 may also include: a touch sensor, used to detect the user's touch operation; a fingerprint sensor, used to detect the user's fingerprint, identify the user's identity, etc.; Adjust some parameters (such as volume); and possibly other sensors.
  • a touch sensor used to detect the user's touch operation
  • a fingerprint sensor used to detect the user's fingerprint, identify the user's identity, etc.
  • Adjust some parameters such as volume
  • the touch sensor can detect the user's touch operations such as single click, double click, multiple clicks, long press, heavy pressure, etc., and can also perform user fingerprint recognition to authenticate the user's identity in business scenarios such as payment transactions. right.
  • the structure shown in the embodiment of the present application does not constitute a specific limitation on the Bluetooth headset. It may have more or fewer components than shown in FIG. 20, may combine two or more components, or may have a different configuration of components.
  • the outer surface of the bluetooth headset can also include buttons 108, indicator lights (which can indicate the status of battery power, incoming/outgoing calls, pairing mode, etc.), display screens (which can prompt users for relevant information), dust-proof nets (which can be used with earpieces) ) and other components.
  • the button 108 may be a physical button or a touch button (used in conjunction with a touch sensor), etc., and is used to trigger operations such as power on, power off, pause, play, record, start pairing, and reset.
  • the bluetooth earphone is usually stored in an earphone box. There may be one or more magnets inside the earphone box to attract the earphone body into the cavity in the earphone box.
  • the headset box may include a battery and multiple input/output interfaces.
  • the input/output interface may be a box electrical connector.
  • At least one touch control can be provided on the earphone box, which can be used to trigger functions such as pairing and resetting of the Bluetooth earphone or charging of the Bluetooth earphone.
  • the earphone box can also be provided with one or more power indicator lights, to remind the user of the power level of the battery in the earphone box, and the power level of the battery in each earphone body in the earphone box.
  • An embodiment of the present application provides a computer program product, which, when running on a device, enables the device to execute the technical solution in the above embodiment, and its realization principle and technical effect are similar to those of the above related embodiments, here No longer.
  • the device may be a first electronic device, a second electronic device, a third electronic device or a Bluetooth device.
  • An embodiment of the present application provides a computer-readable storage medium, on which program instructions are stored, and when the program instructions are executed by a device, the device executes the technical solutions of the foregoing embodiments. Its implementation principle and technical effect are similar to those of the above-mentioned related embodiments, 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.

Abstract

Embodiments of the present application relate to the technical field of communications, and provide a Bluetooth pairing method, a device, a system, and a storage medium. In a communication system composed of a first electronic device, a second electronic device, and a Bluetooth device, the Bluetooth device has not been paired with the first electronic device, but has been paired with the second electronic device. The Bluetooth pairing method comprises: a second electronic device establishes a Bluetooth connection with a Bluetooth device, and sends notification information to the Bluetooth device; the Bluetooth device enters a pairing mode according to the notification information; and a first electronic device obtains the Bluetooth address of the Bluetooth device from the second electronic device or the Bluetooth device or a third electronic device, and sends a pairing request to the Bluetooth device. The second electronic device instructs the Bluetooth device to enter the pairing mode, such that a user does not necessarily have to operate the Bluetooth device to cause the Bluetooth device to enter the pairing mode. In addition, the first electronic device can initiate a pairing process according to the obtained Bluetooth address of the Bluetooth device, thereby achieving successful pairing between the first electronic device and the Bluetooth device.

Description

蓝牙配对方法、设备、系统和存储介质Bluetooth pairing method, device, system and storage medium
本申请要求于2021年11月01日提交国家知识产权局、申请号为202111285181.3、申请名称为“蓝牙配对方法、设备、系统和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application with application number 202111285181.3 and application title "Bluetooth pairing method, device, system, and storage medium" filed with the State Intellectual Property Office on November 01, 2021, the entire contents of which are incorporated by reference in this application.
技术领域technical field
本申请实施例涉及通信技术领域,尤其涉及一种蓝牙配对方法、设备、系统和存储介质。The embodiment of the present application relates to the technical field of communication, and in particular to a Bluetooth pairing method, device, system and storage medium.
背景技术Background technique
蓝牙(Bluetooth)技术是一种短距离无线通信技术,被广泛的应用于通信设备中,例如,智能手机、蓝牙耳机等。Bluetooth (Bluetooth) technology is a short-distance wireless communication technology, which is widely used in communication devices, such as smart phones, Bluetooth headsets, and the like.
蓝牙耳机与智能手机首次进行蓝牙通信之前需要先进行配对,配对之后才能进行正常的通话、音频等业务。蓝牙耳机进行配对时需要处于配对模式,对智能手机发送的查询请求进行扫描并回复,从而使得智能手机发现蓝牙耳机。Before the first Bluetooth communication between the Bluetooth headset and the smartphone, it needs to be paired. After pairing, normal calls, audio and other services can be performed. When the Bluetooth headset is paired, it needs to be in the pairing mode, scan and reply the query request sent by the smart phone, so that the smart phone can find the Bluetooth headset.
目前,对于非首次使用的蓝牙耳机,当蓝牙耳机需要与没有配对的设备进行蓝牙通信时,需要用户对蓝牙耳机上的物理按键进行手动操作,人为的使得蓝牙耳机进入配对模式,才能与其他没有配对的设备进行配对。但是,很多用户并不清楚需要在蓝牙耳机上人为操作,导致蓝牙耳机无法与其他设备进行蓝牙通信。At present, for a Bluetooth headset that is not used for the first time, when the Bluetooth headset needs to communicate with an unpaired device, the user needs to manually operate the physical buttons on the Bluetooth headset, artificially making the Bluetooth headset enter the pairing mode, in order to communicate with other unpaired devices. Paired devices are paired. However, many users do not know that it is necessary to manually operate on the Bluetooth headset, resulting in the inability of the Bluetooth headset to communicate with other devices.
发明内容Contents of the invention
本申请实施例提供一种蓝牙配对方法、设备、系统和存储介质,实现了电子设备和非首次使用的蓝牙设备的成功配对。Embodiments of the present application provide a Bluetooth pairing method, device, system, and storage medium, which realize successful pairing between an electronic device and a Bluetooth device that is not used for the first time.
第一方面,提供了一种蓝牙配对方法,应用于通信系统,通信系统包括第一电子设备、第二电子设备和蓝牙设备,第二电子设备和蓝牙设备已配对,第一电子设备和蓝牙设备未配对。蓝牙配对方法包括:第二电子设备和蓝牙设备建立蓝牙连接;第二电子设备向蓝牙设备发送通知信息,通知信息用于指示蓝牙设备进入配对模式;蓝牙设备根据通知信息进入配对模式;第一电子设备从第二电子设备或蓝牙设备或第三电子设备获取配对信息,配对信息包括蓝牙设备的蓝牙地址;第一电子设备根据蓝牙设备的蓝牙地址向蓝牙设备发送配对请求。In the first aspect, a Bluetooth pairing method is provided, which is 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 have been paired, and the first electronic device and the Bluetooth device Not paired. The Bluetooth pairing method includes: the second electronic device establishes a Bluetooth connection with the Bluetooth device; the second electronic device sends notification information to the Bluetooth device, and the notification information is used to instruct the Bluetooth device to enter the pairing mode; the Bluetooth device enters the pairing mode according to the notification information; the first electronic The device obtains pairing information from the second electronic device or the Bluetooth device or the third electronic device, and the pairing information includes the Bluetooth address of the Bluetooth device; the first electronic device sends a pairing request to the Bluetooth device according to the Bluetooth address of the Bluetooth device.
第一方面提供的蓝牙配对方法,借助于除了第一电子设备和蓝牙设备之外的第二电子设备,通过第二电子设备可以控制蓝牙设备进入配对模式,避免了用户必须对蓝牙设备进行操作才能触发蓝牙设备进入配对模式,消除了用户操作蓝牙设备的不便利性。而且,第一电子设备不通过向蓝牙设备发送查询请求也可以获得蓝牙设备的蓝牙地址,简化了配对过程的消息流程,提升了非首次使用的蓝牙设备与没有配对的电子设备完成配对过程的可实现性和效率,提升了用户的使用感受。In the Bluetooth pairing method provided in the first aspect, by means of the second electronic device other than the first electronic device and the Bluetooth device, the second electronic device can control the Bluetooth device to enter the pairing mode, which avoids the need for the user to operate the Bluetooth device. Trigger the Bluetooth device to enter the pairing mode, eliminating the inconvenience for the user to operate the Bluetooth device. Moreover, the first electronic device can obtain the Bluetooth address of the Bluetooth device without sending a query request to the Bluetooth device, which simplifies the message flow of the pairing process and improves the possibility of completing the pairing process between a Bluetooth device that is not used for the first time and an electronic device that has not been paired. Realization and efficiency have improved the user experience.
一种可能的实现方式中,第二电子设备向蓝牙设备发送通知信息,包括:第二电子设备接收用户的第一操作;第二电子设备响应于第一操作,向蓝牙设备发送通知信息。In a possible implementation manner, the sending the notification information to the Bluetooth device by the second electronic device includes: the second electronic device receives a first operation of the user; and the second electronic device sends the notification information to the Bluetooth device in response to the first operation.
在该实现方式中,通过用户的操作触发第二电子设备向蓝牙设备发送通知信息,提高了操作的灵活性。In this implementation manner, the user's operation triggers the second electronic device to send notification information to the Bluetooth device, which improves operational flexibility.
一种可能的实现方式中,第二电子设备向蓝牙设备发送通知信息,包括:第二电子设备向蓝牙设备发送L2CAP_ECHO_REQ消息,L2CAP_ECHO_REQ消息包括通知信息;蓝牙设备向第二电子设备向发送L2CAP_ECHO_RSP消息。In a possible implementation manner, the second electronic device sends notification information to the Bluetooth device, including: the second electronic device sends an L2CAP_ECHO_REQ message to the Bluetooth device, where the L2CAP_ECHO_REQ message includes notification information; and the Bluetooth device sends an L2CAP_ECHO_RSP message to the second electronic device.
在该实现方式中,通过回声请求实现了第二电子设备向蓝牙设备发送通知信息,通过回声响应确认了蓝牙设备成功接收通知信息,提高了第二电子设备发送通知信息的成功率。In this implementation, the second electronic device sends notification information to the Bluetooth device through the echo request, confirms that the Bluetooth device successfully receives the notification information through the echo response, and improves the success rate of the second electronic device sending notification information.
一种可能的实现方式中,第一电子设备从第二电子设备获取配对信息,包括:第二电子设备根据配对信息生成二维码信息,并显示二维码信息;第一电子设备扫描二维码信息,并解析二维码信息获得配对信息。In a possible implementation manner, the first electronic device acquires the pairing information from the second electronic device, including: the second electronic device generates two-dimensional code information according to the pairing information, and displays the two-dimensional code information; the first electronic device scans the two-dimensional Code information, and parse the QR code information to obtain pairing information.
在该实现方式中,第一电子设备不需要与第二电子设备进行通信,通过扫描或拍照等方式可以获取可视化形式的配对信息,进而获得配对信息。第一电子设备从第二电子设备获得配对信息,涉及的设备数量少,处理步骤少,实现方式简单。In this implementation, the first electronic device does not need to communicate with the second electronic device, and can obtain pairing information in a visualized form by scanning or taking pictures, and then obtain the pairing information. The first electronic device obtains the pairing information from the second electronic device, involving a small number of devices, few processing steps, and a simple implementation.
一种可能的实现方式中,第二电子设备根据配对信息生成二维码信息之前,还包括:第二电子设备接收用户的第二操作。In a possible implementation manner, before the second electronic device generates the two-dimensional code information according to the pairing information, the method further includes: the second electronic device receives a second operation of the user.
在该实现方式中,通过用户的操作触发第二电子设备根据配对信息生成二维码信息,提高了操作的灵活性。In this implementation manner, the user's operation triggers the second electronic device to generate two-dimensional code information according to the pairing information, which improves the flexibility of operation.
一种可能的实现方式中,第一电子设备从第二电子设备获取配对信息,包括:第二电子设备和第一电子设备建立通信连接;第二电子设备通过通信连接向蓝牙设备发送配对信息;第一电子设备接收配对信息。In a possible implementation manner, the acquiring the pairing information from the second electronic device by the first electronic device includes: establishing a communication connection between the second electronic device and the first electronic device; and sending the pairing information to the Bluetooth device by the second electronic device through the communication connection; The first electronic device receives pairing information.
在该实现方式中,第二电子设备通过与第一电子设备之间的通信连接向第一电子设备提供配对信息,涉及的设备数量少,实现方式简单。In this implementation manner, the second electronic device provides pairing information to the first electronic device through a communication connection with the first electronic device, and the number of devices involved is small, and the implementation manner is simple.
一种可能的实现方式中,第二电子设备和第一电子设备建立通信连接之前,还包括:接收用户的第三操作。In a possible implementation manner, before establishing the communication connection between the second electronic device and the first electronic device, the method further includes: receiving a third operation of the user.
一种可能的实现方式中,通信连接包括下列中的任意一项:蓝牙连接、WiFi连接或蜂窝通信连接。In a possible implementation manner, the communication connection includes any one of the following: a Bluetooth connection, a WiFi connection, or a cellular communication connection.
在该实现方式中,通信连接具有多种类型,提高了实现的灵活性。In this implementation manner, there are multiple types of communication connections, which improves the flexibility of implementation.
一种可能的实现方式中,第一电子设备从蓝牙设备获取配对信息,包括:蓝牙设备根据通知信息进入配对模式后,根据配对信息生成二维码信息,并显示二维码信息;第一电子设备扫描二维码信息,并解析二维码信息获得配对信息。In a possible implementation manner, the first electronic device acquires pairing information from the Bluetooth device, including: after the Bluetooth device enters the pairing mode according to the notification information, generates two-dimensional code information according to the pairing information, and displays the two-dimensional code information; the first electronic device The device scans the QR code information, and parses the QR code information to obtain pairing information.
在该实现方式中,第一电子设备不需要与蓝牙设备进行通信,通过扫描或拍照等方式可以从蓝牙设备获取可视化形式的配对信息,进而获得配对信息,提高了第一电子设备获得配对信息的安全性,实现方式更加多样性。In this implementation, the first electronic device does not need to communicate with the Bluetooth device, and can obtain pairing information in visual form from the Bluetooth device by scanning or taking pictures, and then obtain the pairing information, which improves the efficiency of the first electronic device to obtain pairing information. For security, the implementation methods are more diverse.
一种可能的实现方式中,第三电子设备和蓝牙设备通信,第一电子设备从第三电子设备获取配对信息,包括:蓝牙设备根据通知信息进入配对模式后,根据配对信息生成二维码信息;蓝牙设备向第三电子设备发送二维码信息;第三电子设备接收二维码信息后,显示二维码信息;第一电子设备扫描二维码信息,并解析二维码信息获得配对信息。In a possible implementation, the third electronic device communicates with the Bluetooth device, and the first electronic device acquires pairing information from the third electronic device, including: after the Bluetooth device enters the pairing mode according to the notification information, generates two-dimensional code information according to the pairing information ;The Bluetooth device sends two-dimensional code information to the third electronic device; the third electronic device displays the two-dimensional code information after receiving the two-dimensional code information; the first electronic device scans the two-dimensional code information, and analyzes the two-dimensional code information to obtain pairing information .
在该实现方式中,由蓝牙设备向第三电子设备提供配对信息。第一电子设备不需要与第三电子设备进行通信,通过扫描或拍照等方式可以获取可视化形式的配对信息,进而获得配对信息,提高了第一电子设备获得配对信息的安全性,实现方式更加多样性。In this implementation manner, 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, and can obtain pairing information in a visualized form by scanning or taking pictures, and then obtain pairing information, which improves the security of the first electronic device to obtain pairing information, and the implementation methods are more diverse sex.
一种可能的实现方式中,配对信息还包括蓝牙设备的能力信息。In a possible implementation manner, the pairing information further includes capability information of the Bluetooth device.
第二方面,提供了一种蓝牙配对方法,应用于第二电子设备,第二电子设备与蓝牙设备已配对,蓝牙配对方法包括:和蓝牙设备建立蓝牙连接;向蓝牙设备发送通知信息,通知信息用于指示蓝牙设备进入配对模式。In the second aspect, a Bluetooth pairing method is provided, which is applied to a second electronic device. The second electronic device has been paired with the Bluetooth device. The Bluetooth pairing method includes: establishing a Bluetooth connection with the Bluetooth device; sending notification information to the Bluetooth device, and the notification information Used to instruct a Bluetooth device to enter pairing mode.
一种可能的实现方式中,向蓝牙设备发送通知信息,包括:接收用户的第一操作;响应于第一操作,向蓝牙设备发送通知信息。In a possible implementation manner, sending the notification information to the Bluetooth device includes: receiving a first operation of the user; and sending the notification information to the Bluetooth device in response to the first operation.
一种可能的实现方式中,向蓝牙设备发送通知信息,包括:向蓝牙设备发送L2CAP_ECHO_REQ消息,L2CAP_ECHO_REQ消息包括通知信息;接收蓝牙设备发送的L2CAP_ECHO_RSP消息。In a possible implementation manner, sending notification information to the Bluetooth device includes: sending an L2CAP_ECHO_REQ message to the Bluetooth device, where the L2CAP_ECHO_REQ message includes notification information; and receiving an L2CAP_ECHO_RSP message sent by the Bluetooth device.
一种可能的实现方式中,还包括:根据配对信息生成二维码信息,配对信息包括蓝牙设备的蓝牙地址;显示二维码信息。In a possible implementation manner, the method further includes: generating two-dimensional code information according to the pairing information, where the pairing information includes the Bluetooth address of the Bluetooth device; and displaying the two-dimensional code information.
一种可能的实现方式中,根据配对信息生成二维码信息之前,还包括:接收用户的第二操作。In a possible implementation manner, before generating the two-dimensional code information according to the pairing information, the method further includes: receiving a second user operation.
一种可能的实现方式中,还包括:和第一电子设备建立通信连接,第一电子设备和蓝牙设备未配对;通过通信连接向蓝牙设备发送配对信息,配对信息包括蓝牙设备的蓝牙地址。In a possible implementation manner, the method further includes: establishing a communication connection with the first electronic device, and the first electronic device is not paired with the Bluetooth device; sending pairing information to the Bluetooth device through the communication connection, and the pairing information includes the Bluetooth address of the Bluetooth device.
一种可能的实现方式中,和第一电子设备建立通信连接之前,还包括:接收用户的第三操作。In a possible implementation manner, before establishing a communication connection with the first electronic device, the method further includes: receiving a third operation of the user.
一种可能的实现方式中,通信连接包括下列中的任意一项:蓝牙连接、WiFi连接或蜂窝通信连接。In a possible implementation manner, the communication connection includes any one of the following: a Bluetooth connection, a WiFi connection, or a cellular communication connection.
一种可能的实现方式中,通过通信连接向蓝牙设备发送配对信息,包括:根据配对信息生成共享信息;通过通信连接向蓝牙设备发送共享信息。In a possible implementation manner, sending the pairing information to the Bluetooth device through the communication connection includes: generating shared information according to the pairing information; and sending the shared information to the Bluetooth device through the communication connection.
一种可能的实现方式中,配对信息还包括蓝牙设备的能力信息。In a possible implementation manner, the pairing information further includes capability information of the Bluetooth device.
第三方面,提供了一种蓝牙配对方法,应用于蓝牙设备,蓝牙设备与第一电子设备未配对,蓝牙设备与第二电子设备已配对,蓝牙配对方法包括:和第二电子设备建立蓝牙连接;接收第二电子设备发送的通知信息,通知信息用于指示蓝牙设备进入配对模式;根据通知信息进入配对模式;接收第一电子设备发送的配对请求。In a third aspect, a Bluetooth pairing method is provided, which is applied to a Bluetooth device. The Bluetooth device is not paired with the first electronic device, and the Bluetooth device is paired with the second electronic device. The Bluetooth pairing method includes: establishing a Bluetooth connection with the second electronic device ; Receive notification information sent by the second electronic device, the notification information is used to instruct the Bluetooth device to enter the pairing mode; enter the pairing mode according to the notification information; receive a pairing request sent by the first electronic device.
一种可能的实现方式中,接收第二电子设备发送的通知信息,包括:接收第二电子设备发送的L2CAP_ECHO_REQ消息,L2CAP_ECHO_REQ消息包括通知信息;向第二电子设备发送L2CAP_ECHO_RSP消息。In a possible implementation manner, receiving the notification information sent by the second electronic device includes: receiving an L2CAP_ECHO_REQ message sent by the second electronic device, where the L2CAP_ECHO_REQ message includes the notification information; and sending an L2CAP_ECHO_RSP message to the second electronic device.
一种可能的实现方式中,根据通知信息进入配对模式之后,还包括:根据配对信息生成二维码信息,配对信息包括蓝牙设备的蓝牙地址;向第三电子设备发送二维码信息。In a possible implementation manner, after entering the pairing mode according to the notification information, the method further includes: generating two-dimensional code information according to the pairing information, where the pairing information includes the Bluetooth address of the Bluetooth device; and sending the two-dimensional code information to the third electronic device.
一种可能的实现方式中,根据通知信息进入配对模式之后,还包括:根据配对信息生成二维码信息,配对信息包括蓝牙设备的蓝牙地址;显示二维码信息。In a possible implementation manner, after entering the pairing mode according to the notification information, the method further includes: generating two-dimensional code information according to the pairing information, where the pairing information includes the Bluetooth address of the Bluetooth device; and displaying the two-dimensional code information.
一种可能的实现方式中,配对信息还包括蓝牙设备的能力信息。In a possible implementation manner, the pairing information further includes capability information of the Bluetooth device.
第四方面,提供了一种蓝牙配对方法,应用于第一电子设备,第一电子设备与蓝牙设 备未配对,蓝牙设备与第二电子设备已配对,蓝牙配对方法包括:从第二电子设备或蓝牙设备或第三电子设备获取配对信息,配对信息包括蓝牙设备的蓝牙地址;第三电子设备和蓝牙设备通信;根据蓝牙设备的蓝牙地址向蓝牙设备发送配对请求。In the fourth aspect, a Bluetooth pairing method is provided, which is applied to a first electronic device. The first electronic device is not paired with the Bluetooth device, and the Bluetooth device is paired with the second electronic device. The Bluetooth pairing method includes: from the second electronic device or The Bluetooth device or the third electronic device acquires pairing information, and the pairing information includes the Bluetooth address of the Bluetooth device; the third electronic device communicates with the Bluetooth device; and sends a pairing request to the Bluetooth device according to the Bluetooth address of the Bluetooth device.
一种可能的实现方式中,配对信息还包括蓝牙设备的能力信息。In a possible implementation manner, the pairing information further includes capability information of the Bluetooth device.
一种可能的实现方式中,从第二电子设备获取配对信息,包括:扫描第二电子设备显示的二维码信息,二维码信息为第二电子设备根据配对信息生成的;解析二维码信息,获得配对信息。In a possible implementation manner, obtaining the pairing information from the second electronic device includes: scanning the two-dimensional code information displayed by the second electronic device, the two-dimensional code information is generated by the second electronic device according to the pairing information; parsing the two-dimensional code information to obtain pairing information.
一种可能的实现方式中,从第二电子设备获取配对信息,包括:和第二电子设备建立通信连接;通过通信连接从第二电子设备获取配对信息。In a possible implementation manner, obtaining the pairing information from the second electronic device includes: establishing a communication connection with the second electronic device; and obtaining the pairing information from the second electronic device through the communication connection.
一种可能的实现方式中,通过通信连接从第二电子设备获取配对信息,包括:接收第二电子设备发送的共享信息;共享信息为第二电子设备根据配对信息生成的;解析共享信息,获得配对信息。In a possible implementation manner, obtaining pairing information from the second electronic device through a communication connection includes: receiving shared information sent by the second electronic device; the shared information is generated by the second electronic device according to the pairing information; parsing the shared information to obtain pairing information.
一种可能的实现方式中,通信连接包括下列中的任意一项:蓝牙连接、WiFi连接或蜂窝通信连接。In a possible implementation manner, the communication connection includes any one of the following: a Bluetooth connection, a WiFi connection, or a cellular communication connection.
一种可能的实现方式中,从蓝牙设备或第三电子设备获取配对信息,包括:扫描蓝牙设备或第三电子设备显示的二维码信息,二维码信息为蓝牙设备根据配对信息生成的;解析二维码信息,获得配对信息。In a possible implementation manner, obtaining the pairing information from the Bluetooth device or the third electronic device includes: scanning the two-dimensional code information displayed by the Bluetooth device or the third electronic device, where the two-dimensional code information is generated by the Bluetooth device according to the pairing information; Analyze the QR code information to obtain pairing information.
第五方面,提供了一种电子设备,应用于第三电子设备,第三电子设备与蓝牙设备通信,蓝牙配对方法包括:接收蓝牙设备发送的二维码信息,二维码信息为蓝牙设备根据配对信息生成的,配对信息包括蓝牙设备的蓝牙地址;显示二维码信息。In the fifth aspect, an electronic device is provided, which is applied to a third electronic device, and the third electronic device communicates with a Bluetooth device. The Bluetooth pairing method includes: receiving two-dimensional code information sent by the Bluetooth device, and the two-dimensional code information is used by the Bluetooth device according to The pairing information is generated, and the pairing information includes the Bluetooth address of the Bluetooth device; display the QR code information.
一种可能的实现方式中,配对信息还包括蓝牙设备的能力信息。In a possible implementation manner, the pairing information further includes capability information of the Bluetooth device.
第六方面,提供了一种电子设备,作为第二电子设备,第二电子设备与蓝牙设备已配对,第二电子设备包括:处理模块,用于和蓝牙设备建立蓝牙连接;发送模块,用于向蓝牙设备发送通知信息,通知信息用于指示蓝牙设备进入配对模式。In a sixth aspect, an electronic device is provided. As the second electronic device, the second electronic device has been paired with the Bluetooth device, and the second electronic device includes: a processing module, configured to establish a Bluetooth connection with the Bluetooth device; a sending module, configured to Notification information is sent to the Bluetooth device, and the notification information is used to instruct the Bluetooth device to enter a pairing mode.
一种可能的实现方式中,处理模块还用于:接收用户的第一操作;发送模块,还用于响应于第一操作,向蓝牙设备发送通知信息。In a possible implementation manner, the processing module is further configured to: receive a first operation of the user; and the sending module is further configured to send notification information to the Bluetooth device in response to the first operation.
一种可能的实现方式中,还包括接收模块;发送模块,用于向蓝牙设备发送L2CAP_ECHO_REQ消息,L2CAP_ECHO_REQ消息包括通知信息;接收模块,用于接收蓝牙设备发送的应L2CAP_ECHO_RSP消息。In a possible implementation manner, it also includes a receiving module; a sending module, configured to send an L2CAP_ECHO_REQ message to the Bluetooth device, where the L2CAP_ECHO_REQ message includes notification information; and a receiving module, configured to receive an L2CAP_ECHO_RSP message sent by the Bluetooth device.
一种可能的实现方式中,处理模块还用于:根据配对信息生成二维码信息,配对信息包括蓝牙设备的蓝牙地址;显示二维码信息。In a possible implementation manner, the processing module is further configured to: generate two-dimensional code information according to the pairing information, where the pairing information includes the Bluetooth address of the Bluetooth device; and display the two-dimensional code information.
一种可能的实现方式中,处理模块还用于:在根据配对信息生成二维码信息之前,接收用户的第二操作。In a possible implementation manner, the processing module is further configured to: before generating the two-dimensional code information according to the pairing information, receive a second user operation.
一种可能的实现方式中,处理模块还用于:和第一电子设备建立通信连接,第一电子设备和蓝牙设备未配对;发送模块,还用于通过通信连接向蓝牙设备发送配对信息,配对信息包括蓝牙设备的蓝牙地址。In a possible implementation, the processing module is also used to: establish a communication connection with the first electronic device, and the first electronic device is not paired with the Bluetooth device; the sending module is also used to send pairing information to the Bluetooth device through the communication connection, and the pairing The information includes the Bluetooth address of the Bluetooth device.
一种可能的实现方式中,处理模块还用于:在和第一电子设备建立通信连接之前,接收用户的第三操作。In a possible implementation manner, the processing module is further configured to: before establishing a communication connection with the first electronic device, receive a third operation of the user.
一种可能的实现方式中,通信连接包括下列中的任意一项:蓝牙连接、WiFi连接或蜂 窝通信连接。In a possible implementation manner, the communication connection includes any one of the following: a Bluetooth connection, a WiFi connection, or a cellular communication connection.
一种可能的实现方式中,处理模块,还用于根据配对信息生成共享信息;发送模块,用于通过通信连接向蓝牙设备发送共享信息。In a possible implementation manner, the processing module is further configured to generate shared information according to the pairing information; the sending module is configured to send the shared information to the Bluetooth device through a communication connection.
一种可能的实现方式中,配对信息还包括蓝牙设备的能力信息。In a possible implementation manner, the pairing information further includes capability information of the Bluetooth device.
第七方面,提供了一种蓝牙设备,蓝牙设备与第一电子设备未配对,蓝牙设备与第二电子设备已配对,蓝牙设备包括:处理模块,用于和第二电子设备建立蓝牙连接;接收模块,用于接收第二电子设备发送的通知信息,通知信息用于指示蓝牙设备进入配对模式;处理模块,还用于根据通知信息进入配对模式;接收模块,还用于接收第一电子设备发送的配对请求。In a seventh aspect, a Bluetooth device is provided. The Bluetooth device is not paired with the first electronic device, and the Bluetooth device is paired with the second electronic device. The Bluetooth device includes: a processing module, configured to establish a Bluetooth connection with the second electronic device; receiving The module is configured to receive the notification information sent by the second electronic device, the notification information is used to instruct the Bluetooth device to enter the pairing mode; the processing module is also used to enter the pairing mode according to the notification information; the receiving module is also used to receive the notification information sent by the first electronic device. pairing request.
一种可能的实现方式中,还包括发送模块;接收模块,用于接收第二电子设备发送的L2CAP_ECHO_REQ消息,L2CAP_ECHO_REQ消息包括通知信息;发送模块,用于向第二电子设备发送L2CAP_ECHO_RSP消息。In a possible implementation manner, it further includes a sending module; a receiving module, configured to receive the L2CAP_ECHO_REQ message sent by the second electronic device, where the L2CAP_ECHO_REQ message includes notification information; and a sending module, configured to send the L2CAP_ECHO_RSP message to the second electronic device.
一种可能的实现方式中,还包括发送模块;处理模块,还用于在根据通知信息进入配对模式之后,根据配对信息生成二维码信息,配对信息包括蓝牙设备的蓝牙地址;发送模块,用于向第三电子设备发送二维码信息。In a possible implementation, it also includes a sending module; a processing module is also used to generate two-dimensional code information according to the pairing information after entering the pairing mode according to the notification information, and the pairing information includes the Bluetooth address of the Bluetooth device; the sending module uses to send the two-dimensional code information to the third electronic device.
一种可能的实现方式中,处理模块还用于:在根据通知信息进入配对模式之后,根据配对信息生成二维码信息,配对信息包括蓝牙设备的蓝牙地址;显示二维码信息。In a possible implementation manner, the processing module is further configured to: after entering the pairing mode according to the notification information, generate two-dimensional code information according to the pairing information, where the pairing information includes the Bluetooth address of the Bluetooth device; and display the two-dimensional code information.
一种可能的实现方式中,配对信息还包括蓝牙设备的能力信息。In a possible implementation manner, the pairing information further includes capability information of the Bluetooth device.
第八方面,提供了一种电子设备,作为第一电子设备,第一电子设备与蓝牙设备未配对,蓝牙设备与第二电子设备已配对,第一电子设备包括:处理模块,用于从第二电子设备或蓝牙设备或第三电子设备获取配对信息,配对信息包括蓝牙设备的蓝牙地址;第三电子设备和蓝牙设备通信;发送模块,用于根据蓝牙设备的蓝牙地址向蓝牙设备发送配对请求。In an eighth aspect, an electronic device is provided. As the first electronic device, the first electronic device is not paired with the Bluetooth device, and the Bluetooth device is paired with the second electronic device. The first electronic device includes: a processing module configured to obtain The second electronic device or the Bluetooth device or the third electronic device acquires pairing information, and the pairing information includes the Bluetooth address of the Bluetooth device; the third electronic device communicates with the Bluetooth device; the sending module is used to send a pairing request to the Bluetooth device according to the Bluetooth address of the Bluetooth device .
一种可能的实现方式中,配对信息还包括蓝牙设备的能力信息。In a possible implementation manner, the pairing information further includes capability information of the Bluetooth device.
一种可能的实现方式中,处理模块具体用于:扫描第二电子设备显示的二维码信息,二维码信息为第二电子设备根据配对信息生成的;解析二维码信息,获得配对信息。In a possible implementation, the processing module is specifically configured to: scan the two-dimensional code information displayed by the second electronic device, the two-dimensional code information is generated by the second electronic device according to the pairing information; analyze the two-dimensional code information to obtain the pairing information .
一种可能的实现方式中,处理模块用于:和第二电子设备建立通信连接;通过通信连接从第二电子设备获取配对信息。In a possible implementation manner, the processing module is configured to: establish a communication connection with the second electronic device; obtain pairing information from the second electronic device through the communication connection.
一种可能的实现方式中,还包括接收模块;接收模块,用于接收第二电子设备发送的共享信息;共享信息为第二电子设备根据配对信息生成的;处理模块,用于解析共享信息,获得配对信息。In a possible implementation manner, it also includes a receiving module; the receiving module is configured to receive the shared information sent by the second electronic device; the shared information is generated by the second electronic device according to the pairing information; the processing module is configured to parse the shared information, Get pairing information.
一种可能的实现方式中,通信连接包括下列中的任意一项:蓝牙连接、WiFi连接或蜂窝通信连接。In a possible implementation manner, the communication connection includes any one of the following: a Bluetooth connection, a WiFi connection, or a cellular communication connection.
一种可能的实现方式中,处理模块用于:扫描蓝牙设备或第三电子设备显示的二维码信息,二维码信息为蓝牙设备根据配对信息生成的;解析二维码信息,获得配对信息。In a possible implementation, the processing module is configured to: scan the two-dimensional code information displayed by the Bluetooth device or the third electronic device, the two-dimensional code information is generated by the Bluetooth device according to the pairing information; analyze the two-dimensional code information to obtain the pairing information .
第九方面,提供了一种电子设备,作为第三电子设备,第三电子设备与蓝牙设备通信,第三电子设备包括:接收模块,用于接收蓝牙设备发送的二维码信息,二维码信息为蓝牙设备根据配对信息生成的,配对信息包括蓝牙设备的蓝牙地址;处理模块,用于显示二维码信息。In the ninth aspect, an electronic device is provided. As the third electronic device, the third electronic device communicates with the Bluetooth device, and the third electronic device includes: a receiving module for receiving the two-dimensional code information sent by the Bluetooth device, the two-dimensional code The information is generated by the Bluetooth device according to the pairing information, and the pairing information includes the Bluetooth address of the Bluetooth device; the processing module is used to display the two-dimensional code information.
一种可能的实现方式中,配对信息还包括蓝牙设备的能力信息。In a possible implementation manner, the pairing information further includes capability information of the Bluetooth device.
第十方面,提供一种电子设备,作为第二电子设备,电子设备包括处理器,处理器用于与存储器耦合,并读取存储器中的指令并根据指令使得电子设备执行第二方面提供的方法。According to a tenth aspect, an electronic device is provided. As a second electronic device, the electronic device includes a processor, and the processor is configured to be coupled with a memory, read instructions in the memory, and make the electronic device execute the method provided in the second aspect according to the instructions.
第十一方面,提供一种蓝牙设备,蓝牙设备包括处理器,处理器用于与存储器耦合,并读取存储器中的指令并根据指令使得蓝牙设备执行第三方面提供的方法。According to an eleventh aspect, a Bluetooth device is provided, and the Bluetooth device includes a processor, and the processor is configured to be coupled with a memory, read instructions in the memory, and make the Bluetooth device execute the method provided in the third aspect according to the instructions.
第十二方面,提供一种电子设备,作为第一电子设备,电子设备包括处理器,处理器用于与存储器耦合,并读取存储器中的指令并根据指令使得电子设备执行第四方面提供的方法。In a twelfth aspect, an electronic device is provided. As the first electronic device, the electronic device includes a processor, and the processor is used to be coupled with the memory, and read instructions in the memory and make the electronic device execute the method provided in the fourth aspect according to the instructions .
第十三方面,提供一种电子设备,作为第三电子设备,电子设备包括处理器,处理器用于与存储器耦合,并读取存储器中的指令并根据指令使得电子设备执行第五方面提供的方法。In a thirteenth aspect, an electronic device is provided. As the third electronic device, the electronic device includes a processor, and the processor is used to be coupled with the memory, and read instructions in the memory and make the electronic device execute the method provided in the fifth aspect according to the instructions .
第十四方面,提供一种通信系统,通信系统包括第十方面提供的第二电子设备、第十一方面提供的蓝牙设备和第十二方面提供的第一电子设备。A fourteenth aspect provides a communication system, and the communication system includes the second electronic device provided in the tenth aspect, the bluetooth device provided in the eleventh aspect, and the first electronic device provided in the twelfth aspect.
一种可能的实现方式中,通信系统还包括第十三方面提供的第三电子设备。In a possible implementation manner, the communication system further includes the third electronic device provided in the thirteenth aspect.
第十五方面,提供一种程序,该程序在被处理器执行时用于执行第一方面、第二方面、第三方面、第四方面或第五方面提供的方法。A fifteenth aspect provides a program, which is used to execute the method provided in the first aspect, the second aspect, the third aspect, the fourth aspect or the fifth aspect when executed by a processor.
第十六方面,提供一种计算机可读存储介质,计算机可读存储介质中存储有指令,当指令在计算机或处理器上运行时,实现第一方面、第二方面、第三方面、第四方面或第五方面提供的方法。In a sixteenth aspect, a computer-readable storage medium is provided. Instructions are stored in the computer-readable storage medium. When the instructions are run on a computer or a processor, the first aspect, the second aspect, the third aspect, and the fourth aspect are realized. Aspect or the method provided by the fifth aspect.
第十七方面,提供一种程序产品,所述程序产品包括计算机程序,所述计算机程序存储在可读存储介质中,设备的至少一个处理器可以从所述可读存储介质读取所述计算机程序,所述至少一个处理器执行所述计算机程序使得该设备实施第一方面、第二方面、第三方面、第四方面或第五方面提供的方法。In a seventeenth aspect, a program product is provided, the program product includes a computer program, the computer program is stored in a readable storage medium, and at least one processor of the device can read the computer program from the readable storage medium. program, the at least one processor executes the computer program so that the device implements the method provided in the first aspect, the second aspect, the third aspect, the fourth aspect or the fifth aspect.
附图说明Description of drawings
图1为蓝牙通信的一种场景示意图;FIG. 1 is a schematic diagram of a scenario of Bluetooth communication;
图2为图1中蓝牙设备与电子设备在配对过程中的一种消息交互图;FIG. 2 is a message interaction diagram between the Bluetooth device and the electronic device in the pairing process in FIG. 1;
图3A~图3B为用户操作蓝牙设备进入配对模式的示意图;3A-3B are schematic diagrams of the user operating the Bluetooth device to enter the pairing mode;
图4A~图4C为电子设备开启蓝牙功能后的一组界面示意图;4A to 4C are schematic diagrams of a set of interfaces after the Bluetooth function is enabled on the electronic device;
图5为本申请实施例适用的蓝牙通信的一种场景示意图;FIG. 5 is a schematic diagram of a scene of Bluetooth communication applicable to the embodiment of the present application;
图6为本申请实施例提供的蓝牙配对方法的一种消息交互图;FIG. 6 is a message interaction diagram of the Bluetooth pairing method provided by the embodiment of the present application;
图7A~图7F为第二电子设备的一组界面示意图;7A to 7F are schematic diagrams of a group of interfaces of the second electronic device;
图8A~图8F为第二电子设备的另一组界面示意图;8A to 8F are schematic diagrams of another set of interfaces of the second electronic device;
图9为本申请实施例提供的第二电子设备发送通知信息的一种消息交互图;FIG. 9 is a message interaction diagram for sending notification information by the second electronic device provided in the embodiment of the present application;
图10A为本申请实施例提供的L2CAP_ECHO_REQ消息对应的数据包的格式示意图;FIG. 10A is a schematic diagram of the format of the data packet corresponding to the L2CAP_ECHO_REQ message provided by the embodiment of the present application;
图10B为本申请实施例提供的L2CAP_ECHO_RSP消息对应的数据包的格式示意图;FIG. 10B is a schematic diagram of the format of the data packet corresponding to the L2CAP_ECHO_RSP message provided by the embodiment of the present application;
图11为本申请实施例提供的第一电子设备获取配置信息的一种消息交互图;FIG. 11 is a message interaction diagram for obtaining configuration information by the first electronic device provided in the embodiment of the present application;
图12为本申请实施例提供的蓝牙配对方法的另一种消息交互图;FIG. 12 is another message interaction diagram of the Bluetooth pairing method provided by the embodiment of the present application;
图13为本申请实施例提供的第一电子设备获取配置信息的另一种消息交互图;FIG. 13 is another message interaction diagram for obtaining configuration information by the first electronic device provided in the embodiment of the present application;
图14为本申请实施例提供的蓝牙配对方法的又一种消息交互图;FIG. 14 is another message interaction diagram of the Bluetooth pairing method provided by the embodiment of the present application;
图15为本申请实施例提供的第一电子设备获取配置信息的又一种消息交互图;FIG. 15 is another message interaction diagram for obtaining configuration information by the first electronic device provided in the embodiment of the present application;
图16为本申请实施例提供的蓝牙配对方法的又一种消息交互图;FIG. 16 is another message interaction diagram of the Bluetooth pairing method provided by the embodiment of the present application;
图17为本申请实施例提供的第一电子设备获取配置信息的又一种消息交互图;FIG. 17 is another message interaction diagram for obtaining configuration information by the first electronic device provided in the embodiment of the present application;
图18为本申请实施例提供的设备的一种结构示意图;FIG. 18 is a schematic structural diagram of a device provided by an embodiment of the present application;
图19为本申请实施例提供的设备的另一种结构示意图;Fig. 19 is another schematic structural diagram of the device provided by the embodiment of the present application;
图20为本申请实施例提供的设备的又一种结构示意图。Fig. 20 is another schematic structural diagram of the device provided by the embodiment of the present application.
具体实施方式Detailed ways
下面结合附图描述本申请实施例。Embodiments of the present application are described below in conjunction with the accompanying drawings.
本申请实施例提供的蓝牙配对方法,适用于蓝牙通信中设备间的配对过程。首先,对配对过程进行介绍。The Bluetooth pairing method provided in the embodiment of the present application is applicable to a pairing process between devices in Bluetooth communication. First, the pairing process is introduced.
在蓝牙通信中,两个设备初次进行蓝牙通信之前,需要首先进行配对过程。两个设备在完成配对之后,设备中存储有蓝牙地址(bluetooth device address,BD_ADDR)、密钥等信息,从而可以进行蓝牙通信。后续,如果两个设备中存储的蓝牙地址、密钥等信息没有被清空,当再次进行蓝牙通信时,两个设备之间可以根据蓝牙地址发送蓝牙连接请求,不需要再次进行配对过程。In Bluetooth communication, before two devices conduct Bluetooth communication for the first time, they need to go through a pairing process first. After the pairing of the two devices is completed, information such as the Bluetooth device address (BD_ADDR) and key are stored in the device, so that Bluetooth communication can be performed. Subsequently, if the Bluetooth address, key and other information stored in the two devices are not cleared, when the Bluetooth communication is performed again, the two devices can send a Bluetooth connection request according to the Bluetooth address, and there is no need to perform the pairing process again.
示例性的,图1为蓝牙通信的一种场景示意图。如图1所示,电子设备100和蓝牙设备200均支持蓝牙功能,电子设备100和蓝牙设备200可以进行蓝牙通信。Exemplarily, FIG. 1 is a schematic diagram of a scenario of Bluetooth communication. As shown in FIG. 1 , both the electronic device 100 and the Bluetooth device 200 support the Bluetooth function, and the electronic device 100 and the Bluetooth device 200 can perform Bluetooth communication.
其中,对电子设备100和蓝牙设备200的类型和名称不做限定。例如,一些电子设备的举例为:手机、平板电脑、笔记本电脑、掌上电脑、可穿戴设备、智慧屏、教学设备、物联网(internet of things,IOT)设备、或智慧家庭(smart home)中的无线终端等。可选的,电子设备100具有显示屏。一些蓝牙设备的举例为:蓝牙耳机、蓝牙音箱、蓝牙手写笔等。Wherein, the types and names of the electronic device 100 and the Bluetooth device 200 are not limited. For example, examples of some electronic devices are: mobile phones, tablet computers, notebook computers, handheld computers, wearable devices, smart screens, teaching equipment, Internet of Things (internet of things, IOT) devices, or smart home (smart home) wireless terminals, etc. Optionally, the electronic device 100 has a display screen. Examples of some bluetooth devices are: bluetooth earphones, bluetooth speakers, bluetooth stylus and so on.
为了方便说明,本申请实施例以电子设备100为手机、蓝牙设备200为蓝牙耳机为例进行说明。For convenience of description, the embodiment of the present application takes the electronic device 100 as a mobile phone and the Bluetooth device 200 as a Bluetooth headset as an example for description.
下面,对配对过程中的消息流程进行说明。为了便于理解,配对过程可以包括发现设备阶段和配对阶段。在发现设备阶段,电子设备能够发现可配对的蓝牙设备,与蓝牙设备交互配对阶段所需的相关信息,例如,蓝牙设备的蓝牙地址。在配对阶段,电子设备和蓝牙设备可以交换密钥等信息,用于后续的蓝牙通信。Next, the message flow in the pairing process will be described. For ease of understanding, the pairing process may include a device discovery phase and a pairing phase. In the device discovery phase, the electronic device can discover a Bluetooth device that can be paired, and exchange relevant information required in the pairing phase with the Bluetooth device, for example, the Bluetooth address of the Bluetooth device. In the pairing phase, the electronic device and the Bluetooth device can exchange information such as keys for subsequent Bluetooth communication.
图2为图1中蓝牙设备与电子设备在配对过程中的一种消息交互图。如图2所示,蓝牙通信中设备间的配对过程可以包括:FIG. 2 is a diagram of message interaction between the Bluetooth device and the electronic device in FIG. 1 during the pairing process. As shown in Figure 2, the pairing process between devices in Bluetooth communication may include:
S21、蓝牙设备响应于用户对蓝牙设备的操作,进入配对模式。S21. The Bluetooth device enters a pairing mode in response to the user's operation on the Bluetooth device.
具体的,用户需要操作蓝牙设备,使得蓝牙设备进入配对模式。蓝牙设备处于配对模式时,可以搜索电子设备发送的查询请求(inquiry request),并向电子设备回复查询响应(inquiry response),从而使得电子设备发现蓝牙设备。其中,蓝牙设备的使用状态不同时,用户对蓝牙设备的操作可以不同。Specifically, the user needs to operate the Bluetooth device so that the Bluetooth device enters a pairing mode. When the Bluetooth device is in the pairing mode, it can search for an inquiry request (inquiry request) sent by the electronic device, and reply an inquiry response (inquiry response) to the electronic device, so that the electronic device can discover the Bluetooth device. Wherein, when the usage status of the Bluetooth device is different, the user may operate the Bluetooth device differently.
可选的,在一种实现方式中,为蓝牙耳机首次开盒使用的场景。如图3A中左侧所示, 蓝牙耳机包括盒盖201和盒体202。蓝牙耳机在出厂后从未开盒使用过。如图3A中右侧所示,当蓝牙耳机第一次开盒使用时,可以触发蓝牙耳机进入配对模式。相应的,蓝牙耳机响应于用户的操作,进入配对模式。Optionally, in an implementation manner, it is a scenario in which the Bluetooth headset is first unpacked and used. As shown on the left side of FIG. 3A , the Bluetooth headset includes a case cover 201 and a case body 202 . The bluetooth headset has never been used out of the box after leaving the factory. As shown on the right side of FIG. 3A , when the Bluetooth headset is unpacked and used for the first time, the Bluetooth headset can be triggered to enter a pairing mode. Correspondingly, the Bluetooth headset enters the pairing mode in response to the user's operation.
可选的,在另一种实现方式中,为蓝牙耳机非首次使用的场景。如图3B中左侧所示,蓝牙耳机已经开盒使用过,与至少一个电子设备进行过蓝牙通信。如图3B中右侧所示,当蓝牙耳机需要与从未配对的电子设备进行蓝牙通信时,或者,与历史上配对过但需要重新配对的电子设备进行蓝牙通信时,用户可以按压盒体202上的物理按键203,触发蓝牙耳机进入配对模式。相应的,蓝牙耳机响应于用户按压物理按键203的操作,进入配对模式。Optionally, in another implementation manner, it is a scenario where the Bluetooth headset is not used for the first time. As shown on the left side of FIG. 3B , the Bluetooth headset has been used out of the box, and Bluetooth communication has been performed with at least one electronic device. As shown on the right side of Figure 3B, when the Bluetooth headset needs to perform Bluetooth communication with an electronic device that has never been paired, or when performing Bluetooth communication with an electronic device that has been paired in history but needs to be re-paired, the user can press the box body 202 The physical button 203 on the keyboard triggers the Bluetooth headset to enter pairing mode. Correspondingly, the Bluetooth headset enters the pairing mode in response to the operation of pressing the physical button 203 by the user.
需要说明,本申请实施例对配对模式的名称不做限定。例如,配对模式也可以称为配对状态或查询扫描(inquiry scan)状态。It should be noted that the embodiment of the present application does not limit the name of the pairing mode. For example, the pairing mode may also be called a pairing state or an inquiry scan (inquiry scan) state.
S22、电子设备发送查询请求(inquiry request)。相应的,电子设备周围处于配对模式的蓝牙设备可以对查询请求进行扫描,接收查询请求。S22. The electronic device sends an inquiry request (inquiry request). Correspondingly, the Bluetooth devices in the pairing mode around the electronic device can scan the query request and receive the query request.
具体的,电子设备打开蓝牙功能后,可以进入查询(inquiry)状态,向周围的设备发送查询请求。相应的,如果周围的蓝牙设备处于配对模式,则可以对查询请求进行扫描,并向电子设备回复查询响应(inquiry response),从而使得电子设备发现蓝牙设备。Specifically, after the electronic device turns on the bluetooth function, it can enter an inquiry state and send an inquiry request to surrounding devices. Correspondingly, if the surrounding Bluetooth devices are in the pairing mode, the inquiry request can be scanned, and an inquiry response (inquiry response) can be returned to the electronic device, so that the electronic device can discover the Bluetooth device.
其中,对S21和S22的执行顺序不做限定。例如,用户先通过按压蓝牙耳机盒上的物理按键触发蓝牙耳机进入配对模式,然后,电子设备打开蓝牙功能,即,先执行S21再执行S22。又例如,电子设备先打开蓝牙功能,然后,用户首次开盒使用蓝牙耳机触发蓝牙耳机进入配对模式,即,先执行S22再执行S21。Wherein, the execution order of S21 and S22 is not limited. For example, the user first triggers the Bluetooth headset to enter the pairing mode by pressing a physical button on the Bluetooth headset box, and then the electronic device turns on the Bluetooth function, that is, first executes S21 and then executes S22. For another example, the electronic device first turns on the bluetooth function, and then the user opens the box and uses the bluetooth earphone for the first time to trigger the bluetooth earphone to enter the pairing mode, that is, first execute S22 and then execute S21.
其中,查询请求中包括电子设备的蓝牙地址,蓝牙地址可以参见蓝牙协议中的相关内容,此处不再赘述。Wherein, the query request includes the bluetooth address of the electronic device, and the bluetooth address can refer to related content in the bluetooth protocol, which will not be repeated here.
可选的,电子设备可以按照第一周期发送查询请求。可选的,处于配对模式的蓝牙设备可以按照第二周期扫描查询请求。可选的,第一周期和第二周期可以相同,也可以不同。Optionally, the electronic device may send the query request according to the first cycle. Optionally, the Bluetooth device in the pairing mode may scan for query requests according to the second cycle. Optionally, the first period and the second period may be the same or different.
S23、蓝牙设备向电子设备发送查询响应(inquiry response)。相应的,电子设备接收蓝牙设备发送的查询响应。S23. The Bluetooth device sends an inquiry response (inquiry response) to the electronic device. Correspondingly, the electronic device receives the inquiry response sent by the Bluetooth device.
其中,查询响应中包括蓝牙设备的蓝牙地址。Wherein, the query response includes the Bluetooth address of the Bluetooth device.
具体的,当处于配对模式的蓝牙设备扫描到电子设备发送的查询请求后,可以根据查询请求中电子设备的蓝牙地址向电子设备返回查询响应,从而,电子设备可以发现蓝牙设备,并继续与电子设备进行后续的配对过程。Specifically, when the Bluetooth device in the pairing mode scans the query request sent by the electronic device, it can return a query response to the electronic device according to the Bluetooth address of the electronic device in the query request, so that the electronic device can discover the Bluetooth device and continue to communicate with the electronic device. The device goes through the subsequent pairing process.
需要说明,发现设备阶段包括但不限于S21~S23。例如,在发现设备阶段,电子设备和蓝牙设备还可以通过消息的交互获取下列信息中的至少一项:蓝牙设备的设备名称、电子设备的设备支持特性(device supported feature)信息、蓝牙设备的设备支持特性信息。其中,设备支持特性信息也可以称为能力信息,可以参考蓝牙协议中有关设备特性(device feature)的内容,此处不再赘述。It should be noted that the stage of discovering devices includes but not limited to S21-S23. For example, in the device discovery phase, the electronic device and the Bluetooth device can also obtain at least one of the following information through message interaction: the device name of the Bluetooth device, the device supported feature information of the electronic device, and the device information of the Bluetooth device. Support feature information. Wherein, the device support feature information may also be referred to as capability information, and reference may be made to the content about device features in the Bluetooth protocol, which will not be repeated here.
通过发现设备阶段,电子设备可以发现周围可配对的蓝牙设备。示例性的,图4A示出了电子设备在发现设备阶段的一种界面示意图。如图4A所示,手机的蓝牙主界面40中包括蓝牙功能的开关控件41、开放检测的开关控件42、“设备名称”选项卡43、“接收的文件”选项卡44、已配对的设备45和可用设备46。通过“设备名称”选项卡43可知, 手机的名称为“手机2”。已配对的设备45显示有手机2历史上成功配对的设备,例如,手机1。可用设备46显示有手机2发现的当前可配对的设备,例如,蓝牙耳机。如图4A所示,用户可以点击可用设备46中的蓝牙耳机,进行手机2与蓝牙耳机的配对。相应的,手机2响应于用户的操作,开始配对过程中的配对阶段。Through the device discovery stage, the electronic device can discover the Bluetooth devices around it that can be paired. Exemplarily, FIG. 4A shows a schematic interface of an electronic device in a device discovery stage. As shown in FIG. 4A , the bluetooth main interface 40 of the mobile phone includes a switch control 41 of the bluetooth function, a switch control 42 of open detection, a "device name" tab 43, a "received file" tab 44, and a paired device 45 and 46 devices available. It can be known from the "device name" tab 43 that the name of the mobile phone is "mobile phone 2". Paired devices 45 shows devices that have been successfully paired with phone 2 in history, eg, phone 1 . The available devices 46 display currently pairable devices discovered by the mobile phone 2, for example, Bluetooth headsets. As shown in FIG. 4A , the user can click on the Bluetooth headset in the available devices 46 to pair the mobile phone 2 with the Bluetooth headset. Correspondingly, the mobile phone 2 starts the pairing stage in the pairing process in response to the user's operation.
可选的,手机2与蓝牙耳机在配对之前,还可以显示提示信息。示例性的,用户点击图4A中的可用设备46中的蓝牙耳机后,蓝牙主界面40的变化可以参见图4B。如图4B所示,手机2在蓝牙主界面40中弹出配对弹窗47。用户通过查看配对弹窗47中的提示信息进行操作。例如,提示信息包括:“要与以下设备配对:蓝牙耳机”。配对弹窗47中还包括取消按键和配对按键。用户可以点击配对按键48,使得手机2与蓝牙耳机配对。相应的,手机2响应于用户点击配对按键48的操作,执行配对阶段的消息流程,具体参见S24。Optionally, before the mobile phone 2 and the Bluetooth headset are paired, a prompt message may also be displayed. Exemplarily, after the user clicks the Bluetooth headset in the available devices 46 in FIG. 4A , the changes of the Bluetooth main interface 40 can be seen in FIG. 4B . As shown in FIG. 4B , the mobile phone 2 pops up a pairing window 47 in the Bluetooth main interface 40 . The user operates by viewing the prompt information in the pairing pop-up window 47 . For example, the prompt information includes: "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 make the mobile phone 2 pair with the Bluetooth headset. Correspondingly, in response to the user's operation of clicking the pairing button 48, the mobile phone 2 executes the message flow of the pairing phase, see S24 for details.
S24、电子设备向蓝牙设备发送配对请求(pairing request)。相应的,蓝牙设备接收电子设备发送的配对请求。S24. The electronic device sends a pairing request (pairing request) to the Bluetooth device. Correspondingly, the Bluetooth device receives the pairing request sent by the electronic device.
S25、蓝牙设备向电子设备发送配对响应(pairing response)。相应的,电子设备接收蓝牙设备发送的配对响应。S25. The Bluetooth device sends a pairing response (pairing response) to the electronic device. Correspondingly, the electronic device receives the pairing response sent by the Bluetooth device.
具体的,在配对阶段,电子设备可以根据蓝牙设备的蓝牙地址向蓝牙设备发送配对请求,蓝牙设备可以根据电子设备的蓝牙地址向电子设备发送配对响应,配对请求和配对响应用于交换配置信息,配置信息用于确定配对方式和分配密钥。Specifically, in the pairing phase, the electronic device may send a pairing request to the Bluetooth device according to the Bluetooth address of the Bluetooth device, and the Bluetooth device may send a pairing response to the electronic device according to the Bluetooth address of the electronic device, and the pairing request and the pairing response are used to exchange configuration information, Configuration information is used to determine the pairing method and distribute keys.
可选的,配置信息可以包括电子设备的输入输出能力。不同电子设备的类型不同、硬件配置不同,输入输出能力不同。例如,输入输出能力可以指示下列中的至少一项:电子设备是否可以输入、电子设备可以输入时的输入方式、电子设备是否可以显示,等等。可选的,电子设备的输入输出能力可以包括下列中的任意一种:无输入无输出、仅有显示屏、具有显示屏并可以选择“是/否”、仅有键盘、具有键盘和显示屏。Optionally, the configuration information may include the input and output capabilities of the electronic device. Different electronic devices have different types, different hardware configurations, and different input and output capabilities. For example, the input/output capability may indicate at least one of the following: whether the electronic device can input, an input method when the electronic device can input, whether the electronic device can display, and so on. Optionally, the input and output capabilities of the electronic device may include any of the following: no input and no output, only a display screen, a display screen with the option of "yes/no", a keyboard only, a keyboard and a display screen .
需要说明,配对阶段包括但不限于S24~S25。例如,在配对阶段,还需要确定电子设备和蓝牙设备的配对算法、建立加密链路、传输密钥等,可以参见蓝牙协议中关于配对认证的内容,此处不再赘述。It should be noted that the pairing stage includes but not limited to S24-S25. For example, in the pairing phase, it is also necessary to determine the pairing algorithm of the electronic device and the Bluetooth device, establish an encrypted link, transmit a key, etc., and refer to the content about pairing authentication in the Bluetooth protocol, which will not be repeated here.
电子设备和蓝牙设备完成配对后,设备中存储了密钥等信息,电子设备和蓝牙设备后续可以进行蓝牙通信。示例性的,图4C示出了电子设备和蓝牙设备完成配对后电子设备的一种界面示意图。相比于图4A,如图4C所示,在蓝牙主界面40中,已配对的设备45中包括手机1和蓝牙耳机,说明手机2和蓝牙耳机已经完成配对,后续可以进行蓝牙通信。After the electronic device and the Bluetooth device are paired, information such as a key is stored in the device, and the electronic device and the Bluetooth device can subsequently perform Bluetooth communication. Exemplarily, FIG. 4C shows a schematic diagram of an interface of the electronic device after the electronic device and the Bluetooth device are paired. Compared with FIG. 4A , as shown in FIG. 4C , in the Bluetooth main interface 40 , the paired devices 45 include the mobile phone 1 and the Bluetooth headset, indicating that the mobile phone 2 and the Bluetooth headset have been paired, and subsequent Bluetooth communication can be performed.
S26、电子设备与蓝牙设备完成配对后,可以建立蓝牙连接,进行业务。S26. After the electronic device is paired with the Bluetooth device, a Bluetooth connection can be established to perform business.
其中,本申请实施例对业务的类型不做限定。例如,通话业务和音频业务。可选的,通话业务包括但不限于:语音通话或视频通话;音频业务包括但不限于:播放音乐、提示音、导航音、闹钟、游戏、视频等。Wherein, the embodiment of the present application does not limit the type of service. For example, call service and audio service. 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 sounds, navigation sounds, alarm clocks, games, videos, etc.
通过图2所示的配对过程的消息流程,可知,蓝牙设备与电子设备配对时,需要蓝牙设备处于配对模式,从而,蓝牙设备可以扫描电子设备发送的查询请求并回复查询响应。相应的,电子设备发现可配对的蓝牙设备,从蓝牙设备发送的查询响应中获取蓝牙设备的蓝牙地址,后续,可以根据蓝牙设备的蓝牙地址向蓝牙设备发送配对请求,继续配对过程。From the message flow of the pairing process shown in FIG. 2 , it can be seen that when a Bluetooth device is paired with an electronic device, the Bluetooth device needs to be in a pairing mode, so that the Bluetooth device can scan the query request sent by the electronic device and reply with a query response. Correspondingly, the electronic device discovers a Bluetooth device that can be paired, obtains the Bluetooth address of the Bluetooth device from the query response sent by the Bluetooth device, and then sends a pairing request to the Bluetooth device according to the Bluetooth address of the Bluetooth device to continue the pairing process.
目前,控制蓝牙耳机进入配对模式需要用户对蓝牙耳机进行操作。蓝牙设备首次使用时,用户开盒触发蓝牙耳机进入配对模式。蓝牙耳机的首次使用仅有一次,在大部分的应 用场景中,蓝牙设备都为已使用状态,此时,需要用户手动操作蓝牙耳机盒上的物理按键才能让蓝牙耳机进入配对模式。但是,很多用户并不清楚这个操作,导致非首次使用的蓝牙耳机无法进入配对模式,无法与电子设备完成配对过程,因此也无法进行后续的蓝牙通信和业务,严重影响了用户对蓝牙耳机的使用感受。Currently, controlling the Bluetooth headset to enter the pairing mode requires the user to operate the Bluetooth headset. When the Bluetooth device is used for the first time, the user opens the box to trigger the Bluetooth headset to enter the pairing mode. The first use of the Bluetooth headset is only once. In most application scenarios, the Bluetooth device is in use. At this time, the user needs to manually operate the physical button on the Bluetooth headset box to allow the Bluetooth headset to enter the pairing mode. However, many users are not aware of this operation, resulting in the non-first-use Bluetooth headsets being unable to enter the pairing mode, unable to complete the pairing process with electronic devices, and therefore unable to perform subsequent Bluetooth communications and services, seriously affecting the use of Bluetooth headsets by users feel.
本申请实施例提供了一种蓝牙配对方法,借助于除了电子设备和蓝牙设备之外的第三方设备,通过第三方设备可以控制蓝牙设备进入配对模式,避免了用户必须对蓝牙设备进行操作才能触发蓝牙设备进入配对模式,消除了用户操作蓝牙设备的不便利性。而且,电子设备不通过向蓝牙设备发送查询请求也可以获得蓝牙设备的蓝牙地址,简化了配对过程的消息流程,提升了非首次使用的蓝牙设备与没有配对的电子设备完成配对过程的可实现性和便利性,提升了用户的使用感受。The embodiment of the present application provides a Bluetooth pairing method. With the help of third-party devices other than electronic devices and Bluetooth devices, the third-party device can control the Bluetooth device to enter the pairing mode, avoiding that the user must operate the Bluetooth device to trigger The Bluetooth device enters the pairing mode, which eliminates the inconvenience for the user to operate the Bluetooth device. Moreover, the electronic device can obtain the Bluetooth address of the Bluetooth device without sending a query request to the Bluetooth device, which simplifies the message flow of the pairing process and improves the feasibility of completing the pairing process between a Bluetooth device that is not used for the first time and an electronic device that has not been paired. And convenience, enhance the user experience.
为了方便说明,将需要与蓝牙设备配对的电子设备称为第一电子设备,将除了第一电子设备和蓝牙设备之外的第三方设备称为第二电子设备,蓝牙设备与第二电子设备历史上配对成功且未清除数据。For the convenience of description, the electronic device that needs to be paired with the Bluetooth device is called the first electronic device, and the third-party device other than the first electronic device and the Bluetooth device is called the second electronic device. The history of the Bluetooth device and the second electronic device The pairing is successful and the data has not been cleared.
示例性的,图5为本申请实施例适用的蓝牙通信的一种场景示意图。如图5所示,场景中包括蓝牙设备、第一电子设备和第二电子设备。蓝牙设备与第二电子设备可以进行蓝牙通信。可选的,第一电子设备和第二电子设备可以通信,也可以不通信。可选的,第一电子设备和第二电子设备之间的通信包括但不限于下列中的至少一项:有线通信、蓝牙通信、无线保真(wireless fidelity,WiFi)通信、近场通信(near field communication,NFC)或蜂窝通信。Exemplarily, FIG. 5 is a schematic diagram of a scene of Bluetooth communication applicable to the embodiment of the present application. As shown in FIG. 5 , the scene includes a Bluetooth device, a first electronic device, and a second electronic device. The Bluetooth device and the second electronic device can perform Bluetooth communication. 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 (wireless fidelity, WiFi) communication, near field communication (near field communication, NFC) or cellular communication.
可选的,在图5中,场景中还可以包括第三电子设备。蓝牙设备与第三电子设备可以通信。蓝牙设备与第三电子设备之间的通信包括但不限于下列中的至少一项:有线通信、蓝牙通信、WiFi通信或NFC通信。可选的,第一电子设备和第三电子设备可以通信,也可以不通信。第一电子设备和第三电子设备之间的通信包括但不限于下列中的至少一项:有线通信、蓝牙通信、WiFi通信、NFC通信或蜂窝通信。Optionally, in FIG. 5 , the scene may further include a third electronic device. The bluetooth device can communicate with the third electronic device. The 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. The 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.
其中,第一电子设备、第二电子设备和第三电子设备的类型和名称可以参见图1中的电子设备100。可选的,第三电子设备还可以为用于显示蓝牙设备的相关信息的设备,例如,显示屏或显示器等。本申请实施例对第一电子设备、第二电子设备和第三电子设备的数量不做限定。For the types and names of the first electronic device, the second electronic device and the third electronic device, refer to the electronic device 100 in FIG. 1 . Optionally, the third electronic device may also be a device for displaying related information of the Bluetooth device, for example, a display screen or a monitor. The embodiment of the present application does not limit the number of the first electronic device, the second electronic device, and the third electronic device.
下面通过具体的实施例对本申请的技术方案进行详细说明。下面的实施例可以相互结合,对于相同或相似的概念或过程可能在某些实施例中不再赘述。The technical solution of the present application will be described in detail below through specific examples. The following embodiments may be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.
本申请实施例中的术语“第一”、“第二”、“第三”、“第四”等(如果存在)是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。The terms "first", "second", "third", "fourth", etc. (if any) in the embodiments of the present application are used to distinguish similar objects, and not necessarily used to describe a specific order or sequence .
图6为本申请实施例提供的蓝牙配对方法的一种消息交互图。本实施例提供的蓝牙配对方法,适用于图5所示场景,执行主体涉及蓝牙设备、第一电子设备和第二电子设备。可选的,执行主体还可以涉及第三电子设备。为了方便说明,在一些示例中,蓝牙设备为蓝牙耳机,第一电子设备为手机1,第二电子设备为手机2,第三电子设备为显示器3。如图6所示,本实施例提供的蓝牙配对方法,可以包括:FIG. 6 is a message interaction diagram of the Bluetooth pairing method provided by the embodiment of the present application. The Bluetooth pairing method provided in this embodiment is applicable to the scenario shown in FIG. 5 , and the execution subject involves the Bluetooth device, the first electronic device, and the second electronic device. Optionally, the execution subject may also involve a third electronic device. For convenience of description, in some examples, the Bluetooth device is a Bluetooth headset, the first electronic device is a mobile phone 1 , the second electronic device is a mobile phone 2 , and the third electronic device is a display 3 . As shown in Figure 6, the Bluetooth pairing method provided in this embodiment may include:
S61、蓝牙设备与第二电子设备建立蓝牙连接。S61. The Bluetooth device establishes a Bluetooth connection with the second electronic device.
可选的,蓝牙连接可以包括异步连接(asynchronous connection-oriented,ACL)连接。ACL连接为蓝牙协议中物理层上的连接,可以参见蓝牙协议中的相关内容,此处不再赘述。Optionally, the Bluetooth connection may include an asynchronous connection-oriented (ACL) connection. The ACL connection is a connection on the physical layer in the Bluetooth protocol, and reference may be made to related content in the Bluetooth protocol, so details will not be repeated here.
可选的,蓝牙连接还可以包括下列中的至少一种:同步定向连接(synchronous connection-oriented link,SCO)连接、高级音频分发规范(advanced audio distribution profile,A2DP)连接,或者,免提规范(hands-free profile,HFP)连接。其中,SCO连接为蓝牙协议中物理层上的连接,A2DP连接和HFP连接为蓝牙协议中应用层上的连接,可以参见蓝牙协议中的相关内容,此处不再赘述。Optionally, the Bluetooth connection may also include at least one of the following: a synchronous connection-oriented connection (synchronous connection-oriented link, SCO) connection, an advanced audio distribution profile (A2DP) connection, or a hands-free profile ( hands-free profile, HFP) connection. Wherein, the SCO connection is a connection on the physical layer in the Bluetooth protocol, and the A2DP connection and the HFP connection are connections on the application layer in the Bluetooth protocol. Please refer to the relevant content in the Bluetooth protocol, and will not repeat them here.
其中,本实施例对应用场景中蓝牙设备与第二电子设备建立蓝牙连接的时间不做限定。Wherein, this embodiment does not limit the time for establishing the Bluetooth connection between the Bluetooth device and the second electronic device in the application scenario.
可选的,在一种应用场景中,蓝牙设备与第二电子设备当前未建立蓝牙连接。当蓝牙设备需要与第一电子设备配对时,蓝牙设备才与第二电子设备建立蓝牙连接。例如,手机2当前没有打开蓝牙功能。当蓝牙耳机需要与手机1配对时,用户打开手机2的蓝牙功能,手机2可以与蓝牙耳机自动建立蓝牙连接。Optionally, in an application scenario, no Bluetooth connection is currently established between the Bluetooth device and the second electronic device. When the Bluetooth device needs to be paired with the first electronic device, the Bluetooth device establishes a Bluetooth connection with the second electronic device. For example, the mobile phone 2 does not currently have the Bluetooth function turned on. When the Bluetooth headset needs to be paired with the mobile phone 1, the user turns on the Bluetooth function of the mobile phone 2, and the mobile phone 2 can automatically establish a Bluetooth connection with the Bluetooth headset.
可选的,在另一种应用场景中,当蓝牙设备需要与第一电子设备配对时,蓝牙设备与第二电子设备已经建立有蓝牙连接。例如,用户正在通过蓝牙耳机收听手机2上播放的音乐,此时,蓝牙耳机还需要与手机1配对。Optionally, in another application scenario, when the Bluetooth device needs to be paired with the first electronic device, the Bluetooth device has established a Bluetooth connection with the second electronic device. For example, the user is listening to the music played on the mobile phone 2 through the Bluetooth headset. At this time, the Bluetooth headset needs to be paired with the mobile phone 1 .
S62、第二电子设备向蓝牙设备发送通知信息,通知信息用于指示蓝牙设备进入配对模式。相应的,蓝牙设备接收第二电子设备发送的通知信息。S62. The second electronic device sends notification information to the Bluetooth device, where the notification information is used to instruct the Bluetooth device to enter a pairing mode. Correspondingly, the Bluetooth device receives the notification information sent by the second electronic device.
通过第二电子设备向蓝牙设备发送通知信息,指示蓝牙设备进入配对模式,避免了用户必须在蓝牙设备上操作才能使蓝牙设备进入配对模式,避免了用户对蓝牙设备操作的不便,提升了用户使用蓝牙设备的感受。Send notification information to the Bluetooth device through the second electronic device, instructing the Bluetooth device to enter the pairing mode, avoiding the need for the user to operate on the Bluetooth device to enable the Bluetooth device to enter the pairing mode, avoiding the inconvenience of the user's operation of the Bluetooth device, and improving the use of the user The feeling of bluetooth devices.
可选的,在一种实现方式中,可以在蓝牙设备与第二电子设备建立蓝牙连接后,即触发第二电子设备向蓝牙设备发送通知信息。例如,用户希望将蓝牙耳机与手机1配对,在蓝牙耳机和手机1所在的环境中,用户通常知道环境中的第二电子设备,例如,手机2。比如,手机1和手机2均为用户1使用的手机;或者,用户1使用手机1,用户1知道用户2使用手机2。这样,当用户1需要将蓝牙耳机与手机1配对时,可以打开手机2的蓝牙功能,手机2与蓝牙耳机建立蓝牙连接,并触发手机2向蓝牙耳机发送通知信息,指示蓝牙耳机进入配对模式。Optionally, in an implementation manner, after the Bluetooth device establishes a Bluetooth connection with the second electronic device, the second electronic device may be triggered to send notification information to the Bluetooth device. For example, a user wants to pair a Bluetooth headset with a mobile phone 1 . In the environment where the Bluetooth headset and the mobile phone 1 are located, the user usually knows the second electronic device in the environment, for example, the mobile phone 2 . For example, mobile phone 1 and mobile phone 2 are mobile phones used by user 1; or, user 1 uses mobile phone 1, and user 1 knows that user 2 uses mobile phone 2. In this way, when the user 1 needs to pair the Bluetooth headset with the mobile phone 1, the Bluetooth function of the mobile phone 2 can be turned on, and the mobile phone 2 establishes a Bluetooth connection with the Bluetooth headset, and triggers the mobile phone 2 to send a notification message to the Bluetooth headset, indicating that the Bluetooth headset enters pairing mode.
可选的,在另一种实现方式中,可以通过用户对第二电子设备进行第一操作,从而触发第二电子设备向蓝牙设备发送通知信息。Optionally, in another implementation manner, the user may perform a first operation on the second electronic device, thereby triggering the second electronic device to send notification information to the Bluetooth device.
其中,本实施例对用户对第二电子设备的第一操作不做限定。例如,用户的第一操作可以为下列中的任意一种:用户在第二电子设备显示的相关界面上进行的触控操作、用户在第二电子设备的显示屏上进行的手势操作、用户对第二电子设备上的物理按键进行的操作、用户通过第二电子设备的麦克风输入语音,或者,用户通过第二电子设备的摄像头输入图像。可选的,第二电子设备可以安装有用于管理蓝牙设备的应用程序(application,APP),本实施例对APP的名称和功能不做限定,对APP的相关界面中的内容和布局不做限定。Wherein, this embodiment does not limit the first operation performed by the user on the second electronic device. For example, the user's first operation may be any of the following: a touch operation performed by the user on the relevant interface displayed by the second electronic device, a gesture operation performed by the user on the display screen of the second electronic device, An operation performed by a physical button on the second electronic device, a user inputs voice through a microphone of the second electronic device, or a user inputs an image through a camera of the second electronic device. Optionally, the second electronic device may be installed with an application program (application, APP) for managing Bluetooth devices. This embodiment does not limit the name and function of the APP, and does not limit the content and layout of the relevant interface of the APP. .
下面通过示例进行说明。Let's illustrate with an example.
可选的,在一个示例中,如图7A所示,手机2当前运行系统应用程序,显示系统应用程序中的蓝牙主界面70。通过蓝牙主界面70中的已配对的设备71可知,当前,手机2 与手机1和蓝牙耳机均已进行了蓝牙连接。用户可以点击已配对的设备71中的蓝牙耳机,触发手机2向蓝牙耳机发送通知信息。相应的,手机2响应于用户的操作,向蓝牙耳机发送通知信息。Optionally, in an example, as shown in FIG. 7A , the mobile phone 2 is currently running a system application, and displays a Bluetooth main interface 70 in the system application. It can be known from the paired device 71 in the Bluetooth main interface 70 that currently, the mobile phone 2 has been connected to the mobile phone 1 and the Bluetooth earphone via Bluetooth. The user can click on the Bluetooth headset in the paired device 71 to trigger the mobile phone 2 to send notification information to the Bluetooth headset. Correspondingly, the mobile phone 2 sends notification information to the Bluetooth headset in response to the user's operation.
可选的,蓝牙主界面70中包括用于引导用户进行第一操作的提示信息。例如,在图7A中,蓝牙耳机的下方有提示信息“点击蓝牙耳机进入配对模式”。Optionally, the Bluetooth main interface 70 includes prompt information for guiding the user to perform the first operation. For example, in FIG. 7A , there is a prompt message "click the Bluetooth headset to enter pairing mode" below the Bluetooth headset.
可选的,第二电子设备向蓝牙设备发送通知信息之前,可以向用户显示提示信息。示例性的,如图7A所示,用户点击已配对的设备71中的蓝牙耳机,触发手机2向蓝牙耳机发送通知信息。相应的,如图7B所示,手机2响应于用户的操作,在蓝牙主界面70中弹出弹窗72。用户通过查看弹窗72中的提示信息进行操作。例如,提示信息包括:“蓝牙耳机进入配对模式”。弹窗72中还包括取消按键和确定按键。用户可以点击确定按键73,触发手机2向蓝牙耳机发送通知信息。相应的,手机2响应于用户点击确定按键73的操作,向蓝牙耳机发送通知信息,指示蓝牙耳机进入配对模式。Optionally, before the second electronic device sends the notification information to the Bluetooth device, it may display prompt information to the user. Exemplarily, as shown in FIG. 7A , the user clicks on the Bluetooth headset in the paired device 71 to trigger the mobile phone 2 to send notification information to the Bluetooth headset. Correspondingly, as shown in FIG. 7B , the mobile phone 2 pops up a pop-up window 72 in the Bluetooth main interface 70 in response to the user's operation. The user operates by viewing the prompt information in the pop-up window 72 . For example, the prompt information includes: "The Bluetooth headset enters pairing mode". The pop-up window 72 also includes a cancel button and a confirm button. The user can click the OK button 73 to trigger the mobile phone 2 to send notification information to the Bluetooth headset. Correspondingly, the mobile phone 2 sends notification information to the Bluetooth headset in response to the user's operation of clicking the OK button 73, instructing the Bluetooth headset to enter the pairing mode.
可选的,在另一个示例中,图8A示出了手机2的另一种界面图。图8A和图7A的区别在于:在图7A中,手机2运行系统应用程序,显示系统应用程序中的蓝牙主界面70;而在图8A中,手机2运行第三方应用程序,第三方应用程序用于管理与手机2通信的其他设备。本申请实施例对第三方应用程序的名称、功能和界面布局不做限定。例如,如图8A所示,手机2当前显示第三方应用程序中的“我的设备”界面80,与手机2通信的设备包括:门锁001、蓝牙耳机、家里的网关1和手机1。界面80中蓝牙耳机的右侧有按钮85。用户可以点击按钮85触发手机2向蓝牙耳机发送通知信息。相应的,手机2响应于用户的操作,在界面80中弹出弹窗81,参见图8B。弹窗81可以参见图7B中的弹窗72,原理相似,此处不再赘述。可选的,界面80中包括用于引导用户进行第一操作的提示信息。例如,在图8A中,蓝牙耳机的下方有提示信息“点击右侧按钮,蓝牙耳机进入配对模式”。Optionally, in another example, FIG. 8A shows another interface diagram of the mobile phone 2 . The difference between Fig. 8A and Fig. 7A is: in Fig. 7A, the mobile phone 2 runs the system application program, and displays the bluetooth main interface 70 in the system application program; while in Fig. 8A, the mobile phone 2 runs the third-party application program, and the third-party application program Other equipment for managing communication with the mobile phone 2. The embodiment of the present application does not limit the name, function and interface layout of the third-party application program. For example, as shown in FIG. 8A , the mobile phone 2 currently displays the "My Devices" interface 80 in the third-party application program, and the devices communicating with the mobile phone 2 include: door lock 001, Bluetooth headset, home gateway 1 and mobile phone 1. There is a button 85 on the right side of the Bluetooth headset in the interface 80 . The user can click the button 85 to trigger the mobile phone 2 to send notification information to the Bluetooth headset. Correspondingly, the mobile phone 2 pops up a pop-up window 81 on the interface 80 in response to the user's operation, as shown in FIG. 8B . The pop-up window 81 can refer to the pop-up window 72 in FIG. 7B , the principle is similar, so it will not be repeated here. Optionally, the interface 80 includes prompt information for guiding the user to perform the first operation. For example, in FIG. 8A , there is a prompt message "click the right button, and the Bluetooth headset enters pairing mode" below the Bluetooth headset.
需要说明,图7A~图7B、图8A~图8B仅是示例,并不对相关界面和用户的第一操作形成限定。例如,在图7A或图8A中,可以通过用户的相关操作进入蓝牙耳机的设置界面,通过在设置界面中进行第一操作,触发手机2向蓝牙耳机发送通知信息。It should be noted that FIGS. 7A to 7B and FIGS. 8A to 8B are only examples, and do not limit the relevant interface and the first operation of the user. For example, in FIG. 7A or FIG. 8A , the user can enter the setting interface of the Bluetooth headset through relevant operations, and perform the first operation in the setting interface to trigger the mobile phone 2 to send notification information to the Bluetooth headset.
可选的,通知信息可以携带在蓝牙协议中定义的交互消息中,也可以携带在第二电子设备和蓝牙设备之间定义的私有消息中,本实施例对消息的名称和通知信息在消息中的携带方式不作限定。Optionally, the notification information can be carried in the interactive message defined in the Bluetooth protocol, or in the private message defined between the second electronic device and the Bluetooth device. In this embodiment, the name of the message and the notification information are included in the message The way of carrying is not limited.
可选的,第二电子设备可以通过逻辑链路控制和适配协议(logical link control and adaptation layer protocol,L2CAP)的回声(echo或Echo或ECHO)通道发送通知信息。ECHO协议可以参考蓝牙协议的CORE Host(核心主机)章节,例如,PartA 4.8节。Optionally, the second electronic device may send the notification information through an echo (echo or Echo or ECHO) channel of a logical link control and adaptation layer protocol (L2CAP). The ECHO protocol can refer to the CORE Host (core host) chapter of the Bluetooth protocol, for example, Section 4.8 of PartA.
示例性的,图9为本申请实施例提供的第二电子设备发送通知信息的一种消息交互图。如图9所示,第二电子设备向蓝牙设备发送通知信息,可以包括:Exemplarily, FIG. 9 is a message interaction diagram for sending notification information by the second electronic device provided in the embodiment of the present application. As shown in FIG. 9, the notification information sent by the second electronic device to the Bluetooth device may include:
S91、第二电子设备向蓝牙设备发送L2CAP_ECHO_REQ(逻辑链路控制和适配协议回声请求)消息,L2CAP_ECHO_REQ消息中包括通知信息。相应的,蓝牙设备接收第二电子设备发送的L2CAP_ECHO_REQ消息。S91. The second electronic device sends an L2CAP_ECHO_REQ (Logical Link Control and Adaptation Protocol Echo Request) message to the Bluetooth device, where the L2CAP_ECHO_REQ message includes notification information. Correspondingly, the Bluetooth device receives the L2CAP_ECHO_REQ message sent by the second electronic device.
S92、蓝牙设备向第二电子设备向发送L2CAP_ECHO_RSP(逻辑链路控制和适配协议回声响应)消息,L2CAP_ECHO_RSP消息用于指示蓝牙设备接收到L2CAP_ECHO_REQ 消息。S92. The Bluetooth device sends an L2CAP_ECHO_RSP (Logical Link Control and Adaptation Protocol Echo Response) message to the second electronic device, where the L2CAP_ECHO_RSP message is used to indicate that the Bluetooth device has received the L2CAP_ECHO_REQ message.
具体的,在ECHO协议中,回声请求(Echo request或ECHO_REQ或L2CAP_ECHO_REQ)通常用于从远程L2CAP实体请求响应,回声请求可以用于测试链路或利用可选的数据字段传输特定信息。L2CAP实体接收到有效的回声请求数据包后,使用回声响应(Echo response或ECHO_RSP或L2CAP_ECHO_RSP)数据包进行应答。在本实施例中,特定信息为通知信息。Specifically, in the ECHO protocol, an echo request (Echo request or ECHO_REQ or L2CAP_ECHO_REQ) is usually used to request a response from a remote L2CAP entity, and the echo request can be used to test a link or transmit specific information using an optional data field. After the L2CAP entity receives a valid echo request packet, it responds with an echo response (Echo response or ECHO_RSP or L2CAP_ECHO_RSP) packet. In this embodiment, the specific information is notification information.
示例性的,图10A为本申请实施例提供的L2CAP_ECHO_REQ消息对应的数据包的格式示意图,图10B为本申请实施例提供的L2CAP_ECHO_RSP消息对应的数据包的格式示意图。如图10A所示,L2CAP_ECHO_REQ消息对应的数据包(Packet)的左侧为最低有效位(least significant bit,LSB),右侧为最高有效位(most significant bit,MSB),数据包包括:编码(Code)字段、标识符(Identifier)字段、长度(Length)字段和数据(Data)字段。其中,数据字段为可选字段。ECHO协议提供的数据包中,可以在可选的数据字段中携带自定义信息。在本实施例中,可以在数据字段中携带通知信息。图10B所示的L2CAP_ECHO_RSP消息对应的数据包的格式与图10A所示的L2CAP_ECHO_REQ消息对应的数据包的格式相似,其中,L2CAP_ECHO_RSP消息和L2CAP_ECHO_REQ消息中的标识符字段匹配,编码字段匹配。例如,图10A和图10B中的标识符字段的取值相同。例如,图10A中的编码字段取值为0x08,图10B中的编码字段取值为0x09。Exemplarily, FIG. 10A is a schematic diagram of the format of the data packet corresponding to the L2CAP_ECHO_REQ message provided by the embodiment of the present application, and FIG. 10B is a schematic diagram of the format of the data packet corresponding to the L2CAP_ECHO_RSP message provided by the embodiment of the present application. As shown in Figure 10A, the left side of the data packet (Packet) corresponding to the L2CAP_ECHO_REQ message is the least significant bit (least significant bit, LSB), and the right side is the most significant bit (most significant bit, MSB), and the data packet includes: encoding ( Code) field, identifier (Identifier) field, length (Length) field and data (Data) field. Among them, the data field is an optional field. In the data packet provided by the ECHO protocol, user-defined information can be carried in the optional data field. In this embodiment, the notification information may be carried in the data field. The format of the data packet corresponding to the L2CAP_ECHO_RSP message shown in FIG. 10B is similar to the format of the data packet corresponding to the L2CAP_ECHO_REQ message shown in FIG. 10A , wherein the identifier field in the L2CAP_ECHO_RSP message matches the L2CAP_ECHO_REQ message, and the encoding field matches. For example, the value of the identifier field in FIG. 10A and FIG. 10B is the same. For example, the encoding field in FIG. 10A takes a value of 0x08, and the encoding field in FIG. 10B takes a value of 0x09.
S63、蓝牙设备根据通知信息进入配对模式。S63. The Bluetooth device enters a pairing mode according to the notification information.
S64、第一电子设备从第二电子设备或蓝牙设备或第三电子设备获取配对信息,配对信息包括蓝牙设备的蓝牙地址。S64. The first electronic device acquires pairing information from the second electronic device or the Bluetooth device or the third electronic device, where the pairing information includes a Bluetooth address of the Bluetooth device.
可选的,在第一种实现方式中,由于蓝牙设备和第二电子设备已经配对成功,第二电子设备存储有蓝牙设备的蓝牙地址,第一电子设备可以从第二电子设备获取蓝牙设备的蓝牙地址。Optionally, in the first implementation manner, since the Bluetooth device and the second electronic device have been paired successfully, the second electronic device stores the Bluetooth address of the Bluetooth device, and the first electronic device can obtain the Bluetooth address of the Bluetooth device from the second electronic device. Bluetooth address.
在该实现方式中,由第二电子设备通知蓝牙设备进入配对模式,并且,由第二电子设备向第一电子设备提供配对信息,第一电子设备和蓝牙设备配对只借助于第二电子设备,涉及的设备数量少,处理步骤少,实现方式简单。In this implementation, the second electronic device notifies the Bluetooth device to enter the pairing mode, and the second electronic device provides pairing information to the first electronic device, and the first electronic device and the Bluetooth device are paired only by means of the second electronic device, The number of devices involved is small, the processing steps are few, and the implementation method is simple.
可选的,第一电子设备和第二电子设备可以进行有线通信或者无线通信,通过第一电子设备和第二电子设备之间的通信连接,第二电子设备向第一电子设备发送配对信息,相应的,第一电子设备接收第二电子设备发送的配对信息。可选的,无线通信包括但不限于下列中的任意一种:蓝牙通信、WiFi通信、NFC通信或蜂窝通信。Optionally, the first electronic device and the second electronic device may perform wired communication or wireless communication, and through the communication connection between the first electronic device and the second electronic device, the second electronic device sends pairing information to the first electronic device, Correspondingly, the first electronic device receives the pairing information sent by the second electronic device. Optionally, the wireless communication includes but is not limited to any one of the following: Bluetooth communication, WiFi communication, NFC communication or cellular communication.
可选的,第一电子设备和第二电子设备没有通信,第二电子设备显示可视化形式的配对信息,第一电子设备通过扫描可视化形式的配对信息或者对可视化形式的配对信息进行拍照,对可视化形式的配对信息进行处理从而获得配对信息。可选的,可视化形式的配对信息为根据配对信息生成的,例如,包括但不限于下列中的任意一项:二维码或条形码。Optionally, the first electronic device and the second electronic device do not communicate, and the second electronic device displays the pairing information in a visualized form. Form pairing information is processed to obtain pairing information. Optionally, the pairing information in a visualized form is generated according to the pairing information, for example, including but not limited to any one of the following: two-dimensional code or barcode.
可选的,在第二种实现方式中,第三电子设备可以获取配对信息,第一电子设备可以从第三电子设备获取配对信息。本实施例对第三电子设备获取配对信息的方式不做限定。例如,蓝牙设备和第三电子设备可以进行蓝牙通信,第三电子设备存储有蓝牙设备的蓝牙地址等配对信息。又例如,蓝牙设备可以向第三电子设备发送配对信息。可选的,为了提高配对信息的安全性,蓝牙设备可以在接收到第二电子设备发送的通知信息后,再向第三 电子设备发送配对信息。Optionally, in the second implementation manner, the third electronic device may obtain pairing information, and the first electronic device may obtain pairing information from the third electronic device. This embodiment does not limit the manner in which the third electronic device acquires the pairing information. For example, the Bluetooth device and the third electronic device can perform Bluetooth communication, and the third electronic device stores pairing information such as the Bluetooth address of the Bluetooth device. For another example, the Bluetooth device may send pairing information to the third electronic device. Optionally, in order to improve the security of the pairing information, the Bluetooth device may send the pairing information to the third electronic device after receiving the notification information sent by the second electronic device.
在该实现方式中,由第二电子设备通知蓝牙设备进入配对模式,由第三电子设备向第一电子设备提供配对信息,第一电子设备和蓝牙设备配对时需要借助于第二电子设备和第三电子设备,实现方式灵活。In this implementation, the second electronic device notifies the Bluetooth device to enter the pairing mode, and the third electronic device provides pairing information to the first electronic device, and the first electronic device and the Bluetooth device need to use the second electronic device and the second electronic device to pair Three electronic devices, flexible implementation.
可选的,第一电子设备和第三电子设备可以进行有线通信或者无线通信,通过第一电子设备和第三电子设备之间的通信连接,第三电子设备向第一电子设备发送配对信息,相应的,第一电子设备接收第三电子设备发送的配对信息。可选的,无线通信包括但不限于下列中的任意一种:蓝牙通信、WiFi通信、NFC通信或蜂窝通信。Optionally, the first electronic device and the third electronic device may perform wired communication or wireless communication, and through the communication connection between the first electronic device and the third electronic device, the third electronic device sends pairing information to the first electronic device, Correspondingly, the first electronic device receives the pairing information sent by the third electronic device. Optionally, the wireless communication includes but is not limited to any one of the following: Bluetooth communication, WiFi communication, NFC communication or cellular communication.
可选的,第一电子设备和第三电子设备没有通信,第三电子设备显示可视化形式的配对信息,第一电子设备通过扫描可视化形式的配对信息或者对可视化形式的配对信息进行拍照,对可视化形式的配对信息进行处理,可以获得配对信息。可选的,可视化形式的配对信息为根据配对信息生成的,例如,包括但不限于下列中的任意一项:二维码或条形码。Optionally, the first electronic device and the third electronic device do not communicate, and the third electronic device displays the pairing information in a visualized form. The pairing information of the form is processed, and the pairing information can be obtained. Optionally, the pairing information in a visualized form is generated according to the pairing information, for example, including but not limited to any one of the following: two-dimensional code or barcode.
可选的,第三电子设备为蓝牙设备的外接显示设备。蓝牙设备接收第二电子设备发送的通知信息进入配对模式后,根据配对信息生成可视化形式的配对信息,并向第三电子设备发送可视化形式的配对信息。相应的,第三电子设备接收蓝牙设备发送的可视化形式的配对信息,并显示。Optionally, the third electronic device is an external display device of the Bluetooth device. After receiving the notification information sent by the second electronic device, the Bluetooth device enters the pairing mode, generates pairing information in a visualized form according to the pairing information, and sends the pairing information in a visualized form to the third electronic device. Correspondingly, the third electronic device receives and displays the pairing information in visual form sent by the Bluetooth device.
可选的,在第三种实现方式中,第一电子设备可以从蓝牙设备获取配对信息。在该实现方式中,蓝牙设备可以具有显示屏,蓝牙设备接收第二电子设备发送的通知信息进入配对模式后,可以根据配对信息生成可视化形式的配对信息,并显示。相应的,第一电子设备通过扫描可视化形式的配对信息或者对可视化形式的配对信息进行拍照,对可视化形式的配对信息进行处理,可以获得配对信息。可选的,可视化形式的配对信息包括但不限于下列中的任意一项:二维码或条形码。Optionally, in the third implementation manner, the first electronic device may acquire pairing information from the Bluetooth device. In this implementation, the bluetooth device may have a display screen, and after receiving the notification information sent by the second electronic device and entering the pairing mode, the bluetooth device may generate and display pairing information in a visual form according to the pairing information. Correspondingly, the first electronic device can obtain the pairing information by scanning the pairing information in the visualized form or taking a picture of the pairing information in the visualized form and processing the pairing information in the visualized form. Optionally, the pairing information in a visual form includes but is not limited to any one of the following: two-dimensional code or barcode.
在该实现方式中,由第二电子设备通知蓝牙设备进入配对模式,由蓝牙设备向第一电子设备提供配对信息,第一电子设备和蓝牙设备配对只借助于第二电子设备,涉及的设备数量少,实现方式简单。In this implementation, the Bluetooth device is notified by the second electronic device to enter the pairing mode, and the Bluetooth device provides pairing information to the first electronic device, and the pairing between the first electronic device and the Bluetooth device only relies on the second electronic device, and the number of devices involved Less, simple implementation.
需要说明,本实施例不限定S62~S63和S64之间的执行顺序。例如,先执行S62,第二电子设备通知蓝牙设备进入配对模式,之后再执行S64,第一电子设备可以获取配对信息。又例如,先执行S64,第一电子设备可以获取配对信息,之后再执行S62,第二电子设备通知蓝牙设备进入配对模式。又例如,S62和S64可以同时执行。It should be noted that this embodiment does not limit the execution sequence between S62-S63 and S64. For example, S62 is executed first, and the second electronic device notifies the Bluetooth device to enter the pairing mode, and then S64 is executed, and the first electronic device can obtain pairing information. For another example, S64 is executed first, and the first electronic device may acquire pairing information, and then S62 is executed, and the second electronic device notifies the Bluetooth device to enter the pairing mode. For another example, S62 and S64 may be executed simultaneously.
S65、第一电子设备根据蓝牙设备的蓝牙地址向蓝牙设备发送配对请求。相应的,蓝牙设备接收第一电子设备发送的配对请求。S65. The first electronic device sends a pairing request to the Bluetooth device according to the Bluetooth address of the Bluetooth device. Correspondingly, the Bluetooth device receives the pairing request sent by the first electronic device.
S66、蓝牙设备向第一电子设备发送配对响应。相应的,第一电子设备接收蓝牙设备发送的配对响应。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.
其中,配对请求和配对响应可以分别参见图2中S24和S25的说明,此处不再赘述。Wherein, for the pairing request and the pairing response, reference may be made to the descriptions of S24 and S25 in FIG. 2 , which will not be repeated here.
可见,本实施例提供的蓝牙配对方法,应用环境中包括蓝牙设备、已经与蓝牙设备成功配对的第二电子设备和需要与蓝牙设备配对的第一电子设备。蓝牙设备与第二电子设备建立蓝牙连接后,第二电子设备向蓝牙设备发送通知信息,指示蓝牙设备进入配对模式。而且,第一电子设备可以从第二电子设备或蓝牙设备或应用环境中的其他设备获取配对信息,从而,第一电子设备和蓝牙设备可以根据配对信息完成配对。本实施例提供的蓝牙配 对方法,借助于除了第一电子设备和蓝牙设备之外的第二电子设备通知蓝牙设备进入配对模式,避免了用户必须对蓝牙设备进行操作才能触发蓝牙设备进入配对模式,消除了用户操作蓝牙设备的不便利性。而且,相比于现有的配对过程,第一电子设备不需要在蓝牙设备处于配对模式时通过向蓝牙设备发送查询请求也可以获取蓝牙设备的蓝牙地址,简化了配对过程的消息流程,提升了非首次使用的蓝牙设备与没有配对的第一电子设备完成配对过程的可实现性和便利性,提升了用户使用蓝牙耳机的感受。It can be seen that the application environment of 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. After the Bluetooth device establishes a Bluetooth connection with the second electronic device, the second electronic device sends notification information to the Bluetooth device, instructing the Bluetooth device to enter a pairing mode. Moreover, the first electronic device can obtain pairing information from the second electronic device or the Bluetooth device or other devices in the application environment, so that the first electronic device and the Bluetooth device can complete pairing according to the pairing information. The Bluetooth pairing method provided in this embodiment notifies the Bluetooth device to enter the pairing mode by means of the second electronic device except the first electronic device and the Bluetooth device, which avoids that the user must operate the Bluetooth device to trigger the Bluetooth device to enter the pairing mode, Eliminates the inconvenience for the user to operate the Bluetooth device. Moreover, compared with the existing pairing process, the first electronic device can obtain the Bluetooth address of the Bluetooth device without sending a query request to the Bluetooth device when the Bluetooth device is in the pairing mode, which simplifies the message flow of the pairing process and improves the The realization and convenience of completing the pairing process between the Bluetooth device that is not used for the first time and the first electronic device that has not been paired improves the user's experience of using the Bluetooth headset.
可选的,S64中,配对信息还可以包括蓝牙设备的能力信息。Optionally, in S64, the pairing information may also include capability information of the Bluetooth device.
通过获取蓝牙设备的能力信息,有利于后续第一电子设备和蓝牙设备的配对,提高了第一电子设备和蓝牙设备配对的准确性和适配性。Acquiring the capability information of the Bluetooth device facilitates subsequent pairing between the first electronic device and the Bluetooth device, and improves the accuracy and adaptability of pairing between the first electronic device and the Bluetooth device.
其中,能力信息可以参见图2中关于设备支持特性信息的说明,此处不再赘述。For the capability information, reference may be made to the description of the device support feature information in FIG. 2 , which will not be repeated here.
可选的,能力信息还可以指示蓝牙设备支持通过接收第二电子设备发送的通知信息进入配对模式的能力。Optionally, the capability information may also indicate that the Bluetooth device supports the capability of entering the pairing mode by receiving notification information sent by the second electronic device.
需要说明,本实施例对S64中第一电子设备获取蓝牙设备的蓝牙地址和能力信息的顺序不做限定。可选的,在第一种实现方式中,第一电子设备可以同时获取蓝牙设备的蓝牙地址和能力信息。可选的,在该种实现方式中,如果第一电子设备通过扫描可视化形式的配对信息的方式获取配对信息,可视化形式的配对信息为根据蓝牙设备的蓝牙地址和能力信息生成的。可选的,在第二种实现方式中,第一电子设备可以先获取蓝牙设备的蓝牙地址,再获取蓝牙设备的能力信息。可选的,在第三种实现方式中,第一电子设备可以先获取蓝牙设备的能力信息,再获取蓝牙设备的蓝牙地址。可选的,若第一电子设备通过与第二电子设备或第三电子设备进行消息交互获取蓝牙设备的蓝牙地址和能力信息,那么,蓝牙地址和能力信息可以携带在一条交互消息中,也可以分别携带在不同的交互消息中。It should be noted that this embodiment does not limit the order in which the first electronic device acquires the Bluetooth address and capability information of the Bluetooth device in S64. Optionally, in the first implementation manner, the first electronic device may acquire the Bluetooth address and capability information of the Bluetooth device at the same time. Optionally, in this implementation, if the first electronic device obtains the pairing information by scanning the pairing information in a visualized form, the pairing information in a visualized form is generated according to the Bluetooth address and capability information of the Bluetooth device. Optionally, in the second implementation manner, the first electronic device may first obtain the Bluetooth address of the Bluetooth device, and then obtain the capability information of the Bluetooth device. Optionally, in the third implementation manner, the first electronic device may first obtain the capability information of the Bluetooth device, 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 electronic device or the third electronic device, then the Bluetooth address and capability information may be carried in an interaction message, or They are respectively carried in different interaction messages.
可选的,S65中,第一电子设备根据蓝牙设备的蓝牙地址向蓝牙设备发送配对请求,可以包括:Optionally, in S65, the first electronic device sends a pairing request to the Bluetooth device according to the Bluetooth address of the Bluetooth device, which may include:
第一电子设备根据蓝牙设备的蓝牙地址和能力信息,向蓝牙设备发送配对请求。The first electronic device sends a pairing request to the Bluetooth device according to the Bluetooth address and capability information of the Bluetooth device.
通过蓝牙设备的蓝牙地址和能力信息进行第一电子设备与蓝牙设备的配对,提高了第一电子设备和蓝牙设备配对的准确性和适配性。The pairing between the first electronic device and the Bluetooth device is performed through the Bluetooth address and capability information of the Bluetooth device, which improves the accuracy and adaptability of the pairing between the first electronic device and the Bluetooth device.
下面,基于图6所示的实施例,提供S64中第一电子设备从第二电子设备或蓝牙设备或第三电子设备获取配对信息的具体实施方式。为了方便说明,以配对信息包括蓝牙设备的蓝牙地址和能力信息为示例。Below, based on the embodiment shown in FIG. 6 , a specific implementation manner in which the first electronic device acquires pairing information from the second electronic device or the Bluetooth device or the third electronic device in S64 is provided. For convenience of description, it is taken as an example that the pairing information includes the Bluetooth address and capability information of the Bluetooth device.
可选的,在一个实施例中,在S64中,第一电子设备通过扫描第二电子设备显示的可视化形式的配对信息的方式获取配对信息。为了方便说明,可视化形式的配对信息为二维码信息。如图11所示,S64中,第一电子设备从第二电子设备获取配对信息,可以包括:Optionally, in an embodiment, in S64, the first electronic device obtains the pairing information by scanning the pairing information displayed by the second electronic device in a visualized form. For convenience of description, the pairing information in a visualized form is QR code information. As shown in FIG. 11, in S64, the first electronic device acquires pairing information from the second electronic device, which may include:
S111、第二电子设备根据蓝牙设备的蓝牙地址和能力信息生成二维码信息。S111. The second electronic device generates two-dimensional code information according to the Bluetooth address and capability information of the Bluetooth device.
具体的,第二电子设备和蓝牙设备进行蓝牙通信,存储有蓝牙设备的蓝牙地址和能力信息。第二电子设备可以根据蓝牙设备的蓝牙地址和能力信息生成二维码信息,以便后续提供给第一电子设备。其中,生成二维码信息可以采用现有算法,本实施例不做详细说明。Specifically, the second electronic device performs Bluetooth communication with the Bluetooth device, and stores the Bluetooth address and capability information of the Bluetooth device. The second electronic device may generate two-dimensional code information according to the Bluetooth address and capability information of the Bluetooth device, so as to provide it to the first electronic device later. Wherein, existing algorithms may be used to generate the two-dimensional code information, which will not be described in detail in this embodiment.
其中,S111在S61之后执行,但并不限定S111和S62~S63之间的执行顺序。Wherein, S111 is executed after S61, but the execution sequence between S111 and S62-S63 is not limited.
可选的,在第一种实现方式中,S111在S62之前执行,并且,S61中蓝牙设备与第二 电子设备建立蓝牙连接之后,即触发第二电子设备执行S111。例如,用户使用手机1和手机2,手机2与蓝牙耳机成功配对过,手机1从未与蓝牙耳机配对。这样,当用户需要将蓝牙耳机与手机1配对时,可以打开手机2的蓝牙功能,手机2与蓝牙耳机建立蓝牙连接,触发手机2根据蓝牙耳机的蓝牙地址和能力信息生成二维码信息。Optionally, in the first implementation manner, S111 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 S111. For example, the user uses mobile phone 1 and mobile phone 2, and mobile phone 2 has successfully paired with the Bluetooth headset, but mobile phone 1 has never been paired with the Bluetooth headset. In this way, when the user needs to pair the Bluetooth headset with the mobile phone 1, the Bluetooth function of the mobile phone 2 can be turned on, and the mobile phone 2 establishes a Bluetooth connection with the Bluetooth headset, triggering the mobile phone 2 to generate two-dimensional code information according to the Bluetooth address and capability information of the Bluetooth headset.
可选的,在第二种实现方式中,S111在S62之前执行,并且,通过用户对第二电子设备进行第二操作,从而触发第二电子设备执行S111。Optionally, in the second implementation manner, 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.
示例性的,如图7A所示,手机2当前运行系统应用程序,显示系统应用程序中的蓝牙主界面70。通过蓝牙主界面70中的已配对的设备71可知,手机2与手机1和蓝牙耳机均已进行了蓝牙连接。用户可以点击已配对的设备71中的蓝牙耳机,触发手机2根据蓝牙耳机的蓝牙地址和能力信息生成二维码信息。相应的,手机2响应于用户的操作,生成二维码信息。Exemplarily, as shown in FIG. 7A , the mobile phone 2 is currently running a system application program, and displays a Bluetooth main interface 70 in the system application program. According to the paired device 71 in the Bluetooth main interface 70, it can be known that the mobile phone 2 has been connected with the mobile phone 1 and the Bluetooth headset. The user can click on the Bluetooth headset in the paired device 71 to trigger the mobile phone 2 to generate two-dimensional code information according to the Bluetooth address and capability information of the Bluetooth headset. Correspondingly, the mobile phone 2 generates two-dimensional code information in response to the user's operation.
可选的,蓝牙主界面70中包括用于引导用户进行第二操作的提示信息。例如,可以显示提示信息“点击蓝牙耳机分享蓝牙耳机的配对信息”。Optionally, the Bluetooth main interface 70 includes prompt information for guiding the user to perform the second operation. For example, a prompt message "click on the Bluetooth headset to share the pairing information of the Bluetooth headset" may be displayed.
可选的,第二电子设备根据蓝牙设备的蓝牙地址和能力信息生成二维码信息之前,可以向用户显示提示信息。Optionally, before the second electronic device generates the two-dimensional code information according to the Bluetooth address and capability information of the Bluetooth device, it may display prompt information to the user.
示例性的,在一个示例中,如图7A所示,用户点击已配对的设备71中的蓝牙耳机。相应的,如图7C所示,手机2响应于用户的操作,在蓝牙主界面70中弹出弹窗74。用户通过查看弹窗74中的提示信息进行操作。例如,提示信息包括:“显示蓝牙耳机的配对信息”。弹窗74中还包括取消按键和确定按键。用户可以点击确定按键,触发手机2根据蓝牙耳机的蓝牙地址和能力信息生成二维码信息。相应的,手机2响应于用户点击确定按键的操作,根据蓝牙耳机的蓝牙地址和能力信息生成二维码信息。Exemplarily, in an example, as shown in FIG. 7A , the user clicks on the Bluetooth headset in the paired device 71 . Correspondingly, as shown in FIG. 7C , the mobile phone 2 pops up a pop-up window 74 in the Bluetooth main interface 70 in response to the user's operation. The user operates by viewing the prompt information in the pop-up window 74 . For example, the prompt information includes: "display pairing information of the Bluetooth headset". The pop-up window 74 also includes a cancel button and a confirm button. The user can click the OK button to trigger the mobile phone 2 to generate two-dimensional code information according to the Bluetooth address and capability information of the Bluetooth headset. Correspondingly, the mobile phone 2 generates two-dimensional code information according to the Bluetooth address and capability information of the Bluetooth headset in response to the user's operation of clicking the OK button.
示例性的,在另一个示例中,如图7A所示,用户点击已配对的设备71中的蓝牙耳机。相应的,如图7D所示,手机2响应于用户的操作,在蓝牙主界面70中弹出弹窗75。用户通过查看弹窗75中的提示信息进行操作。例如,提示信息包括:“共享蓝牙耳机的配对信息”。弹窗75中包括多种配对信息的共享方式,例如,显示二维码、蓝牙分享、WiFi分享和网络分享。其中,蓝牙分享是指通过手机2和手机1之间的蓝牙通信向手机1提供配对信息,WiFi分享是指通过手机2和手机1之间的WiFi通信向手机1提供配对信息,网络分享是指通过手机2和手机1之间的蜂窝通信向手机1提供配对信息。弹窗75中还包括取消按键和确定按键,用于取消分享配对信息和确认分享配对信息。用户可以点击显示二维码方式的选择控件76,选择二维码的分享方式。如图7E所示,选择控件76的显示状态发生改变,用户继续点击确定按键,触发手机2根据蓝牙耳机的蓝牙地址和能力信息生成二维码信息。相应的,手机2响应于用户的操作,根据蓝牙耳机的蓝牙地址和能力信息生成二维码信息。Exemplarily, in another example, as shown in FIG. 7A , the user clicks on the Bluetooth headset in the paired device 71 . Correspondingly, as shown in FIG. 7D , the mobile phone 2 pops up a pop-up window 75 in the Bluetooth main interface 70 in response to the user's operation. The user operates by viewing the prompt information in the pop-up window 75 . For example, the prompt information includes: "Share the pairing information of the Bluetooth headset". The pop-up window 75 includes multiple ways of sharing pairing information, for example, displaying a QR code, Bluetooth sharing, WiFi sharing and network sharing. Among them, Bluetooth sharing refers to providing pairing information to mobile phone 1 through Bluetooth communication between mobile phone 2 and mobile phone 1, WiFi sharing refers to providing pairing information to mobile phone 1 through WiFi communication between mobile phone 2 and mobile phone 1, network sharing refers to Pairing information is provided to mobile phone 1 through cellular communication between mobile phone 2 and mobile phone 1. The pop-up window 75 also includes a cancel button and a confirm button, which are used to cancel the sharing of the pairing information and confirm the sharing of the pairing information. The user can click the selection control 76 displaying the two-dimensional code mode to select the two-dimensional code sharing mode. As shown in FIG. 7E , the display state of the selection control 76 changes, and the user continues to click the OK button, triggering the mobile phone 2 to generate two-dimensional code information according to the Bluetooth address and capability information of the Bluetooth headset. Correspondingly, the mobile phone 2 generates two-dimensional code information according to the Bluetooth address and capability information of the Bluetooth headset in response to the user's operation.
可选的,第二操作和第一操作可以为同一操作。例如,如图7A所示,用户在蓝牙主界面70中点击已配对的设备71中的蓝牙耳机,触发手机2根据蓝牙耳机的蓝牙地址和能力信息生成二维码信息,同时,触发手机2向蓝牙耳机发送通知信息。又例如,如图7B所示,用户在弹窗72中点击确定按键73,触发手机2向蓝牙耳机发送通知信息,同时,触发手机2根据蓝牙耳机的蓝牙地址和能力信息生成二维码信息。又例如,如图7C所示,用户在弹窗74中点击确定按键,触发手机2根据蓝牙耳机的蓝牙地址和能力信息生成二 维码信息,同时,触发手机2向蓝牙耳机发送通知信息。又例如,如图7E所示,用户在弹窗75中选中选择控件76,并点击确定按键,触发手机2根据蓝牙耳机的蓝牙地址和能力信息生成二维码信息,同时,触发手机2向蓝牙耳机发送通知信息。Optionally, the second operation and the first operation may be the same operation. For example, as shown in Figure 7A, the user clicks on the Bluetooth headset in the paired device 71 in the Bluetooth main interface 70, and triggers the mobile phone 2 to generate two-dimensional code information according to the Bluetooth address and capability information of the Bluetooth headset. The Bluetooth headset sends a notification message. For another example, as shown in FIG. 7B , the user clicks the OK button 73 in the pop-up window 72 to trigger the mobile phone 2 to send notification information to the Bluetooth headset, and at the same time, trigger the mobile phone 2 to generate two-dimensional code information according to the Bluetooth address and capability information of the Bluetooth headset. For another example, as shown in FIG. 7C , the user clicks the OK button in the pop-up window 74 to trigger the mobile phone 2 to generate two-dimensional code information according to the Bluetooth address and capability information of the Bluetooth headset, and at the same time, trigger the mobile phone 2 to send notification information to the Bluetooth headset. For another example, as shown in Figure 7E, the user selects the selection control 76 in the pop-up window 75, and clicks the OK button to trigger the mobile phone 2 to generate two-dimensional code information according to the Bluetooth address and capability information of the Bluetooth headset. The headset sends a notification message.
可选的,在第三种实现方式中,S111在S62之后执行,并且,S62中第二电子设备向蓝牙设备发送通知信息之后,即触发第二电子设备执行S111。Optionally, in the third implementation manner, S111 is executed after S62, and after the second electronic device sends notification information to the Bluetooth device in S62, the second electronic device is triggered to execute S111.
可选的,在第四种实现方式中,S111在S62之后执行,并且,通过用户对第二电子设备进行第二操作,从而触发第二电子设备执行S111。Optionally, in the fourth implementation manner, 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.
需要说明,图7A~图7E仅是示例,并不对用户对第二电子设备的第二操作形成限定。例如,用户的第二操作可以为下列中的任意一种:用户在第二电子设备显示的相关界面上进行的触控操作、用户在第二电子设备的显示屏上进行的手势操作、用户对第二电子设备上的物理按键进行的操作、用户通过第二电子设备的麦克风输入语音,或者,用户通过第二电子设备的摄像头输入图像。可选的,第二电子设备可以安装有用于管理蓝牙设备的APP,本实施例对APP的名称和功能不做限定,对APP的相关界面中的内容和布局不做限定。It should be noted that FIGS. 7A to 7E are only examples, and do not limit the second operation of the user on the second electronic device. For example, the user's second operation may be any of the following: a touch operation performed by the user on the relevant interface displayed by the second electronic device, a gesture operation performed by the user on the display screen of the second electronic device, An operation performed by a physical button on the second electronic device, a user inputs voice through a microphone of the second electronic device, or a user inputs an image through a camera of the second electronic device. Optionally, the second electronic device may be installed with an APP for managing the Bluetooth device. In this embodiment, the name and function of the APP are not limited, and the content and layout of the relevant interface of the APP are not limited.
S112、第二电子设备显示二维码信息。S112. The second electronic device displays the two-dimensional code information.
其中,本实施例对第二电子设备显示二维码信息的界面和界面布局不做限定。Wherein, this embodiment does not limit the interface and interface layout of the second electronic device for displaying the two-dimensional code information.
示例性的,在一个示例中,如图7F所示,手机2当前运行系统应用程序,显示系统应用程序中的蓝牙主界面70。蓝牙主界面70中包括二维码界面77。二维码界面77中包括二维码信息和提示信息。二维码信息为手机2根据蓝牙耳机的蓝牙地址和能力信息生成的。提示信息包括:“请扫描二维码”。用户通过查看二维码界面77中的提示信息进行操作,例如,使用手机1扫描二维码信息,从而,手机1可以获取到蓝牙耳机的配对信息。Exemplarily, in an example, as shown in FIG. 7F , the mobile phone 2 is currently running a system application program, and displays the Bluetooth main interface 70 in the system application program. The Bluetooth main interface 70 includes a two-dimensional code interface 77 . The two-dimensional code interface 77 includes two-dimensional code information and prompt information. The two-dimensional code information is generated by the mobile phone 2 according to the Bluetooth address and capability information of the Bluetooth headset. The prompt information includes: "Please scan the QR code". The user operates by viewing the prompt information in the two-dimensional code interface 77, for example, using the mobile phone 1 to scan the two-dimensional code information, so that the mobile phone 1 can obtain the pairing information of the Bluetooth headset.
可选的,在另一个示例中,如图8C所示。图8C和图7F的区别在于:在图7F中,手机2运行系统应用程序,显示系统应用程序中的蓝牙主界面70;而在图8C中,手机2运行第三方应用程序,第三方应用程序用于管理与手机2通信的其他设备,手机2当前显示第三方应用程序中的“我的设备”界面80,界面80中包括二维码界面82。二维码界面82可以参见图7F中的二维码界面77,原理相似,此处不再赘述。Optionally, in another example, as shown in Fig. 8C. The difference between Fig. 8C and Fig. 7F is: in Fig. 7F, the mobile phone 2 runs the system application program, and displays the bluetooth main interface 70 in the system application program; while in Fig. 8C, the mobile phone 2 runs the third-party application program, and the third-party application program It is used to manage other devices communicating with the mobile phone 2. The mobile phone 2 currently displays the “My Device” interface 80 in the third-party application program, and the interface 80 includes a two-dimensional code interface 82 . For the two-dimensional code interface 82, refer to the two-dimensional code interface 77 in FIG. 7F , the principle is similar and will not be repeated here.
S113、第一电子设备扫描第二电子设备显示的二维码信息。S113. The first electronic device scans the two-dimensional code information displayed by the second electronic device.
其中,本实施例对第一电子设备运行扫描功能的过程不做限定,例如,第一电子设备可以运行具有扫描功能的APP,通过与用户之间的人机互动启动扫描功能。Wherein, this embodiment does not limit the process of running the scanning function on the first electronic device. For example, the first electronic device may run an APP with the scanning function, and activate the scanning function through human-computer interaction with the user.
S114、第一电子设备解析二维码信息,获得蓝牙设备的蓝牙地址和能力信息。S114. The first electronic device parses the two-dimensional code information to obtain the Bluetooth address and capability information of the Bluetooth device.
可见,本实施例提供的蓝牙配对方法,第一电子设备从第二电子设备获取蓝牙设备的配对信息。由于第二电子设备和蓝牙耳机进行蓝牙通信,第二电子设备中存储有蓝牙设备的蓝牙地址和能力信息,不需要通过额外的方式获取。第二电子设备根据蓝牙设备的配对信息生成可视化形式的配对信息并显示。第一电子设备不需要与第二电子设备进行通信,通过扫描或拍照等方式可以获取可视化形式的配对信息,进而获得配对信息。本实施例提供的蓝牙配对方法,第一电子设备从第二电子设备获得配对信息,涉及的设备数量少,处理步骤少,实现方式简单。It can be seen that 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 perform Bluetooth communication, the Bluetooth address and capability information of the Bluetooth device is stored in the second electronic device, which does not need to be obtained through an additional method. The second electronic device generates and displays pairing information in a visualized form according to the pairing information of the Bluetooth device. The first electronic device does not need to communicate with the second electronic device, and can obtain pairing information in a visualized form by scanning or taking pictures, and then obtain the pairing information. In the Bluetooth pairing method provided in this embodiment, the first electronic device obtains pairing information from the second electronic device, the number of devices involved is small, the processing steps are few, and the implementation is simple.
示例性的,以蓝牙设备为蓝牙耳机、第一电子设备为手机1、第二电子设备为手机2为例,结合图12对本实施例提供的蓝牙配对方法的流程进行示例性说明。Exemplarily, taking the Bluetooth headset as the Bluetooth headset, the mobile phone 1 as the first electronic device, and the mobile phone 2 as the second electronic device, the flow of the Bluetooth pairing method provided in this embodiment is exemplarily described with reference to FIG. 12 .
如图12所示,本实施例提供的蓝牙配对方法,可以包括:As shown in Figure 12, the Bluetooth pairing method provided in this embodiment may include:
11.手机2和蓝牙耳机建立蓝牙连接。11. The mobile phone 2 establishes a Bluetooth connection with the Bluetooth headset.
12.手机2获取蓝牙耳机的蓝牙地址和能力信息,根据蓝牙耳机的蓝牙地址和能力信息生成二维码,并显示二维码。12. The mobile phone 2 acquires the Bluetooth address and capability information of the Bluetooth headset, generates a QR code according to the Bluetooth address and capability information of the Bluetooth headset, and displays the QR code.
13.手机2向蓝牙耳机发送通知信息,通知信息用于指示蓝牙耳机进入配对模式。13. The mobile phone 2 sends notification information to the Bluetooth headset, and the notification information is used to instruct the Bluetooth headset to enter the pairing mode.
14.蓝牙耳机接收手机2发送的通知信息,根据通知信息进入配对模式。14. The Bluetooth headset receives the notification information sent by the mobile phone 2, and enters the pairing mode according to the notification information.
15.手机1启动扫描功能,扫描手机2显示的二维码。15. Mobile phone 1 starts the scanning function, and scans the QR code displayed on mobile phone 2.
16.手机1解析扫描的二维码,获取蓝牙耳机的蓝牙地址和能力信息。16. The mobile phone 1 parses the scanned QR code to obtain the Bluetooth address and capability information of the Bluetooth headset.
17.手机1根据蓝牙耳机的蓝牙地址和能力信息,向蓝牙耳机发送配对请求,发起配对。17. The mobile phone 1 sends a pairing request to the Bluetooth headset according to the Bluetooth address and capability information of the Bluetooth headset, and initiates pairing.
18.蓝牙耳机接收手机1发送的配对请求后,向手机发送配对响应。18. After receiving the pairing request sent by mobile phone 1, the Bluetooth headset sends a pairing response to the mobile phone.
可选的,在另一个实施例中,在S64中,第一电子设备通过与第二电子设备之间的通信连接从第二电子设备获取配对信息。如图13所示,S64中,第一电子设备从第二电子设备获取配对信息,可以包括:Optionally, in another embodiment, in S64, the first electronic device acquires pairing information from the second electronic device through a communication connection with the second electronic device. As shown in FIG. 13, in S64, the first electronic device acquires pairing information from the second electronic device, which may include:
S131、第二电子设备和第一电子设备建立通信连接。其中,通信连接包括下列中的任意一种:蓝牙连接、WiFi连接或蜂窝通信连接。S131. The second electronic device establishes a communication connection with the first electronic device. Wherein, the communication connection includes any one of the following: Bluetooth connection, WiFi connection or cellular communication connection.
本实施例对第二电子设备和第一电子设备建立通信连接的时间不做限定,对S131和S62~S63之间的执行顺序不做限定。In this embodiment, the time for establishing a communication connection between the second electronic device and the first electronic device is not limited, and the execution sequence between S131 and S62-S63 is not limited.
可选的,在第一种实现方式中,第二电子设备和第一电子设备当前未建立通信连接,在S61中蓝牙设备与第二电子设备建立蓝牙连接之后,第二电子设备和第一电子设备建立通信连接。可选的,S131可以在S62之前执行,也可以在S62之后执行,也可以与S62同时执行。Optionally, in the first implementation manner, the second electronic device and the first electronic device have not currently 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 The device establishes a communication connection. Optionally, S131 may be performed before S62, may be performed after S62, or may be performed simultaneously with S62.
在第一种实现方式中,可选的,S131在S62之前执行,并且,S61中蓝牙设备与第二电子设备建立蓝牙连接之后,即触发第二电子设备执行S131。该实现方式适用于环境中仅存在第一电子设备、第二电子设备和蓝牙设备的场景。例如,用户使用手机1和手机2,手机2与蓝牙耳机成功配对过,手机1从未与蓝牙耳机配对。当用户需要将蓝牙耳机与手机1配对时,蓝牙耳机上电,用户打开手机1和手机2的蓝牙功能。这样,通过蓝牙技术,手机2可以搜索到手机1。手机2与蓝牙耳机建立蓝牙连接后,可以触发手机2与手机1建立通信连接,以便于后续向手机1发送蓝牙设备的配对信息。可选的,手机1、手机2和蓝牙耳机可以登录同一用户账号。In the first implementation manner, optionally, S131 is performed 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 applicable to a scenario where only the first electronic device, the second electronic device and the Bluetooth device exist in the environment. For example, the user uses mobile phone 1 and mobile phone 2, and mobile phone 2 has successfully paired with the Bluetooth headset, but mobile phone 1 has never been paired with the Bluetooth headset. When the user needs to pair the Bluetooth headset with the mobile phone 1, the Bluetooth headset is powered on, and the user turns on the Bluetooth functions of the mobile phone 1 and the mobile phone 2. In this way, the mobile phone 2 can search for the mobile phone 1 through the Bluetooth technology. After the mobile phone 2 establishes a Bluetooth connection with the Bluetooth headset, it can trigger the mobile phone 2 to establish a communication connection with the mobile phone 1, so as to send pairing information of the Bluetooth device to the mobile phone 1 subsequently. Optionally, the mobile phone 1, the mobile phone 2 and the Bluetooth headset can log in to the same user account.
在第一种实现方式中,可选的,S131在S62之前执行,并且,通过用户对第二电子设备进行第三操作,从而触发第二电子设备执行S131。In the first implementation manner, optionally, S131 is performed before S62, and the second electronic device is triggered to perform S131 by the user performing a third operation on the second electronic device.
需要说明,本实施例对用户对第二电子设备的第三操作不做限定,可以为设备间用于分享文件或信息的任意操作。例如,第三操作为用户在手机2上通过蓝牙向手机1传输文件的操作。又例如,第三操作为用户在手机2上利用聊天类APP通过移动网络向手机1发送信息的操作。可选的,用户的第三操作可以为下列中的任意一种:用户在第二电子设备显示的相关界面上进行的触控操作、用户在第二电子设备的显示屏上进行的手势操作、用户对第二电子设备上的物理按键进行的操作、用户通过第二电子设备的麦克风输入语音,或者,用户通过第二电子设备的摄像头输入图像。可选的,第二电子设备可以安装有用于 管理蓝牙设备的APP,本实施例对APP的名称和功能不做限定,对APP的相关界面中的内容和布局不做限定。It should be noted that in this embodiment, the third operation performed by the user on the second electronic device is not limited, and may be any operation for sharing files or information between devices. For example, the third operation is an operation in which the user transmits a file to the mobile phone 1 on the mobile phone 2 via Bluetooth. For another example, the third operation is an operation in which the user uses a chat app on the mobile phone 2 to send information to the mobile phone 1 through the mobile network. Optionally, the user's third operation may be any of the following: a touch operation performed by the user on a relevant interface displayed on the second electronic device, a gesture operation performed by the user on the display screen of the second electronic device, The user operates the physical keys on the second electronic device, the user inputs voice through the microphone of the second electronic device, or the user inputs images through the camera of the second electronic device. Optionally, the second electronic device may be installed with an APP for managing the Bluetooth device. This embodiment does not limit the name and function of the APP, and does not limit the content and layout of the relevant interface of the APP.
可选的,第二电子设备的相关界面中可以包括用于引导用户进行第三操作的提示信息,本实施例对提示信息的内容不做限定。Optionally, the relevant interface of the second electronic device may include prompt information for guiding the user to perform the third operation, and the content of the prompt information is not limited in this embodiment.
示例性的,如图8A所示,手机2运行第三方应用程序,第三方应用程序用于管理与手机2通信的其他设备,手机2当前显示第三方应用程序中的“我的设备”界面80。界面80中包括手机1,手机1当前与手机2未连接。用户可以点击手机1,触发手机2与手机1建立通信连接,以便于后续手机2向手机1发送蓝牙设备的配对信息。相应的,手机2响应于用户的操作,与手机1建立通信连接。该场景适用于用户知道需要向手机1分享蓝牙耳机的配对信息。Exemplarily, as shown in FIG. 8A, the mobile phone 2 runs a third-party application program, and the third-party application program is used to manage other devices communicating with the mobile phone 2, and the mobile phone 2 currently displays the "my device" interface 80 in the third-party application program . The interface 80 includes the mobile phone 1, and the mobile phone 1 is not connected to the mobile phone 2 currently. The user can click on the mobile phone 1 to trigger the mobile phone 2 to establish a communication connection with the mobile phone 1, so that the subsequent mobile phone 2 can send the Bluetooth device pairing information to the mobile phone 1. Correspondingly, the mobile phone 2 establishes a communication connection with the mobile phone 1 in response to the user's operation. This scenario is applicable when the user knows that the pairing information of the Bluetooth headset needs to be shared with the mobile phone 1 .
可选的,第二电子设备与第一电子设备建立通信连接前,可以向用户显示提示信息。Optionally, before the second electronic device establishes a communication connection with the first electronic device, it may display prompt information to the user.
示例性的,如图8A所示,用户点击手机1。相应的,如图8D所示,手机2响应于用户的操作,在界面80中弹出弹窗83。弹窗83可以参见图7E中弹框75的描述,原理相似,此处不再赘述。用户可以点击WiFi分享的选择控件84,使得手机2通过手机2和手机1之间的WiFi通信向手机1发送配对信息。如图8E所示,选择控件84的显示状态发生改变,用户继续点击确定按键,触发手机2和手机1建立WiFi连接。相应的,手机2响应于用户的操作,和手机1建立WiFi连接。Exemplarily, as shown in FIG. 8A , the user clicks on the mobile phone 1 . Correspondingly, as shown in FIG. 8D , the mobile phone 2 pops up a pop-up window 83 on the interface 80 in response to the user's operation. For the pop-up window 83, refer to the description of the pop-up frame 75 in FIG. 7E , the principle is similar, and will not be repeated here. The user can click the selection control 84 for WiFi sharing, so that the mobile phone 2 can send pairing information to the mobile phone 1 through the WiFi communication between the mobile phone 2 and the mobile phone 1 . As shown in FIG. 8E , the display state of the selection control 84 changes, and the user continues to click the OK button, which triggers the mobile phone 2 to establish a WiFi connection with the mobile phone 1 . Correspondingly, the mobile phone 2 establishes a WiFi connection with the mobile phone 1 in response to the user's operation.
在第一种实现方式中,可选的,S131在S62之后执行,并且,S62中第二电子设备向蓝牙设备发送通知信息之后,即触发第二电子设备执行S131。该实现方式适用于环境中仅存在第一电子设备、第二电子设备和蓝牙设备的场景。In the first implementation manner, optionally, S131 is performed after S62, and after the second electronic device sends notification information to the Bluetooth device in S62, the second electronic device is triggered to perform S131. This implementation is applicable to a scenario where only the first electronic device, the second electronic device and the Bluetooth device exist in the environment.
在第一种实现方式中,可选的,S131在S62之后执行,并且,通过用户对第二电子设备进行第三操作,从而触发第二电子设备执行S131。In the first implementation manner, optionally, S131 is performed after S62, and the second electronic device is triggered to perform S131 by the user performing a third operation on the second electronic device.
示例性的,一种界面变化过程如下:如图8A所示,用户点击按钮85,触发手机2向蓝牙耳机发送通知信息,同时,触发手机2分享配对信息。手机2响应于用户点击按钮85的操作,如图8D所示,在界面80中弹出弹窗83。用户可以点击WiFi分享的选择控件84,使得手机2通过WiFi通信分享配对信息。如图8E所示,选择控件84的显示状态发生改变,用户继续点击确定按键,相应的,手机2响应于用户点击确定按键的操作,搜索周围可进行WiFi通信的设备,显示WiFi设备列表86,如图8F所示。在WiFi设备列表86中,手机2可进行WiFi通信的设备包括手机1、手机3和手机4。每个手机的右侧具有选择控件87。用户可以点击手机1右侧的选择控件87,再点击分享按键88,触发手机2和手机1建立WiFi连接。相应的,手机2响应于用户的操作,和手机1建立WiFi连接。在该实现方式中,手机2可以搜索并显示周围可通信的设备并向用户显示设备列表,以便于用户选定分享蓝牙耳机的配对信息的设备,便于用户操作。Exemplarily, an interface change process is as follows: as shown in FIG. 8A , the user clicks the button 85 to trigger the mobile phone 2 to send notification information to the Bluetooth headset, and at the same time, trigger the mobile phone 2 to share the pairing information. The mobile phone 2 responds to the user's operation of clicking the button 85 , as shown in FIG. 8D , a pop-up window 83 pops up on the interface 80 . The user can click the selection control 84 for WiFi sharing, so that the mobile phone 2 can share the pairing information through WiFi communication. As shown in FIG. 8E , the display state of the selection control 84 changes, and the user continues to click the OK button. Correspondingly, the mobile phone 2 searches for surrounding devices that can perform WiFi communication in response to the operation of the user clicking the OK button, and displays a WiFi device list 86. As shown in Figure 8F. In the WiFi device list 86 , the devices that the mobile phone 2 can perform WiFi communication include mobile phone 1 , mobile phone 3 and mobile phone 4 . Each handset has selection controls 87 on the right side. The user can click the selection control 87 on the right side of the mobile phone 1, and then click the sharing button 88 to trigger the mobile phone 2 and the mobile phone 1 to establish a WiFi connection. Correspondingly, the mobile phone 2 establishes a WiFi connection with the mobile phone 1 in response to the user's operation. In this implementation, the mobile phone 2 can search for and display the surrounding communicable devices and display a device list to the user, so that the user can select a device to share the pairing information of the Bluetooth headset, which is convenient for the user to operate.
可选的,在第二种实现方式中,当蓝牙设备需要与第一电子设备配对时,第二电子设备和第一电子设备已经建立有通信连接。例如,用户需要将手机1与蓝牙耳机配对时,手机1和手机2已经通过蓝牙连接传输音频文件。Optionally, in the second implementation manner, when the Bluetooth device needs to be paired with the first electronic device, the second electronic device has established a communication connection with the first electronic device. For example, when the user needs to pair the mobile phone 1 with the Bluetooth headset, the mobile phone 1 and the mobile phone 2 have already transmitted audio files through the Bluetooth connection.
S132、第二电子设备根据蓝牙设备的蓝牙地址和能力信息生成共享信息。S132. The second electronic device generates shared information according to the Bluetooth address and capability information of the Bluetooth device.
具体的,第二电子设备和蓝牙设备进行蓝牙通信,存储有蓝牙设备的蓝牙地址和能力信息。第二电子设备根据蓝牙设备的蓝牙地址和能力信息生成共享信息。Specifically, the second electronic device performs Bluetooth communication with the Bluetooth device, and stores the Bluetooth address and capability information of the Bluetooth device. The second electronic device generates shared information according to the Bluetooth address and capability information of the Bluetooth device.
其中,本实施例对共享信息的形式不做限定。例如,共享信息可以为下列中的任意一种形式:文本格式、文件格式或图像。Wherein, this embodiment does not limit the form of the shared information. For example, shared information can be in any of the following forms: text format, file format, or image.
可选的,第二电子设备可以对蓝牙设备的蓝牙地址和能力信息进行加密,生成共享信息。本实施例对加密算法不做限定。Optionally, the second electronic device may encrypt the Bluetooth address and capability information of the Bluetooth device to generate shared information. This embodiment does not limit the encryption algorithm.
S133、第二电子设备通过通信连接向第一电子设备发送共享信息。相应的,第一电子设备通过通信连接接收第二电子设备发送的共享信息。S133. The second electronic device sends the sharing information to the first electronic device through the communication connection. Correspondingly, the first electronic device receives the sharing information sent by the second electronic device through the communication connection.
S134、第一电子设备解析共享信息,获得蓝牙设备的蓝牙地址和能力信息。S134. The first electronic device parses the shared information to obtain the Bluetooth address and capability information of the Bluetooth device.
可选的,第一电子设备可以对共享信息进行解密,获得蓝牙设备的蓝牙地址和能力信息。其中,第一电子设备使用的解密算法与第二电子设备使用的加密算法匹配。Optionally, the first electronic device may decrypt the shared information to obtain the Bluetooth address and capability information of the Bluetooth device. Wherein, the decryption algorithm used by the first electronic device matches the encryption algorithm used by the second electronic device.
可选的,在一种实现方式中,第一电子设备接收到共享信息后,自动解析共享信息,获得蓝牙设备的蓝牙地址和能力信息。该种方式实现简单。Optionally, in an implementation manner, 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.
可选的,在另一种实现方式中,第一电子设备接收到共享信息后,需要用户对第二电子设备进行操作,从而第二电子设备响应于用户的操作,解析共享信息。例如,第一电子设备接收共享信息后存储在默认文件夹中。用户可以打开默认文件夹,点击共享信息。第二电子设备响应于用户的点击操作,解析共享信息。该种方式更为灵活,提高了第二电子设备解析共享信息的准确性和安全性。Optionally, in another implementation manner, after receiving the shared information, the first electronic device requires the user to operate the second electronic device, so that the second electronic device parses the shared information in response to the user's operation. For example, the first electronic device stores the shared information in a default folder after receiving it. Users can open the default folder and click Share Information. The second electronic device analyzes the shared information in response to the user's click operation. This method is more flexible, and improves the accuracy and security of the second electronic device in parsing the shared information.
可见,本实施例提供的蓝牙配对方法,第一电子设备从第二电子设备获取蓝牙设备的配对信息。由于第二电子设备和蓝牙耳机进行蓝牙通信,第二电子设备中存储有蓝牙设备的蓝牙地址和能力信息,不需要通过额外的方式获取。第二电子设备通过与第一电子设备之间的通信连接向第一电子设备提供配对信息。本实施例提供的蓝牙配对方法,第一电子设备从第二电子设备获得配对信息,涉及的设备数量少,实现方式简单。It can be seen that 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 perform Bluetooth communication, the Bluetooth address and capability information of the Bluetooth device is stored in the second electronic device, which does not need to be obtained through an additional method. The second electronic device provides pairing information to the first electronic device through a communication connection with the first electronic device. In the Bluetooth pairing method provided in this embodiment, the first electronic device obtains pairing information from the second electronic device, the number of devices involved is small, and the implementation method is simple.
示例性的,以蓝牙设备为蓝牙耳机、第一电子设备为手机1、第二电子设备为手机2为例,结合图14对本实施例提供的蓝牙配对方法的流程进行示例性说明。Exemplarily, taking the Bluetooth headset as the Bluetooth headset, the mobile phone 1 as the first electronic device, and the mobile phone 2 as the second electronic device, the flow of the Bluetooth pairing method provided in this embodiment is exemplarily described with reference to FIG. 14 .
如图14所示,本实施例提供的蓝牙配对方法,可以包括:As shown in Figure 14, the Bluetooth pairing method provided in this embodiment may include:
21.手机2和蓝牙耳机建立蓝牙连接。21. The mobile phone 2 establishes a Bluetooth connection with the Bluetooth headset.
22.手机2向蓝牙耳机发送通知信息,通知信息用于指示蓝牙耳机进入配对模式。22. The mobile phone 2 sends notification information to the Bluetooth headset, and the notification information is used to instruct the Bluetooth headset to enter the pairing mode.
23.手机2根据蓝牙耳机的蓝牙地址和能力信息生成共享信息。23. The mobile phone 2 generates shared information according to the Bluetooth address and capability information of the Bluetooth headset.
24.手机2通过与手机1之间的通信连接向手机1发送共享信息。24. The mobile phone 2 sends the shared information to the mobile phone 1 through the communication connection with the mobile phone 1 .
25.蓝牙耳机接收手机2发送的通知信息,根据通知信息进入配对模式。25. The Bluetooth headset receives the notification information sent by the mobile phone 2, and enters the pairing mode according to the notification information.
26.手机1接收手机2发送的共享信息,解析共享信息,获取蓝牙耳机的蓝牙地址和能力信息。26. The mobile phone 1 receives the shared information sent by the mobile phone 2, analyzes the shared information, and obtains the Bluetooth address and capability information of the Bluetooth headset.
27.手机1根据蓝牙耳机的蓝牙地址和能力信息,向蓝牙耳机发送配对请求,发起配对。27. The mobile phone 1 sends a pairing request to the Bluetooth headset according to the Bluetooth address and capability information of the Bluetooth headset, and initiates pairing.
28.蓝牙耳机接收手机1发送的配对请求后,向手机发送配对响应。28. After receiving the pairing request sent by the mobile phone 1, the Bluetooth headset sends a pairing response to the mobile phone.
可选的,在又一个实施例中,第三电子设备作为蓝牙设备的外接显示设备,S64中,第一电子设备可以通过扫描第三电子设备显示的可视化形式的配对信息的方式获取配对信息,S64在S62之后执行。为了方便说明,可视化形式的配对信息为二维码信息。如图15所示,S64中,第一电子设备从第三电子设备获取配对信息,可以包括:Optionally, in yet another embodiment, the third electronic device is used as an external display device of the Bluetooth device. In S64, the first electronic device may acquire pairing information by scanning the pairing information displayed by the third electronic device in a visual form, S64 is executed after S62. For convenience of description, the pairing information in a visualized form is QR code information. As shown in FIG. 15, in S64, the first electronic device acquires pairing information from the third electronic device, which may include:
S151、蓝牙设备根据蓝牙设备的蓝牙地址和能力信息生成二维码信息。S151. The Bluetooth device generates two-dimensional code information according to the Bluetooth address and capability information of the Bluetooth device.
S152、蓝牙设备向第三电子设备发送二维码信息,相应的,第三电子设备接收蓝牙设备发送的二维码信息。S152. The bluetooth device sends the two-dimensional code information to the third electronic device, and correspondingly, the third electronic device receives the two-dimensional code information sent by the bluetooth device.
S153、第三电子设备显示二维码信息。S153. The third electronic device displays the two-dimensional code information.
其中,本实施例对第三电子设备显示二维码信息的界面和界面布局不做限定。Wherein, this embodiment does not limit the interface and interface layout of the third electronic device for displaying the two-dimensional code information.
S154、第一电子设备扫描第三电子设备显示的二维码信息。S154. The first electronic device scans the two-dimensional code information displayed by the third electronic device.
其中,本实施例对第一电子设备运行扫描功能的过程不做限定,例如,第一电子设备可以运行具有扫描功能的APP,通过与用户之间的人机互动启动扫描功能。Wherein, this embodiment does not limit the process of running the scanning function on the first electronic device. For example, the first electronic device may run an APP with the scanning function, and activate the scanning function through human-computer interaction with the user.
S155、第一电子设备解析二维码信息,获得蓝牙设备的蓝牙地址和能力信息。S155. The first electronic device parses the two-dimensional code information to obtain the Bluetooth address and capability information of the Bluetooth device.
可见,本实施例提供的蓝牙配对方法,第一电子设备从第三电子设备获取蓝牙设备的配对信息。在蓝牙设备接收第二电子设备发送的通知信息后,确定需要进入配对模式。蓝牙设备可以根据蓝牙设备的蓝牙地址和能力信息生成可视化形式的配对信息,并通过第三电子设备进行显示。由于由蓝牙设备确定提供配对信息,提高了第一电子设备获得配对信息的安全性。第一电子设备不需要与第三电子设备进行通信,通过扫描或拍照等方式可以获取可视化形式的配对信息,进而获得配对信息。本实施例提供的蓝牙配对方法,提高了第一电子设备获得配对信息的安全性,而且实现方式更加灵活。It can be seen that 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 the pairing mode. The bluetooth device can generate pairing information in a visual form according to the bluetooth address and capability information of the bluetooth device, and display it through the third electronic device. Since the pairing information is determined to be provided by the Bluetooth device, the security of obtaining the pairing information by the first electronic device is improved. The first electronic device does not need to communicate with the third electronic device, and can obtain pairing information in a visualized form by scanning or taking pictures, and then obtain the pairing information. The Bluetooth pairing method provided in this embodiment improves the security of the pairing information obtained by the first electronic device, and the implementation method is more flexible.
示例性的,以蓝牙设备为蓝牙耳机、第一电子设备为手机1、第二电子设备为手机2、第三电子设备为显示器3为例,结合图16对本实施例提供的蓝牙配对方法的流程进行示例性说明。Exemplarily, taking the Bluetooth device as a Bluetooth headset, the first electronic device as a mobile phone 1, the second electronic device as a mobile phone 2, and the third electronic device as a display 3, the flow of the Bluetooth pairing method provided in this embodiment is described in conjunction with FIG. 16 Give an example.
如图16所示,本实施例提供的蓝牙配对方法,可以包括:As shown in Figure 16, the Bluetooth pairing method provided in this embodiment may include:
31.手机2和蓝牙耳机建立蓝牙连接。31. The mobile phone 2 establishes a Bluetooth connection with the Bluetooth headset.
32.手机2向蓝牙耳机发送通知信息,通知信息用于指示蓝牙耳机进入配对模式。32. The mobile phone 2 sends notification information to the Bluetooth headset, and the notification information is used to instruct the Bluetooth headset to enter the pairing mode.
33.蓝牙耳机接收手机2发送的通知信息,根据通知信息进入配对模式,并根据蓝牙耳机的蓝牙地址和能力信息生成二维码。33. The Bluetooth headset receives the notification information sent by the mobile phone 2, enters the pairing mode according to the notification information, and generates a QR code according to the Bluetooth address and capability information of the Bluetooth headset.
34.蓝牙耳机向显示器3发送二维码。34. The Bluetooth headset sends a QR code to the display 3 .
35.显示器3接收蓝牙耳机发送的二维码,并显示二维码。35. The display 3 receives the two-dimensional code sent by the Bluetooth headset, and displays the two-dimensional code.
36.手机1启动扫描功能,扫描显示器3显示的二维码。36. The mobile phone 1 activates the scanning function, and scans the QR code displayed on the display 3 .
37.手机1解析扫描的二维码,获取蓝牙耳机的蓝牙地址和能力信息。37. The mobile phone 1 parses the scanned QR code to obtain the Bluetooth address and capability information of the Bluetooth headset.
38.手机1根据蓝牙耳机的蓝牙地址和能力信息,向蓝牙耳机发送配对请求,发起配对。38. The mobile phone 1 sends a pairing request to the Bluetooth headset according to the Bluetooth address and capability information of the Bluetooth headset, and initiates pairing.
39.蓝牙耳机接收手机1发送的配对请求后,向手机发送配对响应。39. After receiving the pairing request sent by the mobile phone 1, the Bluetooth headset sends a pairing response to the mobile phone.
可选的,在又一个实施例中,蓝牙设备自身可以具有显示屏,S64中,第一电子设备可以通过扫描蓝牙设备显示的可视化形式的配对信息的方式获取配对信息,S64在S62之后执行。为了方便说明,可视化形式的配对信息为二维码信息。如图17所示,S64中,第一电子设备从蓝牙设备获取配对信息,可以包括:Optionally, in yet another embodiment, the Bluetooth device itself may have a display screen. In S64, the first electronic device may obtain pairing information by scanning the pairing information in visual form displayed by the Bluetooth device. S64 is performed after S62. For convenience of description, the pairing information in a visualized form is QR code information. As shown in FIG. 17, in S64, the first electronic device acquires pairing information from the Bluetooth device, which may include:
S171、蓝牙设备根据蓝牙设备的蓝牙地址和能力信息生成二维码信息。S171. The Bluetooth device generates two-dimensional code information according to the Bluetooth address and capability information of the Bluetooth device.
S172、蓝牙设备显示二维码信息。S172. The Bluetooth device displays the two-dimensional code information.
其中,本实施例对蓝牙设备显示二维码信息的界面和界面布局不做限定。Wherein, this embodiment does not limit the interface and interface layout of the bluetooth device displaying the two-dimensional code information.
S173、第一电子设备扫描蓝牙设备显示的二维码信息。S173. The first electronic device scans the two-dimensional code information displayed by the Bluetooth device.
其中,本实施例对第一电子设备运行扫描功能的过程不做限定,例如,第一电子设备可以运行具有扫描功能的APP,通过与用户之间的人机互动启动扫描功能。Wherein, this embodiment does not limit the process of running the scanning function on the first electronic device. For example, the first electronic device may run an APP with the scanning function, and activate the scanning function through human-computer interaction with the user.
S174、第一电子设备解析二维码信息,获得蓝牙设备的蓝牙地址和能力信息。S174. The first electronic device parses the two-dimensional code information to obtain the Bluetooth address and capability information of the Bluetooth device.
可见,本实施例提供的蓝牙配对方法,第一电子设备从蓝牙设备获取蓝牙设备的配对信息。在蓝牙设备接收第二电子设备发送的通知信息后,确定需要进入配对模式。蓝牙设备可以根据蓝牙设备的蓝牙地址和能力信息生成可视化形式的配对信息,并显示。由于由蓝牙设备确定提供配对信息,提高了第一电子设备获得配对信息的安全性。第一电子设备不需要与蓝牙设备进行通信,通过扫描或拍照等方式可以获取可视化形式的配对信息,进而获得配对信息。本实施例提供的蓝牙配对方法,提高了第一电子设备获得配对信息的安全性,而且实现方式更加灵活。It can be seen that in the Bluetooth pairing method provided in this embodiment, the first electronic device acquires pairing information of the Bluetooth device from the Bluetooth device. After receiving the notification information sent by the second electronic device, the Bluetooth device determines that it needs to enter the pairing mode. The Bluetooth device can generate and display pairing information in a visualized form according to the Bluetooth address and capability information of the Bluetooth device. Since the pairing information is determined to be provided by the Bluetooth device, the security of obtaining the pairing information by the first electronic device is improved. The first electronic device does not need to communicate with the Bluetooth device, and can obtain pairing information in a visualized form by scanning or taking pictures, and then obtain the pairing information. The Bluetooth pairing method provided in this embodiment improves the security of the pairing information obtained by the first electronic device, and the implementation method is more flexible.
可以理解的是,第一电子设备、第二电子设备、蓝牙设备和第三电子设备为了实现上述功能,其包含了执行各个功能相应的硬件和/或软件模块。结合本文中所公开的实施例描述的各示例的算法步骤,本申请能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。本领域技术人员可以结合实施例对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。It can be understood that, in order to realize the above functions, the first electronic device, the second electronic device, the bluetooth device and the third electronic device include corresponding hardware and/or software modules for performing respective functions. Combining the algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed by hardware or computer software drives hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions in combination with the embodiments for each specific application, but such implementation should not be regarded as exceeding the scope of the present application.
本申请实施例可以根据上述方法示例对第一电子设备、第二电子设备、蓝牙设备和第三电子设备进行功能模块的划分,例如,可以对应各个功能划分各个功能模块,也可以将两个或两个以上的功能集成在一个模块中。需要说明的是,本申请实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。需要说明的是,本申请实施例中模块的名称是示意性的,实际实现时对模块的名称不做限定。The embodiment of the present application can divide the functional modules of the first electronic device, the second electronic device, the Bluetooth device and the third electronic device according to the above method example, for example, each functional module can be divided corresponding to each function, or two or More than two functions are integrated in one module. It should be noted that the division of modules in the embodiment of the present application is schematic, and is only a logical function division, and there may be other division methods in actual implementation. It should be noted that the names of the modules in the embodiments of the present application are illustrative, and the names of the modules are not limited during actual implementation.
示例性的,图18为本申请实施例提供的设备的一种结构示意图,设备可以为本申请实施例中的第一电子设备、第二电子设备、蓝牙设备和第三电子设备。如图18所示,设备可以包括:接收模块1801、处理模块1802和发送模块1803。Exemplarily, FIG. 18 is a schematic structural diagram of a device provided in an embodiment of the present application, and the device may be the first electronic device, the second electronic device, the Bluetooth device, and the third electronic device in the embodiment of the present application. As shown in FIG. 18 , the device may include: a receiving module 1801 , a processing module 1802 and a sending module 1803 .
可选的,在一种实现方式中,图18所示的设备为第二电子设备,用于执行上述方法实施例中第二电子设备的操作,技术原理和技术效果相似。其中,所述第二电子设备与所述蓝牙设备已配对,所述第二电子设备包括:Optionally, in an implementation manner, the device shown in FIG. 18 is a second electronic device, configured to perform operations of the second electronic device in the foregoing method embodiments, and the technical principles and technical effects are similar. Wherein, the second electronic device has been paired with the Bluetooth device, and the second electronic device includes:
处理模块1802,用于和所述蓝牙设备建立蓝牙连接;A processing module 1802, configured to establish a Bluetooth connection with the Bluetooth device;
发送模块1803,用于向所述蓝牙设备发送通知信息,所述通知信息用于指示所述蓝牙设备进入配对模式。The sending module 1803 is configured to send notification information to the Bluetooth device, where the notification information is used to instruct the Bluetooth device to enter a pairing mode.
可选的,所述处理模块1802还用于:接收用户的第一操作;Optionally, the processing module 1802 is further configured to: receive a user's first operation;
所述发送模块1803,还用于响应于所述第一操作,向所述蓝牙设备发送所述通知信息。The sending module 1803 is further configured to send the notification information to the Bluetooth device in response to the first operation.
可选的,还包括接收模块1801;Optionally, a receiving module 1801 is also included;
所述发送模块1803,用于向所述蓝牙设备发送L2CAP_ECHO_REQ消息,所述L2CAP_ECHO_REQ消息包括所述通知信息;The sending module 1803 is configured to send an L2CAP_ECHO_REQ message to the Bluetooth device, where the L2CAP_ECHO_REQ message includes the notification information;
所述接收模块1801,用于接收所述蓝牙设备发送的应L2CAP_ECHO_RSP消息。The receiving module 1801 is configured to receive the L2CAP_ECHO_RSP message sent by the Bluetooth device.
可选的,所述处理模块1802还用于:Optionally, the processing module 1802 is also used for:
根据配对信息生成二维码信息,所述配对信息包括所述蓝牙设备的蓝牙地址;generating two-dimensional code information according to the pairing information, the pairing information including the Bluetooth address of the Bluetooth device;
显示所述二维码信息。Display the QR code information.
可选的,所述处理模块1802还用于:在根据配对信息生成二维码信息之前,接收用户的第二操作。Optionally, the processing module 1802 is further configured to: before generating the two-dimensional code information according to the pairing information, receive a second user operation.
可选的,所述处理模块1802还用于:和第一电子设备建立通信连接,所述第一电子设备和所述蓝牙设备未配对;Optionally, the processing module 1802 is further configured to: establish a communication connection with a first electronic device, and the first electronic device is not paired with the Bluetooth device;
所述发送模块1803,还用于通过所述通信连接向所述蓝牙设备发送配对信息,所述配对信息包括所述蓝牙设备的蓝牙地址。The sending module 1803 is further configured to send pairing information to the Bluetooth device through the communication connection, where the pairing information includes the Bluetooth address of the Bluetooth device.
可选的,所述处理模块1802还用于:在和所述第一电子设备建立通信连接之前,接收用户的第三操作。Optionally, the processing module 1802 is further configured to: receive a third user operation before establishing a communication connection with the first electronic device.
可选的,所述通信连接包括下列中的任意一项:蓝牙连接、WiFi连接或蜂窝通信连接。Optionally, the communication connection includes any one of the following: Bluetooth connection, WiFi connection or cellular communication connection.
可选的,所述处理模块1802,还用于根据所述配对信息生成共享信息;Optionally, the processing module 1802 is further configured to generate shared information according to the pairing information;
所述发送模块1803,用于通过所述通信连接向所述蓝牙设备发送所述共享信息。The sending module 1803 is configured to send the sharing information to the Bluetooth device through the communication connection.
可选的,所述配对信息还包括所述蓝牙设备的能力信息。Optionally, the pairing information also includes capability information of the Bluetooth device.
可选的,在一种实现方式中,图18所示的设备为蓝牙设备,用于执行上述方法实施例中蓝牙设备的操作,技术原理和技术效果相似。其中,所述蓝牙设备与第一电子设备未配对,所述蓝牙设备与第二电子设备已配对,所述蓝牙设备包括:Optionally, in an implementation manner, the device shown in FIG. 18 is a Bluetooth device, configured to perform the operations of the Bluetooth device in the foregoing method embodiments, and the technical principles and technical effects are similar. Wherein, the Bluetooth device is not paired with the first electronic device, and the Bluetooth device is paired with the second electronic device, and the Bluetooth device includes:
处理模块1802,用于和所述第二电子设备建立蓝牙连接;A processing module 1802, configured to establish a Bluetooth connection with the second electronic device;
接收模块1801,用于接收所述第二电子设备发送的通知信息,所述通知信息用于指示所述蓝牙设备进入配对模式;A receiving module 1801, configured to receive notification information sent by the second electronic device, where the notification information is used to instruct the Bluetooth device to enter a pairing mode;
所述处理模块1802,还用于根据所述通知信息进入配对模式;The processing module 1802 is further configured to enter a pairing mode according to the notification information;
所述接收模块1801,还用于接收所述第一电子设备发送的配对请求。The receiving module 1801 is further configured to receive the pairing request sent by the first electronic device.
可选的,还包括发送模块1803;Optionally, a sending module 1803 is also included;
所述接收模块1801,用于接收所述第二电子设备发送的L2CAP_ECHO_REQ消息,所述L2CAP_ECHO_REQ消息包括所述通知信息;The receiving module 1801 is configured to receive the L2CAP_ECHO_REQ message sent by the second electronic device, where the L2CAP_ECHO_REQ message includes the notification information;
所述发送模块1803,用于向所述第二电子设备发送L2CAP_ECHO_RSP消息。The sending module 1803 is configured to send an L2CAP_ECHO_RSP message to the second electronic device.
可选的,还包括发送模块1803;Optionally, a sending module 1803 is also included;
所述处理模块1802,还用于在根据所述通知信息进入配对模式之后,根据配对信息生成二维码信息,所述配对信息包括所述蓝牙设备的蓝牙地址;The processing module 1802 is further configured to generate two-dimensional code information according to the pairing information after entering the pairing mode according to the notification information, and the pairing information includes the Bluetooth address of the Bluetooth device;
所述发送模块1803,用于向第三电子设备发送所述二维码信息。The sending module 1803 is configured to send the two-dimensional code information to a third electronic device.
可选的,所述处理模块1802还用于:Optionally, the processing module 1802 is also used for:
在根据所述通知信息进入配对模式之后,根据配对信息生成二维码信息,所述配对信息包括所述蓝牙设备的蓝牙地址;After entering the pairing mode according to the notification information, generate two-dimensional code information according to the pairing information, the pairing information including the Bluetooth address of the Bluetooth device;
显示所述二维码信息。Display the QR code information.
可选的,所述配对信息还包括所述蓝牙设备的能力信息。Optionally, the pairing information also includes capability information of the Bluetooth device.
可选的,在一种实现方式中,图18所示的设备为第一电子设备,用于执行上述方法实施例中第一电子设备的操作,技术原理和技术效果相似。其中,所述第一电子设备与蓝 牙设备未配对,所述蓝牙设备与第二电子设备已配对,所述第一电子设备包括:Optionally, in an implementation manner, the device shown in FIG. 18 is a first electronic device, configured to perform operations of the first electronic device in the foregoing method embodiments, and the technical principles and technical effects are similar. Wherein, the first electronic device is not paired with the Bluetooth device, and the Bluetooth device is paired with the second electronic device, and the first electronic device includes:
处理模块1802,用于从所述第二电子设备或所述蓝牙设备或第三电子设备获取配对信息,所述配对信息包括所述蓝牙设备的蓝牙地址;所述第三电子设备和所述蓝牙设备通信;A processing module 1802, configured to acquire pairing information from the second electronic device or the Bluetooth device or a third electronic device, the pairing information includes the Bluetooth address of the Bluetooth device; the third electronic device and the Bluetooth device communication;
发送模块1803,用于根据所述蓝牙设备的蓝牙地址向所述蓝牙设备发送配对请求。The sending module 1803 is configured to send a pairing request to the Bluetooth device according to the Bluetooth address of the Bluetooth device.
可选的,所述配对信息还包括所述蓝牙设备的能力信息。Optionally, the pairing information also includes capability information of the Bluetooth device.
可选的,所述处理模块1802具体用于:Optionally, the processing module 1802 is specifically configured to:
扫描所述第二电子设备显示的二维码信息,所述二维码信息为所述第二电子设备根据所述配对信息生成的;Scanning the two-dimensional code information displayed by the second electronic device, the two-dimensional code information is generated by the second electronic device according to the pairing information;
解析所述二维码信息,获得所述配对信息。Analyzing the two-dimensional code information to obtain the pairing information.
可选的,所述处理模块1802用于:Optionally, the processing module 1802 is used for:
和所述第二电子设备建立通信连接;establishing a communication connection with the second electronic device;
通过所述通信连接从所述第二电子设备获取所述配对信息。The pairing information is acquired from the second electronic device through the communication connection.
可选的,还包括接收模块1801;Optionally, a receiving module 1801 is also included;
所述接收模块1801,用于接收所述第二电子设备发送的共享信息;所述共享信息为所述第二电子设备根据所述配对信息生成的;The receiving module 1801 is configured to receive sharing information sent by the second electronic device; the sharing information is generated by the second electronic device according to the pairing information;
所述处理模块1802,用于解析所述共享信息,获得所述配对信息。The processing module 1802 is configured to parse the shared information to obtain the pairing information.
可选的,所述通信连接包括下列中的任意一项:蓝牙连接、WiFi连接或蜂窝通信连接。Optionally, the communication connection includes any one of the following: Bluetooth connection, WiFi connection or cellular communication connection.
可选的,所述处理模块1802用于:Optionally, the processing module 1802 is used for:
扫描所述蓝牙设备或所述第三电子设备显示的二维码信息,所述二维码信息为所述蓝牙设备根据所述配对信息生成的;Scanning the two-dimensional code information displayed by the Bluetooth device or the third electronic device, the two-dimensional code information is generated by the Bluetooth device according to the pairing information;
解析所述二维码信息,获得所述配对信息。Analyzing the two-dimensional code information to obtain the pairing information.
可选的,在一种实现方式中,图18所示的设备为第三电子设备,用于执行上述方法实施例中第三电子设备的操作,技术原理和技术效果相似。其中,第三电子设备与蓝牙设备通信,第三电子设备包括:Optionally, in an implementation manner, the device shown in FIG. 18 is a third electronic device, configured to perform operations of the third electronic device in the foregoing method embodiments, and the technical principles and technical effects are similar. Wherein, the third electronic device communicates with the Bluetooth device, and the third electronic device includes:
接收模块1801,用于接收蓝牙设备发送的二维码信息,二维码信息为蓝牙设备根据配对信息生成的,配对信息包括蓝牙设备的蓝牙地址;The receiving module 1801 is configured to receive the two-dimensional code information sent by the Bluetooth device, the two-dimensional code information is generated by the Bluetooth device according to the pairing information, and the pairing information includes the Bluetooth address of the Bluetooth device;
处理模块1802,用于显示二维码信息。The processing module 1802 is configured to display two-dimensional code information.
可选的,配对信息还包括蓝牙设备的能力信息。Optionally, the pairing information also includes capability information of the Bluetooth device.
请参考图19,其示出了本申请实施例提供的设备的一种结构,设备可以为第一电子设备、第二电子设备、第三电子设备或蓝牙设备。该设备包括:处理器1901、接收器1902、发射器1903、存储器1904和总线1905。处理器1901包括一个或者多个处理核心,处理器1901通过运行软件程序以及模块,从而执行各种功能的应用以及信息处理。接收器1902和发射器1903可以实现为一个通信组件,该通信组件可以是一块基带芯片。存储器1904通过总线1905和处理器1901相连。存储器1904可用于存储至少一个程序指令,处理器1901用于执行至少一个程序指令,以实现上述实施例的技术方案。其实现原理和技术效果与上述方法相关实施例类似,此处不再赘述。Please refer to FIG. 19 , which shows a structure of a device provided by an embodiment of the present application. The device may 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, and the processor 1901 executes applications of various functions and information processing by running software programs and modules. The receiver 1902 and the transmitter 1903 can be realized as a communication component, and the communication component can be a baseband chip. The memory 1904 is connected to the processor 1901 through a bus 1905 . The memory 1904 may be used to store at least one program instruction, and the processor 1901 may be used to execute the at least one program instruction, so as to implement the technical solutions of the foregoing embodiments. Its implementation principle and technical effect are similar to those of the related embodiments of the method above, and will not be repeated here.
当设备开机后,处理器可以读取存储器中的软件程序,解释并执行软件程序的指令, 处理软件程序的数据。当需要通过天线发送数据时,处理器对待发送的数据进行基带处理后,输出基带信号至控制电路中的控制电路,控制电路将基带信号进行射频处理后将射频信号通过天线以电磁波的形式向外发送。当有数据发送到设备时,控制电路通过天线接收到射频信号,将射频信号转换为基带信号,并将基带信号输出至处理器,处理器将基带信号转换为数据并对该数据进行处理。When the device is turned on, the processor can read the software program in the memory, interpret and execute the instructions of the software program, and process the data of the software program. When it is necessary to send data through the antenna, the processor performs baseband processing on the data to be sent, and then outputs the baseband signal to the control circuit in the control circuit. send. When data is sent to the device, the control circuit receives the radio frequency signal through the antenna, converts the radio frequency signal into a baseband signal, and outputs the baseband signal to the processor, and the processor converts the baseband signal into data and processes the data.
本领域技术人员可以理解,为了便于说明,图19仅示出了一个存储器和处理器。在实际的设备中,可以存在多个处理器和存储器。存储器也可以称为存储介质或者存储设备等,本申请实施例对此不做限制。Those skilled in the art can understand that, for ease of illustration, FIG. 19 only shows a memory and a processor. In an actual device, there may be multiple processors and memories. A storage may also be called a storage medium or a storage device, etc., which is not limited in this embodiment of the present application.
作为一种可选的实现方式,处理器可以包括基带处理器和中央处理器,基带处理器主要用于对通信数据进行处理,中央处理器主要用于执行软件程序,处理软件程序的数据。本领域技术人员可以理解,基带处理器和中央处理器可以集成在一个处理器中,也可以是各自独立的处理器,通过总线等技术互联。本领域技术人员可以理解,设备可以包括多个基带处理器以适应不同的网络制式,设备可以包括多个中央处理器以增强其处理能力,设备的各个部件可以通过各种总线连接。该基带处理器也可以表述为基带处理电路或者基带处理芯片。该中央处理器也可以表述为中央处理电路或者中央处理芯片。对通信协议以及通信数据进行处理的功能可以内置在处理器中,也可以以软件程序的形式存储在存储器中,由处理器执行软件程序以实现基带处理功能。该存储器可以集成在处理器中,也可以独立在处理器之外。该存储器包括高速缓存Cache,可以存放频繁访问的数据/指令。As an optional implementation manner, the processor may include a baseband processor and a central processing unit, the baseband processor is mainly used for processing communication data, and the central processing unit is mainly used for executing software programs and processing data of the software programs. Those skilled in the art can understand that the baseband processor and the central processing unit may be integrated into one processor, or may be independent processors interconnected through technologies such as a bus. Those skilled in the art can understand that the device may include multiple baseband processors to adapt to different network standards, the device may include multiple central processors to enhance its processing capability, and various components of the device may be connected through various buses. The baseband processor may also be expressed as a baseband processing circuit or a baseband processing chip. The central processing unit may also be expressed as a central processing circuit or a central processing chip. The function of processing the communication protocol and communication data can be built in the processor, or can be stored in the memory in the form of a software program, and the processor executes the software program to realize the baseband processing function. The memory can be integrated in the processor, or it can be independent from the processor. The memory includes a high-speed cache, which can store frequently accessed data/instructions.
在本申请实施例中,处理器可以是通用处理器、数字信号处理器、专用集成电路、现场可编程门阵列或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件,可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。In this embodiment of the application, the processor may be a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, and may implement or Execute the methods, steps and logic block diagrams disclosed in the embodiments of the present application. A general purpose processor may be a microprocessor or any conventional processor or the like. The steps of the methods disclosed in connection with the embodiments of the present application may be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules in the processor.
在本申请实施例中,存储器可以是非易失性存储器,比如硬盘(hard disk drive,HDD)或固态硬盘(solid-state drive,SS)等,还可以是易失性存储器(volatile memory),例如随机存取存储器(random-access memory,RAM)。存储器是能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,不限于此。In the embodiment of the present application, the memory may be a non-volatile memory, such as a hard disk (hard disk drive, HDD) or a solid-state drive (solid-state drive, SS), etc., or a volatile memory (volatile memory), such as Random-access memory (RAM). A memory is, without limitation, any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer.
本申请实施例中的存储器还可以是电路或者其它任意能够实现存储功能的装置,用于存储程序指令和/或数据。本申请各实施例提供的方法中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、网络设备、用户设备或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(digital subscriber line,DSL)或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机可以存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性 介质(例如,软盘、硬盘、磁带)、光介质(例如,数字视频光盘(digital video disc,DWD)、或者半导体介质(例如,SSD)等。The memory in the embodiment of the present application may also be a circuit or any other device capable of implementing a storage function, and is used for storing program instructions and/or data. The methods provided in the various embodiments of the present application may be fully or partially implemented by software, hardware, firmware or any combination thereof. When implemented using software, it may be implemented in whole or in part 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 the computer, the processes or functions according to the embodiments of the present application will be generated in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, network equipment, user equipment or other programmable devices. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website, computer, server or data center Transmission to another website site, computer, server, or data center by wired (such as coaxial cable, optical fiber, digital subscriber line (DSL) or wireless (such as infrared, wireless, microwave, etc.). The computer The readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that includes one or more available media integrated. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape, etc.) ), optical media (for example, digital video disc (DWD), or semiconductor media (for example, SSD), etc.
可选的,图20为本申请实施例提供的设备的又一种结构示意图,设备可以为蓝牙设备,例如,蓝牙耳机。该蓝牙耳机可以包括至少一个处理器101、至少一个存储器102、无线通信模块103、音频模块104、电源模块105以及输入/输出接口106等。该处理器可以包括一个或多个接口,用于与蓝牙耳机的其他部件相连。该蓝牙耳机通过耳机盒进行收纳。下面结合图20对蓝牙耳机的各个部件进行具体的介绍。Optionally, FIG. 20 is another schematic structural diagram of a device provided in an embodiment of the present application, and the device may be a Bluetooth device, for example, 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 supply module 105, an input/output interface 106, and the like. The processor may include one or more interfaces for connecting with other components of the Bluetooth headset. The Bluetooth headset is stored through the headset box. The components of the Bluetooth headset will be specifically introduced below in conjunction with FIG. 20 .
其中,存储器102可以用于存储程序代码,如用于蓝牙耳机与多个电子设备之间进行物理连接,以及与电子设备之间的业务规范连接,处理电子设备的音频业务(例如音乐播放、接/打电话等),以及用于蓝牙耳机进行充电,蓝牙耳机与其他电子设备进行无线配对连接的程序代码等。存储器102还可以用于存储其他信息,例如电子设备的优先级。Among them, the memory 102 can be used to store program codes, such as for the physical connection between the Bluetooth headset and multiple electronic devices, as well as the service specification connection between the electronic devices, and the processing of audio services of the electronic devices (such as music playing, receiving, etc.). / phone calls, etc.), and the program codes for charging the Bluetooth headset, wireless pairing and connection between the Bluetooth headset and other electronic devices, etc. The memory 102 can also be used to store other information, such as the priority of the electronic device.
处理器101可以用于执行上述应用程序代码,调用相关模块以实现本申请实施例中蓝牙耳机的功能。例如,实现蓝牙耳机与多个电子设备之间进行物理连接,业务规范连接,音频播放,接/打电话等功能。The processor 101 may be configured to execute the above application codes, and call related modules to realize the functions of the Bluetooth headset in the embodiment of the present application. For example, realize the physical connection between the Bluetooth headset and multiple electronic devices, business standard connection, audio playback, answering/calling and other functions.
处理器101可以包括一个或多个处理单元,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器101中。处理器101具体可以是集成的控制芯片,也可以由包括各种有源和/或无源部件的电路组成,且该电路被配置为执行本申请实施例描述的属于处理器101的功能。The processor 101 may include one or more processing units, and different processing units may be independent devices, or may be integrated in one or more processors 101 . Specifically, the processor 101 may be an integrated control chip, or may be composed of a circuit including various active and/or passive components, and the circuit is configured to execute the functions belonging to the processor 101 described in the embodiments of this application.
无线通信模块103可以用于支持通过无线通信技术实现蓝牙耳机与其他电子设备或耳机盒之间的数据交换,无线通信技术例如为BT,WLAN(如Wi-Fi),Zigbee,FM,NFC,IR,或通用2.4G/5G无线通信技术等。The wireless communication module 103 can be used to support the data exchange between the Bluetooth headset and other electronic devices or earphone boxes through wireless communication technology, such as BT, WLAN (such as Wi-Fi), Zigbee, FM, NFC, IR , or general 2.4G/5G wireless communication technology, etc.
在一些实施例中,该无线通信模块103可以为蓝牙芯片。蓝牙耳机可以通过该蓝牙芯片,与其他电子设备的蓝牙芯片之间进行配对并建立无线连接,以通过该无线连接实现蓝牙耳机和其他电子设备之间的无线通信和业务处理。通常,蓝牙芯片可以支持基础速率(basic rate,BR)/增强速率(enhanced data rate,EDR)蓝牙和BLE,例如可以收/发寻呼(page)信息,收/发BLE广播消息等。In some embodiments, the wireless communication module 103 may be a Bluetooth chip. The bluetooth earphone can be paired with the bluetooth chip of other electronic devices and establish a wireless connection through the bluetooth chip, so as to realize wireless communication and business processing between the bluetooth earphone and other electronic devices through the wireless connection. Usually, the Bluetooth chip can support basic rate (basic rate, BR)/enhanced data rate (enhanced data rate, EDR) Bluetooth and BLE, for example, it can receive/send paging (page) information, receive/send BLE broadcast messages, etc.
另外,无线通信模块103还可以包括天线,无线通信模块103经由天线接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器101。无线通信模块103还可以从处理器101接收待发送的信号,对其进行调频,放大,经天线转为电磁波辐射出去。In addition, the wireless communication module 103 may further include an antenna. The wireless communication module 103 receives electromagnetic waves via the antenna, frequency-modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 101 . The wireless communication module 103 can also receive the signal to be sent from the processor 101, frequency-modulate it, amplify it, and convert it into electromagnetic wave and radiate it through the antenna.
音频模块104可以用于管理音频数据,实现蓝牙耳机输入和输出音频流。例如,音频模块104可以从无线通信模块103获取音频流,或者向无线通信模块103传递音频流,实现通过蓝牙耳机接打电话、播放音乐、启动/关闭与耳机连接的电子设备的语音助手、接收/发送用户的语音数据等功能。音频模块104可以包括用于输出音频流的扬声器(或称听筒、受话器)组件,麦克风(或称话筒,传声器),与麦克风相配合的麦克收音电路等。扬声器可以用于将音频电信号转换成声音信号并播放。麦克风可以用于将声音信号转换为音频电信号。The audio module 104 can be used to manage audio data, and realize input and output audio streams of Bluetooth earphones. For example, the audio module 104 can obtain the audio stream from the wireless communication module 103, or transfer the audio stream to the wireless communication module 103, so as to realize making and receiving calls, playing music, starting/closing the voice assistant of the electronic device connected to the earphone, receiving /Send the user's voice data and other functions. The audio module 104 may include a speaker (or earpiece, receiver) assembly for outputting audio streams, a microphone (or microphone, microphone), a microphone receiving circuit matched with the microphone, and the like. Loudspeakers can be used to convert audio electrical signals into sound signals and play them back. Microphones can be used to convert sound signals into audio electrical signals.
电源模块105可以用于提供蓝牙耳机的系统电源,为蓝牙耳机各模块供电;支持蓝牙 耳机接收充电输入等。电源模块105可以包括电源管理单元(power management unit,PMU)和电池。其中,电源管理单元可以接收外部的充电输入;将充电路输入的电信号变压后提供给电池充电,还可以将电池提供的电信号变压后提供给音频模块104、无线通信模块103等其他模块;以及防止电池过充、过放、短路或过流等。在一些实施例中,电源模块105还可以包括无线充电线圈,用于对蓝牙耳机进行无线充电。另外,电源管理单元还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。The power supply module 105 can be used to provide the system power supply of the Bluetooth headset, supply power for each module of the Bluetooth headset; support the Bluetooth headset to receive charging input, etc. The power module 105 may include a power management unit (power management unit, PMU) and a battery. Among them, the power management unit can receive an external charging input; transform the electrical signal input from the charging circuit and supply it to the battery for charging; it can also transform the electrical signal provided by the battery and provide it to the audio module 104, the wireless communication module 103, etc. modules; and to prevent battery overcharge, overdischarge, short circuit or overcurrent, etc. In some embodiments, the power module 105 may also include a wireless charging coil for wirelessly charging the Bluetooth headset. In addition, the power management unit can also be used to monitor parameters such as battery capacity, battery cycle times, and battery health status (leakage, impedance).
多个输入/输出接口106,可以用于提供蓝牙耳机与耳机盒之间进行充电或通信的有线连接。在一些实施例中,该输入/输出接口可以为USB接口。在另一些实施例中,输入/输出接口106可以为耳机电连接器,当蓝牙耳机放置于耳机盒中时,蓝牙耳机可以通过耳机电连接器与耳机盒中的电连接器建立电连接,从而为蓝牙耳机中的电池充电。在另一些实施例中,在该电连接建立后,蓝牙耳机还可以与耳机盒进行数据通信,例如可以接收来自耳机盒的配对指令。Multiple input/output interfaces 106 can be used to provide a wired connection for charging or communication between the Bluetooth headset and the headset box. In some embodiments, the input/output interface may be a USB interface. In some other embodiments, the input/output interface 106 can be an earphone electrical connector. When the Bluetooth earphone is placed in the earphone box, the Bluetooth earphone can establish an electrical connection with the electrical connector in the earphone box through the earphone electrical connector, thereby Charge the battery in the Bluetooth headset. In some other embodiments, after the electrical connection is established, the Bluetooth earphone can also perform data communication with the earphone box, for example, can receive a pairing instruction from the earphone box.
另外,蓝牙耳机还可以包括传感器107。例如,该传感器107可以是距离传感器或接近光传感器,可以用于确定蓝牙耳机是否被用户佩戴。示例性的,蓝牙耳机可以利用距离传感器来检测蓝牙耳机附近是否有物体,从而确定蓝牙耳机是否被用户佩戴。在确定蓝牙耳机被佩戴时,蓝牙耳机可以打开扬声器。In addition, the Bluetooth headset may further include a sensor 107 . For example, the sensor 107 can be a distance sensor or a proximity light sensor, which can be used to determine whether the Bluetooth headset is worn by the user. Exemplarily, the Bluetooth headset can use a distance sensor to detect whether there is an object near the Bluetooth headset, so as to determine whether the Bluetooth headset is worn by the user. When it is determined that the Bluetooth headset is worn, the Bluetooth headset can turn on the speaker.
再例如,该传感器107还可以包括骨传导传感器,结合成骨传导耳机。利用该骨传导传感器,蓝牙耳机可以获取人体声部振动骨块的振动信号,解析出语音信号,实现语音功能,从而接收用户的语音指令。蓝牙耳机还可以根据骨传导耳机获取的用户语音信号进行语音鉴权,以在支付交易等业务场景中对用户身份进行认证等。For another example, the sensor 107 may also include a bone conduction sensor, combined into a bone conduction earphone. Using the bone conduction sensor, the Bluetooth headset can obtain the vibration signal of the vibrating bone of the human voice, analyze the voice signal, realize the voice function, and receive the user's voice command. The Bluetooth headset can also perform voice authentication based on the user's voice signal obtained by the bone conduction headset, so as to authenticate the user's identity in business scenarios such as payment transactions.
再例如,该传感器107还可以包括:触摸传感器,用于检测用户的触摸操作;指纹传感器,用于检测用户指纹,识别用户身份等;环境光传感器,可以根据感知的环境光的亮度,自适应调节一些参数(如音量大小);以及其他可能的传感器。For another example, the sensor 107 may also include: a touch sensor, used to detect the user's touch operation; a fingerprint sensor, used to detect the user's fingerprint, identify the user's identity, etc.; Adjust some parameters (such as volume); and possibly other sensors.
在一些实施例中,触摸传感器可以检测用户的单击、双击、多次点击、长按、重压等触摸操作,还可以进行用户指纹识别,以在支付交易等业务场景中对用户身份进行鉴权。In some embodiments, the touch sensor can detect the user's touch operations such as single click, double click, multiple clicks, long press, heavy pressure, etc., and can also perform user fingerprint recognition to authenticate the user's identity in business scenarios such as payment transactions. right.
可以理解的是,本申请实施例示意的结构并不构成对蓝牙耳机的具体限定。其可以具有比图20示出的更多的或者更少的部件,可以组合两个或更多的部件,或者可以具有不同的部件配置。例如,在蓝牙耳机的外表面还可以包括按键108、指示灯(可以指示电量、呼入/呼出、配对模式等状态)、显示屏(可以提示用户相关信息)、防尘网(可以配合听筒使用)等部件。其中,该按键108可以是物理按键或触摸按键(与触摸传感器配合使用)等,用于触发开机、关机、暂停、播放、录音、开始配对、重置等操作。It can be understood that the structure shown in the embodiment of the present application does not constitute a specific limitation on the Bluetooth headset. It may have more or fewer components than shown in FIG. 20, may combine two or more components, or may have a different configuration of components. For example, the outer surface of the bluetooth headset can also include buttons 108, indicator lights (which can indicate the status of battery power, incoming/outgoing calls, pairing mode, etc.), display screens (which can prompt users for relevant information), dust-proof nets (which can be used with earpieces) ) and other components. Wherein, the button 108 may be a physical button or a touch button (used in conjunction with a touch sensor), etc., and is used to trigger operations such as power on, power off, pause, play, record, start pairing, and reset.
在一些实施例中,蓝牙耳机通常收纳于耳机盒内。耳机盒内部可以具有一个或多个磁体,以将耳机本体吸引到耳机盒内的腔体中。该耳机盒可以包括电池和多个输入/输出接口。在一些实施例中,该输入/输出接口可以为盒电连接器。当耳机盒中的一对盒电连接器,分别与耳机本体中的两个耳机电连接器建立电连接后,耳机盒可以通过自身的电池为耳机本体中的电池充电。In some embodiments, the bluetooth earphone is usually stored in an earphone box. There may be one or more magnets inside the earphone box to attract the earphone body into the cavity in the earphone box. The headset box may include a battery and multiple input/output interfaces. In some embodiments, the input/output interface may be a box electrical connector. When the pair of box electrical connectors in the earphone box are respectively electrically connected to the two earphone electrical connectors in the earphone body, the earphone box can charge the battery in the earphone body through its own battery.
在另一些实施例中,该耳机盒上可以设置有至少一个触摸控件,可以用于触发蓝牙耳机进行配对复位或对蓝牙耳机进行充电等功能。耳机盒还可以设置有一个或多个电量指示灯,以向用户提示耳机盒中电池的电量大小,以及耳机盒中每个耳机本体中电池的电量大 小。In some other embodiments, at least one touch control can be provided on the earphone box, which can be used to trigger functions such as pairing and resetting of the Bluetooth earphone or charging of the Bluetooth earphone. The earphone box can also be provided with one or more power indicator lights, to remind the user of the power level of the battery in the earphone box, and the power level of the battery in each earphone body in the earphone box.
本申请实施例提供一种计算机程序产品,当所述计算机程序产品在设备运行时,使得所述设备执行上述实施例中的技术方案,其实现原理和技术效果与上述相关实施例类似,此处不再赘述。所述设备可以为第一电子设备、第二电子设备、第三电子设备或蓝牙设备。An embodiment of the present application provides a computer program product, which, when running on a device, enables the device to execute the technical solution in the above embodiment, and its realization principle and technical effect are similar to those of the above related embodiments, here No longer. The device may be a first electronic device, a second electronic device, a third electronic device or a Bluetooth device.
本申请实施例提供一种计算机可读存储介质,其上存储有程序指令,所述程序指令被设备执行时,使得所述设备执行上述实施例的技术方案。其实现原理和技术效果与上述相关实施例类似,此处不再赘述。所述设备可以为第一电子设备、第二电子设备、第三电子设备或蓝牙设备。An embodiment of the present application provides a computer-readable storage medium, on which program instructions are stored, and when the program instructions are executed by a device, the device executes the technical solutions of the foregoing embodiments. Its implementation principle and technical effect are similar to those of the above-mentioned related embodiments, 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.
综上所述,以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围。In summary, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: it can still The technical solutions described in the foregoing embodiments are modified, or some of the technical features are replaced equivalently; and these modifications or replacements do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.

Claims (36)

  1. 一种蓝牙配对方法,其特征在于,应用于通信系统,所述通信系统包括第一电子设备、第二电子设备和蓝牙设备,所述第二电子设备和所述蓝牙设备已配对,所述第一电子设备和所述蓝牙设备未配对,所述方法包括:A bluetooth pairing method, characterized in that it is 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 have been paired, the first An electronic device is not paired with the Bluetooth device, and the method includes:
    所述第二电子设备和所述蓝牙设备建立蓝牙连接;The second electronic device establishes a Bluetooth connection with the Bluetooth device;
    所述第二电子设备向所述蓝牙设备发送通知信息,所述通知信息用于指示所述蓝牙设备进入配对模式;The second electronic device sends notification information to the Bluetooth device, and the notification information is used to instruct the Bluetooth device to enter a pairing mode;
    所述蓝牙设备根据所述通知信息进入配对模式;The Bluetooth device enters a pairing mode according to the notification information;
    所述第一电子设备从所述第二电子设备或所述蓝牙设备或第三电子设备获取配对信息,所述配对信息包括所述蓝牙设备的蓝牙地址;The first electronic device obtains pairing information from the second electronic device or the Bluetooth device or a third electronic device, and the pairing information includes a Bluetooth address of the Bluetooth device;
    所述第一电子设备根据所述蓝牙设备的蓝牙地址向所述蓝牙设备发送配对请求。The first electronic device sends a pairing request to the Bluetooth device according to the Bluetooth address of the Bluetooth device.
  2. 根据权利要求1所述的方法,其特征在于,所述第二电子设备向所述蓝牙设备发送通知信息,包括:The method according to claim 1, wherein the second electronic device sends notification information to the Bluetooth device, comprising:
    所述第二电子设备接收用户的第一操作;The second electronic device receives a user's first operation;
    所述第二电子设备响应于所述第一操作,向所述蓝牙设备发送通知信息。The second electronic device sends notification information to the Bluetooth device in response to the first operation.
  3. 根据权利要求1或2所述的方法,其特征在于,所述第二电子设备向所述蓝牙设备发送通知信息,包括:The method according to claim 1 or 2, wherein the second electronic device sends notification information to the Bluetooth device, comprising:
    所述第二电子设备向所述蓝牙设备发送逻辑链路控制和适配协议回声请求L2CAP_ECHO_REQ消息,所述L2CAP_ECHO_REQ消息包括所述通知信息;The second electronic device sends a Logical Link Control and Adaptation Protocol echo request L2CAP_ECHO_REQ message to the Bluetooth device, and the L2CAP_ECHO_REQ message includes the notification information;
    所述蓝牙设备向所述第二电子设备向发送逻辑链路控制和适配协议回声响应L2CAP_ECHO_RSP消息。The Bluetooth device sends a Logical Link Control and Adaptation Protocol echo response L2CAP_ECHO_RSP message to the second electronic device.
  4. 根据权利要求1-3中任一项所述的方法,其特征在于,所述第一电子设备从所述第二电子设备获取配对信息,包括:The method according to any one of claims 1-3, wherein the first electronic device acquires pairing information from the second electronic device, comprising:
    所述第二电子设备根据所述配对信息生成二维码信息,并显示所述二维码信息;The second electronic device generates two-dimensional code information according to the pairing information, and displays the two-dimensional code information;
    所述第一电子设备扫描所述二维码信息,并解析所述二维码信息获得所述配对信息。The first electronic device scans the two-dimensional code information, and parses the two-dimensional code information to obtain the pairing information.
  5. 根据权利要求4所述的方法,其特征在于,所述第二电子设备根据所述配对信息生成二维码信息之前,还包括:The method according to claim 4, wherein, before the second electronic device generates the two-dimensional code information according to the pairing information, further comprising:
    所述第二电子设备接收用户的第二操作。The second electronic device receives a second operation of the user.
  6. 根据权利要求1-3中任一项所述的方法,其特征在于,所述第一电子设备从所述第二电子设备获取配对信息,包括:The method according to any one of claims 1-3, wherein the first electronic device acquires pairing information from the second electronic device, comprising:
    所述第二电子设备和所述第一电子设备建立通信连接;establishing a communication connection between the second electronic device and 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. 根据权利要求6所述的方法,其特征在于,所述第二电子设备和所述第一电子设备建立通信连接之前,还包括:The method according to claim 6, wherein, before establishing a communication connection between the second electronic device and the first electronic device, further comprising:
    接收用户的第三操作。The third operation of the user is received.
  8. 根据权利要求6所述的方法,其特征在于,所述通信连接包括下列中的任意一项:蓝牙连接、无线保真WiFi连接或蜂窝通信连接。The method according to claim 6, wherein the communication connection comprises any one of the following: a Bluetooth connection, a Wi-Fi connection or a cellular communication connection.
  9. 根据权利要求1-3中任一项所述的方法,其特征在于,所述第一电子设备从所述蓝 牙设备获取配对信息,包括:The method according to any one of claims 1-3, wherein said first electronic device acquires pairing information from said Bluetooth device, comprising:
    所述蓝牙设备根据所述通知信息进入配对模式后,根据所述配对信息生成二维码信息,并显示所述二维码信息;After the Bluetooth device enters the pairing mode according to the notification information, it generates two-dimensional code information according to the pairing information, and displays the two-dimensional code information;
    所述第一电子设备扫描所述二维码信息,并解析所述二维码信息获得所述配对信息。The first electronic device scans the two-dimensional code information, and parses the two-dimensional code information to obtain the pairing information.
  10. 根据权利要求1-3中任一项所述的方法,其特征在于,所述第三电子设备和所述蓝牙设备通信,所述第一电子设备从所述第三电子设备获取配对信息,包括:The method according to any one of claims 1-3, wherein the third electronic device communicates with the Bluetooth device, and the first electronic device acquires pairing information from the third electronic device, including :
    所述蓝牙设备根据所述通知信息进入配对模式后,根据所述配对信息生成二维码信息;After the Bluetooth device enters the pairing mode according to the notification information, it generates two-dimensional code information according to the pairing information;
    所述蓝牙设备向所述第三电子设备发送所述二维码信息;The Bluetooth device sends the two-dimensional code information to the third electronic device;
    所述第三电子设备接收所述二维码信息后,显示所述二维码信息;The third electronic device displays the two-dimensional code information after receiving the two-dimensional code information;
    所述第一电子设备扫描所述二维码信息,并解析所述二维码信息获得所述配对信息。The first electronic device scans the two-dimensional code information, and parses the two-dimensional code information to obtain the pairing information.
  11. 根据权利要求1-10中任一项所述的方法,其特征在于,所述配对信息还包括所述蓝牙设备的能力信息。The method according to any one of claims 1-10, wherein the pairing information further includes capability information of the Bluetooth device.
  12. 一种蓝牙配对方法,其特征在于,应用于第二电子设备,所述第二电子设备与所述蓝牙设备已配对,所述方法包括:A Bluetooth pairing method, characterized in that it is applied to a second electronic device, and the second electronic device has been paired with the Bluetooth device, and the method includes:
    和所述蓝牙设备建立蓝牙连接;Establish a Bluetooth connection with the Bluetooth device;
    向所述蓝牙设备发送通知信息,所述通知信息用于指示所述蓝牙设备进入配对模式。Send notification information to the Bluetooth device, where the notification information is used to instruct the Bluetooth device to enter a pairing mode.
  13. 根据权利要求12所述的方法,其特征在于,所述向所述蓝牙设备发送通知信息,包括:The method according to claim 12, wherein the sending notification information to the Bluetooth device comprises:
    接收用户的第一操作;Receive the user's first operation;
    响应于所述第一操作,向所述蓝牙设备发送所述通知信息。In response to the first operation, send the notification information to the Bluetooth device.
  14. 根据权利要求12或13所述的方法,其特征在于,所述向所述蓝牙设备发送通知信息,包括:The method according to claim 12 or 13, wherein the sending notification information to the Bluetooth device comprises:
    向所述蓝牙设备发送逻辑链路控制和适配协议回声请求L2CAP_ECHO_REQ消息,所述L2CAP_ECHO_REQ消息包括所述通知信息;sending a Logical Link Control and Adaptation Protocol echo request L2CAP_ECHO_REQ message to the Bluetooth device, where the L2CAP_ECHO_REQ message includes the notification information;
    接收所述蓝牙设备发送的逻辑链路控制和适配协议回声响应L2CAP_ECHO_RSP消息。Receive a Logical Link Control and Adaptation Protocol echo response L2CAP_ECHO_RSP message sent by the Bluetooth device.
  15. 根据权利要求12-14中任一项所述的方法,其特征在于,还包括:The method according to any one of claims 12-14, further comprising:
    根据配对信息生成二维码信息,所述配对信息包括所述蓝牙设备的蓝牙地址;generating two-dimensional code information according to the pairing information, the pairing information including the Bluetooth address of the Bluetooth device;
    显示所述二维码信息。Display the QR code information.
  16. 根据权利要求15所述的方法,其特征在于,所述根据配对信息生成二维码信息之前,还包括:The method according to claim 15, wherein, before generating the two-dimensional code information according to the pairing information, further comprising:
    接收用户的第二操作。Receive the user's second operation.
  17. 根据权利要求12-14中任一项所述的方法,其特征在于,还包括:The method according to any one of claims 12-14, further comprising:
    和第一电子设备建立通信连接,所述第一电子设备和所述蓝牙设备未配对;Establish a communication connection with the first electronic device, and the first electronic device is not paired with the Bluetooth device;
    通过所述通信连接向所述蓝牙设备发送配对信息,所述配对信息包括所述蓝牙设备的蓝牙地址。sending pairing information to the Bluetooth device through the communication connection, where the pairing information includes the Bluetooth address of the Bluetooth device.
  18. 根据权利要求17所述的方法,其特征在于,所述和所述第一电子设备建立通信连接之前,还包括:The method according to claim 17, further comprising: before establishing a communication connection with the first electronic device:
    接收用户的第三操作。The third operation of the user is received.
  19. 根据权利要求17所述的方法,其特征在于,所述通信连接包括下列中的任意一项: 蓝牙连接、无线保真WiFi连接或蜂窝通信连接。The method according to claim 17, wherein the communication connection comprises any one of the following: a Bluetooth connection, a Wi-Fi connection or a cellular communication connection.
  20. 根据权利要求17所述的方法,其特征在于,所述通过所述通信连接向所述蓝牙设备发送配对信息,包括:The method according to claim 17, wherein the sending pairing information to the Bluetooth device through the communication connection comprises:
    根据所述配对信息生成共享信息;generating shared information according to the pairing information;
    通过所述通信连接向所述蓝牙设备发送所述共享信息。sending the sharing information to the Bluetooth device through the communication connection.
  21. 根据权利要求15-20中任一项所述的方法,其特征在于,所述配对信息还包括所述蓝牙设备的能力信息。The method according to any one of claims 15-20, wherein the pairing information further includes capability information of the Bluetooth device.
  22. 一种蓝牙配对方法,其特征在于,应用于蓝牙设备,所述蓝牙设备与第一电子设备未配对,所述蓝牙设备与第二电子设备已配对,所述方法包括:A Bluetooth pairing method, characterized in that it is applied to a Bluetooth device, the Bluetooth device is not paired with the first electronic device, and the Bluetooth device is paired with the second electronic device, and the method includes:
    和所述第二电子设备建立蓝牙连接;Establish a Bluetooth connection with the second electronic device;
    接收所述第二电子设备发送的通知信息,所述通知信息用于指示所述蓝牙设备进入配对模式;receiving notification information sent by the second electronic device, where the notification information is used to instruct the Bluetooth device to enter a pairing mode;
    根据所述通知信息进入配对模式;Entering a pairing mode according to the notification information;
    接收所述第一电子设备发送的配对请求。Receive a pairing request sent by the first electronic device.
  23. 根据权利要求22所述的方法,其特征在于,所述接收所述第二电子设备发送的通知信息,包括:The method according to claim 22, wherein the receiving the notification information sent by the second electronic device comprises:
    接收所述第二电子设备发送的逻辑链路控制和适配协议回声请求L2CAP_ECHO_REQ消息,所述L2CAP_ECHO_REQ消息包括所述通知信息;Receive a Logical Link Control and Adaptation Protocol echo request L2CAP_ECHO_REQ message sent by the second electronic device, where the L2CAP_ECHO_REQ message includes the notification information;
    向所述第二电子设备发送逻辑链路控制和适配协议回声响应L2CAP_ECHO_RSP消息。sending a Logical Link Control and Adaptation Protocol echo response L2CAP_ECHO_RSP message to the second electronic device.
  24. 根据权利要求22或23所述的方法,其特征在于,所述根据所述通知信息进入配对模式之后,还包括:The method according to claim 22 or 23, wherein after entering the pairing mode according to the notification information, further comprising:
    根据配对信息生成二维码信息,所述配对信息包括所述蓝牙设备的蓝牙地址;generating two-dimensional code information according to the pairing information, the pairing information including the Bluetooth address of the Bluetooth device;
    向第三电子设备发送所述二维码信息。Send the two-dimensional code information to the third electronic device.
  25. 根据权利要求22或23所述的方法,其特征在于,所述根据所述通知信息进入配对模式之后,还包括:The method according to claim 22 or 23, wherein after entering the pairing mode according to the notification information, further comprising:
    根据配对信息生成二维码信息,所述配对信息包括所述蓝牙设备的蓝牙地址;generating two-dimensional code information according to the pairing information, the pairing information including the Bluetooth address of the Bluetooth device;
    显示所述二维码信息。Display the QR code information.
  26. 根据权利要求24或25所述的方法,其特征在于,所述配对信息还包括所述蓝牙设备的能力信息。The method according to claim 24 or 25, wherein the pairing information further includes capability information of the Bluetooth device.
  27. 一种蓝牙配对方法,其特征在于,应用于第一电子设备,所述第一电子设备与蓝牙设备未配对,所述蓝牙设备与第二电子设备已配对,所述方法包括:A Bluetooth pairing method, characterized in that it is applied to a first electronic device, the first electronic device is not paired with the Bluetooth device, and the Bluetooth device is paired with the second electronic device, and the method includes:
    从所述第二电子设备或所述蓝牙设备或第三电子设备获取配对信息,所述配对信息包括所述蓝牙设备的蓝牙地址;所述第三电子设备和所述蓝牙设备通信;Obtain pairing information from the second electronic device or the Bluetooth device or a third electronic device, where the pairing information includes the Bluetooth address of the Bluetooth device; the third electronic device communicates with the Bluetooth device;
    根据所述蓝牙设备的蓝牙地址向所述蓝牙设备发送配对请求。Send a pairing request to the Bluetooth device according to the Bluetooth address of the Bluetooth device.
  28. 根据权利要求27所述的方法,其特征在于,所述配对信息还包括所述蓝牙设备的能力信息。The method according to claim 27, wherein the pairing information further includes capability information of the Bluetooth device.
  29. 根据权利要求27或28所述的方法,其特征在于,从所述第二电子设备获取配对信息,包括:The method according to claim 27 or 28, wherein obtaining pairing information from the second electronic device comprises:
    扫描所述第二电子设备显示的二维码信息,所述二维码信息为所述第二电子设备根据 所述配对信息生成的;Scanning the two-dimensional code information displayed by the second electronic device, the two-dimensional code information is generated by the second electronic device according to the pairing information;
    解析所述二维码信息,获得所述配对信息。Analyzing the two-dimensional code information to obtain the pairing information.
  30. 根据权利要求27或28所述的方法,其特征在于,从所述第二电子设备获取配对信息,包括:The method according to claim 27 or 28, wherein obtaining pairing information from the second electronic device comprises:
    和所述第二电子设备建立通信连接;establishing a communication connection with the second electronic device;
    通过所述通信连接从所述第二电子设备获取所述配对信息。The pairing information is acquired from the second electronic device through the communication connection.
  31. 根据权利要求30所述的方法,其特征在于,所述通过所述通信连接从所述第二电子设备获取所述配对信息,包括:The method according to claim 30, wherein the acquiring the pairing information from the second electronic device through the communication connection comprises:
    接收所述第二电子设备发送的共享信息;所述共享信息为所述第二电子设备根据所述配对信息生成的;receiving sharing information sent by the second electronic device; the sharing information is generated by the second electronic device according to the pairing information;
    解析所述共享信息,获得所述配对信息。Analyzing the shared information to obtain the pairing information.
  32. 根据权利要求30所述的方法,其特征在于,所述通信连接包括下列中的任意一项:蓝牙连接、无线保真WiFi连接或蜂窝通信连接。The method according to claim 30, wherein the communication connection comprises any one of the following: a Bluetooth connection, a Wi-Fi connection or a cellular communication connection.
  33. 根据权利要求27或28所述的方法,其特征在于,从所述蓝牙设备或第三电子设备获取配对信息,包括:The method according to claim 27 or 28, wherein obtaining pairing information from the Bluetooth device or the third electronic device comprises:
    扫描所述蓝牙设备或所述第三电子设备显示的二维码信息,所述二维码信息为所述蓝牙设备根据所述配对信息生成的;Scanning the two-dimensional code information displayed by the Bluetooth device or the third electronic device, the two-dimensional code information is generated by the Bluetooth device according to the pairing information;
    解析所述二维码信息,获得所述配对信息。Analyzing the two-dimensional code information to obtain the pairing information.
  34. 一种电子设备,其特征在于,所述电子设备包括处理器,所述处理器用于与存储器耦合,读取存储器中的指令并根据所述指令使得所述电子设备执行如权利要求12-21中任一项所述的方法,或者,执行如权利要求27-33中任一项所述的方法。An electronic device, characterized in that the electronic device includes a processor, and the processor is configured to be coupled with a memory, read instructions in the memory, and make the electronic device execute according to the instructions in claims 12-21. The method according to any one, or, performing the method according to any one of claims 27-33.
  35. 一种蓝牙设备,其特征在于,所述蓝牙设备包括处理器,所述处理器用于与存储器耦合,并读取存储器中的指令并根据所述指令使得所述蓝牙设备执行如权利要求22-26中任一项所述的方法。A bluetooth device, characterized in that the bluetooth device includes a processor, the processor is used to be coupled with a memory, read instructions in the memory, and make the bluetooth device perform the tasks according to claims 22-26 according to the instructions any one of the methods described.
  36. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机指令,当所述计算机指令在设备上运行时,使得所述设备执行如权利要求12-21中任一项所述的方法,或执行如权利要求22-26中任一项所述的方法,或执行如权利要求27-33中任一项所述的方法。A computer-readable storage medium, characterized in that the computer-readable storage medium stores computer instructions, and when the computer instructions are run on a device, the device performs any one of claims 12-21. The method, or performing the method according to any one of claims 22-26, or performing the method according to any one of claims 27-33.
PCT/CN2022/127076 2021-11-01 2022-10-24 Bluetooth pairing method, device, system, and storage medium WO2023071993A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111285181.3 2021-11-01
CN202111285181.3A CN116074793A (en) 2021-11-01 2021-11-01 Bluetooth pairing method, device, system and storage medium

Publications (1)

Publication Number Publication Date
WO2023071993A1 true WO2023071993A1 (en) 2023-05-04

Family

ID=86160375

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/127076 WO2023071993A1 (en) 2021-11-01 2022-10-24 Bluetooth pairing method, device, system, and storage medium

Country Status (2)

Country Link
CN (1) CN116074793A (en)
WO (1) WO2023071993A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116700084B (en) * 2023-06-14 2024-02-06 佛山市顺德区凯祥电器有限公司 Control method of heating table based on Bluetooth applet control

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105554908A (en) * 2015-12-31 2016-05-04 福建联迪商用设备有限公司 Method, master device, slave device and system for achieving code scanning automatic bluetooth connection
CN105578398A (en) * 2016-01-27 2016-05-11 努比亚技术有限公司 Terminal, and Bluetooth connection method
US9480096B1 (en) * 2015-08-25 2016-10-25 Motorola Solutions, Inc. Method, device, and system for fast wireless accessory devices pairing
CN107172718A (en) * 2017-03-30 2017-09-15 联想(北京)有限公司 A kind of information processing method and electronic equipment
CN111050307A (en) * 2019-11-27 2020-04-21 深圳星康医疗科技有限公司 Method, system and computer readable storage medium for realizing Bluetooth connection based on two-dimensional bar code
CN112486105A (en) * 2019-09-12 2021-03-12 深圳市云海物联科技有限公司 Equipment control method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9480096B1 (en) * 2015-08-25 2016-10-25 Motorola Solutions, Inc. Method, device, and system for fast wireless accessory devices pairing
CN105554908A (en) * 2015-12-31 2016-05-04 福建联迪商用设备有限公司 Method, master device, slave device and system for achieving code scanning automatic bluetooth connection
CN105578398A (en) * 2016-01-27 2016-05-11 努比亚技术有限公司 Terminal, and Bluetooth connection method
CN107172718A (en) * 2017-03-30 2017-09-15 联想(北京)有限公司 A kind of information processing method and electronic equipment
CN112486105A (en) * 2019-09-12 2021-03-12 深圳市云海物联科技有限公司 Equipment control method and device
CN111050307A (en) * 2019-11-27 2020-04-21 深圳星康医疗科技有限公司 Method, system and computer readable storage medium for realizing Bluetooth connection based on two-dimensional bar code

Also Published As

Publication number Publication date
CN116074793A (en) 2023-05-05

Similar Documents

Publication Publication Date Title
CN112868244B (en) Point-to-multipoint data transmission method and device
US20230362028A1 (en) Home device control method and device
US20220256626A1 (en) Device Control Method and Terminal
EP3893109B1 (en) Method and device for connecting bluetooth devices
WO2019090726A1 (en) Method for selecting bluetooth device, terminal, and system
WO2016090826A1 (en) Configuration method and device
CN104378801A (en) Method and device for having access to wireless network
WO2021180083A1 (en) Bluetooth communication system and wireless communication system
CN113360108B (en) Screen projection connection control method and electronic equipment
WO2021114952A1 (en) Data processing method, terminal device, bluetooth device, and storage medium
CN105163366A (en) Wireless network connection method and device
WO2022143071A1 (en) Connection establishment method and electronic device
US10827455B1 (en) Method and apparatus for sending a notification to a short-range wireless communication audio output device
JP2018501746A (en) Connection establishment method, apparatus, program, and recording medium
KR102335903B1 (en) Method and apparatus for communication between electronic devices
CN114499587B (en) Audio synchronization communication method, system, wireless earphone, terminal and storage medium
CN115119194A (en) Bluetooth connection method and related device
WO2023273639A1 (en) Device connection method and apparatus, and computer-readable medium and electronic device
CN111010693A (en) Method for providing wireless fidelity WiFi network access service and electronic equipment
WO2021104448A1 (en) Method for synchronizing key information, system and device
WO2023071993A1 (en) Bluetooth pairing method, device, system, and storage medium
CN113038627B (en) File sharing method, mobile device and computer storage medium
CN113365274A (en) Network access method and electronic equipment
WO2022160967A1 (en) Communication method, mobile device, electronic device, and computer-readable storage medium
CN105430642A (en) File transmission method and apparatus

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22885870

Country of ref document: EP

Kind code of ref document: A1