Bluetooth connection method, electronic device, and computer program product

By sharing the Bluetooth control layer in dual-operating system electronic devices, the problem of Bluetooth connection interruption during operating system switching is solved, enabling seamless data transmission and improving the user experience.

WO2026091565A1PCT designated stage Publication Date: 2026-05-07BESTECHNIC SHANGHAI CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
BESTECHNIC SHANGHAI CO LTD
Filing Date
2025-06-20
Publication Date
2026-05-07

AI Technical Summary

Technical Problem

In dual-system electronic devices, Bluetooth connections are easily interrupted when switching operating systems, affecting data transmission and leading to a decline in user experience.

Method used

By sharing the Bluetooth control layer in both operating systems, the second operating system can maintain a constant communication connection with the Bluetooth control layer during system switching, thus avoiding communication interruption.

Benefits of technology

It enables seamless data transmission during operating system switching, avoiding complete interruption of Bluetooth services and ensuring normal operation of remote devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025102343_07052026_PF_FP_ABST
    Figure CN2025102343_07052026_PF_FP_ABST
Patent Text Reader

Abstract

The present application provides a Bluetooth connection method. A first operating system and a second operating system share a Bluetooth control layer. In a process in which an electronic device switches from running the second operating system to running the first operating system, or from running the first operating system to running the second operating system, in response to a system switching instruction, the second operating system remains in a communication connection state with the Bluetooth control layer, thereby preventing a case in which a Bluetooth service is completely interrupted during system switching.
Need to check novelty before this filing date? Find Prior Art

Description

Bluetooth connection method, electronic device and computer program product

[0001] The present application claims priority to the Chinese patent application No. 202411521998.X filed on October 29, 2024, and entitled "Bluetooth connection method, electronic device and computer program product", the whole content of which is incorporated herein by reference. TECHNICAL FIELD

[0002] The present application relates to the field of Bluetooth communication technology, in particular to a Bluetooth connection method, an electronic device and a computer program product. BACKGROUND

[0003] In the conventional technology, when the electronic device with dual systems communicates with the remote device through Bluetooth, the Bluetooth connection may be completely interrupted due to the switching of the two operating systems. In the conventional method, the Bluetooth connection is completely separated in the dual systems and independently runs. That is, when the Bluetooth connection is implemented on the first operating system, the processor (CPU) running the first operating system directly communicates with the Bluetooth chip. Correspondingly, when the Bluetooth connection is implemented on the second operating system, the processor (CPU) running the second operating system also directly communicates with the Bluetooth chip. Since there is only one Bluetooth chip at the bottom layer, when the operating system is switched, the Bluetooth connection of the operating system running needs to be closed first, and then the Bluetooth connection of the other operating system needs to be initialized and established. However, in the gap process of closing the Bluetooth connection of the operating system and initializing and establishing the Bluetooth connection of the other operating system, the Bluetooth connection is completely interrupted, which affects the data transmission. Therefore, how to switch the operating system without affecting the use of the remote device is a technical problem to be solved at present. SUMMARY

[0004] The present application is proposed in view of at least one technical problem in the prior art. According to an aspect of the present application, a Bluetooth connection method is provided, which is applied to an electronic device with dual operating systems. The electronic device includes a first processor and a second processor. The first processor is used to run a first operating system, and the second processor is used to run a second operating system. The first processor is in communication connection with the second processor, and the second processor is in communication connection with a Bluetooth control layer. The method includes:

[0005] In response to a first Bluetooth connection instruction, controlling the second operating system to establish a Bluetooth connection with a remote device through the Bluetooth control layer;

[0006] obtaining a first system switching instruction, and establishing a first communication connection between the first operating system and the second operating system according to the first system switching instruction, so as to transmit data packets between the first operating system and the Bluetooth control layer through the second operating system;

[0007] obtaining a second system switching instruction, and establishing a second communication connection inside the second operating system according to the second system switching instruction, so as to transmit data packets between the application layer of the second operating system and the Bluetooth control layer through the second operating system;

[0008] The power consumption of the second processor is lower than that of the second processor.

[0009] The Bluetooth connection method provided in the embodiments of the present application can share the Bluetooth control layer by the first operating system and the second operating system. In the process of switching from running the second operating system to running the first operating system or in the process of switching from running the first operating system to running the second operating system in response to the system switching instruction, the second operating system is always in a communication connection state with the Bluetooth control layer, and communication interruption does not occur. Therefore, the complete interruption of Bluetooth service during system switching is avoided, and the second operating system and the remote device can maintain data transmission. The remote device can perform data transmission with the second operating system without sensing the switching of the operating system, and the normal use of the remote device is not affected.

[0010] In another aspect, the embodiments of the present application provide an electronic device. The electronic device comprises a first processor and a second processor. The first processor is configured to run a first operating system. The second processor is configured to run a second operating system. The first processor is in communication connection with the second processor. The second processor is in communication connection with a Bluetooth control layer.

[0011] The electronic device further comprises a memory. The memory stores a computer program. When the computer program is executed by the at least two processors, the at least two processors perform the steps of the Bluetooth connection method as described above.

[0012] The Bluetooth connection method provided in the embodiments of the present application can share the Bluetooth control layer by the first operating system and the second operating system. In the process of switching from running the second operating system to running the first operating system or in the process of switching from running the first operating system to running the second operating system in response to the system switching instruction, the second operating system is always in a communication connection state with the Bluetooth control layer, and communication interruption does not occur. Therefore, the complete interruption of Bluetooth service during system switching is avoided, and the second operating system and the remote device can maintain data transmission. The remote device can perform data transmission with the second operating system without sensing the switching of the operating system, and the normal use of the remote device is not affected.

[0013] In another aspect, the embodiments of the present application provide a computer program product. The computer program product comprises a computer program. When the computer program is executed by a processor, the steps of the Bluetooth connection method as described above are implemented.

[0014] In the Bluetooth connection method of this application embodiment, when the first operating system and the second operating system switch instructions, the second operating system is kept in a communication connection with the Bluetooth control layer. The second operating system and the remote device can maintain data transmission, thereby avoiding the complete interruption of Bluetooth services during system switching.

[0015] The Bluetooth connection method in this application embodiment uses a shared Bluetooth control layer between the first operating system and the second operating system. During the process of the electronic device switching from running the second operating system to running the first operating system in response to a system switching command, or from running the first operating system to running the second operating system, the second operating system is always in a communication connection with the Bluetooth control layer, and there will be no communication interruption. This avoids the complete interruption of Bluetooth services during system switching. The second operating system and the remote device can maintain data transmission. When the remote device is transmitting data with the second operating system, the switching of operating systems is seamless and will not affect the normal use of the remote device. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0017] Figure 1 shows a schematic diagram of the architecture of a Bluetooth module according to an embodiment of this application;

[0018] Figure 2 shows a schematic flowchart of a Bluetooth connection method according to an embodiment of this application;

[0019] Figure 3 shows a schematic flowchart of step S201 according to an embodiment of this application;

[0020] Figure 4 shows a schematic flowchart of step S202 according to an embodiment of this application;

[0021] Figure 5 shows a schematic flowchart of step S202 according to another embodiment of this application;

[0022] Figure 6 illustrates a schematic diagram of an electronic device establishing a Bluetooth connection with a remote device while running a first operating system, according to an embodiment of this application.

[0023] Figure 7 shows a schematic flowchart of step S202 according to another embodiment of the present application;

[0024] Figure 8 shows a schematic flowchart of step S202 according to another embodiment of this application;

[0025] Figure 9 shows a schematic diagram of an electronic device establishing a Bluetooth connection with a remote device when running a first operating system according to another embodiment of the present application;

[0026] Figure 10 shows a schematic flow chart of step S203 according to an embodiment of the present application;

[0027] Figure 11 shows a schematic flow chart of step S203 according to another embodiment of the present application;

[0028] Figure 12 shows a schematic diagram of layers resuming connection when switching operating systems according to an embodiment of the present application;

[0029] Figure 13 shows a schematic block diagram of a Bluetooth connection method according to an embodiment of the present application;

[0030] Figure 14 shows a schematic block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0031] For a better understanding of the technical solutions of the embodiments of the present application, the technical solutions of the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present application.

[0032] Figure 1 is a schematic diagram of the architecture of a Bluetooth module according to an embodiment of the present application. As shown in Figure 1, the Bluetooth module includes a Bluetooth application layer (BT App), a Bluetooth protocol stack interface layer (BTIF) and a Bluetooth protocol stack (Bluedroid). In the Bluetooth application layer (BT App), an application framework (Application Framework) is included, and the application framework includes various applications (Apps) and an Android Bluetooth (android.bluetooth). In the Bluetooth protocol stack interface layer (BTIF), a Bluetooth protocol stack process (Bluetooth Stack Process) and a Java native interface (JNI) are included, and the Bluetooth protocol stack process includes a Bluetooth adapter service (Bluetooth Adapter Service), Bluetooth profile services (Bluetooth Profile Services) and Bluetooth profiles (Bluetooth Profiles).

[0033] Continuing with FIG. 1, at the Bluetooth protocol stack (Bluedroid), including Bluetooth Native Stack, Hardware Abstraction Layer Interface Definition Language Interfaces (HIDL Interfaces), and Vendor Implementation, where the Bluetooth protocol stack (Bluedroid) includes Bluetooth Profiles and Bluetooth HAL Clients; the Vendor Implementation includes a Bluetooth controller. The Bluetooth Native Stack is communicatively connected to the HIDL Interfaces via HAL Interface definition language (HIDL), and the HIDL Interfaces are communicatively connected to the Vendor Implementation.

[0034] With the development of technology, Bluetooth technology is widely used. However, when Bluetooth technology is applied in mobile intelligent devices such as watches and mobile phones, it often causes large power consumption due to the large system of the whole machine. In the industry, a double Bluetooth system (host) is often installed on electronic devices to solve this problem. This solution mainly includes the following steps / modules: two sets of Bluetooth systems (hosts) (also referred to as Bluetooth modules in this paper). For example, one set of Android system is installed, and another set of real-time operating system (RTOS) is installed, which respectively run on the first processor (large core) and the second processor (small core) in the system on chip (SoC), and are switched through business, such as when the application layer needs to listen to songs and other audio and video businesses, the Android of the first processor (large core) is switched to run the first processor (large core) Bluetooth system (host), and the performance of the system is fully utilized to obtain better experience. When the application business is only to maintain connection and transmit lightweight business, such as text message chat, short message notification display, etc., the operating system is switched to the real-time operating system (RTOS) of the second processor (small core) to run the second processor (small core) Bluetooth (host), and the low-power operation is performed. However, there are still some problems in the switching of the double Bluetooth system (host), that is, during the switching of the Bluetooth system, the Bluetooth system and the connected remote device may be interrupted, causing data transmission to be interrupted, thereby reducing the user experience.

[0035] Therefore, based on at least one of the foregoing technical problems, the present application provides a Bluetooth connection method applied to an electronic device with dual operating systems, the electronic device comprising a first processor configured to run a first operating system and a second processor configured to run a second operating system, the first processor being in communication connection with the second processor, and the second processor being in communication connection with a Bluetooth control layer; the method comprising: in response to a first Bluetooth connection instruction, controlling the second operating system to establish a Bluetooth connection with a remote device through the Bluetooth control layer; obtaining a first system switching instruction, and establishing a first communication connection between the first operating system and the second operating system according to the first system switching instruction, so as to transmit and receive data packets between the first operating system and the Bluetooth control layer through the second operating system; obtaining a second system switching instruction, and establishing a second communication connection within the second operating system according to the second system switching instruction, so as to transmit and receive data packets between an application layer of the second operating system and the Bluetooth control layer through the second operating system; wherein the power consumption of the second processor is lower than that of the second processor. The Bluetooth connection method of the present application embodiment, by sharing the Bluetooth control layer by the first operating system and the second operating system, in the process of switching from running the second operating system to running the first operating system, or in the process of switching from running the first operating system to running the second operating system, the second operating system is always in communication connection with the Bluetooth control layer, and there is no communication interruption, thereby avoiding the complete interruption of Bluetooth services when switching systems, the second operating system and the remote device can maintain data transmission, and the remote device is unaware of the switching of the operating system when performing data transmission with the second operating system, and the normal use of the remote device is not affected.

[0036] The Bluetooth connection method of the present application embodiment is applied to an electronic device with dual operating systems, the electronic device comprising a first processor configured to run a first operating system and a second processor configured to run a second operating system, the first processor being in communication connection with the second processor, and the second processor being in communication connection with a Bluetooth control layer (BT controller).

[0037] Here, the electronic device can be any terminal device such as a mobile phone, a tablet computer, a PDA (Personal Digital Assistant), a wearable device (smart watch, etc.), a smart home, etc.

[0038] The electronic device in the embodiments of the present application includes at least two processors. The embodiments of the present application do not limit the number, name and type of the processors. For example, the processors can include, but are not limited to, the following processing units: an application processor (AP), a microcontroller unit (MCU), a graphics processing unit (GPU), an image signal processor (ISP), a digital signal processor (DSP), or a neural-network processing unit (NPU), etc. Different processors can be independent devices or can be integrated into one or more processors.

[0039] In an embodiment of the present application, the first operating system includes an Android system, and the second operating system includes a real-time operating system (RTOS).

[0040] The Android system in the embodiments of the present application runs on the first processor (large core), and the real-time operating system runs on the second processor (small core). In the embodiments of the present application, the real-time operating system (RTOS) can be a ThreadX system, which is suitable for embedded applications, has the characteristics of small size, strong real-time performance, high reliability, easy to use, etc., and supports a large number of processors and system-on-chip (SoC), including embedded processors (ARM), reduced instruction set architecture central processing units (PowerPC), etc. For some lightweight applications, the second processor can be used to run the applications to save power consumption.

[0041] FIG. 2 shows a schematic flowchart of a Bluetooth connection method according to an embodiment of the present application. As shown in FIG. 2, the Bluetooth connection method 200 according to the embodiment of the present application can include the following steps S201, S202 and S203:

[0042] Step S201: In response to a first Bluetooth connection instruction, the second operating system is controlled to establish a Bluetooth connection with a remote device through the Bluetooth control layer.

[0043] In combination with FIG. 6 and FIG. 9, when the electronic device establishes a Bluetooth connection with the remote device, the second Bluetooth module (Host2) in the second operating system keeps connection with the Bluetooth control layer (BT controller) through the second connection layer (HCI). When the electronic device establishes a Bluetooth connection with the remote device, the Bluetooth control layer (BT controller) establishes connection with the remote device, so as to achieve the purpose of establishing a Bluetooth connection between the second operating system and the remote device. It is worth noting that at this time, only the second connection layer in the second Bluetooth module establishes a Bluetooth connection with the remote device, and the second connection layer does not necessarily receive or send (hereinafter referred to as transceive) data to the second Bluetooth application layer.

[0044] The host controller interface (HCI) is used to standardize the communication protocol and communication command between the host and the controller.

[0045] In the embodiment of the present application, only one Bluetooth control layer (BT controller) is provided, so that no matter whether the first operating system or the second operating system is currently running, the Bluetooth control layer (BT controller) always maintains Bluetooth connection and data transmission with the remote device, and will not be disconnected.

[0046] As shown in FIG. 3, in response to the first Bluetooth connection instruction, the second operating system is controlled to establish a Bluetooth connection with the remote device through the Bluetooth control layer (BT controller), including step A1:

[0047] In step A1, the second host controller interface (Host Controller Interface, HCI) of the second Bluetooth module (Host2) establishes the Bluetooth connection with the remote device through the Bluetooth control layer (BT controller) to transceive data packets to the remote device.

[0048] In the embodiment of the present application, the first Bluetooth module and the second Bluetooth module can be considered to share the Bluetooth control layer (BT controller). Since the second host controller interface (Host Controller Interface, HCI) in the second Bluetooth module always maintains connection with the Bluetooth control layer (BT controller), and the Bluetooth control layer (BT controller) always maintains Bluetooth connection with the remote device when switching between the first Bluetooth module and the second Bluetooth module, the Bluetooth connection and data transmission will not be interrupted when switching between the first Bluetooth module and the second Bluetooth module.

[0049] In one embodiment of this application, as shown in FIG11, the method further includes step D3:

[0050] In step D3, when switching operating systems, the parameters, status, and fields of each layer of the Bluetooth module being switched are obtained, and the parameters, status, and fields of each layer are migrated to the target Bluetooth module, so that the target Bluetooth module is restored to the same parameters, status, and fields layer by layer.

[0051] In an embodiment of this application, as shown in Figure 12, it is a schematic diagram of the connection restoration at each layer when switching operating systems. When switching operating systems, the context (including parameters, status, and fields of each layer) of the Bluetooth module of the operating system being switched is first extracted and sent to the destination Bluetooth module. The destination Bluetooth module (Host) restores the connection layer by layer according to the context of each layer, and then performs data layer switching.

[0052] For example, when switching operating systems, the operating system being switched to is the first operating system, and the destination operating system is the second operating system; or, the Bluetooth module being switched to is the first Bluetooth module, and the destination Bluetooth module is the second Bluetooth module. During the switch, the context of each layer of the first Bluetooth module in the first operating system (including parameters, status, and fields of each layer) is extracted and sent to each layer of the second Bluetooth module, so that each layer of the second Bluetooth module gradually restores to the same context (including parameters, status, and fields of each layer). In this way, the data received by the second host control interface is sent to the Bluetooth application layer of the second Bluetooth module.

[0053] For example, when switching operating systems, the operating system being switched to is the second operating system, and the destination operating system is the first operating system; or, the Bluetooth module being switched to is the second Bluetooth module, and the destination Bluetooth module is the first Bluetooth module. During the switch, the context (including parameters, states, and fields of each layer) of the second Bluetooth module in the second operating system is extracted and sent to each layer of the first Bluetooth module, so that each layer of the first Bluetooth module restores to the same context (including parameters, states, and fields of each layer). In this way, the data received by the second host control interface is sent to the first host control interface of the first Bluetooth module, and the first host control interface sends the data to the first Bluetooth application layer through the first Bluetooth protocol stack; or, the data received by the second host control interface is sent to the second Bluetooth protocol stack, the second Bluetooth protocol stack sends the data to the Bluetooth protocol stack interface layer, and then sends the data to the first Bluetooth application layer.

[0054] In one example, the condition for triggering the operating system switch could be a physical button external to the electronic device or a virtual button on the electronic device's touchscreen; alternatively, one operating system could be set as the default operating system, and when certain conditions are met, the operating system could be switched, simultaneously triggering a switch of the Bluetooth module. Other trigger conditions could also be set. Those skilled in the art should understand that all examples conforming to the purpose of this invention should be within the scope of protection of this application, and no limitation is made herein.

[0055] During the establishment of the first or second communication connection, the second host control interface maintains a communication connection and data transmission with the Bluetooth control layer.

[0056] Step S202: Obtain a first system switching instruction, and establish a first communication connection between the first operating system and the second operating system according to the first system switching instruction, so as to send and receive data packets between the first operating system and the Bluetooth control layer through the second operating system.

[0057] In one embodiment of this application, as shown in FIG4, step S202, obtaining a first system switching instruction and establishing a first communication connection between the first operating system and the second operating system according to the first system switching instruction, so as to send and receive data packets between the first operating system and the Bluetooth control layer through the second operating system, includes steps B1 and B2:

[0058] In step B1, the first system switching instruction is obtained;

[0059] In step B2, based on the first system switching command, after the second host controller interface (HCI) of the second Bluetooth module (host) sends and receives the data packet, it sends and receives the data packet to the first host controller interface (HCI) of the first Bluetooth module (host), so that the first host controller interface (HCI) sends and receives the data packet to the first Bluetooth application layer (BT APP) through the first Bluetooth protocol stack (bluedroid).

[0060] Generally, an Android Bluetooth system (also referred to herein as a Bluetooth module) may include a host and a BT controller. For ease of understanding, the term "host" is also used herein to refer to the Bluetooth module.

[0061] In one embodiment of this application, as shown in FIG6, it is a schematic diagram of an electronic device establishing a Bluetooth connection with a remote device while running a first operating system. The first Bluetooth module (Host1) of the first operating system includes a first Bluetooth application layer (BT APP), a first Bluetooth protocol stack (bluedroid), and a first host controller interface (HCI). The first host controller interface (HCI) is adapted to interface with the second host controller interface (HCI) of the second Bluetooth module (HOST2) of the second processor (little core) via inter-process communication (IPC). When the first Bluetooth module (Host1) is selected to run or when switching from the second Bluetooth module to the first Bluetooth module, the second host controller interface (HCI) of the second Bluetooth module (Host2) will bypass Bluetooth data to the first host controller interface (HCI) of the first Bluetooth module (Host1), so that the first host controller interface (HCI) can send data to the first Bluetooth application layer (BT APP) through the first Bluetooth protocol stack (bluedroid).

[0062] In one example, as shown in Figure 5, step S202, which establishes the first communication connection between the first operating system and the second operating system, further includes step B3:

[0063] In step B3, the second host control interface sends the parameters, status, and fields of each layer of the second Bluetooth module to the first host control interface, so that the first host control interface sends the parameters, status, and fields of each layer to the first Bluetooth protocol stack.

[0064] The first Bluetooth protocol stack receives a connection request from the first Bluetooth application layer to establish the first communication connection, and sends a response to the first Bluetooth application layer indicating that the connection has been successfully established.

[0065] In one embodiment of this application, the power consumption of the first processor is greater than that of the second processor. Since the second Host Controller Interface (HCI) is connected to the Bluetooth controller (BT controller) instead of the first Host Controller Interface (HCI), and the second Host Controller Interface (HCI) is located on the second processor, maintaining the connection between the second Host Controller Interface (HCI) and the Bluetooth controller is more power-efficient than maintaining the connection between the first Host Controller Interface (HCI) and the Bluetooth controller.

[0066] In another embodiment of this application, as shown in FIG7, step S202, obtaining a first system switching instruction and establishing a first communication connection between the first operating system and the second operating system according to the first system switching instruction, so as to send and receive data packets between the first operating system and the Bluetooth control layer through the second operating system, includes steps C1 and C2:

[0067] In step C1, the first system switching instruction is obtained;

[0068] In step C2, based on the first system switching instruction, after the second host control interface sends and receives the data packet, it sends and receives the data packet to the second Bluetooth protocol stack, so that the second Bluetooth protocol stack bypasses the data packet to the first Bluetooth protocol stack, and the first Bluetooth protocol stack sends and receives the data packet to the first Bluetooth application layer.

[0069] In one example, as shown in Figure 8, step S202, which establishes the first communication connection between the first operating system and the second operating system, further includes step C3:

[0070] In step C3, the second host control interface (HCI) sends the parameters, status, and fields of each layer of the second Bluetooth module to the second Bluetooth protocol stack, so that the second Bluetooth protocol stack sends the parameters, status, and fields of each layer to the first Bluetooth protocol stack.

[0071] The first Bluetooth protocol stack receives a connection request from the first Bluetooth application layer to establish the first communication connection, and sends a response to the first Bluetooth application layer indicating that the connection has been successfully established.

[0072] Figure 9 illustrates an electronic device establishing a Bluetooth connection with a remote device under the operation of a first operating system, according to another embodiment of this application. The first Bluetooth module (HOST1) of the first operating system includes a first Bluetooth application layer (i.e., Android BT APP) and a Bluetooth protocol stack interface layer (BTIF). The Bluetooth protocol stack interface layer (BTIF) is adapted to interface with the Bluetooth protocol stack (STACK) layer of the second Bluetooth module (HOST2) of the second processor (little core) via inter-process communication (IPC). When the first Bluetooth module (HOST1) is selected to run, or when switching from the second Bluetooth module to the first Bluetooth module, the Bluetooth protocol stack (STACK) layer of the second Bluetooth module (HOST2) bypasses Bluetooth data to the Bluetooth protocol stack interface layer (BTIF) of the first Bluetooth module (HOST1), so that the Bluetooth protocol stack interface layer (BTIF) can send data to the first Bluetooth application layer.

[0073] Step S203: Obtain the second system switching instruction, and establish a second communication connection within the second operating system according to the second system switching instruction, so as to send and receive data packets between the application layer of the second operating system and the Bluetooth control layer through the second operating system.

[0074] The power consumption of the second processor is lower than that of the second processor.

[0075] In one embodiment of this application, as shown in FIG10, step S203, obtaining the second system switching instruction and establishing a second communication connection within the second operating system according to the second system switching instruction, to send and receive data packets between the application layer of the second operating system and the Bluetooth control layer, includes steps D1 and D2:

[0076] In step D1, the second system switching instruction is obtained;

[0077] In step D2, based on the second system switching instruction, the second host control interface bypasses the data packet to the second Bluetooth application layer via the second Bluetooth protocol stack.

[0078] Referring to Figures 6 and 9, when running the second operating system or switching from the first operating system to the second operating system, the second host controller interface (HCI) of the second Bluetooth module (HOST2) interfaces data to the local upper-layer second Bluetooth protocol stack (BT STACK), which then sends the data to the second Bluetooth application layer (BT APP). The same principle applies when electronic devices send data to remote devices via Bluetooth connection, and will not be elaborated further here.

[0079] In this embodiment, when the first communication connection or the second communication connection is established, or when the first operating system and the second operating system are switched, the second host control interface maintains a communication connection and data transmission with the Bluetooth control layer, and the Bluetooth control layer also maintains a Bluetooth connection and data transmission with the remote device. In this way, even if the operating system is switching, the data transmission is not interrupted. The second host control interface and the remote device continue to transmit data. When the remote device transmits data with the second host control interface, it is unaware of the operating system switching and it will not affect the normal use of the remote device.

[0080] In one embodiment of this application, the method further includes steps E1 and E2:

[0081] In step E1, after establishing a first communication connection between the first operating system and the second operating system according to the first system switching instruction, the second communication connection is then disconnected; and

[0082] In step E2, after establishing a second communication connection within the second operating system according to the second system switching instruction, the first communication connection is disconnected.

[0083] In fact, when switching from the first operating system to the second operating system, or when switching from the first Bluetooth module to the second Bluetooth module, it is necessary to disconnect the data transmission between the second host controller interface (HCI) and the first Bluetooth module (Host1) while establishing the second communication connection.

[0084] Similarly, when switching from the second operating system to the first operating system, or when switching from the second Bluetooth module to the first Bluetooth module, while establishing the first communication connection, it is necessary to disconnect the data transmission between the second host controller interface (HCI) and the second Bluetooth protocol stack (STACK).

[0085] The establishment of the second communication connection within the second operating system and the disconnection of the first communication connection are synchronous processes; the establishment of the first communication connection between the first operating system and the second operating system and the disconnection of the second communication connection are also synchronous processes.

[0086] In the embodiments of this application, even when switching between operating systems, the establishment of a new communication connection and the disconnection of the old communication connection can be completed synchronously, so that the data transmission process is not interrupted and data transmission is still maintained.

[0087] The Bluetooth connection device 1300 of this application will now be described with reference to FIG13, wherein FIG13 shows a schematic block diagram of the Bluetooth connection device 1300 according to an embodiment of this application.

[0088] The Bluetooth connection device of this application embodiment is applied to an electronic device with a dual operating system. The electronic device includes a first processor and a second processor. The first processor runs a first operating system, and the second processor runs a second operating system. The first processor and the second processor are communicatively connected, and the second processor is communicatively connected to the Bluetooth controller. The device includes a Bluetooth connection module 1301, a first communication connection module 1302, and a second communication connection module 1303.

[0089] Bluetooth connection module 1301 is used to control the second operating system to establish a Bluetooth connection with the remote device through the Bluetooth controller in response to a first Bluetooth connection command.

[0090] The first communication connection module 1302 is used to obtain a first system switching instruction and establish a first communication connection between the first operating system and the second operating system according to the first system switching instruction, so that the second operating system forwards the data packets received and sent through the Bluetooth connection to the first operating system;

[0091] The second communication connection module 1303 is used to obtain the second system switching instruction and establish a second communication connection within the second operating system according to the second system switching instruction, so that the second operating system forwards the data packets received and sent through the Bluetooth connection to the application layer;

[0092] The power consumption of the second processor is lower than that of the second processor.

[0093] The electronic device of this application will now be described with reference to FIG14, which shows a schematic block diagram of an electronic device according to an embodiment of this application.

[0094] As shown in Figure 14, the electronic device 1400 includes: one or more memories 1401 and at least two processors 1402 and 1403. The memory 1401 stores a computer program that is executed by the processor 1402 and / or the processor 1403. When the computer program is executed by the processor 1402 and / or the processor 1403, it causes the processor 1402 and / or the processor 1403 to perform the Bluetooth connection method described above.

[0095] Electronic device 1400 may be part or all of a computer device that can implement Bluetooth connectivity through software, hardware, or a combination of software and hardware.

[0096] As shown in Figure 14, the electronic device 1400 includes one or more memories 1401, at least two processors 1402 and 1403, a display (not shown), and a communication interface, etc., which are interconnected via a bus system and / or other forms of connection mechanisms (not shown). It should be noted that the components and structure of the electronic device 1400 shown in Figure 14 are exemplary and not limiting; the electronic device 1400 may also have other components and structures as needed.

[0097] The memory 1401 is used to store various data and executable program instructions generated during the operation of the relevant Bluetooth connection method, such as algorithms for storing various applications or implementing various specific functions. It may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc.

[0098] Processor 1402 and / or processor 1403 can be configured to perform various operational steps in the Bluetooth connectivity methods described in the various embodiments of this application. In some embodiments, processor 402 may be a processing device including one or more general-purpose processing devices, such as a microprocessor, a central processing unit (CPU), a graphics processing unit (GPU), etc. More specifically, the processor may be a complex instruction set computing (CISC) microprocessor, a reduced instruction set computing (RISC) microprocessor, a very long instruction word (VLIW) microprocessor, a processor running other instruction sets, or a processor running a combination of instruction sets. The processor may also be one or more special-purpose processing devices, such as application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), system-on-a-chip (SoCs), etc. Furthermore, processor 402 may be configured separately for Bluetooth connectivity or may be shared with other functional modules; this application does not impose any limitations on this.

[0099] In one example, the electronic device 1400 also includes an output device that can output various information (such as images or sounds) to the outside (e.g., a user), and may include one or more of a display device, a speaker, etc.

[0100] The communication interface can be any known communication protocol interface, such as a wired interface or a wireless interface. The communication interface may include one or more serial ports, USB interfaces, Ethernet ports, WiFi, wired networks, DVI interfaces, device integrated interconnect modules, or other suitable ports, interfaces, or connections.

[0101] Furthermore, according to embodiments of this application, a storage medium is also provided, on which program instructions are stored. When the program instructions are executed by a computer or processor, they are used to perform corresponding steps of the Bluetooth connection method of this application. The storage medium may, for example, include a memory card of a smartphone, a storage component of a tablet computer, a hard disk of a personal computer, a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a portable compact disc read-only memory (CD-ROM), a USB memory, or any combination of the above storage media.

[0102] The Bluetooth connection device, electronic device, and storage medium of this application embodiment have the same advantages as the aforementioned Bluetooth connection method because they can implement the Bluetooth connection method described above.

[0103] Although exemplary embodiments have been described herein with reference to the accompanying drawings, it should be understood that the above exemplary embodiments are merely illustrative and are not intended to limit the scope of this application. Various changes and modifications can be made therein by those skilled in the art without departing from the scope and spirit of this application. All such changes and modifications are intended to be included within the scope of this application as claimed in the appended claims.

[0104] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these 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 this application.

[0105] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed.

[0106] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of this application may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.

[0107] Similarly, it should be understood that, in order to streamline this application and aid in understanding one or more of the various inventive aspects, features of this application may sometimes be grouped together in a single embodiment, figure, or description thereof in the description of exemplary embodiments of this application. However, this approach should not be construed as reflecting an intention that the claimed application requires more features than are expressly recited in each claim. Rather, as reflected in the corresponding claims, its inventive point lies in solving the corresponding technical problem with features fewer than all features of a single disclosed embodiment. Therefore, the claims following the detailed description are hereby expressly incorporated into that detailed description, wherein each claim itself is a separate embodiment of this application.

[0108] Those skilled in the art will understand that, apart from the mutual exclusion of features, all features disclosed in this specification (including the accompanying claims, abstract, and drawings) and all processes or units of any method or apparatus so disclosed can be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) may be replaced by an alternative feature that serves the same, equivalent, or similar purpose.

[0109] Furthermore, those skilled in the art will understand that although some embodiments described herein include certain features but not others included in other embodiments, combinations of features from different embodiments are intended to be within the scope of this application and form different embodiments. For example, in the claims, any one of the claimed embodiments can be used in any combination.

[0110] The various component embodiments of this application can be implemented in hardware, or as software modules running on one or more processors, or a combination thereof. Those skilled in the art will understand that microprocessors or digital signal processors (DSPs) can be used in practice to implement some or all of the functions of some modules according to the embodiments of this application. This application can also be implemented as an apparatus program (e.g., a computer program and computer program product) for performing part or all of the methods described herein. Such an implementation of this application can be stored on a computer-readable medium, or can be in the form of one or more signals. Such signals can be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.

[0111] It should be noted that the above embodiments are illustrative of this application and not restrictive, and that those skilled in the art can devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses should not be construed as limiting the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. This application can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names.

[0112] The above description is merely a specific embodiment or illustration of the embodiments of this application. The scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. The scope of protection of this application shall be determined by the scope of the claims.

Claims

1. A Bluetooth connection method, wherein, An application is made to an electronic device with a dual operating system, the electronic device including a first processor and a second processor, the first processor running a first operating system and the second processor running a second operating system, the first processor and the second processor being communicatively connected, and the second processor being communicatively connected to a Bluetooth control layer; the method includes: In response to the first Bluetooth connection command, the second operating system is controlled to establish a Bluetooth connection with the remote device through the Bluetooth control layer; Obtain a first system switching instruction, and establish a first communication connection between the first operating system and the second operating system according to the first system switching instruction, so as to send and receive data packets between the first operating system and the Bluetooth control layer through the second operating system; Obtain a second system switching instruction, and establish a second communication connection within the second operating system according to the second system switching instruction, so as to send and receive data packets between the application layer of the second operating system and the Bluetooth control layer through the second operating system; The power consumption of the second processor is lower than that of the second processor.

2. The method according to claim 1, wherein, The first operating system includes a first Bluetooth module, which comprises, from top to bottom, a first Bluetooth application layer, a first Bluetooth protocol stack, and a first host control interface; the second operating system includes a second Bluetooth module, which comprises, from top to bottom, a second Bluetooth application layer, a second Bluetooth protocol stack, and a second host control interface; wherein, the first host control interface is communicatively connected to the second host control interface, and / or the first Bluetooth protocol stack is communicatively connected to the second Bluetooth protocol stack; the second host control interface is communicatively connected to the Bluetooth control layer.

3. The method according to claim 2, wherein, In response to a first Bluetooth connection command, controlling the second operating system to establish a Bluetooth connection with a remote device through the Bluetooth control layer includes: The second host control interface of the second Bluetooth module establishes a Bluetooth connection with the remote device through the Bluetooth control layer to send and receive data packets to and from the remote device.

4. The method according to claim 3, wherein, The method further includes: When switching operating systems, the parameters, status, and fields of each layer of the Bluetooth module being switched are obtained, and the parameters, status, and fields of each layer are migrated to the target Bluetooth module, so that the target Bluetooth module is restored to the same parameters, status, and fields layer by layer.

5. The method according to claim 4, wherein, Obtain a first system switching instruction, and based on the first system switching instruction, establish a first communication connection between the first operating system and the second operating system to send and receive data packets between the first operating system and the Bluetooth control layer through the second operating system, including: Obtain the switching instruction from the first system; Based on the first system switching command, after the second host control interface of the second Bluetooth module sends and receives the data packet, it sends and receives the data packet to the first host control interface of the first Bluetooth module, so that the first host control interface sends and receives the data packet to the first Bluetooth application layer through the first Bluetooth protocol stack.

6. The method according to claim 5, wherein, Establishing a first communication connection between the first operating system and the second operating system includes: The second host control interface sends the parameters, status, and fields of each layer of the second Bluetooth module to the first host control interface, so that the first host control interface sends the parameters, status, and fields of each layer to the first Bluetooth protocol stack; The first Bluetooth protocol stack receives a connection request from the first Bluetooth application layer to establish the first communication connection, and sends a response to the first Bluetooth application layer indicating that the connection has been successfully established.

7. The method according to claim 4, wherein, Obtain a first system switching instruction, and based on the first system switching instruction, establish a first communication connection between the first operating system and the second operating system to send and receive data packets between the first operating system and the Bluetooth control layer through the second operating system, including: Obtain the switching instruction from the first system; Based on the first system switching command, after the second host control interface sends and receives the data packet, it sends and receives the data packet to the second Bluetooth protocol stack, so that the second Bluetooth protocol stack bypasses the data packet to the first Bluetooth protocol stack, and the first Bluetooth protocol stack sends and receives the data packet to the first Bluetooth application layer.

8. The method according to claim 7, wherein, Establishing a first communication connection between the first operating system and the second operating system includes: The second host control interface sends the parameters, status, and fields of each layer of the second Bluetooth module to the second Bluetooth protocol stack, so that the second Bluetooth protocol stack sends the parameters, status, and fields of each layer to the first Bluetooth protocol stack; The first Bluetooth protocol stack receives a connection request from the first Bluetooth application layer to establish the first communication connection, and sends a response to the first Bluetooth application layer indicating that the connection has been successfully established.

9. The method according to claim 5 or 7, wherein, Obtain a second system switching instruction, and based on the second system switching instruction, establish a second communication connection within the second operating system to send and receive data packets between the application layer of the second operating system and the Bluetooth control layer, including: Obtain the second system switching instruction; Based on the second system switching command, the second host control interface bypasses the data packet to the second Bluetooth application layer via the second Bluetooth protocol stack.

10. The method according to claim 1, wherein, The method further includes: According to the first system switching instruction, after establishing a first communication connection between the first operating system and the second operating system, the second communication connection is disconnected; and According to the second system switching instruction, after establishing a second communication connection within the second operating system, the first communication connection is disconnected.

11. The method according to claim 10, wherein, in, Establishing a second communication connection within the second operating system and disconnecting the first communication connection are synchronous processes; establishing a first communication connection between the first operating system and the second operating system and disconnecting the second communication connection are also synchronous processes.

12. The method according to claim 1, wherein, When establishing the first or second communication connection, the second host control interface maintains a communication connection and data transmission with the Bluetooth control layer.

13. The method according to claim 1, wherein, The first operating system includes the Android system, and the second operating system includes a real-time operating system.

14. An electronic device, wherein, The electronic device includes a first processor and a second processor. The first processor is used to run a first operating system, and the second processor is used to run a second operating system. The first processor and the second processor are communicatively connected, and the second processor is communicatively connected to the Bluetooth control layer. The electronic device further includes a memory storing a computer program that, when executed by the at least two processors, causes the at least two processors to perform the steps of the Bluetooth connection method as described in any one of claims 1 to 13.

15. A computer program product comprising a computer program, wherein, When the computer program is executed by a processor, it implements the steps of the Bluetooth connection method as described in any one of claims 1 to 13.

Citation Information

Patent Citations

  • Bluetooth communication method and device and terminal

    CN106452517A

  • System switching method and device, electronic equipment and readable storage medium

    CN112492564A

  • Method and electronic device for bluetooth communication

    CN114124165A

  • Dual-system Bluetooth device and electronic equipment

    CN114422992A

  • Bluetooth connection method and device, electronic equipment and computer readable storage medium

    CN116419189A