Bluetooth connection method and device, electronic device, and computer-readable storage medium

By using the first operating system to establish a Bluetooth connection with the second device in the dual-system electronic device and transmitting the status of the second operating system, the stability problem of the dual-system equipment during Bluetooth connection is solved, ensuring the normal support of Bluetooth services.

CN116419189BActive Publication Date: 2025-08-15GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111643910.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-29
Publication Date
2025-08-15
Estimated Expiration
2041-12-29

AI Technical Summary

Technical Problem

Electronic devices equipped with dual systems cannot support Bluetooth services normally when connected to Bluetooth, because both systems need to connect to external devices through the same Bluetooth module, and the current operating system cannot be sensed when the system is abnormal.

Method used

By controlling the first operating system to establish a first Bluetooth connection with the second device when it is responsive to the Bluetooth connection instruction, and sending the status of the second operating system to the second device, the second device determines whether to establish a second Bluetooth connection.

Benefits of technology

It realizes that no matter which operating system is running in the first device, it can support Bluetooth services normally, ensuring the stability and reliability of Bluetooth connection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116419189B_ABST
    Figure CN116419189B_ABST
Patent Text Reader

Abstract

The present application relates to a Bluetooth connection method and device, an electronic device, and a computer-readable storage medium, which are applied to a first device, wherein the first device includes a first processor, a second processor, and a Bluetooth module, the first processor and the second processor are communicatively connected, the Bluetooth module and the first processor are communicatively connected, the first processor is used to run a first operating system, and the second processor is used to run a second operating system, and the operating power consumption of the first processor is less than the operating power consumption of the second processor. The method includes: in response to a first Bluetooth connection instruction, controlling the first operating system to establish a first Bluetooth connection with the second device through the Bluetooth module; and sending the status of the second operating system to the second device through the first Bluetooth connection, so that the second device determines to establish a second Bluetooth connection with the second operating system according to the status of the second operating system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a Bluetooth connection method and device, an electronic device, and a computer-readable storage medium. Background Art

[0002] As electronic devices become increasingly powerful, a single operating system sometimes fails to meet people's functional needs. Therefore, some electronic devices are starting to use dual operating systems to provide users with a better user experience. When using Bluetooth services, electronic devices equipped with dual operating systems both require a Bluetooth module to establish a connection with external devices.

[0003] However, because both systems need to use Bluetooth modules to achieve Bluetooth connections with external devices, when an abnormality occurs in the system, the electronic device may not be able to normally support Bluetooth services. Summary of the Invention

[0004] The embodiments of the present application provide a Bluetooth connection method and apparatus, an electronic device, and a computer-readable storage medium, which can enable an operating system currently running on a first device to normally support Bluetooth services.

[0005] In one aspect, a Bluetooth connection method is provided, which is applied to a first device. The first device includes a first processor, a second processor, and a Bluetooth module. The first processor and the second processor are communicatively connected, and the Bluetooth module is communicatively connected to the first 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 operating power consumption of the first processor is less than the operating power consumption of the second processor. The method includes:

[0006] In response to a first Bluetooth connection instruction, controlling the first operating system to establish a first Bluetooth connection with a second device through the Bluetooth module;

[0007] The state of the second operating system is sent to the second device via the first Bluetooth connection, so that the second device determines whether to establish a second Bluetooth connection with the second operating system according to the state of the second operating system.

[0008] In another aspect, a Bluetooth connection method is provided, which is applied to a second device, wherein the first device includes a first processor, a second processor, and a Bluetooth module, the first processor and the second processor are communicatively connected, the Bluetooth module and the first processor are communicatively connected, the first processor is configured to run a first operating system, and the second processor is configured to run a second operating system; the method includes:

[0009] In response to a first Bluetooth connection instruction, establishing a first Bluetooth connection with the first operating system through the Bluetooth module;

[0010] receiving, through the first Bluetooth connection, a status of the second operating system sent by the first device;

[0011] A second Bluetooth connection is established with the second operating system according to the state of the second operating system.

[0012] In another aspect, a Bluetooth connection device is provided, which is applied to a first device. The first device includes a first processor, a second processor, and a Bluetooth module. The first processor and the second processor are communicatively connected, and the Bluetooth module is communicatively connected to the first 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 operating power consumption of the first processor is less than the operating power consumption of the second processor. The device includes:

[0013] a first control module, configured to control the first operating system to establish a first Bluetooth connection with a second device via the Bluetooth module in response to a first Bluetooth connection instruction;

[0014] The sending module is configured to send the state of the second operating system to the second device via the first Bluetooth connection, so that the second device determines whether to establish a second Bluetooth connection with the second operating system according to the state of the second operating system.

[0015] An electronic device includes a memory, a first processor and a second processor. The memory stores a computer program. When the computer program is executed by the processor, the processor performs the steps of the Bluetooth communication method described above.

[0016] A computer-readable storage medium stores a computer program, which implements the steps of the Bluetooth communication method described above when executed by a processor.

[0017] On the other hand, a computer program product is provided, comprising a computer program, which implements the steps of the Bluetooth communication method described above when the computer program is executed by a processor.

[0018] The above-mentioned Bluetooth connection method and device, electronic device, and computer-readable storage medium, the first device responds to the first Bluetooth connection instruction to control the first operating system to establish a first Bluetooth connection with the second device through the Bluetooth module. That is, regardless of whether the first operating system or the second operating system is running in the first device, a first Bluetooth connection will be established first. Then, the state of the second operating system is sent to the second device through the first Bluetooth connection, so that the second device determines to establish a second Bluetooth connection with the second operating system based on the state of the second operating system. The first device can send the state of the second operating system to the second device through the first Bluetooth connection established between the first operating system and the second device, so that the second device can obtain the state of the second operating system. Furthermore, based on the state of the second operating system, it is determined to establish a second Bluetooth connection in addition to the first Bluetooth connection, so that the second operating system supports Bluetooth services.

[0019] Thus, the second device can obtain the status of the second operating system in the first device, and then determine to establish a second Bluetooth connection with the first device, so that the operating system currently running on the first device normally supports the Bluetooth service. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0021] Figure 1 A diagram showing an application environment of a Bluetooth connection method in one embodiment;

[0022] Figure 2 is a flowchart of a Bluetooth connection method in one embodiment;

[0023] Figure 3 for Figure 2 A flowchart of a method for establishing a first Bluetooth connection;

[0024] Figure 4 FIG. 1 is a hardware framework diagram of a dual system in an electronic device according to an embodiment;

[0025] Figure 5 is a flowchart of a Bluetooth connection method in another embodiment;

[0026] Figure 6 is a flowchart of a method for establishing a second Bluetooth connection in one embodiment;

[0027] Figure 7 A flowchart of a Bluetooth connection method in yet another embodiment;

[0028] Figure 8 is a flowchart of a Bluetooth connection method in one embodiment;

[0029] Figure 9 is a timing diagram of Bluetooth connection when the operating mode of the first device is the light smart mode in a specific embodiment;

[0030] Figure 10 is a timing diagram of Bluetooth connection when the operating mode of the first device is hybrid mode or high-performance mode in another specific embodiment;

[0031] Figure 11 is a structural block diagram of a Bluetooth connection device in one embodiment;

[0032] Figure 12 is a structural block diagram of a Bluetooth connection device in one embodiment;

[0033] Figure 13 FIG. 1 is a schematic diagram of the internal structure of an electronic device in one embodiment. DETAILED DESCRIPTION

[0034] In order to make the purpose, technical solutions and advantages of this application more clearly understood, the present application is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0035] Figure 1 FIG. 1 is an application scenario diagram of a Bluetooth connection method in an embodiment. Figure 1 As shown, the application environment includes a first device 120 and a second device 140. The first device 120 includes a first processor, a second processor and a Bluetooth module. The first processor and the second processor are communicatively connected, and the Bluetooth module is communicatively connected to the first 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 operating power consumption of the first processor is less than the operating power consumption of the second processor. The method includes: in response to a first Bluetooth connection instruction, controlling the first operating system to establish a first Bluetooth connection with the second device 140 through the Bluetooth module; sending the status of the second operating system to the second device 140 through the first Bluetooth connection, so that the second device 140 determines whether to establish a second Bluetooth connection with the second operating system based on the status of the second operating system. Here, the first device 120 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.

[0036] Traditionally, electronic devices often have a single operating system running on a single-core processor. When connecting to Bluetooth, the single-core processor in the electronic device connects to an external device via a Bluetooth module, enabling the single operating system to support Bluetooth services. However, as electronic devices become increasingly powerful, a single operating system sometimes fails to meet user demands. Therefore, some electronic devices are beginning to feature dual operating systems to provide a better user experience. For example, a first processor runs the first operating system, while a second processor runs the second operating system. Typically, electronic devices with dual operating systems are equipped with only one Bluetooth module. Therefore, when using Bluetooth services, both systems must use the same Bluetooth module to connect to the external device. Furthermore, the Bluetooth services in the dual systems are completely separate and run independently. Specifically, when using Bluetooth services on the first operating system, the first processor running the first operating system communicates directly with the Bluetooth module, without relying on the second operating system. Similarly, when using Bluetooth services on the second operating system, the second processor running the second operating system also communicates directly with the Bluetooth module, without relying on the first operating system. The Bluetooth module is used to implement Bluetooth communication functions.

[0037] Because both systems need to use the same Bluetooth module to achieve Bluetooth connection with external devices, and the Bluetooth connection between the two systems is relatively independent, in some cases, the operating system currently running on the electronic device cannot normally support Bluetooth services. For example, when the electronic device is currently running the first operating system, and the external device cannot sense which operating system is currently running on the electronic device, then when the external device is connected to the second processor running the second operating system, it cannot achieve the first operating system supporting Bluetooth services. On the contrary, when the electronic device is currently running the second operating system, and the external device cannot sense which operating system is currently running on the electronic device, then when the external device is connected to the first processor running the first operating system, it cannot achieve the second operating system supporting Bluetooth services. At this time, the external device needs to go through trial and error and switch the Bluetooth connection before it can achieve the operating system currently running on the electronic device supporting Bluetooth services.

[0038] Therefore, a Bluetooth connection method is proposed in an embodiment of the present application, which no longer completely separates the Bluetooth services of different operating systems. Instead, when the electronic device responds to the first Bluetooth connection instruction, it controls the first operating system to establish a first Bluetooth connection with the second device through the Bluetooth module. Then, the state of the second operating system is sent to the second device through the first Bluetooth connection, so that the external device determines whether to establish a second Bluetooth connection with the second operating system based on the state of the second operating system. Based on the state of the second operating system, the operating system currently running on the electronic device can be determined, and then, based on the operating system currently running on the electronic device, the external device determines whether to establish a second Bluetooth connection with the second operating system. In this way, it can be achieved that the operating system currently running on the electronic device supports Bluetooth services.

[0039] Figure 2 The flowchart of the Bluetooth connection method in one embodiment is shown in FIG. The Bluetooth connection method in this embodiment is based on the operation of Figure 1 The first device 120 in the example is described. The first device 120 includes a first processor, a second processor, and a Bluetooth module. The first processor and the second processor are communicatively connected, and the Bluetooth module is communicatively connected to the first 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 operating power consumption of the first processor is less than the operating power consumption of the second processor. Therefore, the first operating system can be an MCU (Microcontroller Unit) system, and the first processor is used to run the first operating system. In this case, the first processor can be a microcontroller unit (MCU). The first operating system serves as the basic system on the first device. The first device runs the first operating system in most usage scenarios, for example, only using the first device to implement services such as health monitoring or motion monitoring. The second operating system can be an Android system or an iOS system. The second processor is used to run the second operating system. In this case, the second processor can be a system-on-a-chip (SOC). The second operating system serves as an advanced system on the first device. The first device runs the second operating system in some usage scenarios with higher functional requirements. For example, using the first device to implement services such as answering calls on the second device. Of course, this application does not limit this.

[0040] Of course, the first device can not only run dual operating systems, but also run multiple operating systems, each operating system running on a corresponding processor, that is, the first device includes multiple processors, and this application does not limit this.

[0041] Specifically, such as Figure 2 As shown, a Bluetooth connection method is provided for a first device, including:

[0042] Step 220: In response to the first Bluetooth connection instruction, control the first operating system to establish a first Bluetooth connection with the second device through the Bluetooth module.

[0043] Here, the first device can be an electronic device running a dual system (dual operating system), such as a smart watch. The first operating system can be run separately on the first device, and the second operating system can also be run at the same time. That is, the first operating system in the first device is always running to implement some basic services. And the interface and application of the second operating system running on the first device 120 can be different from the interface and application of the first operating system running on the first device 120.

[0044] The second device is an external device used to establish a Bluetooth connection with the first device. The second device can be a device that supports only a single operating system or a device that supports dual operating systems, and this application does not limit this. For example, the second device is a smartphone, and this application does not limit this.

[0045] When establishing a Bluetooth connection between a first device and a second device, the second device sends a first Bluetooth connection instruction to the first device. Since the first operating system in the electronic device is always running, after receiving the first Bluetooth connection instruction, the first device can respond to the first Bluetooth connection instruction and control the first operating system to establish the first Bluetooth connection with the second device via the Bluetooth module. The first Bluetooth connection instruction is used to instruct the first operating system to establish the first Bluetooth connection with the second device via the Bluetooth module.

[0046] Of course, when establishing a Bluetooth connection between the first device and the second device, the first device may also actively trigger the generation of the first Bluetooth connection instruction. Since the first operating system in the electronic device is always running, after receiving the first Bluetooth connection instruction, the first device can respond to the first Bluetooth connection instruction and control the first operating system to establish the first Bluetooth connection with the second device through the Bluetooth module. The first device actively triggering the generation of the first Bluetooth connection instruction may be the first device actively triggering the generation of the first Bluetooth connection instruction after receiving an operation instruction from the user, which is not limited in this application.

[0047] Step 240: Send the state of the second operating system to the second device via the first Bluetooth connection, so that the second device determines whether to establish a second Bluetooth connection with the second operating system according to the state of the second operating system.

[0048] After the first Bluetooth connection is established between the first device and the second device, the first operating system in the first device can communicate with the second device via Bluetooth through the Bluetooth module. Therefore, the first operating system can obtain the status of the second operating system in the first device, and send the status of the second operating system in the first device to the second device via the first Bluetooth connection. In this way, the second device can obtain the status of the second operating system in the first device in real time, and then determine whether to establish a second Bluetooth connection with the second operating system based on the status of the second operating system. That is, when the second operating system in the first device is in a running state or a dormant state, it is determined that the second operating system needs to support Bluetooth services, and then the second device determines to establish a second Bluetooth connection with the second operating system. Here, the second Bluetooth connection established between the second device and the second operating system can be a communication connection established based on the first Bluetooth connection, or it can be a communication connection completely independent of the first Bluetooth connection, and this application does not limit this.

[0049] At this time, when the second operating system in the first device is in a shutdown state, it is determined that the second operating system does not need to support the Bluetooth service, and then the second device determines not to establish a second Bluetooth connection with the second operating system.

[0050] In an embodiment of the present application, the first device responds to the first Bluetooth connection instruction and controls the first operating system to establish a first Bluetooth connection with the second device through the Bluetooth module. That is, regardless of whether the first operating system or the second operating system is running in the first device, the first Bluetooth connection will be established first. Then, the state of the second operating system is sent to the second device through the first Bluetooth connection, so that the second device determines whether to establish a second Bluetooth connection with the second operating system based on the state of the second operating system. The first device can send the state of the second operating system to the second device through the first Bluetooth connection established between the first operating system and the second device, so that the second device can obtain the state of the second operating system. Furthermore, based on the state of the second operating system, it is determined whether it is necessary to establish a second Bluetooth connection in addition to the first Bluetooth connection so that the second operating system supports Bluetooth services.

[0051] Thus, the second device can obtain the status of the second operating system in the first device, and then determine whether it is necessary to establish a second Bluetooth connection with the first device, so that the operating system currently running on the first device normally supports Bluetooth services.

[0052] Continuing from the previous embodiment, a Bluetooth connection method is described, which controls a first operating system to establish a first Bluetooth connection with a second device via a Bluetooth module in response to a first Bluetooth connection instruction. The state of the second operating system is sent to the second device via the first Bluetooth connection, so that the second device determines whether to establish a second Bluetooth connection with the second operating system based on the state of the second operating system. In this embodiment, Figure 3 As shown, step 220 is described in detail, and specific implementation steps of controlling the first operating system to establish a first Bluetooth connection with the second device through the Bluetooth module in response to the first Bluetooth connection instruction include:

[0053] Step 222: Control the first operating system to monitor the first Bluetooth interface of the Bluetooth module.

[0054] Combine Figure 4 The figure shows a hardware framework diagram of a dual system in an electronic device in one embodiment. The first operating system can be a microcontroller unit (MCU) running a first operating system, such as an MCU system; the second operating system can be a system-on-chip (SOC) running a second operating system, such as an Android system or an iOS system, which is not limited in this application. The Bluetooth chip 460 can communicate with the microcontroller unit (MCU) 440 via a UART bus, and then the microcontroller unit (MCU) 440 communicates with the system-on-chip (SOC) 420 via a UART bus. Of course, the Bluetooth chip 460 here can also be a Bluetooth module integrated in the microcontroller unit (MCU) 440, which is not limited in this application. The Bluetooth module in the first device (smart watch) includes two Bluetooth interfaces, a first Bluetooth interface (assuming it is named UUID-B) and a second Bluetooth interface (assuming it is named UUID-A), where UUID is a universally unique identifier. The first Bluetooth interface is used to receive a first Bluetooth connection instruction sent by the second device, and correspondingly, the second Bluetooth interface is used to receive a second Bluetooth connection instruction sent by the second device. Among them, the first Bluetooth connection instruction is used to instruct the second device to establish a Bluetooth connection with the first operating system in the first device, and the second Bluetooth connection instruction is used to instruct the second device to establish a Bluetooth connection with the second operating system in the first device. The first Bluetooth interface (assuming it is named UUID-B) and the second Bluetooth interface (assuming it is named UUID-A) are both interfaces based on the RFCOMM protocol. Among them, the RFCOMM protocol provides a serial (9-pin RS-232) simulation based on the L2CAP protocol, and the RFCOMM protocol can support up to 60 communication connections between two Bluetooth devices.

[0055] When establishing a Bluetooth connection between a first device (smartwatch) and a second device (smartphone), that is, after the Bluetooth function in the second device is turned on, the second device sends a first Bluetooth connection instruction to the first Bluetooth interface (assuming it is named UUID-B) of the Bluetooth module in the first device. After the Bluetooth functions in the first device are both turned on, the first device simultaneously controls the first operating system to monitor the first Bluetooth interface (UUID-B) of the Bluetooth module and the second Bluetooth interface (UUID-A) of the Bluetooth module.

[0056] Step 224 : When a first Bluetooth connection instruction sent by the second device is monitored through the first Bluetooth interface, in response to the first Bluetooth connection instruction, control the first operating system to establish a first Bluetooth connection with the second device through the first Bluetooth interface of the Bluetooth module.

[0057] When a first Bluetooth connection instruction sent by a second device is monitored through the first Bluetooth interface (UUID-B), the Bluetooth module of the first device sends the first Bluetooth connection instruction to the first operating system after receiving the first Bluetooth connection instruction. After receiving the first Bluetooth connection instruction, the first operating system controls the first operating system to establish a first Bluetooth connection with the second device through the first Bluetooth interface (UUID-B) of the Bluetooth module in response to the first Bluetooth connection instruction. In this way, the first operating system of the first device can transmit data with the second device through the established first Bluetooth connection.

[0058] In an embodiment of the present application, the Bluetooth module in the first device includes two Bluetooth interfaces, a first Bluetooth interface and a second Bluetooth interface. The first device simultaneously controls the first operating system to monitor the first Bluetooth interface of the Bluetooth module, and monitor the second Bluetooth interface of the Bluetooth module. When the first Bluetooth connection instruction sent by the second device is monitored through the first Bluetooth interface, the first operating system is controlled to establish a first Bluetooth connection with the second device through the first Bluetooth interface of the Bluetooth module. Different Bluetooth connection instructions are received through different Bluetooth interfaces in the Bluetooth module, and then different Bluetooth connections are established with different operating systems in the first device based on different Bluetooth interfaces. Ultimately, the first operating system in the first device supports Bluetooth services, or the first operating system and the second operating system simultaneously support Bluetooth services.

[0059] Continuing from the previous embodiment, Figure 5 As shown, in the case where the second device determines to establish a second Bluetooth connection with the second operating system according to the state of the second operating system, a Bluetooth connection method is provided, further comprising:

[0060] Step 260, when the state of the second operating system is running state or sleep state, in response to the second Bluetooth connection instruction, control the second operating system to establish a second Bluetooth connection with the second device through the Bluetooth module; the second Bluetooth connection instruction is an instruction sent by the second device when it determines to establish a second Bluetooth connection with the second operating system based on the state of the second operating system.

[0061] When the state of the second operating system is running or dormant, the second device determines to establish a second Bluetooth connection with the second operating system according to the state of the second operating system, and at this time, the second device sends a second Bluetooth connection instruction to the first device. Since the second Bluetooth connection instruction is used to instruct the second device to establish a Bluetooth connection with the second operating system in the first device, when the state of the second operating system of the first device is running, after receiving the second Bluetooth connection instruction, the first device responds to the second Bluetooth connection instruction and controls the second operating system to establish a second Bluetooth connection with the second device through the Bluetooth module. When the state of the second operating system of the first device is dormant, after receiving the second Bluetooth connection instruction, the first device first wakes up the second operating system, and then, in response to the second Bluetooth connection instruction, the first device controls the second operating system to establish a second Bluetooth connection with the second device through the Bluetooth module.

[0062] Among them, the status of the second operating system is running state, which means that the process of the second operating system on the first device is in normal running state, that is, the process in the second operating system will occupy the memory of the second operating system; and the status of the second operating system is sleeping state, which means that the process of the second operating system on the first device is in sleeping state, that is, the process in the second operating system is not closed, but will not occupy the memory of the second operating system.

[0063] Specifically, in response to the second Bluetooth connection instruction, the first device controls the second operating system to establish a connection with the first operating system through the UART bus, and the first operating system then establishes a connection with the Bluetooth module through the UART bus. Finally, the second operating system establishes a second Bluetooth connection with the second device through the Bluetooth module.

[0064] Here, combined Figure 4 As shown, the first processor may be a microcontroller unit MCU 440, which is used to run a first operating system, such as an MCU system (if the first device is a smartwatch, the MCU system may be an RTOS system). The second processor may be a system-on-chip SOC 420, which is used to run a second operating system, such as an Android system. The Bluetooth module may be a Bluetooth chip 460, which may communicate with the microcontroller unit MCU 440 via a UART bus. Then, the microcontroller unit MCU 440 further communicates with the system-on-chip SOC 420 via a UART bus.

[0065] In an embodiment of the present application, when the second operating system is in a running state or a dormant state, the second device determines to establish a second Bluetooth connection with the second operating system based on the state of the second operating system, and then the second device sends a second Bluetooth connection instruction to the first device. In response to the second Bluetooth connection instruction, the first device controls the second operating system to establish a second Bluetooth connection with the second device via the Bluetooth module.

[0066] Through the first Bluetooth connection established between the first device and the second device, the second device can obtain the status of the second operating system in the first device. Then, when the status of the second operating system meets the conditions for establishing a second Bluetooth connection, the second device sends a second Bluetooth connection instruction to the first device. In response to the second Bluetooth connection instruction, the first device controls the second operating system to establish a second Bluetooth connection with the second device via the Bluetooth module. Thus, the second operating system in the first device establishes a second Bluetooth connection with the second device via the Bluetooth module. That is, the second operating system in the first device can normally support Bluetooth services.

[0067] Continuing from the previous embodiment, Figure 6 As shown, step 260, in response to the second Bluetooth connection instruction, controlling the second operating system to establish a second Bluetooth connection with the second device through the Bluetooth module includes:

[0068] When the first operating system receives a second Bluetooth connection instruction sent by the second device through the second Bluetooth interface, in response to the second Bluetooth connection instruction, the second operating system is controlled to establish a second Bluetooth connection with the second device through the second Bluetooth interface on the Bluetooth module connected to the first operating system.

[0069] Specifically, step 260, in response to the second Bluetooth connection instruction, controlling the second operating system to establish a second Bluetooth connection with the second device through the Bluetooth module includes:

[0070] Step 262: Control the first operating system to monitor the second Bluetooth interface of the Bluetooth module.

[0071] Combine Figure 4As shown, the Bluetooth module in the first device (smart watch) includes two Bluetooth interfaces, a first Bluetooth interface (assuming it is named UUID-B) and a second Bluetooth interface (assuming it is named UUID-A), wherein UUID is (Universally Unique Identifier). The first Bluetooth interface is used to receive a first Bluetooth connection instruction sent by the second device, and correspondingly, the second Bluetooth interface is used to receive a second Bluetooth connection instruction sent by the second device. The first Bluetooth connection instruction is used to instruct the second device to establish a Bluetooth connection with the first operating system in the first device, and the second Bluetooth connection instruction is used for the second device to establish a Bluetooth connection with the second operating system in the first device. The first Bluetooth interface (assuming it is named UUID-B) and the second Bluetooth interface (assuming it is named UUID-A) are both interfaces based on the RFCOMM protocol. The RFCOMM protocol provides a serial (9-pin RS-232) simulation based on the L2CAP protocol, and the RFCOMM protocol can support up to 60 communication connections between two Bluetooth devices.

[0072] When establishing a Bluetooth connection between a first device (smartwatch) and a second device (smartphone), that is, after the Bluetooth function in the second device is turned on, the second device sends a first Bluetooth connection instruction to the first Bluetooth interface (assuming it is named UUID-B) of the Bluetooth module in the first device. After the Bluetooth functions in the first device are both turned on, the first device simultaneously controls the first operating system to monitor the first Bluetooth interface (UUID-B) of the Bluetooth module and the second Bluetooth interface (UUID-A) of the Bluetooth module.

[0073] Step 264, when a second Bluetooth connection instruction sent by a second device is received through the second Bluetooth interface, in response to the second Bluetooth connection instruction, control the second operating system to establish a second Bluetooth connection with the second device through the second Bluetooth interface on the Bluetooth module connected to the first operating system.

[0074] Specifically, the second operating system is controlled to send a third Bluetooth connection instruction to the first operating system, the second operating system is controlled to establish a connection with the first operating system based on the third Bluetooth connection instruction, and the first operating system is indirectly controlled to establish a second Bluetooth connection with the second device through the second Bluetooth interface of the Bluetooth module.

[0075] In the case of monitoring the second Bluetooth connection instruction sent by the second device through the second Bluetooth interface (UUID-A), the Bluetooth module of the first device sends the second Bluetooth connection instruction to the first operating system through the UART bus after receiving the second Bluetooth connection instruction. After the first operating system receives the second Bluetooth connection instruction, it forwards the second Bluetooth connection instruction to the second operating system through the UART bus. In response to the second Bluetooth connection instruction, the second operating system controls the second operating system to send a third Bluetooth connection instruction to the first operating system, wherein the third Bluetooth connection instruction is used to instruct the first operating system to establish a Bluetooth connection with the second device through the second Bluetooth interface (UUID-A) of the Bluetooth module. After receiving the third Bluetooth connection instruction, the first operating system controls the second operating system to establish a second Bluetooth connection with the second device through the second Bluetooth interface (UUID-A) of the Bluetooth module. In this way, the second operating system of the first device can transmit data with the second device through the established second Bluetooth connection.

[0076] In an embodiment of the present application, when the first operating system receives a second Bluetooth connection instruction sent by the second device through the second Bluetooth interface, in response to the second Bluetooth connection instruction, the second operating system is controlled to establish a second Bluetooth connection with the second device through the second Bluetooth interface on the Bluetooth module connected to the first operating system.

[0077] Because the second operating system can communicate with the first operating system via the UART bus, the second operating system can use the first operating system as a relay station to establish a second Bluetooth connection with the second device via the second Bluetooth interface of the Bluetooth module. This enables the second operating system in the first device to establish a second Bluetooth connection with the second device via the Bluetooth module, effectively ensuring that the second operating system in the first device can properly support Bluetooth services.

[0078] Continuing from the previous embodiment, upon detecting that the second operating system is in the running state or the dormant state, in response to the second Bluetooth connection instruction, the second operating system is controlled to establish a second Bluetooth connection with the second device via the Bluetooth module. In this embodiment, when the second operating system switches from the running state or the dormant state to the shutdown state, the second operating system is controlled to disconnect the second Bluetooth connection established with the second device via the Bluetooth module.

[0079] Specifically, when the state of the second operating system is the running state or the dormant state, in response to the second Bluetooth connection instruction, the second operating system is controlled to establish a second Bluetooth connection with the second device through the Bluetooth module.

[0080] Since the state of the second operating system changes in real time, when it is detected that the state of the second operating system switches from the running state or the dormant state to the shutdown state, the second operating system is controlled to disconnect the second Bluetooth connection established with the second device through the Bluetooth module. The shutdown state of the second operating system means that the process of the second operating system on the first device is in the shutdown state, that is, the process in the second operating system is closed and does not occupy the memory of the second operating system. When it is detected that the state of the second operating system switches from the running state to the dormant state, or from the dormant state to the running state, the second Bluetooth connection is maintained.

[0081] Of course, on the contrary, when it is detected that the state of the second operating system is switched from the shutdown state to the running state or the sleep state, in response to the second Bluetooth connection instruction, the second operating system is controlled to establish a second Bluetooth connection with the second device again through the Bluetooth module.

[0082] In an embodiment of the present application, when it is detected that the state of the second operating system switches from the running state or the dormant state to the shutdown state, the second operating system is controlled to disconnect the second Bluetooth connection established with the second device through the Bluetooth module. In this way, the second Bluetooth connection can be disconnected in time after the state change of the second operating system is detected in real time. When it is detected that the state of the second operating system switches from the shutdown state to the running state or the dormant state, in response to the second Bluetooth connection instruction, the second operating system is controlled to establish a second Bluetooth connection with the second device again through the Bluetooth module. Thus, while ensuring that the second operating system switches to the running state or the dormant state, the second Bluetooth connection is re-established in time. Ultimately, it is achieved that the second operating system can support Bluetooth services when it is in the running state or the dormant state, and at the same time, when the second operating system switches to the shutdown state, the second communication connection is disconnected in time to reduce the power consumption of the first device.

[0083] In the aforementioned embodiment, a Bluetooth connection method is described. In response to a first Bluetooth connection instruction, a first operating system is controlled to establish a first Bluetooth connection with a second device via a Bluetooth module. The status of the second operating system is sent to the second device via the first Bluetooth connection, so that the second device determines whether to establish a second Bluetooth connection with the second operating system based on the status of the second operating system. In this embodiment, the Bluetooth connection method further includes:

[0084] Control the first operating system to send data of the first operating system to the second device through the first Bluetooth connection; or

[0085] The first operating system is controlled to send data of the first operating system to the second device through the first Bluetooth connection; and the second operating system is controlled to send data of the second operating system to the second device through the second Bluetooth connection.

[0086] Here, the first device may be a first device 120 running a dual system (dual operating system), such as a smartwatch. The first operating system may be run alone on the first device, and the second operating system may also be run at the same time. That is, the first operating system in the electronic device is always running to implement some basic services. Moreover, the interface and application of the second operating system running on the first device 120 may be different from the interface and application of the first operating system running on the first device 120.

[0087] On the one hand, when the first operating system is running alone on the first device and the second operating system is in the shutdown state, the first device responds to the first Bluetooth connection instruction and controls the first operating system to establish a first Bluetooth connection with the second device through the Bluetooth module. And obtains the status of the second operating system, sends the status of the second operating system to the second device through the first Bluetooth connection, and the second device determines not to establish a second Bluetooth connection with the second operating system. At this time, the first device can control the first operating system to send the data of the first operating system to the second device through the first Bluetooth connection. Among them, the data of the first operating system includes the data generated by each application in the first operating system, and this application does not limit the data type and data content.

[0088] On the other hand, when the second operating system is running on the first device at the same time, the second operating system can be in a running state or a dormant state. The first device responds to the first Bluetooth connection instruction and controls the first operating system to establish a first Bluetooth connection with the second device through the first Bluetooth interface of the Bluetooth module. And obtains the status of the second operating system, sends the status of the second operating system to the second device through the first Bluetooth connection, and the second device determines to establish a second Bluetooth connection with the second operating system based on the fact that the second operating system can be in a running state or a dormant state. Specifically, when the status of the second operating system of the first device is a running state, in response to the second Bluetooth connection instruction, the second operating system is controlled to establish the second Bluetooth connection with the second device through the second Bluetooth interface of the Bluetooth module. When the status of the second operating system of the first device is a dormant state, the first device first wakes up the second operating system after receiving the second Bluetooth connection instruction, and then, in response to the second Bluetooth connection instruction, the first device controls the second operating system to establish a second Bluetooth connection with the second device through the Bluetooth module.

[0089] At this time, the first device can control the first operating system to send the data of the first operating system to the second device through the first Bluetooth connection. The first device can also control the second operating system to send the data of the second operating system to the second device through the second Bluetooth connection. Among them, the data of the second operating system includes the data generated by each application in the second operating system, and this application does not limit the data type and data content. In this way, the first device can send the data of different operating systems to the second device respectively through different Bluetooth connections, further improving the data transmission efficiency. And because the first operating system and the second operating system respectively use different Bluetooth interfaces in the Bluetooth module to establish different Bluetooth connections, the first operating system and the second operating system of the first device can respectively use different Bluetooth connections to transmit the data of their respective systems to the second device at the same time.

[0090] In the embodiment of the present application, when the first operating system is running alone on the first device and the second operating system is in a shutdown state, only the first communication connection is established between the first device and the second device. Therefore, the first operating system is controlled to send data of the first operating system to the second device via the first Bluetooth connection. When the second operating system is in a shutdown state, only the first communication connection is established between the first device and the second device, thereby reducing the power consumption of the first device.

[0091] When the first operating system and the second operating system are running simultaneously on the first device, and the second operating system can be in either running or dormant state, not only the first communication connection but also the second communication connection is established between the first device and the second device. Therefore, the first operating system is controlled to send the first operating system's data to the second device via the first Bluetooth connection, and the second operating system is controlled to send the second operating system's data to the second device via the second Bluetooth connection. In this way, the first device can send data from different operating systems to the second device simultaneously via different Bluetooth connections, further improving data transmission efficiency.

[0092] In the aforementioned embodiment, step 240 is described, in which the state of the second operating system is sent to the second device via the first Bluetooth connection, so that the second device determines whether to establish a second Bluetooth connection with the second operating system based on the state of the second operating system. In this embodiment, the specific steps for sending the state of the second operating system to the second device via the first Bluetooth connection are further described, including:

[0093] Controlling the first operating system to obtain the status of the second operating system;

[0094] The status of the second operating system is sent to the second device via the first Bluetooth connection.

[0095] Specifically, in response to a first Bluetooth connection instruction, the first device controls the first operating system to establish a first Bluetooth connection with the second device via the Bluetooth module. The device also obtains the status of the second operating system and sends the status of the second operating system to the second device via the first Bluetooth connection. The second device determines whether to establish a second Bluetooth connection with the second operating system based on the status of the second operating system. When sending the status of the second operating system to the second device via the first Bluetooth connection, the first operating system can be controlled to obtain the status of the second operating system and then send the status of the second operating system to the second device via the first Bluetooth connection.

[0096] The state of the second operating system includes a running state, a dormant state, and a shutdown state. The state of the second operating system can also be divided into more states, which is not limited in this application.

[0097] Specifically, the second operating system can transmit the state of the second operating system to the first operating system via the UART bus, so that the first operating system obtains the state of the second operating system. The first operating system then sends the state of the second operating system to the second device via the first Bluetooth connection.

[0098] In an embodiment of the present application, when the state of the second operating system is sent to the second device via the first Bluetooth connection, the first operating system is controlled to obtain the state of the second operating system, and then the state of the second operating system is sent to the second device via the first Bluetooth connection. In this way, the state of the second operating system can be sent to the second device in real time via the first Bluetooth connection, so that the second device can determine whether to establish a second Bluetooth connection with the second operating system based on the state of the second operating system.

[0099] In one embodiment, Figure 7 As shown, a Bluetooth connection method is provided, including:

[0100] Step 720: After receiving the first Bluetooth connection instruction, the first device controls the first operating system to establish a first Bluetooth connection with the second device via the Bluetooth module in response to the first Bluetooth connection instruction.

[0101] Step 740: Control the first operating system to obtain an operating mode of the first device; the operating modes include a first operating mode, a second operating mode, and a third operating mode; in the first operating mode, the second operating system is in a shutdown state; in the second operating mode, the second operating system is in a running state or a dormant state; in the third operating mode, the second operating system is in a running state;

[0102] Step 760, determining whether the operating mode is the second operating mode or the third operating mode;

[0103] Step 780, when the operating mode is the second operating mode or the third operating mode, execute the step of controlling the first operating system to obtain the status of the second operating system, and sending the status of the second operating system to the second device through the first Bluetooth connection, so that the second device determines whether to establish a second Bluetooth connection with the second operating system according to the status of the second operating system.

[0104] Specific, combined Figure 7 As shown, when establishing a Bluetooth connection between a first device and a second device, the second device sends a first Bluetooth connection instruction to the first device. After receiving the first Bluetooth connection instruction, the first device can respond to the first Bluetooth connection instruction and control the first operating system to establish the first Bluetooth connection with the second device via the Bluetooth module.

[0105] Because the first device 120 is in different operating modes, the second operating system is in different states. For example, the operating modes of the first device 120 include a first operating mode, a second operating mode and a third operating mode, and the first device 120 can switch freely between several different operating modes. Among them, the first operating mode can also be called a light intelligent mode, and the second operating system is in a shutdown state in the first operating mode. The second operating mode can also be called a hybrid mode, and the second operating system is in a running state or a sleep state in the second operating mode. The third operating mode can also be called a high-performance mode, and the second operating system is in a running state in the third operating mode. Among them, the operating mode of the first device can also include more operating modes, which is not limited in this application, and there is a one-to-one correspondence between each operating mode and the state of the second operating system.

[0106] The first device then controls the first operating system to obtain the operating mode of the first device. Specifically, the first device can receive a user operation to switch the operating mode between the first operating mode, the second operating mode, and the third operating mode. When the operating mode is switched to a specific mode, the first operating system receives switching information and records the current operating mode of the first device based on the switching information.

[0107] The first operating system determines whether the current operating mode of the first device is the second operating mode or the third operating mode. If the operating mode is the second operating mode or the third operating mode, the second operating system is in a running state or a dormant state, that is, the state of the second operating system meets the conditions for establishing a second Bluetooth connection, and then the steps of controlling the first operating system to obtain the state of the second operating system and sending the state of the second operating system to the second device through the first Bluetooth connection are executed. That is, if the operating mode is the first operating mode, the second operating system is in a shutdown state, that is, the state of the second operating system does not meet the conditions for establishing a second Bluetooth connection, and then there is no need to execute the steps of controlling the first operating system to obtain the state of the second operating system and sending the state of the second operating system to the second device through the first Bluetooth connection. When the current operating mode of the first device is the first operating mode, there is no need to execute subsequent steps, which can greatly reduce the power consumption of the first device.

[0108] In the embodiment of the present application, because the second operating system is in different states when the first device is in different operating modes, the first operating system can be controlled to obtain the operating mode of the first device. Based on the operating mode of the first device, the state of the second operating system is obtained, and then based on the state of the second operating system, it can be determined whether to perform the subsequent steps of establishing a second Bluetooth connection. When the operating mode is the second operating mode or the third operating mode, the steps of controlling the first operating system to obtain the state of the second operating system and sending the state of the second operating system to the second device through the first Bluetooth connection are performed. That is, when the operating mode is the first operating mode, the above steps do not need to be performed. Starting from the operating mode, the first device can determine whether to perform the subsequent steps of establishing a second Bluetooth connection, thereby triggering the step of establishing a second communication connection in the second operating mode or the third operating mode, and not triggering the step of establishing a second communication connection in the first operating mode, which can reduce the power consumption of the first device to a greater extent.

[0109] In one embodiment, the first processor includes a microcontroller unit (MCU), the second processor includes a system-on-chip (SOC), and the operating power consumption of the first processor is less than that of the second processor.

[0110] Among them, such as Figure 4As shown, it is a hardware framework diagram of the dual system in the first device 120 in one embodiment. The first device 120 includes a system-on-a-chip SOC (System-on-a-Chip) 420, a microcontroller unit MCU (Microcontroller Unit) 440 and a Bluetooth chip 460. Of course, the microcontroller unit MCU can be independent of the system-on-chip SOC, and the microcontroller unit MCU can also be integrated on the system-on-chip SOC, which is not limited in this application. Among them, the first operating system in the dual system can run on the microcontroller unit MCU 440, the second operating system in the dual system can run on the system-on-chip SOC 420, and the Bluetooth chip 460 can realize the function of the Bluetooth module. Among them, the Bluetooth chip 460 can communicate with the microcontroller unit MCU 440 through the UART bus, and then the microcontroller unit MCU 440 communicates with the system-on-chip SOC 420 through the UART bus. For example, the first operating system can be an MCU system, and the second operating system can be an Android system or an IOS system, which is not limited in this application. The system-on-chip SOC has a processor that is independent of the microcontroller unit MCU and can be used to handle different tasks respectively. By Figure 4 It can be seen that since the system-on-chip SOC 420 cannot communicate directly with the Bluetooth chip 460 , it needs to communicate with the Bluetooth chip 460 indirectly through the microcontroller unit MCU 440 .

[0111] In one embodiment, a Bluetooth connection method is provided, which is applied to a second device (mobile phone). The first device (watch) includes a first processor, a second processor, and a Bluetooth module. The first processor and the second processor are communicatively connected, and the Bluetooth module is communicatively connected to the first 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 operating power consumption of the first processor is less than the operating power consumption of the second processor. Figure 8 As shown, the method includes:

[0112] Step 820: In response to the first Bluetooth connection instruction, establish a first Bluetooth connection with the first operating system through the Bluetooth module.

[0113] Here, the first device can be an electronic device running a dual system (dual operating system), such as a smart watch. The first operating system can be run alone on the first device, and the second operating system can also be run at the same time. That is, the first operating system in the electronic device is always running to implement some basic services. And the interface and application of the second operating system running on the first device 120 can be different from the interface and application of the first operating system running on the first device 120.

[0114] The second device is an external device used to establish a Bluetooth connection with the first device. The second device can be a device that supports only a single operating system or a device that supports dual operating systems, and this application does not limit this. For example, the second device is a smartphone, and this application does not limit this.

[0115] When establishing a Bluetooth connection between the second device and the first device, the first device may send a first Bluetooth connection instruction to the second device, or the second device may actively trigger the generation of the first Bluetooth connection instruction. Since the first operating system in the electronic device is always running, the second device can respond to the first Bluetooth connection instruction and establish the first Bluetooth connection with the first operating system through the Bluetooth module in the first device. The first Bluetooth connection instruction is used to instruct the second device to establish the first Bluetooth connection with the first operating system of the first device through the Bluetooth module.

[0116] Step 840: Receive the status of the second operating system sent by the first device through the first Bluetooth connection.

[0117] After the first Bluetooth connection is established between the second device and the first device, the first operating system in the first device can communicate with the second device via Bluetooth via the Bluetooth module. Therefore, the first operating system can obtain the status of the second operating system in the first device and send the status of the second operating system in the first device to the second device via the first Bluetooth connection. In this way, the second device can obtain the status of the second operating system in the first device in real time via the first Bluetooth connection.

[0118] Step 860: Establish a second Bluetooth connection with the second operating system according to the state of the second operating system.

[0119] Furthermore, the second device determines whether to establish a second Bluetooth connection with the second operating system based on the state of the second operating system. That is, when the second operating system in the first device is in a running state or a dormant state, the second device determines that the second operating system on the first device needs to support Bluetooth services, and then the second device determines to establish a second Bluetooth connection with the second operating system of the first device. Here, the second Bluetooth connection established between the second device and the second operating system can be a communication connection established based on the first Bluetooth connection, or it can be a communication connection completely independent of the first Bluetooth connection, and this application does not limit this.

[0120] If the second operating system in the first device is in a shutdown state at this time, the second device determines that the second operating system on the first device does not need to support Bluetooth services, and then the second device determines not to establish a second Bluetooth connection with the second operating system of the first device.

[0121] In an embodiment of the present application, the second device establishes a first Bluetooth connection with the first operating system via the Bluetooth module in response to the first Bluetooth connection instruction. The second device then receives the status of the second operating system sent by the first device via the first Bluetooth connection, and determines whether to establish a second Bluetooth connection with the second operating system based on the status of the second operating system.

[0122] Furthermore, the second device determines, based on the status of the second operating system, whether it is necessary to establish a second Bluetooth connection in addition to the first Bluetooth connection so that the second operating system supports Bluetooth services. Thus, the second device can obtain the status of the second operating system on the first device and determine whether it is necessary to establish a second Bluetooth connection with the first device so that the operating system currently running on the first device can normally support Bluetooth services.

[0123] Continuing from the previous embodiment, a Bluetooth connection method is described, in which a second device, in response to a first Bluetooth connection instruction, establishes a first Bluetooth connection with the first operating system via the Bluetooth module. The second device then receives the status of the second operating system sent by the first device via the first Bluetooth connection, and determines whether to establish a second Bluetooth connection with the second operating system based on the status of the second operating system. This embodiment describes in detail the specific implementation steps for determining whether to establish a second Bluetooth connection with the second operating system based on the status of the second operating system, including:

[0124] When the state of the second operating system is the running state or the dormant state, a second Bluetooth connection is established with the second operating system through the second Bluetooth port on the Bluetooth module.

[0125] The second operating system can transmit the state of the second operating system to the first operating system via the UART bus, so that the first operating system obtains the state of the second operating system. The first operating system then sends the state of the second operating system to the second device via the first Bluetooth connection.

[0126] Specifically, the first device may obtain the status of the second operating system based on the operating mode of the first device. Specifically, the first device may control the first operating system to obtain the operating mode of the first device, and the operating modes include the first operating mode, the second operating mode, and the third operating mode. Since the second operating system is in the shutdown state in the first operating mode; the second operating system is in the running state or the sleep state in the second operating mode; and the second operating system is in the running state in the third operating mode. Therefore, when the operating mode is the second operating mode or the third operating mode, the step of controlling the first operating system to obtain the status of the second operating system and sending the status of the second operating system to the second device through the first Bluetooth connection is executed.

[0127] At this time, the second device receives the status of the second operating system sent by the first device through the first Bluetooth connection. When the second operating system in the first device is in running state or sleep state, the second device determines that the second operating system needs to support Bluetooth services, and then the second device determines to establish a second Bluetooth connection with the second operating system.

[0128] In an embodiment of the present application, the second device receives the status of the second operating system sent by the first device through the first Bluetooth connection. When the second operating system in the first device is in a running state or a dormant state, the second device determines to establish a second Bluetooth connection with the second operating system. In this way, it is possible to ensure that when the second operating system in the first device is in a running state or a dormant state, the application in the second operating system can communicate with the second device through the second Bluetooth connection. This avoids the situation in the traditional method where, when the second operating system in the first device is in a running state or a dormant state, the second Bluetooth connection is not established between the second device and the first device, so that the application in the second operating system in the first device cannot communicate normally with the second device, that is, cannot communicate with the second device through the second Bluetooth connection.

[0129] Continuing from the previous embodiment, the specific implementation steps of determining whether to establish a second Bluetooth connection with the second operating system according to the state of the second operating system are described in detail, including: when the state of the second operating system is the shutdown state, determining not to establish a second Bluetooth connection with the second operating system.

[0130] The second operating system can transmit the state of the second operating system to the first operating system via the UART bus, so that the first operating system obtains the state of the second operating system. The first operating system then sends the state of the second operating system to the second device via the first Bluetooth connection.

[0131] At this time, the second device receives the status of the second operating system sent by the first device through the first Bluetooth connection. When the second operating system in the first device is in the shutdown state, the second device determines that the second operating system does not need to support Bluetooth services, and then the second device determines not to establish a second Bluetooth connection with the second operating system.

[0132] In an embodiment of the present application, the second device receives the status of the second operating system sent by the first device via the first Bluetooth connection. If the second operating system on the first device is in a shutdown state, the second device determines not to establish a second Bluetooth connection with the second operating system. In this way, when the second operating system is in a shutdown state, not establishing a second Bluetooth connection with the second operating system can reduce the power consumption of the first device.

[0133] In a specific embodiment, the first device includes a first processor, a second processor, and a Bluetooth module. The first processor is connected to the second processor for communication, and the Bluetooth module is connected to the first processor for communication. The first processor is used to run a first operating system, and the second processor is used to run a second operating system. The operating power consumption of the first processor is less than the operating power consumption of the second processor. Figure 9 The figure shows a timing diagram of Bluetooth connection when the operating mode of the first device is the light smart mode. When the operating mode of the first device is the light smart mode, a Bluetooth connection method is provided, including:

[0134] Control the first operating system to monitor the first Bluetooth interface and the second Bluetooth interface of the Bluetooth module;

[0135] In response to a first Bluetooth connection instruction, when a first Bluetooth connection instruction sent by the second device is monitored through the first Bluetooth interface, controlling the first operating system to establish a first Bluetooth connection with the second device through the first Bluetooth interface of the Bluetooth module;

[0136] Controlling the first operating system to obtain the operating mode of the first device;

[0137] Determine whether the operating mode is hybrid mode or high-performance mode. If the operating mode is light smart mode, the second device determines not to establish a second Bluetooth connection with the second operating system based on the state of the second operating system (Android system). In light smart mode, the second operating system (Android system) is in a shutdown state; in hybrid mode, the second operating system (Android system) is in a running state or a dormant state; in high-performance mode, the second operating system is in a running state;

[0138] like Figure 10 The figure shows a timing diagram of a Bluetooth connection when the operating mode of the first device is hybrid mode or high-performance mode. When the operating mode of the first device is hybrid mode or high-performance mode, a Bluetooth connection method is provided, including:

[0139] Control the first operating system to monitor the first Bluetooth interface and the second Bluetooth interface of the Bluetooth module;

[0140] In response to a first Bluetooth connection instruction, when a first Bluetooth connection instruction sent by the second device is monitored through the first Bluetooth interface, controlling the first operating system to establish a first Bluetooth connection with the second device through the first Bluetooth interface of the Bluetooth module;

[0141] Controlling the first operating system to obtain the operating mode of the first device;

[0142] sending the operating mode of the first device to the second device via the first Bluetooth connection;

[0143] The second device determines whether the received operating mode is a hybrid mode or a high-performance mode. If the operating mode is a hybrid mode or a high-performance mode, the second device determines the status of the second operating system (Android system) based on the operating mode, and determines to establish a second Bluetooth connection with the second operating system according to the status of the second operating system (Android system).

[0144] In an embodiment of the present application, when the operating mode of the first device is the light intelligent mode, a Bluetooth connection method is provided to control the first operating system to establish a first Bluetooth connection with the second device through the first Bluetooth interface of the Bluetooth module. When the operating mode of the first device is the hybrid mode or the high-performance mode, the first operating system is controlled to establish a first Bluetooth connection with the second device through the first Bluetooth interface of the Bluetooth module. The operating mode of the first device is then sent to the second device through the first Bluetooth connection, and the second device determines the state of the second operating system (Android system) based on the operating mode, and determines to establish a second Bluetooth connection with the second operating system according to the state of the second operating system (Android system). Thus, when the operating mode of the first device is in at least one of the light intelligent mode, hybrid mode, and high-performance mode, the first device can ensure a normal Bluetooth connection between the operating system corresponding to the operating mode and the second device in this operating mode.

[0145] In one embodiment, Figure 11 As shown, a Bluetooth connection device 1100 is provided, which is applied to a first device. The first device includes a first processor, a second processor, and a Bluetooth module. The first processor and the second processor are communicatively connected, and the Bluetooth module is communicatively connected to the first 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 device includes:

[0146] The first control module 1120 is configured to control the first operating system to establish a first Bluetooth connection with the second device via the Bluetooth module in response to the first Bluetooth connection instruction;

[0147] The sending module 1140 is configured to send the state of the second operating system to the second device via the first Bluetooth connection, and control the second device to determine to establish a second Bluetooth connection with the second operating system according to the state of the second operating system.

[0148] In one embodiment, the first control module 1120 includes:

[0149] A first monitoring unit, configured to control the first operating system to monitor a first Bluetooth interface of the Bluetooth module;

[0150] The first Bluetooth connection establishing unit is used to control the first operating system to establish a first Bluetooth connection with the second device through the first Bluetooth interface of the Bluetooth module in response to the first Bluetooth connection instruction when monitoring the first Bluetooth connection instruction sent by the second device through the first Bluetooth interface.

[0151] In one embodiment, the Bluetooth connection device 1100 further includes:

[0152] The second control module 1160 is used to control the second operating system to establish a second Bluetooth connection with the second device through the Bluetooth module in response to a second Bluetooth connection instruction when the second operating system is in a running state or a sleep state; the second Bluetooth connection instruction is an instruction sent by the second device when it determines to establish a second Bluetooth connection with the second operating system based on the state of the second operating system.

[0153] In one embodiment, the second control module 1160 is used to control the second operating system to establish a second Bluetooth connection with the second device through the second Bluetooth interface on the Bluetooth module connected to the first operating system in response to the second Bluetooth connection instruction when the first operating system receives the second Bluetooth connection instruction sent by the second device through the second Bluetooth interface.

[0154] In one embodiment, the Bluetooth connection device 1100 further includes:

[0155] The third control module 1180 controls the second operating system to disconnect the second Bluetooth connection established with the second device through the Bluetooth module when the second operating system is switched from the running state or the dormant state to the shutdown state.

[0156] In one embodiment, the Bluetooth connection device 1100 further includes:

[0157] A first data sending module is configured to control the first operating system to send data of the first operating system to the second device via the first Bluetooth connection; or

[0158] The second data sending module is used to control the first operating system to send the data of the first operating system to the second device through the first Bluetooth connection; and control the first operating system to send the data of the second operating system to the second device through the second Bluetooth connection.

[0159] In one embodiment, the sending module 1140 is configured to control the first operating system to obtain the status of the second operating system; and send the status of the second operating system to the second device via the first Bluetooth connection.

[0160] In one embodiment, the Bluetooth connection device 1100 further includes:

[0161] An operating mode acquisition module is used to control the first operating system to acquire the operating mode of the first device; the operating modes include a first operating mode, a second operating mode, and a third operating mode; in the first operating mode, the second operating system is in a shutdown state; in the second operating mode, the second operating system is in a running state or a dormant state; in the third operating mode, the second operating system is in a running state;

[0162] When the operating mode is the second operating mode or the third operating mode, the step of controlling the first operating system to obtain the status of the second operating system and sending the status of the second operating system to the second device through the first Bluetooth connection is performed.

[0163] In one embodiment, the first processor is a microcontroller unit (MCU), the second processor is a system-on-chip (SOC), and the operating power consumption of the first processor is less than that of the second processor.

[0164] In one embodiment, Figure 12 As shown, a Bluetooth connection device 1200 is provided, which is applied to a second device. The first device includes a first processor, a second processor, and a Bluetooth module. The first processor and the second processor are communicatively connected, and the Bluetooth module is communicatively connected to the first 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 operating power consumption of the first processor is less than the operating power consumption of the second processor. The Bluetooth connection device 1200 includes:

[0165] A first Bluetooth connection establishing module 1220 is configured to establish a first Bluetooth connection with the first operating system via the Bluetooth module in response to a first Bluetooth connection instruction;

[0166] The second operating system status receiving module 1240 is configured to receive the second operating system status sent by the first device through the first Bluetooth connection;

[0167] The second Bluetooth connection establishing module 1260 is configured to establish a second Bluetooth connection with the second operating system according to the state of the second operating system.

[0168] In one embodiment, the second Bluetooth connection establishing module 1260 is configured to establish a second Bluetooth connection with the second operating system through a second Bluetooth port on the Bluetooth module when the second operating system is in a running state or a dormant state.

[0169] In one embodiment, the Bluetooth connection device 1200 further includes:

[0170] The second Bluetooth connection not establishing module is configured to determine not to establish a second Bluetooth connection with the second operating system when the second operating system is in a shutdown state.

[0171] It should be understood that, although the various steps in the flowcharts in the above-mentioned figures are shown in sequence as indicated by the arrows, these steps are not necessarily performed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps may be performed in other orders. Moreover, at least a portion of the steps in the above-mentioned figures may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily performed at the same time, but may be performed at different times, and the execution order of these sub-steps or stages is not necessarily performed in sequence, but may be performed in turn or alternately with at least a portion of other steps or sub-steps or stages of other steps.

[0172] The division of the modules in the above-mentioned Bluetooth connection device is only for illustration. In other embodiments, the Bluetooth connection device may be divided into different modules as needed to complete all or part of the functions of the above-mentioned Bluetooth connection device.

[0173] For the specific definition of the Bluetooth connection device, please refer to the definition of the Bluetooth connection method above and will not be repeated here. Each module in the above-mentioned Bluetooth connection device can be implemented in whole or in part through software, hardware, or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor of the computer device in hardware form, or can be stored in the memory of the computer device in software form, so that the processor can call and execute the corresponding operations of each of the above modules.

[0174] In one embodiment, an electronic device is further provided, including a memory and a processor. The memory stores a computer program. When the computer program is executed by the processor, the processor executes the steps of a Bluetooth connection method provided in the above embodiments.

[0175] In the process of executing a Bluetooth connection method, the processor can perform a sending task with the cooperation of the transmitter. For example, the processor can send an instruction to the transmitter, and the transmitter performs the sending task after receiving the instruction. The processor can also perform a receiving task with the cooperation of the receiver. For example, the processor can send an instruction to the receiver, and the receiver performs the receiving task after receiving the instruction. In addition, the processor can perform a display task with the cooperation of the display. For example, the processor can send a display instruction to the display, and the transmitter performs the display task after receiving the display instruction. Of course, the processor can also perform a variety of tasks with the cooperation of other processing modules, and this application does not limit this.

[0176] Figure 13Schematic diagram of the internal structure of an electronic device in one embodiment. The electronic device can be any terminal device such as a mobile phone, tablet computer, laptop computer, desktop computer, PDA (Personal Digital Assistant), POS (Point of Sales), vehicle-mounted computer, wearable device, etc. The electronic device includes a processor and a memory connected via a system bus. The processor may include one or more processing units. The processor may be a CPU (Central Processing Unit) or a DSP (Digital Signal Processing), etc. The memory may include a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The computer program can be executed by the processor to implement an image processing method provided in each of the following embodiments. The internal memory provides a cached operating environment for the operating system computer program in the non-volatile storage medium.

[0177] The various modules in the Bluetooth connection device provided in the embodiments of the present application may be implemented in the form of a computer program. The computer program may be run on an electronic device or an electronic device. The program modules comprising the computer program may be stored in the memory of the electronic device or an electronic device. When the computer program is executed by a processor, the steps of the method described in the embodiments of the present application are implemented.

[0178] The present application also provides a computer-readable storage medium, one or more non-volatile computer-readable storage media containing computer-executable instructions, which, when executed by one or more processors, cause the processors to perform the steps of the Bluetooth connection method.

[0179] A computer program product comprising instructions, when executed on a computer, causes the computer to perform a Bluetooth connection method.

[0180] Any reference to memory, storage, database or other media used in the embodiments of the present application may include non-volatile or volatile memory. Suitable non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM), which is used as an external cache memory. As an illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0181] The above Bluetooth connection examples represent only a few implementation methods of this application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art could make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of this application. Therefore, the scope of protection of this patent application shall be determined by the appended claims.

Claims

1. A Bluetooth connection method, characterized in that: Applied to a first device, the first device includes a first processor, a second processor, and a Bluetooth module, the first processor and the second processor are communicatively connected, the Bluetooth module is communicatively connected to the first 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 method includes: In response to a first Bluetooth connection instruction, controlling the first operating system to establish a first Bluetooth connection with a second device through the Bluetooth module; The state of the second operating system is sent to the second device through the first Bluetooth connection, so that the second device establishes a second Bluetooth connection with the second operating system according to the state of the second operating system.

2. The method according to claim 1, characterized in that The step of controlling the first operating system to establish a first Bluetooth connection with the second device through the Bluetooth module in response to the first Bluetooth connection instruction includes: Controlling the first operating system to monitor the first Bluetooth interface of the Bluetooth module; When the first Bluetooth interface monitors the first Bluetooth connection instruction sent by the second device, in response to the first Bluetooth connection instruction, the first operating system is controlled to establish a first Bluetooth connection with the second device through the first Bluetooth interface of the Bluetooth module.

3. The method according to claim 1 or 2, characterized in that The method further comprises: When the state of the second operating system is running or sleeping, in response to the second Bluetooth connection instruction, the second operating system is controlled to establish the second Bluetooth connection with the second device through the Bluetooth module; the second Bluetooth connection instruction is an instruction sent by the second device when it determines to establish a second Bluetooth connection with the second operating system based on the state of the second operating system.

4. The method according to claim 3, characterized in that The step of controlling the second operating system to establish the second Bluetooth connection with the second device through the Bluetooth module in response to the second Bluetooth connection instruction includes: When the first operating system receives a second Bluetooth connection instruction sent by the second device through the second Bluetooth interface, in response to the second Bluetooth connection instruction, the second operating system is controlled to establish a second Bluetooth connection with the second device through the second Bluetooth interface on the Bluetooth module connected to the first operating system.

5. The method according to claim 3, characterized in that The method further comprises: When the state of the second operating system is switched from the running state or the dormant state to the shutdown state, the second operating system is controlled to disconnect the second Bluetooth connection established with the second device through the Bluetooth module.

6. The method according to claim 1, characterized in that The sending the state of the second operating system to the second device through the first Bluetooth connection includes: controlling the first operating system to obtain a status of the second operating system; The status of the second operating system is sent to the second device via the first Bluetooth connection.

7. The method according to claim 6, characterized in that Also includes: Controlling the first operating system to obtain an operating mode of the first device; the operating modes include a first operating mode, a second operating mode, and a third operating mode; in the first operating mode, the second operating system is in a shutdown state; In the second operating mode, the second operating system is in a running state or a dormant state; The second operating system is in a running state in the third operating mode; When the operating mode is the second operating mode or the third operating mode, the first operating system is controlled to obtain the status of the second operating system, and the status of the second operating system is sent to the second device through the first Bluetooth connection.

8. The method according to any one of claims 1 to 7, characterized in that The first processor is a microcontroller unit (MCU), and the second processor is a system-on-chip (SOC). The operating power consumption of the first processor is less than that of the second processor.

9. A Bluetooth connection method, characterized in that: Applied to a second device, wherein the first device includes a first processor, a second processor, and a Bluetooth module, the first processor and the second processor are communicatively connected, the Bluetooth module and the first processor are communicatively connected, the first processor is used to run a first operating system, and the second processor is used to run a second operating system; the method includes: In response to a first Bluetooth connection instruction, establishing a first Bluetooth connection with the first operating system through the Bluetooth module; receiving, through the first Bluetooth connection, a status of the second operating system sent by the first device; A second Bluetooth connection is established with the second operating system according to the state of the second operating system.

10. The method according to claim 9, characterized in that The determining, according to the state of the second operating system, to establish a second Bluetooth connection with the second operating system includes: When the state of the second operating system is the running state or the dormant state, a second Bluetooth connection is established with the second operating system through the second Bluetooth port on the Bluetooth module.

11. The method according to claim 9, characterized in that The method further comprises: When the state of the second operating system is the shutdown state, it is determined not to establish a second Bluetooth connection with the second operating system.

12. A Bluetooth connection device, characterized in that: Applied to a first device, the first device includes a first processor, a second processor, and a Bluetooth module, the first processor and the second processor are communicatively connected, the Bluetooth module is communicatively connected to the first processor, the first processor is used to run a first operating system, the second processor is used to run a second operating system, and the operating power consumption of the first processor is less than the operating power consumption of the second processor, the apparatus includes: a first control module, configured to control the first operating system to establish a first Bluetooth connection with a second device via the Bluetooth module in response to a first Bluetooth connection instruction; The sending module is configured to send the state of the second operating system to the second device via the first Bluetooth connection, so that the second device establishes a second Bluetooth connection with the second operating system according to the state of the second operating system.

13. An electronic device comprising a memory, a first processor, and a second processor, wherein a computer program is stored in the memory, wherein: When the computer program is executed by the processor, the first processor and the second processor execute the steps of the Bluetooth connection method according to any one of claims 1 to 8.

14. An electronic device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the computer program is executed by the processor, the processor is caused to perform the steps of the Bluetooth connection method according to any one of claims 9 to 11.

15. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the Bluetooth connection method according to any one of claims 1 to 11 are implemented.

16. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the Bluetooth connection method according to any one of claims 1 to 11 are implemented.

Citation Information

Patent Citations

  • Bluetooth playing method and electronic device

    CN111713141A

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

    CN113056033A