Bluetooth communication method and device, electronic equipment and storage medium
By coordinating and synchronizing the use of Bluetooth addresses and keys between Bluetooth devices, the LE Audio Bluetooth connection stability problem is solved, and stable data transmission and successful connection establishment between devices is achieved.
Patent Information
- Application Number
- CN202310857626.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-12
- Publication Date
- 2025-01-14
AI Technical Summary
The prior art is difficult to improve the stability of LE Audio Bluetooth connections between different electronic devices, especially in the coordinated and synchronous use between devices and separate usage modes, which are prone to problems of connection abnormalities.
By receiving Bluetooth addresses and keys in combined usage mode, coordinating and synchronous use, and establishing and maintaining LE Audio Bluetooth connection based on this information in separate usage mode, ensuring the stability of the connection and normality of data transmission.
It effectively improves the stability of the LE Audio Bluetooth connection between the first Bluetooth device and the terminal device, avoids the abnormal connection, and ensures the normality of data transmission and the successful establishment of the connection.
Smart Images

Figure CN119316843A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a Bluetooth communication method, device, electronic device and storage medium. Background Art
[0002] With the development of Bluetooth technology, the Bluetooth communication standard protocols released by the Bluetooth SIG have also been updated and changed, such as the earliest classic Bluetooth standard protocol, to the BLE (Bluetooth Low Energy) standard protocol, and then to the BLE Audio (Bluetooth Low Energy Audio) standard protocol. On the market, more and more electronic devices support the Bluetooth LE Audio function. How to improve the stability of LE Audio Bluetooth connections between different electronic devices has always been one of the key research issues of various device manufacturers. Summary of the invention
[0003] The embodiments of the present application disclose a Bluetooth communication method, apparatus, electronic device, and storage medium, which can improve the stability of the LE Audio Bluetooth connection between a first Bluetooth device and a terminal device.
[0004] The present application embodiment discloses a Bluetooth communication method, which is applied to a first Bluetooth device, and the method includes:
[0005] When the first Bluetooth device is in a combined use mode, receiving a first Bluetooth address and a first key sent by a second Bluetooth device; in the combined use mode, the first Bluetooth device and the second Bluetooth device are used in coordination and synchronization, and the second Bluetooth device establishes a first LE Audio Bluetooth connection with a terminal device based on the first Bluetooth address; the first key is used to encrypt the first LE Audio Bluetooth connection;
[0006] When the first Bluetooth device is in single use mode, a second LE Audio Bluetooth connection is established with the terminal device based on the first Bluetooth address, and data is transmitted with the terminal device according to the first key.
[0007] The present application embodiment discloses a Bluetooth communication method, which is applied to a headphone device, wherein the headphone device includes a first headphone and a second headphone; the method includes:
[0008] When the earphone device is in binaural use mode, the first earphone receives a first Bluetooth address sent by the second earphone, the second earphone establishes a first LE Audio Bluetooth connection with the terminal device based on the first Bluetooth address, and sends a first key to the first earphone; in the binaural use mode, the first earphone and the second earphone are used in coordination and synchronization; the first key is used to encrypt the first LE Audio Bluetooth connection;
[0009] When the first earphone is in a single-ear usage mode, the first earphone establishes a second LE Audio Bluetooth connection with the terminal device based on the first Bluetooth address, and transmits data with the terminal device according to the first key.
[0010] The embodiment of the present application discloses a Bluetooth communication device, which is applied to a first Bluetooth device, and the device includes:
[0011] a receiving module, configured to receive a first Bluetooth address and a first key sent by a second Bluetooth device when the first Bluetooth device is in a combined use mode; in the combined use mode, the first Bluetooth device and the second Bluetooth device are used in coordination and synchronization, and the second Bluetooth device establishes a first LE Audio Bluetooth connection with a terminal device based on the first Bluetooth address; the first key is used to encrypt the first LE Audio Bluetooth connection;
[0012] A connection module is used to establish a second LE Audio Bluetooth connection with the terminal device based on the first Bluetooth address when the first Bluetooth device is in a single use mode, and to transmit data with the terminal device according to the first key.
[0013] The embodiment of the present application discloses a Bluetooth communication device, which is applied to an earphone device, wherein the earphone device includes a first earphone and a second earphone; the device includes:
[0014] A binaural use module, configured to, when the headphone device is in a binaural use mode, receive, through the first headphone, a first Bluetooth address sent by the second headphone, establish a first LE Audio Bluetooth connection with the terminal device based on the first Bluetooth address through the second headphone, and send a first key to the first headphone; in the binaural use mode, the first headphone and the second headphone are used in coordination and synchronization; the first key is used to encrypt the first LE Audio Bluetooth connection;
[0015] A single-ear use module is used to establish a second LE Audio Bluetooth connection with the terminal device based on the first Bluetooth address through the first earphone when the first earphone is in a single-ear use mode, and to transmit data with the terminal device according to the first key.
[0016] An embodiment of the present application discloses an electronic device, including a memory, a processor, and a communication unit. The memory stores a computer program. When the computer program is executed by the processor, the electronic device implements the method described in any of the above embodiments.
[0017] An embodiment of the present application discloses a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor in an electronic device, the electronic device implements the method described in any of the above embodiments.
[0018] The Bluetooth communication method, apparatus, electronic device and storage medium provided by the embodiments of the present application, when the first Bluetooth device is in a combined use mode, the first Bluetooth device receives a first Bluetooth address and a first key sent by a second Bluetooth device. In the combined use mode, the first Bluetooth device and the second Bluetooth device are used in coordination and synchronization, and the second Bluetooth device establishes a first LE Audio Bluetooth connection with the terminal device based on the first Bluetooth address, and the first key is used to encrypt the first LE Audio Bluetooth connection. When the first Bluetooth device is in a single use mode, the first Bluetooth device establishes a second LE Audio Bluetooth connection with the terminal device based on the first Bluetooth address, and transmits data with the terminal device according to the first key. In an embodiment of the present application, since in the combined use mode, the second Bluetooth device has successfully established a first LE Audio Bluetooth connection with the terminal device based on the first Bluetooth address, when the first Bluetooth device is in the single use mode, based on the first Bluetooth address, it can successfully establish a second LE Audio Bluetooth connection with the terminal device, thereby ensuring the successful establishment of the LE Audio Bluetooth connection between the first Bluetooth device and the terminal device; moreover, in the combined use mode, the second Bluetooth device will send the first key corresponding to the first LE Audio Bluetooth connection to the first Bluetooth device. When the first Bluetooth device is in the single use mode, after the first Bluetooth device establishes the LE Audio Bluetooth connection with the terminal device, it can transmit data with the terminal device according to the first key, thereby avoiding abnormal LE Audio Bluetooth connection interaction and improving the stability of the LE Audio Bluetooth connection between the first Bluetooth device and the terminal device. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0020] Figure 1A An application scenario diagram of a Bluetooth communication method in an embodiment;
[0021] Figure 1B It is an application scenario diagram of the Bluetooth communication method in another embodiment;
[0022] Figure 1C It is an application scenario diagram of the Bluetooth communication method in another embodiment;
[0023] Figure 1D It is an application scenario diagram of the Bluetooth communication method in another embodiment;
[0024] Figure 2 is a flow chart of a Bluetooth communication method in one embodiment;
[0025] Figure 3 is a schematic diagram of the structure of an LE Audio broadcast signal in one embodiment;
[0026] Figure 4A A timing diagram of establishing LEAudio Bluetooth connections between a terminal device and a first Bluetooth device and a second Bluetooth device respectively in one embodiment;
[0027] Figure 4B A timing diagram of establishing LEAudio Bluetooth connections with a first Bluetooth device and a second Bluetooth device respectively in another embodiment;
[0028] Figure 4C A timing diagram of a Bluetooth communication method in one embodiment;
[0029] Figure 5 is a flow chart of a Bluetooth communication method in another embodiment;
[0030] Fig. 6A A timing diagram of establishing LEAudio Bluetooth connections with a first Bluetooth device and a second Bluetooth device respectively in another embodiment;
[0031] Figure 6B A timing diagram of a Bluetooth communication method in another embodiment;
[0032] Figure 6C A timing diagram of a Bluetooth communication method in another embodiment;
[0033] Fig.6D It is a timing diagram of establishing an LE Audio Bluetooth connection between a terminal device and a first Bluetooth device in one embodiment;
[0034] Figure 7 is a flow chart of a Bluetooth communication method in another embodiment;
[0035] Figure 8 is a block diagram of a Bluetooth communication device in one embodiment;
[0036] Fig. 9 is a block diagram of a Bluetooth communication device in another embodiment;
[0037] Fig.10 FIG. 4 is a structural block diagram of a Bluetooth device in an embodiment. DETAILED DESCRIPTION
[0038] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0039] It should be noted that the terms "including" and "having" and any variations thereof in the embodiments of the present application and the accompanying drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products or devices.
[0040] It is understood that the terms "first", "second", etc. used in this application may be used herein to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish a first element from another element. For example, without departing from the scope of this application, a first Bluetooth device may be referred to as a second Bluetooth device, and similarly, a second Bluetooth device may be referred to as a first Bluetooth device. Both the first Bluetooth device and the second Bluetooth device are Bluetooth devices, but they are not the same Bluetooth device.
[0041] Figure 1A FIG. 1 is an application scenario diagram of a Bluetooth communication method in an embodiment. Figure 1A As shown, the first Bluetooth device 110 and the second Bluetooth device 120 can be in a combined use mode. In the combined use mode, the first Bluetooth device 110 and the second Bluetooth device 120 can interact with the terminal device 130 as the same Bluetooth combination, and the first Bluetooth device 110 and the second Bluetooth device 120 can be coordinated and used synchronously.
[0042] The first Bluetooth device 110 and the second Bluetooth device 120 may include but are not limited to headphones, mobile phones, wearable devices, speaker devices, smart home devices, etc. As an implementation, the first Bluetooth device 110 and the second Bluetooth device 120 may be matching devices, for example, the first Bluetooth device 110 and the second Bluetooth device 120 may belong to the same headphone device, the first Bluetooth device 110 is the left headphone in the headphone device, the second Bluetooth device 120 is the right headphone in the headphone device, or the first Bluetooth device 110 is the right headphone in the headphone device, the second Bluetooth device 120 is the left headphone in the headphone device, etc. Further, the headphone device may be a TWS (True Wireless Stereo) headphone, etc., but is not limited thereto.
[0043] The terminal device 130 may include but is not limited to a mobile phone, a wearable device, a vehicle-mounted terminal, a tablet computer, a PC (Personal Computer), a PDA (Personal Digital Assistant), etc.
[0044] In an embodiment of the present application, the first Bluetooth device 110, the second Bluetooth device 120 and the terminal device 130 can all be devices that support BLE Audio technology. Through the established LE Audio Bluetooth connection, it can support audio data encoded by LC3 (Low Complexity Communications Codec, low-power audio codec), so that the transmission of audio data can better take into account various aspects such as power consumption, real-time performance and sound quality. It should be noted that BLE Audio and LE Audio used in this application can refer to the same concept, and the terms can be used interchangeably, and both can refer to the new generation of Bluetooth audio technology standards set based on the Bluetooth 5.2 version specification.
[0045] When the first Bluetooth device 110 and the second Bluetooth device 120 are in combined use mode, the second Bluetooth device 120 may establish a first LE Audio Bluetooth connection with the terminal device 130. In order to achieve coordinated and synchronous use between the first Bluetooth device 110 and the second Bluetooth device 120, as an implementation, the first Bluetooth device 110 may establish a third LE Audio Bluetooth connection with the terminal device 130, and then use a common timestamp or other method to achieve data synchronization between the first Bluetooth device 110 and the second Bluetooth device 120. As another implementation, the first Bluetooth device 110 may not establish an LE Audio Bluetooth connection with the terminal device 130. The first Bluetooth device 110 may monitor the first LE Audio Bluetooth connection between the second Bluetooth device 120 and the terminal device 130 in a monitoring manner to obtain data transmitted by the first LE Audio Bluetooth connection, and achieve data synchronization with the second Bluetooth device 120.
[0046] In some embodiments, Figure 1A As shown, when the first Bluetooth device 110 and the second Bluetooth device 120 are in a combined use mode, a communication connection can be established between the first Bluetooth device 110 and the second Bluetooth device 120, and the communication connection may include but is not limited to a classic Bluetooth connection, a BLE connection, etc. The first Bluetooth device 110 and the second Bluetooth device 120 can perform data transmission through the established communication connection. As an implementation method, the first Bluetooth device 110 and the second Bluetooth device 120 can exchange Bluetooth addresses with each other. For example, the second Bluetooth device 120 currently configures a first BLE address, and the second Bluetooth device 120 can use the first BLE address to establish a first LE Audio Bluetooth connection with the terminal device 130, then the second Bluetooth device 120 can send its currently configured first BLE address to the first Bluetooth device 110; the first Bluetooth device 110 currently configures a second BLE address, and the first Bluetooth device 110 can use the second BLE address to establish a third LE Audio Bluetooth connection with the terminal device 130, then the first Bluetooth device 110 can also send its currently configured second BLE address to the second Bluetooth device 120.
[0047] It should be noted that the Bluetooth devices included in the same Bluetooth combination are not limited to Figure 1A As shown in the first Bluetooth device 110 and the second Bluetooth device 120, the number of Bluetooth devices included in the same Bluetooth combination is not limited in the embodiment of the present application, for example, it can be 3, 4, etc. In the combination use mode, the Bluetooth devices belonging to the same Bluetooth combination can be coordinated and used synchronously.
[0048] In some scenarios, any Bluetooth device in the Bluetooth combination may be used alone. For example, when the first Bluetooth device 110 is abandoned by the second Bluetooth device 120 or the second Bluetooth device 120 is too far away from the terminal device 130 and the first Bluetooth device 110, the first Bluetooth device 110 will be in single use mode. Figure 1B As shown, Figure 1B FIG. 1 is an application scenario diagram of a Bluetooth communication method in another embodiment. When the first Bluetooth device 110 is in a single-use mode, the first Bluetooth device 110 can establish a second LE Audio Bluetooth connection with the terminal device 130. Further, when the first Bluetooth device 110 is in a single-use mode, the communication connection between the first Bluetooth device 110 and the second Bluetooth device 120 is disconnected.
[0049] In order to ensure that the first Bluetooth device 110 can successfully establish an LE Audio Bluetooth connection with the terminal device 130, in some embodiments, when the first Bluetooth device 110 is in single-use mode, a first BLE address can be configured, and the first BLE address can be used to establish a second LE Audio Bluetooth connection with the terminal device 130. Since the second Bluetooth device 120 has successfully established an LE Audio Bluetooth connection with the terminal device 130 using the first BLE address in the previous combined use mode, the first Bluetooth device 110 can also successfully establish an LE Audio Bluetooth connection with the terminal device 130 using the first BLE address in the single-use mode.
[0050] In the related art, when two electronic devices establish an LE Audio Bluetooth connection for the first time, they will perform the SMP (secure manager protocol) process of the BLE connection. The SMP process can provide the BLE connection with the key required to establish an encrypted connection. Therefore, when the terminal device 130 establishes the first LE Audio Bluetooth connection with the second Bluetooth device 120 for the first time, it will generate a key for encrypting the first LE Audio Bluetooth connection. When the first Bluetooth device 110 is in single use mode, the first Bluetooth device 110 uses the first BLE address to establish a second LE Audio Bluetooth connection with the terminal device 130. Since the terminal device 130 already has a connection record of the first BLE address, the corresponding key will not be regenerated. The first Bluetooth device 110 does not have the key corresponding to the first BLE address, resulting in the first Bluetooth device 110 receiving the encrypted data sent by the terminal device 130 through the second LE Audio Bluetooth connection, and cannot parse the data normally, resulting in a connection abnormality.
[0051] In the embodiment of the present application, when the first Bluetooth device 110 and the second Bluetooth device 120 are in a combined use mode, after the second Bluetooth device 120 establishes a first LE Audio Bluetooth connection with the terminal device 130 based on the first BLE address, the first key corresponding to the first LE Audio Bluetooth connection can be sent to the first Bluetooth device 110. When the first Bluetooth device 110 is in a single use mode, the first Bluetooth device 110 establishes a second LE Audio Bluetooth connection with the terminal device 130 based on the first BLE address. Since the first Bluetooth device 110 has previously obtained the first key, data can be transmitted with the terminal device 130 through the second LE Audio Bluetooth connection based on the first key, and the data sent by the terminal device 130 through the second LE Audio Bluetooth connection can be normally parsed, thereby improving the stability of the LE Audio Bluetooth connection.
[0052] In some embodiments, the first Bluetooth device 110 and the second Bluetooth device 120 may be Bluetooth devices supporting dual-mode connection, and may simultaneously establish two different Bluetooth connections with the terminal device 130, such as simultaneously establishing a classic Bluetooth connection and an LE Audio Bluetooth connection with the terminal device 130, wherein the classic Bluetooth connection refers to a Bluetooth connection established based on the classic Bluetooth protocol, and the classic Bluetooth protocol generally refers to a Bluetooth protocol below Bluetooth protocol version 4.0. Figure 1C As shown, Figure 1C FIG. 1 is an application scenario diagram of a Bluetooth communication method in another embodiment. When the first Bluetooth device 110 and the second Bluetooth device 120 are in a combined use mode, the second Bluetooth device 120 can establish a classic Bluetooth connection and a first LE Audio Bluetooth connection with the terminal device 130 respectively.
[0053] The first Bluetooth device 110 may monitor the classic Bluetooth connection between the second Bluetooth device 120 and the terminal device 130, or the second Bluetooth device 120 may forward the data received through the classic Bluetooth connection to the first Bluetooth device 110, so as to achieve data synchronization for classic Bluetooth between the first Bluetooth device 110 and the second Bluetooth device 130. The second Bluetooth device 120 may also establish a third LE Audio Bluetooth connection with the terminal device 130, and then use a common timestamp or other method to achieve data synchronization for LE Audio Bluetooth between the first Bluetooth device 110 and the second Bluetooth device 120. Alternatively, the first Bluetooth device 110 may monitor the first LE Audio Bluetooth connection between the second Bluetooth device 120 and the terminal device 130 in a monitoring manner to obtain the data transmitted by the first LE Audio Bluetooth connection, so as to achieve data synchronization for LE Audio Bluetooth between the first Bluetooth device 110 and the second Bluetooth device 120.
[0054] The second Bluetooth device 120 is configured with a classic Bluetooth address and a first BLE address, and can use the classic Bluetooth address to establish a classic Bluetooth connection with the terminal device 130, and use the first BLE address to establish a first LE Audio Bluetooth connection with the terminal device 130. When the first Bluetooth device 110 and the second Bluetooth device 120 are used as a Bluetooth combination, they can share the same classic Bluetooth address. The second Bluetooth device 120 can be a master Bluetooth device, and the first Bluetooth device 110 can be a slave Bluetooth device. The master Bluetooth device refers to a Bluetooth device in the Bluetooth combination that can directly establish a classic Bluetooth connection with an external device (such as the terminal device 130), and the slave Bluetooth device refers to a Bluetooth device in the Bluetooth combination that does not directly establish a classic Bluetooth connection with an external device (such as the terminal device 130).
[0055] like Figure 1D As shown, Figure 1D FIG. 1 is an application scenario diagram of a Bluetooth communication method in another embodiment. In order to ensure that the first Bluetooth device 110 can successfully establish an LE Audio Bluetooth connection with the terminal device 130, in some embodiments, when the first Bluetooth device 110 is in a single-use mode, the first Bluetooth device 110 can configure the above-mentioned classic Bluetooth connection and the first BLE address, establish a classic Bluetooth connection with the terminal device 130 based on the classic Bluetooth address, and use the first BLE address to establish a second LE Audio Bluetooth connection with the terminal device 130. Since the terminal device has stored a connection record corresponding to the classic Bluetooth connection and the first BLE address in the previous combined use mode, the first Bluetooth device 110 can successfully establish a classic Bluetooth connection and a second LE Audio Bluetooth connection with the terminal device 130. Moreover, since the first Bluetooth device 110 has previously obtained the first key when it was in the combined use mode, when the first Bluetooth device 110 is in the single-use mode, data can be transmitted with the terminal device 130 through the second LE Audio Bluetooth connection according to the first key, and the data sent by the terminal device 130 through the second LE Audio Bluetooth connection can be normally parsed, thereby improving the stability of the LE Audio Bluetooth connection.
[0056] like Figure 2 As shown, in one embodiment, a Bluetooth communication method is provided, which can be applied to the first Bluetooth device mentioned above, and the method may include the following steps:
[0057] Step 210, when the first Bluetooth device is in a combined use mode, receiving a first Bluetooth address and a first key sent by a second Bluetooth device; in the combined use mode, the second Bluetooth device establishes a first LE Audio Bluetooth connection with the terminal device based on the first Bluetooth address.
[0058] When the first Bluetooth device is in the combined use mode, the first Bluetooth device is used as the same Bluetooth combination with at least the second Bluetooth device, and the first Bluetooth device and the second Bluetooth device are used in coordination and synchronization. For example, when the TWS headset is in the combined use mode, the left earphone and the right earphone synchronously output audio data and coordinate with each other.
[0059] When the first Bluetooth device and the second Bluetooth device are in combined use mode, the first Bluetooth device and the second Bluetooth device may establish a communication connection and receive a first Bluetooth address sent by the second Bluetooth device. The communication connection may include but is not limited to a classic Bluetooth connection, a BLE connection, etc. The second Bluetooth device may send a first Bluetooth address to the first Bluetooth device, and the first Bluetooth address may include a first BLE address currently configured by the second Bluetooth device, etc.; optionally, the first Bluetooth device may also send a second Bluetooth address to the second Bluetooth device, and the second Bluetooth address may include a second BLE address currently configured by the first Bluetooth device, etc.
[0060] In the combined use mode, the second Bluetooth device can establish a first LE Audio Bluetooth connection with the terminal device based on the first Bluetooth address. In some embodiments, the second Bluetooth device can use the first BLE address to send a first LE Audio broadcast signal, and after the terminal device receives the first LE Audio broadcast signal sent by the second Bluetooth device, it can establish a first LE Audio Bluetooth connection with the second Bluetooth device according to the first LE Audio broadcast signal.
[0061] As a specific implementation, the terminal device may send a connection request command to the second Bluetooth device based on the first BLE address in the received first LE Audio broadcast signal, and the connection request command is used to notify the terminal device that an LE Audio Bluetooth connection is about to be established with the second Bluetooth device. After receiving the connection request command, the second Bluetooth device may prepare for reception according to the connection request command. For example, the connection request command may include field information such as a transmission window delay (Transmit window offset) and a transmission window size (Transmit window size). Among them, information such as the transmission window delay and the transmission window size can be used to determine the time interval from the second Bluetooth device receiving the connection request command to receiving the LE Audio connection data packet. When the connection anchor point is reached, the terminal device may send an LE Audio connection data packet to the second Bluetooth device. After receiving the LE Audio connection data packet, the second Bluetooth device may return a response signal to the terminal device, thereby successfully establishing the first LE Audio Bluetooth connection with the terminal device. The specific connection method can also refer to the settings of the relevant Bluetooth protocol, which will not be repeated here.
[0062] If the second Bluetooth device and the terminal device establish the first LE Audio Bluetooth connection for the first time, that is, the terminal device does not store the connection record corresponding to the first BLE address, then in the process of establishing the first LE Audio Bluetooth connection between the terminal device and the second Bluetooth device, the terminal device and the second Bluetooth device can perform the SMP process of BLE connection to generate the first key corresponding to the first LE Audio Bluetooth connection, and the SMP process can be considered as the pairing of BLE connection. The first key can be used to encrypt the first LE Audio Bluetooth connection, and the first key may include the first LTK (Long Term Key), etc. After the terminal device establishes the first LE Audio Bluetooth connection with the second Bluetooth device, the terminal device can generate a corresponding connection record, which may include information such as the first BLE address and the first key.
[0063] The second Bluetooth device can use the first key to transmit data with the terminal device through the first LE Audio Bluetooth connection. For example, the terminal device can encrypt data according to the first key, and send the encrypted data to the second Bluetooth device through the first LE Audio Bluetooth connection. After the second Bluetooth device receives the encrypted data, it can decrypt the encrypted data according to the first key to obtain the corresponding data. Similarly, the second Bluetooth device can also use the first key to encrypt data and then send it to the terminal device through the first LE Audio Bluetooth connection, etc.
[0064] In an embodiment of the present application, after establishing the first LE Audio Bluetooth connection, the second Bluetooth device may send the first key to the first Bluetooth device, and the first Bluetooth device may store the first key corresponding to the first Bluetooth address.
[0065] In order to achieve synchronization between the first Bluetooth device and the second Bluetooth device in BLE Audio, as an implementation method, after the second Bluetooth device establishes a first LE Audio Bluetooth connection with the terminal device, the first Bluetooth device can monitor the first LE Audio Bluetooth connection.
[0066] As another implementation, the first Bluetooth device may establish a third LE Audio Bluetooth connection with the terminal device based on the second BLE address, and then use a common timestamp or other method to achieve data synchronization between the first Bluetooth device 110 and the second Bluetooth device 120. The first Bluetooth device may be configured with a second BLE address, and use the second BLE address to send a second LE Audio broadcast signal. The terminal device receives the second LE Audio broadcast signal sent by the first Bluetooth device, and determines that the first Bluetooth device and the second Bluetooth device belong to the same Bluetooth combination according to the second LE Audio broadcast signal, and then establishes a third LE Audio Bluetooth connection with the second Bluetooth device.
[0067] The BLE Audio technology provides CSIP (Coordinated Set Identification Profile), which allows multiple Bluetooth devices belonging to the same Bluetooth combination to achieve coordination and synchronization when interacting with external devices. In CSIP, for multiple Bluetooth devices belonging to the same Bluetooth combination, the same SIRK (Set Identity Resolving Key) can be used, that is, Bluetooth devices with the same SIRK are identified as the same Bluetooth combination.
[0068] In some embodiments, when the first Bluetooth device and the second Bluetooth device are in a combined use mode, the first Bluetooth device and the second Bluetooth device share the same SIRK, and respectively establish LE Audio Bluetooth connections with the terminal device. Since the SIRKs of the first Bluetooth device and the second Bluetooth device are the same, the terminal device can identify the first Bluetooth device and the second Bluetooth device as belonging to the same Bluetooth combination and perform data interaction.
[0069] In the combined use mode, the second Bluetooth device can send a first LE Audio broadcast signal corresponding to the configured SIRK, and the terminal device can establish a first LE Audio Bluetooth connection with the second Bluetooth device based on the first LE Audio broadcast signal, and obtain the SIRK corresponding to the first LE Audio broadcast signal. As an implementation method, the LE Audio Bluetooth connection is established on the basis of the BLE connection, and the process of establishing the LE Audio Bluetooth connection may include querying some device parameters based on the BLE connection, and the query of the device parameters may include a SIRK query for the Bluetooth device. After the LE Audio Bluetooth connection is established, when there is a business demand, a CIS (Connected Isochronous Streams) channel may be established for business transmission. Therefore, the terminal device can receive the first SIRK sent by the second Bluetooth device during the process of establishing the first LE Audio Bluetooth connection with the second Bluetooth device.
[0070] The first Bluetooth device can be configured with the same SIRK as the second Bluetooth device, and send a second LE Audio broadcast signal corresponding to the configured SIRK. After the terminal device receives the second LE Audio broadcast signal sent by the first Bluetooth device, it can determine whether the SIRK corresponding to the second LE Audio broadcast signal is the same as the SIRK of the second Bluetooth device. If it is determined that the SIRK corresponding to the second LE Audio broadcast signal is the same as the SIRK of the second Bluetooth device, it can be considered that the first Bluetooth device and the second Bluetooth device belong to the same Bluetooth combination, and an LE Audio Bluetooth connection request can be automatically sent to the first Bluetooth device to establish a third LE Audio Bluetooth connection with the first Bluetooth device.
[0071] As an implementation method, the LE Audio broadcast signal sent by the Bluetooth device may include a special field calculated based on the SIRK. After the terminal device receives the second LE Audio broadcast signal sent by the first Bluetooth device, it can parse the second BLEAudio broadcast signal to obtain the target specific broadcast information and special fields carried by the second LE Audio broadcast signal, and calculate the target local value based on the SIRK corresponding to the second Bluetooth device and the target specific broadcast information. If the target local value is the same as the special field, it can be determined that the first Bluetooth device and the second Bluetooth device belong to the same Bluetooth combination.
[0072] Specifically, Figure 3 As shown, the LE Audio broadcast signal may include RSI (resolvable Set Identifier), and RSI may include two parts: 1. A hash sequence 310 generated by the SIRK corresponding to the Bluetooth device; 2. A random sequence 320 generated by a random number. The hash sequence 310 can be calculated by the formula: hash = sih (SIKR, prand), hash represents the hash sequence 310, prand represents the random sequence 320; RSI = hash||prand. The target specific broadcast information obtained by the terminal device parsing the second LE Audio broadcast signal sent by the first Bluetooth device may be a random sequence of RSI, and the special field may be a hash sequence of RSI carried by the second LE Audio broadcast signal. The terminal device can calculate the hash value (i.e., the above-mentioned target local value) by the above formula based on the SIRK of the second Bluetooth device and the random sequence in the parsed RSI, and compare the hash value with the hash sequence of the parsed RSI. If the two are consistent, it means that the SIKR of the second Bluetooth device is the same as the SIRK of the first Bluetooth device.
[0073] For example, Figure 4A FIG. 1 is a timing diagram of establishing LE Audio Bluetooth connections between a terminal device and a first Bluetooth device and a second Bluetooth device, respectively, in an embodiment. Figure 4AAs shown, the above-mentioned first Bluetooth device may include a first earphone in the earphone device, and the second Bluetooth device may include a second earphone in the earphone device. When the user opens the earphone box, the first earphone and the second earphone can establish a communication connection and send each other information such as their respective Bluetooth addresses, and the first earphone and the second earphone are in binaural use mode. The second earphone can send LE Audio broadcast signal 1, and the terminal device turns on the scanning mode (referring to the mode that can scan and obtain the LE Audio broadcast signal), and can scan and obtain the LE Audio broadcast signal 1 sent by the second earphone. The terminal device can establish an LE Audio Bluetooth connection with the second earphone according to the LE Audio broadcast signal 1, and obtain the SIRK of the second earphone. The first earphone sends LE Audio broadcast signal 2, and the terminal device can scan and obtain the LE Audio broadcast signal 2 sent by the first earphone. The hash value can be calculated according to the SIRK of the second earphone and the prand field in the LE Audio broadcast signal 2, and then it is determined whether the hash value is equal to the hash field in the LE Audio broadcast signal 2. If the hash value is equal to the hash field in the LE Audio broadcast signal 2, the terminal device can automatically send an LE Audio connection request to the first earphone and establish an LE Audio Bluetooth connection with the first earphone. The terminal device may also obtain the SIRK of the first earphone. Since the SIRKs of the first earphone and the second earphone are the same, the first earphone and the second earphone are determined to belong to the same group.
[0074] In some embodiments, the terminal device may also perform an SMP process of the BLE connection during the process of establishing a third LE Audio Bluetooth connection with the first Bluetooth device to generate a third key corresponding to the third LE Audio Bluetooth connection, and the third key may be used to encrypt the third LE Audio Bluetooth connection. The third key may include the second LTK, etc. The first Bluetooth device may transmit data with the terminal device through the third LE Audio Bluetooth connection based on the third key. The specific data transmission method is similar to the method of data transmission between the second Bluetooth device and the terminal device in the above embodiment. Please refer to the relevant description in the above embodiment, which will not be repeated here.
[0075] Optionally, the first Bluetooth device may also send the third key to the second Bluetooth device, and the second Bluetooth device may store the third key and the second BLE address accordingly, thereby ensuring data synchronization between the first Bluetooth device and the second Bluetooth device and further improving the stability of the Bluetooth connection.
[0076] For example, Figure 4B FIG. 1 is a timing diagram of another embodiment in which a terminal device establishes LE Audio Bluetooth connections with a first Bluetooth device and a second Bluetooth device respectively. Figure 4BAs shown, the above-mentioned first Bluetooth device may include a first earphone in the earphone device, and the second Bluetooth device may include a second earphone in the earphone device. When the user opens the earphone box, the first earphone and the second earphone may establish a communication connection, and send each other information such as their respective Bluetooth addresses, and the first earphone and the second earphone are in binaural use mode. The second earphone can send LE Audio broadcast signal 1, and the terminal device turns on the scanning mode, and can scan and obtain the LE Audio broadcast signal 1 sent by the second earphone. The terminal device can establish an LE Audio Bluetooth connection with the second earphone according to the LE Audio broadcast signal 1. In the process of establishing an LE Audio Bluetooth connection between the terminal device and the second earphone, an SMP process can be performed to generate LTK1, and the LTK1 can be used to encrypt the LE Audio Bluetooth connection between the terminal device and the second earphone. The second earphone can send LTK1 to the first earphone. The first earphone can send LE Audio broadcast signal 2, and the terminal device can scan and obtain the LE Audio broadcast signal 2 sent by the first earphone, and establish an LE Audio Bluetooth connection with the first earphone according to the LE Audio broadcast signal 2. During the process of establishing an LE Audio Bluetooth connection between the terminal device and the first headset, an SMP process may be performed to generate LTK2, which may be used to encrypt the LE Audio Bluetooth connection between the terminal device and the first headset. Optionally, the first headset may also send LTK2 to the second headset.
[0077] Step 220: When the first Bluetooth device is in single-use mode, a second LE Audio Bluetooth connection is established with the terminal device based on the first Bluetooth address, and data is transmitted with the terminal device according to the first key.
[0078] When the first Bluetooth device is in single-use mode, the communication connection between the first Bluetooth device and the second Bluetooth device can be disconnected. The first Bluetooth device can be configured with a first BLE address and use the first BLE address to send a target LE Audio broadcast signal. After the terminal device receives the target LE Audio broadcast signal, since the BLE address corresponding to the target LE Audio broadcast signal is the first BLE address and is stored in the connection record, the terminal device can send a LE Audio connection request to the first Bluetooth device and establish a second LE Audio Bluetooth connection with the first Bluetooth device, thereby ensuring that the LE Audio Bluetooth connection between the first Bluetooth device and the terminal device can be successfully established.
[0079] Furthermore, since the first key corresponding to the first BLE address is stored in the connection record, the SMP process will no longer be performed during the process of establishing the second LE Audio Bluetooth connection between the terminal device and the first Bluetooth device, and no new key will be generated. Instead, the first key will be used directly to transmit data with the first Bluetooth device. In an embodiment of the present application, since the first key is already stored in the first Bluetooth device, when the first Bluetooth device receives the encrypted data (encrypted using the first key) sent by the terminal device through the second LE Audio Bluetooth connection, the first key can be successfully used to decrypt the encrypted data to obtain the corresponding data, thereby avoiding abnormalities in the LE Audio Bluetooth connection and improving the stability of the LE Audio Bluetooth connection.
[0080] For example, Figure 4C FIG. 1 is a timing diagram of a Bluetooth communication method in an embodiment. Figure 4C As shown, when the first Bluetooth device and the second Bluetooth device are in a combined use mode, the first Bluetooth device and the second Bluetooth device can establish a communication connection, and the second Bluetooth device can send a first Bluetooth address to the first Bluetooth device. The second Bluetooth device can send a first LE Audio broadcast signal based on the first Bluetooth address (such as the first BLE address), and the terminal device receives the first LE Audio broadcast signal, and can establish a first LE Audio Bluetooth connection with the second Bluetooth device according to the first LE Audio broadcast signal, and generate a first key. The second Bluetooth device can send a first key to the first Bluetooth device. When the first Bluetooth device is in a single use mode, the first Bluetooth device can send a target LE Audio broadcast signal based on the first Bluetooth address (such as the first BLE address), and the terminal device receives the target LE Audio broadcast signal, and can establish a second LE Audio Bluetooth connection with the second Bluetooth device according to the target LE Audio broadcast signal. The first Bluetooth device and the terminal device can use the first key to transmit data through the second LE Audio Bluetooth connection.
[0081] Optionally, when the first Bluetooth device is in single use mode, the SIRK of the first Bluetooth device may not change and remain consistent with the SIRK when it is in combined use mode. The terminal device can determine, based on the target LE Audio broadcast signal, that the first Bluetooth device in single use mode still belongs to the previously connected Bluetooth combination, and directly initiate an LE Audio Bluetooth connection to the first Bluetooth device without the user clicking to confirm, thereby improving connection efficiency and success rate.
[0082] In an embodiment of the present application, since in the combined use mode, the second Bluetooth device has successfully established a first LE Audio Bluetooth connection with the terminal device based on the first Bluetooth address, when the first Bluetooth device is in the single use mode, based on the first Bluetooth address, it can successfully establish a second LE Audio Bluetooth connection with the terminal device, thereby ensuring the successful establishment of the LE Audio Bluetooth connection between the first Bluetooth device and the terminal device; moreover, in the combined use mode, the second Bluetooth device will send the first key corresponding to the first LE Audio Bluetooth connection to the first Bluetooth device. When the first Bluetooth device is in the single use mode, after the first Bluetooth device establishes the LE Audio Bluetooth connection with the terminal device, it can transmit data with the terminal device according to the first key, thereby avoiding abnormal LE Audio Bluetooth connection interaction and improving the stability of the LE Audio Bluetooth connection between the first Bluetooth device and the terminal device.
[0083] In some embodiments, the first Bluetooth device and the second Bluetooth device may be Bluetooth devices supporting dual-mode connection, such as Figure 5 As shown, a Bluetooth communication method is provided, which can be applied to a first Bluetooth device, and the method includes:
[0084] Step 502, when the first Bluetooth device is in a combined use mode, receive a first Bluetooth address sent by a second Bluetooth device; the first Bluetooth address includes a classic Bluetooth address and a first BLE address. In the combined use mode, the second Bluetooth device establishes a first classic Bluetooth connection with the terminal device based on the classic Bluetooth address, and establishes a first LE Audio Bluetooth connection with the terminal device based on the first BLE address.
[0085] In the combined use mode, the second Bluetooth device can configure its own Bluetooth address as the first Bluetooth address, and configure the above-mentioned classic Bluetooth address and the first BLE address. In the combined use mode, the first Bluetooth device and the second Bluetooth device are used as a Bluetooth combination, and the first Bluetooth device can also be configured as the above-mentioned classic Bluetooth device, and the first Bluetooth device and the second Bluetooth device share the same classic Bluetooth address. Optionally, the second Bluetooth device can be a master Bluetooth device, and the first Bluetooth device can be a slave Bluetooth device. In the group use mode, the second Bluetooth device directly establishes a first classic Bluetooth connection with the terminal device, and the first Bluetooth device monitors the first classic Bluetooth connection, or the second Bluetooth device forwards the data transmitted by the first classic Bluetooth connection to the first Bluetooth device, thereby realizing master-slave synchronization.
[0086] As an implementation method, the second Bluetooth device may be in a pairing state, in which the first Bluetooth device and the second Bluetooth device can be scanned and searched as a Bluetooth combination, and can receive a classic Bluetooth connection request sent by an external terminal device. Optionally, in the pairing state, the second Bluetooth device can simultaneously turn on the inquiry scan mode and the page scan mode. In the inquiry scan mode, the second Bluetooth device allows scanning and searching by other devices, and in the page scan mode, the second Bluetooth device can receive and respond to classic Bluetooth connection requests sent by other devices. That is, when the second Bluetooth device is in a pairing state, the second Bluetooth device is in a discoverable state and a connectable state at the same time. The terminal device may be a device that has not previously established a classic Bluetooth connection with the second Bluetooth device, or a device that has previously established a classic Bluetooth connection but has not stored a corresponding connection record. The terminal device can scan the second Bluetooth device in the pairing state, thereby obtaining the device information of the second Bluetooth device (such as the classic Bluetooth address, the device name of the second Bluetooth device, etc.), and send a classic Bluetooth connection request to the second Bluetooth device according to the device information of the Bluetooth combination.
[0087] Optionally, the terminal device may scan the surrounding Bluetooth devices, and the second Bluetooth device in the pairing state may receive the scan request (inquiry request) sent by the terminal device, and return a scan response (inquiry response) to the terminal device. The terminal device may obtain the device information of the second Bluetooth device according to the received scan response. Further, the terminal device may display the device information of the second Bluetooth device, and the user may perform a connection operation for the device information to trigger the terminal device to connect to the second Bluetooth device through Bluetooth. The terminal device may respond to the connection operation for the device information of the second Bluetooth device and send a classic Bluetooth connection request to the Bluetooth device according to the device information of the second Bluetooth device. It should be noted that the first Bluetooth device and the second Bluetooth device are used as a Bluetooth combination, so the displayed device information may also include information of the entire Bluetooth combination, such as the name of the first Bluetooth device, or the name of the entire Bluetooth combination.
[0088] As another implementation, the terminal device may also be a device that has established a classic Bluetooth connection and paired with the second Bluetooth device, and the terminal device may store a connection record corresponding to the second Bluetooth device. The terminal device may obtain device information of the second Bluetooth device according to the connection record, and send a classic Bluetooth connection request to the second Bluetooth device according to the device information.
[0089] As a specific implementation, the above-mentioned classic Bluetooth connection request may be a paging data packet. The terminal device may send the paging data packet in a frequency hopping manner to page the second Bluetooth device. The second Bluetooth device in page scan mode may scan the paging data packets sent externally at fixed intervals, such as the paging data packets sent by the terminal device, that is, receive the classic Bluetooth connection request sent by the terminal device.
[0090] After receiving the classic Bluetooth connection request sent by the terminal device, the second Bluetooth device may respond to the classic Bluetooth connection request and establish a first classic Bluetooth connection with the terminal device. It should be noted that when the first Bluetooth device and the second Bluetooth device are in a pairing state, the first Bluetooth device may also turn on the inquiry scan mode and the page scan mode. As a slave Bluetooth device, the first Bluetooth device may not respond to the scan request, classic Bluetooth connection request, etc. sent by the terminal device.
[0091] In the combined use mode, the second Bluetooth device can also use the first BLE address to send a first LE Audio broadcast signal to establish a first LE Audio Bluetooth connection with the terminal device through the first LE Audio broadcast signal, that is, the second Bluetooth device simultaneously establishes a classic Bluetooth connection and a LE Audio Bluetooth connection with the terminal device.
[0092] In some embodiments, in order to enable the user to trigger a connection operation on the terminal device once to enable the terminal device to establish a first classic Bluetooth connection and a first LE Audio Bluetooth connection with the second Bluetooth device at the same time, the classic Bluetooth address configured for the second Bluetooth device may be the same as the first BLE address. The Bluetooth standard specifies a set of CTKD (Cross-Transport Key Derivation) schemes that can convert the keys of the BLE connection and the keys of the classic Bluetooth connection. In an embodiment of the present application, the first key used to encrypt the first LE Audio Bluetooth connection can be obtained by performing a CTKD process after the terminal device establishes a first classic Bluetooth connection with the second Bluetooth device, and converting the second key corresponding to the first classic Bluetooth connection.
[0093] After the terminal device establishes the first classic Bluetooth connection with the second Bluetooth device, it can perform the CTKD process to convert the second key corresponding to the classic Bluetooth connection (such as the pairing key link key, etc.) into the first key corresponding to the same BLE address (i.e., the first BLE address). After the terminal device receives the first LE Audio broadcast signal sent by the second Bluetooth device, since the first LE Audio broadcast signal corresponds to the first BLE address (the same as the classic Bluetooth address corresponding to the first classic Bluetooth connection), the terminal device can automatically initiate an LE Audio Bluetooth connection with the second Bluetooth device, send an LE Audio connection request to the second Bluetooth device, establish a first LE Audio Bluetooth connection with the second Bluetooth device, and send the generated first key to the second Bluetooth device.
[0094] In some embodiments, after the terminal device establishes a first classic Bluetooth connection with the second Bluetooth device, the terminal device may query the second Bluetooth device for the Bluetooth services supported by the second Bluetooth device, and determine whether the second Bluetooth device supports a secure connection function based on the query result returned by the second Bluetooth device, wherein the secure connection function can be used to indicate a function that can perform a pairing operation of a BLE connection based on a classic Bluetooth link. The secure connection function may refer to the secure connection function of classic Bluetooth, which can implement an SMP (secure manager protocol) process based on a classic Bluetooth link (such as an ACL link, etc.). If the terminal device determines that the second Bluetooth device supports the secure connection function, the CTKD process may be triggered to convert the second key corresponding to the first classic Bluetooth connection into the first key. The terminal device performs the CTKD process only when it determines that the second Bluetooth device supports the secure connection function, which can ensure the normal progress of the CTKD process and further improve the stability of the Bluetooth connection between the terminal device and the second Bluetooth device.
[0095] It should be noted that the establishment of the first classic Bluetooth connection mentioned above may include establishing a classic Bluetooth link, and the classic Bluetooth link may include but is not limited to ACL (Asynchronous Connectionless), SCO (Synchronous Connection Oriented) and other links. It is also possible to further establish service connections such as A2DP (Advanced Audio Distribution Profile, Bluetooth audio transmission model agreement) and HFP (Hands-free Profile) on the basis of the classic Bluetooth link to realize the transmission of service data such as audio data and voice data.
[0096] Step 504: The first Bluetooth device receives the first key sent by the second Bluetooth device.
[0097] The second Bluetooth device may send the first key to the first Bluetooth device. In some embodiments, in the combined use mode, the second Bluetooth device may be configured with a second Bluetooth address, which may include the above-mentioned classic Bluetooth address and the second BLE address, and the second BLE address may be different from the first BLE address. After the second Bluetooth device establishes a third LE Audio Bluetooth connection with the terminal device based on the first BLE address, the second Bluetooth device may obtain the device information of the terminal device, and store the first Bluetooth address, the first key and the device information of the terminal device accordingly. Further, the first BLE address, the first key and the device information of the terminal device may be stored accordingly. The device information of the terminal device may include, but is not limited to, one or more of the Bluetooth address, device name, MAC (Media Access Control) address, etc. of the terminal device.
[0098] Optionally, during the process of establishing the third LE Audio Bluetooth connection between the first Bluetooth device and the terminal device, a third key may be generated, and the third key is used to encrypt the third LE Audio Bluetooth connection. The first Bluetooth device may store the second BLE address, the third key, and the device information of the terminal device in correspondence.
[0099] For example, Fig. 6A FIG. 1 is a timing diagram of another embodiment in which a terminal device establishes LE Audio Bluetooth connections with a first Bluetooth device and a second Bluetooth device respectively. Fig. 6AAs shown, the above-mentioned second Bluetooth device may be the master headset in the headset device, and the first Bluetooth device may be the slave headset in the headset device. When the headset device is in binaural use mode, the headset device may enter the pairing state, the master headset may set the classic Bluetooth address and the first BLE address, the slave headset may set the second BLE address, and a Bluetooth connection may be established between the master headset and the slave headset. When the headset device is in the pairing state, the master headset may turn on the inquiry scan mode and the page scan mode at the same time, the terminal device may scan the master headset and obtain the device information of the headset device. The terminal device may display the device information of the headset device, and the user may perform a connection operation for the device information (such as clicking the connection button corresponding to the Bluetooth device) to trigger the terminal device to connect to the headset device through Bluetooth. In response to the connection operation, the terminal device may send a classic Bluetooth connection request to the master headset. The master headset may respond to the classic Bluetooth connection request sent by the terminal device, establish a classic Bluetooth connection with the terminal device, and the terminal device finds that the headset device supports BR secure connection (i.e., the above-mentioned secure connection function). The terminal device may perform the CTKD process and obtain LTK1 according to the link key analysis corresponding to the classic Bluetooth connection. The master headset can use the first BLE address to send a first LE Audio broadcast signal. The terminal device that receives the first LE Audio broadcast signal automatically initiates an LE Audio Bluetooth connection with the master headset and sends an LE Audio connection request to the master headset. The master headset and the terminal device can establish a first LE Audio Bluetooth connection, and use LTK1 to encrypt data transmitted through the first LE Audio Bluetooth connection. The slave headset can use the second BLE address to send a second LE Audio broadcast signal. The terminal device that receives the second LE Audio broadcast signal can also automatically initiate an LE Audio Bluetooth connection with the slave headset and send an LE Audio connection request to the slave headset. The slave headset and the terminal device can establish a third LE Audio Bluetooth connection and generate LTK2. LTK2 can be used to encrypt data transmitted through the third LE Audio Bluetooth connection. The master headset can send LTK1 to the slave headset, and the slave headset can store LTK1, the first BLE address, and the device information of the terminal device (such as the Bluetooth address) accordingly.
[0100] Step 506: When the first Bluetooth device is in the single-use mode, establish a second classic Bluetooth connection with the terminal device based on the classic Bluetooth address.
[0101] In some embodiments, when the first Bluetooth device detects a trigger to enter the single-use mode, it configures its own Bluetooth address to be the first Bluetooth address. One or more first trigger conditions for the first Bluetooth device to enter the single-use mode may be pre-set. If any of the first trigger conditions is detected to be met, it is determined that the first Bluetooth device is triggered to enter the single-use mode. Optionally, the first trigger condition may include but is not limited to one or more of the following:
[0102] Trigger condition 1: the first Bluetooth device disconnects the communication connection with the second Bluetooth device. When the first Bluetooth device is in single-use mode, the first Bluetooth device can disconnect the communication connection with the second Bluetooth device, and the two do not need to be used synchronously.
[0103] Trigger condition 2: the signal strength between the first Bluetooth device and the second Bluetooth device is less than the first strength threshold. If the signal strength between the first Bluetooth device and the second Bluetooth device is less than the first strength threshold, it means that the distance between the first Bluetooth device and the second Bluetooth device is too far, and the first Bluetooth device is triggered to enter the single use mode.
[0104] Trigger condition three: detecting a preset first trigger operation.
[0105] The first trigger operation may be set according to actual needs. For example, an interaction button may be provided on the first Bluetooth device, and the first trigger operation may be that the user single-clicks, long-presses, or double-clicks the interaction button, etc.; or, the first Bluetooth device may be the first earphone, and the first trigger operation may be placing the first earphone alone in an earphone box and triggering a pairing button on the earphone box, thereby triggering the first earphone to enter a single-use mode. The single-use mode includes a mode in which the first earphone enters a pairing state alone, etc., but is not limited to this.
[0106] In an embodiment of the present application, by setting the first trigger condition, it is possible to accurately detect that the first Bluetooth device is triggered to enter the single use mode, and update the Bluetooth address of the first Bluetooth device, thereby ensuring that the first Bluetooth device can accurately establish a Bluetooth connection with an external terminal device in the single use mode, and improving the stability of the Bluetooth connection.
[0107] In some embodiments, the single-use mode may include a mode in which the first Bluetooth device enters a pairing state alone, and when the first Bluetooth device is in the pairing state, it can be scanned and searched by a new electronic device. In order to ensure that each electronic device connected to the first Bluetooth device can normally perform the SMP process and the CTKD process with the first electronic device, the classic Bluetooth address and the BLE address of the first Bluetooth device must be consistent.
[0108] In the embodiment of the present application, the first Bluetooth device can be configured with a first BLE address and a classic Bluetooth address that is the same as the first BLE address. The terminal device that has previously been paired with the second Bluetooth device can directly send a classic Bluetooth connection request to the first Bluetooth device to establish a second classic Bluetooth connection with the first Bluetooth device. No pairing operation will be performed during this process, thereby improving the connection efficiency. Moreover, since the classic Bluetooth address of the first Bluetooth device is the same as the classic Bluetooth address of the second Bluetooth device, the terminal device will not display two connection records, thereby avoiding confusion for the user.
[0109] The first Bluetooth device can establish a second classic Bluetooth connection with the terminal device based on the configured classic Bluetooth address. It should be noted that the method of establishing the second classic Bluetooth connection can be similar to the method of establishing the first classic Bluetooth connection between the second Bluetooth device and the terminal device described in the above embodiment, and will not be repeated here.
[0110] Since the terminal device stores the connection record corresponding to the classic Bluetooth address, the CTKD process will not be performed again. The first key can be obtained from the connection record corresponding to the classic Bluetooth address, and the first key can be used to transmit data with the first Bluetooth device.
[0111] Step 508: The first Bluetooth device sends a target LE Audio broadcast signal based on the first BLE address, so that a terminal device that receives the target LE Audio broadcast signal establishes a second LE Audio Bluetooth connection with the first Bluetooth device.
[0112] Step 510: Perform data transmission with the terminal device through a second LE Audio Bluetooth connection according to the first key.
[0113] The description of steps 508 to 510 may refer to the relevant description in the above embodiments, and will not be repeated here.
[0114] In some embodiments, after the first Bluetooth device establishes a second classic Bluetooth connection with the terminal device, the first Bluetooth device may obtain the device information of the terminal device, and obtain the first key corresponding to the device information and the first BLE address of the terminal device according to the device information and the first BLE address of the terminal device. Since in the combined use mode, the first Bluetooth device stores the first key, the first BLE address and the device information of the terminal device that generates the first key sent by the second Bluetooth device, and since there may be multiple terminal devices connected to the second Bluetooth device, when the first Bluetooth device is in the single use mode, after the first Bluetooth device establishes a second classic Bluetooth connection with the terminal device, the device information of the currently connected terminal device may be queried locally, and the first key corresponding to the device information and the first BLE address of the terminal device may be obtained. The first Bluetooth device may configure the first key, and after establishing a second LE Audio Bluetooth connection with the terminal device, according to the first key, transmit data with the terminal device through the second LE Audio Bluetooth connection. The accuracy of the key configured by the first Bluetooth device can be guaranteed, and abnormalities in subsequent data transmission through the LE Audio Bluetooth connection can be avoided, further improving the stability of the LE Audio Bluetooth connection between the first Bluetooth device and the terminal device.
[0115] For example, Figure 6B FIG. 1 is a timing diagram of a Bluetooth communication method in another embodiment. Figure 6BAs shown, when the first Bluetooth device and the second Bluetooth device are in a combined use mode, the first Bluetooth device can be configured with a classic Bluetooth address and a first BLE address, and the second Bluetooth device can be configured with a second BLE address. The first Bluetooth device and the second Bluetooth device can establish a communication connection, and the second Bluetooth device can send the classic Bluetooth address and the first BLE address to the first Bluetooth device. It should be noted that if the first Bluetooth device has stored the classic Bluetooth address, the second Bluetooth device can also only send the first BLE address to the first Bluetooth device. The terminal device can turn on the scanning mode, which can be a mode that can scan surrounding Bluetooth devices and scan LE Audio broadcast signals sent by surrounding Bluetooth devices. The terminal device can establish a first classic Bluetooth connection with the second Bluetooth device. The second Bluetooth device can send a first LE Audio broadcast signal based on the first BLE address. The terminal device receives the first LE Audio broadcast signal and can establish a first LE Audio Bluetooth connection with the second Bluetooth device according to the first LE Audio broadcast signal, and generate a first key. The second Bluetooth device can send the first key to the first Bluetooth device. The terminal device and the second Bluetooth device can perform data transmission through the first LE Audio Bluetooth connection according to the first key, and can also perform data transmission through the first classic Bluetooth connection according to the second key. The first Bluetooth device can send a second LE Audio broadcast signal based on the second BLE address. After the terminal device receives the second LE Audio broadcast signal, it can establish a third LE Audio Bluetooth connection with the second Bluetooth device according to the second LE Audio broadcast signal and generate a third key. The terminal device and the first Bluetooth device can transmit data through the third LE Audio Bluetooth connection according to the third key.
[0116] When the first Bluetooth device is in single use mode, the first Bluetooth device can be configured with a classic Bluetooth address and a first BLE address, and send a target LE Audio broadcast signal based on the first BLE address. The terminal device receives the target LE Audio broadcast signal and can establish a second LE Audio Bluetooth connection with the second Bluetooth device based on the target LE Audio broadcast signal. The first Bluetooth device and the terminal device can use the first key to transmit data through the second LE Audio Bluetooth connection, and can also use the second key to transmit data through the second classic Bluetooth connection.
[0117] For example, Figure 6C FIG. 1 is a timing diagram of a Bluetooth communication method in another embodiment. Figure 6CAs shown, the above-mentioned second Bluetooth device may be the master headset in the headset device, and the first Bluetooth device may be the slave headset in the headset device. When the headset device is in binaural use mode, the master headset and the terminal device establish a first classic Bluetooth connection and a first LE Audio Bluetooth connection respectively, and the slave headset and the terminal device establish a third LE Audio Bluetooth connection. The master headset can send the LTK1 corresponding to the first LE Audio Bluetooth connection to the slave headset, and the slave headset can store the LTK1, the first BLE address and the device information of the terminal device (such as the Bluetooth address) accordingly. When the slave headset is in single use mode, the classic Bluetooth address and the first BLE address are configured, and the terminal device can send a classic Bluetooth connection request to the slave headset. The slave headset can respond to the classic Bluetooth connection request sent by the terminal device and establish a second classic Bluetooth connection with the terminal device. The slave headset can use the first BLE address to send the target LE Audio Bluetooth signal, and the terminal device that receives the target LE Audio broadcast signal automatically initiates the LE Audio Bluetooth connection with the slave headset, sends the LE Audio connection request to the slave headset, and the slave headset and the terminal device can establish a second LE Audio Bluetooth connection, and use LTK1 to encrypt or decrypt the data transmitted through the second LE Audio Bluetooth connection.
[0118] For example, Fig.6D FIG. 1 is a timing diagram of establishing an LE Audio Bluetooth connection between a terminal device and a first Bluetooth device in an embodiment. Fig.6D As shown, the first Bluetooth device may include a first headset, and the first headset may determine whether to enter the pairing state alone. If so, the LE Audio broadcast signal is sent using the first BLE address, and the first LTK (the above-mentioned first key) corresponding to the first BLE address is updated. If not, the LE Audio broadcast signal is sent using the second BLE address, and the second LTK corresponding to the second BLE address is updated. The terminal device that receives the LE Audio broadcast signal may initiate a LE Audio connection to the first headset, and the first headset may respond to the LE Audio connection initiated by the terminal device and establish an LE Audio connection with the terminal device. The terminal device may determine whether the first headset uses the first BLE address to establish an LE Audio Bluetooth connection. If so, the data is encrypted using the first LTK, and if not, the data is encrypted using the second LTK. The terminal device may send encrypted data to the first headset via the LE Audio Bluetooth connection, and the first headset may decrypt the data received using the current LTK, thereby realizing that the terminal device and the first headset can successfully establish an LE Audio Bluetooth connection and perform data transmission regardless of whether the first headset is in a single-ear use mode or a dual-ear use mode, thereby improving the stability of the LE Audio connection.
[0119] In some embodiments, if the first Bluetooth device detects a trigger to enter the combined use mode, it configures its own Bluetooth address to be a second Bluetooth address; wherein the second Bluetooth address includes a classic Bluetooth address and a second BLE address.
[0120] If the first Bluetooth device changes from single-use mode to combined-use mode, it can reset its own BLE address to the second BLE address. In some embodiments, one or more second trigger conditions for the first Bluetooth device to enter the combined-use mode can be pre-set. If any second trigger condition is detected to be met, it is determined that the first Bluetooth device is triggered to enter the combined-use mode. Optionally, the second trigger condition may include but is not limited to one or more of the following:
[0121] Trigger condition 1: The first Bluetooth device establishes a communication connection with the second Bluetooth device.
[0122] Trigger condition 2: the signal strength between the first Bluetooth device and the second Bluetooth device is greater than the second strength threshold. If the signal strength between the first Bluetooth device and the second Bluetooth device is greater than the second strength threshold, it means that the distance between the first Bluetooth device and the second Bluetooth device is relatively close, thus triggering the first Bluetooth device to enter the combined use mode.
[0123] Trigger condition three: detecting a preset second trigger operation.
[0124] The second trigger operation can be set according to actual needs. For example, an interaction button can be set on the first Bluetooth device, and the second trigger operation can be that the user single-clicks, long-presses, or double-clicks the interaction button, etc.; or, the first Bluetooth device can be the first earphone, and the second Bluetooth device can be the second earphone, and the second trigger operation can be that the first earphone and the second earphone are placed in the earphone box at the same time, and the pairing button on the earphone box is triggered; or, the second trigger operation can be that the user opens the earphone box, and the first earphone and the second earphone are placed in the earphone box, etc., but is not limited to this.
[0125] In an embodiment of the present application, by setting a second trigger condition, it is possible to accurately detect that the first Bluetooth device is triggered to enter the combined use mode, and update the Bluetooth address of the first Bluetooth device. The first Bluetooth device can flexibly switch between the single use mode and the combined use mode, and can accurately establish a Bluetooth connection with an external terminal device in all usage modes, thereby improving the accuracy and stability of the Bluetooth connection.
[0126] In an embodiment of the present application, in the combined use mode, the second Bluetooth device uses the first Bluetooth address to establish a first classic Bluetooth connection and a first LE Audio Bluetooth connection with the terminal device, and sends the first key corresponding to the first LE Audio Bluetooth connection to the first Bluetooth device for storage. When the first Bluetooth device is in the single use mode, the first Bluetooth device configures the first Bluetooth address and establishes a second classic Bluetooth connection and a second LE Audio Bluetooth connection with the terminal device, respectively, ensuring that the terminal device can directly complete the connection according to the previous connection record, improving the connection efficiency, and no new connection records will appear, avoiding user confusion, and maintaining the consistent user experience of LE audio and classic Bluetooth performance. After the first Bluetooth device establishes an LE Audio Bluetooth connection with the terminal device, data can be transmitted with the terminal device according to the first key, avoiding abnormal interaction of the LE Audio Bluetooth connection, and improving the stability of the LE Audio Bluetooth connection between the first Bluetooth device and the terminal device.
[0127] like Figure 7 As shown, in one embodiment, another Bluetooth communication method is provided, which can be applied to an earphone device, the earphone device includes a first earphone and a second earphone, and the method may include the following steps:
[0128] Step 710: When the headset device is in binaural use mode, the first headset receives the first Bluetooth address sent by the second headset, the second headset establishes a first LE Audio Bluetooth connection with the terminal device based on the first Bluetooth address, and sends a first key to the first headset; the first key is used to encrypt the first LE Audio Bluetooth connection. In binaural use mode, the first headset and the second headset are used in coordination and synchronization.
[0129] Step 720: When the first earphone is in single-ear usage mode, the first earphone establishes a second LE Audio Bluetooth connection with the terminal device based on the first Bluetooth address, and transmits data with the terminal device according to the first key.
[0130] In one embodiment, the first Bluetooth address includes a classic Bluetooth address and a first BLE address. Before the second headset establishes a first LE Audio Bluetooth connection with the terminal device based on the first Bluetooth address, the method further includes: when the headset device is in binaural use mode, the second headset establishes a first classic Bluetooth connection with the terminal device based on the classic Bluetooth address; the step of the second headset establishing a first LE Audio Bluetooth connection with the terminal device based on the first Bluetooth address includes: the second headset establishes a first LE Audio Bluetooth connection with the terminal device based on the first BLE address.
[0131] In one embodiment, the classic Bluetooth address is the same as the first BLE address; the first key is obtained by performing a CTKD process after the terminal device establishes a first classic Bluetooth connection with the second headset, and converting the second key corresponding to the first classic Bluetooth connection.
[0132] In one embodiment, the method further includes: when the headphone device is in binaural usage mode, the first headphone establishes a third LE Audio Bluetooth connection with the terminal device based on the second BLE address; wherein the second BLE address is different from the first BLE address.
[0133] In one embodiment, after the second headset sends the first key to the first headset, the method further includes: the second headset stores the first Bluetooth address, the first key and the device information of the terminal device in correspondence.
[0134] In one embodiment, the second earphone is a master earphone and the first earphone is a slave earphone.
[0135] In one embodiment, before the first headset establishes a second LE Audio Bluetooth connection with the terminal device based on the first Bluetooth address, the method also includes: when the first headset is in single-ear usage mode, the first headset establishes a second classic Bluetooth connection with the terminal device based on the classic Bluetooth address; the step of the first headset establishing a second LE Audio Bluetooth connection with the terminal device based on the first Bluetooth address, and transmitting data with the terminal device according to the first key may include: the first headset sends a target LE Audio broadcast signal based on the first BLE address, so that the terminal device that receives the target LE Audio broadcast signal establishes a second LE Audio Bluetooth connection with the first headset; the first headset transmits data with the terminal device through the second LE Audio Bluetooth connection according to the first key.
[0136] In one embodiment, after the first headset establishes a second classic Bluetooth connection with the terminal device based on the classic Bluetooth address, the method further includes: the first headset obtains a first key corresponding to the device information and the first BLE address of the terminal device according to the device information and the first BLE address of the terminal device.
[0137] In one embodiment, the step of, when the headphone device is in binaural use mode, the first headphone receives the first Bluetooth address sent by the second headphone, includes: when the headphone device is in binaural use mode, the first headphone establishes a communication connection with the second headphone, and the first headphone receives the first Bluetooth address sent by the second headphone; the method also includes: when the first headphone is in monaural use mode, the first headphone disconnects the communication connection with the second headphone.
[0138] In one embodiment, the single-ear usage mode includes a mode in which the first earphone enters a pairing state alone.
[0139] In one embodiment, before the first headset establishes a second LE Audio Bluetooth connection with the terminal device based on the first Bluetooth address, the method also includes: when the first headset detects a trigger to enter a single-ear usage mode, the first headset configures its own Bluetooth address to the first Bluetooth address; the method also includes: when the first headset detects a trigger to enter a dual-ear usage mode, the first headset configures its own Bluetooth address to the second Bluetooth address; wherein the second Bluetooth address includes a second BLE address.
[0140] It should be noted that the description of the Bluetooth communication method applied to the headphone device provided in the embodiment of the present application can refer to the relevant description of the Bluetooth communication method applied to the first Bluetooth device provided in the above embodiments, and will not be repeated here.
[0141] In an embodiment of the present application, in a dual-ear use mode, the second headset uses the first Bluetooth address to establish a first classic Bluetooth connection and a first LE Audio Bluetooth connection with the terminal device, and sends the first key corresponding to the first LE Audio Bluetooth connection to the first headset for storage. When the first headset is in a single-ear use mode, the first headset is configured with the first Bluetooth address to establish a second classic Bluetooth connection and a second LE Audio Bluetooth connection with the terminal device, respectively, ensuring that the terminal device can directly complete the connection based on the previous connection record, improving the connection efficiency, and no new connection records will appear, avoiding user confusion, and maintaining a consistent user experience of LE audio and classic Bluetooth performance. After the first headset establishes an LE Audio Bluetooth connection with the terminal device, data can be transmitted with the terminal device according to the first key, avoiding abnormal interaction of the LE Audio Bluetooth connection, and improving the stability of the LE Audio Bluetooth connection between the first headset and the terminal device.
[0142] like Figure 8 As shown, in one embodiment, a Bluetooth communication device 800 is provided, which can be applied to the first Bluetooth device mentioned above. The Bluetooth communication device 800 may include a receiving module 810 and a connecting module 820 .
[0143] The receiving module 810 is used to receive the first Bluetooth address and the first key sent by the second Bluetooth device when the first Bluetooth device is in a combined use mode; in the combined use mode, the first Bluetooth device and the second Bluetooth device are coordinated and used synchronously, and the second Bluetooth device establishes a first LE Audio Bluetooth connection with the terminal device based on the first Bluetooth address; the first key is used to encrypt the first LE Audio Bluetooth connection.
[0144] In one embodiment, the receiving module 810 is also used to establish a communication connection with the second Bluetooth device when the first Bluetooth device is in a combined use mode, and receive a first Bluetooth address sent by the second Bluetooth device; receive a first key sent by the second Bluetooth device, and the first key is sent after the second Bluetooth device establishes a first LE Audio Bluetooth connection with the terminal device.
[0145] In one embodiment, the Bluetooth communication device 800 further includes a disconnect module.
[0146] The disconnection module is used to disconnect the communication connection between the first Bluetooth device and the second Bluetooth device when the first Bluetooth device is in the single-use mode.
[0147] The connection module 820 is used to establish a second LE Audio Bluetooth connection with the terminal device based on the first Bluetooth address when the first Bluetooth device is in a single use mode, and to transmit data with the terminal device according to the first key.
[0148] In an embodiment of the present application, since in the combined use mode, the second Bluetooth device has successfully established a first LE Audio Bluetooth connection with the terminal device based on the first Bluetooth address, when the first Bluetooth device is in the single use mode, based on the first Bluetooth address, it can successfully establish a second LE Audio Bluetooth connection with the terminal device, thereby ensuring the successful establishment of the LE Audio Bluetooth connection between the first Bluetooth device and the terminal device; moreover, in the combined use mode, the second Bluetooth device will send the first key corresponding to the first LE Audio Bluetooth connection to the first Bluetooth device. When the first Bluetooth device is in the single use mode, after the first Bluetooth device establishes the LE Audio Bluetooth connection with the terminal device, it can transmit data with the terminal device according to the first key, thereby avoiding abnormal LE Audio Bluetooth connection interaction and improving the stability of the LE Audio Bluetooth connection between the first Bluetooth device and the terminal device.
[0149] In one embodiment, the first Bluetooth address includes a classic Bluetooth address and a first Bluetooth low energy BLE address. In the combined use mode, the second Bluetooth device establishes a first classic Bluetooth connection with the terminal device based on the classic Bluetooth address, and establishes a first LE Audio Bluetooth connection with the terminal device based on the first BLE address.
[0150] In one embodiment, the classic Bluetooth address is the same as the first BLE address; the first key is obtained by performing a CTKD process after the terminal device establishes a first classic Bluetooth connection with the second Bluetooth device, and converting the second key corresponding to the first classic Bluetooth connection.
[0151] In one embodiment, the connection module 820 is further used to establish a third LE Audio Bluetooth connection with the terminal device based on the second BLE address when the first Bluetooth device is in the combined use mode; wherein the second BLE address is different from the first BLE address.
[0152] In one embodiment, the Bluetooth communication device 800 further includes a storage module.
[0153] The storage module is used to store the first Bluetooth address, the first key and the device information of the terminal device in correspondence.
[0154] In one embodiment, the connection module 820 is also used to establish a second classic Bluetooth connection with the terminal device based on the classic Bluetooth address when the first Bluetooth device is in single use mode; and to send a target LE Audio broadcast signal based on the first BLE address so that the terminal device that receives the target LE Audio broadcast signal establishes a second LE Audio Bluetooth connection with the first Bluetooth device; and to transmit data with the terminal device through the second LE Audio Bluetooth connection according to the first key.
[0155] In one embodiment, the connection module 820 is further used to obtain a first key corresponding to the device information and the first BLE address of the terminal device according to the device information and the first BLE address of the terminal device after establishing a second classic Bluetooth connection with the terminal device based on the classic Bluetooth address.
[0156] In one embodiment, the single-use mode includes a mode in which the first Bluetooth device enters a pairing state alone.
[0157] In one embodiment, the Bluetooth communication device 800 further includes a configuration module.
[0158] A configuration module is used to configure its own Bluetooth address to a first Bluetooth address when the first Bluetooth device detects a trigger to enter a single-use mode; and to configure its own Bluetooth address to a second Bluetooth address when the first Bluetooth device detects a trigger to enter a combined use mode; wherein the second Bluetooth address includes a second BLE address.
[0159] In an embodiment of the present application, in the combined use mode, the second Bluetooth device uses the first Bluetooth address to establish a first classic Bluetooth connection and a first LE Audio Bluetooth connection with the terminal device, and sends the first key corresponding to the first LE Audio Bluetooth connection to the first Bluetooth device for storage. When the first Bluetooth device is in the single use mode, the first Bluetooth device configures the first Bluetooth address and establishes a second classic Bluetooth connection and a second LE Audio Bluetooth connection with the terminal device, respectively, ensuring that the terminal device can directly complete the connection according to the previous connection record, improving the connection efficiency, and no new connection records will appear, avoiding user confusion, and maintaining the consistent user experience of LE audio and classic Bluetooth performance. After the first Bluetooth device establishes an LE Audio Bluetooth connection with the terminal device, data can be transmitted with the terminal device according to the first key, avoiding abnormal interaction of the LE Audio Bluetooth connection, and improving the stability of the LE Audio Bluetooth connection between the first Bluetooth device and the terminal device.
[0160] like Fig. 9 As shown, in another embodiment, a Bluetooth communication device 900 is provided, which can be applied to the above-mentioned earphone device, and the earphone device includes a first earphone and a second earphone; the Bluetooth communication device 900 may include a binaural use module 910 and a monaural use module 920.
[0161] The binaural use module 910 is used to receive the first Bluetooth address sent by the second earphone through the first earphone when the earphone device is in the binaural use mode, establish a first LE Audio Bluetooth connection with the terminal device based on the first Bluetooth address through the second earphone, and send a first key to the first earphone; in the binaural use mode, the first earphone and the second earphone are coordinated and used synchronously; the first key is used to encrypt the first LE Audio Bluetooth connection.
[0162] The single-ear use module 920 is used to establish a second LE Audio Bluetooth connection with the terminal device based on the first Bluetooth address through the first earphone when the first earphone is in the single-ear use mode, and to transmit data with the terminal device according to the first key.
[0163] In one embodiment, the first Bluetooth address includes a classic Bluetooth address and a first BLE address. The binaural use module 910 is further configured to establish a first classic Bluetooth connection with the terminal device based on the classic Bluetooth address through the second headset when the headset device is in binaural use mode; and to establish a first LE Audio Bluetooth connection with the terminal device based on the first BLE address through the second headset.
[0164] In one embodiment, the classic Bluetooth address is the same as the first BLE address; the first key is obtained by performing a CTKD process after the terminal device establishes a first classic Bluetooth connection with the second headset, and converting the second key corresponding to the first classic Bluetooth connection.
[0165] In one embodiment, the binaural use module 910 is also used to establish a third LE Audio Bluetooth connection with the terminal device based on the second BLE address through the first headset when the headset device is in binaural use mode; wherein the second BLE address is different from the first BLE address.
[0166] In one embodiment, the binaural use module 910 is further configured to store the first Bluetooth address, the first key, and the device information of the terminal device in correspondence with each other through the second headset.
[0167] In one embodiment, the second earphone is a master earphone and the first earphone is a slave earphone.
[0168] In one embodiment, the single-ear use module 920 is also used to establish a second classic Bluetooth connection with the terminal device based on the classic Bluetooth address through the first earphone when the first earphone is in the single-ear use mode; and to send a target LE Audio broadcast signal based on the first BLE address through the first earphone, so that the terminal device that receives the target LE Audio broadcast signal establishes a second LE Audio Bluetooth connection with the first earphone; and to transmit data with the terminal device through the second LE Audio Bluetooth connection according to the first key through the first earphone.
[0169] In one embodiment, the single-ear use module 920 is also used to obtain, through the first headset, a first key corresponding to the device information and the first BLE address of the terminal device according to the device information and the first BLE address of the terminal device after the first headset establishes a second classic Bluetooth connection with the terminal device based on the classic Bluetooth address.
[0170] In one embodiment, the binaural use module 910 is further used to control the establishment of a communication connection between the first earphone and the second earphone when the earphone device is in the binaural use mode, and receive the first Bluetooth address sent by the second earphone through the first earphone.
[0171] The single-ear use module 920 is further configured to control the communication connection between the first earphone and the second earphone to be disconnected when the first earphone is in the single-ear use mode.
[0172] In one embodiment, the single-ear usage mode includes a mode in which the first earphone enters a pairing state alone.
[0173] In one embodiment, the single-ear use module 920 is further used to configure the Bluetooth address of the first earphone to be a first Bluetooth address when the first earphone detects a trigger to enter a single-ear use mode; the dual-ear use module 910 is further used to configure the Bluetooth address of the first earphone to be a second Bluetooth address when the first earphone detects a trigger to enter a dual-ear use mode; wherein the second Bluetooth address includes a second BLE address.
[0174] In an embodiment of the present application, in a dual-ear use mode, the second headset uses the first Bluetooth address to establish a first classic Bluetooth connection and a first LE Audio Bluetooth connection with the terminal device, and sends the first key corresponding to the first LE Audio Bluetooth connection to the first headset for storage. When the first headset is in a single-ear use mode, the first headset is configured with the first Bluetooth address to establish a second classic Bluetooth connection and a second LE Audio Bluetooth connection with the terminal device, respectively, ensuring that the terminal device can directly complete the connection based on the previous connection record, improving the connection efficiency, and no new connection records will appear, avoiding user confusion, and maintaining a consistent user experience of LE audio and classic Bluetooth performance. After the first headset establishes an LE Audio Bluetooth connection with the terminal device, data can be transmitted with the terminal device according to the first key, avoiding abnormal interaction of the LE Audio Bluetooth connection, and improving the stability of the LE Audio Bluetooth connection between the first headset and the terminal device.
[0175] Fig.10 FIG. 1 is a structural block diagram of a Bluetooth device in one embodiment. Fig.10 As shown, the Bluetooth device 1000 may include one or more of the following components: a processor 1010, and a memory 1020 coupled to the processor 1010, wherein the memory 1020 may store one or more computer programs, and the one or more computer programs may be configured to be executed by one or more processors 1010, so that the Bluetooth device 1000 implements the Bluetooth communication method applied to the first Bluetooth device as described in the above embodiments.
[0176] The processor 1010 may include one or more processing cores. The processor 1010 uses various interfaces and lines to connect the various parts of the entire Bluetooth device 1000, and executes various functions and processes data of the Bluetooth device 1000 by running or executing instructions, programs, code sets or instruction sets stored in the memory 1020, and calling data stored in the memory 1020. Optionally, the processor 1010 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 1010 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing display content; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 1010, but may be implemented separately through a communication chip.
[0177] The memory 1020 may include a random access memory (RAM) or a read-only memory (ROM). The memory 1020 may be used to store instructions, programs, codes, code sets or instruction sets. 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, 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 above-mentioned various method embodiments, etc. The data storage area may also store data created by the Bluetooth device 1000 during use, etc.
[0178] The Bluetooth device 1000 may also include a communication unit, such as a Bluetooth module, which may be used to provide Bluetooth communication functions, such as establishing a Bluetooth connection with a terminal device and performing Bluetooth data transmission. The Bluetooth module may support one or more Bluetooth protocols, such as classic Bluetooth, BLE, BLE Audio, etc., but is not limited thereto and may change with the development of the Bluetooth protocol.
[0179] An embodiment of the present application discloses an earphone device, including a memory, a processor and a communication unit. The memory stores a computer program. When the computer program is executed by the processor, the earphone device implements the Bluetooth communication method applied to the earphone device as described in the above embodiments.
[0180] An embodiment of the present application discloses a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor in an electronic device, the electronic device implements the Bluetooth communication method applied to a first Bluetooth device as described in the above embodiments.
[0181] An embodiment of the present application discloses a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor in an electronic device, the electronic device implements the Bluetooth communication method applied to a headphone device as described in the above embodiments.
[0182] An embodiment of the present application discloses a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program. When the computer program can be executed by a processor in an electronic device, the electronic device implements the Bluetooth communication method applied to a first Bluetooth device as described in the above embodiments.
[0183] An embodiment of the present application discloses a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program. When the computer program can be executed by a processor in an electronic device, the electronic device can implement the Bluetooth communication method applied to a headphone device as described in the above embodiments.
[0184] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a ROM, etc.
[0185] As used herein, any reference to memory, storage, database, or other medium may include nonvolatile and / or volatile memory. Suitable nonvolatile memory may include ROM, programmable ROM (Programmable ROM, PROM), erasable PROM (Erasable PROM, EPROM), electrically erasable PROM (Electrically Erasable PROM, EEPROM), or flash memory. Volatile memory may include random access memory (RAM), which is used as an external cache memory. By way of illustration and not limitation, RAM may be in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), memory bus direct RAM (RDRAM) and direct memory bus dynamic RAM (DRDRAM).
[0186] It should be understood that "one embodiment" or "an embodiment" mentioned throughout the specification means that specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. Those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present application. It should be noted that "multiple" in the present application includes "two or more".
[0187] In the various embodiments of the present application, it should be understood that the size of the serial numbers of the above-mentioned processes does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0188] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0189] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0190] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0191] The above is a detailed introduction to a Bluetooth communication method, device, electronic device and storage medium disclosed in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application. At the same time, for those of ordinary skill in the art, according to the idea of the present application, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present application. It is understandable that some technical features and technical means in the present application may also refer to the relevant provisions of the Bluetooth standard, or be combined with the relevant provisions in the Bluetooth standard.
Claims
1. A Bluetooth communication method, characterized in that: Applied to a first Bluetooth device, the method includes: When the first Bluetooth device is in a combined use mode, receiving a first Bluetooth address and a first key sent by a second Bluetooth device; in the combined use mode, the first Bluetooth device and the second Bluetooth device are used in coordination and synchronization, and the second Bluetooth device establishes a first LE Audio Bluetooth connection with a terminal device based on the first Bluetooth address; the first key is used to encrypt the first LE Audio Bluetooth connection; When the first Bluetooth device is in single use mode, a second LE Audio Bluetooth connection is established with the terminal device based on the first Bluetooth address, and data is transmitted with the terminal device according to the first key.
2. The method according to claim 1, characterized in that The first Bluetooth address includes a classic Bluetooth address and a first Bluetooth low energy BLE address. In the combined use mode, the second Bluetooth device establishes a first classic Bluetooth connection with the terminal device based on the classic Bluetooth address, and establishes a first LE Audio Bluetooth connection with the terminal device based on the first BLE address.
3. The method according to claim 2, characterized in that The classic Bluetooth address is the same as the first BLE address; the first key is obtained by converting the second key corresponding to the first classic Bluetooth connection through a cross-transmission key derivation CTKD process after the terminal device establishes the first classic Bluetooth connection with the second Bluetooth device.
4. The method according to claim 2, characterized in that: The method further comprises: When the first Bluetooth device is in combined use mode, the first Bluetooth device establishes a third LE Audio Bluetooth connection with the terminal device based on a second BLE address; wherein the second BLE address is different from the first BLE address.
5. The method according to claim 4, characterized in that After receiving the first Bluetooth address and the first key sent by the second Bluetooth device, the method further includes: The first Bluetooth address, the first key and the device information of the terminal device are stored correspondingly.
6. The method according to any one of claims 2 to 5, characterized in that: Before establishing a second LE Audio Bluetooth connection with the terminal device based on the first Bluetooth address, the method further includes: When the first Bluetooth device is in single use mode, establishing a second classic Bluetooth connection with the terminal device based on the classic Bluetooth address; The establishing a second LE Audio Bluetooth connection with the terminal device based on the first Bluetooth address, and performing data transmission with the terminal device according to the first key, includes: Send a target LE Audio broadcast signal based on the first BLE address, so that the terminal device that receives the target LE Audio broadcast signal establishes a second LE Audio Bluetooth connection with the first Bluetooth device; Data is transmitted with the terminal device through the second LE Audio Bluetooth connection according to the first key.
7. The method according to claim 6, characterized in that After establishing a second classic Bluetooth connection with the terminal device based on the classic Bluetooth address, the method further includes: According to the device information of the terminal device and the first BLE address, a first key corresponding to the device information of the terminal device and the first BLE address is obtained.
8. The method according to any one of claims 1 to 5, characterized in that: The step of receiving a first Bluetooth address and a first key sent by a second Bluetooth device when the first Bluetooth device is in a combined use mode includes: When the first Bluetooth device is in the combined use mode, establishing a communication connection with the second Bluetooth device, and receiving a first Bluetooth address sent by the second Bluetooth device; Receive a first key sent by the second Bluetooth device, where the first key is sent after the second Bluetooth device establishes the first LE Audio Bluetooth connection with the terminal device.
9. The method according to claim 8, characterized in that The method further comprises: When the first Bluetooth device is in the single-use mode, the communication connection with the second Bluetooth device is disconnected.
10. The method according to any one of claims 1 to 5 and 9, characterized in that: The single-use mode includes a mode in which the first Bluetooth device enters a pairing state alone.
11. The method according to any one of claims 1 to 5 and 9, characterized in that: Before establishing a second LE Audio Bluetooth connection with the terminal device based on the first Bluetooth address, the method further includes: When the first Bluetooth device detects a trigger to enter the single-use mode, configuring its own Bluetooth address to be the first Bluetooth address; The method further comprises: When the first Bluetooth device detects a trigger to enter the combined use mode, it configures its own Bluetooth address to be a second Bluetooth address; wherein the second Bluetooth address includes a second BLE address.
12. The method according to any one of claims 1 to 5 and 9, characterized in that: In the combined use mode, the second Bluetooth device is a master Bluetooth device, and the first Bluetooth device is a slave Bluetooth device.
13. A Bluetooth communication method, characterized in that: Applied to an earphone device, the earphone device includes a first earphone and a second earphone; the method includes: When the earphone device is in binaural use mode, the first earphone receives a first Bluetooth address sent by the second earphone, the second earphone establishes a first LE Audio Bluetooth connection with the terminal device based on the first Bluetooth address, and sends a first key to the first earphone; in the binaural use mode, the first earphone and the second earphone are used in coordination and synchronization; the first key is used to encrypt the first LE Audio Bluetooth connection; When the first earphone is in a single-ear usage mode, the first earphone establishes a second LE Audio Bluetooth connection with the terminal device based on the first Bluetooth address, and transmits data with the terminal device according to the first key.
14. The method according to claim 13, characterized in that The first Bluetooth address includes a classic Bluetooth address and a first BLE address; before the second headset establishes a first LE Audio Bluetooth connection with the terminal device based on the first Bluetooth address, the method further includes: When the earphone device is in binaural use mode, the second earphone establishes a first classic Bluetooth connection with the terminal device based on the classic Bluetooth address; The second headset establishes a first LE Audio Bluetooth connection with the terminal device based on the first Bluetooth address, including: The second headset establishes a first LE Audio Bluetooth connection with the terminal device based on the first BLE address.
15. The method according to claim 14, characterized in that The classic Bluetooth address is the same as the first BLE address; the first key is obtained by converting the second key corresponding to the first classic Bluetooth connection through a cross-transmission key derivation CTKD process after the terminal device establishes the first classic Bluetooth connection with the second headset.
16. The method according to claim 14, characterized in that The method further comprises: When the headphone device is in binaural usage mode, the first headphone establishes a third LE Audio Bluetooth connection with the terminal device based on a second BLE address; wherein the second BLE address is different from the first BLE address.
17. The method according to claim 16, characterized in that After the second headset sends the first key to the first headset, the method further includes: The second headset stores the first Bluetooth address, the first key, and the device information of the terminal device correspondingly.
18. The method according to any one of claims 14 to 17, characterized in that: Before the first headset establishes a second LE Audio Bluetooth connection with the terminal device based on the first Bluetooth address, the method further includes: When the first earphone is in single-ear usage mode, the first earphone establishes a second classic Bluetooth connection with the terminal device based on the classic Bluetooth address; The first headset establishes a second LE Audio Bluetooth connection with the terminal device based on the first Bluetooth address, and performs data transmission with the terminal device according to the first key, including: The first headset sends a target LE Audio broadcast signal based on the first BLE address, so that the terminal device that receives the target LE Audio broadcast signal establishes a second LE Audio Bluetooth connection with the first headset; The first headset performs data transmission with the terminal device through the second LE Audio Bluetooth connection according to the first key.
19. The method according to claim 18, characterized in that After the first headset establishes a second classic Bluetooth connection with the terminal device based on the classic Bluetooth address, the method further includes: The first headset obtains a first key corresponding to the device information of the terminal device and the first BLE address according to the device information of the terminal device and the first BLE address.
20. The method according to any one of claims 13 to 17, characterized in that: When the earphone device is in a binaural use mode, the first earphone receives a first Bluetooth address sent by the second earphone, including: When the earphone device is in a binaural use mode, the first earphone establishes a communication connection with the second earphone, and the first earphone receives a first Bluetooth address sent by the second earphone; The method further comprises: When the first earphone is in the single-ear usage mode, the first earphone disconnects the communication connection with the second earphone.
21. The method according to any one of claims 13 to 17, characterized in that: The single-ear usage mode includes a mode in which the first earphone enters a pairing state alone.
22. The method according to any one of claims 13 to 17, characterized in that: Before the first headset establishes a second LE Audio Bluetooth connection with the terminal device based on the first Bluetooth address, the method further includes: When the first earphone detects a trigger to enter the single-ear usage mode, the first earphone configures its own Bluetooth address to be the first Bluetooth address; The method further comprises: When the first earphone detects a trigger to enter the binaural usage mode, the first earphone configures its own Bluetooth address as a second Bluetooth address; wherein the second Bluetooth address includes a second BLE address.
23. The method according to any one of claims 13 to 17, characterized in that: In the binaural usage mode, the second earphone is a slave earphone, and the first earphone is a master earphone.
24. A Bluetooth communication device, characterized in that: Applied to a first Bluetooth device, the apparatus comprises: a receiving module, configured to receive a first Bluetooth address and a first key sent by a second Bluetooth device when the first Bluetooth device is in a combined use mode; in the combined use mode, the first Bluetooth device and the second Bluetooth device are used in coordination and synchronization, and the second Bluetooth device establishes a first LE Audio Bluetooth connection with a terminal device based on the first Bluetooth address; the first key is used to encrypt the first LE Audio Bluetooth connection; A connection module is used to establish a second LE Audio Bluetooth connection with the terminal device based on the first Bluetooth address when the first Bluetooth device is in a single use mode, and to transmit data with the terminal device according to the first key.
25. A Bluetooth communication device, characterized in that: Applied to an earphone device, the earphone device comprises a first earphone and a second earphone; the device comprises: A binaural use module, configured to, when the headphone device is in a binaural use mode, receive, through the first headphone, a first Bluetooth address sent by the second headphone, establish a first LE Audio Bluetooth connection with the terminal device based on the first Bluetooth address through the second headphone, and send a first key to the first headphone; in the binaural use mode, the first headphone and the second headphone are used in coordination and synchronization; the first key is used to encrypt the first LE Audio Bluetooth connection; A single-ear use module is used to establish a second LE Audio Bluetooth connection with the terminal device based on the first Bluetooth address through the first earphone when the first earphone is in a single-ear use mode, and to transmit data with the terminal device according to the first key.
26. An electronic device, characterized in that: The electronic device comprises a memory, a processor and a communication unit, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the electronic device implements the method according to any one of claims 1 to 12 or 13 to 23.
27. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor in an electronic device, the electronic device implements the method according to any one of claims 1 to 12 or 13 to 23.