发明名称 一种基于市场电价的数据中心实时任务调度方法
摘要 本发明公开了一种基于市场电价的数据中心实时任务调度方法,属于计算机领域。目的是基于市场电价前提下,解决数据中心系统电价运行成本较高的问题。技术方案是当实时任务到达数据中心系统后,首先计算实时任务的到达时间与完成时限之间的各小时段的电价成本选取函数值,然后根据该函数值选取合适的实时任务执行小时段,选取执行服务器,并确定实时任务的执行开始和结束时间,最后将实时任务调度至选取的服务器上,根据所确定的开始时间和结束时间执行任务。采用本发明使得数据中心根据实际市场电价成本进行实时任务优化调度,达到降低数据中心系统的整体运行成本的目标。
申请公布号 CN104537505A 申请公布日期 2015.04.22
申请号 CN201510038370.9 申请日期 2015.01.26
申请人 中国人民解放军国防科学技术大学 发明人 雷洪涛;张涛;查亚兵;刘亚杰;王锐
分类号 G06Q10/06(2012.01)I;G06Q50/06(2012.01)I 主分类号 G06Q10/06(2012.01)I
代理机构 国防科技大学专利服务中心 43202 代理人 郭敏
主权项 一种基于市场电价的数据中心实时任务调度方法,其特征在于它包括以下步骤:步骤1:实时任务i到达数据中心系统,计算实时任务i的各小时段k的电价成本选取函数值f(k,i),k=1,...,τ:<maths num="0001" id="cmaths0001"><math><![CDATA[<mrow><mi>f</mi><mrow><mo>(</mo><mi>k</mi><mo>,</mo><mi>i</mi><mo>)</mo></mrow><mo>=</mo><mi>&alpha;</mi><mo>&CenterDot;</mo><mfrac><mrow><mover><msub><mi>t</mi><mi>i</mi></msub><mo>&OverBar;</mo></mover><mo>-</mo><msubsup><mi>t</mi><mn>0</mn><mi>k</mi></msubsup></mrow><mrow><mover><msub><mi>t</mi><mi>i</mi></msub><mo>&OverBar;</mo></mover><mo>-</mo><munder><mi>min</mi><mrow><msubsup><mi>t</mi><mn>0</mn><mi>k</mi></msubsup><mo>&lt;</mo><mover><msub><mi>t</mi><mi>i</mi></msub><mo>&OverBar;</mo></mover><mo>,</mo><mi>k</mi><mo>&Element;</mo><msub><mi>T</mi><mi>i</mi></msub></mrow></munder><mo>{</mo><msubsup><mi>t</mi><mn>0</mn><mi>k</mi></msubsup><mo>}</mo></mrow></mfrac><mo>+</mo><mi>&beta;</mi><mo>&CenterDot;</mo><mfrac><mrow><munder><mi>max</mi><mrow><mi>k</mi><mo>&Element;</mo><msub><mi>T</mi><mi>i</mi></msub></mrow></munder><mo>{</mo><msup><mi>p</mi><mi>k</mi></msup><mo>}</mo></mrow><msup><mi>p</mi><mi>k</mi></msup></mfrac></mrow>]]></math><img file="FDA0000661961240000011.GIF" wi="848" he="218" /></maths>α+β=1,α<β<img file="FDA0000661961240000012.GIF" wi="41" he="84" />为实时任务i的完成时限,<img file="FDA0000661961240000013.GIF" wi="56" he="75" />为第k个小时段的起始时间,小时段是指从实时任务到达时刻向下取整的整点时刻起算的每个小时为1小时段,实时任务到达时所在的小时段为第1个小时段;k为小时段的顺序标识,k=1,...,τ,τ为实时任务i的到达时间t<sub>i</sub>与任务完成时限<img file="FDA0000661961240000014.GIF" wi="40" he="83" />之间的小时段数;T<sub>i</sub>为实时任务i的调度时间区间,T<sub>i</sub>={1,...,τ}即τ个小时段;p<sup>k</sup>为小时段k内的电价,其取值为实时任务i的τ个小时段内的市场电价值;α、β为小于1的权重因子,其取值由决策者设定,α值表示决策者关注实时任务完成时限的程度,β值的大小表示决策者关注低电价成本的程度,α<β表示在本发明中更关注低电价成本;步骤2:将计算后的f(k,i)值进行降序排列为{f<sup>1</sup>(k,i),...,f<sup>γ</sup>(k,i),...,f<sup>τ</sup>(k,i)},1≤γ≤τ,并令变量γ=1;步骤3:选择实时任务i执行的小时段k*:<maths num="0002" id="cmaths0002"><math><![CDATA[<mrow><mi>k</mi><mo>*</mo><mo>=</mo><munder><mi>arg</mi><mi>k</mi></munder><msup><mi>f</mi><mi>&gamma;</mi></msup><mrow><mo>(</mo><mi>k</mi><mo>,</mo><mi>i</mi><mo>)</mo></mrow></mrow>]]></math><img file="FDA0000661961240000021.GIF" wi="332" he="100" /></maths>其中<img file="FDA0000661961240000022.GIF" wi="238" he="102" />为取得第γ个f(k,i)值的小时段顺序标识;步骤4:若<img file="FDA0000661961240000023.GIF" wi="175" he="99" />则γ=γ+1,转至步骤3;<img file="FDA0000661961240000024.GIF" wi="71" he="78" />为小时段k*的起始时间,<img file="FDA0000661961240000025.GIF" wi="51" he="85" />为实时任务i的完成时限;步骤5:选择运行实时任务i的服务器n*:<maths num="0003" id="cmaths0003"><math><![CDATA[<mfenced open='' close=''><mtable><mtr><mtd><mi>n</mi><mo>*</mo><mo>=</mo><munder><mi>arg</mi><mi>n</mi></munder></mtd><mtd><munder><mi>min</mi><mrow><mi>n</mi><mo>&Element;</mo><mi>M</mi></mrow></munder><mo>{</mo><mfrac><msubsup><mi>l</mi><mi>n</mi><mrow><mi>k</mi><mo>*</mo></mrow></msubsup><msubsup><mi>a</mi><mi>n</mi><mrow><mi>k</mi><mo>*</mo></mrow></msubsup></mfrac><mo>}</mo></mtd></mtr></mtable></mfenced>]]></math><img file="FDA0000661961240000026.GIF" wi="407" he="164" /></maths>若存在多个服务器取得<maths num="0004" id="cmaths0004"><math><![CDATA[<mrow><munder><mi>min</mi><mrow><mi>n</mi><mo>&Element;</mo><mi>M</mi></mrow></munder><mo>{</mo><mfrac><msubsup><mi>l</mi><mi>n</mi><mrow><mi>k</mi><mo>*</mo></mrow></msubsup><msubsup><mi>a</mi><mi>n</mi><mrow><mi>k</mi><mo>*</mo></mrow></msubsup></mfrac><mo>}</mo></mrow>]]></math><img file="FDA0000661961240000027.GIF" wi="224" he="162" /></maths>值,则<maths num="0005" id="cmaths0005"><math><![CDATA[<mrow><mi>n</mi><mo>*</mo><mo>=</mo><mi>min</mi><mfenced open='{' close='}'><mtable><mtr><mtd><munder><mi>arg</mi><mi>n</mi></munder></mtd><mtd><munder><mi>min</mi><mrow><mi>n</mi><mo>&Element;</mo><mi>M</mi></mrow></munder><mo>{</mo><mfrac><msubsup><mi>l</mi><mi>n</mi><mrow><mi>k</mi><mo>*</mo></mrow></msubsup><msubsup><mi>a</mi><mi>n</mi><mrow><mi>k</mi><mo>*</mo></mrow></msubsup></mfrac><mo>}</mo></mtd></mtr></mtable></mfenced><mo>,</mo></mrow>]]></math><img file="FDA0000661961240000028.GIF" wi="548" he="170" /></maths>即n*为取得<img file="FDA0000661961240000029.GIF" wi="216" he="163" />值中最小顺序标识的服务器;<img file="FDA00006619612400000210.GIF" wi="64" he="75" />为小时段k*内服务器n队列中已安排任务的总长,单位为千位kb,1b=1byte;<img file="FDA00006619612400000211.GIF" wi="71" he="81" />为小时段k*内服务器n的运行速度,单位为千位每秒kbps;M为数据中心系统执行实时任务的N台服务器集合{M<sub>1</sub>,M<sub>2</sub>,...,M<sub>n</sub>,...,M<sub>N</sub>},M<sub>n</sub>为数据中心系统的第n台服务器,n为数据中心系统中服务器的顺序标识号,1≤n≤N;步骤6:将实时任务i插入服务器n*任务队列最后,计算实时任务i实际执行开始时间<img file="FDA00006619612400000212.GIF" wi="50" he="71" />及实际执行结束时间<img file="FDA00006619612400000213.GIF" wi="82" he="73" /><maths num="0006" id="cmaths0006"><math><![CDATA[<mrow><msubsup><mi>t</mi><mi>i</mi><mi>s</mi></msubsup><mo>=</mo><mi>max</mi><mo>{</mo><msubsup><mi>t</mi><mrow><mi>i</mi><mo>-</mo><mn>1</mn><mo>,</mo><mi>k</mi><mo>*</mo></mrow><mrow><mi>e</mi><mo>,</mo><mi>n</mi><mo>*</mo></mrow></msubsup><mo>,</mo><msubsup><mi>t</mi><mi>i</mi><mrow><mi>n</mi><mo>*</mo></mrow></msubsup><mo>}</mo></mrow>]]></math><img file="FDA00006619612400000214.GIF" wi="434" he="75" /></maths><maths num="0007" id="cmaths0007"><math><![CDATA[<mrow><msubsup><mi>t</mi><mi>i</mi><mi>e</mi></msubsup><mo>=</mo><msubsup><mi>t</mi><mi>i</mi><mi>s</mi></msubsup><mo>+</mo><mfrac><msub><mi>l</mi><mi>i</mi></msub><msubsup><mi>a</mi><mrow><mi>n</mi><mo>*</mo></mrow><mrow><mi>k</mi><mo>*</mo></mrow></msubsup></mfrac></mrow>]]></math><img file="FDA00006619612400000215.GIF" wi="259" he="138" /></maths>其中,<img file="FDA00006619612400000216.GIF" wi="63" he="82" />为实时任务i到达服务器n*任务队列时间,近似为实时任务i到达数据中心系统时间t<sub>i</sub>;<img file="FDA00006619612400000217.GIF" wi="125" he="80" />为小时段k*内服务器n*任务队列中排在实时任务i前面一个任务的执行结束时间,若小时段k*内服务器n*无实时任务执行,则<img file="FDA0000661961240000031.GIF" wi="250" he="86" />l<sub>i</sub>为实时任务i长度,单位为千位kb,1b=1byte;<img file="FDA0000661961240000032.GIF" wi="73" he="79" />为小时段k*内服务器n*运行速度,单位为千位每秒kbps;步骤7:检测任务执行结束时间是否满足任务执行时限——比较<img file="FDA0000661961240000033.GIF" wi="48" he="71" />与实时任务i完成的时间限制<img file="FDA0000661961240000034.GIF" wi="73" he="85" />当<img file="FDA0000661961240000035.GIF" wi="162" he="92" />则输出n*,t<sub>i</sub><sup>s</sup>和t<sub>i</sub><sup>e</sup>,转步骤8;当<img file="FDA0000661961240000036.GIF" wi="156" he="84" />γ=γ+1,若γ≤12,转步骤3,若γ>12,则按照γ=1时,选取小时段<maths num="0008" id="cmaths0008"><math><![CDATA[<mrow><mi>k</mi><mo>*</mo><mo>=</mo><munder><mi>arg</mi><mi>k</mi></munder><msup><mi>f</mi><mn>1</mn></msup><mrow><mo>(</mo><mi>k</mi><mo>,</mo><mi>i</mi><mo>)</mo></mrow><mo>,</mo></mrow>]]></math><img file="FDA0000661961240000037.GIF" wi="349" he="103" /></maths>确定服务器<maths num="0009" id="cmaths0009"><math><![CDATA[<mfenced open='' close=''><mtable><mtr><mtd><mi>n</mi><mo>*</mo><mo>=</mo><munder><mi>arg</mi><mi>n</mi></munder></mtd><mtd><munder><mi>min</mi><mrow><mi>n</mi><mo>&Element;</mo><mi>M</mi></mrow></munder><mo>{</mo><mfrac><msubsup><mi>l</mi><mi>n</mi><mrow><mi>k</mi><mo>*</mo></mrow></msubsup><msubsup><mi>a</mi><mi>n</mi><mrow><mi>k</mi><mo>*</mo></mrow></msubsup></mfrac><mo>}</mo></mtd></mtr></mtable></mfenced>]]></math><img file="FDA0000661961240000038.GIF" wi="396" he="165" /></maths>以及计算开始时间<img file="FDA0000661961240000039.GIF" wi="424" he="84" />和结束时间<img file="FDA00006619612400000310.GIF" wi="286" he="145" />输出n*,t<sub>i</sub><sup>s</sup>和t<sub>i</sub><sup>e</sup>;步骤8:将实时任务i调度至数据中心的服务器n*上,在时间t<sub>i</sub><sup>s</sup>开始执行,在时间t<sub>i</sub><sup>e</sup>结束任务执行。
地址 410073 湖南省长沙市开福区德雅路109号