WO2022047968A1 - Bluetooth device pairing method, device, and storage medium - Google Patents
Bluetooth device pairing method, device, and storage medium Download PDFInfo
- Publication number
- WO2022047968A1 WO2022047968A1 PCT/CN2020/124893 CN2020124893W WO2022047968A1 WO 2022047968 A1 WO2022047968 A1 WO 2022047968A1 CN 2020124893 W CN2020124893 W CN 2020124893W WO 2022047968 A1 WO2022047968 A1 WO 2022047968A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- bluetooth
- terminal
- paired
- headset
- pairing
- Prior art date
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/80—Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W76/00—Connection management
- H04W76/10—Connection setup
- H04W76/14—Direct-mode setup
Definitions
- the present application relates to the technical field of Bluetooth communication, and in particular, to a Bluetooth device pairing method, device, and computer-readable storage medium.
- Wireless earphones such as TWS wireless Bluetooth earphones
- the TWS wireless Bluetooth earphones consist of two independent earphones without cables and a charging case for charging them.
- pairing between Bluetooth headsets requires the user to open the Bluetooth configuration interface of the Bluetooth device, search for paired Bluetooth devices, and manually select a corresponding Bluetooth device from multiple Bluetooth device connection lists for pairing.
- the TWS Bluetooth headset due to its small size, the TWS Bluetooth headset generally does not have a separate button, so the pairing operation between the TWS Bluetooth headset and a terminal such as a mobile phone will be more complicated.
- the current pairing method for Bluetooth devices not only has low Bluetooth pairing efficiency, but also has high complexity in Bluetooth pairing operations.
- the main purpose of the present application is to provide a Bluetooth device pairing method, device and computer-readable storage medium, aiming to solve the technical problems of low pairing efficiency and high complexity of Bluetooth pairing operation in the existing Bluetooth device pairing method.
- the present application provides a method for pairing a Bluetooth device.
- the method for pairing a Bluetooth device is applied to a pairing device for a Bluetooth device.
- the pairing device includes a Bluetooth headset, a Bluetooth headset box, and a terminal to be paired.
- the pairing method of the device includes the following steps:
- the Bluetooth headset box obtains the terminal Bluetooth device address of the terminal to be paired through the NFC connection with the terminal to be paired, and sends the Bluetooth device address of the terminal to the terminal. sent to the bluetooth headset;
- the terminal to be paired is connected through the NFC to obtain the Bluetooth device address of the headset pre-stored in the Bluetooth headset box;
- the bluetooth earphone and the terminal to be paired complete the bluetooth pairing connection.
- the step of completing the Bluetooth pairing connection between the Bluetooth headset and the terminal to be paired according to the terminal Bluetooth device address and the headset Bluetooth device address specifically includes:
- the to-be-paired terminal searches for a Bluetooth device to be paired within a preset range, and acquires a Bluetooth device information set of the to-be-paired Bluetooth device;
- the terminal to be paired matches the headset Bluetooth device address with the Bluetooth device information set to determine the headset Bluetooth device address in the Bluetooth device information set, and based on the headset Bluetooth device address, sends a message to the headset.
- the Bluetooth headset sends a Bluetooth pairing request;
- the bluetooth headset When the bluetooth headset receives the bluetooth pairing request, it compares the current terminal bluetooth information in the bluetooth pairing request with the terminal bluetooth device address, and compares the current terminal bluetooth information with the terminal bluetooth information. When the device addresses are the same, the Bluetooth pairing connection is completed with the terminal to be paired.
- the method further includes:
- the Bluetooth headset box obtains the device distance from the terminal to be paired based on the infrared proximity sensor, and the Bluetooth headset box determines whether it is in contact with the terminal to be paired based on the device distance;
- the Bluetooth headset box determines that it is in contact with the terminal to be paired, send a connection status detection data packet to the terminal to be paired based on the NFC module;
- the terminal to be paired When the terminal to be paired receives the connection state detection data packet, it generates a corresponding verification data packet, and feeds back the verification data packet to the Bluetooth headset box;
- the Bluetooth headset box When the Bluetooth headset box receives the verification data packet, it sends the NFC connection instruction to the terminal to be paired.
- the Bluetooth headset box obtains the device distance from the terminal to be paired based on an infrared proximity sensor, and the Bluetooth headset box determines whether it is in contact with the terminal to be paired based on the device distance.
- Also includes:
- the Bluetooth earphone box determines that there is no contact with the terminal to be paired, a reminder message of abnormal contact of the NFC module is generated, so that the user can verify the NFC module of the Bluetooth earphone box and the terminal to be paired.
- the step of sending the NFC connection instruction to the terminal to be paired specifically includes:
- the Bluetooth headset box When the Bluetooth headset box receives the verification data packet, based on the verification data packet and the connection state detection data packet, determine whether it is in effective contact with the terminal to be paired;
- the NFC connection instruction is sent to the terminal to be paired.
- ,Also includes:
- a device adjustment reminder message is output through the Bluetooth headset or a terminal communicatively connected to the Bluetooth headset box to remind the user to adjust the Bluetooth headset box The relative position with the terminal to be paired.
- the terminal to be paired includes a first NFC module
- the Bluetooth headset box includes a second NFC module and an MCU module
- the NFC connection between the terminals to be paired, the steps of acquiring the terminal Bluetooth device address of the terminal to be paired, and sending the terminal Bluetooth device address to the Bluetooth headset specifically include:
- the second NFC module When detecting the short-range wireless communication NFC connection instruction, the second NFC module receives the terminal OOB data sent by the first NFC module through the NFC connection with the first NFC module, wherein the short-range wireless communication
- the wireless communication NFC connection instruction is triggered by a touch operation between the first NFC module and the second NFC module;
- the second NFC module acquires the terminal Bluetooth device address in the terminal OOB data, and sends the terminal Bluetooth device address to the MCU module;
- the MCU module sends the terminal Bluetooth device address to the Bluetooth headset, and sends the headset OOB data including the headset Bluetooth device address to the first NFC module.
- the present application also provides a pairing device for a Bluetooth device, and the pairing device for the Bluetooth device includes:
- the terminal information acquisition module is used to acquire the terminal Bluetooth device address of the terminal to be paired through the NFC connection between the Bluetooth earphone box and the terminal to be paired when the short-range wireless communication NFC connection instruction is detected, and sending the terminal Bluetooth device address to the Bluetooth headset;
- a headset information acquisition module used for the terminal to be paired to connect through the NFC to acquire the headset Bluetooth device address pre-stored in the Bluetooth headset box;
- a Bluetooth pairing and connection module configured to match the headset Bluetooth device address with the Bluetooth device information set, and determine whether the headset Bluetooth device address exists in the Bluetooth device information set.
- the present application also provides a Bluetooth device
- the Bluetooth device includes a processor, a memory, and a pairing program of the Bluetooth device stored in the memory and executable by the processor, wherein the When the pairing program of the Bluetooth device is executed by the processor, the steps of the pairing method for the Bluetooth device as described above are implemented.
- the present application also provides a computer-readable storage medium, where a pairing program of a Bluetooth device is stored on the computer-readable storage medium, wherein when the pairing program of the Bluetooth device is executed by a processor, the The steps of the pairing method of the Bluetooth device as described above.
- the present application provides a method for pairing a Bluetooth device.
- the method for pairing a Bluetooth device is applied to a pairing device for a Bluetooth device.
- the pairing device includes a Bluetooth headset, a Bluetooth headset box, and a terminal to be paired.
- the Bluetooth headset box obtains the terminal Bluetooth device address of the terminal to be paired through the NFC connection with the terminal to be paired, and sends the terminal Bluetooth device address to the Bluetooth headset;
- the terminal to be paired is connected through the NFC to obtain the Bluetooth device address of the headset pre-stored in the Bluetooth headset box; according to the terminal Bluetooth device address and the Bluetooth device address of the headset, the Bluetooth headset and the terminal to be paired complete the Bluetooth Pair connection.
- the present application performs NFC connection with the terminal to be paired through the Bluetooth headset box, realizes a quick handshake, exchanges the address data of the Bluetooth device, and does not require the user to manually perform a Bluetooth search, and realizes fast Bluetooth pairing between the Bluetooth headset and the terminal to be paired,
- the bluetooth pairing operation is simplified, the bluetooth pairing efficiency is improved, and the technical problems of low pairing efficiency of the bluetooth pairing method of the existing bluetooth device and high complexity of the bluetooth pairing operation are solved.
- FIG. 1 is a schematic diagram of the hardware structure of the Bluetooth headset involved in the solution of the embodiment of the application;
- FIG. 2 is a schematic flowchart of a first embodiment of a method for pairing a Bluetooth device according to the present application
- FIG. 3 is a schematic flowchart of a second embodiment of a method for pairing a Bluetooth device according to the present application
- FIG. 4 is a schematic structural diagram of a Bluetooth headset box and a terminal to be paired in the present application
- FIG. 5 is a schematic diagram of functional modules of a first embodiment of a pairing device for a Bluetooth device of the present application.
- the Bluetooth device pairing method involved in the embodiments of the present application is mainly applied to a Bluetooth headset, and the Bluetooth headset may be a device with display and processing functions, such as a PC, a portable computer, and a mobile terminal.
- FIG. 1 is a schematic diagram of the hardware structure of the Bluetooth headset involved in the solution of the embodiment of the present application.
- the Bluetooth headset may include a processor 1001 (for example, a CPU), a communication bus 1002 , a user interface 1003 , a network interface 1004 , and a memory 1005 .
- the communication bus 1002 is used to realize the connection and communication between these components;
- the user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard);
- the network interface 1004 may optionally include a standard wired interface, a wireless interface (such as a WI-FI interface);
- the memory 1005 can be a high-speed RAM memory, or a non-volatile memory, such as a disk memory, and the memory 1005 can optionally be a storage device independent of the aforementioned processor 1001 .
- FIG. 1 does not constitute a limitation to the Bluetooth headset, and may include more or less components than shown, or combine some components, or arrange different components.
- the memory 1005 as a computer-readable storage medium in FIG. 1 may include an operating system, a network communication module, and a pairing program for a Bluetooth device.
- the network communication module is mainly used to connect to the server and perform data communication with the server; and the processor 1001 can call the pairing program of the Bluetooth device stored in the memory 1005, and execute the pairing method of the Bluetooth device provided by the embodiment of the present application .
- the embodiment of the present application provides a pairing method for a Bluetooth device.
- FIG. 2 is a schematic flowchart of a first embodiment of a method for pairing a Bluetooth device according to the present application.
- the pairing method for a Bluetooth device is applied to a pairing device for a Bluetooth device.
- the pairing device includes a Bluetooth headset, a Bluetooth headset box, and a terminal to be paired.
- the pairing method for the Bluetooth device includes the following steps:
- Step S10 when the short-range wireless communication NFC connection instruction is detected, the Bluetooth headset box obtains the terminal Bluetooth device address of the terminal to be paired through the NFC connection with the terminal to be paired, and sends the terminal to the terminal.
- the Bluetooth device address is sent to the Bluetooth headset;
- pairing between Bluetooth devices requires the user to open the Bluetooth configuration interface of the Bluetooth device, scan for paired Bluetooth devices, and manually select a corresponding Bluetooth device from multiple Bluetooth device connection lists for pairing. Not only the Bluetooth pairing efficiency is low, but also the Bluetooth pairing operation is cumbersome.
- a quick handshake is realized, the address data of the Bluetooth device is exchanged, and the user does not need to manually perform a Bluetooth search.
- the fast Bluetooth pairing between the terminals to be paired simplifies the Bluetooth pairing operation and improves the Bluetooth pairing efficiency.
- the user can connect the two Bluetooth devices by NFC by contacting the Bluetooth earphone box to be paired with the designated position of the terminal to be paired.
- the terminal to be paired may be a TV, a mobile phone to be connected, a computer, or an IPAD and other Bluetooth devices with an NFC module.
- the Bluetooth headset box can quickly shake hands with the terminal to be paired and exchange Bluetooth address information, that is, the Bluetooth headset The box obtains the terminal Bluetooth device address of the terminal to be paired, and sends the terminal Bluetooth device address to the Bluetooth headset.
- Step S20 the terminal to be paired is connected through the NFC to obtain the Bluetooth device address of the headset pre-stored in the Bluetooth headset box;
- the terminal to be paired may acquire the Bluetooth device address of the headset pre-stored in the Bluetooth headset box based on the NFC connection with the Bluetooth headset box.
- the bluetooth device addresses of the earphones of the two Laner earphones can be obtained and stored through a wired connection (shrapnel connection) with the bluetooth earphones. It can also be that when the bluetooth earphone box leaves the factory, the bluetooth device address of the earphone of the bluetooth earphone is directly written into the storage unit of the bluetooth earphone box.
- Step S30 According to the terminal Bluetooth device address and the headset Bluetooth device address, the Bluetooth headset and the terminal to be paired complete a Bluetooth pairing connection.
- the Bluetooth headset and the terminal to be paired may search for a Bluetooth device to be paired within a preset range at a preset frequency, and generate a Bluetooth device set according to the to-be-paired Bluetooth device.
- the Bluetooth device set includes at least one Bluetooth device. Then the bluetooth headset and the terminal to be paired can compare the terminal bluetooth device address and the bluetooth device address of the earphone respectively with the bluetooth device addresses in the set of bluetooth devices searched by each other, so as to determine the target bluetooth device and complete the bluetooth pairing connection. .
- step S30 specifically includes:
- the to-be-paired terminal searches for a Bluetooth device to be paired within a preset range, and acquires a Bluetooth device information set of the to-be-paired Bluetooth device;
- the terminal to be paired matches the headset Bluetooth device address with the Bluetooth device information set to determine the headset Bluetooth device address in the Bluetooth device information set, and based on the headset Bluetooth device address, sends a message to the headset.
- the Bluetooth headset sends a Bluetooth pairing request;
- the bluetooth headset When the bluetooth headset receives the bluetooth pairing request, it compares the current terminal bluetooth information in the bluetooth pairing request with the terminal bluetooth device address, and compares the current terminal bluetooth information with the terminal bluetooth information. When the device addresses are the same, the Bluetooth pairing connection is completed with the terminal to be paired.
- the to-be-paired terminal searches for a Bluetooth device to be paired within a preset range, and acquires a Bluetooth device information set of the to-be-paired Bluetooth device. Then, the terminal to be paired compares and matches the headset Bluetooth device address with the Bluetooth device information set, and determines whether the headset Bluetooth device address exists in the Bluetooth device information set. That is, when the Bluetooth device address of the headset exists in the Bluetooth device information set, the Bluetooth device address of the headset to be paired is determined from among the plurality of Bluetooth devices searched.
- the Bluetooth device address of the Bluetooth headset can also be sent to the terminal to be paired through the NFC connection, and the terminal to be paired can be controlled according to the Bluetooth name and Bluetooth address of the Bluetooth headset.
- the terminal to be paired feeds back the instruction to complete the Bluetooth device address of the headset to the Bluetooth headset box through the NFC connection, that is, synchronously control the Bluetooth headset (or the Bluetooth headset box) or asynchronously control the Bluetooth headset to broadcast the headset Bluetooth device address, that is, Bluetooth name and Bluetooth address.
- a Bluetooth pairing instruction between devices is triggered, so that the terminal to be paired can determine whether the searched Bluetooth device address of the headset is the information of the Bluetooth headset to be paired based on the Bluetooth device address of the headset broadcast by the Bluetooth headset.
- the Bluetooth headset can be placed in the pairing position corresponding to the terminal to be paired. The position distance between the terminal to be paired and the Bluetooth headset is detected by the infrared sensor, and the contact state is confirmed.
- the indicator light connected to the terminal to be paired or the Bluetooth headset flashes red to remind the user.
- the green light will be on. Then, the terminal to be paired is controlled to send a connection status check data packet to the Bluetooth headset by means of NFC connection to detect the connection status of the NFC data line.
- the terminal to be paired receives a corresponding feedback command from the Bluetooth headset, it confirms that the NFC connection between the terminal to be paired and the Bluetooth headset is normal, and the long green light reminds the user that the connection is normal, otherwise the long red light reminds the user that the connection is abnormal. And when the connection is normal, the Bluetooth address and device name of the Bluetooth headset are sent to the terminal to be paired. And when it is detected that the terminal to be paired receives a bluetooth headset reply command, based on the bluetooth device information of the bluetooth headset, the terminal to be paired is controlled to search for bluetooth device information, and the bluetooth headset is controlled to start broadcasting its own headset bluetooth device address.
- the terminal to be paired is controlled to produce a Bluetooth device list according to the searched target Bluetooth device information (the Bluetooth device list may include one or more Bluetooth device information). Match the list of bluetooth devices with the bluetooth address and bluetooth name sent by the bluetooth headset.
- the Bluetooth device list may include one or more Bluetooth device information.
- a bluetooth device in the bluetooth device list that has the same address as the bluetooth device of the headset, that is, when it is determined that the matching is consistent
- automatic bluetooth pairing between the terminal to be paired and the bluetooth headset is realized, and a long green light is displayed to remind the user that the pairing is successful.
- the pairing fails a long red light is displayed to remind the user that the Bluetooth pairing fails.
- the terminal to be paired can be controlled to search for Bluetooth device information again, and the Bluetooth automatic pairing operation can be performed again until the Bluetooth pairing operation is completed.
- This embodiment provides a method for pairing a Bluetooth device.
- the method for pairing a Bluetooth device is applied to a pairing device for a Bluetooth device.
- the pairing device includes a Bluetooth headset, a Bluetooth headset box, and a terminal to be paired.
- the Bluetooth headset box obtains the terminal Bluetooth device address of the terminal to be paired through the NFC connection with the terminal to be paired, and sends the terminal Bluetooth device address to the Bluetooth headset
- the terminal to be paired is connected through the NFC to obtain the Bluetooth device address of the headset pre-stored in the Bluetooth headset box; according to the Bluetooth device address of the terminal and the Bluetooth device address of the headset, the Bluetooth headset and the terminal to be paired are completed Bluetooth pairing connection.
- the present application performs NFC connection with the terminal to be paired through the Bluetooth headset box, realizes a quick handshake, exchanges the address data of the Bluetooth device, and does not require the user to manually perform a Bluetooth search, and realizes fast Bluetooth pairing between the Bluetooth headset and the terminal to be paired,
- the bluetooth pairing operation is simplified, the bluetooth pairing efficiency is improved, and the technical problems of low pairing efficiency of the bluetooth pairing method of the existing bluetooth device and high complexity of the bluetooth pairing operation are solved.
- FIG. 3 is a schematic flowchart of a second embodiment of a method for pairing a Bluetooth device according to the present application.
- the method further includes:
- Step S40 the Bluetooth headset box obtains the device distance from the terminal to be paired based on the infrared proximity sensor, and the Bluetooth headset box determines whether it is in contact with the terminal to be paired based on the device distance;
- Step S50 if the Bluetooth headset box determines that it is in contact with the terminal to be paired, send a connection status detection data packet to the terminal to be paired based on the NFC module;
- step S40 it also includes:
- the Bluetooth earphone box determines that there is no contact with the terminal to be paired, a reminder message of abnormal contact of the NFC module is generated, so that the user can verify the NFC module of the Bluetooth earphone box and the terminal to be paired.
- Step S60 when the terminal to be paired receives the connection state detection data packet, generates a corresponding verification data packet, and feeds back the verification data packet to the Bluetooth headset box;
- Step S70 when the Bluetooth headset box receives the verification data packet, it sends the NFC connection instruction to the terminal to be paired.
- step S70 specifically includes:
- the Bluetooth headset box When the Bluetooth headset box receives the verification data packet, based on the verification data packet and the connection state detection data packet, determine whether it is in effective contact with the terminal to be paired;
- the NFC connection instruction is sent to the terminal to be paired.
- a device adjustment reminder message is output through the Bluetooth headset or a terminal communicatively connected to the Bluetooth headset box to remind the user to adjust the Bluetooth headset box The relative position with the terminal to be paired.
- this embodiment uses an infrared proximity sensor to determine whether the terminal to be paired is in effective contact with the Bluetooth headset (that is, the NFC module of the terminal to be paired is in correct contact with the NFC module of the Bluetooth headset), thereby judging whether the terminal to be paired is in correct contact with the NFC module of the Bluetooth headset Whether a valid connection is established with the Bluetooth headset.
- the device distance between the terminal to be paired and the Bluetooth headset is obtained through an infrared proximity sensor, so as to determine whether the terminal to be paired and the Bluetooth headset are in a contact state according to the device distance, that is, to determine whether the device distance is less than a preset threshold, such as a device If the distance is equal to 0, it is judged as a contact state.
- the terminal to be paired is controlled to send an NFC connection detection instruction, such as a connection status detection data packet, to the Bluetooth headset to determine whether the terminal to be paired and the Bluetooth headset successfully establish an NFC connection.
- the terminal to be paired sends a connection status check data packet to the Bluetooth headset through the NFC connection, so as to detect the connection status of the current NFC connection.
- the terminal to be paired receives a reply from the Bluetooth headset, it confirms that the connection is normal, that is, if the Bluetooth headset receives the connection status detection data packet, and based on the connection status detection packet, it feeds back the corresponding connectable instruction to the terminal to be paired , if the data packet is verified, it means that the terminal to be paired and the Bluetooth headset have successfully established an NFC connection, that is, the terminal to be paired and the Bluetooth headset are in effective contact.
- An NFC connection instruction is generated so that the terminal to be paired communicates with the Bluetooth headset based on the NFC connection, thereby sending the Bluetooth device address of the Bluetooth headset to the terminal to be paired through the NFC connection. If the Bluetooth headset does not feed back the corresponding verification data packet based on the connection status detection data packet sent by the terminal to be paired, or if the data packet fed back by the Bluetooth headset is not the verification data packet corresponding to the connection status detection data packet, it is determined to be pending.
- the contact state between the paired terminal and the Bluetooth headset is not in valid contact, it means that the current contact state between the terminal to be paired and the Bluetooth headset is not the correct contact position, and a device adjustment reminder message is generated and displayed to remind the user to adjust the relative position of the Bluetooth device to be paired, so that the Contact the NFC module of the terminal to be paired with the NFC module of the Bluetooth headset.
- an infrared proximity sensor is used to detect whether the terminal to be paired and the Bluetooth headset are in contact state, and when the contact state is confirmed, the terminal to be paired asks the Bluetooth headset for the connection status with the Bluetooth headset through NFC connection. And after receiving the confirmation reply message from the Bluetooth headset, it is determined that the NFC line is connected normally, that is, the terminal to be paired successfully establishes an NFC connection with the Bluetooth headset, and then transmits the Bluetooth name and Bluetooth address of the Bluetooth headset based on the NFC connection, thereby achieving accurate Fast Bluetooth pairing.
- step S10 specifically includes:
- the second NFC module When detecting the short-range wireless communication NFC connection instruction, the second NFC module receives the terminal OOB data sent by the first NFC module through the NFC connection with the first NFC module, wherein the short-range wireless communication
- the wireless communication NFC connection instruction is triggered by a touch operation between the first NFC module and the second NFC module;
- the second NFC module acquires the terminal Bluetooth device address in the terminal OOB data, and sends the terminal Bluetooth device address to the MCU module;
- the MCU module sends the Bluetooth device address of the terminal to the Bluetooth headset, and sends the headset OOB data including the Bluetooth device address of the headset to the first NFC module.
- the terminal to be paired includes an NFC module, a Bluetooth module, a Bluetooth antenna and an NFC antenna;
- the Bluetooth headset box ie the charging box
- the storage unit includes two address modules named Data-L and Data-R respectively.
- TWS Bluetooth headsets named TWS(L) and TWS(R).
- the MCU module of the Bluetooth headset box Before the Bluetooth headset box leaves the factory, or after the TWS Bluetooth headset is put into the Bluetooth headset box, the MCU module of the Bluetooth headset box reads the Link key and MAC address of the two TWS Bluetooth headsets and writes them into the corresponding storage units respectively.
- the Bluetooth headset box and the mobile phone terminal perform data interaction through the NFC coupling connection.
- the NFC module of the Bluetooth headset box obtains the Bluetooth device address data transmitted by the mobile phone terminal in the form of OOB data, it sends the Bluetooth device address to the MCU.
- Data processing unit module
- the data exchange processing unit of the MCU After receiving the OOB data, the data exchange processing unit of the MCU reads the Data-L and Data-R (corresponding to the Link key and MAC address of the TWS headset) data of the Bluetooth headset from the storage unit, and after parsing, realizes Quick handshake, feedback the Link key and MAC address data of the TWS headset to the mobile terminal;
- Data-L and Data-R corresponding to the Link key and MAC address of the TWS headset
- an embodiment of the present application also provides a pairing device for a Bluetooth device.
- FIG. 5 is a schematic diagram of functional modules of a first embodiment of a pairing device for a Bluetooth device of the present application.
- the pairing device of the Bluetooth device includes:
- the terminal information acquisition module 10 is configured to acquire the terminal Bluetooth device address of the terminal to be paired through the NFC connection between the Bluetooth earphone box and the terminal to be paired when a short-range wireless communication NFC connection instruction is detected, and sending the terminal Bluetooth device address to the Bluetooth headset;
- the headset information acquisition module 20 is used for the terminal to be paired to connect through the NFC to acquire the Bluetooth device address of the headset pre-stored in the Bluetooth headset box;
- the Bluetooth pairing connection module 30 is configured to match the Bluetooth device address of the headset with the Bluetooth device information set, and determine whether the headset Bluetooth device address exists in the Bluetooth device information set.
- the Bluetooth pairing connection module 30 specifically includes:
- a Bluetooth device search unit used for the to-be-paired terminal to search for a to-be-paired Bluetooth device within a preset range, and to acquire a Bluetooth device information set of the to-be-paired Bluetooth device;
- a Bluetooth pairing request unit used by the terminal to be paired to match the Bluetooth device address of the headset with the Bluetooth device information set, so as to determine the Bluetooth device address of the headset in the Bluetooth device information set, and based on the headset Bluetooth device address, sending a Bluetooth pairing request to the Bluetooth headset;
- the Bluetooth pairing connection unit is used for the Bluetooth headset to compare the current terminal Bluetooth information in the Bluetooth pairing request with the Bluetooth device address of the terminal when receiving the Bluetooth pairing request, and send the Bluetooth pairing request to the current terminal.
- the Bluetooth information is the same as the Bluetooth device address of the terminal, the Bluetooth pairing connection is completed with the terminal to be paired.
- the pairing device of the Bluetooth device further includes a connection instruction generation module, and the connection instruction generation module specifically includes:
- a contact determination unit used for the Bluetooth headset box to obtain the device distance between the terminal to be paired based on an infrared proximity sensor, and the Bluetooth headset box to determine whether it is in contact with the terminal to be paired based on the device distance;
- connection detection unit configured to send a connection status detection data packet to the terminal to be paired based on the NFC module if the Bluetooth headset box determines that it is in contact with the terminal to be paired;
- connection feedback unit configured to generate a corresponding verification data packet when the terminal to be paired receives the connection state detection data packet, and feed back the verification data packet to the Bluetooth headset box;
- the connection determination unit is used for the Bluetooth earphone box to send the NFC connection instruction to the terminal to be paired when receiving the verification data packet.
- the contact judgment unit is also used for:
- the Bluetooth headset box When the Bluetooth headset box receives the verification data packet, based on the verification data packet and the connection state detection data packet, determine whether it is in effective contact with the terminal to be paired;
- the NFC connection instruction is sent to the terminal to be paired.
- connection determination unit is also used for:
- the Bluetooth earphone box determines that there is no contact with the terminal to be paired, a reminder message of abnormal contact of the NFC module is generated, so that the user can verify the NFC module of the Bluetooth earphone box and the terminal to be paired.
- connection determination unit is also used for:
- a device adjustment reminder message is output through the Bluetooth headset or a terminal communicatively connected to the Bluetooth headset box to remind the user to adjust the Bluetooth headset box The relative position with the terminal to be paired.
- terminal information acquisition module 10 is also used for:
- the second NFC module When detecting the short-range wireless communication NFC connection instruction, the second NFC module receives the terminal OOB data sent by the first NFC module through the NFC connection with the first NFC module, wherein the short-range wireless communication
- the wireless communication NFC connection instruction is triggered by a touch operation between the first NFC module and the second NFC module;
- the second NFC module acquires the terminal Bluetooth device address in the terminal OOB data, and sends the terminal Bluetooth device address to the MCU module;
- the MCU module sends the Bluetooth device address of the terminal to the Bluetooth headset, and sends the headset OOB data including the Bluetooth device address of the headset to the first NFC module.
- the modules in the pairing device for Bluetooth devices correspond to the steps in the embodiments of the pairing method for Bluetooth devices, and their functions and implementation processes are not repeated here.
- an embodiment of the present application further provides a Bluetooth device.
- the Bluetooth device of the present application stores a Bluetooth device pairing program, wherein when the Bluetooth device pairing program is executed by the processor, the steps of the above-mentioned Bluetooth device pairing method are implemented.
- embodiments of the present application further provide a computer-readable storage medium.
- the computer-readable storage medium of the present application stores a pairing program of a Bluetooth device, wherein when the pairing program of the Bluetooth device is executed by the processor, the steps of the above-mentioned pairing method for a Bluetooth device are implemented.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Telephone Function (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
Some embodiments of the present application disclose a Bluetooth device pairing method, a device, and a storage medium, where when a near field communication NFC connection instruction is detected, a Bluetooth headphone case obtains the terminal Bluetooth device address of a terminal to be paired by means of an NFC connection with the terminal to be paired, and sends the terminal Bluetooth device address to a pair of Bluetooth headphones; the terminal to be paired obtains the headphone Bluetooth device address pre-stored in the Bluetooth headphone case by means of the NFC connection; and the Bluetooth headphones complete a Bluetooth pairing connection with the terminal to be paired according to the terminal Bluetooth device address and the headphone Bluetooth device address. By means of the Bluetooth headphone case establishing an NFC connection with the terminal to be paired, a rapid handshake is implemented, Bluetooth device address data is exchanged, a user manually performing a Bluetooth search is unnecessary, quick Bluetooth pairing between the Bluetooth headphones and the terminal to be paired is achieved, a Bluetooth pairing operation is simplified, and Bluetooth pairing efficiency is improved.
Description
本申请要求于2020年09月04日提交中国专利局、申请号为202010928266.8、发明名称为“蓝牙设备的配对方法、设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 202010928266.8 and the invention titled "Bluetooth device pairing method, device and storage medium" filed with the Chinese Patent Office on September 4, 2020, the entire contents of which are incorporated by reference in in this application.
本申请涉及蓝牙通信技术领域,尤其涉及一种蓝牙设备的配对方法、设备及计算机可读存储介质。The present application relates to the technical field of Bluetooth communication, and in particular, to a Bluetooth device pairing method, device, and computer-readable storage medium.
随着无线移动通信的不断发展,越来越多的无线通信设备应运而生。无线耳机,如TWS无线蓝牙耳机,作为移动通信发展的产物,弥补了传统有线耳机存在的携带不便、使用受限等问题。TWS无线蓝牙耳机由两只没有线缆,相互独立的耳机和一个为它们充电的耳机充电盒组成。目前,蓝牙耳机之间进行配对需要用户打开蓝牙设备的蓝牙配置界面,进行配对蓝牙设备的搜索,在多个蓝牙设备连接列表中手动选择相应的蓝牙设备进行配对。但是,TWS蓝牙耳机由于尺寸很小,一般没有单独的按键,因此TWS蓝牙耳机与手机等终端的配对操作会更加复杂。另外,蓝牙耳机及待连接终端的周边蓝牙设备较多,搜索的时间也较长,整个配对过程会耗时较长,很大程度上影响了用户体验效果。因此,目前的蓝牙设备的配对方法不仅蓝牙配对效率低下,而且蓝牙配对操作繁琐度较高。With the continuous development of wireless mobile communication, more and more wireless communication devices emerge as the times require. Wireless earphones, such as TWS wireless Bluetooth earphones, as a product of the development of mobile communications, make up for the inconvenience of carrying and limited use of traditional wired earphones. The TWS wireless Bluetooth earphones consist of two independent earphones without cables and a charging case for charging them. Currently, pairing between Bluetooth headsets requires the user to open the Bluetooth configuration interface of the Bluetooth device, search for paired Bluetooth devices, and manually select a corresponding Bluetooth device from multiple Bluetooth device connection lists for pairing. However, due to its small size, the TWS Bluetooth headset generally does not have a separate button, so the pairing operation between the TWS Bluetooth headset and a terminal such as a mobile phone will be more complicated. In addition, there are many Bluetooth headsets and peripheral Bluetooth devices of the terminal to be connected, and the search time is also long. The entire pairing process will take a long time, which greatly affects the user experience. Therefore, the current pairing method for Bluetooth devices not only has low Bluetooth pairing efficiency, but also has high complexity in Bluetooth pairing operations.
发明内容SUMMARY OF THE INVENTION
本申请的主要目的在于提供一种蓝牙设备的配对方法、设备及计算机可读存储介质,旨在解决现有蓝牙设备的蓝牙配对方法配对效率低下以及蓝牙配对操作繁琐度较高的技术问题。The main purpose of the present application is to provide a Bluetooth device pairing method, device and computer-readable storage medium, aiming to solve the technical problems of low pairing efficiency and high complexity of Bluetooth pairing operation in the existing Bluetooth device pairing method.
为实现上述目的,本申请提供一种蓝牙设备的配对方法,所述蓝牙设备的配对方法应用于蓝牙设备的配对装置,所述配对装置包括蓝牙耳机、蓝牙 耳机盒以及待配对终端,所述蓝牙设备的配对方法包括以下步骤:In order to achieve the above object, the present application provides a method for pairing a Bluetooth device. The method for pairing a Bluetooth device is applied to a pairing device for a Bluetooth device. The pairing device includes a Bluetooth headset, a Bluetooth headset box, and a terminal to be paired. The pairing method of the device includes the following steps:
在检测到近距离无线通讯NFC连接指令时,所述蓝牙耳机盒通过与所述待配对终端之间的NFC连接,获取所述待配对终端的终端蓝牙设备地址,并将所述终端蓝牙设备地址发送至所述蓝牙耳机;When the short-range wireless communication NFC connection instruction is detected, the Bluetooth headset box obtains the terminal Bluetooth device address of the terminal to be paired through the NFC connection with the terminal to be paired, and sends the Bluetooth device address of the terminal to the terminal. sent to the bluetooth headset;
所述待配对终端通过所述NFC连接,获取所述蓝牙耳机盒中预存的耳机蓝牙设备地址;The terminal to be paired is connected through the NFC to obtain the Bluetooth device address of the headset pre-stored in the Bluetooth headset box;
根据所述终端蓝牙设备地址以及耳机蓝牙设备地址,所述蓝牙耳机与所述待配对终端完成蓝牙配对连接。According to the bluetooth device address of the terminal and the bluetooth device address of the earphone, the bluetooth earphone and the terminal to be paired complete the bluetooth pairing connection.
可选地,所述根据所述终端蓝牙设备地址以及耳机蓝牙设备地址,所述蓝牙耳机与所述待配对终端完成蓝牙配对连接的步骤具体包括:Optionally, the step of completing the Bluetooth pairing connection between the Bluetooth headset and the terminal to be paired according to the terminal Bluetooth device address and the headset Bluetooth device address specifically includes:
所述待配对终端搜索预设范围内待配对的蓝牙设备,并获取所述待配对的蓝牙设备的蓝牙设备信息集;The to-be-paired terminal searches for a Bluetooth device to be paired within a preset range, and acquires a Bluetooth device information set of the to-be-paired Bluetooth device;
所述待配对终端将所述耳机蓝牙设备地址与所述蓝牙设备信息集进行匹配,以在所述蓝牙设备信息集中确定所述耳机蓝牙设备地址,并基于所述耳机蓝牙设备地址,向所述蓝牙耳机发送蓝牙配对请求;The terminal to be paired matches the headset Bluetooth device address with the Bluetooth device information set to determine the headset Bluetooth device address in the Bluetooth device information set, and based on the headset Bluetooth device address, sends a message to the headset. The Bluetooth headset sends a Bluetooth pairing request;
所述蓝牙耳机在接收到所述蓝牙配对请求时,将所述蓝牙配对请求中的当前终端蓝牙信息与所述终端蓝牙设备地址进行比对,并在所述当前终端蓝牙信息与所述终端蓝牙设备地址相同时,与所述待配对终端完成蓝牙配对连接。When the bluetooth headset receives the bluetooth pairing request, it compares the current terminal bluetooth information in the bluetooth pairing request with the terminal bluetooth device address, and compares the current terminal bluetooth information with the terminal bluetooth information. When the device addresses are the same, the Bluetooth pairing connection is completed with the terminal to be paired.
可选地,所述在检测到近距离无线通讯NFC连接指令时的步骤之前,还包括:Optionally, before the step when the short-range wireless communication NFC connection instruction is detected, the method further includes:
所述蓝牙耳机盒基于红外接近传感器获取距离所述待配对终端之间的设备间距,所述蓝牙耳机盒并基于所述设备间距判断是否与所述待配对终端发生接触;The Bluetooth headset box obtains the device distance from the terminal to be paired based on the infrared proximity sensor, and the Bluetooth headset box determines whether it is in contact with the terminal to be paired based on the device distance;
若所述蓝牙耳机盒判定与所述待配对终端发生接触,则基于NFC模块向所述待配对终端发送连接状态检测数据包;If the Bluetooth headset box determines that it is in contact with the terminal to be paired, send a connection status detection data packet to the terminal to be paired based on the NFC module;
所述待配对终端在接收到所述连接状态检测数据包时,则生成对应的校验数据包,并向所述蓝牙耳机盒反馈所述校验数据包;When the terminal to be paired receives the connection state detection data packet, it generates a corresponding verification data packet, and feeds back the verification data packet to the Bluetooth headset box;
所述蓝牙耳机盒在接收到所述校验数据包时,则向所述待配对终端发送所述NFC连接指令。When the Bluetooth headset box receives the verification data packet, it sends the NFC connection instruction to the terminal to be paired.
可选地,所述蓝牙耳机盒基于红外接近传感器获取距离所述待配对终端之间的设备间距,所述蓝牙耳机盒并基于所述设备间距判断是否与所述待配对终端发生接触的步骤之后,还包括:Optionally, the Bluetooth headset box obtains the device distance from the terminal to be paired based on an infrared proximity sensor, and the Bluetooth headset box determines whether it is in contact with the terminal to be paired based on the device distance. ,Also includes:
若所述蓝牙耳机盒判定与所述待配对终端未发生接触,则生成NFC模块接触异常的提醒消息,以便用户对所述蓝牙耳机盒以及所述待配对终端的NFC模块进行校验。If the Bluetooth earphone box determines that there is no contact with the terminal to be paired, a reminder message of abnormal contact of the NFC module is generated, so that the user can verify the NFC module of the Bluetooth earphone box and the terminal to be paired.
可选地,所述蓝牙耳机盒在接收到所述校验数据包时,则向所述待配对终端发送所述NFC连接指令的步骤具体包括:Optionally, when the Bluetooth headset box receives the verification data packet, the step of sending the NFC connection instruction to the terminal to be paired specifically includes:
所述蓝牙耳机盒在接收到所述校验数据包时,基于所述校验数据包以及所述连接状态检测数据包,判断是否与所述待配对终端进行有效接触;When the Bluetooth headset box receives the verification data packet, based on the verification data packet and the connection state detection data packet, determine whether it is in effective contact with the terminal to be paired;
若所述蓝牙耳机盒判定与所述待配对终端进行有效接触,则向所述待配对终端发送所述NFC连接指令。If the Bluetooth earphone box determines that it is in effective contact with the terminal to be paired, the NFC connection instruction is sent to the terminal to be paired.
可选地,所述蓝牙耳机盒在接收到所述校验数据包时,基于所述校验数据包以及所述连接状态检测数据包,判断是否与所述待配对终端进行有效接触的步骤之后,还包括:Optionally, when the Bluetooth headset box receives the verification data packet, based on the verification data packet and the connection state detection data packet, after the step of judging whether to make effective contact with the terminal to be paired. ,Also includes:
若所述蓝牙耳机盒判定与所述待配对终端未进行有效接触,则通过所述蓝牙耳机或与所述蓝牙耳机盒通讯连接的终端输出设备调整提醒消息,以提醒用户调整所述蓝牙耳机盒与待配对终端之间的相对位置。If the Bluetooth headset box determines that there is no effective contact with the terminal to be paired, a device adjustment reminder message is output through the Bluetooth headset or a terminal communicatively connected to the Bluetooth headset box to remind the user to adjust the Bluetooth headset box The relative position with the terminal to be paired.
可选地,所述待配对终端包括第一NFC模块,所述蓝牙耳机盒包括第二NFC模块以及MCU模块,所述在检测到近距离无线通讯NFC连接指令时,所述蓝牙耳机盒通过与所述待配对终端之间的NFC连接,获取所述待配对终端的终端蓝牙设备地址,并将所述终端蓝牙设备地址发送至所述蓝牙耳机的步骤具体包括:Optionally, the terminal to be paired includes a first NFC module, the Bluetooth headset box includes a second NFC module and an MCU module, and when a short-range wireless communication NFC connection instruction is detected, the Bluetooth headset box is connected to the Bluetooth headset box. The NFC connection between the terminals to be paired, the steps of acquiring the terminal Bluetooth device address of the terminal to be paired, and sending the terminal Bluetooth device address to the Bluetooth headset specifically include:
在检测所述近距离无线通讯NFC连接指令时,所述第二NFC模块通过与所述第一NFC模块的NFC连接,接收所述第一NFC模块发送的终端OOB数据,其中,所述近距离无线通讯NFC连接指令为所述第一NFC模块与所述第二NFC模块的触碰操作触发;When detecting the short-range wireless communication NFC connection instruction, the second NFC module receives the terminal OOB data sent by the first NFC module through the NFC connection with the first NFC module, wherein the short-range wireless communication The wireless communication NFC connection instruction is triggered by a touch operation between the first NFC module and the second NFC module;
所述第二NFC模块获取所述终端OOB数据中的终端蓝牙设备地址,并将所述终端蓝牙设备地址发送至所述MCU模块;The second NFC module acquires the terminal Bluetooth device address in the terminal OOB data, and sends the terminal Bluetooth device address to the MCU module;
所述MCU模块将所述终端蓝牙设备地址发送至所述蓝牙耳机,并将包 含所述耳机蓝牙设备地址的耳机OOB数据发送至所述第一NFC模块。The MCU module sends the terminal Bluetooth device address to the Bluetooth headset, and sends the headset OOB data including the headset Bluetooth device address to the first NFC module.
此外,为实现上述目的,本申请还提供一种蓝牙设备的配对装置,所述蓝牙设备的配对装置包括:In addition, in order to achieve the above purpose, the present application also provides a pairing device for a Bluetooth device, and the pairing device for the Bluetooth device includes:
终端信息获取模块,用于在检测到近距离无线通讯NFC连接指令时,所述蓝牙耳机盒通过与所述待配对终端之间的NFC连接,获取所述待配对终端的终端蓝牙设备地址,并将所述终端蓝牙设备地址发送至所述蓝牙耳机;The terminal information acquisition module is used to acquire the terminal Bluetooth device address of the terminal to be paired through the NFC connection between the Bluetooth earphone box and the terminal to be paired when the short-range wireless communication NFC connection instruction is detected, and sending the terminal Bluetooth device address to the Bluetooth headset;
耳机信息获取模块,用于所述待配对终端通过所述NFC连接,获取所述蓝牙耳机盒中预存的耳机蓝牙设备地址;a headset information acquisition module, used for the terminal to be paired to connect through the NFC to acquire the headset Bluetooth device address pre-stored in the Bluetooth headset box;
蓝牙配对连接模块,用于将所述耳机蓝牙设备地址与所述蓝牙设备信息集进行匹配,并判断所述蓝牙设备信息集中是否存在所述耳机蓝牙设备地址。A Bluetooth pairing and connection module, configured to match the headset Bluetooth device address with the Bluetooth device information set, and determine whether the headset Bluetooth device address exists in the Bluetooth device information set.
此外,为实现上述目的,本申请还提供一种蓝牙设备,所述蓝牙设备包括处理器、存储器、以及存储在所述存储器上并可被所述处理器执行的蓝牙设备的配对程序,其中所述蓝牙设备的配对程序被所述处理器执行时,实现如上所述的蓝牙设备的配对方法的步骤。In addition, in order to achieve the above object, the present application also provides a Bluetooth device, the Bluetooth device includes a processor, a memory, and a pairing program of the Bluetooth device stored in the memory and executable by the processor, wherein the When the pairing program of the Bluetooth device is executed by the processor, the steps of the pairing method for the Bluetooth device as described above are implemented.
此外,为实现上述目的,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有蓝牙设备的配对程序,其中所述蓝牙设备的配对程序被处理器执行时,实现如上所述的蓝牙设备的配对方法的步骤。In addition, in order to achieve the above object, the present application also provides a computer-readable storage medium, where a pairing program of a Bluetooth device is stored on the computer-readable storage medium, wherein when the pairing program of the Bluetooth device is executed by a processor, the The steps of the pairing method of the Bluetooth device as described above.
本申请提供一种蓝牙设备的配对方法,所述蓝牙设备的配对方法应用于蓝牙设备的配对装置,所述配对装置包括蓝牙耳机、蓝牙耳机盒以及待配对终端,通过在检测到近距离无线通讯NFC连接指令时,所述蓝牙耳机盒通过与所述待配对终端之间的NFC连接,获取所述待配对终端的终端蓝牙设备地址,并将所述终端蓝牙设备地址发送至所述蓝牙耳机;所述待配对终端通过所述NFC连接,获取所述蓝牙耳机盒中预存的耳机蓝牙设备地址;根据所述终端蓝牙设备地址以及耳机蓝牙设备地址,所述蓝牙耳机与所述待配对终端完成蓝牙配对连接。通过上述方式,本申请通过蓝牙耳机盒与待配对终端进行NFC连接,实现快速握手,互换蓝牙设备地址数据,无需用户手动进行蓝 牙搜索,实现蓝牙耳机和待配对终端之间的快速蓝牙配对,简化了蓝牙配对操作,提高了蓝牙配对效率,解决了现有蓝牙设备的蓝牙配对方法配对效率低下以及蓝牙配对操作繁琐度较高的技术问题。The present application provides a method for pairing a Bluetooth device. The method for pairing a Bluetooth device is applied to a pairing device for a Bluetooth device. The pairing device includes a Bluetooth headset, a Bluetooth headset box, and a terminal to be paired. When the NFC connection instruction is issued, the Bluetooth headset box obtains the terminal Bluetooth device address of the terminal to be paired through the NFC connection with the terminal to be paired, and sends the terminal Bluetooth device address to the Bluetooth headset; The terminal to be paired is connected through the NFC to obtain the Bluetooth device address of the headset pre-stored in the Bluetooth headset box; according to the terminal Bluetooth device address and the Bluetooth device address of the headset, the Bluetooth headset and the terminal to be paired complete the Bluetooth Pair connection. In the above-mentioned manner, the present application performs NFC connection with the terminal to be paired through the Bluetooth headset box, realizes a quick handshake, exchanges the address data of the Bluetooth device, and does not require the user to manually perform a Bluetooth search, and realizes fast Bluetooth pairing between the Bluetooth headset and the terminal to be paired, The bluetooth pairing operation is simplified, the bluetooth pairing efficiency is improved, and the technical problems of low pairing efficiency of the bluetooth pairing method of the existing bluetooth device and high complexity of the bluetooth pairing operation are solved.
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一部分附图,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the accompanying drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only It is a part of the drawings of the present application. For those of ordinary skill in the art, other drawings can also be obtained from the provided drawings without any creative effort.
图1为本申请实施例方案中涉及的蓝牙耳机的硬件结构示意图;FIG. 1 is a schematic diagram of the hardware structure of the Bluetooth headset involved in the solution of the embodiment of the application;
图2为本申请蓝牙设备的配对方法第一实施例的流程示意图;2 is a schematic flowchart of a first embodiment of a method for pairing a Bluetooth device according to the present application;
图3为本申请蓝牙设备的配对方法第二实施例的流程示意图;3 is a schematic flowchart of a second embodiment of a method for pairing a Bluetooth device according to the present application;
图4为本申请蓝牙耳机盒以及待配对终端的结构示意图;4 is a schematic structural diagram of a Bluetooth headset box and a terminal to be paired in the present application;
图5为本申请蓝牙设备的配对装置第一实施例的功能模块示意图。FIG. 5 is a schematic diagram of functional modules of a first embodiment of a pairing device for a Bluetooth device of the present application.
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
本申请实施例涉及的蓝牙设备的配对方法主要应用于蓝牙耳机,该蓝牙耳机可以是PC、便携计算机、移动终端等具有显示和处理功能的设备。The Bluetooth device pairing method involved in the embodiments of the present application is mainly applied to a Bluetooth headset, and the Bluetooth headset may be a device with display and processing functions, such as a PC, a portable computer, and a mobile terminal.
参照图1,图1为本申请实施例方案中涉及的蓝牙耳机的硬件结构示意图。本申请实施例中,蓝牙耳机可以包括处理器1001(例如CPU),通信总线1002,用户接口1003,网络接口1004,存储器1005。其中,通信总线1002用于实现这些组件之间的连接通信;用户接口1003可以包括显示屏(Display)、输入单元比如键盘(Keyboard);网络接口1004可选的可以包括标准的有线接口、无线接口(如WI-FI接口);存储器1005可以是高速RAM存储器,也可以是稳定的存储器(non-volatile memory),例如磁盘存储器,存储器1005可选的还可以是独立于前述处理器1001的存储装置。Referring to FIG. 1 , FIG. 1 is a schematic diagram of the hardware structure of the Bluetooth headset involved in the solution of the embodiment of the present application. In this embodiment of the present application, the Bluetooth headset may include a processor 1001 (for example, a CPU), a communication bus 1002 , a user interface 1003 , a network interface 1004 , and a memory 1005 . Wherein, the communication bus 1002 is used to realize the connection and communication between these components; the user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard); the network interface 1004 may optionally include a standard wired interface, a wireless interface (such as a WI-FI interface); the memory 1005 can be a high-speed RAM memory, or a non-volatile memory, such as a disk memory, and the memory 1005 can optionally be a storage device independent of the aforementioned processor 1001 .
本领域技术人员可以理解,图1中示出的硬件结构并不构成对蓝牙耳机 的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。Those skilled in the art can understand that the hardware structure shown in FIG. 1 does not constitute a limitation to the Bluetooth headset, and may include more or less components than shown, or combine some components, or arrange different components.
继续参照图1,图1中作为一种计算机可读存储介质的存储器1005可以包括操作系统、网络通信模块以及蓝牙设备的配对程序。Continuing to refer to FIG. 1 , the memory 1005 as a computer-readable storage medium in FIG. 1 may include an operating system, a network communication module, and a pairing program for a Bluetooth device.
在图1中,网络通信模块主要用于连接服务器,与服务器进行数据通信;而处理器1001可以调用存储器1005中存储的蓝牙设备的配对程序,并执行本申请实施例提供的蓝牙设备的配对方法。In FIG. 1, the network communication module is mainly used to connect to the server and perform data communication with the server; and the processor 1001 can call the pairing program of the Bluetooth device stored in the memory 1005, and execute the pairing method of the Bluetooth device provided by the embodiment of the present application .
本申请实施例提供了一种蓝牙设备的配对方法。The embodiment of the present application provides a pairing method for a Bluetooth device.
参照图2,图2为本申请蓝牙设备的配对方法第一实施例的流程示意图。Referring to FIG. 2, FIG. 2 is a schematic flowchart of a first embodiment of a method for pairing a Bluetooth device according to the present application.
本实施例中,所述蓝牙设备的配对方法应用于蓝牙设备的配对装置,所述配对装置包括蓝牙耳机、蓝牙耳机盒以及待配对终端,所述蓝牙设备的配对方法包括以下步骤:In this embodiment, the pairing method for a Bluetooth device is applied to a pairing device for a Bluetooth device. The pairing device includes a Bluetooth headset, a Bluetooth headset box, and a terminal to be paired. The pairing method for the Bluetooth device includes the following steps:
步骤S10,在检测到近距离无线通讯NFC连接指令时,所述蓝牙耳机盒通过与所述待配对终端之间的NFC连接,获取所述待配对终端的终端蓝牙设备地址,并将所述终端蓝牙设备地址发送至所述蓝牙耳机;Step S10, when the short-range wireless communication NFC connection instruction is detected, the Bluetooth headset box obtains the terminal Bluetooth device address of the terminal to be paired through the NFC connection with the terminal to be paired, and sends the terminal to the terminal. The Bluetooth device address is sent to the Bluetooth headset;
目前蓝牙设备之间进行配对需要用户打开蓝牙设备的蓝牙配置界面,进行配对蓝牙设备的扫描,在多个蓝牙设备连接列表中手动选择相应的蓝牙设备进行配对。不仅蓝牙配对效率低下,而且蓝牙配对操作繁琐度较高。为了解决上述问题,本实施例中,通过蓝牙耳机盒以及待配对终端之间的近距离无线通讯NFC连接,实现快速握手,互换蓝牙设备地址数据,无需用户手动进行蓝牙搜索,实现蓝牙耳机和待配对终端之间的快速蓝牙配对,简化了蓝牙配对操作,提高了蓝牙配对效率。具体地,用户可通过将待配对的蓝牙耳机盒与待配对终端的指定位置进行接触,以将两个蓝牙设备进行NFC连接。其中,待配对终端可以是电视、待连接的手机、电脑或IPAD等具有NFC模块的蓝牙设备。在检测到NFC连接指令时,即检测到两个蓝牙设备进行了有效接触,可基于NFC连接指令,所述蓝牙耳机盒可与待配对终端进行快速握手,交互蓝牙地址信息,即所述蓝牙耳机盒获取所述待配对终端的终端蓝牙设备地址,并将所述终端蓝牙设备地址发送至所述蓝牙耳机。Currently, pairing between Bluetooth devices requires the user to open the Bluetooth configuration interface of the Bluetooth device, scan for paired Bluetooth devices, and manually select a corresponding Bluetooth device from multiple Bluetooth device connection lists for pairing. Not only the Bluetooth pairing efficiency is low, but also the Bluetooth pairing operation is cumbersome. In order to solve the above problems, in this embodiment, through the short-range wireless communication NFC connection between the Bluetooth headset box and the terminal to be paired, a quick handshake is realized, the address data of the Bluetooth device is exchanged, and the user does not need to manually perform a Bluetooth search. The fast Bluetooth pairing between the terminals to be paired simplifies the Bluetooth pairing operation and improves the Bluetooth pairing efficiency. Specifically, the user can connect the two Bluetooth devices by NFC by contacting the Bluetooth earphone box to be paired with the designated position of the terminal to be paired. The terminal to be paired may be a TV, a mobile phone to be connected, a computer, or an IPAD and other Bluetooth devices with an NFC module. When the NFC connection command is detected, it is detected that the two Bluetooth devices are in effective contact. Based on the NFC connection command, the Bluetooth headset box can quickly shake hands with the terminal to be paired and exchange Bluetooth address information, that is, the Bluetooth headset The box obtains the terminal Bluetooth device address of the terminal to be paired, and sends the terminal Bluetooth device address to the Bluetooth headset.
步骤S20,所述待配对终端通过所述NFC连接,获取所述蓝牙耳机盒中 预存的耳机蓝牙设备地址;Step S20, the terminal to be paired is connected through the NFC to obtain the Bluetooth device address of the headset pre-stored in the Bluetooth headset box;
本实施例中,所述待配对终端可基于与蓝牙耳机盒的NFC连接,获取蓝牙耳机盒中预存的耳机蓝牙设备地址。其中,所述蓝牙耳机盒可在蓝牙耳机放置于盒内时,通过与蓝牙耳机的有线连接(弹片连接),获取两只兰儿耳机的耳机蓝牙设备地址进行存储。还可以是蓝牙耳机盒出厂时,直接将蓝牙耳机的耳机蓝牙设备地址写入蓝牙耳机盒的存储单元。In this embodiment, the terminal to be paired may acquire the Bluetooth device address of the headset pre-stored in the Bluetooth headset box based on the NFC connection with the Bluetooth headset box. Wherein, when the bluetooth earphones are placed in the box, the bluetooth device addresses of the earphones of the two Laner earphones can be obtained and stored through a wired connection (shrapnel connection) with the bluetooth earphones. It can also be that when the bluetooth earphone box leaves the factory, the bluetooth device address of the earphone of the bluetooth earphone is directly written into the storage unit of the bluetooth earphone box.
步骤S30,根据所述终端蓝牙设备地址以及耳机蓝牙设备地址,所述蓝牙耳机与所述待配对终端完成蓝牙配对连接。Step S30: According to the terminal Bluetooth device address and the headset Bluetooth device address, the Bluetooth headset and the terminal to be paired complete a Bluetooth pairing connection.
本实施例中,所述蓝牙耳机与所述待配对终端可以以预设频率搜索预设范围内待配对蓝牙设备,并根据所述待配对蓝牙设备生成蓝牙设备集。其中,所述蓝牙设备集中包括至少一个蓝牙设备。然后所述蓝牙耳机与所述待配对终端可分别将终端蓝牙设备地址以及耳机蓝牙设备地址,与各自搜索到的蓝牙设备集中的蓝牙设备地址进行比对,从而确定目标蓝牙设备,完成蓝牙配对连接。In this embodiment, the Bluetooth headset and the terminal to be paired may search for a Bluetooth device to be paired within a preset range at a preset frequency, and generate a Bluetooth device set according to the to-be-paired Bluetooth device. Wherein, the Bluetooth device set includes at least one Bluetooth device. Then the bluetooth headset and the terminal to be paired can compare the terminal bluetooth device address and the bluetooth device address of the earphone respectively with the bluetooth device addresses in the set of bluetooth devices searched by each other, so as to determine the target bluetooth device and complete the bluetooth pairing connection. .
其中,所述步骤S30具体包括:Wherein, the step S30 specifically includes:
所述待配对终端搜索预设范围内待配对的蓝牙设备,并获取所述待配对的蓝牙设备的蓝牙设备信息集;The to-be-paired terminal searches for a Bluetooth device to be paired within a preset range, and acquires a Bluetooth device information set of the to-be-paired Bluetooth device;
所述待配对终端将所述耳机蓝牙设备地址与所述蓝牙设备信息集进行匹配,以在所述蓝牙设备信息集中确定所述耳机蓝牙设备地址,并基于所述耳机蓝牙设备地址,向所述蓝牙耳机发送蓝牙配对请求;The terminal to be paired matches the headset Bluetooth device address with the Bluetooth device information set to determine the headset Bluetooth device address in the Bluetooth device information set, and based on the headset Bluetooth device address, sends a message to the headset. The Bluetooth headset sends a Bluetooth pairing request;
所述蓝牙耳机在接收到所述蓝牙配对请求时,将所述蓝牙配对请求中的当前终端蓝牙信息与所述终端蓝牙设备地址进行比对,并在所述当前终端蓝牙信息与所述终端蓝牙设备地址相同时,与所述待配对终端完成蓝牙配对连接。When the bluetooth headset receives the bluetooth pairing request, it compares the current terminal bluetooth information in the bluetooth pairing request with the terminal bluetooth device address, and compares the current terminal bluetooth information with the terminal bluetooth information. When the device addresses are the same, the Bluetooth pairing connection is completed with the terminal to be paired.
本实施例中,所述待配对终端搜索预设范围内待配对的蓝牙设备,并获取所述待配对的蓝牙设备的蓝牙设备信息集。然后待配对终端将所述耳机蓝牙设备地址与所述蓝牙设备信息集进行比对、匹配,判断所述蓝牙设备信息集中是否存在所述耳机蓝牙设备地址。即在所述蓝牙设备信息集中存在所述耳机蓝牙设备地址时,即搜索到的多个蓝牙设备中确定待配对的耳机蓝牙设备地址。具体实施例中,还可以将所述蓝牙耳机的耳机蓝牙设备地址,即蓝 牙名称以及蓝牙地址,通过NFC连接发送至待配对终端后,控制待配对终端根据所述蓝牙耳机的蓝牙名称以及蓝牙地址进行搜索,确定待连接的耳机蓝牙设备地址。同步或者异步地,待配对终端通过NFC连接向蓝牙耳机盒反馈接收完成耳机蓝牙设备地址的指令,即同步控制蓝牙耳机(或者是蓝牙耳机盒)或者异步控制蓝牙耳机广播耳机蓝牙设备地址,即蓝牙名称以及蓝牙地址。由此触发设备之间的蓝牙配对指令,以便待配对终端可基于蓝牙耳机广播的耳机蓝牙设备地址确定搜索的耳机蓝牙设备地址是否为待配对的蓝牙耳机信息。具体实施例中,在用户需要将蓝牙耳机设备与待配对终端进行蓝牙配对连接时,可将蓝牙耳机放入待配对终端对应的配对位置。通过红外传感器检测待配对终端与蓝牙耳机之间的位置距离,确认为接触状态后。为了便于用户连接当前的有线连接状态,在检测到待配对终端与蓝牙耳机的接触状态不正常时,通过与待配对终端或蓝牙耳机连接的指示灯闪烁红灯,以提示用户。在检测到待配对终端与蓝牙耳机的接触状态正常时,则亮绿灯。然后控制待配对终端通过NFC连接的方式向蓝牙耳机发送连接状态检查数据包,检测NFC数据线的连接状态。若待配对终端收到蓝牙耳机的响相应反馈指令,则确认待配对终端与蓝牙耳机的NFC连接正常,并通过长亮绿灯提醒用户连接正常,否则长亮红灯提醒用户连接异常。并在连接正常时,向待配对终端发送蓝牙耳机的蓝牙地址及设备名称。并在检测到待配对终端接收到蓝牙耳机回复指令,基于蓝牙耳机的蓝牙设备信息控制待配对终端进行蓝牙设备信息的搜索,并控制蓝牙耳机开始广播自身的耳机蓝牙设备地址。控制待配对终端根据搜索到的目标蓝牙设备信息,生产蓝牙设备列表(蓝牙设备列表中可以包括一个或者多个蓝牙设备信息)。将蓝牙设备列表与蓝牙耳机发送的蓝牙地址以及蓝牙名称进行匹配。当蓝牙设备列表中存在一蓝牙设备信息与所述耳机蓝牙设备地址相同时,即判定匹配一致时实现待配对终端与蓝牙耳机的自动蓝牙配对,并显示长亮绿灯提醒用户配对成功。当匹配失败时,显示长亮红灯提醒用户蓝牙配对失败。可根据预设时间间隔,控制待配对终端重新搜索蓝牙设备信息,重新进行蓝牙自动配对操作,直至完成蓝牙配对操作。In this embodiment, the to-be-paired terminal searches for a Bluetooth device to be paired within a preset range, and acquires a Bluetooth device information set of the to-be-paired Bluetooth device. Then, the terminal to be paired compares and matches the headset Bluetooth device address with the Bluetooth device information set, and determines whether the headset Bluetooth device address exists in the Bluetooth device information set. That is, when the Bluetooth device address of the headset exists in the Bluetooth device information set, the Bluetooth device address of the headset to be paired is determined from among the plurality of Bluetooth devices searched. In a specific embodiment, the Bluetooth device address of the Bluetooth headset, that is, the Bluetooth name and the Bluetooth address, can also be sent to the terminal to be paired through the NFC connection, and the terminal to be paired can be controlled according to the Bluetooth name and Bluetooth address of the Bluetooth headset. Search to determine the Bluetooth device address of the headset to be connected. Synchronously or asynchronously, the terminal to be paired feeds back the instruction to complete the Bluetooth device address of the headset to the Bluetooth headset box through the NFC connection, that is, synchronously control the Bluetooth headset (or the Bluetooth headset box) or asynchronously control the Bluetooth headset to broadcast the headset Bluetooth device address, that is, Bluetooth name and Bluetooth address. Thereby, a Bluetooth pairing instruction between devices is triggered, so that the terminal to be paired can determine whether the searched Bluetooth device address of the headset is the information of the Bluetooth headset to be paired based on the Bluetooth device address of the headset broadcast by the Bluetooth headset. In a specific embodiment, when the user needs to perform Bluetooth pairing and connection between the Bluetooth headset device and the terminal to be paired, the Bluetooth headset can be placed in the pairing position corresponding to the terminal to be paired. The position distance between the terminal to be paired and the Bluetooth headset is detected by the infrared sensor, and the contact state is confirmed. In order to facilitate the user to connect to the current wired connection state, when it is detected that the contact state between the terminal to be paired and the Bluetooth headset is abnormal, the indicator light connected to the terminal to be paired or the Bluetooth headset flashes red to remind the user. When it is detected that the contact state between the terminal to be paired and the Bluetooth headset is normal, the green light will be on. Then, the terminal to be paired is controlled to send a connection status check data packet to the Bluetooth headset by means of NFC connection to detect the connection status of the NFC data line. If the terminal to be paired receives a corresponding feedback command from the Bluetooth headset, it confirms that the NFC connection between the terminal to be paired and the Bluetooth headset is normal, and the long green light reminds the user that the connection is normal, otherwise the long red light reminds the user that the connection is abnormal. And when the connection is normal, the Bluetooth address and device name of the Bluetooth headset are sent to the terminal to be paired. And when it is detected that the terminal to be paired receives a bluetooth headset reply command, based on the bluetooth device information of the bluetooth headset, the terminal to be paired is controlled to search for bluetooth device information, and the bluetooth headset is controlled to start broadcasting its own headset bluetooth device address. The terminal to be paired is controlled to produce a Bluetooth device list according to the searched target Bluetooth device information (the Bluetooth device list may include one or more Bluetooth device information). Match the list of bluetooth devices with the bluetooth address and bluetooth name sent by the bluetooth headset. When there is a bluetooth device in the bluetooth device list that has the same address as the bluetooth device of the headset, that is, when it is determined that the matching is consistent, automatic bluetooth pairing between the terminal to be paired and the bluetooth headset is realized, and a long green light is displayed to remind the user that the pairing is successful. When the pairing fails, a long red light is displayed to remind the user that the Bluetooth pairing fails. According to the preset time interval, the terminal to be paired can be controlled to search for Bluetooth device information again, and the Bluetooth automatic pairing operation can be performed again until the Bluetooth pairing operation is completed.
本实施例提供一种蓝牙设备的配对方法,所述蓝牙设备的配对方法应用 于蓝牙设备的配对装置,所述配对装置包括蓝牙耳机、蓝牙耳机盒以及待配对终端,通过在检测到近距离无线通讯NFC连接指令时,所述蓝牙耳机盒通过与所述待配对终端之间的NFC连接,获取所述待配对终端的终端蓝牙设备地址,并将所述终端蓝牙设备地址发送至所述蓝牙耳机;所述待配对终端通过所述NFC连接,获取所述蓝牙耳机盒中预存的耳机蓝牙设备地址;根据所述终端蓝牙设备地址以及耳机蓝牙设备地址,所述蓝牙耳机与所述待配对终端完成蓝牙配对连接。通过上述方式,本申请通过蓝牙耳机盒与待配对终端进行NFC连接,实现快速握手,互换蓝牙设备地址数据,无需用户手动进行蓝牙搜索,实现蓝牙耳机和待配对终端之间的快速蓝牙配对,简化了蓝牙配对操作,提高了蓝牙配对效率,解决了现有蓝牙设备的蓝牙配对方法配对效率低下以及蓝牙配对操作繁琐度较高的技术问题。This embodiment provides a method for pairing a Bluetooth device. The method for pairing a Bluetooth device is applied to a pairing device for a Bluetooth device. The pairing device includes a Bluetooth headset, a Bluetooth headset box, and a terminal to be paired. When communicating the NFC connection command, the Bluetooth headset box obtains the terminal Bluetooth device address of the terminal to be paired through the NFC connection with the terminal to be paired, and sends the terminal Bluetooth device address to the Bluetooth headset The terminal to be paired is connected through the NFC to obtain the Bluetooth device address of the headset pre-stored in the Bluetooth headset box; according to the Bluetooth device address of the terminal and the Bluetooth device address of the headset, the Bluetooth headset and the terminal to be paired are completed Bluetooth pairing connection. In the above-mentioned manner, the present application performs NFC connection with the terminal to be paired through the Bluetooth headset box, realizes a quick handshake, exchanges the address data of the Bluetooth device, and does not require the user to manually perform a Bluetooth search, and realizes fast Bluetooth pairing between the Bluetooth headset and the terminal to be paired, The bluetooth pairing operation is simplified, the bluetooth pairing efficiency is improved, and the technical problems of low pairing efficiency of the bluetooth pairing method of the existing bluetooth device and high complexity of the bluetooth pairing operation are solved.
参照图3,图3为本申请蓝牙设备的配对方法第二实施例的流程示意图。Referring to FIG. 3 , FIG. 3 is a schematic flowchart of a second embodiment of a method for pairing a Bluetooth device according to the present application.
基于上述图2所示实施例,本实施例中,所述步骤S10之前,还包括:Based on the above-mentioned embodiment shown in FIG. 2 , in this embodiment, before step S10, the method further includes:
步骤S40,所述蓝牙耳机盒基于红外接近传感器获取距离所述待配对终端之间的设备间距,所述蓝牙耳机盒并基于所述设备间距判断是否与所述待配对终端发生接触;Step S40, the Bluetooth headset box obtains the device distance from the terminal to be paired based on the infrared proximity sensor, and the Bluetooth headset box determines whether it is in contact with the terminal to be paired based on the device distance;
步骤S50,若所述蓝牙耳机盒判定与所述待配对终端发生接触,则基于NFC模块向所述待配对终端发送连接状态检测数据包;Step S50, if the Bluetooth headset box determines that it is in contact with the terminal to be paired, send a connection status detection data packet to the terminal to be paired based on the NFC module;
其中,所述步骤S40之后,还包括:Wherein, after the step S40, it also includes:
若所述蓝牙耳机盒判定与所述待配对终端未发生接触,则生成NFC模块接触异常的提醒消息,以便用户对所述蓝牙耳机盒以及所述待配对终端的NFC模块进行校验。If the Bluetooth earphone box determines that there is no contact with the terminal to be paired, a reminder message of abnormal contact of the NFC module is generated, so that the user can verify the NFC module of the Bluetooth earphone box and the terminal to be paired.
步骤S60,所述待配对终端在接收到所述连接状态检测数据包时,则生成对应的校验数据包,并向所述蓝牙耳机盒反馈所述校验数据包;Step S60, when the terminal to be paired receives the connection state detection data packet, generates a corresponding verification data packet, and feeds back the verification data packet to the Bluetooth headset box;
步骤S70,所述蓝牙耳机盒在接收到所述校验数据包时,则向所述待配对终端发送所述NFC连接指令。Step S70, when the Bluetooth headset box receives the verification data packet, it sends the NFC connection instruction to the terminal to be paired.
其中,所述步骤S70具体包括:Wherein, the step S70 specifically includes:
所述蓝牙耳机盒在接收到所述校验数据包时,基于所述校验数据包以及所述连接状态检测数据包,判断是否与所述待配对终端进行有效接触;When the Bluetooth headset box receives the verification data packet, based on the verification data packet and the connection state detection data packet, determine whether it is in effective contact with the terminal to be paired;
若所述蓝牙耳机盒判定与所述待配对终端进行有效接触,则向所述待配对终端发送所述NFC连接指令。If the Bluetooth earphone box determines that it is in effective contact with the terminal to be paired, the NFC connection instruction is sent to the terminal to be paired.
若所述蓝牙耳机盒判定与所述待配对终端未进行有效接触,则通过所述蓝牙耳机或与所述蓝牙耳机盒通讯连接的终端输出设备调整提醒消息,以提醒用户调整所述蓝牙耳机盒与待配对终端之间的相对位置。If the Bluetooth headset box determines that there is no effective contact with the terminal to be paired, a device adjustment reminder message is output through the Bluetooth headset or a terminal communicatively connected to the Bluetooth headset box to remind the user to adjust the Bluetooth headset box The relative position with the terminal to be paired.
为了保证NFC连接的有效连接,本实施例利用红外接近传感器判断待配对终端与蓝牙耳机是否有效接触(即待配对终端的NFC模块与蓝牙耳机的NFC模块进行正确接触),由此判断待配对终端与蓝牙耳机是否建立有效连接。具体的,通过红外接近传感器获取待配对终端与蓝牙耳机的设备距离,以根据所述设备距离判断待配对终端与蓝牙耳机是否为接触状态,即判断所述设备距离是否小于预设阈值,如设备距离等于0则判定为接触状态。在判定待配对终端与蓝牙耳机为接触状态时,控制待配对终端向蓝牙耳机发送NFC连接检测指令,如连接状态检测数据包,以判断待配对终端与蓝牙耳机是否成功建立NFC连接。即待配对终端通过NFC连接向蓝牙耳机发送连接状态检查数据包,以检测当前NFC连接的连接状态。当待配对终端收到蓝牙耳机的回复时,确认连接正常,即若蓝牙耳机接收到所述连接状态检测数据包,并基于所述连接状态检测数据包向待配对终端反馈了对应的可连接指令,如校验数据包,即表示待配对终端与蓝牙耳机成功建立了NFC连接,即待配对终端与蓝牙耳机进行了有效接触。生成NFC连接指令,以便待配对终端与蓝牙耳机基于NFC连接进行通信,由此,通过NFC连接向待配对终端发送蓝牙耳机耳机蓝牙设备地址。若所述蓝牙耳机并未基于待配对终端发送的连接状态检测数据包反馈对应的校验数据包时,或者蓝牙耳机反馈的数据包不是连接状态检测数据包对应的校验数据包时,判定待配对终端与蓝牙耳机的接触状态不是有效接触,表示待配对终端与蓝牙耳机当前的接触状态不是正确接触位置,生成并显示设备调整提醒消息,以提醒用户调整待配对的蓝牙设备的相对位置,以使待配对终端的NFC模块与蓝牙耳机的NFC模块进行接触。In order to ensure the effective connection of the NFC connection, this embodiment uses an infrared proximity sensor to determine whether the terminal to be paired is in effective contact with the Bluetooth headset (that is, the NFC module of the terminal to be paired is in correct contact with the NFC module of the Bluetooth headset), thereby judging whether the terminal to be paired is in correct contact with the NFC module of the Bluetooth headset Whether a valid connection is established with the Bluetooth headset. Specifically, the device distance between the terminal to be paired and the Bluetooth headset is obtained through an infrared proximity sensor, so as to determine whether the terminal to be paired and the Bluetooth headset are in a contact state according to the device distance, that is, to determine whether the device distance is less than a preset threshold, such as a device If the distance is equal to 0, it is judged as a contact state. When it is determined that the terminal to be paired and the Bluetooth headset are in a contact state, the terminal to be paired is controlled to send an NFC connection detection instruction, such as a connection status detection data packet, to the Bluetooth headset to determine whether the terminal to be paired and the Bluetooth headset successfully establish an NFC connection. That is, the terminal to be paired sends a connection status check data packet to the Bluetooth headset through the NFC connection, so as to detect the connection status of the current NFC connection. When the terminal to be paired receives a reply from the Bluetooth headset, it confirms that the connection is normal, that is, if the Bluetooth headset receives the connection status detection data packet, and based on the connection status detection packet, it feeds back the corresponding connectable instruction to the terminal to be paired , if the data packet is verified, it means that the terminal to be paired and the Bluetooth headset have successfully established an NFC connection, that is, the terminal to be paired and the Bluetooth headset are in effective contact. An NFC connection instruction is generated so that the terminal to be paired communicates with the Bluetooth headset based on the NFC connection, thereby sending the Bluetooth device address of the Bluetooth headset to the terminal to be paired through the NFC connection. If the Bluetooth headset does not feed back the corresponding verification data packet based on the connection status detection data packet sent by the terminal to be paired, or if the data packet fed back by the Bluetooth headset is not the verification data packet corresponding to the connection status detection data packet, it is determined to be pending. If the contact state between the paired terminal and the Bluetooth headset is not in valid contact, it means that the current contact state between the terminal to be paired and the Bluetooth headset is not the correct contact position, and a device adjustment reminder message is generated and displayed to remind the user to adjust the relative position of the Bluetooth device to be paired, so that the Contact the NFC module of the terminal to be paired with the NFC module of the Bluetooth headset.
本实施例中,通过红外接近传感器检测待配对终端与蓝牙耳机是否为接触状态,当确认为接触状态后,待配对终端通过NFC连接的方式向蓝牙耳机询问与蓝牙耳机的连接状态。并在接收到蓝牙耳机的确认回复消息后,确定 NFC线连接正常,即待配对终端与蓝牙耳机成功建立了NFC连接,进而基于NFC连接传输蓝牙耳机的蓝牙名称与蓝牙地址,并由此实现精准快速的蓝牙配对。In this embodiment, an infrared proximity sensor is used to detect whether the terminal to be paired and the Bluetooth headset are in contact state, and when the contact state is confirmed, the terminal to be paired asks the Bluetooth headset for the connection status with the Bluetooth headset through NFC connection. And after receiving the confirmation reply message from the Bluetooth headset, it is determined that the NFC line is connected normally, that is, the terminal to be paired successfully establishes an NFC connection with the Bluetooth headset, and then transmits the Bluetooth name and Bluetooth address of the Bluetooth headset based on the NFC connection, thereby achieving accurate Fast Bluetooth pairing.
进一步地,所述步骤S10具体包括:Further, the step S10 specifically includes:
在检测所述近距离无线通讯NFC连接指令时,所述第二NFC模块通过与所述第一NFC模块的NFC连接,接收所述第一NFC模块发送的终端OOB数据,其中,所述近距离无线通讯NFC连接指令为所述第一NFC模块与所述第二NFC模块的触碰操作触发;When detecting the short-range wireless communication NFC connection instruction, the second NFC module receives the terminal OOB data sent by the first NFC module through the NFC connection with the first NFC module, wherein the short-range wireless communication The wireless communication NFC connection instruction is triggered by a touch operation between the first NFC module and the second NFC module;
所述第二NFC模块获取所述终端OOB数据中的终端蓝牙设备地址,并将所述终端蓝牙设备地址发送至所述MCU模块;The second NFC module acquires the terminal Bluetooth device address in the terminal OOB data, and sends the terminal Bluetooth device address to the MCU module;
所述MCU模块将所述终端蓝牙设备地址发送至所述蓝牙耳机,并将包含所述耳机蓝牙设备地址的耳机OOB数据发送至所述第一NFC模块。The MCU module sends the Bluetooth device address of the terminal to the Bluetooth headset, and sends the headset OOB data including the Bluetooth device address of the headset to the first NFC module.
具体地,本方案是基于目前带有NFC功能的TWS蓝牙耳机充电盒的设计,在不影响其性能的前提下,在蓝牙耳机盒的MCU内部,实现一种快速进行数据交互握手的方法。其中,如图4所示,待配对终端(即手机终端)包括NFC模块、蓝牙模块、蓝牙天线和NFC天线;其中,所述蓝牙耳机盒(即充电盒)包括微处理单元、数据交换处理单元、NFC模块、NFC天线以及存储单元,存储单元包括两个地址模块,分别命名为Data-L和Data-R。两只TWS蓝牙耳机,分别命名为TWS(L)和TWS(R)。其中,两个蓝牙设备的配对过程为:Specifically, this solution is based on the current design of the TWS Bluetooth headset charging box with NFC function. On the premise of not affecting its performance, a fast data interaction handshake method is implemented inside the MCU of the Bluetooth headset box. Wherein, as shown in FIG. 4 , the terminal to be paired (ie the mobile phone terminal) includes an NFC module, a Bluetooth module, a Bluetooth antenna and an NFC antenna; wherein, the Bluetooth headset box (ie the charging box) includes a micro-processing unit, a data exchange processing unit , NFC module, NFC antenna and storage unit, the storage unit includes two address modules named Data-L and Data-R respectively. Two TWS Bluetooth headsets, named TWS(L) and TWS(R). Among them, the pairing process of two Bluetooth devices is as follows:
(1)蓝牙耳机盒在出厂前,或TWS蓝牙耳机放入蓝牙耳机盒后,蓝牙耳机盒的MCU模块分别读取两只TWS蓝牙耳机的Link key和MAC地址,并分别写入对应的存储单元Data-L和Data-R;(1) Before the Bluetooth headset box leaves the factory, or after the TWS Bluetooth headset is put into the Bluetooth headset box, the MCU module of the Bluetooth headset box reads the Link key and MAC address of the two TWS Bluetooth headsets and writes them into the corresponding storage units respectively. Data-L and Data-R;
(2)在手机终端上打开NFC功能后,且蓝牙耳机盒的NFC功能默认为触发打开,然后用手机终端的NFC天线位置去接近触碰蓝牙耳机盒NFC天线位置;(2) After the NFC function is turned on on the mobile phone terminal, and the NFC function of the Bluetooth headset box is activated by default, then use the NFC antenna position of the mobile phone terminal to approach the position of the NFC antenna of the Bluetooth headset box;
(3)蓝牙耳机盒和手机终端通过NFC耦合连接进行数据交互,蓝牙耳机盒的NFC模块获取到手机终端以OOB数据的方式传输的蓝牙设备地址数据后,将所述蓝牙设备地址发送给MCU的数据处理单元模块;(3) The Bluetooth headset box and the mobile phone terminal perform data interaction through the NFC coupling connection. After the NFC module of the Bluetooth headset box obtains the Bluetooth device address data transmitted by the mobile phone terminal in the form of OOB data, it sends the Bluetooth device address to the MCU. Data processing unit module;
(4)MCU的数据交换处理单元在接收到该OOB数据后,从存储单元中读取蓝牙耳机的Data-L和Data-R(对应TWS耳机的Link key和MAC地址)数据,解析后,实现快速握手,将该TWS耳机的Link key和MAC地址数据反馈至手机终端;(4) After receiving the OOB data, the data exchange processing unit of the MCU reads the Data-L and Data-R (corresponding to the Link key and MAC address of the TWS headset) data of the Bluetooth headset from the storage unit, and after parsing, realizes Quick handshake, feedback the Link key and MAC address data of the TWS headset to the mobile terminal;
(5)将TWS耳机从蓝牙耳机盒内取出后,在手机终端的蓝牙功能打开时,手机终端和蓝牙耳机会基于终端蓝牙设备地址和耳机蓝牙设备地址自动实现蓝牙配对连接。(5) After the TWS headset is taken out of the Bluetooth headset box, when the Bluetooth function of the mobile phone terminal is turned on, the mobile phone terminal and the Bluetooth headset will automatically realize the Bluetooth pairing connection based on the terminal Bluetooth device address and the headset Bluetooth device address.
此外,本申请实施例还提供一种蓝牙设备的配对装置。In addition, an embodiment of the present application also provides a pairing device for a Bluetooth device.
参照图5,图5为本申请蓝牙设备的配对装置第一实施例的功能模块示意图。Referring to FIG. 5 , FIG. 5 is a schematic diagram of functional modules of a first embodiment of a pairing device for a Bluetooth device of the present application.
本实施例中,所述蓝牙设备的配对装置包括:In this embodiment, the pairing device of the Bluetooth device includes:
终端信息获取模块10,用于在检测到近距离无线通讯NFC连接指令时,所述蓝牙耳机盒通过与所述待配对终端之间的NFC连接,获取所述待配对终端的终端蓝牙设备地址,并将所述终端蓝牙设备地址发送至所述蓝牙耳机;The terminal information acquisition module 10 is configured to acquire the terminal Bluetooth device address of the terminal to be paired through the NFC connection between the Bluetooth earphone box and the terminal to be paired when a short-range wireless communication NFC connection instruction is detected, and sending the terminal Bluetooth device address to the Bluetooth headset;
耳机信息获取模块20,用于所述待配对终端通过所述NFC连接,获取所述蓝牙耳机盒中预存的耳机蓝牙设备地址;The headset information acquisition module 20 is used for the terminal to be paired to connect through the NFC to acquire the Bluetooth device address of the headset pre-stored in the Bluetooth headset box;
蓝牙配对连接模块30,用于将所述耳机蓝牙设备地址与所述蓝牙设备信息集进行匹配,并判断所述蓝牙设备信息集中是否存在所述耳机蓝牙设备地址。The Bluetooth pairing connection module 30 is configured to match the Bluetooth device address of the headset with the Bluetooth device information set, and determine whether the headset Bluetooth device address exists in the Bluetooth device information set.
进一步地,所述蓝牙配对连接模块30具体包括:Further, the Bluetooth pairing connection module 30 specifically includes:
蓝牙设备搜索单元,用于所述待配对终端搜索预设范围内待配对的蓝牙设备,并获取所述待配对的蓝牙设备的蓝牙设备信息集;a Bluetooth device search unit, used for the to-be-paired terminal to search for a to-be-paired Bluetooth device within a preset range, and to acquire a Bluetooth device information set of the to-be-paired Bluetooth device;
蓝牙配对请求单元,用于所述待配对终端将所述耳机蓝牙设备地址与所述蓝牙设备信息集进行匹配,以在所述蓝牙设备信息集中确定所述耳机蓝牙设备地址,并基于所述耳机蓝牙设备地址,向所述蓝牙耳机发送蓝牙配对请求;A Bluetooth pairing request unit, used by the terminal to be paired to match the Bluetooth device address of the headset with the Bluetooth device information set, so as to determine the Bluetooth device address of the headset in the Bluetooth device information set, and based on the headset Bluetooth device address, sending a Bluetooth pairing request to the Bluetooth headset;
蓝牙配对连接单元,用于所述蓝牙耳机在接收到所述蓝牙配对请求时,将所述蓝牙配对请求中的当前终端蓝牙信息与所述终端蓝牙设备地址进行比对,并在所述当前终端蓝牙信息与所述终端蓝牙设备地址相同时,与所述待 配对终端完成蓝牙配对连接。The Bluetooth pairing connection unit is used for the Bluetooth headset to compare the current terminal Bluetooth information in the Bluetooth pairing request with the Bluetooth device address of the terminal when receiving the Bluetooth pairing request, and send the Bluetooth pairing request to the current terminal. When the Bluetooth information is the same as the Bluetooth device address of the terminal, the Bluetooth pairing connection is completed with the terminal to be paired.
进一步地,所述蓝牙设备的配对装置还包括连接指令生成模块,所述连接指令生成模块具体包括:Further, the pairing device of the Bluetooth device further includes a connection instruction generation module, and the connection instruction generation module specifically includes:
接触判断单元,用于所述蓝牙耳机盒基于红外接近传感器获取距离所述待配对终端之间的设备间距,所述蓝牙耳机盒并基于所述设备间距判断是否与所述待配对终端发生接触;a contact determination unit, used for the Bluetooth headset box to obtain the device distance between the terminal to be paired based on an infrared proximity sensor, and the Bluetooth headset box to determine whether it is in contact with the terminal to be paired based on the device distance;
连接检测单元,用于若所述蓝牙耳机盒判定与所述待配对终端发生接触,则基于NFC模块向所述待配对终端发送连接状态检测数据包;a connection detection unit, configured to send a connection status detection data packet to the terminal to be paired based on the NFC module if the Bluetooth headset box determines that it is in contact with the terminal to be paired;
连接反馈单元,用于所述待配对终端在接收到所述连接状态检测数据包时,则生成对应的校验数据包,并向所述蓝牙耳机盒反馈所述校验数据包;a connection feedback unit, configured to generate a corresponding verification data packet when the terminal to be paired receives the connection state detection data packet, and feed back the verification data packet to the Bluetooth headset box;
连接确定单元,用于所述蓝牙耳机盒在接收到所述校验数据包时,则向所述待配对终端发送所述NFC连接指令。The connection determination unit is used for the Bluetooth earphone box to send the NFC connection instruction to the terminal to be paired when receiving the verification data packet.
进一步地,所述接触判断单元还用于:Further, the contact judgment unit is also used for:
所述蓝牙耳机盒在接收到所述校验数据包时,基于所述校验数据包以及所述连接状态检测数据包,判断是否与所述待配对终端进行有效接触;When the Bluetooth headset box receives the verification data packet, based on the verification data packet and the connection state detection data packet, determine whether it is in effective contact with the terminal to be paired;
若所述蓝牙耳机盒判定与所述待配对终端进行有效接触,则向所述待配对终端发送所述NFC连接指令。If the Bluetooth earphone box determines that it is in effective contact with the terminal to be paired, the NFC connection instruction is sent to the terminal to be paired.
进一步地,所述连接确定单元还用于:Further, the connection determination unit is also used for:
若所述蓝牙耳机盒判定与所述待配对终端未发生接触,则生成NFC模块接触异常的提醒消息,以便用户对所述蓝牙耳机盒以及所述待配对终端的NFC模块进行校验。If the Bluetooth earphone box determines that there is no contact with the terminal to be paired, a reminder message of abnormal contact of the NFC module is generated, so that the user can verify the NFC module of the Bluetooth earphone box and the terminal to be paired.
进一步地,所述连接确定单元还用于:Further, the connection determination unit is also used for:
若所述蓝牙耳机盒判定与所述待配对终端未进行有效接触,则通过所述蓝牙耳机或与所述蓝牙耳机盒通讯连接的终端输出设备调整提醒消息,以提醒用户调整所述蓝牙耳机盒与待配对终端之间的相对位置。If the Bluetooth headset box determines that there is no effective contact with the terminal to be paired, a device adjustment reminder message is output through the Bluetooth headset or a terminal communicatively connected to the Bluetooth headset box to remind the user to adjust the Bluetooth headset box The relative position with the terminal to be paired.
进一步地,所述终端信息获取模块10还用于:Further, the terminal information acquisition module 10 is also used for:
在检测所述近距离无线通讯NFC连接指令时,所述第二NFC模块通过与所述第一NFC模块的NFC连接,接收所述第一NFC模块发送的终端OOB数据,其中,所述近距离无线通讯NFC连接指令为所述第一NFC模块与所述第二NFC模块的触碰操作触发;When detecting the short-range wireless communication NFC connection instruction, the second NFC module receives the terminal OOB data sent by the first NFC module through the NFC connection with the first NFC module, wherein the short-range wireless communication The wireless communication NFC connection instruction is triggered by a touch operation between the first NFC module and the second NFC module;
所述第二NFC模块获取所述终端OOB数据中的终端蓝牙设备地址,并将所述终端蓝牙设备地址发送至所述MCU模块;The second NFC module acquires the terminal Bluetooth device address in the terminal OOB data, and sends the terminal Bluetooth device address to the MCU module;
所述MCU模块将所述终端蓝牙设备地址发送至所述蓝牙耳机,并将包含所述耳机蓝牙设备地址的耳机OOB数据发送至所述第一NFC模块。The MCU module sends the Bluetooth device address of the terminal to the Bluetooth headset, and sends the headset OOB data including the Bluetooth device address of the headset to the first NFC module.
其中,上述蓝牙设备的配对装置中各个模块与上述蓝牙设备的配对方法实施例中各步骤相对应,其功能和实现过程在此处不再一一赘述。The modules in the pairing device for Bluetooth devices correspond to the steps in the embodiments of the pairing method for Bluetooth devices, and their functions and implementation processes are not repeated here.
此外,本申请实施例还提供一种蓝牙设备。In addition, an embodiment of the present application further provides a Bluetooth device.
本申请蓝牙设备上存储有蓝牙设备的配对程序,其中所述蓝牙设备的配对程序被处理器执行时,实现如上述的蓝牙设备的配对方法的步骤。The Bluetooth device of the present application stores a Bluetooth device pairing program, wherein when the Bluetooth device pairing program is executed by the processor, the steps of the above-mentioned Bluetooth device pairing method are implemented.
其中,蓝牙设备的配对程序被执行时所实现的方法可参照本申请蓝牙设备的配对方法的各个实施例,此处不再赘述。For the method implemented when the pairing program of the Bluetooth device is executed, reference may be made to the various embodiments of the pairing method of the Bluetooth device of the present application, which will not be repeated here.
此外,本申请实施例还提供一种计算机可读存储介质。In addition, the embodiments of the present application further provide a computer-readable storage medium.
本申请计算机可读存储介质上存储有蓝牙设备的配对程序,其中所述蓝牙设备的配对程序被处理器执行时,实现如上述的蓝牙设备的配对方法的步骤。The computer-readable storage medium of the present application stores a pairing program of a Bluetooth device, wherein when the pairing program of the Bluetooth device is executed by the processor, the steps of the above-mentioned pairing method for a Bluetooth device are implemented.
其中,蓝牙设备的配对程序被执行时所实现的方法可参照本申请蓝牙设备的配对方法的各个实施例,此处不再赘述。For the method implemented when the pairing program of the Bluetooth device is executed, reference may be made to the various embodiments of the pairing method of the Bluetooth device of the present application, which will not be repeated here.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者系统不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者系统所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者系统中还存在另外的相同要素。It should be noted that, herein, the terms "comprising", "comprising" or any other variation thereof are intended to encompass non-exclusive inclusion, such that a process, method, article or system comprising a series of elements includes not only those elements, It also includes other elements not expressly listed or inherent to such a process, method, article or system. Without further limitation, an element qualified by the phrase "comprising a..." does not preclude the presence of additional identical elements in the process, method, article or system that includes the element.
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。The above-mentioned serial numbers of the embodiments of the present application are only for description, and do not represent the advantages or disadvantages of the embodiments.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通 过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在如上所述的一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本申请各个实施例所述的方法。From the description of the above embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus a necessary general hardware platform, and of course hardware can also be used, but in many cases the former is better implementation. Based on this understanding, the technical solutions of the present application can be embodied in the form of software products in essence or the parts that make contributions to the prior art, and the computer software products are stored in a storage medium (such as ROM/RAM) as described above. , magnetic disk, optical disc), including several instructions to make a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in the various embodiments of the present application.
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。The above are only the preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made by using the contents of the description and drawings of the present application, or directly or indirectly applied in other related technical fields , are similarly included within the scope of patent protection of this application.
Claims (10)
- 一种蓝牙设备的配对方法,其特征在于,所述蓝牙设备的配对方法应用于蓝牙设备的配对装置,所述配对装置包括蓝牙耳机、蓝牙耳机盒以及待配对终端,所述蓝牙设备的配对方法包括以下步骤:A Bluetooth device pairing method, characterized in that the Bluetooth device pairing method is applied to a Bluetooth device pairing device, the pairing device comprising a Bluetooth headset, a Bluetooth headset box and a terminal to be paired, and the Bluetooth device pairing method Include the following steps:在检测到近距离无线通讯NFC连接指令时,所述蓝牙耳机盒通过与所述待配对终端之间的NFC连接,获取所述待配对终端的终端蓝牙设备地址,并将所述终端蓝牙设备地址发送至所述蓝牙耳机;When the short-range wireless communication NFC connection instruction is detected, the Bluetooth headset box obtains the terminal Bluetooth device address of the terminal to be paired through the NFC connection with the terminal to be paired, and sends the Bluetooth device address of the terminal to the terminal. sent to the bluetooth headset;所述待配对终端通过所述NFC连接,获取所述蓝牙耳机盒中预存的耳机蓝牙设备地址;The terminal to be paired is connected through the NFC to obtain the Bluetooth device address of the headset pre-stored in the Bluetooth headset box;根据所述终端蓝牙设备地址以及耳机蓝牙设备地址,所述蓝牙耳机与所述待配对终端完成蓝牙配对连接。According to the bluetooth device address of the terminal and the bluetooth device address of the earphone, the bluetooth earphone and the terminal to be paired complete the bluetooth pairing connection.
- 如权利要求1所述的蓝牙设备的配对方法,其特征在于,所述根据所述终端蓝牙设备地址以及耳机蓝牙设备地址,所述蓝牙耳机与所述待配对终端完成蓝牙配对连接的步骤具体包括:The method for pairing a Bluetooth device according to claim 1, wherein the step of completing the Bluetooth pairing connection between the Bluetooth headset and the terminal to be paired according to the terminal Bluetooth device address and the headset Bluetooth device address specifically includes the following steps: :所述待配对终端搜索预设范围内待配对的蓝牙设备,并获取所述待配对的蓝牙设备的蓝牙设备信息集;The to-be-paired terminal searches for a Bluetooth device to be paired within a preset range, and acquires a Bluetooth device information set of the to-be-paired Bluetooth device;所述待配对终端将所述耳机蓝牙设备地址与所述蓝牙设备信息集进行匹配,以在所述蓝牙设备信息集中确定所述耳机蓝牙设备地址,并基于所述耳机蓝牙设备地址,向所述蓝牙耳机发送蓝牙配对请求;The terminal to be paired matches the headset Bluetooth device address with the Bluetooth device information set to determine the headset Bluetooth device address in the Bluetooth device information set, and based on the headset Bluetooth device address, sends a message to the headset. The Bluetooth headset sends a Bluetooth pairing request;所述蓝牙耳机在接收到所述蓝牙配对请求时,将所述蓝牙配对请求中的当前终端蓝牙信息与所述终端蓝牙设备地址进行比对,并在所述当前终端蓝牙信息与所述终端蓝牙设备地址相同时,与所述待配对终端完成蓝牙配对连接。When the bluetooth headset receives the bluetooth pairing request, it compares the current terminal bluetooth information in the bluetooth pairing request with the terminal bluetooth device address, and compares the current terminal bluetooth information with the terminal bluetooth information. When the device addresses are the same, the Bluetooth pairing connection is completed with the terminal to be paired.
- 如权利要求1所述的蓝牙设备的配对方法,其特征在于,所述在检测到近距离无线通讯NFC连接指令时的步骤之前,还包括:The method for pairing a Bluetooth device according to claim 1, wherein before the step of detecting the short-range wireless communication NFC connection instruction, the method further comprises:所述蓝牙耳机盒基于红外接近传感器获取距离所述待配对终端之间的设备间距,所述蓝牙耳机盒并基于所述设备间距判断是否与所述待配对终端发生接触;The Bluetooth headset box obtains the device distance from the terminal to be paired based on the infrared proximity sensor, and the Bluetooth headset box determines whether it is in contact with the terminal to be paired based on the device distance;若所述蓝牙耳机盒判定与所述待配对终端发生接触,则基于NFC模块向所述待配对终端发送连接状态检测数据包;If the Bluetooth headset box determines that it is in contact with the terminal to be paired, send a connection status detection data packet to the terminal to be paired based on the NFC module;所述待配对终端在接收到所述连接状态检测数据包时,则生成对应的校验数据包,并向所述蓝牙耳机盒反馈所述校验数据包;When the terminal to be paired receives the connection state detection data packet, it generates a corresponding verification data packet, and feeds back the verification data packet to the Bluetooth headset box;所述蓝牙耳机盒在接收到所述校验数据包时,则向所述待配对终端发送所述NFC连接指令。When the Bluetooth headset box receives the verification data packet, it sends the NFC connection instruction to the terminal to be paired.
- 如权利要求3所述的蓝牙设备的配对方法,其特征在于,所述蓝牙耳机盒基于红外接近传感器获取距离所述待配对终端之间的设备间距,所述蓝牙耳机盒并基于所述设备间距判断是否与所述待配对终端发生接触的步骤之后,还包括:The method for pairing a Bluetooth device according to claim 3, wherein the Bluetooth headset box obtains a device distance between the terminals to be paired based on an infrared proximity sensor, and the Bluetooth headset box is based on the device distance After the step of judging whether there is contact with the terminal to be paired, the method further includes:若所述蓝牙耳机盒判定与所述待配对终端未发生接触,则生成NFC模块接触异常的提醒消息,以便用户对所述蓝牙耳机盒以及所述待配对终端的NFC模块进行校验。If the Bluetooth earphone box determines that there is no contact with the terminal to be paired, a reminder message of abnormal contact of the NFC module is generated, so that the user can verify the NFC module of the Bluetooth earphone box and the terminal to be paired.
- 如权利要求3所述的蓝牙设备的配对方法,其特征在于,所述蓝牙耳机盒在接收到所述校验数据包时,则向所述待配对终端发送所述NFC连接指令的步骤具体包括:The method for pairing a Bluetooth device according to claim 3, wherein when the Bluetooth headset box receives the verification data packet, the step of sending the NFC connection instruction to the terminal to be paired specifically includes the following steps: :所述蓝牙耳机盒在接收到所述校验数据包时,基于所述校验数据包以及所述连接状态检测数据包,判断是否与所述待配对终端进行有效接触;When the Bluetooth headset box receives the verification data packet, based on the verification data packet and the connection state detection data packet, determine whether it is in effective contact with the terminal to be paired;若所述蓝牙耳机盒判定与所述待配对终端进行有效接触,则向所述待配对终端发送所述NFC连接指令。If the Bluetooth earphone box determines that it is in effective contact with the terminal to be paired, the NFC connection instruction is sent to the terminal to be paired.
- 如权利要求5所述的蓝牙设备的配对方法,其特征在于,所述蓝牙耳机盒在接收到所述校验数据包时,基于所述校验数据包以及所述连接状态检测数据包,判断是否与所述待配对终端进行有效接触的步骤之后,还包括:The method for pairing a Bluetooth device according to claim 5, wherein when the Bluetooth earphone box receives the verification data packet, it judges the data packet based on the verification data packet and the connection state detection data packet. After the step of whether to make effective contact with the terminal to be paired, it also includes:若所述蓝牙耳机盒判定与所述待配对终端未进行有效接触,则通过所述蓝牙耳机或与所述蓝牙耳机盒通讯连接的终端输出设备调整提醒消息,以提醒用户调整所述蓝牙耳机盒与待配对终端之间的相对位置。If the Bluetooth headset box determines that there is no effective contact with the terminal to be paired, a device adjustment reminder message is output through the Bluetooth headset or a terminal communicatively connected to the Bluetooth headset box to remind the user to adjust the Bluetooth headset box The relative position with the terminal to be paired.
- 如权利要求1至6任意一项所述的蓝牙设备的配对方法,其特征在于,所述待配对终端包括第一NFC模块,所述蓝牙耳机盒包括第二NFC模块以及MCU模块,所述在检测到近距离无线通讯NFC连接指令时,所述蓝牙耳机盒通过与所述待配对终端之间的NFC连接,获取所述待配对终端的终端蓝牙设备地址,并将所述终端蓝牙设备地址发送至所述蓝牙耳机的步骤具体包括:The method for pairing a Bluetooth device according to any one of claims 1 to 6, wherein the terminal to be paired includes a first NFC module, the Bluetooth headset box includes a second NFC module and an MCU module, and the When a short-range wireless communication NFC connection instruction is detected, the Bluetooth headset box obtains the terminal Bluetooth device address of the terminal to be paired through the NFC connection with the terminal to be paired, and sends the terminal Bluetooth device address The steps to the Bluetooth headset specifically include:在检测所述近距离无线通讯NFC连接指令时,所述第二NFC模块通过与所述第一NFC模块的NFC连接,接收所述第一NFC模块发送的终端OOB数据,其中,所述近距离无线通讯NFC连接指令为所述第一NFC模块与所述第二NFC模块的触碰操作触发;When detecting the short-range wireless communication NFC connection instruction, the second NFC module receives the terminal OOB data sent by the first NFC module through the NFC connection with the first NFC module, wherein the short-range wireless communication The wireless communication NFC connection instruction is triggered by a touch operation between the first NFC module and the second NFC module;所述第二NFC模块获取所述终端OOB数据中的终端蓝牙设备地址,并将所述终端蓝牙设备地址发送至所述MCU模块;The second NFC module acquires the terminal Bluetooth device address in the terminal OOB data, and sends the terminal Bluetooth device address to the MCU module;所述MCU模块将所述终端蓝牙设备地址发送至所述蓝牙耳机,并将包含所述耳机蓝牙设备地址的耳机OOB数据发送至所述第一NFC模块。The MCU module sends the Bluetooth device address of the terminal to the Bluetooth headset, and sends the headset OOB data including the Bluetooth device address of the headset to the first NFC module.
- 一种蓝牙设备的配对装置,其特征在于,所述蓝牙设备的配对装置包括:A pairing device for Bluetooth devices, characterized in that the pairing device for Bluetooth devices includes:终端信息获取模块,用于在检测到近距离无线通讯NFC连接指令时,所述蓝牙耳机盒通过与所述待配对终端之间的NFC连接,获取所述待配对终端的终端蓝牙设备地址,并将所述终端蓝牙设备地址发送至所述蓝牙耳机;The terminal information acquisition module is used to acquire the terminal Bluetooth device address of the terminal to be paired through the NFC connection between the Bluetooth earphone box and the terminal to be paired when the short-range wireless communication NFC connection instruction is detected, and sending the terminal Bluetooth device address to the Bluetooth headset;耳机信息获取模块,用于所述待配对终端通过所述NFC连接,获取所述蓝牙耳机盒中预存的耳机蓝牙设备地址;a headset information acquisition module, used for the terminal to be paired to connect through the NFC to acquire the headset Bluetooth device address pre-stored in the Bluetooth headset box;蓝牙配对连接模块,用于将所述耳机蓝牙设备地址与所述蓝牙设备信息集进行匹配,并判断所述蓝牙设备信息集中是否存在所述耳机蓝牙设备地址。A Bluetooth pairing and connection module, configured to match the headset Bluetooth device address with the Bluetooth device information set, and determine whether the headset Bluetooth device address exists in the Bluetooth device information set.
- 一种蓝牙设备的配对设备,其特征在于,所述蓝牙设备包括处理器、存储器、以及存储在所述存储器上并可被所述处理器执行的蓝牙设备的配对程序,其中所述蓝牙设备的配对程序被所述处理器执行时,实现如权利要求1至7中任一项所述的蓝牙设备的配对方法的步骤。A pairing device for a Bluetooth device, characterized in that the Bluetooth device includes a processor, a memory, and a pairing program for the Bluetooth device that is stored in the memory and can be executed by the processor, wherein the Bluetooth device has a pairing program. When the pairing program is executed by the processor, the steps of the pairing method of the Bluetooth device according to any one of claims 1 to 7 are implemented.
- 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有蓝牙设备的配对程序,其中所述蓝牙设备的配对程序被处理器执行时,实现如权利要求1至7中任一项所述的蓝牙设备的配对方法的步骤。A computer-readable storage medium, characterized in that a pairing program of a Bluetooth device is stored on the computer-readable storage medium, wherein when the pairing program of the Bluetooth device is executed by a processor, the method as claimed in claims 1 to 7 is implemented. The steps of any one of the Bluetooth device pairing methods.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010928266.8A CN112020048B (en) | 2020-09-04 | 2020-09-04 | Bluetooth device pairing method, device and storage medium |
CN202010928266.8 | 2020-09-04 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2022047968A1 true WO2022047968A1 (en) | 2022-03-10 |
Family
ID=73515985
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2020/124893 WO2022047968A1 (en) | 2020-09-04 | 2020-10-29 | Bluetooth device pairing method, device, and storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN112020048B (en) |
WO (1) | WO2022047968A1 (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115243389A (en) * | 2022-07-18 | 2022-10-25 | 北京思存通信技术有限公司 | Data analysis system based on Bluetooth data transmission |
CN115278624A (en) * | 2022-07-21 | 2022-11-01 | Oppo广东移动通信有限公司 | Information updating method and device, audio sharing method and system and electronic equipment |
CN117060949A (en) * | 2022-05-07 | 2023-11-14 | Oppo广东移动通信有限公司 | Signal sending method and device, combination identification method and device and electronic equipment |
Families Citing this family (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112689224B (en) * | 2020-12-22 | 2022-11-29 | 广州番禺巨大汽车音响设备有限公司 | Control method of TWS Bluetooth sound system |
US20240114281A1 (en) * | 2021-02-03 | 2024-04-04 | Inventec Appliances (Pudong) Corporation | A method for selecting a response, an earphone base, a method of selecting a wireless earphone, a device and a medium |
CN113163383B (en) * | 2021-04-20 | 2023-01-03 | Oppo广东移动通信有限公司 | Communication connection control method, communication connection control device, computer equipment and readable storage medium |
CN113377325B (en) * | 2021-05-27 | 2024-05-28 | 深圳市亚昱科技有限公司 | Bluetooth sound box and control method thereof |
CN114466339B (en) * | 2021-06-18 | 2023-05-23 | 荣耀终端有限公司 | Bluetooth pairing method, system, storage medium and chip |
CN113490158B (en) * | 2021-07-07 | 2022-06-03 | 荣耀终端有限公司 | Bluetooth device pairing connection method, electronic device, Bluetooth device and terminal system |
CN113763682B (en) * | 2021-09-02 | 2023-06-30 | 上海瑾盛通信科技有限公司 | Security alarm method of terminal, mobile device, electronic device and storage medium |
CN115245271B (en) * | 2022-07-27 | 2024-07-02 | 珠海优特智厨科技有限公司 | Kitchen equipment and kitchen equipment pairing method |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105162497A (en) * | 2015-08-04 | 2015-12-16 | 天地融科技股份有限公司 | Data transmission method, terminal, electronic signature device and system |
CN106028264A (en) * | 2016-05-20 | 2016-10-12 | 珠海市杰理科技有限公司 | Bluetooth pairing method and system for electronic equipment |
US20190069287A1 (en) * | 2015-11-24 | 2019-02-28 | Bose Corporation | Media access control (mac) address identification |
CN109600694A (en) * | 2019-01-16 | 2019-04-09 | 歌尔科技有限公司 | A kind of matching method of wireless headset, device, terminal and charging box |
CN109743714A (en) * | 2019-01-07 | 2019-05-10 | 优奈柯恩(北京)科技有限公司 | Device pairing method and device |
CN111343622A (en) * | 2020-03-02 | 2020-06-26 | 北京服装学院 | Bluetooth sound box synchronous playing method, device and system |
Family Cites Families (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115665320B (en) * | 2014-09-02 | 2024-10-11 | 苹果公司 | Electronic device, storage medium, and method for operating electronic device |
CN108174457B (en) * | 2018-01-12 | 2020-09-01 | 恒玄科技(上海)股份有限公司 | Charging box, communication system and communication method of Bluetooth headset |
CN108811182B (en) * | 2018-06-14 | 2020-11-24 | 歌尔科技有限公司 | Wireless earphone pairing method and device and wireless earphone |
CN108901006B (en) * | 2018-06-15 | 2021-06-08 | Oppo广东移动通信有限公司 | Wireless earphone pairing method and electronic equipment |
CN109168101B (en) * | 2018-11-16 | 2020-09-22 | 歌尔股份有限公司 | Earphone box, earphone set and earphone connecting method |
CN109348466A (en) * | 2018-11-29 | 2019-02-15 | 与德科技有限公司 | Bluetooth headset, bluetooth headset box and bluetooth headset MAC Address exchange method |
CN109547897B (en) * | 2018-11-30 | 2021-07-09 | 歌尔科技有限公司 | Wireless earphone connection method, device and system and wireless earphone box |
WO2020107485A1 (en) * | 2018-11-30 | 2020-06-04 | 华为技术有限公司 | Bluetooth connection method and device |
-
2020
- 2020-09-04 CN CN202010928266.8A patent/CN112020048B/en active Active
- 2020-10-29 WO PCT/CN2020/124893 patent/WO2022047968A1/en active Application Filing
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105162497A (en) * | 2015-08-04 | 2015-12-16 | 天地融科技股份有限公司 | Data transmission method, terminal, electronic signature device and system |
US20190069287A1 (en) * | 2015-11-24 | 2019-02-28 | Bose Corporation | Media access control (mac) address identification |
CN106028264A (en) * | 2016-05-20 | 2016-10-12 | 珠海市杰理科技有限公司 | Bluetooth pairing method and system for electronic equipment |
CN109743714A (en) * | 2019-01-07 | 2019-05-10 | 优奈柯恩(北京)科技有限公司 | Device pairing method and device |
CN109600694A (en) * | 2019-01-16 | 2019-04-09 | 歌尔科技有限公司 | A kind of matching method of wireless headset, device, terminal and charging box |
CN111343622A (en) * | 2020-03-02 | 2020-06-26 | 北京服装学院 | Bluetooth sound box synchronous playing method, device and system |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117060949A (en) * | 2022-05-07 | 2023-11-14 | Oppo广东移动通信有限公司 | Signal sending method and device, combination identification method and device and electronic equipment |
CN115243389A (en) * | 2022-07-18 | 2022-10-25 | 北京思存通信技术有限公司 | Data analysis system based on Bluetooth data transmission |
CN115243389B (en) * | 2022-07-18 | 2023-03-03 | 北京思存通信技术有限公司 | Data analysis system based on Bluetooth data transmission |
CN115278624A (en) * | 2022-07-21 | 2022-11-01 | Oppo广东移动通信有限公司 | Information updating method and device, audio sharing method and system and electronic equipment |
Also Published As
Publication number | Publication date |
---|---|
CN112020048B (en) | 2022-06-21 |
CN112020048A (en) | 2020-12-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2022047968A1 (en) | Bluetooth device pairing method, device, and storage medium | |
KR102600892B1 (en) | Apparatus and method for communicating by using bluetooth low energy | |
KR102473262B1 (en) | Electronic device for controlling establishing or releasing communication connection and method for controlling thereof | |
US11419182B2 (en) | Electronic device supporting link sharing and method therefor | |
US9106337B2 (en) | Terminal apparatus for auto pairing, remote control apparatus and method thereof | |
EP3873004A1 (en) | Method for establishing classic bluetooth connection between dual-mode bluetooth devices, and dual-mode bluetooth device | |
US9326308B2 (en) | Pairing method and terminal apparatus | |
US10887745B2 (en) | Method and device for sharing file between different terminals | |
US20210050960A1 (en) | Electronic device for retransmitting data in bluetooth network environment and method thereof | |
CN110996405A (en) | Earphone connection method, terminal, earphone box and computer readable storage medium | |
KR20200045367A (en) | Electronic device using a bluetooth communication and method of operating the same | |
US9883545B2 (en) | Apparatus and method for selecting channel in wireless communication system | |
KR20210020542A (en) | Method for supporting multiple links in bluetooth network environment and electronic device thereof | |
KR20180114755A (en) | Device And Communication Connection Method Thereof | |
JP2015144402A (en) | On-vehicle device and on-vehicle device control method | |
KR20190138088A (en) | Electronic device suporting multiple wireless communication protocols and method therefor | |
KR20200031275A (en) | Electronic device for performing authorization using accessory and method for the same | |
KR102373548B1 (en) | Electronic device and method for connecting local communication | |
CN111885571A (en) | Bluetooth device pairing method, device and storage medium | |
KR102613405B1 (en) | Method for sharing for Bluetooth communication Information and Electronic Device | |
US20190235880A1 (en) | Scheme for automatically controlling dongle device and/or electronic device enter waiting state of device pairing in which the dongle device and the electronic device exchange/share pairing information | |
CN114257922B (en) | Earphone mixed loading identification method, system, equipment and computer readable storage medium | |
CN113518331A (en) | Communication method and device | |
KR20210039643A (en) | Electronic device and method for performing service discovery in electronic device | |
KR20200073811A (en) | Electronic device supporting secondary node addition and method therefor |
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: 20952210 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 20952210 Country of ref document: EP Kind code of ref document: A1 |