电子科技 ›› 2024, Vol. 37 ›› Issue (7): 89-94.doi: 10.16180/j.cnki.issn1007-7820.2024.07.012

• • 上一篇    

基于智慧路灯云平台的动态权重负载均衡算法

杨泽民, 夏长权, 李佳颖, 朱金荣, 韩一帆   

  1. 扬州大学 物理科学与技术学院,江苏 扬州 225100
  • 收稿日期:2023-02-15 出版日期:2024-07-15 发布日期:2024-07-17
  • 作者简介:杨泽民(1997-),男,硕士研究生。研究方向:物联网与人工智能。
    夏长权(1982-),男,博士,讲师。研究方向:激光与物质相互作用。
    朱金荣(1968-),男,教授。研究方向:物联网与人工智能。
  • 基金资助:
    国家自然科学基金(61802336);江苏省研究生创新计划(SJCX22_1707)

Dynamic Weight Load Balancing Algorithm Based on Microservice for Smart Street Lamp Cloud Platform

YANG Zemin, XIA Changquan, LI Jiaying, ZHU Jinrong, HAN Yifan   

  1. School of Physical Science and Technology,Yangzhou University,Yangzhou 225100,China
  • Received:2023-02-15 Online:2024-07-15 Published:2024-07-17
  • Supported by:
    National Natural Science Foundation of China(61802336);Jiangsu Graduate Innovation Program(SJCX22_1707)

摘要:

大规模路灯向云平台发送数据会导致服务器在高并发情况下的各节点出现负载失衡、引起通信故障。针对该问题,文中基于微服务提出了一种基于智慧路灯云平台的动态权重负载均衡算法。该算法在初始化时根据各个服务器的硬件性能计算出各自的权重系数及各节点的初始权值,并在请求过程中结合CPU(Central Processing Unit)和网络带宽的空闲率动态地调节服务器权重,实现负载的优化。通过设定最低阈值与计算出的剩余负载率进行比较,将到达负载上限的服务器权值置为0,防止服务器出现过载情况。测试结果表明,在实验环境下,文中算法相比于最小连接数算法和平滑加权轮询算法具有更优的负载均衡效果,相比于动态权重算法,平均响应时间和实际并发连接数也有所提升。

关键词: 云平台, 动态权重, 负载均衡, 物联网, 微服务, 集群, 智慧路灯, 剩余负载

Abstract:

A large-scale street lights send data to the cloud platform, causing load imbalance among nodes of the server in high concurrency, resulting in communication failure. In view of this problem, based on microservices, this study proposes a dynamic weight load balancing algorithm based on the smart street lamp cloud platform. The algorithm calculates the respective weight coefficients and the initial weights of each node according to the hardware performance of each server during initialization, and dynamically adjusts the server weights according to the idle rate of CPU(Central Processing Unit) and network bandwidth during the request process to realize load optimization. By setting the minimum threshold and comparing it with the calculated remaining load rate, the weight of the server that reaches the upper limit of the load is set to 0 to prevent the server from being overloaded. The test results show that the proposed algorithm has a better load balancing effect than the minimum number of connections algorithm and the smooth weighted round robin algorithm in the experimental environment. Compared with the dynamic weight algorithm, the average response time and the actual number of concurrent connections of the proposed method are also improved.

Key words: cloud platform, dynamic weight, load balancing, internet of things, microservice, cluster, smart street light, residual load

中图分类号: 

  • TP301.6