Method, apparatus, electronic equipment, and storage medium for managing the power consumption of a processing unit.
Patent Information
- Application Number
- JP2026517773
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-09-03
- Publication Date
- 2026-10-16
Smart Images

Figure 2026534452000001_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application pertains to the technical field of neural networks, and specifically provides a power consumption management method and apparatus for a processing unit, an electronic device, and a storage medium. BACKGROUND ART
[0002] Processing units are widely used in various devices. As requirements for the standby time and operating time of devices increase, requirements for the power consumption of processing units are also rising. For example, some devices powered by batteries need to reduce the power consumption of processing units to improve the continuous operation capability of the devices.
[0003] Currently, the low power consumption management method for processing units is single. Usually, the power of the processing unit is cut off only when the device is powered off. While the device is powered on, the processing unit is always in a powered state, waiting for subsequent tasks at the rated operating frequency of the processing unit. In the case of this method, the processing unit still has relatively high power consumption while the device is operating. SUMMARY OF THE INVENTION
[0004] In view of this, the present application provides a power consumption management method and apparatus for a processing unit, an electronic device, and a storage medium that can reduce the power consumption of the processing unit.
[0005] In a first embodiment, an embodiment of the present application provides a method for managing the power consumption of a processing unit for use in a control unit of an electronic device. The electronic device further includes a processing unit, the control unit and the processing unit are connected, and the method for managing the power consumption of the processing unit includes the steps of: obtaining parameter values of environmental parameters of the operating environment of the processing unit; determining target electrical parameter values of predetermined operating electrical parameters based on a predetermined correspondence between the parameter values of the environmental parameters, wherein the predetermined correspondence includes a correspondence between different parameter values of the environmental parameters and different target electrical parameter values of the predetermined operating electrical parameters, and the different target electrical parameter values of the predetermined operating electrical parameters are electrical parameter values that satisfy a predetermined requirement for the power consumption of the processing unit under different parameter values of the environmental parameters; and controlling the predetermined operating electrical parameters of the processing unit to perform the task at the target electrical parameter values.
[0006] Because different operating environments have different effects on the operational efficiency of the processing unit, this affects the power consumption of the processing unit when it performs the same task. In the embodiment of this application, environmental parameters are acquired, and based on these environmental parameters, target electrical parameter values for the processing unit are set for the appropriate predetermined operating electrical parameters. The different target electrical parameter values for the predetermined operating electrical parameters are electrical parameter values that satisfy a predetermined requirement for the power consumption of the processing unit under different parameter values of the environmental parameters. This allows the processing unit to perform tasks in different environments, and the processing unit to have relatively high operational efficiency in the current environment depending on the operating electrical parameters used, thereby reducing the power consumption of the processing unit when it is currently performing a task.
[0007] In one embodiment, the environmental parameter includes the current temperature of the operating environment of the processing unit, the predetermined correspondence includes the correspondence between different temperature ranges of the current temperature and different electrical parameter values of the predetermined operating electrical parameter, and the step of determining the target electrical parameter value of the predetermined operating electrical parameter based on the parameter value of the environmental parameter and the predetermined correspondence includes the step of determining a target temperature range that includes the temperature value of the current temperature among the parameter values of the environmental parameter, and the step of determining the target electrical parameter value of the predetermined operating electrical parameter corresponding to the target temperature range based on the predetermined correspondence.
[0008] The current operating temperature of the processing unit has a relatively large impact on the processing unit's power consumption; the higher the temperature, the higher the processing unit's power consumption when the electrical parameter values of the operating electrical parameters are the same. If the heat dissipation performance is constant, the temperature of the processing unit's chip may rise due to increased power consumption, which may lead to a system crash. In the embodiment of this application, by setting corresponding target electrical parameter values for different temperature ranges, the processing unit can maintain relatively low power consumption and a slower temperature rise in different temperature environments, thereby enabling the processing unit to maintain a low-power consumption operating state for extended periods.
[0009] In one embodiment, the electronic device further includes a power supply that supplies power to the processing unit, the control unit, the processing unit, and the power supply are connected to each other, the environmental parameter includes the current power supply voltage that supplies power to the processing unit, the predetermined correspondence includes the correspondence between different power supply voltage ranges of the power supply and different electrical parameter values of the predetermined operating electrical parameter, and the step of determining the target electrical parameter value of the predetermined operating electrical parameter based on the parameter value of the environmental parameter and the predetermined correspondence includes the step of determining a target voltage range that includes the voltage value of the current power supply voltage among the parameter values of the environmental parameter, and the step of determining the target electrical parameter value of the predetermined operating electrical parameter corresponding to the target voltage range based on the predetermined correspondence.
[0010] The operating environment of the processing unit includes the power supply environment, which includes the current power supply voltage that supplies power to the processing unit. If the current power supply voltage is insufficient to support the processing unit's stable operation at high voltage or high operating frequency, then the processing unit's power consumption will be too high when it operates at high voltage or high operating frequency. Therefore, in the embodiments of this application, different target voltage ranges are set, and after determining the current power supply voltage, the target voltage range of the processing unit is determined based on the current power supply voltage, and the corresponding target electrical parameter values are determined, thereby enabling the processing unit to perform tasks with operating electrical parameter values that are suitable for the current power supply environment, thereby reducing excess power consumption.
[0011] In one embodiment, the electronic device further includes a power supply that supplies power to the processing unit, the control unit, the processing unit, and the power supply are connected to each other, the environmental parameter includes the current power supply amount that supplies power to the processing unit, the predetermined correspondence includes the correspondence between different ranges of current power supply amounts and different electrical parameter values of the predetermined operating electrical parameter, and the step of determining the target electrical parameter value of the predetermined operating electrical parameter based on the parameter value of the environmental parameter and the predetermined correspondence includes the step of determining the target range of current power supply amounts among the parameter values of the environmental parameter, and the step of determining the target electrical parameter value of the predetermined operating electrical parameter corresponding to the target range of current power supply amounts based on the predetermined correspondence.
[0012] The power supply environment of a processing unit further includes the current amount of electricity supplied to the processing unit. If the processing unit operates with high power consumption even when the current amount of electricity supplied to the processing unit is insufficient, the electricity may be consumed quickly, and the power supply may not be able to continuously supply a stable power voltage, leading to a system shutdown of the processing unit. For this reason, in the embodiment of this application, different target electricity ranges are set, and after determining the current amount of electricity supplied to the power unit, the target electricity range amount of the processing unit is determined based on the current amount of electricity supplied to the power unit, and the corresponding target electrical parameter values are determined. This allows the processing unit to perform tasks with operating electrical parameter values that are suitable for the current power supply environment, thereby reducing unnecessary power consumption.
[0013] In one embodiment, the electronic device further includes a power supply that supplies power to the processing unit, the control unit, the processing unit and the power supply are connected to each other, and the power consumption management method includes the step of controlling the predetermined operating electrical parameters of the processing unit to perform the current task at the target electrical parameter values, the step of starting timing in response to the processing unit completing the current task, and the step of controlling the power supply to stop supplying power to the processing unit when the timing time reaches a predetermined time, provided that the processing unit has not received a new task.
[0014] Compared to a system that supplies power to the processing unit even when it is not performing a task and waits for a new task at the rated operating frequency, in the embodiment of this application, after the processing unit completes a task, a timer is set, and if the timer reaches a predetermined length of time and no new task has been received, it is highly likely that the processing unit does not need to perform a new task for a while. In this situation, by cutting off the power to the processing unit, the processing unit does not consume power, and the power consumption by the processing unit in the electronic device can be effectively reduced.
[0015] In one embodiment, after the timing is started, the power consumption management method sets a predetermined operating electrical parameter of the processing unit to the minimum electrical parameter value allowed for the processing unit in its operating state, and the predetermined operating electrical parameter includes an operating electrical parameter related to the power consumption of the processing unit.
[0016] The operating electrical parameters of a processing unit affect its operating performance. The predetermined operating electrical parameters include those related to the power consumption of the processing unit. By lowering the electrical parameter values of the predetermined operating electrical parameters, the operating performance of the processing unit can be reduced, thereby reducing the power consumption of the processing unit. In the embodiment of this application, since the processing unit is not performing any operations while waiting for a new task that has not yet reached a predetermined time length, lowering the electrical parameter values of the predetermined operating electrical parameters is unlikely to have adverse effects. Therefore, the predetermined operating electrical parameters can be set to the minimum electrical parameter values allowed for the processing unit in its operating state to reduce power consumption. Furthermore, since the processing unit is still in an operating state and is not turned off, it can quickly respond to requests to perform new tasks.
[0017] In one embodiment, the predetermined operating electrical parameters include at least one of the operating frequency and operating voltage of the processing unit.
[0018] In the embodiments of this application, the main operating electrical parameters that affect the power consumption of the processing unit are the operating frequency and the operating voltage. By setting at least one of these as a predetermined operating electrical parameter and adjusting it, the power consumption of the processing unit can be effectively reduced after adjusting the electrical parameter values of the operating electrical parameters.
[0019] In one embodiment, after the timing is started, the power consumption management method includes a step of controlling the processing unit to enter a standby state under power supply conditions, wherein the operating frequency of the processing unit is 0 under the standby state.
[0020] In the embodiment of this application, the processing unit is put into a standby state while waiting for a new task after the start of timing, and the operating frequency in the standby state is 0. In this case, the power consumption of the processing unit can be reduced.
[0021] In one embodiment, the power consumption management method for the processing unit further includes the step of controlling the power supply to supply power to the processing unit in response to a request to assign a new task to the processing unit while the processing unit is electrically shut off.
[0022] Compared to a system in which power is supplied to the processing unit at all times after the device is started up, in the embodiment of this application, power is supplied to the processing unit in response to a request to assign a new task when the processing unit needs to perform a task. This allows the new task to be performed normally by the processing unit, and the processing unit is in an electrically shut-off state at other times. This system effectively reduces power consumption when the processing unit is not performing a task.
[0023] In one embodiment, after the step of starting timing in response to the processing unit having just completed a task, the power consumption management method includes the steps of stopping timing if the processing unit receives a new task before the timing time reaches the predetermined time length, reacquiring the parameter values of the environmental parameters, redetermining the target electrical parameter values of the predetermined operating electrical parameters based on the reacquired parameter values of the environmental parameters, and controlling the processing unit to execute the new task based on the redetermined target electrical parameter values.
[0024] In the embodiment of this application, each time a new task is performed, the parameter values of the environmental parameters are redefined, new target electrical parameter values are redefined, and the unit operates with the redefined target electrical parameter values. This allows the processing unit to perform tasks with the target electrical parameter values of the current environmental parameters even when the operating environment changes, effectively reducing the problem of excessive power consumption due to incompatible electrical parameter values of the operating electrical parameters caused by environmental changes.
[0025] In a second embodiment, an embodiment of the present application provides a power consumption management device for a processing unit used in a control unit of an electronic device. The electronic device further includes a processing unit, the control unit and the processing unit are connected, and the power consumption management device for the processing unit includes an acquisition module and a control module, the acquisition module is configured to acquire parameter values of environmental parameters of the operating environment of the processing unit, the control module determines a target electrical parameter value of a predetermined operating electrical parameter based on a predetermined correspondence relationship with the parameter value of the environmental parameter, the predetermined correspondence relationship includes a correspondence relationship between different parameter values of the environmental parameter and different target electrical parameter values of the predetermined operating electrical parameter, the different target electrical parameter value of the predetermined operating electrical parameter is an electrical parameter value that satisfies a predetermined requirement for the power consumption of the processing unit under different parameter values of the environmental parameter, and the control module is configured to control the predetermined operating electrical parameter of the processing unit to perform the task at the current target electrical parameter value.
[0026] In the third aspect, embodiments of the present application provide electronic equipment, the electronic equipment comprising a control unit, a processing unit, an environmental monitoring unit, and a power supply, wherein the control unit is configured to perform a power consumption management method for the processing unit according to any one of the first embodiments, the processing unit is connected to the control unit, the environmental monitoring unit is configured to monitor the operating environment of the processing unit and acquire environmental parameters, the environmental monitoring unit is further connected to the control unit and is configured to provide the environmental parameters to the control unit in order for the control unit to perform a power consumption management method for the processing unit according to any one of the first embodiments, and the power supply is connected to the control unit and the processing unit respectively and is configured to supply or cut off power to the processing unit in response to control by the control unit.
[0027] In a fourth aspect, the embodiments of the present application provide a readable storage medium. A program is stored in the readable storage medium, and when the program is executed by a processing unit, the processing unit performs the power consumption management method for a processing unit according to any one of the items of the first aspect.
[0028] To more clearly describe the technical solutions of the embodiments of the present application, the drawings used in the embodiments of the present application are briefly described below. The described drawings merely show some embodiments of the present application, and do not limit the scope. Those skilled in the art can derive other related drawings based on these drawings without exercising inventive efforts. Brief Description of the Drawings
[0029] [Figure 1] This is a flowchart of a power consumption management method for a processing unit according to an embodiment of the present application. [Figure 2] This is a supplementary flowchart of the power consumption management method for a processing unit according to an embodiment of the present application. [Figure 3] This is a schematic flowchart showing the entire flow of the power consumption management method for a processing unit according to an embodiment of the present application. [Figure 4] This is a schematic diagram of a power consumption management apparatus for a processing unit according to an embodiment of the present application. [Figure 5] This is a schematic diagram of an electronic device according to an embodiment of the present application. Modes for Carrying Out the Invention
[0030] To make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the present application is described in further detail below with reference to the drawings and embodiments. The specific embodiments described are merely for interpreting the present application, and are not intended to limit the present application.
[0031] First, embodiments of this application provide a method for managing the power consumption of a processing unit. The method is used in a control unit of an electronic device. The electronic device further includes a processing unit and a power supply that supplies power to the processing unit. The processing unit may be an NPU (Neural-Network Processing Unit), GPU (Graphics Processing Unit), ISP (Image Signal Processor), DPU (Display Processing Unit), or VPU (Video Processing Unit), and the control unit may be a CPU (Central Processing Unit), MCU (Microcontroller), etc.
[0032] In the embodiments of this application, the control unit is connected to the NPU and the power supply, respectively. The control unit can adjust the power consumption of the NPU at different times by controlling the operation of the NPU and controlling the power supply to supply or cut off power to the NPU.
[0033] Referring to Figure 1, which is a flowchart of a power consumption management method for a processing unit according to one embodiment of this application, the power consumption management method for the processing unit includes the following steps.
[0034] S110: Obtain the parameter values of the environmental parameters for the operating environment of the processing unit.
[0035] The operating environment of a processing unit affects its power consumption to some extent. By setting the electrical parameter values of the corresponding operating electrical parameters for the processing unit according to the operating environment, it contributes to the normal operation of the processing unit and prevents excessive power consumption, assuming that the task can be executed. Operating electrical parameters are the electrical parameters when the processing unit is operating, and include, for example, operating frequency, operating voltage, operating current, and power.
[0036] In the embodiments of this application, the operating environment of the processing unit includes, but is not limited to, the external environment such as temperature and humidity, and may also include, for example, the power supply environment of the processing unit such as power supply capacity.
[0037] In the embodiment of this application, an environmental monitoring unit is installed inside an electronic device. The environmental monitoring unit includes a dedicated device or circuit for monitoring, such as a temperature sensor or a humidity sensor, and a power supply circuit is provided with a corresponding monitoring circuit to monitor power supply voltage, current, electrical quantity, etc. A control unit is connected to the environmental monitoring unit and receives the parameter values of the monitored environmental parameters.
[0038] S120: Based on the parameter values of the environmental parameters and the predetermined correspondence, the target electrical parameter values of the predetermined operating electrical parameters are determined.
[0039] In the embodiments of this application, the predetermined operating electrical parameters include operating electrical parameters related to the power consumption of the processing unit. For example, the predetermined operating electrical parameters include the operating frequency of the processing unit, where the higher the operating frequency, the higher the power consumption. The predetermined operating electrical parameters further include the operating voltage, where, for example, the processing unit includes a high operating voltage state and a low operating voltage state, with higher power consumption in the high operating voltage state. The voltage values in the high operating voltage state and the low operating voltage state differ depending on the processing unit, and since specific examples can be found in the prior art, a detailed explanation is omitted here.
[0040] In this embodiment, the predetermined correspondence includes the correspondence between parameter values of different environmental parameters and target electrical parameter values of different predetermined operating electrical parameters. The target electrical parameter values of different predetermined operating electrical parameters are the electrical parameter values that satisfy the predetermined requirement for the power consumption of the processing unit under different parameter values of the environmental parameters.
[0041] The predetermined requirements can be specifically set based on the performance of the processing unit, the requirements of the task to be performed, etc., and a detailed explanation is omitted here. This embodiment aims to set electrical parameter values that satisfy the predetermined requirements for each of the different parameter value conditions of the same environmental parameter. For example, the operating frequency corresponding to a temperature of 20°C is 100%, and the operating frequency corresponding to a temperature of 50°C is 50%. In this way, similar settings can be made for other environmental parameters such as different humidity and power supply environments, and the operating voltage or other predetermined operating electrical parameters may be adjusted, not limited to the operating frequency, and the predetermined correspondence can be obtained by setting in this manner.
[0042] A unique correspondence can be established for each type of environmental parameter. For example, in one embodiment of this application, the environmental parameter includes the current temperature of the operating environment of the processing unit, and the predetermined correspondence includes the correspondence between different temperature ranges of the current temperature and different electrical parameter values of the predetermined operating electrical parameter.
[0043] In this embodiment, the temperature range that includes the optimal operating temperature of the processing unit can be associated with the maximum value of a predetermined operating electrical parameter of the processing unit. For example, if the optimal temperature of a processing unit is 15°C, the temperature range that includes 15°C can be associated with the maximum value of the predetermined operating electrical parameter. For example, if the predetermined operating electrical parameter is the operating frequency or operating voltage, and the predetermined temperature range includes a temperature range of less than 20°C, then the operating frequency corresponding to that temperature range is 100% or the maximum operating voltage.
[0044] On the other hand, processing units have a maximum operating temperature, and prolonged operation at high temperatures can lead to system failure. For a processing unit to continue operating at high temperatures for extended periods, it needs to slow down the temperature rise or lower the temperature. Lowering the operating frequency and voltage can reduce power consumption, which in turn slows down the temperature rise, and if the heat dissipation is relatively good, the temperature may decrease, allowing the NPU to maintain its operating state for longer periods.
[0045] Therefore, in this embodiment, the temperature range that includes the maximum operating temperature of the processing unit can be matched with the minimum value of a predetermined operating electrical parameter of the processing unit. For example, if the processing unit can operate at a maximum of 80°C, has a minimum operating frequency of 20%, or a minimum operating voltage of 0.2 times the maximum operating voltage, and the predetermined operating electrical parameter is the operating frequency or operating voltage, and the temperature range includes a temperature range of 70 to 80°C, then the operating frequency corresponding to that temperature range is 20% or 0.2 times the maximum operating voltage. Other temperature ranges can be obtained by experimental measurement. The above is merely illustrative and does not limit the present application. In embodiments of this application, if there are multiple predetermined operating electrical parameters, one or more of them can be adjusted, and are not limited thereto.
[0046] Similarly, in this embodiment, the step of determining the target electrical parameter value of a predetermined operating electrical parameter based on the parameter value of an environmental parameter and a predetermined correspondence relationship includes the step of determining a target temperature range that includes the current temperature value among the parameter values of the environmental parameter, and the step of determining the target electrical parameter value of a predetermined operating electrical parameter corresponding to the target temperature range based on the predetermined correspondence relationship.
[0047] In this embodiment, the target temperature range to which the current temperature value among the acquired environmental parameters belongs is determined, and based on this target temperature range, the target electrical parameter value of the corresponding predetermined operating electrical parameter is determined, and the processing unit is adjusted according to the determined target parameter value. By doing so, the operating electrical parameter value of the processing unit is adapted to the current environment, allowing the neural network processing to complete the task with relatively high efficiency and reducing power consumption during task execution.
[0048] For the sake of clarity, an example will be given here, and this example is not intended to limit the scope of this application.
[0049] In this example, six target temperature ranges are set: below 20°C, above 20°C and below 40°C, above 40°C and below 60°C, above 60°C and below 70°C, above 70°C and below 80°C, and above 80°C.
[0050] A target temperature range below 20°C corresponds to 100% operating frequency and maximum voltage. A target temperature range above 20°C and 40°C or below corresponds to 70% operating frequency or 70% maximum voltage. A target temperature range above 40°C and 60°C or below corresponds to 50% operating frequency or 50% maximum voltage. A target temperature range above 60°C and 70°C or below corresponds to 30% operating frequency or 30% maximum voltage. A target temperature range above 70°C and 80°C or below corresponds to 20% operating frequency or 20% maximum voltage. A target temperature range above 80°C corresponds to 0% operating frequency and 0% operating voltage.
[0051] Similarly, the operating environment further includes the power supply environment. The processing unit is powered by a power supply, and due to various factors, the voltage supplied by the power supply may not meet the needs of the processing unit. For example, if the voltage is relatively low, the processing unit may perform additional tasks to operate normally, which in turn affects power consumption.
[0052] Therefore, in the embodiment of this application, the environmental parameter includes the current power supply voltage supplied to the processing unit, and the predetermined correspondence includes the correspondence between different power supply voltage ranges of the power supply and different electrical parameter values of the predetermined operating electrical parameter.
[0053] Similar to the current temperature, in this embodiment, multiple power supply voltage ranges can be set based on the maximum and minimum power supply voltages required by the processing unit. A target voltage range lower than the minimum power supply voltage corresponds to 0% operating frequency and operating voltage, meaning the processing unit stops operating. Multiple power supply voltage ranges are defined between the maximum and minimum power supply voltages, each power supply voltage range corresponds to a different operating frequency, and the operating voltage corresponding to each power supply voltage range corresponds to the lowest voltage in that range. If the power supply voltage supplied by the power supply is greater than the power supply voltage required by the processing unit, it can be used to support 100% operating frequency and operating voltage.
[0054] Some electronic devices are powered by batteries, and if the battery has a certain amount of electricity and the amount of electricity is too low, it may not be able to provide a suitable operating environment for the processing unit. For this reason, in the embodiments of this application, the environmental parameters may further include the current amount of electricity supplied to the processing unit. Similarly, the predetermined correspondence includes the correspondence between different power supply voltages and electricity amounts of the power supply and different electrical parameter values of the predetermined operating electrical parameters.
[0055] The step of determining the target electrical parameter value of a predetermined operating electrical parameter based on the parameter value of the environmental parameter and a predetermined correspondence relationship includes the step of determining the target electricity quantity range, which includes the current power supply electricity quantity, among the parameter values of the environmental parameter, and the step of determining the target electrical parameter value of the predetermined operating electrical parameter corresponding to the target electricity quantity range based on the predetermined correspondence relationship.
[0056] Similarly to the above, in this embodiment, target parameter values for the corresponding predetermined operating electrical parameters may be set for different power supply charge ranges. For example, when the power supply charge is greater than 50%, the corresponding operating frequency is 100% and the operating voltage is at its maximum value. When the power supply charge is 50% or less but greater than 20%, the corresponding operating frequency is 50% and the corresponding operating voltage is 50% of the maximum operating voltage. When the power supply charge is 20% or less, the operating frequency and operating voltage are at their minimum values in the operating state.
[0057] In some embodiments, when multiple environmental parameters all change, the corresponding parameter values for each environmental parameter are determined, and the lowest parameter value is determined as the target parameter value for setting the processing unit.
[0058] The above are all illustrative examples. Depending on the actual scenario, the type of processing unit, the type of electronic equipment, and the actual work content may differ. Therefore, the electrical parameter values of the predetermined operating electrical parameters that satisfy the predetermined requirements under different operating environments will differ, and for this reason, the above parameter values and the number of partitioned ranges do not limit this application.
[0059] S130: Control the predetermined operating electrical parameters of the processing unit to execute the current task with the target electrical parameter values.
[0060] In this embodiment, after determining the target electrical parameter value, predetermined operating electrical parameters are controlled to execute the current task with the target electrical parameter value. This ensures that the power consumption of the processing unit meets predetermined requirements and prevents excessive power consumption by the unit.
[0061] Referring to Figure 2, which is a supplementary flowchart of a power consumption management method for a processing unit according to one embodiment of this application. In one embodiment of this application, the following steps are further performed before the processing unit executes a task.
[0062] S140: The processing unit responds by indicating that it has completed the task and starts timing.
[0063] In this embodiment, a timer program is placed within the control unit, and the timer performs the timing.
[0064] In one embodiment of this application, a control unit monitors the operation of a processing unit, determines whether the processing unit is executing a task, and activates a timer to start timing when the task is completed. In some other embodiments, after completing the task, the processing unit may send a signal to the control unit to instruct the control unit to activate the timer and start timing. The above are illustrative examples and do not limit this application.
[0065] In some embodiments, after timing is started, the predetermined operating electrical parameters of the processing unit are set to the minimum electrical parameter values allowed for the processing unit in its operating state.
[0066] The operating state refers to the state in which a processing unit is capable of executing a task, and the requirements placed on the processing unit vary depending on the task. For example, some tasks require a relatively high operating frequency of the processing unit in order for it to complete the task within a relatively short time.
[0067] The processing unit has already completed its current task and is waiting for a new task while the timer is running. In this case, reducing the electrical parameter values of the processing unit's operating electrical parameters does not affect its normal operation. Therefore, in the embodiment of this application, the predetermined operating electrical parameters of the processing unit are set to the minimum electrical parameter values allowed for the processing unit in its operating state, thereby reducing power consumption while the processing unit is waiting for a new task. In order for the processing unit to maintain its operating state, when a new task arises, the processing unit can quickly adjust the electrical parameter values of its operating electrical parameters and execute the new task in a timely manner.
[0068] In the embodiments of this application, since the operating frequency and operating voltage have a relatively large effect on the power consumption of the processing unit, the predetermined operating electrical parameters include at least one of the operating frequency and operating voltage, thereby making it possible to reduce power consumption relatively significantly after adjusting the operating electrical parameters.
[0069] In some other embodiments of this application, after timing has started, the processing unit can be controlled to enter a standby state while under power supply. In this standby state, the processing unit has an operating frequency of 0, and the clock inside the NPU is turned off, setting its internal frequency to 0. At this time, the NPU is completely inoperable and enters a deep sleep mode, and this method can also effectively reduce power consumption.
[0070] Compared to setting the operating electrical parameters to the minimum electrical parameter values allowed in the operating state, the standby state consumes less power, but the standby state response speed is slower. Both the standby state and setting the predetermined operating electrical parameters to the minimum electrical parameter values allowed by the processing unit in the operating state constitute a low-power consumption mode. Either can be selected depending on the response speed or power consumption of task execution, and is not limited thereto.
[0071] S150: When the time duration reaches a predetermined duration, if the processing unit has not received a new task, the power supply is controlled to stop supplying power to the processing unit.
[0072] In this embodiment, when the time measurement reaches a predetermined length and the processing unit has not received a new task, it indicates that the processing unit has no tasks to process for a long period of time. At this time, the power supply is controlled to stop supplying power to the neural network processing unit, that is, the electricity is cut off. Even when no tasks are executed while powered, the processing unit still requires a certain amount of power consumption to maintain a low-power consumption state such as standby or sleep. After the electricity is cut off, the processing unit stops consuming power. And since the processing unit has no new tasks, power consumption by the neural network can be reduced without affecting the normal operation of the electronic equipment.
[0073] In this embodiment, the predetermined time length can be determined according to the actual operating scenario of the processing unit. For example, in some scenarios, the processing unit needs to handle a large number of different tasks, and if different tasks are handled frequently, a longer predetermined time length can be set, thereby reducing the possibility of the processing unit frequently losing power. Conversely, if the processing unit has relatively few tasks to perform, the frequency of task execution is relatively low, so a shorter predetermined time length can be set, thereby reducing power consumption by promptly shutting off the power after the processing unit completes its tasks. Here, the specific value of the predetermined time length is not limited.
[0074] In some embodiments, after the step of starting timing in response to the processing unit having just completed a task, the power consumption management method of the processing unit further includes the steps of stopping timing if the processing unit receives a new task before the timing time reaches a predetermined time, reacquiring the parameter values of environmental parameters, redetermining the target electrical parameter values of predetermined operating electrical parameters based on the reacquired parameter values of environmental parameters, and having the processing unit perform the new task based on the redetermined target electrical parameter values.
[0075] After a processing unit completes a task, the operating environment of the processing unit may change. For example, in the case of portable devices, temperature changes may cause the processing unit's power consumption to be at a relatively high level under the current environment. In this embodiment, after the processing unit receives a new task, it re-determines new target electrical parameter values based on environmental parameters and executes the new task with the re-determined target electrical parameter values. This prevents the new task from consuming too much power or from being relatively inefficient, thereby keeping the overall power consumption of the processing unit at a relatively low level.
[0076] In one embodiment of this application, while the processing unit is electrically shut off, it is also possible to respond to a request to assign a new task to the processing unit and to further control the power supply to the processing unit.
[0077] As described above, after the timing period reaches a predetermined length, the power supply to the processing unit is stopped, and the processing unit enters an electrically shut-off state. Furthermore, in some electronic devices, the processing unit may not start up simultaneously with the startup of the electronic device, requiring separate control to start the processing unit, which is in an electrically shut-off state before it starts up. If the processing unit needs to perform a new task during the operation of the electronic device, it needs to be started up, and therefore, in response to a request to assign a new task to the processing unit, the power supply is controlled to supply power to the processing unit.
[0078] In one embodiment of the present application, a new task can be assigned to a processing unit by a control unit, and therefore, there may be cases where the control unit needs to assign a new task to the processing unit. In this case, before the need to assign to the processing unit arises, the control unit first controls the power supply to power the processing unit and then transmits the task to the processing unit.
[0079] In some other embodiments, other units in an electronic device need to assign a new task to a processing unit, for example, a GPU needs the processing unit to perform a certain task. In this embodiment, before other units other than the control unit assign a new task to the processing unit, they first send a notification message to the control unit indicating their intention to assign a task to the processing unit. After receiving this notification message, the control unit controls the power supply to power the processing unit, and after the power supply to the processing unit is successful, it sends a response to the other unit that sent the notification message indicating that the processing unit is now powered on. After receiving the response from the control unit indicating that the processing unit is now powered on, the other unit assigns a task to the processing unit.
[0080] In one embodiment, before sending a new task to the processing unit, the other unit sends a notification message to the control unit indicating its intention to assign a task to the processing unit, and then assigns the new task to the processing unit after receiving a response indicating that the processing unit has been powered on.
[0081] In some other embodiments, only when the processing unit is powered off, before other units can assign a new task to the processing unit, the control unit is first notified of the intention to assign a task to the processing unit, and then, after receiving a response that the processing unit has been powered on, the processing unit is assigned a new task. On the other hand, if the processing unit is not powered off, a new task is assigned directly to the processing unit. In this embodiment, the control unit controls the power supply to stop supplying power to the processing unit and then notifies other units that the processing unit has been powered off.
[0082] The above is merely an example; specific methods can be set according to the actual connection and control methods in electronic devices, and are not limited thereto.
[0083] To facilitate understanding, an example is given here to illustrate the method relating to this application, and this example is not limiting to this application. Referring to Figure 3, Figure 3 is a schematic flowchart showing the entire flow of a power consumption management method for a processing unit according to one embodiment of this application. In this example, the processing unit is an NPU, and the power consumption management method for the processing unit includes the following steps.
[0084] First, with the processing unit powered off, step S301 is executed in response to a request to assign a new task to the NPU, and power is supplied to the NPU. After power is supplied, steps S302 to S304 are executed in order. S302: The parameter values of the environmental parameters are obtained. S303: The target parameter values are determined based on the parameter values of the environmental parameters and a predetermined correspondence. S304: The predetermined operating electrical parameters of the NPU are controlled to execute the current task with the target electrical parameter values.
[0085] S305: Run until the current task is completed. Then, run S306 and S307 simultaneously. S306: Put the NPU into standby mode. S307: Start timing.
[0086] If a new task is received before the time duration reaches the predetermined time duration, steps S301 to S307 are re-executed. If no new task is received, step S308: If no new task is received, the NPU is electrically shut off is executed.
[0087] The specific details of each of the above steps can be found in the previous section, so a detailed explanation will be omitted here.
[0088] Based on the same inventive concept, embodiments of this application further provide a power consumption management device for a processing unit. The power consumption management device for a processing unit is used in a control unit of an electronic device. The electronic device further includes a processing unit and a power supply that provides power to the processing unit, and the control unit, processing unit and power supply are connected to each other.
[0089] Referring to Figure 4, which is a schematic diagram of a power consumption management device for a processing unit according to one embodiment of this application, the power consumption management device for the processing unit includes an acquisition module 440 and a control module 430.
[0090] The acquisition module 440 is configured to acquire parameter values of environmental parameters of the operating environment of the processing unit.
[0091] The control module 430 determines a target electrical parameter value for a predetermined operating electrical parameter based on a predetermined correspondence between the parameter value of the environmental parameter, the predetermined correspondence includes a correspondence between different parameter values of the environmental parameter and different target electrical parameter values of the predetermined operating electrical parameter, the different target electrical parameter value of the predetermined operating electrical parameter is an electrical parameter value that satisfies a predetermined requirement for the power consumption of the processing unit under different parameter values of the environmental parameter, and the control module 430 controls the predetermined operating electrical parameter of the processing unit to execute the current task with the target electrical parameter value.
[0092] The environmental parameter includes the current temperature of the operating environment of the processing unit, and the predetermined correspondence includes the correspondence between different temperature ranges of the current temperature and different electrical parameter values of the predetermined operating electrical parameter. Specifically, the control module 430 is configured to determine a target temperature range that includes the current temperature value among the parameter values of the environmental parameter, and to determine the target electrical parameter value of the predetermined operating electrical parameter corresponding to the target temperature range based on the predetermined correspondence.
[0093] The environmental parameters include the current power supply voltage that supplies power to the processing unit, and the predetermined correspondence includes the correspondence between different power supply voltage ranges of the power supply and different electrical parameter values of the predetermined operating electrical parameters. Specifically, the control module 430 is configured to determine a target voltage range that includes the voltage value of the current power supply voltage among the parameter values of the environmental parameters, and to determine the target electrical parameter value of the predetermined operating electrical parameters corresponding to the target voltage range based on the predetermined correspondence.
[0094] The environmental parameters include the current power supply amount of electricity supplied to the processing unit, and the predetermined correspondence includes the correspondence between different ranges of electricity amounts of the current power supply amount and different electrical parameter values of predetermined operating electrical parameters. Specifically, the control module 430 is configured to determine a target electricity amount range among the parameter values of the environmental parameters, including the current power supply amount, and to determine the target electrical parameter value of the predetermined operating electrical parameter corresponding to the target electricity amount range based on the predetermined correspondence.
[0095] The power consumption management device for the processing unit further includes a timer module 410 and a power on / off control module 420.
[0096] The timer module 410 is configured to start timing in response to the processing unit completing the current task. A predetermined time length is set in the timer module 410, and when the timing reaches the predetermined time length, if the processing unit has not received a new task, the power on / off control module 420 controls the power to stop supplying power to the processing unit.
[0097] The control module 430 is configured to set predetermined operating electrical parameters of the processing unit to the minimum electrical parameter values allowed for the processing unit in its operating state, and the predetermined operating electrical parameters include operating electrical parameters related to the power consumption of the processing unit.
[0098] The predetermined operating electrical parameters set by the control module 430 include at least one of the operating frequency and operating voltage of the processing unit.
[0099] The control module 430 is further configured to control the processing unit to enter a standby state under power supply conditions after the start of the timing. The processing unit has an operating frequency of 0 in the standby state.
[0100] The power on / off control module 420 further controls the power supply to the processing unit in response to a request to assign a new task to the processing unit while the processing unit is electrically shut off.
[0101] The timer module 410 is further configured to stop timing if the processing unit receives a new task after timing has started but before the timing reaches the predetermined time length. The acquisition module 440 is further configured to reacquire the parameter values of the environmental parameters. The control module 420 is further configured to re-determine the target electrical parameter values of the predetermined operating electrical parameters based on the reacquired parameter values of the environmental parameters, and to control the processing unit to execute the new task based on the re-determined target electrical parameter values.
[0102] The functions implemented by the power consumption management device of the processing unit described above are similar to the power consumption management method of the processing unit described above, and since the details can be found by referring to the content described above, a detailed explanation will be omitted here.
[0103] Based on the same inventive concept, embodiments of this application further provide electronic devices. Referring to Figure 5, which is a schematic diagram of an electronic device according to one embodiment of this application, the electronic device 500 includes a control unit 510, a processing unit 520, and a power supply 530. The control unit 510 is connected to the processing unit 520 and the power supply 230 to control the processing unit 520 and the power supply 230, and the power supply 530 is connected to the processing unit 520 and configured to supply power to the processing unit 520.
[0104] The control unit 510 may be a device having control functions, such as a CPU or MCU, and is configured to perform the power consumption management method of the processing unit according to the above embodiment of this application. The processing unit may be an NPU, GPU, ISP, DPU, VPU, etc. The details of the power consumption management method of the processing unit can be found in the above description and will not be explained here.
[0105] In one embodiment of this application, the electronic device 500 further includes an environmental monitoring unit 540. The environmental monitoring unit 540 is configured to monitor the operating environment of the processing unit 520 and acquire environmental parameters. The environmental monitoring unit 540 is connected to a control unit 510 and further provides the environmental parameters to the control unit 510 so that the control unit can perform the power consumption management method of the processing unit described above, which utilizes the environmental parameters.
[0106] The technical features of each of the above embodiments can be freely combined as long as they do not contradict each other, and embodiments obtained by such combinations are included within the scope of protection of this application.
[0107] The above are merely specific embodiments of the present application, and the scope of protection of this application is not limited to these. Any modification or substitution made within the scope of the art disclosed herein will be considered within the scope of protection of this application by a person skilled in the art. Therefore, the scope of protection of this application is equivalent to the claims.
[0108] In this specification, terms such as “having,” “including,” and any variations thereof are intended to encompass non-exclusive inclusion. Thus, a process, method, article, or apparatus that includes a set of elements is not necessarily limited to these elements and may include unspecified elements or other elements inherent to these processes, methods, articles, or apparatus. Unless otherwise specified, the expression “including” does not exclude situations where the process, method, article, or apparatus that includes the aforementioned elements also has other similar elements. [Explanation of Symbols]
[0109] Power consumption management device for 400 processing units 410 Timer Module 420 Power On / Off Control Module 430 Control Module 440 Acquisition Module 500 Electronic equipment 510 Control Unit 520 processing units 530 Power supply 540 Environmental Monitoring Unit
Claims
1. A method for managing the power consumption of a processing unit used in a control unit of an electronic device, wherein the electronic device further includes a processing unit, the control unit and the processing unit are connected, and the method for managing the power consumption of the processing unit is: A step to obtain the parameter values of the environmental parameters of the operating environment of the processing unit, Steps include: determining a target electrical parameter value for a predetermined operating electrical parameter based on a predetermined correspondence between the parameter value of the environmental parameter, wherein the predetermined correspondence includes a correspondence between different parameter values of the environmental parameter and different target electrical parameter values of the predetermined operating electrical parameter, and the different target electrical parameter value of the predetermined operating electrical parameter is an electrical parameter value that satisfies a predetermined requirement for the power consumption of the processing unit under different parameter values of the environmental parameter; The step includes controlling the predetermined operating electrical parameters of the processing unit to perform the current task with the target electrical parameter values. A method for managing the power consumption of a processing unit, characterized by the features described above.
2. The environmental parameter includes the current temperature of the operating environment of the processing unit, and the predetermined correspondence includes the correspondence between different temperature ranges of the current temperature and different electrical parameter values of the predetermined operating electrical parameter. The step of determining the target electrical parameter value of a predetermined operating electrical parameter based on the parameter value of the aforementioned environmental parameter and a predetermined correspondence is as follows: A step of determining a target temperature range that includes the current temperature value among the parameter values of the environmental parameters, The step includes determining the target electrical parameter value of the predetermined operating electrical parameter corresponding to the target temperature range based on the predetermined correspondence relationship. The power consumption management method for a processing unit according to feature 1.
3. The electronic device further includes a power supply that provides power to the processing unit, and the control unit, the processing unit, and the power supply are connected to each other. The environmental parameters include the current power supply voltage supplied to the processing unit, and the predetermined correspondence includes the correspondence between different power supply voltage ranges of the power supply and different electrical parameter values of the predetermined operating electrical parameters. The step of determining the target electrical parameter value of a predetermined operating electrical parameter based on the parameter value of the aforementioned environmental parameter and a predetermined correspondence is as follows: The steps include determining a target voltage range that includes the voltage value of the current power supply voltage among the parameter values of the environmental parameters, The step includes determining the target electrical parameter value of the predetermined operating electrical parameter corresponding to the target voltage range based on the predetermined correspondence relationship. The power consumption management method for a processing unit according to feature 1.
4. The electronic device further includes a power supply that provides power to the processing unit, the control unit, the processing unit, and the power supply are connected to each other, the environmental parameter includes the current power supply amount that provides power to the processing unit, and the predetermined correspondence includes the correspondence between different ranges of current power supply amounts and different electrical parameter values of the predetermined operating electrical parameter. The step of determining the target electrical parameter value of a predetermined operating electrical parameter based on the parameter value of the aforementioned environmental parameter and a predetermined correspondence is as follows: A step of determining the target electricity amount range, which includes the current power supply electricity amount, among the parameter values of the environmental parameters, The step includes determining the target electrical parameter value of the predetermined operating electrical parameter corresponding to the target electrical quantity range based on the predetermined correspondence relationship. The power consumption management method for a processing unit according to feature 1.
5. The electronic device further includes a power supply that provides power to the processing unit, and the control unit, the processing unit, and the power supply are connected to each other. After the step of controlling the predetermined operating electrical parameters of the processing unit to execute the current task with the target electrical parameter values, the power consumption management method: The processing unit has just completed a task, and the step of starting timing is performed. The process includes the step of controlling the power supply to stop supplying power to the processing unit if the time duration reaches a predetermined duration and the processing unit has not received a new task. A method for managing the power consumption of a processing unit according to any one of claims 1 to 4.
6. After the aforementioned timing is started, the power consumption management method is: The steps include setting predetermined operating electrical parameters of the processing unit to the minimum electrical parameter values allowed for the processing unit in its operating state, wherein the predetermined operating electrical parameters include operating electrical parameters related to the power consumption of the processing unit. The power consumption management method for a processing unit according to feature 5.
7. The predetermined operating electrical parameters include at least one of the operating frequency and operating voltage of the processing unit. The power consumption management method for a processing unit according to feature 6.
8. After the aforementioned timing is started, the power consumption management method is: The process includes a step of controlling the processing unit to enter a standby state while powered, wherein the processing unit has an operating frequency of 0 while in the standby state. The power consumption management method for a processing unit according to feature 5.
9. The power consumption management method for the processing unit is as follows: The step further includes, while the processing unit is in an electrically shut-off state, responding to a request to assign a new task to the processing unit, controlling the power supply to supply power to the processing unit. The power consumption management method for a processing unit according to feature 5.
10. After the step of starting timing in response to the processing unit having just completed the task, the power consumption management method: If the processing unit receives a new task before the aforementioned timing time reaches the predetermined time, the timing is stopped. The steps include: obtaining the parameter values of the aforementioned environmental parameters again; The steps include: re-determining the target electrical parameter value of the predetermined operating electrical parameter based on the parameter value of the re-acquired environmental parameter; The step includes controlling the processing unit to perform the new task based on the re-determined target electrical parameter values. The power consumption management method for a processing unit according to feature 5.
11. A power consumption management device for a processing unit used in a control unit of an electronic device, wherein the electronic device further includes a processing unit, and the control unit and the processing unit are connected. The power consumption management device for the processing unit includes an acquisition module and a control module. The acquisition module is configured to acquire parameter values of environmental parameters of the operating environment of the processing unit. The control module determines a target electrical parameter value for a predetermined operating electrical parameter based on a predetermined correspondence between the parameter value of the environmental parameter, the predetermined correspondence includes a correspondence between different parameter values of the environmental parameter and different target electrical parameter values of the predetermined operating electrical parameter, the different target electrical parameter value of the predetermined operating electrical parameter is an electrical parameter value that satisfies a predetermined requirement for the power consumption of the processing unit under different parameter values of the environmental parameter, and the control module controls the predetermined operating electrical parameter of the processing unit to execute the task at the target electrical parameter value. A power consumption management device for a processing unit, characterized by the following features.
12. It includes a control unit, a processing unit, an environmental monitoring unit, and a power supply. The control unit is configured to perform the power consumption management method for the processing unit described in any one of claims 1 to 10. The processing unit is connected to the control unit, The environmental monitoring unit is configured to monitor the operating environment of the processing unit and acquire environmental parameters. The environmental monitoring unit is further connected to the control unit and is configured to provide the environmental parameters to the control unit in order for the control unit to execute the power consumption management method of the processing unit described in any one of claims 1 to 10. The power supply is connected to the control unit and the processing unit, respectively, and is configured to respond to the control of the control unit by supplying or cutting off power to the processing unit. An electronic device characterized by the following features.
13. A readable storage medium, wherein a program is stored in the readable storage medium, and when the program is executed by the processor, the processor executes the power consumption management method for the processing unit according to any one of claims 1 to 10. A readable storage medium characterized by the following features.