CN105808355A - Binary linear regression equation-based dynamic frequency modulation method - Google Patents
Binary linear regression equation-based dynamic frequency modulation method Download PDFInfo
- Publication number
- CN105808355A CN105808355A CN201610139773.7A CN201610139773A CN105808355A CN 105808355 A CN105808355 A CN 105808355A CN 201610139773 A CN201610139773 A CN 201610139773A CN 105808355 A CN105808355 A CN 105808355A
- Authority
- CN
- China
- Prior art keywords
- linear regression
- regression equation
- binary linear
- cpu
- cpu utilization
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000012417 linear regression Methods 0.000 title claims abstract description 91
- 238000000034 method Methods 0.000 title claims abstract description 81
- 230000008569 process Effects 0.000 claims abstract description 56
- 230000001419 dependent effect Effects 0.000 claims abstract description 21
- 238000005070 sampling Methods 0.000 claims description 7
- 230000007704 transition Effects 0.000 abstract description 10
- 230000004044 response Effects 0.000 abstract description 3
- 230000008859 change Effects 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 239000002699 waste material Substances 0.000 description 3
- 230000003139 buffering effect Effects 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000011160 research Methods 0.000 description 2
- 238000012360 testing method Methods 0.000 description 2
- 238000004883 computer application Methods 0.000 description 1
- 238000005265 energy consumption Methods 0.000 description 1
- 238000002474 experimental method Methods 0.000 description 1
- 239000011159 matrix material Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F1/00—Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
- G06F1/26—Power supply means, e.g. regulation thereof
- G06F1/32—Means for saving power
- G06F1/3203—Power management, i.e. event-based initiation of a power-saving mode
- G06F1/3234—Power saving characterised by the action undertaken
- G06F1/329—Power saving characterised by the action undertaken by task scheduling
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Debugging And Monitoring (AREA)
- Supply And Distribution Of Alternating Current (AREA)
Abstract
本发明公开了一种基于二元线性回归方程的动态调频方法,选择二元线性回归方程作为系统负载的预测算法,并应用到Linux操作系统中的CPUFreq模块中;以系统的CPU利用率和系统可执行进程数信息,作为二元线性回归方程的两个自变量,同时将已获得的系统负载信息作为因变量,求解拟合的二元线性回归方程。根据方程,通过自变量对因变量进行预测。本发明实现了对系统负载信息地准确预测,以便根据负载信息及时地设置CPU的运行频率。本发明提高了系统频率设定的响应速度,同时省去系统负载达到稳定状态的过渡时间;同时,准确设置CPU的运行频率,可以避免系统出现性能不足和性能过剩的问题,以达到充分发挥系统性能和降低系统功耗的目的。
The invention discloses a dynamic frequency modulation method based on a binary linear regression equation. The binary linear regression equation is selected as a system load prediction algorithm and applied to the CPUFreq module in the Linux operating system; The executable process number information is used as two independent variables of the binary linear regression equation, and the obtained system load information is used as the dependent variable to solve the fitted binary linear regression equation. According to the equation, the dependent variable is predicted by the independent variable. The invention realizes accurate prediction of system load information so as to timely set the running frequency of the CPU according to the load information. The invention improves the response speed of the system frequency setting, and saves the transition time for the system load to reach a stable state; at the same time, accurately setting the operating frequency of the CPU can avoid the problems of insufficient performance and excess performance of the system, so as to fully utilize the system. performance and reduce system power consumption.
Description
技术领域technical field
本发明属于计算机应用技术领域,尤其涉及一种基于二元线性回归方程的动态调频方法。The invention belongs to the technical field of computer applications, and in particular relates to a dynamic frequency modulation method based on a binary linear regression equation.
背景技术Background technique
动态调频技术是计算机功耗领域研究的热点,也是计算机功能模块重要组成部分。动态调频技术在保证计算机处理能力的同时,可以有效降低系统的功耗。动态调频技术的优劣,将直接影响计算机系统的功耗。计算机系统在正常运行过程中,系统负载会不断发生变化。比如,对CPU性能的要求在进行高性能计算时要高于听音乐时。CPU的性能和CPU的运行频率线性相关,运行频率越高计算性能越强。反之,运行频率越低计算性能越弱。当系统的CPU运行频率和系统负载不匹配时,就会出现性能不足或性能过剩的问题,进而导致不必要的功耗浪费。当系统处于高负载而CPU处于低频运行,计算机系统就会出现程序运行缓慢、操作不流畅等现象。当系统处于低负载而CPU处于高频运行时,就会出现CPU计算性能过剩的现象,致使系统CPU因多做无用功而导致能耗浪费。因此,系统负载信息准确、及时的获取,确保了CPU运行频率的准确设置,在保证计算机CPU计算能力的同时,有效消除不必要的功耗浪费,达到降低系统功耗的目的。系统负载信息预测的准确性和CPU运行频率设置的及时性,将决定系统功耗的降低效果。基于时间片的AIBDDVS算法的核心思想:采用系统前四个时刻的系统CPU利用率预测下一时刻的系统CPU利用率。前四个时间片CPU利用率分别记为:p1、p2、p3、p4,并取前四个时间片的CPU利用率权值分别为0.1、0.2、0.3和0.4。预测当前系统的CPU利用率p的公式如下:Dynamic frequency modulation technology is a hotspot in the field of computer power consumption, and it is also an important part of computer functional modules. The dynamic frequency modulation technology can effectively reduce the power consumption of the system while ensuring the processing capacity of the computer. The advantages and disadvantages of dynamic frequency modulation technology will directly affect the power consumption of the computer system. During normal operation of a computer system, the system load is constantly changing. For example, the requirements for CPU performance are higher when performing high-performance computing than when listening to music. The performance of the CPU is linearly related to the operating frequency of the CPU. The higher the operating frequency, the stronger the computing performance. Conversely, the lower the operating frequency, the weaker the computing performance. When the operating frequency of the CPU of the system does not match the system load, there will be a problem of insufficient performance or excessive performance, which will lead to unnecessary waste of power consumption. When the system is under high load and the CPU is running at a low frequency, the computer system will experience slow program operation and unsmooth operation. When the system is under low load and the CPU is running at high frequency, there will be a phenomenon of excessive CPU computing performance, resulting in waste of energy consumption due to the system CPU doing more useless work. Therefore, the accurate and timely acquisition of system load information ensures the accurate setting of CPU operating frequency, effectively eliminates unnecessary waste of power consumption while ensuring the computing power of the computer CPU, and achieves the purpose of reducing system power consumption. The accuracy of system load information prediction and the timeliness of CPU operating frequency setting will determine the effect of reducing system power consumption. The core idea of the time-slice-based AIBDDVS algorithm: use the system CPU utilization at the first four moments of the system to predict the system CPU utilization at the next moment. The CPU utilization rates of the first four time slices are respectively recorded as: p 1 , p 2 , p 3 , and p 4 , and the weights of the CPU utilization rates of the first four time slices are respectively 0.1, 0.2, 0.3, and 0.4. The formula for predicting the CPU utilization p of the current system is as follows:
p=0.1*p1+0.2*p2+0.3*p3+0.4*p4;p=0.1*p 1 +0.2*p 2 +0.3*p 3 +0.4*p 4 ;
如果p=max,则设定CPU执行最高运行频率;如果p=min,则设定CPU当前执行最低运行频率;否则将p与门限值比较,若p>0.8,则CPU执行频率提升一个档次,若p<0.2,则CPU执行频率下降一个档次。AIBD算法预测系统的CPU利用率时,要依靠前四个时间点的系统CPU利用率信息,因此前四个时间点的CPU利用率是系统本身的实测值,其百分比是100%,从第五个时间点开始是AIBD算法预测系统的CPU利用率。AIBD算法在预测系统CPU利用率方面的准确度较低,有时可达到94.00%,有时只有47.10%,有时又可高达184.00%,因此采用单一变量的预测算法,在预测系统负载的准确性方面存在着很大的不稳定性,要想实现系统负载的准确预测,需要选择更多影响系统负载的参数,对系统的负载进行预测。If p=max, then set the CPU to execute the highest operating frequency; if p=min, then set the CPU to currently execute the lowest operating frequency; otherwise, compare p with the threshold value, if p>0.8, then the CPU execution frequency will be raised to a higher level , if p<0.2, the CPU execution frequency drops by a notch. When the AIBD algorithm predicts the CPU utilization of the system, it depends on the system CPU utilization information at the first four time points. Therefore, the CPU utilization at the first four time points is the measured value of the system itself, and its percentage is 100%. The first time point is the AIBD algorithm to predict the CPU utilization of the system. The accuracy of the AIBD algorithm in predicting the CPU utilization of the system is low, sometimes it can reach 94.00%, sometimes it is only 47.10%, and sometimes it can be as high as 184.00%. In order to realize the accurate prediction of the system load, it is necessary to select more parameters that affect the system load and predict the system load.
发明内容Contents of the invention
本发明的目的在于提供一种基于二元线性回归方程的动态调频方法,旨在解决现有算法如Linux操作系统自带的ondemand策略和康卿提出的单一自变量的AIBD预测算法存在的系统负载预测准确度低、系统负载到达稳定状态的过渡时间长等问题。The purpose of the present invention is to provide a dynamic frequency modulation method based on a binary linear regression equation, aiming to solve the system load of existing algorithms such as the ondemand strategy that comes with the Linux operating system and the AIBD prediction algorithm with a single variable proposed by Kang Qing Problems such as low prediction accuracy and long transition time for the system load to reach a steady state.
本发明即基于二元线性回归方程的动态调频方法,所述基于二元线性回归方程的动态调频方法选择二元线性回归方程作为系统负载的预测算法,并应用到Linux操作系统的CPUFreq模块中;将获取的系统CPU利用率和系统可执行进程数分别作为二元线性回归方程y=a1x1+a2x2+b的两个自变量x1、x2,将系统的负载信息作为因变量y。通过因变量对自变量的求解及时、准确地预测出处理器在下一时刻的系统的负载信息,并能设置CPU的运行频率。The present invention is a dynamic frequency modulation method based on a binary linear regression equation. The dynamic frequency modulation method based on a binary linear regression equation selects a binary linear regression equation as a system load prediction algorithm and applies it to the CPUFreq module of the Linux operating system; The obtained system CPU utilization rate and the number of system executable processes are respectively used as the two independent variables x 1 and x 2 of the binary linear regression equation y=a 1 x 1 +a 2 x 2 +b, and the system load information is used as dependent variable y. Through the solution of the dependent variable to the independent variable, the system load information of the processor at the next moment can be predicted accurately and timely, and the operating frequency of the CPU can be set.
进一步,所述基于二元线性回归方程的动态调频方法包括以下步骤:Further, the dynamic frequency modulation method based on the binary linear regression equation comprises the following steps:
对Linux操作系统的进程序列进行采样,获取就绪队列的可执行进程数,同时采集同一时刻的系统的CPU利用率信息;Sampling the process sequence of the Linux operating system, obtaining the number of executable processes in the ready queue, and collecting the CPU utilization information of the system at the same time;
系统的CPU利用率和可执行进程数作为二元线性回归方程的自变量,预测的系统负载值作为二元线性回归方程的因变量;The CPU utilization rate of the system and the number of executable processes are used as independent variables of the binary linear regression equation, and the predicted system load value is used as the dependent variable of the binary linear regression equation;
通过自变量信息对因变量进行预测,准确给出下一时刻的系统负载信息,进而设置CPU的运行频率。Predict the dependent variable through the independent variable information, accurately give the system load information at the next moment, and then set the operating frequency of the CPU.
进一步,利用二元线性回归预测算法,将CPU利用率和系统可执行进程数作为模型的自变量x1和x2,利用二元线性回归预测方程y=a1x1+a2x2+b,对下一时刻的CPU负载信息进行预测。其中x1表示Linux操作系统下的CPU利用率,x2表示Linux操作系统下系统的可运行进程数,y表示Linux操作系统下系统的预测负载信息;x1=us+sy,us表示Linux操作系统用户态所占操作系统CPU利用率的百分数,sy表示操作系统系统空间所占CPU利用率的百分数,可运行进程数runningtask与二元线性回归方程中参数x2相对应,系统负载信息loadaverage与二元线性回归方程中参数y相对应。Further, using the binary linear regression prediction algorithm, the CPU utilization rate and the number of system executable processes are used as the independent variables x 1 and x 2 of the model, and the binary linear regression prediction equation y=a 1 x 1 +a 2 x 2 + b. Predict the CPU load information at the next moment. Wherein x1 represents the CPU utilization rate under the Linux operating system, x2 represents the number of runnable processes of the system under the Linux operating system, and y represents the predicted load information of the system under the Linux operating system; x1 = us+sy, us represents the Linux operation The percentage of the CPU utilization of the operating system occupied by the user state of the system, sy represents the percentage of the CPU utilization of the operating system system space, the number of runnable processes runningtask corresponds to the parameter x 2 in the binary linear regression equation, and the system load information loadaverage and Corresponds to the parameter y in the binary linear regression equation.
进一步,二元线性回归方程为:y=0.026083x1+0.63251x2-0.62255。Further, the binary linear regression equation is: y=0.026083x 1 +0.63251x 2 -0.62255.
进一步,所述对Linux操作系统的进程序列进行采样,获取就绪队列的可执行进程数,同时采集同一时刻的系统的CPU利用率信息进一步包括:Further, the process sequence of the Linux operating system is sampled, the number of executable processes of the ready queue is obtained, and the CPU utilization information of the system at the same time is collected further comprising:
对Linux操作系统的进程序列进行采样,获取就绪队列的可执行进程数runningtask,同时采集同一时刻的系统的CPU利用率信息us、sy,并获得系统负载信息loadaverage;其中,us表示Linux操作系统用户态所占操作系统CPU利用率的百分数,sy表示操作系统系统空间所占CPU利用率的百分数;采样点的时间间隔设置为每10ms采集一次;对于CPU信息的采集,对采集到的CPU相关数据信息采取不立即保存策略,先将采集到的数据信息存放到缓冲区内,当缓冲区的数据满时,将数据进行集中地输出保存。Sampling the process sequence of the Linux operating system to obtain the number of executable processes runningtask in the ready queue, and at the same time collect the CPU utilization information us and sy of the system at the same time, and obtain the system load information loadaverage; where us indicates the user of the Linux operating system sy represents the percentage of the CPU utilization of the operating system system space; the time interval of the sampling point is set to be collected every 10ms; for the collection of CPU information, the collected CPU-related data The information is not saved immediately. The collected data information is stored in the buffer first. When the data in the buffer is full, the data is output and saved in a centralized manner.
进一步,所述系统的CPU利用率和可执行进程数作为二元线性回归方程的自变量,已知的系统负载值作为二元线性回归方程的因变量进一步包括:Further, the CPU utilization rate and the number of executable processes of the system are used as independent variables of the binary linear regression equation, and the known system load value is used as the dependent variable of the binary linear regression equation, which further includes:
利用二元线性回归预测算法,将CPU利用率和系统可执行进程数作为模型即二元线性回归预测方程y=a1x1+a2x2+b的自变量x1和x2。其中x1表示Linux操作系统下的CPU利用率,x2表示Linux操作系统下系统的可运行进程数,y表示Linux操作系统下系统的预测负载信息;操作系统的CPU利用率=us+sy;通过所得数据求解方程,得到二元回归预测方程的系数a1、a2及b的值。Using the binary linear regression prediction algorithm, the CPU utilization rate and the number of executable processes of the system are used as the model, that is, the independent variables x 1 and x 2 of the binary linear regression prediction equation y=a 1 x 1 +a 2 x 2 +b. Wherein x1 represents the CPU utilization rate under the Linux operating system, x2 represents the number of runnable processes of the system under the Linux operating system, and y represents the predicted load information of the system under the Linux operating system; the CPU utilization rate of the operating system=us+sy; Solve the equation through the obtained data to obtain the values of the coefficients a 1 , a 2 and b of the binary regression prediction equation.
进一步,所述根据所得方程,通过自变量信息对因变量进行预测,准确给出下一时刻的系统负载信息,进而设置CPU的运行频率进一步包括:Further, according to the obtained equation, predicting the dependent variable through the independent variable information, accurately giving the system load information at the next moment, and then setting the operating frequency of the CPU further includes:
根据方程y=a1x1+a2x2+b,在已知下一时刻CPU利用率和系统可执行进程数的情况下,可预测出下一时刻系统负载的信息值,进而设置CPU的运行频率。According to the equation y=a 1 x 1 +a 2 x 2 +b, when the CPU utilization rate and the number of executable processes in the system are known at the next moment, the information value of the system load at the next moment can be predicted, and then the CPU can be set operating frequency.
本发明提供的基于二元线性回归方程的动态调频方法,在系统负载设置阶段,直接设置系统的负载值,省去系统负载到达稳定状态的过渡过程,达到实现系统功耗降低的目的;Linux操作系统CPUFreq动态调频子模块中,系统负载的变化有一个缓冲过程,一段时间之后,才能达到系统的稳定负载。在过渡过程中,不同时间段的系统负载,对应于不同的CPU运行频率,为了达到缩短系统负载过渡过程,降低系统功耗的目的,本发明在对常见预测算法进行的研究分析的基础上,选择二元线性回归方程作为系统负载的预测算法,并将其应用到Linux操作系统中的CPUFreq模块中。本发明以系统的CPU利用率和系统可执行进程数信息,作为二元线性回归方程的两个自变量,同时将系统的负载信息作为因变量。通过自变量对因变量进行预测,可以及时、准确地获得系统的负载信息。相比于Linux操作系统自带的ondemand策略和康卿提出的单一自变量的AIBD预测算法,二元线性回归预测算法在实现Linux系统负载的准确预测的同时及时地设置了系统的负载信息,省去系统负载到达稳定状态的过渡时间,在软件层次实现了系统功耗的降低。本发明提出了一种基于二元线性回归方程的动态调频方法,相比于AIBDDVS算法和Linux系统自带的ondemand调频策略,该方法不仅能准确地预测系统的负载信息,还能及时地设置系统的负载信息;通过Linux操作系统的CPU利用率和系统的可执行进程数信息,二元线性回归方程可以实现对系统负载信息地准确预测,直接获得Linux操作系统的负载信息,根据负载信息及时设置CPU的运行频率,提高系统频率设定的响应速度,同时省去系统负载达到稳定状态的过渡时间;准确设置CPU的运行频率,可以避免系统出现性能不足和性能过剩的问题,达到充分发挥系统性能和降低系统功耗的目的。The dynamic frequency modulation method based on the binary linear regression equation provided by the present invention directly sets the load value of the system in the system load setting stage, saves the transition process for the system load to reach a stable state, and achieves the purpose of reducing system power consumption; Linux operation In the system CPUFreq dynamic frequency modulation sub-module, there is a buffering process for the change of the system load, and the stable load of the system can be reached after a period of time. During the transition process, the system load in different time periods corresponds to different CPU operating frequencies. In order to shorten the system load transition process and reduce system power consumption, the present invention is based on the research and analysis of common prediction algorithms. Select the binary linear regression equation as the prediction algorithm of the system load, and apply it to the CPUFreq module in the Linux operating system. In the present invention, the CPU utilization rate of the system and the information of the executable process number of the system are used as two independent variables of the binary linear regression equation, and the load information of the system is used as the dependent variable at the same time. By predicting the dependent variable through the independent variable, the load information of the system can be obtained timely and accurately. Compared with the ondemand strategy that comes with the Linux operating system and the AIBD prediction algorithm with a single independent variable proposed by Kang Qing, the binary linear regression prediction algorithm not only realizes the accurate prediction of the Linux system load, but also sets the system load information in a timely manner, saving The transition time from the system load to the steady state is removed, and the system power consumption is reduced at the software level. The present invention proposes a dynamic frequency modulation method based on the binary linear regression equation. Compared with the AIBDDVS algorithm and the ondemand frequency modulation strategy that comes with the Linux system, the method can not only accurately predict the load information of the system, but also timely set the system The load information of the Linux operating system; through the CPU utilization rate of the Linux operating system and the number of executable processes of the system, the binary linear regression equation can realize accurate prediction of the system load information, directly obtain the load information of the Linux operating system, and set it in time according to the load information The operating frequency of the CPU can improve the response speed of the system frequency setting, and at the same time save the transition time for the system load to reach a stable state; accurately setting the operating frequency of the CPU can avoid the problems of insufficient performance and excessive performance of the system, and achieve full use of system performance. and reduce system power consumption.
附图说明Description of drawings
图1是本发明实施例提供的基于二元线性回归方程的动态调频方法流程图。Fig. 1 is a flowchart of a dynamic frequency modulation method based on a binary linear regression equation provided by an embodiment of the present invention.
图2是本发明实施例提供的CPU运行频率设置框架图。FIG. 2 is a frame diagram of CPU operating frequency setting provided by an embodiment of the present invention.
图3是本发明实施例提供的元线性回归方程的拟合直线示意图。Fig. 3 is a schematic diagram of a fitting line of a meta-linear regression equation provided by an embodiment of the present invention.
图4是本发明实施例提供的预测负载与实际负载变化曲线对比图。Fig. 4 is a comparison chart of the predicted load and the actual load change curve provided by the embodiment of the present invention.
具体实施方式detailed description
为了使本发明的目的、技术方案及优点更加清楚明白,以下结合实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。In order to make the object, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the examples. It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention.
本发明的二元线性回归预测算法主要考虑两方面的问题:负载信息预测的准确性、负载信息设置的及时性。其中,负载信息的预测是负载信息设置的前提,它关系到负载信息预测的准确性,将直接影响到CPU运行频率的正确性。为了获得准确的系统负载信息预测值,本发明将二元线性回归算法与Linux操作系统的动态调频策略相结合,保证了系统负载信息获得的准确性。The binary linear regression prediction algorithm of the present invention mainly considers two problems: the accuracy of load information prediction and the timeliness of load information setting. Among them, the prediction of the load information is the premise of the load information setting, which is related to the accuracy of the load information prediction, and will directly affect the correctness of the CPU operating frequency. In order to obtain accurate prediction value of system load information, the present invention combines binary linear regression algorithm with dynamic frequency regulation strategy of Linux operating system to ensure the accuracy of system load information acquisition.
下面结合附图对本发明的应用原理作详细的描述。The application principle of the present invention will be described in detail below in conjunction with the accompanying drawings.
如图1所示,本发明实施例的基于二元线性回归方程的动态调频方法包括以下步骤:As shown in Figure 1, the dynamic frequency modulation method based on the binary linear regression equation of the embodiment of the present invention includes the following steps:
S101:对Linux操作系统的进程序列进行采样,获取就绪队列的可执行进程数,同时采集同一时刻的系统的CPU利用率信息;S101: Sampling the process sequence of the Linux operating system, obtaining the number of executable processes in the ready queue, and collecting the CPU utilization information of the system at the same time;
S102:系统的CPU利用率和可执行进程数作为二元线性回归方程的自变量,系统负载值作为二元线性回归方程的因变量;S102: The CPU utilization rate of the system and the number of executable processes are used as independent variables of the binary linear regression equation, and the system load value is used as the dependent variable of the binary linear regression equation;
S103:通过自变量信息对因变量进行预测,准确给出下一时刻的系统负载信息,进而设置CPU的运行频率。S103: Predict the dependent variable through the independent variable information, accurately give the system load information at the next moment, and then set the operating frequency of the CPU.
本发明的基于二元线性回归方程的动态调频方法的基本思想:对Linux操作系统的进程序列进行采样,获取就绪队列的可执行进程数,同时采集同一时刻的系统的CPU利用率信息,系统的CPU利用率和可执行进程数作为二元线性回归方程的自变量,系统负载值作为二元线性回归方程的因变量,通过自变量信息对因变量进行预测,准确给出下一时刻的系统负载信息,进而设置CPU的运行频率。其流程框架如图2:The basic idea of the dynamic frequency modulation method based on the binary linear regression equation of the present invention: sample the process sequence of the Linux operating system, obtain the executable process number of the ready queue, and collect the CPU utilization rate information of the system at the same time at the same time. The CPU utilization rate and the number of executable processes are used as the independent variables of the binary linear regression equation, and the system load value is used as the dependent variable of the binary linear regression equation. The dependent variable is predicted through the independent variable information, and the system load at the next moment is accurately given Information, and then set the operating frequency of the CPU. Its process framework is shown in Figure 2:
Linux操作系统下CPU动态调频策略的调频依据是系统的资源利用信息,影响CPU负载信息的因素是系统当前可执行的进程数。Linux系统资源利用信息的另外一个方面的体现是系统CPU的利用率,即程序运行期间占用CPU的百分比。要实现Linux操作系统动态调频降低功耗的目的,操作系统CPU运行信息的获取至关重要。操作系统CPU利用率和系统可执行的进程数能够直观体现系统的负载信息。The frequency adjustment basis of the CPU dynamic frequency adjustment policy under the Linux operating system is the resource utilization information of the system, and the factor that affects the CPU load information is the number of currently executable processes in the system. Another aspect of Linux system resource utilization information is the utilization rate of the system CPU, that is, the percentage of the CPU occupied during the running of the program. In order to achieve the purpose of dynamic frequency adjustment of the Linux operating system to reduce power consumption, it is very important to obtain the operating information of the CPU of the operating system. The CPU utilization rate of the operating system and the number of executable processes of the system can directly reflect the load information of the system.
通过对影响Linux操作系统负载信息因素的研究,发现CPU利用率和系统可执行进程数是影响系统负载信息的两个主要的因素。利用二元线性回归预测算法,将CPU利用率和系统可执行进程数作为模型的自变量x1和x2,可以对下一时刻系统负载信息进行准确地预测,直接获得Linux操作系统的负载信息。以该负载预测值作为设置CPU的运行频率的依据,及时准确地设定CPU的运行频率,可以在获得CPU运算性能的同时,也能降低系统的功耗。Through the research on the factors affecting the load information of the Linux operating system, it is found that the CPU utilization rate and the number of executable processes in the system are the two main factors affecting the system load information. Using the binary linear regression prediction algorithm, taking the CPU utilization rate and the number of executable processes of the system as the independent variables x 1 and x 2 of the model, the system load information at the next moment can be accurately predicted, and the load information of the Linux operating system can be directly obtained . Using the load prediction value as the basis for setting the operating frequency of the CPU, setting the operating frequency of the CPU in a timely and accurate manner can reduce power consumption of the system while obtaining CPU computing performance.
二元线性回归预测方程y=a1x1+a2x2+b,x1表示Linux操作系统下的CPU利用率,x2表示Linux操作系统下系统的可运行进程数,y表示Linux操作系统下系统的负载信息。通过实验数据建立关于自变量x1(CPU利用率)和自变量x2(Linux可运行进程数)与因变量y(系统负载)信息之间的二元线性回归预测算法方程。基于Thinkcentrem8400t台式机获取的实验数据如表1所示:Binary linear regression prediction equation y=a 1 x 1 +a 2 x 2 +b, x 1 represents the CPU utilization rate under the Linux operating system, x 2 represents the number of runnable processes of the system under the Linux operating system, and y represents the Linux operation Load information of the system under the system. Based on the experimental data, a binary linear regression prediction algorithm equation is established between the independent variable x 1 (CPU utilization rate) and the independent variable x 2 (the number of Linux executable processes) and the dependent variable y (system load). The experimental data obtained based on the Thinkcentrem8400t desktop is shown in Table 1:
表1系统负载信息数据表Table 1 System Load Information Data Sheet
us表示Linux操作系统用户态所占操作系统CPU利用率的百分数,sy表示操作系统系统空间所占CPU利用率的百分数,runningtask表示操作系统中系统可执行进程数,loadaverage表示系统的负载信息。操作系统的CPU利用率=us+sy,该值与二元线性回归方程中参数x1相对应,可运行进程数runningtask与二元线性回归方程中参数x2相对应,loadaverage与二元线性回归方程中参数y相对应。通过MATLAB进行逆向求解获得相关参数如表2所示:us indicates the percentage of the CPU utilization of the operating system in the user mode of the Linux operating system, sy indicates the percentage of the CPU utilization of the operating system system space, runningtask indicates the number of executable processes in the operating system, and loadaverage indicates the load information of the system. The CPU utilization rate of the operating system = us+sy, this value corresponds to the parameter x 1 in the binary linear regression equation, the number of runnable processes runningtask corresponds to the parameter x 2 in the binary linear regression equation, and loadaverage corresponds to the parameter x 2 in the binary linear regression equation Corresponds to the parameter y in the equation. Relevant parameters obtained by reverse solution through MATLAB are shown in Table 2:
表2逆向求解二元线性回归方程数据表Table 2 Reverse solution to binary linear regression equation data table
b表示的是二元线性回归方程的参数x1、x2和b的回归系数的点估计值,得到二元线性回归方程的b数值是一个三行一列的矩阵。其值是:-0.62255、0.026083、0.63251其中在y=α1x1+α2x2+b中,分别对应b为-0.62255,α1为0.026083,α2为0.63251。b represents the point estimated values of the regression coefficients of the parameters x 1 , x 2 and b of the binary linear regression equation, and the obtained value of b of the binary linear regression equation is a matrix with three rows and one column. Its values are: -0.62255, 0.026083, 0.63251 where in y=α 1 x 1 +α 2 x 2 +b, corresponding to b is -0.62255, α 1 is 0.026083, and α 2 is 0.63251.
bint的数据表示的是二元线性回归方程回归系数的区间估计,r的数据表示的是残差,bint的数据表示该数据集合下的二元线性回归方程的置信区间。stats的数据用来检验回归方程的准确性的,其数据值有四个,分别表示相关系数、F检验数值、与F对应的概率p值、误差方差。The bint data represents the interval estimation of the regression coefficient of the binary linear regression equation, the r data represents the residual, and the bint data represents the confidence interval of the binary linear regression equation under the data set. The stats data is used to test the accuracy of the regression equation. There are four data values, which respectively represent the correlation coefficient, the F test value, the probability p value corresponding to F, and the error variance.
stats的取值:0.99199、495.19、4.1226e-09、0.072721。对于二元线性回归方程的相关系数是0.99199接近于1,说明回归方程非常的显著;同时F值为495.19,是一个非常大的数,也说明回归方程非常显著;p的值为4.1226e-09接近于零,也说明该二元线性回归方程是显著的。从上述数据可得二元线性回归方程为:Values of stats: 0.99199, 495.19, 4.1226e-09, 0.072721. The correlation coefficient for the binary linear regression equation is 0.99199 close to 1, indicating that the regression equation is very significant; at the same time, the F value is 495.19, which is a very large number, which also indicates that the regression equation is very significant; the p value is 4.1226e-09 It is close to zero, which also shows that the binary linear regression equation is significant. From the above data, the binary linear regression equation can be obtained as:
y=0.026083x1+0.63251x2-0.62255y=0.026083x 1 +0.63251x 2 -0.62255
二元线性回归方程的拟合直线如图3所示。The fitted straight line of the binary linear regression equation is shown in Figure 3.
下面结合实验对本发明的应用效果作详细的描述。The application effects of the present invention will be described in detail below in conjunction with experiments.
实验数据主要从二元线性回归预测算法预测系统负载的准确性、算法预测后设置CPU运行频率的及时性,这两个方面说明将二元线性回归预测算法应用于动态调频策略的优点。为了直观的体现该算法的优点,将二元线性回归动态调频算法同系统自带的ondemand动态调频策略,康卿提出的基于时间片的AIBDDVS算法做对比。The experimental data mainly includes the accuracy of predicting the system load by the binary linear regression prediction algorithm and the timeliness of setting the CPU operating frequency after the algorithm predicts. These two aspects illustrate the advantages of applying the binary linear regression prediction algorithm to the dynamic frequency modulation strategy. In order to intuitively reflect the advantages of this algorithm, the binary linear regression dynamic frequency modulation algorithm is compared with the ondemand dynamic frequency modulation strategy that comes with the system, and the AIBDDVS algorithm based on time slices proposed by Kang Qing.
表3数据是基于二元线性回归方程y=0.026083x1+0.63251x2-0.62255的系统负载预测值和系统ondemand调频策略关于系统负载数据的对比。通过曲线可以直观的得出,二元线性回归方程获得的系统负载预测值和Linux操作系统ondemand策略下系统负载实验值之间保持着95%以上的准确率,剔除个别实验数据点的影响,二元线性回归方程保持了非常高的预测准确性。说明在获取Linux操作系统CPU利用率信息和系统的可执行进程数后,二元线性回归方程能够准确地预测系统的负载。The data in Table 3 is a comparison of the system load prediction value based on the binary linear regression equation y=0.026083x 1 +0.63251x 2 -0.62255 and the system ondemand frequency modulation strategy on the system load data. From the curve, it can be intuitively concluded that the system load prediction value obtained by the binary linear regression equation and the system load experimental value under the Linux operating system ondemand strategy maintain an accuracy rate of more than 95%, excluding the influence of individual experimental data points, the two The meta-linear regression equation maintains a very high predictive accuracy. It shows that after obtaining the CPU utilization information of the Linux operating system and the number of executable processes of the system, the binary linear regression equation can accurately predict the load of the system.
表3系统负载预测值与实验值对比表Table 3 Comparison of system load prediction value and experimental value
图4可以看出在Linux操作系统自带的ondemand策略下,负载的变化需要一段时间的缓冲,才能到达某个稳定的系统负载,该过程需要5分钟的时间。对于基于二元线性回归方程的动态调频策略,则省去了这个过渡过程。该算法不仅能够准确地预测系统的负载信息,还能直接获取系统的负载信息,省去系统负载变化的过渡过程,从而达到降低系统功耗的目的。Figure 4 shows that under the ondemand policy that comes with the Linux operating system, it takes a period of buffering for load changes to reach a stable system load, and the process takes 5 minutes. For the dynamic frequency modulation strategy based on the binary linear regression equation, this transition process is omitted. The algorithm can not only predict the load information of the system accurately, but also directly obtain the load information of the system, saving the transition process of the system load change, thereby achieving the purpose of reducing the power consumption of the system.
本发明提出了一种基于二元线性回归方程的动态调频方法。相比于AIBDDVS算法和Linux系统自带的ondemand调频策略,该方法不仅能准确地预测系统的负载信息,还能及时地设置系统的负载信息。通过Linux操作系统的CPU利用率和系统的可执行进程数信息,二元线性回归方程可以实现对系统负载信息地准确预测,直接获得Linux操作系统的负载信息,根据负载信息及时设置CPU的运行频率,提高系统频率设定的响应速度,同时省去系统负载达到稳定状态的过渡时间。准确设置CPU的运行频率,可以避免系统出现性能不足和性能过剩的问题,达到充分发挥系统性能和降低系统功耗的目的。The invention proposes a dynamic frequency modulation method based on a binary linear regression equation. Compared with the AIBDDVS algorithm and the ondemand frequency modulation strategy that comes with the Linux system, this method can not only accurately predict the load information of the system, but also set the load information of the system in time. Through the CPU utilization rate of the Linux operating system and the number of executable processes of the system, the binary linear regression equation can realize accurate prediction of the system load information, directly obtain the load information of the Linux operating system, and set the operating frequency of the CPU in time according to the load information , improve the response speed of the system frequency setting, and save the transition time for the system load to reach a steady state at the same time. Accurately setting the operating frequency of the CPU can avoid the problems of insufficient performance and excessive performance in the system, and achieve the purpose of fully exerting system performance and reducing system power consumption.
以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内所作的任何修改、等同替换和改进等,均应包含在本发明的保护范围之内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present invention should be included in the protection of the present invention. within range.
Claims (7)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610139773.7A CN105808355B (en) | 2016-03-10 | 2016-03-10 | Dynamic frequency modulation method based on binary linear regression equation |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610139773.7A CN105808355B (en) | 2016-03-10 | 2016-03-10 | Dynamic frequency modulation method based on binary linear regression equation |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105808355A true CN105808355A (en) | 2016-07-27 |
CN105808355B CN105808355B (en) | 2019-12-10 |
Family
ID=56467193
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610139773.7A Active CN105808355B (en) | 2016-03-10 | 2016-03-10 | Dynamic frequency modulation method based on binary linear regression equation |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105808355B (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110275773A (en) * | 2018-10-30 | 2019-09-24 | 湖北省农村信用社联合社网络信息中心 | Paas resource circulation utilization index system based on truthful data models fitting |
CN110703898A (en) * | 2019-09-06 | 2020-01-17 | 无锡江南计算技术研究所 | Dynamic management system and method for processor power consumption based on periodic query and interrupt |
CN110868330A (en) * | 2018-08-28 | 2020-03-06 | 中国移动通信集团浙江有限公司 | Evaluation method, device and evaluation system for dividing CPU resources of cloud platform |
CN114236232A (en) * | 2021-12-16 | 2022-03-25 | 广州城市理工学院 | A Frequency Prediction Method for Small Hydropower Considering Frequency Trend |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH06258113A (en) * | 1993-03-08 | 1994-09-16 | Yamatake Honeywell Co Ltd | Electromagnetic flow meter |
US5954820A (en) * | 1997-09-26 | 1999-09-21 | International Business Machines Corporation | Portable computer with adaptive demand-driven power management |
CN103488539A (en) * | 2013-09-23 | 2014-01-01 | 北京交通大学 | Data center energy saving method based on central processing unit (CPU) dynamic frequency modulation technology |
CN105323111A (en) * | 2015-11-17 | 2016-02-10 | 南京南瑞集团公司 | Operation and maintenance automation system and method |
-
2016
- 2016-03-10 CN CN201610139773.7A patent/CN105808355B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH06258113A (en) * | 1993-03-08 | 1994-09-16 | Yamatake Honeywell Co Ltd | Electromagnetic flow meter |
US5954820A (en) * | 1997-09-26 | 1999-09-21 | International Business Machines Corporation | Portable computer with adaptive demand-driven power management |
CN103488539A (en) * | 2013-09-23 | 2014-01-01 | 北京交通大学 | Data center energy saving method based on central processing unit (CPU) dynamic frequency modulation technology |
CN105323111A (en) * | 2015-11-17 | 2016-02-10 | 南京南瑞集团公司 | Operation and maintenance automation system and method |
Non-Patent Citations (2)
Title |
---|
崔慎杰: "《集群系统中动态节能调度方法研究》", 《中国优秀硕士学位论文全文数据库 信息科技辑》 * |
李登: "《分布式系统负载均衡策略研究》", 《中国优秀硕士学位论文全文数据库 信息科技辑》 * |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110868330A (en) * | 2018-08-28 | 2020-03-06 | 中国移动通信集团浙江有限公司 | Evaluation method, device and evaluation system for dividing CPU resources of cloud platform |
CN110868330B (en) * | 2018-08-28 | 2021-09-07 | 中国移动通信集团浙江有限公司 | Evaluation method, device and evaluation system for dividing CPU resources of cloud platform |
CN110275773A (en) * | 2018-10-30 | 2019-09-24 | 湖北省农村信用社联合社网络信息中心 | Paas resource circulation utilization index system based on truthful data models fitting |
CN110275773B (en) * | 2018-10-30 | 2020-08-28 | 湖北省农村信用社联合社网络信息中心 | Paas resource recycling index system based on real data model fitting |
CN110703898A (en) * | 2019-09-06 | 2020-01-17 | 无锡江南计算技术研究所 | Dynamic management system and method for processor power consumption based on periodic query and interrupt |
CN114236232A (en) * | 2021-12-16 | 2022-03-25 | 广州城市理工学院 | A Frequency Prediction Method for Small Hydropower Considering Frequency Trend |
Also Published As
Publication number | Publication date |
---|---|
CN105808355B (en) | 2019-12-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103425535B (en) | Quick elastic telescopic method under cloud environment | |
CN107678855B (en) | Processor dynamic adjustment method, device and processor chip | |
CN105808355B (en) | Dynamic frequency modulation method based on binary linear regression equation | |
CN111026548A (en) | A Reverse Deep Reinforcement Learning Test Resource Scheduling Method for Power Communication Equipment | |
CN106528266B (en) | Method and device for dynamically adjusting resources in cloud computing system | |
CN104049716B (en) | Computer energy-saving method and system combined with temperature sensing | |
JP2021517697A (en) | Resource scheduling method and terminal device | |
US10067551B2 (en) | Power state transition analysis | |
CN112954707B (en) | Energy saving method and device for base station, base station and computer readable storage medium | |
CN103019367B (en) | Embedded type GPU (Graphic Processing Unit) dynamic frequency modulating method and device based on Android system | |
CN101860623B (en) | Method and system for indicating service time of intelligent phone battery by sensing system context | |
CN103037109B (en) | Multicore equipment energy consumption management method and device | |
CN111914000B (en) | Server power capping method and system based on power consumption prediction model | |
KR101770736B1 (en) | Method for reducing power consumption of system software using query scheduling of application and apparatus for reducing power consumption using said method | |
CN103019855A (en) | Method for forecasting executive time of Map Reduce operation | |
CN106773610A (en) | A kind of cesium-beam atomic clock and hydrogen clock frequency difference predictor method | |
CN103245829B (en) | A kind of virtual machine power consumption measurement method | |
Zhu et al. | An energy-efficient dynamic offloading algorithm for edge computing based on deep reinforcement learning | |
CN103530190B (en) | A kind of load predicting method and device | |
CN103092328A (en) | Computer energy conservation method based on magnetic disc dormancy | |
Zare et al. | Resource scheduling in mobile cloud computing: taxonomy and open challenges | |
Chinnici et al. | Data center, a cyber-physical system: improving energy efficiency through the power management | |
CN115145709B (en) | Low-carbon big data artificial intelligence methods and medical and health care ecosystem | |
CN112486683B (en) | Processor control method, control device, and computer-readable storage medium | |
US20210072814A1 (en) | Method and apparatus for operating a processor in an electronic device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |