Collaborative processing method and apparatus for multiple bluetooth hosts, device, and storage medium

By acquiring the operation information of Bluetooth hosts working in parallel within a multi-Bluetooth host system and ensuring that operation commands are executed without conflict, the problem of low efficiency in time-sharing negotiation among multiple Bluetooth hosts in the prior art is solved, and parallel operation and efficient collaboration of multiple Bluetooth hosts are realized.

WO2025260847A1PCT designated stage Publication Date: 2025-12-26HUAWEI TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/081693
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-06-20
Filing Date
2025-03-10
Publication Date
2025-12-26

AI Technical Summary

Technical Problem

In existing technologies, multiple Bluetooth hosts use a negotiated time-sharing working mode, which results in low efficiency of the Bluetooth system and makes it unsuitable for scenarios where multiple Bluetooth hosts work in parallel.

Method used

By obtaining the operation information of the second Bluetooth host before the first Bluetooth host executes the operation command, and ensuring no conflict before interacting with the Bluetooth controller, the parallel operation of multiple Bluetooth hosts can be achieved.

Benefits of technology

This avoids conflicts caused by multiple Bluetooth hosts executing operation commands simultaneously, achieves orderly scheduling of operation commands, and improves the working efficiency of the Bluetooth system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025081693_26122025_PF_FP_ABST
    Figure CN2025081693_26122025_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of communications, and discloses a collaborative processing method and apparatus for Bluetooth hosts, a device, and a storage medium. The method comprises: before a first Bluetooth host executes a first operation instruction, acquiring first operation information of a second Bluetooth host, the first operation information indicating an operation state of the second Bluetooth host; and when the operation state of the second Bluetooth host does not conflict with the first operation instruction, interacting with a Bluetooth controller, so as to execute the first operation instruction. The second Bluetooth host and the first Bluetooth host are connected to the same Bluetooth controller, i.e., a multi-Bluetooth host coexistence scenario. The method can avoid the conflict problem of simultaneous execution of operation instructions by multiple Bluetooth hosts, realizing orderly scheduling of the operation instructions, thereby realizing parallel work of the multiple Bluetooth hosts.
Need to check novelty before this filing date? Find Prior Art

Description

Cooperative processing method, device and equipment of multiple Bluetooth hosts, and storage medium

[0001] The present application claims priority from the Chinese patent application No. 202410807944.3 filed on June 20, 2024 and entitled "Cooperative processing method, device and equipment of multiple Bluetooth hosts, and storage medium", the whole content of which is incorporated herein by reference. TECHNICAL FIELD

[0002] The present application relates to the field of communication technology, in particular to a cooperative processing method, device and equipment of multiple Bluetooth hosts, and storage medium. BACKGROUND

[0003] In the field of communication technology, Bluetooth communication technology has been widely used in various fields such as smart home, smart phone, wearable device and car infotainment system due to its standardization, low power consumption and multi-connection characteristics. For devices with multiple Bluetooth hosts working cooperatively, the multiple Bluetooth hosts interact with the same Bluetooth controller on the device, so that the multiple Bluetooth hosts need to be cooperatively processed to avoid the coexistence conflict problem of multiple Bluetooth hosts interacting with the Bluetooth controller at the same time.

[0004] In related technologies, the multiple Bluetooth hosts cooperatively process by adopting a negotiated time-sharing working mode. Taking two Bluetooth hosts as an example, when the first Bluetooth host has the control right of the Bluetooth controller, the first Bluetooth host interacts with the Bluetooth controller, and the second Bluetooth host does not work at this time; the first Bluetooth host hands over the control right to the second Bluetooth host after completing the work, and the second Bluetooth host starts to interact with the Bluetooth controller, and the first Bluetooth host stops working at this time.

[0005] However, the above-mentioned negotiated time-sharing working mode needs to switch the control right of the Bluetooth controller between the two Bluetooth hosts, only one Bluetooth host can work at the same time, which makes the Bluetooth system work inefficiently, and is not suitable for the scene of multiple Bluetooth hosts working in parallel. SUMMARY

[0006] The present application provides a cooperative processing method, device and equipment of multiple Bluetooth hosts, and storage medium, which are used to realize multiple Bluetooth hosts working in parallel.

[0007] In a first aspect, a cooperative processing method of multiple Bluetooth hosts is provided. The method comprises: obtaining first operation information of a second Bluetooth host before a first Bluetooth host executes a first operation instruction, the first operation information indicating an operation state of the second Bluetooth host; and interacting with a Bluetooth controller to execute the first operation instruction in a case where the operation state of the second Bluetooth host does not conflict with the first operation instruction. The second Bluetooth host and the first Bluetooth host are connected to the same Bluetooth controller, i.e., the method is applicable to a scenario where two Bluetooth hosts coexist. In addition, the number of the first Bluetooth host or the second Bluetooth host can be two or more, and the method is also applicable to a scenario where more than two Bluetooth hosts coexist.

[0008] In the method, taking the first Bluetooth host as an example, the first Bluetooth host obtains the operation information of the second Bluetooth host before starting an operation instruction each time in a working process, i.e., the second Bluetooth host can work simultaneously with the first Bluetooth host, and the operation instruction is executed only in the case where no conflict is determined, instead of being directly executed. Thus, the conflict problem of multiple Bluetooth hosts executing operation instructions simultaneously can be avoided, the ordered scheduling of operation instructions is realized, and the parallel working of multiple Bluetooth hosts is further realized.

[0009] The operation state can indicate the execution of the operation instruction. Optionally, the operation state includes being operated, operation being completed, or being idle, etc. For example, the first operation information includes a first flag, and the first flag is used to indicate that the operation state of the second Bluetooth host is operation being completed. Alternatively, the first operation information includes a second flag, and the second flag is used to indicate that the operation state of the second Bluetooth host is being idle. The operation state of the second Bluetooth host not conflicting with the first operation instruction means that the execution of the operation instruction of the second Bluetooth host does not affect the execution of the first operation instruction of the first Bluetooth host, for example, the second Bluetooth host does not execute an operation instruction that conflicts with the first operation instruction, so that the success rate of the first Bluetooth host executing the first operation instruction in the case where no conflict exists is higher.

[0010] In a possible implementation, the manner of obtaining the first operation information of the second Bluetooth host can include: sending a first query instruction to the second Bluetooth host, the first query instruction being used for the second Bluetooth host to send the first operation information of the second Bluetooth host to the first Bluetooth host; and receiving the first operation information sent by the second Bluetooth host.

[0011] The operation information of the opposite Bluetooth host is obtained by sending a query instruction to the opposite Bluetooth host, cooperative interaction between multiple Bluetooth hosts is realized, and since the first operation information obtained by the query manner is the operation information replied by the opposite Bluetooth host, the accuracy of the obtained first operation information is ensured, and the reliability of the obtained first operation information is higher.

[0012] Optionally, the first query instruction is used for the second Bluetooth host to send first operation information of the second Bluetooth host to the first Bluetooth host in a case that an operation state of the second Bluetooth host does not conflict with the first operation instruction, and the first operation information indicates that the operation state of the second Bluetooth host does not conflict with the first operation instruction. In this way, the response is performed until the operation state of the second Bluetooth host does not conflict with the first operation instruction, so as to avoid the re-sending of the query instruction caused by the conflict between the operation state of the response and the first operation instruction. That is, one operation instruction sends one query instruction, and the operation instruction can be executed starting from the response of the query instruction, and the conflict of the simultaneous execution of the operation instruction is avoided.

[0013] In a possible implementation, after the first operation instruction is executed, the second operation information is sent to the second Bluetooth host in a case that the execution of the first operation instruction is completed, and the second operation information indicates that the first Bluetooth host completes the execution of the first operation instruction. In this way, the synchronization of the operation information between the multiple Bluetooth hosts is realized through the cooperative interaction.

[0014] In a possible implementation, the first Bluetooth host records cooperative information, and the cooperative information indicates the first operation information of the second Bluetooth host. In this case, the manner of obtaining the first operation information of the second Bluetooth host can include: reading the cooperative information recorded by the first Bluetooth host to obtain the first operation information of the second Bluetooth host. Through the manner of recording the operation information of the opposite Bluetooth host, the fast obtaining of the first operation information is realized, and the obtaining efficiency of the first operation information is improved.

[0015] In a possible implementation, the cooperative information is recorded in advance before the first operation information of the second Bluetooth host is obtained. Optionally, the second query instruction is received, and the second query instruction is sent before the second Bluetooth host executes the second operation instruction; the third operation information is sent to the second Bluetooth host, the third operation information indicates that the operation state of the first Bluetooth host does not conflict with the second operation instruction; the fourth operation information is recorded as the cooperative information in the first Bluetooth host, and the fourth operation information indicates that the second Bluetooth host is executing the second operation instruction. Alternatively, the fifth operation information is received, the fifth operation information is sent to the first Bluetooth host in a case that the execution of the second operation instruction is completed, and the fifth operation information indicates that the second Bluetooth host completes the execution of the second operation instruction; the fifth operation information of the second Bluetooth host is recorded as the cooperative information in the first Bluetooth host.

[0016] In this case, the second Bluetooth master also queries the first Bluetooth master for the operation information of the first Bluetooth master before executing the second operation instruction. Since the second Bluetooth master starts to execute the second operation instruction after the first Bluetooth master responds to the third operation information, the fourth operation information indicating that the second Bluetooth master is executing the second operation instruction can be recorded as the coordination information. In addition, the second Bluetooth master also notifies the first Bluetooth master after the execution of the second operation instruction is completed, and thus the fifth operation information indicating that the second Bluetooth master has completed the execution of the second operation instruction can be recorded as the coordination information. In this way, the real-time recording of the coordination information is realized, and the operation information between the multiple Bluetooth masters can be synchronized in real time.

[0017] In a possible implementation, the operation state of the second Bluetooth master does not conflict with the first operation instruction includes that the second Bluetooth master does not execute an operation instruction of the same type as the first operation instruction. In this way, the multiple Bluetooth masters can avoid executing the operation instructions of the same type at the same time, and the operation instructions of different types can be executed at the same time, so that the operation instructions of different types do not affect each other. Alternatively, the operation state of the second Bluetooth master does not conflict with the first operation instruction includes that the second Bluetooth master does not execute any operation instruction. In this way, the multiple Bluetooth masters can avoid executing the operation instructions of the same type or different types at the same time, and thus any conflict can be avoided.

[0018] In a possible implementation, the first operation instruction is used to update a scanning parameter of the Bluetooth controller, and the first operation information includes a first scanning parameter of the second Bluetooth master. In this case, the way of interacting with the Bluetooth controller can include: in a case where a second scanning parameter of the first Bluetooth master is greater than or equal to a scanning range indicated by the first scanning parameter, sending the second scanning parameter to the Bluetooth controller, and the second scanning parameter is used by the Bluetooth controller to update the scanning parameter to the second scanning parameter; or in a case where the second scanning parameter is less than the scanning range indicated by the first scanning parameter, sending the first scanning parameter to the Bluetooth controller, and the first scanning parameter is used by the Bluetooth controller to update the scanning parameter to the first scanning parameter.

[0019] In this way, the multiple Bluetooth masters not only can interact with the scanning states, but also can interact with the scanning parameters. In a case where the scanning parameters of the multiple Bluetooth masters are different, the scanning parameter of the Bluetooth controller can be uniformly updated to the scanning parameter with the largest scanning range among the multiple Bluetooth masters, so that the scanning range of the Bluetooth controller based on the updated scanning parameter is greater than the scanning range of each Bluetooth master based on the scanning parameter, and thus the multiple Bluetooth masters can reuse the scanning resource of the Bluetooth controller, that is, the scanning data based on the updated scanning parameter of the Bluetooth controller can be used by the first Bluetooth master and the second Bluetooth master at the same time.

[0020] In a possible implementation, the first operation instruction is used to establish a Bluetooth connection, and the first operation information includes a first number of Bluetooth connections established by the second Bluetooth master, the first number is used to control a second number of Bluetooth connections established by the first Bluetooth master, and a sum of the second number and the first number is less than or equal to a reference number of Bluetooth connections established by the Bluetooth controller. In this way, the multiple Bluetooth masters can not only interact with connection states, but also interact with connection numbers, so that the connection resources among the multiple Bluetooth masters can be reasonably allocated.

[0021] In a possible implementation, before the first Bluetooth master executes the first operation instruction, it is further required to determine the working state of the second Bluetooth master, that is, in a case where the working state of the second Bluetooth master is to exit hibernation, operation information of the second Bluetooth master is acquired; and in a case where the operation state of the second Bluetooth master does not conflict with the first operation instruction, interaction with the Bluetooth controller is performed to execute the first operation instruction. In this case, the working state of the second Bluetooth master is to exit hibernation, which means that the second Bluetooth master is working, and thus the operation information of the second Bluetooth master is acquired in a scenario where multiple Bluetooth masters work in parallel, so as to avoid the conflict problem in the scenario where multiple Bluetooth masters work in parallel.

[0022] In another possible implementation, in a case where the working state of the second Bluetooth master is to enter hibernation, interaction with the Bluetooth controller is directly performed to execute the first operation instruction, that is, the operation information of the second Bluetooth master does not need to be acquired. In this case, the working state of the second Bluetooth master is to enter hibernation, which means that the second Bluetooth master is not working, and thus the operation is directly executed in a scenario where a single Bluetooth master is used, so that the overhead caused by cooperative processing is saved.

[0023] In a second aspect, a cooperative processing apparatus of multiple Bluetooth masters is provided, which is used to execute the method in the first aspect or any possible implementation of the first aspect. Specifically, the cooperative processing apparatus of multiple Bluetooth masters includes a module used to execute the method in the first aspect or any possible implementation of the first aspect. In a possible implementation, the apparatus includes:

[0024] an acquisition module, configured to acquire first operation information of a second Bluetooth master before a first Bluetooth master executes a first operation instruction, the second Bluetooth master and the first Bluetooth master being connected to a same Bluetooth controller, and the first operation information indicating an operation state of the second Bluetooth master;

[0025] an execution module, configured to, in a case where the operation state of the second Bluetooth master does not conflict with the first operation instruction, interact with the Bluetooth controller to execute the first operation instruction.

[0026] In a possible implementation, the apparatus further includes: a first sending module, configured to send a first query instruction to the second Bluetooth host, the first query instruction being used for the second Bluetooth host to send first operation information of the second Bluetooth host to the first Bluetooth host; and a receiving module, configured to receive the first operation information sent by the second Bluetooth host.

[0027] In a possible implementation, the apparatus further includes: a first sending module, configured to send a first query instruction to the second Bluetooth host, the first query instruction being used for the second Bluetooth host to send first operation information of the second Bluetooth host to the first Bluetooth host; and a receiving module, configured to receive the first operation information sent by the second Bluetooth host.

[0028] In a possible implementation, the first Bluetooth host records coordination information, the coordination information indicating the first operation information of the second Bluetooth host.

[0029] In a possible implementation, the apparatus further includes: a receiving module, configured to receive a second query instruction, the second query instruction being sent before the second Bluetooth host executes the second operation instruction; a second sending module, configured to send third operation information to the second Bluetooth host, the third operation information indicating that an operation state of the first Bluetooth host does not conflict with the second operation instruction; and a recording module, configured to record fourth operation information as the coordination information in the first Bluetooth host, the fourth operation information indicating that the second Bluetooth host is executing the second operation instruction.

[0030] In a possible implementation, the receiving module is further configured to receive fifth operation information, the fifth operation information being sent to the first Bluetooth host in a case where the second operation instruction is executed completely, the fifth operation information indicating that the second Bluetooth host executes the second operation instruction completely; and the recording module is further configured to record the fifth operation information as the coordination information in the first Bluetooth host.

[0031] In a possible implementation, the operation state of the second Bluetooth host not conflicting with the first operation instruction includes: the second Bluetooth host not executing an operation instruction of the same type as the first operation instruction, or the second Bluetooth host not executing any operation instruction.

[0032] In a possible implementation, the first operation instruction is used to update a scanning parameter of a Bluetooth controller, the first operation information includes first scanning parameter of the second Bluetooth host; and the executing module is configured to: in a case where second scanning parameter of the first Bluetooth host is greater than or equal to a scanning range indicated by the first scanning parameter, send the second scanning parameter to the Bluetooth controller, the second scanning parameter being used for the Bluetooth controller to update the scanning parameter to the second scanning parameter; or in a case where the second scanning parameter is less than the scanning range indicated by the first scanning parameter, send the first scanning parameter to the Bluetooth controller, the first scanning parameter being used for the Bluetooth controller to update the scanning parameter to the first scanning parameter.

[0033] In a possible implementation, the first operation instruction is used to establish a Bluetooth connection, and the first operation information includes a first number of Bluetooth connections established by the second Bluetooth master, the first number is used to control a second number of Bluetooth connections established by the first Bluetooth master, and a sum of the second number and the first number is less than or equal to a reference number of Bluetooth connections established by the Bluetooth controller.

[0034] In a possible implementation, the obtaining module is configured to, in a case where the working state of the second Bluetooth master is exiting hibernation, obtain operation information of the second Bluetooth master.

[0035] In a third aspect, a terminal device is provided, and the terminal device includes a processor coupled with a memory, and the memory stores at least one program instruction or code, which is loaded and executed by the processor to enable the terminal device to implement the multi-Bluetooth master cooperative processing method according to the first aspect or any one of the first aspect.

[0036] Optionally, the processor is one or more, and the memory is one or more.

[0037] Optionally, the memory can be integrated with the processor, or the memory and the processor are separately arranged.

[0038] In a specific implementation process, the memory can be a non-transitory memory, for example, a read-only memory (ROM), which can be integrated on the same chip as the processor, or can be separately arranged on different chips, and the type of the memory and the arrangement manner of the memory and the processor are not limited in the present application.

[0039] In a fourth aspect, a computer-readable storage medium is provided, and the storage medium stores at least one instruction, which is loaded and executed by a processor to enable a computer to implement the method in the above aspects.

[0040] In a fifth aspect, a computer program (product) is provided, and the computer program (product) includes computer program code, which, when run by a computer, enables the computer to execute the method in the above aspects.

[0041] In a sixth aspect, a chip is provided, including a processor, configured to call and run instructions stored in a memory, so that a communication device installed with the chip executes the method in the above aspects.

[0042] In a seventh aspect, another chip is provided, comprising: an input interface, an output interface, a processor, and a memory, the input interface, the output interface, the processor, and the memory being connected through internal connection paths, the processor being configured to execute code in the memory, when the code is executed, the processor being configured to execute the method in any of the aspects above.

[0043] It should be understood that the beneficial effects achieved by the second aspect to the seventh aspect of the present application and the corresponding possible implementation manners can be referred to the technical effects of the first aspect and the corresponding possible implementation manners described above, and will not be described here again. In addition, the cooperative processing device of the multiple Bluetooth hosts mentioned in the second aspect above can be the chip mentioned in the sixth aspect or the seventh aspect, or the cooperative processing device of the multiple Bluetooth hosts can also be the terminal device mentioned in the third aspect. BRIEF DESCRIPTION OF DRAWINGS

[0044] FIG. 1 is a schematic diagram of a multiple Bluetooth application scenario provided by an embodiment of the present application;

[0045] FIG. 2 is a structural schematic diagram of a Bluetooth communication system provided by an embodiment of the present application;

[0046] FIG. 3 is a flowchart of a cooperative processing method of multiple Bluetooth hosts provided by an embodiment of the present application;

[0047] FIG. 4 is a flowchart of another cooperative processing method of multiple Bluetooth hosts provided by an embodiment of the present application;

[0048] FIG. 5 is an interaction schematic diagram of a cooperative processing method of multiple Bluetooth hosts provided by an embodiment of the present application;

[0049] FIG. 6 is an interaction schematic diagram of another cooperative processing method of multiple Bluetooth hosts provided by an embodiment of the present application;

[0050] FIG. 7 is a structural schematic diagram of a cooperative processing device of multiple Bluetooth hosts provided by an embodiment of the present application;

[0051] FIG. 8 is a structural schematic diagram of a terminal device provided by an embodiment of the present application;

[0052] FIG. 9 is a structural schematic diagram of another terminal device provided by an embodiment of the present application;

[0053] FIG. 10 is a schematic diagram of a terminal system architecture provided by an embodiment of the present application. DETAILED DESCRIPTION

[0054] In order to make the purpose, technical scheme and advantages of the present application more clear, the embodiments of the present application will be further described in detail below with reference to the drawings.

[0055] With the development of Bluetooth communication, devices with Bluetooth communication function are becoming more and more common. In actual application, in the case of long-time running of the Bluetooth communication system, the processor of the device needs to process Bluetooth data for a long time, and the energy consumption of the device will increase sharply. Therefore, in order to reduce the overall energy consumption of the device, the technology of multiple Bluetooth host cooperation coexistence emerges as the times require. Taking the cooperation coexistence of double Bluetooth hosts as an example, two Bluetooth hosts are deployed on the main processor and the coprocessor of the device, and each Bluetooth host runs its own Bluetooth application. The Bluetooth host can be wirelessly connected with at least one Bluetooth peripheral through Bluetooth technology, thereby realizing data transmission and communication function, and the Bluetooth peripheral includes but is not limited to Bluetooth earphone, Bluetooth mouse, Bluetooth keyboard, Bluetooth speaker or Bluetooth printer, etc. Among them, the main processor generally has high frequency and high energy consumption, and the coprocessor generally has low frequency and low energy consumption. Therefore, the long-time running Bluetooth application or high-load Bluetooth application is unloaded from the main processor to the coprocessor, so as to reduce the working time of the main processor and thereby reduce the overall energy consumption of the device and optimize the endurance of the device.

[0056] The Bluetooth system architecture generally includes two parts, namely Bluetooth host and Bluetooth controller. Optionally, the Bluetooth host and the Bluetooth controller can be deployed on two different chips, and the Bluetooth host and the Bluetooth controller interact with each other through a host controller interface protocol (HCI) interface, for example, sending instructions or transmitting data. The Bluetooth host (host) is a logical entity defined as all layers below the HCI interface and above the non-core configuration file, and the Bluetooth controller (controller) is a logical entity defined as all layers below the HCI interface. For a device with multiple Bluetooth host cooperation coexistence, multiple Bluetooth hosts interact with the same Bluetooth controller through the HCI interface, that is, the Bluetooth controller includes a double HCI interface. Therefore, if multiple Bluetooth hosts interact with the Bluetooth controller at the same time, a conflict will occur.

[0057] In the related art, the two Bluetooth hosts deployed on the main processor and the coprocessor negotiate time-sharing work. For example, Bluetooth host A first has the control right of the Bluetooth controller, and Bluetooth host A performs HCI data interaction with the Bluetooth controller; after Bluetooth host A completes the HCI data interaction, Bluetooth host A sends an instruction to switch the control right to the Bluetooth controller, and the Bluetooth controller responds to Bluetooth host A; after Bluetooth host A receives the response, Bluetooth host A sends a request to hand over the control right to Bluetooth host B, and Bluetooth host B responds to Bluetooth host A; Bluetooth host B sends an instruction to obtain the control right to the Bluetooth controller, and the Bluetooth controller responds to Bluetooth host B; thus, Bluetooth host B has the control right of the Bluetooth controller, and Bluetooth host B performs HCI data interaction with the Bluetooth controller. That is, when Bluetooth host A on the main processor works, Bluetooth host B on the coprocessor does not work.

[0058] In the above related technology 1, the dual-Bluetooth host time-sharing control Bluetooth controller mode can solve the coexistence conflict problem of dual-Bluetooth hosts. However, the control right of the Bluetooth controller needs to be switched back and forth between the dual-Bluetooth hosts, and at the same time, one Bluetooth host exclusively occupies the control right of the Bluetooth controller, and the other Bluetooth host completely loses the control right. The second Bluetooth host passively receives the control right handed over by the first Bluetooth host, and cannot actively acquire the control right. After having the control right, since the other Bluetooth host is not working, the operation instruction can be directly executed in the case of a start operation instruction. Therefore, this mode is only applicable to a scene in which the dual-Bluetooth hosts do not need to work simultaneously, for example, a single-Bluetooth application scene, and is not applicable to a scene in which the dual-Bluetooth hosts work in parallel, for example, a multi-Bluetooth application scene.

[0059] In the related technology 2, the two Bluetooth hosts deployed on the main processor and the coprocessor have a master-slave relationship, the master Bluetooth host deployed on the main processor controls the slave Bluetooth host on the coprocessor to perform Bluetooth communication by issuing an instruction. The dual-Bluetooth hosts have an obvious master-slave relationship, and the autonomy of the Bluetooth host on the coprocessor is small, and can only execute the instruction task issued by the main processor, and does not have the ability to work autonomously, and is still not applicable to the multi-Bluetooth application scene, that is, still not applicable to the scene in which the dual-Bluetooth hosts work in parallel.

[0060] Embodiments of the present application provide a dual-Bluetooth host cooperative processing method for realizing parallel work of dual-Bluetooth hosts. The dual-Bluetooth host cooperative processing method can be applicable to a multi-Bluetooth application communication scene, which can include multiple Bluetooth communication devices. Any Bluetooth communication device performs Bluetooth services with other Bluetooth communication devices, the Bluetooth services are triggered by multiple Bluetooth applications of any Bluetooth communication device, and the multiple Bluetooth applications are deployed on at least two Bluetooth hosts of any Bluetooth communication device and have a parallel running demand, that is, a dual-Bluetooth host parallel work demand.

[0061] The embodiments of the present application do not limit the type of Bluetooth communication device, and can be any terminal device with Bluetooth communication function. Optionally, the terminal device can be a personal computer (PC), a mobile phone, a loss-preventing device, a wireless earphone, a wearable device, a pocket PC (PPC), a tablet computer, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, a wireless terminal in self-driving, a wireless terminal in remote medical surgery, a wireless terminal in smart grid, a wireless terminal in transportation safety, a wireless terminal in smart city, a wireless terminal in smart home, an Internet of Things terminal, or the like.

[0062] For example, referring to a schematic diagram of a multi-Bluetooth application scenario shown in FIG. 1, the plurality of Bluetooth communication devices are a mobile phone, a loss-preventing device, a wireless earphone, and a tablet computer (PAD) respectively. As shown in FIG. 1, the mobile phone is at the center, and the multi-Bluetooth host of the mobile phone can perform personal full-scene services with the loss-preventing device, the wireless earphone, and the PAD, and the like. The service scenario can include the following typical scenarios: after the mobile phone discovers the PAD, it can trigger Bluetooth connection and Bluetooth data transmission, and complete data double-end device information update; the wireless earphone is discovered by the mobile phone after the cover is opened, and needs to be connected by Bluetooth; when a user finds a lost device through the loss-preventing device, the mobile phone needs to start Bluetooth scanning to discover the loss-preventing device, and after discovery, the mobile phone connects the loss-preventing device by Bluetooth.

[0063] The above service scenarios are triggered by a plurality of Bluetooth applications, such as the Bluetooth connection of the PAD triggered by the soft bus networking of the mobile phone online automatically; the Bluetooth connection of the wireless earphone triggered by the audio software background of the mobile phone automatically; the Bluetooth connection of the loss-preventing device can be triggered by the user operating the mobile phone and the find network of the mobile phone, or can be triggered by the find network background of the mobile phone automatically. For the Bluetooth applications such as the soft bus, the audio software, and the find network, considering the power consumption of the mobile phone, the Bluetooth application that needs to be run for a long time is deployed on the Bluetooth host of the low-power coprocessor, and other Bluetooth applications can be deployed on the Bluetooth host of the main processor.

[0064] The method for cooperative processing of multiple Bluetooth hosts provided by the embodiments of the present application can be executed by a Bluetooth communication device, which can be a Bluetooth low energy (BLE) device, for example, a mobile phone shown in FIG. 1. The Bluetooth communication device can deploy a Bluetooth communication system, which includes multiple Bluetooth hosts and a Bluetooth controller. For example, FIG. 2 is a structural schematic diagram of a Bluetooth communication system provided by the embodiments of the present application, as shown in FIG. 2, the hardware modules of the Bluetooth communication system include a processor A, a processor B and a Bluetooth chip, and the software modules include a Bluetooth host A, a Bluetooth host B and a Bluetooth controller. The Bluetooth host A is deployed in the processor A, the Bluetooth host B is deployed in the processor B, and the Bluetooth controller is deployed in the Bluetooth chip. For example, the processor A and the processor B are two different processors, not two cores in one processor. The processor A can be an application processor (AP), which belongs to a main processor; and the processor B can be a sensor hub (SH), which belongs to a coprocessor.

[0065] Among them, the Bluetooth host A and the Bluetooth host B are the upper computer parts in the Bluetooth communication system, responsible for controlling the working mode of the Bluetooth controller and processing the data reported by the Bluetooth controller. The Bluetooth host A is equivalent to the content related to Bluetooth in the main architecture of the Bluetooth communication device, that is, the content related to Bluetooth in the operating system of the processor A; and the Bluetooth host B is the content related to Bluetooth in the operating system of the processor B. The operating system corresponding to the Bluetooth host A and the operating system corresponding to the Bluetooth host B can be heterogeneous. As shown in FIG. 2, the Bluetooth host A and the Bluetooth host B respectively include a Bluetooth application, a Bluetooth protocol stack and a Bluetooth interface driver. The Bluetooth controller is the lower computer part in the Bluetooth communication system, responsible for connecting with other Bluetooth communication devices to realize signal transmission and data exchange. The Bluetooth controller includes a Bluetooth interface driver, and other modules included in the Bluetooth controller are the same as related technologies, and will not be described in detail.

[0066] Bluetooth applications refer to applications that need to rely on Bluetooth protocol to complete communication services. For example, a distributed software bus application uses Bluetooth discovery, Bluetooth connection or Bluetooth transmission to discover devices and synchronize information. A search network application uses Bluetooth broadcast and Bluetooth connection to search for devices. The Bluetooth application running on the Bluetooth master A can be the same as or different from the Bluetooth application running on the Bluetooth master B. The Bluetooth protocol stack includes the implementation of the Bluetooth protocol defined in the Bluetooth specification, and optionally includes but is not limited to the implementation and encapsulation of the Bluetooth protocol such as the logical link control and adaptation protocol (L2CAP) and the generic attribute profile (GATT), to provide a Bluetooth interface for the Bluetooth application. The Bluetooth interface provides a standardized way to implement Bluetooth communication. By using the Bluetooth interface, Bluetooth applications can be developed more easily, and can be interoperable between different Bluetooth communication devices.

[0067] In the embodiments of the present application, a coordination module is added to the Bluetooth protocol stack, which is used to implement the coordination logic between different Bluetooth protocol stacks in the Bluetooth communication system of multiple Bluetooth masters, to avoid conflicts between concurrent work of different Bluetooth protocol stacks. The Bluetooth interface driver of the Bluetooth controller is connected with the Bluetooth interface driver of the Bluetooth master, to provide a driver for the path between the Bluetooth master and the Bluetooth controller. For example, the Bluetooth interface driver is an HCI interface driver.

[0068] FIG. 3 is a flowchart of a method for coordinating multiple Bluetooth masters according to an embodiment of the present application. The method is performed by a Bluetooth communication device, which can be the mobile phone shown in FIG. 1. The Bluetooth communication device is deployed with a Bluetooth communication system, which includes multiple Bluetooth masters and at least one Bluetooth controller. The multiple Bluetooth masters can be deployed on the same processor or on different processors. The embodiments of the present application take a first Bluetooth master and a second Bluetooth master connected to the same Bluetooth controller as an example for illustration. For example, the Bluetooth communication system can be as shown in FIG. 2, the first Bluetooth master can be the Bluetooth master A shown in FIG. 2, and the second Bluetooth master can be the Bluetooth master B shown in FIG. 2; or the first Bluetooth master can be the Bluetooth master B shown in FIG. 2, and the second Bluetooth master can be the Bluetooth master A shown in FIG. 2. As shown in FIG. 3, the method for coordinating multiple Bluetooth masters includes but is not limited to the following steps 301 and 302.

[0069] Step 301: Before the first Bluetooth master executes a first operation instruction, first operation information of the second Bluetooth master is obtained, the first operation information indicating an operation state of the second Bluetooth master.

[0070] The second Bluetooth host and the first Bluetooth host are connected to the same Bluetooth controller, that is, a multi-Bluetooth host coexistence scenario. The first Bluetooth host starting the first operation instruction indicates that the working state of the first Bluetooth host is exiting hibernation, and the first Bluetooth host is working. Taking the first Bluetooth host deployed on a first processor of the Bluetooth communication device as an example, the working state of the first Bluetooth host can be determined according to the working state of the first processor. For example, if the working state of the first processor is exiting hibernation, that is, the first processor is working, it is determined that the working state of the first Bluetooth host is exiting hibernation.

[0071] In a possible implementation, before the first Bluetooth host executes the first operation instruction, the working state of the second Bluetooth host also needs to be determined, that is, the operation information of the second Bluetooth host is acquired when the working state of the second Bluetooth host is exiting hibernation. The working state of the second Bluetooth host is exiting hibernation, that is, the second Bluetooth host is working, and the scenario of multi-Bluetooth host parallel working is used, and the operation information of the second Bluetooth host is acquired in the parallel working scenario, so as to avoid the conflict problem of multi-Bluetooth host parallel working.

[0072] In another possible implementation, when the working state of the second Bluetooth host is entering hibernation, the first operation instruction is directly interacted with the Bluetooth controller to be executed, without acquiring the first operation information of the second Bluetooth host, and without judging whether the operation state of the second Bluetooth host conflicts with the first operation instruction. The working state of the second Bluetooth host is entering hibernation, that is, the second Bluetooth host is not working, and the scenario of single Bluetooth host is used, and thus the operation is directly executed, and the overhead of cooperative processing is saved.

[0073] Taking the second Bluetooth host deployed on a second processor of the Bluetooth communication device as an example, the working state of the second Bluetooth host can be determined according to the working state of the second processor. For example, if the working state of the second processor is exiting hibernation, that is, the second processor is working, it is determined that the working state of the second Bluetooth host is exiting hibernation; if the working state of the second processor is entering hibernation, that is, the second processor is not working, it is determined that the working state of the second Bluetooth host is entering hibernation. The processor entering hibernation can reduce the power consumption of the Bluetooth communication device.

[0074] In the embodiments of the present application, the acquired first operation information of the second Bluetooth host can indicate an operation state of the second Bluetooth host, and the operation state can indicate an execution condition of the operation instruction. Optionally, the operation state includes being operated, operation completed, idle, etc. For example, the first operation information includes a first flag, and the first flag is used to indicate that the operation state of the second Bluetooth host is operation completed; or the first operation information includes a second flag, and the second flag is used to indicate that the operation state of the second Bluetooth host is idle. For different types of operation instructions, the type of the operation state can also be different. For example, if the operation instruction is of a scanning type, the operation state is a scanning state, and the scanning state can include being scanned, scanning completed, idle, etc.; if the operation instruction is of a connection type, the operation state is a connection state, and the connection state can include being connected, connection completed, idle, etc.

[0075] Optionally, the embodiments of the present application do not limit the manner of acquiring the first operation information of the second Bluetooth host, and the manner includes but is not limited to the following two manners.

[0076] Manner one, a first query instruction is sent to the second Bluetooth host, the first query instruction is used for the second Bluetooth host to send the first operation information of the second Bluetooth host to the first Bluetooth host; and the first operation information sent by the second Bluetooth host is received.

[0077] In the manner one, the operation information of the opposite Bluetooth host is acquired by sending a query instruction to the opposite Bluetooth host, the cooperative interaction between the multiple Bluetooth hosts is realized, and since the first operation information acquired by the query manner is the latest operation information of the opposite Bluetooth host, the accuracy of the acquired first operation information can be ensured. Taking the Bluetooth hosts shown in FIG. 2 as an example, the interaction between the multiple Bluetooth hosts can be realized by a cooperation module on the Bluetooth host. Optionally, the first query instruction is sent to the second Bluetooth host by the first Bluetooth host, the first query instruction is used for the second Bluetooth host to send the first operation information of the second Bluetooth host to the first Bluetooth host; and the first operation information sent by the second Bluetooth host is received by the first Bluetooth host.

[0078] Optionally, the second Bluetooth host can send the first operation information of the second Bluetooth host to the first Bluetooth host immediately after receiving the first query instruction, and the operation state indicated by the first operation information at this time can or can not conflict with the first operation instruction. Alternatively, the second Bluetooth host can send the first operation information of the second Bluetooth host to the first Bluetooth host only when the operation state of the second Bluetooth host does not conflict with the first operation instruction after receiving the first query instruction, and the first operation information at this time must indicate that the operation state of the second Bluetooth host does not conflict with the first operation instruction. That is, if the second Bluetooth host is executing an operation instruction or an operation instruction of the same type as the first operation instruction, the second Bluetooth host should not respond to the first query instruction and wait until the execution of the operation instruction is completed before responding to the first query instruction.

[0079] In this way, the second Bluetooth host responds only when the operation state of the second Bluetooth host does not conflict with the first operation instruction, thereby avoiding the re-sending of the query instruction due to the conflict between the operation state of the response and the first operation instruction. That is, one operation instruction sends one query instruction, and the operation instruction can be executed as soon as the query instruction is responded, and the conflict of simultaneous execution of the operation instruction is avoided.

[0080] In the second way, the first operation information of the second Bluetooth host is obtained by reading the cooperation information recorded by the first Bluetooth host.

[0081] In the second way, the first Bluetooth host records the cooperation information, and the cooperation information indicates the first operation information of the second Bluetooth host. Thus, by recording the operation information of the opposite Bluetooth host, the first operation information can be quickly obtained, and the efficiency of obtaining the first operation information is improved.

[0082] Optionally, the cooperation information recorded by the first Bluetooth host can include: receiving a second query instruction, the second query instruction being sent before the second Bluetooth host executes a second operation instruction; sending third operation information to the second Bluetooth host, the third operation information indicating that the operation state of the first Bluetooth host does not conflict with the second operation instruction; and recording fourth operation information as the cooperation information in the first Bluetooth host, the fourth operation information indicating that the second Bluetooth host is executing the second operation instruction. Alternatively, receiving fifth operation information, the fifth operation information being sent to the first Bluetooth host after the execution of the second operation instruction is completed, the fifth operation information indicating that the second Bluetooth host has completed the execution of the second operation instruction; and recording the fifth operation information of the second Bluetooth host as the cooperation information in the first Bluetooth host.

[0083] In this case, the second Bluetooth host also queries the first Bluetooth host for operation information before executing the second operation instruction. Since the second Bluetooth host starts to execute the second operation instruction after the first Bluetooth host responds to the third operation information, fourth operation information indicating that the second Bluetooth host is executing the second operation instruction can be recorded as the coordination information. In addition, the second Bluetooth host also notifies the first Bluetooth host after the execution of the second operation instruction is completed, and thus fifth operation information indicating that the second Bluetooth host has completed the execution of the second operation instruction can be recorded as the coordination information. In this way, real-time recording of the coordination information is achieved, and the operation information between the multiple Bluetooth hosts can be synchronized in real time.

[0084] In step 302, in the case where the operation state of the second Bluetooth host does not conflict with the first operation instruction, the first Bluetooth host interacts with the Bluetooth controller to execute the first operation instruction.

[0085] After the first operation information of the second Bluetooth host is obtained, whether there is a conflict can be determined according to the operation state of the second Bluetooth host indicated by the first operation information. That is, in the case where the operation state of the second Bluetooth host does not conflict with the first operation instruction, the first Bluetooth host interacts with the Bluetooth controller to execute the first operation instruction; in the case where the operation state of the second Bluetooth host conflicts with the first operation instruction, the operation information of the second Bluetooth host is obtained again until the operation state of the second Bluetooth host indicated by the obtained operation information does not conflict with the first operation instruction, and then the first Bluetooth host interacts with the Bluetooth controller to execute the first operation instruction. Alternatively, the first Bluetooth host interacts with the Bluetooth controller to execute the first operation instruction. Executing the first operation instruction can mean performing an operation corresponding to the first operation instruction.

[0086] In one possible implementation, after the first Bluetooth host interacts with the Bluetooth controller to execute the first operation instruction, in the case where the execution of the first operation instruction is completed, second operation information is sent to the second Bluetooth host, and the second operation information indicates that the first Bluetooth host has completed the execution of the first operation instruction. In this way, the synchronization of the operation information between the multiple Bluetooth hosts is achieved through the coordination interaction.

[0087] In the embodiments of the present application, the operation state of the second Bluetooth host does not conflict with the first operation instruction means that the execution of the operation instruction of the second Bluetooth host does not affect the execution of the first operation instruction by the first Bluetooth host, for example, the second Bluetooth host does not execute an operation instruction that conflicts with the first operation instruction, so that the success rate of the first Bluetooth host executing the first operation instruction is higher in the case of no conflict. Alternatively, the operation state of the second Bluetooth host does not conflict with the first operation instruction includes that the second Bluetooth host does not execute an operation instruction of the same type as the first operation instruction. In this way, multiple Bluetooth hosts can avoid executing the same type of operation instruction at the same time, while different types of operation instructions can be executed at the same time, so that different types of operation instructions do not affect each other. Alternatively, the operation state of the second Bluetooth host does not conflict with the first operation instruction includes that the second Bluetooth host does not execute any operation instruction. In this way, multiple Bluetooth hosts can avoid executing the same type or different type of operation instruction at the same time, and better avoid any possible conflict. The type of the first operation instruction includes broadcast type, scan type, connection type, and transmission type, etc.

[0088] In the case where the first operation instruction is used to update the scan parameters of the Bluetooth controller, the first operation instruction is of the scan type. In this case, the operation information indicates the scan parameters in addition to the scan state. The scan parameters include at least one of scan type, scan window, scan interval, timeout time, scan filter, scan power, or scan mode.

[0089] The scan type includes active scanning or passive scanning, in the active scanning mode, the device periodically sends a scan request to obtain the broadcast data of the surrounding BLE device, while in the passive scanning mode, the device can only receive the broadcast data of the surrounding BLE device. The scan window refers to the duration of each scan of the device. Generally, the larger the scan window, the more broadcast data can be received, but it will increase the power consumption and prolong the scanning time. The scan interval refers to the time interval between two scans of the device. The timeout time refers to the time when the device stops scanning if it does not find the target device after the scan time reaches the timeout time. The timeout time should be adjusted according to the actual scene and demand. The scan filter can filter the scan results according to the device name, device address, etc. to reduce unnecessary scan results. The setting of the scan power affects the signal strength of the device during scanning, thereby affecting the scanning distance and power consumption of the device. The scan mode includes low power mode, balanced mode and low delay mode. The low power mode can save power to some extent, but the success rate of scanning will be reduced, while the low delay mode can improve the success rate of scanning, but will consume more power.

[0090] In a possible implementation, the first operation information includes a first scan parameter of the second Bluetooth master. In this case, the manner of interacting with the Bluetooth controller can include: in a case where the second scan parameter of the first Bluetooth master is greater than or equal to a scan range indicated by the first scan parameter, sending the second scan parameter to the Bluetooth controller, the second scan parameter being used by the Bluetooth controller to update the scan parameter to the second scan parameter; or in a case where the second scan parameter is less than the scan range indicated by the first scan parameter, sending the first scan parameter to the Bluetooth controller, the first scan parameter being used by the Bluetooth controller to update the scan parameter to the first scan parameter.

[0091] In the formula, the first scan parameter of the second Bluetooth master refers to a scan parameter required by the second Bluetooth master for scanning by the Bluetooth controller, that is, scan data required by the second Bluetooth master for scanning by the Bluetooth controller according to the first scan parameter; and the second scan parameter of the first Bluetooth master refers to a scan parameter required by the first Bluetooth master for scanning by the Bluetooth controller, that is, scan data required by the first Bluetooth master for scanning by the Bluetooth controller according to the second scan parameter. Thus, the multiple Bluetooth masters can not only interact with the scan states, but also interact with the scan parameters. In a case where the scan parameters of the multiple Bluetooth masters are different, the scan parameter of the Bluetooth controller can be uniformly updated to the scan parameter with the largest scan range among the multiple Bluetooth masters, so that the scan range of the Bluetooth controller based on the updated scan parameter is greater than the scan range of the scan parameter of each Bluetooth master, and thus the multiple Bluetooth masters can reuse the scan resource of the Bluetooth controller, that is, the scan data of the Bluetooth controller based on the updated scan parameter can be used by the first Bluetooth master and the second Bluetooth master at the same time.

[0092] In a case where the first operation instruction is used to establish a Bluetooth connection, the first operation instruction is of a connection type. In this case, the operation information indicates not only the connection state but also the connection quantity. In a possible implementation, the first operation information includes a first quantity of Bluetooth connections established by the second Bluetooth master, the first quantity being used to control a second quantity of Bluetooth connections established by the first Bluetooth master, and a sum of the second quantity and the first quantity is less than or equal to a reference quantity of Bluetooth connections established by the Bluetooth controller. The reference quantity can refer to a maximum connection quantity supported by a Bluetooth chip where the Bluetooth controller is located. Thus, the multiple Bluetooth masters can not only interact with the connection states, but also interact with the connection quantities, so as to realize reasonable allocation of the connection resources among the multiple Bluetooth masters.

[0093] In addition to the above execution operation instruction, the first Bluetooth host and the second Bluetooth host can also interact to implement resource cooperative allocation. In a possible implementation, taking the implementation of resource cooperative allocation between the first Bluetooth host and the second Bluetooth host as an example, the number of concurrent broadcasts supported by the Bluetooth controller is obtained; the number of broadcasts is allocated to the second Bluetooth host, so that the second Bluetooth host broadcasts based on the allocated number of broadcasts. Optionally, a first read instruction of broadcast resource is sent to the Bluetooth controller, the first read instruction is used to send the number of concurrent broadcasts by the Bluetooth controller to the first Bluetooth host, that is, to respond to the first read instruction; the number of concurrent broadcasts sent by the Bluetooth controller is received; the number of broadcasts is allocated to the second Bluetooth host, and the allocated number of broadcasts is sent to the second Bluetooth host, and the second Bluetooth host responds to the first Bluetooth host. Thus, the cooperative allocation of broadcast resources of multiple Bluetooth hosts is realized.

[0094] In a possible implementation, the number of transmission buffers supported by the Bluetooth controller is obtained; the number of buffers is allocated to the second Bluetooth host, so that the second Bluetooth host transmits based on the allocated number of buffers. Optionally, a second read instruction of buffer resource is sent to the Bluetooth controller, the second read instruction is used to send the number of transmission buffers by the Bluetooth controller to the first Bluetooth host, that is, to respond to the second read instruction; the number of transmission buffers sent by the Bluetooth controller is received; the number of buffers is allocated to the second Bluetooth host, and the allocated number of buffers is sent to the second Bluetooth host, and the second Bluetooth host responds to the first Bluetooth host. Thus, the cooperative allocation of transmission buffer resources of multiple Bluetooth hosts is realized.

[0095] Thus, through the above steps 301 and 302, the multiple Bluetooth hosts interact with operation information to realize the ordered scheduling of operation instructions, avoiding the coexistence conflict problem in the parallel working scenario of multiple Bluetooth hosts. Taking the first Bluetooth host as an example, the first Bluetooth host in the working process, each time the operation instruction is started, the operation information of the second Bluetooth host is obtained first, that is, the second Bluetooth host can work with the first Bluetooth host at the same time, and the operation instruction is executed only when it is determined that there is no conflict, rather than directly executing the instruction. The cooperative processing mode of the second Bluetooth host in the working process is the same as that of the first Bluetooth host. Thus, the conflict problem of multiple Bluetooth hosts executing operation instructions at the same time can be avoided, and the parallel working of multiple Bluetooth hosts is realized.

[0096] In a possible implementation, the Bluetooth communication system of the Bluetooth communication device further comprises a third Bluetooth master in addition to the first Bluetooth master and the second Bluetooth master, and the sixth operation information of the third Bluetooth master is further acquired in addition to the first operation information of the second Bluetooth master, the sixth operation information indicating an operation state of the third Bluetooth master. Further, in a case where the operation state of the second Bluetooth master and the operation state of the third Bluetooth master both do not conflict with the first operation instruction, interaction with the Bluetooth controller is performed to execute the first operation instruction. The implementation of acquiring the sixth operation information of the third Bluetooth master is the same as the implementation of acquiring the first operation information of the second Bluetooth master, which will not be repeated here.

[0097] Next, taking the Bluetooth communication system deployed by the Bluetooth communication device as the Bluetooth communication system shown in FIG. 2, taking the interaction between the Bluetooth master A, the Bluetooth master B and the Bluetooth controller as an example, and taking the flowchart shown in FIG. 4 as an example, the method for cooperative processing of multiple Bluetooth masters provided in the embodiments of the present application is exemplarily described. As shown in FIG. 4, the Bluetooth application on the Bluetooth master A side starts an operation instruction, and the operation instruction includes but is not limited to updating a scanning parameter or establishing a Bluetooth connection. Before executing the started operation instruction, the Bluetooth protocol stack on the Bluetooth master A side first queries the operation state of the Bluetooth master B. Further, the cooperative module on the Bluetooth master A side sends a query instruction for querying the operation state to the cooperative module on the Bluetooth master B side.

[0098] After receiving the query instruction, the cooperative module on the Bluetooth master B side first judges the operation state of the Bluetooth master B. If the Bluetooth master B is currently executing an operation instruction, the Bluetooth master B needs to wait for the completion of the currently executing operation instruction, and then the cooperative module on the Bluetooth master B side returns the operation state of the Bluetooth master B to the Bluetooth master A, that is, the cooperative module on the Bluetooth master B side responds to the operation state. If the Bluetooth master B is not currently executing an operation instruction, the cooperative module on the Bluetooth master B side immediately returns the operation state of the Bluetooth master B to the Bluetooth master A. Optionally, on the basis of responding to the operation state, the operation parameter is also responded to, that is, the operation parameter of the Bluetooth master B, for example, the scanning parameter, is also returned to the Bluetooth master A. After the cooperative module on the Bluetooth master B side responds to the operation state, the operation state of the Bluetooth master A is also recorded as being in operation.

[0099] After receiving the operation state responded by the Bluetooth master B, the cooperative module on the Bluetooth master A side continues to execute the started operation instruction. After the Bluetooth master A completes the operation instruction, the cooperative module on the Bluetooth master A side notifies the cooperative module on the Bluetooth master B side that the Bluetooth master A completes the operation. After receiving the notification, the cooperative module on the Bluetooth master B side records the operation state of the Bluetooth master A side as being completed.

[0100] Thus, the cooperation module on the Bluetooth host B side records the operation state of the Bluetooth host A side. The Bluetooth application on the Bluetooth host B side starts an operation instruction, which includes but is not limited to Bluetooth scanning or Bluetooth connection, etc. The Bluetooth protocol stack on the Bluetooth host B side queries the operation state of the Bluetooth host A before executing the started operation instruction. Further, the operation state of the Bluetooth host A recorded in the cooperation module on the Bluetooth host B side is first queried; if the operation is being performed, the Bluetooth host B needs to wait until the operation state of the Bluetooth host A changes to operation completion before executing the operation instruction; if the operation is completed, the Bluetooth host B can immediately execute the operation instruction.

[0101] In the case of the operation instruction being to update the scanning parameter, due to the constraint that the Bluetooth chip can only set one set of scanning parameters, if the Bluetooth host A and the Bluetooth host B simultaneously modify the scanning parameter, a conflict situation of parameter coverage or scanning state error will occur, which cannot meet the scanning requirement of multiple Bluetooth hosts working in parallel. Therefore, the embodiment of the present application adds double-stack interaction at the scanning conflict point, double stack is a short name of double Bluetooth protocol stack, and the double-stack interaction is the interaction between the cooperation modules of the double stack, which makes the double stacks mutually sense the scanning state and the scanning parameter through the interaction, realizes the scanning cooperation and orderly scheduling, and unifies the scanning parameter.

[0102] In combination with the timing flow chart of the scanning cooperation shown in FIG. 5, the process of the Bluetooth host A and the Bluetooth host B simultaneously updating the scanning parameter is exemplified. The Bluetooth application on the Bluetooth host A side starts the Bluetooth protocol stack on the Bluetooth host A side to update the scanning parameter, and the scanning parameter to be updated is scanning parameter A. During the interaction between the Bluetooth protocol stack on the Bluetooth host A side and the Bluetooth controller, the Bluetooth application on the Bluetooth host B side also starts the Bluetooth protocol stack on the Bluetooth host B side to update the scanning parameter, and the scanning parameter to be updated is scanning parameter B.

[0103] In this case, the Bluetooth protocol stack on the Bluetooth host A side queries the scanning state and the scanning parameter on the Bluetooth host B side before executing the operation of updating the scanning parameter, for example, by sending a query instruction from the cooperation module on the Bluetooth host A side to the cooperation module on the Bluetooth host B side. After receiving the query instruction, the Bluetooth protocol stack on the Bluetooth host B side waits until the operation of updating the scanning parameter is completed, and then replies the scanning state and the scanning parameter to the Bluetooth protocol stack on the Bluetooth host A side, and the scanning state is operation completion. The process of the Bluetooth host B executing the operation of updating the scanning parameter is that the Bluetooth protocol stack on the Bluetooth host B side sets the scanning parameter B to the Bluetooth controller, the Bluetooth controller replies the setting success to the Bluetooth protocol stack on the Bluetooth host B side after updating the scanning parameter to the scanning parameter B, and the Bluetooth protocol stack on the Bluetooth host B side feeds back to the Bluetooth application on the Bluetooth host B side that the operation of updating the scanning parameter is successful.

[0104] After the Bluetooth protocol stack of the Bluetooth host A side receives the response of the Bluetooth host B, it determines that the scanning state of the Bluetooth host B side is operation completed, that is, it determines that the operation of updating the scanning parameter will not conflict with the operation instruction of the Bluetooth host B side, and then the Bluetooth protocol stack of the Bluetooth host A side starts to execute the operation of updating the scanning parameter. In this case, the Bluetooth protocol stack of the Bluetooth host A side compares the scanning parameter A to be updated of the Bluetooth host A side with the scanning parameter B fed back by the Bluetooth host B side, and determines that the larger scanning parameter between the scanning parameter A and the scanning parameter B is the unified scanning parameter, that is, the unified scanning parameter is the scanning parameter A or the scanning parameter B. The Bluetooth protocol stack of the Bluetooth host A side sets the unified scanning parameter to the Bluetooth controller, and the Bluetooth controller feeds back to the Bluetooth protocol stack of the Bluetooth host A side that the setting is successful after updating the scanning parameter to the unified scanning parameter. The Bluetooth protocol stack of the Bluetooth host A side feeds back to the Bluetooth application of the Bluetooth host A side that the operation of updating the scanning parameter is successful. The Bluetooth protocol stack of the Bluetooth host A side also notifies the Bluetooth protocol stack of the Bluetooth host B side of the scanning state and the unified scanning parameter, and the scanning state is operation completed. The Bluetooth protocol stack of the Bluetooth host B side records the scanning parameter as the unified scanning parameter. In this way, the conflict-free scanning and the unified scanning parameter of the Bluetooth host A and the Bluetooth host B in the parallel working scenario are realized.

[0105] In the case of the operation instruction being to establish a Bluetooth connection, the Bluetooth chip is in a connection initiating state, and the constraint that the connection request of the Bluetooth protocol stack is no longer processed. If the double stacks simultaneously execute the operation of establishing a Bluetooth connection, a connection conflict will occur, resulting in the failure of the Bluetooth application to establish a Bluetooth connection, and the connection requirement of the parallel working of multiple Bluetooth hosts cannot be met. Therefore, the embodiment of the present application adds double-stack interaction at the connection conflict point, realizes mutual connection state between the double stacks through interaction, that is, realizes the cooperation of the connection state of the double stacks, and further realizes the connection cooperative and orderly scheduling, and achieves conflict-free connection.

[0106] In combination with the connection cooperative timing flow chart shown in FIG. 6, the process of simultaneously establishing a Bluetooth connection by the Bluetooth host A and the Bluetooth host B is exemplified. The Bluetooth application of the Bluetooth host A side initiates the operation of establishing a Bluetooth connection to the Bluetooth protocol stack of the Bluetooth host A side. In this case, the Bluetooth protocol stack of the Bluetooth host A side queries the connection state of the Bluetooth host B side before executing the operation of establishing a Bluetooth connection, for example, by sending a query instruction to the cooperative module of the Bluetooth host B side through the cooperative module of the Bluetooth host A side. After receiving the query instruction, the Bluetooth protocol stack of the Bluetooth host B side directly responds to the Bluetooth protocol stack of the Bluetooth host A side with the connection state, that is, idle, because the Bluetooth host B side is not executing the connection operation. Optionally, the Bluetooth protocol stack of the Bluetooth host B side records that the connection state of the Bluetooth host A side is in operation based on the responded connection state.

[0107] After the Bluetooth protocol stack of the Bluetooth host A side receives the response of the connection state, it determines that the connection state of the Bluetooth host B side is idle, i.e. it is determined that the operation of establishing the Bluetooth connection will not conflict with the operation instruction of the Bluetooth host B side, and then the Bluetooth protocol stack of the Bluetooth host A side starts to execute the operation of establishing the Bluetooth connection. That is, the Bluetooth protocol stack of the Bluetooth host A side sends a connection request to the Bluetooth controller, the Bluetooth controller enters the initiating state based on the connection request to realize the establishment of the Bluetooth connection, and after the Bluetooth connection is successfully established, the Bluetooth controller responds to the Bluetooth protocol stack of the Bluetooth host A side that the connection is successful, and the Bluetooth protocol stack of the Bluetooth host A side feeds back to the Bluetooth application of the Bluetooth host A side that the connection is successful. The Bluetooth protocol stack of the Bluetooth host A side also notifies the Bluetooth protocol stack of the Bluetooth host B side of the connection state and the normalized scanning parameters, and the connection state is that the operation is completed.

[0108] In the process of the Bluetooth protocol stack of the Bluetooth host A side executing the operation of establishing the Bluetooth connection, the Bluetooth application of the Bluetooth host B side also starts the operation of establishing the Bluetooth connection to the Bluetooth protocol stack of the Bluetooth host B side. Before executing the operation of establishing the Bluetooth connection, the Bluetooth protocol stack of the Bluetooth host B side queries the connection state of the Bluetooth host A recorded in the Bluetooth protocol stack of the Bluetooth host B side. If the connection state of the Bluetooth host A is in operation, the Bluetooth protocol stack of the Bluetooth host B side waits, i.e. suspends the execution of the operation of establishing the Bluetooth connection; if the connection state of the Bluetooth host A is that the operation is completed, the Bluetooth protocol stack of the Bluetooth host B side starts to execute the operation of establishing the Bluetooth connection.

[0109] The process of the Bluetooth protocol stack of the Bluetooth host B side executing the operation of establishing the Bluetooth connection is that the Bluetooth protocol stack of the Bluetooth host B side sends a connection request to the Bluetooth controller, the Bluetooth controller enters the initiating state based on the connection request to realize the establishment of the Bluetooth connection, and after the Bluetooth connection is successfully established, the Bluetooth controller responds to the Bluetooth protocol stack of the Bluetooth host B side that the connection is successful, and the Bluetooth protocol stack of the Bluetooth host B side feeds back to the Bluetooth application of the Bluetooth host B side that the connection is successful. Thus, the conflict-free connection of the Bluetooth host A and the Bluetooth host B in the parallel working scenario is realized.

[0110] In summary, the method provided by the embodiments of the present application adds an interaction mechanism of an operation state between Bluetooth protocol stacks of multiple Bluetooth hosts, so that the interaction mechanism of operation state query, response and notification between double stacks can be initiated at an operation instruction conflict point, the operation state of the double stacks is sensed, and the double stack operation instructions are sequentially dispatched. A reuse resource mechanism is added between the double stacks, so that at the operation instruction conflict point, the scanning parameters can be interacted between the double stacks, that is, the scanning parameters are sensed, and the scanning parameters are normalized by the Bluetooth protocol stack that finally executes the update scanning parameter operation. A resource allocation mechanism is added between the double stack connections, so that after the Bluetooth connection is successfully established, the opposite end Bluetooth protocol stack connection quantity can be notified, and the buffer quantity of the reallocation is carried. A dynamic coordination mechanism is added between the double stacks, so that the Bluetooth protocol stack senses the processor state of another Bluetooth protocol stack, stops coordination when entering sleep, and resumes coordination when exiting sleep.

[0111] The above introduces the cooperative processing method of the multiple Bluetooth hosts of the embodiments of the present application. Corresponding to the above method, the cooperative processing device of the multiple Bluetooth hosts is further provided by the embodiments of the present application. FIG. 7 is a structural schematic diagram of a cooperative processing device of multiple Bluetooth hosts provided by the embodiments of the present application. The device is applied to a Bluetooth communication device, and the Bluetooth communication device is the Bluetooth communication device shown in FIG. 3. Based on the following multiple modules shown in FIG. 7, the cooperative processing device of the multiple Bluetooth hosts shown in FIG. 7 can perform all or part of the operations performed by the Bluetooth communication device. It should be understood that the device can include more additional modules than the shown modules or omit part of the shown modules, and the embodiments of the present application do not limit this. As shown in FIG. 7, the device includes:

[0112] The obtaining module 701 is configured to obtain first operation information of a second Bluetooth host before a first Bluetooth host executes a first operation instruction, the second Bluetooth host and the first Bluetooth host are connected to a same Bluetooth controller, and the first operation information indicates an operation state of the second Bluetooth host.

[0113] The execution module 702 is configured to, in a case where the operation state of the second Bluetooth host does not conflict with the first operation instruction, interact with the Bluetooth controller to execute the first operation instruction.

[0114] In a possible implementation, the obtaining module 701 is configured to send a first query instruction to the second Bluetooth host, the first query instruction is used for the second Bluetooth host to send the first operation information of the second Bluetooth host to the first Bluetooth host, and the first operation information sent by the second Bluetooth host is received.

[0115] In a possible implementation, the device further includes a first sending module configured to, in a case where the first operation instruction is executed completely, send second operation information to the second Bluetooth host, and the second operation information indicates that the first Bluetooth host executes the first operation instruction completely.

[0116] In a possible implementation, the first Bluetooth host records the coordination information, and the coordination information indicates the first operation information of the second Bluetooth host.

[0117] In a possible implementation, the apparatus further includes: a receiving module, configured to receive a second query instruction, the second query instruction being sent before the second Bluetooth host executes the second operation instruction; a second sending module, configured to send third operation information to the second Bluetooth host, the third operation information indicating that the operation state of the first Bluetooth host does not conflict with the second operation instruction; and a recording module, configured to record fourth operation information as the coordination information in the first Bluetooth host, the fourth operation information indicating that the second Bluetooth host is executing the second operation instruction.

[0118] In a possible implementation, the receiving module is further configured to receive fifth operation information, the fifth operation information being sent to the first Bluetooth host in a case where the execution of the second operation instruction is completed, and the fifth operation information indicating that the second Bluetooth host executes the second operation instruction; and the recording module is further configured to record the fifth operation information as the coordination information in the first Bluetooth host.

[0119] In a possible implementation, the operation state of the second Bluetooth host not conflicting with the first operation instruction includes that the second Bluetooth host does not execute an operation instruction of the same type as the first operation instruction, or the second Bluetooth host does not execute any operation instruction.

[0120] In a possible implementation, the first operation instruction is used to update a scanning parameter of the Bluetooth controller, and the first operation information includes a first scanning parameter of the second Bluetooth host; the execution module 702 is configured to: in a case where a second scanning parameter of the first Bluetooth host is greater than or equal to a scanning range indicated by the first scanning parameter, send the second scanning parameter to the Bluetooth controller, the second scanning parameter being used for the Bluetooth controller to update the scanning parameter to the second scanning parameter; or in a case where the second scanning parameter is less than the scanning range indicated by the first scanning parameter, send the first scanning parameter to the Bluetooth controller, the first scanning parameter being used for the Bluetooth controller to update the scanning parameter to the first scanning parameter.

[0121] In a possible implementation, the first operation instruction is used to establish a Bluetooth connection, and the first operation information includes a first number of Bluetooth connections established by the second Bluetooth host, the first number being used to control a second number of Bluetooth connections established by the first Bluetooth host, and a sum of the first number and the second number is less than or equal to a reference number of Bluetooth connections established by the Bluetooth controller.

[0122] In a possible implementation, the acquisition module 701 is configured to acquire the operation information of the second Bluetooth host in a case where the working state of the second Bluetooth host is exiting hibernation.

[0123] It should be understood that the apparatus provided in the above Figure 7 is only exemplified by the division of the above functional modules when realizing its functions, and in actual application, the above functions can be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus and method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process and beneficial effects are detailed in the method embodiments, which will not be repeated here.

[0124] The embodiment of the present application provides a terminal device for performing the operations involved in the cooperative processing method of multiple Bluetooth hosts shown in Figure 3. Optionally, the structure diagram of the terminal device can be as shown in Figure 8. In the structure diagram of the terminal device shown in Figure 8, the terminal device may, for example, be a smart phone, a tablet computer, a vehicle-mounted terminal, a notebook computer or a desktop computer. The terminal device can also be referred to as a user equipment, a portable terminal, a laptop terminal, a desktop terminal, and other names.

[0125] Generally, the terminal device includes a processor 801 and a memory 802.

[0126] The processor 801 can include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 801 can be implemented in at least one of the hardware forms of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), and a PLA (Programmable Logic Array). The processor 801 can also include a main processor and a coprocessor. The main processor is a processor for processing data in an awake state, also known as a CPU (Central Processing Unit). The coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 801 can be integrated with a GPU (Graphics Processing Unit) that is responsible for rendering and drawing the content needed to be displayed by the display screen. In some embodiments, the processor 801 can also include an AI (Artificial Intelligence) processor for processing machine learning-related computing operations.

[0127] The memory 802 can include one or more computer-readable storage media. The computer-readable storage media can be non-transitory. The memory 802 can also include high-speed random access memory and can include non-volatile memory, such as one or more magnetic disk storage devices, optical disk storage devices, flash memory devices, or other non-volatile storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 802 stores at least one instruction for execution by the processor 801 to implement the method of opening an electronic account provided by the method embodiments in the present application.

[0128] In some embodiments, the terminal can further optionally include a peripheral device interface 803 and at least one peripheral device. The processor 801, the memory 802, and the peripheral device interface 803 can be connected by a bus or a signal line. Each peripheral device can be connected to the peripheral device interface 803 through a bus, a signal line, or a circuit board. Specifically, the peripheral device includes at least one of a radio frequency circuit 804, a display screen 805, a camera assembly 806, an audio circuit 807, and a power supply 808.

[0129] The peripheral device interface 803 can be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 801 and the memory 802. In some embodiments, the processor 801, the memory 802, and the peripheral device interface 803 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 801, the memory 802, and the peripheral device interface 803 can be implemented on a separate chip or circuit board, and the present embodiment does not limit this.

[0130] The radio frequency circuit 804 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 804 communicates with a communication network and other communication devices through electromagnetic signals. The radio frequency circuit 804 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals. Optionally, the radio frequency circuit 804 includes an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a subscriber identity module card, and the like. The radio frequency circuit 804 can communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes but is not limited to metropolitan area networks, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and / or Wireless Fidelity (WiFi) networks. In some embodiments, the radio frequency circuit 804 can also include NFC (Near Field Communication) related circuitry, which is not limited by the present application.

[0131] The display screen 805 is configured to display a UI (User Interface). The UI can include graphics, text, icons, video, and any combination thereof. When the display screen 805 is a touch display screen, the display screen 805 is further configured to capture touch signals on or above the surface of the display screen 805. The touch signals can be input to the processor 801 as control signals for processing. In this case, the display screen 805 can also be configured to provide virtual buttons and / or virtual keyboard, also known as soft buttons and / or soft keyboard. In some embodiments, the display screen 805 can be one, disposed on the front panel of the terminal; in other embodiments, the display screen 805 can be at least two, respectively disposed on different surfaces of the terminal or in a folding design; in still other embodiments, the display screen 805 can be a flexible display screen, disposed on a curved surface or a folding surface of the terminal. Even, the display screen 805 can also be disposed in an irregular shape, i.e., a special-shaped screen. The display screen 805 can be made of LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), etc.

[0132] The camera assembly 806 is configured to capture images or videos. Optionally, the camera assembly 806 includes a front camera and a rear camera. Typically, the front camera is disposed on the front panel of the terminal, and the rear camera is disposed on the back of the terminal. In some embodiments, the rear camera is at least two, respectively any one of a main camera, a depth-of-field camera, a wide-angle camera, and a telephoto camera, to realize the background blur function by fusing the main camera and the depth-of-field camera, the panoramic shooting and VR (Virtual Reality) shooting function by fusing the main camera and the wide-angle camera, or other fusion shooting functions. In some embodiments, the camera assembly 806 can further include a flash. The flash can be a single-color-temperature flash or a dual-color-temperature flash. The dual-color-temperature flash refers to the combination of a warm light flash and a cold light flash, which can be used for light compensation under different color temperatures.

[0133] The audio circuit 807 can include a microphone and a speaker. The microphone is used to collect sound waves of the user and the environment, and convert the sound waves into an electrical signal input to the processor 801 for processing, or input to the radio frequency circuit 804 to realize voice communication. For the purpose of stereo sound collection or noise reduction, the microphone can be multiple, respectively arranged at different parts of the terminal. The microphone can also be an array microphone or an omnidirectional collection type microphone. The speaker is used to convert the electrical signal from the processor 801 or the radio frequency circuit 804 into sound waves. The speaker can be a traditional diaphragm speaker, or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, not only can it convert electrical signals into sound waves that humans can hear, but it can also convert electrical signals into sound waves that humans cannot hear for ranging purposes. In some embodiments, the audio circuit 807 can also include a headphone jack.

[0134] The power supply 808 is used to supply power to each component in the terminal. The power supply 808 can be alternating current, direct current, disposable battery or rechargeable battery. When the power supply 808 includes a rechargeable battery, the rechargeable battery can support wired charging or wireless charging. The rechargeable battery can also be used to support fast charging technology.

[0135] In some embodiments, the terminal also includes one or more sensors 809. The one or more sensors 809 include, but are not limited to, an acceleration sensor 810, a gyroscope sensor 811, a pressure sensor 812, an optical sensor 813, and a proximity sensor 814.

[0136] The acceleration sensor 810 can detect the acceleration in three coordinate axes of the coordinate system established by the terminal. For example, the acceleration sensor 810 can be used to detect the components of gravitational acceleration in three coordinate axes. The processor 801 can control the display screen 805 to display the user interface in a landscape view or a portrait view according to the gravitational acceleration signal collected by the acceleration sensor 810. The acceleration sensor 810 can also be used for game or user motion data collection.

[0137] The gyroscope sensor 811 can detect the body orientation and rotation angle of the terminal. The gyroscope sensor 811 can cooperate with the acceleration sensor 810 to collect 3D actions of the user on the terminal. The processor 801 can realize the following functions according to the data collected by the gyroscope sensor 811: motion sensing (such as changing the UI according to the user's tilt operation), image stabilization when shooting, game control, and inertial navigation.

[0138] The pressure sensor 812 can be disposed at the side frame of the terminal and / or under the display screen 805. When the pressure sensor 812 is disposed at the side frame of the terminal, the holding signal of the user to the terminal can be detected, and the left-hand or right-hand recognition or the shortcut operation can be performed by the processor 801 according to the holding signal collected by the pressure sensor 812. When the pressure sensor 812 is disposed under the display screen 805, the operability control on the UI interface can be controlled by the processor 801 according to the pressure operation of the user to the display screen 805. The operability control includes at least one of the button control, the scroll bar control, the icon control, and the menu control.

[0139] The optical sensor 813 is used to collect the ambient light intensity. In an embodiment, the processor 801 can control the display brightness of the display screen 805 according to the ambient light intensity collected by the optical sensor 813. Specifically, when the ambient light intensity is high, the display brightness of the display screen 805 is increased; when the ambient light intensity is low, the display brightness of the display screen 805 is decreased. In another embodiment, the processor 801 can also dynamically adjust the shooting parameter of the camera assembly 806 according to the ambient light intensity collected by the optical sensor 813.

[0140] The proximity sensor 814, also referred to as the distance sensor, is usually disposed at the front panel of the terminal. The proximity sensor 814 is used to collect the distance between the user and the front of the terminal. In an embodiment, when the proximity sensor 814 detects that the distance between the user and the front of the terminal gradually decreases, the display screen 805 is switched from the bright screen state to the screen-off state by the processor 801; when the proximity sensor 814 detects that the distance between the user and the front of the terminal gradually increases, the display screen 805 is switched from the screen-off state to the bright screen state by the processor 801.

[0141] Those skilled in the art can understand that the structure shown in FIG. 8 does not constitute a limitation on the computer device, and can include more or fewer components than those shown, or combine certain components, or adopt a different component arrangement.

[0142] Alternatively, the structural schematic diagram of the terminal device can also be as shown in FIG. 9. In the structural schematic diagram of the terminal device shown in FIG. 9, the terminal device can be, for example, a smart phone, a tablet computer, a vehicle-mounted terminal, a notebook computer, or a desktop computer. The terminal device can also be referred to as a user equipment, a portable terminal, a laptop terminal, a desktop terminal, or other names. As shown in FIG. 9, the terminal device includes a processor 110.

[0143] The processor 110 is connected with an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a power management module 141, a mobile communication module 150, a wireless communication module 160, an audio module 170, a sensor module 180, a key 190, a motor 191, an indicator 192, cameras 1-N 193, display screens 1-N 194 and SIM card interfaces 1-N 195 respectively. Wherein, N is a positive integer.

[0144] The charging is input to the USB interface 130, and the USB interface 130 is also connected with the charging management module 140, the battery 142 and the power management module 141. The mobile communication module 150 includes mobile communication networks of various generations (2G / 3G / 4G / 5G), and the wireless communication module 160 includes various wireless communication protocols, such as bluetooth (BT), wireless local area networks (WLAN), global navigation satellite system (GNSS), NFC, Infrared Radiation (IR) or frequency modulation (FM) and the like. The mobile communication module 150 communicates through an antenna 1, and the wireless communication module 160 communicates through an antenna 2.

[0145] The audio module 170 is connected with a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D respectively. The sensor module 180 includes but is not limited to a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L and a bone conduction sensor 180M. The modules shown in FIG. 9 can refer to the introduction of the related content shown in FIG. 8, which will not be repeated here.

[0146] The terminal device shown in FIG. 8 or FIG. 9. The number of processors 801 in FIG. 8 can be multiple, and the connection mode of any processor 801 can refer to the connection mode shown in FIG. 8. Two processors 801 in the multiple processors 801 can correspond to the processor A and the processor B shown in FIG. 2 respectively. Wherein, the peripheral device interface 803 can also be connected with a Bluetooth chip, that is, corresponding to the Bluetooth chip shown in FIG. 2. The number of processors 110 in FIG. 9 can be multiple, and the connection mode of any processor 110 can refer to the connection mode shown in FIG. 9. Two processors 110 in the multiple processors 110 can correspond to the processor A and the processor B shown in FIG. 2 respectively. Wherein, in the case that the wireless communication module 150 includes BT, the wireless communication module 150 corresponds to the Bluetooth chip shown in FIG. 2.

[0147] FIG. 10 is a schematic diagram of a terminal system architecture provided by an embodiment of the present application. As shown in FIG. 10, the terminal system architecture includes an application program layer, an application program framework layer, a system library and a kernel library. The application program layer includes but is not limited to camera, calendar, music, map, WLAN, gallery, Bluetooth, video, call, live broadcast, short message, etc. The application program framework layer includes but is not limited to window manager, content provider, phone manager, notification manager, resource manager, view system, etc. The system library includes but is not limited to surface manager, three-dimensional graphics processing library, two-dimensional graphics engine, media library, etc. and various libraries and system running environment. The kernel library includes but is not limited to display driver, camera driver, audio driver, sensor driver, etc.

[0148] For the terminal system architecture shown in FIG. 10, the Bluetooth application shown in FIG. 2 can correspond to the application program layer shown in FIG. 10, that is, the Bluetooth in the application program layer shown in FIG. 10; the Bluetooth protocol stack shown in FIG. 2 can correspond to the system library shown in FIG. 10, and the system library shown in FIG. 10 further includes the Bluetooth protocol stack; the Bluetooth interface driver shown in FIG. 2 can correspond to the kernel layer shown in FIG. 10, and the kernel layer shown in FIG. 10 further includes the Bluetooth interface driver.

[0149] It is to be understood that the above-described processor can be a CPU, and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic components, discrete hardware components, and the like. The general-purpose processor can be a microprocessor or any conventional processor, and the like. It is to be noted that the processor can be an advanced RISC machines (ARM) architecture processor.

[0150] Further, in an optional embodiment, the above-described memory can include a read-only memory and a random access memory, and provide instructions and data to the processor. The memory can also include a non-volatile random access memory. For example, the memory can also store device type information.

[0151] The memory can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically EPROM (EEPROM) or a flash memory. The volatile memory can be a random access memory (RAM) used as an external cache. By way of example but not limitation, many forms of RAM are available. For example, static random access memory (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchlink DRAM (SLDRAM) and direct rambus RAM (DR RAM).

[0152] The embodiment of the present application further provides a computer readable storage medium, at least one instruction is stored in the storage medium, the instruction is loaded and executed by a processor, so that the computer implements the cooperative processing method of the multi-Bluetooth host as any one of the above.

[0153] The embodiment of the present application further provides a computer program (product), when the computer program is executed by a computer, can make the processor or the computer execute the corresponding steps and / or processes in the above method embodiment.

[0154] The embodiment of the present application further provides a chip, comprising a processor, for calling and running instructions stored in a memory, so that the communication device installed with the chip executes the cooperative processing method of the multi-Bluetooth host as any one of the above.

[0155] The embodiment of the present application further provides another chip, comprising: an input interface, an output interface, a processor and a memory, the input interface, the output interface, the processor and the memory are connected through internal connection paths, the processor is used to execute the code in the memory, when the code is executed, the processor is used to execute the cooperative processing method of the multi-Bluetooth host as any one of the above.

[0156] In the above embodiment, all or part of it can be realized by software, hardware, firmware or any combination thereof. When using software to realize, it can be realized in the form of computer program product in whole or in part. The computer program product includes one or more computer instructions. When loading and executing the computer program instructions on the computer, the flow or function according to the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions can be stored in a computer readable storage medium or transferred from one computer readable storage medium to another, for example, the computer instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line) or wireless (such as infrared, wireless, microwave, etc.) mode. The computer readable storage medium can be any available medium that can be accessed by the computer or the data storage device such as server, data center, etc. integrated with one or more available media. The available medium can be magnetic medium (for example, floppy disk, hard disk, magnetic tape), optical medium (for example, DVD) or semiconductor medium (for example, solid state disk) and the like.

[0157] Those skilled in the art can appreciate that, in combination with the method steps and modules described in the embodiments disclosed herein, all or part of the steps can be implemented by software, hardware, firmware or any combination thereof. In order to clearly illustrate the interchangeability of hardware and software, the steps and components of the embodiments have been described in the above description in general terms. Whether the functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0158] Those skilled in the art can understand that all or part of the steps of the above-mentioned embodiments can be completed by hardware, or by programs instructing related hardware, which can be stored in a computer-readable storage medium. The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.

[0159] When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer program instructions. As an example, the method of the embodiments of the present application can be described in the context of machine-executable instructions, such as program modules that are executed by devices included in the target real or virtual processor. Generally, program modules include routines, programs, libraries, objects, classes, components, data structures, etc., which perform specific tasks or implement specific abstract data structures. In various embodiments, the functions of the program modules can be combined or divided among the described program modules. Machine-executable instructions for program modules can be executed within a local or distributed device. In a distributed device, program modules can be located in both local and remote storage media.

[0160] The computer program code for implementing the method of the embodiments of the present application can be written in one or more programming languages. These computer program codes can be provided to the processor of a general-purpose computer, a special-purpose computer or other programmable data processing apparatus, so that when the computer program codes are executed by the computer or other programmable data processing apparatus, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The program codes can be executed entirely on the computer, partially on the computer, as a separate software package, partially on the computer and partially on a remote computer, or entirely on a remote computer or server.

[0161] In the context of the embodiments of the present application, computer program codes or related data can be carried by any appropriate carrier to enable the device, apparatus or processor to perform the various processes and operations described above. Examples of the carrier include a signal, a computer readable medium, etc.

[0162] Examples of a signal can include electrical, optical, radio frequency, sound, or other forms of propagated signals, such as carrier waves, infrared signals, etc.

[0163] A machine-readable medium can be any tangible medium that contains or stores the program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include but not limited to an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of the machine-readable storage medium include an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), and a digital versatile disc (DVD), or any suitable combination of the foregoing.

[0164] It should be clearly understood that, for the sake of brevity and clarity, detailed working processes of the system, device and module described above can refer to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0165] In several embodiments provided in the present application, it should be understood that the disclosed system, device and method can be implemented in other manners. For example, the described device embodiments are merely schematic, and the division of the modules is merely a logical function division, and there can be another division manner in actual implementation, for example, a plurality of modules or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed coupling or direct coupling or communication connection between the modules can be indirect coupling or communication connection through some interfaces, devices or modules, and can also be electrical, mechanical or other forms of connection.

[0166] The modules illustrated as separate components can or can not be physically separate, and the components illustrated as modules can or can not be physical modules, i.e., can be located in one place, or can be distributed to a plurality of network modules. Part or all of the modules can be selected according to actual needs to achieve the purpose of the embodiments of the present application.

[0167] In addition, each functional module in each embodiment of the present application can be integrated into a processing module, or each module can exist physically, or two or more modules can be integrated into one module. The above integrated module can be realized in the form of hardware or in the form of a software functional module.

[0168] The integrated module, if implemented in the form of a software function module and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the part that contributes to the prior art, or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.

[0169] The terms "first", "second", and the like in the present application are used to distinguish between items or similar items having substantially the same function and action. It should be understood that there is no logical or chronological dependency between "first", "second", and "nth", and the number and execution order are not limited. It should also be understood that although the following description uses the terms first, second, and the like to describe various elements, these elements should not be limited by the terms. These terms are only used to distinguish one element from another. For example, without departing from the scope of various examples, a first image can be referred to as a second image, and similarly, a second image can be referred to as a first image. The first image and the second image can both be images, and in some cases, can be separate and distinct images.

[0170] It should also be understood that in various embodiments of the present application, the size of the serial number of each process does not mean the order of execution, and the execution order of each process should be determined by its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0171] The term "at least one" in the present application means one or more, and the term "a plurality of" in the present application means two or more, for example, a plurality of second messages means two or more second messages. The terms "system" and "network" are often used interchangeably in this document.

[0172] It should be understood that the terms used in the description of various described examples herein are only for the purpose of describing specific examples and are not intended to be limiting. As used in the description of various described examples and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.

[0173] It should also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items. The term "and / or", is a descriptive term that refers to an associating relationship for associated objects, and means that there can be three kinds of relationships, for example, A and / or B, can mean that A exists alone, A and B exist together, B exists alone. In addition, the character " / " in the present application generally represents an "or" relationship between the front and rear associated objects.

[0174] It should also be understood that the terms "comprises", "comprising", "includes", "including" and / or "comprising", when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.

[0175] It should also be understood that the terms "if' and "when" can be construed to mean "upon" or "in response to determining" or "in response to detecting", as appropriate. Similarly, the phrase "if it is determined" or "if [a stated condition or event] is detected" can be construed to mean "upon determining" or "in response to determining" or "upon detecting [the stated condition or event]" or "in response to detecting [the stated condition or event]", depending on the context.

[0176] It should be understood that a determination of B according to A does not mean that B is determined only according to A, but B can also be determined according to A and / or other information.

[0177] It should also be understood that the phrase "one embodiment", "an embodiment", "one possible implementation", "possible implementation", and the like, as used throughout the specification, means that a particular feature, structure, or characteristic described in connection with the embodiment or implementation is included in at least one embodiment of the application. Thus, the appearances of the phrase "in one embodiment" or "in an embodiment" or "one possible implementation" or "possible implementation" at various places throughout the specification are not necessarily referring to the same embodiment or implementation. Furthermore, the particular features, structures, or characteristics can be combined in any suitable manner in one or more embodiments.

[0178] The above description is merely optional embodiments of the present application, and is not used to limit the present application, and any modification, equivalent replacement, improvement, etc. made within the principles of the present application, should be included in the protection scope of the present application.

Claims

1. A collaborative processing method for multiple Bluetooth hosts, characterized in that, The method includes: Before the first Bluetooth host executes the first operation instruction, the first operation information of the second Bluetooth host is obtained. The second Bluetooth host and the first Bluetooth host are connected to the same Bluetooth controller. The first operation information indicates the operation status of the second Bluetooth host. If there is no conflict between the operating state of the second Bluetooth host and the first operation command, it interacts with the Bluetooth controller to execute the first operation command.

2. The method according to claim 1, characterized in that, The first operation information for obtaining the second Bluetooth host includes: Send a first query command to the second Bluetooth host, wherein the first query command is used by the second Bluetooth host to send the first operation information of the second Bluetooth host to the first Bluetooth host; Receive the first operation information sent by the second Bluetooth host.

3. The method according to claim 1 or 2, characterized in that, After executing the first operation instruction, the method further includes: Upon completion of the first operation instruction, a second operation message is sent to the second Bluetooth host, the second operation message instructing the first Bluetooth host to complete the first operation instruction.

4. The method according to claim 1, characterized in that, The first Bluetooth host records coordination information, which indicates the first operation information of the second Bluetooth host.

5. The method according to claim 4, characterized in that, Before obtaining the first operation information of the second Bluetooth host, the method further includes: Receive a second query instruction, which is sent before the second Bluetooth host executes the second operation instruction; Send a third operation message to the second Bluetooth host, the third operation message indicating that there is no conflict between the operation status of the first Bluetooth host and the second operation command; The fourth operation information is recorded in the first Bluetooth host as the collaboration information, and the fourth operation information indicates that the second Bluetooth host is executing the second operation instruction.

6. The method according to claim 4 or 5, characterized in that, Before obtaining the first operation information of the second Bluetooth host, the method further includes: Receive fifth operation information, which is sent after the second operation instruction has been completed, and the fifth operation information instructs the second Bluetooth host to complete the second operation instruction; The fifth operation information is recorded as the collaboration information in the first Bluetooth host.

7. The method according to any one of claims 1-6, characterized in that, The fact that the operation state of the second Bluetooth host does not conflict with the first operation instruction includes: the second Bluetooth host does not execute an operation instruction of the same type as the first operation instruction, or the second Bluetooth host does not execute any operation instruction.

8. The method according to any one of claims 1-7, characterized in that, The first operation instruction is used to update the scanning parameters of the Bluetooth controller, and the first operation information includes the first scanning parameters of the second Bluetooth host; the interaction with the Bluetooth controller includes: If the second scan parameter of the first Bluetooth host is greater than or equal to the scan range indicated by the first scan parameter, the second scan parameter is sent to the Bluetooth controller, and the second scan parameter is used by the Bluetooth controller to update the scan parameter to the second scan parameter; or... If the second scan parameter is less than the scan range indicated by the first scan parameter, the first scan parameter is sent to the Bluetooth controller, and the first scan parameter is used by the Bluetooth controller to update the scan parameter to the first scan parameter.

9. The method according to any one of claims 1-7, characterized in that, The first operation instruction is used to establish a Bluetooth connection. The first operation information includes a first number of Bluetooth connections established by the second Bluetooth host. The first number is used to control a second number of Bluetooth connections established by the first Bluetooth host. The sum of the second number and the first number is less than or equal to a reference number of Bluetooth connections established by the Bluetooth controller.

10. The method according to any one of claims 1-9, characterized in that, The first operation information for obtaining the second Bluetooth host includes: When the second Bluetooth host is in the exit sleep state, obtain the operation information of the second Bluetooth host.

11. A collaborative processing device for multiple Bluetooth hosts, characterized in that, The device includes: The acquisition module is used to acquire first operation information of the second Bluetooth host before the first Bluetooth host executes the first operation instruction. The second Bluetooth host and the first Bluetooth host are connected to the same Bluetooth controller. The first operation information indicates the operation status of the second Bluetooth host. The execution module is used to interact with the Bluetooth controller to execute the first operation instruction when there is no conflict between the operation state of the second Bluetooth host and the first operation instruction.

12. A terminal device, characterized in that, The terminal device includes a processor coupled to a memory, the memory storing at least one program instruction or code, the at least one program instruction or code being loaded and executed by the processor to enable the terminal device to implement the multi-Bluetooth host collaborative processing method as described in any one of claims 1-10.

13. A computer-readable storage medium, characterized in that, The computer storage medium stores at least one instruction, which is loaded and executed by a processor to enable the computer to implement the multi-Bluetooth host collaborative processing method as described in any one of claims 1-10.

14. A computer program product, characterized in that, The computer program product includes: computer program code, which is loaded and executed by a computer to enable the computer to implement the multi-Bluetooth host collaborative processing method as described in any one of claims 1-10.

Citation Information

Patent Citations

  • Communication method of multiple Bluetooth devices and host machine

    CN105472773A

  • Method for controlling electronic equipment and electronic equipment

    CN111083684A

  • Bluetooth connection method and system, storage medium and equipment

    CN116193413A

  • Connection method of Bluetooth device and terminal device

    CN117858052A

  • Audio service recovery processing method, electronic equipment and computer storage medium

    CN117956371A