CN106951050B - Method and device for determining power consumption of terminal - Google Patents

Method and device for determining power consumption of terminal Download PDF

Info

Publication number
CN106951050B
CN106951050B CN201610007365.6A CN201610007365A CN106951050B CN 106951050 B CN106951050 B CN 106951050B CN 201610007365 A CN201610007365 A CN 201610007365A CN 106951050 B CN106951050 B CN 106951050B
Authority
CN
China
Prior art keywords
power consumption
terminal
module
unit
configuration template
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
CN201610007365.6A
Other languages
Chinese (zh)
Other versions
CN106951050A (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 CN201610007365.6A priority Critical patent/CN106951050B/en
Publication of CN106951050A publication Critical patent/CN106951050A/en
Application granted granted Critical
Publication of CN106951050B publication Critical patent/CN106951050B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Telephone Function (AREA)

Abstract

The disclosure relates to a method and a device for determining power consumption of a terminal, wherein the method comprises the following steps: acquiring the working state of a terminal; calculating the unit power consumption of at least one power consumption module in the terminal according to the working state; and determining the power consumption of the terminal in a preset time period according to the unit power consumption of each power consumption module in the terminal. Therefore, the power consumption of the terminal can be determined according to the working state of the terminal, so that the accuracy of the power consumption of the terminal is improved.

Description

Method and device for determining power consumption of terminal
Technical Field
The present disclosure relates to the field of network communication technologies, and in particular, to a method and an apparatus for determining power consumption of a terminal.
Background
With the continuous development of network communication technology, the application of intelligent terminals is more and more extensive. In the related art, a configured configuration file is arranged in the intelligent terminal, the configuration file comprises the fixed unit power consumption amount corresponding to each power consumption module, and the use information of the battery, namely the power consumption amount of the intelligent terminal, is easily determined according to the fixed unit power consumption amount corresponding to each power consumption module and the use time corresponding to each power consumption module. However, the working environment of the intelligent terminal is more and more complex, the accuracy of calculating the use information of the battery by using the power consumption of a fixed unit is lower and lower, and the working requirement of the intelligent terminal cannot be better met.
Disclosure of Invention
In order to overcome the problems in the related art, the present disclosure provides a method and an apparatus for determining power consumption of a terminal.
According to a first aspect of the embodiments of the present disclosure, there is provided a method for determining power consumption of a terminal, the method including:
acquiring the working state of a terminal;
calculating the unit power consumption of at least one power consumption module in the terminal according to the working state;
and determining the power consumption of the terminal in a preset time period according to the unit power consumption of each power consumption module in the terminal.
Optionally, the method further includes:
when the change of the working state of the terminal is detected, updating the unit power consumption of at least one power consumption module in the terminal according to the changed working state;
and updating the power consumption of the terminal in unit time according to the updated unit power consumption of each power consumption module in the terminal.
Optionally, the calculating unit power consumption of at least one power consumption module in the terminal according to the operating state includes:
acquiring a configuration template corresponding to each power consumption module from a preset configuration file;
determining working parameters to be configured from the corresponding configuration template;
extracting a parameter value corresponding to the working parameter to be configured from the working state;
and adding the parameter values into the corresponding configuration templates, and calculating the unit power consumption of the corresponding power consumption module by each configuration template according to the parameter values of the working parameters to be configured.
Optionally, the power consuming module is a voice communication module, and the working parameters to be configured in the configuration template corresponding to the voice communication module include any one or more of a working mode and a signal strength.
Optionally, the method further includes:
receiving an update instruction of a configuration template, which is input by a user through an interface or sent by other terminals, wherein the update instruction carries working parameters to be configured for updating the configuration template;
and correspondingly updating the working parameters to be configured of the configuration template according to the updated working parameters to be configured.
Optionally, determining the power consumption of the terminal in a predetermined time period according to the unit power consumption of each power consumption module in the terminal includes:
according to the unit power consumption of each power consumption module in the terminal, carrying out integral or accumulation calculation on the unit power consumption in a preset time period to obtain the power consumption of each power consumption module in the preset time period;
adding the power consumption of each power consumption module in the preset time period to obtain the power consumption of the terminal in the preset time period; or
Adding unit power consumption of each power consumption module in the terminal to obtain the power consumption of the terminal in unit time;
and in the set time period, performing integral or accumulation calculation on the power consumption of the terminal in unit time to obtain the power consumption of the terminal in a preset time period.
According to a second aspect of the embodiments of the present disclosure, there is provided an apparatus for determining power consumption of a terminal, the apparatus including:
the acquisition module is configured to acquire the working state of the terminal;
a calculation module configured to calculate a unit power consumption amount of at least one power consumption module in the terminal according to the operating state;
and the power consumption determining module is configured to determine the power consumed by the terminal in a preset time period according to the unit power consumption of each power consumption module in the terminal.
Optionally, the method further includes:
the terminal comprises a detection module, a power consumption updating module and a power consumption updating module, wherein the detection module is configured to update the unit power consumption of at least one power consumption module in the terminal according to the changed working state when detecting that the working state of the terminal changes;
and the first updating module is configured to update the power consumption of the terminal in unit time according to the updated unit power consumption of each power consumption module in the terminal.
Optionally, the calculation module includes:
the acquisition submodule is configured to acquire a configuration template corresponding to each power consumption module from a preset configuration file;
the determining submodule is configured to determine working parameters to be configured from the corresponding configuration template;
the extraction submodule is configured to extract a parameter value corresponding to the working parameter to be configured from the working state;
and the calculation submodule is configured to add the parameter values into the corresponding configuration templates, and the unit power consumption of the corresponding power consumption module is calculated by each configuration template according to the parameter values of the working parameters to be configured.
Optionally, the power consuming module is a voice communication module, and the working parameters to be configured in the configuration template corresponding to the voice communication module include any one or more of a working mode and a signal strength.
Optionally, the method further includes:
the system comprises a receiving module, a configuration module and a configuration module, wherein the receiving module is configured to receive an updating instruction of a configuration template input by a user through an interface or sent by other terminals, and the updating instruction carries working parameters to be configured for updating the configuration template;
and the second updating module is configured to correspondingly update the working parameters to be configured of the configuration template according to the updated working parameters to be configured.
Optionally, the power consumption determining module includes a first calculating submodule and a second calculating submodule; or a third computation submodule and a fourth computation submodule;
the first calculation submodule is configured to perform integral or accumulation calculation on the unit power consumption in a preset time period according to the unit power consumption of each power consumption module in the terminal to obtain the power consumption of each power consumption module in the preset time period;
the second calculation submodule is configured to add the power consumption of each power consumption module in the preset time period to obtain the power consumption of the terminal in the preset time period; or
The third calculation sub-module is configured to add unit power consumption of each power consumption module in the terminal to obtain power consumption of the terminal in unit time;
the fourth calculating submodule is configured to perform integral or accumulation calculation on the power consumption of the terminal in unit time within the set time period to obtain the power consumption of the terminal in a preset time period.
According to a third aspect of the embodiments of the present disclosure, there is provided an apparatus for determining power consumption of a terminal, the apparatus including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
acquiring the working state of a terminal;
calculating the unit power consumption of at least one power consumption module in the terminal according to the working state;
and determining the power consumption of the terminal in a preset time period according to the unit power consumption of each power consumption module in the terminal.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects:
according to the terminal, the power consumption of the terminal can be determined according to the working state of the terminal, and therefore the accuracy of the power consumption of the terminal is improved.
The unit power consumption of each power consumption module in the terminal can be updated in real time along with the change of the working state, and if the power consumption of the terminal is calculated by using the changed unit power consumption, the accuracy of the power consumption of the terminal can be improved, so that the problem that the accuracy is lower and lower when the power consumption of the terminal is calculated by using the fixed unit power consumption is solved.
The terminal in the disclosure can also adopt the combination of the configuration template and the working state to calculate the unit power consumption of each power consumption module, thereby improving the calculation speed of the unit power consumption.
In the method, the terminal can also preset the configuration template corresponding to each power consumption module and store the configuration template corresponding to each power consumption module in the preset configuration file, so that the unit power consumption of each power consumption module is calculated conveniently, and the calculation speed of the unit power consumption is further improved.
The terminal in the disclosure can also provide an updating function for the configuration template, and can update the working parameters stored in the configuration template in the preset configuration file according to the updating instruction input by the user through an interface or sent by other terminals, so that the personalized requirements of the user are met, and the user experience is improved.
The terminal in the disclosure can also provide a function of modifying the configuration template, and the configuration template stored in the preset configuration file can be modified according to the modification corresponding to the user modification data, so that the user experience is further improved.
In the method, the terminal can also adopt different calculation modes to complete the function of calculating the power consumption of the terminal within a period of time according to the unit power consumption changing in real time of each power consumption module, so that the flexibility of calculating the power consumption of the terminal is enhanced, and the efficiency of determining the power consumption of the terminal is also improved.
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 disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
Fig. 1 is a flowchart illustrating a method for determining power consumption of a terminal according to an exemplary embodiment of the present disclosure;
fig. 2 is a flow chart illustrating another method for determining power consumption of a terminal according to an example embodiment;
fig. 3 is a flow chart illustrating another method for determining power consumption of a terminal according to an example embodiment;
fig. 4 is a flow chart illustrating another method for determining power consumption of a terminal according to an example embodiment;
fig. 5 is a flow chart illustrating another method for determining power consumption of a terminal according to an example embodiment;
fig. 6 is a flow chart illustrating another method for determining power consumption of a terminal according to an example embodiment;
fig. 7 is an application scenario diagram illustrating a method for determining power consumption of a terminal according to an exemplary embodiment of the present disclosure;
fig. 8 is a block diagram illustrating an apparatus for determining power consumption of a terminal according to an exemplary embodiment of the present disclosure;
fig. 9 is a block diagram illustrating another apparatus for determining power consumption of a terminal according to an example embodiment;
fig. 10 is a block diagram illustrating another apparatus for determining power consumption of a terminal according to an example embodiment;
fig. 11 is a block diagram illustrating another apparatus for determining power consumption of a terminal according to an example embodiment;
fig. 12 is a block diagram illustrating another apparatus for determining power consumption of a terminal according to an example embodiment;
fig. 13 is a schematic structural diagram illustrating an apparatus for determining power consumption of a terminal according to an exemplary embodiment of the present disclosure.
Detailed Description
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, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
The terminology used in the present disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. As used in this disclosure and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present disclosure. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
As shown in fig. 1, fig. 1 is a flowchart illustrating a method for determining power consumption of a terminal according to an exemplary embodiment of the present disclosure, where the method may be used in a terminal, and includes the following steps:
in step 110, the operating state of the terminal is obtained.
The terminal in the present disclosure may be any intelligent terminal having an internet access function, and may be specifically a mobile phone, a tablet computer, a Personal Digital Assistant (PDA), or the like. The terminal can access the router through the wireless local area network and access the server on the public network through the router.
In the embodiment of the present disclosure, the operating state of the terminal may include, but is not limited to, an operating mode, signal strength, and the like. The operation mode may refer to which network mode the terminal resides in, and the signal strength may refer to what signal strength the terminal receives from the network mode where the terminal resides. Such as: the working mode is Global System for Mobile Communications (GSM), and the signal strength is-80 dBm.
Due to the continuous development of network communication technology, there are many network modes available for the terminal to reside in. Such as: GSM, Wideband Code Division Multiple Access (WCDMA), Time Division-Synchronous Code Division Multiple Access (TD-SCDMA), and other network modes.
In step 120, the unit power consumption of at least one power consuming module in the terminal is calculated according to the operating state of the terminal.
In the embodiment of the disclosure, the unit power consumption obtained by calculation may be different according to different working states, so that the terminal may calculate the unit power consumption of at least one power consumption module in real time according to the working state of the terminal. In the prior art, the unit power consumption of each power consumption module is fixedly configured and cannot be changed along with the change of the working state.
In addition, there are many power consuming modules in the terminal, such as: the terminal comprises a voice communication module, a wireless module, a backlight module and the like, wherein the unit power consumption of at least one power consumption module in the terminal is related to the working state, namely the corresponding unit power consumption is different under different working states. In this embodiment, the power consumption modules whose unit power consumption is related to the operating state may be determined first, and then the unit power consumption of the power consumption modules may be calculated according to the operating state.
In step 130, the power consumption of the terminal in the predetermined time period is determined according to the unit power consumption of each power consumption module in the terminal.
In the embodiment of the disclosure, the power consumption of the terminal in unit time can be determined according to the unit power consumption of each power consumption module in the terminal; and then determining the power consumption of the terminal in a preset time period according to the power consumption of the terminal in the unit time.
In the embodiment of the present disclosure, the unit power consumption of each power consumption module changes with the change of the operating state of the terminal. If the terminal power consumption in the unit time is calculated, the unit power consumption of each power consumption module can be added to obtain the terminal power consumption in the unit time; if the power consumption of the terminal in a period of time needs to be calculated, the unit power consumption of each power consumption module in the period of time can be integrated or accumulated to obtain the power consumption of the terminal in the period of time.
According to the embodiment, the working state of the terminal is obtained, the unit power consumption of at least one power consumption module in the terminal is calculated according to the working state of the terminal, and the power consumption of the terminal in the preset time period is determined according to the unit power consumption of each power consumption module in the terminal, so that the terminal can determine the power consumption of the terminal according to the working state of the terminal, and the accuracy of the power consumption of the terminal is improved.
In a disclosed embodiment, the method shown in fig. 1 may further include:
when the working state of the terminal is detected to be changed, unit power consumption of at least one power consumption module in the terminal is updated according to the changed working state;
and updating the power consumption of the terminal in unit time according to the updated unit power consumption of each power consumption module in the terminal.
It can be seen from the above embodiment that the unit power consumption of each power consumption module in the terminal can be updated in real time along with the change of the operating state, and if the terminal power consumption is calculated by using the changed unit power consumption, the accuracy of the terminal power consumption can be improved, so that the problem that the accuracy is lower and lower when the terminal power consumption is calculated by using a fixed unit power consumption is avoided.
As shown in fig. 2, fig. 2 is a flowchart illustrating another method for determining power consumption of a terminal according to an exemplary embodiment of the present disclosure, which may be used in the terminal, and on the basis of the method shown in fig. 1, when calculating a unit power consumption of at least one power consumption module in the terminal according to an operating state of the terminal in step 120, the method may further include the following steps:
in step 210, a configuration template corresponding to each power consuming module is obtained from a preset configuration file. The configuration template can calculate the power consumption of the corresponding power consumption module according to the working parameters.
In the embodiment of the present disclosure, each power consuming module may correspond to a common configuration template, and the common configuration template may be used to calculate the unit power consumption of each power consuming module; each power consumption module may also correspond to a different configuration template, that is, each power consumption module has its own corresponding configuration template, and the corresponding configuration template is only used for calculating its own unit power consumption.
In step 220, the operating parameters to be configured are determined from the corresponding configuration template.
In step 230, a parameter value corresponding to the operating parameter to be configured is extracted from the operating state.
In step 240, the extracted parameter values are added to the corresponding configuration templates, and the power consumption of the corresponding power consumption module is calculated by each configuration template according to the parameter values of the working parameters to be configured.
In the embodiment of the disclosure, in order to increase the speed of calculating the power consumption of each power consumption module, different working parameters may be stored in the configuration template corresponding to each power consumption module in advance, and when each working parameter takes a different parameter value, the power consumption of each corresponding power consumption module is increased.
Such as: the power consumption module is a voice communication module, firstly, working parameters to be configured are obtained from a configuration template corresponding to the voice communication module and are working modes and signal strength, then, the working mode of the terminal is extracted from the current working state of the terminal and is GSM, the signal strength is-80 dBm, finally, the working mode of the terminal is GSM, the signal strength is-80 dBm, the working mode of the terminal is added into the configuration template corresponding to the voice communication module, and the unit power consumption of the voice communication module is calculated.
In addition, the operating parameters to be configured in the configuration template corresponding to the voice communication module may include any one or more of an operating mode and a signal strength.
According to the embodiment, the unit power consumption of each power consumption module can be calculated by combining the configuration template and the working state, so that the calculation speed of the unit power consumption is improved.
As shown in fig. 3, fig. 3 is a flowchart illustrating another method for determining power consumption of a terminal according to an exemplary embodiment of the present disclosure, where the method may be used in a terminal, and on the basis of the method shown in fig. 1 or fig. 2, the method may further include the following steps:
in step 310, a configuration template corresponding to each power consuming module is set.
Such as: the power consumption module is a voice communication module, and if the influence factors influencing the voice communication module include a working mode and signal strength, the working mode and the signal strength can be set in a configuration template corresponding to the voice communication module.
In addition, the terminal can also calculate unit power consumption corresponding to various operation modes and various signal strengths in advance and store the unit power consumption in the configuration template, so that the terminal can directly obtain the unit power consumption in a certain operation mode and a certain signal strength from the configuration template when calculating the unit power consumption in a certain operation mode and a certain signal strength.
In step 320, the configuration templates corresponding to the power consuming modules are saved in a preset configuration file.
According to the embodiment, the configuration templates corresponding to the power consumption modules can be preset and stored in the preset configuration file, so that the unit power consumption of the power consumption modules can be calculated conveniently, and the calculation speed of the unit power consumption is improved.
As shown in fig. 4, fig. 4 is a flowchart of another method for determining power consumption of a terminal according to an exemplary embodiment of the present disclosure, where the method may be used in a terminal, and on the basis of the method shown in fig. 3, the method may further include the following steps:
in step 410, an update instruction of the configuration template, which is input by a user through an interface or sent by another terminal, is received, and the update instruction carries the working parameters to be configured for updating the configuration template.
In step 420, the working parameters to be configured of the configuration template are updated correspondingly according to the updated working parameters to be configured.
The embodiment can provide the updating function of the configuration template, and can update the working parameters stored in the configuration template in the preset configuration file according to the updating instruction input by the user through the interface or sent by other terminals, thereby meeting the personalized requirements of the user and improving the user experience.
As shown in fig. 5, fig. 5 is a flowchart of another method for determining power consumption of a terminal according to an exemplary embodiment of the present disclosure, where the method may be used in a terminal, and on the basis of the method shown in fig. 3, the method may further include the following steps:
in step 510, a modification instruction for a configuration template corresponding to each power consuming module is received.
In step 520, a modification interface is output, the modification interface including an input box for a user to input modification data.
In step 530, the modification data entered by the user at the input box is received.
In step 540, the configuration template stored in the preset configuration file is modified according to the modification data.
The embodiment can provide a function of modifying the configuration template, and the configuration template stored in the preset configuration file can be modified according to the modification corresponding to the user modification data, so that the user experience is further improved.
As shown in fig. 6, fig. 6 is a flowchart of another method for determining power consumption of a terminal according to an exemplary embodiment, which may be used in a terminal, and on the basis of the method shown in fig. 1, when the unit power consumption of each power consumption module in the terminal is executed in step 130, and the power consumption of the terminal in a predetermined time period is determined, the method may further include the following steps:
in step 610, according to the unit power consumption of each power consumption module in the terminal, the unit power consumption in the preset time period is integrated or accumulated to obtain the power consumption of each power consumption module in the preset time period.
In the embodiment of the present disclosure, since the unit power consumption of each power consumption module changes with the operating state, that is, with the change of time, the unit power consumption of each power consumption module also changes. If the unit power consumption of each power consumption module at each moment is stored in the configuration file corresponding to each power consumption module, the unit power consumption in the first set time period can be obtained from the corresponding configuration file; if the unit power consumption of each power consumption module at each moment is stored in the local cache, the unit power consumption in the first set time period can be obtained from the local cache.
In step 620, the power consumptions of the power consumption modules in the preset time period are added to obtain the power consumption of the terminal in the preset time period.
The above steps 610 to 620 are a determination method of power consumption of the terminal, and the present disclosure may further include, but is not limited to, the following determination methods described in steps 630 to 640:
in step 630, the unit power consumption of each power consuming module in the terminal is added to obtain the power consumption of the terminal in unit time.
In the embodiment of the present disclosure, since the unit power consumption of each power consumption module changes with the operating state, that is, the unit power consumption of each power consumption module also changes with time, the unit power consumption of the terminal also changes with time. If the unit power consumption of the terminal at each moment is stored in the configuration file, the unit power consumption in the second set time period in the configuration file can be used; if the unit power consumption of the terminal at each moment is stored in the local cache, the unit power consumption in the second set time period can be obtained from the local cache.
In step 640, the power consumption of the terminal in unit time is integrated or accumulated in a set time period to obtain the power consumption of the terminal in a predetermined time period.
According to the embodiment, different calculation modes can be adopted to complete the function of calculating the power consumption of the terminal within a period of time according to the unit power consumption changing in real time of each power consumption module, so that the flexibility of calculating the power consumption of the terminal is enhanced, and the efficiency of determining the power consumption of the terminal is improved.
As shown in fig. 7, fig. 7 is an application scenario diagram illustrating a method for determining power consumption of a terminal according to an exemplary embodiment of the present disclosure. The application scenario includes a smartphone as a terminal.
When the power consumption of the smart phone needs to be determined, the smart phone can acquire the working state of the smart phone, such as: the working mode is GSM, the signal intensity is-80 dBm, the unit power consumption of at least one power consumption module in the terminal is calculated according to the working state, and the power consumption of the terminal is determined according to the unit power consumption of each power consumption module.
In the application scenario shown in fig. 7, for a specific process of determining the power consumption of the terminal, reference may be made to the foregoing description in fig. 1 to fig. 6, which is not described herein again.
Corresponding to the embodiment of the method for determining the power consumption of the terminal, the disclosure also provides an embodiment of a device for determining the power consumption of the terminal.
As shown in fig. 8, fig. 8 is a block diagram of an apparatus for determining power consumption of a terminal, which may be applied to a terminal and used to perform the method for determining power consumption of a terminal shown in fig. 1, according to an exemplary embodiment of the present disclosure, and the apparatus may include: an acquisition module 81, a calculation module 82 and a power consumption amount determination module 83.
The obtaining module 81 is configured to obtain an operating state of the terminal;
a calculating module 82 configured to calculate a unit power consumption of at least one power consuming module in the terminal according to the operating state;
a power consumption determining module 83 configured to determine the amount of power consumed by the terminal for a predetermined period of time based on the unit power consumption of each power consuming module within the terminal.
According to the embodiment, the working state of the terminal is obtained, the unit power consumption of at least one power consumption module in the terminal is calculated according to the working state of the terminal, and the power consumption of the terminal in the preset time period is determined according to the unit power consumption of each power consumption module in the terminal, so that the terminal can determine the power consumption of the terminal according to the working state of the terminal, and the accuracy of the power consumption of the terminal is improved.
As shown in fig. 9, fig. 9 is a block diagram of another apparatus for determining power consumption of a terminal according to an exemplary embodiment of the present disclosure, where the apparatus may further include, on the basis of the foregoing embodiment shown in fig. 8: a detection module 91 and a first update module 92.
The detection module 91 is configured to update the unit power consumption of at least one power consumption module in the terminal according to the changed working state when detecting that the working state of the terminal changes;
and the first updating module 92 is configured to update the power consumption of the terminal in unit time according to the updated unit power consumption of each power consumption module in the terminal.
It can be seen from the above embodiment that the unit power consumption of each power consumption module in the terminal can be updated in real time along with the change of the operating state, and if the terminal power consumption is calculated by using the changed unit power consumption, the accuracy of the terminal power consumption can be improved, so that the problem that the accuracy is lower and lower when the terminal power consumption is calculated by using a fixed unit power consumption is avoided.
As shown in fig. 10, fig. 10 is a block diagram of another apparatus for determining power consumption of a terminal according to an exemplary embodiment of the present disclosure, where on the basis of the foregoing embodiments shown in fig. 8 or 9, the calculating module 82 may include: an acquisition sub-module 101, a determination sub-module 102, an extraction sub-module 103, and a calculation sub-module 104.
The obtaining sub-module 101 is configured to obtain a configuration template corresponding to each power consuming module from a preset configuration file;
the determining submodule 102 is configured to determine the working parameters to be configured from the corresponding configuration template;
the extraction submodule 103 is configured to extract a parameter value corresponding to the to-be-configured working parameter from the working state;
and the calculating submodule 104 is configured to add the parameter value to the corresponding configuration template, and calculate the unit power consumption of the corresponding power consumption module according to the parameter value of the working parameter to be configured by each configuration template.
The power consumption module may be a voice communication module, and the working parameters to be configured in the configuration template corresponding to the voice communication module include any one or more of a working mode and a signal strength.
According to the embodiment, the unit power consumption of each power consumption module can be calculated by combining the configuration template and the working state, so that the calculation speed of the unit power consumption is improved.
As shown in fig. 11, fig. 11 is a block diagram of another apparatus for determining power consumption of a terminal according to an exemplary embodiment of the present disclosure, where the apparatus may further include, on the basis of the foregoing embodiment shown in fig. 10: a receiving module 111 and a second updating module 112.
The receiving module 111 is configured to receive an update instruction of the configuration template, which is input by a user through an interface or sent by another terminal, where the update instruction carries working parameters to be configured for updating the configuration template;
and a second updating module 112 configured to correspondingly update the to-be-configured working parameters of the configuration template according to the updated to-be-configured working parameters.
The embodiment can provide the updating function of the configuration template, and can update the working parameters stored in the configuration template in the preset configuration file according to the updating instruction input by the user through the interface or sent by other terminals, thereby meeting the personalized requirements of the user and improving the user experience.
As shown in fig. 12, fig. 12 is a block diagram of another apparatus for determining power consumption of a terminal according to an exemplary embodiment of the present disclosure, where the power consumption determining module 83 may include, on the basis of the foregoing embodiment shown in fig. 8: a first calculation submodule 121 and a second calculation submodule 122; or a third calculation submodule 123 and a fourth calculation submodule 124.
The first calculating submodule 121 is configured to perform integral or cumulative calculation on the unit power consumption in a preset time period according to the unit power consumption of each power consumption module in the terminal, so as to obtain the power consumption of each power consumption module in the preset time period;
the second calculating submodule 122 is configured to add the power consumption of each power consumption module in the preset time period to obtain the power consumption of the terminal in the preset time period; or
A third calculating submodule 123 configured to add unit power consumption amounts of power consumption modules in the terminal to obtain a power consumption amount of the terminal in unit time;
and the fourth calculating submodule 124 is configured to integrate or accumulate the power consumption of the terminal in a unit time in the set time period to obtain the power consumption of the terminal in a predetermined time period.
According to the embodiment, different calculation modes can be adopted to complete the function of calculating the power consumption of the terminal within a period of time according to the unit power consumption changing in real time of each power consumption module, so that the flexibility of calculating the power consumption of the terminal is enhanced, and the efficiency of determining the power consumption of the terminal is improved.
Corresponding to fig. 8, the present disclosure also provides another apparatus for determining power consumption of a terminal, where the apparatus may be applied to the terminal, and the apparatus includes:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
acquiring the working state of the terminal;
calculating the unit power consumption of at least one power consumption module in the terminal according to the working state;
and determining the power consumption of the terminal in a preset time period according to the unit power consumption of each power consumption module in the terminal.
The implementation process of the functions and actions of each unit in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the disclosed solution. One of ordinary skill in the art can understand and implement it without inventive effort.
As shown in fig. 13, fig. 13 is another schematic structural diagram (terminal side) of a device 1300 for determining power consumption of a terminal according to an exemplary embodiment of the present disclosure. For example, the apparatus 1300 may be a mobile phone with routing capability, 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 so forth.
Referring to fig. 13, the apparatus 1300 may include one or more of the following components: processing component 1302, memory 1304, power component 1306, multimedia component 1308, audio component 1310, input/output (I/O) interface 1312, sensor component 1314, and communication component 1313.
The processing component 1302 generally controls overall operation of the device 1300, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 1302 may include one or more processors 1320 to execute instructions to perform all or part of the steps of the methods described above. Further, the processing component 1302 can include one or more modules that facilitate interaction between the processing component 1302 and other components. For example, the processing component 1302 may include a multimedia module to facilitate interaction between the multimedia component 1308 and the processing component 1302.
The memory 1304 is configured to store various types of data to support operations at the apparatus 1300. Examples of such data include instructions for any application or method operating on device 1300, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 1304 may be implemented by any type or combination of volatile or non-volatile memory devices 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 disks.
Power supply component 1306 provides power to the various components of device 1300. Power components 1306 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for device 1300.
The multimedia component 1308 includes a screen between the device 1300 and the user that provides an output interface. 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 an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 1308 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the apparatus 1300 is in an operation mode, such as a photographing mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 1310 is configured to output and/or input audio signals. For example, the audio component 1310 includes a Microphone (MIC) configured to receive external audio signals when the apparatus 1300 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal may further be stored in the memory 1304 or transmitted via the communication component 1313. In some embodiments, the audio component 1310 also includes a speaker for outputting audio signals.
The I/O interface 1312 provides an interface between the processing component 1302 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 1314 includes one or more sensors for providing various aspects of state assessment for the device 1300. For example, the sensor assembly 1314 may detect the open/closed state of the device 1300, the relative positioning of components, such as a display and keypad of the device 1300, the sensor assembly 1314 may also detect a change in the position of the device 1300 or a component of the device 1300, the presence or absence of user contact with the device 1300, orientation or acceleration/deceleration of the device 1300, and a change in the temperature of the device 1300. The sensor assembly 1314 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 1314 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 1314 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, a microwave sensor, or a temperature sensor.
The communication component 1313 is configured to facilitate communications between the apparatus 1300 and other devices in a wired or wireless manner. The apparatus 1300 may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 1313 receives a broadcast signal or broadcast associated information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communications component 1313 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the apparatus 1300 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer readable storage medium comprising instructions, such as the memory 1304 comprising instructions, executable by the processor 1320 of the apparatus 1300 to perform the method described above is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that 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 (13)

1. A method for determining power consumption of a terminal, the method comprising:
acquiring the working state of a terminal;
calculating the unit power consumption of at least one power consumption module in the terminal according to the working state;
determining the power consumption of the terminal in a preset time period according to the unit power consumption of each power consumption module in the terminal;
calculating the unit power consumption of at least one power consumption module in the terminal according to the working state, and the method comprises the following steps:
calculating the unit power consumption of each power consumption module according to the working parameters to be configured in the configuration template of each power consumption module and the working state;
the method further comprises the following steps:
and updating the working parameters to be configured of the configuration template according to the received updating instruction of the configuration template.
2. The method of claim 1, further comprising:
when the change of the working state of the terminal is detected, updating the unit power consumption of at least one power consumption module in the terminal according to the changed working state;
and updating the power consumption of the terminal in unit time according to the updated unit power consumption of each power consumption module in the terminal.
3. The method according to claim 1 or 2, wherein calculating the unit power consumption of each power consuming module based on the configuration template and the operating status of each power consuming module comprises:
acquiring a configuration template corresponding to each power consumption module from a preset configuration file;
determining working parameters to be configured from the corresponding configuration template;
extracting a parameter value corresponding to the working parameter to be configured from the working state;
and adding the parameter values into the corresponding configuration templates, and calculating the unit power consumption of the corresponding power consumption module by each configuration template according to the parameter values of the working parameters to be configured.
4. The method according to claim 3, wherein the power consuming module is a voice communication module, and the operating parameters to be configured in the configuration template corresponding to the voice communication module include any one or more of an operating mode and a signal strength.
5. The method of claim 3, further comprising:
receiving an update instruction of a configuration template input by a user through an interface or sent by other terminals, wherein the update instruction carries working parameters to be configured updated by the configuration template, so that the working parameters to be configured of the configuration template are correspondingly updated according to the updated working parameters to be configured.
6. The method of claim 1, wherein determining the power consumption of the terminal for the predetermined period of time according to the unit power consumption of each power consumption module in the terminal comprises:
according to the unit power consumption of each power consumption module in the terminal, carrying out integral or accumulation calculation on the unit power consumption in a preset time period to obtain the power consumption of each power consumption module in the preset time period;
adding the power consumption of each power consumption module in the preset time period to obtain the power consumption of the terminal in the preset time period; or
Adding unit power consumption of each power consumption module in the terminal to obtain the power consumption of the terminal in unit time;
and in the preset time period, performing integral or accumulation calculation on the power consumption of the terminal in unit time to obtain the power consumption of the terminal in the preset time period.
7. An apparatus for determining power consumption of a terminal, the apparatus comprising:
the acquisition module is configured to acquire the working state of the terminal;
a calculation module configured to calculate a unit power consumption amount of at least one power consumption module in the terminal according to the operating state;
the power consumption determining module is configured to determine the power consumed by the terminal within a preset time period according to the unit power consumption of each power consumption module in the terminal;
the calculation module is specifically configured to calculate the unit power consumption of each power consumption module according to the working parameters and the working states to be configured in the configuration template of each power consumption module;
the device further comprises:
and the second updating module is configured to update the to-be-configured working parameters of the configuration template according to the received updating instruction of the configuration template.
8. The apparatus of claim 7, further comprising:
the terminal comprises a detection module, a power consumption updating module and a power consumption updating module, wherein the detection module is configured to update the unit power consumption of at least one power consumption module in the terminal according to the changed working state when detecting that the working state of the terminal changes;
and the first updating module is configured to update the power consumption of the terminal in unit time according to the updated unit power consumption of each power consumption module in the terminal.
9. The apparatus of claim 7 or 8, wherein the computing module comprises:
the acquisition submodule is configured to acquire a configuration template corresponding to each power consumption module from a preset configuration file;
the determining submodule is configured to determine working parameters to be configured from the corresponding configuration template;
the extraction submodule is configured to extract a parameter value corresponding to the working parameter to be configured from the working state;
and the calculation submodule is configured to add the parameter values into the corresponding configuration templates, and the unit power consumption of the corresponding power consumption module is calculated by each configuration template according to the parameter values of the working parameters to be configured.
10. The apparatus according to claim 9, wherein the power consuming module is a voice communication module, and the operating parameters to be configured in the configuration template corresponding to the voice communication module include any one or more of an operating mode and a signal strength.
11. The apparatus of claim 9, further comprising:
the receiving module is configured to receive an update instruction of the configuration template, which is input by a user through an interface or sent by other terminals, where the update instruction carries the to-be-configured working parameters of the configuration template update, so that the second update module correspondingly updates the to-be-configured working parameters of the configuration template according to the updated to-be-configured working parameters.
12. The apparatus of claim 7, wherein the power consumption determination module comprises a first calculation submodule and a second calculation submodule; or a third computation submodule and a fourth computation submodule;
the first calculation submodule is configured to perform integral or accumulation calculation on the unit power consumption in a preset time period according to the unit power consumption of each power consumption module in the terminal to obtain the power consumption of each power consumption module in the preset time period;
the second calculation submodule is configured to add the power consumption of each power consumption module in the preset time period to obtain the power consumption of the terminal in the preset time period; or
The third calculation sub-module is configured to add unit power consumption of each power consumption module in the terminal to obtain power consumption of the terminal in unit time;
the fourth calculating submodule is configured to integrate or accumulate the power consumption of the terminal in unit time in the predetermined time period to obtain the power consumption of the terminal in the predetermined time period.
13. An apparatus for determining power consumption of a terminal, the apparatus comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
acquiring the working state of a terminal;
calculating the unit power consumption of at least one power consumption module in the terminal according to the working state;
determining the power consumption of the terminal in a preset time period according to the unit power consumption of each power consumption module in the terminal;
calculating the unit power consumption of at least one power consumption module in the terminal according to the working state, and the method comprises the following steps:
calculating the unit power consumption of each power consumption module according to the working parameters to be configured in the configuration template of each power consumption module and the working state;
and updating the working parameters to be configured of the configuration template according to the received updating instruction of the configuration template.
CN201610007365.6A 2016-01-06 2016-01-06 Method and device for determining power consumption of terminal Active CN106951050B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610007365.6A CN106951050B (en) 2016-01-06 2016-01-06 Method and device for determining power consumption of terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610007365.6A CN106951050B (en) 2016-01-06 2016-01-06 Method and device for determining power consumption of terminal

Publications (2)

Publication Number Publication Date
CN106951050A CN106951050A (en) 2017-07-14
CN106951050B true CN106951050B (en) 2020-11-06

Family

ID=59465677

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610007365.6A Active CN106951050B (en) 2016-01-06 2016-01-06 Method and device for determining power consumption of terminal

Country Status (1)

Country Link
CN (1) CN106951050B (en)

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102918473B (en) * 2010-06-07 2015-07-08 松下电器(美国)知识产权公司 Mobile-type information processing terminal
WO2012149738A1 (en) * 2011-09-14 2012-11-08 华为技术有限公司 Power management method and device for mobile terminal
CN103914365B (en) * 2012-12-31 2017-03-15 北京金山安全软件有限公司 Method and device for acquiring power consumption of mobile terminal application
CN104281510A (en) * 2013-07-05 2015-01-14 贝壳网际(北京)安全技术有限公司 Method and system for obtaining power consumption degree of application program and energy-saving method and system
CN104635908B (en) * 2013-11-13 2018-09-28 腾讯科技(深圳)有限公司 A kind of method and device for the power consumption reducing mobile terminal
CN104516806B (en) * 2014-12-26 2017-12-08 北京奇虎科技有限公司 The testing result methods of exhibiting and system of the power consumption information of mobile terminal
CN105100429B (en) * 2015-06-08 2018-03-06 北京金山安全软件有限公司 Method and device for determining use time of residual electric quantity of mobile terminal

Also Published As

Publication number Publication date
CN106951050A (en) 2017-07-14

Similar Documents

Publication Publication Date Title
EP3454192B1 (en) Method and device for displaying page
EP3136658B1 (en) Method, device, terminal device, computer program and recording medium for changing emoticon in chat interface
US20180046336A1 (en) Instant Message Processing Method and Apparatus, and Storage Medium
CN105517112B (en) Method and device for displaying WiFi network information
EP3185160A1 (en) Screen unlocking method and apparatus, terminal
CN110231901B (en) Application interface display method and device
CN109961094B (en) Sample acquisition method and device, electronic equipment and readable storage medium
CN105912450B (en) Application state information display method and device
CN106354504B (en) Message display method and device
CN107454204B (en) User information labeling method and device
CN110059547B (en) Target detection method and device
EP3176999A1 (en) Method and device for processing information
EP3089436A1 (en) Methods and devices for calling based on cloud card
CN106155703B (en) Emotional state display method and device
EP3173925B1 (en) Interface display method and apparatus, computer program and recording medium
CN111343481B (en) Data sharing method and device, electronic equipment and storage medium
CN108629814B (en) Camera adjusting method and device
CN112331158B (en) Terminal display adjusting method, device, equipment and storage medium
EP3425533A1 (en) Displaying page
CN106878654B (en) Video communication method and device
CN106506808B (en) Method and device for prompting communication message
CN105786561B (en) Method and device for calling process
EP3125514A1 (en) Method and device for state notification
CN107885464B (en) Data storage method, device and computer readable storage medium
CN107341000B (en) Method and device for displaying fingerprint input image and terminal

Legal Events

Date Code Title Description
PB01 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