元元+曹海英
摘 要: 針對傳統(tǒng)輪詢算法對網(wǎng)絡(luò)資源的均衡化調(diào)度存在負載均衡性差、網(wǎng)絡(luò)資源浪費嚴重以及資源調(diào)度效果差的問題,提出一種新的網(wǎng)絡(luò)資源均衡化調(diào)度算法?;诰W(wǎng)絡(luò)資源的均衡化算法運行過程,設(shè)計異構(gòu)集群的并行計算熵的計算矩陣,實現(xiàn)虛擬機的調(diào)度,對調(diào)度目標的物理節(jié)點進行分析,完成網(wǎng)絡(luò)資源多線程負載均衡調(diào)度。采用基于處理時間的網(wǎng)絡(luò)資源負載動態(tài)均衡算法,對每個物理節(jié)點建立負載調(diào)度機制,使物理節(jié)點按照內(nèi)部最優(yōu)調(diào)度方式實施均衡調(diào)度,實現(xiàn)對網(wǎng)絡(luò)資源的均衡化調(diào)度。實驗結(jié)果表明,所提算法的調(diào)度效率高,且具有較高的負載均衡穩(wěn)定性,可以減少網(wǎng)絡(luò)資源的浪費,增強網(wǎng)絡(luò)資源的調(diào)度效果。
關(guān)鍵詞: 網(wǎng)絡(luò)資源調(diào)度; 負載均衡; 云平臺; 物理節(jié)點; 均衡調(diào)度; 負載調(diào)度機制
中圖分類號: TN711?34; TN929 文獻標識碼: A 文章編號: 1004?373X(2018)04?0034?03
Abstract: In allusion to the problems that there exist poor load balance, serious waste of network resources and poor resource scheduling efficiency in network resource equalization scheduling by using traditional polling algorithm, a new network resource equalization scheduling algorithm is proposed. The computing matrix of parallel computing entropy for heterogeneous cluster is designed on the basis of operation process of network resource equalization algorithm to realize the scheduling of fixed virtual machines. The physical nodes of scheduling targets are analyzed to complete the multithreading load balance scheduling of network resources. The dynamic network resource load balance algorithm based on processing time is adopted to establish load scheduling mechanism for each physical node, so that balanced scheduling of physical nodes can be implemented according to the internal optimal scheduling mode, and balanced scheduling of network resources realized. The experimental results show that the proposed algorithm has high scheduling efficiency and high load balancing stability, which can reduce the waste of network resources and enhance the scheduling effect of network resources.
Keywords: network resource scheduling; load balance; cloud platform; physical node; balanced scheduling; load scheduling mechanism
0 引 言
隨著互聯(lián)網(wǎng)通信技術(shù)的不斷發(fā)展,網(wǎng)絡(luò)資源的數(shù)據(jù)規(guī)模也逐漸變大,人們對網(wǎng)絡(luò)資源掌握的要求也越來越高,對網(wǎng)絡(luò)資源均衡化調(diào)度的研究關(guān)注度較高,加強網(wǎng)絡(luò)資源的綜合管理[1],實現(xiàn)網(wǎng)絡(luò)資源均衡化調(diào)度成為互聯(lián)網(wǎng)發(fā)展的關(guān)鍵。傳統(tǒng)輪詢法對網(wǎng)絡(luò)資源的均衡化調(diào)度存在網(wǎng)絡(luò)資源利用率低、資源調(diào)度效果差的問題。面對該問題,本文提出一種新的網(wǎng)絡(luò)資源多線程負載均衡調(diào)度算法,以提高網(wǎng)絡(luò)資源均衡化調(diào)度效率,減少網(wǎng)絡(luò)資源的浪費。
1 網(wǎng)絡(luò)資源的均衡化調(diào)度算法
1.1 基于云平臺網(wǎng)絡(luò)資源多線程負載均衡調(diào)度算法
在網(wǎng)絡(luò)資源的均衡化算法的研究過程中,先收集各個網(wǎng)絡(luò)節(jié)點的負載信息,并根據(jù)其攜帶的信息種類實施分類,根據(jù)已知節(jié)點樣本的負載特征值,對其余節(jié)點負載特征值進行計算[2],將計算出節(jié)點的特征值隨心跳包傳導至根節(jié)點,實現(xiàn)根節(jié)點對子節(jié)點的信息反饋作用。本文在此基礎(chǔ)上建立云平臺網(wǎng)絡(luò)資源均衡化算法,采用該算法進行網(wǎng)絡(luò)資源的均衡化調(diào)度時,需要利用云平臺網(wǎng)絡(luò)資源的均衡化原理、模型中的時間、費用等參數(shù)?;谠破脚_網(wǎng)絡(luò)資源多線程負載均衡調(diào)度算法,設(shè)計了異構(gòu)集群的并行計算熵的計算矩陣,對虛擬機的調(diào)度[3]、調(diào)度目標的物理節(jié)點及其判斷方式進行定義,其定義步驟如下:
式中,[ptotali]為物理節(jié)點處理能力的量化體現(xiàn)。
用[?]表示網(wǎng)絡(luò)資源的采樣周期,對網(wǎng)絡(luò)資源的對應(yīng)并行熵進行求值。若計算出的并行熵大于或等于負載閾值,判斷此時的網(wǎng)絡(luò)資源處于負載均衡狀態(tài)。
上述過程基于云平臺網(wǎng)絡(luò)資源均衡化模型的基本原理,以及異構(gòu)集群的并行計算熵的計算矩陣,實現(xiàn)虛擬機的調(diào)度,對調(diào)度目標的物理節(jié)點進行分析,完成網(wǎng)絡(luò)資源多線程負載均衡調(diào)度。endprint
1.2 基于處理時間的網(wǎng)絡(luò)資源負載動態(tài)均衡算法
上文分析的網(wǎng)絡(luò)資源的均衡化調(diào)度算法,在物理節(jié)點處于數(shù)據(jù)繁忙狀態(tài)時,其向中央服務(wù)器進行網(wǎng)絡(luò)資源負載信息提交過程中,負載信息反饋不及時[5],會降低網(wǎng)絡(luò)資源均衡化的效率,因此需要建立一種基于處理時間的網(wǎng)絡(luò)資源負載動態(tài)均衡算法,提高網(wǎng)絡(luò)資源均衡化效率。假設(shè)有[n]個物理節(jié)點參與計算,任務(wù)總量為[Ti1],[Vi]和[Ti]分別為物理點的平均處理時間和運行時間,對第一個物理節(jié)點實施均衡調(diào)度。將剩余物理節(jié)點按照內(nèi)部最優(yōu)調(diào)度方式實施均衡調(diào)度,對于物理節(jié)點[Nj(j≤n≤2)],存在處理時間最大的節(jié)點[p1],理論上[T1]和[Tp1]存在式(3)所示的函數(shù)關(guān)系,函數(shù)關(guān)系表達式為:
為了充分考慮網(wǎng)絡(luò)資源的有效利用,提高任務(wù)的并行能力[6],調(diào)度發(fā)生的最合適時間應(yīng)為圖1中的臨界點上,其滿足[T1=Tpj],并進行一次負載均衡調(diào)度,必然存在某一個物理節(jié)點的運行時間為[Tn(j≤n≤1)],當一個響應(yīng)時間最短的網(wǎng)絡(luò)資源調(diào)度方式,需要所有物理節(jié)點的共同參與[7],不能間斷。為了讓網(wǎng)絡(luò)資源的均衡度更高,需要為每一個物理節(jié)點設(shè)置一個臨時變量[ti(n≤i≤1)],初始值為0,記錄起始運行時間,當物理節(jié)點完成網(wǎng)絡(luò)資源調(diào)度任務(wù)后,用當前時間減去起始時間即為任務(wù)用時[Δt],其能精準地反應(yīng)出目標物理節(jié)點的網(wǎng)絡(luò)資源任務(wù)處理能力和負載均衡能力[8],本文令[ti=ti+Δt],[ti]表示目標物理節(jié)點處理任務(wù)總用時。假設(shè)未完成的網(wǎng)絡(luò)資源任務(wù)按當前處理速度繼續(xù)進行,設(shè)當前物理節(jié)點[i]已完成任務(wù)為[Nh],提交完成任務(wù)量為[Nhi],提交任務(wù)數(shù)為[Nsi],該物理節(jié)點[i]網(wǎng)絡(luò)資源處理用時[Ti]為:
式中,[t0]為對物理節(jié)點預(yù)期的單位任務(wù)用時,通常設(shè)為0.01。從式(4)得到網(wǎng)絡(luò)資源的動態(tài)均衡調(diào)整策略,從所有物理節(jié)點中選擇處理時間最短的物理節(jié)點,未進行網(wǎng)絡(luò)資源任務(wù)分配時,[ti=0]。因此在網(wǎng)絡(luò)資源任務(wù)均衡調(diào)度初始狀態(tài)[9],遵從物理節(jié)點的順序進行任務(wù)提交。因為[Ti]處于動態(tài)變化中,因此該網(wǎng)絡(luò)資源負載動態(tài)均衡算法能夠?qū)崿F(xiàn)對網(wǎng)絡(luò)資源的均衡調(diào)度,并降低網(wǎng)絡(luò)資源均衡化用時,提高網(wǎng)絡(luò)資源均衡化效率[10]。
2 實驗分析
實驗以國外某個制藥公司的網(wǎng)絡(luò)資源均衡調(diào)度過程為例,對比分析本文算法和傳統(tǒng)輪詢算法對該公司網(wǎng)絡(luò)資源的均衡調(diào)度效果,分別選取不同規(guī)模的實驗數(shù)據(jù),實驗采用本文算法和傳統(tǒng)輪詢算法對網(wǎng)絡(luò)資源均衡調(diào)度過程中資源利用率和負載均衡穩(wěn)定性實施分析。圖2為兩種算法對網(wǎng)絡(luò)資源的利用率結(jié)果,圖3為兩種算法對負載均衡穩(wěn)定性分析結(jié)果。
從圖2和圖3可以分析得出,采用本文算法進行網(wǎng)絡(luò)資源負載均衡調(diào)度的資源利用率和負載均衡穩(wěn)定性均要好于傳統(tǒng)輪詢算法,且本文算法隨著實驗任務(wù)數(shù)量的擴大,負載均衡的波動較小,因為利用本文算法實施網(wǎng)絡(luò)資源負載均衡時,采用云平臺網(wǎng)絡(luò)資源均衡化模型,得到云平臺環(huán)境下網(wǎng)絡(luò)資源任務(wù)所需要的時間、費用和安全性函數(shù),將多線程的負載均衡調(diào)度問題轉(zhuǎn)化為離線空間優(yōu)化問題,提高了網(wǎng)絡(luò)資源的利用率和負載均衡調(diào)度質(zhì)量。
3 結(jié) 論
本文設(shè)計的網(wǎng)絡(luò)資源的均衡化調(diào)度算法,能有效地對網(wǎng)絡(luò)資源實施均衡調(diào)度,提高網(wǎng)絡(luò)資源的利用效率,降低能量消耗,實現(xiàn)高效的網(wǎng)絡(luò)資源均衡調(diào)度。
參考文獻
[1] 張忠平,馮玉鵬,張雪楠.基于標準差及二次分配的啟發(fā)式網(wǎng)格資源調(diào)度算法[J].小型微型計算機系統(tǒng),2016,37(2):259?263.
ZHANG Zhongping, FENG Yupeng, ZHANG Xuenan. Heuristic grid resource scheduling algorithm based on standard deviations and secondary distribution [J]. Journal of Chinese computer systems, 2016, 37(2): 259?263.
[2] 李曉峰.云計算光纖網(wǎng)絡(luò)下的云資源調(diào)度方法研究與改進[J].激光雜志,2016,37(5):99?103.
LI Xiaofeng. Research and improvement of cloud resource scheduling method in cloud computing optical fiber network [J]. Laser journal, 2016, 37(5): 99?103.
[3] 劉迅,畢遠志.基于微粒群算法的工程網(wǎng)絡(luò)計劃多資源均衡優(yōu)化研究[J].科技管理研究,2014,34(11):182?187.
LIU Xun, BI Yuanzhi. Multi?resources leveling optimization in project network planning based on PSO algorithm [J]. Science and technology management research, 2014, 34(11): 182?187.
[4] 封岸松,王宏,張彥武.無線HART網(wǎng)絡(luò)節(jié)點變速率資源調(diào)度算法實現(xiàn)[J].電子技術(shù)應(yīng)用,2016,42(3):95?97.
FENG Ansong, WANG Hong, ZHANG Yanwu. Implementation of variable?rate resources scheduling algorithm of wireless HART node [J]. Application of electronic technique, 2016, 42(3): 95?97.
[5] 王勇,劉美林,李凱,等.云環(huán)境下基于可靠性的均衡任務(wù)調(diào)度算法研究[J].計算機科學,2015,42(z1):325?331.endprint
WANG Yong, LIU Meilin, LI Kai, et al. Reliability?based job scheduling algorithm in cloud computing [J]. Computer science, 2015, 42(S1): 325?331.
[6] 宋玉堅,葉春明,黃佐钘.多智能體布谷鳥算法的網(wǎng)絡(luò)計劃資源均衡優(yōu)化[J].計算機工程與應(yīng)用,2015,51(15):56?61.
SONG Yujian, YE Chunming, HUANG Zuoxing. Multi?agent cuckoo search algorithm for resource leveling problem of network planning [J]. Computer engineering and applications, 2015, 51(15): 56?61.
[7] 王鵬,黃焱,李坤,等.云計算集群相空間負載均衡度優(yōu)先調(diào)度算法研究[J].計算機研究與發(fā)展,2014,51(5):1095?1107.
WANG Peng, HUANG Yan, LI Kun, et al. Load balancing degree first algorithm on phase space for cloud computing cluster [J]. Journal of computer research and development, 2014, 51(5): 1095?1107.
[8] 何立華,張連營.基于資源波動成本的工程項目資源均衡優(yōu)化[J].管理工程學報,2015,29(2):167?174.
HE Lihua, ZHANG Lianying. Resource leveling optimization based on resource fluctuation cost in construction projects [J]. Journal of industrial engineering and engineering management, 2015, 29(2): 167?174.
[9] 鄧志龍,段哲民,李劉濤.OpenStack環(huán)境下的資源動態(tài)調(diào)度研究[J].西北工業(yè)大學學報,2016,34(4):650?655.
DENG Zhilong, DUAN Zhemin, LI Liutao. Research of dynamic scheduling of resources under the environment of OpenStack [J]. Journal of Northwestern Polytechnical University, 2016, 34(4): 650?655.
[10] ZHANG Peng. Simulation research on load balancing scheduling of cloud platform network [J]. Computer simulation, 2017, 34(6): 372?375.
[11] 田春子,邵曉康.局域網(wǎng)限速狀態(tài)下的資源調(diào)度模型仿真[J].計算機仿真,2015,32(4):248?251.
TIAN Chunzi, SHAO Xiaokang. Simulation of resource scheduling model under LAN speed limit state [J]. Computer simulation, 2015, 32(4): 248?251.endprint