CN111132100B - Bluetooth connection method and device, bluetooth equipment and Bluetooth system - Google Patents

Bluetooth connection method and device, bluetooth equipment and Bluetooth system Download PDF

Info

Publication number
CN111132100B
CN111132100B CN201910952785.5A CN201910952785A CN111132100B CN 111132100 B CN111132100 B CN 111132100B CN 201910952785 A CN201910952785 A CN 201910952785A CN 111132100 B CN111132100 B CN 111132100B
Authority
CN
China
Prior art keywords
bluetooth
unit
connection
packet
inquiry
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
CN201910952785.5A
Other languages
Chinese (zh)
Other versions
CN111132100A (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.)
Zhuhai Jieli Technology Co Ltd
Original Assignee
Zhuhai Jieli Technology 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 Zhuhai Jieli Technology Co Ltd filed Critical Zhuhai Jieli Technology Co Ltd
Priority to CN201910952785.5A priority Critical patent/CN111132100B/en
Publication of CN111132100A publication Critical patent/CN111132100A/en
Application granted granted Critical
Publication of CN111132100B publication Critical patent/CN111132100B/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
    • H04BTRANSMISSION
    • H04B1/00Details of transmission systems, not covered by a single one of groups H04B3/00 - H04B13/00; Details of transmission systems not characterised by the medium used for transmission
    • H04B1/69Spread spectrum techniques
    • H04B1/713Spread spectrum techniques using frequency hopping
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W56/00Synchronisation arrangements
    • H04W56/001Synchronization between nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Abstract

The invention provides a Bluetooth connection method and device, a Bluetooth device and a Bluetooth system, wherein the Bluetooth connection method of a main device side comprises the following steps: the first Bluetooth device enables out-of-band communication to establish connection with the second Bluetooth device; step 102: the first Bluetooth device sends a Bluetooth address, a local clock and a contracted inquiry time T of the first Bluetooth device to the second Bluetooth device by adopting out-of-band communication; step 103: the first Bluetooth device configures a current frequency hopping sequence according to the Bluetooth address and the local clock of the first Bluetooth device; and the first Bluetooth device performs first packet communication with the second Bluetooth device by adopting a frequency point corresponding to the appointed inquiry moment T in the frequency hopping sequence. And the first Bluetooth device establishes Bluetooth connection with the second Bluetooth device after the first Bluetooth device successfully communicates with the first Bluetooth device. The invention adopts out-of-band communication to exchange frequency hopping information and appoints the communication time of the first packet, thereby improving the efficiency of establishing Bluetooth connection.

Description

Bluetooth connection method and device, bluetooth equipment and Bluetooth system
Technical Field
The present invention relates to the field of bluetooth communication technologies, and in particular, to a bluetooth connection method, a bluetooth connection device, a bluetooth device, and a bluetooth system for establishing a bluetooth communication connection between two bluetooth devices in a short time.
Background
When a bluetooth connection is established between conventional master and slave bluetooth devices, a target device in inquiry scan (inquriy scan) and page scan (page scan) states needs to be discovered and connected in an inquiry (inquiry) and page scan (page) mode. This approach requires a long time to establish a connection. Specifically, the bluetooth wireless connection is established between the master and slave bluetooth devices, and the connection is required to be established between the master and slave machines in a classical bluetooth wireless frequency band in an unsynchronized frequency hopping mode. The master (master) needs to query (query) by fast frequency hopping (switching a new transmission frequency every 312.5 us), and the slave (slave) slowly frequency hopping (switching a new listening frequency every 1.28 s) to perform query scanning or page scanning. After the two parties hit a frequency point which can be communicated with each other, the slave machine responds to the host machine, thereby synchronizing the frequency hopping sequence and establishing wireless connection. The entire inquiry and paging process averages the time duration, resulting in inefficiency in bluetooth connection establishment.
Disclosure of Invention
Based on the above-mentioned situation, a main object of the present invention is to provide a bluetooth connection method, a bluetooth connection device, a bluetooth device and a bluetooth system, which can improve the efficiency of bluetooth connection establishment.
In order to achieve the above purpose, the technical scheme adopted by the invention is as follows:
the Bluetooth connection method is applied to a main device side and comprises the following steps:
step 101: the first Bluetooth device enables out-of-band communication and establishes out-of-band communication connection with the second Bluetooth device;
step 102: the first Bluetooth device sends a Bluetooth address, a local clock and a contracted inquiry time T of the first Bluetooth device to the second Bluetooth device by adopting out-of-band communication;
step 103: the first Bluetooth device configures a current frequency hopping sequence according to a Bluetooth address and a local clock of the first Bluetooth device;
step 104: the first Bluetooth device performs first packet communication with the second Bluetooth device by adopting a frequency point corresponding to the appointed inquiry moment T in the frequency hopping sequence;
step 106: the first Bluetooth device establishes Bluetooth connection with the second Bluetooth device after the first Bluetooth device successfully communicates with the first Bluetooth device
Preferably, when the first bluetooth device sends the bluetooth address of the first bluetooth device to the second bluetooth device by using out-of-band communication, the local clock value of the first bluetooth device is a synchronization time CLKN (sync), and the contracted inquiry time T is delayed by a number of bluetooth clock minimum timing units based on the synchronization time CLKN (sync).
Preferably, the contracted query time t=clkn (sync) + (CLKN (sync)% 2+2n) ×t unit Wherein, "%" is the remainder operator, T unit A Bluetooth clock minimum timing unit; if CLKN (sync)% 2= 0, n=2, and if CLKN (sync)% 2= 1, n=1.
Preferably, the step 104 specifically includes:
step 104a: the first Bluetooth device sends an inquiry packet to the second Bluetooth device by adopting a frequency point corresponding to the appointed inquiry time T in the frequency hopping sequence;
step 104b: the first Bluetooth device judges whether a response packet of the second Bluetooth device for confirming the inquiry packet is received or not;
step 104c: the first Bluetooth device confirms that the first packet communication is successful when receiving the response packet;
the Bluetooth connection method further comprises the following steps:
step 106: the first bluetooth device jumps to step 102 when the response packet is not received.
Preferably, the method further comprises:
step 107: and after the first Bluetooth device establishes Bluetooth connection with the second Bluetooth device, the first Bluetooth device disconnects out-of-band communication connection with the second Bluetooth device.
The technical scheme adopted by the invention also comprises the following steps:
the Bluetooth connection method is applied to a slave device side and comprises the following steps:
Step 601: the second Bluetooth device enables out-of-band communication and establishes out-of-band communication connection with the first Bluetooth device;
step 602: the second Bluetooth device receives the Bluetooth address, the local clock and the appointed inquiry time T of the first Bluetooth device sent by the first Bluetooth device by adopting out-of-band communication;
step 603: the second Bluetooth device configures a current frequency hopping sequence according to a local clock, an offset of the local clock relative to the local clock of the first Bluetooth device and a Bluetooth address of the first Bluetooth device;
step 604: and the second Bluetooth device starts a scanning window by taking the appointed inquiry time T as a reference, and performs first packet communication with the first Bluetooth device by adopting a frequency point corresponding to the appointed inquiry time T in the frequency hopping sequence.
Step 607: and the second Bluetooth device establishes Bluetooth connection with the first Bluetooth device after the first packet communication is successful.
Preferably, the scanning window is [ T- (T) unit +|Δt|),T+(T unit +|Δt|)]Wherein T is the appointed inquiry time, T unit For the minimum timing unit of the bluetooth clock, |Δt| is a compensation amount considering out-of-band communication delay.
Preferably, the scanning window size is 625-1250 mus.
Preferably, the step 604 specifically includes:
Step 604a: the second Bluetooth device starts a scanning window by taking the appointed inquiry time T as a reference, and receives an inquiry packet sent by the first Bluetooth device by adopting a frequency point corresponding to the appointed inquiry time T in the frequency hopping sequence;
step 604b: the second Bluetooth device judges whether an inquiry packet sent by the first Bluetooth device is received or not;
step 604c: the second Bluetooth device replies a response packet for confirming the inquiry packet to the first Bluetooth device when receiving the inquiry packet sent by the first Bluetooth device;
step 604d: the second Bluetooth device confirms that the first packet communication is successful when the first Bluetooth device receives the response packet;
the Bluetooth connection method further comprises the following steps:
step 606: the second bluetooth device jumps to step 602 when it does not receive the inquiry packet sent by the first bluetooth device.
The technical scheme adopted by the invention also comprises the following steps:
the Bluetooth connecting device is applied to a main equipment side and comprises an out-of-band communication module and a Bluetooth module, wherein the out-of-band communication module comprises an out-of-band communication connecting unit and an out-of-band information sending unit; the Bluetooth module comprises a frequency hopping configuration unit, a first packet communication unit and a Bluetooth communication connection unit, wherein,
The out-of-band communication connection unit is used for establishing out-of-band communication connection with the Bluetooth connection device of the slave device side when the Bluetooth connection with the Bluetooth connection device of the slave device side is required to be established;
the out-of-band information sending unit is used for sending the Bluetooth address of the Bluetooth connecting device at the side of the main equipment, the local clock and the appointed inquiry time T to the Bluetooth connecting device at the side of the auxiliary equipment by adopting out-of-band communication;
the frequency hopping configuration unit is used for configuring a current frequency hopping sequence according to the Bluetooth address of the Bluetooth connection device at the side and the local clock;
the first packet communication unit is used for carrying out first packet communication with the Bluetooth connection device at the slave device side by adopting a frequency point corresponding to the appointed inquiry moment T in the frequency hopping sequence;
the Bluetooth communication connection unit is used for establishing Bluetooth connection with the Bluetooth connection device at the slave device side after the first packet communication is successful.
Preferably, the first packet communication unit includes an inquiry unit and a packet receipt confirmation unit, wherein,
the inquiry unit is used for sending an inquiry packet to the Bluetooth connection device at the slave device side by adopting a frequency point corresponding to the appointed inquiry time T in the frequency hopping sequence;
the packet receiving confirmation unit is used for judging whether a response packet for confirming the inquiry packet of the Bluetooth connection device at the slave equipment side is received or not;
The out-of-band information sending unit is further configured to send, to the bluetooth connection device on the slave device side, the bluetooth address of the bluetooth connection device on the master device side, the local clock, and the contracted inquiry time T by using out-of-band communication again when the packet receiving confirmation unit determines that the response packet is not received.
Preferably, the out-of-band communication unit is further configured to disconnect the out-of-band communication with the slave device side bluetooth connection device after the bluetooth communication connection unit establishes a bluetooth connection with the slave device side bluetooth connection device.
The technical scheme adopted by the invention also comprises the following steps:
the Bluetooth connection device is applied to a slave device side and comprises an out-of-band communication module and a Bluetooth module, wherein the out-of-band communication module comprises an out-of-band communication connection unit and an out-of-band information receiving unit; the Bluetooth module comprises the frequency hopping configuration unit, a first packet communication unit and a Bluetooth communication connection unit, wherein
The out-of-band communication connection unit is used for establishing out-of-band communication connection with the Bluetooth connection device on the side of the main equipment when the Bluetooth connection with the Bluetooth connection device on the side of the main equipment is required to be established;
the out-of-band information receiving unit is used for receiving a Bluetooth address, a local clock and a contracted inquiry time T of the Bluetooth connecting device at the slave device side, which are sent by the Bluetooth connecting device at the master device side, by adopting out-of-band communication;
The frequency hopping configuration unit is used for configuring a current frequency hopping sequence according to a local clock of the local side Bluetooth connection device, offset of the local clock relative to the local clock of the Bluetooth connection device at the main equipment side and a Bluetooth address of the Bluetooth connection device at the main equipment side;
the first packet communication unit is used for starting a scanning window by taking the appointed inquiry time T as a reference, and carrying out first packet communication with a Bluetooth connection device at a main equipment side by adopting a frequency point corresponding to the appointed inquiry time T in the frequency hopping sequence;
the Bluetooth communication connection unit is used for establishing Bluetooth connection with the Bluetooth connection device at the side of the main equipment after the first packet communication is successful.
Preferably, the first packet communication unit includes: a scanning unit, a packet receiving confirmation unit and a response unit, wherein,
the scanning unit starts a scanning window by taking the appointed inquiry time T as a reference, and receives an inquiry packet sent by a main equipment side Bluetooth connection device by adopting a frequency point corresponding to the appointed inquiry time T in the frequency hopping sequence;
the packet receiving confirmation unit is used for judging whether an inquiry packet sent by the Bluetooth connection device at the main equipment side is received or not;
the response unit is used for replying a response packet for confirming the inquiry packet to the Bluetooth connection device at the main equipment side when receiving the inquiry packet sent by the Bluetooth connection device at the main equipment side;
The out-of-band communication connection unit is further configured to receive, by using out-of-band communication, the bluetooth address of the bluetooth connection device on the side of the primary device, the local clock, and the contracted query time T, which are sent by the first bluetooth device, when the packet receiving confirmation unit determines that the query packet sent by the bluetooth connection device on the side of the primary device is not received.
The technical scheme adopted by the invention also comprises the following steps:
there is provided a bluetooth device including a bluetooth module, an out-of-band communication module, a processor, and a computer readable storage medium having stored thereon a bluetooth connection program which, when executed by the processor, implements the bluetooth connection method applied to a main device side as described above.
The technical scheme adopted by the invention also comprises the following steps:
there is provided a bluetooth device including a bluetooth module, an out-of-band communication module, a processor, and a computer readable storage medium having stored thereon a bluetooth connection program which, when executed by the processor, implements the bluetooth connection method applied to a slave device side as described above.
The technical scheme adopted by the invention also comprises the following steps:
there is provided a bluetooth system comprising a first bluetooth device, and a second bluetooth device, wherein,
The first Bluetooth device comprises a Bluetooth module, an out-of-band communication module, a processor and a computer readable storage medium, wherein a Bluetooth connection program is stored in the computer readable storage medium, and the Bluetooth connection program realizes the Bluetooth connection method applied to the main device side when being executed by the processor;
the second Bluetooth device comprises a Bluetooth module, an out-of-band communication module, a processor and a computer readable storage medium, wherein the computer readable storage medium is stored with a Bluetooth connection program, and the Bluetooth connection program realizes the Bluetooth connection method applied to the slave device side when being executed by the processor;
or alternatively, the first and second heat exchangers may be,
there is provided a bluetooth system comprising a first bluetooth device comprising a bluetooth connection means as described above applied to a master device side, and a second bluetooth device comprising a bluetooth connection means as described above applied to a slave device side.
According to the Bluetooth connection method, the Bluetooth connection device, the Bluetooth equipment and the Bluetooth system, firstly, the Bluetooth address and the clock of the Bluetooth equipment are acquired in an out-of-band communication mode, so that the master Bluetooth equipment and the slave Bluetooth equipment adopt the same frequency hopping sequence for frequency hopping; meanwhile, the first packet communication time, namely the inquiry time, is agreed, so that the master-slave equipment can conveniently and accurately confirm the interaction of the master-slave equipment and the first packet communication on the same frequency hopping frequency, namely the phase synchronization is directly carried out by taking the first packet communication on the basic frequency hopping channel, the traditional inquiry and paging processes are saved, the time required for establishing the Bluetooth connection is shortened, and the efficiency of establishing the Bluetooth connection is improved.
Drawings
Hereinafter, preferred embodiments of a bluetooth connection method, a bluetooth connection apparatus, a bluetooth device, and a bluetooth system according to the present invention will be described with reference to the accompanying drawings. In the figure:
fig. 1 is a flowchart of a first preferred embodiment of a bluetooth connection method applied to a master device side according to the present invention;
fig. 2 is a flowchart of a second preferred embodiment of the bluetooth connection method applied to the master device side according to the present invention;
fig. 3 is a flowchart of a third preferred embodiment of the bluetooth connection method applied to the master device side according to the present invention;
fig. 4 is a flowchart of a first preferred embodiment of a bluetooth connection method applied to a slave device side according to the present invention;
fig. 5 is a flowchart of a second preferred embodiment of the bluetooth connection method applied to the slave device side according to the present invention;
fig. 6 is a schematic block diagram of a bluetooth connection device applied to a master device side according to the present invention;
fig. 7 is a schematic block diagram of a bluetooth connection apparatus applied to a slave device side according to the present invention;
fig. 8 is a flow chart of a preferred embodiment of a bluetooth system according to the present invention.
Detailed Description
Aiming at the technical problem of low efficiency of establishing Bluetooth connection between master and slave Bluetooth devices in the prior art, the invention provides a Bluetooth connection method and device, a Bluetooth device and a Bluetooth system.
Referring to fig. 1, fig. 1 is a flowchart of a first preferred embodiment of a bluetooth connection method applied to a master device according to the present invention, where the bluetooth connection method includes:
step 101: the first Bluetooth device enables out-of-band communication and establishes out-of-band communication connection with the second Bluetooth device;
the interface for establishing connection out-of-band communication between the first Bluetooth device and the second Bluetooth device can be in a wired mode or a wireless mode, and the communication interface adopted in the wired mode comprises a serial port, a single bus interface, an IIC interface and the like. The wireless system may be infrared wireless communication, or contactless communication such as NFC. It will be appreciated that the establishment of out-of-band communications and transmission of information, in accordance with the purposes of the present invention, should be less time consuming and more reliable than conventional bluetooth inquiry, inquiry scan, page and page scan.
Step 102: the first Bluetooth device sends a Bluetooth address, a local clock and a contracted inquiry time T of the first Bluetooth device to the second Bluetooth device by adopting out-of-band communication;
the bluetooth address and local clock may be used to generate the hopping sequence, for example figure 2.12, which may be referred to the bluetooth specification version 5.0, volume 2, section B (BLUETOOTH SPECIFICATION Version 5.0.0|vol 2, part B) page 374. The first Bluetooth device sends the Bluetooth address and the local clock to the second Bluetooth device, so that the second Bluetooth device can calculate clock offset conveniently, and the second Bluetooth device can generate the same frequency hopping sequence as the first Bluetooth device conveniently. The appointed inquiry time T is the first packet communication time of the master and slave Bluetooth devices, and corresponds to a specific communication frequency point of a specific frequency hopping sequence.
Step 103: the first Bluetooth device configures a current frequency hopping sequence according to a Bluetooth address and a local clock of the first Bluetooth device;
the first Bluetooth device generates a frequency hopping sequence according to the Bluetooth address of the first Bluetooth device and a local clock, and determines the frequency point of the first packet communication by combining the appointed inquiry time T.
Step 104: and the first Bluetooth device performs first packet communication with the second Bluetooth device by adopting a frequency point corresponding to the appointed inquiry moment T in the frequency hopping sequence.
The local clock synchronization is a rough synchronization, and the purpose of the first packet communication is to perform phase alignment, so as to establish more accurate synchronization. The first packet communication is interactive acknowledgement on the same frequency hopping frequency.
Step 105: the first Bluetooth device establishes Bluetooth connection with the second Bluetooth device after the first Bluetooth device successfully communicates with the first Bluetooth device
And if the first Bluetooth device and the second Bluetooth device successfully carry out first packet communication, indicating that the phases are aligned and the condition of establishing Bluetooth communication connection is met. Thus, a HOST layer link (A2 DP, HFP, etc.) can be established between the first Bluetooth device and the second Bluetooth device, bluetooth data transmission is performed, and functions such as music playing are performed. In a specific scenario, the bluetooth headset is charged with the notebook computer through a wired connection, and the notebook computer is provided with a bluetooth communication module, so that when the bluetooth connection between the bluetooth headset and the notebook computer needs to be established, the out-of-band transmission as described in step 102 can be realized through the wired connection, and then steps 103-105 are performed, so that the bluetooth connection can be established more quickly.
Further, when the first bluetooth device sends the bluetooth address of the first bluetooth device to the second bluetooth device by using out-of-band communication, the local clock value of the first bluetooth device is a synchronization time CLKN (sync), and the appointed inquiry time T is delayed by a plurality of bluetooth clock minimum timing units on the basis of the synchronization time CLKN (sync).
In this embodiment, the local clock of the first bluetooth device is set to delay the appointed inquiry time, so that the time window of the second bluetooth device for performing first packet communication is enlarged, the second bluetooth device has enough time to open the scanning window in advance, the probability of aligning phases of the second bluetooth device is improved, and the master bluetooth device and the slave bluetooth device are prevented from losing synchronization. Since the bluetooth devices between the first bluetooth device and the second bluetooth device are not precisely synchronized before step 105, and the accuracy of CLKN (sync) is typically only 312.5 μs, an error of maximum plus or minus 312.5 μs may occur between the first bluetooth device and the second bluetooth device, and there is a certain delay in transmitting and receiving data of different out-of-band communications, so it is preferable that the agreed inquiry time t=clkn (sync) + (CLKN (sync)% 2+2n) ×t unit Wherein, "%" is the remainder operator, T unit A Bluetooth clock minimum timing unit; if CLKN (sync)% 2= 0, n=2, and if CLKN (sync)% 2= 1, n=1.
Further, referring to fig. 2, fig. 2 is a flowchart of a second preferred embodiment of the bluetooth connection method applied to the master device side according to the present invention;
the step 104 specifically includes:
step 104a: the first Bluetooth device sends an inquiry packet to the second Bluetooth device by adopting a frequency point corresponding to the appointed inquiry time T in the frequency hopping sequence;
the stage of this step may be referred to by way of example as "step 5" of figure8.3 on page 451 of the Bluetooth specification, section 5.0, volume 2, section B (BLUETOOTH SPECIFICATION Version.0.sub.Vol 2). The bluetooth connection method of the present embodiment omits inquiry, inquiry scan, page and page scan, and specifically, steps 1 to 4 in fig. 8.3 may be omitted. Preferably, the query Packet may be "POLL Packet", but not limited thereto, and other packets with acknowledgement mechanism may be used as long as they can mutually receive the data packets of the other party. The POLL Packet has no Payload, but requires acknowledgement from the receiving end. In this step, the first bluetooth device directly transmits an inquiry packet for the first packet communication on the basic frequency hopping channel.
Step 104b: the first Bluetooth device judges whether a response packet of the second Bluetooth device for confirming the inquiry packet is received or not;
the second bluetooth device replies with a response packet immediately after receiving the inquiry packet, and it will be appreciated that in this process, the second bluetooth device will open a corresponding scanning window using the agreed inquiry time T. Preferably, the response Packet may be "NULL Packet", but is not limited thereto, and other packets having acknowledgement mechanisms may be used as long as they can mutually receive the data packets of the other parties. NULL Packet has no Payload, only Access Code (CAC) and Header, fixed length 126bits, for returning link information to the sender through fields such as ARQN, FLOW, etc.; NULL Packet does not require acknowledgement. In this step, the first bluetooth device determines whether a response packet for confirmation is received in order to confirm whether the phases have been aligned.
Step 104c: the first Bluetooth device confirms that the first packet communication is successful when receiving the response packet; the first Bluetooth device receives the response packet of the second Bluetooth device, and indicates that the phases are aligned and the condition for establishing the Bluetooth communication connection is met.
The Bluetooth connection method further comprises the following steps:
Step 106: the first bluetooth device jumps to step 102 when the response packet is not received.
In this embodiment, by setting the step of skipping 107, even in an extreme case, when the first bluetooth device does not receive the response packet, the step of restarting the transmission for generating the same frequency-hopping sequence and prescribing the inquiry time T can be performed, so as to ensure the reliability of the bluetooth connection.
Further, referring to fig. 3, fig. 3 is a flowchart of a third preferred embodiment of the bluetooth connection method applied to the master device side according to the present invention; the Bluetooth connection method further comprises the following steps:
step 107: and after the first Bluetooth device establishes Bluetooth connection with the second Bluetooth device, the first Bluetooth device disconnects out-of-band communication connection with the second Bluetooth device.
In this embodiment, after the bluetooth connection is established, the bluetooth connection between the first bluetooth device and other bluetooth devices may be conveniently established in the same manner by disconnecting the out-of-band communication connection, so that the out-of-band communication is disconnected in time, and the energy consumption and the operand of the processor may be reduced. The way of breaking the out-of-band communication may be program controlled or may be implemented by mechanical plug-and-pull, for example in case of implementing the out-of-band communication by means of a wired connection.
The technical scheme adopted by the invention also comprises the following steps:
referring to fig. 4, fig. 4 is a flowchart of a first preferred embodiment of a bluetooth connection method applied to a slave device according to the present invention, where the bluetooth connection method includes:
step 601: the second Bluetooth device enables out-of-band communication and establishes out-of-band communication connection with the first Bluetooth device;
the interface for establishing connection out-of-band communication between the first Bluetooth device and the second Bluetooth device can be in a wired mode or a wireless mode, and the communication interface adopted in the wired mode comprises a serial port, a single bus interface, an IIC interface and the like. The wireless system may be infrared wireless communication, or contactless communication such as NFC. It will be appreciated that the establishment of out-of-band communications and transmission of information, in accordance with the purposes of the present invention, should be less time consuming and more reliable than conventional bluetooth inquiry, inquiry scan, page and page scan.
Step 602: the second Bluetooth device receives the Bluetooth address, the local clock and the appointed inquiry time T of the first Bluetooth device sent by the first Bluetooth device by adopting out-of-band communication;
the bluetooth address and the local clock can be used to generate a hopping sequence, for example figure 2.12, which can be referred to page BLUETOOTH SPECIFICATION Version 5.0|Vol 2,Part B,page 374. The first Bluetooth device sends the Bluetooth address and the local clock to the second Bluetooth device, so that the second Bluetooth device can calculate clock offset conveniently, and the second Bluetooth device can generate the same frequency hopping sequence as the first Bluetooth device conveniently. The appointed inquiry time T is the time when the master-slave Bluetooth equipment performs first packet communication, and meanwhile, the appointed inquiry time T corresponds to a specific communication frequency point of a specific frequency hopping sequence.
Step 603: the second Bluetooth device configures a current frequency hopping sequence according to the local clock, the offset of the local clock relative to the local clock of the first Bluetooth device and the Bluetooth address of the first Bluetooth device;
in this step, the second bluetooth device may generate a frequency hopping sequence that is consistent with the frequency hopping sequence of the first bluetooth device.
Step 604: and the second Bluetooth device starts a scanning window by taking the appointed inquiry time T as a reference, and performs first packet communication with the first Bluetooth device by adopting a frequency point corresponding to the appointed inquiry time T in the frequency hopping sequence.
The local clock synchronization is a rough synchronization, and the purpose of the first packet communication is to perform phase alignment, so as to establish more accurate synchronization. The first packet communication is interactive acknowledgement on the same frequency hopping frequency.
Step 605: the second Bluetooth device establishes Bluetooth connection with the first Bluetooth device when the first Bluetooth device receives the response packet;
and if the first packet communication between the first Bluetooth device and the second Bluetooth device is successful, indicating that the phases are aligned and the condition of establishing the Bluetooth communication connection is met. Thus, a HOST layer link (A2 DP, HFP, etc.) can be established between the first Bluetooth device and the second Bluetooth device, bluetooth data transmission is performed, and functions such as music playing are performed.
Further, the scanning window is [ T- (T) uni t+|Δt|),T+(T unit +|Δt|)]Wherein, T is the inquiry time, T unit For the minimum timing unit of the bluetooth clock, it can be understood that i Δt is a compensation amount considering the out-of-band communication delay. By expanding the time window of the second Bluetooth device for first packet communication, the second Bluetooth device has enough time to start the scanning window in advance, so that the probability of aligning phases of the second Bluetooth device is improved, and the master-slave Bluetooth devices are prevented from losing synchronization. Similarly, consider that the clock accuracy is only 312.5 μs, and that out-of-band communicationThe time delay may cause clock errors, and the scanning window size is preferably 625-1250 mus.
Further, referring to fig. 5, fig. 5 is a flowchart of a second preferred embodiment of the bluetooth connection method applied to the slave device side according to the present invention, and the step 604 specifically includes:
step 604a: the second Bluetooth device starts a scanning window by taking the appointed inquiry time T as a reference, and receives an inquiry packet sent by the first Bluetooth device by adopting a frequency point corresponding to the appointed inquiry time T in the frequency hopping sequence;
since the first bluetooth device and the second bluetooth device generate consistent frequency hopping sequences, the second bluetooth device can scan the inquiry packet by using a frequency point consistent with the transmission frequency point of the first bluetooth device. Preferably, the query Packet may be "POLL Packet", but not limited thereto, and other packets with acknowledgement mechanism may be used as long as they can mutually receive the data packets of the other party. The POLL Packet has no Payload, but requires acknowledgement from the receiving end.
Step 604b: the second Bluetooth device judges whether an inquiry packet sent by the first Bluetooth device is received or not;
the setting of the step is beneficial to triggering the subsequent steps in time.
Step 604c: the second Bluetooth device replies a response packet for confirming the inquiry packet to the first Bluetooth device when receiving the inquiry packet sent by the first Bluetooth device;
the stage of this step may be referred to by way of example as "step 6" of figure8.3 on page 451 of the Bluetooth specification, section 5.0, volume 2, section B (BLUETOOTH SPECIFICATION Version.0.sub.Vol 2). The second bluetooth device replies with a response packet immediately after receiving the inquiry packet, and it will be appreciated that in this process, the second bluetooth device will open a corresponding scanning window using the agreed inquiry time T. Preferably, the response Packet may be "NULL Packet", but is not limited thereto, and other packets having acknowledgement mechanisms may be used as long as they can mutually receive the data packets of the other parties. NULL Packet has no Payload, only Access Code (CAC) and Header, fixed length 126bits, for returning link information to the sender through fields such as ARQN, FLOW, etc.; NULL Packet does not require acknowledgement. In this step, the first bluetooth device determines whether a response packet for confirmation is received in order to confirm whether the phases have been aligned.
Step 604d: the second Bluetooth device confirms that the first packet communication is successful when the first Bluetooth device receives the response packet;
the first Bluetooth device receives the response packet of the second Bluetooth device, and indicates that the phases are aligned and the condition for establishing the Bluetooth communication connection is met. It will be appreciated that the method for determining that the first bluetooth device receives the response packet may be determined by determining whether an acknowledgement message corresponding to the response packet is received, or whether a subsequent communication handshake message is received.
The Bluetooth connection method further comprises the following steps:
step 606: the second bluetooth device jumps to step 602 when it does not receive the inquiry packet sent by the first bluetooth device.
In this embodiment, by setting the step of jumping 606, even if the first packet communication of the second bluetooth device is unsuccessful in an extreme case, the step of generating the same frequency hopping sequence and assigning the inquiry time T can be restarted, so as to ensure the reliability of the bluetooth connection.
The technical scheme adopted by the invention also comprises the following steps:
referring to fig. 6, the bluetooth connection device includes an out-of-band communication module and a bluetooth module, where the out-of-band communication module includes an out-of-band communication connection unit and an out-of-band information sending unit; the Bluetooth module comprises a frequency hopping configuration unit, a first packet communication unit and a Bluetooth communication connection unit, wherein,
The out-of-band communication connection unit is used for establishing out-of-band communication connection with the Bluetooth connection device of the slave device side when the Bluetooth connection with the Bluetooth connection device of the slave device side is required to be established;
the interface for establishing connection out-of-band communication between the Bluetooth connection devices on the master device side and the slave device side can be in a wired mode or a wireless mode, and the communication interface adopted in the wired mode comprises a serial port, a single bus interface, an IIC interface and the like. The wireless system may be infrared wireless communication, or contactless communication such as NFC. It will be appreciated that the establishment of out-of-band communications and transmission of information, in accordance with the purposes of the present invention, should be less time consuming and more reliable than conventional bluetooth inquiry, inquiry scan, page and page scan.
The out-of-band information sending unit is used for sending the Bluetooth address of the Bluetooth connecting device at the side of the main equipment, the local clock and the appointed inquiry time T to the Bluetooth connecting device at the side of the auxiliary equipment by adopting out-of-band communication;
the bluetooth address and local clock may be used to generate the hopping sequence, for example figure 2.12, which may be referred to the bluetooth specification version 5.0, volume 2, section B (BLUETOOTH SPECIFICATION Version 5.0.0|vol 2, part B) page 374. The Bluetooth connection device at the side of the main equipment sends the Bluetooth address and the local clock to the Bluetooth connection device at the side of the auxiliary equipment, so that the Bluetooth connection device at the side of the auxiliary equipment can conveniently calculate clock offset, and the Bluetooth connection device at the side of the auxiliary equipment can conveniently generate the same frequency hopping sequence as the Bluetooth connection device at the side of the main equipment. The appointed inquiry time T is the time when the master-slave Bluetooth equipment performs first packet communication, and meanwhile, the appointed inquiry time T corresponds to a specific communication frequency point of a specific frequency hopping sequence.
The frequency hopping configuration unit is used for configuring a current frequency hopping sequence according to the Bluetooth address of the Bluetooth connection device at the side and the local clock;
the frequency hopping configuration unit of the main equipment side Bluetooth connection device generates a frequency hopping sequence according to the Bluetooth address of the side Bluetooth connection device and a local clock, and determines the frequency point of the first packet communication by combining the appointed inquiry time T.
The first packet communication unit is used for carrying out first packet communication with the Bluetooth connection device at the slave device side by adopting a frequency point corresponding to the appointed inquiry time T in the frequency hopping sequence.
The local clock synchronization is a rough synchronization, and the purpose of the first packet communication is to perform phase alignment, so as to establish more accurate synchronization. The first packet communication is interactive acknowledgement on the same frequency hopping frequency.
The Bluetooth communication connection unit is used for establishing Bluetooth connection with the Bluetooth connection device at the slave device side after the first packet communication is successful.
And if the first packet communication between the Bluetooth connection device at the master equipment side and the Bluetooth connection device at the slave equipment side is successful, the alignment phase is indicated, and the condition of establishing the Bluetooth communication connection is provided. So far, a HOST layer link (A2 DP, HFP, etc.) can be established between the Bluetooth connection devices at the master device side and the slave device side, and functions such as Bluetooth data transmission, music playing, etc. can be performed.
Regarding the preferred appointed time, when the out-of-band communication connection unit sends the bluetooth address of the first bluetooth device to the second bluetooth device by adopting out-of-band communication, the local clock value of the first bluetooth device is set as a synchronization time CLKN (sync), and then the appointed inquiry time T is delayed by a plurality of bluetooth clock minimum timing units on the basis of the synchronization time CLKN (sync). Further, the contracted inquiry time t=clkn (sync) + (CLKN (sync)% 2+2n) ×t unit Wherein, "%" is the remainder operator, T unit The minimum timing unit of the Bluetooth clock; if CLKN (sync)% 2= 0, n=2, and if CLKN (sync)% 2= 1, n=1.
Further, the first packet communication unit comprises an inquiry unit and a packet receiving confirmation unit, wherein,
the inquiry unit is used for sending an inquiry packet to the Bluetooth connection device at the slave device side by adopting a frequency point corresponding to the appointed inquiry time T in the frequency hopping sequence;
the function of the interrogation unit may be referred to by way of example as "step 5" of figure8.3 of page 451 of the Bluetooth specification, section 5.0, volume 2, section B (BLUETOOTH SPECIFICATION Version 5.0.0.|Vol 2). The bluetooth connection device of the present embodiment omits inquiry, inquiry scan, page and page scan, and specifically, steps 1 to 4 in fig. 8.3 may be omitted. Preferably, the query Packet may be "POLL Packet", but not limited thereto, and other packets with acknowledgement mechanism may be used as long as they can mutually receive the data packets of the other party. The POLL Packet has no Payload, but requires acknowledgement from the receiving end. By means of the interrogation unit, the first bluetooth connection device can send an interrogation packet for the first packet communication directly on the basic frequency hopping channel.
The packet receiving confirmation unit is used for judging whether a response packet for confirming the inquiry packet of the Bluetooth connection device at the slave equipment side is received or not;
the bluetooth connection device at the slave device side immediately replies a response packet after receiving the inquiry packet, and it can be understood that the bluetooth connection device at the slave device side opens a corresponding scanning window by using the agreed inquiry time T in the process. Preferably, the response Packet may be "NULL Packet", but is not limited thereto, and other packets having acknowledgement mechanisms may be used as long as they can mutually receive the data packets of the other parties. NULL Packet has no Payload, only Access Code (CAC) and Header, fixed length 126bits, for returning link information to the sender through fields such as ARQN, FLOW, etc.; NULL Packet does not require acknowledgement. In this step, the bluetooth connection means at the master device side determines whether a response packet for confirmation is received in order to confirm whether the phases have been aligned.
The out-of-band information sending unit is further configured to send, to the bluetooth connection device on the slave device side, the bluetooth address of the bluetooth connection device on the master device side, the local clock, and the contracted inquiry time T by using out-of-band communication again when the packet receiving confirmation unit determines that the response packet is not received.
In this embodiment, by setting the packet reception confirmation unit, the feedback monitoring can be performed on the bluetooth connection device on the slave device side, so that, for example, even in an extreme case, when the bluetooth connection device on the master device side does not receive the response packet, the step of generating the same frequency hopping sequence and assigning the inquiry time T can be restarted, thereby ensuring the reliability of the bluetooth connection.
Further, the out-of-band communication unit is further configured to disconnect the out-of-band communication connection with the slave device side bluetooth connection device after the bluetooth communication connection unit establishes a bluetooth connection with the slave device side bluetooth connection device.
In this embodiment, after the bluetooth connection is established, the bluetooth connection device on the side of the master device and the bluetooth connection devices on the side of other slave devices can be conveniently established in the same manner by disconnecting the out-of-band communication, so that the out-of-band communication is disconnected in time, and the energy consumption and the operation amount of the processor can be reduced. The way of breaking the out-of-band communication may be program controlled or may be implemented by mechanical plug-and-pull, for example in case of implementing the out-of-band communication by means of a wired connection.
The technical scheme adopted by the invention also comprises the following steps:
Referring to fig. 7, the bluetooth connection device includes an out-of-band communication module and a bluetooth module, where the out-of-band communication module includes an out-of-band communication connection unit and an out-of-band information receiving unit; the Bluetooth module comprises the frequency hopping configuration unit, a first packet communication unit and a Bluetooth communication connection unit, wherein
The out-of-band communication connection unit is used for establishing out-of-band communication connection with the Bluetooth connection device on the side of the main equipment when the Bluetooth connection with the Bluetooth connection device on the side of the main equipment is required to be established;
the interface for establishing connection out-of-band communication between the Bluetooth connection devices on the master device side and the slave device side can be in a wired mode or a wireless mode, and the communication interface adopted in the wired mode comprises a window, a single bus serial port, an IIC interface and the like. The wireless system may be a non-contact communication such as infrared wireless communication or NFC. It will be appreciated that the establishment of out-of-band communications and transmission of information, in accordance with the purposes of the present invention, should be less time consuming and more reliable than conventional bluetooth inquiry, inquiry scan, page and page scan.
The out-of-band information receiving unit is used for receiving a Bluetooth address, a local clock and a contracted inquiry time T of the Bluetooth connecting device at the side of the main equipment, which are sent by the Bluetooth connecting device at the side of the main equipment, by adopting out-of-band communication;
The bluetooth address and local clock may be used to generate the hopping sequence, for example figure 2.12, page 374, which may be referred to the bluetooth specification version 5.0, volume 2, section B (BLUETOOTH SPECIFICATION Version 5.0.0|vol 2, part B). The Bluetooth connection device at the side of the main equipment sends the Bluetooth address and the local clock to the Bluetooth connection device at the side of the auxiliary equipment, so that the Bluetooth connection device at the side of the auxiliary equipment can conveniently calculate clock offset, and the Bluetooth connection device at the side of the auxiliary equipment can conveniently generate the same frequency hopping sequence as the Bluetooth connection device at the side of the main equipment. The appointed inquiry time T is the time when the master-slave Bluetooth equipment performs first packet communication, and meanwhile, the appointed inquiry time T corresponds to a specific communication frequency point of a specific frequency hopping sequence.
The frequency hopping configuration unit is used for configuring a current frequency hopping sequence according to the local clock of the Bluetooth connection device at the side of the slave device, the offset of the local clock relative to the local clock of the Bluetooth connection device at the side of the master device and the Bluetooth address of the Bluetooth connection device at the side of the master device, so that the Bluetooth connection device at the side of the slave device can generate the frequency hopping sequence consistent with the frequency hopping sequence of the Bluetooth connection device at the side of the master device.
The first packet communication unit is used for starting a scanning window by taking the appointed inquiry time T as a reference, and carrying out first packet communication with the Bluetooth connection device at the main equipment side by adopting a frequency point corresponding to the appointed inquiry time T in the frequency hopping sequence.
The local clock synchronization is a rough synchronization, and the purpose of the first packet communication is to perform phase alignment, so as to establish more accurate synchronization. The first packet communication is interactive acknowledgement on the same frequency hopping frequency.
The Bluetooth communication connection unit is used for establishing Bluetooth connection with the Bluetooth connection device at the side of the main equipment when the Bluetooth connection device at the side of the main equipment receives the response packet.
The successful communication of the first packet between the master device side bluetooth connection device and the slave device side bluetooth connection device means that the phases are aligned and the bluetooth communication is successfully established. So far, a HOST layer link (A2 DP, HFP and the like) can be established between the Bluetooth connection devices at the master device side and the slave device side, bluetooth data transmission is carried out, and functions such as music playing and the like are carried out.
Further, the first packet communication unit includes: a scanning unit, a packet receiving confirmation unit and a response unit, wherein,
the scanning unit starts a scanning window by taking the appointed inquiry time T as a reference, and receives an inquiry packet sent by a main equipment side Bluetooth connection device by adopting a frequency point corresponding to the appointed inquiry time T in the frequency hopping sequence;
the Bluetooth connection device at the side of the master device and the Bluetooth connection device at the side of the slave device generate consistent frequency hopping sequences, and the Bluetooth connection device at the side of the slave device can scan the inquiry packet by adopting the frequency point consistent with the transmission frequency point of the Bluetooth connection device at the side of the master device. However, since the two connection devices are not completely aligned, a larger scan window needs to be opened to increase the probability of hitting the query packet. Preferably, the query Packet may be "POLL Packet", but not limited thereto, and other packets with acknowledgement mechanism may be used as long as they can mutually receive the data packets of the other party. The POLL Packet has no Payload, but requires acknowledgement from the receiving end.
Regarding the setting of the scanning window, it is preferable that the scanning window is [ T- (T) unit +|Δt|),T+(T unit +|Δt|)]Wherein T is the appointed inquiry time, T unit For the minimum timing unit of the bluetooth clock, it can be understood that i Δt is a compensation amount considering the out-of-band communication delay. The time window for receiving the query packet by the radio frequency of the second Bluetooth device is enlarged, and the second Bluetooth device has enough time to start the scanning window in advance, so that the probability of the second Bluetooth device hitting the query packet is improved, and the master and slave Bluetooth devices are prevented from losing synchronization. Similarly, the scan window size is preferably 625 μs to 1250 μs, considering that the accuracy of the clock is only 312.5 μs, and that the delay of out-of-band communications may result in clock errors.
The packet receiving confirmation unit is used for judging whether an inquiry packet sent by the Bluetooth connection device at the main equipment side is received or not; and the unit or the module action which is favorable for timely triggering the response is monitored whether the inquiry package is received or not by arranging the package receiving confirmation unit.
The response unit is used for replying a response packet for confirming the inquiry packet to the Bluetooth connection device at the main equipment side when receiving the inquiry packet sent by the Bluetooth connection device at the main equipment side;
The stage of this step may be referred to by way of example as "step 6" of figure8.3 on page 451 of the Bluetooth specification, section 5.0, volume 2, section B (BLUETOOTH SPECIFICATION Version.0.sub.Vol 2). The bluetooth connection device at the slave device side immediately replies with a response packet after receiving the inquiry packet, and it is understood that in this process, the bluetooth connection device at the slave device side will open a corresponding scanning window by using the agreed inquiry time T. Preferably, the response Packet may be "NULL Packet", but is not limited thereto, and other packets having acknowledgement mechanisms may be used as long as they can mutually receive the data packets of the other parties. NULL Packet has no Payload, only Access Code (CAC) and Header, fixed length 126bits, for returning link information to the sender through fields such as ARQN, FLOW, etc.; NULL Packet does not require acknowledgement. In this step, the bluetooth connection means at the master device side determines whether a response packet for confirmation is received in order to confirm whether the phases have been aligned.
The out-of-band communication connection unit is further configured to receive, by using out-of-band communication, the bluetooth address of the bluetooth connection device on the side of the primary device, the local clock, and the contracted query time T, which are sent by the first bluetooth device, when the packet receiving confirmation unit determines that the query packet sent by the bluetooth connection device on the side of the primary device is not received.
In this embodiment, by setting a condition for triggering the out-of-band communication connection unit again, that is, when the second bluetooth device does not receive the inquiry packet, the out-of-band communication connection unit may restart sending the action for generating the same frequency hopping sequence and agreeing with the inquiry time T under the condition that phase synchronization fails, so as to ensure reliability of bluetooth connection.
The technical scheme adopted by the invention also comprises the following steps:
there is provided a bluetooth device including a bluetooth module, an out-of-band communication module, a processor, and a computer readable storage medium having stored thereon a bluetooth connection program which, when executed by the processor, implements the bluetooth connection method applied to a main device side as described above. The bluetooth device adopts all the technical schemes of all the embodiments, so that the bluetooth device has at least all the beneficial effects brought by the technical schemes of the embodiments, and is not described in detail herein.
The technical scheme adopted by the invention also comprises the following steps:
there is provided a bluetooth device including a bluetooth module, an out-of-band communication module, a processor, and a computer readable storage medium having stored thereon a bluetooth connection program which, when executed by the processor, implements the bluetooth connection method applied to a slave device side as described above. The bluetooth device adopts all the technical schemes of all the embodiments, so that the bluetooth device has at least all the beneficial effects brought by the technical schemes of the embodiments, and is not described in detail herein.
The technical scheme adopted by the invention also comprises the following steps:
there is provided a bluetooth system, please refer to fig. 8, which includes a first bluetooth device, and a second bluetooth device, wherein,
the first Bluetooth device comprises a Bluetooth module, an out-of-band communication module, a processor and a computer readable storage medium, wherein a Bluetooth connection program is stored in the computer readable storage medium, and the Bluetooth connection program realizes the Bluetooth connection method applied to the main device side when being executed by the processor;
the second bluetooth device includes a bluetooth module, an out-of-band communication module, a processor, and a computer readable storage medium, on which a bluetooth connection program is stored, which when executed by the processor implements the bluetooth connection method applied to the slave device side as described above.
Or alternatively, the first and second heat exchangers may be,
there is provided a bluetooth system comprising a first bluetooth device comprising a bluetooth connection means as described above applied to a master device side, and a second bluetooth device comprising a bluetooth connection means as described above applied to a slave device side.
The bluetooth system adopts all the technical schemes of all the embodiments, so that the bluetooth system has at least all the beneficial effects brought by the technical schemes of the embodiments, and is not described in detail herein.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) as described above, comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present invention.
Those skilled in the art will appreciate that the above-described preferred embodiments can be freely combined and stacked without conflict.
It will be understood that the above-described embodiments are merely illustrative and not restrictive, and that all obvious or equivalent modifications and substitutions to the details given above may be made by those skilled in the art without departing from the underlying principles of the invention, are intended to be included within the scope of the appended claims.

Claims (15)

1. A bluetooth connection method applied to a main device side, the method comprising:
step 101: the first Bluetooth device enables out-of-band communication and establishes out-of-band communication connection with the second Bluetooth device;
step 102: the first Bluetooth device sends a Bluetooth address, a local clock and a contracted inquiry time T of the first Bluetooth device to the second Bluetooth device by adopting out-of-band communication;
step 103: the first Bluetooth device configures a current frequency hopping sequence according to a Bluetooth address and a local clock of the first Bluetooth device;
step 104: the first Bluetooth device performs first packet communication with the second Bluetooth device by adopting a frequency point corresponding to the appointed inquiry moment T in the frequency hopping sequence;
Step 105: the first Bluetooth device establishes Bluetooth connection with the second Bluetooth device after the first Bluetooth device successfully communicates with the first Bluetooth device;
the first Bluetooth device sends a Bluetooth address of the first Bluetooth device to the second Bluetooth device by out-of-band communication, wherein the local clock value of the first Bluetooth device is a synchronization time CLKN (sync), and the appointed inquiry time T is delayed by a plurality of Bluetooth clock minimum timing units on the basis of the synchronization time CLKN (sync);
wherein the contracted inquiry time T=CLKN (sync) + (CLKN (sync)% 2+2n) ×T unit Wherein, the method comprises the steps of, wherein,
"%" is the remainder operator, T unit The minimum timing unit of the Bluetooth clock; if CLKN (sync)% 2= 0, n=2, and if CLKN (sync)% 2= 1, n=1.
2. The Bluetooth connection method of claim 1, wherein the Bluetooth connection method further comprises the step of,
the step 104 specifically includes:
step 104a: the first Bluetooth device sends an inquiry packet to the second Bluetooth device by adopting a frequency point corresponding to the appointed inquiry time T in the frequency hopping sequence;
step 104b: the first Bluetooth device judges whether a response packet of the second Bluetooth device for confirming the inquiry packet is received or not;
step 104c: the first Bluetooth device confirms that the first packet communication is successful when receiving the response packet;
The Bluetooth connection method further comprises the following steps:
step 106: the first bluetooth device jumps to step 102 when the response packet is not received.
3. The bluetooth connection method according to claim 1 or 2, further comprising:
step 107: and after the first Bluetooth device establishes Bluetooth connection with the second Bluetooth device, the first Bluetooth device disconnects out-of-band communication connection with the second Bluetooth device.
4. A bluetooth connection method applied to a slave device side, the method comprising:
step 601: the second Bluetooth device enables out-of-band communication and establishes out-of-band communication connection with the first Bluetooth device;
step 602: the second Bluetooth device receives the Bluetooth address, the local clock and the appointed inquiry time T of the first Bluetooth device sent by the first Bluetooth device by adopting out-of-band communication;
step 603: the second Bluetooth device configures a current frequency hopping sequence according to a local clock, an offset of the local clock relative to the local clock of the first Bluetooth device and a Bluetooth address of the first Bluetooth device;
step 604: the second Bluetooth device starts a scanning window by taking the appointed inquiry time T as a reference, and performs first packet communication with the first Bluetooth device by adopting a frequency point corresponding to the appointed inquiry time T in the frequency hopping sequence;
Step 605: the second Bluetooth device establishes Bluetooth connection with the first Bluetooth device after the first packet communication is successful;
the second Bluetooth device receives the Bluetooth address of the first Bluetooth device sent by the first Bluetooth device through out-of-band communication, wherein the local clock value of the first Bluetooth device is a synchronization time CLKN (sync), and the appointed inquiry time T is delayed by a plurality of Bluetooth clock minimum timing units on the basis of the synchronization time CLKN (sync);
wherein the contracted inquiry time T=CLKN (sync) + (CLKN (sync)% 2+2n) ×T unit Wherein, the method comprises the steps of, wherein,
"%" is the remainder operator, T unit The minimum timing unit of the Bluetooth clock; if CLKN (sync)% 2= 0, n=2, and if CLKN (sync)% 2= 1, n=1.
5. The bluetooth connection method according to claim 4, wherein the scanning window is
[T-(T unit +|Δt|),T+(T unit +|Δt|)]Wherein T is the appointed inquiry time, T unit For the minimum timing unit of the bluetooth clock, |Δt| is a compensation amount considering out-of-band communication delay.
6. The bluetooth connection method according to claim 5, wherein the scanning window size is 625 μs to 1250 μs.
7. The method for bluetooth connection according to any of the claims 4-6, wherein,
The step 604 specifically includes:
step 604a: the second Bluetooth device starts a scanning window by taking the appointed inquiry time T as a reference, and receives an inquiry packet sent by the first Bluetooth device by adopting a frequency point corresponding to the appointed inquiry time T in the frequency hopping sequence;
step 604b: the second Bluetooth device judges whether an inquiry packet sent by the first Bluetooth device is received or not;
step 604c: the second Bluetooth device replies a response packet for confirming the inquiry packet to the first Bluetooth device when receiving the inquiry packet sent by the first Bluetooth device;
step 604d: the second Bluetooth device confirms that the first packet communication is successful when the first Bluetooth device receives the response packet;
the Bluetooth connection method further comprises the following steps:
step 606: the second bluetooth device jumps to step 602 when it does not receive the inquiry packet sent by the first bluetooth device.
8. A Bluetooth connection device is applied to a main device side, and is characterized in that,
the Bluetooth connection device comprises an out-of-band communication module and a Bluetooth module, wherein the out-of-band communication module comprises an out-of-band communication connection unit and an out-of-band information sending unit; the Bluetooth module comprises a frequency hopping configuration unit, a first packet communication unit and a Bluetooth communication connection unit, wherein,
The out-of-band communication connection unit is used for establishing out-of-band communication connection with the Bluetooth connection device of the slave device side when the Bluetooth connection with the Bluetooth connection device of the slave device side is required to be established;
the out-of-band information sending unit is used for sending the Bluetooth address of the Bluetooth connecting device at the side of the main equipment, the local clock and the appointed inquiry time T to the Bluetooth connecting device at the side of the auxiliary equipment by adopting out-of-band communication;
the frequency hopping configuration unit is used for configuring a current frequency hopping sequence according to the Bluetooth address of the Bluetooth connection device at the side and the local clock;
the first packet communication unit is used for carrying out first packet communication with the Bluetooth connection device at the slave device side by adopting a frequency point corresponding to the appointed inquiry moment T in the frequency hopping sequence;
the Bluetooth communication connection unit is used for establishing Bluetooth connection with a Bluetooth connection device at the slave equipment side after the first packet communication is successful;
the out-of-band information sending unit sends a Bluetooth address of a Bluetooth connecting device at a main device side to the Bluetooth connecting device at a slave device side by adopting out-of-band communication, wherein the local clock value of the Bluetooth connecting device at the main device is a synchronization time CLKN (sync), and the appointed inquiry time T is delayed by a plurality of Bluetooth clock minimum timing units on the basis of the synchronization time CLKN (sync);
Wherein the contracted inquiry time t=clkn (sync) + (CLKN (sy)nc)%2+2n)*T unit Wherein, the method comprises the steps of, wherein,
"%" is the remainder operator, T unit The minimum timing unit of the Bluetooth clock; if CLKN (sync)% 2= 0, n=2, and if CLKN (sync)% 2= 1, n=1.
9. The Bluetooth connection apparatus of claim 8, wherein,
the first packet communication unit comprises an inquiry unit and a packet receiving confirmation unit, wherein,
the inquiry unit is used for sending an inquiry packet to the Bluetooth connection device at the slave device side by adopting a frequency point corresponding to the appointed inquiry time T in the frequency hopping sequence;
the packet receiving confirmation unit is used for judging whether a response packet for confirming the inquiry packet of the Bluetooth connection device at the slave equipment side is received or not;
the out-of-band information sending unit is further configured to send, to the bluetooth connection device on the slave device side, the bluetooth address of the bluetooth connection device on the master device side, the local clock, and the contracted inquiry time T by using out-of-band communication again when the packet receiving confirmation unit determines that the response packet is not received.
10. The bluetooth connection device as claimed in claim 8, wherein the out-of-band communication unit is further configured to disconnect the out-of-band communication connection with the slave device side bluetooth connection device after the bluetooth connection unit establishes a bluetooth connection with the slave device side bluetooth connection device.
11. A Bluetooth connection device is applied to a slave device side, and is characterized in that,
the Bluetooth connecting device comprises an out-of-band communication module and a Bluetooth module, wherein the out-of-band communication module comprises an out-of-band communication connecting unit and an out-of-band information receiving unit; the Bluetooth module comprises a frequency hopping configuration unit, a first packet communication unit and a Bluetooth communication connection unit, wherein
The out-of-band communication connection unit is used for establishing out-of-band communication connection with the Bluetooth connection device of the main equipment side when the Bluetooth connection with the Bluetooth connection device of the main equipment side is required to be established;
the out-of-band information receiving unit is used for receiving a Bluetooth address, a local clock and an appointed inquiry time T of the Bluetooth connecting device at the side of the main equipment by adopting out-of-band communication;
the frequency hopping configuration unit is used for configuring a current frequency hopping sequence according to a local clock of the local side Bluetooth connection device, offset of the local clock relative to the local clock of the Bluetooth connection device at the main equipment side and a Bluetooth address of the Bluetooth connection device at the main equipment side;
the first packet communication unit is used for starting a scanning window by taking the appointed inquiry time T as a reference, and carrying out first packet communication with a Bluetooth connection device at a main equipment side by adopting a frequency point corresponding to the appointed inquiry time T in the frequency hopping sequence;
The Bluetooth communication connection unit is used for establishing Bluetooth connection with the Bluetooth connection device at the side of the main equipment after the first packet communication is successful;
the out-of-band information receiving unit receives a Bluetooth address of the Bluetooth connecting device at the side of the main equipment by adopting out-of-band communication when the Bluetooth address of the Bluetooth connecting device at the side of the main equipment is sent, wherein the local clock value of the Bluetooth connecting device at the side of the main equipment is a synchronous time CLKN (sync), and the appointed inquiry time T is delayed by a plurality of Bluetooth clock minimum timing units on the basis of the synchronous time CLKN (sync);
wherein the contracted inquiry time T=CLKN (sync) + (CLKN (sync)% 2+2n) ×T unit Wherein, the method comprises the steps of, wherein,
"%" is the remainder operator, T unit The minimum timing unit of the Bluetooth clock; if CLKN (sync)% 2= 0, n=2, and if CLKN (sync)% 2= 1, n=1.
12. The Bluetooth connection apparatus of claim 11, wherein,
the first packet communication unit includes: a scanning unit, a packet receiving confirmation unit and a response unit, wherein,
the scanning unit starts a scanning window by taking the appointed inquiry time T as a reference, and receives an inquiry packet sent by a main equipment side Bluetooth connection device by adopting a frequency point corresponding to the appointed inquiry time T in the frequency hopping sequence;
The packet receiving confirmation unit is used for judging whether an inquiry packet sent by the Bluetooth connection device at the main equipment side is received or not;
the response unit is used for replying a response packet for confirming the inquiry packet to the Bluetooth connection device at the main equipment side when receiving the inquiry packet sent by the Bluetooth connection device at the main equipment side;
the out-of-band communication connection unit is further configured to receive, by using out-of-band communication, the bluetooth address of the master device side bluetooth connection device, the local clock, and the contracted query time T, which are sent by the master device side bluetooth connection device, when the packet receiving confirmation unit determines that the query packet sent by the master device side bluetooth connection device is not received.
13. A bluetooth device comprising a bluetooth module, an out-of-band communication module, a processor, and a computer readable storage medium having stored thereon a bluetooth connection program which when executed by the processor implements the bluetooth connection method according to any of claims 1-3.
14. A bluetooth device comprising a bluetooth module, an out-of-band communication module, a processor, and a computer readable storage medium having stored thereon a bluetooth connection program which when executed by the processor implements the bluetooth connection method according to any of claims 4-7.
15. A Bluetooth system is characterized in that,
the bluetooth system comprises a first bluetooth device and a second bluetooth device, wherein the first bluetooth device is the bluetooth device according to claim 13, and the second bluetooth device is the bluetooth device according to claim 14; or (b)
The bluetooth system comprising a first bluetooth device comprising a bluetooth connection arrangement according to any of claims 8-10, and a second bluetooth device comprising a bluetooth connection arrangement according to claim 11 or 12.
CN201910952785.5A 2019-10-09 2019-10-09 Bluetooth connection method and device, bluetooth equipment and Bluetooth system Active CN111132100B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910952785.5A CN111132100B (en) 2019-10-09 2019-10-09 Bluetooth connection method and device, bluetooth equipment and Bluetooth system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910952785.5A CN111132100B (en) 2019-10-09 2019-10-09 Bluetooth connection method and device, bluetooth equipment and Bluetooth system

Publications (2)

Publication Number Publication Date
CN111132100A CN111132100A (en) 2020-05-08
CN111132100B true CN111132100B (en) 2023-05-02

Family

ID=70496046

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910952785.5A Active CN111132100B (en) 2019-10-09 2019-10-09 Bluetooth connection method and device, bluetooth equipment and Bluetooth system

Country Status (1)

Country Link
CN (1) CN111132100B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111970669B (en) * 2020-08-17 2023-11-24 立讯电子科技(昆山)有限公司 Bluetooth connection method and device and Bluetooth equipment
CN113055868B (en) * 2021-03-12 2022-09-23 上海物骐微电子有限公司 Bluetooth rapid networking method and system and Bluetooth headset
CN115250451A (en) * 2021-04-27 2022-10-28 华为技术有限公司 Bluetooth communication method, system and electronic equipment
CN113950123B (en) * 2021-10-29 2024-04-09 歌尔科技有限公司 Connection method, device, equipment and storage medium of communication equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103813471A (en) * 2012-11-12 2014-05-21 联发科技股份有限公司 Communications establishing method and bluetooth device
CN103888177A (en) * 2014-02-25 2014-06-25 南京邮电大学 Method for quickly establishing Bluetooth connection
CN106878926A (en) * 2017-02-08 2017-06-20 泰凌微电子(上海)有限公司 A kind of data transmission method based on low-power consumption bluetooth, from main equipment and system
CN108616849A (en) * 2016-12-13 2018-10-02 中国电信股份有限公司 Bluetooth connecting method, Bluetooth system and equipment
CN109479226A (en) * 2016-12-24 2019-03-15 华为技术有限公司 A kind of wireless connection switching method and terminal

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100727897B1 (en) * 2006-06-30 2007-06-14 삼성전자주식회사 Method for setting device connection on wireless personal area networks

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103813471A (en) * 2012-11-12 2014-05-21 联发科技股份有限公司 Communications establishing method and bluetooth device
CN103888177A (en) * 2014-02-25 2014-06-25 南京邮电大学 Method for quickly establishing Bluetooth connection
CN108616849A (en) * 2016-12-13 2018-10-02 中国电信股份有限公司 Bluetooth connecting method, Bluetooth system and equipment
CN109479226A (en) * 2016-12-24 2019-03-15 华为技术有限公司 A kind of wireless connection switching method and terminal
CN106878926A (en) * 2017-02-08 2017-06-20 泰凌微电子(上海)有限公司 A kind of data transmission method based on low-power consumption bluetooth, from main equipment and system

Also Published As

Publication number Publication date
CN111132100A (en) 2020-05-08

Similar Documents

Publication Publication Date Title
CN111132100B (en) Bluetooth connection method and device, bluetooth equipment and Bluetooth system
CN111107528B (en) Bluetooth testing method and testing machine
EP1261171B1 (en) Radio communication terminal having functions of master station or slave station
EP2793528B1 (en) Method for transmitting data between terminals and terminal
CN101860941B (en) Wireless communications device, system, method and program
CN112771941B (en) Data synchronization method, device, equipment, system and storage medium
EP2866395B1 (en) Maximum transmission unit negotiation method and data terminal
US11444800B2 (en) Topology switching method based on isochronous channel, apparatus, system and storage medium
CN112534838B (en) Wireless battery management system for vehicle
EP3820128B1 (en) Method for allocating time slots for wireless headset and wireless headset using the same
CN112291766B (en) Bluetooth equipment and firmware upgrading method and system thereof
CN112636901A (en) Identity recognition method and device, storage medium and electronic equipment
CN112055315A (en) Bluetooth broadcast communication method, system and master device and slave device thereof
CN109804655A (en) Method, radio frequency system and the detection device that signal transmits in radio frequency network
CN101753272B (en) Method, device and system for synchronously controlling window
CN106603559B (en) A kind of method of wireless communication terminal data transmission anti-intercepting and capturing
JP2001197080A (en) Method for reducing temporary connection in bluetooth device
CN102883344B (en) Method and device for exchanging of wireless network management messages
CN103259639A (en) Clock synchronization method of stacking equipment and stacking equipment
CN105245258A (en) Bluetooth-based unpacking method and device
CN112312537B (en) Clock synchronization method and device, storage medium and electronic device
CN102802091B (en) A kind of method, system and equipment sent and process broadcast message
CN102598735B (en) Set up the method for utility cession, equipment and corresponding notice
CN101702820B (en) Method of wireless PPPoE handshake message answer and equipment thereof
CN116195338A (en) Method and equipment for initiating small data transmission in NR inactive state

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
CB02 Change of applicant information

Address after: 519075 No. 333, Kexing Road, Xiangzhou District, Zhuhai City, Guangdong Province

Applicant after: ZHUHAI JIELI TECHNOLOGY Co.,Ltd.

Address before: Floor 1-107, building 904, ShiJiHua Road, Zhuhai City, Guangdong Province

Applicant before: ZHUHAI JIELI TECHNOLOGY Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant