Bluetooth device connection method and apparatus, terminal device, and storage medium
By broadcasting different status information when the Bluetooth speaker is disconnected, the problem of difficulty in recognizing the Bluetooth speaker in BLE connection is solved, and a fast and low-power connection process is achieved.
Patent Information
- Application Number
- CN202210813173.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-11
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2042-07-11
AI Technical Summary
In existing technologies, when connecting Bluetooth speakers via BLE, it is difficult to identify the Bluetooth speaker that needs to be connected.
When disconnected, the Bluetooth speaker broadcasts a first status message without identification information via BLE so that previously connected host devices can identify and connect to it; when a connection signal is received, it broadcasts a second status message containing identification information so that previously unconnected host devices can display the identification and establish a connection.
It enables rapid identification and connection to the target Bluetooth speaker during BLE connection, reduces power consumption, minimizes interference from identification information, and improves connection efficiency.
Smart Images

Figure CN117425141B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of Bluetooth technology, and in particular to Bluetooth device connection methods, apparatus, terminal devices and storage media. Background Technology
[0002] With the development of technology, the ways to use and control speakers are becoming increasingly diverse. Bluetooth speakers are audio devices that use Bluetooth connectivity to replace traditional wired connections. By connecting to electronic devices such as mobile phones and computers, they provide convenient music playback services and are therefore widely used in various fields. Bluetooth speakers can connect to electronic devices through two connection modes: Bluetooth connection mode and audio cable connection mode. Bluetooth protocols include Classic Bluetooth and BLE (Bluetooth Low Energy). BLE is a personal area network (PAN) technology generally used for connecting electronic devices in fields such as medical, sports and fitness, security, and home entertainment. Compared to Classic Bluetooth, BLE aims to significantly reduce power consumption and cost while maintaining the same communication range.
[0003] The inventors discovered that when electronic devices connect to Bluetooth speakers via BLE, they receive broadcasts from multiple Bluetooth speakers, making it difficult for the electronic devices to identify the Bluetooth speaker they need to connect to. Summary of the Invention
[0004] This invention provides a Bluetooth device connection method, apparatus, terminal device, and storage medium to solve the technical problem in the prior art that it is difficult to identify the Bluetooth speaker to be connected during the process of connecting a Bluetooth speaker via BLE.
[0005] In a first aspect, embodiments of the present invention provide a Bluetooth device connection method for a slave device, comprising:
[0006] In the disconnected state, the first status information is broadcast via BLE so that the first type of device that receives the first status information can connect to the slave device according to the connection information, and the second type of device that receives the first status information ignores the slave device. The first status information includes the connection information of the slave device but does not include the identification information. The first type of device is a master device that has established a connection with the slave device, and the second type of device is a master device that has not established a connection with the slave device.
[0007] Upon receiving a connection signal, the second status information is broadcast via BLE so that the second type of device receiving the second status information can display identification information and establish a connection based on the connection information. The second status information includes the connection information and identification information of the slave device.
[0008] In a second aspect, embodiments of the present invention provide a Bluetooth device connection method for a host device, comprising:
[0009] Receive status information broadcast by the slave device via BLE, including the slave device's connection information;
[0010] When the status information is the first status information and a connection has been established with the slave device, a connection is established with the slave device according to the connection information;
[0011] If the status information is the first status information and no connection has been established with the slave device, the slave device is ignored; the first status information does not include the identification information of the slave device.
[0012] When the status information is the second status information, the identification information of the slave device is displayed. The second status information includes the identification information of the slave device.
[0013] The target slave device is identified based on the displayed identification information, and a connection is established with the target slave device according to the corresponding connection information.
[0014] Thirdly, embodiments of the present invention provide a Bluetooth device connection apparatus for a slave device, comprising:
[0015] The first broadcast unit is used to broadcast first status information via BLE in the disconnected state, so that a first type of device that receives the first status information can connect to the slave device according to the connection information, and a second type of device that receives the first status information can ignore the slave device. The first status information includes the connection information of the slave device but does not include the identification information. The first type of device is a master device that has established a connection with the slave device, and the second type of device is a master device that has not established a connection with the slave device.
[0016] The second broadcast unit is used to broadcast second status information via BLE when a connection signal is received, so that the second type of device that receives the second status information can display identification information and establish a connection based on the connection information. The second status information includes the connection information and identification information of the slave device.
[0017] Fourthly, embodiments of the present invention provide a Bluetooth device connection apparatus for a host device, comprising:
[0018] The first receiving unit is used to receive status information broadcast by the slave device via BLE, including the connection information of the slave device;
[0019] The first connection unit is used to establish a connection with the slave device based on the connection information when the status information is the first status information and a connection has been established with the slave device.
[0020] The information ignoring unit is used to ignore the slave device when the status information is the first status information and no connection has been established with the slave device; the first status information does not include the identification information of the slave device;
[0021] The identification display unit is used to display the identification information of the slave device when the status information is the second status information, wherein the second status information includes the identification information of the slave device;
[0022] The second connection unit is used to identify the target slave device based on the displayed identification information and establish a connection with the target slave device according to the corresponding connection information.
[0023] Fifthly, embodiments of the present invention provide a terminal device, including:
[0024] Bluetooth module;
[0025] One or more processors;
[0026] Memory, used to store one or more computer programs;
[0027] When one or more computer programs are executed by one or more processors, the terminal device enables the Bluetooth device connection method as described in the first or second aspect.
[0028] In a sixth aspect, embodiments of the present invention provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a Bluetooth device connection method as described in the first or second aspect.
[0029] The aforementioned Bluetooth device connection method, apparatus, terminal device, and storage medium, in this method, in a disconnected state, broadcasts first status information via BLE, so that a first type of device receiving the first status information connects to the slave device according to the connection information, and a second type of device receiving the first status information ignores the slave device. The first status information includes the connection information of the slave device but does not include identification information. The first type of device is a master device that has established a connection with the slave device, and the second type of device is a master device that has not established a connection with the slave device. When a connection signal is received, broadcasting second status information via BLE, so that the second type of device receiving the second status information displays the identification information and establishes a connection according to the connection information. The second status information includes the connection information and identification information of the slave device. When a slave device is disconnected, the first status information broadcast via BLE does not include its own identification information. First-class devices that have been connected to it can directly identify and connect to the slave device based on the connection information in the first status information. Second-class devices that have not been connected to it will not display the identification information of nearby slave devices that are disconnected. Therefore, when receiving the identification information sent by the slave device to be connected, the slave device to be connected can be quickly identified without interference from other identification information. This solves the technical problem in the prior art that it is difficult to identify the Bluetooth speaker to be connected when connecting a Bluetooth speaker via BLE. Attached Figure Description
[0030] Figure 1 A flowchart illustrating a Bluetooth device connection method provided in an embodiment of the present invention;
[0031] Figure 2 A flowchart illustrating another Bluetooth device connection method provided in an embodiment of the present invention;
[0032] Figure 3 This is an application scenario diagram illustrating the connection establishment between a host device and a slave device provided in an embodiment of the present invention.
[0033] Figure 4 This is a schematic diagram of a Bluetooth device connection device provided in an embodiment of the present invention;
[0034] Figure 5 This is a schematic diagram of another Bluetooth device connection device provided in an embodiment of the present invention;
[0035] Figure 6 This is a schematic diagram of the structure of a terminal device provided in an embodiment of the present invention. Detailed Implementation
[0036] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are for illustrative purposes only and not for limiting the invention. Furthermore, it should be noted that, for ease of description, the accompanying drawings show only the parts relevant to the present invention and not the entire structure.
[0037] It should be noted that, due to space limitations, this application specification does not exhaustively list all possible implementation methods. Those skilled in the art should be able to conceive after reading this application specification that, as long as the technical features do not contradict each other, any combination of technical features can constitute an optional implementation method.
[0038] The embodiments of the present invention will be described in detail below.
[0039] Figure 1 This is a flowchart illustrating a Bluetooth device connection method provided in an embodiment of the present invention. This Bluetooth device connection method is used for a slave device. Figure 1 As shown, the Bluetooth device connection method includes:
[0040] Step S101: In the disconnected state, broadcast first status information via BLE so that the first type of device that receives the first status information can connect to the slave device according to the connection information, and the second type of device that receives the first status information ignores the slave device. The first status information includes the connection information of the slave device but does not include the identification information. The first type of device is a master device that has established a connection with the slave device, and the second type of device is a master device that has not established a connection with the slave device.
[0041] Wireless communication is one of the main methods of connectivity in the Internet of Things (IoT), and Bluetooth, as a wireless communication technology, plays a crucial role in IoT applications. Bluetooth, based on low-cost short-range wireless connectivity, enables various electronic devices to connect to the internet without cables, thus establishing a communication environment for these devices. Bluetooth devices are the main carriers of Bluetooth technology applications; common Bluetooth devices include computers, mobile phones, Bluetooth headsets, and Bluetooth speakers. Connections between Bluetooth devices require pairing within a certain range; this pairing search method is currently called Short Range Temporary Network (SLTN) mode. Bluetooth devices are equipped with Bluetooth modules to support wireless connections. Bluetooth modules, depending on the application and supported protocols, mainly include Classic Bluetooth modules and BLE modules. In BLE module applications, the roles of Bluetooth devices in a Bluetooth connection can include: broadcaster, scanner, slave device, master device, and initiator. It should be noted that the master device is derived from the initiator and scanner, while the slave device is derived from the broadcaster. In this embodiment, the two parties involved in data communication between multiple Bluetooth devices are defined as the master device and the slave device, respectively.
[0042] The following is a detailed discussion of the working modes of Bluetooth devices for different roles:
[0043] Master device operating mode: As a master device, it can connect to one or more slave devices. In this operating mode, it can search for nearby Bluetooth devices and select the slave device to connect to.
[0044] Slave device operating mode: In this operating mode, Bluetooth devices can only be searched by the host device and cannot be actively searched.
[0045] Specifically, a master device can search for other Bluetooth devices and actively establish connections, while a slave device cannot actively establish connections and can only wait for other Bluetooth devices to connect to it. Normally, a master device can communicate with multiple slave devices simultaneously. Furthermore, a Bluetooth device can switch between master and slave roles at any time. When switched to slave mode, it waits for other Bluetooth devices to initiate connections. When switched to master mode, it can actively initiate connections to other Bluetooth devices.
[0046] In this embodiment, the slave device broadcasts first status information via BLE when disconnected. Since this first status information includes connection information but not its identification information, the host device receiving it typically ignores this information. Connection information may include the slave device's MAC address, operating parameters, device type, and device model, while identification information may be the slave device's name. In practical applications, authorized users can modify the slave device's name, as long as the name identifies the corresponding slave device. This embodiment defines host devices that have established a connection with the slave device as first-class devices, and host devices that have not established a connection with the slave device as second-class devices. It should be noted that the distinction between first-class and second-class devices is merely for clarity and does not represent different types of host devices. For example, based on historical connection relationships, a host device might be a first-class device relative to the former of two slave devices and a second-class device relative to the latter; another host device might be a second-class device relative to the former of two slave devices and a first-class device relative to the latter.
[0047] For the first type of device that needs to establish a connection with a slave device, since a connection has already been established between the two, the first type of device can directly connect to the slave device based on the connection information. For example, many users are accustomed to using Bluetooth headsets or Bluetooth speakers. By enabling the Bluetooth connection function on their mobile phones, they can discover nearby Bluetooth headsets or speakers and actively initiate a connection. When the mobile phone and the Bluetooth headset or speaker have already established a connection, and the Bluetooth headset or speaker broadcasts via BLE while disconnected, the mobile phone can quickly identify the Bluetooth headset or speaker and establish a connection with it. For the second type of device, since the second type of device has not connected to the slave device, when the second type of device does not need to establish a connection with the slave device, it usually ignores the first status information broadcast by the slave device. In addition, since the first status information does not include identification information, the slave device's identification information will not be displayed in the master device. Even if multiple slave devices broadcast first status information via BLE at the same time, the master device will not be interfered with by the identification information of different slave devices, thus enabling it to quickly identify the slave device that needs to be connected.
[0048] Step S102: When a connection signal is received, the second status information is broadcast via BLE so that the second type of device that receives the second status information displays identification information and establishes a connection based on the connection information. The second status information includes the connection information and identification information of the slave device.
[0049] The host device initiates the connection, while the slave device passively searches for connections. When the host device needs to connect to a slave device, it can actively initiate a connection request. In this embodiment, since the first type of device can directly connect to a previously connected slave device (i.e., it doesn't need the slave device's identification information to connect), it doesn't need the slave device to broadcast second status information to establish a connection. Therefore, we only need to consider the case where the second type of device receives the second status information. Furthermore, this embodiment does not consider the case where the first type of device receives the second status information because it can receive the second status information. However, if no connection relationship needs to be established, it will not perform subsequent processing based on the second status information. It can be understood that since the first status information broadcast by the slave device in the disconnected state via BLE only includes connection information and not identification information, the second type of device will directly ignore this first status information. Therefore, if the host device wants to initiate a connection to the slave device, it needs to obtain the slave device's identification information. In this embodiment, the slave device only broadcasts second status information including its identification information via BLE when it receives a connection signal. To trigger the slave device to broadcast second status information including its identification information via BLE, a connection signal can be sent to the slave device or the slave device can be instructed to activate the connection signal under specific conditions. Upon receiving the second status information including its identification information from the slave device, the second type of device can initiate a connection to the corresponding slave device based on that identification information.
[0050] In practice, the connection signal is either a trigger signal generated when a preset button is triggered, or an audio signal with preset audio characteristics received through an audio cable.
[0051] The connection signal can be triggered by the slave device under certain conditions, or it can be sent by a second type of device to the slave device to indicate that it wants to establish a connection. This allows the slave device to broadcast second status information based on the received connection signal. Specifically, a detection device, such as a sensor, can be installed in the slave device. This sensor can detect the measured information and convert it into an electrical signal or other signal output according to a certain rule to meet the requirements of information transmission, processing, storage, display, recording, and control. When the detection device detects that a preset button has been triggered, it generates a trigger signal. The detection device uses this trigger signal as a connection signal and sends it to the slave device, so that the slave device can broadcast second status information upon receiving the connection signal. Of course, the preset button can be triggered by pressing the button, moving the slave device, or shaking the slave device.
[0052] For a slave device in a Bluetooth speaker, due to its product characteristics, once its placement is determined, it is not easily moved in practical applications. Furthermore, the Bluetooth speaker and host device can connect via Bluetooth or an audio cable. Therefore, to enable the Bluetooth speaker to broadcast second status information to the host device, in this embodiment, the host device and Bluetooth speaker can be connected via an audio cable. When the host device needs to connect to the Bluetooth speaker, it can send an audio signal with preset audio characteristics to the Bluetooth speaker via the audio cable. Upon receiving this connection signal, the Bluetooth speaker broadcasts second status information, including its identification information and connection information, via BLE. This identification information is displayed on the host device. Therefore, the host device can establish a connection with the Bluetooth speaker based on the received second status information. Specifically, the content of the audio signal can be set according to actual needs. In this embodiment, the audio signal can be a 3-5 second sound with a frequency of 18kHz. Generally, 18kHz sound will not affect the human ear.
[0053] In practice, both the first and second state information are broadcast via non-directional broadcasting.
[0054] In the BLE protocol, directional broadcasting serves as a fast reconnection mechanism. Its principle involves a Bluetooth device broadcasting a large number of directional messages in a short period, confining the sound to a specific range. Upon receiving these broadcasts, the host device immediately initiates a connection if it wishes to establish a connection with the Bluetooth device. However, existing directional broadcasting technology, due to the rapid transmission of numerous broadcast requests within a short time, consumes a significant amount of power. For Bluetooth speakers, this high power consumption can easily damage the sound quality, negatively impacting user experience. In this embodiment, both the first and second state information are broadcast using non-directional broadcasting. Non-directional broadcasting refers to periodic broadcasting at a lower frequency. This method consumes less power than directional broadcasting, and although the broadcast interval is longer, it does not significantly affect user experience.
[0055] In the specific implementation process, it also includes:
[0056] Step S103: Disable BLE broadcasting while connected.
[0057] In the case of non-directional broadcasting, each BLE broadcast by the slave device is spaced at a preset interval to reduce power consumption. In this embodiment, after the master device connects to the slave device, the slave device disables BLE broadcasting. At this time, it will no longer broadcast the first or second status information. This reduces power consumption and avoids interference to other master devices during the discovery process. Specifically, if the slave device broadcasts the second status information via BLE, the identification information included in the second status information can be displayed on various master devices. Therefore, other master devices may mistakenly connect to the slave device during the discovery process, causing interference to other master devices.
[0058] Corresponding to the Bluetooth device connection method for slave devices described above, this embodiment of the invention provides another Bluetooth device connection method for host devices. Figure 2 A flowchart illustrating another Bluetooth device connection method provided in an embodiment of the present invention. Figure 2 As shown, the Bluetooth device connection method includes:
[0059] Step S201: Receive status information broadcast by the slave device via BLE. The status information includes the connection information of the slave device.
[0060] Step S202: When the status information is the first status information and a connection has been established with the slave device, establish a connection with the slave device according to the connection information.
[0061] Step S203: When the status information is the first status information and no connection has been established with the slave device, ignore the slave device; the first status information does not include the identification information of the slave device.
[0062] Step S204: When the status information is the second status information, display the identification information of the slave device. The second status information includes the identification information of the slave device.
[0063] Step S205: Confirm the target slave device based on the displayed identification information, and establish a connection with the target slave device according to the corresponding connection information.
[0064] The host device can actively search for and discover slave devices and actively establish connections with them. In this embodiment, the host device corresponds to the slave device discussed in the previous embodiments. In practical applications, when the mobile phone acting as the host device has its Bluetooth connection function enabled, it can receive status information broadcast by the slave device via BLE. This status information includes first status information and second status information. The first status information does not include identification information, while the second status information does. To enable the host device to quickly identify the slave device to connect to, the host device automatically ignores the first status information, which does not include identification information, and only displays the identification information in the second status information. A host device that has previously established a connection with a slave device can directly establish a connection with that slave device upon receiving the first status information, achieving a fast reconnection. When the host device receives the second status information, and the host device has not previously established a connection with the slave device corresponding to the identification information, the host device needs to confirm the target slave device and initiate a connection request to establish a connection with it. For example, in practical applications, the mobile phone acts as the host device and the Bluetooth speaker as the slave device. If the mobile phone and the Bluetooth speaker have previously established a connection, when reconnecting after a disconnection, the mobile phone does not need to initiate a new connection request and can directly connect to the Bluetooth speaker. If the mobile phone and the Bluetooth speaker have not previously established a connection, the mobile phone needs to determine the identification information from the received second status information before it can establish a connection with the Bluetooth speaker based on that identification information.
[0065] In the specific implementation process, step S205 includes:
[0066] Step S2051: Save the connection information of the target slave device.
[0067] By saving the connection information in step S2051, the host device can confirm whether the first status information received has been connected, i.e., whether to execute step S202 or step S203 after receiving the first status information.
[0068] Corresponding to step S2051, step S202 specifically includes:
[0069] When the status information is the first status information, and the connection information in the first status information matches the saved connection information, a connection is established with the slave device based on the connection information in the first status information.
[0070] To enable a host device that has already established a connection to a target slave device to quickly reconnect, the host device saves the target slave device's connection information when initially establishing a connection. Upon receiving the first status information, the host device matches the connection information in the first status information with the saved connection information and then establishes a connection with the slave device based on that information. Although the first status information does not display the slave device's identification information, the host device can still connect to the corresponding slave device based on the saved connection information.
[0071] In the specific implementation process, it also includes:
[0072] Step S200: Send an audio signal with preset audio characteristics to the currently connected slave device via an audio cable, so that the slave device broadcasts second status information via BLE.
[0073] When the host device sends an audio signal to the slave device, the slave device will broadcast second status information via BLE so that the host device can obtain the identification information of the slave device. The audio signal in this embodiment is the same as the description of the audio signal in the above embodiment, and will not be repeated here.
[0074] To more clearly illustrate the technical solutions of the embodiments of this application, the embodiments described above are described below in conjunction with specific application scenarios:
[0075] like Figure 3 As shown, assume there are rooms A and B. Room A contains a first master device 10 and a first slave device 100, while room B contains a second master device 11 and a second slave device 111. Initially, no connection has been established between any of the devices. When disconnected, both slave devices 100 and 111 broadcast first status information via BLE. At this time, the first status information broadcast by slave devices 100 and 111 only includes their respective connection information and does not include identification information. Both master devices 10 and 11 can receive the first status information broadcast by slave devices 100 and 111. However, since neither first status information contains identification information, and neither master device 10 nor master device 11 has established a connection, they will ignore the two first status information even if they receive them.
[0076] If both the first host device 10 and the second host device 11 are display tablets, and both the first slave device 100 and the second slave device 111 are Bluetooth speakers, when the first host device 10 has not connected to the first slave device 100 before, it can first send a connection signal to the first slave device 100 via an audio cable. After receiving the connection signal, the first slave device 100 broadcasts second status information including its identification information via BLE. Both the first host device 10 and the second host device 111 process the second status information carrying the identification information upon receipt; that is, the identification information can be processed by both the first host device 10 and the second host device 111. As shown in Figure 1, at this time, the second slave device 111 has not received a connection signal but continues to broadcast the first status information. The first master device 10 and the second master device 11 can only receive the second status information sent by the first slave device 100, and both only display the identification information corresponding to the first slave device 100. Although there are multiple slave devices in the external environment of the first master device 10 and the second master device 11, only the first slave device 100 is displayed. The first master device 10 only needs to select the uniquely displayed first slave device 100 to connect. The second slave device 111 maintains its existing status if it does not receive a selection or connection command. It can be observed that the slave device sends different BLE broadcasts in different states, and the master device responds differently to different BLE broadcasts. This allows the master device to display only one slave device at a time, thereby enabling rapid connection to the target slave device.
[0077] exist Figure 3 In the application scenario shown, after multiple connection and disconnection operations between devices, the first host device 10 and the first slave device 100 are in a connected state, while the second host device 11 and the second slave device 111 are disconnected after the connection, as shown. Figure 3As shown, the first host device 10 and the first slave device 100 are connected by a bold solid line, indicating that a Bluetooth connection is stored between them, enabling data transmission. The second host device 11 and the second slave device 111 are connected by a non-bold solid line, indicating that a connection has been established between them, but they are not currently connected. In the disconnected state, the second slave device 111 broadcasts a first status information via BLE. Upon receiving the first status information broadcast by the second slave device 111 via BLE, the second host device 11 can quickly reconnect to the second slave device 111 based on the connection information carried therein. The first slave device 100 and the second host device 11, as well as the second slave device 111 and the first host device 10, are connected by dashed lines, indicating that when the second host device 11 receives the first status information from the first slave device 100, and the first host device 10 receives the first status information from the second slave device 111, they will ignore the existence of each other and will not perform any connection-related operations.
[0078] Figure 4 This is a schematic diagram of a Bluetooth device connection device provided in an embodiment of the present invention. The Bluetooth device connection device is used for a slave device. (Refer to...) Figure 4 The Bluetooth device connection device includes a first broadcast unit 310 and a second broadcast unit 320.
[0079] The first broadcast unit 310 is used to broadcast first status information via BLE in a disconnected state, so that a first type of device receiving the first status information can connect to the slave device according to the connection information, and a second type of device receiving the first status information can ignore the slave device. The first status information includes the connection information of the slave device but does not include the identification information. The first type of device is a master device that has established a connection with the slave device, and the second type of device is a master device that has not established a connection with the slave device. The second broadcast unit 320 is used to broadcast second status information via BLE when a connection signal is received, so that the second type of device receiving the second status information can display the identification information and establish a connection according to the connection information. The second status information includes the connection information and identification information of the slave device.
[0080] Based on the above embodiments, the connection signal is a trigger signal generated when a preset button is triggered, or an audio signal with preset audio characteristics received through an audio cable.
[0081] Based on the above embodiments, both the first state information and the second state information are broadcast via non-directional broadcasting.
[0082] Based on the above embodiments, it also includes:
[0083] The broadcast shutdown unit is used to disable BLE broadcasting when connected.
[0084] The slave device provided in this embodiment of the invention can be used to execute the corresponding Bluetooth device connection method provided in the above embodiments, and has the corresponding functions and beneficial effects.
[0085] It is worth noting that in the embodiments of the Bluetooth device connection device described above, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the scope of protection of the present invention.
[0086] Figure 5 This is a schematic diagram of a Bluetooth device connection device provided in an embodiment of the present invention, used for a host device, for reference. Figure 5 The Bluetooth device connection device includes a first receiving unit 410, a first connecting unit 420, an information ignoring unit 430, an identification display unit 440, and a second connecting unit 450.
[0087] The system includes a first receiving unit 410, which receives status information broadcast by a slave device via BLE, including connection information of the slave device; a first connecting unit 420, which establishes a connection with the slave device based on the connection information when the status information is the first status information and a connection has been established with the slave device; an information ignoring unit 430, which ignores the slave device when the status information is the first status information and a connection has not been established with the slave device; the first status information does not include the identification information of the slave device; an identification display unit 440, which displays the identification information of the slave device when the status information is the second status information, including the identification information of the slave device; and a second connecting unit 450, which confirms the target slave device based on the displayed identification information and establishes a connection with the target slave device based on the corresponding connection information.
[0088] Based on the above embodiments, the second connection unit 450 includes:
[0089] The storage module is used to save the connection information of the target slave device.
[0090] Correspondingly, the first connection unit 420 is specifically used for:
[0091] When the status information is the first status information, and the connection information in the first status information matches the saved connection information, a connection is established with the slave device based on the connection information in the first status information.
[0092] Based on the above embodiments, it also includes:
[0093] The transmitting unit is used to send an audio signal with preset audio characteristics to the currently connected slave device via an audio cable, so that the slave device can broadcast second status information via BLE.
[0094] The host device provided in this embodiment of the invention can be used to execute the corresponding Bluetooth device connection method provided in the above embodiments, and has corresponding functions and beneficial effects.
[0095] It is worth noting that in the above-described embodiments of the host device, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the scope of protection of the present invention.
[0096] Figure 6 This is a schematic diagram of the structure of a terminal device provided in an embodiment of the present invention. Figure 6 As shown, the terminal device includes a Bluetooth module 500, a processor 510, and a memory 520, and may also include an input device 530, an output device 540, and a communication device 550; the number of processors 510 in the terminal device can be one or more. Figure 6 Taking a processor 510 as an example; the processor 510, memory 520, input device 530, output device 540, and communication device 550 in the terminal device can be connected via a bus or other means. Figure 6 Taking the example of a connection between China and Israel via a bus.
[0097] The memory 520, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as the program instructions / modules corresponding to the Bluetooth device connection method in this embodiment of the invention. The processor 510 executes various functional applications and data processing of the terminal device by running the software programs, instructions, and modules stored in the memory 520, thereby implementing the aforementioned LED display grayscale correction method.
[0098] The memory 520 may primarily include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the terminal device. Furthermore, the memory 520 may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 520 may further include memory remotely located relative to the processor 510, which can be connected to the terminal device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0099] Input device 530 can be used to receive input digital or character information, and to generate key signal inputs related to user settings and function control of the terminal device. Output device 540 may include display devices such as a display screen.
[0100] The aforementioned terminal device includes a Bluetooth device connection device, which can be used to execute any Bluetooth device connection method and has corresponding functions and beneficial effects.
[0101] This invention also provides a computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program performs relevant operations in the Bluetooth device connection method provided in any embodiment of this application, and has corresponding functions and beneficial effects.
[0102] Those skilled in the art will understand that embodiments of this application may be provided as methods, systems, or computer program products.
[0103] Therefore, this application may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, produce implementations of the flowchart... Figure 1 One or more processes and / or boxes Figure 1 The computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The functions specified in one or more boxes. These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable apparatus for implementing the process. Figure 1One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0104] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory. Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0105] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0106] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0107] Note that the above description is merely a preferred embodiment of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of the present invention, the scope of which is determined by the scope of the appended claims.
Claims
1. A Bluetooth device connection method for a slave device, characterized by, Comprising: broadcasting first state information through BLE in the disconnected state, so that a first type of device receiving the first state information connects the slave device according to the connection information, and a second type of device receiving the first state information ignores the slave device, the first state information including the connection information of the slave device and not including identification information, the first type of device being a master device that has established a connection with the slave device, and the second type of device being a master device that has not established a connection with the slave device; when a connection signal is received, broadcasting second state information through BLE, so that a second type of device receiving the second state information displays the identification information and establishes a connection according to the connection information, the second state information including the connection information and identification information of the slave device.
2. The Bluetooth device connection method according to claim 1, wherein, The connection signal is a trigger signal generated when a preset key is triggered, or an audio signal with preset audio characteristics received through an audio line.
3. The Bluetooth device connection method of claim 1, wherein, The first state information and the second state information are both broadcast through non-directional broadcast.
4. The Bluetooth device connection method according to any one of claims 1 to 3, characterized by, Also comprising: turning off BLE broadcast in the connected state.
5. A Bluetooth device connection method for a host device, characterized by, Comprising: receiving state information broadcast by the slave device through BLE, the state information including the connection information of the slave device; when the state information is first state information and a connection has been established with the slave device, establishing a connection with the slave device according to the connection information; when the state information is first state information and a connection has not been established with the slave device, ignoring the slave device; The first state information does not include identification information of the slave device; when the state information is second state information, displaying the identification information of the slave device, the second state information including the identification information of the slave device; confirming a target slave device based on the displayed identification information, and establishing a connection with the target slave device according to the corresponding connection information.
6. The Bluetooth device connection method according to claim 5, wherein, The confirmation of the target slave device based on the displayed identification information and the establishment of the connection with the target slave device according to the corresponding connection information comprises: saving the connection information of the target slave device; Correspondingly, when the state information is first state information and a connection has been established with the slave device, establishing a connection with the slave device according to the connection information, specifically: when the state information is first state information and the connection information in the first state information matches the saved connection information, establishing a connection with the slave device according to the connection information in the first state information.
7. The Bluetooth device connection method according to claim 5 or 6, characterized by, Also comprising: sending an audio signal with preset audio characteristics to the currently connected slave device through an audio line, so that the slave device broadcasts second state information through BLE.
8. A Bluetooth device connection apparatus for a slave device, characterized by comprising: Comprising: The first broadcast unit is configured to broadcast first state information in a disconnected state through BLE, so that a first type of device receiving the first state information connects to the slave device according to connection information, and a second type of device receiving the first state information ignores the slave device, the first state information including the connection information of the slave device and not including identification information, the first type of device being a master device that has established a connection with the slave device, and the second type of device being a master device that has not established a connection with the slave device. The second broadcast unit is configured to broadcast second state information through BLE when a connection signal is received, so that a second type of device receiving the second state information displays the identification information and establishes a connection according to the connection information, the second state information including the connection information and the identification information of the slave device.
9. A Bluetooth device connection device for a host device, characterized in that, The first broadcast unit is configured to broadcast first state information in a disconnected state through BLE, so that a first type of device receiving the first state information connects to the slave device according to connection information, and a second type of device receiving the first state information ignores the slave device, the first state information including the connection information of the slave device and not including identification information, the first type of device being a master device that has established a connection with the slave device, and the second type of device being a master device that has not established a connection with the slave device. The first broadcast unit is configured to broadcast first state information in a disconnected state through BLE, so that a first type of device receiving the first state information connects to the slave device according to connection information, and a second type of device receiving the first state information ignores the slave device, the first state information including the connection information of the slave device and not including identification information, the first type of device being a master device that has established a connection with the slave device, and the second type of device being a master device that has not established a connection with the slave device. The identification display unit is configured to display the identification information of the slave device when the state information is second state information, the second state information including the identification information of the slave device. The second connection unit is configured to confirm a target slave device based on the displayed identification information, and establish a connection with the target slave device according to corresponding connection information. The Bluetooth module; One or more processors; Memory for storing one or more computer programs; 10. A terminal device, comprising: When the one or more computer programs are executed by the one or more processors, the terminal device implements the Bluetooth device connection method of any one of claims 1-7. The computer program is executed by the processor to implement the Bluetooth device connection method of any one of claims 1-7. 11. A computer readable storage medium having stored thereon a computer program, characterized in that,
Citation Information
Patent Citations
Bluetooth connection method, device and system
CN113225693A
Bluetooth connection switching method and equipment, and storage medium
CN113965895A