Parameter adjustment method, first device, storage medium and computer program product

By introducing managers, monitors and regulators into the CPU, the CPU sleep state and working frequency are automatically adjusted, which solves the problem of low efficiency in the operating system core adjustment and achieves the best energy-saving effect and energy-efficiency ratio.

CN119396267APending Publication Date: 2025-02-07CHINA MOBILE COMM LTD RES INST +1
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411480377.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-22
Publication Date
2025-02-07

AI Technical Summary

Technical Problem

The tuning efficiency of the operating system core is low, resulting in a decrease in the energy saving effect of the server and failure to effectively consider the power consumption/performance ratio.

Method used

By introducing a manager, monitor and regulator into the CPU, based on the first parameter generation strategy, the sleep state and operating frequency of the CPU are automatically adjusted to achieve the best energy saving effect.

Benefits of technology

The energy-saving effect of the CPU is improved, so that the operating state parameters are maintained within the set range, and the energy efficiency ratio is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119396267A_ABST
    Figure CN119396267A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a parameter adjusting method, first equipment, a storage medium and a computer program product, the method is applied to the first equipment, the first equipment comprises a central processing unit (CPU), and the method comprises the steps that the CPU generates a first strategy based on a first parameter; wherein the first strategy is used for triggering adjustment processing on the state parameters of the CPU, and the state parameters at least comprise the sleep state of the CPU and / or the working frequency of the CPU; the CPU judges whether the triggering condition of the first strategy is met or not based on the running state data, under the condition that the triggering condition is met, the state parameters of the CPU are automatically adjusted based on the first strategy, in other words, the running state parameters can be automatically adjusted through the CPU, and therefore the running state parameters can be maintained within the set range, and the user experience is improved. Therefore, the best energy-saving effect is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of performance optimization, and in particular to a parameter adjustment method, a first device, a storage medium, and a computer program product. Background Art

[0002] The current server power consumption usually involves two working states: C state and P state; among them, C state is used to describe the processor sleep state, which is generally divided into normal working state, shallow sleep state and deep sleep state, etc.; P state represents the processor energy efficiency state, which is divided into acceleration state, base frequency state and frequency modulation state; and the two working states of the server are not adjusted by the server itself, but with the participation of the operating system kernel, the software and hardware jointly complete the adjustment of different operating states.

[0003] However, the regulation efficiency of the operating system kernel is low. The operating system kernel usually detects the CPU utilization rate in a 10 millisecond cycle and uses the CPU utilization rate as a basis for automatic sleep and automatic frequency adjustment. The CPU regulation efficiency is much higher than that of the operating system. The longest CPU sleep and wake-up time (in deep sleep) is no more than 100 microseconds, and the frequency adjustment delay is less than 1 millisecond. Therefore, the operating system becomes a bottleneck, resulting in a decrease in energy saving effect. Summary of the invention

[0004] The embodiments of the present application provide a parameter adjustment method, a first device, a storage medium, and a computer program product, which can automatically adjust the operating status parameters through the CPU, thereby achieving the best energy-saving effect.

[0005] The technical solution of the embodiment of the present application is implemented as follows:

[0006] In a first aspect, an embodiment of the present application provides a parameter adjustment method, the method is applied to a first device, the first device includes a CPU, and the method includes:

[0007] The CPU generates a first strategy based on a first parameter; wherein the first strategy is used to trigger adjustment processing of a state parameter of the CPU, and the state parameter at least includes a sleep state of the CPU and / or an operating frequency of the CPU;

[0008] The CPU determines whether a trigger condition of the first strategy is met based on the running status data, and automatically adjusts the status parameters of the CPU based on the first strategy when the trigger condition is met.

[0009] In a second aspect, an embodiment of the present application provides a first device, the first device includes a CPU, the CPU includes at least a first circuit unit and a second circuit unit; wherein,

[0010] The first circuit unit is used to generate a first strategy based on a first parameter; wherein the first strategy is used to trigger an adjustment process on a state parameter of the CPU, wherein the state parameter at least includes a sleep state of the CPU and / or an operating frequency of the CPU;

[0011] The second circuit unit is used to determine whether a trigger condition of the first strategy is met based on the operating status data, and automatically adjust the status parameters of the CPU based on the first strategy when the trigger condition is met.

[0012] In a third aspect, an embodiment of the present application provides a first device, the first device comprising: a processor and a memory; wherein:

[0013] The memory is used to store a computer program that can be run on the processor;

[0014] The processor is used to execute the parameter adjustment method as described above when running the computer program.

[0015] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program code is stored. When the computer program code is executed by a computer, the parameter adjustment method as described above is implemented.

[0016] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the parameter adjustment method as described above.

[0017] The embodiment of the present application provides a parameter adjustment method, a first device, a storage medium and a computer program product, the method is applied to the first device, the first device includes a CPU, the method includes: the CPU generates a first strategy based on the first parameter; wherein the first strategy is used to trigger the adjustment of the state parameters of the CPU, the state parameters at least include the sleep state of the CPU, and / or the operating frequency of the CPU; the CPU determines whether the triggering condition of the first strategy is met based on the running state data, and automatically adjusts the state parameters of the CPU based on the first strategy when the triggering condition is met. It can be seen that the CPU of the embodiment of the present application can generate a first strategy based on the first parameter, the strategy is used to trigger the adjustment of the state parameters of the CPU, and then the CPU can determine whether the triggering condition of the first strategy is met based on the running state data, and when the triggering condition is met, the state parameters of the CPU can be automatically adjusted based on the first strategy, that is, the embodiment of the present application can automatically adjust the running state parameters through the CPU, so that the running state parameters can be maintained within a set range to achieve the best energy saving effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 A schematic diagram of processor support in the related art;

[0019] Figure 2 A schematic diagram of the power consumption of a processor in the related art;

[0020] Figure 3 The parameter adjustment method proposed in this embodiment is shown in FIG. Figure 1 ;

[0021] Figure 4 Schematic diagram of the CPU structure proposed in this application embodiment Figure 1 ;

[0022] Figure 5 Schematic diagram of the CPU structure proposed in this application embodiment Figure 2 ;

[0023] Figure 6 The parameter adjustment method proposed in this embodiment is shown in FIG. Figure 2 ;

[0024] Figure 7 Schematic diagram of the composition structure of the first device proposed in the embodiment of the present application Figure 1 ;

[0025] Figure 8 Schematic diagram of the composition structure of the first device proposed in the embodiment of the present application Figure 2 . DETAILED DESCRIPTION

[0026] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. It is understood that the specific embodiments described herein are only used to explain the related applications, rather than to limit the applications. It should also be noted that, for ease of description, only the parts related to the related applications are shown in the drawings.

[0027] Server power consumption usually involves two working states: C state and P state; among them, C state is used to describe the processor sleep state, which is generally divided into normal working state, shallow sleep state, deep sleep state, etc. (taking Intel processor as an example, C0 represents normal working state, C1 / C1E represents shallow sleep, C3 / C6 represents deep sleep, the larger the number, the more circuit units are offline, the lower the power consumption, but the longer the wake-up time is); P state represents the processor energy efficiency state, which is divided into acceleration state, base frequency state, and frequency modulation state (taking Intel processor as an example, P1 represents working at the base frequency, P0 represents entering the turbo acceleration mode, the operating frequency is higher than the base frequency, which is a short-term state, P2~Pn represents running at different frequencies, the larger the number, the lower the frequency, but it is not linear, but automatically adjusted in steps of 100Mhz or 133MHz).

[0028] Currently, the C state and P state of the server are not adjusted by the server itself, but with the participation of the operating system kernel, the software and hardware jointly complete the adjustment of different operating states. Figure 1 Schematic diagram of the support status of processors in related technologies, such as Figure 1 As shown in the figure, the support status of Intel, Hygon, and ARM processors is also described.

[0029] The Basic Input Output System (BIOS) options of the server motherboard include switches for C state and P state (the sleep switch allows the C1 to Cn states to be turned on or off individually, the acceleration switch allows the P0 state to be turned on or off, and the energy-saving switch can set the performance mode or energy-efficiency mode. The performance mode works constantly in the P1 state, and the energy-efficiency mode automatically adjusts the frequency according to the load in the P1 to Pn states). When a certain function is enabled, the operating system kernel can call these two capabilities of the processor to achieve automatic control of sleep and frequency.

[0030] There are two types of drivers in the operating kernel: idledriver implements automatic sleep, and cpufreq driver implements automatic frequency regulation. These two drivers have multiple regulators to achieve different regulation effects, and depending on the processor, there are certain differences between the driver and regulator.

[0031] In summary, with the cooperation of software and hardware, the above mechanism can be used to realize automatic CPU sleep and automatic frequency adjustment, thereby reducing some power consumption while meeting business performance.

[0032] However, the regulation efficiency of the operating system kernel is low. The operating system kernel usually detects CPU utilization in a period of 10 milliseconds and uses CPU utilization as a basis for automatic sleep and automatic frequency adjustment. The CPU regulation efficiency is much higher than that of the operating system. The longest CPU sleep and wake-up time (in deep sleep) is no more than 100 microseconds, and the frequency adjustment delay is less than 1 millisecond. Therefore, the operating system becomes a bottleneck, resulting in a decrease in energy saving effect. At the same time, the power consumption / performance ratio is not considered, and there is still room for optimization of energy saving effect: the lower the CPU frequency, the lower the power consumption and the lower the performance. However, the power consumption under unit performance (i.e., energy efficiency ratio) is not the lower the frequency, the better, but it is best at a certain frequency (which varies with different processors). Figure 2 Schematic diagram of the power consumption of a processor in the related art. Figure 2 As shown, taking the Intel 6230N processor as an example, the power consumption is lowest when the main frequency is adjusted until the CPU utilization is between 50% and 70% while keeping the performance constant.

[0033] In order to solve the problem that the current operating system has become a bottleneck, thereby causing a decrease in energy saving effect, the embodiment of the present application provides a parameter adjustment method, a first device, a storage medium and a computer program product, the method is applied to the first device, the first device includes a CPU, the method includes: the CPU generates a first strategy based on the first parameter; wherein the first strategy is used to trigger the adjustment of the state parameters of the CPU, the state parameters at least include the sleep state of the CPU, and / or the operating frequency of the CPU; the CPU determines whether the triggering condition of the first strategy is met based on the running state data, and automatically adjusts the state parameters of the CPU based on the first strategy when the triggering condition is met. It can be seen that the CPU of the embodiment of the present application can generate a first strategy based on the first parameter, the strategy is used to trigger the adjustment of the state parameters of the CPU, and then the CPU can determine whether the triggering condition of the first strategy is met based on the running state data, and when the triggering condition is met, the state parameters of the CPU can be automatically adjusted based on the first strategy, that is, the embodiment of the present application can automatically adjust the running state parameters through the CPU, so that the running state parameters can be maintained within a set range to achieve the best energy saving effect.

[0034] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.

[0035] The embodiment of the present application provides a parameter adjustment method, which is applied to a first device, wherein the first device includes a CPU, Figure 3 The parameter adjustment method proposed in this embodiment is shown in FIG. Figure 1 ,like Figure 3 As shown, the parameter adjustment method may include the following steps:

[0036] Step 101: The CPU generates a first strategy based on a first parameter; wherein the first strategy is used to trigger adjustment processing of a state parameter of the CPU, and the state parameter at least includes a sleep state of the CPU and / or an operating frequency of the CPU.

[0037] In an embodiment of the present application, a CPU in the first device may generate a first policy based on a first parameter.

[0038] It should be noted that, in the embodiments of the present application, the first device may be a server or other devices, and the present application does not specifically limit the device type of the first device.

[0039] It should be noted that, in an embodiment of the present application, the first parameter may include one or more of the CPU utilization range, the first preset threshold and the second preset threshold, the first preset threshold includes the threshold for the CPU to enter light sleep, and the second preset threshold includes the threshold for the CPU to enter deep sleep. The present application does not specifically limit the parameter type and number of parameters included in the first parameter.

[0040] It should be noted that, in the embodiments of the present application, the state parameters include at least the sleep state of the CPU and / or the operating frequency of the CPU. The present application does not specifically limit the parameter type and number of parameters included in the state parameters.

[0041] It should be noted that, in the embodiments of the present application, the CPU may include a first circuit unit and a second circuit unit, and the present application does not specifically limit the number of circuit units included in the CPU.

[0042] It should be noted that, in an embodiment of the present application, the first circuit unit may be a manager, which may be used at least to generate a first strategy, and the present application does not specifically limit the structure and function of the first circuit unit.

[0043] It should be noted that, in an embodiment of the present application, the second circuit unit may be a regulator, which may be used at least to adjust and process the state parameters of the CPU. The present application does not specifically limit the structure and function of the second circuit unit.

[0044] Further, in an embodiment of the present application, when the CPU generates a first strategy based on a first parameter, the first circuit unit may receive the first parameter sent by the operating system kernel; wherein the first parameter includes one or more of a CPU utilization range, a first preset threshold, and a second preset threshold, the first preset threshold includes a threshold for the CPU to enter shallow sleep, and the second preset threshold includes a threshold for the CPU to enter deep sleep; then the first circuit unit may generate a first strategy based on the first parameter, and send the first strategy to the second circuit unit.

[0045] It should be noted that, in an embodiment of the present application, when the first circuit unit generates the first strategy based on the first parameter, the first circuit unit may first verify the validity of the first parameter to obtain a verification result; if the verification result indicates that the first strategy is passed, the first strategy may then be generated based on the first parameter.

[0046] Exemplarily, in an embodiment of the present application, when the first circuit unit verifies the validity of the first parameter, it can determine whether the value in the first parameter is correct, for example, whether the information in the first parameter is information supported by the CPU. If so, it can be determined that the verification has passed.

[0047] It should be noted that, in an embodiment of the present application, the first strategy may include a second strategy, and the second strategy is at least used to adjust the current operating frequency of the CPU. The present application does not specifically limit the number and type of strategies included in the first strategy.

[0048] It should be noted that, in an embodiment of the present application, when the first circuit unit generates the first strategy based on the first parameter, when the CPU utilization is greater than the upper limit value of the CPU utilization range and the current operating frequency of the CPU is not the maximum operating frequency supported by the CPU, the current operating frequency can be increased based on the preset adjustment step; when the CPU utilization is less than the lower limit value of the CPU utilization range and the current operating frequency of the CPU is not the minimum operating frequency supported by the CPU, the current operating frequency can be decreased based on the preset adjustment step; when the CPU utilization is greater than the lower limit value and less than the upper limit value, the current operating frequency of the CPU can be kept unchanged.

[0049] It should be noted that, in the embodiments of the present application, assuming that the CPU utilization range in the first parameter is set to 10%-30%, the upper limit value of the CPU utilization range may be 30%, and the lower limit value of the CPU utilization range may be 10%. The present application does not specifically limit the setting size of the CPU utilization range.

[0050] It should be noted that in the embodiments of the present application, the preset adjustment step size can be automatically generated by the CPU according to its own characteristics, which is generally a multiple of the frequency, the frequency difference of each increase or decrease, and the present application does not specifically limit the size of the preset adjustment step size.

[0051] That is to say, in an embodiment of the present application, the first circuit unit in the CPU can generate a second strategy based on the first parameter, that is, the CPU utilization and the upper and lower limit values ​​of the CPU utilization range in the first parameter can be compared and processed, and then the CPU operating frequency can be adjusted based on the comparison result, so that the CPU operating frequency can be set within a reasonable range, thereby improving the energy saving effect of the CPU.

[0052] It should be noted that, in the embodiments of the present application, the first strategy may include not only the second strategy but also a third strategy, and the third strategy is at least used to adjust the sleep state of the CPU. The present application does not specifically limit the number and type of strategies included in the first strategy.

[0053] It should be noted that, in an embodiment of the present application, when the first circuit unit in the CPU generates a first strategy based on the first parameter, the CPU can be controlled to enter a shallow sleep state when the number of idle sampling cycles of the CPU is equal to a first preset threshold; wherein the number of idle sampling cycles at least includes the number of idle clock cycles; when the number of idle sampling cycles of the CPU is greater than or equal to a second preset threshold, the CPU can be controlled to enter a deep sleep state; when the number of idle sampling cycles of the CPU is greater than the first preset threshold and less than the second preset threshold, the CPU can be controlled to enter a shallow sleep state.

[0054] It should be noted that, in an embodiment of the present application, the first preset threshold includes a threshold for the CPU to enter shallow sleep. For example, the size of the first preset threshold can be set to the CPU idle time being N1 sampling cycles. The present application does not specifically limit the size of the first preset threshold.

[0055] It should be noted that, in an embodiment of the present application, the second preset threshold includes a threshold for the CPU to enter deep sleep. For example, the size of the second preset threshold can be set to the CPU idle time being N2 sampling cycles. The present application does not specifically limit the size of the second preset threshold.

[0056] That is to say, in an embodiment of the present application, the first circuit unit in the CPU can also generate a third strategy based on the first parameter, that is, the number of idle sampling cycles of the CPU can be compared with the size of the first preset threshold and the size of the second preset threshold, and then the CPU can be controlled to enter a corresponding sleep state based on the comparison result, thereby improving the energy saving effect of the CPU.

[0057] Step 102: The CPU determines whether a trigger condition of a first strategy is met based on the running status data. If the trigger condition is met, the CPU status parameters are automatically adjusted based on the first strategy.

[0058] In an embodiment of the present application, after the CPU in the first device generates the first strategy based on the first parameter, it can determine whether the trigger condition of the first strategy is met based on the operating status data, and automatically adjust the status parameters of the CPU based on the first strategy when the trigger condition is met.

[0059] It should be noted that, in the embodiments of the present application, the CPU may include a third circuit unit in addition to the first circuit unit and the second circuit unit. The present application does not specifically limit the number of circuit units included in the CPU.

[0060] It should be noted that, in the embodiments of the present application, the third circuit unit may be a monitor, whose main function is to monitor the CPU working status and provide a basis for whether to execute the first strategy. The present application does not specifically limit the structure and function of the third circuit unit.

[0061] It should be noted that in the embodiments of the present application, the operating status data may include the CPU utilization, the total number of clock cycles corresponding to one or more circuit units in the CPU, the number of active clock cycles, etc. The present application does not specifically limit the type of data and the amount of data contained in the CPU operating status data.

[0062] Further, in an embodiment of the present application, the second circuit unit can receive first data sent by the third circuit unit; wherein the first data at least includes the total number of clock cycles and the number of active clock cycles corresponding to one or more circuit units in the CPU; then the second circuit unit can determine second data based on the first data; wherein the second data at least includes the utilization rate of the CPU; and then the second circuit unit can generate operating status data based on the first data and / or the second data.

[0063] It should be noted that, in an embodiment of the present application, when the second circuit unit determines the second data based on the first data, it can obtain the CPU utilization by dividing the number of active time cycles by the total number of clock cycles. The present application does not specifically limit the calculation method of the CPU utilization.

[0064] It should be noted that, in an embodiment of the present application, the first data may also include the number of idle clock cycles corresponding to one or more circuit units, and the present application does not specifically limit the type and quantity of data included in the first data.

[0065] It should be noted that, in the embodiment of the present application, after generating the running status data, the CPU may determine whether the triggering condition of the first strategy is met based on the running status data.

[0066] Further, in an embodiment of the present application, when the CPU determines whether the triggering condition of the first strategy is met based on the operating status data, the second circuit unit may compare the number of idle clock cycles contained in the first data with the first preset threshold and the second preset threshold, respectively, to obtain a first comparison result, and compare the CPU utilization contained in the second data with the upper limit value of the CPU utilization range and the lower limit value of the CPU utilization range, respectively, to obtain a second comparison result; then the second circuit unit may determine whether the triggering condition of the first strategy is met based on the first comparison result and / or the second comparison result.

[0067] It should be noted that, in an embodiment of the present application, when the second circuit unit determines whether the trigger condition of the first strategy is met based on the first comparison result and / or the second comparison result, the second circuit unit may match the first comparison result with the third strategy to obtain a first matching result; when the first matching result indicates a successful match, it is determined that the trigger condition of the first strategy is met; and / or, the second circuit unit may also match the second comparison result with the second strategy to obtain a second matching result; when the second matching result indicates a successful match, it is determined that the trigger condition of the first strategy is met.

[0068] Exemplarily, in an embodiment of the present application, when the second circuit unit determines whether the trigger condition of the first strategy is met based on the first comparison result and / or the second comparison result, assuming that the first comparison result is that the number of idle clock cycles contained in the first data is equal to the first preset threshold, the second circuit unit can match the first comparison result with the third strategy, and if it is found that the situation matches the third strategy that when the number of idle sampling cycles of the CPU is equal to the first preset threshold, the CPU can be controlled to enter a shallow sleep state, then it indicates that the first matching result indicates that the match is successful, and it can be determined that the trigger condition of the first strategy is met.

[0069] It should be noted that, in the embodiment of the present application, when the first matching result indicates that the match is unsuccessful, it is determined that the trigger condition of the first strategy is not met; and / or when the second matching result indicates that the match is unsuccessful, it is determined that the trigger condition of the first strategy is not met, then the automatic adjustment processing of the CPU state parameters based on the first strategy is prohibited.

[0070] It should be noted that in an embodiment of the present application, the second circuit unit can automatically adjust the CPU state parameters based on the first strategy after determining that the trigger condition of the first strategy is met based on the first comparison result and / or the second comparison result.

[0071] Further, in an embodiment of the present application, when the second circuit unit automatically adjusts the state parameters of the CPU based on the first strategy, the second circuit unit may adjust the current operating frequency of the CPU based on the second strategy; and / or, the second circuit unit may also adjust the sleep state of the CPU based on the third strategy.

[0072] That is to say, in an embodiment of the present application, the second circuit unit in the CPU can determine whether the trigger condition of the first strategy is met based on the operating status data, that is, the number of idle clock cycles contained in the first data can be compared with the first preset threshold and the second preset threshold respectively to obtain a first comparison result, and the CPU utilization contained in the second data can be compared with the upper limit value of the CPU utilization range and the lower limit value of the CPU utilization range respectively to obtain a second comparison result; then the second circuit unit matches the first comparison result with the third strategy to obtain a first matching result; when the first matching result indicates a successful match, it is determined that the trigger condition of the first strategy is met; and / or, the second circuit unit matches the second comparison result with the second strategy to obtain a second matching result; when the second matching result indicates a successful match, it is determined that the trigger condition of the first strategy is met, and then the second circuit unit can adjust the current operating frequency of the CPU based on the second strategy; and / or, adjust the sleep state of the CPU based on the third strategy, so that the current operating frequency of the CPU can be reduced; and / or, the sleep state of the CPU is automatically adjusted to the optimal state, so that the CPU energy saving effect is optimized.

[0073] In summary, the embodiment of the present application can add three circuit units in the CPU, including a first circuit unit, a second circuit unit and a third circuit unit respectively. The first circuit unit in the CPU can generate a second strategy based on the first parameter, that is, the CPU utilization rate can be compared with the upper and lower limits of the CPU utilization rate range in the first parameter, and then the CPU operating frequency can be adjusted based on the comparison result, so that the CPU operating frequency can be set within a reasonable range; the first circuit unit in the CPU can also generate a third strategy based on the first parameter, that is, the number of idle sampling cycles of the CPU can be compared with the size of the first preset threshold and the size of the second preset threshold, and then the CPU can be controlled to enter a corresponding sleep state based on the comparison result, so that the energy saving effect of the CPU can be improved, and then the second circuit unit in the CPU can determine whether the triggering condition of the first strategy is met based on the running state data; wherein, the first strategy includes the second strategy and the third strategy, and when it is determined that the triggering condition of the first strategy is met, the second circuit unit can adjust the current operating frequency of the CPU based on the second strategy; and / or, adjust the sleep state of the CPU based on the third strategy, so that the current operating frequency of the CPU can be adjusted; and / or, the sleep state of the CPU is automatically adjusted to the optimal state, so that the CPU energy saving effect is optimal.

[0074] The embodiment of the present application provides a parameter adjustment method, a first device, a storage medium and a computer program product, the method is applied to the first device, the first device includes a CPU, the method includes: the CPU generates a first strategy based on the first parameter; wherein the first strategy is used to trigger the adjustment of the state parameters of the CPU, the state parameters at least include the sleep state of the CPU, and / or the operating frequency of the CPU; the CPU determines whether the triggering condition of the first strategy is met based on the running state data, and automatically adjusts the state parameters of the CPU based on the first strategy when the triggering condition is met. It can be seen that the CPU of the embodiment of the present application can generate a first strategy based on the first parameter, the strategy is used to trigger the adjustment of the state parameters of the CPU, and then the CPU can determine whether the triggering condition of the first strategy is met based on the running state data, and when the triggering condition is met, the state parameters of the CPU can be automatically adjusted based on the first strategy, that is, the embodiment of the present application can automatically adjust the running state parameters through the CPU, so that the running state parameters can be maintained within a set range to achieve the best energy saving effect.

[0075] Based on the above embodiments, another embodiment of the present application provides a parameter adjustment method, which can be improved by the CPU, that is, three circuit units can be added to the CPU, which can be a manager (i.e., a first circuit unit), a monitor (i.e., a third circuit unit) and a regulator (i.e., a second circuit unit), so as to realize the hardware-based self-adjustment capability for CPU utilization to achieve the best energy saving effect; Figure 4 Schematic diagram of the CPU structure proposed in this application embodiment Figure 1 ,like Figure 4 As shown, the embodiment of the present application adds three circuit units to the CPU, which can be a manager, a monitor and a regulator respectively; among them, the manager can provide an interface for the operating system kernel, allowing the user to set the working parameters of the processor (i.e., CPU); the monitor can monitor the working status of the CPU and provide a basis for whether to execute the energy-saving trigger strategy (i.e., the first strategy); the regulator can automatically adjust the operating status parameters of the CPU.

[0076] It should be noted that in the embodiments of the present application, by introducing a monitor (i.e., the third circuit unit) and a regulator (i.e., the second circuit unit) in the CPU, hardware-controlled automatic frequency regulation can be achieved, thereby adjusting the CPU to the utilization rate with the best energy efficiency ratio, and hardware-controlled automatic sleep can also be achieved, thereby achieving energy consumption when there is no business activity.

[0077] It should be noted that in the embodiment of the present application, the manager (i.e., the first circuit unit) can provide an interface for the operating system kernel, so that the user can set the operating parameters of the processor (i.e., the first parameter), and generate an energy-saving trigger strategy (i.e., the first strategy) according to the set parameters (i.e., the first parameter). The manager receives the energy-saving strategy parameters (i.e., the first parameter) transmitted by the user operating system kernel. The energy-saving strategy parameters (i.e., the first parameter) include the capability switch, the anchor utilization range (optional, which can be automatically generated by the processor according to its own characteristics, including a CPU utilization range. If the current CPU utilization exceeds its upper limit, the frequency is increased by one step to the highest frequency supported, and if it is lower than its lower limit, the frequency is decreased by one step to the lowest frequency supported), the frequency adjustment step (optional, which can be automatically generated by the processor according to its own characteristics, generally a multiplier, and the frequency difference of each increase or decrease), the threshold for entering shallow sleep (i.e., the first preset threshold) (optional, which can be automatically generated by the processor according to its own characteristics, and the CPU idle time is N1 sampling cycles), and the threshold for entering deep sleep (i.e., the second preset threshold) (optional, which can be automatically generated by the processor according to its own characteristics, The CPU idle time is N2 sampling cycles), data sampling cycle (optional, can be automatically generated by the processor according to its own characteristics, the number of clock cycles, as the basis for frequency modulation or sleep), etc. The manager (i.e., the first circuit unit) is responsible for checking the validity of the incoming parameters (i.e., the first parameters). If the parameter value is correct (such as the step size is a value supported by the CPU), the energy-saving trigger strategy is set (such as the above parameters, setting strategy 1 (i.e., the second strategy): if the CPU utilization exceeds the upper limit of the anchor utilization within a sampling cycle and the frequency is not the supported maximum value, the frequency is increased by one step; if the CPU utilization is lower than the lower limit of the anchor utilization within a sampling cycle and the frequency is not the supported minimum value, the frequency is reduced by one step; strategy 2 (i.e., the third strategy): if the CPU is idle for N1 sampling cycles, it will enter light sleep; if the CPU is idle for N2 sampling cycles, it will enter deep sleep).

[0078] It should be noted that, in an embodiment of the present application, when the CPU generates a first strategy based on a first parameter, the first circuit unit can receive the first parameter sent by the operating system kernel; wherein the first parameter includes one or more of the CPU utilization range, a first preset threshold and a second preset threshold, the first preset threshold includes the threshold for the CPU to enter shallow sleep, and the second preset threshold includes the threshold for the CPU to enter deep sleep; then the first circuit unit can generate a first strategy based on the first parameter, and send the first strategy to the second circuit unit.

[0079] It should be noted that, in an embodiment of the present application, the first strategy may include a second strategy, and the second strategy is at least used to adjust the current operating frequency of the CPU. The present application does not specifically limit the number and type of strategies included in the first strategy.

[0080] It should be noted that, in an embodiment of the present application, when the first circuit unit generates the first strategy based on the first parameter, when the CPU utilization is greater than the upper limit value of the CPU utilization range and the current operating frequency of the CPU is not the maximum operating frequency supported by the CPU, the current operating frequency can be increased based on the preset adjustment step; when the CPU utilization is less than the lower limit value of the CPU utilization range and the current operating frequency of the CPU is not the minimum operating frequency supported by the CPU, the current operating frequency can be decreased based on the preset adjustment step; when the CPU utilization is greater than the lower limit value and less than the upper limit value, the current operating frequency of the CPU can be kept unchanged.

[0081] It should be noted that, in the embodiments of the present application, assuming that the CPU utilization range in the first parameter is set to 10%-30%, the upper limit value of the CPU utilization range may be 30%, and the lower limit value of the CPU utilization range may be 10%. The present application does not specifically limit the setting size of the CPU utilization range.

[0082] It should be noted that in the embodiments of the present application, the preset adjustment step size can be automatically generated by the CPU according to its own characteristics, which is generally a multiple of the frequency, the frequency difference of each increase or decrease, and the present application does not specifically limit the size of the preset adjustment step size.

[0083] That is to say, in an embodiment of the present application, the first circuit unit in the CPU can generate a second strategy based on the first parameter, that is, the CPU utilization and the upper and lower limit values ​​of the CPU utilization range in the first parameter can be compared and processed, and then the CPU operating frequency can be adjusted based on the comparison result, so that the CPU operating frequency can be set within a reasonable range, thereby achieving the best energy efficiency ratio state.

[0084] It should be noted that, in the embodiments of the present application, the first strategy may include not only the second strategy but also a third strategy, and the third strategy is at least used to adjust the sleep state of the CPU. The present application does not specifically limit the number and type of strategies included in the first strategy.

[0085] It should be noted that, in an embodiment of the present application, when the first circuit unit in the CPU generates a first strategy based on the first parameter, the CPU can be controlled to enter a shallow sleep state when the number of idle sampling cycles of the CPU is equal to a first preset threshold; wherein the number of idle sampling cycles at least includes the number of idle clock cycles; when the number of idle sampling cycles of the CPU is greater than or equal to a second preset threshold, the CPU can be controlled to enter a deep sleep state; when the number of idle sampling cycles of the CPU is greater than the first preset threshold and less than the second preset threshold, the CPU can be controlled to enter a shallow sleep state.

[0086] It should be noted that, in an embodiment of the present application, the first preset threshold includes a threshold for the CPU to enter shallow sleep. For example, the size of the first preset threshold can be set to the CPU idle time being N1 sampling cycles. The present application does not specifically limit the size of the first preset threshold.

[0087] It should be noted that, in an embodiment of the present application, the second preset threshold includes a threshold for the CPU to enter deep sleep. For example, the size of the second preset threshold can be set to the CPU idle time being N2 sampling cycles. The present application does not specifically limit the size of the second preset threshold.

[0088] That is to say, in an embodiment of the present application, the first circuit unit in the CPU can also generate a third strategy based on the first parameter, that is, the number of idle sampling cycles of the CPU can be compared with the size of the first preset threshold and the size of the second preset threshold, and then the CPU can be controlled to enter a corresponding sleep state based on the comparison result, thereby improving the energy saving effect of the CPU.

[0089] It should be noted that, in the embodiment of the present application, the monitor (i.e., the third circuit unit) can monitor the CPU working status (i.e., the operating status data) to provide a basis for whether to execute the energy-saving trigger strategy (i.e., the first strategy); the monitor includes multiple counting units (configured as needed, such as 5 counting units are configured if it is necessary to monitor the utilization of the decoding unit, the transmitting unit, the shaping calculation unit, the floating-point calculation unit, and the vector calculation unit), and the monitor can monitor the activity data of each circuit unit, and store the total number of clock cycles and the number of activity time cycles of each circuit unit in the corresponding counting unit.

[0090] It should be noted that in the embodiments of the present application, the operating status data may include the CPU utilization, the total number of clock cycles corresponding to one or more circuit units in the CPU, the number of active clock cycles, etc. The present application does not specifically limit the type of data and the amount of data contained in the CPU operating status data.

[0091] It should be noted that, in an embodiment of the present application, the regulator (i.e., the second circuit unit) can obtain the counting unit value of the monitor (i.e., the third circuit unit), calculate the CPU utilization data, and obtain the energy-saving trigger strategy (i.e., the first strategy) of the manager (i.e., the first circuit unit), and match the CPU utilization data with the energy-saving trigger strategy (i.e., the first strategy). Once the match is successful, corresponding adjustments are made, including adjusting the frequency by controlling the CPU multiplier to change the CPU multiplier, and controlling the CPU power switch to realize the sleep function. Depending on the support of the CPU, it may support DIE level, Core level, etc.

[0092] That is to say, in an embodiment of the present application, the second circuit unit can receive the first data sent by the third circuit unit; wherein the first data at least includes the total number of clock cycles and the number of active clock cycles corresponding to one or more circuit units in the CPU; then the second circuit unit can determine the second data based on the first data; wherein the second data at least includes the utilization rate of the CPU; and then the second circuit unit can generate operating status data based on the first data and / or the second data.

[0093] It should be noted that, in an embodiment of the present application, when the second circuit unit determines the second data based on the first data, it can obtain the CPU utilization by dividing the number of active time cycles by the total number of clock cycles. The present application does not specifically limit the calculation method of the CPU utilization.

[0094] It should be noted that, in the embodiment of the present application, after generating the running status data, the CPU may determine whether the triggering condition of the first strategy is met based on the running status data.

[0095] Further, in an embodiment of the present application, when the CPU determines whether the triggering condition of the first strategy is met based on the operating status data, the second circuit unit may compare the number of idle clock cycles contained in the first data with the first preset threshold and the second preset threshold, respectively, to obtain a first comparison result, and compare the CPU utilization contained in the second data with the upper limit value of the CPU utilization range and the lower limit value of the CPU utilization range, respectively, to obtain a second comparison result; then the second circuit unit may determine whether the triggering condition of the first strategy is met based on the first comparison result and / or the second comparison result.

[0096] It should be noted that, in an embodiment of the present application, when the second circuit unit determines whether the trigger condition of the first strategy is met based on the first comparison result and / or the second comparison result, the second circuit unit may match the first comparison result with the third strategy to obtain a first matching result; when the first matching result indicates a successful match, it is determined that the trigger condition of the first strategy is met; and / or, the second circuit unit may also match the second comparison result with the second strategy to obtain a second matching result; when the second matching result indicates a successful match, it is determined that the trigger condition of the first strategy is met.

[0097] Exemplarily, in an embodiment of the present application, when the second circuit unit determines whether the trigger condition of the first strategy is met based on the first comparison result and / or the second comparison result, assuming that the first comparison result is that the number of idle clock cycles contained in the first data is equal to the first preset threshold, the second circuit unit can match the first comparison result with the third strategy, and if it is found that the situation matches the third strategy that when the number of idle sampling cycles of the CPU is equal to the first preset threshold, the CPU can be controlled to enter a shallow sleep state, then it indicates that the first matching result indicates that the match is successful, and it can be determined that the trigger condition of the first strategy is met.

[0098] It should be noted that, in the embodiment of the present application, when the first matching result indicates that the match is unsuccessful, it is determined that the trigger condition of the first strategy is not met; and / or when the second matching result indicates that the match is unsuccessful, it is determined that the trigger condition of the first strategy is not met, then the automatic adjustment processing of the CPU state parameters based on the first strategy is prohibited.

[0099] It should be noted that in an embodiment of the present application, the second circuit unit can automatically adjust the CPU state parameters based on the first strategy after determining that the trigger condition of the first strategy is met based on the first comparison result and / or the second comparison result.

[0100] Further, in an embodiment of the present application, when the second circuit unit automatically adjusts the state parameters of the CPU based on the first strategy, the second circuit unit may adjust the current operating frequency of the CPU based on the second strategy; and / or, the second circuit unit may also adjust the sleep state of the CPU based on the third strategy.

[0101] That is to say, in an embodiment of the present application, the second circuit unit in the CPU can determine whether the trigger condition of the first strategy is met based on the operating status data, that is, the number of idle clock cycles contained in the first data can be compared with the first preset threshold and the second preset threshold respectively to obtain a first comparison result, and the CPU utilization contained in the second data can be compared with the upper limit value of the CPU utilization range and the lower limit value of the CPU utilization range respectively to obtain a second comparison result; then the second circuit unit matches the first comparison result with the third strategy to obtain a first matching result; when the first matching result indicates a successful match, it is determined that the trigger condition of the first strategy is met; and / or, the second circuit unit matches the second comparison result with the second strategy to obtain a second matching result; when the second matching result indicates a successful match, it is determined that the trigger condition of the first strategy is met, and then the second circuit unit can adjust the current operating frequency of the CPU based on the second strategy; and / or, adjust the sleep state of the CPU based on the third strategy, so that the current operating frequency of the CPU can be reduced; and / or, the sleep state of the CPU is automatically adjusted to the optimal state, so that the CPU energy saving effect is optimized.

[0102] It should be noted that, in the embodiments of the present application, Figure 5 Schematic diagram of the CPU structure proposed in this application embodiment Figure 2 ,like Figure 5 As shown, according to the above description, a reference CPU circuit is implemented as follows (the data structure and the circuit function represented by the data can be flexibly defined during implementation). Based on the above CPU reference circuit implementation, the CPU parameter adjustment process is as follows (the solution of monitoring the CPU working status for automatic adjustment is continuous). Figure 6 The parameter adjustment method proposed in this embodiment is shown in FIG. Figure 2 ,like Figure 6As shown, the manager (i.e., the first circuit unit) can receive a first parameter (i.e., an energy-saving strategy parameter) sent by the operating system kernel; wherein the first parameter includes one or more of a CPU utilization range, a first preset threshold, and a second preset threshold, the first preset threshold includes a threshold for the CPU to enter shallow sleep, and the second preset threshold includes a threshold for the CPU to enter deep sleep; then the first circuit unit can generate a first strategy (i.e., an energy-saving trigger strategy) based on the first parameter, and send the first strategy to the second circuit unit (i.e., the regulator), and the second circuit unit (i.e., the regulator) can also receive first data sent by the third circuit unit (i.e., the monitor); wherein the first data at least includes the total number of clock cycles and the number of active clock cycles corresponding to one or more circuit units in the CPU; then the second circuit unit (i.e., the regulator) can determine the second data based on the first data; wherein the second data at least includes the CPU utilization; then the second circuit unit can generate operating status data based on the first data and / or the second data, and then the second circuit unit can determine whether the first strategy is satisfied based on the operating status data. The trigger condition is that the number of idle clock cycles contained in the first data can be compared with the first preset threshold and the second preset threshold respectively to obtain a first comparison result, and the CPU utilization contained in the second data can be compared with the upper limit value of the CPU utilization range and the lower limit value of the CPU utilization range to obtain a second comparison result; then the second circuit unit matches the first comparison result with the third strategy to obtain a first matching result; when the first matching result indicates a successful match, it is determined that the trigger condition of the first strategy is met; and / or, the second circuit unit matches the second comparison result with the second strategy to obtain a second matching result; when the second matching result indicates a successful match, it is determined that the trigger condition of the first strategy is met, and then the second circuit unit can adjust the current operating frequency of the CPU based on the second strategy; and / or, adjust the sleep state of the CPU based on the third strategy, so that the current operating frequency of the CPU can be adjusted; and / or, the sleep state of the CPU is automatically adjusted to the optimal state, so that the CPU energy saving effect is optimized.

[0103] In summary, the embodiment of the present application can add three circuit units in the CPU, including a first circuit unit, a second circuit unit and a third circuit unit respectively. The first circuit unit in the CPU can generate a second strategy based on the first parameter, that is, the CPU utilization rate can be compared with the upper and lower limits of the CPU utilization rate range in the first parameter, and then the CPU operating frequency can be adjusted based on the comparison result, so that the CPU operating frequency can be set within a reasonable range; the first circuit unit in the CPU can also generate a third strategy based on the first parameter, that is, the number of idle sampling cycles of the CPU can be compared with the size of the first preset threshold and the size of the second preset threshold, and then the CPU can be controlled to enter a corresponding sleep state based on the comparison result, so that the energy saving effect of the CPU can be improved, and then the second circuit unit in the CPU can determine whether the triggering condition of the first strategy is met based on the running state data; wherein, the first strategy includes the second strategy and the third strategy, and when it is determined that the triggering condition of the first strategy is met, the second circuit unit can adjust the current operating frequency of the CPU based on the second strategy; and / or, adjust the sleep state of the CPU based on the third strategy, so that the current operating frequency of the CPU can be adjusted; and / or, the sleep state of the CPU is automatically adjusted to the optimal state, so that the CPU energy saving effect is optimal.

[0104] The embodiment of the present application provides a parameter adjustment method, a first device, a storage medium and a computer program product, the method is applied to the first device, the first device includes a CPU, the method includes: the CPU generates a first strategy based on the first parameter; wherein the first strategy is used to trigger the adjustment of the state parameters of the CPU, the state parameters at least include the sleep state of the CPU, and / or the operating frequency of the CPU; the CPU determines whether the triggering condition of the first strategy is met based on the running state data, and automatically adjusts the state parameters of the CPU based on the first strategy when the triggering condition is met. It can be seen that the CPU of the embodiment of the present application can generate a first strategy based on the first parameter, the strategy is used to trigger the adjustment of the state parameters of the CPU, and then the CPU can determine whether the triggering condition of the first strategy is met based on the running state data, and when the triggering condition is met, the state parameters of the CPU can be automatically adjusted based on the first strategy, that is, the embodiment of the present application can automatically adjust the running state parameters through the CPU, so that the running state parameters can be maintained within a set range to achieve the best energy saving effect.

[0105] Based on the above embodiments, the present application provides a first device. Figure 7 Schematic diagram of the composition structure of the first device Figure 1 ,like Figure 7As shown, the first device 10 includes a CPU 11, and the CPU 11 includes at least a first circuit unit 12 and a second circuit unit 13; wherein,

[0106] The first circuit unit 12 is used to generate a first strategy based on a first parameter; wherein the first strategy is used to trigger an adjustment process on a state parameter of the CPU, wherein the state parameter at least includes a sleep state of the CPU and / or an operating frequency of the CPU;

[0107] The second circuit unit 13 is used to determine whether a trigger condition of the first strategy is met based on the operating status data, and automatically adjust the state parameters of the CPU based on the first strategy when the trigger condition is met.

[0108] In the embodiments of the present application, further, Figure 8 Schematic diagram of the composition structure of the first device Figure 2 ,like Figure 8 As shown, the first device 10 proposed in the embodiment of the present application may also include a processor 14 and a memory 15 storing executable instructions of the processor 14. Further, the first device 10 may also include a communication interface 16 and a bus 17 for connecting the processor 14, the memory 15 and the communication interface 16.

[0109] In the embodiment of the present application, the processor 14 can be at least one of an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), a Programmable Logic Device (PLD), a Field Programmable Gate Array (FPGA), a Central Processing Unit (CPU), a controller, a microcontroller, and a microprocessor. It can be understood that for different devices, the electronic device used to implement the above-mentioned processor function can also be other, and the embodiment of the present application is not specifically limited. The first device 10 can also include a memory 15, which can be connected to the processor 14, wherein the memory 15 is used to store executable program code, the program code includes computer operation instructions, and the memory 15 may include a high-speed RAM memory, and may also include a non-volatile memory, for example, at least two disk memories.

[0110] In the embodiment of the present application, the bus 17 is used to connect the communication interface 16, the processor 14 and the memory 15, and the mutual communication between these devices.

[0111] In the embodiment of the present application, the memory 15 is used to store instructions and data.

[0112] Furthermore, in an embodiment of the present application, the above-mentioned processor 14 is used to generate a first strategy based on a first parameter; wherein, the first strategy is used to trigger adjustment processing of the status parameters of the CPU, and the status parameters at least include the sleep state of the CPU, and / or the operating frequency of the CPU; the CPU determines whether the triggering condition of the first strategy is met based on the running status data, and when the triggering condition is met, the status parameters of the CPU are automatically adjusted based on the first strategy.

[0113] In practical applications, the memory 15 may be a volatile memory, such as a random access memory (RAM); or a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk (HDD) or a solid-state drive (SSD); or a combination of the above types of memory, and provide instructions and data to the processor 14.

[0114] The embodiment of the present application provides a first device, which includes a CPU, and the CPU generates a first strategy based on a first parameter; wherein the first strategy is used to trigger the adjustment of the state parameters of the CPU, and the state parameters include at least the sleep state of the CPU, and / or the operating frequency of the CPU; the CPU determines whether the triggering condition of the first strategy is met based on the running state data, and automatically adjusts the state parameters of the CPU based on the first strategy when the triggering condition is met. It can be seen that the CPU of the embodiment of the present application can generate a first strategy based on the first parameter, and the strategy is used to trigger the adjustment of the state parameters of the CPU, and then the CPU can determine whether the triggering condition of the first strategy is met based on the running state data, and automatically adjust the state parameters of the CPU based on the first strategy when the triggering condition is met, that is, the embodiment of the present application can automatically adjust the running state parameters through the CPU, so that the running state parameters can be maintained within a set range to achieve the best energy saving effect.

[0115] An embodiment of the present application provides a computer-readable storage medium on which a program is stored. When the program is executed by a processor, the parameter adjustment method as described above is implemented.

[0116] Specifically, a program instruction corresponding to a parameter adjustment method in this embodiment can be stored in a storage medium such as a CD, a hard disk, a USB flash drive, etc. When the program instruction corresponding to a parameter adjustment method in the storage medium is read or executed by an electronic device, the following steps are included:

[0117] The CPU generates a first strategy based on a first parameter; wherein the first strategy is used to trigger adjustment processing of a state parameter of the CPU, and the state parameter at least includes a sleep state of the CPU and / or an operating frequency of the CPU;

[0118] The CPU determines whether a trigger condition of the first strategy is met based on the running status data, and automatically adjusts the status parameters of the CPU based on the first strategy when the trigger condition is met.

[0119] The embodiment of the present application also provides a computer program product, including a computer program, which can be executed by the processor 14 of the first device 10 to complete the steps of any of the aforementioned methods.

[0120] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of hardware embodiments, software embodiments, or embodiments in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) that contain computer-usable program code.

[0121] The present application is described with reference to implementation flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the process in the flowchart. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0122] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which is implemented in the implementation flow diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0123] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for executing the steps in the flowchart. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0124] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application.

Claims

1. A parameter adjustment method, characterized in that: The method is applied to a first device, the first device includes a central processing unit (CPU), and the method includes: The CPU generates a first strategy based on a first parameter; wherein the first strategy is used to trigger adjustment processing of a state parameter of the CPU, and the state parameter at least includes a sleep state of the CPU and / or an operating frequency of the CPU; The CPU determines whether a trigger condition of the first strategy is met based on the running status data, and automatically adjusts the status parameters of the CPU based on the first strategy when the trigger condition is met.

2. The method according to claim 1, characterized in that The CPU includes at least a first circuit unit and a second circuit unit, and the CPU generates a first strategy based on a first parameter, including: The first circuit unit receives a first parameter sent by the operating system kernel; wherein the first parameter includes one or more of a utilization range of the CPU, a first preset threshold, and a second preset threshold, the first preset threshold includes a threshold for the CPU to enter a light sleep state, and the second preset threshold includes a threshold for the CPU to enter a deep sleep state; The first circuit unit generates the first strategy based on the first parameter, and sends the first strategy to the second circuit unit.

3. The method according to claim 2, characterized in that The first circuit unit generates the first strategy based on the first parameter, including: The first circuit unit verifies the validity of the first parameter to obtain a verification result; When the verification result indicates a passing result, the first strategy is generated based on the first parameter.

4. The method according to claim 1, characterized in that The CPU further includes a third circuit unit, and the method further includes: The second circuit unit receives the first data sent by the third circuit unit; wherein the first data at least includes the total clock cycle number and the active clock cycle number corresponding to one or more circuit units in the CPU; The second circuit unit determines second data based on the first data; wherein the second data at least includes the utilization rate of the CPU; The second circuit unit generates the operating status data based on the first data and / or the second data.

5. The method according to claim 3, characterized in that: The first strategy includes a second strategy, and the second strategy is at least used to adjust the current operating frequency of the CPU. The generating the first strategy based on the first parameter includes: When the utilization rate of the CPU is greater than the upper limit of the CPU utilization rate range and the current operating frequency of the CPU is not the maximum operating frequency supported by the CPU, performing frequency increase processing on the current operating frequency based on a preset adjustment step size; When the utilization rate of the CPU is less than the lower limit of the CPU utilization rate range and the current operating frequency of the CPU is not the minimum operating frequency supported by the CPU, the current operating frequency is reduced based on the preset adjustment step size; When the utilization rate of the CPU is greater than the lower limit value and less than the upper limit value, the current operating frequency of the CPU is kept unchanged.

6. The method according to claim 3, characterized in that The first strategy also includes a third strategy, and the third strategy is at least used to adjust the sleep state of the CPU. The generating of the first strategy based on the first parameter includes: When the number of idle sampling cycles of the CPU is equal to the first preset threshold, controlling the CPU to enter a shallow sleep state; wherein the number of idle sampling cycles at least includes the number of idle clock cycles; When the number of idle sampling cycles of the CPU is greater than or equal to the second preset threshold, controlling the CPU to enter a deep sleep state; When the number of idle sampling cycles of the CPU is greater than the first preset threshold and less than the second preset threshold, the CPU is controlled to enter a light sleep state.

7. The method according to claim 5 or 6, characterized in that: The first data also includes the number of idle clock cycles corresponding to one or more circuit units, and the CPU determines whether the triggering condition of the first strategy is met based on the running status data, including: The second circuit unit compares the number of idle clock cycles included in the first data with the first preset threshold and the second preset threshold to obtain a first comparison result, and compares the CPU utilization included in the second data with an upper limit value of the CPU utilization range and a lower limit value of the CPU utilization range to obtain a second comparison result; The second circuit unit determines whether a triggering condition of the first strategy is met based on the first comparison result and / or the second comparison result.

8. The method according to claim 7, characterized in that The second circuit unit judges whether the triggering condition of the first strategy is met based on the first comparison result and / or the second comparison result, including: The second circuit unit matches the first comparison result with the third strategy to obtain a first matching result; when the first matching result indicates a successful match, determining that a trigger condition of the first strategy is met; and / or, The second circuit unit matches the second comparison result with the second strategy to obtain a second matching result; when the second matching result indicates a successful match, it is determined that the trigger condition of the first strategy is met.

9. The method according to claim 8, characterized in that The method further comprises: When the first matching result indicates that the match is unsuccessful, determining that the triggering condition of the first strategy is not satisfied; and / or, When the second matching result indicates that the match is unsuccessful, it is determined that the triggering condition of the first policy is not satisfied.

10. The method according to claim 8, characterized in that The automatically adjusting the state parameters of the CPU based on the first strategy includes: The second circuit unit adjusts the current operating frequency of the CPU based on the second strategy; and / or, The second circuit unit adjusts the sleep state of the CPU based on the third strategy.

11. A first device, characterized in that: The first device includes a CPU, and the CPU includes at least a first circuit unit and a second circuit unit; wherein, The first circuit unit is used to generate a first strategy based on a first parameter; wherein the first strategy is used to trigger an adjustment process on a state parameter of the CPU, wherein the state parameter at least includes a sleep state of the CPU and / or an operating frequency of the CPU; The second circuit unit is used to determine whether a trigger condition of the first strategy is met based on the operating status data, and automatically adjust the status parameters of the CPU based on the first strategy when the trigger condition is met.

12. A first device, characterized in that: The first device comprises: a processor and a memory; wherein, The memory is used to store a computer program that can be run on the processor; The processor is configured to execute the method according to any one of claims 1 to 10 when running the computer program.

13. A computer-readable storage medium, characterized in that: The storage medium stores computer program codes, and when the computer program codes are executed by a computer, the method according to any one of claims 1 to 10 is executed.

14. A computer program product comprising a computer program, characterized in that The computer program implements the method according to any one of claims 1 to 10 when executed by a processor.

Citation Information

Patent Citations

  • Clock management method and device of central processing unit

    CN105487597A

  • Parameter adjustment method, terminal and storage medium

    CN109426558A

  • Energy-saving management method and device, computing equipment and computer readable storage medium

    CN117348715A

  • Performance optimization method and device, computer equipment and storage medium

    CN117908902A

  • Consumption reduction management and control method, device and equipment, storage medium and computer program product

    CN118093169A