Control method and electronic equipment
By dynamically adjusting the power consumption of the processor to ensure that the total power consumption of the processor and peripheral devices does not exceed the current power consumption of the electronic device, the problem of the lack of unified power consumption measurement and control in the existing technology is solved, and the control of single-machine systems is realized. Efficient energy management and energy efficiency improvement.
Patent Information
- Application Number
- CN202411389430.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-01-21
AI Technical Summary
The prior art lacks a unified power consumption measurement and control method for the entire stand-alone system, making it difficult to effectively manage the overall energy consumption of the computer system.
By obtaining the power consumption parameters of electronic equipment, processors, and peripheral equipment, the power consumption of the processor is dynamically adjusted to ensure that the total power consumption of the processor and peripheral equipment does not exceed the current power consumption of electronic equipment.
The uniform power consumption and control of the entire single -machine system has been achieved, the energy use is optimized, the energy efficiency ratio of the system is improved, and the best performance and energy consumption balance is maintained under different workloads.
Smart Images

Figure CN119336149A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to a control method and an electronic device. Background Art
[0002] The energy consumption problem of computer systems has become increasingly prominent. Energy saving and improving energy efficiency have become one of the key research directions of computer systems.
[0003] At present, processor manufacturers such as Intel and AMD have launched continuously upgraded Turbo Boost technologies through continuous technological innovation. With the introduction of the proprietary power control IP PCU (Power Control Unit) in the processor (Central Processing Unit, CPU), technologies such as ITBMT, HWP, and SST have been added, aiming to make the processor faster when busy and lower power consumption when idle, and to dynamically adjust processor performance to adapt to different workload requirements.
[0004] For the measurement and control of power consumption, the processor and memory subsystem have introduced RAPL (Running Average Power Limit) technology to perform closed-loop control of power consumption. These technologies can accurately measure and control the power consumption of a single subsystem, but there is currently a lack of a unified power consumption measurement and control method for the entire stand-alone system. Summary of the invention
[0005] The present application provides a control method, the method comprising:
[0006] Acquire a first performance parameter of the electronic device, wherein the first performance parameter is used to characterize current power consumption of the electronic device;
[0007] Acquire a second performance parameter of a processor of the electronic device, wherein the second performance parameter is used to characterize current power consumption of the processor;
[0008] Determine a third performance parameter of the peripheral device based on the first performance parameter and the second performance parameter, wherein the third performance parameter is used to characterize the current power consumption of the peripheral device;
[0009] Based on the third performance parameter, the second performance parameter of the processor is adjusted so that the sum of the current power consumption of the processor and the current power consumption of the peripheral device never exceeds the current power consumption of the electronic device.
[0010] In some embodiments, obtaining a first performance parameter of the electronic device includes:
[0011] Acquire a first electrical parameter of the electronic device, wherein the first electrical parameter is a rated voltage and a current current of the electronic device;
[0012] Based on the first electrical parameter, a current power consumption of the electronic device is determined.
[0013] In some embodiments, the obtaining a second performance parameter of a processor of the electronic device includes:
[0014] Acquire a second electrical parameter of a processor of the electronic device, wherein the second electrical parameter is a current voltage and a current current of the processor;
[0015] Based on the second electrical parameter, a current power consumption of the processor is determined.
[0016] In some embodiments, adjusting the second performance parameter of the processor based on the third performance parameter includes:
[0017] Based on a preset cycle, obtaining the third performance parameter of a plurality of cycles;
[0018] Comparing the third performance parameters corresponding to different periods to determine a change trend of the third performance parameter;
[0019] Based on the change trend, the second performance parameter of the processor is adjusted.
[0020] In some embodiments, adjusting the second performance parameter of the processor based on the change trend includes:
[0021] Based on the change trend, determine the change result of the current cycle;
[0022] Based on the change result, the second performance parameter of the processor in the current cycle is adjusted, wherein the performance of the processor in the current cycle after the second performance parameter is adjusted is different from the performance of the processor in the previous cycle.
[0023] In some embodiments, adjusting the second performance parameter of the processor in the current cycle based on the change result includes:
[0024] If it is determined that the change result is an increase, limiting the performance of the processor;
[0025] In the case where it is determined that the change result is a decrease, the performance of the processor is released.
[0026] In some embodiments, limiting the performance of the processor includes at least one of the following:
[0027] reducing the voltage of the processor;
[0028] Reduce the refresh rate of the processor's cache or close part of the cache;
[0029] The controller of the electronic device controls the processor of the electronic device to enter a low power consumption state;
[0030] reducing the frequency of the processor, wherein the frequency is not lower than the lowest frequency of the processor;
[0031] Some of the processors among the plurality of processors are turned off.
[0032] In some embodiments, the method further comprises:
[0033] Acquire a fourth performance parameter of the power adapter, wherein the fourth performance parameter is used to characterize the rated power consumption of the power adapter;
[0034] When it is determined that the electronic device is in the startup stage, obtaining a fifth performance parameter of the processor and a sixth performance parameter of the peripheral device, wherein the fifth performance parameter is the minimum power consumption of the processor, and the sixth performance parameter is the full-load power consumption of the peripheral device;
[0035] A matching result between the electronic device and the power adapter is determined based on the fourth performance parameter, the fifth performance parameter, and the sixth performance parameter.
[0036] In some embodiments, the method further comprises:
[0037] Obtain the seventh performance parameter of the onboard device;
[0038] A third performance parameter of the peripheral device is determined based on the first performance parameter, the second performance parameter and the seventh performance parameter.
[0039] The present application also provides an electronic device, the electronic device comprising:
[0040] An embedded controller connected to a power adapter;
[0041] a platform controller connected to the embedded controller;
[0042] A processor, connected to the embedded controller and the platform controller respectively;
[0043] A power controller is connected to the embedded controller and the processor respectively, and is also connected to the power adapter via a current detection sensor, and is used to obtain electrical parameters of the processor and the power adapter. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 A flow chart of a control method according to an embodiment of the present application;
[0045] Figure 2 This is a flow chart of step S1 in the control method of an embodiment of the present application;
[0046] Figure 3 This is a flow chart of step S2 in the control method of an embodiment of the present application;
[0047] Figure 4 This is a flow chart of step S4 in the control method of an embodiment of the present application;
[0048] Figure 5 This is a flow chart of step S43 in the control method of an embodiment of the present application;
[0049] Figure 6 This is a flow chart of step S42 in the control method of an embodiment of the present application;
[0050] Figure 7 This is a flow chart of step S5 in the control method of an embodiment of the present application;
[0051] Figure 8 This is a flow chart of step S6 in the control method of an embodiment of the present application;
[0052] Fig. 9 This is a structural block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0053] Various aspects and features of the present application are described herein with reference to the accompanying drawings.
[0054] It should be understood that various modifications may be made to the embodiments of the present application. Therefore, the above description should not be considered as limiting, but only as an example of an embodiment. Other modifications within the scope and spirit of the present application will occur to those skilled in the art.
[0055] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the present application and, together with the general description of the present application given above and the detailed description of the embodiments given below, serve to explain the principles of the present application.
[0056] These and other characteristics of the present application will become apparent from the following description of a preferred form of embodiment given as a non-limiting example with reference to the accompanying drawings.
[0057] It should also be understood that although the present application has been described with reference to some specific examples, those skilled in the art will be able to readily implement many other equivalent forms of the present application.
[0058] The above and other aspects, features and advantages of the present application will become more apparent in view of the following detailed description when taken in conjunction with the accompanying drawings.
[0059] Specific embodiments of the present application are described hereinafter with reference to the accompanying drawings; however, it should be understood that the embodiments applied for are merely examples of the present application, which may be implemented in a variety of ways. Well-known and / or repeated functions and structures are not described in detail to avoid unnecessary or redundant details that obscure the present application. Therefore, the specific structural and functional details applied for herein are not intended to be limiting, but merely serve as a basis and representative basis for the claims to teach those skilled in the art to use the present application in a variety of ways with substantially any suitable detailed structure.
[0060] This specification may use the phrases "in one embodiment," "in another embodiment," "in yet another embodiment," or "in other embodiments," all of which may refer to one or more of the same or different embodiments according to the present application.
[0061] The present application embodiment provides a control method, such as Figure 1 As shown, the method includes:
[0062] S1. Acquire a first performance parameter of an electronic device, wherein the first performance parameter is used to characterize current power consumption of the electronic device.
[0063] In this embodiment, the electronic device is a device that does not have an internal power supply and can only be powered by an external power adapter. For example, many servers and network communication devices, such as routers and switches, usually do not contain internal batteries, but are directly connected to the power supply through a power adapter to operate.
[0064] Alternatively, certain types of computers used in industrial automation and control systems may not have internal batteries, but instead connect to a power source via a power adapter to ensure continuous power. Alternatively, single-board computers such as the Raspberry Pi may not include a battery in their design and typically require a power adapter connected via a Micro USB or other power interface.
[0065] Additionally, in certain repair or testing scenarios, the computer may be intentionally powered by the power adapter only, with the battery removed to prevent battery issues from affecting diagnostic results.
[0066] Wherein, when the electronic device is a computer, this step involves collecting the overall power consumption data of the computer (ie, current power consumption), which is usually provided by a power adapter or calculated by power consumption monitoring hardware and software.
[0067] The performance parameters of the electronic device include but are not limited to voltage, current, frequency, load, power consumption, thermal design power consumption, etc.
[0068] S2. Obtain a second performance parameter of a processor of the electronic device, wherein the second performance parameter is used to characterize current power consumption of the processor.
[0069] In this embodiment, this step is to monitor the current power consumption of the processor to provide a basis for adjusting the processor performance. The performance parameters of the processor include but are not limited to voltage, current, frequency, load, power consumption, thermal design power consumption, number of cores, number of threads, cache usage, operating temperature, etc. These parameters work together to affect the power consumption performance of the processor. By monitoring and adjusting these parameters, the power consumption of the processor can be effectively managed to optimize performance and save energy.
[0070] S3. Determine a third performance parameter of the peripheral device based on the first performance parameter and the second performance parameter, wherein the third performance parameter is used to characterize current power consumption of the peripheral device.
[0071] In this embodiment, after the current power consumption of the electronic device and the current power consumption of the processor are known, the remaining power consumption is calculated, and the remaining power consumption is the current power consumption of other peripheral devices.
[0072] For example, if the current power consumption of the electronic device is 500 watts and the current power consumption of the processor is 350 watts, then the remaining power consumption is 150 watts, indicating that the power consumption of other peripheral devices is 150 watts.
[0073] Among them, when the electronic device is a computer, the peripheral devices connected to the computer include but are not limited to input devices (keyboard, mouse, scanner, camera, microphone, game controller, etc.), output devices (display, printer, speaker, headset, projector, etc.), storage devices (USB flash drive, external hard drive, CD / DVD drive, etc.), network communication equipment (Ethernet power adapter, wireless network card, router, etc.), etc.
[0074] S4. Based on the third performance parameter, adjust the second performance parameter of the processor so that the sum of the current power consumption of the processor and the current power consumption of the peripheral device never exceeds the current power consumption of the electronic device.
[0075] In this embodiment, this step is to dynamically adjust the power consumption of the processor according to the power consumption status of the peripheral device to ensure that the total power consumption of the processor and the peripheral device does not exceed the current total power consumption of the electronic device.
[0076] When the present application is used, the electronic device first monitors the current power consumption of the entire electronic device, and the electronic device monitors the current power consumption of the processor, such as monitoring the operating frequency, core voltage and other parameters of the processor. The electronic device calculates the current power consumption of the peripheral device by subtracting the current power consumption of the processor from the overall current power consumption.
[0077] The power consumption of the processor is dynamically adjusted according to the power consumption of the peripheral devices, so that the processor has better performance when busy and lower power consumption when idle. In the adjustment process, the current total power consumption of the processor and the peripheral devices does not exceed the current total power consumption of the electronic device.
[0078] For example, there is a laptop computer. When the user plugs in headphones and starts listening to music, the laptop computer detects that the power consumption of the peripheral device (headphones) increases. If the processor is performing some unimportant background tasks at this time, the laptop computer will choose to reduce the power consumption of the processor to ensure that the sound quality of the headphones is not affected, and the sum of the current power consumption of the entire peripheral device and the current power consumption of the processor is always less than the current power consumption of the laptop computer, and the current power consumption of the laptop computer remains within the power supply capacity of the power adapter. In this way, the laptop computer can maintain stable performance when performing various tasks.
[0079] This application allows electronic devices to dynamically adjust the power consumption of the processor under different workloads, which can achieve optimal energy utilization while ensuring performance. This dynamic adjustment mechanism enables electronic devices to respond to different working conditions more flexibly, and maintain the best balance between performance and energy consumption, whether in a high-load working environment or in a low-load energy-saving mode.
[0080] This application adopts a method of unified power consumption measurement and control of the entire electronic device, not just a single subsystem. The comprehensive management strategy helps to further reduce overall energy consumption, improve the system's energy efficiency, and achieve more environmentally friendly and economical computer system operation.
[0081] In some embodiments, Figure 2 As shown, the obtaining of the first performance parameter of the electronic device includes:
[0082] S11. Acquire a first electrical parameter of the electronic device, wherein the first electrical parameter is a rated voltage and a current current of the electronic device.
[0083] In this embodiment, it involves collecting the first electrical parameter of the electronic device, the rated voltage is the voltage required for the normal operation of the electronic device, and the current current is the current actually consumed by the electronic device.
[0084] For example, it is known that the power supply of a power adapter for powering a laptop is 20V, and the embedded controller of the laptop obtains the current currently consumed by the laptop through a current sensor.
[0085] S12. Determine the current power consumption of the electronic device based on the first electrical parameter.
[0086] In this embodiment, the power consumption of the electronic device is calculated by multiplying the rated voltage by the current current, and the calculation formula is power consumption = voltage × current. Specifically, the embedded controller of the computer multiplies the rated voltage of 22V provided by the power adapter and the current 5A currently consumed by the laptop to determine that the current power consumption of the laptop is 110W.
[0087] In some embodiments, Figure 3 As shown, the obtaining of the second performance parameter of the processor of the electronic device includes:
[0088] S21. Acquire a second electrical parameter of a processor of the electronic device, wherein the second electrical parameter is a current voltage and a current current of the processor.
[0089] In this embodiment, the second electrical parameter of the processor is collected, the voltage of the processor is the supply voltage of the power adapter, and the current is the current consumed by the processor when executing a task.
[0090] Specifically, the embedded controller of the electronic device reads the current of different parts of the processor (Core, GT, AUX_CPU) from the power controller through the I2C communication protocol. I2C is a common serial communication protocol used to connect embedded controllers and other devices.
[0091] And, the embedded controller uses an analog-to-digital converter (ADC) to read the voltage of each part of the processor (Core, GT, AUX_CPU). The analog-to-digital converter is a component that converts analog signals into digital signals, allowing the embedded controller to process voltage data.
[0092] S22. Determine a current power consumption of the processor based on the second electrical parameter.
[0093] In this embodiment, the power consumption of the processor is calculated by multiplying the current voltage of the processor by the current current. The power consumption calculation formula is power consumption = voltage × current.
[0094] Specifically, a laptop processor consists of three parts: Core, GT (graphics processor), AUX_CPU (auxiliary CPU). The embedded controller reads through I2C that the Core current is 2A, the GT current is 1A, and the AUX_CPU current is 0.5A. The embedded controller reads through ADC that the Core voltage is 1.2V, the GT voltage is 0.9V, and the AUX_CPU voltage is 1.0V.
[0095] The calculation shows that the Core power consumption is 2.4W, the GT power consumption is 0.9W, and the AUX_CPU power consumption is 0.5W, so the current power consumption of the processor is 3.8W.
[0096] In some embodiments, Figure 4 As shown, adjusting the second performance parameter of the processor based on the third performance parameter includes:
[0097] S41. Based on a preset cycle, obtain the third performance parameter of multiple cycles.
[0098] In this embodiment, it involves collecting power consumption data of peripheral devices within a preset time period. By monitoring the current power consumption of the electronic device and the current power consumption of the processor within multiple periods, the current power consumption of the peripheral devices within multiple periods can be obtained, and then the power consumption change of the peripheral devices can be determined. Among them, the preset period can be set to 1ms, that is, real-time and continuous monitoring is performed.
[0099] S42: Compare the third performance parameters corresponding to different periods to determine a change trend of the third performance parameter.
[0100] In this embodiment, the current power consumption of the peripheral device obtained in multiple cycles in step S41 is analyzed to determine whether the current power consumption of the peripheral device presents an increasing, decreasing or unchanged change trend. The cycle includes at least two cycles, that is, observing the change of the current power consumption of the peripheral device in the current cycle relative to the current power consumption of the peripheral device in the previous cycle.
[0101] S43: Adjust the second performance parameter of the processor based on the change trend.
[0102] In this embodiment, the performance parameters of the processor, such as voltage and current, are adjusted according to the change trend of the power consumption of the peripheral device to optimize the power consumption.
[0103] Specifically, the power consumption of the peripheral device is continuously acquired within a preset period, the current power consumption of the peripheral device in different periods is compared, and the power consumption change trend of the peripheral device is analyzed to determine whether it is increasing or decreasing. According to the change trend of the current power consumption of the peripheral device, the performance parameters of the processor are adjusted.
[0104] For example, a user is using a laptop computer, which monitors and adjusts power consumption through an embedded controller. The embedded controller monitors the power consumption of peripheral devices (such as USB devices, hard disks, etc.) every 1ms (preset period).
[0105] The embedded controller finds that the power consumption of the peripheral devices in the current cycle has increased compared to the power consumption of the peripheral devices in the previous cycle (for example, the user uses a USB device). In order to balance the overall power consumption, the laptop will reduce the frequency of the processor, thereby reducing the power consumption of the processor to maintain the stability of the overall power consumption. This application dynamically adjusts the processor performance, and the system can optimize power consumption while ensuring performance.
[0106] In some embodiments, Figure 5 As shown, adjusting the second performance parameter of the processor based on the change trend includes:
[0107] S431. Determine the change result of the current cycle based on the change trend.
[0108] In this embodiment, the change trend of the power consumption of the peripheral device is analyzed, and based on the trend, it is determined whether the change result of the power consumption of the peripheral device in the current cycle is an increase, a decrease, or stability.
[0109] S432. Adjust the second performance parameter of the processor in the current cycle based on the change result, wherein the performance of the processor in the current cycle after adjusting the second performance parameter is different from the performance of the processor in the previous cycle.
[0110] In this embodiment, whether the second performance parameter of the processor needs to be adjusted and how to adjust the second performance parameter of the processor are determined according to the change result determined in S431.
[0111] Among them, compared with the current power consumption of the peripheral device in the previous cycle, if the current power consumption of the peripheral device in the current cycle remains unchanged, the change trend is unchanged, the change result is stable, and there is no need to adjust the performance parameters of the processor.
[0112] If the current power consumption of the peripheral device in the current cycle increases compared to the current power consumption of the peripheral device in the previous cycle, the change trend is upward, and the change result is increase. The performance parameters of the processor need to be adjusted, such as reducing the frame rate or voltage of the processor to reduce power consumption.
[0113] If the current power consumption of the peripheral device in the current cycle is reduced compared to the current power consumption of the peripheral device in the previous cycle, the change trend is downward, and the change result is reduced. It is necessary to adjust the performance parameters of the processor, such as increasing the frequency or voltage of the processor, to improve the performance of the processor. After the adjustment, the processor performance of the current cycle is different from the processor performance of the previous cycle to better adapt to the current power consumption of the peripheral device.
[0114] In some embodiments, Figure 6 As shown, adjusting the second performance parameter of the processor in the current cycle based on the change result includes:
[0115] S4321. When it is determined that the change result is an increase, limit the performance of the processor.
[0116] In this embodiment, if the performance parameters such as power consumption or temperature of the peripheral device are on an upward trend, that is, the change result is an increase, measures need to be taken to limit the performance of the processor to prevent excessive power consumption or overheating. Limiting the performance of the processor includes reducing the operating frequency of the processor, reducing the number of cores, or reducing the voltage.
[0117] S4322: When it is determined that the change result is a decrease, release the performance of the processor.
[0118] In this embodiment, if the performance parameters such as power consumption or temperature of the peripheral device are on a downward trend, that is, the change result is a decrease, it is necessary to improve the performance of the processor to improve the performance while maintaining temperature safety. Improving the performance of the processor includes increasing the operating frequency of the processor, increasing the number of cores, or increasing the voltage.
[0119] Specifically, the electronic device continuously monitors the current power consumption of the electronic device and the current power consumption of the processor, and then continuously obtains the performance parameters of the peripheral device, such as power consumption, temperature and load. The electronic device analyzes the change trend of the performance parameters of the peripheral device to determine whether the change trend is increasing or decreasing or remains unchanged.
[0120] If the change trend is rising and the change result is increasing, the electronic device takes measures to limit the processor performance to reduce power consumption and temperature. If the change trend is falling and the change result is decreasing, the electronic device releases the processor performance to improve processing speed and efficiency.
[0121] By dynamically adjusting processor performance, electronic devices can manage heat more effectively, avoiding overheating and potential hardware damage. When the power consumption of peripheral devices increases, limiting the performance of the processor helps to extend the life of the hardware, and when the power consumption of peripheral devices decreases, releasing the performance of the processor can ensure that the processor provides optimal performance within a safe range.
[0122] Consider a laptop that can dynamically adjust processor performance in response to changes in power consumption of peripheral devices. The laptop continuously monitors overall power consumption and processor power consumption, while also monitoring performance parameters such as power consumption of peripheral devices (such as USB devices, hard drives, and displays).
[0123] The laptop analyzes the changing trend of the performance parameters of the USB device. For example, if a user connects a high-power USB device to the laptop, the power consumption of the peripheral device will be monitored to increase.
[0124] When determining that the current power consumption of the peripheral device has increased compared to the previous power consumption of the peripheral device, the laptop computer automatically reduces the operating frequency of the processor from 3.5 GHz to 2.9 GHz and / or reduces the number of active cores from 4 cores to 2 cores and / or reduces the voltage from 1.2V to 1.1V, etc., to reduce the power consumption and heat generation of the processor.
[0125] If the user unplugs the high-power USB device and the laptop detects that the power consumption of the peripheral device has decreased, the laptop will increase the processor's operating frequency back to 3.5GHz and / or increase the number of active cores to all 4 cores and / or increase the voltage back to 1.2V, etc., to improve processor performance.
[0126] In this way, the laptop is able to optimize processor performance and power consumption in different usage scenarios. Dynamic adjustments help the laptop prevent overheating when performing high-load tasks, while providing higher performance when the task load is lower. This not only improves the user experience, but also helps extend the life of the hardware.
[0127] In some embodiments, limiting the performance of the processor includes at least one of the following:
[0128] Reducing the voltage of the processor, reducing the voltage can reduce the power consumption of the processor;
[0129] Reducing the refresh rate of the cache of the processor or shutting down part of the cache. Reducing the refresh rate of the cache or shutting down part of the cache can reduce power consumption;
[0130] The controller of the electronic device controls the processor of the electronic device to enter a low power consumption state, where the low power consumption state reduces the activity of the processor, thereby reducing power consumption;
[0131] Lowering the frequency of the processor, wherein the frequency is not lower than the lowest frequency of the processor, and the frequency is not lower than the lowest frequency to ensure stable operation of the electronic device;
[0132] Shutting down some of the plurality of processors. In a multi-core processor, shutting down unused cores can save energy because each core can be turned on or off independently.
[0133] In this embodiment, the electronic device obtains the change result of the current power consumption of the peripheral device, and when the change result is an increase, one or a combination of the above measures is taken to reduce the power consumption of the processor. By adjusting different performance parameters of the processor, the purpose of reducing the power consumption of the processor can be achieved. That is, by reducing the energy consumption of the processor, the battery life is extended, the heat generation is reduced, overheating is avoided, and the reliability and efficiency of the electronic device are improved.
[0134] And, releasing the performance of the processor includes at least one of the following:
[0135] Increasing the voltage of the processor, increasing the supply voltage can improve the performance of the processor;
[0136] Increasing the refresh rate of the cache of the processor or opening more caches, which can increase the speed at which the processor accesses data, thereby improving performance;
[0137] The controller controls the processor to enter a high performance state and increase activity to improve performance;
[0138] Increasing the frequency of the processor. Increasing the operating frequency of the processor can improve processing speed and performance. The frequency is increased to respond to higher performance requirements;
[0139] Starting some of the multiple processors, in a multi-core processor, starting the cores that were previously shut down can provide more processing power.
[0140] In this embodiment, the electronic device obtains the change result of the current power consumption of the peripheral device, and when the change result is a decrease, one or a combination of the above measures is taken to increase the power consumption of the processor. By adjusting different performance parameters of the processor, the purpose of increasing the power consumption of the processor can be achieved. That is, by improving the processing speed and response time, the user experience is improved and the high performance requirements are met.
[0141] In some embodiments, Figure 7 As shown, the method also includes:
[0142] S51. Obtain a fourth performance parameter of a power adapter, wherein the fourth performance parameter is used to characterize a rated power consumption of the power adapter.
[0143] In this embodiment, the rated power consumption of the power adapter is collected, and the rated power consumption refers to the maximum power output that the power adapter can provide.
[0144] S52. When it is determined that the electronic device is in the startup stage, obtain a fifth performance parameter of the processor and a sixth performance parameter of the peripheral device, wherein the fifth performance parameter is the minimum power consumption of the processor, and the sixth performance parameter is the full-load power consumption of the peripheral device.
[0145] In this embodiment, the fifth performance parameter refers to the minimum power consumption of the processor, that is, the power consumption when the processor is in an idle or low-load state. The sixth performance parameter refers to the full-load power consumption of the peripheral device, that is, the power consumption of the peripheral device in a working state when the electronic device is fully plugged in with peripheral devices.
[0146] S53: Determine a matching result between the electronic device and the power adapter based on the fourth performance parameter, the fifth performance parameter, and the sixth performance parameter.
[0147] In this embodiment, the matching result between the rated power consumption of the power adapter and the power consumption of the electronic device under the minimum demand state is determined. The matching result will determine whether the power adapter can meet the power demand of the electronic device under the minimum demand state.
[0148] Specifically, when the electronic device is turned on and before it is powered on, that is, the electronic device is connected to a power adapter and the power button is not turned on, the rated power consumption of the power adapter is first determined, and then the minimum power consumption of the processor and the full-load power consumption of the peripheral device are obtained to obtain the power consumption required for the electronic device to work under the minimum demand state. The rated power consumption of the power adapter is compared with the power consumption required for the electronic device to work under the minimum demand state to determine whether the power adapter is suitable for the current electronic device.
[0149] If the rated power consumption of the power adapter cannot meet the use requirements of the electronic device, the electronic device will shut down after notifying the user to prevent the electronic device from shutting down during startup due to the power adapter being unable to provide sufficient power consumption.
[0150] Assume that a laptop uses a 65-watt power adapter. When it is turned on, the laptop processor requires a minimum power consumption of 10 watts in the minimum demand state, and the full load power consumption of the peripheral devices is 45 watts. The total power consumption required by the laptop in the minimum demand state is 55 watts, which is lower than the rated power consumption of the power adapter, and the power adapter can supply power normally.
[0151] This application can intelligently detect the matching results between the power adapter and the electronic device, ensuring that the electronic device can operate safely and stably. When a low-power power adapter is detected, the electronic device will automatically notify the user and shut down to avoid instability or damage to the electronic device due to insufficient power. This intelligent protection mechanism improves the reliability of electronic devices and reduces the risk of failures caused by power problems.
[0152] In some embodiments, Figure 8 As shown, the method also includes:
[0153] S61. Obtain a seventh performance parameter of the onboard device.
[0154] In this embodiment, it involves collecting performance parameters of onboard devices (such as integrated graphics cards, network interface cards, or other hardware fixed to the motherboard). Onboard devices refer to the configuration firmware of electronic devices, which usually do not change when the electronic device is in operation. For example, for storage expansion of electronic devices, after the newly added memory is arranged, it must be restarted before it can take effect. The configuration firmware is read and determined by the electronic device during the startup phase of the electronic device. Once the electronic device is powered on, the configuration firmware of the electronic device is based only on the firmware that is already present at the time of startup.
[0155] The seventh performance parameter includes power consumption, temperature or other performance-related indicators of the onboard device. The current power consumption of the onboard device is the sum of the power consumption required by the configuration firmware of all electronic devices.
[0156] S62: Determine a third performance parameter of the peripheral device based on the first performance parameter, the second performance parameter, and the seventh performance parameter.
[0157] In this embodiment, the third performance parameter of the peripheral device is determined based on the first performance parameter of the electronic device, the second performance parameter of the processor, and the seventh performance parameter of the onboard device to ensure that the electronic device does not exceed the power supply capacity of the power adapter during operation.
[0158] Specifically, the performance parameters of the onboard device are first obtained, and the performance parameters of the processor, the performance parameters of the onboard device and the overall performance parameters of the electronic device are integrated. Based on the integrated performance parameters, the performance parameters of the peripheral device are calculated.
[0159] This application ensures the performance balance between the processor, onboard devices and peripheral devices to prevent a certain part from becoming a performance bottleneck. By accurately controlling the power consumption of each part, the energy efficiency ratio of the entire electronic device is improved.
[0160] In summary, the workflow of the control method includes:
[0161] The electronic device collects the rated voltage of the power adapter and the current current of the electronic device to calculate the current power consumption of the electronic device. The electronic device reads the voltage and current of each part of the processor to calculate the current power consumption of the processor. The current power consumption of the processor is subtracted from the current power consumption of the electronic device to obtain the current power consumption of the peripheral device.
[0162] According to the above steps, the current power consumption of the peripheral device for at least two cycles is obtained, and the current power consumption of the peripheral device for at least two cycles is compared to determine the change result. According to the change result, the electronic device automatically adjusts the performance parameters of the processor.
[0163] If the current power consumption of the peripheral device in the current cycle increases relative to the current power consumption of the peripheral device in the previous cycle, the change trend is rising, the change result is increasing, and the electronic device limits the performance of the processor in the current cycle.
[0164] If the current power consumption of the peripheral devices in the current cycle decreases relative to the current power consumption of the peripheral devices in the previous cycle, the change trend is downward, and the change result is reduction. The electronic device improves the performance of the processor in the current cycle to keep the total power consumption of the processor and the peripheral devices from exceeding the total power consumption of the device (current power consumption).
[0165] Through this control method, the electronic device can dynamically adjust the performance parameters of the processor according to the performance parameters of the peripheral device, ensuring that the electronic device can operate stably under different working conditions.
[0166] The present application also provides an electronic device, such as Fig. 9 As shown, the electronic device includes:
[0167] An embedded controller connected to a power adapter;
[0168] a platform controller connected to the embedded controller;
[0169] A processor, connected to the embedded controller and the platform controller respectively;
[0170] A power controller is connected to the embedded controller and the processor respectively, and is also connected to the power adapter via a current detection sensor, and is used to obtain electrical parameters of the processor and the power adapter.
[0171] In this embodiment, the embedded controller is responsible for managing the components connected between the electronic device and the power adapter, and is generally responsible for monitoring and controlling the supply of power. The embedded controller is also connected to a low dropout linear regulator (Low Dropout Regulator), which is connected to the power adapter via a power identification resistor R1.
[0172] The platform controller is connected to the embedded controller and is responsible for coordinating and managing the hardware and software resources of the entire platform. The processor is the core component of the electronic device, responsible for executing programs and processing data. It is connected to the embedded controller and the platform controller to manage and optimize power usage. The power controller is responsible for managing the power supply of the processor, connected to the embedded controller and the processor, and obtains the electrical parameters of the processor and the power adapter through the connection to the current detection sensor.
[0173] The power adapter converts AC power into DC power required by the device, and the DC input voltage of the power adapter is +20V, which is the nominal voltage provided by the power adapter. The power adapter also includes a power identification module, which is used to identify or measure the power provided by the power adapter. In this embodiment, the rated power of the power adapter is determined by the power identification module.
[0174] A current sensor is a sensor that detects the flow of current and is generally used to monitor the current consumption of an electronic device. In this embodiment, the monitoring value of the current sensor can be used to determine the power consumption of the entire electronic device.
[0175] The embedded controller obtains the voltage of the processor through the ADC port and the current of the processor through the I2C port. The current of the processor (Core, GT, AUX_CPU) refers to the current consumption of different parts of the processor. Core is the core of the processor, GT is the graphics processing unit (GPU), and AUX_CPU is the auxiliary CPU or other processor parts.
[0176] In summary, the process of the electronic device executing the control method is as follows:
[0177] The electronic device is a computer, and the embedded controller reads the current of the entire system (ie, the electronic device) from the current sensor through an analog-to-digital converter, and uses the formula current power consumption of the system = rated voltage of the power adapter × current current of the system to determine the current power consumption of the system.
[0178] Communicate with the power controller via the I2C bus to read the current of the three parts of the processor: Core, GT (graphics processor), and AUX_CPU (auxiliary processor). The embedded controller reads the voltage of the three parts of the processor: Core, GT, and AUX_CPU through the analog-to-digital converter. Use the formula processor power consumption = processor voltage × processor current to calculate the current power consumption of each part of the processor. Add the power consumption of each part of the processor to get the current power consumption of the entire processor. Use the formula current power consumption of peripheral devices = current power consumption of the system - current power consumption of the processor to determine the current power consumption of peripheral devices.
[0179] By comparing the current power consumption of the peripheral devices of at least two cycles, the change result is determined by the change trend. When the change trend of the current power consumption of the peripheral devices in the current cycle is an increase compared to the current power consumption of the peripheral devices in the previous cycle, the change result is an increase. At this time, the embedded controller sends a power consumption limit signal to the processor through the PECI (Platform Environment Control Interface) to keep the system power consumption within the power supply capacity of the power adapter.
[0180] When the current power consumption of the peripheral device in the current cycle decreases compared to the current power consumption of the peripheral device in the previous cycle, the change result is a decrease. At this time, the embedded controller sends a signal to the processor through PECI to release the power consumption limit, allowing the processor to increase power consumption to improve performance.
[0181] This application optimizes the load of the power adapter to avoid overload by dynamically adjusting the power consumption of the processor. When the current power consumption of the peripheral devices in the current cycle decreases compared to the current power consumption of the peripheral devices in the previous cycle, the performance of the processor is improved to ensure user experience. When the current power consumption of the peripheral devices in the current cycle increases compared to the current power consumption of the peripheral devices in the previous cycle, the unnecessary power consumption of the processor is limited to improve energy utilization efficiency and reduce operating costs.
[0182] Assume that the rated power consumption of the power adapter connected to a laptop is 65W, the embedded controller of the laptop reads the current current of the system (ie, the laptop) as 2.5A through the analog-to-digital converter, the supply voltage of the power adapter is 20V, and the current power consumption of the system is calculated to be 50W.
[0183] The embedded controller reads from RT3628AE that the processor's Core current is 2A, GT current is 1A, and AUX_CPU current is 0.5A. The embedded controller reads the processor's Core voltage is 1.2V, GT voltage is 1.0V, and AUX_CPU voltage is 0.9V through the analog-to-digital converter. The processor's Core power consumption is determined to be 2.4W, GT power consumption is 1W, AUX_processor power consumption is 0.45W, and the processor's current power consumption is 3.85W. Based on the system's current power consumption of 50W and the processor's current power consumption of 3.85W, the current power consumption of the peripheral device is determined to be 46.15W.
[0184] When the user inserts a new peripheral device, the above steps are followed to determine that the current power consumption of the peripheral device is 50W, that is, the current power consumption of the peripheral device has increased compared to before. At this time, the embedded controller sends a power consumption limit signal to the processor through PECI, reducing the processor frequency from 3.5GHz to 3.0GHz (or taking other measures that can limit processor performance), reducing the processor power consumption to keep the total power consumption (the sum of the current power consumption of the processor and the current power consumption of the peripheral device) within the current power supply capacity of the power adapter.
[0185] When the user unplugs the peripheral device, the above steps are used to determine that the current power consumption of the peripheral device is 20W, that is, compared with before, the current power consumption of the peripheral device is reduced. The embedded controller releases the processor power consumption limit through PECI and increases the processor frequency as needed (or adopts other measures that can improve processor performance) to improve performance and utilization of the power adapter.
[0186] The electronic device provided in the present application can be any type of electronic device, and the processor of the electronic device is used to execute the control method in any of the above embodiments. The electronic device also includes a memory, and the memory is used to store programs required by the processor to execute operations.
[0187] The processor may be a general purpose processor, a digital signal processor, an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof. The PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof. The general purpose processor may be a microprocessor or any conventional processor.
[0188] Since the electronic device introduced in the embodiments of the present application is an electronic device provided with a memory for implementing the method disclosed in the embodiments of the present application, based on the method introduced in the embodiments of the present application, technical personnel in this field can understand the structure and deformation of the electronic device introduced in the embodiments of the present application, so it is not repeated here.
[0189] The present application also provides a control device, the control device comprising:
[0190] A first acquisition module, configured to acquire a first performance parameter of the electronic device, wherein the first performance parameter is used to characterize a current power consumption of the electronic device;
[0191] A second acquisition module, configured to acquire a second performance parameter of a processor of the electronic device, wherein the second performance parameter is used to characterize a current power consumption of the processor;
[0192] a determination module configured to determine a third performance parameter of the peripheral device based on the first performance parameter and the second performance parameter, wherein the third performance parameter is used to characterize a current power consumption of the peripheral device;
[0193] An adjustment module is configured to adjust the second performance parameter of the processor based on the third performance parameter so that the sum of the current power consumption of the processor and the current power consumption of the peripheral device never exceeds the current power consumption of the electronic device.
[0194] It should be noted that the principle of solving the technical problem by the control device provided in the embodiment of the present application is similar to the control method provided in the embodiment of the present application. Therefore, the implementation of the control device provided in the embodiment of the present application can refer to the implementation of the control method provided in the embodiment of the present application, and the repeated parts will not be repeated.
[0195] Another embodiment of the present application further provides a storage medium, which includes a stored program, wherein when the program is executed, a device including the storage medium is controlled to execute the control method as described in any one of the above embodiments.
[0196] The storage medium in this embodiment may be included in the electronic device, or may exist independently without being installed in the electronic device. The storage medium carries one or more computer programs, and when the one or more computer programs are executed, any step of the control method provided in the embodiment of the present application is implemented.
[0197] It should be understood that each scheme in this embodiment has the corresponding technical effects in the above method embodiment, which will not be repeated here.
[0198] The embodiment of the present application also provides a computer program product, which is tangibly stored on a computer-readable medium and includes computer-readable instructions, and when the computer-executable instructions are executed, at least one processor executes the control method in the embodiment described above. It should be understood that each solution in this embodiment has the corresponding technical effect in the above method embodiment, which will not be repeated here.
[0199] It should be noted that the computer storage medium of the present application may be a computer readable signal medium or a computer readable storage medium or any combination of the above two. The computer readable medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access storage medium (RAM), a read-only storage medium (ROM), an erasable programmable read-only storage medium (EPROM or flash memory), an optical fiber, a portable compact disk read-only storage medium (CD-ROM), an optical storage medium, a magnetic storage medium, or any suitable combination of the above.
[0200] In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus, or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program configured to be used by or in combination with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless, antenna, optical cable, RF, etc., or any suitable combination of the above.
[0201] The above embodiments are only exemplary embodiments of the present application and are not intended to limit the present application. The protection scope of the present application is defined by the claims. Those skilled in the art may make various modifications or equivalent substitutions to the present application within the essence and protection scope of the present application, and such modifications or equivalent substitutions shall also be deemed to fall within the protection scope of the present application.
Claims
1. A control method, the method comprising: Acquire a first performance parameter of the electronic device, wherein the first performance parameter is used to characterize current power consumption of the electronic device; Acquire a second performance parameter of a processor of the electronic device, wherein the second performance parameter is used to characterize current power consumption of the processor; Determine a third performance parameter of the peripheral device based on the first performance parameter and the second performance parameter, wherein the third performance parameter is used to characterize the current power consumption of the peripheral device; Based on the third performance parameter, the second performance parameter of the processor is adjusted so that the sum of the current power consumption of the processor and the current power consumption of the peripheral device never exceeds the current power consumption of the electronic device.
2. The control method according to claim 1, wherein obtaining the first performance parameter of the electronic device comprises: Acquire a first electrical parameter of the electronic device, wherein the first electrical parameter is a rated voltage and a current current of the electronic device; Based on the first electrical parameter, a current power consumption of the electronic device is determined.
3. The control method according to claim 1, wherein obtaining the second performance parameter of the processor of the electronic device comprises: Acquire a second electrical parameter of a processor of the electronic device, wherein the second electrical parameter is a current voltage and a current current of the processor; Based on the second electrical parameter, a current power consumption of the processor is determined.
4. The control method according to claim 1, wherein adjusting the second performance parameter of the processor based on the third performance parameter comprises: Based on a preset cycle, obtaining the third performance parameter of a plurality of cycles; Comparing the third performance parameters corresponding to different periods to determine a change trend of the third performance parameter; Based on the change trend, the second performance parameter of the processor is adjusted.
5. The control method according to claim 4, wherein adjusting the second performance parameter of the processor based on the change trend comprises: Based on the change trend, determine the change result of the current cycle; Based on the change result, the second performance parameter of the processor in the current cycle is adjusted, wherein the performance of the processor in the current cycle after the second performance parameter is adjusted is different from the performance of the processor in the previous cycle.
6. The control method according to claim 5, wherein adjusting the second performance parameter of the processor in the current cycle based on the change result comprises: If it is determined that the change result is an increase, limiting the performance of the processor; In the case where it is determined that the change result is a decrease, the performance of the processor is released.
7. The control method according to claim 6, wherein limiting the performance of the processor comprises at least one of the following: reducing the voltage of the processor; Reduce the refresh rate of the processor's cache or close part of the cache; The controller of the electronic device controls the processor of the electronic device to enter a low power consumption state; reducing the frequency of the processor, wherein the frequency is not lower than the lowest frequency of the processor; Some of the processors among the plurality of processors are turned off.
8. The control method according to claim 1, further comprising: Acquire a fourth performance parameter of the power adapter, wherein the fourth performance parameter is used to characterize the rated power consumption of the power adapter; When it is determined that the electronic device is in the startup stage, obtaining a fifth performance parameter of the processor and a sixth performance parameter of the peripheral device, wherein the fifth performance parameter is the minimum power consumption of the processor, and the sixth performance parameter is the full-load power consumption of the peripheral device; A matching result between the electronic device and the power adapter is determined based on the fourth performance parameter, the fifth performance parameter, and the sixth performance parameter.
9. The control method according to claim 1, further comprising: Obtain the seventh performance parameter of the onboard device; A third performance parameter of the peripheral device is determined based on the first performance parameter, the second performance parameter and the seventh performance parameter.
10. An electronic device, comprising: An embedded controller connected to a power adapter; a platform controller connected to the embedded controller; a processor, connected to the embedded controller and the platform controller respectively; A power controller is connected to the embedded controller and the processor respectively, and is also connected to the power adapter via a current detection sensor, and is used to obtain electrical parameters of the processor and the power adapter.