[go: up one dir, main page]

CN106375604B - Method and device for controlling terminal power - Google Patents

Method and device for controlling terminal power Download PDF

Info

Publication number
CN106375604B
CN106375604B CN201610998700.3A CN201610998700A CN106375604B CN 106375604 B CN106375604 B CN 106375604B CN 201610998700 A CN201610998700 A CN 201610998700A CN 106375604 B CN106375604 B CN 106375604B
Authority
CN
China
Prior art keywords
terminal
power consumption
application
duration
power
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610998700.3A
Other languages
Chinese (zh)
Other versions
CN106375604A (en
Inventor
王爱军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN201610998700.3A priority Critical patent/CN106375604B/en
Publication of CN106375604A publication Critical patent/CN106375604A/en
Application granted granted Critical
Publication of CN106375604B publication Critical patent/CN106375604B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72448User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions
    • H04M1/72463User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions to restrict the functionality of the device
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3234Power saving characterised by the action undertaken
    • G06F1/3287Power saving characterised by the action undertaken by switching off individual functional units in the computer system
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Power Sources (AREA)

Abstract

本公开是关于一种控制终端电量的方法和装置,通过确定待使用的目标应用程序,获取该目标应用程序的应用待使用时长以及应用单位耗电量,并获取该终端当前的电量信息,根据该应用待使用时长和该应用单位耗电量以及该电量信息得到该终端当前的待机时长,并根据该应用待使用时长和用户输入的等待时长得到期望待机时长,在该终端当前的待机时长小于或者等于该期望待机时长时,执行省电操作,其中,该省电操作包括降低该终端耗电量的操作。

The present disclosure relates to a method and device for controlling the power of a terminal. By determining the target application program to be used, the application duration of the target application program and the power consumption of the application unit are obtained, and the current power information of the terminal is obtained. The current standby time of the terminal is obtained from the waiting time of the application, the unit power consumption of the application, and the power information, and the expected standby time is obtained according to the waiting time of the application and the waiting time input by the user. When the current standby time of the terminal is less than Or when it is equal to the expected standby time, perform a power saving operation, where the power saving operation includes an operation of reducing power consumption of the terminal.

Description

控制终端电量的方法和装置Method and device for controlling terminal power

技术领域technical field

本公开涉及通信领域,尤其涉及一种控制终端电量的方法和装置。The present disclosure relates to the communication field, and in particular, to a method and device for controlling battery power of a terminal.

背景技术Background technique

随着终端设备的使用率不断提高,在日常生活中,终端通常只显示剩余电量,并且终端随着电量的耗尽而关机,使得用户在有紧急状况的时候,无法根据用户的需求使用终端。As the utilization rate of terminal equipment continues to increase, in daily life, the terminal usually only displays the remaining power, and the terminal shuts down when the power is exhausted, so that the user cannot use the terminal according to the user's needs when there is an emergency.

发明内容Contents of the invention

为克服相关技术中存在的问题,本公开提供一种控制终端电量的方法和装置。In order to overcome the problems existing in related technologies, the present disclosure provides a method and device for controlling terminal power.

根据本公开实施例的第一方面,提供一种控制终端电量的方法,应用于终端,所述方法包括:确定待使用的目标应用程序;获取所述目标应用程序的应用待使用时长以及应用单位耗电量;获取所述终端当前的电量信息;根据所述应用待使用时长和所述应用单位耗电量以及所述电量信息得到所述终端当前的待机时长,并根据所述应用待使用时长和用户输入的等待时长得到期望待机时长;在所述终端当前的待机时长小于或者等于所述期望待机时长时,执行省电操作,其中,所述省电操作包括降低所述终端耗电量的操作。According to the first aspect of the embodiments of the present disclosure, there is provided a method for controlling the power of a terminal, which is applied to a terminal. The method includes: determining the target application program to be used; acquiring the application waiting time and application unit of the target application program power consumption; obtain the current power information of the terminal; obtain the current standby time of the terminal according to the waiting time of the application and the power consumption of the application unit and the power information, and obtain the current standby time of the terminal according to the waiting time of the application and the waiting time input by the user to obtain an expected standby time; when the current standby time of the terminal is less than or equal to the expected standby time, perform a power saving operation, wherein the power saving operation includes reducing the power consumption of the terminal operate.

可选地,所述电量信息包括所述终端当前的剩余电量和待机单位耗电量,所述根据所述应用待使用时长和所述应用单位耗电量以及所述电量信息得到所述终端当前的待机时长包括:根据所述应用待使用时长和所述应用单位耗电量以及所述剩余电量和所述待机单位耗电量得到所述终端当前的待机时长。Optionally, the power information includes the current remaining power of the terminal and the unit power consumption in standby mode, and the terminal current The standby time includes: obtaining the current standby time of the terminal according to the waiting time of the application and the unit power consumption of the application as well as the remaining power and the unit power consumption of the standby.

可选地,所述根据所述应用待使用时长和所述应用单位耗电量以及所述剩余电量和所述待机单位耗电量得到所述终端当前的待机时长包括:通过以下公式得到所述终端当前的待机时长:Optionally, the obtaining the current standby time of the terminal according to the waiting time of the application, the unit power consumption of the application, the remaining power and the unit power consumption of the standby includes: obtaining the The current standby time of the terminal:

Figure BDA0001150910030000021
Figure BDA0001150910030000021

其中,T表示所述终端当前的待机时长;P表示终端当前的剩余电量;Py表示终端当前的待机单位耗电量;Tx表示所述目标应用程序的应用待使用时长;Px表示所述目标应用程序的应用单位耗电量。Wherein, T represents the current standby time of the terminal; P represents the current remaining power of the terminal; P y represents the current standby unit power consumption of the terminal; T x represents the application waiting time of the target application ; Application unit power consumption of the target application described above.

可选地,所述省电操作包括以下至少一个:控制所述终端进入休眠状态和/或关机状态;停止所述终端安装的应用程序。Optionally, the power saving operation includes at least one of the following: controlling the terminal to enter a sleep state and/or a power-off state; stopping an application program installed on the terminal.

可选地,在所述控制所述终端进入休眠状态和/或关机状态前,所述方法还包括:获取终端进入休眠状态时的休眠单位耗电量;所述休眠单位耗电量为所述终端在休眠状态时的单位耗电量;根据所述休眠单位耗电量、所述剩余电量和所述目标应用程序的应用待使用时长以及应用单位耗电量获取所述终端的第一理论休眠时长;确定所述第一理论休眠时长和所述应用待使用时长之和是否大于或者等于所述期望待机时长;所述控制所述终端进入休眠状态和/或关机状态包括:在确定所述第一理论休眠时长和所述应用待使用时长之和大于或者等于所述期望待机时长时,控制所述终端进入休眠状态,且所述休眠状态的休眠时长为所述等待时长;在确定所述第一理论休眠时长和所述应用待使用时长之和小于所述期望待机时长时,获取所述终端开机的开机耗电量和关机的关机耗电量,并得到所述开机耗电量和所述关机耗电量之和,并获取所述应用待使用时长和所述应用单位耗电量的乘积,并根据所述剩余电量与得到的开机耗电量和所述关机耗电量之和的差值以及所述乘积,控制所述终端进入关机操作。Optionally, before controlling the terminal to enter the dormancy state and/or the power-off state, the method further includes: obtaining the dormancy unit power consumption when the terminal enters the dormancy state; the dormancy unit power consumption is the The unit power consumption of the terminal in the dormant state; the first theoretical dormancy of the terminal is obtained according to the unit power consumption of the dormancy, the remaining power, the application waiting time of the target application program, and the unit power consumption of the application duration; determine whether the sum of the first theoretical sleep duration and the application to-be-used duration is greater than or equal to the expected standby duration; the controlling the terminal to enter a sleep state and/or shutdown state includes: determining the first When the sum of a theoretical sleep duration and the application waiting duration is greater than or equal to the expected standby duration, control the terminal to enter a sleep state, and the sleep duration of the sleep state is the waiting duration; When the sum of the theoretical sleep duration and the waiting duration of the application is less than the expected standby duration, obtain the startup power consumption of the terminal and the shutdown power consumption of the shutdown, and obtain the startup power consumption and the The sum of power consumption when the power is turned off, and obtain the product of the waiting time of the application and the unit power consumption of the application, and calculate the power consumption according to the difference between the remaining power and the obtained power consumption when the power is turned on and the power consumption when the power is turned off value and the product to control the terminal to enter a shutdown operation.

可选地,所述根据所述剩余电量与得到的开机耗电量和所述关机耗电量之和的差值以及所述乘积,控制所述终端进入关机操作包括:在所述剩余电量与得到的所述开机耗电量和所述关机耗电量之和的差值大于或者等于所述应用待使用时长和所述应用单位耗电量的乘积时,根据所述剩余电量、所述休眠单位耗电量和所述开机耗电量和所述关机耗电量以及所述应用待使用时长和所述应用单位耗电量获取终端的第二理论休眠时长,根据所述期望待机时长、所述第二理论休眠时长和所述应用待使用时长得到关机时长,并在达到所述关机时长时,启动所述终端,并控制所述终端进入所述休眠状态,且所述休眠状态的休眠时长为所述第二理论休眠时长;在所述剩余电量与得到的所述开机耗电量和所述关机耗电量之和的差值小于所述应用待使用时长和所述应用单位耗电量的乘积时,控制所述终端关机状态,并在达到所述等待时长时,启动所述终端。Optionally, controlling the terminal to enter a shutdown operation according to the difference between the remaining power and the obtained sum of the power consumption of power-on and the power consumption of power-off and the product includes: When the obtained difference between the power consumption of power-on and the power consumption of power-off is greater than or equal to the product of the waiting time of the application and the power consumption of the application unit, according to the remaining power, the sleep The unit power consumption, the startup power consumption, the shutdown power consumption, the application waiting time and the application unit power consumption acquire a second theoretical sleep duration of the terminal, according to the expected standby duration, the The shutdown duration is obtained by the second theoretical sleep duration and the waiting duration of the application, and when the shutdown duration is reached, the terminal is started, and the terminal is controlled to enter the sleep state, and the sleep duration of the sleep state is the second theoretical sleep duration; the difference between the remaining power and the obtained sum of the power consumption of power-on and the power consumption of power-off is less than the duration of the application to be used and the unit power consumption of the application When the product of , the shutdown state of the terminal is controlled, and when the waiting time is reached, the terminal is started.

可选地,所述停止所述终端安装的应用程序包括获取所述终端安装的应用程序的省电优先级;按照所述省电优先级的顺序依次停止所述终端安装的应用程序,直至所述终端当前的待机时长大于用户输入的期望待机时长。Optionally, the stopping the application programs installed on the terminal includes obtaining the power saving priority of the application programs installed on the terminal; stopping the application programs installed on the terminal in sequence according to the order of the power saving priority until the The current standby duration of the terminal is greater than the expected standby duration input by the user.

可选地,所述获取所述终端安装的应用程序的省电优先级包括:获取用户输入的省电优先级;或者,根据所述终端安装的应用程序的应用单位耗电量确定所述省电优先级。Optionally, the obtaining the power saving priority of the application installed on the terminal includes: obtaining the power saving priority input by the user; or, determining the power saving according to the application unit power consumption of the application installed on the terminal. Electric priority.

根据本公开实施例的第二方面,提供一种控制终端电量的装置,所述装置包括第一确定模块,被配置为确定待使用的目标应用程序;第一获取模块,被配置为获取所述目标应用程序的应用待使用时长以及应用单位耗电量;第二获取模块,被配置为获取所述终端当前的电量信息;第三获取模块,被配置为根据所述应用待使用时长和所述应用单位耗电量以及所述电量信息得到所述终端当前的待机时长,并根据所述应用待使用时长和用户输入的等待时长得到期望待机时长;执行模块,被配置为在所述终端当前的待机时长小于或者等于所述期望待机时长时,执行省电操作,其中,所述省电操作包括降低所述终端耗电量的操作。According to the second aspect of the embodiments of the present disclosure, there is provided an apparatus for controlling battery power of a terminal, the apparatus includes a first determination module configured to determine a target application program to be used; a first acquisition module configured to acquire the The duration of the application to be used and the power consumption of the application unit of the target application; the second acquisition module is configured to acquire the current power information of the terminal; the third acquisition module is configured to obtain The unit power consumption of the application and the power information obtain the current standby time of the terminal, and obtain the expected standby time according to the waiting time of the application and the waiting time input by the user; When the standby duration is less than or equal to the expected standby duration, perform a power saving operation, where the power saving operation includes an operation of reducing power consumption of the terminal.

可选地,所述电量信息包括所述终端当前的剩余电量和待机单位耗电量,所述第三获取模块被配置为根据所述应用待使用时长和所述应用单位耗电量以及所述剩余电量和所述待机单位耗电量得到所述终端当前的待机时长。Optionally, the power information includes the current remaining power of the terminal and the unit power consumption of the standby unit, and the third acquisition module is configured to, according to the waiting time of the application, the unit power consumption of the application and the The current standby duration of the terminal is obtained from the remaining power and the standby unit power consumption.

可选地,所述第三获取模块被配置为通过以下公式得到所述终端当前的待机时长:Optionally, the third obtaining module is configured to obtain the current standby duration of the terminal through the following formula:

Figure BDA0001150910030000041
Figure BDA0001150910030000041

其中,T表示所述终端当前的待机时长;P表示终端当前的剩余电量;Py表示终端当前的待机单位耗电量;Tx表示所述目标应用程序的应用待使用时长;Px表示所述目标应用程序的应用单位耗电量。Wherein, T represents the current standby time of the terminal; P represents the current remaining power of the terminal; P y represents the current standby unit power consumption of the terminal; T x represents the application waiting time of the target application ; Application unit power consumption of the target application described above.

可选地,所述省电操作包括以下至少一个:控制所述终端进入休眠状态和/或关机状态;停止所述终端安装的应用程序。Optionally, the power saving operation includes at least one of the following: controlling the terminal to enter a sleep state and/or a power-off state; stopping an application program installed on the terminal.

可选地,所述装置还包括:第四获取模块,被配置为获取终端进入休眠状态时的休眠单位耗电量;所述休眠单位耗电量为所述终端在休眠状态时的单位耗电量;第五获取模块,被配置为根据所述休眠单位耗电量、所述剩余电量和所述目标应用程序的应用待使用时长以及应用单位耗电量获取所述终端的第一理论休眠时长;第二确定模块,被配置为确定所述第一理论休眠时长和所述应用待使用时长之和是否大于或者等于所述期望待机时长;所述执行模块被配置为在确定所述第一理论休眠时长和所述应用待使用时长之和大于或者等于所述期望待机时长时,控制所述终端进入休眠状态,且所述休眠状态的休眠时长为所述等待时长;在确定所述第一理论休眠时长和所述应用待使用时长之和小于所述期望待机时长时,获取所述终端开机的开机耗电量和关机的关机耗电量,并得到所述开机耗电量和所述关机耗电量之和,并获取所述应用待使用时长和所述应用单位耗电量的乘积,并根据所述剩余电量与得到的开机耗电量和所述关机耗电量之和的差值以及所述乘积,控制所述终端进入关机操作。Optionally, the device further includes: a fourth acquiring module configured to acquire the dormant unit power consumption when the terminal enters the dormant state; the dormant unit power consumption is the unit power consumption when the terminal is in the dormant state amount; the fifth acquisition module is configured to acquire the first theoretical sleep duration of the terminal according to the sleep unit power consumption, the remaining power, the application to-be-used duration of the target application program, and the application unit power consumption The second determination module is configured to determine whether the sum of the first theoretical sleep duration and the application to-be-used duration is greater than or equal to the expected standby duration; the execution module is configured to determine the first theoretical When the sum of the dormancy duration and the waiting duration of the application is greater than or equal to the expected standby duration, the terminal is controlled to enter the dormancy state, and the dormancy duration of the dormancy state is the waiting duration; when determining the first theory When the sum of the dormancy duration and the waiting duration of the application is less than the expected standby duration, obtain the startup power consumption of the terminal and the shutdown power consumption of the shutdown, and obtain the startup power consumption and the shutdown power consumption. and obtain the product of the waiting time of the application and the unit power consumption of the application, and according to the difference between the remaining power and the obtained sum of the power consumption of power-on and the power consumption of power-off and The product controls the terminal to enter a shutdown operation.

可选地,所述执行模块被配置为在所述剩余电量与得到的所述开机耗电量和所述关机耗电量之和的差值大于或者等于所述应用待使用时长和所述应用单位耗电量的乘积时,根据所述剩余电量、所述休眠单位耗电量和所述开机耗电量和所述关机耗电量以及所述应用待使用时长和所述应用单位耗电量获取终端的第二理论休眠时长,根据所述期望待机时长、所述第二理论休眠时长和所述应用待使用时长得到关机时长,并在达到所述关机时长时,启动所述终端,并控制所述终端进入所述休眠状态,且所述休眠状态的休眠时长为所述第二理论休眠时长;在所述剩余电量与得到的所述开机耗电量和所述关机耗电量之和的差值小于所述应用待使用时长和所述应用单位耗电量的乘积时,控制所述终端关机状态,并在达到所述等待时长时,启动所述终端。Optionally, the executing module is configured such that when the difference between the remaining power and the obtained sum of the power-on power consumption and the power-off power consumption is greater than or equal to the application to-be-used duration and the application When the product of the unit power consumption is based on the remaining power, the sleep unit power consumption, the power-on power consumption, the power-off power consumption, the waiting time of the application, and the unit power consumption of the application Obtain a second theoretical sleep duration of the terminal, obtain a shutdown duration based on the expected standby duration, the second theoretical sleep duration, and the application to-be-used duration, and start the terminal when the shutdown duration is reached, and control The terminal enters the dormancy state, and the dormancy duration of the dormancy state is the second theoretical dormancy duration; the sum of the remaining power and the obtained power consumption of power-on and power consumption of power-off When the difference is less than the product of the waiting time of the application and the unit power consumption of the application, the terminal is controlled to be powered off, and when the waiting time is reached, the terminal is started.

可选地,所述执行模块包括:获取子模块,被配置为获取所述终端安装的应用程序的省电优先级;停止子模块,被配置为按照所述省电优先级的顺序依次停止所述终端安装的应用程序,直至所述终端当前的待机时长大于用户输入的期望待机时长。Optionally, the execution module includes: an acquisition submodule configured to acquire the power saving priority of the application installed on the terminal; a stop submodule configured to sequentially stop all applications according to the order of the power saving priority The application program installed on the terminal until the current standby time of the terminal is greater than the expected standby time input by the user.

可选地,所述获取子模块被配置为获取用户输入的省电优先级;或者,根据所述终端安装的应用程序的应用单位耗电量确定所述省电优先级。Optionally, the acquiring sub-module is configured to acquire the power saving priority input by the user; or, determine the power saving priority according to the application unit power consumption of the application installed on the terminal.

根据本公开实施例的第三方面,提供一种控制终端电量的装置,其特征在于,所述装置包括处理器;用于存储处理器可执行指令的存储器;其中,所述处理器被配置为确定待使用的目标应用程序;获取所述目标应用程序的应用待使用时长以及应用单位耗电量;获取所述终端当前的电量信息;根据所述应用待使用时长和所述应用单位耗电量以及所述电量信息得到所述终端当前的待机时长,并根据所述应用待使用时长和用户输入的等待时长得到期望待机时长;在所述终端当前的待机时长小于或者等于所述期望待机时长时,执行省电操作,其中,所述省电操作包括降低所述终端耗电量的操作。According to a third aspect of an embodiment of the present disclosure, there is provided an apparatus for controlling terminal power, wherein the apparatus includes a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to Determine the target application program to be used; obtain the application to-be-used duration and application unit power consumption of the target application program; obtain the current power information of the terminal; according to the application to-be-used duration and the application unit power consumption And the battery information obtains the current standby time of the terminal, and obtains the expected standby time according to the waiting time of the application and the waiting time input by the user; when the current standby time of the terminal is less than or equal to the expected standby time , performing a power saving operation, where the power saving operation includes an operation of reducing power consumption of the terminal.

根据本公开实施例的第四方面,提供一种非临时性计算机可读存储介质,当所述存储介质中的指令由移动终端的处理器执行时,使得移动终端能够执行一种控制终端电量的方法,所述方法包括:确定待使用的目标应用程序;获取所述目标应用程序的应用待使用时长以及应用单位耗电量;获取所述终端当前的电量信息;根据所述应用待使用时长和所述应用单位耗电量以及所述电量信息得到所述终端当前的待机时长,并根据所述应用待使用时长和用户输入的等待时长得到期望待机时长;在所述终端当前的待机时长小于或者等于所述期望待机时长时,执行省电操作,其中,所述省电操作包括降低所述终端耗电量的操作。According to the fourth aspect of the embodiments of the present disclosure, there is provided a non-transitory computer-readable storage medium. When the instructions in the storage medium are executed by the processor of the mobile terminal, the mobile terminal can execute a method for controlling the power of the terminal. The method includes: determining the target application program to be used; obtaining the application to-be-used duration and application unit power consumption of the target application; obtaining the current power information of the terminal; according to the application to-be-used duration and The unit power consumption of the application and the power information obtain the current standby duration of the terminal, and obtain the expected standby duration according to the waiting duration of the application and the waiting duration input by the user; when the current standby duration of the terminal is less than or When it is equal to the expected standby time, perform a power saving operation, where the power saving operation includes an operation of reducing power consumption of the terminal.

本公开的实施例提供的技术方案可以包括以下有益效果:通过确定待使用的目标应用程序,可以根据该目标应用程序的使用信息和终端当前的电量信息对终端电量进行控制,从而在终端电量过低时,根据用户对目标应用程序的使用需求进行省电操作,确保用户对目标应用程序的使用。The technical solutions provided by the embodiments of the present disclosure may include the following beneficial effects: by determining the target application program to be used, the terminal power can be controlled according to the usage information of the target application program and the current power information of the terminal, so that when the terminal power is over When the value is low, the power saving operation is performed according to the user's demand for the target application program to ensure the user's use of the target application program.

应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure.

附图说明Description of drawings

此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description serve to explain the principles of the disclosure.

图1是根据一示例性实施例示出的一种控制终端电量的方法的流程图;Fig. 1 is a flow chart of a method for controlling terminal power according to an exemplary embodiment;

图2是根据一示例性实施例示出的又一种控制终端电量的方法的流程图;Fig. 2 is a flow chart showing another method for controlling terminal power according to an exemplary embodiment;

图3是根据一示例性实施例示出的再一种控制终端电量的方法的流程图;Fig. 3 is a flow chart of another method for controlling terminal power according to an exemplary embodiment;

图4是根据一示例性实施例示出的第一种控制终端电量的装置的框图;Fig. 4 is a block diagram of a first device for controlling terminal power according to an exemplary embodiment;

图5是根据一示例性实施例示出的第二种控制终端电量的装置的框图;Fig. 5 is a block diagram of a second device for controlling terminal power according to an exemplary embodiment;

图6是根据一示例性实施例示出的第三种控制终端电量的装置的框图;Fig. 6 is a block diagram of a third device for controlling terminal power according to an exemplary embodiment;

图7是根据一示例性实施例示出的第四种控制终端电量的装置的框图。Fig. 7 is a block diagram of a fourth device for controlling power of a terminal according to an exemplary embodiment.

具体实施方式Detailed ways

这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本公开相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本公开的一些方面相一致的装置和方法的例子。Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numerals in different drawings refer to the same or similar elements unless otherwise indicated. The implementations described in the following exemplary examples do not represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatuses and methods consistent with aspects of the present disclosure as recited in the appended claims.

相关技术中,用户在使用终端(如手机)的过程中,往往会遇到手机电量过低的情况,但此时,用户可能仍然需要使用手机中安装的应用程序,例如,在手机低电量时,用户可能需要在1个小时后通过手机上的会议软件与客户进行视频会议;又如,在手机低电量时,用户可能正处于陌生的地点,需要在30分钟后,使用手机上的导航软件进行导航。但是,由于手机在低电量时,会随着时间的推移电量继续减少,因此,无法保证用户在后续对手机中安装的应用程序的使用。In related technologies, when a user uses a terminal (such as a mobile phone), he often encounters a situation where the power of the mobile phone is too low, but at this time, the user may still need to use the application program installed in the mobile phone, for example, when the battery of the mobile phone is low , the user may need to conduct a video conference with the customer through the conference software on the mobile phone after 1 hour; for another example, when the battery of the mobile phone is low, the user may be in an unfamiliar place and need to use the navigation software on the mobile phone after 30 minutes to navigate. However, since the power of the mobile phone will continue to decrease as time goes by when the battery is low, there is no way to guarantee the user's subsequent use of the applications installed in the mobile phone.

为了解决上述问题,本发明提出了一种控制终端电量的方法和装置,在确定待使用的目标应用程序后,可以根据该目标应用程序的使用信息和终端当前的电量信息对终端电量进行控制,从而在终端电量过低时,根据用户对目标应用程序的使用需求进行省电操作,确保用户对目标应用程序的使用。In order to solve the above problems, the present invention proposes a method and device for controlling the terminal power. After the target application program to be used is determined, the terminal power can be controlled according to the usage information of the target application program and the current power information of the terminal. Therefore, when the power of the terminal is too low, the power saving operation is performed according to the user's requirement for using the target application program, so as to ensure the user's use of the target application program.

下面通过具体实施例对本公开进行详细说明。The present disclosure will be described in detail below through specific embodiments.

图1是根据一示例性实施例示出的一种控制终端电量的方法的流程图,如图1所示,应用于终端中,该方法包括以下步骤:Fig. 1 is a flow chart of a method for controlling terminal power according to an exemplary embodiment. As shown in Fig. 1, it is applied to a terminal, and the method includes the following steps:

在步骤101中,确定待使用的目标应用程序。In step 101, a target application program to be used is determined.

其中,该目标应用程序可以包括用户即将使用的应用程序,用户可以在该终端上设置该目标应用程序,例如,用户需要在1小时后通过手机上的会议软件进行视频会议,则该目标应用程序为该会议软件;又如,用户可能处于陌生的地点,需要在30分钟后使用手机上已安装的导航软件,则该目标应用程序为该导航软件,当然,该目标应用程序还可以是其他用户指定的应用程序,本公开对此不作限定。Wherein, the target application program can include the application program that the user will use soon, and the user can set the target application program on the terminal. is the conference software; for another example, the user may be in an unfamiliar place and needs to use the navigation software installed on the mobile phone after 30 minutes, then the target application is the navigation software. Of course, the target application can also be other users The specified application program is not limited in this disclosure.

在步骤102中,获取该目标应用程序的应用待使用时长以及应用单位耗电量。In step 102, the target application program's application to-be-used duration and application unit power consumption are obtained.

示例地,终端可以获取用户输入的该目标应用程序的应用待使用时长,该应用待使用时长为用户预期的使用时长,继续以上述会议软件和导航软件为例,如用户需要在1小时后使用会议软件进行视频会议,并且使用时长为50分钟,则该应用待使用时长为50分钟;又如,用户需要在30分钟后使用导航软件进行导航,并且使用时长为40分钟,则该应用待使用时长为40分钟。For example, the terminal can obtain the application waiting time input by the user for the target application program, and the application waiting time is the expected using time of the user. Continuing to take the above-mentioned conference software and navigation software as examples, for example, the user needs to use the application after 1 hour. If the conferencing software is used for video conferencing and the duration of use is 50 minutes, then the application duration is 50 minutes; for another example, the user needs to use navigation software for navigation after 30 minutes, and the usage duration is 40 minutes, then the application duration is 50 minutes. The duration is 40 minutes.

其中,该应用单位耗电量可以为目标应用程序在单位时间内的耗电量。Wherein, the unit power consumption of the application may be the power consumption of the target application program in a unit time.

在步骤103中,获取终端当前的电量信息。In step 103, the current power information of the terminal is obtained.

其中,该电量信息包括终端当前的剩余电量和待机单位耗电量。Wherein, the power information includes the current remaining power of the terminal and the power consumption of a standby unit.

在步骤104中,根据该应用待使用时长和该应用单位耗电量以及该电量信息得到该终端当前的待机时长,并根据该应用待使用时长和用户输入的等待时长得到期望待机时长。In step 104, the current standby time of the terminal is obtained according to the waiting time of the application, the unit power consumption of the application and the power information, and the expected standby time is obtained according to the waiting time of the application and the waiting time input by the user.

示例地,终端可以获取用户输入的等待时长,该期望待机时长为该应用待使用时长和该等待时长之和,继续以上述会议软件和导航软件为例,如用户需要在1小时后使用会议软件进行视频会议,并且使用时长为50分钟,则该等待时长为1小时,该期望待机时长为1小时50分钟;又如,用户需要在30分钟后使用导航软件进行导航,并且使用时长为40分钟,则该等待时长为30分钟,该期望待机时长为1小时10分钟。For example, the terminal can obtain the waiting time input by the user. The expected waiting time is the sum of the waiting time of the application and the waiting time. Continuing to take the above conference software and navigation software as examples, for example, the user needs to use the conference software after 1 hour For a video conference, and the usage time is 50 minutes, the waiting time is 1 hour, and the expected standby time is 1 hour and 50 minutes; for another example, the user needs to use navigation software for navigation after 30 minutes, and the usage time is 40 minutes , then the waiting time is 30 minutes, and the expected standby time is 1 hour and 10 minutes.

在步骤105中,在该终端当前的待机时长小于或者等于该期望待机时长时,执行省电操作。In step 105, when the current standby time of the terminal is less than or equal to the expected standby time, a power saving operation is performed.

其中,该省电操作包括降低该终端耗电量的操作。Wherein, the power saving operation includes an operation of reducing power consumption of the terminal.

在本步骤中,该省电操作包括以下至少一个:控制该终端进入休眠状态和/或关机状态;停止该终端安装的应用程序。In this step, the power saving operation includes at least one of the following: controlling the terminal to enter a sleep state and/or shutdown state; stopping the application program installed on the terminal.

采用上述方法,在确定待使用的目标应用程序后,可以根据该目标应用程序的使用信息和终端当前的电量信息对终端电量进行控制,从而在终端电量过低时,根据用户对目标应用程序的使用需求进行省电操作,确保用户对目标应用程序的使用。Using the above method, after determining the target application program to be used, the terminal power can be controlled according to the usage information of the target application program and the current power information of the terminal, so that when the terminal power is too low, according to the user's control of the target application program Use demand for power-saving operations to ensure user usage of target applications.

图2是根据一示例性实施例示出的一种控制终端电量的方法的流程图,如图2所示,应用于终端中,该实施例中的省电操作是以控制终端进入关机状态和/或休眠状态为例进行的说明,该方法包括以下步骤:Fig. 2 is a flowchart of a method for controlling terminal power according to an exemplary embodiment. As shown in Fig. 2, it is applied to a terminal, and the power saving operation in this embodiment is to control the terminal to enter a shutdown state and/or or sleep state as an example, the method includes the following steps:

在步骤201中,确定待使用的目标应用程序。In step 201, a target application program to be used is determined.

其中,该目标应用程序可以包括用户即将使用的应用程序,用户可以在该终端上设置该目标应用程序,例如,用户需要在1小时后通过手机上的会议软件进行视频会议,则该目标应用程序为该会议软件;又如,用户可能处于陌生的地点,需要在30分钟后使用手机上已安装的导航软件,则该目标应用程序为该导航软件,当然,该目标应用程序还可以是其他用户指定的应用程序,本公开对此不作限定。Wherein, the target application program can include the application program that the user will use soon, and the user can set the target application program on the terminal. is the conference software; for another example, the user may be in an unfamiliar place and needs to use the navigation software installed on the mobile phone after 30 minutes, then the target application is the navigation software. Of course, the target application can also be other users The specified application program is not limited in this disclosure.

在步骤202中,获取该目标应用程序的应用待使用时长以及应用单位耗电量。In step 202, the target application program's application to-be-used duration and application unit power consumption are acquired.

示例地,终端可以获取用户输入的该目标应用程序的应用待使用时长,该应用待使用时长为用户预期的使用时长,继续以上述会议软件和导航软件为例,如用户需要在1小时后使用会议软件进行视频会议,并且使用时长为50分钟,则该应用待使用时长为50分钟;又如,用户需要在30分钟后使用导航软件进行导航,并且使用时长为40分钟,则该应用待使用时长为40分钟。For example, the terminal can obtain the application waiting time input by the user for the target application program, and the application waiting time is the expected using time of the user. Continuing to take the above-mentioned conference software and navigation software as examples, for example, the user needs to use the application after 1 hour. If the conferencing software is used for video conferencing and the duration of use is 50 minutes, then the application duration is 50 minutes; for another example, the user needs to use navigation software for navigation after 30 minutes, and the usage duration is 40 minutes, then the application duration is 50 minutes. The duration is 40 minutes.

其中,该应用单位耗电量可以为目标应用程序在单位时间内的耗电量。Wherein, the unit power consumption of the application may be the power consumption of the target application program in a unit time.

在步骤203中,获取终端当前的剩余电量和待机单位耗电量。In step 203, the current remaining battery power and standby unit power consumption of the terminal are acquired.

在步骤204中,根据该应用待使用时长和该应用单位耗电量以及该剩余电量和该待机单位耗电量得到该终端当前的待机时长。In step 204, the current standby time of the terminal is obtained according to the waiting time of the application, the unit power consumption of the application, the remaining power and the power consumption of the standby unit.

在本步骤中,可以通过以下公式得到该终端当前的待机时长:In this step, the current standby time of the terminal can be obtained by the following formula:

其中,T表示终端当前的待机时长;P表示终端当前的剩余电量;Py表示终端当前的待机单位耗电量;Tx表示目标应用程序的应用待使用时长;Px表示目标应用程序的应用单位耗电量。Among them, T represents the current standby time of the terminal; P represents the current remaining power of the terminal; P y represents the current standby power consumption of the terminal; T x represents the waiting time of the target application; P x represents the application of the target application unit power consumption.

在步骤205中,根据该应用待使用时长和用户输入的等待时长得到期望待机时长。In step 205, the expected standby time is obtained according to the waiting time of the application and the waiting time input by the user.

示例地,终端可以获取用户输入的等待时长,该期望待机时长为该应用待使用时长和该等待时长之和,继续以上述会议软件和导航软件为例,如用户需要在1小时后使用会议软件进行视频会议,并且使用时长为50分钟,则该等待时长为1小时,该期望待机时长为1小时50分钟;又如,用户需要在30分钟后使用导航软件进行导航,并且使用时长为40分钟,则该等待时长为30分钟,该期望待机时长为1小时10分钟。For example, the terminal can obtain the waiting time input by the user. The expected waiting time is the sum of the waiting time of the application and the waiting time. Continuing to take the above conference software and navigation software as examples, for example, the user needs to use the conference software after 1 hour For a video conference, and the usage time is 50 minutes, the waiting time is 1 hour, and the expected standby time is 1 hour and 50 minutes; for another example, the user needs to use navigation software for navigation after 30 minutes, and the usage time is 40 minutes , then the waiting time is 30 minutes, and the expected standby time is 1 hour and 10 minutes.

在步骤206中,确定该终端当前的待机时长是否小于或者等于该期望待机时长。In step 206, it is determined whether the current standby time of the terminal is less than or equal to the expected standby time.

在确定该终端当前的待机时长大于该期望待机时长时,说明该终端在保持当前运行状态时,该终端的剩余电量可以保证用户对该目标应用程序的使用,执行步骤207;When it is determined that the current standby time of the terminal is longer than the expected standby time, it means that when the terminal maintains the current running state, the remaining power of the terminal can guarantee the user's use of the target application program, and perform step 207;

在确定该终端当前的待机时长小于或者等于该期望待机时长时,说明终端在保持当前运行状态时,该终端的剩余电量无法保证用户对该目标应用程序的使用,执行步骤208。When it is determined that the current standby time of the terminal is less than or equal to the expected standby time, it means that when the terminal maintains the current running state, the remaining power of the terminal cannot guarantee the user's use of the target application, and step 208 is executed.

在步骤207中,终端保持当前运行状态。In step 207, the terminal maintains the current running state.

在步骤208中,获取终端进入休眠状态时的休眠单位耗电量。In step 208, the sleep unit power consumption when the terminal enters the sleep state is acquired.

其中,该休眠单位耗电量为该终端在休眠状态时的单位耗电量。Wherein, the dormant unit power consumption is the unit power consumption of the terminal in a dormant state.

在步骤209中,根据该休眠单位耗电量、该剩余电量和该目标应用程序的应用待使用时长以及应用单位耗电量获取该终端的第一理论休眠时长。In step 209, a first theoretical sleep duration of the terminal is acquired according to the sleep unit power consumption, the remaining power, the application to-be-used duration of the target application program, and the application unit power consumption.

在本步骤中,可以通过以下公式得到第一理论休眠时长:In this step, the first theoretical sleep duration can be obtained by the following formula:

Figure BDA0001150910030000111
Figure BDA0001150910030000111

其中,T1表示第一理论休眠时长;P表示终端当前的剩余电量;Tx表示该目标应用程序的应用待使用时长;Px表示目标应用程序的应用单位耗电量;P1表示休眠单位耗电量。Among them, T 1 represents the first theoretical sleep duration; P represents the current remaining power of the terminal; T x represents the application waiting time of the target application program; P x represents the application unit power consumption of the target application program; P 1 represents the sleep unit power consumption.

在步骤210中,确定该第一理论休眠时长和该应用待使用时长之和是否大于或者等于该期望待机时长。In step 210, it is determined whether the sum of the first theoretical sleep duration and the application standby duration is greater than or equal to the expected standby duration.

在确定该第一理论休眠时长和该应用待使用时长之和大于或者等于该期望待机时长时,说明该终端通过进入休眠状态减少了电量的消耗,从而节省电量,保证用户在该期望待机时间内对目标应用程序的使用,则执行步骤211;When it is determined that the sum of the first theoretical sleep duration and the application standby duration is greater than or equal to the expected standby duration, it means that the terminal has reduced power consumption by entering the sleep state, thereby saving power and ensuring that the user is within the expected standby time. For the use of the target application program, execute step 211;

在确定该第一理论休眠时长和该应用待使用时长之和小于该期望待机时长时,说明即使该终端进入休眠状态也无法保证用户在该期望待机时间内对目标程序的使用,则执行步骤212至215。When it is determined that the sum of the first theoretical sleep duration and the application standby duration is less than the expected standby duration, it means that even if the terminal enters the sleep state, it cannot guarantee that the user can use the target program within the expected standby time, then perform step 212 to 215.

在步骤211中,控制该终端进入休眠状态。In step 211, the terminal is controlled to enter a sleep state.

其中,该休眠状态的休眠时长为该等待时长。Wherein, the dormant duration of the dormant state is the waiting time.

终端在进入休眠状态后的休眠时长达到该等待时长时,从休眠状态切换为运行状态。When the dormant time after entering the dormant state reaches the waiting time, the terminal switches from the dormant state to the running state.

在步骤212中,获取该终端开机的开机耗电量和关机的关机耗电量。In step 212, the startup power consumption of the terminal and the shutdown power consumption of the terminal are obtained.

在步骤213中,获取该开机耗电量和该关机耗电量之和。In step 213, the sum of the startup power consumption and the shutdown power consumption is obtained.

在步骤214中,获取该目标应用程序的应用待使用时长和应用单位耗电量的乘积。In step 214, the product of the target application's application to-be-used duration and the application's unit power consumption is obtained.

在步骤215中,根据该剩余电量与得到的开机耗电量和该关机耗电量之和的差值以及该乘积,对该终端执行关机操作。In step 215, perform a shutdown operation on the terminal according to the difference between the remaining power, the obtained sum of the power consumption for power-on and the power consumption for power-off, and the product.

在本步骤中,可以通过以下步骤对该终端执行关机操作:In this step, the terminal can be shut down through the following steps:

在步骤S1中、确定该剩余电量与得到的该开机耗电量和该关机耗电量之和的差值是否大于或者等于该应用待使用时长和应用单位耗电量的乘积;In step S1, it is determined whether the difference between the remaining power and the obtained sum of the power consumption of power-on and the power consumption of power-off is greater than or equal to the product of the waiting time of the application and the power consumption of the application unit;

在该剩余电量与得到的该开机耗电量和该关机耗电量之和的差值大于或者等于该应用待使用时长和应用单位耗电量的乘积时,说明该终端的剩余电量在保证用户在该应用待使用时长内对目标应用程序的正常使用的情况下,在该等待时长无法完全维持终端处于休眠状态,因而需要在该等待时长内的部分时间控制该终端进入关机状态,以节约电量,则执行步骤S2至步骤S3;When the difference between the remaining power and the obtained sum of the power consumption of power-on and the power consumption of power-off is greater than or equal to the product of the waiting time of the application and the power consumption of the application unit, it means that the remaining power of the terminal is sufficient to ensure the user In the case of normal use of the target application program during the waiting period of the application, the terminal cannot be completely kept in the dormant state during the waiting period, so it is necessary to control the terminal to enter the shutdown state during a part of the waiting period to save power , then execute step S2 to step S3;

在该剩余电量与得到的该开机耗电量和该关机耗电量之和的差值小于该应用待使用时长和应用单位耗电量的乘积时,说明该终端的剩余电量无法保证用户在该应用待使用时长内对该目标应用程序的正常使用,因而需要在等待时长内控制终端进入关机状态,则执行步骤S4。When the difference between the remaining power and the obtained sum of the startup power consumption and the shutdown power consumption is less than the product of the waiting time of the application and the unit power consumption of the application, it means that the remaining power of the terminal cannot guarantee the For normal use of the target application program within the waiting time period, the terminal needs to be controlled to enter the shutdown state within the waiting time period, and step S4 is performed.

在步骤S2中、根据该剩余电量、该休眠单位耗电量和该开机耗电量和该关机耗电量以及该应用待使用时长和应用单位耗电量获取终端的第二理论休眠时长。In step S2, the second theoretical sleep duration of the terminal is acquired according to the remaining power, the sleep unit power consumption, the power-on power consumption, the power-off power consumption, the application waiting time and the application unit power consumption.

在本步骤中,该第二理论休眠时长可以通过以下公式获得:In this step, the second theoretical sleep duration can be obtained by the following formula:

Figure BDA0001150910030000131
Figure BDA0001150910030000131

其中,T2表示第二理论休眠时长;P表示终端当前的剩余电量;P2表示开机耗电量;P3表示关机耗电量;Tx表示所述目标应用程序的应用待使用时长;Px表示所述目标应用程序的应用单位耗电量;P1表示休眠单位耗电量。Wherein, T 2 represents the second theoretical dormancy duration; P represents the current remaining power of the terminal; P 2 represents power consumption when powering on; P 3 represents power consumption when powering off; T x represents the application duration of the target application program to be used; P x represents the application unit power consumption of the target application; P 1 represents the sleep unit power consumption.

在步骤S3中、根据该期望待机时长、该第二理论休眠时长和该应用待使用时长得到关机时长,并控制终端进入关机状态,在达到该关机时长时,启动该终端,并控制该终端进入该休眠状态,且该休眠状态的休眠时长为该第二理论休眠时长。In step S3, the shutdown duration is obtained according to the expected standby duration, the second theoretical sleep duration, and the application to-be-used duration, and the terminal is controlled to enter the shutdown state. When the shutdown duration is reached, the terminal is started and the terminal is controlled to enter The sleep state, and the sleep duration of the sleep state is the second theoretical sleep duration.

在本步骤中,可以计算得到该第二理论休眠时长和该应用待使用时长之和,并用该期望待机时长减去该第二理论休眠时长和该应用待使用时长之和,得到该关机时长。In this step, the sum of the second theoretical sleep duration and the application standby duration can be calculated, and the expected standby duration is subtracted from the sum of the second theoretical sleep duration and the application standby duration to obtain the shutdown duration.

其中,终端在进入休眠状态后的休眠时长达到该第二理论休眠时长后,从休眠状态切换为运行状态。Wherein, after the sleep duration of the terminal after entering the sleep state reaches the second theoretical sleep duration, the terminal switches from the sleep state to the running state.

需要说明的是,本步骤S3还包括以下实现方式:根据该期望待机时长、该第二理论休眠时长和该应用待使用时长得到关机时长,并控制该终端进入休眠状态,在达到第二理论休眠时长时,控制该终端进入关机状态,在达到该关机时长后,启动该终端。It should be noted that this step S3 also includes the following implementation methods: obtain the shutdown duration according to the expected standby duration, the second theoretical sleep duration, and the application standby duration, and control the terminal to enter the sleep state. When the duration is long, control the terminal to enter the shutdown state, and start the terminal after reaching the shutdown duration.

在步骤S4中、控制该终端进入关机状态,并在达到该等待时长时,启动该终端。In step S4, the terminal is controlled to enter the shutdown state, and when the waiting time is reached, the terminal is started.

这样,在该终端为低电量时,通过进行关机操作节约终端的剩余电量,并设置在该等待时长后开机,以便将全部剩余电量中除开机耗电量和关机耗电量之外的剩余电量都用于用户对该目标应用程序的使用。In this way, when the terminal is low in power, the remaining power of the terminal is saved by shutting down the terminal, and the power is set to be turned on after the waiting time, so that the remaining power of all remaining power except power consumption for power-on and power consumption for power-off are used for the user's use of the target application.

为了提升用户的体验,在一种可能实现的方式中,可以根据该终端的剩余电量和该目标应用程序的应用单位耗电量获取到该目标应用程序的实际待使用时长,并将该实际待使用时长通过提示消息的方式提示用户,从而用户可以根据该实际待使用时长进行该目标应用程序的使用。In order to improve user experience, in a possible implementation manner, the actual waiting time of the target application can be obtained according to the remaining power of the terminal and the application unit power consumption of the target application, and the actual waiting time The usage duration prompts the user by means of a prompt message, so that the user can use the target application program according to the actual duration to be used.

采用上述方法,在确定待使用的目标应用程序后,可以根据该目标应用程序的使用信息和终端的电量信息对终端电量进行控制,从而在终端电量过低时,根据用户对目标应用程序的使用需求控制该终端进入休眠状态和/或关机状态,确保用户对目标应用程序的使用。Using the above method, after the target application program to be used is determined, the terminal power can be controlled according to the usage information of the target application program and the terminal power information, so that when the terminal power is too low, according to the user's use of the target application program It is required to control the terminal to enter a sleep state and/or a power-off state to ensure that the user can use the target application program.

图3是根据一示例性实施例示出的一种控制终端电量的方法的流程图,如图3所示,应用于终端中,该实施例中的省电操作是以停止终端中安装的应用程序为例进行的说明,该方法包括以下步骤:Fig. 3 is a flow chart of a method for controlling terminal power according to an exemplary embodiment. As shown in Fig. 3, it is applied to a terminal, and the power saving operation in this embodiment is to stop the application program installed in the terminal As an example, the method includes the following steps:

在步骤301中,确定待使用的目标应用程序。In step 301, a target application program to be used is determined.

其中,该目标应用程序可以包括用户即将使用的应用程序,用户可以在该终端上设置该目标应用程序,例如,用户需要在1小时后通过手机上的会议软件进行视频会议,则该目标应用程序为该会议软件;又如,用户可能处于陌生的地点,需要在30分钟后使用手机上已安装的导航软件,则该目标应用程序为该导航软件,当然,该目标应用程序还可以是其他用户指定的应用程序,本公开对此不作限定。Wherein, the target application program can include the application program that the user will use soon, and the user can set the target application program on the terminal. is the conference software; for another example, the user may be in an unfamiliar place and needs to use the navigation software installed on the mobile phone after 30 minutes, then the target application is the navigation software. Of course, the target application can also be other users The specified application program is not limited in this disclosure.

在步骤302中,获取该目标应用程序的应用待使用时长以及应用单位耗电量。In step 302, the target application program's application to-be-used duration and application unit power consumption are obtained.

示例地,终端可以获取用户输入的该目标应用程序的应用待使用时长,该应用待使用时长为用户预期的使用时长,继续以上述会议软件和导航软件为例,如用户需要在1小时后使用会议软件进行视频会议,并且使用时长为50分钟,则该应用待使用时长为50分钟;又如,用户需要在30分钟后使用导航软件进行导航,并且使用时长为40分钟,则该应用待使用时长为40分钟。For example, the terminal can obtain the application waiting time input by the user for the target application program, and the application waiting time is the expected using time of the user. Continuing to take the above-mentioned conference software and navigation software as examples, for example, the user needs to use the application after 1 hour. If the conferencing software is used for video conferencing and the duration of use is 50 minutes, then the application duration is 50 minutes; for another example, the user needs to use navigation software for navigation after 30 minutes, and the usage duration is 40 minutes, then the application duration is 50 minutes. The duration is 40 minutes.

其中,该应用单位耗电量可以为目标应用程序在单位时间内的耗电量。Wherein, the unit power consumption of the application may be the power consumption of the target application program in a unit time.

在步骤303中,获取终端当前的剩余电量和待机单位耗电量。In step 303, the current remaining battery power and standby unit power consumption of the terminal are acquired.

在步骤304中,根据该应用待使用时长和该应用单位耗电量以及该剩余电量和该待机单位耗电量得到该终端当前的待机时长。In step 304, the current standby time of the terminal is obtained according to the waiting time of the application, the unit power consumption of the application, the remaining power, and the power consumption of the standby unit.

在本步骤中,通过以下公式计算该终端当前的待机时长:In this step, the current standby time of the terminal is calculated by the following formula:

Figure BDA0001150910030000151
Figure BDA0001150910030000151

其中,T表示所述终端当前的待机时长;P表示终端当前的剩余电量;Py表示终端当前的待机单位耗电量;Tx表示所述目标应用程序的应用待使用时长;Px表示所述目标应用程序的应用单位耗电量。Wherein, T represents the current standby time of the terminal; P represents the current remaining power of the terminal; P y represents the current standby unit power consumption of the terminal; T x represents the application waiting time of the target application ; Application unit power consumption of the target application described above.

在步骤305中,根据该应用待使用时长和用户输入的等待时长得到期望待机时长。In step 305, the expected standby time is obtained according to the waiting time of the application and the waiting time input by the user.

示例地,终端可以获取用户输入的等待时长,该期望待机时长为该应用待使用时长和该等待时长之和,继续以上述会议软件和导航软件为例,如用户需要在1小时后使用会议软件进行视频会议,并且使用时长为50分钟,则该等待时长为1小时,该期望待机时长为1小时50分钟;又如,用户需要在30分钟后使用导航软件进行导航,并且使用时长为40分钟,则该等待时长为30分钟,该期望待机时长为1小时10分钟。For example, the terminal can obtain the waiting time input by the user. The expected waiting time is the sum of the waiting time of the application and the waiting time. Continuing to take the above conference software and navigation software as examples, for example, the user needs to use the conference software after 1 hour For a video conference, and the usage time is 50 minutes, the waiting time is 1 hour, and the expected standby time is 1 hour and 50 minutes; for another example, the user needs to use navigation software for navigation after 30 minutes, and the usage time is 40 minutes , then the waiting time is 30 minutes, and the expected standby time is 1 hour and 10 minutes.

在步骤306中,确定该终端当前的待机时长是否小于或者等于该期望待机时长。In step 306, it is determined whether the current standby time of the terminal is less than or equal to the expected standby time.

在确定该终端当前的待机时长大于该期望待机时长时,说明该终端在保持当前运行状态时,该终端的剩余电量可以保证用户对目标应用程序的使用,执行步骤307;When it is determined that the current standby time of the terminal is longer than the expected standby time, it means that when the terminal maintains the current running state, the remaining power of the terminal can guarantee the user's use of the target application program, and perform step 307;

在确定该终端当前的待机时长小于或者等于该期望待机时长时,说明终端在保持当前运行状态时,该终端的剩余电量无法保证用户对目标应用程序的使用,执行步骤308和步骤309。When it is determined that the current standby time of the terminal is less than or equal to the expected standby time, it means that when the terminal maintains the current running state, the remaining power of the terminal cannot guarantee the use of the target application by the user, and steps 308 and 309 are performed.

在步骤307中,终端保持当前运行状态。In step 307, the terminal maintains the current running state.

在步骤308中,获取该终端安装的应用程序的省电优先级。In step 308, the power saving priority of the application program installed on the terminal is obtained.

其中,该省电优先级可以包括用户输入的省电优先级,或者根据终端中安装的应用程序的应用单位耗电量确定的省电优先级。Wherein, the power saving priority may include the power saving priority input by the user, or the power saving priority determined according to the application unit power consumption of the application program installed in the terminal.

在步骤309中,按照该省电优先级的顺序依次停止该终端安装的应用程序,直至该终端当前的待机时长大于用户输入的期望待机时长。In step 309, the application programs installed on the terminal are sequentially stopped according to the order of the power saving priority until the current standby time of the terminal is greater than the expected standby time input by the user.

其中,可以根据用户输入的省电优先级,例如,可以根据用户的需求将应用程序进行省电优先级排序,从而终端执行省电操作时,可以按照该排序依次关闭该应用程序,直至该终端当前的待机时长大于用户输入的期望待机时长,如用户使用会议软件的频率最高,则可以将终端中的会议软件设置在排序列表的后面,从而在关闭终端安装的应用程序时,可以不优先考虑关闭该会议软件;又如,可以根据终端中安装的应用程序的应用单位耗电量确定该省电优先级,如在终端中安装的应用程序中小米直播的应用单位耗电量最大时,则可以优先关闭小米直播。Among them, according to the power saving priority input by the user, for example, the application programs can be sorted according to the user's needs, so that when the terminal performs the power saving operation, the application programs can be closed in order according to the order until the terminal The current standby time is greater than the expected standby time entered by the user. If the user uses the conference software most frequently, the conference software in the terminal can be set at the back of the sorting list, so that when closing the application installed on the terminal, it does not need to be given priority Close the conference software; as another example, the power saving priority can be determined according to the application unit power consumption of the applications installed in the terminal. Xiaomi live streaming can be turned off first.

采用上述方法,在确定待使用的目标应用程序后,可以根据该目标应用程序的使用信息和终端的电量信息对终端电量进行控制,从而在终端电量过低时,根据用户对目标应用程序的使用需求停止该终端安装的应用程序,确保用户对目标应用程序的使用。Using the above method, after the target application program to be used is determined, the terminal power can be controlled according to the usage information of the target application program and the terminal power information, so that when the terminal power is too low, according to the user's use of the target application program It is necessary to stop the application program installed on the terminal to ensure the user's use of the target application program.

图4是根据一示例性实施例示出的一种控制终端电量的装置的框图。参照图4,该装置包括第一确定模块401,第一获取模块402,第二获取模块403,第三获取模块404和执行模块405。Fig. 4 is a block diagram of an apparatus for controlling battery power of a terminal according to an exemplary embodiment. Referring to FIG. 4 , the device includes a first determination module 401 , a first acquisition module 402 , a second acquisition module 403 , a third acquisition module 404 and an execution module 405 .

该第一确定模块401,被配置为确定待使用的目标应用程序;The first determining module 401 is configured to determine the target application program to be used;

该第一获取模块402,被配置为获取该目标应用程序的应用待使用时长以及应用单位耗电量;The first obtaining module 402 is configured to obtain the application to-be-used duration and application unit power consumption of the target application;

该第二获取模块403,被配置为获取该终端当前的电量信息;The second obtaining module 403 is configured to obtain current power information of the terminal;

该第三获取模块404,被配置为根据该应用待使用时长和该应用单位耗电量以及该电量信息得到该终端当前的待机时长,并根据该应用待使用时长和用户输入的等待时长得到期望待机时长;The third acquisition module 404 is configured to obtain the current standby time of the terminal according to the waiting time of the application, the unit power consumption of the application, and the power information, and obtain the expected waiting time according to the waiting time of the application and the waiting time input by the user. standby time;

该执行模块405,被配置为在该终端当前的待机时长小于或者等于该期望待机时长时,执行省电操作,其中,该省电操作包括降低该终端耗电量的操作。The execution module 405 is configured to execute a power saving operation when the current standby time of the terminal is less than or equal to the expected standby time, wherein the power saving operation includes an operation of reducing power consumption of the terminal.

可选地,该电量信息包括该终端当前的剩余电量和待机单位耗电量,该第三获取模块,被配置为根据该应用待使用时长和该应用单位耗电量以及该剩余电量和该待机单位耗电量得到该终端当前的待机时长。Optionally, the power information includes the terminal's current remaining power and standby unit power consumption, and the third acquisition module is configured to The unit power consumption gets the current standby time of the terminal.

可选地,该第三获取模块,被配置为通过以下公式得到该终端当前的待机时长:Optionally, the third obtaining module is configured to obtain the current standby time of the terminal through the following formula:

Figure BDA0001150910030000171
Figure BDA0001150910030000171

其中,T表示该终端当前的待机时长;P表示终端当前的剩余电量;Py表示终端当前的待机单位耗电量;Tx表示该目标应用程序的应用待使用时长;Px表示该目标应用程序的应用单位耗电量。Among them, T represents the current standby time of the terminal; P represents the current remaining power of the terminal; P y represents the current standby power consumption of the terminal; T x represents the waiting time of the target application; P x represents the target application The application unit power consumption of the program.

可选地,该省电操作包括以下至少一个:控制该终端进入休眠状态和/或关机状态;停止该终端安装的应用程序。Optionally, the power saving operation includes at least one of the following: controlling the terminal to enter a sleep state and/or a power-off state; stopping an application program installed on the terminal.

可选地,图5是图4所示实施例示出的一种控制终端电量的装置的框图,该装置还包括:Optionally, FIG. 5 is a block diagram of an apparatus for controlling terminal power shown in the embodiment shown in FIG. 4, and the apparatus further includes:

第四获取模块406,被配置为获取终端进入休眠状态时的休眠单位耗电量;该休眠单位耗电量为该终端在休眠状态时的单位耗电量;The fourth acquiring module 406 is configured to acquire the dormant unit power consumption when the terminal enters the dormant state; the dormant unit power consumption is the unit power consumption when the terminal is in the dormant state;

第五获取模块407,被配置为根据该休眠单位耗电量、该剩余电量和该目标应用程序的应用待使用时长以及应用单位耗电量获取该终端的第一理论休眠时长;The fifth obtaining module 407 is configured to obtain the first theoretical sleep duration of the terminal according to the sleep unit power consumption, the remaining power, the application waiting time of the target application program, and the application unit power consumption;

第二确定模块408,被配置为确定该第一理论休眠时长和该应用待使用时长之和是否大于或者等于该期望待机时长。The second determination module 408 is configured to determine whether the sum of the first theoretical sleep duration and the application standby duration is greater than or equal to the expected standby duration.

该执行模块被配置为在确定该第一理论休眠时长和该应用待使用时长之和大于或者等于该期望待机时长时,控制该终端进入休眠状态,且该休眠时长为该等待时长;在确定该第一理论休眠时长和该应用待使用时长之和小于该期望待机时长时,获取该终端开机的开机耗电量和关机的关机耗电量,并得到该开机耗电量和该关机耗电量之和,并获取该应用待使用时长和应用单位耗电量的乘积,并根据该剩余电量与得到的开机耗电量和该关机耗电量之和的差值以及该乘积,控制该终端进入关机操作。The execution module is configured to control the terminal to enter a sleep state when it is determined that the sum of the first theoretical sleep duration and the application standby duration is greater than or equal to the expected standby duration, and the sleep duration is the waiting duration; When the sum of the first theoretical dormancy duration and the application standby duration is less than the expected standby duration, obtain the startup power consumption of the terminal and the shutdown power consumption of the terminal, and obtain the startup power consumption and the shutdown power consumption and obtain the product of the waiting time of the application and the unit power consumption of the application, and control the terminal to enter the Shutdown operation.

可选地,该执行模块被配置为在该剩余电量与得到的该开机耗电量和该关机耗电量之和的差值大于或者等于该应用待使用时长和应用单位耗电量的乘积时,根据该剩余电量、该休眠单位耗电量和该开机耗电量和该关机耗电量以及该应用待使用时长和应用单位耗电量获取终端的第二理论休眠时长,根据该期望待机时长、该第二理论休眠时长和该应用待使用时长得到关机时长,并在达到该关机时长时,启动该终端,并控制该终端进入该休眠状态,且该休眠状态的休眠时长为该第二理论休眠时长;在终端的剩余电量与得到的该开机耗电量和该关机耗电量之和的差值小于该应用待使用时长和应用单位耗电量的乘积时,控制该终端关机状态,并在达到该等待时长时,启动该终端。Optionally, the execution module is configured to: when the difference between the remaining power and the obtained sum of the power consumption on startup and the power consumption on shutdown is greater than or equal to the product of the waiting time of the application and the unit power consumption of the application , obtain the second theoretical sleep duration of the terminal according to the remaining power, the sleep unit power consumption, the power-on power consumption, the power-off power consumption, the application waiting time and the application unit power consumption, and according to the expected standby time 1. The second theoretical dormancy duration and the application to-be-used duration obtain the shutdown duration, and when the shutdown duration is reached, start the terminal and control the terminal to enter the dormancy state, and the dormancy duration of the dormancy state is the second theoretical dormancy duration Sleep duration; when the difference between the remaining power of the terminal and the sum of the power consumption of the startup and the power consumption of the shutdown is less than the product of the waiting time of the application and the power consumption of the application unit, control the shutdown state of the terminal, and When the waiting time is reached, start the terminal.

可选地,图6是图4所示实施例示出的一种控制终端电量的装置的框图,该执行模块405还包括:Optionally, FIG. 6 is a block diagram of an apparatus for controlling terminal power shown in the embodiment shown in FIG. 4 , and the execution module 405 further includes:

获取子模块4051,被配置为获取该终端安装的应用程序的省电优先级;The obtaining submodule 4051 is configured to obtain the power saving priority of the application program installed on the terminal;

停止子模块4052,被配置为按照该省电优先级的顺序依次停止该终端安装的应用程序,直至该终端当前的待机时长大于用户输入的期望待机时长。The stop submodule 4052 is configured to stop the application programs installed on the terminal sequentially according to the order of the power saving priority until the current standby time of the terminal is greater than the expected standby time input by the user.

可选地,该获取子模块4051被配置为获取用户输入的省电优先级;或者,根据该终端安装的应用程序的应用单位耗电量确定该省电优先级。Optionally, the obtaining sub-module 4051 is configured to obtain the power saving priority input by the user; or, determine the power saving priority according to the application unit power consumption of the application installed on the terminal.

关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。Regarding the apparatus in the foregoing embodiments, the specific manner in which each module executes operations has been described in detail in the embodiments related to the method, and will not be described in detail here.

图7是根据一示例性实施例示出的一种用于控制终端电量的装置700的框图。例如,装置700可以是移动电话,计算机,数字广播终端,消息收发设备,游戏控制台,平板设备,医疗设备,健身设备,个人数字助理等。Fig. 7 is a block diagram of an apparatus 700 for controlling battery power of a terminal according to an exemplary embodiment. For example, the apparatus 700 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, and the like.

参照图7,装置700可以包括以下一个或多个组件:处理组件702,存储器704,电力组件706,多媒体组件708,音频组件710,输入/输出(I/O)的接口712,传感器组件714,以及通信组件716。7, device 700 may include one or more of the following components: processing component 702, memory 704, power component 706, multimedia component 708, audio component 710, input/output (I/O) interface 712, sensor component 714, and communication component 716 .

处理组件702通常控制装置700的整体操作,诸如与显示,电话呼叫,数据通信,相机操作和记录操作相关联的操作。处理组件702可以包括一个或多个处理器720来执行指令,以完成上述控制终端电量的方法的全部或部分步骤。此外,处理组件702可以包括一个或多个模块,便于处理组件702和其他组件之间的交互。例如,处理组件702可以包括多媒体模块,以方便多媒体组件708和处理组件702之间的交互。The processing component 702 generally controls the overall operations of the device 700, such as those associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 702 may include one or more processors 720 to execute instructions, so as to complete all or part of the steps of the above-mentioned method for controlling battery power of a terminal. Additionally, processing component 702 may include one or more modules that facilitate interaction between processing component 702 and other components. For example, processing component 702 may include a multimedia module to facilitate interaction between multimedia component 708 and processing component 702 .

存储器704被配置为存储各种类型的数据以支持在装置700的操作。这些数据的示例包括用于在装置700上操作的任何应用程序或方法的指令,联系人数据,电话簿数据,消息,图片,视频等。存储器704可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。The memory 704 is configured to store various types of data to support operations at the device 700 . Examples of such data include instructions for any application or method operating on device 700, contact data, phonebook data, messages, pictures, videos, and the like. The memory 704 can be realized by any type of volatile or non-volatile storage device or their combination, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable Programmable Read Only Memory (EPROM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Magnetic Memory, Flash Memory, Magnetic or Optical Disk.

电力组件706为装置700的各种组件提供电力。电力组件706可以包括电源管理系统,一个或多个电源,及其他与为装置700生成、管理和分配电力相关联的组件。Power component 706 provides power to various components of device 700 . Power components 706 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for device 700 .

多媒体组件708包括在所述装置700和用户之间的提供一个输出接口的屏幕。在一些实施例中,屏幕可以包括液晶显示器(LCD)和触摸面板(TP)。如果屏幕包括触摸面板,屏幕可以被实现为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。所述触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与所述触摸或滑动操作相关的持续时长和压力。在一些实施例中,多媒体组件708包括一个前置摄像头和/或后置摄像头。当装置700处于操作模式,如拍摄模式或视频模式时,前置摄像头和/或后置摄像头可以接收外部的多媒体数据。每个前置摄像头和后置摄像头可以是一个固定的光学透镜系统或具有焦距和光学变焦能力。The multimedia component 708 includes a screen that provides an output interface between the device 700 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may not only sense a boundary of a touch or slide action, but also detect duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 708 includes a front camera and/or a rear camera. When the device 700 is in an operation mode, such as a shooting mode or a video mode, the front camera and/or the rear camera can receive external multimedia data. Each front camera and rear camera can be a fixed optical lens system or have focal length and optical zoom capability.

音频组件710被配置为输出和/或输入音频信号。例如,音频组件710包括一个麦克风(MIC),当装置700处于操作模式,如呼叫模式、记录模式和语音识别模式时,麦克风被配置为接收外部音频信号。所接收的音频信号可以被进一步存储在存储器704或经由通信组件716发送。在一些实施例中,音频组件710还包括一个扬声器,用于输出音频信号。The audio component 710 is configured to output and/or input audio signals. For example, the audio component 710 includes a microphone (MIC), which is configured to receive external audio signals when the device 700 is in operation modes, such as call mode, recording mode and voice recognition mode. Received audio signals may be further stored in memory 704 or sent via communication component 716 . In some embodiments, the audio component 710 also includes a speaker for outputting audio signals.

I/O接口712为处理组件702和外围接口模块之间提供接口,上述外围接口模块可以是键盘,点击轮,按钮等。这些按钮可包括但不限于:主页按钮、音量按钮、启动按钮和锁定按钮。The I/O interface 712 provides an interface between the processing component 702 and a peripheral interface module, which may be a keyboard, a click wheel, a button, and the like. These buttons may include, but are not limited to: a home button, volume buttons, start button, and lock button.

传感器组件714包括一个或多个传感器,用于为装置700提供各个方面的状态评估。例如,传感器组件714可以检测到装置700的打开/关闭状态,组件的相对定位,例如所述组件为装置700的显示器和小键盘,传感器组件714还可以检测装置700或装置700一个组件的位置改变,用户与装置700接触的存在或不存在,装置700方位或加速/减速和装置700的温度变化。传感器组件714可以包括接近传感器,被配置用来在没有任何的物理接触时检测附近物体的存在。传感器组件714还可以包括光传感器,如CMOS或CCD图像传感器,用于在成像应用中使用。在一些实施例中,该传感器组件714还可以包括加速度传感器,陀螺仪传感器,磁传感器,压力传感器或温度传感器。Sensor assembly 714 includes one or more sensors for providing various aspects of status assessment for device 700 . For example, the sensor component 714 can detect the open/closed state of the device 700, the relative positioning of components, such as the display and keypad of the device 700, and the sensor component 714 can also detect a change in the position of the device 700 or a component of the device 700 , the presence or absence of user contact with the device 700 , the device 700 orientation or acceleration/deceleration and the temperature change of the device 700 . Sensor assembly 714 may include a proximity sensor configured to detect the presence of nearby objects in the absence of any physical contact. Sensor assembly 714 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor component 714 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor or a temperature sensor.

通信组件716被配置为便于装置700和其他设备之间有线或无线方式的通信。装置700可以接入基于通信标准的无线网络,如WiFi,2G或3G,或它们的组合。在一个示例性实施例中,通信组件716经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,所述通信组件716还包括近场通信(NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(RFID)技术,红外数据协会(IrDA)技术,超宽带(UWB)技术,蓝牙(BT)技术和其他技术来实现。The communication component 716 is configured to facilitate wired or wireless communication between the apparatus 700 and other devices. The device 700 can access wireless networks based on communication standards, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 716 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 716 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, Infrared Data Association (IrDA) technology, Ultra Wide Band (UWB) technology, Bluetooth (BT) technology and other technologies.

在示例性实施例中,装置700可以被一个或多个应用专用集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理设备(DSPD)、可编程逻辑器件(PLD)、现场可编程门阵列(FPGA)、控制器、微控制器、微处理器或其他电子元件实现,用于执行上述控制终端电量的方法。In an exemplary embodiment, apparatus 700 may be programmed by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable Realized by a gate array (FPGA), a controller, a microcontroller, a microprocessor or other electronic components, and is used to execute the above method for controlling the power of the terminal.

在示例性实施例中,还提供了一种包括指令的非临时性计算机可读存储介质,例如包括指令的存储器704,上述指令可由装置700的处理器720执行以完成上述控制终端电量的方法。例如,所述非临时性计算机可读存储介质可以是ROM、随机存取存储器(RAM)、CD-ROM、磁带、软盘和光数据存储设备等。In an exemplary embodiment, there is also provided a non-transitory computer-readable storage medium including instructions, such as a memory 704 including instructions, which can be executed by the processor 720 of the device 700 to complete the above-mentioned method for controlling terminal power. For example, the non-transitory computer readable storage medium may be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, and the like.

本领域技术人员在考虑说明书及实践本公开后,将容易想到本公开的其它实施方案。本申请旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由下面的权利要求指出。Other embodiments of the disclosure will be readily apparent to those skilled in the art from consideration of the specification and practice of the disclosure. This application is intended to cover any modification, use or adaptation of the present disclosure, and these modifications, uses or adaptations follow the general principles of the present disclosure and include common knowledge or conventional technical means in the technical field not disclosed in the present disclosure . The specification and examples are to be considered exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.

应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求来限制。It should be understood that the present disclosure is not limited to the precise constructions which have been described above and shown in the drawings, and various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (15)

1. A method for controlling electric quantity of a terminal is applied to the terminal, and the method comprises the following steps:
determining a target application program to be used;
acquiring the application standby time length and the unit power consumption of the target application program;
acquiring current electric quantity information of the terminal;
obtaining the current standby time of the terminal according to the application standby time, the power consumption of the application unit and the electric quantity information, and obtaining the expected standby time according to the application standby time and the waiting time input by a user;
executing a power saving operation when the current standby duration of the terminal is less than or equal to the expected standby duration, wherein the power saving operation comprises an operation of reducing the power consumption of the terminal; the power saving operation includes: controlling the terminal to enter a dormant state and/or a power-off state;
before the controlling the terminal to enter the sleep state and/or the power-off state, the method further includes:
acquiring the power consumption of a dormancy unit when the terminal enters a dormancy state; the sleep unit power consumption is the unit power consumption of the terminal in a sleep state; acquiring a first theoretical sleep duration of the terminal according to the sleep unit power consumption, the residual power, the application to-be-used duration of the target application program and the application unit power consumption;
determining whether the sum of the first theoretical sleep duration and the application standby duration is greater than or equal to the expected standby duration;
the controlling the terminal to enter the sleep state and/or the power-off state comprises:
when the sum of the first theoretical sleep duration and the application standby duration is determined to be greater than or equal to the expected standby duration, controlling the terminal to enter a sleep state, wherein the sleep duration of the sleep state is the waiting duration;
and when the sum of the first theoretical dormancy duration and the application standby duration is determined to be less than the expected standby duration, acquiring the power consumption of the terminal for starting and the power consumption of the terminal for closing, acquiring the sum of the power consumption of the terminal for starting and the power consumption of the terminal for closing, acquiring the product of the application standby duration and the power consumption of the application unit, and controlling the terminal to enter the operation of closing according to the difference between the residual power and the sum of the power consumption of the terminal for starting and the power consumption of the terminal for closing and the product.
2. The method of claim 1, wherein the power information includes a current remaining power and a current standby unit power consumption of the terminal, and wherein obtaining the current standby time of the terminal according to the application standby time and the application unit power consumption and the power information comprises:
and obtaining the current standby time of the terminal according to the application standby time, the unit power consumption of the application, the residual power and the unit power consumption of the standby.
3. The method according to claim 2, wherein the obtaining the current standby duration of the terminal according to the application standby duration and the application unit power consumption amount and the remaining power amount and the standby unit power consumption amount comprises:
obtaining the current standby time of the terminal through the following formula:
Figure FDA0002138960040000021
wherein T represents the current standby time of the terminal; p represents the current residual capacity of the terminal; pyRepresenting the current standby unit power consumption of the terminal; t isxRepresenting the application standby time of the target application program; pxRepresenting the power consumption of the target application in units of application.
4. The method of claim 1, wherein the power saving operation further comprises:
and stopping the application program installed in the terminal.
5. The method according to claim 1, wherein the controlling the terminal to enter a shutdown operation according to the product and a difference between the remaining power and a sum of the obtained startup power consumption and the shutdown power consumption comprises:
when the difference value between the residual electric quantity and the sum of the obtained startup power consumption and the obtained shutdown power consumption is larger than or equal to the product of the application standby time and the application unit power consumption, acquiring a second theoretical sleep time of the terminal according to the residual electric quantity, the sleep unit power consumption, the startup power consumption and the shutdown power consumption, the application standby time and the application unit power consumption, acquiring a shutdown time according to the expected standby time, the second theoretical sleep time and the application standby time, starting the terminal when the shutdown time is reached, and controlling the terminal to enter the sleep state, wherein the sleep time of the sleep state is the second theoretical sleep time;
and when the difference value between the residual electric quantity and the sum of the obtained power consumption for starting and the power consumption for shutting down is smaller than the product of the application waiting time and the unit power consumption of the application, controlling the shutdown state of the terminal, and starting the terminal when the waiting time is reached.
6. The method of claim 4, wherein the stopping of the terminal-installed application comprises:
acquiring the power saving priority of an application program installed in the terminal;
and sequentially stopping the application programs installed on the terminal according to the sequence of the power saving priority until the current standby time of the terminal is longer than the expected standby time input by a user.
7. The method of claim 6, wherein obtaining the power saving priority of the terminal-installed application comprises:
acquiring a power saving priority input by a user; or,
and determining the power saving priority according to the power consumption of an application unit of the application program installed in the terminal.
8. An apparatus for controlling power of a terminal, the apparatus being applied to the terminal, the apparatus comprising:
a first determination module configured to determine a target application to be used;
the first acquisition module is configured to acquire the application to-be-used time length and the unit power consumption of the target application program;
the second acquisition module is configured to acquire the current electric quantity information of the terminal;
the third acquisition module is configured to obtain the current standby time of the terminal according to the application to-be-used time length, the unit power consumption of the application and the electric quantity information, and obtain the expected standby time length according to the application to-be-used time length and the waiting time length input by a user;
an execution module configured to execute a power saving operation when a current standby duration of the terminal is less than or equal to the expected standby duration, wherein the power saving operation includes an operation of reducing power consumption of the terminal;
the power saving operation includes: controlling the terminal to enter a dormant state and/or a power-off state;
the device further comprises:
the fourth acquisition module is configured to acquire the power consumption of a sleep unit when the terminal enters a sleep state; the sleep unit power consumption is the unit power consumption of the terminal in a sleep state;
a fifth obtaining module, configured to obtain a first theoretical sleep duration of the terminal according to the sleep unit power consumption, the remaining power, the application to-be-used duration of the target application program, and the application unit power consumption;
a second determination module configured to determine whether a sum of the first theoretical sleep duration and the application standby duration is greater than or equal to the desired standby duration;
the execution module is configured to control the terminal to enter a sleep state when determining that the sum of the first theoretical sleep duration and the application standby duration is greater than or equal to the expected standby duration, and the sleep duration of the sleep state is the waiting duration; and when the sum of the first theoretical dormancy duration and the application standby duration is determined to be less than the expected standby duration, acquiring the power consumption of the terminal for starting and the power consumption of the terminal for closing, acquiring the sum of the power consumption of the terminal for starting and the power consumption of the terminal for closing, acquiring the product of the application standby duration and the power consumption of the application unit, and controlling the terminal to enter the operation of closing according to the difference between the residual power and the sum of the power consumption of the terminal for starting and the power consumption of the terminal for closing and the product.
9. The apparatus according to claim 8, wherein the power information includes a current remaining power and a current standby unit power consumption of the terminal, and the third obtaining module is configured to obtain the current standby time of the terminal according to the application standby time and the application unit power consumption as well as the remaining power and the standby unit power consumption.
10. The apparatus according to claim 9, wherein the third obtaining module is configured to obtain the current standby duration of the terminal according to the following formula:
Figure FDA0002138960040000051
wherein T represents the current standby time of the terminal; p represents the current residual capacity of the terminal; pyRepresenting the current standby unit power consumption of the terminal; t isxRepresenting the application standby time of the target application program; pxRepresenting the power consumption of the target application in units of application.
11. The apparatus of claim 8, wherein the power saving operation further comprises:
and stopping the application program installed in the terminal.
12. The apparatus according to claim 8, wherein the execution module is configured to, when the difference between the remaining power amount and the sum of the obtained power-on power consumption amount and the obtained power-off power consumption amount is greater than or equal to the product of the application usage waiting time period and the application unit power consumption amount, acquiring a second theoretical dormancy duration of the terminal according to the residual power, the dormancy unit power consumption, the power-on power consumption and the power-off power consumption, the application standby duration and the application unit power consumption, obtaining a shutdown duration according to the expected standby duration, the second theoretical sleep duration and the application standby duration, when the shutdown time length is reached, starting the terminal, and controlling the terminal to enter the dormant state, wherein the dormant time length of the dormant state is the second theoretical dormant time length; and when the difference value between the residual electric quantity and the sum of the obtained power consumption for starting and the power consumption for shutting down is smaller than the product of the application waiting time and the unit power consumption of the application, controlling the shutdown state of the terminal, and starting the terminal when the waiting time is reached.
13. The apparatus of claim 11, wherein the means for performing comprises:
an acquisition submodule configured to acquire a power saving priority of an application installed in the terminal;
and the stopping submodule is configured to stop the application programs installed in the terminal in sequence according to the power saving priority until the current standby time of the terminal is longer than the expected standby time input by a user.
14. The apparatus of claim 13, wherein the obtaining sub-module is configured to obtain a power saving priority input by a user; or, the power saving priority is determined according to the power consumption of the application program installed in the terminal.
15. An apparatus for controlling power of a terminal, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to: determining a target application program to be used; acquiring the application standby time length and the unit power consumption of the target application program; acquiring current electric quantity information of the terminal; obtaining the current standby time of the terminal according to the application standby time, the power consumption of the application unit and the electric quantity information, and obtaining the expected standby time according to the application standby time and the waiting time input by a user; executing a power saving operation when the current standby duration of the terminal is less than or equal to the expected standby duration, wherein the power saving operation comprises an operation of reducing the power consumption of the terminal; the power saving operation includes: controlling the terminal to enter a dormant state and/or a power-off state;
before controlling the terminal to enter a dormant state and/or a power-off state, acquiring the power consumption of a dormant unit when the terminal enters the dormant state; the sleep unit power consumption is the unit power consumption of the terminal in a sleep state; acquiring a first theoretical sleep duration of the terminal according to the sleep unit power consumption, the residual power, the application to-be-used duration of the target application program and the application unit power consumption;
determining whether the sum of the first theoretical sleep duration and the application standby duration is greater than or equal to the expected standby duration;
the controlling the terminal to enter the sleep state and/or the power-off state comprises:
when the sum of the first theoretical sleep duration and the application standby duration is determined to be greater than or equal to the expected standby duration, controlling the terminal to enter a sleep state, wherein the sleep duration of the sleep state is the waiting duration;
and when the sum of the first theoretical dormancy duration and the application standby duration is determined to be less than the expected standby duration, acquiring the power consumption of the terminal for starting and the power consumption of the terminal for closing, acquiring the sum of the power consumption of the terminal for starting and the power consumption of the terminal for closing, acquiring the product of the application standby duration and the power consumption of the application unit, and controlling the terminal to enter the operation of closing according to the difference between the residual power and the sum of the power consumption of the terminal for starting and the power consumption of the terminal for closing and the product.
CN201610998700.3A 2016-11-11 2016-11-11 Method and device for controlling terminal power Active CN106375604B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610998700.3A CN106375604B (en) 2016-11-11 2016-11-11 Method and device for controlling terminal power

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610998700.3A CN106375604B (en) 2016-11-11 2016-11-11 Method and device for controlling terminal power

Publications (2)

Publication Number Publication Date
CN106375604A CN106375604A (en) 2017-02-01
CN106375604B true CN106375604B (en) 2019-10-15

Family

ID=57893424

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610998700.3A Active CN106375604B (en) 2016-11-11 2016-11-11 Method and device for controlling terminal power

Country Status (1)

Country Link
CN (1) CN106375604B (en)

Families Citing this family (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107197083A (en) * 2017-04-14 2017-09-22 北京安云世纪科技有限公司 The method and mobile terminal of a kind of continuation of the journey duration for adjusting mobile terminal
CN108804208A (en) * 2017-04-27 2018-11-13 北京小米移动软件有限公司 Terminal operating method, device and terminal
CN107193718A (en) * 2017-05-27 2017-09-22 广东小天才科技有限公司 Charging reminding method, system and terminal equipment
CN107506018A (en) * 2017-07-05 2017-12-22 深圳天珑无线科技有限公司 Mobile terminal and its method for classification power saving, the device with store function
CN107454663A (en) * 2017-07-27 2017-12-08 广东小天才科技有限公司 Power saving method, device, equipment and storage medium
CN107548142A (en) * 2017-07-31 2018-01-05 努比亚技术有限公司 A kind of electricity-saving control method, terminal and computer-readable recording medium
CN107463435B (en) * 2017-07-31 2020-04-14 Oppo广东移动通信有限公司 Application process priority management method, device, storage medium and electronic device
CN107577150A (en) * 2017-08-09 2018-01-12 移康智能科技(上海)股份有限公司 A kind of electric quantity controlling method, electronic equipment and computer-readable recording medium
CN109471516B (en) * 2017-09-07 2023-07-04 中兴通讯股份有限公司 Terminal, power consumption control method and device thereof, and computer readable storage medium
CN108112063B (en) * 2017-12-21 2020-03-31 珠海市魅族科技有限公司 Power management method, power management device, terminal and readable storage medium
CN108810226A (en) * 2018-06-22 2018-11-13 维沃移动通信有限公司 A kind of electricity method for early warning and mobile terminal
CN109474747B (en) * 2018-11-28 2020-10-23 维沃移动通信有限公司 A kind of information prompting method and mobile terminal
CN109768547B (en) * 2018-12-28 2021-06-22 京信通信系统(中国)有限公司 Power supply control method, device, equipment and readable storage medium
CN110266886B (en) * 2019-06-21 2021-04-16 Oppo广东移动通信有限公司 Battery management method and related product
CN113194201B (en) * 2021-04-26 2022-08-26 中国联合网络通信集团有限公司 Electric quantity reminding method and device
CN115802453A (en) * 2021-09-09 2023-03-14 上海华为技术有限公司 Power consumption control method, device and system for electric equipment
CN114828180B (en) * 2022-06-22 2022-09-09 江西科技学院 A sensor control method and device
CN117369619B (en) * 2023-12-06 2024-03-22 深圳市德晟达电子科技有限公司 Intelligent energy-saving method and system for computer

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101388924A (en) * 2008-10-11 2009-03-18 深圳华为通信技术有限公司 Method and mobile terminal for prompting residue working time
CN102369647A (en) * 2011-09-14 2012-03-07 华为技术有限公司 Power supply managment method and device of mobile terminal

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101388924A (en) * 2008-10-11 2009-03-18 深圳华为通信技术有限公司 Method and mobile terminal for prompting residue working time
CN102369647A (en) * 2011-09-14 2012-03-07 华为技术有限公司 Power supply managment method and device of mobile terminal

Also Published As

Publication number Publication date
CN106375604A (en) 2017-02-01

Similar Documents

Publication Publication Date Title
CN106375604B (en) Method and device for controlling terminal power
CN107134823B (en) Charging prompting method and device
WO2017028425A1 (en) Energy-saving mode activation method and device
CN105807873A (en) Temperature control method and device
CN107608561A (en) Touch-screen control method and device
CN106357910A (en) Terminal working mode switching method and device
CN105807894B (en) Using the treating method and apparatus for holding lock
CN106598704A (en) Application program recovery method and apparatus
CN106407079A (en) Mobile terminal charging prompting method, device and equipment
CN107515749A (en) Method and device for starting up electronic equipment, and electronic equipment
CN107368175B (en) Processing method and device for reducing terminal power consumption and terminal
CN108539804B (en) Battery charging control method, battery charging control device and electronic device
CN106502370A (en) The method of control intelligent terminal and intelligent terminal
CN108267972A (en) Control method of electronic device and device
CN105957011A (en) Picture processing method and device
CN106791089B (en) Method and device for indicating battery power
CN105868624A (en) Application program authority management method and device
CN105677428A (en) Upgrading method and device for terminal and terminal
CN106201738B (en) System broadcast calling method and device
CN106603825A (en) Method and device for controlling mobile terminal
CN105786561A (en) Process calling method and apparatus
CN106708243A (en) Terminal equipment control method and device
CN107659727B (en) Terminal control method, device and storage medium
CN105607319A (en) Method and device for improving light leak of screen automatically
CN108803853A (en) Terminal operating method, device and terminal, computer readable storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant