A control method and device of a low power bluetooth device
By gradually shutting down the power supply to the CPU, flash memory, and baseband RF module after the Bluetooth device disconnects and restoring the power supply when needed, the problem of high power consumption in traditional low-power Bluetooth devices is solved, realizing a low-power Bluetooth device control method that significantly reduces power consumption, especially in the non-connected state.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGZHOU ANYKA MICROELECTRONICS CO LTD
- Filing Date
- 2024-12-09
- Publication Date
- 2026-06-09
AI Technical Summary
Traditional Bluetooth Low Energy (BLE) devices use a full-stack control module, resulting in high power consumption, especially for devices that are in a non-connected state most of the time, where power loss is significant.
A low-power control method is adopted, which gradually shuts down the power supply of the CPU, flash and baseband RF module according to a preset timing sequence after the Bluetooth connection is disconnected, and restores the power supply of these modules when needed, so as to enter a single-mode control mode and reduce unnecessary power consumption.
It effectively reduces the operating power consumption of Bluetooth devices, especially in non-connected states, significantly enhancing the advantages of low power consumption, while avoiding mutual interference between modules and ensuring normal device operation.
Smart Images

Figure CN122179867A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of Bluetooth technology, and in particular to a control method and apparatus for a low-power Bluetooth device. Background Technology
[0002] As application demands and usage scenarios continue to expand, the Bluetooth Low Energy (BLE) technology standard protocol is also constantly evolving. Bluetooth, as a decentralized piconet self-organizing network, enables quick, easy, and secure short-range instant communication and data exchange between devices. Compared to classic Bluetooth BR / EDR devices, Bluetooth BLE devices have a simpler core protocol design and lower power consumption. As Bluetooth BLE continues to expand in embedded applications, its low-power control and requirements will become increasingly stringent.
[0003] Traditional Bluetooth Low Energy (BLE) devices typically employ a full-stack control module, supporting control functions across all link layers. This requires a large amount of memory, makes the software complex, and results in relatively high power consumption for BLE devices. In particular, for BLE devices that are in a non-connected state most of the time, the full-stack mode leads to a certain amount of power loss. Summary of the Invention
[0004] This application provides a control method and apparatus for a low-power Bluetooth device, which can reduce the operating power consumption of the Bluetooth device. The advantage of low power consumption is even more obvious for Bluetooth devices that are in a non-connected state most of the time.
[0005] In a first aspect, embodiments of this application provide a control method for a low-power Bluetooth device, including:
[0006] When the control module receives a disconnection notification, it starts a timer to obtain the duration of no response. When the duration of no response exceeds the preset switching duration, it sends the first power-off information, the second power-off information, and the third power-off information to the power management module of the Bluetooth device in sequence according to the preset timing, so that the Bluetooth device enters the single-mode control mode.
[0007] When the power management module receives the first power-off information, it stops sending the first voltage signal to the CPU module of the Bluetooth device; when it receives the second power-off information, it stops sending the second voltage signal to the flash module of the Bluetooth device; and when it receives the third power-off information, it stops sending the third voltage signal to the baseband radio frequency module of the Bluetooth device.
[0008] Furthermore, the method also includes:
[0009] After sending the third power-off information, the control module starts the single-mode operation timer to obtain the single-mode operation duration; it determines whether the single-mode operation duration has reached the preset advertising duration; if so, it sends the third power-on information to the power management module; when it receives the RF start information, it sends the advertising operation information to the baseband RF module; when it receives the advertising completion information, it sends the third power-off information to the power management module and resets the single-mode operation duration.
[0010] After receiving the third power-on information, the power management module sends a third voltage signal to the baseband RF module;
[0011] After receiving the third voltage signal, the baseband RF module sends RF start information to the control module; after sending the advertisement according to the received advertisement work information, it sends advertisement completion information to the control module.
[0012] Furthermore, the method also includes:
[0013] In response to the connection request information, the control module obtains the current working status information of the Bluetooth device; based on the current status information, it sends the third power-on information, the second power-on information, or the first power-on information to the power management module; after receiving the CPU startup information, it sends the connection request information to the CPU module.
[0014] After receiving the first power-on information, the power management module sends a first voltage signal to the CPU module; after receiving the second power-on information, it sends a second voltage signal to the flash module.
[0015] After receiving the first voltage signal, the CPU module sends CPU startup information to the control module; it initiates a Bluetooth connection based on the received connection request information; after a successful connection, it sends a connection notification message to the control module; and after a disconnection, it sends a disconnection notification message to the control module.
[0016] Furthermore, the aforementioned sending of the third power-on information, the second power-on information, or the first power-on information to the power management module based on the current status information includes:
[0017] If the current working status information is advertising status information, then the second power-on information and the first power-on information are sent to the power management module in sequence; if the current working status information is sleep status information, then the third power-on information, the second power-on information and the first power-on information are sent to the power management module in sequence.
[0018] Furthermore, the connection request information includes link data, the requesting device address, and the request reception time.
[0019] Furthermore, the method also includes:
[0020] After sending the connection request information to the CPU module, the control module determines whether the Bluetooth connection has timed out based on the Bluetooth clock and the preset connection interval before receiving the connection notification information.
[0021] If yes, then send advertising work information to the baseband radio frequency module; if no, then calculate the most recent packet reception time based on the Bluetooth clock and the preset connection interval; and send the most recent packet reception time to the CPU module.
[0022] The CPU module receives data packets from the device corresponding to the requested device address based on the most recent packet reception time.
[0023] Furthermore, the above-mentioned determination of whether a Bluetooth connection has timed out based on the Bluetooth clock and a preset connection interval includes:
[0024] Obtain the preset offset duration and the preset delay duration of the first data packet from the link data;
[0025] Add the product of the preset offset duration, preset delay duration, preset quantity and preset connection interval to the preset window duration of the Bluetooth device to obtain the judgment threshold;
[0026] Subtract the request reception time from the Bluetooth clock to obtain the duration to be tested;
[0027] If the duration to be tested is greater than or equal to the judgment threshold, the Bluetooth connection times out.
[0028] If the test duration is less than the judgment threshold, the Bluetooth connection has not timed out.
[0029] Furthermore, the preset quantity is 5, and the preset connection interval is greater than or equal to 7.5 milliseconds.
[0030] Furthermore, the calculation of the most recent packet reception time based on the Bluetooth clock and preset connection interval includes:
[0031] The formula for calculating the packet reception time is obtained by adding the request reception time, the preset delay duration, the preset offset duration, and the preset connection interval of the target variable; the target variable is greater than or equal to 0 and less than or equal to 5.
[0032] Calculate the minimum value of the target variable when the most recent packet reception time is greater than or equal to the Bluetooth clock;
[0033] Substituting the minimum value into the formula for calculating the package collection time yields the most recent package collection time.
[0034] Furthermore, the method also includes:
[0035] After sending the third power-on information, the control module deletes the connection request information and the current working status information.
[0036] Secondly, embodiments of this application provide a control device for a low-power Bluetooth device, including a control module and a power management module; the control module is used to start a timer to obtain the no-response duration when receiving a disconnection notification information; and, after the no-response duration exceeds a preset switching duration, to send a first power-off information, a second power-off information and a third power-off information to the power management module of the Bluetooth device in a preset sequence, so as to enable the Bluetooth device to enter a single-mode control mode.
[0037] The power management module is used to stop sending a first voltage signal to the CPU module of the Bluetooth device when it receives a first power-off message; and to stop sending a second voltage signal to the flash module of the Bluetooth device when it receives a second power-off message; and to stop sending a third voltage signal to the baseband radio frequency module of the Bluetooth device when it receives a third power-off message.
[0038] Furthermore, the control module is also used to start the single-mode operation timer after sending the third power-off information to obtain the single-mode operation duration; determine whether the single-mode operation duration has reached the preset advertising duration; if so, send the third power-on information to the power management module; when receiving the RF start information, send the advertising operation information to the baseband RF module; when receiving the advertising completion information, send the third power-off information to the power management module to clear the single-mode operation duration.
[0039] The power management module is also used to send a third voltage signal to the baseband RF module after receiving the third power-on information;
[0040] The baseband RF module is used to send RF start information to the control module after receiving the third voltage signal; and to send advertising completion information to the control module after sending the advertisement according to the received advertising work information.
[0041] Furthermore, the control module is also used to respond to the connection request information, obtain the current working status information of the Bluetooth device; send the third power-on information, the second power-on information, or the first power-on information to the power management module according to the current status information; and send the connection request information to the CPU module after receiving the CPU startup information.
[0042] The power management module is also used to send a first voltage signal to the CPU module after receiving the first power-on information; and to send a second voltage signal to the flash module after receiving the second power-on information.
[0043] The CPU module is also used to send CPU startup information to the control module after receiving the first voltage signal; to establish a Bluetooth connection based on the received connection request information; to send a connection notification message to the control module after a successful connection; and to send a disconnection notification message to the control module after a disconnection.
[0044] Furthermore, the control module is specifically used to send the second power-on information and the first power-on information to the power management module in sequence when the current working status information is advertising status information; and to send the third power-on information, the second power-on information and the first power-on information to the power management module in sequence when the current working status information is sleep status information.
[0045] Furthermore, the control module is also used to determine whether the Bluetooth connection has timed out based on the Bluetooth clock and the preset connection interval after sending the connection request information to the CPU module and before receiving the connection notification information; and, in the case of timeout, to send advertising work information to the baseband radio frequency module; and in the case of no timeout, to calculate the most recent packet reception time based on the Bluetooth clock and the preset connection interval; and to send the most recent packet reception time to the CPU module.
[0046] The CPU module is used to receive data packets from the device corresponding to the requested device address based on the most recent packet reception time.
[0047] In summary, compared with the prior art, the beneficial effects of the technical solution provided in this application include at least the following:
[0048] This application provides a control method for a low-power Bluetooth device. After a preset switching time for the Bluetooth connection is disconnected, the control module sends a first power-off message, a second power-off message, and a third power-off message to the power management module according to a preset timing sequence. This causes the power management module to sequentially stop supplying power to the CPU module, flash module, and baseband RF module in the Bluetooth device based on the received power-off messages. This reduces the operating power consumption of the Bluetooth device while avoiding performance issues in the CPU module and flash module. The advantage of low power consumption is particularly pronounced for Bluetooth devices that are in a non-connected state most of the time. Attached Figure Description
[0049] Figure 1 A flowchart illustrating a control method for a low-power Bluetooth device, provided as an exemplary embodiment of this application.
[0050] Figure 2 A flowchart illustrating the process of entering an advertising state under a single-modal control mode, as provided in an exemplary embodiment of this application.
[0051] Figure 3 A diagram showing the transition relationships of various states in the Bluetooth Low Energy link layer, provided as an exemplary embodiment of this application.
[0052] Figure 4 A flowchart illustrating the process of entering a multimodal control mode based on connection request information, provided as an exemplary embodiment of this application.
[0053] Figure 5This is a schematic diagram illustrating mode switching in single-modal and dual-modal modes, provided as an exemplary embodiment of this application.
[0054] Figure 6 A parameter structure diagram for writing to shared memory is provided as an exemplary embodiment of this application.
[0055] Figure 7 A flowchart illustrating packet reception after Bluetooth connection is provided as an exemplary embodiment of this application.
[0056] Figure 8 A flowchart illustrating a Bluetooth connection timeout determination step provided in an exemplary embodiment of this application.
[0057] Figure 9 A flowchart illustrating the recent packet reception time calculation steps provided in an exemplary embodiment of this application.
[0058] Figure 10 A timeline diagram of Bluetooth connection parameters provided for an exemplary embodiment of this application. Detailed Implementation
[0059] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments.
[0060] Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0061] Please see Figure 1 This application provides a control method for a low-power Bluetooth device, including:
[0062] In step S11, when the control module receives the disconnection notification information, it starts a timer to obtain the no-response duration. When the no-response duration is longer than the preset switching duration, it sends the first power-off information, the second power-off information, and the third power-off information to the power management module of the Bluetooth device in sequence according to the preset timing, so that the Bluetooth device enters the single-mode control mode.
[0063] The preset timing is as follows: first send the first power-off information, then send the second power-off information, and finally send the third power-off information. The time interval between each transmission and the previous transmission is 1-3 milliseconds.
[0064] Specifically, these modules cannot be powered off simultaneously because the various modules in a Bluetooth device have interdependent relationships. For example, the flash module, as a non-volatile storage module, is used to store the device's firmware, configuration data, user data, etc. The CPU module's work often requires accessing data from the flash module. If the flash module is powered off first, while the CPU module is using the flash module's data to perform its workflow, it will affect the CPU module. As for the baseband RF module, it generates significant electromagnetic interference when switching on and off. This electromagnetic interference can easily affect the performance of the flash module, thus indirectly affecting the CPU's operation. Therefore, this application powers off the CPU module first, then the flash module, and finally the baseband RF module to avoid mutual interference when the modules are powered off.
[0065] In step S12, when the power management module receives the first power-off information, it stops sending the first voltage signal to the CPU module of the Bluetooth device; when it receives the second power-off information, it stops sending the second voltage signal to the flash module of the Bluetooth device; and when it receives the third power-off information, it stops sending the third voltage signal to the baseband radio frequency module of the Bluetooth device.
[0066] Understandably, after entering single-mode control mode, only the clock and the memory where the control module's program is running are powered on and working in the Bluetooth device, apart from the control module.
[0067] The control program running in single-mode is simplified to a minimal set of control operations for the Bluetooth BLE chip, which has the outstanding features of small memory requirements, simple and direct operation, and fast running time.
[0068] The above embodiment provides a control method for a low-power Bluetooth device. After a preset switching time for Bluetooth connection disconnection, the control module sends a first power-off message, a second power-off message, and a third power-off message to the power management module according to a preset timing sequence. This causes the power management module to sequentially stop supplying power to the CPU module, flash module, and baseband RF module in the Bluetooth device based on the received power-off messages. This achieves the goal of reducing the operating power consumption of the Bluetooth device while avoiding performance problems in the CPU module and flash module. The advantage of low power consumption is even more obvious for Bluetooth devices that are in a non-connected state most of the time.
[0069] Please see Figure 2 In some embodiments, the method further includes:
[0070] Step S21: After sending the third power-off information, the control module starts the single-mode operation timer to obtain the single-mode operation duration; it determines whether the single-mode operation duration has reached the preset advertising duration; if so, it sends the third power-on information to the power management module; when it receives the RF start information, it sends the advertising operation information to the baseband RF module; when it receives the advertising completion information, it sends the third power-off information to the power management module and clears the single-mode operation duration.
[0071] Specifically, the Bluetooth Low Energy (BLE) link layer, excluding LE Audio state modes, primarily has five operating modes: Advertising, Scanning, Initiating, Connection, and Standby. The switching relationships between these modes are as follows: Figure 3 As shown.
[0072] When a Bluetooth Low Energy (BLE) device operates in single-mode control mode, it needs to periodically enter advertising or scanning mode. In this case, it is only necessary to control the baseband and radio frequency of the Bluetooth device to be powered on and working normally. When the advertising or scanning mode ends, the Bluetooth device can be controlled to enter standby mode. In standby mode, except for the resident memory area required by the single-mode control mode program and the Bluetooth clock with low precision requirements, other modules in the Bluetooth device, such as baseband, radio frequency, flash and CPU, can be powered off, thereby saving the overall power consumption of the chip.
[0073] This can be understood as follows: apart from the clock and memory, in single-mode control mode, Bluetooth devices can only be powered on with hardware modules that can control the Bluetooth Low Energy link layer to enter advertising mode or scanning mode.
[0074] In step S22, after receiving the third power-on information, the power management module sends a third voltage signal to the baseband radio frequency module.
[0075] In step S23, after receiving the third voltage signal, the baseband RF module sends RF start information to the control module; after sending the advertisement according to the received advertisement work information, it sends advertisement completion information to the control module.
[0076] The advertising work information includes the advertising content to be sent and the preset number of channels.
[0077] Specifically, in single-mode control mode, when the control module periodically enters the advertising working state according to the preset advertising duration, after the initialization work of configuring the Bluetooth baseband and radio frequency to power on normally is completed, it can send advertising working information according to the required number of advertising channels, i.e., the preset number of channels. After the baseband radio frequency module completes the sending of advertising information, it can be controlled to enter the power-off state, thereby minimizing the overall operating power consumption of the Bluetooth device.
[0078] The entry and exit of the scanning status are similar to those of the advertising status.
[0079] It can be assumed that Bluetooth connection is not supported in single-mode control mode. Therefore, the CPU module and flash module are always powered off. Since the advertising and scanning modes are not always running, the corresponding hardware modules are only powered on when the device periodically enters the advertising and scanning modes. Most of the time, the Bluetooth device is in sleep mode. The sleep mode in single-mode control mode only requires the clock module and storage control module to run part of the program, which greatly reduces the power consumption required for the Bluetooth device to run during non-connection periods.
[0080] It is worth noting that the baseband RF module does not require additional waiting time to send advertisements in single-mode control mode because the CPU module is powered off at this time. If the CPU is powered on, it needs to detect an interrupt signal to control the next advertisement transmission time. However, in the single-mode control mode of the above embodiment, only the baseband RF module needs to be powered on, without waiting for an interrupt signal, which reduces the working time of the advertisement state and further reduces power consumption.
[0081] Please see Figure 4 In some embodiments, the method further includes:
[0082] In step S31, the control module responds to the connection request information by obtaining the current working status information of the Bluetooth device; sends the third power-on information, the second power-on information, or the first power-on information to the power management module according to the current status information; and sends the connection request information to the CPU module after receiving the CPU startup information.
[0083] The connection request information includes link data, the requesting device address, and the request receiving time.
[0084] The link data is the link layer (LL) data defined by the protocol, the requesting device address is the address of the device that initiated the connection request, and the request reception time includes the local time when the connection request information was received.
[0085] It is worth noting that the request reception time is generated by the Bluetooth device after receiving the link data and the address of the requesting device and is included in the connection request information. As the master device that sends the connection request information, it does not know the request reception time of the slave device.
[0086] This can be understood as follows: when the control module receives a connection request in single-mode control mode, it needs to power on each hardware module in the power-off state so that the Bluetooth device can enter multi-mode control mode.
[0087] Furthermore, the current working status information is mainly determined based on the power-on status of each module: if the control module only sends the third power-on information and the advertising work information, and has not yet received the advertising completion information (i.e., has not sent the third power-off information), it indicates that only the baseband RF module is in the power-on state, and the control module is in the advertising state in single-mode control mode, then the current working status information is the advertising state information; if the control module is in single-mode control mode and has not sent the third power-on information after clearing the single-mode runtime, it indicates that no module is working except for the clock and memory, and the current working status information is the sleep state information; if the control module receives the connection request information, sends the first power-on information, and has not received the disconnection notification information, it indicates that the current working status information is the multi-mode working information.
[0088] If the current working status information is advertising status information, it means that the baseband RF module is currently powered on and does not need to be powered on again. Therefore, the second power-on information and the first power-on information are sent to the power management module in sequence. If the current working status information is sleep status information, it means that the baseband RF module, CPU module and flash are not powered on. Therefore, the third power-on information, the second power-on information and the first power-on information are sent to the power management module in sequence.
[0089] If the current working status information is multimodal working information, and a connection request information is received at this time, it means that the corresponding device is requesting reconnection, and the connection request information can be directly sent to the CPU module.
[0090] In step S32, after receiving the first power-on information, the power management module sends a first voltage signal to the CPU module; after receiving the second power-on information, it sends a second voltage signal to the flash module.
[0091] It is worth noting that the power-on sequence of the hardware modules is completely reversed. The power-off sequence is: CPU module, flash module, baseband RF module, while the power-on sequence is: baseband RF module, flash module, and CPU module.
[0092] The reason for this approach is that the electromagnetic fluctuations generated when the baseband RF module powers on can affect the flash module, and if the CPU module powers on earlier than the flash module, some processes in the CPU module may fail to execute, leading to congestion.
[0093] In step S33, after receiving the first voltage signal, the CPU module sends CPU startup information to the control module; performs Bluetooth connection according to the received connection request information; after successful connection, sends connection notification information to the control module; and after disconnection, sends disconnection notification information to the control module.
[0094] The Bluetooth connection process is a standard connection process and is not within the scope of this application's improvements, so it will not be described in detail here.
[0095] Specifically, after the CPU and flash are powered on, the Bluetooth device enters the multi-mode control mode. At this time, the program of the multi-mode control mode includes the running programs of all working modes of the Bluetooth link layer, as well as the application functions related to the host, including upper-layer application protocols such as hci command, L2CAP protocol, GATT protocol and SMP protocol. The running control logic is more complex, the required running memory is relatively large, and the control operation of the low-power Bluetooth baseband is more complex and needs to be maintained for a longer time.
[0096] In single-mode control, connection request information and current operating status information need to be stored in designated shared memory. In multi-mode control, the connection request information and current operating status information stored in the shared memory during single-mode operation are retrieved from the designated shared memory. The current operating status information is then assessed, and the hardware module is powered on, thus achieving a smooth transition between different modes. The transition between different modes is as follows: Figure 5 As shown. In multimodal control mode, there are time constraints for loading into memory and executing normally. According to the requirement that the Bluetooth connection timeout during the connection establishment phase is 6 connection intervals, the normal startup execution time of multimodal control mode (power-off module re-power-on initialization) must be completed within 38.75ms (calculated with a minimum connection interval of 7.5ms).
[0097] The specific parameter structure for writing to shared memory is as follows: Figure 6 As shown, SoftStatus indicates the status when writing parameters, i.e., the current working status information, while ParamValid indicates whether the currently written information is valid.
[0098] When switching from single-mode control mode in advertising mode to multi-mode control mode, since the low-power Bluetooth baseband and radio frequency are already in a ready state, there is no need to re-initialize the low-power Bluetooth baseband and radio frequency hardware. This speeds up the startup of multi-mode control mode. At the same time, the Bluetooth clock needs to remain continuous during the software switching process to ensure that the Bluetooth connection can be established normally when switching from single-mode control mode to multi-mode control mode.
[0099] The above embodiments execute Bluetooth connection in multimodal control mode because Bluetooth connection is generally not a long-term continuous working state, and Bluetooth connection requires the use of upper-layer application protocols, which not only has a large demand for running memory, but also requires the CPU module to be powered on and working. The corresponding connection control algorithm and operation in the CPU are also more complex and require higher power consumption.
[0100] In some embodiments, please refer to [specific examples]. Figure 7 The method also includes:
[0101] Step S41: After sending the connection request information to the CPU module, the control module determines whether the Bluetooth connection has timed out based on the Bluetooth clock and the preset connection interval before receiving the connection notification information.
[0102] If yes, then send advertising work information to the baseband RF module; if no, then calculate the most recent packet reception time based on the Bluetooth clock and the preset connection interval; and send the most recent packet reception time to the CPU module.
[0103] Specifically, when switching from single-mode control mode to multi-mode control mode, if the current working status information is advertising status information, it means that the baseband and radio frequency of the low-power Bluetooth device are already in a working ready state. At this time, there is no need to re-initialize the low-power Bluetooth baseband and radio frequency hardware. It is only necessary to ensure that the Bluetooth clock remains continuous during the mode switching process to ensure that the Bluetooth connection can be established normally.
[0104] Specifically, determining whether a Bluetooth connection has timed out can be done by checking if the current Bluetooth clock and the request reception time exceed six preset connection intervals (ConnInterval). If the connection times out, an advertising message is sent to wait for the other device to resend the connection request. In multimodal control mode, upon receiving a connection request message, step S41 is executed directly.
[0105] In the event of a Bluetooth connection timeout, the control module of this application controls the baseband radio frequency module to perform an advertising transmission operation in the advertising state. This process can be performed in multi-mode control mode without switching back to single-mode control mode. This is because it can be determined at this time that a connection request information will be received, thus avoiding multiple reads and writes to the shared memory caused by switching back and forth between modes.
[0106] In step S42, the CPU module receives the data packet from the device corresponding to the requested device address based on the most recent packet reception time.
[0107] Specifically, if the connection does not time out, the Bluetooth device is instructed to receive data packets from the requesting device based on the most recent packet reception time after calculating the most recent packet reception time. The most recent packet reception time refers to when the Bluetooth device should start listening for and preparing to receive data packets sent by the requesting device. This process is to ensure that the Bluetooth device receives data within the correct time window. Because BLE communication is time-division multiplexing, the Bluetooth device does not need to keep the radio transceiver on all the time, which saves power consumption.
[0108] After calculating the most recent packet reception time, the CPU module activates the radio transceiver and listens for data packets sent by the other device within a specified window size (WinSize). If a data packet does not arrive before the window closes, the Bluetooth device shuts down the radio transceiver, calculates the next most recent packet reception time, and waits for the next receiving window to open.
[0109] In Bluetooth connection mode, the Bluetooth device will exchange data packets with the device requesting the connection. If no data packet exchange occurs within a preset timeout period, and either party sends a disconnection data packet, the Bluetooth connection will be disconnected, and the device will switch back to single-mode control mode, shutting down modules such as the CPU and flash.
[0110] Please see Figure 8 In some embodiments, the above-mentioned determination of whether a Bluetooth connection has timed out based on the Bluetooth clock and a preset connection interval may specifically include the following steps:
[0111] Step S411: Obtain the preset offset duration and the preset delay duration of the first data packet from the link data.
[0112] Step S412: Add the product of the preset offset duration, preset delay duration, preset quantity, and preset connection interval to the preset window duration of the Bluetooth device to obtain the judgment threshold. The preset connection interval is greater than or equal to 7.5 milliseconds.
[0113] Taking a preset quantity of 5 as an example, the formula for calculating the threshold is:
[0114] WinDelay+Winoffset+5*ConnInterval+WinSize
[0115] WinDelay is a constant value for the delay time specified in the protocol for the Bluetooth device to send the first data packet, i.e., the preset delay duration, which is obtained from the link data sent by the other Bluetooth device.
[0116] Winoffset is a parameter in Bluetooth Low Energy (BLE) technology that defines the offset of a communication window following the CONNECT_REQ command; essentially, it's the preset offset duration. Specifically, Winoffset provides the Bluetooth device with the time to perform relevant configurations after receiving the CONNECT_REQ command. This parameter, measured in 1.25ms units, determines the time window within which the Bluetooth device turns on its radio transceiver to prepare for receiving data packets from the master device. Therefore, Winoffset is one of the key parameters ensuring that the slave device can correctly receive data packets during a BLE connection.
[0117] WinSize is the window duration for which a Bluetooth device activates its transceiver each time; it is the preset window length. Both master and slave devices adhere to the definition of WinSize, which is preset in each Bluetooth device.
[0118] ConnInterval is the Bluetooth connection interval, also measured in 1.25ms.
[0119] Step S413: Subtract the request reception time from the Bluetooth clock to obtain the duration to be tested.
[0120] Specifically, the formula for calculating the duration to be measured is:
[0121] CurrentTime-RecvConnReqTime
[0122] Where CurrentTime is the current Bluetooth clock, and RecvConnReqTime is the time when the Bluetooth device received the connection request information, that is, the request reception time in the connection request information.
[0123] Step S414: If the duration to be tested is greater than or equal to the judgment threshold, the Bluetooth connection timeout occurs.
[0124] Step S415: If the test duration is less than the judgment threshold, the Bluetooth connection has not timed out.
[0125] It is worth noting that the test duration is obtained by the control module based on the Bluetooth clock before receiving the connection notification information. If the test duration is still less than the judgment threshold when the connection notification information is received, the Bluetooth connection has achieved a connection without timeout.
[0126] Please see Figure 9 In some embodiments, the calculation of the most recent packet reception time based on the Bluetooth clock and a preset connection interval may specifically include the following steps:
[0127] Step S421: Add the request receiving time, preset delay duration, preset offset duration, and preset connection interval of the target variable to obtain the calculation formula for the packet receiving time; the target variable is greater than or equal to 0 and less than or equal to 5.
[0128] Specifically, the formula for calculating the package collection time is:
[0129] RecvConnReqTime+WinDelay+Winoffset+Min(i)*ConnInterval>=CurrentTime
[0130] Min(i) is used to calculate the minimum value of the target variable i, where i is a positive integer between [0, 5].
[0131] Step S422: Calculate the minimum value of the target variable when the most recent packet reception time is greater than or equal to the Bluetooth clock.
[0132] Step S423: Substitute the minimum value into the formula for calculating the package receiving time to obtain the most recent package receiving time.
[0133] Since the actual packet transmission time of the other device within the WinSize is unknown, only the start time of the WinSize is considered here. Specifically, the relationship between the parameters for determining whether a Bluetooth connection has timed out is as follows: Figure 10 As shown, Figure 10 The arrow below the time axis in the middle indicates the actual first packet transmission time of the Central end (the other party device) in each connection event. The time axis above indicates the most recent packet reception time and the preset packet reception window WinSize for each connection event before the connection is established on our Bluetooth device. The timeout will occur after the last packet reception time window ends.
[0134] In some embodiments, the method further includes:
[0135] After sending the third power-on information, the control module deletes the connection request information and the current working status information.
[0136] Specifically, when the Bluetooth connection ends, the multi-mode control mode can switch back to the single-mode control mode. At this time, the control module will clear the current working status information and connection request information in the shared memory. That is, the previously saved parameters are all invalid and outdated information, so as to avoid sending incorrect information to the CPU module when establishing a new connection.
[0137] Another embodiment of this application provides a control device for a low-power Bluetooth device, including a control module and a power management module. The control module is used to start a timer to obtain the no-response duration when receiving a disconnection notification message; and after the no-response duration exceeds a preset switching duration, to send a first power-off message, a second power-off message, and a third power-off message to the power management module of the Bluetooth device in a preset sequence, so that the Bluetooth device enters a single-mode control mode.
[0138] The power management module is used to stop sending a first voltage signal to the CPU module of the Bluetooth device when it receives a first power-off message; and to stop sending a second voltage signal to the flash module of the Bluetooth device when it receives a second power-off message; and to stop sending a third voltage signal to the baseband radio frequency module of the Bluetooth device when it receives a third power-off message.
[0139] The preset timing is as follows: first send the first power-off information, then send the second power-off information, and finally send the third power-off information. The time interval between each transmission and the previous transmission is 1-3 milliseconds.
[0140] Specifically, these modules cannot be powered off simultaneously because the various modules in a Bluetooth device have interdependent relationships. For example, the flash module, as a non-volatile storage module, is used to store the device's firmware, configuration data, user data, etc. The CPU module's work often requires accessing data from the flash module. If the flash module is powered off first, while the CPU module is using the flash module's data to perform its workflow, it will affect the CPU module. As for the baseband RF module, it generates significant electromagnetic interference when switching on and off. This electromagnetic interference can easily affect the performance of the flash module, thus indirectly affecting the CPU's operation. Therefore, this application powers off the CPU module first, then the flash module, and finally the baseband RF module to avoid mutual interference when the modules are powered off.
[0141] Understandably, after entering single-mode control mode, only the clock and the memory where the control module's program is running are powered on and working in the Bluetooth device, apart from the control module.
[0142] The control program running in single-mode is simplified to a minimal set of control operations for the Bluetooth BLE chip, which has the outstanding features of small memory requirements, simple and direct operation, and fast running time.
[0143] In some embodiments, the control module is further configured to start a single-mode operation timer after sending the third power-off information to obtain the single-mode operation duration; determine whether the single-mode operation duration has reached the preset advertising duration; if so, send the third power-on information to the power management module; when receiving the radio frequency start information, send the advertising operation information to the baseband radio frequency module; when receiving the advertising completion information, send the third power-off information to the power management module to clear the single-mode operation duration.
[0144] The power management module is also used to send a third voltage signal to the baseband RF module after receiving the third power-on information.
[0145] The baseband RF module is used to send RF start information to the control module after receiving the third voltage signal; and to send advertising completion information to the control module after sending the advertisement according to the received advertising work information.
[0146] When a Bluetooth Low Energy (BLE) device operates in single-mode control mode, it needs to periodically enter advertising or scanning mode. In this case, it is only necessary to control the baseband and radio frequency of the Bluetooth device to be powered on and working normally. When the advertising or scanning mode ends, the Bluetooth device can be controlled to enter standby mode. In standby mode, except for the resident memory area required by the single-mode control mode program and the Bluetooth clock with low precision requirements, other modules in the Bluetooth device, such as baseband, radio frequency, flash and CPU, can be powered off, thereby saving the overall power consumption of the chip.
[0147] This can be understood as follows: apart from the clock and memory, in single-mode control mode, Bluetooth devices can only be powered on with hardware modules that can control the Bluetooth Low Energy link layer to enter advertising mode or scanning mode.
[0148] The advertising work information includes the advertising content to be sent and the preset number of channels.
[0149] Specifically, in single-mode control mode, when the control module periodically enters the advertising working state according to the preset advertising duration, after the initialization work of configuring the Bluetooth baseband and radio frequency to power on normally is completed, it can send advertising working information according to the required number of advertising channels, i.e., the preset number of channels. After the baseband radio frequency module completes the sending of advertising information, it can be controlled to enter the power-off state, thereby minimizing the overall operating power consumption of the Bluetooth device.
[0150] The entry and exit of the scanning status are similar to those of the advertising status.
[0151] It can be assumed that Bluetooth connection is not supported in single-mode control mode. Therefore, the CPU module and flash module are always powered off. Since the advertising and scanning modes are not always running, the corresponding hardware modules are only powered on when the device periodically enters the advertising and scanning modes. Most of the time, the Bluetooth device is in sleep mode. The sleep mode in single-mode control mode only requires the clock module and storage control module to run part of the program, which greatly reduces the power consumption required for the Bluetooth device to run during non-connection periods.
[0152] It is worth noting that the baseband RF module does not require additional waiting time to send advertisements in single-mode control mode because the CPU module is powered off at this time. If the CPU is powered on, it needs to detect an interrupt signal to control the next advertisement transmission time. However, in the single-mode control mode of the above embodiment, only the baseband RF module needs to be powered on, without waiting for an interrupt signal, which reduces the working time of the advertisement state and further reduces power consumption.
[0153] In some embodiments, the control module is further configured to, in response to a connection request message, obtain the current operating status information of the Bluetooth device; send a third power-on message, a second power-on message, or a first power-on message to the power management module according to the current status information; and, upon receiving CPU startup information, send the connection request message to the CPU module.
[0154] Furthermore, the control module is specifically used to send the second power-on information and the first power-on information to the power management module in sequence when the current working status information is advertising status information; and to send the third power-on information, the second power-on information and the first power-on information to the power management module in sequence when the current working status information is sleep status information.
[0155] The power management module is also used to send a first voltage signal to the CPU module after receiving the first power-on information; and to send a second voltage signal to the flash module after receiving the second power-on information.
[0156] The CPU module is also used to send CPU startup information to the control module after receiving the first voltage signal; to establish a Bluetooth connection based on the received connection request information; to send a connection notification message to the control module after a successful connection; and to send a disconnection notification message to the control module after a disconnection.
[0157] The connection request information includes link data, the requesting device address, and the request receiving time.
[0158] The link data is the link layer (LL) data defined by the protocol, the requesting device address is the address of the device that initiated the connection request, and the request reception time includes the local time when the connection request information was received.
[0159] It is worth noting that the request reception time is generated by the Bluetooth device after receiving the link data and the address of the requesting device and is included in the connection request information. As the master device that sends the connection request information, it does not know the request reception time of the slave device.
[0160] This can be understood as follows: when the control module receives a connection request in single-mode control mode, it needs to power on each hardware module in the power-off state so that the Bluetooth device can enter multi-mode control mode.
[0161] The above embodiments execute Bluetooth connection in multimodal control mode because Bluetooth connection is generally not a long-term continuous working state, and Bluetooth connection requires the use of upper-layer application protocols, which not only has a large demand for running memory, but also requires the CPU module to be powered on and working. The corresponding connection control algorithm and operation in the CPU are also more complex and require higher power consumption.
[0162] In some embodiments, the control module is further configured to determine whether the Bluetooth connection has timed out based on the Bluetooth clock and a preset connection interval after sending the connection request information to the CPU module and before receiving the connection notification information; and, in the case of timeout, send advertising work information to the baseband radio frequency module; in the case of no timeout, calculate the most recent packet reception time based on the Bluetooth clock and the preset connection interval; and send the most recent packet reception time to the CPU module.
[0163] The CPU module is used to receive data packets from the device corresponding to the requested device address based on the most recent packet reception time.
[0164] Specifically, when switching from single-mode control mode to multi-mode control mode, if the current working status information is advertising status information, it means that the baseband and radio frequency of the low-power Bluetooth device are already in a working ready state. At this time, there is no need to re-initialize the low-power Bluetooth baseband and radio frequency hardware. It is only necessary to ensure that the Bluetooth clock remains continuous during the mode switching process to ensure that the Bluetooth connection can be established normally.
[0165] Specifically, to determine whether a Bluetooth connection has timed out, you can determine whether the current Bluetooth clock and the request reception time exceed 6 preset connection intervals (ConnInterval).
[0166] If the connection does not time out, the Bluetooth device is instructed to receive data packets from the requesting device based on the most recent packet reception time. The most recent packet reception time refers to when the Bluetooth device should start listening for and preparing to receive data packets sent by the requesting device. This process is to ensure that the Bluetooth device receives data within the correct time window. Because BLE communication is time-division multiplexing, the Bluetooth device does not need to keep the radio transceiver on all the time, which saves power consumption.
[0167] After calculating the most recent packet reception time, the CPU module activates the radio transceiver and listens for data packets sent by the other device within a specified window size (WinSize). If a data packet does not arrive before the window closes, the Bluetooth device shuts down the radio transceiver, calculates the next most recent packet reception time, and waits for the next receiving window to open.
[0168] In Bluetooth connection mode, the Bluetooth device will exchange data packets with the device requesting the connection. If no data packet exchange occurs within a preset timeout period, and either party sends a disconnection data packet, the Bluetooth connection will be disconnected, and the device will switch back to single-mode control mode, shutting down modules such as the CPU and flash.
[0169] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0170] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A control method for a low-power Bluetooth device, characterized in that, include: When the control module receives a disconnection notification, it starts a timer to obtain the duration of no response. When the duration of no response exceeds the preset switching duration, the first power-off information, the second power-off information, and the third power-off information are sent to the power management module of the Bluetooth device in sequence according to the preset timing, so that the Bluetooth device enters the single-mode control mode. When the power management module receives the first power-off information, it stops sending the first voltage signal to the CPU module of the Bluetooth device; when it receives the second power-off information, it stops sending the second voltage signal to the flash module of the Bluetooth device; and when it receives the third power-off information, it stops sending the third voltage signal to the baseband radio frequency module of the Bluetooth device.
2. The control method for a low-power Bluetooth device according to claim 1, characterized in that, Also includes: After sending the third power-off information, the control module starts the single-mode operation timer to obtain the single-mode operation duration; Determine whether the single-mode runtime has reached the preset advertising duration; if so, send a third power-on message to the power management module. Upon receiving the radio frequency start information, advertising work information is sent to the baseband radio frequency module; upon receiving the advertising completion information, the third power-off information is sent to the power management module to clear the single-mode runtime. After receiving the third power-on information, the power management module sends a third voltage signal to the baseband radio frequency module; After receiving the third voltage signal, the baseband RF module sends RF start information to the control module; After sending the advertisement based on the received advertisement work information, an advertisement completion message is sent to the control module.
3. The control method for a low-power Bluetooth device according to claim 2, characterized in that, Also includes: In response to the connection request information, the control module obtains the current working status information of the Bluetooth device; Based on the current status information, send a third power-on message, a second power-on message, or a first power-on message to the power management module; After receiving the CPU startup information, the connection request information is sent to the CPU module; After receiving the first power-on information, the power management module sends a first voltage signal to the CPU module; after receiving the second power-on information, it sends a second voltage signal to the flash module. After receiving the first voltage signal, the CPU module sends CPU startup information to the control module; performs Bluetooth connection according to the received connection request information; after successful connection, sends connection notification information to the control module; and after connection is lost, sends disconnection notification information to the control module.
4. The control method for a low-power Bluetooth device according to claim 3, characterized in that, Sending a third power-on message, a second power-on message, or a first power-on message to the power management module based on the current status information includes: If the current working status information is advertising status information, then the second power-on information and the first power-on information are sent to the power management module in sequence; if the current working status information is sleep status information, then the third power-on information, the second power-on information and the first power-on information are sent to the power management module in sequence.
5. The control method for a low-power Bluetooth device according to claim 3, characterized in that, The connection request information includes link data, the requesting device address, and the request receiving time.
6. The control method for a low-power Bluetooth device according to claim 5, characterized in that, Also includes: After the control module sends the connection request information to the CPU module, but before receiving the connection notification information, it determines whether the Bluetooth connection has timed out based on the Bluetooth clock and the preset connection interval. If yes, then send advertising work information to the baseband radio frequency module; if no, then calculate the most recent packet reception time based on the Bluetooth clock and the preset connection interval. Send the most recent packet reception time to the CPU module; The CPU module receives the data packet from the device corresponding to the requested device address based on the most recent packet reception time.
7. The control method for a low-power Bluetooth device according to claim 6, characterized in that, The method of determining whether a Bluetooth connection has timed out based on the Bluetooth clock and a preset connection interval includes: Obtain the preset offset duration and the preset delay duration of the first data packet from the link data; The judgment threshold is obtained by adding the product of the preset offset duration, the preset delay duration, the preset quantity and the preset connection interval and the preset window duration of the Bluetooth device; Subtract the request reception time from the Bluetooth clock to obtain the test duration; if the test duration is greater than or equal to the judgment threshold, the Bluetooth connection timed out; if the test duration is less than the judgment threshold, the Bluetooth connection did not time out.
8. The control method for a low-power Bluetooth device according to claim 7, characterized in that, The preset quantity is 5, and the preset connection interval is greater than or equal to 7.5 milliseconds.
9. The control method for a low-power Bluetooth device according to claim 8, characterized in that, The calculation of the most recent packet reception time based on the Bluetooth clock and the preset connection interval includes: The packet reception time is calculated by adding the request reception time, the preset delay duration, the preset offset duration, and the preset connection interval of the target variable; the target variable is greater than or equal to 0 and less than or equal to 5. Calculate the minimum value of the target variable when the most recent packet reception time is greater than or equal to the Bluetooth clock; Substituting the minimum value into the formula for calculating the package receiving time yields the most recent package receiving time.
10. The control method for a low-power Bluetooth device according to claim 4, characterized in that, Also includes: After sending the third power-off information, the control module deletes the connection request information and the current working status information.
11. A control device for a low-power Bluetooth device, characterized in that, Includes a control module and a power management module; The control module is used to start a timer when receiving a disconnection notification message to obtain the duration of no response; and after the duration of no response exceeds the preset switching duration, to send the first power-off information, the second power-off information and the third power-off information to the power management module of the Bluetooth device in sequence according to the preset timing, so as to enable the Bluetooth device to enter the single-mode control mode. The power management module is configured to stop sending a first voltage signal to the CPU module of the Bluetooth device when it receives the first power-off information; and to stop sending a second voltage signal to the flash module of the Bluetooth device when it receives the second power-off information; and to stop sending a third voltage signal to the baseband radio frequency module of the Bluetooth device when it receives the third power-off information.