WO2024016885A1 - 蓝牙连接方法、装置、电子设备及计算机可读存储介质 - Google Patents

蓝牙连接方法、装置、电子设备及计算机可读存储介质 Download PDF

Info

Publication number
WO2024016885A1
WO2024016885A1 PCT/CN2023/099367 CN2023099367W WO2024016885A1 WO 2024016885 A1 WO2024016885 A1 WO 2024016885A1 CN 2023099367 W CN2023099367 W CN 2023099367W WO 2024016885 A1 WO2024016885 A1 WO 2024016885A1
Authority
WO
WIPO (PCT)
Prior art keywords
bluetooth
function
terminal device
connection
classic
Prior art date
Application number
PCT/CN2023/099367
Other languages
English (en)
French (fr)
Inventor
侯锐填
Original Assignee
Oppo广东移动通信有限公司
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 Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Publication of WO2024016885A1 publication Critical patent/WO2024016885A1/zh

Links

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
    • H04W52/00Power management, e.g. TPC [Transmission Power Control], power saving or power classes
    • H04W52/02Power saving arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W52/00Power management, e.g. TPC [Transmission Power Control], power saving or power classes
    • H04W52/02Power saving arrangements
    • H04W52/0209Power saving arrangements in terminal devices
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/14Direct-mode setup

Definitions

  • This application relates to the field of communication technology, and specifically to a Bluetooth connection method, device, electronic equipment and computer-readable storage medium.
  • Bluetooth communication standard protocols released by the Bluetooth SIG have also been updated and changed, such as from the earliest classic Bluetooth standard protocol, to the BLE (Bluetooth Low Energy, Bluetooth low power consumption) standard protocol, and then to the BLE Audio (Bluetooth Low Energy Audio, Bluetooth low energy audio) standard protocol, etc.
  • BLE Bluetooth Low Energy, Bluetooth low power consumption
  • BLE Audio Bluetooth Low Energy Audio, Bluetooth low energy audio
  • the embodiments of the present application disclose a Bluetooth connection method, device, electronic device and computer-readable storage medium.
  • the embodiment of the present application discloses a Bluetooth connection method, which is applied to Bluetooth devices.
  • the method includes:
  • the secure connection function is controlled to be on; the secure connection function is used to indicate that it can be performed on the basis of the classic Bluetooth link. Function of pairing operation of BLE connection;
  • the embodiment of the present application discloses a Bluetooth connection method, which is applied to a terminal device.
  • the method includes:
  • the embodiment of the present application discloses a Bluetooth connection method, which is applied to a headset device.
  • the headset device includes a master headset and a slave headset.
  • the method includes:
  • the main headset receives the classic Bluetooth connection request sent by the terminal device
  • the secure connection function of the headset device is controlled to be in an on state; the secure connection function is used to indicate that it can The function of pairing BLE connection based on the classic Bluetooth link;
  • the main earphone responds to the classic Bluetooth connection request and establishes a classic Bluetooth link with the terminal device.
  • the embodiment of the present application discloses a Bluetooth connection device, which is applied to Bluetooth devices.
  • the device includes:
  • the request receiving module is used to receive classic Bluetooth connection requests sent by the terminal device
  • a function control module configured to control the secure connection function to be on when it is determined based on the classic Bluetooth connection request that the terminal device supports the Bluetooth low-power audio function; the secure connection function is used to indicate that the secure connection function can be enabled in the classic Bluetooth connection request.
  • the function control module is also configured to control the secure connection function to be in a closed state when it is determined that the terminal device does not support the Bluetooth low-power audio function according to the classic Bluetooth connection request;
  • a connection module configured to respond to the classic Bluetooth connection request and establish a classic Bluetooth link with the terminal device.
  • the embodiment of the present application discloses a Bluetooth connection device, which is applied to terminal equipment.
  • the device includes:
  • a request sending module configured to send a classic Bluetooth connection request to the Bluetooth device, so that when the Bluetooth device determines that the terminal device supports the Bluetooth low-power audio function according to the classic Bluetooth connection request, the secure connection function is controlled to be in On state, when it is determined that the terminal device does not support the Bluetooth low power audio function according to the classic Bluetooth connection request, the secure connection function is controlled to be in the off state; the secure connection function is used to indicate that the The function of pairing BLE connection based on the classic Bluetooth link;
  • connection module is used to establish a classic Bluetooth link with the Bluetooth device.
  • the embodiment of the present application discloses a Bluetooth connection device, which is applied to a headset device.
  • the headset device includes a master headset and a slave headset.
  • the device includes:
  • a receiving module configured to receive the classic Bluetooth connection request sent by the terminal device through the main headset
  • a function control module configured to control the secure connection function of the headset device to be on through the main headset when the main headset determines that the terminal device supports the Bluetooth low-power audio function according to the classic Bluetooth connection request. Status; the secure connection function is used to indicate the function of pairing a BLE connection based on the classic Bluetooth link;
  • the function control module is also configured to control the secure connection through the main earphone when the main earphone determines that the terminal device does not support the Bluetooth low-power audio function according to the classic Bluetooth connection request.
  • the function is turned off;
  • a connection module configured to respond to the classic Bluetooth connection request through the main earphone and establish a classic Bluetooth link with the terminal device.
  • An embodiment of the present application discloses an electronic device, which includes a memory, a processor and a communication unit.
  • a computer program is stored in the memory.
  • the computer program is executed by the processor, the electronic device implements any of the above. methods described in the examples.
  • Embodiments of the present application disclose a computer-readable storage medium on which a computer program is stored.
  • the computer program When the computer program is executed by a processor in an electronic device, it causes the electronic device to implement the method described in any of the above embodiments. .
  • Figure 1A is an application scenario diagram of a Bluetooth connection method in an embodiment
  • Figure 1B is an application scenario diagram of a Bluetooth connection method in another embodiment
  • Figure 2 is a flow chart of a Bluetooth connection method in one embodiment
  • Figure 3 is a sequence diagram of a Bluetooth connection method in an embodiment
  • Figure 4 is a sequence diagram of a Bluetooth connection method in another embodiment
  • Figure 5 is a schematic structural diagram of the LE Audio broadcast signal in one embodiment
  • Figure 6 is a sequence diagram of a Bluetooth connection method in another embodiment
  • Figure 7 is a timing diagram for establishing LE Audio Bluetooth connections between the terminal device and the two earphones of the earphone device in one embodiment
  • Figure 8 is a flow chart of a Bluetooth connection method in another embodiment
  • Figure 9 is a flow chart of a Bluetooth connection method in yet another embodiment
  • Figure 10 is a block diagram of a Bluetooth connection device in one embodiment
  • Figure 11 is a block diagram of a Bluetooth connection device in another embodiment
  • Figure 12 is a block diagram of a Bluetooth connection device in yet another embodiment
  • Figure 13 is a structural block diagram of a Bluetooth device in one embodiment.
  • first, second, etc. used in this application may be used to describe various elements herein, but these elements Not limited by these terms. These terms are only used to distinguish one element from another element.
  • a first key may be referred to as a second key, and similarly, the second key may be referred to as a first key, without departing from the scope of the present application.
  • the first key and the second key are both keys, but they are not the same key.
  • the term “plurality” used in this application refers to two or more than two.
  • the term “and/or” used in this application refers to one of the solutions, or any combination of multiple solutions thereto. If there is no conflict, the embodiments, implementation methods and technical features in this application can be combined arbitrarily.
  • FIG. 1A is an application scenario diagram of a Bluetooth connection method in an embodiment.
  • the Bluetooth device 10 can establish a Bluetooth connection with the terminal device 20 , where the Bluetooth device 10 can include but is not limited to vehicle-mounted terminals, wearable devices, speaker devices, Bluetooth headsets, smart home devices, etc. that support Bluetooth communication functions.
  • Electronic device further, the Bluetooth device 10 may be a TWS (True Wireless Stereo) headset, etc.
  • the terminal device 20 may include but is not limited to mobile phones, wearable devices, vehicle-mounted terminals, tablet computers, PC (Personal Computer, personal computer), PDA (Personal Digital Assistant, personal digital assistant) and other devices.
  • the Bluetooth device 10 may be an electronic device that supports Bluetooth dual-mode.
  • the electronic device that supports Bluetooth dual-mode may refer to an electronic device that supports both the classic Bluetooth protocol and the BLE (Bluetooth Low Energy, Bluetooth Low Energy) protocol.
  • the classic Bluetooth protocol usually refers to the Bluetooth protocol below Bluetooth protocol version 4.0
  • the BLE protocol usually refers to the Bluetooth protocol above Bluetooth protocol version 4.0.
  • the Bluetooth device 10 may be an electronic device that supports the classic Bluetooth protocol and the BLE Audio (Bluetooth Low Energy Audio) protocol.
  • BLE Audio technology solves the problem that BLE connections can only transmit small amounts of data, but not audio data.
  • the BLE Audio protocol supports audio data encoded by LC3 (Low Complexity Communications Codec, low-power audio codec), making The transmission of audio data can better take into account various aspects such as power consumption, real-time performance and sound quality.
  • BLE Audio and LE Audio used in this application can refer to the same concept, and the terms can be used interchangeably. Both can refer to the new generation of Bluetooth audio technology standards based on the Bluetooth 5.2 version specification. For example, it can support low-power audio decoder LC3, can support multiple streaming audio, can support broadcast audio technology, etc.
  • the sound quality of LDAC encoding based on classic Bluetooth protocol transmission may be better than the sound quality of LC3 encoding supported by BLE Audio protocol, so it can be based on classic Bluetooth Protocol for audio data transmission; when users play games through terminal devices, audio data transmission based on the BLE Audio protocol can reduce delays, etc.
  • the Bluetooth device 10 can establish a classic Bluetooth connection and a LE Audio Bluetooth connection with the terminal device 20 at the same time.
  • CTKD Cross-Transport Key Derivation
  • the key of the BLE connection and the key of the classic Bluetooth connection can be converted to each other, so that the user can trigger a connection operation on the terminal device 20 to enable the terminal device 20 to establish a classic Bluetooth connection and LE Audio Bluetooth with the Bluetooth device 10 at the same time. connect.
  • CTKD solution is a function launched after Bluetooth standard 5.0, not all terminal devices 20 can support the CTKD solution. For example, some terminal devices 20 do not support the BLE Audio protocol.
  • this kind of terminal device 20 may be a dual-mode device that supports classic Bluetooth BT and low-power Bluetooth BLE.
  • This dual-mode device also has a secure connection function, which results in the device not supporting the BLE Audio protocol.
  • the terminal device 20 executes the CTKD process and then performs a classic Bluetooth connection and a BLE connection with the Bluetooth device 10.
  • the terminal device 20 that does not support the BLE Audio protocol first establishes a classic Bluetooth connection with the Bluetooth device 10 and triggers the CTKD scheme to obtain the key for the BLE connection. , in some cases the terminal device will reuse the BLE connection key to establish a BLE connection with the Bluetooth device 10.
  • the Bluetooth device 10 can receive the classic Bluetooth connection request sent by the terminal device 20, and determine whether the terminal device 20 supports the Bluetooth low-power audio function (LE Audio function) based on the classic Bluetooth connection request. When the Bluetooth device 10 determines that the terminal device 20 supports the Bluetooth low-power audio function based on the classic Bluetooth connection, the secure connection function is controlled to be in an on state.
  • the secure connection function is turned off.
  • the secure connection function is used to indicate the function of pairing operation of BLE connection based on the classic Bluetooth link.
  • the Bluetooth device 10 responds to the classic Bluetooth connection request sent by the terminal device 20 and establishes a classic Bluetooth link with the terminal device 20 .
  • the Bluetooth device 10 can dynamically control the secure connection function to be on or off according to whether the terminal device 20 supports the Bluetooth low-power audio function.
  • the secure connection function can be turned off. This prevents the terminal device 20 from triggering the CTKD process when it does not support the LE Audio function, ensuring the stability and compatibility of the Bluetooth connection between the Bluetooth device 10 and the terminal device 20 that does not support the LE Audio function.
  • classic Bluetooth links may include but are not limited to ACL (Asynchronous Connectionless, asynchronous no link), SCO (Synchronous Connection Oriented, synchronous directional link) and other links.
  • the Bluetooth device 10 and the terminal device 20 can further establish business connections such as A2DP (Advanced Audio Distribution Profile, Bluetooth audio transmission model protocol) and HFP (Hands-free Profile) based on the classic Bluetooth link, so that the terminal device and the Bluetooth device Audio data, voice data and other services can be transmitted between data.
  • A2DP Advanced Audio Distribution Profile, Bluetooth audio transmission model protocol
  • HFP High-free Profile
  • FIG. 1B is an application scenario diagram of a Bluetooth connection method in another embodiment.
  • the Bluetooth device 10 may include an earphone device.
  • a master-slave relationship can be distinguished between the two earphones included in the earphone device.
  • the earphone device includes a master earphone 110 and a slave earphone. 120.
  • a communication connection (such as Bluetooth connection, etc.) can be established between the master earphone 110 and the slave earphone 120.
  • the main headset 110 can receive the classic Bluetooth connection request sent by the terminal device 20, and determine whether the terminal device 20 supports the Bluetooth low-power audio function based on the classic Bluetooth connection request. If the terminal device 20 supports the Bluetooth low-power audio function, the main headset 110 can control the secure connection function of the headset device to be on. If the terminal device 20 does not support the Bluetooth low-power audio function, the main headset 110 can control the headset device. The secure connection feature is turned off. The main headset 110 can then respond to the classic Bluetooth connection request sent by the terminal device 20 and establish a classic Bluetooth link with the terminal device 20 .
  • the slave headset 120 can obtain the classic Bluetooth connection information between the main headset 110 and the terminal device 20 through the communication connection with the main headset 110, thereby
  • the monitoring method can be used to monitor the data transmission between the master earphone 110 and the terminal device 20 based on the classic Bluetooth link to achieve synchronization of the master and slave earphones.
  • the master earphone 110 establishes a classic Bluetooth link with the terminal device 20, and the master earphone 110 establishes a communication connection with the slave earphone 120, and the master earphone 110 receives the data transmitted by the terminal device 20 through the classic Bluetooth link.
  • the master earphone 110 can forward the transmitted data to the slave earphone 120 to achieve synchronization between the master and slave earphones.
  • the headphone device can also establish a LE Audio Bluetooth connection with the terminal device 20.
  • the headphone device does not need to distinguish the master-slave relationship.
  • the two headphones of the headphone device can establish LE Audio Bluetooth connections with the terminal device 20 respectively.
  • a master-slave relationship can also be distinguished between two headphones included in the headphone device.
  • the main earphone 110 can establish a LE Audio Bluetooth connection with the terminal device 20, and the slave earphone 120 can obtain the LE Audio Bluetooth connection information between the main earphone 110 and the terminal device 20 through the communication connection with the main earphone 110, and Use monitoring to monitor the data transmission between the master headset 110 and the terminal device 20 through the LE Audio Bluetooth connection to achieve synchronization of the master and slave headsets; or, the master headset 110 receives the data transmitted by the terminal device 20 through the LE Audio Bluetooth connection.
  • the master earphone 110 can forward the transmitted data to the slave earphone 120 to achieve synchronization between the master and slave earphones.
  • the headphone device and the terminal device can be dual-mode Bluetooth devices that support classic Bluetooth and LE Audio Bluetooth, and the terminal device can also be a dual-mode Bluetooth device that does not support LE Audio Bluetooth (such as one that supports classic Bluetooth and BLE Bluetooth). Dual-mode Bluetooth device), the secure connection function of this kind of dual-mode Bluetooth device that does not support LE Audio Bluetooth may also be turned on.
  • a Bluetooth connection method is provided, which can be applied to the above-mentioned Bluetooth devices (such as dual-mode Bluetooth devices that support classic Bluetooth and LE Audio Bluetooth).
  • the method may include the following steps:
  • Step 210 Receive the classic Bluetooth connection request sent by the terminal device.
  • the Bluetooth device may be in a pairing state.
  • the Bluetooth device may enable inquiry scan (inquiry scan) mode and page scan (paging scan) mode at the same time.
  • inquiry scan mode Bluetooth devices are allowed to be scanned and searched by other devices.
  • page scan mode Bluetooth devices can receive and respond to classic Bluetooth connection requests sent by other devices. That is, when the Bluetooth device is in the pairing state, the Bluetooth device is in the discoverable state and the connectable state at the same time.
  • the terminal device may be a device that has not established a classic Bluetooth connection with the Bluetooth device before, or a device that has previously established a classic Bluetooth connection but does not store a connection record corresponding to the Bluetooth device.
  • the connection record may include information such as device information and pairing information (such as keys, pairing codes, etc.) of the Bluetooth device.
  • the terminal device can scan the Bluetooth device in the paired state, thereby obtaining the device information of the Bluetooth device, and sends a classic Bluetooth connection request to the Bluetooth device based on the device information of the Bluetooth device.
  • the terminal device can turn on the scanning mode and scan the surrounding Bluetooth devices.
  • the terminal device can send a scanning request (inquiry request) to the Bluetooth device.
  • the Bluetooth device can return a scanning response (inquiry request) to the terminal device. inquiry respond).
  • the terminal device can obtain the device information of the Bluetooth device based on the received scan response.
  • the device information may include but is not limited to one of the Bluetooth address of the Bluetooth device (such as the classic Bluetooth address, etc.), the device name of the Bluetooth device, the MAC address, etc., or Various.
  • the terminal device can display the device information of the Bluetooth device, and the user can perform a connection operation for the device information to trigger the terminal device to perform a Bluetooth connection with the Bluetooth device.
  • the terminal device may respond to the connection operation for the device information of the Bluetooth device and send a classic Bluetooth connection request to the Bluetooth device according to the device information of the Bluetooth device.
  • the terminal device may also be a device that has established a classic Bluetooth connection and performed pairing with the Bluetooth device, and the terminal device may store a connection record corresponding to the Bluetooth device.
  • the terminal device can obtain the device information of the Bluetooth device based on the connection record, and send a classic Bluetooth connection request to the Bluetooth device based on the device information.
  • the above-mentioned classic Bluetooth connection request can be a paging (page) data packet
  • the terminal device can send the paging data packet in a frequency hopping manner to page the Bluetooth device and enable the page scan mode.
  • the Bluetooth device can scan externally sent paging data packets at fixed intervals, such as paging data packets sent by the terminal device, that is, it receives classic Bluetooth data packets sent by the terminal device. connection request.
  • Step 220 Determine whether the terminal device supports the Bluetooth low-power audio function according to the classic Bluetooth connection request. If yes, step 230 is executed. If not, step 240 is executed.
  • the Bluetooth device After the Bluetooth device receives the classic Bluetooth connection request sent by the terminal device, it can determine whether the terminal device supports the Bluetooth low-power audio function based on the classic Bluetooth connection request. Among them, the terminal device supporting the Bluetooth low-power audio function may refer to the terminal device. Currently, it is possible to establish a LE Audio Bluetooth connection with a Bluetooth device. If the terminal device does not support the Bluetooth low-power audio function, it means that the terminal device is currently unable to establish a LE Audio Bluetooth connection with the Bluetooth device.
  • the terminal device does not support the Bluetooth low-power audio function. It may be that the terminal device itself does not support the BLE Audio protocol (that is, it does not have the LE Audio function), or the terminal device itself supports the BLE Audio protocol, but LE is turned off. Audio function, turning off the LE Audio function can be understood as achieving a similar effect as not having the LE Audio function, such as not showing the LE Audio function to the outside world by not running the corresponding LE Audio function module.
  • the terminal device can provide a switch control for the LE Audio function in the Bluetooth management interface. The user can choose to turn on/off the LE Audio function of the terminal device by triggering the switch control. Audio function.
  • the terminal device supports the Bluetooth low power audio function and can establish a LE Audio Bluetooth connection with the Bluetooth device. If the user chooses to turn off the LE Audio function of the terminal device, the terminal device does not support Bluetooth low energy. The power-consuming audio function cannot establish a LE Audio Bluetooth connection with a Bluetooth device.
  • the terminal device may send a classic Bluetooth connection request carrying a target field to the Bluetooth device. If the terminal device supports the Bluetooth low-power audio function, the target field may include the first identifier. If the terminal device does not If the Bluetooth low energy audio function is supported, the target field may contain a second identifier.
  • the first logo and the second logo are different. The first logo and the second logo can be set according to actual needs. The first logo and the second logo can be composed of one or more of numbers, letters, symbols, etc. For example, the first identifier may be 1 and the second identifier may be 0, but it is not limited thereto.
  • the Bluetooth device After the Bluetooth device receives the classic Bluetooth connection request sent by the terminal device, it can parse the classic Bluetooth connection request to extract the target field contained in the classic Bluetooth connection request, and determine whether the terminal device supports Bluetooth low energy based on the target field. Audio function. If the target field contains the first identifier, it can be determined that the terminal device supports the Bluetooth low-power audio function. If the target field contains the second identifier, it can be determined that the terminal device does not support the Bluetooth low-power audio function.
  • the classic Bluetooth connection request can carry a COD (Class of device, device type) field.
  • the COD field can be used to declare the device type of the terminal device.
  • the COD field can include one or more subfields, for example, Includes the Bit_14 subfield, which can be used to indicate whether the terminal device supports the Bluetooth low energy audio function.
  • the Bluetooth device can parse the classic Bluetooth connection request to extract the COD field. If it is detected that the Bit_14 subfield in the COD field is set as the first identifier, it can be determined that the terminal device supports the Bluetooth low-power audio function.
  • the terminal device If it is detected that If the Bit_14 subfield in the COD field is set as the second identifier, it can be determined that the terminal device does not support the Bluetooth low-power audio function.
  • the terminal device directly modifies the content of the target field carried in the classic Bluetooth connection request according to whether it supports the Bluetooth low power audio function, which allows the Bluetooth device to more quickly and conveniently determine whether the terminal device supports Bluetooth low power. consumption audio function to improve Bluetooth connection efficiency.
  • Step 230 Control the secure connection function to be on.
  • Step 240 Control the secure connection function to be in a closed state.
  • the Secure Connection feature of a Bluetooth device can be used to indicate capabilities that enable pairing operations for BLE connections on the basis of a classic Bluetooth link.
  • the secure connection function may refer to the secure connection function of classic Bluetooth.
  • the secure connection function of classic Bluetooth can implement SMP (secure manager protocol, security management) based on the classic Bluetooth link (such as ACL link, etc.) Protocol) process, the SMP process can provide the BLE connection with the keys required to establish an encrypted connection.
  • the secure connection function can trigger the conversion of the first key corresponding to the classic Bluetooth connection into the second key corresponding to the BLE connection, and realize the pairing operation of the BLE connection based on the classic Bluetooth link.
  • the secure connection function of the Bluetooth device is always on. After the terminal device establishes a classic Bluetooth link with the Bluetooth device, the terminal device will find that the Bluetooth device supports the secure connection function, so it will trigger the pairing operation of the BLE connection based on the classic Bluetooth link. Errors may occur for terminal devices that do not support the LE Audio function, and may also affect the classic Bluetooth connection between the terminal device and the Bluetooth device, resulting in poor stability and compatibility.
  • the Bluetooth device in order to avoid the above situation, can dynamically control the status of the secure connection function according to whether the terminal device supports the Bluetooth low-power audio function.
  • the secure connection function can be controlled to be turned on.
  • the secure connection function can be controlled to be turned off.
  • the secure connection function of the Bluetooth device can be turned off by default.
  • the Bluetooth device receives the classic blue message sent by the terminal device, After receiving the Bluetooth connection request, if it is determined that the terminal device supports the Bluetooth low-power audio function based on the classic Bluetooth connection request, then the secure connection function is enabled. It should be noted that the secure connection function of the Bluetooth device can also be turned on by default. After the Bluetooth device receives the classic Bluetooth connection request sent by the terminal device, if it is determined based on the classic Bluetooth connection request that the terminal device does not support Bluetooth low-power audio function, and then turn off the secure connection function.
  • Step 250 Respond to the classic Bluetooth connection request and establish a classic Bluetooth link with the terminal device.
  • the Bluetooth device After the Bluetooth device dynamically controls the status of the secure connection function based on whether the terminal device supports the Bluetooth low-power audio function, it can then respond to the classic Bluetooth connection request sent by the terminal device and establish a classic Bluetooth link with the terminal device. After the terminal device establishes a classic Bluetooth link with the Bluetooth device, it can query the Bluetooth device for the Bluetooth services supported by the Bluetooth device, and determine whether the Bluetooth device has turned on the secure connection function based on the query results returned by the Bluetooth device, that is, determine whether the Bluetooth device Whether the device supports the secure connection function. Among them, if the Bluetooth device supports the secure connection function, it means that the secure connection function is turned on, and if the Bluetooth device does not support the secure connection function, it means that the secure connection function is turned off.
  • the query result returned by the Bluetooth device may include the service identifier corresponding to the secure connection function. If the secure connection function of the Bluetooth device is turned off, the query result returned by the Bluetooth device may The returned query result does not contain the service identifier corresponding to the secure connection function.
  • the terminal device can determine whether the Bluetooth device has enabled the secure connection function by determining whether the query result contains the service identifier.
  • the service identification may be composed of one or more of numbers, letters, symbols, etc.
  • the query result returned by the Bluetooth device may include a function field corresponding to the secure connection function. If the secure connection function of the Bluetooth device is turned on, the Bluetooth device may set the function field to the third identifier.
  • the Bluetooth device can set this function field to the fourth identifier.
  • the third and fourth flags and the fourth flag can be set according to actual needs. For example, the third flag is YES, the fourth flag is NO, etc., but is not limited to this.
  • the terminal device can determine whether the Bluetooth device enables the secure connection function by determining whether the function field corresponding to the secure connection function in the query result is the third identifier or the fourth identifier.
  • the terminal device determines that the Bluetooth device has turned on the secure connection function (that is, the Bluetooth device supports the secure connection function), it can perform the pairing operation of the BLE connection based on the classic Bluetooth link. If the terminal device determines that the Bluetooth device does not have the secure connection function turned on (that is, the Bluetooth device does not support the secure connection function), it will only establish a classic Bluetooth link with the terminal device without performing the pairing operation of the BLE connection based on the classic Bluetooth link. This can avoid adverse effects on the classic Bluetooth connection between the terminal device and the Bluetooth device when the terminal device does not support the LE Audio function.
  • the secure connection function of the Bluetooth device when the secure connection function of the Bluetooth device is turned on, the secure connection function can be used to trigger the terminal device to perform the CTKD process after establishing a classic Bluetooth link with the Bluetooth device, and connect the corresponding classic Bluetooth link to the terminal device.
  • the first key (such as pairing key link key, etc.) is converted into the second key corresponding to the BLE connection (such as LTK (Long Term Key, long-term key), etc.).
  • LTK Long Term Key, long-term key
  • the classic Bluetooth address and the BLE address of the Bluetooth device can be the same, so that mutual conversion between the first key corresponding to the classic Bluetooth connection and the second key corresponding to the BLE connection can be achieved.
  • the specific key conversion process please refer to the relevant regulations in the Bluetooth standard.
  • the terminal device After the terminal device establishes a classic Bluetooth link with the Bluetooth device, it can determine whether the Bluetooth device has enabled the secure connection function. If it is determined that the Bluetooth device has enabled the secure connection function, it can perform the CTKD process to convert the first key corresponding to the classic Bluetooth connection into The second key corresponding to the BLE connection. This second key can be used to encrypt subsequent BLE connections established.
  • the terminal device is a device that has not established a classic Bluetooth connection with the Bluetooth device before, or a device that has established a classic Bluetooth connection before but does not store a connection record corresponding to the Bluetooth device, the terminal device can establish a classic Bluetooth connection with the Bluetooth device. Classic Bluetooth link, and perform pairing operation.
  • the pairing operation may include processes such as exchanging pairing codes and agreeing on the first key between the two to ensure the security of the transmission.
  • the terminal device After the terminal device determines that the Bluetooth device has enabled the secure connection function, it can obtain the first key and convert the first key into a second key corresponding to the BLE connection.
  • the terminal device is a device that has established a classic Bluetooth connection and performed pairing with the Bluetooth device
  • the first key corresponding to the classic Bluetooth connection can be stored in the terminal device, and the terminal device can directly establish a classic Bluetooth connection with the Bluetooth device.
  • the link does not need to be paired.
  • the terminal device determines that the Bluetooth device has enabled the secure connection function, it can obtain the stored first key and convert the first key into a second key corresponding to the BLE connection.
  • the terminal device determines that the Bluetooth device has turned off the secure connection function (that is, does not support the secure connection function), it will not perform the CTKD process and will not convert the first key corresponding to the classic Bluetooth connection into the second key corresponding to the BLE connection.
  • FIG. 3 is a sequence diagram of a Bluetooth connection method in one embodiment.
  • the Bluetooth device can enter the pairing state (turn on the inquiry scan mode and page scan mode at the same time), and the terminal device can scan the Bluetooth device and obtain the device information of the Bluetooth device.
  • the terminal device can display the device information of the Bluetooth device, and the user can perform a connection operation for the device information (such as clicking a connection button corresponding to the Bluetooth device) to trigger a Bluetooth connection between the terminal device and the Bluetooth device.
  • the terminal device sends a classic Bluetooth connection request to the Bluetooth device.
  • the Bluetooth device receives the classic Bluetooth connection request sent by the terminal device, it can connect according to the classic Bluetooth connection request. Request to determine whether the terminal device supports the Bluetooth low energy audio function.
  • the secure connection function can be controlled to be on. If not, the secure connection function can be controlled to be off.
  • the Bluetooth device then responds to the classic Bluetooth connection request sent by the terminal device and establishes a classic Bluetooth link with the terminal device.
  • the terminal device can determine whether the Bluetooth device has turned on the secure connection function. If so, it can perform the CTKD process to convert the first key corresponding to the classic Bluetooth connection into the second key corresponding to the BLE connection (the second key can be used to establish a BLE connection ), if not, the CTKD process will not be performed.
  • the Bluetooth device can also send LE Audio broadcast signals, and the terminal device can receive the LE Audio broadcast signals.
  • the terminal device can determine whether the Bluetooth device has turned on the secure connection function. If so, it can initiate a LE Audio connection request to the Bluetooth device, and at the same time establish a classic Bluetooth connection and a LE Audio Bluetooth connection with the Bluetooth device. If not, it will not initiate a LE Audio connection request to the Bluetooth device. Connection request to establish a classic Bluetooth connection only with Bluetooth devices.
  • the establishing a classic Bluetooth connection may include establishing a classic Bluetooth link as mentioned in the above embodiment.
  • receiving the LE Audio broadcast signal is a prerequisite for establishing a LE Audio Bluetooth connection.
  • the Bluetooth device can dynamically control the secure connection function to be on or off according to whether the terminal device supports the Bluetooth low-power audio function, which can avoid the situation when the terminal device does not support the Bluetooth low-power audio function.
  • the Bluetooth device turns on the secure connection function, which affects the classic Bluetooth connection between the terminal device and the Bluetooth device, which can improve the stability and compatibility of establishing Bluetooth connections between electronic devices.
  • the above method may also include: the Bluetooth device sends a first LE Audio broadcast signal, and the first LE Audio broadcast signal may be used to trigger the reception of the first LE Audio broadcast signal.
  • a terminal device that broadcasts LE Audio signals initiates a LE Audio connection request to the Bluetooth device after establishing a classic Bluetooth link with the Bluetooth device.
  • the Bluetooth device can only send the first LE Audio broadcast signal when the secure connection function is turned on. If the terminal device receives the first LE Audio broadcast signal sent by the Bluetooth device, it means that the secure connection function of the Bluetooth device is turned on. After establishing a classic Bluetooth link with the Bluetooth device, it can directly initiate a LE Audio connection request to the Bluetooth device. Establish a LE Audio Bluetooth connection with a Bluetooth device.
  • the Bluetooth device determines that the terminal device supports the Bluetooth low-power audio function, the secure connection function is turned on, and when it determines that the terminal device does not support the Bluetooth low-power audio function, the secure connection function is turned off. Therefore, if the terminal device receives the first LE Audio broadcast signal sent by the Bluetooth device, it means that the secure connection function of the Bluetooth device is turned on, and the terminal device supports the Bluetooth low-power audio function, and the terminal device can establish a classic connection with the terminal device. In the case of Bluetooth link, perform the CTKD process, convert the first key corresponding to the classic Bluetooth connection into the second key corresponding to the BLE connection (can be used for BLE connection), and initiate a LE Audio connection request to the Bluetooth device, and communicate with the Bluetooth device.
  • the device establishes a LE Audio Bluetooth connection. It can be understood that establishing a LE Audio Bluetooth connection between a terminal device and a Bluetooth device may include establishing a BLE connection first (for example, it may include establishing a BLE ACL link), and then completing the LE Audio Bluetooth connection based on the BLE connection. In this embodiment of the present application, the terminal device no longer needs to make an additional judgment on whether the Bluetooth device enables the secure connection function, thereby improving connection efficiency.
  • the first LE Audio broadcast signal can be used to trigger the terminal device that receives the first LE Audio broadcast signal. After establishing a classic Bluetooth link with the Bluetooth device, and when it is determined that the Bluetooth device turns on the secure connection function, Initiate a LE Audio connection request to the Bluetooth device.
  • the terminal device After the terminal device establishes a classic Bluetooth link with the Bluetooth device, it can obtain the Bluetooth service supported by the Bluetooth device to determine whether the Bluetooth device currently has the secure connection function enabled. If it is determined that the Bluetooth device has the secure connection function enabled, the CTKD process can be executed. , if the first LE Audio broadcast signal sent by the Bluetooth device is received, a LE Audio connection request can be sent to the Bluetooth device to establish a LE Audio Bluetooth connection with the Bluetooth device.
  • the Bluetooth device when the terminal device does not support the LE Audio function, the Bluetooth device will control its secure connection function to be turned off. Therefore, the terminal device can determine that the secure connection function of the Bluetooth device is turned off through the classic Bluetooth link.
  • the CTKD process will be executed to avoid the terminal device still executing the CTKD process even if it does not support the LE Audio function, especially for dual-mode terminal devices that support classic Bluetooth and BLE Bluetooth to avoid further establishment of no real needs in some cases. BLE connection can also avoid adverse effects on classic Bluetooth connections.
  • the Bluetooth device may send the first LE Audio broadcast signal when it is determined that the terminal device supports the Bluetooth low-power audio function based on the classic Bluetooth connection request sent by the terminal device; or the Bluetooth device may send the first LE Audio broadcast signal during the secure connection function.
  • the timing of sending the first LE Audio broadcast signal is not limited.
  • the Bluetooth device can determine whether the terminal device supports the Bluetooth low-power audio function based on the classic Bluetooth connection request. If it is determined whether the terminal device supports the Bluetooth low-power audio function, then you can send the first LE Audio broadcast signal and control secure connection function are on. If it is determined that the terminal device does not support the Bluetooth low-power audio function, the Bluetooth device controls the secure connection function to be in a closed state and does not send the first LE Audio broadcast signal. It should be noted that the order in which the Bluetooth device sends the first LE Audio broadcast signal and controls the secure connection function to be on is not limited in the embodiments of this application, and both can also be performed at the same time.
  • the first LE Audio broadcast signal is only sent when it is determined that the terminal device supports the LE Audio function, which can not only save the power consumption of the Bluetooth device, but also prevent the terminal device that does not support the LE Audio function from receiving the first LE Audio broadcast signal. In the event of process errors, the stability and compatibility of Bluetooth connections between electronic devices are further ensured.
  • it can also be configured to send the first LE Audio broadcast signal after establishing a classic Bluetooth link with the terminal device. In this case, the terminal device can be connected to classic Bluetooth first.
  • the Bluetooth device can also send the first LE Audio broadcast signal after establishing a classic Bluetooth link with the terminal device when the secure connection function is turned on.
  • the secure connection function is turned off, the first LE Audio broadcast signal is not sent after establishing a classic Bluetooth link with the terminal device. Since the embodiment of this application is applicable to the scenario where the classic Bluetooth link is first established and then the LE Audio Bluetooth connection is established, the Bluetooth device can send the first LE Audio broadcast signal after establishing the classic Bluetooth link with the terminal device. Further save power consumption of Bluetooth devices.
  • FIG. 4 is a sequence diagram of a Bluetooth connection method in another embodiment.
  • the Bluetooth device can enter the pairing state (turn on inquiry scan mode and page scan mode at the same time), and the terminal device can scan the Bluetooth device and obtain the device information of the Bluetooth device.
  • the terminal device can display the device information of the Bluetooth device, and the user can perform a connection operation for the device information (such as clicking a connection button corresponding to the Bluetooth device) to trigger a Bluetooth connection between the terminal device and the Bluetooth device.
  • the terminal device sends a classic Bluetooth connection request to the Bluetooth device.
  • the Bluetooth device receives the classic Bluetooth connection request sent by the terminal device, it can determine whether the terminal device supports the Bluetooth low-power audio function based on the classic Bluetooth connection request.
  • the Bluetooth device If so, it can control the secure connection function to be turned on. If not, it can Control the secure connection feature is turned off.
  • the Bluetooth device then responds to the classic Bluetooth connection request sent by the terminal device and establishes a classic Bluetooth link with the terminal device. After the Bluetooth device control secure connection function is turned on and a classic Bluetooth link is established with the terminal device, the first LE Audio broadcast signal can be sent. If the secure connection function is turned off, the Bluetooth device does not send the first LE Audio broadcast signal.
  • the terminal device After the terminal device establishes a classic Bluetooth link with the Bluetooth device, it can determine whether the Bluetooth device has enabled the secure connection function. If so, it can perform the CTKD process to convert the first key corresponding to the classic Bluetooth connection into the second key corresponding to the BLE connection. key, and upon receiving the first LE Audio broadcast signal, initiate a LE Audio Bluetooth connection with the Bluetooth device, send a LE Audio Bluetooth connection request to the Bluetooth device, thereby establishing a LE Audio Bluetooth connection with the Bluetooth device.
  • the terminal device supports both classic Bluetooth and LE Audio functions, the user can trigger the terminal device and the Bluetooth device to establish a classic Bluetooth connection and LE Audio Bluetooth connection at the same time by performing a single connection operation, which is more convenient and faster.
  • the terminal device determines that the Bluetooth device has turned off the secure connection function, it will not perform the CTKD process, and will not initiate a LE Audio Bluetooth connection with the Bluetooth device. It will only establish a classic Bluetooth connection with the Bluetooth device, thus avoiding the emergence of terminal devices that do not support the LE Audio function. Process errors lead to situations where the classic Bluetooth link is also adversely affected. Or avoid causing unnecessary BLE connections to be established by some Bluetooth dual-mode terminal devices that do not support the LE Audio function.
  • the Bluetooth device can dynamically control the secure connection function to be on or off according to whether the terminal device supports the Bluetooth low-power audio function. Since the Bluetooth device does not support the Bluetooth low-power audio function when the terminal device , the secure connection function (that is, the secure connection function of classic Bluetooth) will be controlled to be turned off. Therefore, when the terminal device determines that the secure connection function of the Bluetooth device is turned off, it will not further perform CTKD on the basis of classic Bluetooth. process, thereby avoiding BLE connections on some terminal devices that do not support the LE Audio function, and avoiding adverse effects on the classic Bluetooth link.
  • the secure connection function that is, the secure connection function of classic Bluetooth
  • the terminal device only establishes classic Bluetooth connections with Bluetooth devices and does not perform the CTKD process, ensuring the stability and compatibility of Bluetooth connections between Bluetooth devices and terminal devices that do not support Bluetooth low-power audio functions.
  • the above-mentioned Bluetooth device can be the master Bluetooth device in the Bluetooth device set.
  • the Bluetooth device can send a broadcast to the slave Bluetooth device in the Bluetooth device set.
  • Trigger instruction The broadcast trigger can only be used to instruct the Bluetooth device to send a second LE Audio broadcast signal.
  • the second LE Audio broadcast signal can trigger the terminal device that receives the second LE Audio broadcast signal to initiate LE Audio to the slave Bluetooth device. Connection request.
  • a Bluetooth device set may include at least two Bluetooth devices, and each Bluetooth device belonging to the same Bluetooth device set may achieve data synchronization.
  • a master-slave relationship can be distinguished between each Bluetooth device in the Bluetooth device set, including a master Bluetooth device and a slave Bluetooth device.
  • the master Bluetooth device can refer to the one that establishes a classic Bluetooth link with an external terminal device.
  • Bluetooth device, slave Bluetooth device can refer to monitoring the classic Bluetooth link between the master Bluetooth device and the terminal device, or receiving the master Bluetooth device forwarding through the classic Bluetooth device. Bluetooth device receiving data over the Bluetooth link.
  • each Bluetooth device in the Bluetooth device set can share the same classic Bluetooth address, and the terminal device can obtain the classic Bluetooth address and send a classic Bluetooth connection request to the Bluetooth device set according to the classic Bluetooth address.
  • the master Bluetooth device in the Bluetooth device collection can receive the classic Bluetooth connection request sent by the terminal device, and determine whether the terminal device supports the Bluetooth low-power audio function based on the classic Bluetooth connection request. If it supports, the secure connection of the master Bluetooth device can be controlled. The function is on. If it is not supported, the secure connection function of the main Bluetooth device can be controlled to be off. The master Bluetooth device can then respond to the classic Bluetooth connection request sent by the terminal device and establish a classic Bluetooth link with the terminal device.
  • the master Bluetooth device can establish a communication connection (such as a classic Bluetooth connection or a BLE connection, etc.) with the slave Bluetooth device, and synchronize the connection information corresponding to the classic Bluetooth link to the slave Bluetooth device.
  • the connection information can include but is not limited to frequency hopping information, Channel information, clock information, etc.
  • the slave Bluetooth device can monitor the classic Bluetooth link between the master Bluetooth device and the terminal device based on the connection information, or the master Bluetooth device can forward the data received through the classic Bluetooth link to the slave Bluetooth device, thereby achieving the same Master-slave synchronization under Bluetooth device collection.
  • each Bluetooth device under the same Bluetooth device set does not need to distinguish the master-slave relationship.
  • Each Bluetooth device can establish a LE Audio Bluetooth connection with an external terminal device and perform data transmission.
  • the master Bluetooth device sends the first LE Audio broadcast signal, and can send a broadcast triggering instruction to the slave Bluetooth device through the communication connection with the slave Bluetooth device.
  • the slave Bluetooth device can send a second LE Audio broadcast signal according to the broadcast triggering instruction, so that both the master Bluetooth device and the slave Bluetooth device can establish LE Audio Bluetooth connections with the terminal device respectively.
  • CSIP Coordinated Set Identification Profile
  • BLE Audio technology which allows multiple Bluetooth devices belonging to the same Bluetooth device set to reach coordination when interacting with external devices. synchronization purpose.
  • SIRK Set Identity Resolving Key, combined identification resolution value
  • Bluetooth devices with the same SIRK are identified as the same Bluetooth device set.
  • Each Bluetooth device belonging to the same Bluetooth device set can send LE Audio broadcast signals based on the same SIRK.
  • the master Bluetooth device may send a first LE Audio broadcast signal based on the target SIKR, and the slave Bluetooth device may also send a second LE Audio broadcast signal based on the target SIKR.
  • the terminal device If the terminal device first receives the first LE Audio broadcast signal sent by the main Bluetooth device in the Bluetooth device set, it can establish a LE Audio Bluetooth connection with the main Bluetooth device and obtain the SIRK corresponding to the main Bluetooth device (i.e., the target SIRK). .
  • the terminal device can receive the SIRK sent by the Bluetooth device during the process of establishing a LE Audio Bluetooth connection with the main Bluetooth device.
  • the LE Audio Bluetooth connection is established on the basis of the BLE connection.
  • the process of establishing the LE Audio Bluetooth connection may include querying some device parameters based on the BLE connection.
  • the query of the device parameters may include the SIRK query of the Bluetooth device.
  • the terminal device When the terminal device receives the second LE Audio broadcast signal sent from the Bluetooth device, it can determine whether the SIRK corresponding to the slave Bluetooth device is the same as the target SIRK based on the second LE Audio broadcast signal. If it is the same, it will automatically send the SIRK to the slave Bluetooth device.
  • the device sends a LE Audio Bluetooth connection request to establish a LE Audio Bluetooth connection with the slave Bluetooth device.
  • the LE Audio broadcast signal sent by the Bluetooth device may include special fields generated based on SIRK calculation.
  • the terminal device After the terminal device receives the second LE Audio broadcast signal sent from the Bluetooth device, it can analyze the second BLE Audio broadcast signal and obtain the target-specific broadcast information and special fields carried by the second LE Audio broadcast signal. According to the main Bluetooth The SIRK corresponding to the device (i.e., target SIRK) and the target specific broadcast information are calculated to obtain the target local value. If the target local value is the same as the special field, it can be determined that the master Bluetooth device and the slave Bluetooth device belong to the same Bluetooth device set, and automatically This sends a LE Audio Bluetooth connection request from the Bluetooth device.
  • the LE Audio broadcast signal may include RSI (resolvable Set Identifier, resolvable set identifier).
  • RSI may include two parts: 1.
  • the target-specific broadcast information obtained by the terminal device from parsing the second LE Audio broadcast signal sent by the Bluetooth device may be a random sequence of RSI, and the special field may be a hash sequence of the RSI carried by the second LE Audio broadcast signal.
  • the terminal device can calculate the target local value through the above formula based on the SIRK corresponding to the main Bluetooth device (i.e., the target SIRK) and the random sequence in the parsed RSI, and compare the target local value with the hash sequence of the parsed RSI. Yes, if they are consistent, it means that the SIKR of the master Bluetooth device is the same as the SIRK of the slave Bluetooth device (both are target SIRKs), then it can be determined that the master Bluetooth device and the slave Bluetooth device belong to the same Bluetooth device set.
  • BLE Audio technology does not distinguish the master-slave relationship of Bluetooth devices included in the Bluetooth device collection. Therefore, the above-mentioned master Bluetooth device and slave Bluetooth device are only used to explain different Bluetooth devices, rather than indicating the relationship between BLE devices. There is still a master-slave relationship in Audio technology.
  • FIG. 6 is a sequence diagram of a Bluetooth connection method in another embodiment.
  • the earphone device taking the above-mentioned Bluetooth device as the master earphone in the earphone device as an example, the earphone device also includes a slave earphone.
  • the main headset can enter the pairing state (turn on inquiry scan mode and page scan mode at the same time), and the terminal device can scan the headset device and obtain the device information of the headset device (including the classic Bluetooth address).
  • the terminal device can display the device information of the headset device, and the user can perform a connection operation for the device information (such as clicking a connection button corresponding to the headset device on the terminal device) to trigger a Bluetooth connection between the terminal device and the headset device.
  • the terminal device sends a classic Bluetooth connection request to the headset device.
  • the main headset can parse the COD field carried in the classic Bluetooth connection request, and determine whether the terminal device supports the Bluetooth low-power audio function based on the parsed COD field. If so, the security can be controlled. The connection function is on. If not, the secure connection function can be controlled to be off. The main headset then responds to the classic Bluetooth connection request sent by the terminal device and establishes a classic Bluetooth link with the terminal device.
  • the first LE Audio broadcast signal can be sent, and a broadcast triggering instruction can be sent to the slave headset to cause the slave headset to send the second LE Audio broadcast signal. If the secure connection function is turned off, the master earphone does not send the first LE Audio broadcast signal, and the slave earphone does not send the second LE Audio broadcast signal.
  • the terminal device After the terminal device establishes a classic Bluetooth link with the main headset, it can determine whether the headset device has enabled the secure connection function. If so, it can perform the CTKD process to convert the link key of the classic Bluetooth connection into the LTK of the BLE connection.
  • the terminal device receives the first LE Audio broadcast signal, it can be determined whether the main headset is in the white list and the terminal device can process the first LE Audio broadcast signal. Since the classic Bluetooth address of the main headset is the same as the BLE address, the terminal device establishes a classic Bluetooth link with the main headset. Therefore, the BLE address corresponding to the main headset is stored in the whitelist.
  • the terminal device supports the LE Audio function, so it can process the first LE Audio broadcast signal.
  • the terminal device can initiate a LE Audio Bluetooth connection with the main headset and send a LE Audio Bluetooth connection request to the main headset, thereby establishing a LE Audio connection with the main headset. Audio Bluetooth connection.
  • the terminal device receives the second LE Audio broadcast signal sent from the slave headset, it can determine that the slave headset and the master headset belong to the same Bluetooth device set, actively initiate a LE Audio Bluetooth connection to the slave headset, and establish a LE Audio Bluetooth connection with the slave headset.
  • the terminal device supports both classic Bluetooth and LE Audio functions, the user can trigger the terminal device and headphone device to establish a classic Bluetooth connection and LE Audio Bluetooth connection at the same time by performing a single connection operation, which is more convenient and faster.
  • the terminal device determines that the headset device has turned off the secure connection function, it will not perform the CTKD process, and will not initiate a LE Audio Bluetooth connection with the headset. It will only establish a classic Bluetooth connection with the headset device, thus avoiding the process for terminal devices that do not support the LE Audio function. Error, resulting in a situation where classic Bluetooth links are also adversely affected.
  • FIG. 7 is a sequence diagram of a terminal device establishing a LE Audio Bluetooth connection with two earphones of the earphone device in one embodiment.
  • the terminal device can turn on the scanning mode and scan the LE Audio broadcast signals sent by surrounding Bluetooth devices.
  • the main earphone in the earphone device sends the first LE Audio broadcast signal
  • the slave earphone sends the second LE Audio broadcast signal. If the terminal device first receives the first LE Audio broadcast signal sent by the main headset, it can establish a LE Audio Bluetooth connection with the main headset and obtain the SIKR of the main headset.
  • the terminal device After the terminal device receives the second LE Audio broadcast signal sent from the headset, it can calculate the target local value based on the SIRK of the main headset and the random sequence in the second LE Audio broadcast signal, and determine whether the target local value is consistent with the second LE Audio broadcast signal. Whether the hash sequence in the Audio broadcast signal is the same, if so, the terminal device can actively initiate a LE Audio Bluetooth connection with the slave headset, send a LE Audio connection request to the slave headset, and establish a LE Audio Bluetooth connection with the slave headset. The terminal device can obtain the SIRK of the slave earphone and determine whether the SIRK of the slave earphone is the same as the SIRK of the master earphone. If they are the same, the two earphones can be identified as belonging to the same group (set). If they are not the same, the two earphones can be identified as belonging to the same group (set). Only the headphones are identified as belonging to different groups.
  • a terminal device that supports the Bluetooth low-power audio function can establish a classic Bluetooth connection and a LE Audio Bluetooth connection with a Bluetooth device set at the same time.
  • a terminal device that does not support the Bluetooth low-power audio function can only establish a Bluetooth device set with the Bluetooth device set.
  • the classic Bluetooth connection does not perform the CTKD process, ensuring the stability and compatibility of the Bluetooth connection between the Bluetooth device collection and the terminal device that does not support the Bluetooth low energy audio function, and ensuring the communication between each Bluetooth device in the Bluetooth device collection. synchronized and coordinated use.
  • a Bluetooth connection method is provided, which can be applied to the above-mentioned terminal device.
  • the method may include the following steps:
  • Step 810 Send a classic Bluetooth connection request to the Bluetooth device, so that when the Bluetooth device determines that the terminal device supports the Bluetooth low-power audio function according to the classic Bluetooth connection request, the secure connection function is turned on. When the Bluetooth connection request determines that the terminal device does not support the Bluetooth low-power audio function, the secure connection function is controlled to be turned off.
  • step 810 includes: sending a classic Bluetooth connection request carrying a target field to the Bluetooth device; where, when the terminal device supports the Bluetooth low-power audio function, the target field contains the first identifier; in the terminal In the case where the device does not support the Bluetooth low energy audio function, the target field contains the second identifier.
  • Step 820 Establish a classic Bluetooth link with the Bluetooth device.
  • the method further includes: receiving the first LE Audio broadcast signal sent by the Bluetooth device; after establishing a classic Bluetooth link with the Bluetooth device, responding to the first LE Audio broadcast signal and initiating a LE Audio connection request to the Bluetooth device .
  • the step of responding to the first LE Audio broadcast signal and initiating a LE Audio connection request to the Bluetooth device includes: after establishing the classic Bluetooth link with the Bluetooth device, if it is determined Turn on Bluetooth device Full connection function responds to the first LE Audio broadcast signal and initiates a LE Audio connection request to the Bluetooth device.
  • the method further includes: if it is determined that the Bluetooth device has enabled the secure connection function, performing a CTKD process to convert the first key corresponding to the classic Bluetooth connection into the second key corresponding to the BLE connection.
  • the method further includes: if it is determined that the Bluetooth device has turned off the secure connection function, not performing the CTKD process.
  • the Bluetooth device can dynamically control the secure connection function to be on or off according to whether the terminal device supports the Bluetooth low-power audio function, which can avoid the situation when the terminal device does not support the Bluetooth low-power audio function.
  • the Bluetooth device turns on the secure connection function, causing the classic Bluetooth connection between the terminal device and the Bluetooth device to be affected, which can improve the stability and compatibility of establishing Bluetooth connections between electronic devices, or in some cases avoid establishing unnecessary BLE connect.
  • a Bluetooth connection method is provided, which can be applied to a headset device.
  • the headset device can include a master headset and a slave headset.
  • the method can include the following steps:
  • Step 910 The main headset receives the classic Bluetooth connection request sent by the terminal device.
  • the method also includes: the main headset parses the classic Bluetooth connection request to extract the target field contained in the classic Bluetooth connection request; the main headset determines whether the terminal device supports Bluetooth Low based on the target field. Power consumption audio features.
  • Step 920 When the master headset determines that the terminal device supports the Bluetooth low-power audio function according to the classic Bluetooth connection request, control the secure connection function of the headset device to be turned on.
  • Step 930 When the main headset determines that the terminal device does not support the Bluetooth low-power audio function according to the classic Bluetooth connection request, the secure connection function is controlled to be turned off.
  • Step 940 The main headset responds to the classic Bluetooth connection request and establishes a classic Bluetooth link with the terminal device.
  • the method when the secure connection function of the headset device is turned on, the method further includes: the main headset sends a first LE Audio broadcast signal, and the first LE Audio broadcast signal can trigger the reception of the first LE Audio
  • the classic Bluetooth address of the main headset is the same as the BLE address.
  • the method when the secure connection function of the headset device is turned on, the method further includes: the master headset sends a broadcast trigger instruction to the slave headset; the slave headset sends a second LE Audio broadcast signal according to the broadcast trigger instruction, The second LE Audio broadcast signal can trigger the terminal device that receives the second LE Audio broadcast signal to initiate a LE Audio connection request to the slave headset.
  • the main earphone in the earphone device can dynamically control the secure connection function of the earphone device to be on or off according to whether the terminal device supports the Bluetooth low-power audio function, and dynamically decide whether to send the first LE Audio Broadcast signals and control the sending of the second LE Audio broadcast signal from the headset.
  • Terminal devices that support the Bluetooth low-power audio function can establish classic Bluetooth connections and LE Audio Bluetooth connections with the headset device at the same time.
  • Terminal devices that do not support the Bluetooth low-power audio function Only a classic Bluetooth connection is established with the headset device without CTKD process, which ensures the stability and compatibility of the Bluetooth connection between the headset device and the terminal device that does not support Bluetooth low-power audio function, and ensures that each headset in the headset device Synchronization and coordination between use.
  • a Bluetooth connection device 1000 is provided, which can be applied to the above-mentioned Bluetooth device.
  • the Bluetooth connection device 1000 includes a request receiving module 1010 , a function control module 1020 and a connection module 1030 .
  • the request receiving module 1010 is used to receive a classic Bluetooth connection request sent by the terminal device.
  • the function control module 1020 is used to control the secure connection function to be on when it is determined that the terminal device supports the Bluetooth low energy audio function according to the classic Bluetooth connection request; the secure connection function is used to indicate that the secure connection function can be enabled based on the classic Bluetooth link. Function to perform pairing operation of BLE connection.
  • the function control module 1020 is also used to control the secure connection function to be turned off when it is determined according to the classic Bluetooth connection request that the terminal device does not support the Bluetooth low-power audio function.
  • the connection module 1030 is used to respond to the classic Bluetooth connection request and establish a classic Bluetooth link with the terminal device.
  • the Bluetooth connection device 1000 further includes a parsing module.
  • the parsing module is used to parse the classic Bluetooth connection request to extract the target field contained in the classic Bluetooth connection request; and determine whether the terminal device supports the Bluetooth low-power audio function based on the target field.
  • the parsing module is also used to determine that the terminal device supports Bluetooth low energy consumption if the target field contains the first identifier. frequency function; if the target field contains the second identifier, it is determined that the terminal device does not support the Bluetooth low-power audio function.
  • the secure connection function of the Bluetooth device when the secure connection function of the Bluetooth device is turned on, the secure connection function is used to trigger the terminal device to perform the CTKD process after establishing a classic Bluetooth link with the Bluetooth device, and transfer the third link corresponding to the classic Bluetooth connection to The first key is converted into the second key corresponding to the BLE connection.
  • the terminal device when the secure connection function of the Bluetooth device is turned off, the terminal device does not perform the CTKD process after establishing a classic Bluetooth link with the Bluetooth device.
  • the classic Bluetooth address of the Bluetooth device is the same as the BLE address.
  • the Bluetooth connection device 1000 further includes a broadcast module.
  • the broadcast module is used to send the first LE Audio broadcast signal.
  • the first LE Audio broadcast signal can trigger the terminal device that receives the first LE Audio broadcast signal. After establishing a classic Bluetooth link with the Bluetooth device, initiate LE Audio to the Bluetooth device. connection request.
  • the first LE Audio broadcast signal can trigger the terminal device that receives the first LE Audio broadcast signal to, after establishing a classic Bluetooth link with the Bluetooth device, and determine that the Bluetooth device has turned on the secure connection function.
  • the Bluetooth device initiates a LE Audio connection request.
  • the broadcast module is also used to send the first LE Audio broadcast signal when it is determined that the terminal device supports the Bluetooth low-power audio function according to the classic Bluetooth connection request; or, when the secure connection function is turned on , after establishing a classic Bluetooth link with the terminal device, send the first LE Audio broadcast signal; or, after establishing a classic Bluetooth link with the terminal device, send the first LE Audio broadcast signal.
  • the timing of sending the first LE Audio broadcast signal there is no limit on the timing of sending the first LE Audio broadcast signal.
  • the Bluetooth connection device 1000 further includes an instruction sending module.
  • the instruction sending module is used to send a broadcast trigger instruction to the slave Bluetooth device in the Bluetooth device set.
  • the broadcast trigger instruction is used to instruct the slave Bluetooth device to send a second LE Audio broadcast signal.
  • the second LE Audio broadcast signal can trigger the reception of the second LE
  • the terminal device that broadcasts Audio signals initiates a LE Audio connection request to the slave Bluetooth device.
  • the Bluetooth device can dynamically control the secure connection function to be on or off according to whether the terminal device supports the Bluetooth low-power audio function, which can avoid the situation when the terminal device does not support the Bluetooth low-power audio function.
  • the Bluetooth device turns on the secure connection function, which affects the classic Bluetooth connection between the terminal device and the Bluetooth device, which can improve the stability and compatibility of establishing Bluetooth connections between electronic devices.
  • a Bluetooth connection device 1100 is provided, which can be applied to the above-mentioned terminal device.
  • the Bluetooth connection device 1100 includes a request sending module 1110 and a connection module 1120.
  • the request sending module 1110 is used to send a classic Bluetooth connection request to the Bluetooth device, so that when the Bluetooth device determines that the terminal device supports the Bluetooth low-power audio function according to the classic Bluetooth connection request, the secure connection function is turned on.
  • the classic Bluetooth connection request determines that the terminal device does not support the Bluetooth low energy audio function
  • the secure connection function is controlled to be turned off; the secure connection function is used to indicate the function of pairing the BLE connection based on the classic Bluetooth link. .
  • the request sending module 1110 is also configured to send a classic Bluetooth connection request carrying a target field to the Bluetooth device; where, when the terminal device supports the Bluetooth low-power audio function, the target field contains the first identifier ; In the case where the terminal device does not support the Bluetooth low energy audio function, the target field contains the second identifier.
  • connection module 1120 is used to establish a classic Bluetooth link with a Bluetooth device.
  • the Bluetooth connection device 1100 further includes a broadcast receiving module.
  • the broadcast receiving module is used to receive the first LE Audio broadcast signal sent by the Bluetooth device.
  • connection module 1120 is also used to respond to the first LE Audio broadcast signal and initiate a LE Audio connection request to the Bluetooth device after establishing a classic Bluetooth link with the Bluetooth device.
  • connection module 1120 is also used to, after establishing a classic Bluetooth link with the Bluetooth device, if it is determined that the Bluetooth device has enabled the secure connection function, respond to the first LE Audio broadcast signal and initiate a LE Audio connection request to the Bluetooth device. .
  • the Bluetooth connection device 1100 further includes a conversion module.
  • the conversion module is used to perform the CTKD process to convert the first key corresponding to the classic Bluetooth connection into the second key corresponding to the BLE connection if it is determined that the Bluetooth device has enabled the secure connection function after establishing a classic Bluetooth link with the Bluetooth device. .
  • the conversion module is also configured to not perform the CTKD process if it is determined that the Bluetooth device has turned off the secure connection function after establishing a classic Bluetooth link with the Bluetooth device.
  • the Bluetooth device can dynamically control the secure connection function to be on or off according to whether the terminal device supports the Bluetooth low-power audio function, which can avoid the situation when the terminal device does not support the Bluetooth low-power audio function.
  • the Bluetooth device turns on the secure connection function, which affects the classic Bluetooth connection between the terminal device and the Bluetooth device, which can improve the stability and compatibility of establishing Bluetooth connections between electronic devices.
  • a Bluetooth connection device 1200 is provided, which can be applied to a headset device.
  • the headset device includes a master headset and a slave headset.
  • the Bluetooth connection device 1200 includes a receiving module 1210, a function control module 1220 and a connection module. Module 1230.
  • the receiving module 1210 is used to receive the classic Bluetooth connection request sent by the terminal device through the main headset.
  • the function control module 1220 is used to control the secure connection function of the headset device to be on through the main headset when the main headset determines that the terminal device supports the Bluetooth low-power audio function according to the classic Bluetooth connection request; the safe connection function is used to indicate that it can The function of pairing operation of BLE connection based on the classic Bluetooth link.
  • the function control module 1220 is also used to control the secure connection function to be turned off through the main headset when the main headset determines that the terminal device does not support the Bluetooth low-power audio function based on the classic Bluetooth connection request.
  • the connection module 1230 is used to respond to the classic Bluetooth connection request through the main headset and establish a classic Bluetooth link with the terminal device.
  • the Bluetooth connection device 1200 further includes a parsing module.
  • the parsing module is used to parse the classic Bluetooth connection request through the main headset to extract the target field contained in the classic Bluetooth connection request; the main headset determines whether the terminal device supports the Bluetooth low-power audio function based on the target field.
  • the Bluetooth connection device 1200 further includes a broadcast module.
  • the broadcast module is used to send the first LE Audio broadcast signal through the main earphone when the secure connection function of the headset device is turned on.
  • the first LE Audio broadcast signal can trigger the terminal device that receives the first LE Audio broadcast signal. , after establishing a classic Bluetooth link with the main headset, initiate a LE Audio connection request to the main headset.
  • the classic Bluetooth address of the main headset is the same as the BLE address.
  • the Bluetooth connection device 1200 further includes an instruction sending module.
  • the command sending module is used to send a broadcast triggering command to the slave headset through the master headset when the secure connection function of the headset device is turned on.
  • the broadcast module is also used to send a second LE Audio broadcast signal through the slave earphone according to the broadcast trigger instruction.
  • the second LE Audio broadcast signal can trigger the terminal device that receives the second LE Audio broadcast signal to initiate a LE Audio connection request to the slave earphone. .
  • the main earphone in the earphone device can dynamically control the secure connection function of the earphone device to be on or off according to whether the terminal device supports the Bluetooth low-power audio function, and dynamically decide whether to send the first LE Audio Broadcast signals and control the sending of the second LE Audio broadcast signal from the headset.
  • Terminal devices that support the Bluetooth low-power audio function can establish classic Bluetooth connections and LE Audio Bluetooth connections with the headset device at the same time.
  • Terminal devices that do not support the Bluetooth low-power audio function Only a classic Bluetooth connection is established with the headset device without CTKD process, which ensures the stability and compatibility of the Bluetooth connection between the headset device and the terminal device that does not support Bluetooth low-power audio function, and ensures that each headset in the headset device The synchronization and coordination between them can also prevent some Bluetooth dual-mode terminal devices from establishing unnecessary BLE connections when they do not support the LE Audio function.
  • FIG 13 is a structural block diagram of a Bluetooth device in one embodiment.
  • the Bluetooth device 1300 may include one or more of the following components: a processor 1310, a memory 1320 coupled to the processor 1310, where the memory 1320 may store one or more computer programs, and one or more computer programs. It can be configured to be executed by one or more processors 1310, so that the Bluetooth device 1300 implements the Bluetooth connection method applied to the Bluetooth device as described in the above embodiments.
  • Processor 1310 may include one or more processing cores.
  • the processor 1310 uses various interfaces and lines to connect various parts of the entire Bluetooth device 1300, and executes by running or executing instructions, programs, code sets or instruction sets stored in the memory 1320, and calling data stored in the memory 1320.
  • the processor 1310 can use at least one of digital signal processing (Digital Signal Processing, DSP), field-programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA).
  • the processor 1310 may integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processor (Graphics Processing Unit, GPU), a modem, etc.
  • CPU Central Processing Unit
  • GPU Graphics Processing Unit
  • modem etc.
  • the CPU mainly handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the display content; and the modem is used to handle wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 1310 and may be implemented solely through a communication chip.
  • the memory 1320 may include random access memory (RAM) or read-only memory (Read-Only Memory, ROM). Memory 1320 may be used to store instructions, programs, codes, sets of codes, or sets of instructions.
  • the memory 1320 may include a program storage area and a data storage area, where the program storage area may store instructions for implementing an operating system and instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.) , instructions for implementing each of the above method embodiments, etc.
  • the storage data area can also store data created during use of the Bluetooth device 1300, etc.
  • the Bluetooth device 1300 may also include a communication unit, such as a Bluetooth module.
  • the Bluetooth module may be used to provide a Bluetooth communication function and interact with the second electronic device.
  • the device establishes a Bluetooth connection and performs Bluetooth data transmission.
  • the Bluetooth module can support one or more Bluetooth protocols, such as classic Bluetooth, BLE, BLE Audio, etc.), but is not limited to this and can change with the development of the Bluetooth protocol.
  • An embodiment of the present application discloses a terminal device, which includes a memory, a processor and a communication unit.
  • a computer program is stored in the memory.
  • the terminal device implements the applications described in the above embodiments. Bluetooth connection method of terminal device.
  • An embodiment of the present application discloses a headphone device, which includes a memory, a processor and a communication unit.
  • a computer program is stored in the memory.
  • the headphone device implements the applications described in the above embodiments. Bluetooth connection method for headset devices.
  • Embodiments of the present application disclose a computer-readable storage medium that stores a computer program, wherein when the computer program is executed by a processor in an electronic device, the electronic device implements Bluetooth applied to Bluetooth devices as described in the above embodiments. connection method.
  • Embodiments of the present application disclose a computer-readable storage medium that stores a computer program.
  • the computer program When executed by a processor in an electronic device, the electronic device implements Bluetooth applied to terminal devices as described in the above embodiments. connection method.
  • Embodiments of the present application disclose a computer-readable storage medium that stores a computer program.
  • the computer program When executed by a processor in an electronic device, the electronic device implements Bluetooth applied to a headset device as described in the above embodiments. connection method.
  • An embodiment of the present application discloses a computer program product.
  • the computer program product includes a non-transitory computer-readable storage medium storing a computer program.
  • the computer program can be executed by a processor in an electronic device, the electronic device implements the following:
  • the above embodiments describe a Bluetooth connection method applied to a Bluetooth device.
  • An embodiment of the present application discloses a computer program product.
  • the computer program product includes a non-transitory computer-readable storage medium storing a computer program.
  • the computer program can be executed by a processor in an electronic device, the electronic device implements the following:
  • the above embodiments describe the Bluetooth connection method applied to the terminal device.
  • An embodiment of the present application discloses a computer program product.
  • the computer program product includes a non-transitory computer-readable storage medium storing a computer program.
  • the computer program can be executed by a processor in an electronic device, the electronic device implements the following:
  • the above embodiments describe the Bluetooth connection method applied to the headset device.
  • the programs can be stored in a non-volatile computer-readable storage medium. , when the program is executed, it may include the processes of the above-mentioned method embodiments.
  • the storage medium may be a magnetic disk, an optical disk, a ROM, etc.
  • Non-volatile memory may include ROM, programmable ROM (PROM), erasable PROM (Erasable PROM, EPROM), electrically erasable PROM (Electrically Erasable PROM, EEPROM) or flash memory.
  • Volatile memory may include random access memory (RAM), which acts as external cache memory.
  • RAM can be in many forms, such as static RAM (Static RAM, SRAM), dynamic RAM (Dynamic Random Access Memory, DRAM), synchronous DRAM (synchronous DRAM, SDRAM), double data rate SDRAM (Double Data Rate SDRAM, DDR SDRAM), enhanced SDRAM (Enhanced Synchronous DRAM, ESDRAM), synchronous link DRAM (Synchlink DRAM, SLDRAM), memory bus direct RAM (Rambus DRAM, RDRAM) and direct memory bus dynamic RAM (Direct Rambus DRAM , DRDRAM).
  • static RAM Static RAM, SRAM
  • dynamic RAM Dynamic Random Access Memory
  • DRAM Dynamic Random Access Memory
  • SDRAM synchronous DRAM
  • double data rate SDRAM Double Data Rate SDRAM, DDR SDRAM
  • enhanced SDRAM Enhanced Synchronous DRAM, ESDRAM
  • synchronous link DRAM Synchlink DRAM, SLDRAM
  • memory bus direct RAM Rabus DRAM, RDRAM
  • DRDRAM direct memory bus dynamic RAM
  • DRDRAM Direct Rambus DRAM
  • the units described above as separate components may or may not be physically separated.
  • the components shown as units may or may not be physical units, that is, they may be located in one place, or they may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of this embodiment.
  • each functional unit in each embodiment of the present application can be integrated into one processing unit, each unit can exist physically alone, or two or more units can be integrated into one unit.
  • the above integrated units can be implemented in the form of hardware or software functional units.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Telephone Function (AREA)

Abstract

本申请实施例公开了一种蓝牙连接方法、装置、电子设备及计算机可读存储介质。该方法应用于蓝牙设备,该方法包括:接收终端设备发送的经典蓝牙连接请求;在根据经典蓝牙连接请求确定终端设备支持蓝牙低功耗音频功能的情况下,控制安全连接功能处于开启状态;所述安全连接功能用于指示能够在经典蓝牙链路的基础上进行BLE连接的配对操作的功能;在根据经典蓝牙连接请求确定终端设备不支持蓝牙低功耗音频功能的情况下,控制所述安全连接功能处于关闭状态;响应所述经典蓝牙连接请求,与所述终端设备建立经典蓝牙链路。

Description

蓝牙连接方法、装置、电子设备及计算机可读存储介质
本申请要求于2022年07月22日提交、申请号为202210868499.2、发明名称为“蓝牙连接方法、 装置、电子设备及计算机可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请 中。
技术领域
本申请涉及通信技术领域,具体涉及一种蓝牙连接方法、装置、电子设备及计算机可读存储介质。
背景技术
随着蓝牙技术的发展,蓝牙技术联盟发布的蓝牙通信标准协议也一直在更新变化,如从最早的经典蓝牙标准协议,到BLE(Bluetooth Low Energy,蓝牙低功耗)标准协议,再到BLE Audio(Bluetooth Low Energy Audio,蓝牙低功耗音频)标准协议等。目前,对于电子设备之间建立蓝牙连接的稳定性及兼容性,还有待改进的地方。
发明内容
本申请实施例公开了一种蓝牙连接方法、装置、电子设备及计算机可读存储介质。
本申请实施例公开了一种蓝牙连接方法,应用于蓝牙设备,所述方法包括:
接收终端设备发送的经典蓝牙连接请求;
在根据所述经典蓝牙连接请求确定所述终端设备支持蓝牙低功耗音频功能的情况下,控制安全连接功能处于开启状态;所述安全连接功能用于指示能够在经典蓝牙链路的基础上进行BLE连接的配对操作的功能;
在根据所述经典蓝牙连接请求确定所述终端设备不支持所述蓝牙低功耗音频功能的情况下,控制所述安全连接功能处于关闭状态;
响应所述经典蓝牙连接请求,与所述终端设备建立经典蓝牙链路。
本申请实施例公开了一种蓝牙连接方法,应用于终端设备,所述方法包括:
向蓝牙设备发送经典蓝牙连接请求,以使所述蓝牙设备在根据所述经典蓝牙连接请求确定所述终端设备支持蓝牙低功耗音频功能的情况下,控制安全连接功能处于开启状态,在根据所述经典蓝牙连接请求确定所述终端设备不支持所述蓝牙低功耗音频功能的情况下,控制所述安全连接功能处于关闭状态;所述安全连接功能用于指示能够在经典蓝牙链路的基础上进行BLE连接的配对操作的功能;
与所述蓝牙设备建立经典蓝牙链路。
本申请实施例公开了一种蓝牙连接方法,应用于耳机设备,所述耳机设备包括主耳机及从耳机,所述方法包括:
所述主耳机接收终端设备发送的经典蓝牙连接请求;
在所述主耳机根据所述经典蓝牙连接请求确定所述终端设备支持蓝牙低功耗音频功能的情况下,控制所述耳机设备的安全连接功能处于开启状态;所述安全连接功能用于指示能够在经典蓝牙链路的基础上进行BLE连接的配对操作的功能;
在所述主耳机根据所述经典蓝牙连接请求确定所述终端设备不支持所述蓝牙低功耗音频功能的情况下,控制所述安全连接功能处于关闭状态;
所述主耳机响应所述经典蓝牙连接请求,与所述终端设备建立经典蓝牙链路。
本申请实施例公开了一种蓝牙连接装置,应用于蓝牙设备,所述装置包括:
请求接收模块,用于接收终端设备发送的经典蓝牙连接请求;
功能控制模块,用于在根据所述经典蓝牙连接请求确定所述终端设备支持蓝牙低功耗音频功能的情况下,控制安全连接功能处于开启状态;所述安全连接功能用于指示能够在经典蓝牙链路的基础上进行BLE连接的配对操作的功能;
所述功能控制模块,还用于在根据所述经典蓝牙连接请求确定所述终端设备不支持所述蓝牙低功耗音频功能的情况下,控制所述安全连接功能处于关闭状态;
连接模块,用于响应所述经典蓝牙连接请求,与所述终端设备建立经典蓝牙链路。
本申请实施例公开了一种蓝牙连接装置,应用于终端设备,所述装置包括:
请求发送模块,用于向蓝牙设备发送经典蓝牙连接请求,以使所述蓝牙设备在根据所述经典蓝牙连接请求确定所述终端设备支持蓝牙低功耗音频功能的情况下,控制安全连接功能处于开启状态,在根据所述经典蓝牙连接请求确定所述终端设备不支持所述蓝牙低功耗音频功能的情况下,控制所述安全连接功能处于关闭状态;所述安全连接功能用于指示能够在经典蓝牙链路的基础上进行BLE连接的配对操作的功能;
连接模块,用于与所述蓝牙设备建立经典蓝牙链路。
本申请实施例公开了一种蓝牙连接装置,应用于耳机设备,所述耳机设备包括主耳机及从耳机,所述装置包括:
接收模块,用于通过所述主耳机接收终端设备发送的经典蓝牙连接请求;
功能控制模块,用于在所述主耳机根据所述经典蓝牙连接请求确定所述终端设备支持蓝牙低功耗音频功能的情况下,通过所述主耳机控制所述耳机设备的安全连接功能处于开启状态;所述安全连接功能用于指示能够在经典蓝牙链路的基础上进行BLE连接的配对操作的功能;
所述功能控制模块,还用于在所述主耳机根据所述经典蓝牙连接请求确定所述终端设备不支持所述蓝牙低功耗音频功能的情况下,通过所述主耳机控制所述安全连接功能处于关闭状态;
连接模块,用于通过所述主耳机响应所述经典蓝牙连接请求,与所述终端设备建立经典蓝牙链路。
本申请实施例公开了一种电子设备,包括存储器、处理器及通信单元,所述存储器中存储有计算机程序,所述计算机程序被所述处理器执行时,使得所述电子设备实现如上任一实施例所述的方法。
本申请实施例公开了一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被电子设备中的处理器执行时,使得所述电子设备实现如上任一实施例所述的方法。
本申请的一个或多个实施例的细节在下面的附图和描述中提出。本申请的其它特征和有益效果将从说明书、附图以及权利要求书中体现。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1A为一个实施例中蓝牙连接方法的应用场景图;
图1B为另一个实施例中蓝牙连接方法的应用场景图;
图2为一个实施例中蓝牙连接方法的流程图;
图3为一个实施例中蓝牙连接方法的时序图;
图4为另一个实施例中蓝牙连接方法的时序图;
图5为一个实施例中LE Audio广播信号的结构示意图;
图6为另一个实施例中蓝牙连接方法的时序图;
图7为一个实施例中终端设备分别与耳机设备的两只耳机建立LE Audio蓝牙连接的时序图;
图8为另一个实施例中蓝牙连接方法的流程图;
图9为又一个实施例中蓝牙连接方法的流程图;
图10为一个实施例中蓝牙连接装置的框图;
图11为另一个实施例中蓝牙连接装置的框图;
图12为又一个实施例中蓝牙连接装置的框图;
图13为一个实施例中蓝牙设备的结构框图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
需要说明的是,本申请实施例及附图中的术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、***、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。
可以理解,本申请所使用的术语“第一”、“第二”等可在本文中用于描述各种元件,但这些元件 不受这些术语限制。这些术语仅用于将一个元件与另一个元件区分。举例来说,在不脱离本申请的范围的情况下,可以将第一密钥称为第二密钥,且类似地,可将第二密钥称为第一密钥。第一密钥和第二密钥两者都是密钥,但其不是同一个密钥。本申请所使用的术语“多个”指的是两个及两个以上。本申请所使用的术语“和/或”指的是其中的一种方案,或是其中多种方案的任意组合。在不冲突的情况,本申请中各实施例、实施方式及其技术特征可以任意组合。
图1A为一个实施例中蓝牙连接方法的应用场景图。如图1A所示,蓝牙设备10可与终端设备20建立蓝牙连接,其中,蓝牙设备10可包括但不限于车载终端、可穿戴设备、音箱设备、蓝牙耳机、智能家居设备等支持蓝牙通信功能的电子设备,进一步地,蓝牙设备10可以是TWS(True Wireless Stereo,真无线立体声)耳机等。终端设备20可包括但不限于手机、可穿戴设备、车载终端、平板电脑、PC(Personal Computer,个人电脑)、PDA(Personal Digital Assistant,个人数字助理)等设备。
在本申请实施例中,蓝牙设备10可以是支持蓝牙双模的电子设备,支持蓝牙双模的电子设备可指的是同时支持经典蓝牙协议及BLE(Bluetooth Low Energy,蓝牙低功耗)协议的电子设备。其中,经典蓝牙协议通常泛指在蓝牙协议4.0版本以下的蓝牙协议,BLE协议通常泛指在蓝牙协议4.0版本以上的蓝牙协议。进一步地,蓝牙设备10可以是支持经典蓝牙协议及BLE Audio(Bluetooth Low Energy Audio,蓝牙低功耗音频)协议的电子设备。BLE Audio技术解决了利用BLE连接只能传输数据量较小的数据,而不能传输音频数据的问题,BLE Audio协议支持LC3(Low Complexity Communications Codec,低功耗音频编解码)编码的音频数据,使得音频数据的传输能够更好地兼顾功耗、实时性及音质等各方面的问题。需要说明的是,本申请中使用的BLE Audio和LE Audio可以指的是同一个概念,用词上可以相互替换使用,均可以是指基于蓝牙5.2版本规范设定的新一代蓝牙音频技术标准,例如可以支持低功耗音频解码器LC3,可以支持多重串流音频、可以支持广播音频技术等。
为了满足用户在不同场景下对于音频传输的需求,例如,用户在收听高清音乐时,基于经典蓝牙协议传输的LDAC编码的音质可能比BLE Audio协议支持的LC3编码的音质好,因此可基于经典蓝牙协议进行音频数据传输;用户在通过终端设备玩游戏时,基于BLE Audio协议进行音频数据传输可减延延迟等。蓝牙设备10可同时与终端设备20建立经典蓝牙连接及LE Audio蓝牙连接。
在相关技术中,在终端设备20想要同时与蓝牙设备10建立经典蓝牙连接及LE Audio蓝牙连接时,在蓝牙标准中规范有一套CTKD(Cross-Transport Key Derivation,交叉传输密钥派生)方案,能够将BLE连接的密钥与经典蓝牙连接的密钥进行相互转换,从而实现用户在终端设备20上触发一次连接操作即可实现让终端设备20同时与蓝牙设备10建立经典蓝牙连接及LE Audio蓝牙连接。但是由于CTKD方案是属于蓝牙标准5.0后推出的功能,并不是所有的终端设备20都能够支持CTKD方案,例如,有些终端设备20不支持BLE Audio协议等。但是对于这种不支持BLE Audio协议的终端设备20其可能是支持经典蓝牙BT和低功耗蓝牙BLE的双模设备,这种双模设备也具有安全连接功能,进而导致不支持BLE Audio协议的终端设备20执行CTKD流程进而与蓝牙设备10进行经典蓝牙连接及BLE连接,例如,不支持BLE Audio协议的终端设备20先与蓝牙设备10建立经典蓝牙连接并触发CTKD方案,得到BLE连接的密钥,有的情况下终端设备会再利用该BLE连接的密钥与蓝牙设备10建立BLE连接,对于不支持BLE Audio功能的蓝牙设备,建立这两种连接可能没有实质意义,此外,有的情况下,也可能导致蓝牙连接过程中发生错误,可能导致终端设备20与蓝牙设备10的经典蓝牙连接都受到不良影响,存在蓝牙连接的稳定性及兼容性风险。在本申请实施例中,蓝牙设备10可接收终端设备20发送的经典蓝牙连接请求,并根据该经典蓝牙连接请求判断终端设备20是否支持蓝牙低功耗音频功能(LE Audio功能)。在蓝牙设备10根据该经典蓝牙连接确定终端设备20支持蓝牙低功耗音频功能的情况下,控制安全连接功能处于开启状态,在蓝牙设备10根据该经典蓝牙连接确定终端设备20不支持蓝牙低功耗音频功能的情况下,控制安全连接功能处于关闭状态。其中,安全连接功能用于指示能够在经典蓝牙链路的基础上进行BLE连接的配对操作的功能。然后蓝牙设备10再响应终端设备20发送的经典蓝牙连接请求,与终端设备20建立经典蓝牙链路。蓝牙设备10可根据终端设备20是否支持蓝牙低功耗音频功能,动态控制安全连接功能处于开启状态或关闭状态,在终端设备20不支持LE Audio功能的情况下,让安全连接功能处于关闭状态,从而可避免终端设备20在不支持LE Audio功能的情况下触发进行CTKD流程,保证了蓝牙设备10与不支持LE Audio功能的终端设备20之间的蓝牙连接的稳定性及兼容性。
需要说明的是,经典蓝牙链路可包括但不限于ACL(Asynchronous Connectionless,异步无链接)、SCO(Synchronous Connection Oriented,同步定向链接)等链路。蓝牙设备10与终端设备20可在经典蓝牙链路的基础上,进一步建立A2DP(Advanced Audio Distribution Profile,蓝牙音频传输模型协定)、HFP(Hands-free Profile)等业务连接,从而终端设备与蓝牙设备之间可传输音频数据、语音数据等业务 数据。
图1B为另一个实施例中蓝牙连接方法的应用场景图。如图1B所示,在一些实施例中,蓝牙设备10可包括耳机设备,在经典蓝牙通信中,耳机设备包括的两只耳机之间可区分主从关系,耳机设备包括主耳机110及从耳机120,主耳机110与从耳机120之间可建立有通信连接(如蓝牙连接等)。
主耳机110可接收终端设备20发送的经典蓝牙连接请求,并根据该经典蓝牙连接请求判断终端设备20是否支持蓝牙低功耗音频功能。若终端设备20支持蓝牙低功耗音频功能,则主耳机110可控制耳机设备的安全连接功能处于开启状态,若终端设备20不支持蓝牙低功耗音频功能,则主耳机110可控制耳机设备的安全连接功能处于关闭状态。主耳机110可再响应终端设备20发送的经典蓝牙连接请求,与终端设备20建立经典蓝牙链路。
在主耳机110与终端设备20之间建立经典蓝牙链路之后,从耳机120可以通过与主耳机110之间的通信连接,获取主耳机110与终端设备20之间的经典蓝牙连接信息等,从而可以采用监听的方式监听主耳机110与终端设备20之间基于经典蓝牙链路进行的数据传输,实现主从耳机的同步。作为一种实施方式,也可以是主耳机110与终端设备20建立经典蓝牙链路,且主耳机110与从耳机120建立通信连接,在主耳机110接收到终端设备20通过经典蓝牙链路传输的数据时,主耳机110可将传输的数据转发给从耳机120,实现主从耳机的同步。
在耳机设备与终端设备20均支持经典蓝牙又均支持LE Audio功能的情况下,耳机设备还可与终端设备20建立LE Audio蓝牙连接,在LE Audio蓝牙通信中,耳机设备可不区分主从关系,耳机设备的两只耳机可分别与终端设备20建立LE Audio蓝牙连接。作为另一种实施方式,在LE Audio蓝牙通信中,耳机设备包括的两只耳机之间也可区分主从关系。其中,主耳机110可与终端设备20建立LE Audio蓝牙连接,从耳机120可通过与主耳机110之间的通信连接,获取主耳机110与终端设备20之间的LE Audio蓝牙连接信息等,并采用监听的方式监听主耳机110与终端设备20之间通过LE Audio蓝牙连接进行的数据传输,实现主从耳机的同步;或者,在主耳机110接收到终端设备20通过LE Audio蓝牙连接传输的数据时,主耳机110可将传输的数据转发给从耳机120,实现主从耳机的同步。示例的,耳机设备与终端设备可以是均为支持经典蓝牙和LE Audio蓝牙的双模蓝牙设备,而终端设备也可以是不支持LE Audio蓝牙的双模蓝牙设备(例如支持经典蓝牙和BLE蓝牙的双模蓝牙设备),这种不支持LE Audio蓝牙的双模蓝牙设备其安全连接功能也可能是开启的。
如图2所示,在一个实施例中,提供一种蓝牙连接方法,可应用于上述的蓝牙设备(例如支持经典蓝牙和LE Audio蓝牙的双模蓝牙设备),该方法可包括以下步骤:
步骤210,接收终端设备发送的经典蓝牙连接请求。
在一些实施例中,蓝牙设备可处于配对状态,在该配对状态下蓝牙设备可同时开启inquiry scan(查询扫描)模式及page scan(寻呼扫描)模式。蓝牙设备在inquiry scan模式下,允许被其它设备扫描搜索到,蓝牙设备在page scan模式下,能够接收到其它设备发送的经典蓝牙连接请求并进行响应。也即,在蓝牙设备处于配对状态时,蓝牙设备处于同时处于可发现状态及可连接状态。终端设备可以是之前未与蓝牙设备建立过经典蓝牙连接的设备,或是之前建立过经典蓝牙连接但是未存储有蓝牙设备对应的连接记录的设备。该连接记录可包括蓝牙设备的设备信息、配对信息(例如密钥、配对码等)等信息。终端设备可扫描到处于配对状态的蓝牙设备,从而获取蓝牙设备的设备信息,并根据该蓝牙设备的设备信息向蓝牙设备发送经典蓝牙连接请求。
可选地,终端设备可开启扫描模式,并对周围的蓝牙设备进行扫描,终端设备可向蓝牙设备发送扫描请求(inquiry request),蓝牙设备接收到该扫描请求向可向终端设备返回扫描响应(inquiry respond)。终端设备可根据接收的扫描响应获取蓝牙设备的设备信息,该设备信息可包括但不限于蓝牙设备的蓝牙地址(如经典蓝牙地址等)、蓝牙设备的设备名称、MAC地址等中的一种或多种。进一步地,终端设备可显示蓝牙设备的设备信息,用户可进行针对该设备信息的连接操作,以触发终端设备与蓝牙设备进行蓝牙连接。终端设备可响应于针对该蓝牙设备的设备信息的连接操作,根据该蓝牙设备的设备信息向蓝牙设备发送经典蓝牙连接请求。
作为另一种实施方式,终端设备也可以是与蓝牙设备建立过经典蓝牙连接并进行过配对的设备,终端设备可存储有蓝牙设备对应的连接记录。终端设备可根据该连接记录获取蓝牙设备的设备信息,并根据该设备信息向蓝牙设备发送经典蓝牙连接请求。
作为一种具体实施方式,上述的经典蓝牙连接请求可为寻呼(page)数据包,终端设备可采用跳频的方式发送寻呼数据包,以对蓝牙设备进行寻呼,开启page scan模式的蓝牙设备可采用固定间隔地扫描(scan)外部发送的寻呼数据包,如终端设备发送的寻呼数据包,即接收到终端设备发送的经典蓝牙 连接请求。
步骤220,根据经典蓝牙连接请求判断终端设备是否支持蓝牙低功耗音频功能,若是,则执行步骤230,若否,则执行步骤240。
蓝牙设备接收到终端设备发送的经典蓝牙连接请求后,可根据该经典蓝牙连接请求判断终端设备是否支持蓝牙低功耗音频功能,其中,终端设备支持蓝牙低功耗音频功能可指的是终端设备当前能够与蓝牙设备建立LE Audio蓝牙连接,终端设备不支持蓝牙低功耗音频功能可指的是终端设备当前不能够与蓝牙设备建立LE Audio蓝牙连接。
可选地,终端设备不支持蓝牙低功耗音频功能,可以是终端设备本身不支持BLE Audio协议(即不具备LE Audio功能),或者,可以是终端设备本身支持BLE Audio协议,但是关闭了LE Audio功能,关闭LE Audio功能可以理解为达到与不具备LE Audio功能类似的效果,例如通过不运行对应的LE Audio功能模块等方式对外不示出LE Audio功能。作为一种具体实施方式,对于终端设备本身支持BLE Audio协议的情况,终端设备可在蓝牙管理界面中提供LE Audio功能的开关控件,用户可通过触发该开关控制来选择开启/关闭终端设备的LE Audio功能。若用户选择开启终端设备的LE Audio功能,则终端设备支持蓝牙低功耗音频功能,能够与蓝牙设备建立LE Audio蓝牙连接,若用户选择关闭终端设备的LE Audio功能,则终端设备不支持蓝牙低功耗音频功能,不能够与蓝牙设备建立LE Audio蓝牙连接。
在一些实施例中,终端设备可向蓝牙设备发送携带有目标字段的经典蓝牙连接请求,在终端设备支持蓝牙低功耗音频功能的情况下,该目标字段可包含第一标识,在终端设备不支持蓝牙低功耗音频功能的情况下,该目标字段可包含第二标识。第一标识与第二标识不同,第一标识及第二标识可根据实际需求进行设置,第一标识及第二标识可由数字、字母及符号等中的一种或多种组成。例如,第一标识可为1,第二标识可为0,但不限于此。
蓝牙设备接收到终端设备发送的经典蓝牙连接请求后,可对该经典蓝牙连接请求进行解析,以提取经典蓝牙连接请求中包含的目标字段,并根据该目标字段判断终端设备是否支持蓝牙低功耗音频功能。若目标字段包含第一标识,则可确定终端设备支持蓝牙低功耗音频功能,若目标字段包含第二标识,则可确定终端设备不支持蓝牙低功耗音频功能。
作为一种具体实施方式,经典蓝牙连接请求可携带COD(Class of device,设备类型)字段,该COD字段可用于声明终端设备的设备类型,COD字段中可包括一个或多个子字段,例如,可包括Bit_14子字段,该Bit_14子字段可用于指示终端设备是否支持蓝牙低功耗音频功能。蓝牙设备可对该经典蓝牙连接请求进行解析,以提取COD字段,若检测到COD字段中的Bit_14子字段被置为第一标识,则可确定终端设备支持蓝牙低功耗音频功能,若检测到COD字段中的Bit_14子字段被置为第二标识,则可确定终端设备不支持蓝牙低功耗音频功能。在本申请实施例中,终端设备直接根据自身是否支持蓝牙低功耗音频功能修改经典蓝牙连接请求中携带的目标字段的内容,可让蓝牙设备更加快速、便捷地判断终端设备是否支持蓝牙低功耗音频功能,提高蓝牙连接效率。
步骤230,控制安全连接功能处于开启状态。
步骤240,控制安全连接功能处于关闭状态。
蓝牙设备的安全连接功能可用于指示能够在经典蓝牙链路的基础上进行BLE连接的配对操作的功能。进一步地,安全连接功能可指的是经典蓝牙的secure connection功能,该经典蓝牙的secure connection功能可以实现在经典蓝牙链路(如ACL链路等)的基础上进行SMP(secure manager protocol,安全管理协议)流程,SMP流程能够为BLE连接提供建立加密连接所需的密钥。进一步地,安全连接功能能够触发将经典蓝牙连接对应的第一密钥转换为BLE连接对应的第二密钥,在经典蓝牙链路的基础上实现BLE连接的配对操作。
在相关的技术中,在蓝牙设备同时支持经典蓝牙协议及BLE Audio协议的情况下,蓝牙设备的安全连接功能一直处于开启状态。终端设备在与蓝牙设备建立经典蓝牙链路后,终端设备会发现蓝牙设备支持安全连接功能,因此会在经典蓝牙链路的基础上触发BLE连接的配对操作。对于不支持LE Audio功能的终端设备可能会出现错误情况,还可能会影响到终端设备与蓝牙设备之间的经典蓝牙连接,导致稳定性及兼容性较差。
在本申请实施例中,为了避免出现上述情况,蓝牙设备可根据终端设备是否支持蓝牙低功耗音频功能,动态控制安全连接功能的状态。在蓝牙设备根据经典蓝牙连接请求确定终端设备支持蓝牙低功耗音频功能的情况下,可控制安全连接功能处于开启状态,在蓝牙设备根据经典蓝牙连接请求确定终端设备不支持蓝牙低功耗音频功能的情况下,可控制安全连接功能处于关闭状态。
可选地,蓝牙设备的安全连接功能可默认处于关闭状态,在蓝牙设备接收到终端设备发送的经典蓝 牙连接请求后,若根据该经典蓝牙连接请求确定终端设备支持蓝牙低功耗音频功能,再开启安全连接功能。需要说明的是,蓝牙设备的安全连接功能也可默认处于开启状态,在蓝牙设备接收到终端设备发送的经典蓝牙连接请求后,若根据该经典蓝牙连接请求确定终端设备不支持蓝牙低功耗音频功能,再关闭安全连接功能。
步骤250,响应经典蓝牙连接请求,与终端设备建立经典蓝牙链路。
在蓝牙设备根据终端设备是否支持蓝牙低功耗音频功能,动态控制安全连接功能的状态之后,可再响应终端设备发送的经典蓝牙连接请求,与终端设备建立经典蓝牙链路。终端设备在与蓝牙设备建立经典蓝牙链路后,可向蓝牙设备问询蓝牙设备所支持的蓝牙服务,并根据蓝牙设备返回的问询结果判断蓝牙设备是否开启安全连接功能,也即,判断蓝牙设备是否支持安全连接功能。其中,蓝牙设备支持安全连接功能可指的是安全连接功能处于开启状态,蓝牙设备不支持安全连接功能可指的是安全连接功能处于关闭状态。
作为一种实施方式,若蓝牙设备的安全连接功能处于开启状态,则蓝牙设备返回的问询结果可包含该安全连接功能对应的服务标识,若蓝牙设备的安全连接功能处于关闭状态,则蓝牙设备返回的问询结果不包含该安全连接功能对应的服务标识。终端设备可通过判断问询结果中是否包含该服务标识确定蓝牙设备是否开启安全连接功能。该服务标识可由数字、字母及符号等中的一种或多种组成。作为另一种实施方式,蓝牙设备返回的问询结果可包括安全连接功能对应的功能字段,若蓝牙设备的安全连接功能处于开启状态,则蓝牙设备可将该功能字段置为第三标识,若蓝牙设备的安全连接功能处于关闭状态,则蓝牙设备可将该功能字段置为第四标识。该第三四标与第四标识可根据实际需求进行设置,例如,第三标识为YES,第四标识为NO等,但不限于此。终端设备可通过判断问询结果中安全连接功能对应的功能字段为第三标识还是第四标识,确定蓝牙设备是否开启安全连接功能。
若终端设备确定蓝牙设备开启安全连接功能(即蓝牙设备支持安全连接功能),则可在经典蓝牙链路的基础上进行BLE连接的配对操作。若终端设备确定蓝牙设备未开启安全连接功能(即蓝牙设备不支持安全连接功能),则仅与终端设备建立经典蓝牙链路,而不在该经典蓝牙链路的基础上进行BLE连接的配对操作,从而可避免在终端设备不支持LE Audio功能的情况下,对终端设备与蓝牙设备之间的经典蓝牙连接产生不良影响。
在一些实施例中,在蓝牙设备的安全连接功能处于开启状态的情况下,该安全连接功能可用于触发终端设备在与蓝牙设备建立经典蓝牙链路后,进行CTKD流程,将经典蓝牙连接对应的第一密钥(如配对密钥link key等)转换为BLE连接对应的第二密钥(如LTK(Long Term Key,长期密钥)等)。在蓝牙设备的安全连接功能处于关闭状态的情况下,终端设备在与蓝牙设备建立经典蓝牙链路后,不进行CTKD流程。进一步地,蓝牙设备的经典蓝牙地址与BLE地址可相同,从而可实现经典蓝牙连接对应的第一密钥与BLE连接对应的第二密钥之间的相互转换。具体的密钥转换流程可参考蓝牙标准中的相关规定。
终端设备在与蓝牙设备建立经典蓝牙链路后,可判断蓝牙设备是否开启安全连接功能,若确定蓝牙设备开启安全连接功能,则可进行CTKD流程,将经典蓝牙连接对应的第一密钥转换为BLE连接对应的第二密钥,该第二密钥可用于对后续建立的BLE连接进行加密。可选地,若终端设备为之前未与蓝牙设备建立过经典蓝牙连接的设备,或是之前建立过经典蓝牙连接但是未存储有蓝牙设备对应的连接记录的设备,则终端设备可与蓝牙设备建立经典蓝牙链路,并进行配对操作(pairing),该配对操作可包括相互交换配对码、约定二者之间的第一密钥等过程,以保障传输的安全性。在终端设备确定蓝牙设备开启安全连接功能后,可获取该第一密钥,并将第一密钥转换为BLE连接对应的第二密钥。
可选地,若终端设备为与蓝牙设备建立过经典蓝牙连接并进行过配对的设备,则终端设备中可存储有经典蓝牙连接对应的第一密钥,终端设备可直接与蓝牙设备建立经典蓝牙链路不需要进行配对操作。在终端设备确定蓝牙设备开启安全连接功能后,可获取该存储的第一密钥,并将第一密钥转换为BLE连接对应的第二密钥。
若终端设备确定蓝牙设备关闭安全连接功能(即不支持安全连接功能),则不进行CTKD流程,不将经典蓝牙连接对应的第一密钥转换为BLE连接对应的第二密钥。
示例性地,图3为一个实施例中蓝牙连接方法的时序图。如图3所示,蓝牙设备可进入配对状态(同时开启inquiry scan模式及page scan模式),终端设备可扫描到蓝牙设备,并获取蓝牙设备的设备信息。终端设备可显示该蓝牙设备的设备信息,用户可进行针对该设备信息的连接操作(如点击该蓝牙设备对应的连接按钮),以触发终端设备与蓝牙设备进行蓝牙连接。终端设备响应于该连接操作,向蓝牙设备发送经典蓝牙连接请求。蓝牙设备接收到终端设备发送的经典蓝牙连接请求后,可根据该经典蓝牙连接 请求判断终端设备是否支持蓝牙低功耗音频功能,若是,则可控制安全连接功能处于开启状态,若否,则可控制安全连接功能处于关闭状态。蓝牙设备再响应终端设备发送的经典蓝牙连接请求,与终端设备建立经典蓝牙链路。终端设备可判断蓝牙设备是否开启安全连接功能,若是,则可进行CTKD流程,将经典蓝牙连接对应的第一密钥转换为BLE连接对应的第二密钥(第二密钥可用于建立BLE连接),若否,则不进行CTKD流程。
进一步地,蓝牙设备还可发送LE Audio广播信号,终端设备可接收到该LE Audio广播信号。终端设备可判断蓝牙设备是否开启安全连接功能,若是,则可向蓝牙设备发起LE Audio连接请求,同时与蓝牙设备建立经典蓝牙连接及LE Audio蓝牙连接,若否,则不向蓝牙设备发起LE Audio连接请求,仅与蓝牙设备建立经典蓝牙连接。该建立经典蓝牙连接可包括上述实施例中涉及的建立经典蓝牙链路。
可以理解的,按照BLE Audio蓝牙协议的相关规定,一般来说接收到LE Audio广播信号是建立LE Audio蓝牙连接的前提。
在本申请实施例中,蓝牙设备可根据终端设备是否支持蓝牙低功耗音频功能,动态控制安全连接功能处于开启状态或关闭状态,可避免在终端设备不支持蓝牙低功耗音频功能的情况下,蓝牙设备开启安全连接功能导致终端设备与蓝牙设备之间的经典蓝牙连接受到影响,能够提高电子设备之间建立蓝牙连接的稳定性及兼容性。
在一些实施例中,在蓝牙设备的安全连接功能处于开启状态的情况下,上述的方法还可包括:蓝牙设备发送第一LE Audio广播信号,该第一LE Audio广播信号可用于触发接收到第一LE Audio广播信号的终端设备,在与蓝牙设备建立经典蓝牙链路后,向蓝牙设备发起LE Audio连接请求。
蓝牙设备可仅在安全连接功能处于开启状态的情况下,发送第一LE Audio广播信号。若终端设备接收到蓝牙设备发送的第一LE Audio广播信号,说明蓝牙设备的安全连接功能处于开启状态,则可在与蓝牙设备建立经典蓝牙链路后,直接向蓝牙设备发起LE Audio连接请求,与蓝牙设备建立LE Audio蓝牙连接。
作为一种实施方式,由于蓝牙设备在确定终端设备支持蓝牙低功耗音频功能时,安全连接功能处于开启状态,在确定终端设备不支持蓝牙低功耗音频功能时,安全连接功能处于关闭状态,因此,若终端设备接收到蓝牙设备发送的第一LE Audio广播信号,说明蓝牙设备的安全连接功能处于开启状态,且终端设备支持蓝牙低功耗音频功能,终端设备可在与终端设备建立了经典蓝牙链路的情况下进行CTKD流程,将经典蓝牙连接对应的第一密钥转换为BLE连接对应的第二密钥(可以用于BLE连接),并向蓝牙设备发起LE Audio连接请求,与蓝牙设备建立LE Audio蓝牙连接。可以理解的,终端设备与蓝牙设备建立LE Audio蓝牙连接,可包括先建立BLE连接(例如可包括建立BLE的ACL链路),在BLE连接的基础上完成LE Audio蓝牙连接。在本申请实施例中,终端设备可不再额外进行蓝牙设备是否开启安全连接功能的判断,提高连接效率。
在一些实施例中,第一LE Audio广播信号可用于触发接收到第一LE Audio广播信号的终端设备,在与蓝牙设备建立经典蓝牙链路后,在确定蓝牙设备开启安全连接功能的情况下,向蓝牙设备发起LE Audio连接请求。
例如,终端设备在与蓝牙设备建立经典蓝牙链路后,可获取蓝牙设备所支持的蓝牙服务,从而判断蓝牙设备当前是否开启安全连接功能,若确定蓝牙设备开启安全连接功能,则可执行CTKD流程,若接收到蓝牙设备发送的第一LE Audio广播信号,则可向蓝牙设备发送LE Audio连接请求,与蓝牙设备建立LE Audio蓝牙连接。
可以理解的,由于在终端设备不支持LE Audio功能的情况下,蓝牙设备会控制其安全连接功能处于关闭状态,从而终端设备可以通过经典蓝牙链路确定蓝牙设备的安全连接功能处于关闭状态则不会执行CTKD流程,从而避免终端设备在不支持LE Audio功能的情况下仍然执行CTKD流程,特别是对于支持经典蓝牙和BLE蓝牙的双模终端设备而言避免有的情况下进一步建立没有实质需求的BLE连接,也可避免对经典蓝牙的连接产生不良影响。
作为一种实施方式,蓝牙设备可以是在根据终端设备发送的经典蓝牙连接请求确定终端设备支持蓝牙低功耗音频功能时,发送第一LE Audio广播信号;或者,蓝牙设备可以是在安全连接功能处于开启状态的情况下,在与终端设备建立经典蓝牙链路之后,发送第一LE Audio广播信号;或者,在与所述终端设备建立经典蓝牙链路之后,发送第一LE Audio广播信号,这样可以使得终端设备先启动经典蓝牙的连接。当然,可以理解的,发送第一LE Audio广播信号的时机也可以不受限制。
可选地,蓝牙设备接收到终端设备发送的经典蓝牙连接请求后,可根据该经典蓝牙连接请求判断终端设备是否支持蓝牙低功耗音频功能,若确定终端设备是否支持蓝牙低功耗音频功能,则可发送第一 LE Audio广播信号,以及控制安全连接功能处于开启状态。若确定终端设备不支持蓝牙低功耗音频功能,则蓝牙设备控制安全连接功能处于关闭状态,且不发送第一LE Audio广播信号。需要说明的是,蓝牙设备发送第一LE Audio广播信号与控制安全连接功能处于开启状态的先后顺序在本申请实施例中不作限定,二者也可以同时进行。仅在确定终端设备支持LE Audio功能的情况下才发送第一LE Audio广播信号,既可节省蓝牙设备的功耗,又可避免不支持LE Audio功能的终端设备接收到第一LE Audio广播信号出现流程错误的情况,进一步保证了电子设备之间蓝牙连接的稳定性及兼容性。可选的,也可以设置在与所述终端设备建立经典蓝牙链路之后,再发送第一LE Audio广播信号,这种情况下可以使得终端设备先进行经典蓝牙的连接。
可选地,蓝牙设备也可在安全连接功能处于开启状态的情况下,在与终端设备建立经典蓝牙链路之后,再发送第一LE Audio广播信号。在安全连接功能处于关闭状态的情况下,在与终端设备建立经典蓝牙链路之后,不发送第一LE Audio广播信号。由于本申请实施例中适用于先建立经典蓝牙链路,再建立LE Audio蓝牙连接的场景,因此,蓝牙设备可在与终端设备建立经典蓝牙链路之后,再发送第一LE Audio广播信号,可进一步节省蓝牙设备的功耗。
示例性地,图4为另一个实施例中蓝牙连接方法的时序图。如图4所示,蓝牙设备可进入配对状态(同时开启inquiry scan模式及page scan模式),终端设备可扫描到蓝牙设备,并获取蓝牙设备的设备信息。终端设备可显示该蓝牙设备的设备信息,用户可进行针对该设备信息的连接操作(如点击该蓝牙设备对应的连接按钮),以触发终端设备与蓝牙设备进行蓝牙连接。终端设备响应于该连接操作,向蓝牙设备发送经典蓝牙连接请求。蓝牙设备接收到终端设备发送的经典蓝牙连接请求后,可根据该经典蓝牙连接请求判断终端设备是否支持蓝牙低功耗音频功能,若是,则可控制安全连接功能处于开启状态,若否,则可控制安全连接功能处于关闭状态。蓝牙设备再响应终端设备发送的经典蓝牙连接请求,与终端设备建立经典蓝牙链路。在蓝牙设备控制安全连接功能处于开启状态,并与终端设备建立经典蓝牙链路之后,可发送第一LE Audio广播信号。若安全连接功能处于关闭状态,则蓝牙设备不发送第一LE Audio广播信号。
终端设备在与蓝牙设备建立经典蓝牙链路之后,可判断蓝牙设备是否开启安全连接功能,若是,则可进行CTKD流程,将经典蓝牙连接对应的第一密钥转换为BLE连接对应的第二密钥,且在接收到第一LE Audio广播信号的情况下,发起与蓝牙设备的LE Audio蓝牙连接,向蓝牙设备发送LE Audio蓝牙连接请求,从而与蓝牙设备建立LE Audio蓝牙连接。在终端设备同时支持经典蓝牙及LE Audio功能的情况下,用户通过进行一次连接操作,即可触发终端设备与蓝牙设备同时建立经典蓝牙连接及LE Audio蓝牙连接,更加方便、快捷。
若终端设备确定蓝牙设备关闭安全连接功能,则不进行CTKD流程,且不发起与蓝牙设备的LE Audio蓝牙连接,仅与蓝牙设备建立经典蓝牙连接,从而可避免不支持LE Audio功能的终端设备出现流程错误,导致经典蓝牙链路也受到不良影响的情况。或者避免导致某些不支持LE Audio功能的蓝牙双模终端设备建立不必要的BLE连接。
在本申请实施例中,蓝牙设备可根据终端设备是否支持蓝牙低功耗音频功能,动态控制安全连接功能处于开启状态或关闭状态,由于蓝牙设备在终端设备不支持蓝牙低功耗音频功能的情况下,会控制安全连接功能(即经典蓝牙的安全连接功能)处于关闭状态,因此终端设备在确定蓝牙设备的安全连接功能处于关闭状态的情况下,其不会进一步在经典蓝牙的基础上进行CTKD流程,进而避免在某些不支持LE Audio功能的终端设备上进行BLE连接,也避免导致经典蓝牙链路受到不良影响的情况。
进一步的可动态决定是否发送第一LE Audio广播信号,从而可保证支持蓝牙低功耗音频功能的终端设备能够同时与蓝牙设备建立经典蓝牙连接及LE Audio蓝牙连接,不支持蓝牙低功耗音频功能的终端设备仅与蓝牙设备建立经典蓝牙连接且不进行CTKD流程,保证了蓝牙设备与不支持蓝牙低功耗音频功能的终端设备之间建立蓝牙连接的稳定性及兼容性。
在一些实施例中,上述的蓝牙设备可为蓝牙设备集合中的主蓝牙设备,在该蓝牙设备的安全连接功能处于开启状态的情况下,蓝牙设备可向蓝牙设备集合中的从蓝牙设备发送广播触发指令,该广播触发指仅可用于指示从蓝牙设备发送第二LE Audio广播信号,该第二LE Audio广播信号可触发接收到第二LE Audio广播信号的终端设备,向从蓝牙设备发起LE Audio连接请求。
一个蓝牙设备集合中可包括至少两个蓝牙设备,属于同一个蓝牙设备集合中的各个蓝牙设备可实现数据同步。在经典蓝牙中,蓝牙设备集合中的各个蓝牙设备之间可区分主从关系,包括主蓝牙设备及从蓝牙设备,其中,主蓝牙设备可指的是与外部的终端设备建立经典蓝牙链路的蓝牙设备,从蓝牙设备可指的是对主蓝牙设备与终端设备之间的经典蓝牙链路进行监听,或者接收主蓝牙设备转发通过该经典蓝 牙链路接收的数据的蓝牙设备。
在本申请实施例中,蓝牙设备集合中的各个蓝牙设备可共用相同的经典蓝牙地址,终端设备可获取该经典蓝牙地址,并根据该经典蓝牙地址向蓝牙设备集合发送经典蓝牙连接请求。可由蓝牙设备集合中的主蓝牙设备接收终端设备发送的经典蓝牙连接请求,并根据该经典蓝牙连接请求判断终端设备是否支持蓝牙低功耗音频功能,若支持,则可控制主蓝牙设备的安全连接功能处于开启状态,若不支持,则可控制主蓝牙设备的安全连接功能处于关闭状态。主蓝牙设备可再响应终端设备发送的经典蓝牙连接请求,与终端设备建立经典蓝牙链路。主蓝牙设备可与从蓝牙设备建立通信连接(如经典蓝牙连接或BLE连接等),并向从蓝牙设备同步该经典蓝牙链路对应的连接信息,该连接信息可包括但不限于跳频信息、信道信息、时钟信息等。从蓝牙设备可根据该连接信息对主蓝牙设备与终端设备之间的经典蓝牙链路进行监听,或者主蓝牙设备可将通过该经典蓝牙链路接收的数据转发给从蓝牙设备,从而可实现同一蓝牙设备集合下的主从同步。
可选地,在BLE Audio技术中,同一蓝牙设备集合下的各个蓝牙设备可不区分主从关系,各个蓝牙设备可分别与外部的终端设备建立LE Audio蓝牙连接,并进行数据传输。在上述的主蓝牙设备的安全连接功能处于开启状态的情况下,主蓝牙设备发送第一LE Audio广播信号,可通过与从蓝牙设备之间的通信连接向从蓝牙设备发送广播触发指令。从蓝牙设备可根据该广播触发指令发送第二LE Audio广播信号,以实现主蓝牙设备、从蓝牙设备均分别与终端设备建立LE Audio蓝牙连接。
在一些实施例中,在BLE Audio技术中提供了CSIP(Coordinated Set Identification Profile,协调集识别协议),可以让属于同一个蓝牙设备集合中的多个蓝牙设备在与外部设备进行交互时,达成协调同步的目的。在CSIP中,对于属于同一个蓝牙设备集合的多个蓝牙设备,可使用相同的SIRK(Set Identity Resolving Key,组合标识解析值),即将具有相同SIRK的蓝牙设备识别为同一个蓝牙设备集合。
属于同一个蓝牙设备集合下的各个蓝牙设备可基于相同的SIRK发送LE Audio广播信号。在一些实施例中,主蓝牙设备可基于目标SIKR发送第一LE Audio广播信号,从蓝牙设备也可基于目标SIKR发送第二LE Audio广播信号。若终端设备先接收到该蓝牙设备集合中的主蓝牙设备发送的第一LE Audio广播信号,可与该主蓝牙设备建立LE Audio蓝牙连接,并获取该主蓝牙设备对应的SIRK(即目标SIRK)。作为一种实施方式,终端设备可在与该主蓝牙设备建立LE Audio蓝牙连接的过程中,接收该蓝牙设备发送的SIRK。LE Audio蓝牙连接是在BLE连接的基础上建立的,建立LE Audio蓝牙连接的过程可包括在BLE连接的基础上进行一些设备参数的查询,该设备参数的查询可包括蓝牙设备的SIRK查询。
终端设备在接收到从蓝牙设备发送的第二LE Audio广播信号时,可根据第二LE Audio广播信号判断该从蓝牙设备对应的SIRK是否为与目标SIRK相同,若相同,则自动向该从蓝牙设备发送LE Audio蓝牙连接请求,与从蓝牙设备建立LE Audio蓝牙连接。
作为一种实施方式,蓝牙设备发送的LE Audio广播信号可包括基于SIRK计算生成的特殊字段。终端设备接收到从蓝牙设备发送的第二LE Audio广播信号后,可对第二BLE Audio广播信号进行解析,得到第二LE Audio广播信号所携带的目标特定广播信息及特殊字段,可根据主蓝牙设备对应的SIRK(即目标SIRK)及该目标特定广播信息计算得到目标本地值,若目标本地值与特殊字段相同,则可确定主蓝牙设备与该从蓝牙设备属于同一个蓝牙设备集合,自动向该从蓝牙设备发送LE Audio蓝牙连接请求。
具体地,如图5所示,LE Audio广播信号可包括RSI(resolvable Set Identifier,可解析集标识符),RSI可包括两部分:1、由蓝牙设备对应的SIRK生成的哈希序列510;2、随机数产生的随机序列520。其中,哈希序列510可通过公式:hash=sih(SIKR,prand)进行计算得到,hash表示哈希序列510,prand表示随机序列520。终端设备解析从蓝牙设备发送的第二LE Audio广播信号得到的目标特定广播信息可以是RSI的随机序列,特殊字段可以是第二LE Audio广播信号所携带的RSI的哈希序列。终端设备可根据主蓝牙设备对应的SIRK(即目标SIRK)及解析得到的RSI中的随机序列,通过上述公式计算得到目标本地值,并将目标本地值与解析得到的RSI的哈希序列进行比对,若二者一致,说明主蓝牙设备的SIKR与该从蓝牙设备的SIRK相同(均为目标SIRK),则可确定主蓝牙设备与从蓝牙设备属于同一个蓝牙设备集合。
需要说明的是,BLE Audio技术中不对蓝牙设备集合中包含的蓝牙设备的主从关系进行区分,因此上述的主蓝牙设备及从蓝牙设备仅用于对不同蓝牙设备的说明,而非表示在BLE Audio技术中依然具备主从关系。
示例性地,图6为另一个实施例中蓝牙连接方法的时序图。如图6所示,以上述的蓝牙设备为耳机设备中的主耳机为例,该耳机设备还包括从耳机。主耳机可进入配对状态(同时开启inquiry scan模式及page scan模式),终端设备可扫描到耳机设备,并获取耳机设备的设备信息(包括经典蓝牙地址)。 终端设备可显示该耳机设备的设备信息,用户可进行针对该设备信息的连接操作(如点击终端设备上该耳机设备对应的连接按钮),以触发终端设备与耳机设备进行蓝牙连接。终端设备响应于该连接操作,向耳机设备发送经典蓝牙连接请求。主耳机接收到终端设备发送的经典蓝牙连接请求后,可解析该经典蓝牙连接请求携带的COD字段,并根据解析的COD字段判断终端设备是否支持蓝牙低功耗音频功能,若是,则可控制安全连接功能处于开启状态,若否,则可控制安全连接功能处于关闭状态。主耳机再响应终端设备发送的经典蓝牙连接请求,与终端设备建立经典蓝牙链路。在主耳机控制安全连接功能处于开启状态,并与终端设备建立经典蓝牙链路之后,可发送第一LE Audio广播信号,并可向从耳机发送广播触发指令,以使从耳机发送第二LE Audio广播信号。若安全连接功能处于关闭状态,则主耳机不发送第一LE Audio广播信号,且从耳机也不发送第二LE Audio广播信号。
终端设备在与主耳机建立经典蓝牙链路之后,可判断耳机设备是否开启安全连接功能,若是,则可进行CTKD流程,将经典蓝牙连接的link key转换为BLE连接的LTK。在终端设备接收到第一LE Audio广播信号的情况下,可判断主耳机是否在白名单中且终端设备可处理该第一LE Audio广播信号。由于主耳机的经典蓝牙地址与BLE地址相同,终端设备与主耳机建立经典蓝牙链路,因此,主耳机对应的BLE地址存储在白名单中。另外,终端设备支持LE Audio功能,因此可处理该第一LE Audio广播信号,则终端设备可发起与主耳机的LE Audio蓝牙连接,向主耳机发送LE Audio蓝牙连接请求,从而与主耳机建立LE Audio蓝牙连接。在终端设备接收到从耳机发送的第二LE Audio广播信号后,可确定从耳机与主耳机属于同一个蓝牙设备集合,主动向从耳机发起LE Audio蓝牙连接,与从耳机建立LE Audio蓝牙连接。在终端设备同时支持经典蓝牙及LE Audio功能的情况下,用户通过进行一次连接操作,即可触发终端设备与耳机设备同时建立经典蓝牙连接及LE Audio蓝牙连接,更加方便、快捷。
若终端设备确定耳机设备关闭安全连接功能,则不进行CTKD流程,且不发起与耳机的LE Audio蓝牙连接,仅与耳机设备建立经典蓝牙连接,从而可避免不支持LE Audio功能的终端设备出现流程错误,导致经典蓝牙链路也受到不良影响的情况。
示例性地,图7为一个实施例中终端设备分别与耳机设备的两只耳机建立LE Audio蓝牙连接的时序图。如图7所示,终端设备可开启扫描模式,扫描周围的蓝牙设备发送的LE Audio广播信号。耳机设备中的主耳机发送第一LE Audio广播信号,从耳机发送第二LE Audio广播信号。若终端设备先接收到主耳机发送的第一LE Audio广播信号,则可与主耳机建立LE Audio蓝牙连接,并获取主耳机的SIKR。在终端设备接收到从耳机发送的第二LE Audio广播信号后,可根据主耳机的SIRK及第二LE Audio广播信号中的随机序列计算得到目标本地值,并判断该目标本地值与第二LE Audio广播信号中的哈希序列是否相同,若相同,则终端设备可主动发起与从耳机的LE Audio蓝牙连接,向从耳机发送LE Audio连接请求,并与从耳机建立LE Audio蓝牙连接。终端设备可获取从耳机的SIRK,并判断从耳机的SIRK与主耳机的SIRK是否相同,若相同,则可将两只耳机标识为属于同一个group(集合),若不相同,则可将两只耳机标识为属于不同的group。
在本申请实施例中,支持蓝牙低功耗音频功能的终端设备能够同时与蓝牙设备集合建立经典蓝牙连接及LE Audio蓝牙连接,不支持蓝牙低功耗音频功能的终端设备仅与蓝牙设备集合建立经典蓝牙连接且不进行CTKD流程,保证了蓝牙设备集合与不支持蓝牙低功耗音频功能的终端设备之间建立蓝牙连接的稳定性及兼容性,且保证了蓝牙设备集合中各个蓝牙设备之间的同步协调使用。
如图8所示,在一个实施例中,提供一种蓝牙连接方法,可应用于上述的终端设备,该方法可包括以下步骤:
步骤810,向蓝牙设备发送经典蓝牙连接请求,以使蓝牙设备在根据该经典蓝牙连接请求确定终端设备支持蓝牙低功耗音频功能的情况下,控制开启安全连接功能处于开启状态,在根据该经典蓝牙连接请求确定终端设备不支持蓝牙低功耗音频功能的情况下,控制关闭安全连接功能处于关闭状态。
在一个实施例中,步骤810,包括:向蓝牙设备发送携带有目标字段的经典蓝牙连接请求;其中,在终端设备支持蓝牙低功耗音频功能的情况下,目标字段包含第一标识;在终端设备不支持蓝牙低功耗音频功能的情况下,目标字段包含第二标识。
步骤820,与蓝牙设备建立经典蓝牙链路。
在一个实施例中,该方法还包括:接收蓝牙设备发送的第一LE Audio广播信号;在与蓝牙设备建立经典蓝牙链路之后,响应第一LE Audio广播信号,向蓝牙设备发起LE Audio连接请求。
在一个实施例中,步骤在与蓝牙设备建立经典蓝牙链路之后,响应第一LE Audio广播信号,向蓝牙设备发起LE Audio连接请求,包括:在与蓝牙设备建立经典蓝牙链路之后,若确定蓝牙设备开启安 全连接功能,则响应第一LE Audio广播信号,向蓝牙设备发起LE Audio连接请求。
在一个实施例中,在步骤820之后,还包括:若确定蓝牙设备开启安全连接功能,则进行CTKD流程,将经典蓝牙连接对应的第一密钥转换为BLE连接对应的第二密钥。
在一个实施例中,在步骤820之后,还包括:若确定蓝牙设备关闭安全连接功能,则不进行CTKD流程。
需要说明的是,本申请实施例提供的应用于终端设备的蓝牙连接方法的描述,可参考上述各实施例中提供的应用于蓝牙设备的蓝牙连接方法的相关描述,在此不再重复赘述。
在本申请实施例中,蓝牙设备可根据终端设备是否支持蓝牙低功耗音频功能,动态控制安全连接功能处于开启状态或关闭状态,可避免在终端设备不支持蓝牙低功耗音频功能的情况下,蓝牙设备开启安全连接功能导致终端设备与蓝牙设备之间的经典蓝牙连接受到影响,能够提高电子设备之间建立蓝牙连接的稳定性及兼容性,或者在某些情况下避免建立不必要的BLE连接。
如图9所示,在一个实施例中,提供一种蓝牙连接方法,可应用于耳机设备,该耳机设备可包括主耳机及从耳机,该方法可包括以下步骤:
步骤910,主耳机接收终端设备发送的经典蓝牙连接请求。
在一个实施例中,在步骤910之后,该方法还包括:主耳机对经典蓝牙连接请求进行解析,以提取经典蓝牙连接请求中包含的目标字段;主耳机根据目标字段判断终端设备是否支持蓝牙低功耗音频功能。
步骤920,在主耳机根据经典蓝牙连接请求确定终端设备支持蓝牙低功耗音频功能的情况下,控制开启耳机设备的安全连接功能处于开启状态。
步骤930,在主耳机根据经典蓝牙连接请求确定终端设备不支持蓝牙低功耗音频功能的情况下,控制关闭安全连接功能处于关闭状态。
步骤940,主耳机响应经典蓝牙连接请求,与终端设备建立经典蓝牙链路。
在一个实施例中,在耳机设备的安全连接功能处于开启状态的情况下,该方法还包括:主耳机发送第一LE Audio广播信号,该第一LE Audio广播信号可触发接收到第一LE Audio广播信号的终端设备,在与主耳机建立经典蓝牙链路后,向主耳机发起LE Audio连接请求。
在一个实施例中,主耳机的经典蓝牙地址与BLE地址相同。
在一个实施例中,在耳机设备的安全连接功能处于开启状态的情况下,该方法还包括:主耳机向从耳机发送广播触发指令;从耳机根据广播触发指令发送第二LE Audio广播信号,该第二LE Audio广播信号可触发接收到第二LE Audio广播信号的终端设备,向从耳机发起LE Audio连接请求。
需要说明的是,本申请实施例提供的应用于耳机设备的蓝牙连接方法的描述,可参考上述各实施例中提供的应用于蓝牙设备的蓝牙连接方法的相关描述,在此不再重复赘述。
在本申请实施例中,耳机设备中的主耳机可根据终端设备是否支持蓝牙低功耗音频功能,动态控制耳机设备的安全连接功能处于开启状态或关闭状态,并动态决定是否发送第一LE Audio广播信号并控制从耳机发送第二LE Audio广播信号,支持蓝牙低功耗音频功能的终端设备能够同时与耳机设备建立经典蓝牙连接及LE Audio蓝牙连接,不支持蓝牙低功耗音频功能的终端设备仅与耳机设备建立经典蓝牙连接且不进行CTKD流程,保证了耳机设备与不支持蓝牙低功耗音频功能的终端设备之间建立蓝牙连接的稳定性及兼容性,且保证了耳机设备中各个耳机之间的同步协调使用。
如图10所示,在一个实施例中,提供一种蓝牙连接装置1000,可应用于上述的蓝牙设备,蓝牙连接装置1000包括请求接收模块1010、功能控制模块1020及连接模块1030。
请求接收模块1010,用于接收终端设备发送的经典蓝牙连接请求。
功能控制模块1020,用于在根据经典蓝牙连接请求确定终端设备支持蓝牙低功耗音频功能的情况下,控制安全连接功能处于开启状态;安全连接功能用于指示能够在经典蓝牙链路的基础上进行BLE连接的配对操作的功能。
功能控制模块1020,还用于在根据经典蓝牙连接请求确定终端设备不支持蓝牙低功耗音频功能的情况下,控制安全连接功能处于关闭状态。
连接模块1030,用于响应经典蓝牙连接请求,与终端设备建立经典蓝牙链路。
在一个实施例中,蓝牙连接装置1000还包括解析模块。
解析模块,用于对经典蓝牙连接请求进行解析,以提取经典蓝牙连接请求中包含的目标字段;根据目标字段判断终端设备是否支持蓝牙低功耗音频功能。
在一个实施例中,解析模块,还用于若目标字段包含第一标识,则确定终端设备支持蓝牙低功耗音 频功能;若目标字段包含第二标识,则确定终端设备不支持蓝牙低功耗音频功能。
在一个实施例中,在蓝牙设备的安全连接功能处于开启状态的情况下,安全连接功能用于触发终端设备在与蓝牙设备建立经典蓝牙链路后,进行CTKD流程,将经典蓝牙连接对应的第一密钥转换为BLE连接对应的第二密钥。
在一个实施例中,在蓝牙设备的安全连接功能处于关闭状态的情况下,终端设备在与蓝牙设备建立经典蓝牙链路后,不进行CTKD流程。
在一个实施例中,蓝牙设备的经典蓝牙地址与BLE地址相同。
在一个实施例中,蓝牙连接装置1000还包括广播模块。
广播模块,用于发送第一LE Audio广播信号,第一LE Audio广播信号可触发接收到第一LE Audio广播信号的终端设备,在与蓝牙设备建立经典蓝牙链路后,向蓝牙设备发起LE Audio连接请求。
在一个实施例中,第一LE Audio广播信号可触发接收到第一LE Audio广播信号的终端设备,在与蓝牙设备建立经典蓝牙链路后,在确定蓝牙设备开启安全连接功能的情况下,向蓝牙设备发起LE Audio连接请求。
在一个实施例中,广播模块,还用于在根据经典蓝牙连接请求确定终端设备支持蓝牙低功耗音频功能时,发送第一LE Audio广播信号;或者,在安全连接功能处于开启状态的情况下,在与终端设备建立经典蓝牙链路之后,发送第一LE Audio广播信号;或者,在与终端设备建立经典蓝牙链路之后,发送第一LE Audio广播信号。当然,发送第一LE Audio广播信号的时机也可不做限制。
在一个实施例中,蓝牙连接装置1000还包括指令发送模块。
指令发送模块,用于向蓝牙设备集合中的从蓝牙设备发送广播触发指令,广播触发指令用于指示从蓝牙设备发送第二LE Audio广播信号,第二LE Audio广播信号可触发接收到第二LE Audio广播信号的终端设备,向从蓝牙设备发起LE Audio连接请求。
在本申请实施例中,蓝牙设备可根据终端设备是否支持蓝牙低功耗音频功能,动态控制安全连接功能处于开启状态或关闭状态,可避免在终端设备不支持蓝牙低功耗音频功能的情况下,蓝牙设备开启安全连接功能导致终端设备与蓝牙设备之间的经典蓝牙连接受到影响,能够提高电子设备之间建立蓝牙连接的稳定性及兼容性。
如图11所示,在一个实施例中,提供一种蓝牙连接装置1100,可应用于上述的终端设备,蓝牙连接装置1100包括请求发送模块1110及连接模块1120。
请求发送模块1110,用于向蓝牙设备发送经典蓝牙连接请求,以使蓝牙设备在根据经典蓝牙连接请求确定终端设备支持蓝牙低功耗音频功能的情况下,控制安全连接功能处于开启状态,在根据经典蓝牙连接请求确定终端设备不支持蓝牙低功耗音频功能的情况下,控制安全连接功能处于关闭状态;安全连接功能用于指示能够在经典蓝牙链路的基础上进行BLE连接的配对操作的功能。
在一个实施例中,请求发送模块1110,还用于向蓝牙设备发送携带有目标字段的经典蓝牙连接请求;其中,在终端设备支持蓝牙低功耗音频功能的情况下,目标字段包含第一标识;在终端设备不支持蓝牙低功耗音频功能的情况下,目标字段包含第二标识。
连接模块1120,用于与蓝牙设备建立经典蓝牙链路。
在一个实施例中,蓝牙连接装置1100还包括广播接收模块。
广播接收模块,用于接收蓝牙设备发送的第一LE Audio广播信号。
连接模块1120,还用于在与蓝牙设备建立经典蓝牙链路之后,响应第一LE Audio广播信号,向蓝牙设备发起LE Audio连接请求。
在一个实施例中,连接模块1120,还用于在与蓝牙设备建立经典蓝牙链路之后,若确定蓝牙设备开启安全连接功能,则响应第一LE Audio广播信号,向蓝牙设备发起LE Audio连接请求。
在一个实施例中,蓝牙连接装置1100还包括转换模块。
转换模块,用于在与蓝牙设备建立经典蓝牙链路之后,若确定蓝牙设备开启安全连接功能,则进行CTKD流程,将经典蓝牙连接对应的第一密钥转换为BLE连接对应的第二密钥。
在一个实施例中,转换模块,还用于在与蓝牙设备建立经典蓝牙链路之后,若确定蓝牙设备关闭安全连接功能,则不进行CTKD流程。
在本申请实施例中,蓝牙设备可根据终端设备是否支持蓝牙低功耗音频功能,动态控制安全连接功能处于开启状态或关闭状态,可避免在终端设备不支持蓝牙低功耗音频功能的情况下,蓝牙设备开启安全连接功能导致终端设备与蓝牙设备之间的经典蓝牙连接受到影响,能够提高电子设备之间建立蓝牙连接的稳定性及兼容性。此外,或者可以避免某些终端设备在不支持LE Audio功能的情况下建立不必要 的BLE连接。
如图12所示,在一个实施例中,提供一种蓝牙连接装置1200,可应用于耳机设备,耳机设备包括主耳机及从耳机,蓝牙连接装置1200包括接收模块1210、功能控制模块1220及连接模块1230。
接收模块1210,用于通过主耳机接收终端设备发送的经典蓝牙连接请求。
功能控制模块1220,用于在主耳机根据经典蓝牙连接请求确定终端设备支持蓝牙低功耗音频功能的情况下,通过主耳机控制耳机设备的安全连接功能处于开启状态;安全连接功能用于指示能够在经典蓝牙链路的基础上进行BLE连接的配对操作的功能。
功能控制模块1220,还用于在主耳机根据经典蓝牙连接请求确定终端设备不支持蓝牙低功耗音频功能的情况下,通过主耳机控制安全连接功能处于关闭状态。
连接模块1230,用于通过主耳机响应经典蓝牙连接请求,与终端设备建立经典蓝牙链路。
在一个实施例中,蓝牙连接装置1200还包括解析模块。
解析模块,用于通过主耳机对经典蓝牙连接请求进行解析,以提取经典蓝牙连接请求中包含的目标字段;由主耳机根据目标字段判断终端设备是否支持蓝牙低功耗音频功能。
在一个实施例中,蓝牙连接装置1200还包括广播模块。
广播模块,用于在耳机设备的安全连接功能处于开启状态的情况下,通过主耳机发送第一LE Audio广播信号,该第一LE Audio广播信号可触发接收到第一LE Audio广播信号的终端设备,在与主耳机建立经典蓝牙链路后,向主耳机发起LE Audio连接请求。
在一个实施例中,主耳机的经典蓝牙地址与BLE地址相同。
在一个实施例中,蓝牙连接装置1200还包括指令发送模块。
指令发送模块,用于在耳机设备的安全连接功能处于开启状态的情况下,通过主耳机向从耳机发送广播触发指令。
广播模块,还用于通过从耳机根据广播触发指令发送第二LE Audio广播信号,该第二LE Audio广播信号可触发接收到第二LE Audio广播信号的终端设备,向从耳机发起LE Audio连接请求。
在本申请实施例中,耳机设备中的主耳机可根据终端设备是否支持蓝牙低功耗音频功能,动态控制耳机设备的安全连接功能处于开启状态或关闭状态,并动态决定是否发送第一LE Audio广播信号并控制从耳机发送第二LE Audio广播信号,支持蓝牙低功耗音频功能的终端设备能够同时与耳机设备建立经典蓝牙连接及LE Audio蓝牙连接,不支持蓝牙低功耗音频功能的终端设备仅与耳机设备建立经典蓝牙连接且不进行CTKD流程,保证了耳机设备与不支持蓝牙低功耗音频功能的终端设备之间建立蓝牙连接的稳定性及兼容性,且保证了耳机设备中各个耳机之间的同步协调使用,也可以避免某些蓝牙双模终端设备在不支持LE Audio功能的情况下建立不必要的BLE连接。
图13为一个实施例中蓝牙设备的结构框图。如图13所示,蓝牙设备1300可以包括一个或多个如下部件:处理器1310、与处理器1310耦合的存储器1320,其中存储器1320可存储有一个或多个计算机程序,一个或多个计算机程序可以被配置为由一个或多个处理器1310执行时,使得蓝牙设备1300实现如上述各实施例描述的应用于蓝牙设备的蓝牙连接方法。
处理器1310可以包括一个或者多个处理核。处理器1310利用各种接口和线路连接整个蓝牙设备1300内的各个部分,通过运行或执行存储在存储器1320内的指令、程序、代码集或指令集,以及调用存储在存储器1320内的数据,执行蓝牙设备1300的各种功能和处理数据。可选地,处理器1310可以采用数字信号处理(Digital Signal Processing,DSP)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、可编程逻辑阵列(Programmable Logic Array,PLA)中的至少一种硬件形式来实现。处理器1310可集成中央处理器(Central Processing Unit,CPU)、图像处理器(Graphics Processing Unit,GPU)和调制解调器等中的一种或几种的组合。其中,CPU主要处理操作***、用户界面和应用程序等;GPU用于负责显示内容的渲染和绘制;调制解调器用于处理无线通信。可以理解的是,上述调制解调器也可以不集成到处理器1310中,单独通过一块通信芯片进行实现。
存储器1320可以包括随机存储器(Random Access Memory,RAM),也可以包括只读存储器(Read-Only Memory,ROM)。存储器1320可用于存储指令、程序、代码、代码集或指令集。存储器1320可包括存储程序区和存储数据区,其中,存储程序区可存储用于实现操作***的指令、用于实现至少一个功能的指令(比如触控功能、声音播放功能、图像播放功能等)、用于实现上述各个方法实施例的指令等。存储数据区还可以存储蓝牙设备1300在使用中所创建的数据等。
蓝牙设备1300还可包括通信单元,如蓝牙模块,蓝牙模块可用于提供蓝牙通信功能,与第二电子 设备建立蓝牙连接,并进行蓝牙数据传输。蓝牙模块可支持一种或多种蓝牙协议,如经典蓝牙、BLE、BLE Audio等),但不限于此,可随着蓝牙协议的发展而变化。
本申请实施例公开一种终端设备,包括存储器、处理器及通信单元,该存储器中存储有计算机程序,该计算机程序被处理器执行时,使得该终端设备实现如上述各实施例描述的应用于终端设备的蓝牙连接方法。
本申请实施例公开一种耳机设备,包括存储器、处理器及通信单元,该存储器中存储有计算机程序,该计算机程序被处理器执行时,使得该耳机设备实现如上述各实施例描述的应用于耳机设备的蓝牙连接方法。
本申请实施例公开一种计算机可读存储介质,其存储计算机程序,其中,该计算机程序被电子设备中的处理器执行时,使得电子设备实现如上述各实施例描述的应用于蓝牙设备的蓝牙连接方法。
本申请实施例公开一种计算机可读存储介质,其存储计算机程序,其中,该计算机程序被电子设备中的处理器执行时,使得电子设备实现如上述各实施例描述的应用于终端设备的蓝牙连接方法。
本申请实施例公开一种计算机可读存储介质,其存储计算机程序,其中,该计算机程序被电子设备中的处理器执行时,使得电子设备实现如上述各实施例描述的应用于耳机设备的蓝牙连接方法。
本申请实施例公开一种计算机程序产品,该计算机程序产品包括存储了计算机程序的非瞬时性计算机可读存储介质,且该计算机程序可被电子设备中的处理器执行时,使得电子设备实现如上述各实施例描述的应用于蓝牙设备的蓝牙连接方法。
本申请实施例公开一种计算机程序产品,该计算机程序产品包括存储了计算机程序的非瞬时性计算机可读存储介质,且该计算机程序可被电子设备中的处理器执行时,使得电子设备实现如上述各实施例描述的应用于终端设备的蓝牙连接方法。
本申请实施例公开一种计算机程序产品,该计算机程序产品包括存储了计算机程序的非瞬时性计算机可读存储介质,且该计算机程序可被电子设备中的处理器执行时,使得电子设备实现如上述各实施例描述的应用于耳机设备的蓝牙连接方法。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一非易失性计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、ROM等。
如此处所使用的对存储器、存储、数据库或其它介质的任何引用可包括非易失性和/或易失性存储器。合适的非易失性存储器可包括ROM、可编程ROM(Programmable ROM,PROM)、可擦除PROM(Erasable PROM,EPROM)、电可擦除PROM(Electrically Erasable PROM,EEPROM)或闪存。易失性存储器可包括随机存取存储器(random access memory,RAM),它用作外部高速缓冲存储器。作为说明而非局限,RAM可为多种形式,诸如静态RAM(Static RAM,SRAM)、动态RAM(Dynamic Random Access Memory,DRAM)、同步DRAM(synchronous DRAM,SDRAM)、双倍数据率SDRAM(Double Data Rate SDRAM,DDR SDRAM)、增强型SDRAM(Enhanced Synchronous DRAM,ESDRAM)、同步链路DRAM(Synchlink DRAM,SLDRAM)、存储器总线直接RAM(Rambus DRAM,RDRAM)及直接存储器总线动态RAM(Direct Rambus DRAM,DRDRAM)。
应理解,说明书通篇中提到的“一个实施例”或“一实施例”意味着与实施例有关的特定特征、结构或特性包括在本申请的至少一个实施例中。因此,在整个说明书各处出现的“在一个实施例中”或“在一实施例中”未必一定指相同的实施例。此外,这些特定特征、结构或特性可以以任意适合的方式结合在一个或多个实施例中。本领域技术人员也应该知悉,说明书中所描述的实施例均属于可选实施例,所涉及的动作和模块并不一定是本申请所必须的。需要说明的,本申请中的“多个”包括“两个或两个以上”。
在本申请的各种实施例中,应理解,上述各过程的序号的大小并不意味着执行顺序的必然先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。
上述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可位于一个地方,或者也可以分布到多个网络单元上。可根据实际的需要选择其中的部分或全部单元来实现本实施例方案的目的。
另外,在本申请各实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
以上所述实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术 特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。
以上对本申请实施例公开的一种蓝牙连接方法、装置、电子设备及计算机可读存储介质进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想。同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制,可以理解的,对于本申请中的一些技术特征、技术手段也可以参考蓝牙标准的相关规定,或者与蓝牙标准中的相关规定相互组合。

Claims (26)

  1. 一种蓝牙连接方法,其特征在于,应用于蓝牙设备,所述方法包括:
    接收终端设备发送的经典蓝牙连接请求;
    在根据所述经典蓝牙连接请求确定所述终端设备支持蓝牙低功耗音频功能的情况下,控制安全连接功能处于开启状态;所述安全连接功能用于指示能够在经典蓝牙链路的基础上进行BLE连接的配对操作的功能;
    在根据所述经典蓝牙连接请求确定所述终端设备不支持所述蓝牙低功耗音频功能的情况下,控制所述安全连接功能处于关闭状态;
    响应所述经典蓝牙连接请求,与所述终端设备建立经典蓝牙链路。
  2. 根据权利要求1所述的方法,其特征在于,在所述安全连接功能处于开启状态的情况下,所述方法还包括:
    发送第一LE Audio广播信号,所述第一LE Audio广播信号用于触发接收到所述第一LE Audio广播信号的所述终端设备,在与所述蓝牙设备建立所述经典蓝牙链路后,向所述蓝牙设备发起LE Audio连接请求。
  3. 根据权利要求2所述的方法,其特征在于,所述第一LE Audio广播信号用于触发接收到所述第一LE Audio广播信号的所述终端设备,在与所述蓝牙设备建立所述经典蓝牙链路后,在确定所述蓝牙设备开启所述安全连接功能的情况下,向所述蓝牙设备发起LE Audio连接请求。
  4. 根据权利要求2所述的方法,其特征在于,所述发送第一LE Audio广播信号,包括:
    在根据所述经典蓝牙连接请求确定所述终端设备支持所述蓝牙低功耗音频功能时,发送第一LE Audio广播信号;或者,
    在所述安全连接功能处于开启状态的情况下,在与所述终端设备建立经典蓝牙链路之后,发送第一LE Audio广播信号;或者,
    在与所述终端设备建立经典蓝牙链路之后,发送第一LE Audio广播信号。
  5. 根据权利要求1所述的方法,其特征在于,在所述蓝牙设备的所述安全连接功能处于开启状态的情况下,所述安全连接功能用于触发所述终端设备在与所述蓝牙设备建立所述经典蓝牙链路后,进行交叉传输密钥派生CTKD流程,将经典蓝牙连接对应的第一密钥转换为BLE连接对应的第二密钥。
  6. 根据权利要求1所述的方法,其特征在于,在所述蓝牙设备的所述安全连接功能处于关闭状态的情况下,所述终端设备在与所述蓝牙设备建立所述经典蓝牙链路后,不进行CTKD流程。
  7. 根据权利要求1~6任一项所述的方法,其特征在于,在所述接收终端设备发送的经典蓝牙连接请求之后,所述方法还包括:
    对所述经典蓝牙连接请求进行解析,以提取所述经典蓝牙连接请求中包含的目标字段;
    根据所述目标字段判断所述终端设备是否支持蓝牙低功耗音频功能。
  8. 根据权利要求7所述的方法,其特征在于,在所述根据所述目标字段判断所述终端设备是否支持蓝牙低功耗音频功能之后,所述方法还包括:
    若所述目标字段包含第一标识,则确定所述终端设备支持所述蓝牙低功耗音频功能;
    若所述目标字段包含第二标识,则确定所述终端设备不支持所述蓝牙低功耗音频功能。
  9. 根据权利要求1项所述的方法,其特征在于,所述蓝牙设备的经典蓝牙地址与BLE地址相同。
  10. 根据权利要求1~6、8~9任一项所述的方法,其特征在于,所述蓝牙设备为蓝牙设备集合中的主蓝牙设备,在所述蓝牙设备的所述安全连接功能处于开启状态的情况下,所述方法还包括:
    向所述蓝牙设备集合中的从蓝牙设备发送广播触发指令,所述广播触发指令用于指示所述从蓝牙设备发送第二LE Audio广播信号,所述第二LE Audio广播信号用于触发接收到所述第二LE Audio广播信号的所述终端设备,向所述从蓝牙设备发起LE Audio连接请求。
  11. 一种蓝牙连接方法,其特征在于,应用于终端设备,所述方法包括:
    向蓝牙设备发送经典蓝牙连接请求,以使所述蓝牙设备在根据所述经典蓝牙连接请求确定所述终端设备支持蓝牙低功耗音频功能的情况下,控制安全连接功能处于开启状态,在根据所述经典蓝牙连接请求确定所述终端设备不支持所述蓝牙低功耗音频功能的情况下,控制所述安全连接功能处于关闭状态;所述安全连接功能用于指示能够在经典蓝牙链路的基础上进行BLE连接的配对操作的功能;
    与所述蓝牙设备建立经典蓝牙链路。
  12. 根据权利要求11所述的方法,其特征在于,所述方法还包括:
    接收所述蓝牙设备发送的第一LE Audio广播信号;
    在与所述蓝牙设备建立经典蓝牙链路之后,响应所述第一LE Audio广播信号,向所述蓝牙设备发起LE Audio连接请求。
  13. 根据权利要求12所述的方法,其特征在于,所述在与所述蓝牙设备建立经典蓝牙链路之后,响应所述第一LE Audio广播信号,包括:
    在与所述蓝牙设备建立经典蓝牙链路之后,若确定所述蓝牙设备开启所述安全连接功能,则响应所述第一LE Audio广播信号,向所述蓝牙设备发起LE Audio连接请求。
  14. 根据权利要求11所述的方法,其特征在于,在所述与所述蓝牙设备建立经典蓝牙链路之后,所述方法还包括:
    若确定所述蓝牙设备开启所述安全连接功能,则进行CTKD流程,将经典蓝牙连接对应的第一密钥转换为BLE连接对应的第二密钥。
  15. 根据权利要求11所述的方法,其特征在于,在所述与所述蓝牙设备建立经典蓝牙连接之后,所述方法还包括:
    若确定所述蓝牙设备关闭所述安全连接功能,则不进行CTKD流程。
  16. 根据权利要求11~15任一项所述的方法,其特征在于,所述向蓝牙设备发送经典蓝牙连接请求,包括:
    向蓝牙设备发送携带有目标字段的经典蓝牙连接请求;
    其中,在所述终端设备支持蓝牙低功耗音频功能的情况下,所述目标字段包含第一标识;在所述终端设备不支持蓝牙低功耗音频功能的情况下,所述目标字段包含第二标识。
  17. 一种蓝牙连接方法,其特征在于,应用于耳机设备,所述耳机设备包括主耳机及从耳机,所述方法包括:
    所述主耳机接收终端设备发送的经典蓝牙连接请求;
    在所述主耳机根据所述经典蓝牙连接请求确定所述终端设备支持蓝牙低功耗音频功能的情况下,控制所述耳机设备的安全连接功能处于开启状态;所述安全连接功能用于指示能够在经典蓝牙链路的基础上进行BLE连接的配对操作的功能;
    在所述主耳机根据所述经典蓝牙连接请求确定所述终端设备不支持所述蓝牙低功耗音频功能的情况下,控制所述安全连接功能处于关闭状态;
    所述主耳机响应所述经典蓝牙连接请求,与所述终端设备建立经典蓝牙链路。
  18. 根据权利要求17所述的方法,其特征在于,在所述耳机设备的安全连接功能处于开启状态的情况下,所述方法还包括:
    所述主耳机发送第一LE Audio广播信号,所述第一LE Audio广播信号用于触发接收到所述第一LE Audio广播信号的所述终端设备,在与所述主耳机建立所述经典蓝牙链路后,向所述主耳机发起LE Audio连接请求。
  19. 根据权利要求17或18所述的方法,其特征在于,在所述主耳机接收终端设备发送的经典蓝牙连接请求之后,所述方法还包括:
    所述主耳机对所述经典蓝牙连接请求进行解析,以提取所述经典蓝牙连接请求中包含的目标字段;
    所述主耳机根据所述目标字段判断所述终端设备是否支持蓝牙低功耗音频功能。
  20. 根据权利要求17所述的方法,其特征在于,所述主耳机的经典蓝牙地址与BLE地址相同。
  21. 根据权利要求17所述的方法,其特征在于,在所述耳机设备的安全连接功能处于开启状态的情况下,所述方法还包括:
    所述主耳机向所述从耳机发送广播触发指令;
    所述从耳机根据所述广播触发指令发送第二LE Audio广播信号,所述第二LE Audio广播信号用于触发接收到所述第二LE Audio广播信号的所述终端设备,向所述从耳机发起LE Audio连接请求。
  22. 一种蓝牙连接装置,其特征在于,应用于蓝牙设备,所述装置包括:
    请求接收模块,用于接收终端设备发送的经典蓝牙连接请求;
    功能控制模块,用于在根据所述经典蓝牙连接请求确定所述终端设备支持蓝牙低功耗音频功能的情况下,控制安全连接功能处于开启状态;所述安全连接功能用于指示能够在经典蓝牙链路的基础上进行BLE连接的配对操作的功能;
    所述功能控制模块,还用于在根据所述经典蓝牙连接请求确定所述终端设备不支持所述蓝牙低功耗音频功能的情况下,控制所述安全连接功能处于关闭状态;
    连接模块,用于响应所述经典蓝牙连接请求,与所述终端设备建立经典蓝牙链路。
  23. 一种蓝牙连接装置,其特征在于,应用于终端设备,所述装置包括:
    请求发送模块,用于向蓝牙设备发送经典蓝牙连接请求,以使所述蓝牙设备在根据所述经典蓝牙连接请求确定所述终端设备支持蓝牙低功耗音频功能的情况下,控制安全连接功能处于开启状态,在根据所述经典蓝牙连接请求确定所述终端设备不支持所述蓝牙低功耗音频功能的情况下,控制所述安全连接功能处于关闭状态;所述安全连接功能用于指示能够在经典蓝牙链路的基础上进行BLE连接的配对操作的功能;
    连接模块,用于与所述蓝牙设备建立经典蓝牙链路。
  24. 一种蓝牙连接装置,其特征在于,应用于耳机设备,所述耳机设备包括主耳机及从耳机,所述装置包括:
    接收模块,用于通过所述主耳机接收终端设备发送的经典蓝牙连接请求;
    功能控制模块,用于在所述主耳机根据所述经典蓝牙连接请求确定所述终端设备支持蓝牙低功耗音频功能的情况下,通过所述主耳机控制所述耳机设备的安全连接功能处于开启状态;所述安全连接功能用于指示能够在经典蓝牙链路的基础上进行BLE连接的配对操作的功能;
    所述功能控制模块,还用于在所述主耳机根据所述经典蓝牙连接请求确定所述终端设备不支持所述蓝牙低功耗音频功能的情况下,通过所述主耳机控制所述安全连接功能处于关闭状态;
    连接模块,用于通过所述主耳机响应所述经典蓝牙连接请求,与所述终端设备建立经典蓝牙链路。
  25. 一种电子设备,其特征在于,包括存储器、处理器及通信单元,所述存储器中存储有计算机程序,所述计算机程序被所述处理器执行时,使得所述电子设备实现如权利要求1~10或11~16或17~21任一项所述的方法。
  26. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被电子设备中的处理器执行时,使得所述电子设备实现如权利要求1~10或11~16或17~21任一项所述的方法。
PCT/CN2023/099367 2022-07-22 2023-06-09 蓝牙连接方法、装置、电子设备及计算机可读存储介质 WO2024016885A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210868499.2A CN117479131A (zh) 2022-07-22 2022-07-22 蓝牙连接方法、装置、电子设备及计算机可读存储介质
CN202210868499.2 2022-07-22

Publications (1)

Publication Number Publication Date
WO2024016885A1 true WO2024016885A1 (zh) 2024-01-25

Family

ID=89616958

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/099367 WO2024016885A1 (zh) 2022-07-22 2023-06-09 蓝牙连接方法、装置、电子设备及计算机可读存储介质

Country Status (2)

Country Link
CN (1) CN117479131A (zh)
WO (1) WO2024016885A1 (zh)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180103499A1 (en) * 2016-10-06 2018-04-12 Htc Corporation Control method for bluetooth communication and bluetooth low energy communication
CN108476060A (zh) * 2016-06-27 2018-08-31 华为技术有限公司 用于双模蓝牙设备之间建立经典蓝牙连接的方法和双模蓝牙设备
CN108551670A (zh) * 2018-03-30 2018-09-18 深圳市冠旭电子股份有限公司 一种蓝牙连接方法、装置及智能终端
CN112469015A (zh) * 2019-09-06 2021-03-09 华为技术有限公司 蓝牙连接的方法和电子设备
CN114339618A (zh) * 2021-12-16 2022-04-12 恒玄科技(上海)股份有限公司 广播控制方法、蓝牙音频***和蓝牙音频设备

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108476060A (zh) * 2016-06-27 2018-08-31 华为技术有限公司 用于双模蓝牙设备之间建立经典蓝牙连接的方法和双模蓝牙设备
US20180103499A1 (en) * 2016-10-06 2018-04-12 Htc Corporation Control method for bluetooth communication and bluetooth low energy communication
CN108551670A (zh) * 2018-03-30 2018-09-18 深圳市冠旭电子股份有限公司 一种蓝牙连接方法、装置及智能终端
CN112469015A (zh) * 2019-09-06 2021-03-09 华为技术有限公司 蓝牙连接的方法和电子设备
CN114339618A (zh) * 2021-12-16 2022-04-12 恒玄科技(上海)股份有限公司 广播控制方法、蓝牙音频***和蓝牙音频设备

Also Published As

Publication number Publication date
CN117479131A (zh) 2024-01-30

Similar Documents

Publication Publication Date Title
US10524300B2 (en) Wireless low-latency audio content sharing
EP3893109B1 (en) Method and device for connecting bluetooth devices
JP6039133B2 (ja) Wi−fiディスプレイ接続のオーディオおよび音声バックチャネルを確立および制御すること
WO2018032455A1 (zh) 一种蓝牙通信的方法及终端
US11172530B2 (en) Communication establishment method and terminal
US8825873B2 (en) Using a service discovery request to find available devices
WO2014047853A1 (zh) 一种蓝牙设备之间连接的方法及设备
US20160299739A1 (en) Method for controlling data streaming using bluetooth communication
WO2016080798A1 (ko) 블루투스 통신을 지원하는 무선 통신 시스템에서 디바이스들 간 페어링을 수행하기 위한 방법 및 이를 위한 장치
WO2022068517A1 (zh) 蓝牙通信***、蓝牙连接方法、电子设备及存储介质
WO2024016948A1 (zh) 信息更新方法及装置、音频共享方法及***、电子设备
WO2023036178A1 (zh) 蓝牙连接方法、装置、耳机设备及计算机可读存储介质
WO2016203877A1 (ja) 通信装置、通信方法、プログラム、及び通信システム
WO2024119947A1 (zh) 蓝牙通信方法、装置、电子设备及计算机可读介质
WO2024066694A1 (zh) 音频设备的连接方法、装置、存储介质及设备
WO2017140095A1 (zh) 一种无线通信方法及装置
WO2024016885A1 (zh) 蓝牙连接方法、装置、电子设备及计算机可读存储介质
WO2023103732A1 (zh) 耳机设备的状态控制方法、装置、耳机设备及存储介质
WO2021239032A1 (zh) 蓝牙协议连接方法、装置、存储介质及相关设备
CN111954123A (zh) 无线音频设备信息同步的方法、***、介质及无线音频设备
JP2015023539A (ja) 無線通信機器
WO2023098423A1 (zh) 蓝牙连接方法及装置、蓝牙地址配置方法及装置
WO2023093328A1 (zh) 蓝牙回连方法及装置、信息存储方法及装置、终端设备
WO2023065881A1 (zh) 蓝牙连接方法、装置、电子设备及存储介质
WO2023246056A1 (zh) 设备连接方法及装置、存储介质、芯片

Legal Events

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

Ref document number: 23841951

Country of ref document: EP

Kind code of ref document: A1