Communication method of bluetooth protocol, electronic device, apparatus, storage medium and product
Patent Information
- Application Number
- CN202210201987.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-03
- Publication Date
- 2026-09-04
- Estimated Expiration
- 2042-03-03
AI Technical Summary
[0004]相关技术中,第一电子设备的蓝牙控制器频繁的切换信道会导致蓝牙控制器在广播信道的扫描时间短,进而影响蓝牙控制器在广播信道的扫描性能
[0024] In this embodiment, when scanning the first broadcast channel via the first Bluetooth controller, under preset conditions, the scanning of the first broadcast channel by the first Bluetooth controller can be maintained, while the scanning of the first data channel is performed by the second Bluetooth controller. This allows the first electronic device to obtain the second data packet sent through the first data channel while maintaining the scanning of the first broadcast channel, thus obtaining the first data packet broadcast by the second electronic device through the first broadcast channel. This avoids the situation where the scanning time of the first broadcast channel is short due to the first Bluetooth controller switching from the first broadcast channel to the first data channel, thereby improving the scanning performance of the first broadcast channel by the first Bluetooth controller.
Smart Images

Figure CN116744264B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of wireless network technology, and in particular to a Bluetooth protocol communication method, electronic device, apparatus, storage medium, and product. Background Technology
[0002] Currently, two electronic devices can transmit data using Bluetooth Low Energy (BLE) technology. Before the first and second electronic devices can transmit data via BLE, they need to establish a Bluetooth communication connection. When establishing this connection, the first electronic device scans the broadcast channel and, based on the scanned device information of the second electronic device, establishes a Bluetooth communication connection, thereby enabling data transmission.
[0003] The Bluetooth core specification protocol supports multi-channel data transmission. This means it not only supports broadcasting a first data packet (including device information for the second electronic device) via broadcast channels (channels 37, 38, and 39), but also broadcasting (or sending) a second data packet (including device information for the second electronic device or other channels) via data channels (channels 0-36 or other channels). The second data packet contains either device information for the second electronic device or data to be transmitted. Since the first electronic device includes a Bluetooth controller, the Bluetooth controller needs to switch between the two channels to receive both the first and second data packets.
[0004] In related technologies, frequent channel switching by the Bluetooth controller of the first electronic device can lead to a short scanning time for the Bluetooth controller on the broadcast channel, thereby affecting the scanning performance of the Bluetooth controller on the broadcast channel. Summary of the Invention
[0005] This application provides a Bluetooth protocol communication method, electronic device, apparatus, storage medium, and product, which can improve the scanning performance of a first broadcast channel by a first Bluetooth controller. The technical solution is as follows:
[0006] On the one hand, a communication method based on the Bluetooth protocol is provided, executed by a first electronic device, the method comprising:
[0007] The first Bluetooth controller performs a scan of the first broadcast channel to receive a first data packet from the second electronic device;
[0008] Based on the determination that the preset conditions are met, the first Bluetooth controller continues to scan the first broadcast channel, and the second Bluetooth controller performs a scan on the first data channel to receive the second data packet from the second electronic device;
[0009] The second Bluetooth controller is different from the first Bluetooth controller.
[0010] On the other hand, an electronic device is provided, the electronic device including a Bluetooth module, a first Bluetooth controller and a second Bluetooth controller;
[0011] The Bluetooth module is configured to:
[0012] To conduct Bluetooth-based data communication with one or more other electronic devices;
[0013] The first Bluetooth controller is configured as follows:
[0014] A scan is performed on the first broadcast channel to receive a first data packet from the second electronic device;
[0015] Based on the determination that the preset conditions are met, the scanning of the first broadcast channel is continued;
[0016] The second Bluetooth controller is configured as follows:
[0017] Based on the knowledge that the preset conditions are met, a scan is performed on the first data channel to receive a second data packet from the second electronic device.
[0018] On the other hand, a Bluetooth protocol communication device is provided, the device comprising:
[0019] A first execution module is configured to perform a scan of a first broadcast channel via a first Bluetooth controller to receive a first data packet from a second electronic device;
[0020] The second execution module is configured to maintain the scanning of the first broadcast channel by the first Bluetooth controller based on the determination that a preset condition is met, and to perform a scan of the first data channel by the second Bluetooth controller to receive a second data packet from the second electronic device; wherein the second Bluetooth controller is different from the first Bluetooth controller.
[0021] On the other hand, an electronic device is provided, the electronic device including a processor and a memory; the memory stores at least one piece of program code, the at least one piece of program code being executed by the processor to implement the communication method of the Bluetooth protocol as described above.
[0022] On the other hand, a computer-readable storage medium is provided that stores at least one piece of program code, the at least one piece of program code being executed by a processor to implement a communication method of the Bluetooth protocol as described above.
[0023] On the other hand, a computer program product is provided, the computer program product storing at least one piece of program code, the at least one piece of program code being executed by a processor to implement a communication method of the Bluetooth protocol as described in any of the above implementations.
[0024] In this embodiment, when scanning the first broadcast channel via the first Bluetooth controller, under preset conditions, the scanning of the first broadcast channel by the first Bluetooth controller can be maintained, while the scanning of the first data channel is performed by the second Bluetooth controller. This allows the first electronic device to obtain the second data packet sent through the first data channel while maintaining the scanning of the first broadcast channel, thus obtaining the first data packet broadcast by the second electronic device through the first broadcast channel. This avoids the situation where the scanning time of the first broadcast channel is short due to the first Bluetooth controller switching from the first broadcast channel to the first data channel, thereby improving the scanning performance of the first broadcast channel by the first Bluetooth controller. Attached Figure Description
[0025] Figure 1 A schematic diagram illustrating an implementation environment provided by an exemplary embodiment of this application is shown;
[0026] Figure 2 A flowchart illustrating a Bluetooth protocol communication method is shown in an exemplary embodiment of this application;
[0027] Figure 3 A flowchart illustrating a Bluetooth protocol communication method is shown in an exemplary embodiment of this application;
[0028] Figure 4 A schematic diagram illustrating a channel scan is shown in an exemplary embodiment of this application;
[0029] Figure 5 A schematic diagram of the structure of a first electronic device illustrated in an exemplary embodiment of this application is shown;
[0030] Figure 6 A schematic diagram of the structure of a first electronic device illustrated in an exemplary embodiment of this application is shown;
[0031] Figure 7 A flowchart illustrating a Bluetooth protocol communication method is shown in an exemplary embodiment of this application;
[0032] Figure 8 A flowchart illustrating a Bluetooth protocol communication method is shown in an exemplary embodiment of this application;
[0033] Figure 9 A flowchart illustrating a Bluetooth protocol communication method is shown in an exemplary embodiment of this application;
[0034] Figure 10 A flowchart illustrating a Bluetooth protocol communication method is shown in an exemplary embodiment of this application;
[0035] Figure 11 A block diagram of a Bluetooth protocol communication device is shown in an exemplary embodiment of this application;
[0036] Figure 12 A structural block diagram of an electronic device illustrated in an exemplary embodiment of this application is shown;
[0037] Figure 13 A structural block diagram of an electronic device illustrated in an exemplary embodiment of this application is shown;
[0038] Figure 14 A structural block diagram of an electronic device illustrated in an exemplary embodiment of this application is shown. Detailed Implementation
[0039] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0040] In this document, "multiple" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. Furthermore, the relevant data involved in this application can be data authorized by the user or fully authorized by all parties.
[0041] Please refer to Figure 1 This illustration shows a schematic diagram of an implementation environment for the Bluetooth protocol communication method provided in an exemplary embodiment of this application. In this implementation environment, the environment includes a first electronic device 100 and at least one second electronic device 200; the first electronic device 100 and each of the second electronic devices 200 communicate via corresponding Bluetooth communication connections. Both the first electronic device 100 and the second electronic device 200 can be devices applying the Bluetooth Core Specification 5.0 protocol or other Bluetooth Core Specification protocols, such as Bluetooth Core Specification 6.0, Bluetooth Core Specification 7.0, etc., but are not limited thereto. The two electronic devices can transmit data via Bluetooth Low Energy technology. Both the first electronic device 100 and the second electronic device 200 can be terminal devices or wearable electronic devices; for example, both the first electronic device 100 and the second electronic device 200 can be at least one of a mobile phone, tablet computer, personal computer (PC), headset, watch, glasses, etc.
[0042] Please refer to Figure 2 This document illustrates a flowchart of a Bluetooth protocol communication method according to an exemplary embodiment of this application. The executing entity in this embodiment is a first electronic device, and the method includes:
[0043] Step 201: Perform a scan of the first broadcast channel by the first Bluetooth controller to receive the first data packet from the second electronic device.
[0044] Step 202: Based on the determination that the preset conditions are met, the first Bluetooth controller continues to scan the first broadcast channel, and the second Bluetooth controller performs a scan on the first data channel to receive the second data packet from the second electronic device; wherein the second Bluetooth controller is different from the first Bluetooth controller.
[0045] In some embodiments, the preset conditions include:
[0046] The second electronic device broadcasts via Bluetooth through the first data channel.
[0047] In some embodiments, the preset conditions include:
[0048] The second electronic device establishes a Bluetooth communication connection with the first electronic device to use the first data channel.
[0049] In some embodiments, the first Bluetooth controller is independent of the first electronic device.
[0050] In some embodiments, the second Bluetooth controller is independent of the first electronic device.
[0051] In some embodiments, determining that a preset condition is met includes:
[0052] If the first data packet is broadcast by the second electronic device and includes auxiliary information, then it is determined that the second electronic device broadcasts via Bluetooth through the first data channel to send the second data packet, and the auxiliary information is used to instruct the second electronic device to broadcast via Bluetooth through the first data channel to send the second data packet.
[0053] In some embodiments, the auxiliary information includes the channel identifier of the target sub-channel and the target time, where the target sub-channel is the sub-channel for transmitting the second data packet and the target time is the time for transmitting the second data packet;
[0054] A second Bluetooth controller performs a scan of the first data channel to receive a second data packet from a second electronic device, including:
[0055] Send the channel identifier and target time to the second Bluetooth controller;
[0056] The second Bluetooth controller is instructed to scan the target sub-channel corresponding to the channel identifier at a target time to receive the second data packet from the second electronic device.
[0057] In some embodiments, the first Bluetooth controller and the second Bluetooth controller are electrically connected;
[0058] Send the channel identifier and target time to the second Bluetooth controller, including:
[0059] The channel identifier and target time are sent to the second Bluetooth controller via the first Bluetooth controller.
[0060] In some embodiments, the first electronic device includes a scheduling module, which is electrically connected to a first Bluetooth controller and a second Bluetooth controller respectively;
[0061] Send the channel identifier and target time to the second Bluetooth controller, including:
[0062] The channel identifier and target time are sent to the second Bluetooth controller via the scheduling module.
[0063] In some embodiments, the method further includes:
[0064] Based on the determination that the second Bluetooth controller performs a scan on the first data channel to receive the second data packet, the first Bluetooth controller performs a scan on the second data channel to receive the third data packet from the third electronic device.
[0065] In some embodiments, the method further includes:
[0066] Based on the determination that the second Bluetooth controller performs a scan on the first data channel to receive the second data packet, the first Bluetooth controller performs a scan on the Bluetooth audio link to receive audio data from the fourth electronic device.
[0067] In some embodiments, the method further includes:
[0068] Based on the determination that the preset conditions are not met, the first Bluetooth controller continues to scan the first broadcast channel, and the second Bluetooth controller performs a broadcast to broadcast the fourth data packet.
[0069] In this embodiment, when scanning the first broadcast channel via the first Bluetooth controller, under preset conditions, the scanning of the first broadcast channel by the first Bluetooth controller can be maintained, while scanning of the first data channel is performed via the second Bluetooth controller. This allows the first electronic device to obtain the second data packet sent via the first data channel while maintaining scanning of the first broadcast channel to obtain the first data packet broadcast by the second electronic device via the first broadcast channel. This avoids the situation where the scanning time of the first broadcast channel is short due to the first Bluetooth controller switching from the first broadcast channel to the first data channel, thereby improving the scanning performance of the first broadcast channel by the first Bluetooth controller.
[0070] Please refer to Figure 3The document illustrates a flowchart of a Bluetooth protocol communication method according to an exemplary embodiment of this application, wherein the execution subject of this embodiment is a first electronic device. The method includes:
[0071] Step 301: The first electronic device scans the first broadcast channel via the first Bluetooth controller to receive the first data packet from the second electronic device.
[0072] In one implementation, the first electronic device includes two Bluetooth controllers, namely a first Bluetooth controller and a second Bluetooth controller. The second Bluetooth controller is different from the first Bluetooth controller. The first electronic device can perform scanning of broadcast channels or data channels through the first Bluetooth controller and the second Bluetooth controller, respectively.
[0073] In another implementation, both the first Bluetooth controller and the second Bluetooth controller are independent of the first electronic device, thus facilitating their reuse by multiple electronic devices and improving their utilization rate. In yet another implementation, the first electronic device includes a first Bluetooth controller, and the second Bluetooth controller is independent of the first electronic device, further facilitating its reuse by multiple electronic devices and improving its utilization rate. In yet another implementation, the first electronic device includes a second Bluetooth controller, and the first Bluetooth controller is independent of the first electronic device, further facilitating its reuse by multiple electronic devices and improving its utilization rate.
[0074] The first broadcast channel is used to broadcast a first data packet, which is then used by the second electronic device to establish a Bluetooth communication connection with the first electronic device. Optionally, the second electronic device broadcasts the first data packet through the first broadcast channel, and the first electronic device scans the first broadcast channel to obtain the first data packet broadcast by the second electronic device through the first broadcast channel. The second electronic device and the first electronic device then establish a Bluetooth communication connection through the first data packet, which is used for data transmission between the two electronic devices. The first broadcast channel is the primary broadcast channel, including at least one of channels 37, 38, and 39, with channels 37, 38, and 39 corresponding to frequencies of 2402MHz, 2426MHz, and 2480MHz, respectively. Optionally, the first broadcast channel may also include other channels besides channels 37, 38, and 39; for example, other channels may be channels 57, 58, or 59, etc., which are not specifically limited in this embodiment.
[0075] It should be noted that the first electronic device may also include multiple first Bluetooth controllers and multiple second Bluetooth controllers. The number of first Bluetooth controllers and second Bluetooth controllers can be set and changed as needed, and this is not limited in the embodiments of this application; optionally, the number of first Bluetooth controllers and second Bluetooth controllers is two each.
[0076] Step 302: The first electronic device, based on the determination that the second electronic device is broadcasting via Bluetooth through the first data channel, maintains the scanning of the first broadcast channel by the first Bluetooth controller.
[0077] In this embodiment, the second electronic device broadcasts via Bluetooth through the first data channel to send a second data packet to the first electronic device. The second data packet is used to establish a Bluetooth communication connection between the second and first electronic devices. The first data channel includes at least one channel from channel 0 to 36 for data transmission or broadcasting of data packets. Optionally, the first data channel may also include other channels besides channels 0 to 36; for example, other channels may be channels 40 to 56, etc., but this is not specifically limited in this embodiment.
[0078] It should be noted that, since the second electronic device can broadcast the second data packet to the first electronic device through the first data channel, and the first data channel and the first broadcast channel are different channels, a Bluetooth controller cannot scan the first data channel and the first broadcast channel simultaneously. However, in this application, after determining that the second electronic device broadcasts Bluetooth through the first data channel, the first Bluetooth controller continues to scan the first broadcast channel, which ensures that the first electronic device can receive the first data packet broadcast by the second electronic device through the first broadcast channel. Furthermore, since the first electronic device can also receive the second data packet broadcast by the second electronic device through the first data channel by scanning the first data channel through the second Bluetooth controller, it is ensured that the first electronic device can completely receive the data packet from the second electronic device.
[0079] In some embodiments, the process by which the first electronic device determines that the second electronic device is broadcasting via Bluetooth through the first data channel is as follows: if the first data packet is broadcast by the second electronic device and the first data packet includes auxiliary information, then the first electronic device determines that the second electronic device is broadcasting via Bluetooth through the first data channel to send the second data packet.
[0080] The first electronic device determines whether the first data packet was broadcast by the second electronic device. If the first data packet was broadcast by the second electronic device, the first electronic device determines whether the first data packet includes auxiliary information. If the first data packet includes auxiliary information, the first electronic device determines that the second electronic device broadcasts the second data packet via Bluetooth through the first data channel. The auxiliary information instructs the second electronic device to send the second data packet through the first data channel. The auxiliary information includes the channel identifier of the target sub-channel and the target time. The target sub-channel is the sub-channel for sending the second data packet, and the target time is the time when the second data packet is sent. Optionally, see [link to relevant documentation]. Figure 4 The first data packet sent by the second electronic device through the first broadcast channel includes auxiliary information corresponding to at least one auxiliary extended indication (AUX_EXT_IND) pointing to the first data channel. This auxiliary information includes an auxiliary chain indication (AUX_CHAIN_IND) and an auxiliary synchronous indication (AUX_SYNC_IND), pointing to the channel identifier and target time of the target sub-channel, respectively. Optionally, the auxiliary information may also include a manufacturer-defined device name, device identifier, and other device coding information of the second electronic device; however, this is not specifically limited in this embodiment. In one implementation, the first electronic device can accurately locate the second electronic device based on its device name, device identifier, and other device coding information included in the auxiliary information, thereby enabling Bluetooth communication with the second electronic device.
[0081] It should be noted that when the second electronic device broadcasts the second data packet to the first electronic device through the first data channel, the first data packet broadcast by the first broadcast channel needs to carry indication information that the second electronic device sent the second data packet through the first data channel. However, in this embodiment, by determining whether the first data packet was broadcast by the second electronic device and whether the first data packet carries auxiliary information indicating the first data channel, the accuracy of determining whether the second electronic device broadcasts the second data packet via Bluetooth through the first data channel can be improved.
[0082] Step 303: The first electronic device sends the channel identifier and target time to the second Bluetooth controller.
[0083] In some embodiments, the number of second Bluetooth controllers is at least two. The second Bluetooth controller in this step is one of at least two Bluetooth controllers included in the first electronic device or one of at least two Bluetooth controllers independent of the first electronic device. The first electronic device determines a target Bluetooth controller among the at least two second Bluetooth controllers and sends a channel identifier and a target time to the target Bluetooth controller. Optionally, the target Bluetooth controller may be the Bluetooth controller used for scanning data channels among the plurality of second Bluetooth controllers, or the Bluetooth controller that performs the fewest scans among the plurality of second Bluetooth controllers, or the Bluetooth controller whose scan time is longest from the current time among the plurality of second Bluetooth controllers, but is not limited to these.
[0084] In some embodiments, the first Bluetooth controller and the second Bluetooth controller are electrically connected; the first electronic device sends the channel identifier and target time to the second Bluetooth controller through the first Bluetooth controller.
[0085] Optionally, see Figure 5 The first Bluetooth controller is electrically connected to the Bluetooth module and the second Bluetooth controller via a first interface and a second interface, respectively. The Bluetooth module is the Bluetooth host component, used to control the first and second Bluetooth controllers. Optionally, the first interface is a Host Controller Interface (HCI), through which the Bluetooth module connects to the first Bluetooth controller. The Bluetooth module can send commands to the first Bluetooth controller via the first interface, thereby enabling the first Bluetooth controller to perform a scan of the first broadcast channel. Optionally, the Bluetooth module can also instruct the second Bluetooth controller to perform a scan via the first Bluetooth controller.
[0086] In one implementation, a first Bluetooth controller scans a first broadcast channel to obtain a first data packet broadcast by a second electronic device through the first broadcast channel. Based on auxiliary information included in the first data packet, it obtains the channel identifier and target time of a target sub-channel and sends the channel identifier and target time to a second Bluetooth controller. Optionally, the first Bluetooth controller sends a scan command to the second Bluetooth controller, the scan command carrying the channel identifier and target time, and the scan command instructs the second Bluetooth controller to perform a scan on the first data channel. In this embodiment, by connecting the first Bluetooth controller and the second Bluetooth controller, the first Bluetooth controller can directly send the channel identifier and target time obtained from scanning the first broadcast channel to the second Bluetooth controller, thereby improving the efficiency of transmitting the channel identifier and target time, and thus improving the efficiency of the subsequent scan performed by the second Bluetooth controller.
[0087] In another implementation, the first Bluetooth controller sends the first data packet obtained from scanning the first broadcast channel to the Bluetooth module. After determining the auxiliary information in the first data packet, the Bluetooth module sends a scan command to the first Bluetooth controller. This scan command carries the channel identifier and target time, and instructs the second Bluetooth controller to perform a scan on the first data channel. The first Bluetooth controller then forwards the scan command to the second Bluetooth controller. In this implementation, the auxiliary information in the first data packet is determined by the Bluetooth module, and the scan command is synthesized by the Bluetooth module. Only the auxiliary information is forwarded by the first Bluetooth controller, reducing the workload of the first Bluetooth controller and ensuring that the first Bluetooth controller can perform channel scanning stably and efficiently.
[0088] In some embodiments, the first electronic device includes a scheduling module electrically connected to both a first Bluetooth controller and a second Bluetooth controller. The first electronic device transmits the channel identifier and target time to the second Bluetooth controller via the scheduling module. Optionally, see [link to relevant documentation]. Figure 6 The scheduling module connects to the Bluetooth module via a third interface and to the first and second Bluetooth controllers via fourth and fifth interfaces, respectively. The Bluetooth module sends commands to the first and second Bluetooth controllers through the scheduling module, thus scheduling the first or second Bluetooth controller to perform channel scanning. The interface types of the third, fourth, and fifth interfaces can be set and changed as needed; in this embodiment, no specific limitation is made.
[0089] In one implementation, the first Bluetooth controller sends a first data packet obtained from scanning the first broadcast channel to a scheduling module. After determining the auxiliary information in the first data packet, the scheduling module sends a scan command to the second Bluetooth controller. This scan command carries a channel identifier and a target time, and instructs the second Bluetooth controller to perform a scan on the first data channel. In this implementation, by sending the channel identifier and target time to the second Bluetooth controller through the scheduling module, and instructing the second Bluetooth controller to perform a scan on the first data channel, scheduling of the second Bluetooth controller is achieved, and the workload of the first Bluetooth controller is reduced, thereby ensuring that the first Bluetooth controller can perform channel scanning stably and efficiently.
[0090] In another implementation, the first Bluetooth controller sends the first data packet obtained from scanning the first broadcast channel to the Bluetooth module through the scheduling module. After determining the auxiliary information in the first data packet, the Bluetooth module sends a scanning command to the second Bluetooth controller through the scheduling module. Thus, the scheduling module can effectively control the second Bluetooth controller to perform channel scanning, enabling the first Bluetooth controller and the second Bluetooth controller to perform scanning in a coordinated manner.
[0091] Step 304: The first electronic device instructs the second Bluetooth controller to scan the target sub-channel corresponding to the channel identifier at the target time to receive the second data packet from the second electronic device.
[0092] In some embodiments, the first electronic device sends a scanning command carrying a channel identifier and a target time to the second Bluetooth controller. This scanning command further instructs the second Bluetooth controller to scan the first data channel. Specifically, the scanning command instructs the second Bluetooth controller to scan the target sub-channel corresponding to the channel identifier at the target time. The target sub-channel is at least one of the first data channels 0-36. Optionally, the target sub-channel can also be other channels used for transmitting the second data packet besides channels 0-36; for example, other channels can be at least one of channels 40-56. In this embodiment, this is not specifically limited. Optionally, the channel identifier is a channel number or channel frequency, etc.; in this embodiment, the channel identifier is not specifically limited.
[0093] In one implementation, after receiving the channel identifier and target time, the first electronic device instructs the second Bluetooth controller to formulate a scanning action based on the channel identifier and target time. The second Bluetooth controller then performs the scan based on this scanning action, that is, scanning the target sub-channel corresponding to the channel identifier at the target time. Specifically, the first electronic device scans the first data channel through the second Bluetooth controller to obtain the second data packet transmitted by the second electronic device through the first data channel.
[0094] Optionally, the first electronic device and the second electronic device provided in this application embodiment are both electronic devices using Bluetooth Low Energy (BLE) technology. For electronic devices using BLE technology, Bluetooth broadcasting and scanning are crucial, providing a fundamental guarantee for device discovery and rapid connection between electronic devices. Furthermore, with the rapid development of BLE audio technology in electronic devices, the application of data packet broadcasting via data channels will become increasingly widespread. The method provided in this application embodiment can maximize support for data packet broadcasting via data channels while ensuring the basic performance of Bluetooth broadcasting and scanning in electronic devices, thereby improving the overall performance of Bluetooth broadcasting and scanning in electronic devices.
[0095] See also Figure 4 , Figure 4 This diagram illustrates how a first electronic device scans a first broadcast channel and a first data channel via a first Bluetooth controller and a second Bluetooth controller, respectively. The first Bluetooth controller continuously scans the first broadcast channel, while the second Bluetooth controller scans the first data channel. The first electronic device performs a periodic scan of the broadcast channel, scanning it once at preset intervals, creating a scanning window. As shown in the diagram, even if the second electronic device broadcasts a second data packet to the first electronic device via the first data channel, the first electronic device still needs to obtain auxiliary information pointing to the first data channel from the first data packet broadcast via the first broadcast channel. Therefore, ensuring the scanning duration of the first broadcast channel is crucial for obtaining complete data packets.
[0096] In this embodiment, because the first electronic device uses two Bluetooth controllers, it can not only continue scanning the first broadcast channel while the second electronic device is broadcasting the second data packet via the first data channel, but also scan the first broadcast channel through the second Bluetooth controller, so that the first electronic device can obtain the second data packet sent via the first data channel. This avoids the situation where the scanning time of the first broadcast channel is short due to the first Bluetooth controller switching from the first broadcast channel to other channels, thereby improving the scanning performance of the first Bluetooth controller on the first broadcast channel.
[0097] Please refer to Figure 7 The document illustrates a flowchart of a Bluetooth protocol communication method according to an exemplary embodiment of this application, wherein the execution subject of this embodiment is a first electronic device. The method includes:
[0098] Step 701: The first electronic device scans the first broadcast channel via the first Bluetooth controller to receive the first data packet from the second electronic device.
[0099] This step is the same as step 301, and will not be repeated here.
[0100] Step 702: Based on the determination that the second electronic device has established a Bluetooth communication connection with the first electronic device to use the first data channel, the first electronic device maintains the scanning of the first broadcast channel by the first Bluetooth controller, and performs a scan of the first data channel by the second Bluetooth controller to receive the second data packet from the second electronic device.
[0101] Optionally, the process of establishing a Bluetooth communication connection between the first electronic device and the second electronic device is as follows: after the first electronic device scans the first broadcast channel through the first Bluetooth controller to receive the first data packet of the second electronic device, the first electronic device establishes a Bluetooth communication connection with the second electronic device based on the first data packet. After the first electronic device and the second electronic device establish a Bluetooth communication connection, the first data channel is used to transmit data between the first electronic device and the second electronic device.
[0102] In this embodiment, since the first electronic device uses two Bluetooth controllers, it can not only receive the second data packet from the second electronic device when the second electronic device establishes a Bluetooth communication connection with the first electronic device and uses the first data channel, but also receive the first data packet broadcast by the second electronic device through the first broadcast channel by maintaining a scan of the first broadcast channel. This avoids the situation where the first broadcast channel scan time is short due to the first Bluetooth controller switching from the first broadcast channel to other channels, thereby improving the scanning performance of the first Bluetooth controller on the first broadcast channel.
[0103] Please refer to Figure 8 The document illustrates a flowchart of a Bluetooth protocol communication method according to an exemplary embodiment of this application, wherein the execution subject of this embodiment is a first electronic device. The method includes:
[0104] Step 801: The first electronic device scans the first broadcast channel via the first Bluetooth controller to receive the first data packet from the second electronic device.
[0105] Step 801 is similar to step 301, and will not be repeated here.
[0106] Step 802: Based on the determination that the preset conditions are met, the first electronic device maintains the scanning of the first broadcast channel by the first Bluetooth controller, and performs a scan of the first data channel by the second Bluetooth controller to receive the second data packet from the second electronic device.
[0107] If the preset condition is that the second electronic device broadcasts via Bluetooth through the first data channel, then the process of step 802, in which the second Bluetooth controller scans the first data channel to receive the second data packet from the second electronic device, is the same as steps 302-304, and will not be repeated here. If the preset condition is that the second electronic device establishes a Bluetooth communication connection with the first electronic device to use the first data channel, then step 802 is the same as step 702, and will not be repeated here.
[0108] Step 803: The first electronic device, based on the determination that the second Bluetooth controller is scanning the first data channel to receive the second data packet, scans the second data channel through the first Bluetooth controller to receive the third data packet from the third electronic device.
[0109] The second data channel is used to broadcast a third data packet, which is used by the third electronic device to establish a Bluetooth communication connection with the first electronic device. The second data channel includes at least one channel from channels 0-36 for data transmission or broadcasting data packets. Optionally, the second data channel may also include other channels besides channels 0-36; for example, other channels may be channels 40-56, etc., which are not specifically limited in this embodiment. Optionally, the first data channel and the second data channel may be the same or different; for example, the first data channel may be channel 36 and the second data channel may be channel 36, or the first data channel may be channel 36 and the second data channel may be channel 35, which are not specifically limited in this application.
[0110] In some embodiments, before the first electronic device executes step 803, it determines whether the third electronic device is broadcasting via Bluetooth through the second data channel to send a third data packet. In one implementation, if the first electronic device scans the first broadcast channel through the first Bluetooth controller to receive a first data packet from the second electronic device, and detects a data packet including indication information that the third electronic device is broadcasting a third data packet via the second data channel, then the first electronic device determines that the third electronic device is broadcasting via Bluetooth through the second data channel to send a third data packet, and then the first electronic device executes step 803.
[0111] In this embodiment, when both electronic devices broadcast data packets via the data channel, the first electronic device controls the scanning channel of the first Bluetooth controller to switch to the data channel and also performs a scan on the data channel. That is, the first electronic device scans the data channels corresponding to the two electronic devices through the first Bluetooth controller and the second Bluetooth controller respectively, to obtain the second data packets sent by the two electronic devices through the data channels. In this way, the first electronic device scans the data channels through the two Bluetooth controllers respectively, thereby improving the efficiency of obtaining data packets broadcast by other electronic devices through the data channels.
[0112] Please refer to Figure 9 The document illustrates a flowchart of a Bluetooth protocol communication method according to an exemplary embodiment of this application, wherein the execution subject of this embodiment is a first electronic device. The method includes:
[0113] Step 901: The first electronic device scans the first broadcast channel via the first Bluetooth controller to receive the first data packet from the second electronic device.
[0114] This step is the same as step 301, and will not be repeated here.
[0115] Step 902: Based on the determination that the preset conditions are met, the first electronic device maintains the scanning of the first broadcast channel by the first Bluetooth controller, and performs a scan of the first data channel by the second Bluetooth controller to receive the second data packet from the second electronic device.
[0116] This step is the same as step 802, and will not be repeated here.
[0117] Step 903: Based on the determination that the second Bluetooth controller is performing a scan on the first data channel to receive the second data packet, the first electronic device performs a scan on the Bluetooth audio link through the first Bluetooth controller to receive audio data from the fourth electronic device.
[0118] The Bluetooth audio link is established between the fourth electronic device and the first electronic device for transmitting audio data. Optionally, the Bluetooth audio link is a data channel through which the fourth electronic device sends a second data packet. The data channel includes at least one channel from channel 0 to 36 for data transmission or broadcasting of data packets. Optionally, the data channel may also include other channels besides channels 0 to 36; for example, other channels may be channels 40 to 56, etc., which are not specifically limited in this embodiment.
[0119] In some embodiments, before the first electronic device executes step 903, it determines whether the fourth electronic device is transmitting audio data via a Bluetooth audio link. In one implementation, if the first electronic device determines that a Bluetooth audio link has been established between the fourth electronic device and the first electronic device, and the first electronic device determines that the fourth electronic device is transmitting audio data via the Bluetooth audio link, then the first electronic device executes step 903 to receive audio data from the fourth electronic device.
[0120] In one implementation, if the first electronic device obtains the fifth data packet of the fourth electronic device through the first Bluetooth controller, and establishes a Bluetooth audio link with the fourth electronic device, the first electronic device transmits data with the fourth electronic device through the established Bluetooth audio link via the first Bluetooth controller, while the first electronic device receives the second data packet through the second Bluetooth controller. This allows the first electronic device to receive the second data packet while simultaneously transmitting audio data via frequency division multiplexing.
[0121] In this embodiment, since the first electronic device can receive the second data packet from the second electronic device by scanning the first data channel through the second Bluetooth controller, it can also receive the audio data sent by the fourth electronic device through the Bluetooth audio link by scanning the Bluetooth audio link through the first Bluetooth controller. This allows the first electronic device to receive the second data packet from the second electronic device and the audio data from the fourth electronic device through two Bluetooth controllers respectively, thereby improving the efficiency of the first electronic device in receiving data.
[0122] Please refer to Figure 10 The document illustrates a flowchart of a Bluetooth protocol communication method according to an exemplary embodiment of this application, wherein the execution subject of this embodiment is a first electronic device. The method includes:
[0123] Step 1001: The first electronic device scans the first broadcast channel via the first Bluetooth controller to receive the first data packet from the second electronic device.
[0124] This step is the same as step 301, and will not be repeated here.
[0125] Step 1002: Based on the determination that the preset conditions are not met, the first electronic device continues to scan the first broadcast channel by the first Bluetooth controller and performs a broadcast through the second Bluetooth controller to broadcast the fourth data packet.
[0126] The preset conditions include at least one of the following: the second electronic device broadcasts Bluetooth through the first data channel and the second electronic device establishes a Bluetooth communication connection with the first electronic device to use the first data channel. If neither of these preset conditions is met, the first electronic device determines that the preset conditions are not met.
[0127] The fourth data packet is used by the electronic device receiving the fourth data packet to establish a Bluetooth communication connection with the first electronic device. Optionally, the first electronic device broadcasts the fourth data packet through a broadcast channel or a data channel; this application does not specifically limit this.
[0128] In this embodiment, since the first electronic device uses two Bluetooth controllers, it can broadcast data packets through the second Bluetooth controller while maintaining scanning of the first broadcast channel through the first Bluetooth controller. This allows the first electronic device to establish Bluetooth communication connections with other electronic devices by performing Bluetooth broadcasts while maintaining scanning of the first broadcast channel. This avoids the situation where the scanning time of the first broadcast channel is short due to the first Bluetooth controller switching from scanning to broadcasting, thereby improving the scanning performance of the first Bluetooth controller on the first broadcast channel.
[0129] In some embodiments, the number of Bluetooth controllers corresponding to the first electronic device is three. These three Bluetooth controllers can be either included in the first electronic device or independent of it. The first electronic device scans the first broadcast channel through the first Bluetooth controller. Optionally, if a second electronic device broadcasts via Bluetooth through the first data channel to send a second data packet, and a third electronic device broadcasts via Bluetooth through the second data channel to send a third data packet, the first electronic device maintains the scanning of the first broadcast channel by the first Bluetooth controller, scans the first data channel through the second Bluetooth controller, and scans the second data channel through the third Bluetooth controller. Optionally, if a second electronic device broadcasts via Bluetooth through the first data channel to send a second data packet, and a fourth electronic device sends audio data through a Bluetooth audio link, the first electronic device maintains the scanning of the first broadcast channel by the first Bluetooth controller, scans the first data channel through the second Bluetooth controller, and scans the Bluetooth audio link through the third Bluetooth controller to transmit audio data with the fourth electronic device. Optionally, if the second electronic device broadcasts via Bluetooth through the second broadcast channel and the third electronic device broadcasts via Bluetooth through the third broadcast channel, the first electronic device maintains the scanning of the first broadcast channel by the first Bluetooth controller, performs scanning of the second broadcast channel by the second Bluetooth controller, and performs scanning of the third broadcast channel by the third Bluetooth controller.
[0130] In some embodiments, the number of Bluetooth controllers corresponding to the first electronic device is four. These four Bluetooth controllers can be either included in the first electronic device or independent of it. The first electronic device scans the first broadcast channel through the first Bluetooth controller. Optionally, if a second electronic device broadcasts via Bluetooth through the first data channel to send a second data packet, and a third electronic device broadcasts via the second data channel to send a third data packet, and a fourth electronic device sends audio data via the Bluetooth audio link, then the first electronic device maintains the scanning of the first broadcast channel by the first Bluetooth controller, performs scanning of the first data channel through the second Bluetooth controller, performs scanning of the second data channel through the third Bluetooth controller, and performs scanning of the Bluetooth audio link through the fourth Bluetooth controller. Optionally, if a second electronic device broadcasts via Bluetooth through the first data channel to send a second data packet, and a third electronic device broadcasts via the second broadcast channel, then the first Bluetooth controller maintains the scanning of the first broadcast channel, performs scanning of the first data channel through the second Bluetooth controller, performs scanning of the second broadcast channel through the third Bluetooth controller, and performs Bluetooth broadcasting through the fourth Bluetooth controller.
[0131] It should be noted that the above are only optional embodiments of this application and are not intended to limit this application. The number of Bluetooth controllers and the tasks performed by each Bluetooth controller can be set and changed as needed.
[0132] Please refer to Figure 11 This illustration shows a block diagram of a Bluetooth protocol communication device according to an exemplary embodiment of this application. The device includes:
[0133] The first execution module 1101 is configured to perform a scan of the first broadcast channel via the first Bluetooth controller to receive a first data packet from the second electronic device;
[0134] The second execution module 1102 is configured to maintain the scanning of the first broadcast channel by the first Bluetooth controller based on the determination that a preset condition is met, and to perform a scan of the first data channel by the second Bluetooth controller to receive a second data packet from the second electronic device; wherein the second Bluetooth controller is different from the first Bluetooth controller.
[0135] In some embodiments, the preset conditions include:
[0136] The second electronic device broadcasts via Bluetooth through the first data channel.
[0137] In some embodiments, the preset conditions include:
[0138] The second electronic device establishes a Bluetooth communication connection with the first electronic device to use the first data channel.
[0139] In some embodiments, the first Bluetooth controller is independent of the first electronic device.
[0140] In some embodiments, the second Bluetooth controller is independent of the first electronic device.
[0141] In some embodiments, the apparatus further includes:
[0142] The module is configured to determine that if the first data packet is broadcast by the second electronic device and the first data packet includes auxiliary information, then the second electronic device will broadcast via Bluetooth through the first data channel to send the second data packet. The auxiliary information is used to instruct the second electronic device to broadcast via Bluetooth through the first data channel to send the second data packet.
[0143] In some embodiments, the auxiliary information includes the channel identifier of the target sub-channel and the target time, where the target sub-channel is the sub-channel for transmitting the second data packet and the target time is the time for transmitting the second data packet;
[0144] The second execution module 1102 is configured to send the channel identifier and target time to the second Bluetooth controller; and instruct the second Bluetooth controller to scan the target sub-channel corresponding to the channel identifier at the target time to receive the second data packet from the second electronic device.
[0145] In some embodiments, the first Bluetooth controller and the second Bluetooth controller are electrically connected;
[0146] The second execution module 1102 is configured to send the channel identifier and target time to the second Bluetooth controller via the first Bluetooth controller.
[0147] In some embodiments, the first electronic device includes a scheduling module, which is electrically connected to a first Bluetooth controller and a second Bluetooth controller respectively;
[0148] The second execution module 1102 is configured to send the channel identifier and target time to the second Bluetooth controller via the scheduling module.
[0149] In some embodiments, the apparatus further includes:
[0150] The third execution module is configured to, based on the determination that the second Bluetooth controller is scanning the first data channel to receive the second data packet, scan the second data channel through the first Bluetooth controller to receive the third data packet from the third electronic device.
[0151] In some embodiments, the apparatus further includes:
[0152] The fourth execution module is configured to perform a scan of the Bluetooth audio link through the first Bluetooth controller to receive audio data from the fourth electronic device, based on the determination that the second Bluetooth controller performs a scan on the first data channel to receive the second data packet.
[0153] In some embodiments, the apparatus further includes:
[0154] The fifth execution module is configured to maintain the scanning of the first broadcast channel by the first Bluetooth controller based on the determination that the preset conditions are not met, and to perform broadcasting through the second Bluetooth controller to broadcast the fourth data packet.
[0155] Please refer to Figure 12The diagram illustrates a structural block diagram of an electronic device according to an exemplary embodiment of this application. The electronic device includes a Bluetooth module, a first Bluetooth controller, and a second Bluetooth controller. The Bluetooth module is configured to perform data communication with one or more other electronic devices based on the Bluetooth protocol. The first Bluetooth controller is configured to perform a scan of a first broadcast channel to receive a first data packet from a second electronic device and to maintain the scan of the first broadcast channel based on determining that a preset condition is met. The second Bluetooth controller is configured to perform a scan of a first data channel to receive a second data packet from the second electronic device based on knowing that the preset condition is met.
[0156] In some embodiments, the preset conditions include:
[0157] The second electronic device broadcasts via Bluetooth through the first data channel.
[0158] In some embodiments, the preset conditions include:
[0159] The second electronic device establishes a Bluetooth communication connection with the first electronic device to use the first data channel.
[0160] In some embodiments, the first Bluetooth controller is independent of the first electronic device.
[0161] In some embodiments, the second Bluetooth controller is independent of the first electronic device.
[0162] In some embodiments, the Bluetooth module is further configured to: if the first data packet is broadcast by the second electronic device and the first data packet includes auxiliary information, determine that the second electronic device broadcasts the second data packet via the first data channel, and the auxiliary information is used to instruct the second electronic device to broadcast the second data packet via the first data channel.
[0163] In some embodiments, the auxiliary information includes the channel identifier of the target sub-channel and the target time, wherein the target sub-channel is the sub-channel for transmitting the second data packet and the target time is the time for transmitting the second data packet; the Bluetooth module is further configured to: send the channel identifier and the target time to the second Bluetooth controller; and instruct the second Bluetooth controller to scan the target sub-channel corresponding to the channel identifier at the target time to receive the second data packet from the second electronic device.
[0164] In some embodiments, the first Bluetooth controller and the second Bluetooth controller are electrically connected; the first Bluetooth controller is further configured to send a channel identifier and a target time to the second Bluetooth controller.
[0165] Please refer to Figure 13The diagram illustrates the structure of an electronic device provided in an embodiment of this application. The electronic device includes a Bluetooth module, a first Bluetooth controller, and a second Bluetooth controller, and also includes a scheduling module. The scheduling module is electrically connected to the Bluetooth module, the first Bluetooth controller, and the second Bluetooth controller. The scheduling module is configured to send the channel identifier and the target time to the second Bluetooth controller.
[0166] In some embodiments, the Bluetooth module is further configured to: scan the second data channel through the first Bluetooth controller to receive a third data packet based on determining that the second Bluetooth controller is performing a scan on the first data channel to receive a second data packet.
[0167] In some embodiments, the Bluetooth module is further configured to: perform a scan of the Bluetooth audio link through the first Bluetooth controller to receive audio data from a fourth electronic device, based on determining that the second Bluetooth controller is performing a scan on the first data channel to receive a second data packet.
[0168] In some embodiments, the Bluetooth module is further configured to: based on determining that a preset condition is not met, maintain the scanning of the first broadcast channel by the first Bluetooth controller, and perform a broadcast through the second Bluetooth controller to broadcast a fourth data packet.
[0169] In the embodiments of this application, both the first Bluetooth controller and the second Bluetooth controller are controllers that use Bluetooth Low Energy technology. The first Bluetooth controller and the second Bluetooth controller work together to perform scanning. In this way, the scanning performance of electronic devices using Bluetooth Low Energy technology is improved through the control of the first Bluetooth controller and the second Bluetooth controller.
[0170] In this embodiment, the electronic device includes a first Bluetooth controller and a second Bluetooth controller. When the electronic device scans the first broadcast channel through the first Bluetooth controller, it can maintain the scanning of the first broadcast channel by the first Bluetooth controller under preset conditions, while scanning the first data channel through the second Bluetooth controller. This allows the first electronic device to obtain the second data packet sent through the first data channel while maintaining the scanning of the first broadcast channel to obtain the first data packet broadcast by the second electronic device through the first broadcast channel. This avoids the situation where the scanning time of the first broadcast channel is short due to the first Bluetooth controller switching from the first broadcast channel to the first data channel, thereby improving the scanning performance of the first broadcast channel by the first Bluetooth controller.
[0171] Please refer to Figure 14This document illustrates a structural block diagram of an electronic device provided in an exemplary embodiment of this application. This structural block diagram can be a structural block diagram of a first electronic device or a structural block diagram of a second electronic device. The electronic device 1400 includes one or more of the following components: a processor 1410, a memory 1420, a first Bluetooth controller 1430, a second Bluetooth controller 1440, a scheduling module 1450, and a Bluetooth module 1460.
[0172] In some embodiments, processor 1410 may include one or more processing cores. Processor 1410 connects to various parts within the electronic device 1400 via various interfaces and lines, and performs various functions and processes data of the electronic device 1400 by running or executing instructions, programs, code sets, or instruction sets stored in memory 1420, and by calling data stored in memory 1420. Optionally, processor 1410 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). Processor 1410 may integrate one or more of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), Neural-network Processing Unit (NPU), and modem. Specifically, the CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the content to be displayed on the screen; the NPU is used to implement Artificial Intelligence (AI) functions; and the modem is used for wireless communication. It is understandable that the aforementioned modem may not be integrated into the processor 1410, but may be implemented as a separate chip.
[0173] In some embodiments, the memory 1420 includes random access memory (RAM) and may also include read-only memory (ROM). Optionally, the memory 1420 includes a non-transitory computer-readable storage medium. The memory 1420 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 1420 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as touch function, sound playback function, image playback function, etc.), instructions for implementing the various method embodiments described above, etc.; the data storage area may store data created based on the use of the electronic device 1400 (such as audio data, telephone directory, etc.).
[0174] In some embodiments, at least one first Bluetooth controller 1430 is used to scan a broadcast channel. At least one second Bluetooth controller 1440 is used, whereby, when an electronic device scans a broadcast channel via the first Bluetooth controller 1430, and a preset condition is met, the second Bluetooth controller 1440 scans a first data channel to receive a second data packet from a second electronic device, thereby maintaining the scanning of the broadcast channel by the first Bluetooth controller 1430. In some embodiments, a scheduling module 1450 is used to schedule the first Bluetooth controller 1430 and the second Bluetooth controller 1440. In some embodiments, a Bluetooth module 1460 is used to perform data communication with one or more other electronic devices based on the Bluetooth protocol.
[0175] In some embodiments, the electronic device 1400 further includes a display screen. The display screen is a display component for displaying a user interface. Optionally, the display screen is a touch-enabled display screen, allowing the user to perform touch operations on the display screen using any object such as a finger or a stylus. The display screen is typically located on the front panel of the electronic device 1400. The display screen can be designed as a full-screen, curved screen, irregularly shaped screen, dual-sided screen, or foldable screen. The display screen can also be designed as a combination of a full-screen and a curved screen, or a combination of an irregularly shaped screen and a curved screen, etc., which are not limited in this embodiment.
[0176] In addition, those skilled in the art will understand that the structure of the electronic device 1400 shown in the above figures does not constitute a limitation on the electronic device 1400. The electronic device 1400 may include more or fewer components than shown, or combine certain components, or have different component arrangements. For example, the electronic device 1400 may also include a microphone, speaker, radio frequency circuit, input unit, sensor, audio circuit, wireless Fidelity (Wi-Fi) module, power supply, etc., which will not be described in detail here.
[0177] This application also provides a computer-readable medium storing at least one instruction that is loaded and executed by a processor to implement the Bluetooth protocol communication method shown in the above embodiments.
[0178] This application also provides a computer program product that stores at least one instruction, which is loaded and executed by a processor to implement the Bluetooth protocol communication method shown in the above embodiments.
[0179] Those skilled in the art will recognize that the functions described in the embodiments of this application in one or more of the above examples can be implemented using hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media include any medium that facilitates the transfer of a computer program from one place to another. Storage media can be any available medium that can be accessed by a general-purpose or special-purpose computer.
[0180] The above description is merely an optional embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of this application should be included within the scope of protection of this application. It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant countries and regions.
Claims
1. A communication method based on the Bluetooth protocol, characterized in that, Performed by a first electronic device, the method includes: The first Bluetooth controller performs a scan of the first broadcast channel to receive a first data packet from the second electronic device; Based on the determination that preset conditions are met, the first Bluetooth controller continues to scan the first broadcast channel, and the second Bluetooth controller performs a scan on the first data channel to receive a second data packet from the second electronic device. The preset conditions include: the second electronic device broadcasts via Bluetooth through the first data channel; or, the second electronic device establishes a Bluetooth communication connection with the first electronic device to use the first data channel. Based on the determination that the preset conditions are not met, the first Bluetooth controller continues to scan the first broadcast channel, and the second Bluetooth controller performs a broadcast to broadcast a fourth data packet, which is used by the electronic device receiving the fourth data packet to establish a Bluetooth communication connection with the first electronic device; Determining that the preset conditions are met includes: If the first data packet is broadcast by the second electronic device and the first data packet includes auxiliary information, then it is determined that the second electronic device broadcasts the second data packet via Bluetooth through the first data channel, and the auxiliary information is used to instruct the second electronic device to broadcast the second data packet via Bluetooth through the first data channel. The second Bluetooth controller is different from the first Bluetooth controller.
2. The method according to claim 1, characterized in that, The first Bluetooth controller is independent of the first electronic device.
3. The method according to claim 1, characterized in that, The second Bluetooth controller is independent of the first electronic device.
4. The method according to claim 1, characterized in that, The auxiliary information includes the channel identifier and target time of the target sub-channel, wherein the target sub-channel is the sub-channel for transmitting the second data packet, and the target time is the time for transmitting the second data packet; The step of scanning the first data channel via the second Bluetooth controller to receive a second data packet from the second electronic device includes: Send the channel identifier and the target time to the second Bluetooth controller; The second Bluetooth controller is instructed to scan the target sub-channel corresponding to the channel identifier at the target time to receive the second data packet from the second electronic device.
5. The method according to claim 4, characterized in that, The first Bluetooth controller and the second Bluetooth controller are electrically connected; Sending the channel identifier and the target time to the second Bluetooth controller includes: The first Bluetooth controller sends the channel identifier and the target time to the second Bluetooth controller.
6. The method according to claim 4, characterized in that, The first electronic device includes a scheduling module, which is electrically connected to the first Bluetooth controller and the second Bluetooth controller respectively; Sending the channel identifier and the target time to the second Bluetooth controller includes: The scheduling module sends the channel identifier and the target time to the second Bluetooth controller.
7. The method according to claim 1, characterized in that, The method further includes: Based on the determination that the second Bluetooth controller performs a scan on the first data channel to receive the second data packet, the first Bluetooth controller performs a scan on the second data channel to receive the third data packet from the third electronic device.
8. The method according to claim 1, characterized in that, The method further includes: Based on the determination that the second Bluetooth controller performs a scan on the first data channel to receive the second data packet, the first Bluetooth controller performs a scan on the Bluetooth audio link to receive audio data from the fourth electronic device.
9. An electronic device, characterized in that, The electronic device includes a Bluetooth module, a first Bluetooth controller, and a second Bluetooth controller; The Bluetooth module is configured to: To conduct Bluetooth-based data communication with one or more other electronic devices; The first Bluetooth controller is configured as follows: A scan is performed on the first broadcast channel to receive a first data packet from the second electronic device; Based on the determination that preset conditions are met, the scanning of the first broadcast channel is maintained. The preset conditions include: the second electronic device broadcasts via Bluetooth through the first data channel; or, the second electronic device establishes a Bluetooth communication connection with the first electronic device to use the first data channel. The second Bluetooth controller is configured as follows: Based on the knowledge that the preset conditions are met, a scan is performed on the first data channel to receive a second data packet from the second electronic device; The Bluetooth module is also configured to: If the first data packet is broadcast by the second electronic device and the first data packet includes auxiliary information, then it is determined that the second electronic device broadcasts the second data packet via Bluetooth through the first data channel, and the auxiliary information is used to instruct the second electronic device to broadcast the second data packet via Bluetooth through the first data channel. The Bluetooth module is also configured to: Based on the determination that the preset conditions are not met, the first Bluetooth controller continues to scan the first broadcast channel, and the second Bluetooth controller performs a broadcast to broadcast a fourth data packet, which is used by the electronic device receiving the fourth data packet to establish a Bluetooth communication connection with the first electronic device.
10. The electronic device according to claim 9, characterized in that, The first Bluetooth controller is independent of the first electronic device.
11. The electronic device according to claim 9, characterized in that, The second Bluetooth controller is independent of the first electronic device.
12. The electronic device according to claim 9, characterized in that, The auxiliary information includes the channel identifier and target time of the target sub-channel, wherein the target sub-channel is the sub-channel for transmitting the second data packet, and the target time is the time for transmitting the second data packet; The Bluetooth module is also configured to: Send the channel identifier and the target time to the second Bluetooth controller; The second Bluetooth controller is instructed to scan the target sub-channel corresponding to the channel identifier at the target time to receive the second data packet from the second electronic device.
13. The electronic device according to claim 12, characterized in that, The first Bluetooth controller and the second Bluetooth controller are electrically connected; The first Bluetooth controller is also configured to: The channel identifier and the target time are sent to the second Bluetooth controller.
14. The electronic device according to claim 12, characterized in that, The electronic device further includes a scheduling module, which is electrically connected to the Bluetooth module, the first Bluetooth controller, and the second Bluetooth controller, respectively. The scheduling module is configured as follows: The channel identifier and the target time are sent to the second Bluetooth controller.
15. The electronic device according to claim 9, characterized in that, The Bluetooth module is also configured to: Based on the determination that the second Bluetooth controller performs a scan on the first data channel to receive the second data packet, the first Bluetooth controller performs a scan on the second data channel to receive the third data packet from the third electronic device.
16. The electronic device according to claim 9, characterized in that, The Bluetooth module is also configured to: Based on the determination that the second Bluetooth controller performs a scan on the first data channel to receive the second data packet, the first Bluetooth controller performs a scan on the Bluetooth audio link to receive audio data from the fourth electronic device.
17. A Bluetooth protocol communication device, characterized in that, The device includes: A first execution module is configured to perform a scan of a first broadcast channel via a first Bluetooth controller to receive a first data packet from a second electronic device; The second execution module is configured to maintain the scanning of the first broadcast channel by the first Bluetooth controller based on determining that preset conditions are met, and to perform a scan of the first data channel by the second Bluetooth controller to receive a second data packet from the second electronic device. The preset conditions include: the second electronic device broadcasting via Bluetooth through the first data channel; or, the second electronic device establishing a Bluetooth communication connection with the first electronic device to use the first data channel; wherein the second Bluetooth controller is different from the first Bluetooth controller. The determining module is configured to determine, if the first data packet is broadcast by the second electronic device and the first data packet includes auxiliary information, that the second electronic device broadcasts the second data packet via the first data channel to send the second data packet, wherein the auxiliary information is used to instruct the second electronic device to broadcast the second data packet via the first data channel. The fifth execution module is used to maintain the scanning of the first broadcast channel by the first Bluetooth controller based on the determination that the preset conditions are not met, and to perform broadcasting through the second Bluetooth controller to broadcast a fourth data packet, the fourth data packet being used by the electronic device receiving the fourth data packet to establish a Bluetooth communication connection with the first electronic device.
18. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one piece of program code, which is executed by a processor of an electronic device to implement the communication method of the Bluetooth protocol as described in any one of claims 1 to 8.
19. A computer program product, characterized in that, The computer program product stores at least one piece of program code, which is executed by the processor of an electronic device to implement the communication method of the Bluetooth protocol as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Method and system for achieving Bluetooth low-power-consumption networking and supporting convenient interconnection
CN104717603A
Method, apparatus, and computer program product for seamless switching of communication connection
CN104980987A
Low-power Bluetooth data discovery method and device and electronic equipment
CN112367649A
Migrating wireless channels using dual media access controllers
US20170034755A1