CN112004218B - Bluetooth connection pairing method - Google Patents

Bluetooth connection pairing method Download PDF

Info

Publication number
CN112004218B
CN112004218B CN202010860955.XA CN202010860955A CN112004218B CN 112004218 B CN112004218 B CN 112004218B CN 202010860955 A CN202010860955 A CN 202010860955A CN 112004218 B CN112004218 B CN 112004218B
Authority
CN
China
Prior art keywords
pairing
bluetooth
host
information
broadcast packet
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010860955.XA
Other languages
Chinese (zh)
Other versions
CN112004218A (en
Inventor
王春华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanjing Qinheng Microelectronics Co ltd
Original Assignee
Nanjing Qinheng Microelectronics Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nanjing Qinheng Microelectronics Co ltd filed Critical Nanjing Qinheng Microelectronics Co ltd
Priority to CN202010860955.XA priority Critical patent/CN112004218B/en
Publication of CN112004218A publication Critical patent/CN112004218A/en
Application granted granted Critical
Publication of CN112004218B publication Critical patent/CN112004218B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W48/00Access restriction; Network selection; Access point selection
    • H04W48/08Access restriction or access information delivery, e.g. discovery data delivery
    • H04W48/10Access restriction or access information delivery, e.g. discovery data delivery using broadcasted information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/11Allocation or use of connection identifiers

Abstract

The invention discloses a Bluetooth connection pairing method, which can realize connection pairing only by powering on and powering off a Bluetooth slave or a Bluetooth host under the condition that the Bluetooth host and the Bluetooth slave have no human-computer interaction interface or keys. The pairing method is safe and reliable, simple in pairing process and high in pairing efficiency, and is particularly suitable for being used on products without human-computer interaction interfaces or keys, so that the requirements of small size, simplicity and attractiveness of the products are met.

Description

Bluetooth connection pairing method
Technical Field
The invention belongs to the technical field of wireless, and particularly relates to a Bluetooth connection pairing method.
Background
With the development of wireless technology, the application of bluetooth is more and more extensive. Currently, in an environment with numerous bluetooth signals, pairing of a bluetooth host to a designated device is mainly completed by a human-computer interaction interface, such as a pairing interface in a mobile phone APP. Without human-machine interface, the pairing-specific device is usually controlled by a button press, RSSI magnitude, or AT command transmission, if it is to be connected.
Considering the volume and the attractiveness of the product, a plurality of Bluetooth host and slave machines have no human-computer interaction interface and no keys. The connection is controlled by the RSSI value, so that the uncontrollable property exists, the AT command control process is complicated, and the connection pairing method is not convenient enough.
Disclosure of Invention
The invention aims to: the invention provides a Bluetooth connection pairing method, aiming at solving the problem that the Bluetooth connection pairing method in the prior art is not convenient enough.
Another object of the present invention is to provide a connection pairing method for bluetooth hosts.
Another object of the present invention is to provide a connection pairing method of a bluetooth slave.
The technical scheme is as follows: a connection pairing method of a Bluetooth host comprises the following steps:
(a1) powering on the Bluetooth host;
(a2) the Bluetooth host scans, if a broadcast packet is scanned within a set time T1 after power-on, the broadcast packet contains power-on information, then step (a3) is executed; if the broadcast packet is not scanned, the pairing is failed;
(a3) judging whether the power-on information is power-on, if so, executing the step (a4), and if not, returning to the step (a 2);
(a4) judging whether the pairing state is paired, if not, executing the step (a5), if so, judging whether the host computer and the slave computer are matched, if so, initiating a pairing request to complete pairing, otherwise, executing the step (a 5);
(a5) connecting the Bluetooth host and the Bluetooth slave, taking the Bluetooth slave as a pairing object, recording equipment information of the pairing object, waiting for disconnection and reconnection, and executing the step (a6) if the connection is disconnected within a preset time T2 after the connection and is reconnected within a preset time T3 after the disconnection; otherwise, the pairing is failed, and the equipment information of the paired object is deleted;
(a6) Judging whether the equipment information of the reconnected Bluetooth slave machine is matched with the equipment information of the pairing object, if so, initiating a pairing request by the Bluetooth host machine to complete pairing, and clearing the equipment information of the historical pairing object; if not, the connection is disconnected, and the device information of the pairing object is deleted.
Further, the broadcast packet further includes a pairing status and pairing information, wherein the pairing status is one of paired, to-be-paired and unpaired; when the pairing state is paired or to be paired, the pairing information includes the MAC address of the pairing host.
Further, the method further comprises a rapid pairing method, which specifically comprises the following steps:
the step (a3) further includes that, if the power-on information is just powered on, the bluetooth host executes the following steps: judging whether the Bluetooth slave machines are not paired according to the pairing state in the broadcast packet, judging whether the Bluetooth master machine is not paired, judging whether the Bluetooth signal intensity of the received broadcast packet is greater than a preset Bluetooth signal intensity threshold value, and if the Bluetooth master machine and the Bluetooth slave machines are not paired and the Bluetooth signal intensity of the received broadcast packet is greater than the Bluetooth signal intensity threshold value, sending a pairing request by the Bluetooth master machine to establish pairing; otherwise, step (a4) is executed.
Further, in the step (a4), the method for determining the pairing state is that the bluetooth host determines whether the bluetooth host has already paired; the method for judging whether the host computer is matched with the slave computer comprises the following steps: whether the slave is a paired object is judged.
Further, in the step (a4), the pairing state may be determined by: the Bluetooth host judges whether the Bluetooth slave machines are paired according to the pairing state in the broadcast packet; the method for judging whether the host computer is matched with the slave computer comprises the following steps: and judging whether the pairing information in the broadcast packet is consistent with the host.
A connection pairing method of a Bluetooth slave machine comprises the following steps:
(b1) electrifying the Bluetooth slave computer, initiating a broadcast packet, wherein the broadcast packet comprises electrifying information, the electrifying information is the time when the Bluetooth slave computer is just electrified and is maintained for T1, and executing the step (b2) if the Bluetooth master computer is connected within the specified time T1 after the Bluetooth slave computer is electrified; if no Bluetooth host is connected, the pairing is failed;
(b2) the Bluetooth slave waits for receiving the pairing request or is powered off, and if the pairing request sent by the Bluetooth host is received, the pairing is established; if the pairing request sent by the Bluetooth host is not received and the Bluetooth slave is powered off within the specified time T2 after connection, the step (b1) is returned, and if the power is not powered off within the specified time T2 after connection, the connection is maintained.
A Bluetooth connection pairing method comprises the following steps:
(c1) the Bluetooth host and the Bluetooth slave are powered on within a T1 time period; the method comprises the steps that a Bluetooth slave computer launches a broadcast packet after being powered on, the broadcast packet comprises power-on information, the power-on information is power-on and maintains T1 time, and the Bluetooth master computer conducts scanning after being powered on;
(c2) the Bluetooth host scans the broadcast packet, is connected with the Bluetooth slave, takes the connecting equipment as a pairing object, and records the equipment information of the pairing object;
(c3) powering off the Bluetooth slave within a specified time T2 after connection and powering back on within a specified time T3 after power off;
(c4) the Bluetooth host and the Bluetooth slave are reconnected;
(c5) judging whether the equipment information of the reconnected Bluetooth slave machine is a pairing object or not according to the equipment information of the pairing object, if so, initiating a pairing request by the Bluetooth host machine to complete pairing, and clearing the equipment information of the historical pairing object; if not, the connection is disconnected, and the Bluetooth host deletes the equipment information of the pairing object.
A connection pairing method of a Bluetooth host comprises the following steps:
(a1) powering on the Bluetooth host;
(a2) the Bluetooth host scans, if a broadcast packet is scanned within a set time T1 after power-on, the broadcast packet comprises power-on information, pairing state and pairing information, then step (a3) is executed; if the broadcast packet is not scanned, the pairing is failed;
(a3) Judging whether the pairing state in the broadcast packet is to be paired, if not, executing the step (a 4); if yes, judging whether the pairing information is matched with the host computer, if so, initiating a pairing request to establish pairing, and if not, returning to the step (a 2);
(a4) judging whether the power-on information is power-on immediately, if so, executing the step (a5), and if not, returning to the step (a 2);
(a5) judging whether the pairing state is paired, if not, executing the step (a6), if so, judging whether the pairing information is matched, if so, establishing pairing, and if not, executing the step (a 6);
(a6) connecting the Bluetooth host with the Bluetooth slave, sending a request to be paired by the Bluetooth host, and returning to the step (a1) if the host is powered off within a specified time T2 after connection; if not, pairing fails.
A connection pairing method of a Bluetooth slave machine comprises the following steps:
(b1) the Bluetooth slave computer is electrified, a broadcast packet is initiated, the broadcast packet comprises electrifying information, a pairing state and pairing information, the electrifying information is the time of just electrifying and maintaining T1, and if the Bluetooth master computer is connected within the specified time T1 after electrifying, the step (b2) is executed; if no Bluetooth host is connected, the pairing is failed;
(b2) the Bluetooth slave waits for receiving a request initiated by the host, wherein the request comprises a request to be paired and a pairing request, and if the request to be paired is received, the step (b3) is executed; if the pairing request is received, establishing pairing, updating the pairing state in the broadcast packet to be paired, and changing the pairing information into a host machine MAC address; if the request is not received, the connection is kept;
(b3) Changing the pairing state in the broadcast packet to be paired, wherein the pairing information is a host MAC address, the changed pairing state and the pairing information maintain T6 time, and T6 is at least T2+ T3; judging whether the connection is disconnected within a specified time T2 after the connection, if the connection is disconnected, initiating a broadcast packet, and executing the step (b 4); if the connection is not disconnected, the connection is kept;
(b4) whether a host is connected or not is judged within a predetermined time T3 after disconnection, if yes, return is made (b2), and if no host is connected, pairing is failed.
A Bluetooth connection pairing method comprises the following steps:
(c1) the Bluetooth host and the Bluetooth slave are powered on within a T1 time period; the method comprises the steps that a Bluetooth slave computer is powered on and then launches a broadcast packet, the broadcast packet comprises power-on information, a pairing state and pairing information, and the Bluetooth master computer is powered on and then scans;
(c2) the Bluetooth host scans the broadcast packet, is connected with the Bluetooth slave, and sends a request to be paired to the Bluetooth slave, the Bluetooth slave changes the pairing state in the broadcast packet to be paired, changes the pairing information to be the MAC address of the Bluetooth host, maintains the changed pairing state and the pairing information for T6 time, and T6 is at least T2+ T3;
(c3) powering off the Bluetooth host within the specified time T2 after connection, initiating the broadcast packet by the Bluetooth slave, powering on again within the specified time T3 after power off, and scanning and reconnecting the broadcast packet by the Bluetooth host; judging the pairing state and the pairing information in the broadcast packet, if the pairing state is to be paired, matching the pairing information with the Bluetooth host, initiating a pairing request by the Bluetooth host to complete pairing, updating the pairing state in the broadcast packet to be paired by the Bluetooth slave, and changing the pairing information into a host MAC address; otherwise, the pairing fails.
Has the advantages that: compared with the prior art, the Bluetooth connection pairing method provided by the invention has the advantages that the pairing process is safe and reliable, the pairing method is simple and convenient, and the method is particularly suitable for being used on Bluetooth products without human-computer interaction interfaces or keys, so that the requirements of small product size, simplification and beauty are met; a rapid pairing mechanism is added, rapid pairing can be realized when rapid pairing conditions are met, and the working efficiency is improved.
Drawings
FIG. 1 is a flowchart illustrating a connection pairing method for a Bluetooth host according to an embodiment;
fig. 2 is a flowchart of a connection pairing method of a bluetooth slave according to an embodiment;
FIG. 3 is a flowchart of a connection pairing method of a Bluetooth host according to a third embodiment;
FIG. 4 is a flowchart illustrating a connection pairing method for Bluetooth hosts according to an embodiment;
fig. 5 is a flowchart of a connection pairing method of a bluetooth slave according to the fifth embodiment.
Detailed Description
The invention is further explained below with reference to the figures and the specific embodiments.
The first embodiment is as follows:
a Bluetooth connection pairing method realizes pairing of a host computer and a slave computer in a mode of powering off the Bluetooth slave computer, and comprises the following steps:
(c1) the Bluetooth host and the Bluetooth slave are powered on within a T1 time period, in the embodiment, T1 takes 3s, and other values can be set as required; the method comprises the steps that a broadcast packet is initiated after a Bluetooth slave computer is powered on, the broadcast packet comprises power-on information, the power-on information can be power-on immediately or not, the power-on information in the broadcast packet is power-on immediately after the Bluetooth slave computer is powered on and is maintained for 3s and then is changed into non-power-on immediately, and scanning is carried out after a Bluetooth host computer is powered on;
(c2) The Bluetooth host scans the broadcast packet, is connected with the Bluetooth slave, takes the connecting equipment as a pairing object, and records the equipment information of the pairing object;
(c3) the Bluetooth slave is powered off within the specified time T2 and powered on again within the specified time T3, in the embodiment, T2 and T3 take 3s, and can also take other values as required, and T1, T2 and T3 can also be different;
(c4) the Bluetooth host and the Bluetooth slave are reconnected;
(c5) judging whether the equipment information of the reconnected Bluetooth slave machine is a pairing object or not according to the equipment information of the pairing object, if so, initiating a pairing request by the Bluetooth host machine to complete pairing, and clearing the equipment information of the historical pairing object; if not, the connection is disconnected, and the Bluetooth host deletes the equipment information of the pairing object.
1. The method flow executed by the bluetooth host is shown in fig. 1, and includes the following steps:
(a1) powering on the Bluetooth host;
(a2) the Bluetooth host scans, if a broadcast packet is scanned within 3s after power-on, and the broadcast packet contains power-on information, executing the step (a 3); if the broadcast packet is not scanned, the pairing fails (the pairing failure only means that the pairing fails by adopting the method, but does not exclude that the pairing can be carried out by other methods);
(a3) Judging whether the power-on information is power-on immediately, if so, executing the step (a4), and if not, returning to the step (a 2);
(a4) judging whether the pairing state of the Bluetooth host is paired, if not, executing a step (a5), if so, judging whether the slave is a pairing object (a broadcast packet sent by the Bluetooth slave inevitably contains a slave address, and the slave identity is identified through the address), if so, initiating a pairing request to complete pairing, otherwise, executing a step (a 5);
(a5) connecting the Bluetooth host machine with the Bluetooth slave machine, taking the Bluetooth slave machine as a pairing object, recording equipment information of the pairing object, waiting for disconnection and reconnection, and executing the step (a6) if the connection is disconnected within 3s after connection and the reconnection is performed within 3s after disconnection; if the connection is not disconnected within 3s after the connection, judging whether the host is paired, if so, disconnecting the connection and deleting the equipment information of the paired object, and if not, keeping the connection and deleting the equipment information of the paired object; if the connection is disconnected within 3s after the connection but the power is not re-powered within the disconnected 3s, the pairing is failed, and the Bluetooth host deletes the device information of the pairing object.
(a6) Judging whether the equipment information of the reconnected Bluetooth slave machine is matched with the equipment information of the paired object, if so, initiating a pairing request by the Bluetooth host machine to complete pairing, and clearing the equipment information of the historical paired object; if not, the connection is disconnected, and the Bluetooth host deletes the equipment information of the pairing object.
2. The method flow executed by the bluetooth slave is shown in fig. 2, and includes the following steps:
(b1) the Bluetooth slave machine is electrified, a broadcast packet is initiated, the broadcast packet comprises electrifying information, the electrifying information is just electrified and is maintained for 3s, the electrifying information is changed into non-just electrified after being electrified for 3s, and if the Bluetooth master machine is connected within 3s after being electrified, the step (b2) is executed; if no Bluetooth host is connected, the pairing is failed;
(b2) the Bluetooth slave waits for receiving a pairing request or is powered off, and if the pairing request sent by the Bluetooth host is received, pairing is established; if the pairing request sent by the Bluetooth host is not received and the Bluetooth slave is powered off within 3s after connection, the step (b1) is returned, and if the power is not powered off within 3s after connection, the connection is kept.
The second embodiment:
the difference between the second embodiment and the first embodiment is that the broadcast packet sent by the bluetooth slave after being powered on in the second embodiment further includes a pairing status and pairing information, wherein the pairing status is one of paired, to-be-paired and unpaired; when the pairing state is paired or to be paired, the pairing information includes the MAC address of the pairing host. In the step (a4), the method for determining the pairing status is that the bluetooth host determines whether the bluetooth slave is paired according to the pairing status in the broadcast packet, and determines whether the bluetooth slave is consistent with the MAC address of the host according to the pairing information in the broadcast packet, instead of determining whether the bluetooth host is paired. The rest is the same as the first embodiment.
Example three:
fig. 3 shows a pairing connection method of three bluetooth hosts according to an embodiment.
The difference between the third embodiment and the second embodiment is that the method further comprises a quick pairing method:
the step (a3) further comprises, if the power-on information is marked as power-on, the bluetooth host firstly performs the following steps: judging whether the Bluetooth slave machines are unpaired according to the pairing state in the broadcast packet, judging whether the Bluetooth host machine is unpaired, judging whether the Bluetooth signal intensity of the received broadcast packet is greater than a preset Bluetooth signal intensity threshold value, and if the Bluetooth host machine and the Bluetooth slave machines are unpaired and the Bluetooth signal intensity of the received broadcast packet is greater than the preset Bluetooth signal intensity threshold value, sending a pairing request by the Bluetooth host machine to establish pairing; otherwise, step (a4) is executed.
The purpose of the rapid pairing method is to directly establish pairing under the condition that the Bluetooth host and the Bluetooth slave are not paired and the distance between the Bluetooth host and the Bluetooth slave is short, so that the pairing is more time-saving, convenient and efficient.
Example four:
the fast pairing method according to the third embodiment may be added to the first embodiment, but it should be noted that the broadcast packet sent by the bluetooth slave after being powered on must include a pairing status, which is one of paired, intended to be paired, and unpaired.
The Bluetooth connection pairing method has simple pairing process, does not need any human-computer interaction interface or key in the whole process, and can realize the connection pairing of the Bluetooth host and the Bluetooth slave only by powering on and powering off the Bluetooth slave. The Bluetooth host can only be paired with one Bluetooth slave at a time, the Bluetooth slave can also be paired with one Bluetooth host at a time, after the Bluetooth host is paired with the Bluetooth slave, the Bluetooth host can only be connected with the paired Bluetooth slave, and if the Bluetooth host is required to be connected with other Bluetooth slaves, the pairing needs to be reestablished, so that the Bluetooth system is safe and reliable.
Example five:
a Bluetooth connection pairing method realizes pairing of a host and a slave in a mode of power failure of a Bluetooth host, and comprises the following steps:
(c1) the Bluetooth host and the Bluetooth slave are powered on in a T1 time period (in the embodiment, the T1 takes 3s, and other values can be taken as required); the method comprises the steps that a Bluetooth slave computer is powered on and then launches a broadcast packet, the broadcast packet comprises power-on information, a pairing state and pairing information, and the Bluetooth master computer is powered on and then scans;
the Bluetooth slave machine always sends out the broadcast packet when not connected by the host machine, and does not broadcast after being connected with the host machine. The power-on information can be power-on or not power-on, the slave maintains power-on within the time T1 after power-on, and the power-on information is changed into non-power-on after the time T1, and the purpose of setting the power-on information is to confirm whether the slave is the equipment needing pairing or not when the slave is connected for the first time. The pairing state can be to be paired or unpaired, and if the pairing state is to be paired or paired, the pairing information comprises a pairing host machine MAC address;
(c2) The Bluetooth host scans the broadcast packet, is connected with the Bluetooth slave, and sends a request to be paired to the Bluetooth slave, the Bluetooth slave changes the pairing state in the broadcast packet into the pairing state, changes the pairing information into the MAC address of the Bluetooth host, and maintains the changed pairing state and the pairing information for 6s (at least T2+ T3), so that the Bluetooth host can identify the Bluetooth slave to be paired within 6 s;
(c3) the Bluetooth host is powered off within the specified time T2, the Bluetooth slave initiates the broadcast packet again, and the Bluetooth host is powered on again within the specified time T3, in the embodiment, T2 and T3 take 3s, or take other values as required, and T1, T2 and T3 may be different; the Bluetooth host scans the broadcast packet and reconnects the broadcast packet; judging the pairing state and the pairing information in the broadcast packet, if the pairing state is to be paired, matching the pairing information with the Bluetooth host, initiating a pairing request by the Bluetooth host to complete pairing, updating the pairing state in the broadcast packet to be paired by the Bluetooth slave, and changing the pairing information into a host MAC address; otherwise, the pairing fails.
1. The method flow executed by the bluetooth host is shown in fig. 4, and includes the following steps:
(a1) powering on the Bluetooth host;
(a2) the Bluetooth host scans, if a broadcast packet is scanned within 3s after being powered on, and the broadcast packet comprises power-on information, a pairing state and pairing information, executing the step (a 3); if the broadcast packet is not scanned, the pairing is failed;
(a3) Judging whether the pairing state in the broadcast packet is to be paired, if not, executing the step (a 4); if yes, judging whether the pairing information is matched with the host computer, if so, initiating a pairing request to establish pairing, and if not, returning to the step (a 2);
(a4) judging whether the power-on information is marked as power-on, if so, executing the step (a5), and if not, returning to the step (a 2);
(a5) judging whether the pairing state in the broadcast packet is paired, if not, executing the step (a6), if so, judging whether the pairing information in the broadcast packet is matched with the host computer, if so, establishing pairing, and if not, executing the step (a 6);
(a6) the Bluetooth host is connected with the Bluetooth slave, the Bluetooth host sends a request to be paired, and if the host is powered off within 3s after connection, the step (a1) is returned; if the power is not off within 3s after the connection, the pairing fails (the pairing failure refers to the pairing failure only by adopting the method, but does not exclude the possibility of pairing through other modes, see embodiment four), in addition, whether the host is paired or not can be judged, and if yes, the connection is disconnected; if not, the connection is maintained.
2. The connection pairing method of the bluetooth slave, as shown in fig. 5, includes the following steps:
(b1) and the Bluetooth slave computer is electrified, a broadcast packet is initiated, the broadcast packet comprises electrifying information, a pairing state and pairing information, and the electrifying information in the broadcast packet is just electrified after the slave computer is electrified and is changed into non-just electrified after being maintained for 3 s. In the power-on 3s, if a Bluetooth host is connected, executing the step (b 2); if no Bluetooth host is connected, the pairing is failed;
(b2) The Bluetooth slave waits for receiving a request initiated by the host, wherein the request comprises a request to be paired and a pairing request, and if the request to be paired is received, the step (b3) is executed; if the pairing request is received, establishing pairing, updating the pairing state in the broadcast packet to be paired, and changing the pairing information into a host machine MAC address; if the request is not received, keeping connection;
(b3) changing the pairing state in the broadcast packet to be paired, and the pairing information to be a host machine MAC address, and maintaining the changed pairing state and the pairing information for 6 s; judging whether the connection is disconnected within 3s after the connection, if the connection is disconnected, initiating a broadcast packet, and executing the step (b 4); if the connection is not disconnected, the connection is kept;
in this step, the pairing status and the pairing information in the broadcast packet may be changed after the disconnection, or before the disconnection, and there is no fixed sequence between the two. The reason for restoring the changed information in the broadcast packet after maintaining for 6s is to restore the pairing state and the pairing information to the previous information without affecting the next connection pairing when the host is not disconnected within 3s or is not reconnected within 3s after disconnection, that is, the pairing is failed this time.
(b4) And judging whether the host is connected within 3s after the disconnection, if so, returning (b2), and if not, failing to pair.
In this embodiment, the master unit and the slave unit are paired in a master unit plugging manner, where the step (a5) of determining whether the pairing status is paired may also be: judging whether the Bluetooth host is paired or not; the method for judging whether the pairing information is matched comprises the following steps: and judging whether the equipment information of the pairing object is matched with the Bluetooth slave, wherein the equipment information of the pairing object is recorded after the Bluetooth master establishes pairing each time.
A fast pairing method can be added on the basis of the embodiment:
in the step (a4), if the power-on information is marked as power-on, the bluetooth host performs the following steps: judging whether the Bluetooth slave machines are not paired according to the pairing state in the broadcast packet, judging whether the Bluetooth master machine is not paired, judging whether the Bluetooth signal intensity of the received broadcast packet is greater than a preset Bluetooth signal intensity threshold value, and if the Bluetooth master machine and the Bluetooth slave machines are not paired and the Bluetooth signal intensity of the received broadcast packet is greater than the preset Bluetooth signal intensity threshold value, sending a pairing request by the Bluetooth master machine to establish pairing; otherwise, step (a5) is executed.
The rapid pairing method is aimed at directly establishing pairing under the condition that the Bluetooth host and the Bluetooth slave are not paired and are close to each other, so that the pairing is more time-saving, convenient and efficient. The fast pairing method as described in the third embodiment can also be added to the second embodiment.
The method for pairing the Bluetooth host and the Bluetooth slave is realized in a host or slave plugging mode, and is very suitable for being used on a Bluetooth product without a human-computer interaction interface or keys, so that the product is optimized, and the requirements of small volume, simplicity and attractiveness of the product are met; the pairing process is simple, convenient and easy to operate; in addition, a quick pairing mechanism is added, so that quick pairing can be realized when a quick pairing condition is met, and the working efficiency is improved.

Claims (10)

1. A connection pairing method of a Bluetooth host is characterized by comprising the following steps:
(a1) powering on the Bluetooth host;
(a2) the Bluetooth host scans, if a broadcast packet is scanned within a set time T1 after power-on, the broadcast packet contains power-on information, then step (a3) is executed; if the broadcast packet is not scanned, the pairing is failed;
(a3) judging whether the power-on information is power-on, if so, executing the step (a4), and if not, returning to the step (a 2);
(a4) Judging whether the pairing state is paired, if not, executing the step (a5), if so, judging whether the host computer and the slave computer are matched, if so, initiating a pairing request to complete pairing, otherwise, executing the step (a 5);
(a5) connecting the Bluetooth host and the Bluetooth slave, taking the Bluetooth slave as a pairing object, recording equipment information of the pairing object, waiting for disconnection and reconnection, and executing the step (a6) if the connection is disconnected within a preset time T2 after the connection and is reconnected within a preset time T3 after the disconnection; otherwise, the pairing is failed, and the equipment information of the paired object is deleted;
(a6) judging whether the equipment information of the reconnected Bluetooth slave machine is matched with the equipment information of the pairing object, if so, initiating a pairing request by the Bluetooth host machine to complete pairing, and clearing the equipment information of the historical pairing object; if not, the connection is disconnected, and the device information of the pairing object is deleted.
2. The method of claim 1, wherein the broadcast packet further includes a pairing status and pairing information, the pairing status being one of paired, to-be-paired, or unpaired; when the pairing state is paired or to be paired, the pairing information includes the MAC address of the pairing host.
3. The connection pairing method of the bluetooth host according to claim 2, further comprising a fast pairing method, specifically:
the step (a3) further includes that, if the power-on information is just powered on, the bluetooth host executes the following steps: judging whether the Bluetooth slave machines are unpaired according to the pairing state in the broadcast packet, judging whether the Bluetooth host machine is unpaired, judging whether the Bluetooth signal intensity of the received broadcast packet is greater than a preset Bluetooth signal intensity threshold value, and if the Bluetooth host machine and the Bluetooth slave machines are unpaired and the Bluetooth signal intensity of the received broadcast packet is greater than the Bluetooth signal intensity threshold value, sending a pairing request by the Bluetooth host machine to establish pairing; otherwise, step (a4) is executed.
4. A method for connecting and pairing a bluetooth host as claimed in any one of claims 1 to 3, wherein in step (a4), the method for determining the pairing status is that the bluetooth host determines whether it is paired; the method for judging whether the host computer is matched with the slave computer comprises the following steps: whether the slave is a paired object is judged.
5. The method for connecting and pairing a bluetooth host as claimed in claim 2 or 3, wherein in the step (a4), the method for determining the pairing status comprises: the Bluetooth host judges whether the Bluetooth slave machines are paired according to the pairing state in the broadcast packet; the method for judging whether the host computer is matched with the slave computer comprises the following steps: and judging whether the pairing information in the broadcast packet is consistent with the host.
6. A connection pairing method of Bluetooth slaves is characterized by comprising the following steps:
(b1) electrifying the Bluetooth slave computer, initiating a broadcast packet, wherein the broadcast packet comprises electrifying information, the electrifying information is the time when the Bluetooth slave computer is just electrified and is maintained for T1, and executing the step (b2) if the Bluetooth master computer is connected within the specified time T1 after the Bluetooth slave computer is electrified; if no Bluetooth host is connected, the pairing is failed;
(b2) the Bluetooth slave waits for receiving the pairing request or is powered off, and if the pairing request sent by the Bluetooth host is received, the pairing is established; if the pairing request sent by the Bluetooth host is not received and the Bluetooth slave is powered off within the preset time T2 after connection, the step (b1) is returned, and if the power is not powered off within the preset time T2 after connection, the connection is maintained.
7. A Bluetooth connection pairing method is characterized by comprising the following steps:
(c1) the Bluetooth host and the Bluetooth slave are powered on within a T1 time period; the method comprises the steps that a Bluetooth slave computer launches a broadcast packet after being powered on, the broadcast packet comprises power-on information, the power-on information is power-on and maintains T1 time, and the Bluetooth master computer conducts scanning after being powered on;
(c2) the Bluetooth host scans the broadcast packet, is connected with the Bluetooth slave, takes the connecting equipment as a pairing object, and records the equipment information of the pairing object;
(c3) Powering off the Bluetooth slave within a specified time T2 after connection and powering back on within a specified time T3 after power off;
(c4) the Bluetooth host and the Bluetooth slave are reconnected;
(c5) judging whether the equipment information of the reconnected Bluetooth slave machine is a pairing object or not according to the equipment information of the pairing object, if so, initiating a pairing request by a Bluetooth host to complete pairing, and clearing the equipment information of a historical pairing object; if not, the connection is disconnected, and the Bluetooth host deletes the equipment information of the pairing object.
8. A connection pairing method of a Bluetooth host is characterized by comprising the following steps:
(a1) powering on the Bluetooth host;
(a2) the Bluetooth host computer scans, if a broadcast packet is scanned within a set time T1 after being powered on, and the broadcast packet comprises power-on information, a pairing state and pairing information, executing a step (a 3); if the broadcast packet is not scanned, the pairing is failed;
(a3) judging whether the pairing state in the broadcast packet is to be paired, if not, executing the step (a 4); if yes, judging whether the pairing information is matched with the host computer, if so, initiating a pairing request to establish pairing, and if not, returning to the step (a 2);
(a4) judging whether the power-on information is power-on immediately, if so, executing the step (a5), and if not, returning to the step (a 2);
(a5) Judging whether the pairing state is paired, if not, executing the step (a6), if yes, judging whether the pairing information is matched, if yes, establishing pairing, and if not, executing the step (a 6);
(a6) connecting the Bluetooth host with the Bluetooth slave, sending a request to be paired by the Bluetooth host, and if the host is powered off within a specified time T2 after connection, returning to the step (a 1); if not, pairing fails.
9. A connection pairing method of Bluetooth slaves is characterized by comprising the following steps:
(b1) the Bluetooth slave computer is electrified, a broadcast packet is initiated, the broadcast packet comprises electrifying information, a pairing state and pairing information, the electrifying information is the time of just electrifying and maintaining T1, and if the Bluetooth master computer is connected within the specified time T1 after electrifying, the step (b2) is executed; if no Bluetooth host is connected, the pairing is failed;
(b2) the Bluetooth slave waits for receiving a request initiated by the host, wherein the request comprises a request to be paired and a pairing request, and if the request to be paired is received, the step (b3) is executed; if the pairing request is received, establishing pairing, updating the pairing state in the broadcast packet to be paired, and changing the pairing information into a host machine MAC address; if the request is not received, the connection is kept;
(b3) Changing the pairing state in the broadcast packet to be paired, wherein the pairing information is a host MAC address, the changed pairing state and the pairing information maintain T6 time, and T6 is at least T2+ T3; judging whether the connection is disconnected within a specified time T2 after the connection, if the connection is disconnected, initiating a broadcast packet, and executing the step (b 4); if the connection is not disconnected, the connection is kept;
(b4) whether a host is connected or not is judged within a predetermined time T3 after disconnection, if yes, return is made (b2), and if no host is connected, pairing is failed.
10. A Bluetooth connection pairing method is characterized by comprising the following steps:
(c1) the Bluetooth host and the Bluetooth slave are powered on within a T1 time period; the method comprises the steps that a Bluetooth slave computer is powered on and then launches a broadcast packet, the broadcast packet comprises power-on information, a pairing state and pairing information, and the Bluetooth master computer is powered on and then scans;
(c2) the Bluetooth host scans the broadcast packet, is connected with the Bluetooth slave, and sends a request to be paired to the Bluetooth slave, the Bluetooth slave changes the pairing state in the broadcast packet to be paired, changes the pairing information to be the MAC address of the Bluetooth host, maintains the changed pairing state and the pairing information for T6 time, and T6 is at least T2+ T3;
(c3) powering off the Bluetooth host within the specified time T2 after connection, initiating the broadcast packet by the Bluetooth slave, powering on again within the specified time T3 after power off, and scanning and reconnecting the broadcast packet by the Bluetooth host; judging the pairing state and the pairing information in the broadcast packet, if the pairing state is to be paired, matching the pairing information with the Bluetooth host, initiating a pairing request by the Bluetooth host to complete pairing, updating the pairing state in the broadcast packet to be paired by the Bluetooth slave, and changing the pairing information into a host MAC address; otherwise, the pairing fails.
CN202010860955.XA 2020-08-24 2020-08-24 Bluetooth connection pairing method Active CN112004218B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010860955.XA CN112004218B (en) 2020-08-24 2020-08-24 Bluetooth connection pairing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010860955.XA CN112004218B (en) 2020-08-24 2020-08-24 Bluetooth connection pairing method

Publications (2)

Publication Number Publication Date
CN112004218A CN112004218A (en) 2020-11-27
CN112004218B true CN112004218B (en) 2022-07-19

Family

ID=73470684

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010860955.XA Active CN112004218B (en) 2020-08-24 2020-08-24 Bluetooth connection pairing method

Country Status (1)

Country Link
CN (1) CN112004218B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112788579A (en) * 2020-12-31 2021-05-11 厦门亿联网络技术股份有限公司 Method and device for quickly pairing dual-mode Bluetooth equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105338402A (en) * 2015-11-04 2016-02-17 北京数码视讯科技股份有限公司 Bluetooth connection method and apparatus
CN107155123A (en) * 2017-06-14 2017-09-12 深圳Tcl新技术有限公司 Matching method, television set and the readable storage medium storing program for executing of bluetooth equipment and television set
CN108391259A (en) * 2018-01-11 2018-08-10 佳禾智能科技股份有限公司 A kind of method that bluetooth is quickly matched

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105933039B (en) * 2016-06-24 2018-06-29 飞天诚信科技股份有限公司 A kind of bluetooth equipment and its method of work

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105338402A (en) * 2015-11-04 2016-02-17 北京数码视讯科技股份有限公司 Bluetooth connection method and apparatus
CN107155123A (en) * 2017-06-14 2017-09-12 深圳Tcl新技术有限公司 Matching method, television set and the readable storage medium storing program for executing of bluetooth equipment and television set
CN108391259A (en) * 2018-01-11 2018-08-10 佳禾智能科技股份有限公司 A kind of method that bluetooth is quickly matched

Also Published As

Publication number Publication date
CN112004218A (en) 2020-11-27

Similar Documents

Publication Publication Date Title
CN108419226B (en) Method for connecting Bluetooth devices and Bluetooth devices
EP3873004B1 (en) Method for establishing classic bluetooth connection between dual-mode bluetooth devices, and dual-mode bluetooth device
CN101026394A (en) Method and apparatus for secured communication between bluetooth devices
CN103430509A (en) Pairing between wireless devices
US20190159271A1 (en) Bluetooth connection management method, master bluetooth device, and apparatus
EP3893109A1 (en) Method and device for connecting bluetooth devices
US8838032B2 (en) Communication terminal and communication control method
CN103221962A (en) Peripheral authentication
EP2206312A2 (en) Pairing exchange
MXPA02010535A (en) A method and apparatus for peer to peer communication over an inherently master slave interface.
CN106998496A (en) The method and system that a kind of set top box bluetooth is de-coordinated automatically
KR101568332B1 (en) Vehicle supporting efficient bluetooth connection and method for controlling thereof
EP3502908B1 (en) Spi-based data transmission method and device
US20190268951A1 (en) Communication Method and Device
CN103220822A (en) Data transmission method, data transmission device and mobile terminal
CN109618318A (en) A kind of matching method and TWS earphone of TWS earphone
EP2996256A1 (en) Method, device and system for controlling nfc radio frequency communication
CN105636161A (en) Wireless network access method and device, communication terminal and wireless network access point
CN112004218B (en) Bluetooth connection pairing method
CN106020515B (en) The connection method and radio keyboard mouse system of radio keyboard mouse and its receiver
CN105787344A (en) Slave device and method for establishing connection between same and master device
EP4160857A1 (en) Charger, data line and charging device
CN110944313B (en) Bluetooth connection method, device, storage medium and terminal
CN108702366A (en) Equipment connection method and terminal
WO2018095175A1 (en) Communication message synchronization method, data backup method, device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant