# Patent

## Title
Mobile terminal and power saving method thereof

## Abstract

A mobile terminal and a method are provided for power saving. The mobile terminal monitors changes of data on a UART bus, acquires current operating states of a Bluetooth chip and a main control chip on the mobile terminal, and when detecting that there is no data on the UART bus, the main control chip controls a Bluetooth module to enter into a power saving mode. By adopting the technical scheme described, once it is detected that there is no data on the bus, the Bluetooth module will be enabled to enter into a state of power saving mode immediately, which ensures that the Bluetooth module is always in the state of power saving mode when there is no service ongoing, thereby increasing the standby time of the mobile terminal to the maximum extent, and improving the level of the user experience.

## Background
CROSS-REFERENCE TO RELATED APPLICATION
This application is the U.S. national phase of PCT Appln. No. PCT/CN2012/074446 filed Apr. 20, 2012 which claims priority to Chinese Application No. 201110337454.4 filed Oct. 31, 2011, the disclosures of which are incorporated in their entirety by reference herein.
TECHNICAL FIELD
The present document relates to the field of communication technologies, and in particular, to a mobile terminal and a method for power saving thereof.
BACKGROUND OF THE RELATED ART
The Bluetooth technology is used as a kind of open standard for wireless data and voice communication, it is based on a close range wireless connection with a low cost, which enables the terminal apparatus with a Bluetooth function to realize the seamless sharing of resources in a short range, and therefore, the Bluetooth technology is widely applied in products such as embedded, portable terminals. Such products generally have characteristics such as portability, a small volume etc., has a higher demand on the battery life, and therefore, under the condition of the limited battery capacity, a higher requirement is made on the power consumption of a peripheral module on the product, especially for the Bluetooth module, after the application thereof is started, the Bluetooth chip is always being in an operating mode, including the mobile phone entering into a standby mode, to ensure that the Bluetooth device of the mobile terminal makes a normal response when an external Bluetooth device makes a request with the Bluetooth device of the mobile terminal. This increases additional power consumption of the mobile terminal with no doubt. For the characteristics of the Bluetooth, the present document provides a method for controlling a Bluetooth module of a mobile terminal to enter into a power saving mode, which can ensure that the Bluetooth chip is enabled to enter into the state of power saving mode immediately when there is no data service.
SUMMARY OF THE INVENTION
The purpose of the present document is to provide a method for controlling a Bluetooth module of a mobile terminal to enter into a power saving mode, which ensures that the Bluetooth module of the mobile terminal is enabled to enter into the state of power saving mode immediately when there is no data interaction, and ensures that the Bluetooth is enabled to enter into a power saving mode immediately when there is no service, and the Bluetooth module can recover to a state of normal operating mode when an external Bluetooth device makes a request.
In order to implement the above purpose, the technical scheme of the present document is implemented as follows.
A method for power saving of a mobile terminal, comprising: the mobile terminal monitoring changes of data on a Universal Asynchronous Receiver/Transmitter (UART) bus, acquiring current operating states of a Bluetooth chip and a main control chip on the mobile terminal; and when detecting that there is no data on the UART bus, the main control chip controlling a Bluetooth module to enter into a power saving mode.
Wherein, when there is a Bluetooth event outside, the mobile terminal is awoken, while monitoring a state of the data activities on the UART bus.
Wherein, a corresponding interruption will be generated after the data activity, transmission or reception of the data, on the UART bus is completed, to enter into an interruption process of the UART transmission and reception; and a timer is activated in the interruption process, and thereby the Bluetooth module is controlled to enter into the power saving mode.
Wherein, if the timer expires, whether an ID of the timer is valid and a variable uart_last_acess for identifying whether there are data activities on the UART bus is 1 are determined; if the ID of the timer is invalid and the uart_last_acess is not 1, the Bluetooth module is controlled to enter into the power saving mode.
Wherein, after the Bluetooth module of the mobile terminal enters into the power saving mode, whether the mobile terminal enters into the standby state is detected, if the mobile terminal enters into the standby state, it is determined that the data activities on the UART bus will no longer be monitored.
A mobile terminal, comprising a Bluetooth module, a monitor module and a main control module; wherein,

    
    
        the Bluetooth module is used to communicate with an external Bluetooth device;
        the monitor module is used to monitor a data state on the UART bus and feed the data state to the main control module; and
        the main control module is used to communicate with and control the Bluetooth module; and when the monitor module detects that there is no data on the UART bus, control the Bluetooth module to enter into the power saving mode.
    
    


Wherein, when there is a Bluetooth event outside, the mobile terminal is awoken to monitor the state of the data activities on the UART bus.
Wherein, a corresponding interruption will be generated after the data activity, transmission or reception of the data, on the UART bus is completed, to enter into an interruption process of the UART transmission and reception; and a timer is activated in the interruption process, and thereby the Bluetooth module is controlled by the main control module to enter into the power saving mode.
Wherein, if the timer expires, it is to enter into an interruption process function of expiration of the timer of the monitor module, to determine whether an ID of the timer is valid and a variable uart_last_acess for identifying whether there are data activities on the UART bus is 1; and if the ID of the timer is invalid and the uart_last_acess is not 1, the Bluetooth module is set to enter into the power saving mode.
Wherein, after the Bluetooth module of the mobile terminal enters into the power saving mode, the monitor module is used to detect whether the mobile terminal enters the standby state; and if the mobile terminal enters into the standby state, determine that the data activities on the UART bus will no longer be monitored.
In conclusion, with the present document, there will be following benefit effects.
A method for controlling a Bluetooth module of a mobile terminal to enter into a power saving mode is provided, and with this method, the data on the bus can be monitored in real time and a corresponding operating mode thereof can be set. By adopting this method, once it is detected that there is no data on the bus, the Bluetooth module will be enabled to enter into a state of power saving immediately, which ensures that the Bluetooth module is always in the state of power saving mode when there is no service ongoing, thereby increasing the standby time of the mobile terminal to the maximum extent, and improving the level of the user experience.



BRIEF DESCRIPTION OF DRAWINGS
FIG. 1 is a diagram of a constitution of a mobile terminal according to an embodiment of the present document;
FIG. 2 is a specific procedure of controlling a power saving mode of a Bluetooth module by a main control module according to an embodiment of the present document; and
FIG. 3 is a specific implementation procedure of a monitor module in an embodiment of the present document.



PREFERRED EMBODIMENTS OF THE INVENTION
The present document provides a method for controlling a mobile terminal and power saving thereof, specifically a method for controlling a Bluetooth module of a mobile terminal to enter into a power saving mode, which ensures that the Bluetooth module of the mobile terminal is enabled to enter into the state of power saving mode immediately when there is no data interaction, and ensures that the Bluetooth is enabled to enter into a power saving mode immediately when there is no service, and the Bluetooth module can recover to a state of normal operating mode when an external Bluetooth device makes a request. By this method, the cruising ability of the battery of the mobile terminal can be enhanced and the standby time of the terminal can be increased.
At present, the mode of the communication between the main control chip and the Bluetooth chip is generally performed over a Universal Asynchronous Receiver/Transmitter (UART) bus, and as long as a Bluetooth functional service is in progress, there will be active data on the UART bus, and therefore, the current operating states of the Bluetooth chip and the main control chip can be indirectly acquired by monitoring the change of the data on the UART bus, thus setting the operating mode of the Bluetooth chip. This ensures that the Bluetooth module is enabled to enter into the power saving mode when there is no service ongoing, which avoids unnecessary power consumption by the Bluetooth module.
The technical scheme of the present document includes the following steps.
In step one, the change of the data on the UART bus is monitored in real time by using a monitor module;
In step two, according to the change of the data on the UART bus, the Bluetooth module is controlled to be in a corresponding state of operating mode.
The specific implementation scheme of the monitor module in the above step one is as follows.
When the UART performs data transmission, the processor chip will be notified, by means of interruption, that the transmission or reception of the data is completed, and with this characteristics of the UART, in the interruption process function of the UART transmission and reception, one monitor module is added to control the start of the timer, manage a current state of the timer, to decide whether the timer needs to be started, and whether a corresponding flag needs to be set, after the timer is started, once there is no data on the UART bus and the timer expires, it is to enter into an interruption process function of the expiration, and the main control module is notified that the Bluetooth module can enter into the state of power saving mode.
The specific implementation scheme of the above step two is as follows.
after the Bluetooth function starts, the monitor module is opened and enabled to monitor the state of the UART bus in real time, if there is a Bluetooth service ongoing, data or commands will be transmitted on the UART bus, and the monitor module will detect the change of data on the UART bus, once the data on the UART bus disappears, the monitor module will feeds it back to the main control module immediately, to notify the main control module that the Bluetooth module can enter into the state of power saving mode, the main control module issues a command to the Bluetooth module, the Bluetooth module enters into the power saving state, and when the mobile terminal enters into the standby phase, the monitor module is closed. When an external Bluetooth device makes a request, the main control mode is awoken by the Bluetooth module, and meanwhile, the monitor module is started, to monitor the data on the UART bus.
The technical scheme of the present document will be further described in detail in conjunction with accompanying drawing and specific embodiments hereinafter.
With respect to FIG. 1, a schematic block diagram of a constitution of a mobile terminal according to the present document is illustrated, and as shown in FIG. 1, the mobile terminal according to the present document includes a main control module, a monitor module and a Bluetooth module. Wherein, the main control module is used to communicate with and control the Bluetooth module, the monitor module is used to monitor the state of the data on the UART bus in real time and feed it back to the main control module, and the Bluetooth module is mainly responsible for the communication with an external Bluetooth device, implementing the control on interaction with a baseband chip and voice data transmission through the UART and a PCM interface etc.
The monitor module is a core part for controlling the Bluetooth module to enter into the power saving mode, and is responsible for monitoring the state of the UART bus, and feeding the state back to the main control module in time, the power saving mode of the Bluetooth module is controlled by the main control module, and the specific control procedure is shown in FIG. 2, which comprises the following steps.
In step S201, a Bluetooth function of the mobile terminal is started;
in step S202, the monitor module is enabled;
in step S203, the monitor module monitors the data activities on the UART bus in real time, and if it is detected that there is no data on the UART bus, it is to turn to step S204, and if it is detected that there is data, the monitoring continues;

    
    
        in step S204, once it is detected that there is no data on the UART bus, the information is fed back to the main control module immediately;
        in step S205, the Bluetooth module enters into the power saving mode;
        the main control module transmits a command to the Bluetooth module, to set the Bluetooth module to enter into the state of power saving mode.
    
    


In step S206, whether the mobile terminal enters into the standby state is monitored, if so, it is to turn to step S207, and if not, it is to turn to step S203;
In step S207, once the mobile terminal enters into the standby mode, the monitor module is closed.
When there is a Bluetooth event outside, the mobile terminal is awoken, and meanwhile, the monitor module is enabled, to monitor the state of the data activities on the UART bus.
Wherein, the specific implementation procedure of the monitor module in the above steps is as shown in FIG. 3, which comprises the following steps.
In step S301, after there is a data activity on the UART bus and the transmission or reception of the data is completed, a corresponding interruption will be generated to enter into an interruption process function of the UART transmission and reception;

    
    
        in step S302, it is to enter into the interruption process function, to determine whether the state of the timer is in an activation state;
        in step S303, if the timer is not activated, it needs to start the timer and set the activation flag of the timer as 1;
        in step S304, if the timer is in an activation state at this time, a variable uart_last_acess is set as 1, to identify that there is a data activity on the UART bus;
        in step S305, after the timer is started, once the timer expires, it is to enter into an interruption process function of the expiration of the timer;
        in step S306, the timer is stopped, and meanwhile, the activation flag of the timer is cleared to be 0;
        in step S307, whether the ID of the timer is valid and the uart_last_acess is 1 are determined;
        in step S308, if the ID of the timer is valid and the uart_last_acess is 1, the timer is started and the activation flag of the timer is set as 1, and the uart_last_acess is cleared to be 0;
        in step S309, if the above conditions are not satisfied, it can be determined that there is no active data on the UART bus, and the main control module is notified that there is no data on the UART bus, and the Bluetooth module can enter into the power saving mode;
        in step S310, the main control module controls the Bluetooth module to enter into the power saving mode.
    
    


The technical scheme of the present document can make the Bluetooth module of the mobile terminal enter into the Bluetooth power saving mode rapidly in the case that the basic function is normal when there is no service, thus being able to enhance the standby time of the mobile terminal.
The above description is only preferred embodiments of the present document, and is not used to limit the protection scope of the present document.

## Claims

1. A method for power saving of a mobile terminal, comprising: the mobile terminal monitoring changes of data on a Universal Asynchronous Receiver/Transmitter (UART) bus, acquiring current operating states of a Bluetooth chip and a main control chip on the mobile terminal; and when detecting that there is no data on the UART bus, the main control chip controlling a Bluetooth module to enter into a power saving mode;
wherein, the method further comprising: generating a corresponding interruption after data activities, transmission or reception of the data on the UART bus is completed, to enter into an interruption process of the UART transmission and reception; and activating a timer in the interruption process, thereby controlling the Bluetooth module to enter into the power saving mode according to the state of the timer.

2. The method according to claim 1, further comprising: if the timer expires, determining whether an ID of the timer is valid and whether a variable uart_last_acess for identifying whether there are the data activities on the UART bus is 1; and if the ID of the timer is invalid and the uart_last_acess is not 1, controlling the Bluetooth module to enter into the power saving mode.

3. The method according to claim 1, further comprising: after the Bluetooth module of the mobile terminal enters into the power saving mode, detecting whether the mobile terminal enters into a standby state, and if the mobile terminal enters into the standby state, determining that the data activities on the UART bus is monitored no longer.

4. A mobile terminal, comprising a Bluetooth module, a monitor module and a main control module; wherein,
the Bluetooth module is used to communicate with an external Bluetooth device;
the monitor module is used to monitor a data state on a Universal Asynchronous Receiver/Transmitter (UART) bus and feed the data state to the main control module; and
the main control module is used to communicate with the Bluetooth module and the monitor module and control the Bluetooth module, and when the data state fed by the monitor module is that there is no data on the UART bus, control the Bluetooth module to enter into the power saving mode;
wherein, the monitor module is further used to, generate a corresponding interruption after data activities, transmission or reception of the data, on the UART bus is completed, so as to enter into an interruption process of the UART transmission and reception, and activate a timer in the interruption process; and the main control module is further used to control the Bluetooth module to enter into the power saving mode according to the state of the timer.

5. The mobile terminal according to claim 4, wherein, the monitor module is further used to, if the timer expires, to enter into an interruption process function of expiration of the timer of the monitor module, so as to determine whether an ID of the timer is valid and whether a variable uart_last_acessfor identifying whether there are data activities on the UART bus is 1; and if the ID of the timer is invalid and the uart_last_acess is not 1, notify the main control module to control the Bluetooth module is set to enter into the power saving mode.

6. The mobile terminal according to claim 5, wherein, after the Bluetooth module of the mobile terminal enters into the power saving mode, the monitor module is used to: detect whether the mobile terminal enters into a standby state, and if the mobile terminal enters into the standby state, determine that the data activities on the UART bus is monitored no longer.