Bluetooth connection method, Bluetooth device and storage medium
By adopting an optimized Bluetooth connection method in Bluetooth devices, the problem of dual-end chain building is solved, reducing the consumption of Bluetooth air interface resources and connection collisions, and improving the success rate of chain building.
Patent Information
- Application Number
- CN202311236912.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-22
- Publication Date
- 2025-03-25
AI Technical Summary
The existing Bluetooth connection method has the problem of dual-end chain building, which leads to excessive consumption of Bluetooth air interface resources and is prone to connection collisions, reducing the success rate of chain building.
By implementing an optimized Bluetooth connection method in the Bluetooth device, the specific steps include: the first Bluetooth device receives a broadcast message from the second Bluetooth device. If the chain building condition is met, only the first Bluetooth device initiates a chain building request and does not respond to the broadcast message, thereby avoiding the two ends from simultaneously launching a chain building.
This method effectively reduces the consumption of Bluetooth air interface resources, improves the success rate of chain building, and avoids the occurrence of connection collisions.
Smart Images

Figure CN119697801A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a Bluetooth connection method, a Bluetooth device and a storage medium. Background Art
[0002] With the continuous development of consumer electronic devices, individuals own more and more mobile terminal devices. It has become the current trend to interconnect multiple devices and build a full-scenario ecosystem. As the core technology of near-field communication, Bluetooth is widely used in full-scenario device interconnection. In the existing Bluetooth technology, after the device discovers the surrounding interconnected devices, it will actively initiate a connection; at the same time, the device will also receive connection requests from the surrounding interconnected devices and respond to the connection. Taking the establishment of a Bluetooth connection between device A and device B as an example, in the current Bluetooth connection process, there will be a situation where device A initiates a link to device B, and device B also initiates a link to device A. The problem of double-end link establishment in the existing Bluetooth connection method will not only consume too many Bluetooth air interface resources, but also easily cause Bluetooth connection collisions, resulting in a low success rate of link establishment. Summary of the invention
[0003] The embodiments of the present application provide a Bluetooth connection method, a Bluetooth device and a storage medium, which are used to reduce the consumption of Bluetooth air interface resources and improve the success rate of link establishment.
[0004] In a first aspect, the present application provides a Bluetooth connection method, the method comprising: a first Bluetooth device receives a first broadcast message sent by a second Bluetooth device, the first broadcast message including device information of the second Bluetooth device; if the first Bluetooth device determines that a link establishment condition is met based on the device information of the second Bluetooth device, the first Bluetooth device sends a first Bluetooth link establishment request to the second Bluetooth device, and the first Bluetooth device does not respond to the first broadcast message; the first Bluetooth device receives a first Bluetooth link establishment response sent by the second Bluetooth device.
[0005] Based on this solution, the first Bluetooth device receives the first broadcast message, and after determining that the link establishment conditions are met, initiates link establishment to the second Bluetooth device, and does not respond to the first broadcast message. In this way, the second Bluetooth device does not receive a response to the first broadcast message and does not initiate link establishment. Therefore, only the first Bluetooth device on both ends initiates link establishment, thereby avoiding the situation where both ends initiate link establishment and cause link establishment failure, thereby improving the link establishment success rate and reducing the consumption of air interface resources.
[0006] In a possible implementation, the first Bluetooth device includes device information that has been paired with the first Bluetooth device, and the first Bluetooth device determines that a link establishment condition is met based on the device information of the second Bluetooth device, which may include: if the device information that has been paired with the first Bluetooth device includes the device information of the second Bluetooth device, then the first Bluetooth device determines that the link establishment condition is met. That is, the device information that has been paired with the first Bluetooth device, included in the device information of the second Bluetooth device, indicates that the first Bluetooth device and the second Bluetooth device are paired. Correspondingly, if the device information that has been paired with the first Bluetooth device does not include the device information of the second Bluetooth device, indicating that the first Bluetooth device and the second Bluetooth device are not paired, then the first Bluetooth device determines that the link establishment condition is not met. This implementation provides a way for the first Bluetooth device to determine whether the link establishment condition is met.
[0007] In a possible implementation, the method further includes: if the first Bluetooth device determines that the link establishment condition is not met according to the device information of the second Bluetooth device, the first Bluetooth device responds to the first broadcast message and sends a first response message to the second Bluetooth device, and the first response message includes the device information of the first Bluetooth device. Through this implementation, the first Bluetooth device receives the first broadcast message, and after determining that the link establishment condition is not met, the first Bluetooth device responds to the first broadcast message and sends the first response message to the second Bluetooth device, but does not initiate link establishment to the second Bluetooth device, so that even if the second Bluetooth device initiates link establishment after receiving the response to the first broadcast message, at most only one end of the two ends initiates link establishment, thereby avoiding the situation where both ends initiate link establishment and cause link establishment failure, improving the link establishment success rate, and reducing the consumption of air interface resources.
[0008] In a second aspect, the present application provides a Bluetooth connection method, the method comprising: a second Bluetooth device sends a first broadcast message, the first broadcast message including device information of the second Bluetooth device; if the second Bluetooth device receives a first Bluetooth link establishment request sent by the first Bluetooth device, and the first Bluetooth device does not respond to the first broadcast message, the second Bluetooth device responds to the first Bluetooth link establishment request and sends a first Bluetooth link establishment response to the first Bluetooth device.
[0009] Based on this solution, after the second Bluetooth device sends the first broadcast message, it receives the first Bluetooth link establishment request sent by the first Bluetooth device, and the first Bluetooth device does not respond to the first broadcast message. In this way, the second Bluetooth device does not receive a response to the first broadcast message and will not initiate link establishment. Only the first Bluetooth device on both ends initiates link establishment, thereby avoiding the situation where both ends initiate link establishment and cause link establishment failure, improving the link establishment success rate, and reducing the consumption of air interface resources.
[0010] In a possible implementation, the method further includes: if the second Bluetooth device receives a first response message sent by the first Bluetooth device and determines that the link establishment condition is met according to the first response message, the second Bluetooth device sends a second Bluetooth link establishment request to the first Bluetooth device, and the first response message includes the device information of the first Bluetooth device; the second Bluetooth device receives the second Bluetooth link establishment response sent by the first Bluetooth device. Through this implementation, after the second Bluetooth device sends the first broadcast message, it receives the first response message sent by the first Bluetooth device, and the first Bluetooth device does not initiate link establishment. Then, the second Bluetooth device can initiate link establishment to the first Bluetooth device according to the first response message, and only the second Bluetooth device at both ends initiates link establishment, thereby avoiding the situation where both ends initiate link establishment and cause link establishment failure, improving the link establishment success rate, and reducing the consumption of air interface resources.
[0011] In a possible implementation, the second Bluetooth device includes device information that has been paired with the second Bluetooth device, and the second Bluetooth device determines that the link establishment condition is met according to the first response message, including: if the device information that has been paired with the second Bluetooth device includes the device information of the first Bluetooth device, then the second Bluetooth device determines that the link establishment condition is met. That is, the device information that has been paired with the second Bluetooth device included in the second Bluetooth device includes the device information of the first Bluetooth device, indicating that the first Bluetooth device and the second Bluetooth device are paired. Correspondingly, if the device information that has been paired with the second Bluetooth device does not include the device information of the first Bluetooth device, indicating that the first Bluetooth device and the second Bluetooth device are not paired, then the second Bluetooth device determines that the link establishment condition is not met. This implementation provides a way for the second Bluetooth device to determine whether the link establishment condition is met.
[0012] In a third aspect, the present application provides a Bluetooth connection method, the method comprising: a first Bluetooth device receives a first broadcast message sent by a second Bluetooth device, the first broadcast message including device information of the second Bluetooth device and a first timestamp, the first timestamp being the sending time corresponding to the first broadcast message; the first Bluetooth device sends a second broadcast message, the second broadcast message including device information of the first Bluetooth device and a second timestamp, the second timestamp being the sending time corresponding to the second broadcast message; if the first Bluetooth device determines that a link establishment condition is met based on the device information of the second Bluetooth device, and the first timestamp and the second timestamp satisfy a first preset relationship, the first Bluetooth device sends a first Bluetooth link establishment request to the second Bluetooth device; the first Bluetooth device receives a first Bluetooth link establishment response sent by the second Bluetooth device.
[0013] Based on this solution, when the first Bluetooth device receives the first broadcast message and determines according to the device information of the second Bluetooth device that the link establishment conditions are met and the first timestamp and the second timestamp satisfy the first preset relationship, only the first Bluetooth device can initiate the link establishment, thereby avoiding the situation where both ends initiate the link establishment and cause the link establishment to fail, improving the link establishment success rate and reducing the consumption of air interface resources.
[0014] In a possible implementation, the method further includes: if the first Bluetooth device determines that the link establishment condition is met according to the device information of the second Bluetooth device, and the first timestamp and the second timestamp meet the second preset relationship, the first Bluetooth device determines that the link establishment initiator is the second Bluetooth device; the first Bluetooth device receives the second Bluetooth link establishment request sent by the second Bluetooth device; the first Bluetooth device sends a second Bluetooth link establishment response to the second Bluetooth device. Through this implementation, when the first Bluetooth device receives the first broadcast message and determines that the link establishment condition is met according to the device information of the second Bluetooth device, and the first timestamp and the second timestamp meet the second preset relationship, only the second Bluetooth device can initiate the link establishment, thereby avoiding the situation where both ends initiate the link establishment and cause the link establishment to fail, improving the link establishment success rate, and reducing the consumption of air interface resources.
[0015] In one possible implementation, the first preset relationship includes the first timestamp being less than or equal to the second timestamp, and the second preset relationship includes the first timestamp being greater than the second timestamp; or, the first preset relationship includes the first timestamp being greater than the second timestamp, and the second preset relationship includes the first timestamp being less than or equal to the second timestamp.
[0016] In a possible implementation, the first Bluetooth device includes device information that has been paired with the first Bluetooth device, and the first Bluetooth device determines that a link establishment condition is met based on the device information of the second Bluetooth device, including: if the device information that has been paired with the first Bluetooth device includes the device information of the second Bluetooth device, then the first Bluetooth device determines that the link establishment condition is met. That is, the device information that has been paired with the first Bluetooth device, included in the device information of the second Bluetooth device, indicates that the first Bluetooth device and the second Bluetooth device are paired. Correspondingly, if the device information that has been paired with the first Bluetooth device does not include the device information of the second Bluetooth device, indicating that the first Bluetooth device and the second Bluetooth device are not paired, then the first Bluetooth device determines that the link establishment condition is not met. This implementation provides a way for the first Bluetooth device to determine whether the link establishment condition is met.
[0017] In a fourth aspect, the present application provides a Bluetooth connection method, the method comprising: a second Bluetooth device sends a first broadcast message, the first broadcast message including device information of the second Bluetooth device and a first timestamp, the first timestamp being the sending time corresponding to the first broadcast message; a second Bluetooth device receives a second broadcast message sent by the first Bluetooth device, the second broadcast message including device information of the first Bluetooth device and a second timestamp, the second timestamp being the sending time corresponding to the second broadcast message; if the second Bluetooth device determines that a link establishment condition is met based on the device information of the first Bluetooth device, and the first timestamp and the second timestamp meet a first preset relationship, the second Bluetooth device determines that the link establishment initiator is the first Bluetooth device; the second Bluetooth device receives a first Bluetooth link establishment request sent by the first Bluetooth device; the second Bluetooth device responds to the first Bluetooth link establishment request and sends a first Bluetooth link establishment response to the first Bluetooth device.
[0018] Based on this solution, the second Bluetooth device sends a first broadcast message and receives a second broadcast message sent by the first Bluetooth device, and then determines according to the device information of the first Bluetooth device that when the link establishment conditions are met and the first timestamp and the second timestamp satisfy a first preset relationship, only the first Bluetooth device can initiate link establishment, thereby avoiding the situation where both ends initiate link establishment and cause link establishment failure, improving the link establishment success rate, and reducing the consumption of air interface resources.
[0019] In a possible implementation, if the second Bluetooth device determines that the link establishment condition is met according to the device information of the first Bluetooth device, and the first timestamp and the second timestamp meet the second preset relationship, the second Bluetooth device sends a second Bluetooth link establishment request to the first Bluetooth device; the second Bluetooth device receives the second Bluetooth link establishment response sent by the first Bluetooth device. Through this implementation, the second Bluetooth device sends a first broadcast message and receives a second broadcast message sent by the first Bluetooth device, and then determines that the link establishment condition is met according to the device information of the first Bluetooth device, and the first timestamp and the second timestamp meet the second preset relationship, only the second Bluetooth device can initiate the link establishment, thereby avoiding the situation where both ends initiate the link establishment and cause the link establishment to fail, improving the link establishment success rate, and also reducing the consumption of air interface resources.
[0020] In one possible implementation, the first preset relationship includes the first timestamp being less than or equal to the second timestamp, and the second preset relationship includes the first timestamp being greater than the second timestamp; or, the first preset relationship includes the first timestamp being greater than the second timestamp, and the second preset relationship includes the first timestamp being less than or equal to the second timestamp.
[0021] In a possible implementation, the second Bluetooth device includes device information that has been paired with the second Bluetooth device, and the second Bluetooth device determines that the link establishment condition is met based on the device information of the first Bluetooth device, including: if the device information that has been paired with the second Bluetooth device includes the device information of the first Bluetooth device, then the second Bluetooth device determines that the link establishment condition is met. That is, the device information that has been paired with the second Bluetooth device included in the second Bluetooth device includes the device information of the first Bluetooth device, indicating that the first Bluetooth device and the second Bluetooth device are paired. Correspondingly, if the device information that has been paired with the second Bluetooth device does not include the device information of the first Bluetooth device, indicating that the first Bluetooth device and the second Bluetooth device are not paired, then the second Bluetooth device determines that the link establishment condition is not met. This implementation provides a way for the second Bluetooth device to determine whether the link establishment condition is met.
[0022] In a fifth aspect, the present application further provides a device, which includes a module / unit for executing any possible design method of any of the above aspects. These modules / units can be implemented by hardware, or by executing corresponding software implementations by hardware.
[0023] In a sixth aspect, the present application provides a Bluetooth device, including a processor and a memory, wherein the memory is used to store one or more programs; when the one or more programs stored in the memory are executed by the processor, the Bluetooth device can implement the above-mentioned various aspects and any possible design method involved in each aspect.
[0024] In a seventh aspect, the present application also provides a readable storage medium, which includes a program. When the program runs on an electronic device, the Bluetooth device executes the above-mentioned various aspects and any possible design method involved in each aspect.
[0025] In an eighth aspect, the present application further provides a method comprising a computer program product, which, when executed on a Bluetooth device, enables the Bluetooth device to execute the above-mentioned various aspects and any possible design method involved in each aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 A schematic diagram of a flow chart of a Bluetooth connection method provided in an embodiment of the present application;
[0027] Figure 2 A schematic diagram of a device interconnection scenario provided in an embodiment of the present application;
[0028] Figure 3 A schematic diagram of the structure of a Bluetooth device provided in an embodiment of the present application;
[0029] Figure 4 A schematic diagram of a flow chart of a Bluetooth connection method provided in an embodiment of the present application;
[0030] Figure 5 A schematic diagram of a flow chart of a Bluetooth connection method provided in an embodiment of the present application;
[0031] Figure 6 A schematic diagram of a flow chart of a Bluetooth connection method provided in an embodiment of the present application;
[0032] Figure 7 A schematic diagram of the structure of a Bluetooth device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0033] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. The terms used in the following embodiments are only for the purpose of describing specific embodiments and are not intended to be used as limitations on the present application. As used in the specification and the appended claims of the present application, the singular expressions "one", "a kind", "said", "above", "the" and "this" are intended to also include expressions such as "one or more", unless there is a clear contrary indication in the context. It should also be understood that in the embodiments of the present application, "one or more" refers to one, two or more; "and / or" describes the association relationship of the associated objects, indicating that three relationships may exist; for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship.
[0034] References to "some embodiments" and the like described in this specification mean that a particular feature, structure or characteristic described in conjunction with the embodiment is included in one or more embodiments of the present application. Thus, the phrases "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily all refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in another way. The terms "include", "comprises", "has" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in another way.
[0035] The multiple involved in the embodiments of the present application means greater than or equal to two. It should be noted that in the description of the embodiments of the present application, the words "first", "second", etc. are only used for the purpose of distinguishing the description, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying an order.
[0036] In a multi-device interconnection scenario, after a Bluetooth device discovers nearby interconnected devices, it will actively initiate a Bluetooth connection. Figure 1A flowchart of a Bluetooth link establishment method is provided, the method comprising the following steps:
[0037] Step 101: Bluetooth device B sends a Bluetooth broadcast, where the Bluetooth broadcast includes device information of Bluetooth device B.
[0038] Correspondingly, other devices around Bluetooth device B can receive the Bluetooth broadcast of Bluetooth device B, for example, Bluetooth device A receives the Bluetooth broadcast of Bluetooth device B.
[0039] Step 102: Bluetooth device A parses the device information of Bluetooth device B from the Bluetooth broadcast.
[0040] After obtaining the information of the opposite device, the Bluetooth device A will execute step 103 and step 104 .
[0041] Step 103: Bluetooth device A sends a response to the Bluetooth broadcast to Bluetooth device B. For example, Bluetooth device A informs Bluetooth device B of its device information through broadcasting.
[0042] Step 104: Bluetooth device A initiates link establishment with Bluetooth device B.
[0043] Step 105: After receiving the response to the Bluetooth broadcast sent by the Bluetooth device A, the Bluetooth device B parses the device information of the Bluetooth device A from the response to the Bluetooth broadcast.
[0044] Step 106: After parsing the device information of Bluetooth device A, Bluetooth device B initiates link establishment with Bluetooth device A.
[0045] In the above-mentioned Bluetooth link establishment method, after Bluetooth device A receives the Bluetooth broadcast of Bluetooth device B, it can obtain the device information of Bluetooth device B, so that it can initiate link establishment. At the same time, Bluetooth device A will also reply to Bluetooth device B, so that Bluetooth device B can also obtain the device information of Bluetooth device A. Bluetooth device B will also initiate link establishment. If both ends of the device initiate link establishment at the same time, it will not only consume too many Bluetooth air interface resources, but also cause Bluetooth connection collision, thereby reducing the success rate of Bluetooth connection.
[0046] To this end, the present application provides a Bluetooth connection method to optimize the Bluetooth connection interaction process. For example, after device A receives a Bluetooth broadcast sent by a peer device, it decides to send a link establishment request or respond to the Bluetooth broadcast, thereby avoiding both ends initiating link establishment at the same time.
[0047] The implementation of the embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0048] like Figure 2 FIG. 1 is a schematic diagram of a multi-device interconnection scenario provided by an embodiment of the present application. In the multi-device interconnection scenario, multiple Bluetooth devices may be included, such as Figure 2 The mobile phone 201, laptop computer 202, Bluetooth headset 203, Bluetooth watch 204, TV terminal 205 and tablet computer 206 shown in the figure can establish Bluetooth connections with the laptop computer 202, Bluetooth headset 203, smart watch 204, TV terminal 205 and tablet computer 206 respectively. It should be understood that Figure 2 The various devices shown can establish Bluetooth connections with each other.
[0049] The Bluetooth device in the above interconnection scenario may also be other devices with Bluetooth communication function, and the embodiment of the present application does not limit the specific form of the Bluetooth device.
[0050] like Figure 3 , which is a structural example diagram of a Bluetooth device provided in an embodiment of the present application.
[0051] The structure of the above Bluetooth device is further explained with reference to the accompanying drawings.
[0052] Figure 3 Only a hardware structure diagram of a Bluetooth device provided in an embodiment of the present application is shown. Figure 3 Based on the above, there may be other variant structures. Figure 3 As shown, the Bluetooth device 300 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include one or more of the following: a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0053] Below Figure 3 The components of the Bluetooth device 300 shown will be described in detail.
[0054] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a memory, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and / or a neural-network processing unit (neural-network processing unit, NPU), etc. Among them, different processing units can be independent devices or integrated in one or more processors. In some embodiments, the Bluetooth device 300 may also include one or more processors 110. Among them, the processor is the nerve center and command center of the Bluetooth device 300. The processor can generate an operation control signal according to the instruction opcode and the timing signal to complete the control of fetching and executing instructions.
[0055] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory, thereby avoiding repeated access, reducing the waiting time of the processor 110, and thus improving the efficiency of the system.
[0056] In some embodiments, the processor 110 may include one or more interfaces. For example, the interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc. It is understood that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation of the Bluetooth device 300.
[0057] The charging management module 140 is used to receive charging input from the charger. The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The wireless communication function of the Bluetooth device 300 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0058] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in Bluetooth device 300 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antenna can be used in combination with a tuning switch.
[0059] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the Bluetooth device 300. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0060] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In some embodiments, the modem processor may be independent of the processor 110 and may be set in the same device as the mobile communication module 150 or other functional modules.
[0061] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the Bluetooth device 300. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0062] In some embodiments, antenna 1 of Bluetooth device 300 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, so that Bluetooth device 300 can communicate with the network and other devices through wireless communication technology.
[0063] The Bluetooth device 300 implements the display function through a GPU, a display screen 194, and an application processor. The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light emitting diode (QLED), etc. In some embodiments, the Bluetooth device 300 may include 1 or N display screens 194, where N is a positive integer greater than 1.
[0064] In some other embodiments, the Bluetooth device 300 can implement the shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.
[0065] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the Bluetooth device 300. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and videos can be stored in the external memory card.
[0066] The internal memory 121 can be used to store computer executable program codes, which include instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system and an application required for at least one function. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the Bluetooth device 300 by running instructions stored in the internal memory 121 and / or instructions stored in a memory provided in the processor.
[0067] The Bluetooth device 300 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0068] The Bluetooth device 300 can receive input from the button 190 and generate key signal input related to the user settings and function control of the mobile phone 300. For example, the button 190 may include a power button, a volume up button, a volume down button, etc., which are arranged on the right side of the Bluetooth device. In the embodiment of the present application, the button 190 may also include a first button arranged on the Bluetooth device, and the first button can be used to implement the corresponding customized function using the operation gesture set by the user in different scenarios. The first button can be set on the side of the Bluetooth device, such as the left side, and for example, on the right side. The first button can also be set at other positions of the Bluetooth device. The present application does not limit the specific location of the first button. The name of the first button can also be a smart button, a function button, a shortcut button, a customized button or other names, and the present application does not limit the name of the first button. The following embodiments are described by taking the first button as an example.
[0069] although Figure 3Not shown, the Bluetooth device 300 may also include a Bluetooth device, a positioning device, a flashlight, a micro-projection device, a near field communication (NFC) device, etc., which are not described in detail here.
[0070] It should be understood that the structure shown in the embodiment of the present application does not constitute a specific limitation on the Bluetooth device 300. In some embodiments of the present application, the Bluetooth device 300 may include Figure 3 More or fewer components than those shown in the drawings may be used, some components may be combined, some components may be separated, or different component arrangements may be used. Figure 3 The components shown may be implemented in hardware, software, or a combination of software and hardware.
[0071] The following embodiments can all be implemented in the Bluetooth device 300 having the above hardware structure.
[0072] like Figure 4 FIG. 1 is a flow chart of a Bluetooth connection method provided in an embodiment of the present application, and the method may include the following steps:
[0073] Step 401: The second Bluetooth device sends a first broadcast message. Correspondingly, the first Bluetooth device receives the first broadcast message sent by the second Bluetooth device, where the first broadcast message includes device information of the second Bluetooth device.
[0074] Exemplarily, the device information of the second Bluetooth device may include an identifier of the second device and a Bluetooth address of the second device.
[0075] After step 401, step 402 or step 404 is executed.
[0076] Step 402: If the first Bluetooth device determines that the link establishment condition is met according to the device information of the second Bluetooth device, the first Bluetooth device sends a first Bluetooth link establishment request to the second Bluetooth device, and the first Bluetooth device does not respond to the first broadcast message.
[0077] The first Bluetooth link establishment request is used to request to establish a Bluetooth connection with the second Bluetooth device.
[0078] In one possible implementation, the first Bluetooth device may include device information that has been paired with the first Bluetooth device. In step 402, the first Bluetooth device determines that the link establishment condition is met based on the device information of the second Bluetooth device, which can be achieved in the following manner: if the device information that has been paired with the first Bluetooth device includes the device information of the second Bluetooth device, the first Bluetooth device determines that the link establishment condition is met. Among them, the device information that has been paired with the first Bluetooth device includes the device information of the second Bluetooth device, indicating that the first Bluetooth device and the second Bluetooth device have been paired, and then the link establishment condition can be met.
[0079] In the above step 402, the first Bluetooth device sends the first Bluetooth link establishment request to the second Bluetooth device and does not respond to the first broadcast message. Correspondingly, the second Bluetooth device can receive the first Bluetooth link establishment request sent by the first Bluetooth device, but will not receive a response to the first broadcast message. That is, after the second Bluetooth device sends the first broadcast message, only the first Bluetooth device obtains the device information of the second Bluetooth device by parsing the first broadcast message, and then initiates link establishment to the second Bluetooth device according to the device information of the second Bluetooth device. Since the second Bluetooth device does not receive a response to the first broadcast message and does not obtain the device information of the first Bluetooth device, the second Bluetooth device will not initiate link establishment to the first Bluetooth device.
[0080] Based on the above step 402 , if the second Bluetooth device receives the first Bluetooth link establishment request sent by the first Bluetooth device and the first Bluetooth device does not respond to the first broadcast message, the second Bluetooth device executes step 403 .
[0081] Step 403: In response to the first Bluetooth link establishment request, the second Bluetooth device sends a first Bluetooth link establishment response to the first Bluetooth device. Correspondingly, the first Bluetooth device receives the first Bluetooth link establishment response sent by the second Bluetooth device.
[0082] Step 404: If the first Bluetooth device determines that the link establishment condition is not met according to the device information of the second Bluetooth device, the first Bluetooth device sends a first response message to the second Bluetooth device in response to the first broadcast message, and the first response message includes the device information of the first Bluetooth device.
[0083] In step 404, the first Bluetooth device determines that the link establishment condition is not met based on the device information of the second Bluetooth device. This can be achieved in the following way: if the device information paired with the first Bluetooth device does not include the device information of the second Bluetooth device, it means that the first Bluetooth device and the second Bluetooth device are not paired, then the first Bluetooth device determines that the link establishment condition is not met.
[0084] In a possible implementation, when the first Bluetooth device determines that the link establishment condition is not met, the first Bluetooth device sends a first response message to the second Bluetooth device, and the first Bluetooth device does not initiate link establishment to the second Bluetooth device, that is, it does not send the first Bluetooth link establishment request to the second Bluetooth device. Correspondingly, the second Bluetooth device will not receive the first Bluetooth link establishment request, but can receive the first response message sent by the first Bluetooth device, and then the second Bluetooth device can parse the device information of the first Bluetooth device from the first response message, so as to initiate link establishment to the first Bluetooth device according to the device information of the first Bluetooth device.
[0085] Step 405: If the second Bluetooth device receives the first response message sent by the first Bluetooth device and determines that the link establishment condition is met according to the first response message, the second Bluetooth device sends a second Bluetooth link establishment request to the first Bluetooth device. Correspondingly, the first Bluetooth device receives the second Bluetooth link establishment request sent by the second Bluetooth device.
[0086] In one possible implementation, the second Bluetooth device may include device information that has been paired with the second Bluetooth device. The second Bluetooth device in step 405 determines that the link establishment condition is met based on the first response message. This can be achieved in the following way: if the device information that has been paired with the second Bluetooth device includes the device information of the first Bluetooth device, indicating that the second Bluetooth device has been paired with the first Bluetooth device, then the second Bluetooth device determines that the link establishment condition is met.
[0087] Step 406: The first Bluetooth device sends a second Bluetooth link establishment response to the second Bluetooth device. Correspondingly, the second Bluetooth device receives the second Bluetooth link establishment response sent by the first Bluetooth device.
[0088] Through the above method, the first Bluetooth device receives the first broadcast message of the second Bluetooth device, and after determining that the link establishment condition is met, initiates link establishment to the second Bluetooth device, and does not respond to the first broadcast message, and binds the initiation of link establishment and the non-response to the first broadcast message, that is, as long as the link establishment is initiated, the first broadcast message will not be responded to, so that only the first Bluetooth device on both ends of the first Bluetooth device and the second Bluetooth device initiates link establishment; the first Bluetooth device receives the first broadcast message, and after determining that the link establishment condition is not met, the first Bluetooth device responds to the first broadcast message and sends a first response message to the second Bluetooth device, but does not initiate link establishment to the second Bluetooth device, so that even if the second Bluetooth device initiates link establishment after receiving the response to the first broadcast message, only the second Bluetooth device on both ends initiates link establishment. Therefore, the situation where both ends initiate link establishment and cause link establishment failure can be avoided, the link establishment success rate can be improved, and the consumption of air interface resources can be reduced.
[0089] See also Figure 5 , exemplarily shows a flow chart of a Bluetooth connection method provided in an embodiment of the present application, the method may include the following steps:
[0090] Step 501: The second Bluetooth device sends a first broadcast message. Correspondingly, the first Bluetooth device receives the first broadcast message sent by the second Bluetooth device.
[0091] The first broadcast message includes device information of the second Bluetooth device and a first timestamp, where the first timestamp is the sending time of the first broadcast message. Exemplarily, the device information of the second Bluetooth device may include an identifier of the second device and a Bluetooth address of the second device.
[0092] The first timestamp may be set in an extension field of the first broadcast message.
[0093] Step 502: The first Bluetooth device sends a second broadcast message. Correspondingly, the second Bluetooth device receives the first broadcast message sent by the first Bluetooth device.
[0094] The second broadcast message includes device information of the first Bluetooth device and a second timestamp, and the second timestamp is the sending time corresponding to the second broadcast message. Exemplarily, the device information of the first Bluetooth device may include an identifier of the first device and a Bluetooth address of the first device.
[0095] The second timestamp may be set in an extension field of the second broadcast message.
[0096] There is no particular order for step 501 and step 502. After step 501 and step 502, steps 503 to 505 may be performed, or steps 506 to 508 may be performed.
[0097] Step 503: If the first Bluetooth device determines that the link establishment condition is met according to the device information of the second Bluetooth device, and the first timestamp and the second timestamp meet the first preset relationship, the first Bluetooth device sends a first Bluetooth link establishment request to the second Bluetooth device. Correspondingly, the second Bluetooth device receives the first Bluetooth link establishment request sent by the first Bluetooth device.
[0098] In a possible implementation, the first Bluetooth device may include device information that has been paired with the first Bluetooth device. In step 503, the first Bluetooth device determines that the link establishment condition is met based on the device information of the second Bluetooth device, which can be implemented in the following manner: if the device information that has been paired with the first Bluetooth device includes the device information of the second Bluetooth device, the first Bluetooth device determines that the link establishment condition is met. Among them, the device information that has been paired with the first Bluetooth device includes the device information of the second Bluetooth device, indicating that the first Bluetooth device and the second Bluetooth device have been paired, and then the link establishment condition can be met.
[0099] The first preset relationship in step 503 may include that the first timestamp is less than or equal to the second timestamp, or the first preset relationship includes that the first timestamp is greater than the second timestamp.
[0100] After step 503, step 505 is executed.
[0101] Step 504: If the second Bluetooth device determines that the link establishment condition is met according to the device information of the first Bluetooth device, and the first timestamp and the second timestamp meet the first preset relationship, the second Bluetooth device determines that the link establishment initiator is the first Bluetooth device.
[0102] In one possible implementation, the second Bluetooth device includes device information that has been paired with the second Bluetooth device. The second Bluetooth device in step 504 determines that the link establishment condition is met based on the device information of the first Bluetooth device. This can be achieved in the following way: if the device information that has been paired with the second Bluetooth device includes the device information of the first Bluetooth device, the second Bluetooth device determines that the link establishment condition is met.
[0103] The second Bluetooth device determines that the link establishment initiator is the first Bluetooth device, that is, the second Bluetooth device does not initiate link establishment to the first Bluetooth device.
[0104] Step 505: In response to the first Bluetooth link establishment request, the second Bluetooth device sends a first Bluetooth link establishment response to the first Bluetooth device.
[0105] Step 506: If the first Bluetooth device determines that the link establishment condition is met according to the device information of the second Bluetooth device, and the first timestamp and the second timestamp meet the second preset relationship, the first Bluetooth device determines that the link establishment initiator is the second Bluetooth device.
[0106] The specific implementation manner in which the first Bluetooth device determines in step 506 that the link establishment condition is met according to the device information of the second Bluetooth device can refer to the relevant description of step 503, which will not be repeated here.
[0107] In step 506, the second preset relationship may have the following two possible implementations:
[0108] In the first mode, the second preset relationship includes that the first timestamp is greater than the second timestamp. In this mode, the first preset relationship includes that the first timestamp is less than or equal to the second timestamp. That is, if the first Bluetooth device determines that the link establishment condition is met according to the device information of the second Bluetooth device, and the first timestamp is less than or equal to the second timestamp, the first Bluetooth device sends a first Bluetooth link establishment request to the second Bluetooth device; if the first Bluetooth device determines that the link establishment condition is met according to the device information of the second Bluetooth device, and the first timestamp is greater than the second timestamp, the second Bluetooth device is determined to be the link establishment initiator.
[0109] In the second mode, if the first preset relationship includes that the first timestamp is greater than the second timestamp, then the second preset relationship includes that the first timestamp is less than or equal to the second timestamp. That is, if the first Bluetooth device determines that the link establishment condition is met according to the device information of the second Bluetooth device, and the first timestamp is greater than the second timestamp, then the first Bluetooth device sends a first Bluetooth link establishment request to the second Bluetooth device; if the first Bluetooth device determines that the link establishment condition is met according to the device information of the second Bluetooth device, and the first timestamp is less than or equal to the second timestamp, then the second Bluetooth device is determined to be the link establishment initiator.
[0110] Step 507: If the second Bluetooth device determines that the link establishment condition is met according to the device information of the first Bluetooth device, and the first timestamp and the second timestamp meet the second preset relationship, the second Bluetooth device sends a second Bluetooth link establishment request to the first Bluetooth device. Correspondingly, the first Bluetooth device receives the second Bluetooth link establishment request sent by the second Bluetooth device.
[0111] Step 508: The first Bluetooth device sends a second Bluetooth link establishment response to the second Bluetooth device. Correspondingly, the second Bluetooth device receives the second Bluetooth link establishment response sent by the first Bluetooth device.
[0112] Step 509: If the first Bluetooth device determines that the link establishment condition is not met according to the device information of the second Bluetooth device, the first Bluetooth device does not send a first Bluetooth link establishment request to the second Bluetooth device.
[0113] In some embodiments, the first Bluetooth device may include device information that has been paired with the first Bluetooth device. If the device information that has been paired with the first Bluetooth device does not include device information of the second Bluetooth device, it means that the first Bluetooth device and the second Bluetooth device are not paired, and the first Bluetooth device determines that the link establishment condition is not met.
[0114] Step 510: If the second Bluetooth device determines that the link establishment condition is not met according to the device information of the first Bluetooth device, the second Bluetooth device does not send a second Bluetooth link establishment request to the first Bluetooth device.
[0115] In some embodiments, the second Bluetooth device may include device information that has been paired with the second Bluetooth device. If the device information that has been paired with the second Bluetooth device does not include device information of the first Bluetooth device, it means that the first Bluetooth device and the second Bluetooth device are not paired, and the second Bluetooth device determines that the link establishment condition is not met.
[0116] Through the above method, after receiving the broadcast message of the opposite device, the first Bluetooth device or the second Bluetooth device can, based on the condition that the link establishment condition is met according to the device information of the opposite device, and the first timestamp and the second timestamp satisfy the first preset relationship, only the first Bluetooth device on both ends of the first Bluetooth device and the second Bluetooth device can initiate link establishment; based on the condition that the link establishment condition is met according to the device information of the opposite device, and the first timestamp and the second timestamp satisfy the second preset relationship, only the second Bluetooth device on both ends of the first Bluetooth device and the second Bluetooth device can initiate link establishment; therefore, the situation where both ends initiate link establishment, resulting in link establishment failure, can be avoided, the link establishment success rate can be improved, and the consumption of air interface resources can be reduced.
[0117] The following provides a specific example of a Bluetooth connection method performed by a first Bluetooth device, taking the first preset relationship including the first timestamp being less than or equal to the second timestamp and the first preset relationship including the first timestamp being greater than the second timestamp as an example. The Bluetooth connection method includes the following steps:
[0118] Step 601: A first Bluetooth device receives a first broadcast message.
[0119] The first broadcast message at least includes device information of the second Bluetooth device.
[0120] Step 602: The first Bluetooth device parses the first broadcast message to obtain device information of the opposite device, for example, obtains device information of the second Bluetooth device.
[0121] Step 603: the first Bluetooth device determines whether it has been paired with the second Bluetooth device according to the device information of the second Bluetooth device; if so, step 604 is executed; if not, the link establishment process is terminated.
[0122] Step 604, the first Bluetooth device determines whether to carry a timestamp; if so, execute step 605; if not, end the link establishment process.
[0123] Step 605: The first Bluetooth device determines whether the first timestamp is less than or equal to the second timestamp; if so, execute step 606; if not, end the link establishment process.
[0124] The second timestamp is the time when the first Bluetooth device sends the second broadcast message.
[0125] Step 606: The first Bluetooth device sends a first Bluetooth link establishment request to the second Bluetooth device.
[0126] Step 607: The first Bluetooth device receives a first Bluetooth link establishment response sent by the second Bluetooth device.
[0127] Above Figure 6 The description is made by taking the link establishment process after the first Bluetooth device receives the first broadcast message sent by the second Bluetooth device as an example. The above method is also applicable to the link establishment process after the second Bluetooth device receives the second broadcast message sent by the first Bluetooth device.
[0128] In the above embodiments provided by the present application, the method provided by the embodiment of the present application is introduced from the perspective of a Bluetooth device as an execution subject. In order to implement the various functions in the method provided by the above embodiments of the present application, the device may include a hardware structure and / or a software module, and the above functions may be implemented in the form of a hardware structure, a software module, or a hardware structure plus a software module. Whether a certain function of the above functions is executed in the form of a hardware structure, a software module, or a hardware structure plus a software module depends on the specific application and design constraints of the technical solution.
[0129] The present application also provides a Bluetooth device, which is used to implement the Bluetooth connection method in the above figures. Figure 7 As shown, the Bluetooth device 700 may be the Bluetooth device or smart host in the aforementioned method embodiment, and the Bluetooth device 700 includes: a transceiver 701, a processor 702, and a memory 703. The transceiver 701, the processor 702, and the memory 703 are interconnected.
[0130] Optionally, the transceiver 701, the processor 702, and the memory 703 are interconnected via a bus 704. The bus 704 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0131] The memory 703 is used to store program instructions and data. Specifically, the program instructions may include program codes, and the program codes include computer operation instructions. The memory 703 may include random access memory (RAM), and may also include non-volatile memory (non-volatile memory), such as at least one disk storage. The processor 702 executes the program instructions and data stored in the memory 703 to implement the above functions, thereby implementing the Bluetooth connection method provided in the above embodiment.
[0132] In the embodiment of the present application, the processor 702 can be a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, and can implement or execute the methods, steps and logic block diagrams disclosed in the embodiment of the present application. The general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware processor to be executed, or the hardware and software modules in the processor can be combined and executed. The software module can be located in the memory 703, and the processor 702 reads the program instructions in the memory 703, and completes the steps of the above method in combination with its hardware.
[0133] In the embodiment of the present application, the memory 703 may be a non-volatile memory, such as a hard disk drive (HDD) or a solid-state drive (SSD), etc., or a volatile memory (volatile memory), such as RAM. The memory may also be any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory in the embodiment of the present application may also be a circuit or any other device that can implement a storage function, for storing instructions and / or data.
[0134] The present application also provides a readable storage medium, which stores a program, and when the program is run on an electronic device, the electronic device executes the above-mentioned related method steps to implement the method in the above-mentioned embodiment. The electronic device may be a smart host or a Bluetooth device in the above-mentioned method embodiment.
[0135] The embodiments of the present application also provide a computer program product. When the computer program product is run on an electronic device, the electronic device executes the above-mentioned related steps to implement the method in the above-mentioned embodiments.
[0136] In addition, an embodiment of the present application also provides a device, which can specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store instructions, and when the device is running, the processor can execute the computer-executable instructions stored in the memory so that the chip executes the methods in the above-mentioned method embodiments.
[0137] Among them, the electronic device, computer storage medium, computer program product or chip provided in the embodiments of the present application are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here.
[0138] Through the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0139] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0140] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0141] 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.
[0142] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0143] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A Bluetooth connection method, characterized in that: The method comprises: The first Bluetooth device receives a first broadcast message sent by a second Bluetooth device, where the first broadcast message includes device information of the second Bluetooth device; If the first Bluetooth device determines that the link establishment condition is met according to the device information of the second Bluetooth device, the first Bluetooth device sends a first Bluetooth link establishment request to the second Bluetooth device, and the first Bluetooth device does not respond to the first broadcast message; The first Bluetooth device receives a first Bluetooth link establishment response sent by the second Bluetooth device.
2. The method according to claim 1, characterized in that The first Bluetooth device includes device information that has been paired with the first Bluetooth device, and the first Bluetooth device determines that a link establishment condition is met according to the device information of the second Bluetooth device, including: If the device information paired with the first Bluetooth device includes the device information of the second Bluetooth device, the first Bluetooth device determines that the link establishment condition is met.
3. The method according to claim 1 or 2, characterized in that The method further comprises: If the first Bluetooth device determines that the link establishment condition is not met according to the device information of the second Bluetooth device, the first Bluetooth device sends a first response message to the second Bluetooth device in response to the first broadcast message, where the first response message includes the device information of the first Bluetooth device.
4. A Bluetooth connection method, characterized in that: The method comprises: The second Bluetooth device sends a first broadcast message, where the first broadcast message includes device information of the second Bluetooth device; If the second Bluetooth device receives the first Bluetooth link establishment request sent by the first Bluetooth device and the first Bluetooth device does not respond to the first broadcast message, the second Bluetooth device sends a first Bluetooth link establishment response to the first Bluetooth device in response to the first Bluetooth link establishment request.
5. The method according to claim 4, characterized in that The method further comprises: If the second Bluetooth device receives the first response message sent by the first Bluetooth device and determines that the link establishment condition is met according to the first response message, the second Bluetooth device sends a second Bluetooth link establishment request to the first Bluetooth device, and the first response message includes device information of the first Bluetooth device; The second Bluetooth device receives a second Bluetooth link establishment response sent by the first Bluetooth device.
6. The method according to claim 5, characterized in that The second Bluetooth device includes information of a device that has been paired with the second Bluetooth device, and the second Bluetooth device determines that a link establishment condition is met according to the first response message, including: If the device information paired with the second Bluetooth device includes the device information of the first Bluetooth device, the second Bluetooth device determines that the link establishment condition is met.
7. A Bluetooth connection method, characterized in that: The method comprises: A first Bluetooth device receives a first broadcast message sent by a second Bluetooth device, where the first broadcast message includes device information of the second Bluetooth device and a first timestamp, where the first timestamp is a sending time corresponding to the first broadcast message; The first Bluetooth device sends a second broadcast message, where the second broadcast message includes device information of the first Bluetooth device and a second timestamp, where the second timestamp is a sending time corresponding to the second broadcast message; If the first Bluetooth device determines that the link establishment condition is met according to the device information of the second Bluetooth device, and the first timestamp and the second timestamp meet a first preset relationship, the first Bluetooth device sends a first Bluetooth link establishment request to the second Bluetooth device; The first Bluetooth device receives a first Bluetooth link establishment response sent by the second Bluetooth device.
8. The method according to claim 7, characterized in that The method further comprises: If the first Bluetooth device determines that the link establishment condition is met according to the device information of the second Bluetooth device, and the first timestamp and the second timestamp satisfy a second preset relationship, the first Bluetooth device determines that the link establishment initiator is the second Bluetooth device; The first Bluetooth device receives a second Bluetooth link establishment request sent by the second Bluetooth device; The first Bluetooth device sends a second Bluetooth link establishment response to the second Bluetooth device.
9. The method according to claim 8, characterized in that The first preset relationship includes that the first timestamp is less than or equal to the second timestamp, and the second preset relationship includes that the first timestamp is greater than the second timestamp; or, The first preset relationship includes that the first timestamp is greater than the second timestamp, and the second preset relationship includes that the first timestamp is less than or equal to the second timestamp.
10. The method according to any one of claims 7 to 9, characterized in that: The first Bluetooth device includes device information that has been paired with the first Bluetooth device, and the first Bluetooth device determines that a link establishment condition is met according to the device information of the second Bluetooth device, including: If the device information paired with the first Bluetooth device includes the device information of the second Bluetooth device, the first Bluetooth device determines that the link establishment condition is met.
11. A Bluetooth connection method, characterized in that: Applied to a first Bluetooth device, the method includes: The second Bluetooth device sends a first broadcast message, where the first broadcast message includes device information of the second Bluetooth device and a first timestamp, where the first timestamp is a sending time corresponding to the first broadcast message; The second Bluetooth device receives a second broadcast message sent by the first Bluetooth device, where the second broadcast message includes device information of the first Bluetooth device and a second timestamp, where the second timestamp is a sending time corresponding to the second broadcast message; If the second Bluetooth device determines that the link establishment condition is met according to the device information of the first Bluetooth device, and the first timestamp and the second timestamp satisfy a first preset relationship, the second Bluetooth device determines that the link establishment initiator is the first Bluetooth device; The second Bluetooth device receives a first Bluetooth link establishment request sent by the first Bluetooth device; In response to the first Bluetooth link establishment request, the second Bluetooth device sends a first Bluetooth link establishment response to the first Bluetooth device.
12. The method according to claim 11, characterized in that The method further comprises: If the second Bluetooth device determines that the link establishment condition is met according to the device information of the first Bluetooth device, and the first timestamp and the second timestamp meet a second preset relationship, the second Bluetooth device sends a second Bluetooth link establishment request to the first Bluetooth device; The second Bluetooth device receives a second Bluetooth link establishment response sent by the first Bluetooth device.
13. The method according to claim 11 or 12, characterized in that The first preset relationship includes that the first timestamp is less than or equal to the second timestamp, and the second preset relationship includes that the first timestamp is greater than the second timestamp; or, The first preset relationship includes that the first timestamp is greater than the second timestamp, and the second preset relationship includes that the first timestamp is less than or equal to the second timestamp.
14. The method according to any one of claims 11 to 13, characterized in that: The second Bluetooth device includes device information that has been paired with the second Bluetooth device, and the second Bluetooth device determines that a link establishment condition is met according to the device information of the first Bluetooth device, including: If the device information paired with the second Bluetooth device includes the device information of the first Bluetooth device, the second Bluetooth device determines that the link establishment condition is met.
15. A Bluetooth device, characterized in that: include: at least one processor; and a memory and a communication interface communicatively connected to the at least one processor; The memory stores instructions that can be executed by the at least one processor, and the at least one processor executes the instructions stored in the memory, so that the Bluetooth device executes the method as described in any one of claims 1-3, or executes the method as described in any one of claims 7-10.
16. A Bluetooth device, characterized in that: include: at least one processor; and a memory and a communication interface communicatively connected to the at least one processor; The memory stores instructions executable by the at least one processor, and the at least one processor executes the instructions stored in the memory, so that the Bluetooth device executes the method as described in any one of claims 4-6, or executes the method as described in any one of claims 11-14.
17. A computer-readable storage medium, characterized in that: The method comprises a program or an instruction, and when the program or the instruction is run on a computer, the method according to any one of claims 1 to 14 is executed.