Bluetooth communication method and communication device
By establishing a connection between Bluetooth devices and assigning some tasks to the second device to perform, the problem of insufficient allocation of BLE SCAN task time for Bluetooth devices in multi-task scenarios is solved, and task time is optimized and taken into account.
Patent Information
- Application Number
- CN201910708508.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-08-01
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2039-08-01
AI Technical Summary
When Bluetooth devices handle multitasking, some tasks cannot be fully executed or the results are poor when processing multitasking. In particular, the time of the BLE SCAN task is occupied by other tasks, resulting in the problem that the specified device cannot be found.
By establishing a connection between Bluetooth devices, some tasks in multiple tasks, such as scanning tasks, are assigned to the second communication device for execution, and receive execution results through Bluetooth connections, thereby optimizing task time allocation and ensuring the time of the BLE SCAN task More than 90%.
It realizes that the time allocation of BLE SCAN tasks reaches 90% in multi-task scenarios, and meets the time allocation needs of other tasks, ensuring that tasks can be perfectly taken into account, and avoiding the problem of insufficient task time allocation.
Smart Images

Figure CN112312367B_ABST
Abstract
Description
Technical Field
[0001] The disclosed embodiments of the present invention relate to the field of communications, and more specifically, to a Bluetooth communication method and a communication device. Background Art
[0002] As it develops, Bluetooth 5.0 adds Bluetooth Low Energy (BLE) Advertisement extension, which increases the difficulty and time cost of implementing BLE SCAN on Bluetooth devices. Bluetooth devices have multiple tasks and perform multiple tasks in time-sharing. Therefore, the new functions added by Bluetooth 5.0 bring challenges to the time allocation of Bluetooth devices. Among them, Bluetooth devices have many problems when handling multiple tasks, for example, insufficient time is allocated to a task, and different tasks compete for time. In this way, in some complex scenarios, Bluetooth devices cannot perfectly handle multiple tasks. Summary of the invention
[0003] According to an embodiment of the present invention, the present invention provides a Bluetooth communication method and a corresponding communication device to solve the above problems.
[0004] According to a first aspect of the present invention, a Bluetooth communication method is disclosed, comprising: a first communication device establishes a Bluetooth connection with a second communication device, wherein the first communication device needs to perform multiple tasks; the first communication device communicates with the second communication device via the Bluetooth connection to assign part of the multiple tasks to the second communication device for execution; wherein the part of the tasks includes a scanning task, and the first communication device receives a result of the second communication device executing the part of the tasks from the second communication device via the Bluetooth connection.
[0005] According to a second aspect of the present invention, a Bluetooth communication method is disclosed, comprising: the second communication device communicates with the first communication device via the Bluetooth connection to receive an instruction to execute a portion of a task of the first communication device; wherein the portion of the task includes a scanning task; the second communication device executes the portion of the task; and the second communication device sends a result of executing the portion of the task to the first communication device via the Bluetooth connection.
[0006] According to a third aspect of the present invention, an exemplary communication device is disclosed, which includes a processor and a communication circuit, wherein the communication circuit is connected to the processor, and the processor is used to execute the Bluetooth communication method in the first aspect through the communication circuit.
[0007] According to a fourth aspect of the present invention, an exemplary communication device is disclosed, which includes a processor and a communication circuit, wherein the communication circuit is connected to the processor, and the processor is used to execute the Bluetooth communication method in the second aspect through the communication circuit.
[0008] The beneficial effects of the present invention are as follows: a first communication device establishes a Bluetooth connection with a second communication device and communicates through the Bluetooth connection, so that part of a plurality of tasks is assigned to the second communication device for execution, wherein the part of the tasks includes a scanning task, and then the first communication device receives the result of executing the scanning task from the second communication device. Therefore, the first communication device only needs to connect through Bluetooth to obtain the result of executing the scanning task. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] Figure 1 It is a flowchart of the Bluetooth communication method according to the first embodiment of the present invention.
[0010] Figure 2 4 is a flow chart of a Bluetooth communication method according to a second embodiment of the present invention.
[0011] Figure 3 4 is a flowchart of a Bluetooth communication method according to a third embodiment of the present invention.
[0012] Figure 4 4 is a flowchart of a Bluetooth communication method according to a fourth embodiment of the present invention.
[0013] Figure 5 4 is a flowchart of a Bluetooth communication method according to a fifth embodiment of the present invention.
[0014] Figure 6 4 is a flowchart of a Bluetooth communication method according to a sixth embodiment of the present invention.
[0015] Figure 7 4 is a flowchart of a Bluetooth communication method according to a seventh embodiment of the present invention.
[0016] Figure 8 It is a schematic diagram of a process of Bluetooth communication between a first communication device and different second communication devices according to an example of the present invention.
[0017] Fig. 9 It is a schematic diagram of a process of Bluetooth communication between a first communication device and different second communication devices according to an example of the present invention.
[0018] Fig.10 It is a schematic diagram of the structure of a communication device according to the first embodiment of the present invention.
[0019] Fig.11 It is a schematic diagram of the structure of a communication device according to the second embodiment of the present invention. DETAILED DESCRIPTION
[0020] As described above, when a communication device processes multiple tasks, there may be a situation where insufficient time is allocated to a task.
[0021] For example, in the first scenario, for a certain communication device, the following functions need to be performed simultaneously: turn on the wifi function, use a Bluetooth headset to play online music, and search for a connected Bluetooth bracelet, wherein turning on the wifi function is for the wifi module of the communication device to perform a wifi task, using a Bluetooth headset to play online music is for the Bluetooth module of the communication device to perform an A2DP task, and searching for a connected Bluetooth bracelet is for the Bluetooth module of the communication device to perform a BLE SCAN task. Among them, the Bluetooth module and the wifi module can be integrated on one chip. At this time, the time-sharing of the communication device for these three tasks is: wifi (30%) + A2DP (50%) + BLE SCAN (20%). It can be seen that since the priority of the wifi task and the A2DP task is higher than the BLE SCAN task, in order to maintain the wifi task and the A2DP task, the time of the BLE SCAN task is sacrificed, accounting for only 20%.
[0022] For another example, in the second scenario, for a certain communication device, the following functions need to be run simultaneously: turn on the wifi function, use a Bluetooth headset to make a WeChat voice call, and receive information from other communication devices, wherein turning on the wifi function is for the wifi module of the communication device to perform the wifi task, using a Bluetooth headset to make a WeChat voice call is for the Bluetooth module of the communication device to perform the eSCO task, and receiving information from other communication devices is for the Bluetooth module of the communication device to perform the BLESCAN task. At this time, the time-sharing of the communication device for these three tasks is: wifi (56%) + eSCO (33%) + BLE SCAN (11%). It can be seen that since the priority of the wifi task and the eSCO task is higher than that of the BLE SCAN task, in order to maintain the wifi task and the eSCO task, the time of the BLE SCAN task is sacrificed, accounting for only 11%.
[0023] However, with the development of Bluetooth technology, the time for communication devices to execute BLE SCAN tasks needs to reach about 40%. In the above two scenarios, the time for executing BLE SCAN tasks is insufficient and is occupied by other tasks. As a result, when executing BLE SCAN tasks, problems such as failure to search for specified devices often occur.
[0024] Therefore, in some scenarios, the communication device needs to process multiple tasks. At this time, the communication device cannot simultaneously ensure that sufficient time is allocated to the multiple tasks for execution, that is, the communication device cannot perfectly balance the multiple tasks at the same time.
[0025] In view of this, the present invention provides a Bluetooth communication method to solve the above problems. In order to enable those skilled in the art to better understand the technical solution of the present invention, the technical solution of the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0026] like Figure 1 FIG. 1 is a flow chart of a Bluetooth communication method according to a first embodiment of the present invention. The execution subject of the Bluetooth communication method is a first communication device, which may be a Bluetooth chip or a combination chip (including a Bluetooth module and a Wi-Fi module), or a device including a Bluetooth chip, or a device including a combination chip, such as a smart phone.
[0027] In one example, the first communication device may determine whether to start executing the Bluetooth communication method by a preset method, such as API / host setting / tci command / hci command. For example, the first communication device may determine to start executing the Bluetooth communication method by a tci_collaborator_enable command. The host layer of the first communication device sends a tci_collaborator_enable command to the link layer (LL), and then the Bluetooth communication method is executed.
[0028] Specifically, Figure 1 As shown, the Bluetooth communication method includes:
[0029] Step 110: The first communication device establishes a Bluetooth connection with the second communication device.
[0030] The first communication device needs to perform multiple tasks, for example, including the wifi task, A2DP (Advanced Audio Distribution Profile) task, eSCO task, BLESCAN task, etc. in the above scenario, to perform multiple functions. The second communication device can be a Bluetooth chip or a combination chip (including a Bluetooth module and a wifi module), or a device including a Bluetooth chip, or a device including a combination chip, such as a smart phone. The second communication device can be in a state of not executing a task or in a state of executing a task.
[0031] In one example, the second communication device can determine whether to assist other devices in performing some tasks by a preset method, such as Setting UI / API / host setting / tci command / hci command. For example, the second communication device can assist the first communication device in starting to execute the Bluetooth communication method by using the tci_collaborator_enable command. The Host layer of the second communication device sends the tci_collaborator_enable command to the Link Layer (LL) to assist the first communication device in starting to execute the Bluetooth communication method.
[0032] Step 120: The first communication device communicates with the second communication device via a Bluetooth connection to assign some of the multiple tasks to the second communication device for execution, wherein the some tasks include scanning tasks, such as Scan / Inquiry.
[0033] The first communication device allocates insufficient time to some tasks, resulting in that some tasks cannot be fully executed or some tasks have poor execution results. The insufficient time allocation to some tasks may be due to the low priority of some tasks or insufficient preset time.
[0034] The remaining tasks among the multiple tasks may be executed by the first communication device itself, or a part of the remaining tasks may be executed by the first communication device itself and the other part may be executed by other communication devices.
[0035] In one example, both the first communication device and the second communication device have components for playing music, and some of the multiple tasks may also include A2DP tasks.
[0036] Step 130: The first communication device receives the result of the second communication device executing part of the task from the second communication device via the Bluetooth connection.
[0037] The result of the second communication device performing the scanning task is the search result, and the search result includes: the identification of the communication device near the first communication device and the second communication device. In this embodiment, the distance between the first communication device and the second communication device is less than the preset distance, so that the first communication device and the second communication device are close to each other, so that the search result obtained by the second communication device performing the scanning task can be roughly the same as the search result obtained by the first communication device performing the scanning task itself, so the first communication device can use the search result obtained by the second communication device performing the scanning task.
[0038] In this embodiment, the first communication device establishes a Bluetooth connection with the second communication device and communicates through the Bluetooth connection, so that part of its multiple tasks is assigned to the second communication device for execution, wherein the part of the tasks includes a scanning task, and the remaining tasks are executed by the first communication device itself, and then the first communication device receives the results of the scanning task. Therefore, the first communication device only needs to connect to Bluetooth to obtain the search results obtained by executing the scanning task, so that multiple tasks can be perfectly taken into account at the same time.
[0039] The effect of the present invention is described below by taking a specific scenario as an example, wherein it is assumed that the second communication device is in a state of not executing a task.
[0040] In the first scenario above, the first communication device needs to execute a wifi task, an A2DP task, and a BLE SCAN task. After the first communication device executes the Bluetooth communication method of the embodiment of the present invention, the tasks executed by the first communication device are: a wifi task, an A2DP task, and a BLE link task, and the tasks executed by the second communication device are: a BLE SCAN task and a BLE link task, wherein the BLE link task is to establish a Bluetooth connection between the first communication device and the second communication device. At this time, the time allocation of the above tasks is:
[0041] The time allocation of the first communication device for the task it performs is:
[0042] wifi(35%)+A2DP(55%)+BLE link(10%),
[0043] The time allocation of the second communication device for the task it performs is:
[0044] BLE SCAN(90%)+BLE link(10%).
[0045] In the second scenario described above, the first communication device needs to execute a wifi task, an eSCO task, and a BLE SCAN task. After the first communication device executes the Bluetooth communication method of the embodiment of the present invention, the tasks executed by the first communication device are: a wifi task, an eSCO task, and a BLE link task, and the tasks executed by the second communication device are: a BLE SCAN task and a BLE link task, wherein the BLE link task is to establish a Bluetooth connection between the first communication device and the second communication device. At this time, the time allocation of the above tasks is:
[0046] The time allocation of the first communication device for the task it performs is:
[0047] wifi(35%)+eSCO(55%)+BLE link(10%),
[0048] The time allocation of the second communication device for the task it performs is:
[0049] BLE SCAN(90%)+BLE link(10%).
[0050] It can be seen that in the above two scenarios, the time allocation of the BLE SCAN task reaches 90%, and the time allocation of other tasks is also met. That is to say, the first communication device can not only obtain the result of executing the BLE SCAN task, but also execute other tasks only through the Bluetooth connection established between the first communication device and the second communication device. Therefore, the above tasks in different scenarios can be perfectly executed, and there is no situation where the time allocation of a certain task is insufficient.
[0051] It should be noted that the above example is illustrated by time-division multiplexing of Bluetooth and WiFi. Those skilled in the art will understand that the present invention is not limited to this. Bluetooth and WiFi can also be frequency-division multiplexed. In the scenario of frequency-division multiplexing of Bluetooth and WiFi, the technical solution of the present invention can also be adopted.
[0052] Wherein, step 110 further includes: receiving an information packet broadcasted by the second communication device, wherein the information packet at least includes: indication information for indicating whether the second communication device can perform a part of the task; the first communication device determines whether the second communication device can perform the part of the task according to the information packet, and when the second communication device can perform the part of the task, establishes a Bluetooth connection with the second communication device that can perform the part of the task. The specific execution method of step 110 can be as follows: Figure 2 , Figure 3 and Figure 4 As shown:
[0053] like Figure 2 FIG. 1 is a flow chart of a Bluetooth communication method according to a second embodiment of the present invention. Based on the first embodiment, step 110 further includes:
[0054] Step 1111: Receive an information packet broadcasted by a second communication device, wherein the information packet includes: indication information indicating whether the second communication device can provide idle resources, and indication information indicating an idle time length of the idle resources that the second communication device can provide.
[0055] The idle resources refer to idle Bluetooth communication frequency bands, that is, idle Bluetooth communication frequency bands when no Bluetooth-related tasks are executed. The idle Bluetooth communication frequency bands may include channel 37, channel 38 and / or channel 39, and the idle Bluetooth communication frequency bands may also refer to other Bluetooth communication channels.
[0056] In one example, the information packet may be an advertise message or a connectionless subordinate broadcast (CSB) message.
[0057] Step 1112: The first communication device determines, based on the information packet, that the second communication device can provide idle resources.
[0058] Step 1113: The first communication device determines, based on the information packet, that the relationship between the time length required for itself to execute a portion of the task and the idle time length of the idle resources meets a preset condition.
[0059] In one example, the idle time length of the idle resources that can be provided by the second communication device in step 1111 can be expressed as: the ratio of the idle time of the idle resources to the time of a communication cycle. The time length required for the first communication device to perform part of the task itself can be expressed as the ratio of the time that the first communication device occupies the Bluetooth communication frequency band to perform part of the task itself to the time of a communication cycle.
[0060] In one example, the preset conditions include: the length of time that the idle resources are idle is greater than or equal to the length of time required for the first communication device itself to perform part of the task, and / or the length of time that the idle resources are idle is less than the length of time required for the first communication device itself to perform part of the task, and the difference between the two is less than or equal to the preset value. For example, the length of time that the idle resources of the second communication device are idle is 40%, and the length of time required for the first communication device itself to perform part of the task is 50%, and the preset value is 10%. At this time, the preset condition is met.
[0061] Step 1114: The first communication device establishes a Bluetooth connection with the second communication device.
[0062] When the relationship between the time required for the first communication device to perform part of the task and the time during which the idle resource is idle meets a preset condition, the first communication device determines to establish a Bluetooth connection with the second communication device, and sends a response signal to the second communication device, so that the first communication device and the second communication device establish a Bluetooth connection. The response signal may be a Bluetooth connection establishment request message.
[0063] When the relationship between the time length required for the first communication device to perform part of the task and the time length during which the idle resources are idle does not meet the preset conditions, the first communication device determines not to establish a Bluetooth connection with the second communication device and does not send a response signal, so that the first communication device does not establish a Bluetooth connection with the second communication device.
[0064] In an optional example, step 1113 may not be performed, that is, as long as the second communication device can provide idle resources, the first communication device can establish a Bluetooth connection with the second communication device.
[0065] like Figure 3 FIG. 1 is a flow chart of a Bluetooth communication method according to a third embodiment of the present invention. Based on the first embodiment, step 110 further includes:
[0066] Step 1121: Receive an information packet broadcasted by a second communication device, the information packet comprising: indication information indicating whether the second communication device can provide idle resources, indication information indicating the idle time length of the idle resources that the second communication device can provide, and indication information indicating whether it has an excellent function.
[0067] Among them, the proficient functions at least include: a function of filtering the search results obtained by executing the scanning task. Specifically, it means that the second communication device executes the scanning task to obtain the search results, and filters the search results according to the filtering conditions sent by the first communication device, wherein the filtering conditions may include: the identifier of the device that the first communication device expects to scan, and / or the signal strength indication of the signal strength of the device that the first communication device expects to scan. In this way, when the filtering conditions include the identifier of the device that the first communication device expects to scan, the second communication device finds the device identified by the identifier of the device that the first communication device needs to scan in the search results; when the filtering conditions include the signal strength indication of the signal strength of the device that the first communication device expects to scan, the second communication device finds the device whose signal strength detected during the scan is higher than or equal to the signal strength indicated by the signal strength indication in the search results.
[0068] The expert function may also include: address resolution function, which can resolve the address of a searched device according to the key provided by the first communication device. For example, the first communication device is a mobile phone, which has been paired with its own private device (such as a Bluetooth headset). The Bluetooth headset is a private device of the mobile phone, so not all devices in the network can resolve the address of the Bluetooth headset. Only the key can be used to resolve the address of the Bluetooth headset. If the second communication device has an address resolution function, during subsequent scanning, the second communication device can resolve the address of the Bluetooth headset according to the key provided by the first communication device to help the mobile phone find the Bluetooth headset.
[0069] Step 1122-step 1123 is basically the same as step 1112-1113.
[0070] Step 1124: The first communication device determines, based on the indication information indicating the second communication device has an excellent function, that the second communication device has a function of filtering the search results obtained by executing the scanning task.
[0071] Step 1125: The first communication device establishes a Bluetooth connection with the second communication device.
[0072] Specifically, when the relationship between the time length required for the first communication device to perform part of the task and the time length of the idle resource satisfies the preset condition, and the second communication device has the function of filtering the search results obtained by performing the scanning task, a Bluetooth connection is established with the second communication device. The specific method of establishing the Bluetooth connection is the same as that in the above embodiment, and will not be repeated here.
[0073] In an optional manner, step 1124 may be that the first communication device determines that the second communication device has an address resolution function based on indication information indicating that the second communication device has an excellent function, and step 1125 may be that the first communication device establishes a Bluetooth connection with the second communication device when the relationship between the length of time required for the first communication device to perform part of the task and the length of time that idle resources are idle meets a preset condition, and the second communication device has an address resolution function.
[0074] like Figure 4 FIG. 1 is a flow chart of a Bluetooth communication method according to a fourth embodiment of the present invention. Based on the first embodiment, step 110 further includes:
[0075] Step 1131: The first communication device receives an information packet broadcasted by the second communication device, where the information packet includes: indication information indicating a task being executed by the second communication device.
[0076] Step 1132: The first communication device determines whether the second communication device is executing the part of the task based on the information packet.
[0077] Step 1133: The first communication device establishes a Bluetooth connection with the second communication device that is executing a portion of the task.
[0078] Optionally, in step 1131, the information packet further includes: indication information indicating the length of time required for the second communication device to perform a portion of the task. The length of time required for the second communication device to perform a portion of the task may be the ratio of the estimated time that the second communication device occupies the Bluetooth communication frequency band for the portion of the task being performed to a communication cycle. At this time, the method further includes the first communication device determining whether the relationship between the length of time required for the first communication device to perform a portion of the task and the length of time required for the second communication device to perform a portion of the task meets a preset condition.
[0079] In one example, the preset conditions include: the length of time required for the second communication device to perform part of the task is greater than or equal to the length of time required for the first communication device to perform part of the task itself; and / or, the preset conditions include: the length of time required for the second communication device to perform part of the task is less than the length of time required for the first communication device to perform part of the task itself, and the difference between the two is less than or equal to the preset value. For example, the length of time required for the second communication device to perform part of the task is 40%, and the length of time required for the first communication device to perform part of the task itself is 50%, and the preset value is 10%. At this time, the preset conditions are met.
[0080] When the relationship between the time length required for the first communication device to perform a part of the task and the time length required for the second communication device to perform a part of the task meets a preset condition, the first communication device determines to establish a Bluetooth connection with the second communication device, and sends a response signal to the second communication device, so that the first communication device and the second communication device establish a Bluetooth connection. The response signal may be a Bluetooth connection establishment request message.
[0081] When the relationship between the time length required for the first communication device to perform part of the task itself and the time length required for the task being performed by the second communication device does not meet the preset conditions, the first communication device determines not to establish a Bluetooth connection with the second communication device and does not send a response signal, so that the first communication device does not establish a Bluetooth connection with the second communication device.
[0082] like Figure 5 FIG. 1 is a flow chart of a Bluetooth communication method according to a fifth embodiment of the present invention. Based on the first embodiment, step 120 includes:
[0083] Step 1211: The first communication device determines the actual time length for the second communication device to perform the partial task according to the time length required for the first communication device to perform the partial task and the time length for the second communication device to perform the partial task, wherein the partial task includes a scanning task.
[0084] In one embodiment, after the second communication device broadcasts an information packet, if the second communication device does not receive a request from a communication device other than the first communication device to reserve idle resources and idle time, or does not agree to a request from a communication device other than the first communication device to reserve idle resources and idle time, then the length of time that the partial task can be performed is the length of idle time indicated in the broadcast message; if the second communication device receives a request from a communication device other than the first communication device to reserve idle resources and idle time after the second communication device broadcasts the information packet, and agrees to a request from a communication device other than the first communication device to reserve idle resources and idle time, then the length of time that the second communication device can perform the partial task is the length of idle time indicated in the broadcast message minus the reserved length of time.
[0085] Wherein, when the time length that the second communication device can perform part of the task is longer than the time length required by the first communication device itself to perform part of the task, the actual time length may be the time length required by the first communication device itself to perform part of the task; when the time length that the second communication device can perform part of the task is shorter than the time length required by the first communication device itself to perform part of the task and the difference between the two is less than a predetermined value, the actual time length is the time length that the second communication device can perform part of the task;
[0086] Step 1212: Send a notification message to the second communication device, the notification message including: indication information for instructing the second communication device to perform the part of the task, and indication information for indicating the actual length of time for the second communication device to perform the part of the task.
[0087] Optionally, the method further includes: determining a specific channel for executing the scanning task; when there are multiple specific channels, determining a time length for each specific channel; and the actual time length is equal to the sum of the time lengths for each specific channel.
[0088] The indication information used to indicate the actual time length for the second communication device to perform the part of the task includes: indication information indicating the specific channels for which the scanning task will be performed and the time length for each specific channel.
[0089] Optionally, the notification message in step 1212 also includes: instruction information indicating a specialized function to be executed, the specialized function at least including: a function of filtering search results obtained by executing the scanning task. The specialized function may also include: an address resolution function.
[0090] Optionally, the notification message in step 1212 also includes: indication information indicating the search quantity, where the indication information indicating the search quantity indicates how many devices the second communication device searches for before actively reporting the search result to the first communication device.
[0091] Optionally, the notification message in step 12012 also includes: a communication time interval, which indicates that the first communication device sends a message to the second communication device at a preset time interval to check whether the second communication device has completed the part of the task.
[0092] Optionally, based on the above embodiment, before step 130, the following steps are further included:
[0093] Step 130a: The first communication device checks via Bluetooth connection whether the second communication device has completed part of the task.
[0094] In one example, the first communication device may check whether the second communication device has completed a portion of the task at a preset time interval.
[0095] In one example, before step 130a, the method further includes: the first communication device maintains a Bluetooth connection with the second communication device. It should be noted that both step 130a and maintaining the Bluetooth connection are performed before step 130.
[0096] In one embodiment, the first communication device can check whether the second communication device has completed part of the task by means of CSB. In other embodiments, the first communication device can check whether the second communication device has completed part of the task by means of advertise extension.
[0097] like Figure 6 FIG. 1 is a flow chart of a Bluetooth communication method according to a sixth embodiment of the present invention. The Bluetooth communication method is performed by a second communication device, which may be a Bluetooth chip or a combination chip (including a Bluetooth module and a Wi-Fi module), or a device including a Bluetooth chip, or a device including a combination chip, such as a smart phone.
[0098] In one example, the second communication device can determine whether to execute the Bluetooth communication method in a preset manner to determine whether to assist other devices in performing some tasks, such as Setting UI / API / host setting / tci command / hci command. For example, the second communication device can set the second communication device to execute the Bluetooth communication method through the tci_collaborator_enable command. The Host layer of the second communication device sends the tci_collaborator_enable command to the Link Layer (LL) to execute the Bluetooth communication method.
[0099] Specifically, Figure 6 As shown, the Bluetooth communication method includes:
[0100] Step 210: The second communication device establishes a Bluetooth connection with the first communication device.
[0101] The second communication device may be in a state of not executing a task or in a state of executing a task. The first communication device may execute multiple tasks, for example, including the wifi task, A2DP task, eSCO task, BLE SCAN task, etc. in the above scenario.
[0102] Step 220: The second communication device communicates with the first communication device via a Bluetooth connection to receive an instruction to execute a portion of the task of the first communication device.
[0103] Some of the tasks include scanning tasks, for example, Scan / Inquiry.
[0104] The first communication device allocates insufficient time to some tasks, resulting in that some tasks cannot be fully executed or some tasks have poor execution results. The insufficient time allocation to some tasks may be due to the low priority of some tasks or insufficient preset time.
[0105] In one example, both the first communication device and the second communication device have components for playing music, and some of the multiple tasks may also include A2DP tasks.
[0106] Step 230: The second communication device performs part of the task of the first communication device.
[0107] Step 240: The second communication device sends the result of executing part of the task to the first communication device via the Bluetooth connection.
[0108] The result of the second communication device performing the scanning task is the search result, and the search result includes: the identification of the communication device near the first communication device and the second communication device. In this embodiment, the distance between the first communication device and the second communication device is less than the preset distance, so that the first communication device and the second communication device are close to each other, so that the search result obtained by the second communication device performing the scanning task can be roughly the same as the search result obtained by the first communication device performing the scanning task itself, so the first communication device can use the search result obtained by the second communication device performing the scanning task.
[0109] It should be noted that the execution order of step 230 and step 210 may not be based on the order of numerical numbers. For example, step 230 may be executed before step 210, or step 230 may be executed simultaneously with step 210.
[0110] In this embodiment, the second communication device establishes a Bluetooth connection with the first communication device and communicates with the first communication device through the Bluetooth connection to receive an instruction to execute a portion of the task of the first communication device, execute the portion of the task of the first communication device, and send the result of executing the portion of the task of the first communication device to the first communication device, so that the first communication device can obtain the result of executing the portion of the task only through the Bluetooth connection.
[0111] like Figure 7 FIG. 2 is a flow chart of a Bluetooth communication method according to a seventh embodiment of the present invention. Based on the sixth embodiment, step 210 further includes:
[0112] Step 2111: The second communication device broadcasts an information packet, wherein the information packet at least includes: indication information for indicating whether the second communication device can perform part of the task.
[0113] The indication information used to indicate whether the second communication device can perform part of the task includes: indication information indicating whether the second communication device can provide idle resources.
[0114] Step 2112: The second communication device receives the response signal sent by the first communication device according to the information packet to establish a Bluetooth connection with the first communication device, wherein the response signal may be a Bluetooth connection establishment request message.
[0115] Further, in one embodiment, the information packet specifically includes: indication information indicating whether the second communication device can provide idle resources, and indication information indicating the idle time length of the idle resources that the second communication device can provide. At this time, the response signal in step 212 is a signal sent by the first communication device when the relationship between the time length required to perform part of the task and the idle time length of the idle resources meets the preset condition. Among them, the preset condition is the same as the above embodiment, and will not be repeated here.
[0116] The indication information of the idle time length of the idle resources that can be provided by the second communication device can be expressed as: the ratio of the idle time length of the idle resources to the time of a communication cycle. The time length required for the first communication device to perform part of the task itself can be expressed as the ratio of the time that the first communication device occupies the Bluetooth communication frequency band to perform part of the task itself to the time of a communication cycle.
[0117] In one embodiment, the information packet specifically includes: indication information indicating whether the second communication device can provide idle resources, indication information indicating the idle time length of the idle resources that the second communication device can provide, and indication information indicating whether it has a good function. For the relevant description of the good function, please refer to the above embodiment and will not be repeated here. In this embodiment, the response signal in step 212 is a signal sent by the first communication device when the relationship between the time length required to perform part of the task and the idle time length of the idle resources meets the preset conditions and it is determined that the second communication device has a good function.
[0118] In one embodiment, the indication information in the information packet for indicating whether the second communication device can perform part of the task includes: information indicating the task that the second communication device is performing. At this time, in this embodiment, the response signal in step 212 is a signal sent when the first communication device determines that the second communication device is performing part of the task.
[0119] In one embodiment, step 220 includes: the second communication device negotiates with the first communication device through a Bluetooth connection, and receives a notification message from the first communication device, the notification message including indication information for indicating the second communication device to perform a part of the task and indication information for indicating the actual length of time for the second communication device to perform the part of the task. In this step, the second communication device can report to the first communication device the length of time it can perform the part of the task. After broadcasting the information packet, if the second communication device does not receive a request for a communication device other than the first communication device to reserve idle resources and idle time, or does not agree to a request for a communication device other than the first communication device to reserve idle resources and idle time, then the length of time it can perform the part of the task is the length of idle time indicated in the broadcast message; if the second communication device receives a request for a communication device other than the first communication device to reserve idle resources and idle time after broadcasting the information packet, and agrees to a request for a communication device other than the first communication device to reserve idle resources and idle time, then the length of time it can perform the part of the task is the length of idle time indicated in the broadcast message minus the reserved length of time. The actual time length sent by the first communication device is determined according to the time length that the first communication device can perform part of the task according to the second communication device and the time length that the first communication device performs part of the task itself.
[0120] The notification message may also include: indication information indicating the specialized function to be executed, and the specialized function at least includes: the function of filtering the search results obtained by executing the scanning task. In this case, the notification message also includes: filtering conditions, wherein the filtering conditions may include: the identification of the device that the first communication device expects to scan, and / or the signal strength indication of the signal strength of the device that the first communication device expects to scan. The specialized function may also include: address resolution function, and in this case, the notification message also includes the key required for executing the address resolution function. The notification message may also include: indication information indicating the number of searches, and the notification message may also include: communication time interval.
[0121] In one embodiment, step 230 includes: the second communication device performs a scanning operation according to the actual time length to obtain a search result, and the result of executing part of the task sent in step 240 is the search result. If the indication information of the notification message indicates that it is necessary to perform a function of filtering the search results obtained by executing the scanning task, the second communication device filters the search results according to the filtering conditions sent by the first communication device, and the result of executing part of the task sent in step 240 is the result after filtering the search results. If the indication information of the communication message also indicates that it is necessary to perform an address resolution function, the second communication device uses the key sent by the first communication device to perform address resolution on the device with an encrypted address in the search result to obtain the real address of the device with the encrypted address, and the result of executing part of the task sent in step 240 is the searched device with a real address.
[0122] The following is an example of a process of Bluetooth communication between a first communication device F and different second communication devices, with reference to the accompanying drawings. The first communication device F needs to perform tasks A, B, and C simultaneously, and the first communication device F does not allocate enough time for task C. The parts in the figure that are the same as those in the above embodiment are not described again.
[0123] like Figure 8 As shown, the first communication device F cooperates with the second communication device S1 to complete tasks A, B and C of the first communication device F, wherein the second communication device S1 can perform task C. The specific process is as follows:
[0124] Step 311: The first communication device F starts the cooperation function.
[0125] The first communication device F enables the cooperation function through the tci_collaborator_enable command.
[0126] Step 312: The second communication device S1 enables the cooperation function.
[0127] The second communication device S1 enables the cooperation function through the tci_collaborator_enable command.
[0128] Step 313: The second communication device S1 broadcasts the information packet.
[0129] The information packet at least includes indication information for indicating that the second communication device S1 can perform task C. Specifically, the information packet specifically includes indication information indicating that the second communication device S1 can provide idle resources. Further, the information packet further includes indication information for indicating the idle time length of the idle resources that the second communication device S1 can provide. The content of the information packet may also include indication information indicating whether there is a proficient function. The description of the proficient function is the same as that in the above embodiment and will not be repeated here.
[0130] Step 314: The first communication device F determines to establish a Bluetooth connection with the second communication device S1 according to the information packet.
[0131] Specifically, the information packet specifically includes indication information indicating that the second communication device S1 can provide idle resources, so that according to the information packet, the first communication device F determines to establish a Bluetooth connection with the second communication device S1. Furthermore, the information packet further includes indication information for indicating the idle time length of the idle resources that the second communication device S1 can provide, so that according to the information packet, the first communication device F determines that the relationship between the time length required for itself to execute task C and the idle time length of the idle resources meets the preset conditions, and then the first communication device F determines to establish a Bluetooth connection with the second communication device S1.
[0132] Step 315: The first communication device F sends a response signal to the second communication device S1, and the first communication device F establishes a Bluetooth connection with the second communication device S1.
[0133] Step 316: The first communication device F communicates with the second communication device S1 to assign the task C of the first communication device F to the second communication device S1 for execution.
[0134] Step 317: The second communication device S1 executes task C.
[0135] Step 318: The first communication device F performs tasks A and B.
[0136] Step 319: The second communication device S1 sends the result of executing task C to the first communication device F.
[0137] It should be noted that steps 311 and 312, as well as steps 317 and 318 may not be executed in the order of the numerical labels. For example, steps 311 and 312 may be executed simultaneously.
[0138] In this embodiment, the detailed description of the first communication device F and the second communication device S1 can be found in the above embodiments, which will not be repeated here.
[0139] like Fig. 9As shown, the first communication device F cooperates with the second communication device S2 to complete tasks A, B and C of the first communication device F, wherein the second communication device S2 can perform task C. The specific process is as follows:
[0140] Step 411: The second communication device S2 is executing task C.
[0141] Step 412: The first communication device F starts the cooperation function.
[0142] The first communication device F enables the cooperation function through the tci_collaborator_enable command.
[0143] Step 413: The second communication device S2 enables the cooperation function.
[0144] The second communication device S2 enables the cooperation function through the tci_collaborator_enable command.
[0145] Step 414: The second communication device S2 broadcasts the information packet.
[0146] The information packet at least includes indication information for indicating that the second communication device S2 can execute task C. Specifically, the information packet includes indication information indicating that the second communication device S2 is executing task C. Furthermore, the information packet further includes indication information for indicating the length of time required for the second communication device S2 to execute task C.
[0147] Step 415: The first communication device F determines to establish a Bluetooth connection with the second communication device S2 according to the information packet.
[0148] The information packet includes indication information indicating that the second communication device S2 is executing task C, so that according to the information packet, the first communication device F determines to establish a Bluetooth connection with the second communication device S2. Furthermore, the information packet further includes indication information for indicating the length of time required for the second communication device S2 to execute task C, and the first communication device F determines that the relationship between the length of time required for the first communication device F to execute part of the task and the length of time required for the second communication device S2 to execute part of the task meets the preset condition, and then the first communication device F determines to establish a Bluetooth connection with the second communication device S2.
[0149] Step 416: the first communication device F sends a response signal to the second communication device S2, and the first communication device F establishes a Bluetooth connection with the second communication device S2.
[0150] Step 417: The first communication device F communicates with the second communication device S2.
[0151] Step 418: The first communication device F performs tasks A and B.
[0152] Step 419: The second communication device S2 sends the result of executing task C to the first communication device F.
[0153] It should be noted that steps 412 and 413, as well as steps 418 and 419 may not be executed in the order of the numerical labels. For example, steps 412 and 413 may be executed simultaneously.
[0154] like Fig.10 1 is a schematic diagram of the structure of a communication device according to the first embodiment of the present invention. The communication device 1000 can be applied to the first communication device described above, and includes a memory 1010, a processor 1020, and a communication circuit 1030. The memory 1010 and the communication circuit 1030 are connected to the processor 1020, respectively.
[0155] The memory 1010 may include a read-only memory and / or a random access memory, and provides instructions and data to the processor 1020. A portion of the memory 1010 may also include a non-volatile random access memory (NVRAM). The memory 1010 stores instructions, and when the instructions are executed, the method provided by any one of the first to fifth embodiments of the present invention and any non-conflicting combination is implemented.
[0156] The communication circuit 1030 is used to send and receive data and is an interface for the communication device to communicate with other devices.
[0157] The processor 1020 is configured to execute the Bluetooth communication methods of the first embodiment to the fifth embodiment of the present invention through the communication circuit 1030 .
[0158] The processor 1020 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor 1020 or an instruction in the form of software. The above processor 1020 may be a general processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component. The disclosed methods, steps and logic block diagrams in the embodiments of the present invention can be implemented or executed.
[0159] like Fig.11 1 is a schematic diagram of the structure of a communication device according to a second embodiment of the present invention. The communication device 1100 can be applied to the second communication device described above, and includes a memory 1110, a processor 1120, and a communication circuit 1130. The memory 1110 and the communication circuit 1130 are connected to the processor 1120, respectively.
[0160] The memory 1110 may include a read-only memory and / or a random access memory, and provides instructions and data to the processor 1120. A portion of the memory 1110 may also include a non-volatile random access memory (NVRAM). The memory 1110 stores instructions, which, when executed, implement the method provided by any one of the sixth to seventh embodiments of the present invention and any non-conflicting combination.
[0161] The communication circuit 1130 is used to send and receive data and is an interface for the communication device to communicate with other devices.
[0162] The processor 1120 is configured to execute the Bluetooth communication methods of the fifth embodiment to the seventh embodiment of the present invention through the communication circuit 1130 .
[0163] The processor 1120 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor 1120 or an instruction in the form of software. The above processor 1120 can be a general processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component. The disclosed methods, steps and logic block diagrams in the embodiments of the present invention can be implemented or executed.
[0164] It is easy for a person skilled in the art to realize that many modifications and changes can be made to the apparatus and method while maintaining the teaching content of the present invention. Therefore, the above disclosure should be considered as limited only by the scope of the appended claims.
Claims
1. A Bluetooth communication method, characterized in that: include: A first communication device establishes a Bluetooth connection with a second communication device, wherein the first communication device needs to perform multiple tasks; The first communication device communicates with the second communication device via the Bluetooth connection to assign part of the multiple tasks to the second communication device for execution; wherein the part of the tasks includes a scanning task, and The first communication device receives, from the second communication device via the Bluetooth connection, a result of the second communication device executing the part of the task; Wherein, the first communication device establishing a Bluetooth connection with the second communication device comprises: The first communication device receives an information packet broadcasted by the second communication device, wherein the information packet at least includes: indication information indicating whether the second communication device can provide idle resources; the idle resources are idle Bluetooth communication frequency bands; wherein the idle Bluetooth communication frequency bands are Bluetooth communication frequency bands that need to be occupied to perform the partial tasks; The first communication device establishes the Bluetooth connection with the second communication device that can provide the idle resource according to the information packet.
2. The Bluetooth communication method according to claim 1, wherein: The information packet further includes: indication information indicating the idle time length of the idle resources that can be provided by the second communication device; The step of the first communication device establishing the Bluetooth connection with the second communication device capable of providing the idle resource according to the information packet comprises: The first communication device establishes the Bluetooth connection with the second communication device when the relationship between the time length required for the first communication device to execute the part of the task and the idle time length of the idle resource meets a preset condition.
3. The Bluetooth communication method according to claim 1 or 2, characterized in that: The information packet also includes: indication information indicating whether there is an excellent function; the excellent function at least includes: a function of filtering the search results obtained by executing the scanning task; The first communication device establishing the Bluetooth connection with the second communication device capable of providing the idle resource according to the information packet comprises: When the relationship between the time length required for the first communication device to perform the part of the task and the idle time length of the idle resource meets a preset condition, and the second communication device has the proficient function, the Bluetooth connection is established with the second communication device.
4. The Bluetooth communication method according to claim 1, wherein: The first communication device communicates with the second communication device through the Bluetooth connection to assign some of the multiple tasks to the second communication device, including: The first communication device determines the actual time length for the second communication device to perform the partial task according to the time length required for the first communication device to perform the partial task and the time length for which the second communication device can perform the partial task; A notification message is sent to the second communication device, where the notification message includes: indication information for instructing the second communication device to perform the part of the task and indication information for indicating the actual time length.
5. The Bluetooth communication method according to claim 4, characterized in that: The method further includes: Determining a specific channel for performing the scanning task; and When there are multiple specific channels, determine the time length for each specific channel; the actual time length is equal to the sum of the time lengths for each specific channel; The indication information for indicating the actual time length includes: indication information indicating the specific channel for which the scanning task is to be performed and the time length for each specific channel.
6. A Bluetooth communication method, characterized in that: include: A first communication device establishes a Bluetooth connection with a second communication device, wherein the first communication device needs to perform multiple tasks; The first communication device communicates with the second communication device via the Bluetooth connection to assign part of the multiple tasks to the second communication device for execution; wherein the part of the tasks includes a scanning task, and The first communication device receives, from the second communication device via the Bluetooth connection, a result of the second communication device executing the part of the task; Wherein, the first communication device establishing a Bluetooth connection with the second communication device comprises: The first communication device receives an information packet broadcasted by the second communication device, wherein the information packet at least includes: indication information indicating whether there is a skilled function; the skilled function at least includes: an address resolution function, wherein the address resolution function can resolve the address of the searched device according to the key provided by the first communication device; Determine to establish a Bluetooth connection with a second communication device according to the information packet; wherein, when the second communication device has the skilled function, establish the Bluetooth connection with the second communication device.
7. The Bluetooth communication method according to claim 6, wherein: The information packet further includes: indication information indicating the task being performed by the second communication device; Determining, according to the information packet, to establish a Bluetooth connection with the second communication device includes: The first communication device establishes the Bluetooth connection with the second communication device that is executing the part of the task according to the information packet.
8. The Bluetooth communication method according to claim 6, wherein: The information packet further includes: indication information indicating the length of time required for the second communication device to perform the portion of the task; Determining, according to the information packet, to establish a Bluetooth connection with the second communication device includes: The first communication device establishes a Bluetooth connection with the second communication device when a relationship between a time length required for the first communication device to execute the partial task and a time length required for the second communication device to execute the partial task meets a preset condition.
9. The Bluetooth communication method according to claim 6, wherein: The above-mentioned specialized functions also include: a function of filtering the search results obtained by executing the scanning task.
10. A Bluetooth communication method, characterized in that: include: The second communication device establishes a Bluetooth connection with the first communication device; The second communication device communicates with the first communication device via the Bluetooth connection to receive an instruction to perform a portion of a task of the first communication device; wherein the portion of the task includes a scanning task; The second communication device performs the portion of the task; and The second communication device sends the result of executing the part of the task to the first communication device via the Bluetooth connection; Wherein, the second communication device establishing a Bluetooth connection with the first communication device comprises: The second communication device broadcasts an information packet, wherein the information packet at least includes: indication information indicating whether the second communication device can provide idle resources; the idle resources are idle Bluetooth communication frequency bands; wherein the idle Bluetooth communication frequency bands are Bluetooth communication frequency bands that need to be occupied to perform the partial tasks; The second communication device receives the response signal sent by the first communication device according to the information packet to establish the Bluetooth connection with the first communication device; wherein the response signal is a signal sent by the first communication device when the received indication information indicates that the second communication device can provide idle resources.
11. The Bluetooth communication method according to claim 10, wherein: The information packet further includes: indication information indicating the idle time length of the idle resources that can be provided by the second communication device; The response signal is a signal sent by the first communication device when the relationship between the time length required to execute the part of the task and the idle time length of the idle resource meets a preset condition.
12. The Bluetooth communication method according to claim 11, wherein: The information packet further includes: indication information indicating whether there is an excellent function; the excellent function at least includes: a function of filtering the search results obtained by executing the scanning task; and The response signal is a signal sent by the first communication device when the relationship between the time length required to perform the part of the task and the idle time length of the idle resource meets a preset condition and when it is determined that the second communication device has the skilled function.
13. The Bluetooth communication method according to claim 10, wherein: The second communication device communicates with the first communication device through the Bluetooth connection to receive an instruction to perform a portion of the task of the first communication device, including: The second communication device receives a notification message through the Bluetooth connection, wherein the notification message includes: indication information for instructing the second communication device to execute the part of the task and indication information for indicating an actual length of time for the second communication device to execute the part of the task.
14. A Bluetooth communication method, characterized in that: include: The second communication device establishes a Bluetooth connection with the first communication device; The second communication device communicates with the first communication device via the Bluetooth connection to receive an instruction to perform a portion of a task of the first communication device; wherein the portion of the task includes a scanning task; The second communication device performs the portion of the task; and The second communication device sends the result of executing the part of the task to the first communication device via the Bluetooth connection; Wherein, the second communication device establishing a Bluetooth connection with the first communication device comprises: The second communication device broadcasts an information packet, wherein the information packet at least includes: indication information indicating whether it has a proficient function; the proficient function at least includes: an address resolution function, wherein the address resolution function can resolve the address of the searched device according to the key provided by the first communication device; The second communication device receives the response signal sent by the first communication device according to the information packet to establish the Bluetooth connection with the first communication device; wherein the response signal is a signal sent when it is determined that the second communication device has the proficient function.
15. A communication device, characterized in that: It comprises a processor and a communication circuit, wherein the communication circuit is connected to the processor, and the processor is used to execute the Bluetooth communication method as described in any one of claims 1-5 or 6-9 or any one of claims 10-13 or 14 through the communication circuit.
