Bluetooth communication method and device, earphone equipment, electronic equipment and storage medium
By pre-storing key data in Bluetooth devices and directly transmitting data, the problem of slow connection speed in existing Bluetooth is solved, especially when the speed is significantly improved when the first connection is connected.
Patent Information
- Application Number
- CN202311213993.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-19
- Publication Date
- 2025-03-21
AI Technical Summary
Existing Bluetooth connection speeds are slow, especially when connecting for the first time, a pairing process is required, resulting in a longer connection time.
By pre-storing key data in the Bluetooth device, the pairing process is avoided when establishing a Bluetooth connection, and data transmission is directly based on the pre-stored key data.
Reduces the pairing process during Bluetooth connection, saves connection time, and improves Bluetooth connection speed, especially when the first connection is significantly faster.
Smart Images

Figure CN119676680A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a Bluetooth communication method and device, an earphone device, an electronic device, and a storage medium. Background Art
[0002] Bluetooth technology is a short-range wireless technology that can provide low-cost short-range wireless connections and realize various types of data transmission. At present, most electronic devices are equipped with Bluetooth communication functions, and Bluetooth technology has become one of the mainstream communication technologies supported by most electronic devices on the market. However, there is still room for improvement in the current Bluetooth connection speed. Summary of the invention
[0003] The embodiments of the present application disclose a Bluetooth communication method and apparatus, a headset device, an electronic device, and a storage medium, which can save time in the Bluetooth connection process and improve the Bluetooth connection speed between two Bluetooth devices.
[0004] The present application embodiment discloses a Bluetooth communication method, which is applied to a first Bluetooth device, and the method includes:
[0005] receiving a Bluetooth connection signal sent by a second Bluetooth device, and establishing a Bluetooth connection with the second Bluetooth device according to the Bluetooth connection signal; no pairing process is performed during the process of establishing the Bluetooth connection, and the Bluetooth connection includes an initial Bluetooth connection and a non-initial Bluetooth connection;
[0006] Based on the pre-stored key data, data is transmitted with the second Bluetooth device via the Bluetooth connection; the second Bluetooth device also pre-stores the key data.
[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, and the method includes:
[0008] The first earphone receives a Bluetooth connection signal sent by the second earphone, and establishes a Bluetooth connection with the second earphone according to the Bluetooth connection signal; no pairing process is performed during the process of establishing the Bluetooth connection, and the Bluetooth connection includes a first Bluetooth connection and a non-first Bluetooth connection;
[0009] The first earphone and the second earphone perform data transmission through the Bluetooth connection based on pre-stored key data.
[0010] The present application embodiment discloses a Bluetooth communication device, which is applied to a first Bluetooth device, and the device includes:
[0011] a connection module, configured to receive a Bluetooth connection signal sent by a second Bluetooth device, and establish a Bluetooth connection with the second Bluetooth device according to the Bluetooth connection signal; a pairing process is not performed during the process of establishing the Bluetooth connection, and the Bluetooth connection includes an initial Bluetooth connection and a non-initial Bluetooth connection;
[0012] The transmission module is used to transmit data with the second Bluetooth device through the Bluetooth connection based on the pre-stored key data; the second Bluetooth device also pre-stores the key data.
[0013] The embodiment of the present application discloses an earphone device, including a first earphone and a second earphone, wherein:
[0014] The first earphone is used to receive a Bluetooth connection signal sent by the second earphone, and establish a Bluetooth connection with the second earphone according to the Bluetooth connection signal; no pairing process is performed during the process of establishing the Bluetooth connection, and the Bluetooth connection includes a first Bluetooth connection and a non-first Bluetooth connection;
[0015] The first headset is further configured to perform data transmission with the second headset via the Bluetooth connection based on pre-stored key data;
[0016] The second headset is used to perform data transmission with the first headset through the Bluetooth connection based on pre-stored key data.
[0017] 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.
[0018] 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.
[0019] The embodiments of the present application disclose a Bluetooth communication method and apparatus, a headset device, an electronic device, and a storage medium. A first Bluetooth device receives a Bluetooth connection signal sent by a second Bluetooth device, and establishes a Bluetooth connection with the second Bluetooth device according to the Bluetooth connection signal. Since key data is pre-stored in the first Bluetooth device and the second Bluetooth device, no pairing process is required during the establishment of the Bluetooth connection. The Bluetooth connection includes a first Bluetooth connection and a non-first Bluetooth connection. The first Bluetooth device and the second Bluetooth device can transmit data through the established Bluetooth connection based on the pre-stored key data. The pairing process is reduced during the Bluetooth connection process, the time of the Bluetooth connection process is saved, and the Bluetooth connection speed between the two Bluetooth devices is improved. In particular, for the first Bluetooth connection between the first Bluetooth device and the second Bluetooth device, the speed of establishing the Bluetooth connection is significantly improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] 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.
[0021] Figure 1A A schematic diagram of a process of establishing a classic Bluetooth connection between a left earphone and a right earphone in the related art;
[0022] Figure 1B A schematic diagram of the process of establishing a BLE connection between a left earphone and a right earphone in the related art;
[0023] Figure 2A An application scenario diagram of a Bluetooth communication method in an embodiment;
[0024] Figure 2B It is an application scenario diagram of the Bluetooth communication method in another embodiment;
[0025] Figure 3 is a flow chart of a Bluetooth communication method in one embodiment;
[0026] Figure 4 A schematic diagram of a process of establishing a classic Bluetooth connection and performing Bluetooth communication between a first Bluetooth device and a second Bluetooth device in one embodiment;
[0027] Figure 5 A schematic diagram of a timing sequence of establishing a classic Bluetooth connection and performing Bluetooth communication between a first Bluetooth device and a second Bluetooth device in an embodiment;
[0028] Figure 6 A schematic diagram of a process of establishing a BLE connection and performing Bluetooth communication between a first Bluetooth device and a second Bluetooth device in an embodiment;
[0029] Figure 7 A timing diagram of a first Bluetooth device establishing a BLE connection and performing Bluetooth communication with a second Bluetooth device in one embodiment;
[0030] Figure 8 is a flow chart of a Bluetooth communication method in another embodiment;
[0031] Fig.9A A schematic diagram of presetting key data by burning on a production line in one embodiment;
[0032] Fig. 9B A schematic diagram of presetting key data by sending it through an earphone box in one embodiment;
[0033] Fig.10 It is a timing diagram of the earphone box verifying the key data stored in the earphone in one embodiment;
[0034] Fig.11 is a flow chart of a Bluetooth communication method in another embodiment;
[0035] Fig.12 is a block diagram of a Bluetooth communication device in one embodiment;
[0036] Fig.13 FIG. 4 is a structural block diagram of a Bluetooth device in an embodiment. DETAILED DESCRIPTION
[0037] 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.
[0038] 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.
[0039] 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 one element from another. For example, without departing from the scope of this application, the second earphone may be referred to as the first earphone, and similarly, the first earphone may be referred to as the second earphone. The second earphone and the first earphone are both earphones, but they are not the same earphone. The term "plurality" used in this application refers to two or more. The term "and / or" used in this application refers to one of the solutions, or any combination of multiple solutions.
[0040] In the related art, when two Bluetooth devices establish a Bluetooth connection for the first time, in order to improve the security of Bluetooth communication, a pairing process is required during the establishment of the Bluetooth connection. The pairing process can be understood as a process in which the two Bluetooth devices negotiate an encryption key. The two Bluetooth devices generate a key during the pairing process. In subsequent Bluetooth communications, the two parties can use the generated key to communicate to ensure the security of Bluetooth communication.
[0041] At present, the Bluetooth connection established between two Bluetooth devices mainly includes classic Bluetooth connection and BLE (Bluetooth Low Energy Technology) connection. The classic Bluetooth connection usually refers to the connection established based on Bluetooth technology below Bluetooth protocol 4.0, and the BLE connection usually refers to the connection established based on Bluetooth technology 4.0 and above. At present, whether it is a classic Bluetooth connection or a BLE connection, when two Bluetooth devices establish a Bluetooth connection for the first time, a pairing process is required.
[0042] Taking the establishment of a Bluetooth connection between the left earphone and the right earphone in a pair of earphones as an example, illustratively, Figure 1A The figure is a schematic diagram of the process of establishing a classic Bluetooth connection between a left earphone and a right earphone in the related art. Figure 1A As shown, the right earphone can actively initiate a page (paging) to the left earphone. After the left earphone receives the page data packet sent by the right earphone, it establishes an ACL (Asynchronous Connection-oriented Link) link with the right earphone. Then the left earphone and the right earphone perform a pairing process to generate a key. The pairing methods of classic Bluetooth connections may include a simple secure pairing (Secure Simple Pairing) and a secure connection (Secure Connections) mode. Subsequently, the left earphone and the right earphone can encrypt the transmitted data based on the generated key (which can be direct encryption or indirect encryption) to ensure the security of Bluetooth communication.
[0043] For example, Figure 1BThe figure is a schematic diagram of the process of establishing a BLE connection between a left earphone and a right earphone in the related art. Figure 1B As shown, the right earphone can actively send BLE broadcasts to the outside, and the left earphone starts BLE scanning. After scanning the BLE broadcast sent by the right earphone, a BLE connection can be initiated to the right earphone, so that the left earphone and the right earphone establish a BLE ACL link. Then the left earphone and the right earphone can interact and generate a key based on the SMP (Security Manager Protocol). Subsequently, the left earphone and the right earphone can encrypt the transmitted data based on the generated key (which can be direct encryption or indirect encryption) to ensure the security of Bluetooth communication.
[0044] Figure 2A FIG. 1 is an application scenario diagram of a Bluetooth communication method in an embodiment. Figure 2A As shown, key data may be pre-stored in the first Bluetooth device 210 and the second Bluetooth device 220. The key data may be used to encrypt data when the first Bluetooth device 210 and the second Bluetooth device 220 perform Bluetooth communication, thereby ensuring the security of Bluetooth communication.
[0045] The first Bluetooth device 210 may include but is not limited to mobile phones, vehicle terminals, wearable devices, speaker devices, Bluetooth headsets, smart home devices and other electronic devices that support Bluetooth communication functions. The second Bluetooth device 220 may include but is not limited to mobile phones, vehicle terminals, wearable devices, speaker devices, Bluetooth headsets, smart home devices and other electronic devices that support Bluetooth communication functions.
[0046] In some embodiments, the first Bluetooth device 210 and the second Bluetooth device 220 may be Bluetooth devices of the same product model, or the first Bluetooth device 210 and the second Bluetooth device 220 may be Bluetooth devices belonging to the same Bluetooth set, data synchronization may be achieved between Bluetooth devices belonging to the same Bluetooth set, Bluetooth devices belonging to the same Bluetooth set may establish a Bluetooth connection with an external electronic device as a whole and perform data transmission, and data synchronization is maintained between the various Bluetooth devices in the same Bluetooth set. For example, the first Bluetooth device 210 and the second Bluetooth device 220 may form a pair of headphone devices, such as a TWS (True Wireless Stereo) headset, the first Bluetooth device 210 may be a left headset and the second Bluetooth device may be a right headset, or the first Bluetooth device 210 may be a right headset and the second Bluetooth device may be a left headset, and the embodiment of the present application is not limited to this.
[0047] The first Bluetooth device 210 can receive a Bluetooth connection signal sent by the second Bluetooth device 220, and establish a Bluetooth connection with the second Bluetooth device 220 according to the Bluetooth connection signal. Since the first Bluetooth device 210 and the second Bluetooth device 220 can pre-store key data, no pairing process is performed during the process of establishing the Bluetooth connection between the first Bluetooth device 210 and the second Bluetooth device 220. Regardless of whether it is the first Bluetooth connection between the first Bluetooth device 210 and the second Bluetooth device 220 or not the first Bluetooth connection, the time consumed by the pairing process during the Bluetooth connection process is saved, thereby improving the Bluetooth connection speed between the two Bluetooth devices.
[0048] After the first Bluetooth device 210 and the second Bluetooth device 220 establish a Bluetooth connection, the first Bluetooth device 210 and the second Bluetooth device 220 may perform data transmission through the Bluetooth connection based on pre-stored key data to ensure the security of Bluetooth communication.
[0049] In some embodiments, the key data pre-stored in the first Bluetooth device 210 and the second Bluetooth device 220 may be sent to the first Bluetooth device 210 and the second Bluetooth device 220 by other devices / apparatuses. Figure 2B FIG. 1 is an application scenario diagram of the Bluetooth communication method in another embodiment. Figure 2B As shown, the first Bluetooth device 210 is a first earphone, and the second Bluetooth device 220 is a second earphone. The first earphone and the second earphone can be used as a pair of earphones. Key data is pre-stored in the first earphone and the second earphone, and the key data can be used for data encryption of Bluetooth communication between the first earphone and the second earphone.
[0050] The key data pre-stored in the first headset and the second headset may be sent by the headset box 230. When the first headset establishes a communication connection with the headset box 230, the headset box 230 may send the key data to the first headset, and the first headset may store the key data sent by the headset box 230. When the second headset establishes a communication connection with the headset box 230, the headset box 230 may send the key data to the second headset, and the second headset may store the key data sent by the headset box 230.
[0051] When the first earphone receives the Bluetooth connection signal sent by the second earphone, a Bluetooth connection can be established with the second earphone according to the Bluetooth connection signal. Since the first earphone and the second earphone both store key data in advance, no pairing process is performed during the Bluetooth connection establishment.
[0052] like Figure 3 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:
[0053] Step 310: receiving a Bluetooth connection signal sent by a second Bluetooth device, and establishing a Bluetooth connection with the second Bluetooth device according to the Bluetooth connection signal; and no pairing process is performed during the process of establishing the Bluetooth connection.
[0054] In the embodiment of the present application, key data may be pre-stored in the first Bluetooth device and the second Bluetooth device, and the key data may be used to encrypt the transmitted data during the Bluetooth communication process to ensure the security of the Bluetooth communication. The key data stored in the first Bluetooth device and the second Bluetooth device are the same, and both parties use the same key to encrypt data during the Bluetooth communication process, and can normally decrypt the encrypted data transmitted by the other party, thereby ensuring the accuracy and stability of data transmission.
[0055] When the second Bluetooth device needs to establish a Bluetooth connection with the first Bluetooth device, it can send a Bluetooth connection signal. After the first Bluetooth device receives the Bluetooth connection signal sent by the second Bluetooth device, it can establish a Bluetooth connection with the second Bluetooth device according to the Bluetooth connection signal. Since the first Bluetooth device and the second Bluetooth device both store key data in advance, they do not need to negotiate the key used for Bluetooth communication encryption during the process of establishing the Bluetooth connection, that is, no pairing process is performed during the process of establishing the Bluetooth connection.
[0056] In the embodiment of the present application, the Bluetooth connection may include the first Bluetooth connection and the non-first Bluetooth connection, wherein the first Bluetooth connection refers to the first time that the first Bluetooth device and the second Bluetooth device establish a Bluetooth connection, and may include the first time that the first Bluetooth device and the second Bluetooth device establish a Bluetooth connection after leaving the factory, and the first Bluetooth device and the second Bluetooth device establish a Bluetooth connection once after the first Bluetooth device and the second Bluetooth device are restored to the factory configuration, etc.; the non-first Bluetooth connection refers to the first Bluetooth device and the second Bluetooth device not establishing a Bluetooth connection for the first time, that is, the first Bluetooth device and the second Bluetooth device have established a Bluetooth connection before. In the related art, when the first Bluetooth device and the second Bluetooth device establish a Bluetooth connection for the first time, a pairing process must be performed to negotiate the key for the subsequent Bluetooth communication between the two. In the embodiment of the present application, since the key data is pre-stored in the first Bluetooth device and the second Bluetooth device, even if the first Bluetooth device and the second Bluetooth device establish a Bluetooth connection for the first time, there is no need to perform a pairing process, which improves the speed of establishing a Bluetooth connection.
[0057] Step 320: Based on the pre-stored key data, data is transmitted with the second Bluetooth device via the Bluetooth connection; the second Bluetooth device also pre-stores the key data.
[0058] After the first Bluetooth device successfully establishes a Bluetooth connection with the second Bluetooth device, data transmission can be performed based on the pre-stored key data. When the first Bluetooth device needs to send data to the second Bluetooth device, the data can be encrypted based on the pre-stored key data, and then the encrypted data is sent to the second Bluetooth device. The second Bluetooth device receives the encrypted data sent by the first Bluetooth device, and can decrypt the encrypted data according to the pre-stored key data to obtain the data sent by the first Bluetooth device. Furthermore, the pre-stored key data may include a public key and a private key. When the first Bluetooth device needs to send data to the second Bluetooth device, the data can be encrypted based on the pre-stored public key, and then the encrypted data is sent to the second Bluetooth device. The second Bluetooth device receives the encrypted data sent by the first Bluetooth device, and can decrypt the encrypted data according to the pre-stored private key to obtain the data sent by the first Bluetooth device.
[0059] Similarly, when the second Bluetooth device needs to send data to the first Bluetooth device, it can encrypt the data based on the pre-stored key data and then send the encrypted data to the first Bluetooth device. The first Bluetooth device receives the encrypted data sent by the first Bluetooth device and can decrypt the encrypted data according to the pre-stored key data to obtain the data sent by the second Bluetooth device.
[0060] Optionally, the above encryption method may include direct encryption or indirect encryption, etc. Direct encryption may refer to directly encrypting data using pre-stored key data, and indirect encryption may refer to generating another key based on pre-stored key data and encrypting data using the generated key, thereby ensuring the security of Bluetooth communication.
[0061] In an embodiment of the present application, a first Bluetooth device receives a Bluetooth connection signal sent by a second Bluetooth device, and establishes a Bluetooth connection with the second Bluetooth device based on the Bluetooth connection signal. Since key data is pre-stored in the first Bluetooth device and the second Bluetooth device, there is no need to perform a pairing process during the establishment of the Bluetooth connection. The Bluetooth connection includes a first Bluetooth connection and a non-first Bluetooth connection. The first Bluetooth device and the second Bluetooth device can transmit data through the established Bluetooth connection based on the pre-stored key data. The pairing process is reduced during the Bluetooth connection process, the time of the Bluetooth connection process is saved, and the Bluetooth connection speed between the two Bluetooth devices is improved. In particular, for the first Bluetooth connection between the first Bluetooth device and the second Bluetooth device, the speed of establishing the Bluetooth connection is significantly improved.
[0062] In some embodiments, when the connection types of the Bluetooth connection established between the second Bluetooth device and the first Bluetooth device are different, the second Bluetooth device may send different Bluetooth connection signals, and the different connection types may refer to Bluetooth connections established based on different Bluetooth communication protocols. Optionally, the Bluetooth connection established between the second Bluetooth device and the first Bluetooth device may include a classic Bluetooth connection or a BLE connection, wherein the classic Bluetooth connection is a connection established based on Bluetooth technology below Bluetooth protocol 4.0, and the BLE connection is a connection established based on Bluetooth technology above Bluetooth protocol 4.0.
[0063] The connection type of the Bluetooth connection established between the second Bluetooth device and the first Bluetooth device can be determined according to the Bluetooth protocols supported by the second Bluetooth device and the first Bluetooth device. For example, if either the second Bluetooth device or the first Bluetooth device only supports Bluetooth protocols below 4.0, a classic Bluetooth connection can be established between the two; if either the second Bluetooth device or the first Bluetooth device only supports Bluetooth protocols 4.0 and above, a BLE connection can be established between the two. Optionally, the connection type of the Bluetooth connection established between the second Bluetooth device and the first Bluetooth device can also be set according to actual needs. For example, if both support all Bluetooth protocols (including Bluetooth protocols below 4.0 and Bluetooth protocols 4.0 and above), the second Bluetooth device can be configured to establish a classic Bluetooth connection with the first Bluetooth device, or a BLE connection, or both a classic Bluetooth connection and a BLE connection (i.e., the first Bluetooth device and the second Bluetooth device support Bluetooth dual-mode) according to actual needs.
[0064] In some embodiments, a classic Bluetooth connection may be established between the second Bluetooth device and the first Bluetooth device, and the Bluetooth connection signal sent by the second Bluetooth device may include a paging signal. Figure 4 FIG. 1 is a flow chart of a first Bluetooth device and a second Bluetooth device establishing a classic Bluetooth connection and performing Bluetooth communication in one embodiment. Figure 4 As shown, the above-mentioned Bluetooth communication method may include the following steps:
[0065] Step 402: Receive a paging signal sent by the second Bluetooth device, and establish a classic Bluetooth connection with the second Bluetooth device according to the paging signal; and do not perform a pairing process during the process of establishing the classic Bluetooth connection.
[0066] The second Bluetooth device can send a paging signal to the first Bluetooth device. The first Bluetooth device receives the paging signal sent by the second Bluetooth device and can establish a classic Bluetooth connection with the second Bluetooth device according to the Bluetooth paging signal.
[0067] Furthermore, the second Bluetooth device may pre-store device information of the first Bluetooth device, and the device information may include but is not limited to the classic Bluetooth address, device name, etc. of the first Bluetooth device. The second Bluetooth device may send a paging signal to the first Bluetooth device based on the device information of the first Bluetooth device. Optionally, the second Bluetooth device may send a paging signal to the first Bluetooth device in a frequency hopping manner. The first Bluetooth device may be in a page scan mode, and the first Bluetooth device in page scan mode may scan the paging signal sent externally at a fixed first time interval, so that the paging signal sent by the second Bluetooth device can be received. After receiving the paging signal sent by the second Bluetooth device, the first Bluetooth device may respond to the paging signal and establish a classic Bluetooth connection with the second Bluetooth device.
[0068] Since the first Bluetooth device and the second Bluetooth device pre-store keys for classic Bluetooth communication encryption, such as link keys, there is no need to negotiate the link keys during the process of establishing a classic Bluetooth connection between the first Bluetooth device and the second Bluetooth device, that is, there is no need to perform a classic Bluetooth pairing process, such as a simple security pairing process, a pairing process in a secure connection mode, etc. The classic Bluetooth connection may include a first classic Bluetooth connection and a non-first classic Bluetooth connection, that is, no matter it is a first classic Bluetooth connection or a non-first classic Bluetooth connection, there is no need to perform a classic Bluetooth pairing process, thereby saving time in establishing a classic Bluetooth connection.
[0069] Step 404: Based on the pre-stored link key, data is transmitted with the second Bluetooth device through the classic Bluetooth connection; the second Bluetooth device also pre-stores the link key.
[0070] After the first Bluetooth device and the second Bluetooth device successfully establish a classic Bluetooth connection, data transmitted through the classic Bluetooth connection may be encrypted according to a pre-stored link key to ensure the security of communication of the classic Bluetooth connection.
[0071] For example, Figure 5 FIG. 1 is a timing diagram of a first Bluetooth device and a second Bluetooth device establishing a classic Bluetooth connection and performing Bluetooth communication in an embodiment. Figure 5As shown, taking the first Bluetooth device as the first earphone and the second Bluetooth device as the second earphone as an example, the second earphone can actively initiate a page (paging) to the left earphone. After the first earphone receives the page data packet sent by the second earphone, it establishes an ACL link with the second earphone. The first earphone and the second earphone can transmit data based on the pre-stored LinkKey through the established classic Bluetooth connection to verify the security of Bluetooth communication. The second earphone can encrypt the transmitted data based on the pre-stored Link Key, and send the encrypted data to the first earphone. The first earphone can decrypt the received data based on the pre-stored Link Key to obtain the data sent by the second earphone. Similarly, the first earphone can encrypt the transmitted data based on the pre-stored Link Key, and send the encrypted data to the second earphone. The second earphone can decrypt the received data based on the pre-stored Link Key to obtain the data sent by the first earphone. Compared to Figure 1A The related technology shown omits the process of pairing and generating keys during the process of establishing a classic Bluetooth connection, thereby speeding up the establishment of the classic Bluetooth connection.
[0072] In the embodiment of the present application, since the link key is pre-stored in both the first Bluetooth device and the second Bluetooth device, there is no need to perform a pairing process in the process of establishing a classic Bluetooth connection, which saves the time of the Bluetooth connection process, improves the speed of establishing a classic Bluetooth connection between the two Bluetooth devices, and ensures the security of Bluetooth communication. In particular, for the first classic Bluetooth connection between the first Bluetooth device and the second Bluetooth device, the speed of establishing a classic Bluetooth connection is significantly improved, which improves the user experience.
[0073] In some embodiments, a BLE connection may be established between the second Bluetooth device and the first Bluetooth device, and the Bluetooth connection signal sent by the second Bluetooth device may include a BLE broadcast signal. Figure 6 FIG. 1 is a flow chart of a first Bluetooth device establishing a BLE connection with a second Bluetooth device and performing Bluetooth communication in one embodiment. Figure 6 As shown, the above-mentioned Bluetooth communication method may further include the following steps:
[0074] Step 602: Receive a BLE broadcast signal sent by a second Bluetooth device, and establish a BLE Bluetooth connection with the second Bluetooth device according to the BLE broadcast signal; and do not perform a pairing process during the process of establishing the BLE Bluetooth connection.
[0075] The second Bluetooth device may send a BLE broadcast signal, and the first Bluetooth device may turn on the BLE scanning mode to scan and obtain the BLE broadcast signal sent by the second Bluetooth device. Optionally, in the BLE scanning mode, the first Bluetooth device may use a fixed second time interval to scan the BLE broadcast signal sent externally, and establish a BLE Bluetooth connection with the second Bluetooth device based on the received BLE broadcast signal.
[0076] In some embodiments, the first Bluetooth device may pre-store device information of the second Bluetooth device, and the device information may include but is not limited to the BLE address, device name, etc. of the second Bluetooth device. The second Bluetooth device may send a BLE broadcast signal based on its own BLE address, and the BLE broadcast signal may carry the BLE address of the second Bluetooth device. After the first Bluetooth device receives the BLE broadcast signal sent by the second Bluetooth device, it may extract the BLE address carried by the BLE broadcast signal, and compare the extracted BLE address with the stored BLE address of the second Bluetooth device. If it is determined that the two are consistent, a BLE connection request is sent to the second Bluetooth device, and the second Bluetooth device receives the BLE connection request sent by the first Bluetooth device, responds to the BLE connection request, and thus establishes a BLE connection.
[0077] Since the first Bluetooth device and the second Bluetooth device pre-store keys for BLE communication encryption, such as LTK (Long Term Key), there is no need to generate LTK during the process of establishing a BLE connection between the first Bluetooth device and the second Bluetooth device, that is, there is no need to perform a BLE pairing process, such as a pairing process based on SMP to generate LTK. The BLE connection may include an initial BLE connection and a non-initial BLE connection, that is, no matter it is an initial BLE connection or a non-initial BLE connection, there is no need to perform a BLE pairing process, thereby saving time in establishing a BLE connection.
[0078] Step 604: Based on the pre-stored LTK, data is transmitted with the second Bluetooth device via the BLE connection; the second Bluetooth device also pre-stores the LTK.
[0079] After the first Bluetooth device and the second Bluetooth device successfully establish a BLE connection, data transmitted through the BLE connection may be encrypted according to the pre-stored LTK to ensure the security of the communication of the BLE connection.
[0080] For example, Figure 7 FIG. 1 is a timing diagram of a first Bluetooth device establishing a BLE connection with a second Bluetooth device and performing Bluetooth communication in an embodiment. Figure 5As shown, taking the first Bluetooth device as the first earphone and the second Bluetooth device as the second earphone as an example, the second earphone can send a BLE broadcast, the first earphone can turn on the BLE scanning mode, and scan to obtain the BLE broadcast sent by the second earphone. After the first earphone receives the BLE broadcast sent by the second earphone, it can initiate a BLE connection to the second earphone and establish an ACL link with the second earphone. The first earphone and the second earphone can transmit data through the established BLE connection based on the pre-stored LTK to verify the security of Bluetooth communication. The second earphone can encrypt the transmitted data based on the pre-stored LTK, and send the encrypted data to the first earphone. The first earphone can decrypt the received data based on the pre-stored LTK to obtain the data sent by the second earphone. Similarly, the first earphone can encrypt the transmitted data based on the pre-stored LTK, and send the encrypted data to the second earphone. The second earphone can decrypt the received data based on the pre-stored LTK to obtain the data sent by the first earphone. Compared to Figure 1B The related technology shown omits the process of generating keys based on SMP interaction during the process of establishing a BLE connection, thereby speeding up the establishment of the BLE connection.
[0081] In the embodiment of the present application, since the LTK is pre-stored in both the first Bluetooth device and the second Bluetooth device, there is no need to perform a pairing process in the process of establishing a BLE connection, which saves the time of the Bluetooth connection process, improves the speed of establishing a BLE connection between the two Bluetooth devices, and ensures the security of Bluetooth communication. In particular, for the first BLE connection between the first Bluetooth device and the second Bluetooth device, the speed of establishing a BLE connection is significantly improved, which improves the user experience.
[0082] like Figure 8 As shown, in another 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:
[0083] Step 802: Receive a Bluetooth connection signal sent by a second Bluetooth device.
[0084] Step 804: determine, based on the Bluetooth connection signal, that the first Bluetooth device and the second Bluetooth device belong to the same Bluetooth set, and establish a Bluetooth connection with the second Bluetooth device based on the Bluetooth connection signal; and do not perform a pairing process during the process of establishing the Bluetooth connection.
[0085] Step 806: Based on the pre-stored key data, data is transmitted with the second Bluetooth device via the Bluetooth connection; the second Bluetooth device also pre-stores the key data.
[0086] In some embodiments, the first Bluetooth device and the second Bluetooth device are Bluetooth devices of the same product model; and / or, the first Bluetooth device and the second Bluetooth device belong to the same Bluetooth set.
[0087] Optionally, the same product model may be electronic products of the same model produced in the same batch, such as Bluetooth speakers produced in the same batch, etc.; it may also be electronic products of the same model produced in different batches, such as smart watches of the same model produced in different batches; or it may be electronic products of the same model that can be used together, such as left earphones and right earphones that can be used together. Different Bluetooth devices of the same product model may pre-store the same key data, and when a first Bluetooth device of the same product model establishes a Bluetooth connection with a second Bluetooth device, communication encryption may be performed based on the pre-stored same key data, and therefore, no pairing process is performed during the process of establishing the Bluetooth connection.
[0088] As an implementation method, the Bluetooth connection signal sent by the second Bluetooth device may carry product model information. After the first Bluetooth device receives the Bluetooth connection signal sent by the second Bluetooth device, the Bluetooth connection signal may be parsed to obtain the product model information of the second Bluetooth device, and determine whether the product model information of the second Bluetooth device is consistent with its own product model information. If they are consistent, it is determined that the second Bluetooth device and the first Bluetooth device belong to the same product model. Therefore, no pairing process is performed when establishing a Bluetooth connection. In subsequent data transmission, the transmitted data is encrypted using pre-stored key data to ensure communication security.
[0089] As another implementation, each Bluetooth device belonging to the same product model may store the Bluetooth addresses of other Bluetooth devices of the same product model. The Bluetooth connection signal sent by the second Bluetooth device may carry the Bluetooth address of the second Bluetooth device. After receiving the Bluetooth connection signal sent by the second Bluetooth device, the first Bluetooth device may parse the Bluetooth connection signal to obtain the Bluetooth address of the second Bluetooth device, and determine whether the Bluetooth address obtained by parsing matches the pre-stored Bluetooth address. If there is a pre-stored Bluetooth address that matches the Bluetooth address obtained by parsing, it is determined that the second Bluetooth device and the first Bluetooth device belong to the same product model, so the pairing process is not performed when establishing the Bluetooth connection, and in subsequent data transmission, the pre-stored key data is used to encrypt the transmitted data to ensure communication security.
[0090] For example, taking the first Bluetooth device as the first headset and the second Bluetooth device as the second headset as an example, the first headset and the second headset can store each other's Bluetooth addresses. When the first headset receives the Bluetooth connection signal sent by the second headset, the Bluetooth address of the second headset is determined according to the Bluetooth connection signal, and it is determined to be the same as the pre-stored Bluetooth address of the second headset. It is considered that the second headset and the first headset are the same product model and both have the same key data pre-stored. Therefore, the pairing process is not performed when the Bluetooth connection is established. When the first headset and the second headset subsequently communicate via Bluetooth, the pre-stored key data can be used to encrypt the transmitted data to ensure communication security. Moreover, since the first Bluetooth device is determined to be the same product model as the second Bluetooth device, there will be no Bluetooth compatibility issues, and communication security and communication stability are basically guaranteed.
[0091] Optionally, if the first Bluetooth device is determined to be a different product model from the second Bluetooth device, a pairing process can be performed during the process of establishing a Bluetooth connection with the second Bluetooth device to generate a key for Bluetooth communication encryption, thereby ensuring communication security and data transmission stability.
[0092] The first Bluetooth device and the second Bluetooth device belong to the same Bluetooth set, which means that the first Bluetooth device and the second Bluetooth device can be used in conjunction with each other, and data synchronization can be achieved between the first Bluetooth device and the second Bluetooth device. Different Bluetooth devices belonging to the same Bluetooth set can pre-store the same key data. When the first Bluetooth device and the second Bluetooth device belonging to the same Bluetooth set establish a Bluetooth connection, communication encryption can be performed based on the pre-stored same key data. Therefore, the pairing process is not performed during the process of establishing the Bluetooth connection.
[0093] In some embodiments, each Bluetooth device in the same Bluetooth set may be configured with the same set identifier, which can be used to identify the Bluetooth set to which the Bluetooth device belongs, and the set identifier may be composed of one or more of numbers, letters, and symbols. The Bluetooth connection signal sent by the second Bluetooth device may carry the set identifier. After the first Bluetooth device receives the Bluetooth connection signal sent by the second Bluetooth device, it may parse the Bluetooth connection signal to obtain the set identifier corresponding to the second Bluetooth device, and determine whether the set identifier corresponding to the second Bluetooth device is consistent with the set identifier corresponding to itself. If they are consistent, it is determined that the second Bluetooth device and the first Bluetooth device belong to the same Bluetooth set, so the pairing process is not performed when establishing the Bluetooth connection, and in subsequent data transmission, the transmitted data is encrypted using the pre-stored key data to ensure communication security.
[0094] In some embodiments, each Bluetooth device belonging to the same Bluetooth set may store the Bluetooth addresses of other Bluetooth devices in the same Bluetooth set. The Bluetooth connection signal sent by the second Bluetooth device may carry the Bluetooth address of the second Bluetooth device. After the first Bluetooth device receives the Bluetooth connection signal sent by the second Bluetooth device, if it is determined based on the Bluetooth connection signal that the Bluetooth address corresponding to the second Bluetooth device is pre-stored in the first electronic device, it is determined that the first Bluetooth device and the second Bluetooth device belong to the same Bluetooth set. The first Bluetooth device can parse the Bluetooth connection signal to obtain the Bluetooth address of the second Bluetooth device, and determine whether the Bluetooth address obtained by the analysis matches the pre-stored Bluetooth address. If there is a pre-stored Bluetooth address that matches the Bluetooth address obtained by the analysis, it is determined that the second Bluetooth device and the first Bluetooth device belong to the same Bluetooth set. Therefore, the pairing process is not performed when establishing a Bluetooth connection, and in subsequent data transmission, the transmitted data is encrypted using the pre-stored key data to ensure communication security.
[0095] For example, taking the first Bluetooth device as the first earphone and the second Bluetooth device as the second earphone as an example, the first earphone and the second earphone may store each other's Bluetooth addresses. When the first earphone receives a Bluetooth connection signal sent by the second earphone, the Bluetooth address of the second earphone is determined according to the Bluetooth connection signal, and if it is determined to be the same as the pre-stored Bluetooth address of the second earphone, it is considered that the second earphone and the first earphone belong to the same Bluetooth set (that is, the same pair of earphones) and both have the same key data pre-stored. Therefore, the pairing process is not performed when establishing a Bluetooth connection. When the first earphone and the second earphone subsequently communicate via Bluetooth, the pre-stored key data can be used to encrypt the transmitted data to ensure communication security.
[0096] Optionally, if the first Bluetooth device determines that it does not belong to the same Bluetooth set as the second Bluetooth device, a pairing process may be performed during the process of establishing a Bluetooth connection with the second Bluetooth device to generate a key for Bluetooth communication encryption.
[0097] In an embodiment of the present application, the same key data is pre-stored in Bluetooth devices belonging to the same product model and / or belonging to the same Bluetooth set, which can reduce the pairing process during the Bluetooth connection process, save the time of the Bluetooth connection process, and improve the Bluetooth connection speed between the two Bluetooth devices. Only Bluetooth devices belonging to the same product model and / or belonging to the same Bluetooth set do not need to be paired, further ensuring the security of Bluetooth communications.
[0098] In some embodiments, the key data stored in the first Bluetooth device may be burned into the first Bluetooth device during the production process of the first Bluetooth device. Similarly, the key data stored in the second Bluetooth device may be burned into the second Bluetooth device during the production process of the second Bluetooth device. During the production process of the first Bluetooth device and the second Bluetooth device, the production line may burn the same key data into the memory (such as non-volatile memory) in the first Bluetooth device and the second Bluetooth device by burning, so that the first Bluetooth device and the second Bluetooth device store the same key data. Therefore, when the two establish a Bluetooth connection for the first time, there is no need to perform a pairing process, which not only improves the Bluetooth connection speed but also ensures the security of Bluetooth communication.
[0099] Fig.9A FIG. 1 is a schematic diagram of presetting key data by burning on a production line in an embodiment. Fig.9A As shown, taking the first Bluetooth device and the second Bluetooth device as the left earphone and the right earphone as an example, the same key data is preset into the left earphone and the right earphone by burning on the production line. When the left earphone and the right earphone establish a Bluetooth connection, there is no need to perform a pairing process.
[0100] In an embodiment of the present application, key data can be preset into the first Bluetooth device and the second Bluetooth device by burning on the production line, so that the first Bluetooth device and the second Bluetooth device do not need to perform a pairing process when establishing a Bluetooth connection, thereby saving time of the Bluetooth connection process and improving the Bluetooth connection speed between the two Bluetooth devices.
[0101] In some embodiments, the key data stored in the first Bluetooth device and the second Bluetooth device may be sent and stored by a supporting device of the first Bluetooth device and the second Bluetooth device. The supporting device may refer to a device used in conjunction with the first Bluetooth device and the second Bluetooth device. For example, if the first Bluetooth device is a first headset and the second Bluetooth device is a second headset, the supporting device may be an earphone box; or, if the first Bluetooth device is a first speaker and the second Bluetooth device is a second speaker, the supporting device may be a speaker remote control, etc., but is not limited to this.
[0102] As a specific implementation, the first Bluetooth device includes a first earphone, and the second Bluetooth device includes a second earphone. When the first earphone establishes a communication connection with the earphone box, the first earphone receives key data sent by the earphone box and stores the key data. The key data is burned into the earphone box during the production process of the earphone box.
[0103] During the production process of the earphone box, the production line can burn the key data into a memory (such as a non-volatile memory) in the earphone box by burning, so that the earphone box stores the key data. When the first earphone establishes a communication connection with the earphone box, the earphone box can send the stored key data to the first earphone, and the first earphone can store the key data after receiving the key data sent by the earphone box. Similarly, when the second earphone establishes a communication connection with the earphone box, the earphone box can send the stored key data to the second earphone, and the second earphone can store the key data after receiving the key data sent by the earphone box.
[0104] Optionally, when the first earphone is placed in the earphone box, if the earphone box is in an open state, the first earphone establishes a communication connection with the earphone box. When the second earphone is placed in the earphone box, if the earphone box is in an open state, the second earphone establishes a communication connection with the earphone box.
[0105] Furthermore, when the first earphone establishes a communication connection with the earphone box for the first time, the key data sent by the earphone box is received. When the first earphone establishes a communication connection with the earphone box for the first time, the earphone box sends the stored key data to the first earphone, and when the second earphone establishes a communication connection with the earphone box for the first time, the earphone box sends the stored key data to the second earphone. For example, the user opens the lid of the earphone box and puts the first earphone and the second earphone into the earphone box for the first time. When the earphone box establishes a communication connection with the first earphone and the second earphone for the first time after the lid is opened, the earphone box sends the stored key data (that is, the key data burned by the earphone box on the production line) to the first earphone and the second earphone respectively. When the earphone establishes a communication connection with the earphone box for the first time, the earphone box sends the key data to the earphone, which can ensure that the key data has been stored before the two earphones establish a Bluetooth connection for the first time, thereby ensuring that the pairing process does not need to be performed when the two earphones establish a Bluetooth connection for the first time.
[0106] It should be noted that the communication method between the earphone box and the first earphone and the second earphone is not limited to the above-mentioned contact communication method (such as connection through pins), but can also be other wireless communication methods (such as Bluetooth communication, optical communication, etc.), which is not limited in the embodiment of the present application.
[0107] Fig. 9B FIG. 1 is a schematic diagram of presetting key data by sending it through an earphone box in an embodiment. Fig. 9B As shown, taking the first Bluetooth device and the second Bluetooth device as the left earphone and the right earphone as an example, the key data is preset into the earphone box by burning on the production line, and then sent by the earphone box to the left earphone and the right earphone for storage respectively. When the left earphone and the right earphone establish a Bluetooth connection, there is no need to perform a pairing process.
[0108] In an embodiment of the present application, key data can be preset into the earphone box by burning on the production line, and then sent by the earphone box to the first Bluetooth device and the second Bluetooth device respectively and stored, so that the first Bluetooth device and the second Bluetooth device do not need to perform a pairing process when establishing a Bluetooth connection, thereby saving the time of the Bluetooth connection process and improving the Bluetooth connection speed between the two Bluetooth devices.
[0109] In one embodiment, the above method may also include: when the first earphone establishes a communication connection with the earphone box, sending the key data stored in the first earphone to the earphone box, so that the earphone box receives the key data stored in the first earphone, and compares the key data stored in the first earphone with the key data burned in the earphone box; if the key data stored in the first earphone is different from the key data burned in the earphone box, sending the burned key data to the first earphone; the first earphone receives the burned key data sent by the earphone box, and updates the key data stored in the first earphone to the burned key data.
[0110] Since the key data of the headset may be modified in the event of an unexpected change, such as when certain abnormal errors occur that cause the key stored in the headset to be modified, the headset box can be used to verify the key data stored in the headset. When the first headset establishes a communication connection with the headset box, the first headset can send its own stored key data to the headset box. After the headset box receives the key data sent by the first headset, it can compare the key data with the key data burned by the headset box on the production line to determine whether the two are consistent. If the two are inconsistent, it means that the key data stored in the first headset is wrong, and the headset box can send its own stored key data (that is, the key data burned by the headset box on the production line) to the first headset. After the first headset receives the key data sent by the headset box, it can update its own stored key data to the latest received key data (that is, the key data burned by the headset box on the production line).
[0111] If the key data sent by the first earphone is consistent with the key data burned by the earphone box on the production line, it means that the key data stored in the first earphone is correct. The earphone box can reply key confirmation information to the first earphone, and the key confirmation information is used to indicate that the key is correct.
[0112] Similarly, when the second earphone establishes a communication connection with the earphone box, the earphone box can also verify the key data stored in the second earphone to determine whether the key data stored in the second earphone is correct. The specific verification method can be similar to the method in which the earphone box verifies the key data stored in the first earphone in the above embodiment, and will not be repeated here.
[0113] Fig.10 FIG. 1 is a timing diagram of an embodiment of an earphone box verifying key data stored in an earphone. Fig.10As shown, the earphone (the first earphone and / or the second earphone) is connected to the earphone box for communication, and the earphone sends the stored key data to the earphone box. After receiving the key data sent by the earphone, the earphone box verifies the key data to determine whether it is correct. If it is determined that the key data stored in the earphone is wrong, the earphone box can send its own stored key data (i.e., the key data burned by the earphone box on the production line) to the earphone, and the earphone can be updated according to the key data sent by the earphone box. If it is determined that the key data stored in the earphone is correct, the earphone box can send key confirmation information to the earphone.
[0114] In the embodiment of the present application, the earphone box can be used to verify the key data stored in the earphone to ensure that the key data stored in the earphone is correct, thereby ensuring the stability and accuracy of Bluetooth communication between the first earphone and the second earphone.
[0115] like Fig.11 As shown, in one embodiment, another Bluetooth communication method is provided, which can be applied to a headset device, the headset device includes a first headset and a second headset, the first headset can be a left headset, the second headset can be a right headset, or the first headset can be a right headset, the second headset can be a left headset, which is not limited here. The Bluetooth communication method may include the following steps:
[0116] Step 1110: the first earphone receives a Bluetooth connection signal sent by the second earphone, and establishes a Bluetooth connection with the second earphone according to the Bluetooth connection signal; no pairing process is performed during the process of establishing the Bluetooth connection. The Bluetooth connection includes the first Bluetooth connection and the non-first Bluetooth connection.
[0117] Step 1120: The first headset and the second headset perform data transmission via a Bluetooth connection based on the pre-stored key data.
[0118] In some embodiments, the Bluetooth connection signal includes a Bluetooth paging signal, and the key data includes a link key; step 1110 includes: the first earphone receives the Bluetooth paging signal sent by the second earphone, and establishes a classic Bluetooth connection with the second earphone according to the Bluetooth paging signal; step 1120 includes: the first earphone and the second earphone transmit data through the classic Bluetooth connection based on the pre-stored link key.
[0119] In some embodiments, the Bluetooth connection signal includes a BLE broadcast signal, and the key data includes an LTK; step 1110 includes: the first earphone receives the BLE broadcast signal sent by the second earphone, and establishes a BLE connection with the second earphone based on the BLE broadcast signal; step 1120 includes: the first earphone and the second earphone transmit data through the BLE connection based on the pre-stored LTK.
[0120] In some embodiments, the Bluetooth connection signal carries a Bluetooth address corresponding to the second headset; the step of establishing a Bluetooth connection with the second headset according to the Bluetooth connection signal includes: if the first headset determines according to the Bluetooth connection signal that the Bluetooth address corresponding to the second headset is pre-stored in the first headset, then establishing a Bluetooth connection with the second headset.
[0121] In some embodiments, the key data is burned into the first headset and the second headset during the production process of the first headset and the second headset.
[0122] In some embodiments, the headphone device also includes an headphone box; before step 1110, the method also includes: when the headphone box establishes a communication connection with the first headphone, the headphone box sends key data to the first headphone, the first headphone receives the key data sent by the headphone box, and stores the key data; when the headphone box establishes a communication connection with the second headphone, the headphone box sends key data to the second headphone, the second headphone receives the key data sent by the headphone box, and stores the key data; wherein the key data is burned into the headphone box during the production process of the headphone box.
[0123] In some embodiments, the step of the headphone box sending key data to the first headphone when the headphone box establishes a communication connection with the first headphone includes: when the headphone box establishes a communication connection with the first headphone for the first time, the headphone box sends the key data to the first headphone; the step of the headphone box sending key data to the second headphone when the headphone box establishes a communication connection with the second headphone includes: when the headphone box establishes a communication connection with the second headphone for the first time, the headphone box sends the key data to the second headphone.
[0124] In some embodiments, in the step of establishing a communication connection between the earphone box and the first earphone, before the earphone box sends key data to the first earphone, the method further includes: when the first earphone is placed in the earphone box, if the earphone box is in an open state, the first earphone establishes a communication connection with the earphone box.
[0125] In some embodiments, before the step of the earphone box sending key data to the second earphone, the second earphone receiving the key data sent by the earphone box, and storing the key data, the method also includes: when the second earphone is placed in the earphone box, if the earphone box is in an open state, the second earphone establishes a communication connection with the earphone box.
[0126] In some embodiments, the method also includes: when the target earphone establishes a communication connection with the earphone box, sending the key data stored in the target earphone to the earphone box; the target earphone is any one of the first earphone and the second earphone; the earphone box receives the key data stored in the target earphone, and compares the key data stored in the target earphone with the key data burned in the earphone box, if the key data stored in the target earphone is different from the key data burned in the earphone box, sending the burned key data to the target earphone; the target earphone receives the burned key data sent by the earphone box, and updates the key data stored in the target earphone to the burned key data.
[0127] 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.
[0128] In the embodiment of the present application, since key data is pre-stored in the first earphone and the second earphone, there is no need to perform a pairing process during the establishment of the Bluetooth connection. The Bluetooth connection includes a first Bluetooth connection and a non-first Bluetooth connection. The first earphone and the second earphone can transmit data through the established Bluetooth connection based on the pre-stored key data, which reduces the pairing process during the Bluetooth connection process, saves the time of the Bluetooth connection process, and improves the Bluetooth connection speed between the two Bluetooth devices. In particular, for the first Bluetooth connection between the first earphone and the second earphone, the speed of establishing the Bluetooth connection is significantly improved.
[0129] like Fig.12 As shown, in one embodiment, a Bluetooth communication device 1200 is provided, which can be applied to the first Bluetooth device mentioned above. The Bluetooth communication device 1200 may include a connection module 1210 and a transmission module 1220 .
[0130] The connection module 1210 is used to receive a Bluetooth connection signal sent by a second Bluetooth device and establish a Bluetooth connection with the second Bluetooth device according to the Bluetooth connection signal; no pairing process is performed during the establishment of the Bluetooth connection, and the Bluetooth connection includes the first Bluetooth connection and the non-first Bluetooth connection.
[0131] The transmission module 1220 is used to perform data transmission with a second Bluetooth device through a Bluetooth connection based on pre-stored key data; the second Bluetooth device also pre-stores the key data.
[0132] In one embodiment, the Bluetooth connection signal includes a Bluetooth paging signal, and the key data includes a link key; the connection module 1210 is also used to establish a classic Bluetooth connection with a second Bluetooth device based on the Bluetooth paging signal; the transmission module 1220 is also used to transmit data with the second Bluetooth device through the classic Bluetooth connection based on a pre-stored link key.
[0133] In one embodiment, the Bluetooth connection signal includes a BLE broadcast signal, and the key data includes an LTK; the connection module 1210 is also used to establish a BLE connection with a second Bluetooth device based on the BLE broadcast signal; the transmission module 1220 is also used to transmit data with the second Bluetooth device through a BLE connection based on a pre-stored LTK.
[0134] In one embodiment, the first Bluetooth device and the second Bluetooth device are Bluetooth devices of the same product model; and / or the first Bluetooth device and the second Bluetooth device belong to the same Bluetooth set.
[0135] In one embodiment, the connection module 1210 is further configured to determine, according to the Bluetooth connection signal, that the first Bluetooth device and the second Bluetooth device belong to the same Bluetooth set, and establish a Bluetooth connection with the second Bluetooth device according to the Bluetooth connection signal.
[0136] In one embodiment, the Bluetooth connection signal carries the Bluetooth address corresponding to the second Bluetooth device; the connection module 1210 is also used to determine that the first Bluetooth device and the second Bluetooth device belong to the same Bluetooth set if it is determined based on the Bluetooth connection signal that the Bluetooth address corresponding to the second Bluetooth device is pre-stored in the first electronic device.
[0137] In one embodiment, the key data is burned into the first Bluetooth device during the production process of the first Bluetooth device.
[0138] In one embodiment, the first Bluetooth device includes a first earphone, and the second Bluetooth device includes a second earphone. The Bluetooth communication apparatus 1200 further includes a key storage module.
[0139] The key storage module is used to receive key data sent by the earphone box and store the key data when the first earphone establishes a communication connection with the earphone box. The key data is burned into the earphone box during the production process of the earphone box.
[0140] In one embodiment, the key storage module is further used to receive key data sent by the earphone box and store the key data when the first earphone establishes a communication connection with the earphone box for the first time.
[0141] In one embodiment, the Bluetooth communication device 1200 further includes a communication establishing module.
[0142] The communication establishing module is used to establish a communication connection with the earphone box when the first earphone is placed in the earphone box and the earphone box is in an open state.
[0143] In one embodiment, the Bluetooth communication device 1200 further includes a key updating module.
[0144] The key update module is used to send the key data stored in the first earphone to the earphone box when the first earphone establishes a communication connection with the earphone box, so that the earphone box receives the key data stored in the first earphone and compares the key data stored in the first earphone with the key data burned in the earphone box. If the key data stored in the first earphone is different from the key data burned in the earphone box, the burned key data is sent to the first earphone; and is used to receive the burned key data sent by the earphone box and update the key data stored in the first earphone to the burned key data.
[0145] In an embodiment of the present application, since key data is pre-stored in the first Bluetooth device and the second Bluetooth device, there is no need to perform a pairing process during the establishment of the Bluetooth connection. The Bluetooth connection includes a first Bluetooth connection and a non-first Bluetooth connection. The first Bluetooth device and the second Bluetooth device can transmit data through the established Bluetooth connection based on the pre-stored key data, which reduces the pairing process during the Bluetooth connection process, saves the time of the Bluetooth connection process, and improves the Bluetooth connection speed between the two Bluetooth devices. In particular, for the first Bluetooth connection between the first Bluetooth device and the second Bluetooth device, the speed of establishing the Bluetooth connection is significantly improved.
[0146] In one embodiment, an earphone device is provided, comprising a first earphone and a second earphone, wherein:
[0147] The first earphone is used to receive a Bluetooth connection signal sent by the second earphone, and establish a Bluetooth connection with the second earphone according to the Bluetooth connection signal; no pairing process is performed during the process of establishing the Bluetooth connection, and the Bluetooth connection includes an initial Bluetooth connection and a non-initial Bluetooth connection;
[0148] The first headset is further used to transmit data with the second headset via Bluetooth connection based on pre-stored key data;
[0149] The second earphone is used for performing data transmission with the first earphone through a Bluetooth connection based on pre-stored key data.
[0150] In one embodiment, the Bluetooth connection signal includes a Bluetooth paging signal, and the key data includes a link key;
[0151] The first earphone is further used to receive a Bluetooth paging signal sent by the second earphone, and establish a classic Bluetooth connection with the second earphone according to the Bluetooth paging signal;
[0152] The first headset is further configured to perform data transmission with the second headset via a classic Bluetooth connection based on a pre-stored link key;
[0153] The second headset is further configured to transmit data with the second headset through a classic Bluetooth connection based on a pre-stored link key.
[0154] In one embodiment, the Bluetooth connection signal includes a BLE broadcast signal, and the key data includes a LTK;
[0155] The first earphone is further used to receive the BLE broadcast signal sent by the second earphone, and establish a BLE connection with the second earphone according to the BLE broadcast signal;
[0156] The first earphone is further used to transmit data with the second earphone through the BLE connection based on the pre-stored LTK;
[0157] The second earphone is further used to perform data transmission with the second earphone through the BLE connection based on the pre-stored LTK.
[0158] In one embodiment, the Bluetooth connection signal carries the Bluetooth address corresponding to the second headset; the first headset is further used to establish a Bluetooth connection with the second headset if it is determined based on the Bluetooth connection signal that the Bluetooth address corresponding to the second headset is pre-stored in the first headset.
[0159] In one embodiment, the key data is burned into the first earphone and the second earphone during the production process of the first earphone and the second earphone.
[0160] In one embodiment, the headphone device further comprises a headphone box;
[0161] The earphone box is used to send key data to the first earphone when a communication connection is established with the first earphone; and is used to send key data to the second earphone when a communication connection is established with the second earphone; wherein the key data is burned into the earphone box during the production process of the earphone box;
[0162] The first earphone is further used to receive the key data sent by the earphone box and store the key data;
[0163] The second earphone is also used to receive the key data sent by the earphone box and store the key data.
[0164] In one embodiment, the earphone box is further used to send key data to the first earphone when a communication connection is established with the first earphone for the first time; and is used to send key data to the second earphone when a communication connection is established with the second earphone for the first time.
[0165] In one embodiment, the first earphone is further configured to establish a communication connection with the earphone box when the earphone box is placed in the earphone box and the earphone box is in an open state;
[0166] The second earphone is also used to establish a communication connection with the earphone box when the earphone box is placed in the earphone box and the earphone box is in an open state.
[0167] In one embodiment, the first earphone is further configured to send the key data stored in the first earphone to the earphone box when a communication connection is established with the earphone box;
[0168] The earphone box is further used to receive the key data stored in the first earphone, and compare the key data stored in the first earphone with the key data burned in the earphone box, and if the key data stored in the first earphone is different from the key data burned in the earphone box, send the burned key data to the first earphone;
[0169] The first earphone is further used to receive the burned key data sent by the earphone box, and update the key data stored in the first earphone to the burned key data.
[0170] The second earphone is further used to send the key data stored in the second earphone to the earphone box when a communication connection is established with the earphone box;
[0171] The earphone box is further used to receive the key data stored in the second earphone, and compare the key data stored in the second earphone with the key data burned in the earphone box, and if the key data stored in the second earphone is different from the key data burned in the earphone box, send the burned key data to the second earphone;
[0172] The second earphone is further used to receive the burned key data sent by the earphone box, and update the key data stored in the second earphone to the burned key data.
[0173] In the embodiment of the present application, since key data is pre-stored in the first earphone and the second earphone, there is no need to perform a pairing process during the establishment of the Bluetooth connection. The Bluetooth connection includes a first Bluetooth connection and a non-first Bluetooth connection. The first earphone and the second earphone can transmit data through the established Bluetooth connection based on the pre-stored key data, which reduces the pairing process during the Bluetooth connection process, saves the time of the Bluetooth connection process, and improves the Bluetooth connection speed between the two Bluetooth devices. In particular, for the first Bluetooth connection between the first earphone and the second earphone, the speed of establishing the Bluetooth connection is significantly improved.
[0174] Fig.13 FIG. 1 is a structural block diagram of a Bluetooth device in one embodiment. Fig.13As shown, the Bluetooth device 1300 may include one or more of the following components: a processor 1310, and a memory 1320 coupled to the processor 1310, wherein the memory 1320 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 1310, so that the Bluetooth device 1300 implements the Bluetooth communication method applied to the first Bluetooth device as described in the above embodiments.
[0175] The processor 1310 may include one or more processing cores. The processor 1310 uses various interfaces and lines to connect the various parts of the entire Bluetooth device 1300, and executes various functions and processes data of the Bluetooth device 1300 by running or executing instructions, programs, code sets or instruction sets stored in the memory 1320, and calling data stored in the memory 1320. Optionally, the processor 1310 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 1310 can integrate one or a combination of a central processing unit (CPU), a 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 1310, but may be implemented separately through a communication chip.
[0176] The memory 1320 may include a random access memory (RAM) or a read-only memory (ROM). The memory 1320 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 1320 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 1300 during use, etc.
[0177] The Bluetooth device 1300 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.
[0178] 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.
[0179] 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.
[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 headphone device as described in the above embodiments.
[0181] 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.
[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 can implement the Bluetooth communication method applied to a headphone device as described in the above embodiments.
[0183] 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.
[0184] 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).
[0185] 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".
[0186] 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.
[0187] 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.
[0188] 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.
[0189] 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.
[0190] The above is a detailed introduction to a Bluetooth communication method and device, a headset device, an electronic device, and a 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: receiving a Bluetooth connection signal sent by a second Bluetooth device, and establishing a Bluetooth connection with the second Bluetooth device according to the Bluetooth connection signal; no pairing process is performed during the process of establishing the Bluetooth connection, and the Bluetooth connection includes an initial Bluetooth connection and a non-initial Bluetooth connection; Based on the pre-stored key data, data is transmitted with the second Bluetooth device via the Bluetooth connection; the second Bluetooth device also pre-stores the key data.
2. The method according to claim 1, characterized in that: The Bluetooth connection signal includes a Bluetooth paging signal, and the key data includes a link key; and establishing a Bluetooth connection with the second Bluetooth device according to the Bluetooth connection signal includes: Establishing a classic Bluetooth connection with the second Bluetooth device according to the Bluetooth paging signal; The step of transmitting data with the second Bluetooth device through the Bluetooth connection based on the pre-stored key data includes: Based on the pre-stored link key, data is transmitted with the second Bluetooth device through the classic Bluetooth connection.
3. The method according to claim 1, characterized in that The Bluetooth connection signal includes a Bluetooth low energy consumption (BLE) broadcast signal, and the key data includes a long-term key (LTK); and establishing a Bluetooth connection with the second Bluetooth device according to the Bluetooth connection signal includes: Establishing a BLE connection with the second Bluetooth device according to the BLE broadcast signal; The step of transmitting data with the second Bluetooth device through the Bluetooth connection based on the pre-stored key data includes: Based on the pre-stored LTK, data is transmitted with the second Bluetooth device through the BLE connection.
4. The method according to claim 1, characterized in that: The first Bluetooth device and the second Bluetooth device are Bluetooth devices of the same product model; and / or the first Bluetooth device and the second Bluetooth device belong to the same Bluetooth set.
5. The method according to claim 4, characterized in that The establishing a Bluetooth connection with the second Bluetooth device according to the Bluetooth connection signal includes: According to the Bluetooth connection signal, it is determined that the first Bluetooth device and the second Bluetooth device belong to the same Bluetooth set, and a Bluetooth connection is established with the second Bluetooth device according to the Bluetooth connection signal.
6. The method according to any one of claims 1 to 5, characterized in that: The key data is burned into the first Bluetooth device during the production process of the first Bluetooth device.
7. The method according to any one of claims 1 to 5, characterized in that: The first Bluetooth device includes a first earphone, and the second Bluetooth device includes a second earphone. Before receiving the Bluetooth connection signal sent by the second Bluetooth device, the method further includes: When the first earphone establishes a communication connection with the earphone box, key data sent by the earphone box is received and stored, wherein the key data is burned into the earphone box during the production process of the earphone box.
8. The method according to claim 7, characterized in that The step of receiving key data sent by the earphone box when the first earphone establishes a communication connection with the earphone box includes: When the first earphone establishes a communication connection with the earphone box for the first time, receiving key data sent by the earphone box.
9. The method according to claim 7, characterized in that: The method further comprises: When the first earphone establishes a communication connection with the earphone box, the key data stored in the first earphone is sent to the earphone box, so that the earphone box receives the key data stored in the first earphone, and compares the key data stored in the first earphone with the key data burned in the earphone box; if the key data stored in the first earphone is different from the key data burned in the earphone box, the burned key data is sent to the first earphone; Receive the burned key data sent by the earphone box, and update the key data stored in the first earphone to the burned key data.
10. A Bluetooth communication method, characterized in that: Applied to an earphone device, the earphone device includes a first earphone and a second earphone, and the method includes: The first earphone receives a Bluetooth connection signal sent by the second earphone, and establishes a Bluetooth connection with the second earphone according to the Bluetooth connection signal; no pairing process is performed during the process of establishing the Bluetooth connection, and the Bluetooth connection includes a first Bluetooth connection and a non-first Bluetooth connection; The first earphone and the second earphone perform data transmission through the Bluetooth connection based on pre-stored key data.
11. The method according to claim 10, characterized in that The key data is burned into the first earphone and the second earphone during the production process of the first earphone and the second earphone.
12. The method according to claim 10, characterized in that The earphone device further includes an earphone box. Before the first earphone receives the Bluetooth connection signal sent by the second earphone, the method further includes: When the earphone box establishes a communication connection with the first earphone, the earphone box sends key data to the first earphone, and the first earphone receives the key data sent by the earphone box and stores the key data; When the earphone box establishes a communication connection with the second earphone, the earphone box sends the key data to the second earphone, and the second earphone receives the key data sent by the earphone box and stores the key data; The key data is burned into the earphone box during the production process of the earphone box.
13. The method according to claim 12, characterized in that The method further comprises: When a target earphone establishes a communication connection with an earphone box, sending the key data stored in the target earphone to the earphone box; the target earphone is any one of the first earphone and the second earphone; The earphone box receives the key data stored in the target earphone, and compares the key data stored in the target earphone with the key data burned in the earphone box, and if the key data stored in the target earphone is different from the key data burned in the earphone box, sends the burned key data to the target earphone; The target earphone receives the burned key data sent by the earphone box, and updates the key data stored in the target earphone to the burned key data.
14. A Bluetooth communication device, characterized in that: Applied to a first Bluetooth device, the apparatus comprises: a connection module, configured to receive a Bluetooth connection signal sent by a second Bluetooth device, and establish a Bluetooth connection with the second Bluetooth device according to the Bluetooth connection signal; a pairing process is not performed during the process of establishing the Bluetooth connection, and the Bluetooth connection includes an initial Bluetooth connection and a non-initial Bluetooth connection; The transmission module is used to transmit data with the second Bluetooth device through the Bluetooth connection based on the pre-stored key data; the second Bluetooth device also pre-stores the key data.
15. An earphone device, characterized in that: It includes a first earphone and a second earphone, wherein: The first earphone is used to receive a Bluetooth connection signal sent by the second earphone, and establish a Bluetooth connection with the second earphone according to the Bluetooth connection signal; no pairing process is performed during the process of establishing the Bluetooth connection, and the Bluetooth connection includes a first Bluetooth connection and a non-first Bluetooth connection; The first headset is further configured to perform data transmission with the second headset via the Bluetooth connection based on pre-stored key data; The second headset is used to perform data transmission with the first headset through the Bluetooth connection based on pre-stored key data.
16. An electronic device, characterized in that: The electronic device comprises a memory, a processor and a communication unit, wherein the memory stores a computer program, and when the computer program is executed by the processor, the electronic device implements the method according to any one of claims 1 to 9 or 10 to 13.
17. 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 9 or 10 to 13.