A method and system for controlling the energy consumption of a device
By introducing timers and self-balancing modules into intelligent sensing node devices, the main frequency is dynamically adjusted, solving the problem of high energy consumption caused by the maximum main frequency in existing technologies, and enabling the device to operate stably with low energy consumption.
Patent Information
- Application Number
- CN202310567264.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-17
- Publication Date
- 2025-12-09
- Estimated Expiration
- 2043-05-17
AI Technical Summary
The existing intelligent sensing node device control mode is affected by the maximum main frequency, resulting in insignificant energy-saving effect and low energy utilization rate.
It adopts single-task and multi-task control modes, and dynamically adjusts the main frequency of the equipment through timers and self-balancing modules. The main frequency is adjusted in real time according to the task completion status and load rate to ensure that the equipment operates normally with low energy consumption.
While ensuring the normal operation of the equipment, it achieves low energy consumption, avoids equipment malfunction caused by delays in the operation of functional modules, and improves the stability and reliability of the equipment.
Smart Images

Figure CN116679597B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the field of device operation control, and particularly relates to a device operation energy consumption control method and system. BACKGROUND
[0002] The intelligent sensing node device can be used in intelligent sensing scenarios of various target parameters; in the working process, the intelligent sensing node device senses or acquires corresponding sensing data, processes the data, and forwards the processed data to a corresponding destination; since the real-time performance of the intelligent sensing node device task is usually strong, the amount of data that needs to be collected or acquired in a short time can be large, so the device energy consumption of the intelligent sensing node device is also large in the case of long-time operation.
[0003] To reduce the energy consumption of the intelligent sensing node device, the prior art mainly adopts a control mode of normal operation combined with sleep according to the sensing task to be executed, that is, when the intelligent sensing node device is normally operated, it is controlled to run at the maximum frequency, and when the task is completed, the intelligent sensing node device is controlled to enter a sleep state, waits for a specific event to wake up the device, and then re-operates normally; however, the energy consumption of this method is constrained by the maximum frequency of the intelligent sensing node device itself, and the larger the maximum frequency, the greater the energy consumption, so in the case of a large maximum frequency of the intelligent sensing node device itself, the energy saving effect of the intelligent sensing node device will not be obvious, and the energy utilization rate will still be low. SUMMARY
[0004] The present application aims to provide a device operation energy consumption control method and system to solve the problem that the existing control mode is affected by the maximum frequency of the intelligent sensing node device itself, resulting in poor energy saving effect and low energy utilization rate.
[0005] To achieve the above-mentioned purpose, the present application provides a device operation energy consumption control method, the device comprising a plurality of functional modules, the device operation energy consumption control method comprising a single task control mode; if the functional modules are connected in series, the single task control mode is used for device operation energy consumption control:
[0006] Before the device is operated, the interrupt period of the timer and the initial value of the main frequency variable are set, the initial value of the main frequency variable being less than the maximum system frequency of the device; the interrupt period of the timer is determined by the required operation period of the device and the required load rate of the device;
[0007] When the device starts running, a timer is started, and the main frequency variable value is used as the device running main frequency, and each functional module is run in series; after each functional module is run in series, the self-balancing module is run; if the timer interrupt occurs before each functional module is run in series, the timer count value is read, and the main frequency is raised to the first set main frequency high level value to continue running each functional module, the timer continues to count, and after each functional module is run, the self-balancing module is run; the set main frequency high level value of the single task control mode is greater than the current device running main frequency;
[0008] When the self-balancing module starts running, the timer is stopped, the timer count value is read, the required computing power is calculated according to the timer count value read when the timer interrupt occurs, the timer count value read when the self-balancing module starts running, the current device running main frequency, and the first set main frequency high level value, and a new main frequency variable value is calculated through the required computing power, and the new main frequency variable value is used as the device running main frequency, and each functional module is run in series again.
[0009] The beneficial effects of the above technical solutions are: for the single task mode of the device, a timer of a periodic interrupt is set according to the required running period of the device and the required load rate of the device, and after each functional module is run in series, whether the task is completed long or short compared with the time corresponding to the required load rate of the device is reflected by reading the timer count value and whether the interrupt occurs, so as to recalculate the main frequency of the device running in the single task mode of each functional module in series next time, which can not only make the energy consumption relatively low but also ensure the normal completion of the task, so that the device main frequency can be adjusted in real time in each running period of the device, that is, the device energy consumption is dynamically adjusted, and the corresponding task can be completed at a relatively low main frequency under the premise of ensuring the normal operation of the single task mode of the device, thereby realizing low device running energy consumption.
[0010] Further, the device running energy consumption control method further includes a multi-task control mode; if each functional module is used as a different functional module task, and the running is switched back and forth according to the priority of each functional module task, the multi-task control mode is used for device running energy consumption control:
[0011] Before the device runs, the interrupt period of the timer and the initial value of the main frequency variable are set, and the initial value of the main frequency variable is less than the maximum system main frequency of the device; the interrupt period of the timer is determined by the required running period of the device and the required load rate of the device;
[0012] The self-balancing task is set, the device starts running, a timer is started, a main frequency variable value is used as the device running main frequency, and the self-balancing task priority is set to the lowest priority; if the timer interrupt occurs before all the function module tasks are idle, the timer count value is read, and the main frequency is raised to a second set main frequency high level value; the function module tasks continue running, the timer continues counting, and when all the function module tasks are idle, the self-balancing task starts running; the set main frequency high level value of the multi-task control mode is greater than the current device running main frequency.
[0013] When all the function module tasks are idle, the self-balancing task starts running, the timer is stopped, the timer value is read, the required computing power is calculated according to the timer count value read when the timer interrupt occurs, the timer count value read when the self-balancing task starts running, the current device running main frequency, and the second set main frequency high level value, the new main frequency variable value is calculated through the required computing power, the new main frequency variable value is used as the device running main frequency, the timer is started again, and the function module tasks start running.
[0014] The above technical solution has the beneficial effects that: for the multi-task mode of the device, a timer with a periodic interrupt determined according to the required running period of the device is set, and the self-balancing task priority is set to the lowest priority; the running time relationship between the function module tasks and the self-balancing task within the running period and whether the interrupt occurs reflect whether the function module corresponding task completion time is longer or shorter compared with the time corresponding to the load rate required by the device, so as to recalculate the main frequency of the device running in the multi-task mode in which the tasks corresponding to the function modules are switched according to the priority, which can both reduce the energy consumption and ensure the task completion, thereby adjusting the device main frequency in real time in each running period of the device, that is, dynamically adjusting the device energy consumption, ensuring the normal operation of the device multi-task mode, and completing the corresponding task at a relatively low main frequency to achieve a relatively low device running energy consumption.
[0015] Further, when the single-task control mode is used for device running energy consumption control, the required computing power is calculated according to the timer count value read when the timer interrupt occurs, the timer count value read when the self-balancing module starts running, the current device running main frequency, and the set main frequency high level value, and the new main frequency variable value is calculated through the required computing power.
[0016] The timer flag is read to determine whether the timer interrupt occurs in the current device running process; if the timer interrupt occurs, the required computing power is C1*F_RUN+(C2-C1)*F_MAX1; if the timer interrupt does not occur, the required computing power is C2*F_RUN.
[0017] Then, the required computing power is divided by the required running period of the device to obtain the new main frequency variable value.
[0018] Wherein C1 is the timer count value read when the timer interrupt occurs, C2 is the timer count value read when the self-balancing module starts running, F_RUN is the current device running frequency, and F_MAX1 is the first set frequency high level value.
[0019] Further, when the multi-task control mode is used for device running energy consumption control, the required calculation power is calculated according to the timer count value read when the timer interrupt occurs, the timer count value read when the self-balancing task starts running, the current device running frequency, and the second set frequency high level value.
[0020] The timer flag is read to determine whether the timer interrupt occurs during the current device running process. If the timer interrupt occurs, the required calculation power is C1*F_RUN+(C2-C1)*F_MAX2. If the timer interrupt does not occur, the required calculation power is C2*F_RUN.
[0021] Then, the required calculation power is divided by the required running period of the device to obtain a new frequency variable value.
[0022] Wherein C1 is the timer count value read when the timer interrupt occurs, C2 is the timer count value read when the self-balancing task starts running, F_RUN is the current device running frequency, and F_MAX2 is the second set frequency high level value.
[0023] Further, the first set frequency high level value and the second set frequency high level value are both the maximum device frequency.
[0024] The above technical solution has the beneficial effect of avoiding the situation that the running of the functional module cannot be completed in time, causing the device to be unable to work normally, thereby ensuring the stability and reliability of the device running.
[0025] The embodiment also provides a device running energy consumption control system. The device includes a plurality of functional modules. The device running energy consumption control system includes a timer, a self-balancing module, and a processor. The processor is used to execute program instructions to implement the following single-task control mode in the case of serial running of the functional modules.
[0026] Before the device runs, the interrupt period of the timer and the initial value of the frequency variable are set. The initial value of the frequency variable is less than the maximum system frequency of the device. The interrupt period of the timer is determined by the required running period of the device and the required load rate of the device.
[0027] When the device starts running, a timer is started, and the main frequency variable value is used as the device running main frequency, and each functional module is run in series; after each functional module is run in series, the self-balancing module is run; if the timer interrupt occurs before each functional module is run in series, the timer count value is read, and the main frequency is raised to the first set main frequency high level value to continue running each functional module, and the timer continues to count, and after each functional module is run, the self-balancing module is run; the set main frequency high level value of the single task control mode is greater than the current device running main frequency;
[0028] When the self-balancing module starts running, the timer is stopped, the timer count value is read, the required computing power is calculated according to the timer count value read when the timer interrupt occurs, the timer count value read when the self-balancing module starts running, the current device running main frequency, and the first set main frequency high level value, and a new main frequency variable value is calculated through the required computing power, and the new main frequency variable value is used as the device running main frequency, and each functional module is run in series again.
[0029] The beneficial effects of the above technical solutions are: for the single task mode of the device, a timer of a periodic interrupt is set according to the required running period of the device and the required load rate of the device, and the timer count value and whether the interrupt occurs are read after each functional module is run in series, so as to reflect whether the task completion time is longer or shorter than the time corresponding to the required load rate of the device, and the main frequency of the device in the single task mode of each functional module is recalculated, so that the device main frequency can be adjusted in real time in each running period of the device, that is, the device energy consumption is dynamically adjusted, and the corresponding task can be completed at a relatively low main frequency under the premise of ensuring the normal operation of the single task mode of the device, thereby realizing low device running energy consumption.
[0030] Further, the processor is further configured to execute program instructions to realize the following multi-task control mode when each functional module is used as a different functional module task and is switched to run according to the priority of each functional module task:
[0031] Before the device runs, the interrupt period of the timer and the initial value of the main frequency variable are set, and the initial value of the main frequency variable is less than the maximum system main frequency of the device; the interrupt period of the timer is determined by the required running period of the device and the required load rate of the device;
[0032] The self-balancing task is set, the device starts running, a timer is started, a main frequency variable value is used as the device running main frequency, and the self-balancing task priority is set to the lowest priority; if the timer interrupt occurs before all the function module tasks are idle, the timer count value is read, and the main frequency is raised to a second set main frequency high level value; the function module tasks continue running, the timer continues counting, and after all the function module tasks are idle, the self-balancing task starts running; and the set main frequency high level value of the multi-task control mode is greater than the current device running main frequency.
[0033] When all the function module tasks are idle, the self-balancing task starts running, the timer is stopped, the timer value is read, the required computing power is calculated according to the timer count value read when the timer interrupt occurs, the timer count value read when the self-balancing task starts running, the current device running main frequency, and the second set main frequency high level value, the new main frequency variable value is calculated through the required computing power, the new main frequency variable value is used as the device running main frequency, the timer is started again, and the function module tasks start running.
[0034] The above technical solution has the beneficial effects that: for the multi-task mode of the device, a timer with a periodic interrupt determined according to the required running period of the device is set, and the self-balancing task priority is set to the lowest priority; the running time relationship between the function module tasks and the self-balancing task within the running period and whether the interrupt occurs reflect whether the function module corresponding task completion time is longer or shorter compared with the time corresponding to the load rate required by the device, so as to recalculate the main frequency of the device running in the multi-task mode in which the tasks corresponding to the function modules are switched according to the priority, which can not only relatively lower the energy consumption but also ensure the normal completion of the tasks, thereby adjusting the device main frequency in real time in each running period of the device, that is, dynamically adjusting the device energy consumption, and always completing the corresponding tasks at a lower main frequency under the premise of ensuring the normal operation of the multi-task mode of the device, thereby realizing lower device running energy consumption.
[0035] Further, when the single-task control mode is used for device running energy consumption control, the required computing power is calculated according to the timer count value read when the timer interrupt occurs, the timer count value read when the self-balancing module starts running, the current device running main frequency, and the set main frequency high level value, and the new main frequency variable value is calculated through the required computing power, that is:
[0036] The timer flag is read to determine whether the timer interrupt occurs in the current device running process; if the timer interrupt occurs, the required computing power is C1*F_RUN+(C2-C1)*F_MAX1; and if the timer interrupt does not occur, the required computing power is C2*F_RUN.
[0037] Then, the required computing power is divided by the required running period of the device, and the new main frequency variable value is obtained.
[0038] Wherein C1 is the timer count value read when the timer interrupt occurs, C2 is the timer count value read when the balancing module starts running, F_RUN is the current device running frequency, and F_MAX1 is the first set frequency high level value.
[0039] Further, when the multi-task control mode is used for device running energy consumption control, the required calculation power is calculated according to the timer count value read when the timer interrupt occurs, the timer count value read when the balancing task starts running, the current device running frequency, and the second set frequency high level value.
[0040] The timer flag is read to determine whether the timer interrupt occurs during the current device running process, if yes, the required calculation power is C1*F_RUN+(C2-C1)*F_MAX2, and if not, the required calculation power is C2*F_RUN.
[0041] Then the required calculation power is divided by the required device running period to obtain a new frequency variable value.
[0042] Wherein C1 is the timer count value read when the timer interrupt occurs, C2 is the timer count value read when the balancing task starts running, F_RUN is the current device running frequency, and F_MAX2 is the second set frequency high level value.
[0043] Further, the first set frequency high level value and the second set frequency high level value are both the maximum device frequency.
[0044] The above technical solution has the beneficial effect of avoiding the situation that the device cannot work normally due to the failure of the function module to complete running in time, and ensuring the stability and reliability of the device running. BRIEF DESCRIPTION OF DRAWINGS
[0045] Figure 1 It is a single task control mode principle diagram in the device running energy consumption control method embodiment of the present application.
[0046] Figure 2 It is a multi-task control mode principle diagram in the device running energy consumption control method embodiment of the present application. DETAILED DESCRIPTION
[0047] In order to make the purpose, technical solution and advantages of the present application more clear and explicit, the present application is further described in detail below in combination with the drawings and embodiments.
[0048] Device running energy consumption control method embodiment
[0049] The embodiment provides a technical scheme of a device operation energy consumption control method. The control method is suitable for a smart sensing node, which comprises a plurality of functional modules. The device operation energy consumption control method comprises a single task control mode corresponding to a single task mode of the controlled device. In the single task mode, the functional modules of the device are connected in series. If the functional modules are connected in series, the single task control mode is adopted for device operation energy consumption control. The specific control mode is as follows.
[0050] Before the device is operated, it is determined that the control mode is the single task control mode, and a main frequency variable (a single task control mode main frequency variable) is allocated to the control mode. The interrupt period of a timer and the initial value of the main frequency variable are set. The initial value of the main frequency variable needs to be less than the maximum main frequency of the device. In the embodiment, the initial value of the main frequency variable is set to 50% of the maximum main frequency of the device for the convenience of subsequent adjustment. The operation period required by the device is T, and the load rate required by the device is x (that is, the load rate expected to be maintained during the device operation energy consumption control period), and x<1.
[0051] When the device starts to operate, the timer is started, the main frequency variable value is used as the device operation main frequency, and is recorded as F_RUN. The functional modules are connected in series. After each series operation of the functional modules is completed, the timer count value is read. In the embodiment, since the self-balancing module is connected at the end of all the functional modules, after the device starts to operate, the self-balancing module is referred to. Figure 1 Module 1 starts to operate, passes through module 2, …, module n, and reaches the self-balancing module after all the modules are operated. The self-balancing module can start to operate after each series operation of the functional modules is completed, that is, the timer count value is read and is recorded as C2. In the embodiment, the interrupt period of the timer is the product of the operation period required by the device and the load rate required by the device, that is, xT.
[0052] If the timer interrupt occurs before the completion of the serial operation of each functional module, the timer count value is read as C1, and the main frequency is raised to the first set main frequency high level value F_MAX1, and then the serial operation of each functional module is continued, the timer continues to count, and after the completion of the operation of each functional module, the self-balancing module is operated; wherein the set main frequency high level value of the single task control mode is greater than the current device operation main frequency. If the timer interrupt occurs before the completion of the serial operation of each functional module, it is necessary that the time used by each functional module to complete the task in the current device operation period T is greater than xT, which indicates that the current energy consumption is relatively lagging behind the load rate required by the task completion degree of the system, and the energy consumption is low; at this time, in order to avoid the failure of the functional module operation in time, the device operation main frequency is adjusted to the first set main frequency high level value, and then the serial operation of each functional module is continued until the completion of the serial operation; in this embodiment, the first main frequency high level value is the maximum main frequency of the device, which ensures that the remaining task amount of the timeout part is completed at the fastest speed in the case of functional module operation timeout, and the normal work of the device is preferentially ensured.
[0053] When the self-balancing module starts to operate, the timer is stopped, the timer count value is read, the required computing power is calculated according to the timer count value read when the timer interrupt occurs, the timer count value read when the self-balancing module starts to operate, the current device operation main frequency and the first set main frequency high level value, and the new main frequency variable value is calculated through the required computing power, and the new main frequency variable value is used as the device operation main frequency, and the serial operation of each functional module is restarted, and the timer is cleared and restarted.
[0054] Specifically, when the device is operated in the single task control mode, the above-mentioned way of calculating the required computing power according to the timer count value read when the timer interrupt occurs, the timer count value read when the self-balancing module starts to operate, the current device operation main frequency and the set main frequency high level value, and calculating the new main frequency variable value through the required computing power is as follows:
[0055] The timer flag is read to determine whether the timer interrupt occurs in the current device operation process, if it occurs, the required computing power is C1*F_RUN+(C2-C1)*F_MAX1; if it does not occur, the required computing power is C2*F_RUN;
[0056] Then the required computing power is divided by the required operation period T of the device, and the new main frequency variable value is obtained;
[0057] Wherein C1 is the timer count value read when the timer interrupt occurs, C2 is the timer count value read when the self-balancing module starts to operate, F_RUN is the current device operation main frequency, and F_MAX1 is the first set main frequency high level value.
[0058] And in the calculation of the new main frequency variable value, if the new main frequency variable value has little change compared with the current device running main frequency, for example, the deviation is less than 10%, the main frequency adjustment can not be performed, that is, the current device running main frequency is still used as the main frequency variable value in the next device running.
[0059] In the embodiment, the device running energy consumption control method further includes a multi-task control mode corresponding to the single-task mode of the controlled device. In the single-task mode, each functional module of the device is respectively as a different functional module task, and is switched to run according to the priority of each functional module task. That is, if each functional module is respectively as a different functional module task and is switched to run according to the priority of each functional module task, the multi-task control mode is used for device running energy consumption control, and the specific control mode is as follows:
[0060] A self-balancing task (in the embodiment, the self-balancing task corresponds to a self-balancing module) is set, and the priority of the self-balancing task is set to the lowest. When all the functional module tasks are idle, the self-balancing task is executed.
[0061] Before the device running, it is determined that the control mode is the multi-task control mode, and a main frequency variable (a multi-task control mode main frequency variable) is allocated for the control mode. The interrupt period of the timer and the initial value of the main frequency variable are set. The initial value of the main frequency variable is also less than the maximum system main frequency of the device. In the embodiment, for the convenience of subsequent adjustment, the initial value of the main frequency variable is also set to 50% of the maximum value of the device main frequency. The running period required by the device is T, and the load rate required by the device is x (that is, the load rate desired to be maintained by the device running energy consumption control), x < 1. The interrupt period of the timer is the product of the running period required by the device and the load rate required by the device, that is, xT.
[0062] The self-balancing task is set. When the device starts running, the timer is started, the main frequency variable value is used as the device running main frequency, which is recorded as F_RUN, and the priority of the self-balancing task is set to the lowest. Each functional module task and the self-balancing task are run according to the priority. At this time, the priority of other module tasks is higher than that of the self-balancing task, the self-balancing task gives up the running right, and reference is made to Figure 2 ;
[0063] If the timer interrupt occurs before all the function module tasks are idle, the timer count value read at this time is recorded as C1, the main frequency is raised to the second set main frequency high level value, the function module tasks continue to run, the timer continues to count, and after all the function module tasks are idle, the self-balancing task starts to run; the set main frequency high level value of the multi-task control mode is greater than the current device running main frequency; if the timer interrupt occurs before the serial running of each function module is completed, it indicates that the time taken by each function module to complete the task within the current device running period T is necessarily greater than xT, which indicates that the current energy consumption is relatively lagging behind the load rate required by the system for task completion, and the energy consumption is low; at this time, in order to avoid the failure of the device to work normally due to the failure of the function module task to run in time, the device running main frequency is first adjusted to the second set main frequency high level value, and then the serial running of each function module is continued until the serial running is completed; in this embodiment, the second main frequency high level value is the maximum main frequency of the device, which ensures that the remaining task amount of the overtime function module is completed at the fastest speed, and the normal work of the device is preferentially ensured.
[0064] When all the function module tasks are idle, the self-balancing task starts to run, at which time the timer is stopped, the timer value read at this time is recorded as C2, the required computing power is calculated according to the timer count value read at the time of the timer interrupt, the timer count value read at the time when the self-balancing task starts to run, the current device running main frequency and the second set main frequency high level value, and the new main frequency variable value is calculated through the required computing power, the new main frequency variable value is used as the device running main frequency, the timer is restarted, and the function module tasks start to run.
[0065] Specifically, when the multi-task control mode is used for device running energy consumption control, the above-mentioned way of calculating the required computing power according to the timer count value read at the time of the timer interrupt, the timer count value read at the time when the self-balancing task starts to run, the current device running main frequency and the second set main frequency high level value is as follows:
[0066] The timer flag is read to determine whether the timer interrupt has occurred during the current device running process, if the timer interrupt has occurred, the required computing power is C1*F_RUN+(C2-C1)*F_MAX2; if the timer interrupt has not occurred, the required computing power is C2*F_RUN;
[0067] Then, the required computing power is divided by the required running period of the device, and the new main frequency variable value is obtained;
[0068] Wherein C1 is the timer count value read at the time of the timer interrupt, C2 is the timer count value read at the time when the self-balancing task starts to run, F_RUN is the current device running main frequency, and F_MAX2 is the second set main frequency high level value.
[0069] And in the calculation of the new main frequency variable value, if the new main frequency variable value changes little compared with the current device running main frequency, for example, the deviation does not exceed 10%, the main frequency adjustment can not be performed, that is, the current device running main frequency is still used as the main frequency variable value in the next device running.
[0070] Device running energy consumption control system embodiment
[0071] The embodiment provides a device running energy consumption control system, and the control method is suitable for a device such as an intelligent sensing node, and the device comprises a plurality of function modules; the device running energy consumption control system comprises a timer, a self-balancing module and a processor; the processor is used for executing program instructions to realize the following single task control mode in the case that the function modules are connected in series (corresponding to the single task mode of the controlled device):
[0072] Before the device runs, it is determined that the control mode is a single task control mode, and a main frequency variable (a single task control mode main frequency variable) is allocated for the control mode, the interrupt period of the timer and the initial value of the main frequency variable are set; wherein the initial value of the main frequency variable needs to be less than the maximum main frequency of the device, and in the embodiment, the initial value of the main frequency variable is set to 50% of the maximum main frequency of the device for the convenience of subsequent adjustment; the running period required by the device is T, and the load rate required by the device is x (that is, the load rate required to be maintained by the device running energy consumption control), and x < 1;
[0073] When the device starts running, the timer is started, the main frequency variable value is used as the device running main frequency, and is recorded as F_RUN, and the function modules are connected in series; after each time the function modules are connected in series and run, the timer count value is read, and in the embodiment, since the self-balancing module is connected at the end of all the function modules, after the device starts running, the timer count value is read by referring to Figure 1 Module 1 starts running, passes through module 2, …, module n, and after all the modules run, reaches the self-balancing module, the self-balancing module can start running after each time the function modules are connected in series and run, that is, the timer count value is read and is recorded as C2, and in the embodiment, the interrupt period of the timer is the product of the running period required by the device and the load rate required by the device, that is, xT;
[0074] If the timer interrupt occurs before the completion of the serial operation of each functional module, the timer count value is read as C1, and the main frequency is raised to the first set main frequency high level value F_MAX1, and then the serial operation of each functional module is continued, the timer continues to count, and after the completion of the operation of each functional module, the self-balancing module is operated; wherein the set main frequency high level value of the single task control mode is greater than the current device operation main frequency. If the timer interrupt occurs before the completion of the serial operation of each functional module, it is necessary that the time used by each functional module to complete the task in the current device operation period T is greater than xT, which indicates that the current energy consumption is relatively lagging behind the load rate required by the task completion degree of the system, and the energy consumption is low; at this time, in order to avoid the failure of the functional module operation to complete in time and cause the device to fail to work normally, the device operation main frequency is first adjusted to the first set main frequency high level value, and then the serial operation of each functional module is continued until the completion of the serial operation; in this embodiment, the first main frequency high level value is the maximum main frequency of the device, which ensures that the remaining task amount of the timeout part is completed at the fastest speed in the case of functional module operation timeout, and the normal work of the device is preferentially ensured.
[0075] When the self-balancing module starts to operate, the timer is stopped, the timer count value is read, the required computing power is calculated according to the timer count value read when the timer interrupt occurs, the timer count value read when the self-balancing module starts to operate, the current device operation main frequency and the first set main frequency high level value, the new main frequency variable value is calculated through the required computing power, and the new main frequency variable value is used as the device operation main frequency, and the serial operation of each functional module is restarted, and the timer is cleared and restarted.
[0076] Specifically, when the device is operated and the energy consumption is controlled in the single task control mode, the above-mentioned way of calculating the required computing power according to the timer count value read when the timer interrupt occurs, the timer count value read when the self-balancing module starts to operate, the current device operation main frequency and the set main frequency high level value, and calculating the new main frequency variable value through the required computing power is as follows:
[0077] The timer flag is read to determine whether the timer interrupt has occurred in the current device operation process, if yes, the required computing power is C1*F_RUN+(C2-C1)*F_MAX1; if not, the required computing power is C2*F_RUN;
[0078] Then the required computing power is divided by the required operation period T of the device, and the new main frequency variable value is obtained;
[0079] Wherein C1 is the timer count value read when the timer interrupt occurs, C2 is the timer count value read when the self-balancing module starts to operate, F_RUN is the current device operation main frequency, and F_MAX1 is the first set main frequency high level value.
[0080] And in the calculation of the new main frequency variable value, if the new main frequency variable value is not changed much compared with the current device running main frequency, for example, the deviation is not more than 10%, the main frequency adjustment can not be performed, that is, the current device running main frequency is still used as the main frequency variable value in the next device running.
[0081] In the embodiment, the processor is further configured to execute program instructions to switch the running of each functional module as different functional module tasks according to the priority of each functional module task (corresponding to the multi-task mode of the controlled device) to implement the following multi-task control mode:
[0082] A self-balancing task (in the embodiment, the self-balancing task corresponds to the self-balancing module) is set, and the priority of the self-balancing task is set to the lowest, and the self-balancing task is executed only when all the functional module tasks are idle.
[0083] Before the device runs, it is determined that the control mode is the multi-task control mode, and a main frequency variable (the main frequency variable of the multi-task control mode) is allocated for the control mode, the interrupt period of the timer and the initial value of the main frequency variable are set. The initial value of the main frequency variable is also less than the maximum system main frequency of the device; in the embodiment, for the convenience of subsequent adjustment, the initial value of the main frequency variable is also set to 50% of the maximum value of the device main frequency; the required running period of the device is T, and the required load rate of the device is x (that is, the load rate desired to be maintained by the device in the energy consumption control period), x < 1; the interrupt period of the timer is the product of the required running period of the device and the required load rate of the device, that is, xT.
[0084] The self-balancing task is set, when the device starts running, the timer is started, the main frequency variable value is used as the device running main frequency, denoted as F_RUN, and the priority of the self-balancing task is set to the lowest, each functional module task and the self-balancing task are run according to the priority, at this time, the priority of other module tasks is higher than that of the self-balancing task, the self-balancing task gives up the running right, and the priority of the self-balancing task is adjusted according to the following formula: Figure 2 ;
[0085] If the timer interrupt occurs before all the function module tasks are idle, the timer count value read at this time is recorded as C1, the main frequency is raised to the second set main frequency high level value, the function module tasks continue to run, the timer continues to count, and after all the function module tasks are idle, the self-balancing task starts to run; the set main frequency high level value of the multi-task control mode is greater than the current device running main frequency; if the timer interrupt occurs before the serial running of each function module is completed, it indicates that the time taken by each function module to complete the task within the current device running period T is necessarily greater than xT, which indicates that the current energy consumption is relatively lagging behind the load rate required by the system for task completion, and the energy consumption is low; at this time, in order to avoid the failure of the device to work normally due to the failure of the function module task to run in time, the device running main frequency is first adjusted to the second set main frequency high level value, and then the serial running of each function module is continued until the serial running is completed; in this embodiment, the second main frequency high level value is the maximum main frequency of the device, which ensures that the remaining task amount of the overtime function module is completed at the fastest speed, and the normal work of the device is preferentially ensured.
[0086] When all the function module tasks are idle, the self-balancing task starts to run, at which time the timer is stopped, the timer value read at this time is recorded as C2, the required computing power is calculated according to the timer count value read at the time of the timer interrupt, the timer count value read at the time when the self-balancing task starts to run, the current device running main frequency and the second set main frequency high level value, and the new main frequency variable value is calculated through the required computing power, the new main frequency variable value is used as the device running main frequency, the timer is restarted, and the function module tasks start to run.
[0087] Specifically, when the multi-task control mode is used for device running energy consumption control, the above-mentioned way of calculating the required computing power according to the timer count value read at the time of the timer interrupt, the timer count value read at the time when the self-balancing task starts to run, the current device running main frequency and the second set main frequency high level value is as follows:
[0088] The timer flag is read to determine whether the timer interrupt has occurred during the current device running process, if it has occurred, the required computing power is C1*F_RUN+(C2-C1)*F_MAX2; if it has not occurred, the required computing power is C2*F_RUN;
[0089] Then the required computing power is divided by the required running period of the device, and the new main frequency variable value is obtained;
[0090] Wherein C1 is the timer count value read at the time of the timer interrupt, C2 is the timer count value read at the time when the self-balancing task starts to run, F_RUN is the current device running main frequency, and F_MAX2 is the second set main frequency high level value.
[0091] And in the calculation of the new main frequency variable value, if the new main frequency variable value changes little compared with the current device running main frequency, for example, the deviation does not exceed 10%, the main frequency adjustment can not be performed, that is, the current device running main frequency is still used as the main frequency variable value in the next device running.
[0092] The present application has the following characteristics:
[0093] 1) For the single task mode of the device, a timer of periodic interruption determined according to the required running period of the device and the required load rate of the device is set, and after each series running of the functional modules is completed, whether the task completion time is longer or shorter than the time corresponding to the required load rate of the device is reflected by reading the timer count value and whether the interruption occurs, so as to recalculate the main frequency of the device in the single task mode of the series running of the functional modules in the next running of the device, which can not only relatively lower the energy consumption but also ensure the normal completion of the task, so that the main frequency of the device can be adjusted in real time in each running period of the device, that is, the energy consumption of the device is dynamically adjusted, the corresponding task can be completed at a lower main frequency under the premise of ensuring the normal running of the single task mode of the device, and lower running energy consumption of the device is realized.
[0094] 2) For the multi-task mode of the device, a timer of periodic interruption determined according to the required running period of the device is set, and the self-balancing task priority is set to the lowest, whether the task completion time corresponding to the functional module is longer or shorter than the time corresponding to the required load rate of the device is reflected by the running time relationship of the functional module tasks and the self-balancing tasks in the running period and whether the interruption occurs, so as to recalculate the main frequency of the device in the multi-task mode of the corresponding tasks of the functional modules in the next running of the device, which can not only relatively lower the energy consumption but also ensure the completion of the task, so that the main frequency of the device can be adjusted in real time in each running period of the device, that is, the energy consumption of the device is dynamically adjusted, the corresponding task can be completed at a lower main frequency under the premise of ensuring the normal running of the multi-task mode of the device, and lower running energy consumption of the device is realized.
[0095] 3) In the single task control mode and the multi-task control mode, if the timer interruption occurs before the series running of each functional module is completed or before all the functional module tasks are idle, the device running main frequency is first adjusted to the set main frequency high level value, and then each functional module or functional module task is continuously run until the current running of the device is completed, so that the situation that the running of the functional module or the functional module task cannot be completed in time to cause the device to be unable to work normally can be avoided to the greatest extent, and the stability and reliability of the device running are ensured.
[0096] It should be understood that the above specific embodiments of the present application are only used for illustrative or explanatory purposes of the principles of the present application, and do not constitute a limitation on the present application.
Claims
1. A method for controlling energy consumption during equipment operation, wherein the equipment comprises several functional modules, characterized in that, The device operation energy consumption control method comprises a single task control mode; if the functional modules are connected in series, the single task control mode is used for device operation energy consumption control: Before the device is operated, the interrupt period of the timer and the initial value of the main frequency variable are set, and the initial value of the main frequency variable is less than the maximum system main frequency of the device; the interrupt period of the timer is determined by the required operation period of the device and the required load rate of the device; When the device starts to operate, the timer is started, the main frequency variable value is used as the device operation main frequency, the functional modules are connected in series, and after the connection of the functional modules is completed, the self-balancing module is operated; if the timer interrupt occurs before the connection of the functional modules is completed, the timer count value is read, the main frequency is raised to the first set main frequency high level value, the functional modules continue to operate, the timer continues to count, and after the operation of the functional modules is completed, the self-balancing module is operated; the set main frequency high level value of the single task control mode is greater than the current device operation main frequency; When the self-balancing module starts to operate, the timer is stopped, the timer count value is read, the required computing power is calculated according to the timer count value read when the timer interrupt occurs, the timer count value read when the self-balancing module starts to operate, the device operation main frequency and the first set main frequency high level value, and the new main frequency variable value is calculated through the required computing power, the new main frequency variable value is used as the device operation main frequency, and the functional modules are connected in series again.
2. The device operation energy consumption control method according to claim 1, wherein, The device operation energy consumption control method further comprises a multi-task control mode; if the functional modules are respectively used as different functional module tasks, the multi-task control mode is used for device operation energy consumption control according to the priority of the functional module tasks: Before the device is operated, the interrupt period of the timer and the initial value of the main frequency variable are set, and the initial value of the main frequency variable is less than the maximum system main frequency of the device; the interrupt period of the timer is determined by the required operation period of the device and the required load rate of the device; The self-balancing task is set, when the device starts to operate, the timer is started, the main frequency variable value is used as the device operation main frequency, and the priority of the self-balancing task is set to the lowest; if the timer interrupt occurs before all the functional module tasks are idle, the timer count value is read, the main frequency is raised to the second set main frequency high level value, the functional module tasks continue to operate, the timer continues to count, and after all the functional module tasks are idle, the self-balancing task starts to operate; the set main frequency high level value of the multi-task control mode is greater than the current device operation main frequency; When all the functional module tasks are idle, the self-balancing task starts to operate, at this time, the timer is stopped, the timer value is read, the required computing power is calculated according to the timer count value read when the timer interrupt occurs, the timer count value read when the self-balancing task starts to operate, the device operation main frequency and the second set main frequency high level value, the new main frequency variable value is calculated through the required computing power, the new main frequency variable value is used as the device operation main frequency, the timer is started again, and the functional module tasks start to operate.
3. The device operation energy consumption control method according to claim 1 or 2, wherein, When the single-task control mode is used for the device running energy consumption control, the required computing power is calculated according to the timer count value read when the timer interrupt occurs, the timer count value read when the self-balancing module starts running, the current device running frequency and the first set high level of the frequency, and the new frequency variable value is obtained by dividing the required computing power by the required running period of the device. If the timer interrupt occurs during the current device running process, the required computing power is C1*F_RUN+(C2-C1)*F_MAX1; if the timer interrupt does not occur, the required computing power is C2*F_RUN; Then the new frequency variable value is obtained by dividing the required computing power by the required running period of the device. C1 is the timer count value read when the timer interrupt occurs, C2 is the timer count value read when the self-balancing module starts running, F_RUN is the current device running frequency, and F_MAX1 is the first set high level of the frequency.
4. The device operation energy consumption control method according to claim 2, wherein When the multi-task control mode is used for the device running energy consumption control, the required computing power is calculated according to the timer count value read when the timer interrupt occurs, the timer count value read when the self-balancing task starts running, the current device running frequency and the second set high level of the frequency, and the new frequency variable value is obtained by dividing the required computing power by the required running period of the device. If the timer interrupt occurs during the current device running process, the required computing power is C1*F_RUN+(C2-C1)*F_MAX2; if the timer interrupt does not occur, the required computing power is C2*F_RUN; Then the new frequency variable value is obtained by dividing the required computing power by the required running period of the device. C1 is the timer count value read when the timer interrupt occurs, C2 is the timer count value read when the self-balancing task starts running, F_RUN is the current device running frequency, and F_MAX2 is the second set high level of the frequency.
5. The method of claim 2, wherein, The first set high level of the frequency and the second set high level of the frequency are both the maximum frequency of the device.
6. A system for controlling the energy consumption of a device, the device comprising a number of functional modules, characterized in that The device running energy consumption control system comprises a timer, a self-balancing module and a processor; the processor is used for executing program instructions to realize the following single-task control mode in the case of serially running the functional modules: Before the device starts running, the interrupt period of the timer and the initial value of the frequency variable are set, and the initial value of the frequency variable is less than the maximum system frequency of the device; the interrupt period of the timer is determined by the required running period of the device and the required load rate of the device; When the device starts running, the timer is started, the frequency variable value is used as the device running frequency, the functional modules are serially run, and the self-balancing module is run after the serial running of the functional modules is completed; if the timer interrupt occurs before the serial running of the functional modules is completed, the timer count value is read and the frequency is raised to the first set high level of the frequency to continue running the functional modules, the timer continues to count, the functional modules are run, and then the self-balancing module is run; the set high level of the frequency of the single-task control mode is greater than the current device running frequency; When the self-balancing module starts running, the timer is stopped, the timer count value is read, the required computing power is calculated according to the timer count value read when the timer interrupt occurs, the timer count value read when the self-balancing module starts running, the current device running frequency and the first set frequency high level value, and the new frequency variable value is calculated through the required computing power, the new frequency variable value is taken as the device running frequency, and the series running of each functional module is restarted.
7. The device operating energy consumption control system of claim 6, wherein, The processor is further configured to execute program instructions to implement the following multi-task control mode when each functional module is switched to run as different functional module tasks according to the priority of each functional module task: Before the device runs, the interrupt period of the timer and the initial value of the frequency variable are set, the initial value of the frequency variable is less than the maximum system frequency of the device, and the interrupt period of the timer is determined by the required running period of the device and the required load rate of the device; The self-balancing task is set, the timer is started when the device starts running, the frequency variable value is taken as the device running frequency, and the priority of the self-balancing task is set to the lowest, if the timer interrupt occurs before all the functional module tasks are idle, the timer count value is read and the frequency is raised to the second set frequency high level value, the functional module tasks continue to run, the timer continues to count, and the self-balancing task starts running after all the functional module tasks are idle; the set frequency high level value of the multi-task control mode is greater than the current device running frequency; When all the functional module tasks are idle, the self-balancing task starts running, the timer is stopped at this time, the timer value is read, the required computing power is calculated according to the timer count value read when the timer interrupt occurs, the timer count value read when the self-balancing task starts running, the current device running frequency and the second set frequency high level value, and the new frequency variable value is calculated through the required computing power, the new frequency variable value is taken as the device running frequency, the timer is restarted, and the functional module tasks start running.
8. The device operating energy consumption control system according to claim 6 or 7, wherein, When the single-task control mode is used for device running energy consumption control, the required computing power is calculated according to the timer count value read when the timer interrupt occurs, the timer count value read when the self-balancing module starts running, the current device running frequency and the set frequency high level value, and the new frequency variable value is calculated through the required computing power, which is: The timer flag is read to determine whether the timer interrupt has occurred during the current device running process, if it has occurred, the required computing power is C1*F_RUN+(C2-C1)*F_MAX1; if it has not occurred, the required computing power is C2*F_RUN; Then the required computing power is divided by the required running period of the device to obtain the new frequency variable value; Wherein C1 is the timer count value read when the timer interrupt occurs, C2 is the timer count value read when the self-balancing module starts running, F_RUN is the current device running frequency, and F_MAX1 is the first set frequency high level value.
9. The apparatus of claim 7, wherein the energy consumption control system is operable to, When the device is running in the multi-task control mode, the required computing power is calculated according to the timer count value read when the timer interrupt occurs, the timer count value read when the self-balancing task starts running, the current device running frequency and the second set frequency high level value, and the calculation method is as follows: If the timer interrupt occurs in the current device running process, the required computing power is C1*F_RUN+(C2-C1)*F_MAX2; if the timer interrupt does not occur, the required computing power is C2*F_RUN; Then, the required computing power is divided by the required running period of the device, and a new frequency variable value is obtained. Wherein, C1 is the timer count value read when the timer interrupt occurs, C2 is the timer count value read when the self-balancing task starts running, F_RUN is the current device running frequency, and F_MAX2 is the second set frequency high level value.
10. The apparatus of claim 7, wherein the energy consumption control system is operable to, The first set frequency high level value and the second set frequency high level value are both the maximum frequency of the device.
Citation Information
Patent Citations
Data processing method and device, electronic equipment and readable storage medium
CN110134215A
CPU and GPU combined frequency modulation energy-saving optimization method based on Nvidia TX2
CN110308784A