CN108196482B - Power consumption control method and device, storage medium and electronic equipment - Google Patents

Power consumption control method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN108196482B
CN108196482B CN201810012096.1A CN201810012096A CN108196482B CN 108196482 B CN108196482 B CN 108196482B CN 201810012096 A CN201810012096 A CN 201810012096A CN 108196482 B CN108196482 B CN 108196482B
Authority
CN
China
Prior art keywords
power consumption
preset
value
power saving
sampling
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.)
Expired - Fee Related
Application number
CN201810012096.1A
Other languages
Chinese (zh)
Other versions
CN108196482A (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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201810012096.1A priority Critical patent/CN108196482B/en
Publication of CN108196482A publication Critical patent/CN108196482A/en
Application granted granted Critical
Publication of CN108196482B publication Critical patent/CN108196482B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/042Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors
    • G05B19/0423Input/output
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/20Pc systems
    • G05B2219/25Pc structure of the system
    • G05B2219/25257Microcontroller

Abstract

The application discloses a power consumption control method, a device, a storage medium and an electronic device, wherein the power consumption control method comprises the following steps: acquiring a power consumption detection instruction; starting a timer to time according to the power consumption detection instruction; in the timing process, acquiring the current value of the electronic equipment at each sampling moment; determining a target power saving strategy according to the current value and the timing duration; the target power saving strategy is executed to control the power consumption of the electronic equipment, so that different power saving schemes can be started in real time according to the power consumption condition of the electronic equipment, the power consumption of the electronic equipment is effectively reduced, and the method is simple, high in flexibility and good in power saving effect.

Description

Power consumption control method and device, storage medium and electronic equipment
Technical Field
The present application relates to the field of computer technologies, and in particular, to a power consumption control method and apparatus, a storage medium, and an electronic device.
Background
The current mobile terminal can customize various application functions according to the user requirements, and is an intelligent terminal capable of completing multiple functions such as telephone making, multimedia, internet surfing, social contact, application, third-party office and the like.
Generally, the more function applications of the intelligent terminal mean the greater power consumption, and as the number of cores of the processor of the intelligent terminal increases, the power consumption of the processor of the intelligent terminal also increases, which results in the need to increase the battery capacity of the terminal, but the increase of the battery capacity causes the pressure of the battery volume becoming larger and the cost to be increased.
Therefore, terminal manufacturers have adjusted the power consumption of each single function of the terminal to be optimal in a development stage, but different users have different use habits, and in the actual use process, concurrent operation, process scheduling, networking power consumption and the like of multiple functions cannot be predicted, so that accurate power consumption optimization is difficult to achieve, the power consumption of the terminal in the use process of the user cannot be effectively reduced, and the purposes of saving energy and prolonging cruising ability are achieved.
Disclosure of Invention
The embodiment of the application provides a power consumption control method and device, a storage medium and electronic equipment, which can effectively reduce power consumption in the operation process of the electronic equipment.
The embodiment of the application provides a power consumption control method, which comprises the following steps:
acquiring a power consumption detection instruction;
starting a timer to time according to the power consumption detection instruction;
in the timing process, acquiring a current value of the electronic equipment at each sampling moment;
determining a target power saving strategy according to the current value and the timing duration;
and executing the target power saving strategy to control the power consumption of the electronic equipment.
An embodiment of the present application further provides a power consumption control apparatus, including:
the first acquisition module is used for acquiring a power consumption detection instruction;
the starting module is used for starting a timer to time according to the power consumption detection instruction;
the second acquisition module is used for acquiring the current value of the electronic equipment at each sampling moment in the timing process;
the determining module is used for determining a target power saving strategy according to the current value and the timing duration;
and the execution module is used for executing the target power saving strategy so as to control the power consumption of the electronic equipment.
The embodiment of the application also provides a storage medium, wherein a plurality of instructions are stored in the storage medium, and the instructions are suitable for being loaded by a processor to execute any one of the above power consumption control methods.
An embodiment of the present application further provides an electronic device, which includes a processor and a memory, where the processor is electrically connected to the memory, the memory is used to store instructions and data, and the processor is used in any one of the steps in the power consumption control method.
According to the power consumption control method, the power consumption detection instruction is obtained, the timer is started to time according to the power consumption detection instruction, the current value of the electronic equipment at each sampling moment is obtained in the timing process, the target power saving strategy is determined according to the current value and the timing duration, and then the target power saving strategy is executed to control the power consumption of the electronic equipment, so that different power saving schemes can be started according to the power consumption condition of the electronic equipment in real time, the power consumption of the electronic equipment is effectively reduced, and the method is simple, high in flexibility and good in power saving effect.
Drawings
The technical solution and other advantages of the present application will become apparent from the detailed description of the embodiments of the present application with reference to the accompanying drawings.
Fig. 1 is a schematic flow chart of a power consumption control method according to an embodiment of the present application.
Fig. 2 is another schematic flow chart of a power consumption control method according to an embodiment of the present application.
Fig. 3 is a schematic diagram of a framework of a power consumption control process according to an embodiment of the present application.
Fig. 4 is a schematic flowchart of step 207 according to an embodiment of the present application.
Fig. 5 is a schematic structural diagram of a power consumption control apparatus according to an embodiment of the present application.
Fig. 6 is a schematic structural diagram of a determination module according to an embodiment of the present application.
Fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The embodiment of the application provides a power consumption control method and device, a storage medium and electronic equipment.
A power consumption control method is applied to electronic equipment and comprises the following steps: acquiring a power consumption detection instruction; starting a timer to time according to the power consumption detection instruction; in the timing process, acquiring the current value of the electronic equipment at each sampling moment; determining a target power saving strategy according to the current value and the timing duration; and executing the target power saving strategy to control the power consumption of the electronic equipment.
As shown in fig. 1, fig. 1 is a schematic flow chart of a power consumption control method provided in the embodiment of the present application, and a specific flow may be as follows:
101. and acquiring a power consumption detection instruction.
In this embodiment, the power consumption detection instruction may be automatically generated, for example, when the electronic device is turned on, or a screen is turned on for the first time, or the electric quantity is lower than a certain value, the power consumption detection instruction is automatically triggered and generated, or may be manually triggered and generated by a user, for example, the user may manually click a certain key to generate the power consumption detection instruction when the operating speed of the electronic device is slow.
102. And starting a timer for timing according to the power consumption detection instruction.
103. And in the timing process, acquiring the current value of the electronic equipment at each sampling moment.
In this embodiment, the sampling time is mainly determined according to a sampling frequency, and the sampling frequency may be set manually once in 2s, once per second, and the like, for example, when the sampling frequency is set once in 2s, the sampling time may be a 2s timing time, a 4s timing time, a 6s timing time, and the like. The current value mainly refers to output current, the power consumption of a battery of the electronic equipment can be accurately measured, and generally, the brightness of a screen, running application and the like can affect the magnitude of the output current.
104. And determining a target power saving strategy according to the current value and the timing duration.
For example, the step 104 may specifically include:
1-1, determining the sampling duration range to which the current timing duration belongs.
In this embodiment, the sampling duration range may be set manually, and may have the same time starting point, such as 0-1 min, 0-5 min, 0-10 min, and the like, or may have different time starting points, such as 0-1 min, 1-5 min, 5-10 min, and the like, and the specific setting form may be determined according to actual requirements.
And 1-2, acquiring a preset power consumption value corresponding to the sampling duration range.
In this embodiment, the preset power consumption value may be set in advance according to characteristics of the electronic device (e.g., the number of cores of the CPU and the size of the display screen), such as 1000mA/h, 600mA/h or 300mA/h, and the preset power consumption values of different electronic devices may be different, such as the larger the number of cores of the CPU of the electronic device is, or the larger the size of the display screen is, the larger the preset power consumption value thereof may be. It should be noted that the preset power consumption value and the sampling duration range should be stored in the electronic device in advance in a one-to-one correspondence manner.
1-3, judging whether power saving operation is needed or not according to the current value and a preset power consumption value;
if so, acquiring a preset power saving strategy corresponding to the sampling duration range as a target power saving strategy;
if not, returning to execute the operation of determining the sampling duration range to which the current timing duration belongs, and stopping until the current timing duration reaches a preset threshold value.
In this embodiment, the preset power saving policy may relate to multiple aspects, such as brightness adjustment of a display screen, background application cleaning, and the like, a user may set a preset power saving policy of a required level in the electronic device in advance, the preset power saving policies of different levels may correspond to different sampling duration ranges, so as to achieve different power saving strengths, the number of specific levels may be determined according to characteristics of the electronic device itself (such as the number of cores of a CPU and the size of the display screen), for example, the electronic device a may divide three levels, and the electronic device B may divide four levels. Generally, the power saving operation is performed only when it is determined that the preset power saving policy of the current level needs to be executed, and if it is determined that the preset power saving policy of the current level does not need to be executed, it is continuously detected whether the preset power saving policy of the next level needs to be executed until it is determined that all the preset power saving policies do not need to be executed.
The determining result mainly depends on whether the actual power consumption value of the electronic device exceeds the preset power consumption value, that is, the step of determining whether the power saving operation is required according to the current value and the preset power consumption value may specifically include:
calculating the product of the current value and the corresponding sampling moment;
determining an actual power consumption value according to the product and the current timing duration;
and when the actual power consumption value is not less than the preset power consumption value, judging that power-saving operation is required.
In this embodiment, the actual power consumption may be calculated by a current value, the average power consumption value may be calculated according to the actual power consumption, and the average power consumption value is compared with the preset power consumption value as the actual power consumption value, that is, the step of "determining the actual power consumption value according to the product and the current timing duration" may further include:
accumulating the product to obtain an accumulated value;
and calculating the ratio of the accumulated value to the current timing duration, and taking the ratio as an actual power consumption value.
In this embodiment, the product of each current value and the corresponding sampling time may be accumulated to be used as the power consumption in the period of time duration, and then the product is divided by the whole time duration to obtain an average power consumption value, which is used as the actual power consumption value.
105. And executing the target power saving strategy to control the power consumption of the electronic equipment.
For example, the step 105 may specifically include:
counting the running number of the background applications;
judging whether the running number exceeds a preset number or not;
if so, calculating a difference value between the running number and a preset number, and acquiring the background running time length and/or a preset priority of the background application;
and selecting the target application with the difference quantity from the background applications according to the background running time length and/or the preset priority to close.
In this embodiment, the preset number may be 5 or 6, and the preset numbers corresponding to the preset power saving policies of different levels may be different. When the number of the background running applications is larger than the preset number corresponding to the current level, the background applications exceeding the number need to be selected for closing so as to reduce the power consumption of the electronic equipment. The specific selection mode may be selected according to actual requirements, for example, according to factors such as a background application running time length, a preset priority level, and/or a CPU occupancy rate, and generally, a longer background running time length represents a longer idle time, a lower priority level represents a lower importance, a higher CPU occupancy rate represents a greater influence on power consumption, and the applications may be preferentially closed.
Of course, the target power saving policy may also relate to the aspects of adjusting the brightness of the display screen, updating the application version, and the like, such as reducing the brightness of the display screen to a certain value, updating the background application that consumes more power to the latest version, and the like. And when the target power saving strategy is executed, the electronic equipment can also generate a current oscillogram according to the current value and the sampling moment, so that when a user wants to check the power consumption details, the power consumption details can be directly displayed to the user, the user can intuitively feel the change of the system power consumption, and the user experience effect is enhanced.
As can be seen from the above, the power consumption control method provided in this embodiment is applied to an electronic device, and is implemented by obtaining a power consumption detection instruction, starting a timer according to the power consumption detection instruction, obtaining a current value of the electronic device at each sampling time in the timing process, determining a target power saving policy according to the current value and a timing duration, and then executing the target power saving policy to control the power consumption of the electronic device, so that different power saving schemes can be started according to the power consumption condition of the electronic device in real time, and the power consumption control method effectively reduces the power consumption of the electronic device.
In the present embodiment, a description will be made from the viewpoint of the power consumption control device, and in particular, a detailed description will be given taking an example in which the power consumption control device is integrated in an electronic apparatus.
Referring to fig. 2 and fig. 3, a power consumption control method applied to an electronic device may include the following specific processes:
201. the electronic device obtains a power consumption detection instruction.
For example, when the electronic device is turned on, or the screen is turned on for the first time, or the power consumption is lower than a certain value, the power consumption detection command is automatically triggered and generated.
202. And the electronic equipment starts a timer to time according to the power consumption detection instruction.
203. In the timing process, the electronic device obtains a current value at each sampling instant.
For example, when the sampling frequency is artificially set once per second, each timing time is a sampling time, such as 1 st s, 2 nd s, etc., and the current value mainly refers to the output current.
204. The electronic equipment determines a sampling duration range to which the current timing duration belongs, and acquires a preset power consumption value corresponding to the sampling duration range.
For example, a user may set a plurality of power saving levels in advance according to characteristics of the electronic device, such as the number of cores of a CPU, the size of a display screen, and the like, for example, n power saving levels S1 is divided into 1, S2 is divided into 3, S3 is divided into 3.. Sn is divided into n, each power saving level sets a sampling duration range, such as 0 to T1, 0 to T2, and 0 to T3.. 0 to Tn, each sampling duration range sets a preset power consumption value, such as W1, W2, and W3... Wn, and specific mapping relationships may be referred to in table 1 below.
Class of power saving S1 S2 S3 ....... Sn
Preset power consumption value corresponding to power saving grade W1 W2 W3 ....... Wn
Sampling duration range corresponding to power saving level 0~T1 0~T2 0~T3 ....... 0~Tn
Actual power consumption value of power saving class pair w1 w2 w3 ....... wn
TABLE 1
205. The electronic equipment calculates the product of the current value and the corresponding sampling moment, and accumulates the product to obtain an accumulated value.
206. The electronic device calculates a ratio of the accumulated value to the current timing duration, and uses the ratio as an actual power consumption value, and then determines whether the actual power consumption value is not less than a preset power consumption value, if so, the following step 207 is executed, and if not, the following step 208 is executed.
For example, the product of each current value and the corresponding sampling time may be accumulated to obtain the power consumption amount in the time period, and then divided by the whole time period to obtain the average power consumption value, which is used as the actual power consumption value, for example, the actual power consumption value in the sampling time period range from 0 to Ti may be Wi, and the magnitudes of Wi and Wi need to be compared at this time.
207. The electronic equipment acquires a preset power saving strategy corresponding to the sampling duration range, and the preset power saving strategy is used as a target power saving strategy, and the target power saving strategy is executed so as to control the power consumption of the electronic equipment.
For example, referring to fig. 4, the step 207 may further include:
2071. the electronic equipment counts the running number of background applications;
2072. the electronic equipment judges whether the running number exceeds a preset number or not;
2073. if so, the electronic equipment calculates the difference between the running number and the preset number, and acquires the background running time length and/or the preset priority of the background application;
and selecting the target application with the difference quantity from the background applications according to the background running time length and/or the preset priority to close.
For example, the predetermined number may be 5 which is set manually. If Wi is larger than or equal to Wi, it is indicated that the current actual power consumption exceeds the ideal range, power saving operation needs to be performed, at this time, whether the total number of background applications exceeds a preset number or not can be detected, and if the total number exceeds the preset number, the background running time is too long, or the background applications with lower preset priority are closed, so that the number of the background applications is controlled within the preset number.
208. The electronic device determines whether the current timing duration reaches a preset threshold, if so, the timing is cleared, and the step 202 is returned to be executed, and if not, the step 204 is returned to be executed.
For example, when Wi < Wi, it indicates that the current actual power consumption is within the ideal range, the power saving operation of the current power saving level is not needed, but it needs to continuously determine whether the power saving operation of the next level needs to be performed, that is, it needs to return to the operation of determining the sampling duration range again according to the timing duration t until the current timing duration t reaches Tn.
As can be seen from the above, the power consumption control method provided in this embodiment is applied to an electronic device, where the electronic device can obtain a power consumption detection instruction, start a timer to time according to the power consumption detection instruction, then obtain a current value at each sampling time in the timing process, determine a sampling time range to which a current timing time belongs, then obtain a preset power consumption value corresponding to the sampling time range, calculate a product of the current value and the corresponding sampling time, then accumulate the product to obtain an accumulated value, then calculate a ratio of the accumulated value to the current timing time, and use the ratio as an actual power consumption value, then determine whether the actual power consumption value is not less than the preset power consumption value, if so, obtain a preset power saving policy corresponding to the sampling time range, as a target power saving policy, and execute the target power saving policy, the power consumption of the electronic equipment is controlled, so that different power saving schemes can be started in real time according to the power consumption condition of the electronic equipment, the power consumption of the electronic equipment is effectively reduced, and the method is simple, high in flexibility and good in power saving effect.
According to the method described in the foregoing embodiment, the embodiment will be further described from the perspective of a power consumption control device, which may be specifically implemented as a stand-alone entity, or may be implemented by being integrated in an electronic device, such as a terminal, where the terminal may include a mobile phone, a tablet computer, a personal computer, and the like.
Referring to fig. 5, fig. 5 specifically describes a power consumption control apparatus provided in an embodiment of the present application, which is applied to an electronic device, and the power consumption control apparatus may include: a first obtaining module 10, a starting module 20, a second obtaining module 30, a determining module 40 and an executing module 50, wherein:
(1) first acquisition module 10
The first obtaining module 10 is configured to obtain a power consumption detection instruction.
In this embodiment, the power consumption detection instruction may be automatically generated, for example, when the electronic device is turned on, or a screen is turned on for the first time, or the electric quantity is lower than a certain value, the power consumption detection instruction is automatically triggered to be generated, or may be manually triggered to be generated by a user, for example, the user may click a certain key to generate the power consumption detection instruction when the operating speed of the electronic device is relatively low.
(2) Start module 20
And a starting module 20, configured to start a timer to time according to the power consumption detection instruction.
(3) Second acquisition module 30
And the second obtaining module 30 is configured to obtain a current value of the electronic device at each sampling time in the timing process.
In this embodiment, the sampling time is mainly determined according to a sampling frequency, and the sampling frequency may be set manually once in 2s, once per second, and the like, for example, when the sampling frequency is set once in 2s, the sampling time may be a 2s timing time, a 4s timing time, a 6s timing time, and the like. The current value mainly refers to output current, the power consumption of a battery of the electronic equipment can be accurately measured, and generally, the brightness of a screen, running application and the like can affect the magnitude of the output current.
(4) Determination module 40
And the determining module 40 is used for determining a target power saving strategy according to the current value and the timing duration.
For example, referring to fig. 6, the determining module 40 may specifically include a determining sub-module 41, an obtaining sub-module 42, and a determining sub-module 43, where:
and the determining submodule 41 is used for determining the sampling duration range to which the current timing duration belongs.
In this embodiment, the sampling duration range may be set manually, and may have the same time starting point, such as 0-1 min, 0-5 min, 0-10 min, and the like, or may have different time starting points, such as 0-1 min, 1-5 min, 5-10 min, and the like, and the specific setting form may be determined according to actual requirements.
And the obtaining submodule 42 is configured to obtain a preset power consumption value corresponding to the sampling duration range.
In this embodiment, the preset power consumption value may be set in advance according to characteristics of the electronic device (e.g., the number of cores of the CPU and the size of the display screen), such as 1000mA/h, 600mA/h or 300mA/h, and the preset power consumption values of different electronic devices may be different, such as the larger the number of cores of the CPU of the electronic device is, or the larger the size of the display screen is, the larger the preset power consumption value thereof may be. It should be noted that the preset power consumption value and the sampling duration range should be stored in the electronic device in advance in a one-to-one correspondence manner.
A judging submodule 43, configured to judge whether a power saving operation is required according to the current value and a preset power consumption value;
if so, acquiring a preset power saving strategy corresponding to the sampling duration range as a target power saving strategy;
if not, returning to execute the operation of determining the sampling duration range to which the current timing duration belongs, and stopping until the current timing duration reaches a preset threshold value.
In this embodiment, the preset power saving policy may relate to multiple aspects, such as brightness adjustment of a display screen, background application cleaning, and the like, a user may set a preset power saving policy of a required level in the electronic device in advance, the preset power saving policies of different levels may correspond to different sampling duration ranges, so as to achieve different power saving strengths, the number of specific levels may be determined according to characteristics of the electronic device itself (such as the number of cores of a CPU and the size of the display screen), for example, the electronic device a may divide three levels, and the electronic device B may divide four levels. Generally, the power saving operation is performed only when it is determined that the preset power saving policy of the current level needs to be executed, and if it is determined that the preset power saving policy of the current level does not need to be executed, it is continuously detected whether the preset power saving policy of the next level needs to be executed until it is determined that all the preset power saving policies do not need to be executed.
Wherein, the determination result mainly depends on whether the actual power consumption value of the electronic device exceeds the preset power consumption value, that is, the determining submodule 43 is further configured to:
calculating the product of the current value and the corresponding sampling moment;
determining an actual power consumption value according to the product and the current timing duration;
and when the actual power consumption value is not less than the preset power consumption value, judging that power-saving operation is required.
In this embodiment, the actual power consumption may be calculated by the current value, the average power consumption value may be calculated according to the actual power consumption, and the average power consumption value is compared with the preset power consumption value as the actual power consumption value, that is, the determining submodule 43 may be further configured to:
accumulating the product to obtain an accumulated value;
and calculating the ratio of the accumulated value to the current timing duration, and taking the ratio as an actual power consumption value.
In this embodiment, the determining submodule 43 may accumulate the product of each current value and the corresponding sampling time to obtain the power consumption in the period of time duration, then divide the power consumption by the whole time duration to obtain an average power consumption value, and use the average power consumption value as the actual power consumption value.
(5) Execution module 50
And an executing module 50, configured to execute the target power saving policy to control power consumption of the electronic device.
For example, the execution module 50 may specifically be configured to:
counting the running number of the background applications;
judging whether the running number exceeds a preset number or not;
if so, calculating a difference value between the running number and a preset number, and acquiring the background running time length and/or a preset priority of the background application;
and selecting the target application with the difference quantity from the background applications according to the background running time length and/or the preset priority to close.
In this embodiment, the preset number may be 5 or 6, and the preset numbers corresponding to the preset power saving policies of different levels may be different. When the number of the background running applications is greater than the preset number corresponding to the current level, the execution module 50 needs to select an excess portion of the background applications to close, so as to reduce the power consumption of the electronic device. The specific selection mode may be selected according to actual requirements, for example, according to factors such as a background application running time length, a preset priority level, and/or a CPU occupancy rate, and generally, a longer background running time length represents a longer idle time, a lower priority level represents a lower importance, a higher CPU occupancy rate represents a greater influence on power consumption, and the applications may be preferentially closed.
Of course, the target power saving policy may also relate to the adjustment of the brightness of the display screen, the update of the application version, and so on, for example, the execution module 50 reduces the brightness of the display screen to a certain value, updates the background application that consumes more power to the latest version, and so on. In addition, while executing the target power saving policy, the execution module 50 may also generate a current waveform according to the current value and the sampling time, so that when a user wants to check the power consumption details, the current waveform can be directly displayed to the user, so that the user can intuitively feel the change of the system power consumption, and the user experience effect is enhanced.
In a specific implementation, the above units may be implemented as independent entities, or may be combined arbitrarily to be implemented as the same or several entities, and the specific implementation of the above units may refer to the foregoing method embodiments, which are not described herein again.
As can be seen from the above, the power consumption control method provided in this embodiment is applied to an electronic device, a power consumption detection instruction is obtained by the first obtaining module 10, the starting module 20 starts a timer to time according to the power consumption detection instruction, during the time counting, the second obtaining module 30 obtains a current value of the electronic device at each sampling time, the determining module 40 determines a target power saving policy according to the current value and a time duration, and then the executing module 50 executes the target power saving policy to control the power consumption of the electronic device, so that different power saving schemes can be started according to the power consumption condition of the electronic device in real time, and the power consumption of the electronic device is effectively reduced.
In addition, the embodiment of the application also provides electronic equipment which can be equipment such as a smart phone and a tablet computer. As shown in fig. 7, the electronic device 900 includes a processor 901, a memory 902, a display 903, and a control circuit 904. The processor 901 is electrically connected to the memory 902, the display 903, and the control circuit 904.
The processor 901 is a control center of the electronic device 900, connects various parts of the whole electronic device by using various interfaces and lines, executes various functions of the electronic device and processes data by running or loading an application program stored in the memory 902 and calling the data stored in the memory 902, thereby performing overall monitoring of the electronic device.
In this embodiment, the processor 901 in the electronic device 900 loads instructions corresponding to processes of one or more application programs into the memory 902 according to the following steps, and the processor 901 runs the application programs stored in the memory 902, so as to implement various functions:
acquiring a power consumption detection instruction;
starting a timer to time according to the power consumption detection instruction;
in the timing process, acquiring the current value of the electronic equipment at each sampling moment;
determining a target power saving strategy according to the current value and the timing duration;
and executing the target power saving strategy to control the power consumption of the electronic equipment.
Memory 902 may be used to store applications and data. The memory 902 stores applications containing instructions executable in the processor. The application programs may constitute various functional modules. The processor 901 executes various functional applications and data processing by running an application program stored in the memory 902.
The display 903 may be used to display information input by or provided to the user as well as various graphical user interfaces of the terminal, which may be comprised of images, text, icons, video, and any combination thereof.
The control circuit 904 is electrically connected to the display 903, and is configured to control the display 903 to display information.
In some embodiments, as shown in fig. 7, electronic device 900 further comprises: a radio frequency circuit 905, an input unit 906, an audio circuit 907, a sensor 908, and a power supply 909. The processor 901 is electrically connected to the rf circuit 905, the input unit 906, the audio circuit 907, the sensor 908, and the power source 909.
The radio frequency circuit 905 is configured to receive and transmit radio frequency signals, so as to establish wireless communication with a network device or other electronic devices through wireless communication, and receive and transmit signals with the network device or other electronic devices.
The input unit 906 may be used to receive input numbers, character information, or user characteristic information (e.g., a fingerprint), and to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control. The input unit 906 may include a fingerprint recognition module.
The audio circuit 907 may provide an audio interface between the user and the terminal through a speaker, microphone, or the like.
The electronic device 900 may also include at least one sensor 908, such as light sensors, motion sensors, and other sensors. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display panel according to the brightness of ambient light, and a proximity sensor that may turn off the display panel and/or the backlight when the terminal is moved to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when the mobile phone is stationary, and can be used for applications of recognizing the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer and tapping), and the like; as for other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which can be configured in the terminal, detailed description is omitted here.
The power supply 909 is used to supply power to the various components of the electronic device 900. In some embodiments, the power source 909 may be logically connected to the processor 901 through a power management system, so that functions of managing charging, discharging, and power consumption management are realized through the power management system.
Although not shown in fig. 7, the electronic device 900 may further include a camera, a bluetooth module, etc., which are not described in detail herein.
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by instructions or by associated hardware controlled by the instructions, which may be stored in a computer readable storage medium and loaded and executed by a processor. To this end, embodiments of the present invention provide a storage medium, in which a plurality of instructions are stored, and the instructions can be loaded by a processor to execute steps in any one of the power consumption control methods provided by the embodiments of the present invention.
Wherein the storage medium may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
Since the instructions stored in the storage medium may execute the steps in any power consumption control method provided in the embodiments of the present invention, beneficial effects that can be achieved by any power consumption control method provided in the embodiments of the present invention may be achieved, which are detailed in the foregoing embodiments and will not be described herein again.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
In summary, although the present application has been described with reference to the preferred embodiments, the above-described preferred embodiments are not intended to limit the present application, and those skilled in the art can make various changes and modifications without departing from the spirit and scope of the present application, so that the scope of the present application shall be determined by the appended claims.

Claims (8)

1. A power consumption control method applied to an electronic device is characterized by comprising the following steps:
acquiring a power consumption detection instruction;
starting a timer to time according to the power consumption detection instruction;
in the timing process, acquiring a current value of the electronic equipment at each sampling moment;
determining a sampling duration range to which the current timing duration belongs;
acquiring a preset power consumption value corresponding to the sampling duration range;
calculating the product of the current value and the corresponding sampling moment;
determining an actual power consumption value according to the product and the current timing duration;
when the actual power consumption value is not less than a preset power consumption value, acquiring a preset power saving strategy corresponding to the sampling duration range as a target power saving strategy, wherein the preset power saving strategy is set by a user in the electronic equipment in advance according to a required grade, the preset power saving strategies of different grades correspond to different sampling duration ranges, and each sampling duration range is set with a preset power consumption value; the power saving strategy comprises at least one of display screen brightness adjustment and background application cleaning;
if not, returning to execute the operation of determining the sampling duration range to which the current timing duration belongs, and stopping until the current timing duration reaches a preset threshold;
and executing the target power saving strategy to control the power consumption of the electronic equipment, and generating a current oscillogram according to the current value and the sampling time.
2. The power consumption control method of claim 1, wherein determining the actual power consumption value based on the product and a current timing duration comprises:
accumulating the products to obtain an accumulated value;
and calculating the ratio of the accumulated value to the current timing duration, and taking the ratio as an actual power consumption value.
3. The power consumption control method of any one of claims 1-2, wherein the executing the target power saving policy comprises:
counting the running number of the background applications;
judging whether the running number exceeds a preset number or not;
if so, calculating a difference value between the running number and a preset number, and acquiring the background running time length and/or a preset priority of the background application;
and selecting the target application with the difference quantity from the background applications according to the background running time length and/or the preset priority to close.
4. A power consumption control apparatus, comprising:
the first acquisition module is used for acquiring a power consumption detection instruction;
the starting module is used for starting a timer to time according to the power consumption detection instruction;
the second acquisition module is used for acquiring the current value of the electronic equipment at each sampling moment in the timing process;
the determining module is used for determining a target power saving strategy according to the current value and the timing duration;
the execution module is used for executing the target power saving strategy so as to control the power consumption of the electronic equipment and generate a current oscillogram according to the current value and the sampling moment;
the determining module specifically includes:
the determining submodule is used for determining a sampling duration range to which the current timing duration belongs;
the acquisition submodule is used for acquiring a preset power consumption value corresponding to the sampling duration range;
the judging submodule is used for judging whether power saving operation is needed or not according to the current value and a preset power consumption value;
if yes, acquiring a preset power saving strategy corresponding to the sampling duration range as a target power saving strategy, wherein the preset power saving strategy is set in the electronic equipment by a user in advance according to a required grade, the preset power saving strategies of different grades correspond to different sampling duration ranges, and each sampling duration range is set with a preset power consumption value; the power saving strategy comprises at least one of display screen brightness adjustment and background application cleaning;
if not, returning to execute the operation of determining the sampling duration range to which the current timing duration belongs, and stopping until the current timing duration reaches a preset threshold;
the judgment submodule is specifically configured to:
calculating the product of the current value and the corresponding sampling moment;
determining an actual power consumption value according to the product and the current timing duration;
and when the actual power consumption value is not less than the preset power consumption value, judging that power saving operation is required.
5. The power consumption control device of claim 4, wherein the determining sub-module is further configured to accumulate the products to obtain an accumulated value; and calculating the ratio of the accumulated value to the current timing duration, and taking the ratio as an actual power consumption value.
6. The power consumption control device of claim 4, wherein the execution module is further configured to count the number of running background applications; judging whether the running number exceeds a preset number or not; if so, calculating a difference value between the running number and a preset number, and acquiring the background running time length and/or a preset priority of the background application; and selecting the target application with the difference quantity from the background applications according to the background running time length and/or the preset priority to close.
7. A storage medium having stored therein a plurality of instructions adapted to be loaded by a processor to perform the power consumption control method of any one of claims 1 to 3.
8. An electronic device comprising a processor and a memory, the processor being electrically connected to the memory, the memory being configured to store instructions and data, the processor being configured to perform the steps of the power consumption control method of any one of claims 1 to 3.
CN201810012096.1A 2018-01-05 2018-01-05 Power consumption control method and device, storage medium and electronic equipment Expired - Fee Related CN108196482B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810012096.1A CN108196482B (en) 2018-01-05 2018-01-05 Power consumption control method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810012096.1A CN108196482B (en) 2018-01-05 2018-01-05 Power consumption control method and device, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN108196482A CN108196482A (en) 2018-06-22
CN108196482B true CN108196482B (en) 2022-02-18

Family

ID=62587935

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810012096.1A Expired - Fee Related CN108196482B (en) 2018-01-05 2018-01-05 Power consumption control method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN108196482B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111198607B (en) * 2018-11-20 2022-11-25 浙江宇视科技有限公司 Method and device for managing power consumption of electronic equipment
CN111796654B (en) * 2019-04-09 2022-05-31 Oppo广东移动通信有限公司 Power saving processing method and device, storage medium and electronic equipment
CN110658904A (en) * 2019-09-19 2020-01-07 Oppo广东移动通信有限公司 Method and device for controlling terminal current, terminal and storage medium
CN114138098B (en) * 2022-02-07 2022-04-29 苏州浪潮智能科技有限公司 Power consumption adjusting method and device, storage device and readable storage medium
CN116540660B (en) * 2023-07-07 2023-09-12 岑科科技(深圳)集团有限公司 Method, device, equipment and storage medium for adjusting production power consumption of chip inductor

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103037108A (en) * 2012-12-10 2013-04-10 乐蛙科技(上海)有限公司 Power saving method for smart mobile terminal
CN106020420A (en) * 2016-05-16 2016-10-12 深圳天珑无线科技有限公司 Power consumption reduction method and electronic device
CN107357620A (en) * 2017-07-14 2017-11-17 广东欧珀移动通信有限公司 A kind of method of adjustment of application program, device, mobile terminal and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI531131B (en) * 2014-06-25 2016-04-21 rui-jie Qiu Current detection and management device
CN104765438A (en) * 2015-04-29 2015-07-08 集怡嘉数码科技(深圳)有限公司 Method for controlling power consumption and mobile terminal
CN105676998A (en) * 2016-01-11 2016-06-15 上海传英信息技术有限公司 Graded electricity saving method for intelligent terminal device
CN106200872A (en) * 2016-06-30 2016-12-07 维沃移动通信有限公司 A kind of terminal and the management method of power consumption thereof

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103037108A (en) * 2012-12-10 2013-04-10 乐蛙科技(上海)有限公司 Power saving method for smart mobile terminal
CN106020420A (en) * 2016-05-16 2016-10-12 深圳天珑无线科技有限公司 Power consumption reduction method and electronic device
CN107357620A (en) * 2017-07-14 2017-11-17 广东欧珀移动通信有限公司 A kind of method of adjustment of application program, device, mobile terminal and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于C8051F330单片机的积分式电量表;刘俊峰;《新乡学院学报》;20091230;正文第32页 *

Also Published As

Publication number Publication date
CN108196482A (en) 2018-06-22

Similar Documents

Publication Publication Date Title
CN108196482B (en) Power consumption control method and device, storage medium and electronic equipment
CN107463403B (en) Process control method, device, storage medium and electronic equipment
CN109388220B (en) Power supply management method and mobile terminal
CN107463436B (en) process control method, device, storage medium and electronic equipment
CN107302633B (en) Application control method, device, storage medium and electronic equipment
CN111324235A (en) Screen refreshing frequency adjusting method and electronic equipment
CN107733016B (en) Mobile terminal charging control method and mobile terminal
CN108322599B (en) Network access method and mobile terminal
CN106371326B (en) Storage method and device for equipment working scene
CN107613146A (en) A kind of method for regulation of sound volume, device and mobile terminal
CN108984066B (en) Application icon display method and mobile terminal
CN114510140B (en) Frequency modulation method and device and electronic equipment
CN107332997A (en) Reduce method, device, mobile terminal and the storage medium of terminal heating
CN112214112A (en) Parameter adjusting method and device
CN107797832B (en) Application cleaning method and device, storage medium and electronic equipment
CN108601048B (en) Flow control method and mobile terminal
CN111651030B (en) Sensor detection method and device, storage medium and mobile terminal
CN115985323B (en) Voice wakeup method and device, electronic equipment and readable storage medium
CN110489177B (en) Application control method and device, storage medium and terminal equipment
CN111431250A (en) Electric quantity display method and device and electronic equipment
CN112312542B (en) Ephemeris information collection method, device, storage medium and mobile terminal
CN115118636A (en) Method and device for determining network jitter state, electronic equipment and storage medium
CN110941326B (en) Voltage control method and electronic equipment
CN110995324B (en) Bluetooth communication method, device, storage medium and terminal equipment
CN109672242B (en) Terminal charging control method and device and storage medium

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 523860 No. 18, Wu Sha Beach Road, Changan Town, Dongguan, Guangdong

Applicant after: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

Address before: 523860 No. 18, Wu Sha Beach Road, Changan Town, Dongguan, Guangdong

Applicant before: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20220218