WO2023098423A1 - 蓝牙连接方法及装置、蓝牙地址配置方法及装置 - Google Patents

蓝牙连接方法及装置、蓝牙地址配置方法及装置 Download PDF

Info

Publication number
WO2023098423A1
WO2023098423A1 PCT/CN2022/130692 CN2022130692W WO2023098423A1 WO 2023098423 A1 WO2023098423 A1 WO 2023098423A1 CN 2022130692 W CN2022130692 W CN 2022130692W WO 2023098423 A1 WO2023098423 A1 WO 2023098423A1
Authority
WO
WIPO (PCT)
Prior art keywords
bluetooth
connection
bluetooth device
address
classic
Prior art date
Application number
PCT/CN2022/130692
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 WO2023098423A1 publication Critical patent/WO2023098423A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W48/00Access restriction; Network selection; Access point selection
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W56/00Synchronisation arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W56/00Synchronisation arrangements
    • H04W56/001Synchronization between nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/15Setup of multiple wireless link connections
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Definitions

  • the present application relates to the field of communication technology, and in particular to a Bluetooth connection method and device, and a Bluetooth address configuration method and device.
  • Bluetooth communication standard protocol issued by the Bluetooth SIG has been updating and changing, such as from the earliest classic Bluetooth standard protocol, to the BLE (Bluetooth Low Energy, Bluetooth Low Energy) standard protocol, and then to the BLE Audio (Bluetooth Low Energy Audio, Bluetooth Low Energy Audio) standard protocol, etc.
  • electronic devices can usually support a variety of Bluetooth communication standard protocols, but how to use different Bluetooth communication technologies more flexibly to meet the needs of data transmission in different business scenarios is still one of the key directions in the field of Bluetooth communication. .
  • the embodiment of the present application discloses a Bluetooth connection method and device, and a Bluetooth address configuration method and device, which can more flexibly use different Bluetooth communication technologies to meet the requirements for data transmission in different business scenarios and reduce bandwidth consumption .
  • the embodiment of the present application discloses a Bluetooth connection method, which is applied to a group of Bluetooth devices.
  • the group of Bluetooth devices includes at least a first Bluetooth device and a second Bluetooth device.
  • the method includes:
  • the first Bluetooth device respectively establishes a first Bluetooth connection and a second Bluetooth connection with the terminal device
  • the second Bluetooth device monitors the first Bluetooth connection according to the first connection information corresponding to the first Bluetooth connection, and monitors the second Bluetooth connection according to the second connection information corresponding to the second Bluetooth connection. to monitor.
  • the embodiment of the present application discloses a Bluetooth address configuration method, which is applied to a group of Bluetooth devices.
  • the group of Bluetooth devices includes at least a first Bluetooth device and a second Bluetooth device.
  • the method includes:
  • the first Bluetooth device and the second Bluetooth device are configured with the same classic Bluetooth address, and the first Bluetooth device and the second Bluetooth device are configured with the same classic Bluetooth address.
  • the second Bluetooth device is configured with the same BLE address.
  • the embodiment of the present application discloses a Bluetooth connection device, which is applied to a group of Bluetooth devices, and the group of Bluetooth devices includes at least a first Bluetooth device and a second Bluetooth device; the device includes:
  • a connection module configured to respectively establish a first Bluetooth connection and a second Bluetooth connection with the terminal device by the first Bluetooth device
  • a monitoring module configured for the second Bluetooth device to monitor the first Bluetooth connection according to the first connection information corresponding to the first Bluetooth connection, and to monitor the first Bluetooth connection according to the second connection information corresponding to the second Bluetooth connection.
  • the second Bluetooth connection is listening.
  • the embodiment of the present application discloses a Bluetooth address configuration device, which is applied to a group of Bluetooth devices, and the group of Bluetooth devices includes at least a first Bluetooth device and a second Bluetooth device; the device includes:
  • An address configuration module configured to configure the first Bluetooth device and the second Bluetooth device to the same classic Bluetooth address when the first Bluetooth device establishes a Bluetooth connection with the second Bluetooth device, and The first Bluetooth device and the second Bluetooth device are configured with the same BLE address.
  • the embodiment of the present application discloses an electronic device, including a memory and a processor, and a computer program is stored in the memory, and when the computer program is executed by the processor, the processor realizes any of the above-mentioned method.
  • the embodiment of the present application discloses a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, any one of the methods described above is implemented.
  • FIG. 1 is a schematic diagram of establishing a Bluetooth connection between an earphone device and a terminal device in the related art
  • Fig. 2 is an application scenario diagram of a bluetooth connection method in an embodiment
  • Fig. 3 is a flowchart of the bluetooth connection method in an embodiment
  • Fig. 4 is the flowchart of bluetooth connection method in another embodiment
  • FIG. 5 is a schematic diagram of the sequence of the Bluetooth connection method in an embodiment
  • FIG. 6 is a schematic diagram of the sequence of the Bluetooth connection method in another embodiment
  • Fig. 7 is the flowchart of bluetooth address configuration method in one embodiment
  • Figure 8 is a block diagram of a bluetooth connection device in one embodiment
  • Fig. 9 is a block diagram of a bluetooth address configuration device in an embodiment
  • Fig. 10 is a structural block diagram of an electronic device in an embodiment.
  • first, second and the like used in this application may be used to describe various elements herein, but these elements are not limited by these terms. These terms are only used to distinguish one element from another element.
  • a first Bluetooth device could be termed a second Bluetooth device, and, similarly, a second Bluetooth device could be termed a first Bluetooth device, without departing from the scope of the present application.
  • Both the first bluetooth device and the second bluetooth device are headphones, but they are not the same bluetooth device.
  • plural and the like involved in this application refer to two or more than two.
  • the protocols supporting audio data transmission in Bluetooth technology can include A2DP (Advanced Audio Distribution Profile, Bluetooth Audio Transmission Model Protocol) based on the classic Bluetooth standard protocol, and the BLE Audio standard protocol developed on the basis of the BLE protocol.
  • BLE Audio technology solves the problem that the BLE connection can only transmit data with a small amount of data, but not audio data.
  • the BLE Audio protocol supports LC3 (Low Complexity Communications Codec, low-power audio codec) encoded audio data, making The transmission of audio data can better take into account various aspects such as power consumption, real-time performance and sound quality.
  • each Bluetooth device needs to communicate with External electronic devices establish LE Audio Bluetooth connections, and then use common time stamps and other methods to achieve data synchronization within the same group of Bluetooth devices.
  • the first earphone and the second earphone belong to the same earphone device (that is, belong to the same group of Bluetooth devices), and the earphone device supports dual-mode connection (such as being able to establish a classic Bluetooth connection and a LE Audio Bluetooth connection at the same time).
  • the terminal device and the headset device establish a classic Bluetooth connection and a LE Audio Bluetooth connection at the same time, the terminal device establishes a classic Bluetooth connection with one of the headsets (such as the first headset), and establishes a LE Audio connection with the first headset and the second headset respectively. Audio Bluetooth connection. That is, there are three Bluetooth communication links between the headset device and the terminal device, which increases bandwidth consumption.
  • a Bluetooth connection method and device a Bluetooth address configuration method and device are provided, which can more flexibly use different Bluetooth communication technologies to meet the requirements for data transmission in different business scenarios, and can reduce Bandwidth consumption.
  • Fig. 2 is an application scene diagram of a Bluetooth connection method in an embodiment.
  • the first bluetooth device 20 and the second bluetooth device 30 belong to a group of bluetooth devices, the group of bluetooth devices may include but not limited to a group of bluetooth speakers, a pair of earphones, etc., the pair of earphones may include but not limited to earphones, Wireless earphones such as earphones, further, may be true wireless stereo (True Wireless Stereo, TWS) bluetooth earphones and the like.
  • a group of Bluetooth devices may include more Bluetooth devices.
  • the group of Bluetooth devices can be devices supporting dual-mode connections, and can establish two different Bluetooth connections with the terminal device 10 at the same time, such as establishing a classic Bluetooth connection and a BLE connection at the same time, or establishing a classic Bluetooth connection and a LE Audio Bluetooth connection at the same time wait.
  • the terminal device 10 may include but not limited to a mobile phone, a smart wearable device, a vehicle terminal, a tablet computer, a PC (Personal Computer, personal computer), a PDA (Personal Digital Assistant, personal digital assistant) and the like.
  • the first Bluetooth device 20 can respectively establish a first Bluetooth connection and a second Bluetooth connection with the terminal device 10, and the second Bluetooth device 30 can communicate with the first Bluetooth connection according to the first connection information corresponding to the first Bluetooth connection.
  • the connection is monitored, and the second Bluetooth connection is monitored according to the second connection information corresponding to the second Bluetooth connection.
  • a group of Bluetooth devices can realize dual-mode connection only by establishing two Bluetooth communication links with the terminal device 10, which can flexibly use different Bluetooth communication technologies to meet the needs of data transmission in different business scenarios, and can Reduce bandwidth consumption of wireless channels.
  • the first bluetooth device 20 can be a master device in a group of bluetooth devices
  • the second bluetooth device 30 can be a slave device in a group of bluetooth devices
  • the master device refers to a device that can directly communicate with a terminal device 10 A device that establishes a Bluetooth connection.
  • the slave device refers to a device that does not directly establish a Bluetooth connection with the terminal device 10.
  • the slave device can monitor the Bluetooth connection between the master device and the terminal device 10 to realize the connection between the master device and the slave device. Data synchronization between.
  • a Bluetooth connection method is provided, which can be applied to the above-mentioned group of Bluetooth devices, and the group of Bluetooth devices can include at least a first Bluetooth device and a second Bluetooth device, and the method can be Include the following steps:
  • Step 310 the first Bluetooth device respectively establishes a first Bluetooth connection and a second Bluetooth connection with the terminal device.
  • the first Bluetooth connection and the second Bluetooth connection can be Bluetooth connections established using different Bluetooth communication technologies respectively.
  • the first Bluetooth connection can include a classic Bluetooth connection
  • the second Bluetooth connection includes a BLE connection or LE Audio Bluetooth connect.
  • the first Bluetooth connection can be a classic Bluetooth connection established based on the classic Bluetooth communication protocol
  • the second Bluetooth connection can be a BLE connection established based on the BLE communication protocol
  • the first Bluetooth connection can be a classic Bluetooth connection established based on the classic Bluetooth communication protocol
  • Bluetooth connection the second Bluetooth connection can be LE Audio Bluetooth connection established based on BLE Audio protocol, etc.
  • the classic Bluetooth communication protocol generally refers to the Bluetooth protocol below the Bluetooth protocol version 4.0
  • the BLE communication protocol generally refers to the Bluetooth protocol above the Bluetooth protocol version 4.0
  • the BLE Audio protocol is a protocol for transmitting audio output based on the BLE communication protocol.
  • the first Bluetooth device may establish a Bluetooth connection (which may be a classic Bluetooth connection or a BLE connection) with the second Bluetooth device.
  • a Bluetooth connection which may be a classic Bluetooth connection or a BLE connection
  • the first Bluetooth device and the second Bluetooth device can be configured as the same classic Bluetooth address
  • the first Bluetooth device and the second Bluetooth device can be configured as the same BLE address.
  • the classic Bluetooth addresses of the first Bluetooth device and the second Bluetooth device are both address A
  • the BLE addresses of the first Bluetooth device and the second Bluetooth device can be Both are address B.
  • the first Bluetooth device and the second Bluetooth device share the same classic Bluetooth address and the same BLE address, for an external device (such as the terminal device in this application), the first Bluetooth device and the second Bluetooth device share the same classic Bluetooth address. belongs to one Bluetooth device, the first Bluetooth device and the second Bluetooth device also belong to the same Bluetooth device in BLE, and the first Bluetooth device and the second Bluetooth device will not be distinguished.
  • the same BLE address configured by the first Bluetooth device and the second Bluetooth device may be the same as the same classic Bluetooth address configured by the first Bluetooth device and the second Bluetooth device, for example, when the first Bluetooth device and the second Bluetooth device establish In the case of Bluetooth connection, the classic Bluetooth addresses of the first Bluetooth device and the second Bluetooth device are both address A, and the BLE addresses of the first Bluetooth device and the second Bluetooth device are also address A.
  • the terminal device obtains the same classic Bluetooth address and the same BLE address configured by the first Bluetooth device and the second Bluetooth device at the same time, since the acquired classic Bluetooth address is the same as the BLE address, only one corresponding to a group of Bluetooth devices can be displayed.
  • the user can enable the terminal device to establish the first Bluetooth connection and the second Bluetooth connection with the main device in a group of Bluetooth devices by triggering the pending connection information, which can avoid causing trouble to the user and improve the operation efficiency.
  • the first Bluetooth connection established between the first Bluetooth device and the terminal device is a classic Bluetooth connection.
  • the above-mentioned group of Bluetooth devices may be devices that have not established a classic Bluetooth connection with the terminal device, that is, the device information corresponding to the group of Bluetooth devices (such as device name, classic Bluetooth address, device model, etc.) is not stored in the terminal device. and other information).
  • This group of bluetooth devices can be in pairing state, can be that the first bluetooth device and/or the second bluetooth device are in pairing state (pairing state can be understood as opening page scan mode and inquiry scan mode). Take the first Bluetooth device in the pairing state as an example, the first Bluetooth device can enable the inquiry scan mode and page scan mode at the same time.
  • the first Bluetooth device In the inquiry scan mode, the first Bluetooth device is allowed to be scanned and searched by the terminal device. In the page scan mode, the second A bluetooth device is allowed to be connected by the end device.
  • the first bluetooth device turns on the inquiry scan mode, if the terminal device scans the surrounding bluetooth devices, the first bluetooth device can receive the scan request sent by the terminal device, and send a scan response to the terminal device according to the scan request.
  • the terminal device can acquire the classic Bluetooth address of the first Bluetooth device (that is, the classic Bluetooth address of the group of Bluetooth devices) according to the scanning response, and send a classic Bluetooth connection request based on the classic Bluetooth address.
  • the classic Bluetooth connection request can be a paging (page) data packet, and the terminal device can send the paging data packet in a frequency hopping manner to page the group of Bluetooth devices.
  • the first Bluetooth device with the page scan mode enabled can scan (scan) the paging data packets sent externally at fixed intervals.
  • the Bluetooth connection request establishes a classic Bluetooth connection with the end device.
  • the aforementioned group of Bluetooth devices may be devices that have established a classic Bluetooth connection with the terminal device, that is, the terminal device may store device information corresponding to the group of Bluetooth devices.
  • the first Bluetooth device can be in a connectable state. In this connectable state, only the page scan mode can be turned on.
  • the terminal device can perform Bluetooth reconnection based on the stored device information corresponding to the group of Bluetooth devices, and can send based on the stored classic Bluetooth address. Classic Bluetooth connection request.
  • a group of Bluetooth devices can be connected to the first Bluetooth device and/or the second Bluetooth device Start the LE Audio broadcast after receiving the classic Bluetooth connection request sent by the terminal device, so that the terminal device can perform LE Audio Bluetooth connection with the group of Bluetooth devices after receiving the LE Audio broadcast.
  • the establishment of a classic Bluetooth connection between the first Bluetooth device and the terminal device may include establishing a physical link such as ACL (Asynchronous Connectionless, asynchronous connectionless) or SCO (Synchronous Connection Oriented, connection-oriented synchronous link) between the first Bluetooth device and the terminal device It may also include service connections established based on upper-layer protocols, such as A2DP, HFP (Hands-free Profile), etc.
  • ACL Asynchronous Connectionless, asynchronous connectionless
  • SCO Synchronous Connection Oriented, connection-oriented synchronous link
  • the second Bluetooth connection established between the first Bluetooth device and the terminal device may be a LE Audio Bluetooth connection.
  • the first bluetooth device and/or the second bluetooth device can send the LE Audio broadcast signal based on the BLE address, so that the terminal device receiving the LE Audio broadcast signal sends the LE Audio connection request according to the BLE address.
  • the terminal device can turn on the BLE broadcast scan to scan the LE Audio broadcast signal sent by the surrounding Bluetooth devices.
  • the terminal device scans the first Bluetooth device and/or the LE Audio broadcast signal sent, it can be determined according to the LE Audio broadcast signal
  • the BLE address corresponding to the first Bluetooth device that is, the BLE address of the group of Bluetooth devices. Since the BLE addresses of the first Bluetooth device and the second Bluetooth device are the same, the terminal device can only obtain one BLE address no matter whether it receives the LE Audio broadcast signal sent by the first Bluetooth device or the second Bluetooth device.
  • the terminal device can send LE Audio connection request based on the BLE address.
  • the master device (such as the first bluetooth device) in the first bluetooth device and the second bluetooth device can establish a LE Audio bluetooth connection with the terminal device according to the LE Audio connection request. It is understandable that the device for establishing a classic Bluetooth connection and establishing a LE Audio Bluetooth connection is the same device.
  • the terminal device can send a connection request command to the first Bluetooth device based on the BLE address in the received LE Audio broadcast signal, and the connection request command is used to notify the first Bluetooth device that it is about to communicate with the first Bluetooth device.
  • the connection request command is used to notify the first Bluetooth device that it is about to communicate with the first Bluetooth device.
  • the first bluetooth device can prepare for receiving according to the connection request command.
  • the connection request command may include field information such as transmission window delay (Transmit window offset), transmission window size (Transmit window size). Among them, information such as transmission window delay and transmission window size can be used to determine the time interval between the first Bluetooth device receiving the connection request command and receiving the LE Audio connection data packet.
  • the terminal device When reaching the connection anchor point, the terminal device can send an LE Audio connection data packet to the first Bluetooth device, and after receiving the LE Audio connection data packet, the first Bluetooth device can return a response signal to the terminal device, thereby successfully communicating with the terminal device.
  • Establish LE Audio Bluetooth connection For the specific connection method, please refer to the regulations of the relevant Bluetooth protocol.
  • Step 320 the second Bluetooth device monitors the first Bluetooth connection according to the first connection information corresponding to the first Bluetooth connection, and monitors the second Bluetooth connection according to the second connection information corresponding to the second Bluetooth connection.
  • the first connection information corresponding to the first Bluetooth connection can be synchronized to the second Bluetooth device, and the first connection information can include but not limited to Frequency hopping information, channel information, clock information, link key (such as link key in classic Bluetooth connection, etc.) and other information.
  • the second bluetooth device can monitor the first bluetooth connection according to the first connection information corresponding to the first bluetooth connection.
  • the Bluetooth connection transmits data with the first Bluetooth device.
  • the second connection information corresponding to the second Bluetooth connection can be synchronized to the second Bluetooth device, and the second connection information can also include but not limited to the second connection information Corresponding frequency hopping information, channel information, clock information, link key (such as LTK "Long Term Key” in LE Audio Bluetooth connection, etc.) and other information.
  • the second bluetooth device can monitor the second bluetooth connection according to the second connection information corresponding to the second bluetooth connection, which is equivalent to establishing a second virtual bluetooth connection between the second bluetooth device and the terminal device.
  • the Bluetooth connection transmits data with the first Bluetooth device.
  • the second Bluetooth connection is a LE Audio Bluetooth connection
  • the second Bluetooth device can obtain the audio data transmitted by the terminal device through the LE Audio Bluetooth connection by monitoring, without establishing a separate communication link with the terminal device. This reduces bandwidth consumption.
  • terminal devices can quickly establish LE Audio Bluetooth connections and classic Bluetooth connections with Bluetooth devices that support both classic Bluetooth and BLE Audio, and combine BLE Audio with classic Bluetooth to meet users' needs for audio transmission in different scenarios.
  • the link key and LTK can be converted to each other, so one can be used to calculate the other.
  • the link key can be calculated according to the link key.
  • LTK is used for BLE Audio connection; or, after the first Bluetooth device obtains LTK in the process of establishing LE Audio Bluetooth connection with the terminal device, the link key can be calculated according to the LTK for classic Bluetooth connection.
  • the embodiment of the present application does not limit the order in which the first Bluetooth device establishes the first Bluetooth connection and the second Bluetooth connection with the terminal device, that is, the first Bluetooth device can first establish the first Bluetooth connection with the terminal device, and then establish the first Bluetooth connection with the terminal device.
  • the second Bluetooth connection may be established with the terminal device first, and then the first Bluetooth connection may be established, or the connection may be established at the same time.
  • the embodiment of the present application does not limit the order in which the second Bluetooth device monitors the first Bluetooth connection and the second Bluetooth connection, that is, the second Bluetooth device can first monitor the first Bluetooth connection, and then monitor the second Bluetooth connection. , you can also monitor the second Bluetooth connection first, and then monitor the first Bluetooth connection, or you can monitor at the same time. Of course, if only one of the links is used for data transmission, only the link can be monitored.
  • a group of Bluetooth devices can also include other Bluetooth devices.
  • the other Bluetooth devices are slave devices.
  • the working method and working principle may be similar to those of the second bluetooth device, and will not be repeated here.
  • the first Bluetooth device can use different Bluetooth communication technologies to respectively establish the first Bluetooth connection and the second Bluetooth connection with the terminal device, and can use different Bluetooth communication technologies more flexibly to meet the requirements of different business scenarios.
  • the second Bluetooth device can also perform data transmission with the terminal device through monitoring, it is not necessary to establish a communication link with the terminal device, which can reduce the bandwidth consumption of the wireless channel.
  • the above-mentioned first Bluetooth device includes a first earphone
  • the second Bluetooth device includes a second earphone
  • the first earphone and the second earphone form a pair of earphone devices.
  • the above method may further include: the first earphone receives the audio data sent by the terminal device through the first Bluetooth connection or the second Bluetooth connection, and processes the audio data to obtain the first channel audio data corresponding to the first earphone;
  • the second earphone receives the audio data sent by the terminal device by monitoring the first Bluetooth connection or the second Bluetooth connection, and processes the audio data to obtain second channel audio data corresponding to the first earphone.
  • the first earphone can be the left earphone, and the corresponding channel is the left channel; the second earphone can be the right earphone, and the corresponding channel is the right channel; or, the first earphone can be the right earphone, and the corresponding channel is the right sound channel, the second earphone may be the left earphone, and the corresponding sound channel is the left sound channel.
  • the terminal device sends audio data to the earphone device through the first Bluetooth connection or the second Bluetooth connection, the audio data is transmitted through only one communication link, therefore, the audio data of the left channel and the right channel can be simultaneously
  • the audio data are commonly sent to the first earphone.
  • the first Bluetooth connection is a classic Bluetooth connection. If the terminal device sends audio data to the first earphone through the classic Bluetooth connection, the first earphone can process the received audio data to obtain the audio data corresponding to the first earphone.
  • the audio data of the first channel (such as the audio data of the right channel, or the audio data of the left channel), and play the audio data of the first channel.
  • the second earphone can monitor the classic Bluetooth connection between the first earphone and the terminal device to synchronously receive the audio data sent by the terminal device, and the second earphone can process the received audio data to obtain the corresponding audio data of the second earphone.
  • second channel audio data (such as left channel audio data, or right channel audio data; different from the first channel audio data), and play the second channel audio data.
  • the second Bluetooth connection is a LE Audio Bluetooth connection. If the terminal device sends audio data to the first earphone through the LE Audio Bluetooth connection, the first earphone can process the received audio data to obtain the same audio data as the first earphone. The earphone corresponds to the first channel audio data, and plays the first channel audio data. The second earphone can monitor the LE Audio Bluetooth connection between the first earphone and the terminal device to synchronously receive the audio data sent by the terminal device, and the second earphone can process the received audio data to obtain the corresponding , and play the second-channel audio data.
  • the first earphone and the second earphone respectively process the received audio data to obtain the audio data of the corresponding channel for playing.
  • the second earphone does not need to establish a communication link with the terminal device In this case, the accuracy of the audio data output by the first earphone and the second earphone can still be guaranteed, and the audio playback effect can be improved.
  • a Bluetooth connection method is provided, which can be applied to the above-mentioned group of Bluetooth devices, and the Bluetooth connection method may include the following steps:
  • Step 402 the first Bluetooth device establishes a third Bluetooth connection with the second Bluetooth device.
  • the first Bluetooth device Before the first Bluetooth device establishes the Bluetooth connection with the terminal device, the first Bluetooth device may first establish a third Bluetooth connection with the second Bluetooth device, and the third Bluetooth connection may include a classic Bluetooth connection or a BLE connection.
  • the first Bluetooth device and the second Bluetooth device may respectively correspond to different classic Bluetooth connections. address.
  • the first Bluetooth device can obtain the current classic Bluetooth address of the second Bluetooth device, and establish a classic Bluetooth connection with the second Bluetooth device based on the obtained classic Bluetooth address; and/or, the second Bluetooth device can obtain the current classic Bluetooth address of the first Bluetooth device.
  • the first Bluetooth device and the second Bluetooth device share the same classic Bluetooth address.
  • the first Bluetooth device can share the classic Bluetooth address of the first Bluetooth device with the second Bluetooth device through the classic Bluetooth connection with the second Bluetooth device.
  • the second Bluetooth device can change the classic Bluetooth address to the classic Bluetooth address shared by the first Bluetooth device.
  • the classic Bluetooth address of the first Bluetooth device is address A
  • the classic Bluetooth address of the second Bluetooth device is address B
  • the first Bluetooth device shares address A with the second Bluetooth device
  • the second Bluetooth device can also change the classic Bluetooth address to address A, so as to realize the sharing between the first Bluetooth device and the second Bluetooth device Same classic bluetooth address.
  • the BLE address of the first Bluetooth device may be the same as or different from the BLE address of the second Bluetooth device.
  • the first Bluetooth device can share the BLE address of the first Bluetooth device with the second Bluetooth device through the classic Bluetooth connection with the second Bluetooth device, and the second Bluetooth device can change the BLE address to the BLE shared by the first Bluetooth device address.
  • the first Bluetooth device and the second Bluetooth device respectively correspond to different BLE addresses.
  • the first Bluetooth device can send a BLE broadcast signal based on its own BLE address, and the second Bluetooth device can scan the BLE broadcast signal sent by the first Bluetooth device, and according to the BLE address of the first Bluetooth device carried in the BLE broadcast signal and the first Bluetooth
  • the device establishes a BLE connection; and/or, the second Bluetooth device can send a BLE broadcast signal based on its own BLE address, and the first Bluetooth device can scan the BLE broadcast signal sent by the second Bluetooth device, and according to the second BLE broadcast signal carried by the BLE broadcast signal
  • the BLE address of the Bluetooth device establishes a BLE connection with the second Bluetooth device.
  • the first Bluetooth device and the second Bluetooth device share the same BLE address.
  • the first Bluetooth device can share the BLE address of the first Bluetooth device with the second Bluetooth device through the BLE connection with the second Bluetooth device, and the second Bluetooth device The BLE address can be changed to the BLE address shared by the first Bluetooth device.
  • the BLE address of the first Bluetooth device is address A
  • the BLE address of the second Bluetooth device is address B
  • the first Bluetooth device shares address A with the second Bluetooth device
  • the second Bluetooth device can also change the BLE address to address A, so that the first Bluetooth device and the second Bluetooth device share the same BLE address.
  • the classic Bluetooth address of the first Bluetooth device and the classic Bluetooth address of the second Bluetooth device may be the same or different. If the classic Bluetooth address of the first Bluetooth device is different from the classic Bluetooth address of the second Bluetooth device before the first Bluetooth device establishes a BLE connection with the second Bluetooth device, then after the first Bluetooth device establishes a BLE connection with the second Bluetooth device , the first Bluetooth device can share the classic Bluetooth address of the first Bluetooth device with the second Bluetooth device through the BLE connection with the second Bluetooth device, and the second Bluetooth device can change the classic Bluetooth address to the one shared by the first Bluetooth device Classic Bluetooth address.
  • the first Bluetooth device and the second Bluetooth device may be respectively configured as different classic Bluetooth addresses, and/or may be respectively It is configured as a different BLE address, so as to ensure that the first Bluetooth device and the second Bluetooth device can normally establish a third Bluetooth connection, and realize information synchronization between the first Bluetooth device and the second Bluetooth device.
  • the first Bluetooth device and the second Bluetooth device can be configured with the same classic Bluetooth address and the same BLE address, which can ensure that a group of Bluetooth devices are In terms of a device, it is a device that accurately and stably implements the subsequent Bluetooth connection solution.
  • the second Bluetooth device does not need to establish a communication link with the terminal device, which can reduce the bandwidth consumption of the wireless channel.
  • the Bluetooth connection between the first Bluetooth device and the second Bluetooth device can be based on different Bluetooth addresses, but the Bluetooth addresses of the first Bluetooth device and the second Bluetooth device relative to the terminal device are the same, thus ensuring The Bluetooth connection between the first Bluetooth device and the second Bluetooth device is perceived by the terminal device as a Bluetooth device, which is convenient for the user to operate.
  • Step 404 The first Bluetooth device establishes a first Bluetooth connection with the terminal device, and sends first connection information corresponding to the first Bluetooth connection to the second Bluetooth device through a third Bluetooth connection.
  • Step 406 The first Bluetooth device establishes a second Bluetooth connection with the terminal device, and sends the first connection information corresponding to the first Bluetooth connection and the second connection information corresponding to the second Bluetooth connection to the second Bluetooth connection through the third Bluetooth connection. equipment.
  • Step 408 the second Bluetooth device monitors the first Bluetooth connection according to the first connection information corresponding to the first Bluetooth connection, and monitors the second Bluetooth connection according to the second connection information corresponding to the second Bluetooth connection.
  • FIG. 5 is a schematic diagram of a sequence of a Bluetooth connection method in an embodiment.
  • a group of Bluetooth devices may include a first Bluetooth device and a second Bluetooth device.
  • the first Bluetooth device and the second Bluetooth device can establish a Bluetooth connection, and the first Bluetooth device can share the BT address and the BLE address of the first Bluetooth device with the second Bluetooth device.
  • the second Bluetooth device can change the BT address from B to A, and change the BLE address from B to A, that is, the BT addresses of the first Bluetooth device and the second Bluetooth device are both A, and the first Bluetooth device and the second Bluetooth device
  • the BLE address of the device is B.
  • the terminal device can establish a classic Bluetooth connection with the first Bluetooth device based on the BT address A, the first Bluetooth device can share the connection information of the classic Bluetooth connection with the second Bluetooth device, and the second Bluetooth device can send the first Bluetooth device based on the connection information.
  • the classic Bluetooth connection with the terminal device is monitored to realize data synchronization between the first Bluetooth device and the second Bluetooth device in the classic Bluetooth transmission path.
  • the terminal device can establish a LE Audio Bluetooth connection with the first Bluetooth device based on the BLE address A, and the first Bluetooth device can share the connection information of the LE Audio Bluetooth connection with the second Bluetooth device, and the second Bluetooth device can send the first Bluetooth connection to the first Bluetooth device based on the connection information.
  • the LE Audio Bluetooth connection between the Bluetooth device and the terminal device is monitored to realize data synchronization on the LE Audio Bluetooth transmission path between the first Bluetooth device and the second Bluetooth device.
  • the above-mentioned master-slave relationship of the first Bluetooth device can be a master device
  • the master-slave relationship of the second Bluetooth device can be a slave device. Therefore, the classic Bluetooth address and the BLE address of the first Bluetooth device are master devices
  • the corresponding classic Bluetooth address and BLE address by changing the classic Bluetooth address and BLE address of the second Bluetooth device to be the same as the classic Bluetooth address and BLE address of the first Bluetooth device, that is, both are configured as the classic Bluetooth address corresponding to the master device
  • the BLE address which can ensure that the terminal device can accurately establish a Bluetooth connection with the main device, especially when the terminal device is connected back to a group of Bluetooth devices, it can ensure that the terminal device can accurately connect back to the main device in a group of Bluetooth devices.
  • Step 410 a master-slave switch occurs between the first Bluetooth device and the second Bluetooth device, so that the first Bluetooth connection object with the terminal device is switched from the first Bluetooth device to the second Bluetooth device, and the second Bluetooth connection object with the terminal device is switched from the second Bluetooth device to the second Bluetooth device.
  • a bluetooth device is switched to a second bluetooth device.
  • a master-slave switch occurs between the first Bluetooth device and the second Bluetooth device, that is, the master-slave relationship of the first Bluetooth device is switched from a master device to a slave device, and the master-slave relationship of the second Bluetooth device is switched from a slave device to a master device, and the terminal device
  • the first Bluetooth connection object of the terminal device is switched from the first Bluetooth device to the second Bluetooth device; the second Bluetooth connection object of the terminal device is switched from the first Bluetooth device to the second Bluetooth device.
  • the first Bluetooth device and the second Bluetooth device are one device, because in the process of master-slave switching between the first Bluetooth device and the second Bluetooth device, the terminal device is insensitive and will not affect the terminal
  • the device uses this group of Bluetooth devices for business processing.
  • the master-slave switching condition when the master-slave switching condition is satisfied, the master-slave switching occurs between the first Bluetooth device and the second Bluetooth device.
  • the master-slave switching condition may include but not limited to any of the following conditions:
  • the first Bluetooth device detects that it is not in use by the user.
  • the first bluetooth device may be the first earphone in the earphone device.
  • the first earphone detects that it is not worn or when the first earphone detects that it is placed in an earphone box, it can be determined that it is not in use by the user. Trigger a master-slave switchover.
  • the signal strength of the first Bluetooth device relative to the terminal device is smaller than the strength threshold. For example, the distance between the first Bluetooth device and the terminal device is too far, or the Bluetooth signal sent by the first Bluetooth device is severely interfered by the environment, resulting in the deterioration of the signal strength of the Bluetooth signal sent by the first Bluetooth device received by the terminal device , it can trigger master-slave switching.
  • the first Bluetooth device and the terminal device exceeds the distance threshold of the Bluetooth connection, or the first Bluetooth device cannot be used due to low power, etc., it can trigger a master-slave switch, or do a power balance. There is no restriction on master-slave switching, etc.
  • a group of Bluetooth devices has the same Bluetooth address as the master device and the slave device relative to the terminal device, in general, when performing master-slave switching, it is not necessary to disconnect the Bluetooth connection, only to switch the connection It can also be understood as switching the object of direct communication with the terminal device, so that it can be switched without feeling.
  • the first Bluetooth device can pair the Monitor the first Bluetooth connection between the second Bluetooth device and the terminal device, and monitor the second Bluetooth connection between the second Bluetooth device and the terminal device according to the second connection information corresponding to the second Bluetooth connection. It can ensure that data synchronization between the first Bluetooth device and the second Bluetooth device is still maintained after master-slave switching occurs.
  • FIG. 6 is a timing diagram of a Bluetooth connection method in another embodiment.
  • the second Bluetooth device monitors the classic Bluetooth connection and the LE Audio Bluetooth connection between the first Bluetooth device and the terminal device, and realizes data synchronization between the first Bluetooth device and the second Bluetooth device
  • a master-slave switch occurs between the first Bluetooth device and the second Bluetooth device, the second Bluetooth device switches from the slave device to the master device, and the first Bluetooth device switches from the master device to the slave device.
  • the connection object of the classic Bluetooth connection between the terminal device and a group of Bluetooth devices is switched from the first Bluetooth device to the second Bluetooth device; the connection object of the LE Audio Bluetooth connection between the terminal device and a group of Bluetooth devices is switched from the first Bluetooth device to the second Bluetooth device.
  • the Bluetooth device switches to the second Bluetooth device.
  • the first bluetooth device can monitor the classic bluetooth connection between the second bluetooth device and the terminal device, so as to realize the data synchronization between the first bluetooth device and the second bluetooth device in the classic bluetooth transmission path; the first bluetooth device can The LE Audio Bluetooth connection between the second Bluetooth device and the terminal device is monitored to realize data synchronization in the LE Audio Bluetooth transmission path between the first Bluetooth device and the second Bluetooth device. It can be understood that the first Bluetooth device may also be put into a box or shut down, which causes the Bluetooth module to stop working, so as not to monitor the Bluetooth connection between the second Bluetooth device and the terminal device.
  • a group of Bluetooth devices can still maintain the first Bluetooth connection and the second Bluetooth connection established with the terminal device, ensuring The stability of the Bluetooth connection will not adversely affect the user's use.
  • a Bluetooth address configuration method is provided, which can be applied to the above-mentioned group of Bluetooth devices, and the group of Bluetooth devices includes at least a first Bluetooth device and a second Bluetooth device.
  • the method may include the steps of:
  • Step 710 when the first Bluetooth device establishes a Bluetooth connection with the second Bluetooth device, the first Bluetooth device and the second Bluetooth device are configured with the same classic Bluetooth address, and the first Bluetooth device and the second Bluetooth device are configured as Same BLE address.
  • the above-mentioned same classic Bluetooth address is the same as the above-mentioned same BLE address.
  • a group of Bluetooth devices are regarded as a whole, so that it is convenient for the user to perform Bluetooth connection operations, and it is also convenient to carry out Bluetooth Connect back, because the terminal device only needs to store a Bluetooth address (such as the Bluetooth address of the default master device) to realize the classic Bluetooth back connection and LE Audio Bluetooth back connection with any Bluetooth device in a group of Bluetooth devices.
  • the Bluetooth connection between the first Bluetooth device and the second Bluetooth device includes a classic Bluetooth connection; the method further includes: before the first Bluetooth device establishes a Bluetooth connection with the second Bluetooth device, The second Bluetooth devices are respectively configured with different classic Bluetooth addresses.
  • the Bluetooth connection between the first Bluetooth device and the second Bluetooth device includes a BLE connection; the method further includes: before the first Bluetooth device establishes a Bluetooth connection with the second Bluetooth device, the first Bluetooth device and the second Bluetooth device
  • the two Bluetooth devices are respectively configured with different BLE addresses.
  • the first Bluetooth device and the second Bluetooth device may be configured as different classic Bluetooth addresses, and/or may be configured separately are different BLE addresses, so as to ensure that the first Bluetooth device and the second Bluetooth device normally establish a Bluetooth connection, and realize information synchronization between the first Bluetooth device and the second Bluetooth device.
  • the first Bluetooth device and the second Bluetooth device can be configured with the same classic Bluetooth address and the same BLE address, which can ensure that a group of Bluetooth devices can communicate with external devices
  • the subsequent Bluetooth connection solution can be implemented accurately and stably.
  • the second Bluetooth device does not need to establish a communication link with the terminal device, which can reduce the bandwidth consumption of the wireless channel.
  • a Bluetooth connection device 800 is provided, which may be configured as the above-mentioned group of Bluetooth devices, and the group of Bluetooth devices includes at least a first Bluetooth device and a second Bluetooth device.
  • the Bluetooth connection device 800 may include a connection module 810 and a monitoring module 820 .
  • the connection module 810 is configured to respectively establish a first Bluetooth connection and a second Bluetooth connection with the terminal device by the first Bluetooth device.
  • the first Bluetooth connection includes a classic Bluetooth connection
  • the second Bluetooth connection includes a BLE connection or a LE Audio Bluetooth connection.
  • the first Bluetooth device and the second Bluetooth device share the same classic Bluetooth address, and the first Bluetooth device and the second Bluetooth device share the same BLE address.
  • the BLE address is the same as the classic Bluetooth address.
  • connection module 810 is also configured to send the LE Audio broadcast signal based on the BLE address by the first Bluetooth device and/or the second Bluetooth device, so that the terminal device receiving the LE Audio broadcast signal sends the LE Audio broadcast signal according to the BLE address LE Audio connection request; and the first Bluetooth device establishes a LE Audio Bluetooth connection with the terminal device according to the received LE Audio connection request.
  • the master device (such as the first Bluetooth device) performs the LE Audio Bluetooth connection.
  • the monitoring module 820 is configured such that the second Bluetooth device monitors the first Bluetooth connection according to the first connection information corresponding to the first Bluetooth connection, and monitors the second Bluetooth connection according to the second connection information corresponding to the second Bluetooth connection .
  • the first Bluetooth device can use different Bluetooth communication technologies to respectively establish the first Bluetooth connection and the second Bluetooth connection with the terminal device, and can use different Bluetooth communication technologies more flexibly to meet the requirements of different business scenarios.
  • the second Bluetooth device can also perform data transmission with the terminal device through monitoring, it is not necessary to establish a communication link with the terminal device, which can reduce the bandwidth consumption of the wireless channel.
  • the first Bluetooth device includes a first earphone
  • the second Bluetooth device includes a second earphone
  • the first earphone and the second earphone form a pair of earphone devices.
  • the Bluetooth connection device 800 mentioned above also includes an audio processing module.
  • the audio processing module is configured to receive the audio data sent by the terminal device through the first Bluetooth connection or the second Bluetooth connection by the first earphone, and process the audio data to obtain the first channel audio data corresponding to the first earphone ; and the second earphone monitors the first Bluetooth connection or the second Bluetooth connection to receive the audio data sent by the terminal device, and process the audio data to obtain the second channel audio data corresponding to the first earphone .
  • the first earphone and the second earphone respectively process the received audio data to obtain the audio data of the corresponding channel for playing.
  • the second earphone does not need to establish a communication link with the terminal device In this case, the accuracy of the audio data output by the first earphone and the second earphone can still be guaranteed, and the audio playback effect can be improved.
  • connection module 810 is further configured to establish a third Bluetooth connection between the first Bluetooth device and the second Bluetooth device.
  • the third Bluetooth connection includes a classic Bluetooth connection, and before the first Bluetooth device establishes the third Bluetooth connection with the second Bluetooth device, the first Bluetooth device and the second Bluetooth device respectively correspond to different classic Bluetooth addresses ; After the first Bluetooth device establishes a third Bluetooth connection with the second Bluetooth device, the first Bluetooth device and the second Bluetooth device share the same classic Bluetooth address; or,
  • the third bluetooth connection comprises BLE connection, before the first bluetooth device and the second bluetooth device establish the third bluetooth connection, the first bluetooth device and the second bluetooth device respectively correspond to different BLE addresses; After the devices establish the third Bluetooth connection, the first Bluetooth device and the second Bluetooth device share the same BLE address.
  • the Bluetooth connection device 800 mentioned above not only includes the connection module 810 and the monitoring module 820, but also includes a synchronization module.
  • the synchronization module is configured to send the first connection information corresponding to the first Bluetooth connection to the second Bluetooth device through the third Bluetooth connection by the first Bluetooth device after the first Bluetooth connection is established with the terminal device; And it is configured to send the second connection information corresponding to the second Bluetooth connection to the second Bluetooth device by the first Bluetooth device through the third Bluetooth connection after the first Bluetooth device establishes the second Bluetooth connection with the terminal device.
  • connection module 810 is further configured to perform master-slave switching between the first Bluetooth device and the second Bluetooth device, so that the first Bluetooth connection object with the terminal device is switched from the first Bluetooth device to the second Bluetooth device. device, the second Bluetooth connection object with the terminal device is switched from the first Bluetooth device to the second Bluetooth device.
  • the monitoring module 820 is further configured to switch from the first Bluetooth device to the second Bluetooth device when the first Bluetooth connection object with the terminal device is switched from the first Bluetooth device to the second Bluetooth connection object with the terminal device.
  • the first Bluetooth device monitors the first Bluetooth connection between the second Bluetooth device and the terminal device according to the first connection information corresponding to the first Bluetooth connection, and according to the second Bluetooth connection The corresponding second connection information monitors the second Bluetooth connection between the second Bluetooth device and the terminal device.
  • a group of Bluetooth devices can still maintain the first Bluetooth connection and the second Bluetooth connection established with the terminal device, ensuring The stability of the Bluetooth connection will not adversely affect the user's use.
  • a Bluetooth address configuration apparatus 900 which can be configured as the above-mentioned group of Bluetooth devices, and the group of Bluetooth devices includes at least a first Bluetooth device and a second Bluetooth device.
  • the Bluetooth address configuration device 900 may include an address configuration module.
  • the address configuration module is configured to configure the first bluetooth device and the second bluetooth device to the same classic bluetooth address when the first bluetooth device establishes a bluetooth connection with the second bluetooth device, and the first bluetooth device and the second bluetooth device
  • the bluetooth devices are configured to the same BLE address.
  • the same classic Bluetooth address is the same as the same BLE address.
  • the Bluetooth connection between the first Bluetooth device and the second Bluetooth device comprises a classic Bluetooth connection.
  • the address configuration module is also configured such that the first Bluetooth device and the second Bluetooth device are respectively configured with different classic Bluetooth addresses before the first Bluetooth device establishes a Bluetooth connection with the second Bluetooth device.
  • the Bluetooth connection between the first Bluetooth device and the second Bluetooth device includes a BLE connection.
  • the address configuration module is further configured to configure the first Bluetooth device and the second Bluetooth device with different BLE addresses before establishing a Bluetooth connection between the first Bluetooth device and the second Bluetooth device.
  • the first Bluetooth device and the second Bluetooth device may be configured as different classic Bluetooth addresses, and/or may be configured separately are different BLE addresses, so as to ensure that the first Bluetooth device and the second Bluetooth device normally establish a Bluetooth connection, and realize information synchronization between the first Bluetooth device and the second Bluetooth device.
  • the first Bluetooth device and the second Bluetooth device can be configured with the same classic Bluetooth address and the same BLE address, which can ensure that a group of Bluetooth devices can communicate with external devices
  • the subsequent Bluetooth connection solution can be implemented accurately and stably.
  • the second Bluetooth device does not need to establish a communication link with the terminal device, which can reduce the bandwidth consumption of the wireless channel.
  • Fig. 10 is a structural block diagram of an electronic device in an embodiment.
  • the electronic device 1000 may include one or more of the following components: a processor 1010, a memory 1020 coupled to the processor 1010, wherein the memory 1020 may store one or more computer programs, one or more computer programs It may be configured to implement the methods described in the foregoing embodiments when executed by one or more processors 1010 .
  • Processor 1010 may include one or more processing cores.
  • the processor 1010 uses various interfaces and lines to connect various parts in the entire electronic device 1000, and executes by running or executing instructions, programs, code sets or instruction sets stored in the memory 1020, and calling data stored in the memory 1020.
  • the processor 1010 may adopt 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). implemented in the form of hardware.
  • DSP Digital Signal Processing
  • FPGA Field-Programmable Gate Array
  • PLA Programmable Logic Array
  • the processor 1010 may integrate one or a combination of a central processing unit (Central Processing Unit, CPU), an image processor (Graphics Processing Unit, GPU), a modem, and the like.
  • CPU Central Processing Unit
  • GPU Graphics Processing Unit
  • the CPU mainly handles the operating system, user interface and application programs, etc.
  • the GPU is used to render and draw the displayed content
  • the modem is used to handle wireless communication. It can be understood that the above modem may also not be integrated into the processor 1010, but implemented by a communication chip alone.
  • the memory 1020 may include random access memory (Random Access Memory, RAM), and may also include read-only memory (Read-Only Memory, ROM).
  • the memory 1020 may be used to store instructions, programs, codes, sets of codes or sets of instructions.
  • the memory 1020 may include a program storage area and a data storage area, wherein 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 the foregoing method embodiments, and the like.
  • the storage data area can also store data created by the electronic device 1000 during use, and the like.
  • the electronic device 1000 may further include a Bluetooth module, and the Bluetooth module may be configured to provide a Bluetooth communication function, establish a Bluetooth connection with other electronic devices, and perform 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.
  • the processor 1010 is configured to receive a first pairing instruction sent by a second electronic device through the Bluetooth module when the electronic device 1000 establishes a Bluetooth connection with at least one second electronic device, and according to the The first pairing instruction controls the Bluetooth module to enter into a pairing state, so that other electronic devices can scan to the electronic device 1000 .
  • the electronic device 1000 may include more or less structural elements than those in the above structural block diagram, for example, including a power module, physical keys, sensors, etc., and there is no limitation here.
  • the above-mentioned first Bluetooth device and the second Bluetooth device may at least include the above-mentioned processor 1010, memory 1020 and Bluetooth module.
  • the first Bluetooth device can respectively establish a first Bluetooth connection and a second Bluetooth connection with the terminal device through the Bluetooth module in the first Bluetooth device, and the second Bluetooth device can use the Bluetooth module in the second Bluetooth device to correspond to the first Bluetooth connection.
  • the first connection information corresponding to the first Bluetooth connection is monitored, and the second Bluetooth connection is monitored according to the second connection information corresponding to the second Bluetooth connection.
  • the embodiment of the present application discloses a computer-readable storage medium, which stores a computer program, wherein when the computer program is executed by a processor, the methods described in the foregoing embodiments are implemented.
  • the 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, and when the computer program is executed by a processor, the manufacturing method as described in the above-mentioned embodiments can be implemented .
  • the processes in the methods of the above embodiments can be realized through computer programs to instruct related hardware, and 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 embodiments of the above-mentioned methods.
  • the storage medium may be a magnetic disk, an optical disk, a ROM, or the like.
  • 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 can include random access memory (RAM), which acts as external cache memory.
  • RAM can take 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 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
  • SDRAM synchronous DRAM
  • double data rate SDRAM Double data rate Data Rate SDRAM, DDR SDRAM
  • enhanced SDRAM Enhanced Synchronous DRAM, ESDRAM
  • synchronous link DRAM Synchlink DRAM, SLDRAM
  • memory bus direct RAM Rabus DRAM, RDRAM
  • Direct Rambus DRAM Direct Rambus DRAM
  • the units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, located in one place, or distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.

Landscapes

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

Abstract

本申请实施例公开了一种蓝牙连接方法及装置、蓝牙地址配置方法及装置。该蓝牙连接方法应用于一组蓝牙设备,该一组蓝牙设备至少包括第一蓝牙设备及第二蓝牙设备,该方法可包括:所述第一蓝牙设备分别与终端设备建立第一蓝牙连接及第二蓝牙连接;所述第二蓝牙设备根据所述第一蓝牙连接对应的第一连接信息对所述第一蓝牙连接进行监听,并根据所述第二蓝牙连接对应的第二连接信息对所述第二蓝牙连接进行监听。上述的蓝牙连接方法及装置、蓝牙地址配置方法及装置,能够更加灵活地使用不同的蓝牙通信技术,以满足在不同业务场景下对于数据传输的需求,且可降低带宽消耗。

Description

蓝牙连接方法及装置、蓝牙地址配置方法及装置
相关交叉引用
本公开要求于2021年12月03日提交中国专利局、申请号为202111474902.5、发明名称为“蓝牙连接方法及装置、蓝牙地址配置方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本公开中。
技术领域
本申请涉及通信技术领域,具体涉及一种蓝牙连接方法及装置、蓝牙地址配置方法及装置。
背景技术
随着蓝牙技术的发展,蓝牙技术联盟发布的蓝牙通信标准协议也一直在更新变化,如从最早的经典蓝牙标准协议,到BLE(Bluetooth Low Energy,蓝牙低功耗)标准协议,再到BLE Audio(Bluetooth Low Energy Audio,蓝牙低功耗音频)标准协议等。目前,电子设备通常可以支持多种蓝牙通信标准协议,但是如何更加灵活地使用不同的蓝牙通信技术来满足在不同业务场景下对于数据传输的需求,依然是蓝牙通信领域中重点探索的方向之一。
发明内容
本申请实施例公开了一种蓝牙连接方法及装置、蓝牙地址配置方法及装置,能够更加灵活地使用不同的蓝牙通信技术,以满足在不同业务场景下对于数据传输的需求,且可降低带宽消耗。
本申请实施例公开了一种蓝牙连接方法,应用于一组蓝牙设备,所述一组蓝牙设备至少包括第一蓝牙设备及第二蓝牙设备,所述方法包括:
所述第一蓝牙设备分别与终端设备建立第一蓝牙连接及第二蓝牙连接;
所述第二蓝牙设备根据所述第一蓝牙连接对应的第一连接信息对所述第一蓝牙连接进行监听,并根据所述第二蓝牙连接对应的第二连接信息对所述第二蓝牙连接进行监听。
本申请实施例公开了一种蓝牙地址配置方法,应用于一组蓝牙设备,所述一组蓝牙设备至少包括第一蓝牙设备及第二蓝牙设备,所述方法包括:
在所述第一蓝牙设备与所述第二蓝牙设备建立蓝牙连接的情况下,所述第一蓝牙设备与所述第二蓝牙设备被配置为同一经典蓝牙地址,且所述第一蓝牙设备与所述第二蓝牙设备被配置为同一BLE地址。
本申请实施例公开了一种蓝牙连接装置,应用于一组蓝牙设备,所述一组蓝牙设备至少包括第一蓝牙设备及第二蓝牙设备;所述装置包括:
连接模块,用于由所述第一蓝牙设备分别与终端设备建立第一蓝牙连接及第二蓝牙连接;
监听模块,用于由所述第二蓝牙设备根据所述第一蓝牙连接对应的第一连接信息对所述第一蓝牙连接进行监听,并根据所述第二蓝牙连接对应的第二连接信息对所述第二蓝牙连接进行监听。
本申请实施例公开了一种蓝牙地址配置装置,应用于一组蓝牙设备,所述一组蓝牙设备至少包括第一蓝牙设备及第二蓝牙设备;所述装置包括:
地址配置模块,用于在所述第一蓝牙设备与所述第二蓝牙设备建立蓝牙连接的情况下,使得所述第一蓝牙设备与所述第二蓝牙设备被配置为同一经典蓝牙地址,且所述第一蓝牙设备与所述第二蓝牙设备被配置为同一BLE地址。
本申请实施例公开了一种电子设备,包括存储器及处理器,所述存储器中存储有计算机程序,所述计算机程序被所述处理器执行时,使得所述处理器实现如上任一所述的方法。
本申请实施例公开了一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现如上任一所述的方法。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用来解释本公开的原理。
为了更清楚地说明本公开实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,对于本领域普通技术人员而言,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1为相关技术中耳机设备与终端设备之间建立蓝牙连接的示意图;
图2为一个实施例中蓝牙连接方法的应用场景图;
图3为一个实施例中蓝牙连接方法的流程图;
图4为另一个实施例中蓝牙连接方法的流程图;
图5为一个实施例中蓝牙连接方法的时序示意图;
图6为另一个实施例中蓝牙连接方法的时序示意图;
图7为一个实施例中蓝牙地址配置方法的流程图;
图8为一个实施例中蓝牙连接装置的框图;
图9为一个实施例中蓝牙地址配置装置的框图;
图10为一个实施例中电子设备的结构框图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
需要说明的是,本申请实施例及附图中的术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没 有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。
可以理解,本申请所使用的术语“第一”、“第二”等可在本文中用于描述各种元件,但这些元件不受这些术语限制。这些术语仅用于将第一个元件与另一个元件区分。举例来说,在不脱离本申请的范围的情况下,可以将第一蓝牙设备称为第二蓝牙设备,且类似地,可将第二蓝牙设备称为第一蓝牙设备。第一蓝牙设备和第二蓝牙设备两者都是耳机,但其不是同一蓝牙设备。需要说明的是,本申请所涉及的术语“多个”等指的是两个及两个以上。
目前蓝牙技术中支持音频数据传输的协议,可包括基于经典蓝牙标准协议的A2DP(Advanced Audio Distribution Profile,蓝牙音频传输模型协定),以及在BLE协议的基础上发展出的BLE Audio标准协议。BLE Audio技术解决了利用BLE连接只能传输数据量较小的数据,而不能传输音频数据的问题,BLE Audio协议支持LC3(Low Complexity Communications Codec,低功耗音频编解码)编码的音频数据,使得音频数据的传输能够更好地兼顾功耗、实时性及音质等各方面的问题。
在相关技术中,对于BLE Audio技术,当同一组蓝牙设备需要与外部的电子设备建立LE Audio蓝牙连接时,由于每个蓝牙设备对应的BLE地址均不相同,因此,每个蓝牙设备均需要与外部的电子设备建立LE Audio蓝牙连接,再采用共时间戳等方式来实现同一组蓝牙设备内的数据同步。如图1所示,第一耳机与第二耳机属于同一耳机设备(即属于同一组蓝牙设备),该耳机设备支持双模连接(如能够同时建立经典蓝牙连接及LE Audio蓝牙连接)。在终端设备与耳机设备同时建立经典蓝牙连接及LE Audio蓝牙连接时,终端设备与其中的一只耳机(如第一耳机)建立经典蓝牙连接,并分别与第一耳机及第二耳机均建立LE Audio蓝牙连接。也即,耳机设备与终端设备之间包括三条蓝牙通信链路,增加了带宽消耗。
在本申请实施例中,提供一种蓝牙连接方法及装置、蓝牙地址配置方法及装置,能够更加灵活地使用不同的蓝牙通信技术,以满足在不同业务场景下对于数据传输的需求,且可降低带宽消耗。
图2为一个实施例中蓝牙连接方法的应用场景图。第一蓝牙设备20及第二蓝牙设备30属于一组蓝牙设备,该一组蓝牙设备可包括但不限于一组蓝牙音箱、一对耳机等,该一对耳机可包括但不限于入耳式耳机、耳塞式耳机等无线耳机,进一步地,可以是真无线立体声(True Wireless Stereo,TWS)蓝牙耳机等。需要说明的是,一组蓝牙设备除了包括第一蓝牙设备20及第二蓝牙设备30以外,还可包括更多的蓝牙设备。
该一组蓝牙设备可为支持双模连接的设备,能够与终端设备10同时建立两种不同的蓝牙连接,如同时建立经典蓝牙连接及BLE连接,或是同时建立经典蓝牙连接及LE Audio蓝牙连接等。其中,终端设备10可包括但不限于手机、智能可穿戴设备、车载终端、平板电脑、PC(Personal Computer,个人电脑)、PDA(Personal Digital Assistant,个人数字助理)等。
在本申请实施例中,第一蓝牙设备20可分别与终端设备10建立第一蓝牙连 接及第二蓝牙连接,第二蓝牙设备30可根据第一蓝牙连接对应的第一连接信息对第一蓝牙连接进行监听,并根据第二蓝牙连接对应的第二连接信息对第二蓝牙连接进行监听。一组蓝牙设备仅与终端设备10建立2条蓝牙通信链路,即可实现双模连接,既能够灵活地使用不同的蓝牙通信技术,以满足在不同业务场景下对于数据传输的需求,且可降低无线信道的带宽消耗。
在一些实施例中,第一蓝牙设备20可为一组蓝牙设备中的主设备,第二蓝牙设备30可为一组蓝牙设备中的从设备,其中,主设备指的是能够直接与终端设备10建立蓝牙连接的设备,从设备指的是不直接与终端设备10建立蓝牙连接的设备,从设备可通过监听主设备与终端设备10之间的蓝牙连接的方式,实现主设备与从设备之间的数据同步。
如图3所示,在一个实施例中,提供一种蓝牙连接方法,可应用于上述的一组蓝牙设备,该一组蓝牙设备可至少包括第一蓝牙设备及第二蓝牙设备,该方法可包括以下步骤:
步骤310,第一蓝牙设备分别与终端设备建立第一蓝牙连接及第二蓝牙连接。
第一蓝牙连接与第二蓝牙连接可以是分别采用不同的蓝牙通信技术建立的蓝牙连接,在一些实施例中,第一蓝牙连接可包括经典蓝牙连接,第二蓝牙连接包括BLE连接或LE Audio蓝牙连接。
其中,第一蓝牙连接可以是基于经典蓝牙通信协议建立的经典蓝牙连接,第二蓝牙连接可以是基于BLE通信协议建立的BLE连接,或者,第一蓝牙连接可以是基于经典蓝牙通信协议建立的经典蓝牙连接,第二蓝牙连接可以是基于BLE Audio协议建立的LE Audio蓝牙连接等。其中,经典蓝牙通信协议通常泛指在蓝牙协议4.0版本以下的蓝牙协议,BLE通信协议通常泛指在蓝牙协议4.0版本以上的蓝牙协议。BLE Audio协议则是在BLE通信协议的基础上提出的用于传输音频输出的协议。
在一些实施例中,在第一蓝牙设备与终端设备建立第一蓝牙连接及第二蓝牙连接之前,第一蓝牙设备可与第二蓝牙设备建立蓝牙连接(可为经典蓝牙连接或BLE连接)。在第一蓝牙设备与第二蓝牙设备建立蓝牙连接的情况下,第一蓝牙设备与第二蓝牙设备可被配置为同一经典蓝牙地址,且第一蓝牙设备与第二蓝牙设备可被配置为同一BLE地址。例如,在第一蓝牙设备与第二蓝牙设备建立蓝牙连接的情况下,第一蓝牙设备与第二蓝牙设备的经典蓝牙地址均为地址A,第一蓝牙设备与第二蓝牙设备的BLE地址可均为地址B。
由于第一蓝牙设备与第二蓝牙设备共用同一经典蓝牙地址,以及共用同一BLE地址,因此对于外部设备(例如本申请中的终端设备)来说,第一蓝牙设备与第二蓝牙设备在经典蓝牙中属于一个蓝牙设备,第一蓝牙设备与第二蓝牙设备在BLE中也属于同一个蓝牙设备,而不会区分第一蓝牙设备与第二蓝牙设备。
进一步地,第一蓝牙设备与第二蓝牙设备配置的同一BLE地址,可与第一蓝牙设备与第二蓝牙设备配置的同一经典蓝牙地址相同,例如,在第一蓝牙设备与第二蓝牙设备建立蓝牙连接的情况下,第一蓝牙设备与第二蓝牙设备的经典蓝牙 地址均为地址A,第一蓝牙设备与第二蓝牙设备的BLE地址也为地址A。在终端设备同时获取到第一蓝牙设备与第二蓝牙设备配置的同一经典蓝牙地址及同一BLE地址时,由于获取的经典蓝牙地址与BLE地址相同,则可仅显示一个与一组蓝牙设备对应的待连接信息,用户通过触发该待连接信息即可使终端设备与一组蓝牙设备中的主设备建立第一蓝牙连接及第二蓝牙连接,可避免给用户造成困扰,提高了操作效率。
在一些实施例中,第一蓝牙设备与终端设备建立的第一蓝牙连接为经典蓝牙连接。可选地,上述的一组蓝牙设备可以是未与终端设备建立过经典蓝牙连接的设备,即终端设备中未存储该一组蓝牙设备对应的设备信息(如设备名称、经典蓝牙地址、设备型号等信息)。该一组蓝牙设备可处于配对状态,可以是第一蓝牙设备和/或第二蓝牙设备处于配对状态(配对状态可以理解为开启page scan模式和inquiry scan模式)。以第一蓝牙设备处于配对状态为例,第一蓝牙设备可同时开启inquiry scan模式及开启page scan模式,在inquiry scan模式下第一蓝牙设备允许被终端设备扫描搜索到,在page scan模式下第一蓝牙设备允许被终端设备连接。当第一蓝牙设备开启inquiry scan模式时,若终端设备对周围的蓝牙设备进行扫描,则第一蓝牙设备可接收到终端设备发送的扫描请求,并根据该扫描请求向终端设备发送扫描响应。
终端设备可根据该扫描响应获取第一蓝牙设备的经典蓝牙地址(即该一组蓝牙设备的经典蓝牙地址),并基于该经典蓝牙地址发送经典蓝牙连接请求。该经典蓝牙连接请求可为寻呼(page)数据包,终端设备可采用跳频的方式发送寻呼数据包,以对该一组蓝牙设备进行寻呼。开启page scan模式的第一蓝牙设备可采用固定间隔地扫描(scan)外部发送的寻呼数据包,若扫描到终端设备发送的寻呼数据包,即接收到经典蓝牙连接请求,则可根据经典蓝牙连接请求与终端设备建立经典蓝牙连接。
可选地,上述的一组蓝牙设备可以是与终端设备建立过经典蓝牙连接的设备,即终端设备中可存储有该一组蓝牙设备对应的设备信息。第一蓝牙设备可处于可连接状态,在该可连接状态可仅开启page scan模式,终端设备可基于存储的该一组蓝牙设备对应的设备信息进行蓝牙回连,可基于存储的经典蓝牙地址发送经典蓝牙连接请求。
可选地,在一组蓝牙设备与终端设备之间的蓝牙连接均断开,且一组蓝牙设备的LE Audio广播停止后,一组蓝牙设备可以在第一蓝牙设备和/或第二蓝牙设备接收到终端设备发送的经典蓝牙连接请求后开启LE Audio广播,从而使得终端设备能够在接收到LE Audio广播后与该一组蓝牙设备进行LE Audio蓝牙连接。
第一蓝牙设备与终端设备建立经典蓝牙连接,可包括第一蓝牙设备与终端设备之间建立ACL(Asynchronous Connectionless,异步无连接)或SCO(Synchronous Connection Oriented,面向连接的同步链路)等物理链路,还可包括基于上层协议建立的业务连接,如A2DP、HFP(Hands-free Profile)等。经典蓝牙连接的具体过程,可参考经典蓝牙标准协议的规定。
在一些实施例中,第一蓝牙设备与终端设备建立的第二蓝牙连接可为LE Audio蓝牙连接。第一蓝牙设备和/或第二蓝牙设备可基于BLE地址发送LE Audio广播信号,以使接收到LE Audio广播信号的终端设备根据该BLE地址发送LE Audio连接请求。
终端设备可开启BLE广播扫描,以对周围蓝牙设备发送的LE Audio广播信号进行扫描,在终端设备扫描到第一蓝牙设备和/或发送的LE Audio广播信号时,可根据该LE Audio广播信号确定第一蓝牙设备对应的BLE地址(即该一组蓝牙设备的BLE地址)。由于第一蓝牙设备与第二蓝牙设备的BLE地址相同,因此终端设备不论是接收到第一蓝牙设备还是第二蓝牙设备发送的LE Audio广播信号,也仅能获取到一个BLE地址。终端设备可基于该BLE地址发送LE Audio连接请求。第一蓝牙设备和第二蓝牙设备中的主设备(例如第一蓝牙设备)可根据该LE Audio连接请求与终端设备建立LE Audio蓝牙连接。可以理解的,建立经典蓝牙连接和建立LE Audio蓝牙连接的设备是同一个设备。
作为一种具体实施方式,终端设备可基于接收到的LE Audio广播信号中的BLE地址向第一蓝牙设备发送connection request命令,该connection request命令用于通知第一蓝牙设备即将要与第一蓝牙设备进行LE Audio蓝牙连接。第一蓝牙设备在接收到该connection request命令后,可根据该connection request命令进行接收准备。例如,该connection request命令可包括传输窗口时延(Transmit window offset)、传输窗口尺寸(Transmit window size)等字段信息。其中,传输窗口时延、传输窗口尺寸等信息可用于确定第一蓝牙设备从接收到connection request命令,到接收到LE Audio连接数据包的时间间隔。在到达连接锚点时,终端设备可向第一蓝牙设备发送LE Audio连接数据包,第一蓝牙设备在接收到该LE Audio连接数据包后,可向终端设备返回响应信号,从而与终端设备成功建立LE Audio蓝牙连接。具体连接方式也可以参考相关蓝牙协议的规定。
步骤320,第二蓝牙设备根据第一蓝牙连接对应的第一连接信息对第一蓝牙连接进行监听,并根据第二蓝牙连接对应的第二连接信息对第二蓝牙连接进行监听。
在第一蓝牙连接与第二蓝牙设备建立第一蓝牙连接后,可向第二蓝牙设备同步第一蓝牙连接对应的第一连接信息,该第一连接信息可包括但不限于第一蓝牙连接对应的跳频信息、信道信息、时钟信息、链路密钥(如经典蓝牙连接中的link key等)等信息。第二蓝牙设备可根据第一蓝牙连接对应的第一连接信息对第一蓝牙连接进行监听,相当于第二蓝牙设备与终端设备建立第一虚拟蓝牙连接,也可同步获取到终端设备通过第一蓝牙连接与第一蓝牙设备传输的数据。
在第一蓝牙连接与第二蓝牙设备建立第二蓝牙连接后,可向第二蓝牙设备同步第二蓝牙连接对应的第二连接信息,该第二连接信息也可包括但不限于第二连接信息对应的跳频信息、信道信息、时钟信息、链路密钥(如LE Audio蓝牙连接中的LTK“Long Term Key”等)等信息。第二蓝牙设备可根据第二蓝牙连接对应的第二连接信息对第二蓝牙连接进行监听,相当于第二蓝牙设备与终端设备建立 第二虚拟蓝牙连接,也可同步获取到终端设备通过第二蓝牙连接与第一蓝牙设备传输的数据。例如,第二蓝牙连接为LE Audio蓝牙连接,第二蓝牙设备通过监听的方式即可获取终端设备通过LE Audio蓝牙连接所传输的音频数据,而不需要再与终端设备建立单独的通信链路,从而可减少带宽消耗。此外,终端设备可快速与同时支持经典蓝牙和BLE Audio的蓝牙设备建立LE Audio蓝牙连接及经典蓝牙连接,将BLE Audio与经典蓝牙相结合,以满足用户在不同场景下对于音频传输的需求。
可以理解的,link key与LTK之间可以相互换算,因此可以根据其中一个算出另外一个,例如第一蓝牙设备在与终端设备建立经典蓝牙连接的过程中获得了link key后,可以根据link key计算出LTK供BLE Audio连接时使用;或者,第一蓝牙设备在与终端设备建立LE Audio蓝牙连接的过程中获取了LTK后,可根据该LTK计算出link key供经典蓝牙连接使用。
需要说明的是,本申请实施例不对第一蓝牙设备与终端设备建立第一蓝牙连接及第二蓝牙连接的先后顺序进行限定,即第一蓝牙设备可先与终端设备建立第一蓝牙连接,再建立第二蓝牙连接,也可先与终端设备建立第二蓝牙连接,再建立第一蓝牙连接,也可以同时建立连接。同理,本申请实施例也不对第二蓝牙设备对第一蓝牙连接及第二蓝牙连接进行监听的先后顺序进行限定,即第二蓝牙设备可先监听第一蓝牙连接,再监听第二蓝牙连接,也可先监听第二蓝牙连接,再监听第一蓝牙连接,也可以同时进行监听。当然,如果只使用其中一条链路进行数据传输,则只监听该链路即可。
需要说明的是,一组蓝牙设备除了包括第一蓝牙设备与第二蓝牙设备以外,还可包括其它蓝牙设备,在第一蓝牙设备为主设备时,其它蓝牙设备为从设备,其它蓝牙设备的工作方式及工作原理可与第二蓝牙设备相似,在此不再重复进行赘述。
在本申请实施例中,第一蓝牙设备可采用不同的蓝牙通信技术分别与终端设备建立第一蓝牙连接及第二蓝牙连接,能够更加灵活地使用不同的蓝牙通信技术,以满足在不同业务场景下对于数据传输的需求,且第二蓝牙设备通过监听的方式也可与终端设备进行数据传输,不需要再与终端设备建立通信链路,能够降低无线信道的带宽消耗。
在一些实施例中,上述的第一蓝牙设备包括第一耳机,第二蓝牙设备包括第二耳机,第一耳机与第二耳机组成一对耳机设备。上述的方法还可包括:第一耳机通过第一蓝牙连接或第二蓝牙连接接收终端设备发送的音频数据,并对音频数据进行处理,以得到与第一耳机对应的第一声道音频数据;第二耳机通过监听第一蓝牙连接或第二蓝牙连接,以接收终端设备发送的音频数据,并对音频数据进行处理,以得到与第一耳机对应的第二声道音频数据。
第一耳机可以是左耳机,对应的声道为左声道,第二耳机可以是右耳机,对应的声道为右声道;或,第一耳机可以是右耳机,对应的声道为右声道,第二耳机可以是左耳机,对应的声道为左声道。由于终端设备不论是通过第一蓝牙连接 还是通过第二蓝牙连接向耳机设备发送音频数据,均只通过一条通信链路进行音频数据传输,因此,可同时将左声道的音频数据与右声道的音频数据共同发送到第一耳机。
在一些实施例中,第一蓝牙连接为经典蓝牙连接,若终端设备通过经典蓝牙连接向第一耳机发送音频数据,则第一耳机可对接收的音频数据进行处理,以得到与第一耳机对应的第一声道音频数据(如右声道的音频数据,或左声道的音频数据),并播放该第一声道音频数据。第二耳机可对第一耳机与终端设备之间的经典蓝牙连接进行监听,以同步接收到终端设备发送的音频数据,第二耳机可对接收的音频数据进行处理,以得到第二耳机对应的第二声道音频数据(如左声道的音频数据,或右声道的音频数据;与第一声道音频数据不同),并播放该第二声道音频数据。
在一些实施例中,第二蓝牙连接为LE Audio蓝牙连接,若终端设备通过LE Audio蓝牙连接向第一耳机发送音频数据,则第一耳机可对接收的音频数据进行处理,以得到与第一耳机对应的第一声道音频数据,并播放该第一声道音频数据。第二耳机可对第一耳机与终端设备之间的LE Audio蓝牙连接进行监听,以同步接收到终端设备发送的音频数据,第二耳机可对接收的音频数据进行处理,以得到第二耳机对应的第二声道音频数据,并播放该第二声道音频数据。
在本申请实施例中,由第一耳机与第二耳机分别对接收的音频数据进行处理,以得到相应声道的音频数据进行播放,在第二耳机不需要与终端设备建立通信链路的情况下,依然可保证第一耳机与第二耳机输出的音频数据的准确性,且可提高音频播放效果。
如图4所示,在另一个实施例中,提供一种蓝牙连接方法,可应用于上述的一组蓝牙设备,该蓝牙连接方法可包括以下步骤:
步骤402,第一蓝牙设备与第二蓝牙设备建立第三蓝牙连接。
在第一蓝牙设备与终端设备建立蓝牙连接之前,第一蓝牙设备可先与第二蓝牙设备建立第三蓝牙连接,该第三蓝牙连接可包括经典蓝牙连接或BLE连接。
在一些实施例中,若第三蓝牙连接为经典蓝牙连接,则在第一蓝牙设备与第二蓝牙设备建立第三蓝牙连接之前,第一蓝牙设备与第二蓝牙设备可分别对应不同的经典蓝牙地址。第一蓝牙设备可获取第二蓝牙设备在当前的经典蓝牙地址,并基于获取的经典蓝牙地址与第二蓝牙设备建立经典蓝牙连接;和/或,第二蓝牙设备可获取第一蓝牙设备在当前的经典蓝牙地址,并基于获取的经典蓝牙地址与第一蓝牙设备建立经典蓝牙连接。
在第一蓝牙设备与第二蓝牙设备建立第三蓝牙连接之后,第一蓝牙设备与第二蓝牙设备共用同一经典蓝牙地址。在第一蓝牙设备与第二蓝牙设备建立经典蓝牙连接后,第一蓝牙设备可通过与第二蓝牙设备之间的经典蓝牙连接,向第二蓝牙设备共享第一蓝牙设备的经典蓝牙地址,第二蓝牙设备可将经典蓝牙地址变更为第一蓝牙设备共享的经典蓝牙地址。例如,在第一蓝牙设备与第二蓝牙设备建立经典蓝牙连接之前,第一蓝牙设备的经典蓝牙地址为地址A,第二蓝牙设备的 经典蓝牙地址为地址B,则在第一蓝牙设备与第二蓝牙设备建立经典蓝牙连接之后,第一蓝牙设备将地址A共享给第二蓝牙设备,第二蓝牙设备可将经典蓝牙地址也变更为地址A,以实现第一蓝牙设备与第二蓝牙设备共用同一经典蓝牙地址。可选地,在第一蓝牙设备与第二蓝牙设备建立经典蓝牙连接之前,第一蓝牙设备的BLE地址与第二蓝牙设备的BLE地址可相同,也可不同。若在第一蓝牙设备与第二蓝牙设备建立经典蓝牙连接之前,第一蓝牙设备的BLE地址与第二蓝牙设备的BLE地址不同,则在第一蓝牙设备与第二蓝牙设备建立经典蓝牙连接之后,第一蓝牙设备可通过与第二蓝牙设备之间的经典蓝牙连接,向第二蓝牙设备共享第一蓝牙设备的BLE地址,第二蓝牙设备可将BLE地址变更为第一蓝牙设备共享的BLE地址。
在一些实施例中,若第三蓝牙连接为BLE连接,在第一蓝牙设备与第二蓝牙设备建立第三蓝牙连接之前,第一蓝牙设备与第二蓝牙设备分别对应不同的BLE地址。第一蓝牙设备可基于自身的BLE地址发送BLE广播信号,第二蓝牙设备可扫描第一蓝牙设备发送的BLE广播信号,并根据该BLE广播信号携带的第一蓝牙设备的BLE地址与第一蓝牙设备建立BLE连接;和/或,第二蓝牙设备可基于自身的BLE地址发送BLE广播信号,第一蓝牙设备可扫描第二蓝牙设备发送的BLE广播信号,并根据该BLE广播信号携带的第二蓝牙设备的BLE地址与第二蓝牙设备建立BLE连接。
在第一蓝牙设备与第二蓝牙设备建立第三蓝牙连接之后,第一蓝牙设备与第二蓝牙设备共用同一BLE地址。在第一蓝牙设备与第二蓝牙设备建立BLE连接后,第一蓝牙设备可通过与第二蓝牙设备之间的BLE连接,向第二蓝牙设备共享第一蓝牙设备的BLE地址,第二蓝牙设备可将BLE地址变更为第一蓝牙设备共享的BLE地址。例如,在第一蓝牙设备与第二蓝牙设备建立BLE连接之前,第一蓝牙设备的BLE地址为地址A,第二蓝牙设备的BLE地址为地址B,则在第一蓝牙设备与第二蓝牙设备建立BLE连接之后,第一蓝牙设备将地址A共享给第二蓝牙设备,第二蓝牙设备可将BLE地址也变更为地址A,以实现第一蓝牙设备与第二蓝牙设备共用同一BLE地址。
可选地,在第一蓝牙设备与第二蓝牙设备建立BLE连接之前,第一蓝牙设备的经典蓝牙地址与第二蓝牙设备的经典蓝牙地址可相同,也可不同。若在第一蓝牙设备与第二蓝牙设备建立BLE连接之前,第一蓝牙设备的经典蓝牙地址与第二蓝牙设备的经典蓝牙地址不同,则在第一蓝牙设备与第二蓝牙设备建立BLE连接之后,第一蓝牙设备可通过与第二蓝牙设备之间的BLE连接,向第二蓝牙设备共享第一蓝牙设备的经典蓝牙地址,第二蓝牙设备可将经典蓝牙地址变更为第一蓝牙设备共享的经典蓝牙地址。
在本申请实施例中,在第一蓝牙设备与第二蓝牙设备建立第三蓝牙连接之前,第一蓝牙设备与第二蓝牙设备可分别被配置为不同的经典蓝牙地址,和/或,可分别被配置为不同的BLE地址,从而可保证第一蓝牙设备与第二蓝牙设备正常建立第三蓝牙连接,实现第一蓝牙设备与第二蓝牙设备之间的信息同步。在第一蓝牙 设备与第二蓝牙设备建立第三蓝牙连接之后,第一蓝牙设备与第二蓝牙设备可被配置为相同的经典蓝牙地址,以及相同的BLE地址,可保证一组蓝牙设备对于外部的设备来说为一个设备,准确且稳定地实现后续的蓝牙连接方案,第二蓝牙设备不需要与终端设备建立通信链路,能够降低无线信道的带宽消耗。
可以理解的,第一蓝牙设备和第二蓝牙设备之间的蓝牙连接可以是基于不同蓝牙地址的,但是第一蓝牙设备和第二蓝牙设备相对于终端设备的蓝牙地址是相同的,这样保障了第一蓝牙设备和第二蓝牙设备之间的蓝牙连接,对于终端设备而言其感知的是一个蓝牙设备,方便用户操作。
步骤404,第一蓝牙设备与终端设备建立第一蓝牙连接,并通过第三蓝牙连接,将第一蓝牙连接对应的第一连接信息发送给第二蓝牙设备。
步骤406,第一蓝牙设备与终端设备建立第二蓝牙连接,并通过第三蓝牙连接,将第一蓝牙连接对应的第一连接信息及第二蓝牙连接对应的第二连接信息发送给第二蓝牙设备。
步骤408,第二蓝牙设备根据第一蓝牙连接对应的第一连接信息对第一蓝牙连接进行监听,并根据第二蓝牙连接对应的第二连接信息对第二蓝牙连接进行监听。
步骤404~408的描述可参考上述各实施例中的相关描述,在此不再重复赘述。
示例性地,图5为一个实施例中蓝牙连接方法的时序示意图。如图5所示,一组蓝牙设备可包括第一蓝牙设备及第二蓝牙设备,第一蓝牙设备与第二蓝牙设备在未建立蓝牙连接之前,第一蓝牙设备的BT地址(即经典蓝牙地址)为A,BLE地址为A,第二蓝牙设备的BT地址为B,BLE地址为B。第一蓝牙设备与第二蓝牙设备可建立蓝牙连接,第一蓝牙设备可向第二蓝牙设备共享第一蓝牙设备的BT地址及BLE地址。第二蓝牙设备可将BT地址从B变更为A,将BLE地址从B变更为A,也即,第一蓝牙设备与第二蓝牙设备的BT地址均为A,第一蓝牙设备与第二蓝牙设备的BLE地址均为B。
终端设备可基于BT地址A与第一蓝牙设备建立经典蓝牙连接,第一蓝牙设备可向第二蓝牙设备共享该经典蓝牙连接的连接信息,第二蓝牙设备可基于该连接信息对第一蓝牙设备与终端设备之间的经典蓝牙连接进行监听,以实现第一蓝牙设备与第二蓝牙设备之间在经典蓝牙传输通路的数据同步。终端设备可基于BLE地址A与第一蓝牙设备建立LE Audio蓝牙连接,第一蓝牙设备可向第二蓝牙设备共享该LE Audio蓝牙连接的连接信息,第二蓝牙设备可基于该连接信息对第一蓝牙设备与终端设备之间的LE Audio蓝牙连接进行监听,以实现第一蓝牙设备与第二蓝牙设备之间在LE Audio蓝牙传输通路上的数据同步。
在一些实施例中,上述的第一蓝牙设备的主从关系可为主设备,第二蓝牙设备的主从关系可为从设备,因此,第一蓝牙设备的经典蓝牙地址及BLE地址为主设备对应的经典蓝牙地址及BLE地址,通过将第二蓝牙设备的经典蓝牙地址及BLE地址变更为与第一蓝牙设备的经典蓝牙地址及BLE地址相同,也即均配置为主设备对应的经典蓝牙地址及BLE地址,可保证终端设备能够准确与主设备建立 蓝牙连接,特别是在终端设备与一组蓝牙设备进行回连时,可保证准确与一组蓝牙设备中的主设备进行回连。
步骤410,第一蓝牙设备与第二蓝牙设备发生主从切换,使得与终端设备的第一蓝牙连接对象从第一蓝牙设备切换为第二蓝牙设备,与终端设备的第二蓝牙连接对象从第一蓝牙设备切换为第二蓝牙设备。
第一蓝牙设备与第二蓝牙设备发生主从切换,即第一蓝牙设备的主从关系从主设备切换为从设备,第二蓝牙设备的主从关系从从设备切换为主设备,则终端设备的第一蓝牙连接对象从第一蓝牙设备切换为第二蓝牙设备;终端设备的第二蓝牙连接对象从第一蓝牙设备切换为第二蓝牙设备。由于对于终端设备来说,第一蓝牙设备与第二蓝牙设备是一个设备,因为在第一蓝牙设备与第二蓝牙设备发生主从切换的过程中,终端设备是无感的,不会影响终端设备使用该一组蓝牙设备进行业务处理。
在一些实施例中,当满足主从切换条件时,第一蓝牙设备与第二蓝牙设备发生主从切换。该主从切换条件可包括但不限于以下中的任一种条件:
(1)第一蓝牙设备检测到处于用户未使用的状态。例如,第一蓝牙设备可为耳机设备中的第一耳机,第一耳机检测到处于未佩戴状态或是第一耳机检测到被放置到耳机盒中时,可确定处于用户未使用的状态,可触发进行主从切换。
(2)第一蓝牙设备相对终端设备的信号强度小于强度阈值。例如,第一蓝牙设备与终端设备之间的距离过远,或是第一蓝牙设备发送的蓝牙信号受到环境干扰严重,导致终端设备接收到的第一蓝牙设备发送的蓝牙信号的信号强度变差,则可触发进行主从切换。
(3)其他情况。例如,第一蓝牙设备与终端设备之间的距离超过蓝牙连接的距离阈值,或是第一蓝牙设备因电量过低导致无法使用等情况,则可触发进行主从切换,或是为了电量均衡做的主从切换等,对此不做限制。
可以理解的,由于一组蓝牙设备相对于终端设备而言,其主设备与从设备的蓝牙地址相同,因此一般情况下,进行主从切换时,并不需要断开蓝牙连接,只需要切换连接的蓝牙设备即可,也可以理解为切换与终端设备进行直接通信的对象,从而能够无感切换。
在终端设备的第一蓝牙连接对象切换为第二蓝牙设备,以及终端设备的第二蓝牙连接对象切换为第二蓝牙设备之后,第一蓝牙设备可根据第一蓝牙连接对应的第一连接信息对第二蓝牙设备与终端设备之间的第一蓝牙连接进行监听,并根据第二蓝牙连接对应的第二连接信息对第二蓝牙设备与终端设备之间的第二蓝牙连接进行监听。能够保证在发生主从切换后,第一蓝牙设备与第二蓝牙设备之间依然保持数据同步。
示例性地,图6为另一个实施例中蓝牙连接方法的时序示意图。如图6所示,在第二蓝牙设备对第一蓝牙设备与终端设备之间的经典蓝牙连接及LE Audio蓝牙连接进行监听,实现第一蓝牙设备与第二蓝牙设备之间的数据同步后,第一蓝牙设备与第二蓝牙设备之间发生主从切换,第二蓝牙设备从从设备切换为主设备, 第一蓝牙设备从主设备切换为从设备。终端设备与一组蓝牙设备之间的经典蓝牙连接的连接对象,从第一蓝牙设备切换为第二蓝牙设备;终端设备与一组蓝牙设备之间的LE Audio蓝牙连接的连接对象,从第一蓝牙设备切换为第二蓝牙设备。第一蓝牙设备可对第二蓝牙设备与终端设备之间的经典蓝牙连接进行监听,以实现第一蓝牙设备与第二蓝牙设备之间在经典蓝牙传输通路的数据同步;第一蓝牙设备可对第二蓝牙设备与终端设备之间的LE Audio蓝牙连接进行监听,以实现第一蓝牙设备与第二蓝牙设备之间在LE Audio蓝牙传输通路的数据同步。可以理解的,第一蓝牙设备也可能被放入盒中或者关机等原因导致蓝牙模块停止工作,从而不对第二蓝牙设备与终端设备之间的蓝牙连接进行监听。
在本申请实施例中,针对第一蓝牙设备与第二蓝牙设备出现主从切换的场景,一组蓝牙设备依然可保持与终端设备之间建立的第一蓝牙连接及第二蓝牙连接,保证了蓝牙连接的稳定性,且不会对用户的使用产生不良影响。
如图7所示,在一个实施例中,提供一种蓝牙地址配置方法,可应用于上述的一组蓝牙设备,该一组蓝牙设备至少包括第一蓝牙设备及第二蓝牙设备。该方法可包括以下步骤:
步骤710,在第一蓝牙设备与第二蓝牙设备建立蓝牙连接的情况下,第一蓝牙设备与第二蓝牙设备被配置为同一经典蓝牙地址,且第一蓝牙设备与第二蓝牙设备被配置为同一BLE地址。
在一个实施例中,上述同一经典蓝牙地址与上述同一BLE地址相同,在这种情况下,对于终端设备来说一组蓝牙设备视为一个整体,从而方便用户进行蓝牙连接操作,也方便进行蓝牙回连,因为终端设备只需要存储一个蓝牙地址(例如默认主设备的蓝牙地址)即可以实现与一组蓝牙设备中任一蓝牙设备的经典蓝牙回连和LE Audio蓝牙回连。
在一个实施例中,第一蓝牙设备与第二蓝牙设备之间的蓝牙连接包括经典蓝牙连接;该方法还包括:在第一蓝牙设备与第二蓝牙设备建立蓝牙连接之前,第一蓝牙设备与第二蓝牙设备分别被配置为不同的经典蓝牙地址。
在一个实施例中,第一蓝牙设备与第二蓝牙设备之间的蓝牙连接包括BLE连接;该方法还包括:在第一蓝牙设备与第二蓝牙设备建立蓝牙连接之前,第一蓝牙设备与第二蓝牙设备分别被配置为不同的BLE地址。需要说明的是,本申请实施例提供的蓝牙地址配置方法的描述,可参考上述各实施例中提供的蓝牙连接方法的相关描述,在此不再重复赘述。
在本申请实施例中,在第一蓝牙设备与第二蓝牙设备建立蓝牙连接之前,第一蓝牙设备与第二蓝牙设备可分别被配置为不同的经典蓝牙地址,和/或,可分别被配置为不同的BLE地址,从而可保证第一蓝牙设备与第二蓝牙设备正常建立蓝牙连接,实现第一蓝牙设备与第二蓝牙设备之间的信息同步。在第一蓝牙设备与第二蓝牙设备建立蓝牙连接之后,第一蓝牙设备与第二蓝牙设备可被配置为相同的经典蓝牙地址,以及相同的BLE地址,可保证一组蓝牙设备对于外部的设备来说为一个设备,准确且稳定地实现后续的蓝牙连接方案,第二蓝牙设备不需要与 终端设备建立通信链路,能够降低无线信道的带宽消耗。
如图8所示,在一个实施例中,提供一种蓝牙连接装置800,可应被配置为上述的一组蓝牙设备,该一组蓝牙设备至少包括第一蓝牙设备及第二蓝牙设备。该蓝牙连接装置800可包括连接模块810及监听模块820。
连接模块810,被配置为由第一蓝牙设备分别与终端设备建立第一蓝牙连接及第二蓝牙连接。
在一个实施例中,第一蓝牙连接包括经典蓝牙连接,第二蓝牙连接包括BLE连接或LE Audio蓝牙连接。
在一个实施例中,第一蓝牙设备与第二蓝牙设备共用同一经典蓝牙地址,且第一蓝牙设备与第二蓝牙设备共用同一BLE地址。
在一个实施例中,该BLE地址与经典蓝牙地址相同。
在一个实施例中,连接模块810,还被配置为由第一蓝牙设备和/或第二蓝牙设备基于BLE地址发送LE Audio广播信号,以使接收到LE Audio广播信号的终端设备根据BLE地址发送LE Audio连接请求;以及由第一蓝牙设备根据接收的LE Audio连接请求,与终端设备建立LE Audio蓝牙连接。
可以理解的,在接收到LE Audio连接请求时,由主设备(例如第一蓝牙设备)进行LE Audio蓝牙连接。
监听模块820,被配置为由第二蓝牙设备根据第一蓝牙连接对应的第一连接信息对第一蓝牙连接进行监听,并根据第二蓝牙连接对应的第二连接信息对第二蓝牙连接进行监听。
在本申请实施例中,第一蓝牙设备可采用不同的蓝牙通信技术分别与终端设备建立第一蓝牙连接及第二蓝牙连接,能够更加灵活地使用不同的蓝牙通信技术,以满足在不同业务场景下对于数据传输的需求,且第二蓝牙设备通过监听的方式也可与终端设备进行数据传输,不需要再与终端设备建立通信链路,能够降低无线信道的带宽消耗。
在一个实施例中,第一蓝牙设备包括第一耳机,第二蓝牙设备包括第二耳机,第一耳机与第二耳机组成一对耳机设备。上述的蓝牙连接装置800还包括音频处理模块。
音频处理模块,被配置为由第一耳机通过第一蓝牙连接或第二蓝牙连接接收终端设备发送的音频数据,并对音频数据进行处理,以得到与第一耳机对应的第一声道音频数据;以及由第二耳机通过监听第一蓝牙连接或第二蓝牙连接,以接收终端设备发送的所述音频数据,并对音频数据进行处理,以得到与第一耳机对应的第二声道音频数据。
在本申请实施例中,由第一耳机与第二耳机分别对接收的音频数据进行处理,以得到相应声道的音频数据进行播放,在第二耳机不需要与终端设备建立通信链路的情况下,依然可保证第一耳机与第二耳机输出的音频数据的准确性,且可提高音频播放效果。
在一个实施例中,连接模块810,还被配置为由第一蓝牙设备与第二蓝牙设 备建立第三蓝牙连接。
在一个实施例中,第三蓝牙连接包括经典蓝牙连接,在第一蓝牙设备与所述第二蓝牙设备建立第三蓝牙连接之前,第一蓝牙设备与第二蓝牙设备分别对应不同的经典蓝牙地址;在第一蓝牙设备与第二蓝牙设备建立第三蓝牙连接之后,第一蓝牙设备与所述第二蓝牙设备共用同一经典蓝牙地址;或,
第三蓝牙连接包括BLE连接,在第一蓝牙设备与第二蓝牙设备建立第三蓝牙连接之前,第一蓝牙设备与第二蓝牙设备分别对应不同的BLE地址;在第一蓝牙设备与第二蓝牙设备建立第三蓝牙连接之后,第一蓝牙设备与第二蓝牙设备共用同一BLE地址。
上述的蓝牙连接装置800,除了包括连接模块810及监听模块820,还包括同步模块。
同步模块,被配置为在第一蓝牙设备与终端设备建立第一蓝牙连接之后,由第一蓝牙设备通过第三蓝牙连接,将第一蓝牙连接对应的第一连接信息发送给第二蓝牙设备;以及被配置为在第一蓝牙设备与终端设备建立第二蓝牙连接之后,由第一蓝牙设备通过第三蓝牙连接,将第二蓝牙连接对应的第二连接信息发送给第二蓝牙设备。
在一个实施例中,连接模块810,还被配置为第一蓝牙设备与所述第二蓝牙设备发生主从切换,使得与终端设备的第一蓝牙连接对象从第一蓝牙设备切换为第二蓝牙设备,与终端设备的第二蓝牙连接对象从第一蓝牙设备切换为第二蓝牙设备。
在一个实施例中,监听模块820,还被配置为在与终端设备的第一蓝牙连接对象从第一蓝牙设备切换为第二蓝牙设备,与终端设备的第二蓝牙连接对象从第一蓝牙设备切换为第二蓝牙设备之后,由第一蓝牙设备根据第一蓝牙连接对应的第一连接信息对第二蓝牙设备与所述终端设备之间的第一蓝牙连接进行监听,并根据第二蓝牙连接对应的第二连接信息对第二蓝牙设备与终端设备之间的第二蓝牙连接进行监听。
在本申请实施例中,针对第一蓝牙设备与第二蓝牙设备出现主从切换的场景,一组蓝牙设备依然可保持与终端设备之间建立的第一蓝牙连接及第二蓝牙连接,保证了蓝牙连接的稳定性,且不会对用户的使用产生不良影响。
如图9所示,在一个实施例中,提供一种蓝牙地址配置装置900,可应被配置为上述的一组蓝牙设备,该一组蓝牙设备至少包括第一蓝牙设备及第二蓝牙设备。该蓝牙地址配置装置900,可包括地址配置模块。
地址配置模块,被配置为在第一蓝牙设备与第二蓝牙设备建立蓝牙连接的情况下,使得第一蓝牙设备与第二蓝牙设备被配置为同一经典蓝牙地址,且第一蓝牙设备与第二蓝牙设备被配置为同一BLE地址。
在一个实施例中,该同一经典蓝牙地址与同一BLE地址相同。
在一个实施例中,第一蓝牙设备与第二蓝牙设备之间的蓝牙连接包括经典蓝牙连接。地址配置模块,还被配置为在第一蓝牙设备与第二蓝牙设备建立蓝牙连 接之前,第一蓝牙设备与第二蓝牙设备分别被配置为不同的经典蓝牙地址。
在一个实施例中,第一蓝牙设备与第二蓝牙设备之间的蓝牙连接包括BLE连接。地址配置模块,还被配置为在第一蓝牙设备与第二蓝牙设备建立蓝牙连接之前,第一蓝牙设备与第二蓝牙设备分别被配置为不同的BLE地址。
在本申请实施例中,在第一蓝牙设备与第二蓝牙设备建立蓝牙连接之前,第一蓝牙设备与第二蓝牙设备可分别被配置为不同的经典蓝牙地址,和/或,可分别被配置为不同的BLE地址,从而可保证第一蓝牙设备与第二蓝牙设备正常建立蓝牙连接,实现第一蓝牙设备与第二蓝牙设备之间的信息同步。在第一蓝牙设备与第二蓝牙设备建立蓝牙连接之后,第一蓝牙设备与第二蓝牙设备可被配置为相同的经典蓝牙地址,以及相同的BLE地址,可保证一组蓝牙设备对于外部的设备来说为一个设备,准确且稳定地实现后续的蓝牙连接方案,第二蓝牙设备不需要与终端设备建立通信链路,能够降低无线信道的带宽消耗。
图10为一个实施例中电子设备的结构框图。如图10所示,电子设备1000可以包括一个或多个如下部件:处理器1010、与处理器1010耦合的存储器1020,其中存储器1020可存储有一个或多个计算机程序,一个或多个计算机程序可以被配置为由一个或多个处理器1010执行时实现如上述各实施例描述的方法。
处理器1010可以包括一个或者多个处理核。处理器1010利用各种接口和线路连接整个电子设备1000内的各个部分,通过运行或执行存储在存储器1020内的指令、程序、代码集或指令集,以及调用存储在存储器1020内的数据,执行电子设备1000的各种功能和处理数据。可选地,处理器1010可以采用数字信号处理(Digital Signal Processing,DSP)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、可编程逻辑阵列(Programmable Logic Array,PLA)中的至少一种硬件形式来实现。处理器1010可集成中央处理器(Central Processing Unit,CPU)、图像处理器(Graphics Processing Unit,GPU)和调制解调器等中的一种或几种的组合。其中,CPU主要处理操作系统、用户界面和应用程序等;GPU用于负责显示内容的渲染和绘制;调制解调器用于处理无线通信。可以理解的是,上述调制解调器也可以不集成到处理器1010中,单独通过一块通信芯片进行实现。
存储器1020可以包括随机存储器(Random Access Memory,RAM),也可以包括只读存储器(Read-Only Memory,ROM)。存储器1020可用于存储指令、程序、代码、代码集或指令集。存储器1020可包括存储程序区和存储数据区,其中,存储程序区可存储用于实现操作系统的指令、用于实现至少一个功能的指令(比如触控功能、声音播放功能、图像播放功能等)、用于实现上述各个方法实施例的指令等。存储数据区还可以存储电子设备1000在使用中所创建的数据等。
电子设备1000还可包括蓝牙模块,蓝牙模块可被配置为提供蓝牙通信功能,与其它电子设备建立蓝牙连接,并进行蓝牙数据传输。蓝牙模块可支持一种或多种蓝牙协议,如经典蓝牙、BLE、BLE Audio等),但不限于此,可随着蓝牙协议的发展而变化。
在一些实施例中,处理器1010,被配置为在电子设备1000与至少一个第二电子设备建立蓝牙连接的情况下,通过蓝牙模块接收一个第二电子设备发送的第一配对指令,并根据该第一配对指令控制蓝牙模块进入配对状态,以使其它电子设备能够扫描到电子设备1000。
可以理解地,电子设备1000可包括比上述结构框图中更多或更少的结构元件,例如,包括电源模块、物理按键、传感器等,还可在此不进行限定。
在一些实施例中,上述的第一蓝牙设备及第二蓝牙设备中均可至少包括上述的处理器1010、存储器1020及蓝牙模块。
第一蓝牙设备可通过第一蓝牙设备中的蓝牙模块分别与终端设备建立第一蓝牙连接及第二蓝牙连接,第二蓝牙设备可通过第二蓝牙设备中的蓝牙模块,根据第一蓝牙连接对应的第一连接信息对第一蓝牙连接进行监听,并根据第二蓝牙连接对应的第二连接信息对第二蓝牙连接进行监听。
本申请实施例公开一种计算机可读存储介质,其存储计算机程序,其中,该计算机程序被处理器执行时实现如上述各实施例描述的方法。
本申请实施例公开一种计算机程序产品,该计算机程序产品包括存储了计算机程序的非瞬时性计算机可读存储介质,且该计算机程序可被处理器执行时实现如上述各实施例描述的制方法。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一非易失性计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、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 (20)

  1. 一种蓝牙连接方法,其特征在于,应用于一组蓝牙设备,所述一组蓝牙设备至少包括第一蓝牙设备及第二蓝牙设备,所述方法包括:
    所述第一蓝牙设备分别与终端设备建立第一蓝牙连接及第二蓝牙连接;
    所述第二蓝牙设备根据第一连接信息对所述第一蓝牙连接进行监听,并根据第二连接信息对所述第二蓝牙连接进行监听;所述第一连接信息与所述第一蓝牙连接对应,所述第二连接信息与所述第二蓝牙连接对应。
  2. 根据权利要求1所述的方法,其特征在于,所述第一蓝牙连接包括经典蓝牙连接,所述第二蓝牙连接包括BLE连接或LE Audio蓝牙连接。
  3. 根据权利要求2所述的方法,其特征在于,所述第一蓝牙设备与所述第二蓝牙设备共用同一经典蓝牙地址,且所述第一蓝牙设备与所述第二蓝牙设备共用同一BLE地址。
  4. 根据权利要求3所述的方法,其特征在于,所述BLE地址与所述经典蓝牙地址相同。
  5. 根据权利要求3所述的方法,其特征在于,在所述第一蓝牙设备分别与终端设备建立第一蓝牙连接及第二蓝牙连接之前,所述方法还包括:
    所述第一蓝牙设备和/或所述第二蓝牙设备基于所述BLE地址发送LE Audio广播信号,以使接收到所述LE Audio广播信号的终端设备根据所述BLE地址发送LE Audio连接请求;
    所述第一蓝牙设备根据接收的LE Audio连接请求,与所述终端设备建立LE Audio蓝牙连接。
  6. 根据权利要求1~5任一所述的方法,其特征在于,在所述第一蓝牙设备分别与终端设备建立第一蓝牙连接及第二蓝牙连接之前,所述方法还包括:
    所述第一蓝牙设备与所述第二蓝牙设备建立第三蓝牙连接;
    在所述第一蓝牙设备与终端设备建立第一蓝牙连接之后,所述方法还包括:所述第一蓝牙设备通过所述第三蓝牙连接,将所述第一蓝牙连接对应的第一连接信息发送给所述第二蓝牙设备;
    以及在所述第一蓝牙设备与终端设备建立第二蓝牙连接之后,所述方法还包括:所述第一蓝牙设备通过所述第三蓝牙连接,将所述第二蓝牙连接对应的第二连接信息发送给所述第二蓝牙设备。
  7. 根据权利要求6所述的方法,其特征在于,所述第三蓝牙连接包括经典蓝牙连接,在所述第一蓝牙设备与所述第二蓝牙设备建立第三蓝牙连接之前,所述第一蓝牙设备与所述第二蓝牙设备分别对应不同的经典蓝牙地址;在所述第一蓝牙设备与所述第二蓝牙设备建立第三蓝牙连接之后,所述第一蓝牙设备与所述第二蓝牙设备共用同一经典蓝牙地址;或,
    所述第三蓝牙连接包括BLE连接,在所述第一蓝牙设备与所述第二蓝牙设备建立第三蓝牙连接之前,所述第一蓝牙设备与所述第二蓝牙设备分别对应不同的BLE地址;在所述第一蓝牙设备与所述第二蓝牙设备建立第三蓝牙连接之后,所 述第一蓝牙设备与所述第二蓝牙设备共用同一BLE地址。
  8. 根据权利要求1~5任一所述的方法,其特征在于,所述第一蓝牙设备的主从关系为主设备,所述第二蓝牙设备的主从关系为从设备;所述方法还包括:
    所述第一蓝牙设备与所述第二蓝牙设备发生主从切换,使得与所述终端设备的所述第一蓝牙连接对象从所述第一蓝牙设备切换为所述第二蓝牙设备,与所述终端设备的所述第二蓝牙连接对象从所述第一蓝牙设备切换为所述第二蓝牙设备。
  9. 根据权利要求8所述的方法,其特征在于,在所述第一蓝牙设备与所述第二蓝牙设备发生主从切换之后,所述方法还包括:
    所述第一蓝牙设备根据所述第一蓝牙连接对应的第一连接信息对所述第二蓝牙设备与所述终端设备之间的第一蓝牙连接进行监听,并根据所述第二蓝牙连接对应的第二连接信息对所述第二蓝牙设备与所述终端设备之间的第二蓝牙连接进行监听。
  10. 根据权利要求8所述的方法,其特征在于,所述第一蓝牙设备与所述第二蓝牙设备发生主从切换,包括:
    当满足主从切换条件时,所述第一蓝牙设备与所述第二蓝牙设备发生主从切换。
  11. 根据权利要求10所述的方法,其特征在于,所述主从切换条件,包括:
    所述第一蓝牙设备检测到处于用户未使用的状态;或者,
    所述第一蓝牙设备相对终端设备的信号强度小于强度阈值。
  12. 根据权利要求1所述的方法,其特征在于,所述第一蓝牙设备包括第一耳机,所述第二蓝牙设备包括第二耳机,所述第一耳机与所述第二耳机组成一对耳机设备;所述方法还包括:
    所述第一耳机通过所述第一蓝牙连接或所述第二蓝牙连接接收所述终端设备发送的音频数据,并对所述音频数据进行处理,以得到与所述第一耳机对应的第一声道音频数据;
    所述第二耳机通过监听所述第一蓝牙连接或所述第二蓝牙连接,以接收所述终端设备发送的所述音频数据,并对所述音频数据进行处理,以得到与所述第一耳机对应的第二声道音频数据。
  13. 一种蓝牙地址配置方法,其特征在于,应用于一组蓝牙设备,所述一组蓝牙设备至少包括第一蓝牙设备及第二蓝牙设备,所述方法包括:
    在所述第一蓝牙设备与所述第二蓝牙设备建立蓝牙连接的情况下,所述第一蓝牙设备与所述第二蓝牙设备被配置为同一经典蓝牙地址,且所述第一蓝牙设备与所述第二蓝牙设备被配置为同一BLE地址。
  14. 根据权利要求13所述的方法,其特征在于,所述蓝牙连接包括经典蓝牙连接,所述方法还包括:
    在所述第一蓝牙设备与所述第二蓝牙设备建立蓝牙连接之前,所述第一蓝牙设备与所述第二蓝牙设备分别被配置为不同的经典蓝牙地址。
  15. 根据权利要求13所述的方法,其特征在于,所述蓝牙连接包括BLE连接,所述方法还包括:
    在所述第一蓝牙设备与所述第二蓝牙设备建立蓝牙连接之前,所述第一蓝牙设备与所述第二蓝牙设备分别被配置为不同的BLE地址。
  16. 根据权利要求13所述的方法,其特征在于,所述经典蓝牙地址与所述BLE地址相同。
  17. 一种蓝牙连接装置,其特征在于,应被配置为一组蓝牙设备,所述一组蓝牙设备至少包括第一蓝牙设备及第二蓝牙设备;所述装置包括:
    连接模块,被配置为由所述第一蓝牙设备分别与终端设备建立第一蓝牙连接及第二蓝牙连接;
    监听模块,被配置为由所述第二蓝牙设备根据第一连接信息对所述第一蓝牙连接进行监听,并根据第二连接信息对所述第二蓝牙连接进行监听;所述第一连接信息与所述第一蓝牙连接对应,所述第二连接信息与所述第二蓝牙连接对应。
  18. 一种蓝牙地址配置装置,其特征在于,应被配置为一组蓝牙设备,所述一组蓝牙设备至少包括第一蓝牙设备及第二蓝牙设备;所述装置包括:
    地址配置模块,被配置为在所述第一蓝牙设备与所述第二蓝牙设备建立蓝牙连接的情况下,使得所述第一蓝牙设备与所述第二蓝牙设备被配置为同一经典蓝牙地址,且所述第一蓝牙设备与所述第二蓝牙设备被配置为同一BLE地址。
  19. 一种电子设备,其特征在于,包括存储器及处理器,所述存储器中存储有计算机程序,所述计算机程序被所述处理器执行时,使得所述处理器实现如权利要求1~16任一所述的方法。
  20. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1~16任一所述的方法。
PCT/CN2022/130692 2021-12-03 2022-11-08 蓝牙连接方法及装置、蓝牙地址配置方法及装置 WO2023098423A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111474902.5A CN116233807A (zh) 2021-12-03 2021-12-03 蓝牙连接方法及装置、蓝牙地址配置方法及装置
CN202111474902.5 2021-12-03

Publications (1)

Publication Number Publication Date
WO2023098423A1 true WO2023098423A1 (zh) 2023-06-08

Family

ID=86589682

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/130692 WO2023098423A1 (zh) 2021-12-03 2022-11-08 蓝牙连接方法及装置、蓝牙地址配置方法及装置

Country Status (2)

Country Link
CN (1) CN116233807A (zh)
WO (1) WO2023098423A1 (zh)

Citations (7)

* 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
CN108551670A (zh) * 2018-03-30 2018-09-18 深圳市冠旭电子股份有限公司 一种蓝牙连接方法、装置及智能终端
CN110636487A (zh) * 2019-09-27 2019-12-31 恒玄科技(上海)有限公司 无线耳机及无线耳机的通信方法
CN110753330A (zh) * 2019-10-14 2020-02-04 合肥星空物联信息科技有限公司 一种蓝牙配对方法及蓝牙耳机
CN112055349A (zh) * 2020-09-18 2020-12-08 恒玄科技(上海)股份有限公司 一种无线通信方法及蓝牙设备
US20210037582A1 (en) * 2019-07-31 2021-02-04 Samsung Electronics Co., Ltd. Electronic device and method for communication connection based on low energy in electronic device
CN112925501A (zh) * 2021-01-26 2021-06-08 努比亚技术有限公司 音频播放控制方法、装置、系统及计算机可读存储介质

Patent Citations (7)

* 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
CN108551670A (zh) * 2018-03-30 2018-09-18 深圳市冠旭电子股份有限公司 一种蓝牙连接方法、装置及智能终端
US20210037582A1 (en) * 2019-07-31 2021-02-04 Samsung Electronics Co., Ltd. Electronic device and method for communication connection based on low energy in electronic device
CN110636487A (zh) * 2019-09-27 2019-12-31 恒玄科技(上海)有限公司 无线耳机及无线耳机的通信方法
CN110753330A (zh) * 2019-10-14 2020-02-04 合肥星空物联信息科技有限公司 一种蓝牙配对方法及蓝牙耳机
CN112055349A (zh) * 2020-09-18 2020-12-08 恒玄科技(上海)股份有限公司 一种无线通信方法及蓝牙设备
CN112925501A (zh) * 2021-01-26 2021-06-08 努比亚技术有限公司 音频播放控制方法、装置、系统及计算机可读存储介质

Also Published As

Publication number Publication date
CN116233807A (zh) 2023-06-06

Similar Documents

Publication Publication Date Title
KR102362156B1 (ko) 이어폰 무선 통신 방법, 마스터 이어폰, 슬레이브 이어폰 및 이어폰 시스템
EP3629562B1 (en) Data transmitting method and system
EP3849223B1 (en) Bluetooth headset device and communication method for the same
US20100048133A1 (en) Audio data flow input/output method and system
US20100158288A1 (en) Contextual audio switching for a usb controlled audio device
CN104205998A (zh) 用于在蓝牙网络中中继数据通信的方法和装置
WO2023087793A1 (zh) 音频业务处理方法、装置、电子设备及存储介质
CN113906773A (zh) 低功耗蓝牙设备的信道选择方法和装置
WO2023036178A1 (zh) 蓝牙连接方法、装置、耳机设备及计算机可读存储介质
EP4210362A1 (en) Bluetooth communication system, bluetooth connection method, electronic device, and storage medium
WO2012068814A1 (zh) 音频处理方法及双模数字移动通信终端
WO2023103732A1 (zh) 耳机设备的状态控制方法、装置、耳机设备及存储介质
WO2024016948A1 (zh) 信息更新方法及装置、音频共享方法及系统、电子设备
WO2023098423A1 (zh) 蓝牙连接方法及装置、蓝牙地址配置方法及装置
CN111954123A (zh) 无线音频设备信息同步的方法、系统、介质及无线音频设备
CN115175159A (zh) 一种蓝牙耳机播放方法及设备
WO2021239032A1 (zh) 蓝牙协议连接方法、装置、存储介质及相关设备
CN113709906B (zh) 无线音频系统、无线通讯方法及设备
WO2023093328A1 (zh) 蓝牙回连方法及装置、信息存储方法及装置、终端设备
TW202232983A (zh) 可避免聲音中斷的藍牙通信系統及相關的藍牙設備群
KR101653656B1 (ko) 와이파이-블루투스 브릿지 시스템 및 그 시스템을 이용한 와이파이-블루투스 연결 방법
CN115175149A (zh) 设备添加方法、装置、蓝牙芯片及设备
WO2024016885A1 (zh) 蓝牙连接方法、装置、电子设备及计算机可读存储介质
WO2023065881A1 (zh) 蓝牙连接方法、装置、电子设备及存储介质
WO2024060750A1 (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: 22900228

Country of ref document: EP

Kind code of ref document: A1