A power consumption control method and electronic device
By using a PID controller to monitor and calculate power consumption errors in real time and dynamically adjust the target subsystem parameters of electronic devices, the problems of inaccurate power consumption adjustment and low efficiency in existing technologies are solved, and fast and accurate power consumption control is achieved.
Patent Information
- Application Number
- CN202411588833.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-08
- Publication Date
- 2026-01-09
- Estimated Expiration
- 2044-11-08
AI Technical Summary
Existing technologies cannot accurately adjust the power consumption of electronic devices to the expected value, and the adjustment process is lengthy and inefficient.
A PID controller is used to obtain the current and historical power consumption error of the target subsystem. The target value of the parameter to be adjusted is determined by a proportional, integral, and derivative controller. The parameters of the target subsystem are dynamically adjusted to achieve fast and accurate power consumption control.
The accuracy and efficiency of power consumption regulation have been optimized, so that the power consumption of the target subsystem is kept within the set target value, which meets the system's power consumption control requirements and improves the power consumption management capability of the subsystem under various loads or operating conditions.
Smart Images

Figure CN119088194B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the technical field of electronic devices, and in particular to a power consumption control method and an electronic device. BACKGROUND
[0002] In the running process of an electronic device, the power consumption of the electronic device can be adjusted to improve user experience and protect the electronic device. By adjusting the power consumption of the electronic device, the endurance time of the electronic device can be optimized, the heat can be reduced, the system can be prevented from being stuck or crashed due to high load, and the service life of the device can be prolonged.
[0003] Currently, when the power consumption of an electronic device is adjusted, the power consumption cannot be accurately adjusted to an expected value, and the adjustment process is long and the adjustment efficiency is low. SUMMARY
[0004] Embodiments of the present application provide a power consumption control method and an electronic device to improve the low adjustment efficiency and the problem of not meeting the delay requirement of the prior art.
[0005] To achieve the above object, embodiments of the present application adopt the following technical solutions:
[0006] In a first aspect, the embodiments of the present application provide a power consumption control method, comprising: obtaining a power consumption error of a target subsystem in a current sampling period and a power consumption error of the target subsystem in a historical sampling period, a Proportional Integral Derivative (PID) controller determining a target value of an adjustment parameter of the target subsystem according to the power consumption error of the target subsystem in the current sampling period and the power consumption error of the target subsystem in the historical sampling period, and adjusting the adjustment parameter of the target subsystem according to the target value of the adjustment parameter.
[0007] The power consumption control method provided by the present application converts the power consumption error of the target subsystem into a correction factor of the adjustment parameter of the target subsystem through the PID controller. By monitoring and calculating the error between the current power consumption of the target subsystem and the set target value in real time, a suitable correction factor is generated to ensure that the adjustment process is faster and more accurate. According to the generated correction factor, the target value of the adjustment parameter of the target subsystem is dynamically determined, so that it can quickly respond to the power consumption change and avoid delay or excessive correction. This process effectively optimizes the accuracy and efficiency of power consumption adjustment, so that the power consumption of the target subsystem can be stably maintained within the set target value, meets the demand of the system for power consumption control, and improves the power consumption management capability of the subsystem under various loads or running states.
[0008] In a first aspect, in a possible implementation, the historical sampling period includes an (N-1)th sampling period and an (N-2)th sampling period, the Nth sampling period is the current sampling period, and N is an integer greater than or equal to 3.
[0009] In a possible implementation of the first aspect, the power consumption error of the target subsystem is a difference between a target power consumption of the target subsystem and the feedback power consumption, the target power consumption of the target subsystem is U A = U B * , U A is the target power consumption of the target subsystem, U B is the target power consumption of the electronic device, is an allocation weight of the target subsystem.
[0010] In a possible implementation of the first aspect, the PID controller obtains the target value of the to-be-adjusted parameter of the target subsystem according to the power consumption error of the current sampling period and the power consumption errors of historical sampling periods, which includes: inputting the power consumption error of the Nth sampling period, the power consumption error of the (N-1) th sampling period, and the power consumption error of the (N-2) th sampling period into the PID controller, determining a correction value of the to-be-adjusted parameter, and determining the target value of the to-be-adjusted parameter according to a current value of the to-be-adjusted parameter, the correction value of the to-be-adjusted parameter, and a correction weight.
[0011] In a possible implementation of the first aspect, the power consumption error of the Nth sampling period, the power consumption error of the (N-1) th sampling period, the power consumption error of the (N-2) th sampling period, and the correction value of the to-be-adjusted parameter satisfy:
[0012] ;
[0013] wherein is the correction value of the to-be-adjusted parameter, is the power consumption error of the Nth sampling period, is the power consumption error of the (N-1) th sampling period, is the power consumption error of the (N-2) th sampling period, is a proportional coefficient of the PID controller, is an integral coefficient of the PID controller, is a differential coefficient of the PID controller.
[0014] In a possible implementation of the first aspect, the correction value of the to-be-adjusted parameter, the correction weight, the target value of the to-be-adjusted parameter, and the current value of the to-be-adjusted parameter satisfy:
[0015] ;
[0016] wherein is the correction value of the to-be-adjusted parameter, is the correction weight, is the current value of the to-be-adjusted parameter, is the target value of the to-be-adjusted parameter.
[0017] In a possible implementation of the first aspect, the determining the feedback power consumption of the target subsystem comprises: acquiring the feedback power consumption of the target subsystem every preset sampling period, and determining a power consumption error of the target subsystem according to a difference between the target power consumption and the feedback power consumption of the target subsystem.
[0018] In a second aspect, the present application provides an electronic device, comprising: a memory and a processor; the processor is coupled with the memory; wherein the memory is configured to store computer program code, the computer program code comprises computer instructions; when the computer instructions are executed by the processor, the electronic device executes the method of the first aspect.
[0019] In a third aspect, the present application provides a computer readable storage medium, comprising computer instructions; when the computer instructions are run on an electronic device, the electronic device executes the method of any possible implementation of the first aspect.
[0020] In a fourth aspect, the present application provides a computer program product, when the computer program product is run on an electronic device, the electronic device executes the method of any possible implementation of the first aspect.
[0021] The technical effects of the second to fourth aspects refer to those of the first aspect and any of its implementations, which are not repeated here. BRIEF DESCRIPTION OF DRAWINGS
[0022] Figure 1 A structural schematic diagram of an electronic device provided for an embodiment of the present application;
[0023] Figure 2 A step flowchart of a power consumption control method provided for an embodiment of the present application;
[0024] Figure 3 A control logic block diagram of a power consumption control method provided for an embodiment of the present application;
[0025] Figure 4 A power consumption control process schematic diagram of an electronic device provided for an embodiment of the present application;
[0026] Figure 5 A step flowchart of processor power consumption adjustment provided for an embodiment of the present application. DETAILED DESCRIPTION
[0027] The terminology used in the following description of the embodiments herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the description of the embodiments and the appended claims herein, the singular forms "a", "an" and "the" are intended to include both singular and plural forms, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and / or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, objects, and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, objects, and / or components.
[0028] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments of the present application.
[0029] Hereinafter, the terms "first", "second", and the like are used only for the purpose of description and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the technical features indicated. Therefore, the features defined with "first", "second", and the like can explicitly or implicitly include one or more of the features. In the description of the present application, unless otherwise specified, "a plurality of" means two or more. For example, a plurality of processing circuits means two or more processing circuits.
[0030] In the embodiments of the present application, unless otherwise explicitly specified and limited, the term "connection" should be understood broadly, for example, "connection" can be fixed connection, or detachable connection, or integral; can be directly connected, or indirectly connected through an intermediate medium. In addition, the term "electrical connection" can be direct electrical connection, or indirect electrical connection through an intermediate medium.
[0031] In the embodiments of the present application, the term "module" is generally a functional structure divided according to logic, which can be implemented by pure hardware, or by a combination of software and hardware. In the embodiments of the present application, the association relationship of the associated objects is described by "and / or", which means that there can be three kinds of relationships, for example, A and / or B can represent three cases of A alone, B alone, and A and B together.
[0032] In the embodiments of the present application, the words "exemplary" or "for example" are used to mean serving as an example, instance, or illustration. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be construed as being more preferred or advantageous than other embodiments or designs. Rather, the use of the term "exemplary" or "for example" is intended to present concepts in a concrete manner. In the embodiments of the present application, the words "first", "second", and the like are used only for the purpose of description and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the technical features indicated. Therefore, the features defined with "first", "second", and the like can explicitly or implicitly include one or more of the features. In the description of the present application, unless otherwise specified, "a plurality of" means two or more. For example, a plurality of processing circuits means two or more processing circuits.
[0033] Embodiments of the present application provide an electronic device, which can be fixed or mobile. In addition, the electronic device can also be referred to as user equipment (UE), mobile station (MS), mobile terminal (MT), access terminal device, vehicle-mounted terminal device, industrial control terminal device, mobile station, remote station, remote terminal device, mobile device, wireless communication device, terminal agent, etc. For example, the electronic device can be a mobile phone, a pad, a desktop computer, a notebook computer, an all-in-one machine, a vehicle-mounted terminal, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, etc.
[0034] In some embodiments of the present application, the electronic device can also be a device with transceiver function, such as a chip system. The chip system can include a chip and other discrete devices.
[0035] Taking the electronic device as a mobile phone as an example, Figure 1 A possible structure of the electronic device is shown. The electronic device can include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface (hereinafter referred to as USB interface 130), a power management module 140, a battery 141, a wireless charging coil 142, a first antenna 151, a second antenna 161, a mobile communication module 150, a wireless communication module 160, an audio module 170, a sensor module 180, a key 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface (hereinafter referred to as SIM card interface 195), etc.
[0036] The sensor module 180 can include a pressure sensor, a gyroscope sensor, a barometric pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc.
[0037] It can be understood that the structure shown in the embodiments of the present application does not constitute a specific limitation on the electronic device. In other embodiments of the present application, the electronic device can include more or fewer components than shown, or combine certain components, or split certain components, or different component arrangements. The components shown can be implemented in hardware, software, or a combination of software and hardware.
[0038] The processor 110 can include one or more processing units, for example: the processor 110 can be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SOC), a central processing unit (CPU), an application processor (AP), a network processor (NP), a digital signal processor (DSP), a microcontroller unit (MCU), a programmable logic device (PLD), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a baseband processor, and a neural-network processing unit (NPU), etc. Different processing units can be independent devices or integrated in one or more processors 110. For example, the processor 110 can be an application processor AP. Alternatively, the above processor 110 can be integrated in a system on chip (SoC). Alternatively, the above processor 110 can be integrated in an integrated circuit (IC) chip. The processor 110 can include an analog front end (AFE) and a micro-controller unit (MCU) in the IC chip.
[0039] The controller can be the nerve center and command center of the electronic device. The controller can generate operation control signals according to instruction operation codes and timing signals to complete the control of fetching and executing instructions.
[0040] The processor 110 can also be provided with a memory for storing computer instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory can save computer instructions or data that have just been used or are recycled by the processor 110. If the processor 110 needs to use the computer instructions or data again, it can directly call them from the memory. This avoids repeated access and reduces the waiting time of the processor 110, thereby improving the efficiency of the system.
[0041] In some embodiments, the processor 110 can include one or more interfaces. The interfaces can include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a SIM card interface 195, and / or a USB interface 130, etc.
[0042] It can be understood that the interface connection relationship between the modules shown in the embodiments of the present application is only illustrative and does not constitute a structural limitation on the electronic device. In some other embodiments of the present application, the electronic device can also use different interface connection modes or a combination of multiple interface connection modes in the above embodiments.
[0043] The wireless communication function of the electronic device can be implemented through the first antenna 151, the second antenna 161, the mobile communication module 150, the wireless communication module 160, the modem, and the baseband processor, etc.
[0044] The first antenna 151 and the second antenna 161 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device can be used to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization rate of the antennas. For example, the first antenna 151 can be multiplexed as a diversity antenna of a wireless local area network. In some other embodiments, the antennas can be used in combination with a tuning switch.
[0045] The mobile communication module 150 can provide a solution for wireless communication including 2G / 3G / 4G / 5G, etc. applied to the electronic device. The wireless communication module 160 can provide a solution for wireless communication including wireless local area networks (WLAN) (e.g., wireless fidelity (Wi-Fi) network), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR) technology, etc. applied to the electronic device. In some embodiments, the first antenna 151 and the mobile communication module 150 of the electronic device are coupled, and the second antenna 161 and the wireless communication module 160 are coupled, so that the electronic device can communicate with a network and other devices through wireless communication technology.
[0046] The external memory interface 120 can be used to connect an external memory card, such as a micro SanDisk (Micro SD) card, to expand the storage capacity of the electronic device. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and videos are saved in the external memory card.
[0047] The internal memory 121 can be used to store computer executable program code, which includes computer instructions. The processor 110 executes various functional applications and data processing of the electronic device by running the computer instructions stored in the internal memory 121. In addition, the internal memory 121 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0048] The memory to which embodiments of the present application are directed can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memory. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable ROM (PROM), an erasable PROM (EPROM), an electrically EPROM (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM) used as an external cache. By way of example and not limitation, for example, a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate SDRAM (DDR SDRAM), an enhanced SDRAM (ESDRAM), a synchlink DRAM (SLDRAM), and a direct rambus RAM (DRRAM). It should be noted that the memory of the system and method described herein is intended to include, but not be limited to, these and any other suitable types of memory.
[0049] The audio module 170 can include a speaker, a receiver, a microphone, and a headphone interface, and the electronic device can implement audio functions through the audio module 170 and the processor 110, etc. For example, music play, recording, etc.
[0050] The audio module 170 is configured to convert digital audio information into analog audio signals and output the analog audio signals, and to convert analog audio input into digital audio signals. In some embodiments, the audio module 170 can be disposed in the processor 110, or some functional modules of the audio module 170 can be disposed in the processor 110. A speaker, also referred to as a "loudspeaker", is configured to convert an audio electrical signal into a sound signal. A receiver, also referred to as a "earpiece", is configured to convert an audio electrical signal into a sound signal. A microphone, also referred to as a "microphone", "microphone", is configured to convert a sound signal into an electrical signal. The electronic device can be provided with at least one microphone. An earphone interface is configured to connect a wired earphone. The earphone interface can be a USB interface 130, or a 3.5mm open mobile terminal platform (OMTP) standard interface, a cellular telecommunications industry association of the USA (CTIA) standard interface.
[0051] The keys 190 include a power key, a volume key, and the like. The keys 190 can be mechanical keys. Alternatively, the keys 190 can be touch keys. The electronic device can receive a key input of the keys 190, and generate a key signal input related to user settings and function control of the electronic device. The motor 191 can generate a vibration prompt. The motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. The indicator 192 can be an indicator light, and can be used to indicate a charging state, a power change, and can also be used to indicate a message, a missed call, a notification, and the like. The SIM card interface 195 is configured to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to achieve contact and separation with the electronic device. The electronic device can support one or N SIM card interfaces 195, N being a positive integer greater than 1. The SIM card interface 195 can support a Nano SIM card, a Micro SIM card, a SIM card, and the like. In some embodiments, the electronic device uses an embedded SIM (eSIM) card, which can be embedded in the electronic device and cannot be separated from the electronic device.
[0052] The electronic device can implement a photographing function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and a processor 110, and the like. The ISP is configured to process data fed back by the camera 193. In some embodiments, the ISP can be disposed in the camera 193. The camera 193 is configured to capture a still image or a video. In some embodiments, the electronic device can include one or N cameras 193, N being a positive integer greater than 1.
[0053] The electronic device can implement a display function through a GPU, a display screen 194, and a processor 110, etc. The GPU is a microprocessor for image processing, connected to the display screen 194 and the processor 110. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 can include one or more GPUs that execute computer instructions to generate or change display information.
[0054] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. In some embodiments, the electronic device can include 1 or more display screens 194. In other embodiments, the touch screen in the display screen 194 can be a folding screen.
[0055] The battery 141 can include at least two batteries 141, which can be connected in series, in parallel, etc. to supply power to the load.
[0056] The power management module 140 is used to receive charging input from a charger. The charger can be a wireless charger, such as a wireless charging base, other electronic devices with reverse wireless charging function, etc. The power management module 140 can receive wireless charging input through the wireless charging coil 142 of the electronic device. The charger can also be a wired charger, for example, the power management module 140 can receive charging input from the wired charger through the USB interface 130.
[0057] The following describes the present application by taking the electronic device 110 as a mobile phone as an example. During the running of the electronic device, the user experience can be improved and the electronic device can be protected by adjusting the power consumption of the electronic device. By adjusting the power consumption of the electronic device, the battery life of the electronic device can be optimized, and the device life can be prolonged.
[0058] At present, when the electronic device adjusts the power consumption, there are the following deficiencies:
[0059] 1. Poor accuracy of adjustment.
[0060] The current power consumption adjustment method usually relies on pre-set logical conditions or strategies, for example, when the temperature, processor utilization, etc. reach a certain threshold, the frequency is reduced, and the power consumption is adjusted. This way is a discrete decision, which cannot accurately match the real-time dynamic needs of the system. For example, when the system load fluctuates slightly but frequently, the fixed rule cannot make detailed adjustments according to these subtle changes, which may cause the frequency adjustment to be too much or too little, and cannot achieve the optimal balance between power consumption and performance. And the adjustment value is usually hierarchical, that is, the frequency is adjusted to a pre-set gear. This rough frequency adjustment may result in a less delicate power consumption adjustment, and cannot achieve accurate power consumption optimization.
[0061] 2. Poor real-time adjustment.
[0062] The triggering of such a mechanism based on preset conditions has a certain lag, and the change in system state is often instantaneous, while the process of the controller determining whether to trigger power consumption adjustment requires time and cannot respond in real time. For example, when the processor utilization of a mobile phone rapidly increases at a certain moment, the controller for power consumption control may not be able to respond immediately, but wait until the temperature or load continues to exceed a certain threshold to reduce the frequency.
[0063] It can be seen that the power consumption adjustment method in the above embodiments is poor in accuracy and timeliness of power consumption adjustment due to the limitations of its preset rules and poor triggering lag.
[0064] To solve the above problems, with reference to Figure 2 The power consumption control method provided by the embodiments of the present application is applied to an electronic device, and the power consumption control method comprises:
[0065] S201: Obtain the power consumption error of a target subsystem in a current sampling period and the power consumption error of a historical sampling period.
[0066] The electronic device can include multiple subsystems. As an example, the subsystems can include a processor, an audio module, a display screen, a mobile communication module, a wireless communication module, and the like. The embodiments of the present application do not limit the specific types of subsystems. The target subsystem refers to a subsystem that has a power consumption deviation or needs to optimize energy efficiency, and thus needs to adjust power consumption. The historical sampling period can be a period before the current sampling period, for example, two consecutive sampling periods before the current sampling period, that is, the current sampling period and the historical sampling period can be three consecutive sampling periods. As an example, the current sampling period can be the third sampling period, and the historical sampling period can be the first sampling period and the second sampling period. The time period from 0s to 1s is the first sampling period, the time period from 1s to 2s is the second sampling period, and the time period from 2s to 3s is the third sampling period.
[0067] The controller obtains the power consumption error of the target subsystem in the current sampling period and the power consumption error data of the historical sampling period in real time. The power consumption error of the current sampling period and the power consumption error data of the historical sampling period can be stored in a memory, and the controller obtains the power consumption error of the target subsystem in the current sampling period and the power consumption error of the historical sampling period by reading the memory.
[0068] The power consumption error refers to the difference between the target power consumption of the target subsystem and the feedback power consumption. The target power consumption is based on the power consumption expectation value predetermined during system design. The feedback power consumption refers to the actual power consumption of the target subsystem monitored in real time by a sensor or a feedback unit. The difference between the two reflects the power consumption deviation of the target subsystem. As an example, the target subsystem is a processor. The target power consumption of the current sampling period of the processor is 6W, and the feedback power consumption of the current sampling period of the processor is 6.7W. The power consumption error of the current sampling period of the processor can be 0.7W.
[0069] S202: The PID controller determines the target value of the to-be-adjusted parameter of the target subsystem according to the power consumption error of the current sampling period and the power consumption error of the historical sampling period.
[0070] After obtaining the power consumption error of the current sampling period and the power consumption error of the historical sampling period of the target subsystem, the power consumption error of the current sampling period and the power consumption error of the historical sampling period of the target subsystem can be input into the PID controller. The PID controller determines the target value of the to-be-adjusted parameter of the target subsystem according to the power consumption error of the current sampling period and the power consumption error of the historical sampling period. The to-be-adjusted parameter of the target subsystem refers to the parameter that needs to be adjusted to achieve the effect of adjusting the power consumption of the target subsystem. The to-be-adjusted parameters of different subsystems can be different. As an example, the to-be-adjusted parameter of the processor can be the working frequency of the processor, the to-be-adjusted parameter of the audio module can be the volume, the to-be-adjusted parameter of the display screen can be the screen brightness, and the to-be-adjusted parameter of the mobile communication module can be the communication signal strength. The target value of the to-be-adjusted parameter refers to the to-be-adjusted parameter after correction.
[0071] S203: Adjusting the to-be-adjusted parameter of the target subsystem according to the target value of the to-be-adjusted parameter.
[0072] After determining the target value of the to-be-adjusted parameter, the processor can generate a power consumption adjustment instruction according to the target value of the to-be-adjusted parameter, and send the power consumption adjustment instruction to the power management module. The power management module executes the power consumption adjustment instruction to adjust the to-be-adjusted parameter of the target subsystem to the target value, thereby realizing the power consumption management of the target subsystem.
[0073] As an example, the target subsystem is a processor, and the parameter to be adjusted is the working frequency. The current working frequency of the processor can be 1.3 GHz, and the target value of the working frequency of the processor can be 1.5 GHz. By accurately and quickly adjusting the frequency of the processor from 1.3 GHz to 1.5 GHz, the expected power consumption management effect is achieved. As an example, the current working frequency of the processor can be 1.5 GHz, and the target value of the working frequency of the processor can be 1.3 GHz. By accurately and quickly adjusting the frequency of the processor from 1.5 GHz to 1.3 GHz, the expected power consumption management effect is achieved. The controller can generate corresponding control instructions and send them to the power management module. The power management module analyzes the received instructions, and then adjusts the supply voltage and frequency to adjust the frequency of the processor to the target value.
[0074] The power consumption control method provided in the application converts the power consumption error of the target subsystem into a correction value of the parameter to be adjusted of the subsystem through the PID controller. The error between the current power consumption of the target subsystem and the set target value is monitored and calculated in real time to generate a corresponding correction value. According to the generated correction value, the target value of the adjustment parameter of the target subsystem is dynamically determined, so that it can quickly respond to the power consumption change and avoid delay or excessive correction. This process effectively optimizes the accuracy and efficiency of power consumption adjustment, so that the power consumption of the target subsystem can be stably maintained within the set target value, and the power consumption of the entire electronic device can be quickly and stably adjusted.
[0075] When obtaining the feedback power consumption of the target subsystem, the feedback power consumption can be obtained periodically to reduce resource consumption and optimize data processing efficiency. In a feasible implementation manner, determining the feedback power consumption of the target subsystem includes: obtaining the feedback power consumption of the target subsystem every preset sampling period, and determining the power consumption error of the target subsystem according to the difference between the target power consumption and the feedback power consumption of the target subsystem.
[0076] By periodically obtaining the feedback power consumption, the real-time performance and accuracy of the subsystem power consumption adjustment can be ensured, and the system resource consumption and response efficiency can be balanced, so that an efficient and stable power consumption control scheme is realized.
[0077] When determining the target power consumption of the target subsystem, the target power consumption of the target subsystem and the target power consumption of the entire electronic device can be used for determination. In a feasible implementation manner, the target power consumption of the target subsystem satisfies formula (1):
[0078] U A =U B * (1);
[0079] Wherein, U A is the target power consumption of the target subsystem, and UB a target power consumption of an electronic device, an allocation weight of the target subsystem.
[0080] The allocation weights of different target subsystems are different, and the allocation weight represents a power consumption priority or a resource occupation weight of the subsystem relative to other subsystems. By reasonably setting the allocation weight, the system can dynamically allocate the overall power consumption according to the importance or priority of each subsystem, and ensure that different subsystems still meet their performance requirements under power consumption control.
[0081] Before the power consumption error of the current sampling period of the target subsystem and the power consumption error of the historical sampling period are input into the PID controller, it is necessary to determine whether to perform the power consumption adjustment operation according to the size relationship between the power consumption error of the current sampling period of the target subsystem and the power consumption error threshold. For example, when the power consumption error of the current sampling period of the target subsystem is less than or equal to the power consumption error threshold, the power consumption adjustment operation does not need to be performed; when the power consumption error of the current sampling period of the target subsystem is greater than the power consumption error threshold, the power consumption adjustment operation needs to be performed.
[0082] Referring to Figure 3 the control logic block diagram shown, when the power consumption adjustment operation needs to be performed, the power consumption error of the current sampling period of the target subsystem and the power consumption error of the historical sampling period are input into the PID controller. The PID controller can obtain the correction value of the to-be-adjusted parameter by combining the proportional adjustment result, the integral adjustment result and the differential adjustment result of the power consumption error and performing discrete processing on the combined result according to the power consumption error of the current sampling period and the power consumption error of the historical sampling period input into the PID controller. Then, the current value of the to-be-adjusted parameter is corrected according to the correction value of the to-be-adjusted parameter, so as to obtain the target value of the to-be-adjusted parameter. Since the power consumption error is used as the control condition, the PID controller can be an incremental PID controller. Using the incremental PID controller can make the calculation amount of the entire system smaller.
[0083] As an example, the power consumption error of the first sampling period, the power consumption error of the second sampling period and the power consumption error of the third sampling period are input into the PID controller to determine the correction value of the to-be-adjusted parameter. The power consumption error of the Nth sampling period, the power consumption error of the (N-1)th sampling period, the power consumption error of the (N-2)th sampling period and the correction value of the to-be-adjusted parameter satisfy formula (2) shown:
[0084] (2);
[0085] wherein the correction value of the to-be-adjusted parameter, the power consumption error of the third sampling period, the power consumption error of the second sampling period, is a power consumption error of a first sampling period, is a proportional coefficient of the PID controller, is an integral coefficient of the PID controller, is a differential coefficient of the PID controller.
[0086] After the PID controller determines the correction value to be adjusted, the target value of the parameter to be adjusted can be determined according to the current value of the parameter to be adjusted, the correction value of the parameter to be adjusted, and the correction weight.
[0087] For example, the correction value of the parameter to be adjusted, the correction weight, the target value of the parameter to be adjusted, and the current value of the parameter to be adjusted satisfy formula (3):
[0088] (3).
[0089] wherein is the correction value of the parameter to be adjusted, is the correction weight, is the current value of the parameter to be adjusted, is the target value of the parameter to be adjusted. The correction weight can be dynamically adjusted according to actual needs, which is not limited in the embodiments of the present application.
[0090] It should be noted that the power consumption adjustment processes of the various subsystems are independent of each other. Referring to the power consumption control process schematic diagram of the electronic device shown in Figure 4 , the target subsystems of the electronic device can include a processor, an audio module, a display screen, and a wireless communication module. The power consumption control of each target subsystem is completed by a corresponding PID controller.
[0091] Taking the processor as a target subsystem as an example, the parameter to be adjusted of the target subsystem is the frequency of the processor. Referring to the flow schematic diagram shown in Figure 5 .
[0092] S501: Determine the sampling period interval of the processor, the target power consumption, and the current working frequency of the processor.
[0093] S502: Obtain the power consumption error of the current sampling period of the processor and the power consumption error of the historical sampling period.
[0094] S503: The processor PID controller determines the target value of the working frequency of the processor according to the power consumption error of the current sampling period and the power consumption error of the historical sampling period.
[0095] S504: Adjust the working frequency of the processor according to the target value of the working frequency.
[0096] Firstly, the sampling period interval of the processor and the current working frequency of the processor are determined, and then the target power consumption of the processor can be determined according to the preset allocation weight and the target power consumption of the electronic device. When the power consumption of the processor is controlled, the feedback unit collects the feedback power consumption of the processor every preset time and sends it to the processor PID controller. The processor PID controller determines whether to perform the power consumption adjustment operation according to the difference between the feedback power consumption and the target power consumption. In the case where the power consumption adjustment operation needs to be performed, the processor PID controller obtains the historical power consumption error and the current power consumption error, and determines the working frequency correction value of the processor. Then, the current working frequency of the processor is corrected according to the working frequency correction value of the processor, so that the working frequency of the processor is adjusted to the target value.
[0097] Taking the display screen as an example, the to-be-adjusted parameter of the target subsystem is the display brightness of the display screen. When the power consumption of the display screen is controlled, the feedback unit collects the feedback power consumption of the display screen every preset time and sends it to the display screen PID controller. The display screen PID controller determines whether to perform the power consumption adjustment operation according to the difference between the feedback power consumption and the target power consumption. In the case where the power consumption adjustment operation needs to be performed, the display screen PID controller determines the display brightness correction value of the display screen according to the historical power consumption error and the current power consumption error. Then, the current display brightness of the display screen is corrected according to the display brightness correction value of the display screen, so that the display brightness of the display screen is adjusted to the target value.
[0098] Taking the audio module as an example, the to-be-adjusted parameter of the target subsystem is the volume of the audio module. When the power consumption of the audio module is controlled, the feedback unit collects the feedback power consumption of the audio module every preset time and sends it to the audio module PID controller. The audio module PID controller determines whether to perform the power consumption adjustment operation according to the difference between the feedback power consumption and the target power consumption. In the case where the power consumption adjustment operation needs to be performed, the audio module PID controller determines the volume correction value of the audio module according to the historical power consumption error and the current power consumption error. Then, the current volume of the audio module is corrected according to the volume correction value of the audio module, so that the volume of the audio module is adjusted to the target value.
[0099] Taking the wireless communication module as an example, the parameter to be adjusted of the target subsystem is the working signal strength of the wireless communication module. When the power consumption of the wireless communication module is controlled, the feedback unit collects the feedback power consumption of the wireless communication module at preset time intervals and sends the feedback power consumption to the wireless communication module PID controller. The wireless communication module PID controller determines whether to perform the power consumption adjustment operation according to the difference between the feedback power consumption and the target power consumption. In the case where the power consumption adjustment operation needs to be performed, the wireless communication module PID controller determines the working signal strength correction value of the wireless communication module based on the historical power consumption error and the current power consumption error, and then corrects the current working signal strength of the wireless communication module according to the working signal strength correction value of the wireless communication module, so that the working signal strength of the wireless communication module is adjusted to the target value.
[0100] The embodiment further provides a computer readable storage medium, which stores computer instructions. When the computer instructions run on an electronic device, the electronic device performs each function or step in the method embodiment.
[0101] The embodiment further provides a computer program product. When the computer program product runs on a computer, the computer performs each function or step in the method embodiment.
[0102] Through the description of the above embodiments, those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above functional modules is taken as an example for illustration. In actual application, the above functions can be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
[0103] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiment described above is only illustrative. For example, the division of the module or unit is only a logical function division. In actual implementation, another division mode can be used, for example, a plurality of units or components can be combined or integrated into another device, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0104] The units described as separate components can or can not be physically separated, and the components shown as units can be one physical unit or multiple physical units, that is, they can be located in one place or distributed in multiple different places. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment scheme.
[0105] In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0106] When the integrated unit is realized in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application essentially or the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The software product is stored in a storage medium, including a number of instructions to make an electronic device (which can be a single-chip microcomputer, a chip, etc.) or a processor execute all or part of the steps of the embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various program code storage media.
[0107] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application and not to limit it. Although the present application has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present application can be modified or replaced equivalently without departing from the spirit and scope of the technical solutions of the present application.
Claims
1. A power consumption control method characterized by comprising: The application is applied to an electronic device including a plurality of subsystems, and the method comprises: obtaining power consumption errors of a plurality of target subsystems in a current sampling period and in historical sampling periods; the historical sampling periods include an (N-1)th sampling period and an (N-2)th sampling period, the Nth sampling period is the current sampling period, N is an integer greater than or equal to 3, and the historical sampling periods and the current sampling period are three continuous sampling periods; a PID controller obtains a target value of an adjustment parameter of the target subsystem according to the power consumption errors in the current sampling period and in the historical sampling periods, comprising: inputting the power consumption error in the Nth sampling period, the power consumption error in the (N-1)th sampling period and the power consumption error in the (N-2)th sampling period into the PID controller to determine a correction value of the adjustment parameter; determining the target value of the adjustment parameter according to a current value of the adjustment parameter, the correction value of the adjustment parameter and a correction weight; independently adjusting the adjustment parameters of the plurality of target subsystems according to the target value of the adjustment parameter, so that the adjustment parameters of the target subsystems are adjusted to the target value; The power consumption error of the target subsystem is a difference between a target power consumption of the target subsystem and a feedback power consumption, the target power consumption of the target subsystem is U A =U B * , U A is the target power consumption of the target subsystem, U B is the target power consumption of the electronic device, is the allocation weight of the target subsystem; the power consumption error in the Nth sampling period, the power consumption error in the (N-1)th sampling period, the power consumption error in the (N-2)th sampling period and the correction value of the adjustment parameter satisfy: ; wherein is a correction value of the parameter to be adjusted, is a power consumption error of the Nth sampling period, is a power consumption error of the N-1th sampling period, is a power consumption error of the N-2th sampling period, is a proportional coefficient of the PID controller, is an integral coefficient of the PID controller, is a differential coefficient of the PID controller; the correction value of the adjustment parameter, the correction weight, the target value of the adjustment parameter and the current value of the adjustment parameter satisfy: ; wherein is a correction value for the parameter to be adjusted, is the correction weight, is a current value for the parameter to be adjusted, is a target value for the parameter to be adjusted.
2. The method of claim 1, wherein, determining the feedback power consumption of the target subsystem comprises: obtaining the feedback power consumption of the target subsystem every preset sampling period; determining the power consumption error of the target subsystem according to a difference between the target power consumption of the target subsystem and the feedback power consumption.
3. An electronic device, comprising: The electronic device comprises a processor, a memory and a computer program stored on the memory; the memory is coupled to the processor; when the electronic device is running, the processor executes the computer program to implement the method of claim 1 or 2.
4. A computer-readable storage medium, characterized in that, The computer program is stored and, when executed by the processor of the electronic device, implements the method of claim 1 or 2.
5. A computer program product, characterised in that, The computer program is stored and, when executed by the processor of the electronic device, implements the method of claim 1 or 2.
Citation Information
Patent Citations
Method for performing system power control within an electronic device, and associated apparatus
CN105765957A
Server power consumption management and control method, system and device and computer storage medium
CN118244874A