0% found this document useful (0 votes)
17 views12 pages

LBA-EC: Load Balancing Algorithm Based On Weighted Bipartite Graph For Edge Computing

The document proposes an algorithm called LBA-EC for load balancing in edge computing environments. It matches tasks to edge servers and then optimally allocates tasks to containers using a weighted bipartite graph and particle swarm optimization to minimize completion time and energy consumption.

Uploaded by

D.M.Kalai Selvi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views12 pages

LBA-EC: Load Balancing Algorithm Based On Weighted Bipartite Graph For Edge Computing

The document proposes an algorithm called LBA-EC for load balancing in edge computing environments. It matches tasks to edge servers and then optimally allocates tasks to containers using a weighted bipartite graph and particle swarm optimization to minimize completion time and energy consumption.

Uploaded by

D.M.Kalai Selvi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Chinese Journal of Electronics

Vol.32, No.2, Mar. 2023

LBA-EC: Load Balancing Algorithm Based on


Weighted Bipartite Graph for Edge Computing
SHAO Sisi1,2, LIU Shangdong1,2,3,4, LI Kui1,2, YOU Shuai1,2, QIU Huajie1,2,
YAO Xiaoliang1,2, and JI Yimu1,2,3,4
(1. School of Computer Science, Nanjing University of Posts and Telecommunications, Nanjing 210023, China)
(2. Institue of High Performance Computing and Bigdata, Nanjing University of Posts and Telecommunications,
Nanjing 210003, China)
(3. Nanjing Center of HPC China, Nanjing 210003, China)
(4. Jiangsu HPC and Intelligent Processing Engineer Research Center, Nanjing 210003, China)

Abstract — Compared with cloud computing envir- growth rate of data is far faster than that of network
onment, edge computing has many choices of service pro- bandwidth. Although the integration of intelligent In-
viders due to different deployment environments. The
ternet of things and cloud computing supports many
flexibility of edge computing makes the environment more
complex. The current edge computing architecture has applications, it is inefficient to move all tasks to cloud
the problems of scattered computing resources and lim- computing in some cases [1]. For example, when the
ited resources of single computing node. When the edge bandwidth is limited and the response time is strict, up-
node carries too many task requests, the makespan of the loading data to the cloud for processing may lead to a
task will be delayed. We propose a load balancing al- longer response time and occupy a large portion of
gorithm based on weighted bipartite graph for edge com-
bandwidth. In this case, edge computing [2], [3] came
puting (LBA-EC), which makes full use of network edge
resources, reduces user delay, and improves user service into being. Edge computing allows data processing at
experience. The algorithm is divided into two phases for the edge of the network and computing near the data
task scheduling. In the first phase, the tasks are matched source to avoid unnecessary data movement [4]. Com-
to different edge servers. In the second phase, the tasks pared with the traditional cloud computing mode, edge
are optimally allocated to different containers in the edge computing can better support mobile computing and
server to execute according to the two indicators of en-
Internet of things applications.
ergy consumption and completion time. The simulations
and experimental results show that our algorithm can ef- Edge computing not only has computing and stor-
fectively map all tasks to available resources with a short- age capacity but also has the advantages of high band-
er completion time. width and low latency [5], which can significantly im-
Key words — Edge computing, Weighted bipartite prove the real-time experience and satisfaction of users.
graph, Load balancing.
However, the resources of edge computing nodes are
scattered, and the computing performance is limited.
Facing the applications that require high computing re-
sources (i.e., multimedia processing, social network and
I. Introduction
natural language processing), edge computing is still
With the continuous development of the Internet limited by resources [6]. When the edge server carries
of things, the number of terminal devices such as smart too many task requests, the response time of some tasks
phones and smart glasses continues to increase. The will be delayed, even longer than that of calling tasks to

Manuscript Received Feb. 3, 2021; Accepted Dec. 4, 2021. This work was supported by the National Key R&D Program of China
(2020YFB2104000, 2020YFB2104002), Natural Science Foundation of the Jiangsu Province (Higher Education Institutions) (BK20170900,
19KJB520046, 20KJA520001), Innovative and Entrepreneurial Talents Projects of Jiangsu Province, Jiangsu Planned Projects for
Postdoctoral Research Funds (2019K024), Six Talent Peak Projects in Jiangsu Province (JY02), Postgraduate Research and Practice
Innovation Program of Jiangsu Province (KYCX19 0921, KYCX19 0906), Open Research Project of Zhejiang Lab (2021KF0AB05), and
NUPT DingShan Scholar Project and NUPTSF (NY219132).
© 2023 Chinese Institute of Electronics. DOI:10.23919/cje.2021.00.289
314 Chinese Journal of Electronics 2023

the remote cloud server. It can be seen that task load tasks is extended, even exceeding the response time of
balancing algorithm and computing offload strategy calling services on the remote cloud server [7]. How to
play an important role in edge computing, which de- effectively solve the problem of task load balancing in
termines the computing efficiency and quality. edge computing environment has become a research
As mentioned above, we design a framework of hotspot. By assigning tasks to different edge data cen-
task load balancing for edge computing, and propose a ters for processing through task scheduling, the edge
task load balancing algorithm based on weighted bi- data center and cloud computing resources can be ef-
partite graph (LBA-EC). The algorithm is divided into fectively utilized, the completion time of applications
two phases: load balancing between edge nodes and can be reduced, and the quality of computing experi-
load balancing between containers. First, the task is ence can be improved. The fundamental purpose of task
mapped to different edge nodes. Second, the tasks are load balancing is to effectively support real-time data.
optimally allocated to different containers in the edge It is necessary to schedule various tasks optimally to
server to execute according to the two indicators of en- meet various SLA parameters, such as response time,
ergy consumption and completion time. The algorithm power consumption, delay, and cost [8]. Many studies
makes full use of network edge resources, reduces user show that the task load balancing problem belongs to
delay, and improves user service experience. The main NP-hard optimization problem. Many heuristic al-
contributions of this work are as follows. gorithms are used to solve the multi-objective optimiza-
1) We design a load balancing framework for edge tion problem, such as particle swarm optimization
computing, which is composed of edge device layer, (PSO) [9], ant colony algorithm (ACO) [10], genetic al-
edge layer and cloud layer. When an edge device sends gorithm (GA), simulated annealing algorithm (SA) [11],
a task request, it can select a nearby edge data center etc. For the task assignment problem in edge comput-
to process the task. ing environment, researchers provide different heuristic
2) The phase of load balancing between edge nodes and meta-heuristic algorithms. Among the heuristic al-
is responsible for matching tasks from edge devices to gorithms, particle swarm optimization is the most
different edge data centers. In this phase, combined widely used. Zhan et al. [12 ] describe the resource
with the queuing theory model, the task scheduling scheduling problem and its solutions, using several nat-
problem is modeled as a dynamic weighted bipartite ural heuristic evolutionary methods (i.e., ant colony al-
graph maximum perfect matching problem. Then the gorithm, genetic algorithm, particle swarm optimiza-
task is matched to different edge data centers by find- tion). Kaur et al. [8 ] use Docker containers instead of
ing the maximum perfect match of the current bipart- traditional virtual machines (VMs) to manage task
ite graph. scheduling and load balancing in a virtualized environ-
3) The phase of load balancing between containers ment, and propose a container-based edge service man-
is responsible for allocating the tasks in the edge data agement system, which reduced bandwidth utilization
center to a specific container for execution. In this and energy consumption. Yang et al. [13] develop differ-
phase, we describe quantitatively the makespan and the ent service load optimization algorithms and service al-
energy consumption of the edge nodes. Then, the location algorithms for different service providers. Guo
particle swarm optimization algorithm is used to find et al. [14] propose a PSO-based task scheduling optimiz-
the optimal value of the objective optimization prob- ation method to minimize the cost. Wan et al. [15] pro-
lem and decide which specific Docker container the task pose an energy aware task scheduling method based on
is allocated to. fog computing to solve the energy consumption prob-
The rest of this paper is structured as follows. Sec- lem of task clusters in the manufacturing industry,
tion II presents existing related works. Section III gives which can achieve load balancing in the multi-task and
the framework of task load balancing for edge comput- multi-objective environments.
ing. Section IV proposes a two-stage load balancing al- Effective load balancing is one of the most com-
gorithm based on bipartite graph. Section V verifies the mon methods to reduce service delay in edge comput-
effectiveness of the algorithm through experiments. Sec- ing, to avoid overload or waste of resources of any edge
tion VI summarizes the research work of this paper and server. In order to shorten the task completion time as
points out our future work. much as possible, Zeng et al. [16] comprehensively con-
sider the load balance between edge devices and edge
II. Related Work servers, the placement of task images, and the balance
Compared with the powerful cloud server, the re- of I/O interrupt requests between storage servers, and
source of edge server is limited. When the edge server propose a solution with high computational efficiency.
carries too many task requests, the makespan of some Souza et al. [17 ] propose a strategy for service alloca-
LBA-EC: Load Balancing Algorithm Based on Weighted Bipartite Graph for Edge Computing 315

tion problem as a multidimensional knapsack problem. In this method, the adaptation problem between cloud
They apply their model to the integration of fog and services and end services is modeled as a bipartite
cloud computing to optimize latency, load, and energy graph matching problem to ensure the minimum global
consumption. Mishra et al. [18] propose a service alloca- average request response time of end service instances
tion framework based on meta-heuristics to adapt to in the adaptation process.
the heterogeneity of resources in the fog computing en- As mentioned above, many researchers have estab-
vironment by analyzing the equipment energy consump- lished different objective functions to reduce various
tion and the maximum task completion time. Liu et al. SLA parameters of services (i.e., response time, service
[19] balance the load according to the queuing time, ex- availability, delay and cost). Each method plays an im-
ecution time and transmission time of tasks, and pro- portant role in a specific edge computing scene. To
pose a one-dimensional search algorithm to find the op- solve the problem of limited resources of edge comput-
timal task scheduling strategy. Li et al. [20 ] propose a ing nodes, we propose a two-phase load balancing al-
two-stage algorithm for computing resource scheduling gorithm based on weighted bipartite graph, which
in edge layer based on task delay constraint and makes full use of network edge resources, reduces the
threshold strategy. makespan of users, and improves the user service exper-
Some researchers have solved the load balancing
ience.
problem by modeling the relationship between comput-
ing nodes and tasks as a weighted bipartite graph. Li et III. Load Balancing Framework for Edge
al. [21 ] propose a task scheduling method based on Computing
cache location for intensive data tasks in edge comput-
ing environment. First, the cache is placed, and then Our proposed load balancing architecture for edge
the data location is used as the weight to establish a computing consists of three layers, namely edge device
weighted bipartite graph to solve the task scheduling layer, edge layer and cloud layer, as shown in Fig.1.
problem. Wang et al. [22 ] propose a dynamic task The edge device layer (including different smart
scheduling algorithm based on weighted bipartite graph devices) sends the tasks to the nearby edge data center.
considering the dynamic characteristics of tasks and The edge data center consists of edge servers. Inside the
computing nodes, which transforms the scheduling edge server is a cluster based on Docker container.
problem into the maximum weighted bipartite graph Compared with the traditional virtual machine cluster,
matching problem. Zhang et al. [23 ] propose a service Docker container has the characteristics of less resource
adaptation method for cloud end dynamic integration. consumption, fast startup, high deployment efficiency

Edge data center 1


Edge devices
Cloud data center
Proxy 1
Local
controller
Proxy 2
Cloud server 1
...

App A App B
Controller
Proxy 3 Bins/Libs Bins/Libs
...

Docker engine
Proxy n Host OS
Server

Cloud server 2
Edge data center n
...

Proxy 1
...

Local
controller
Proxy 2
...

App A App B
Controller
Proxy 3
Cloud server m
Bins/Libs Bins/Libs
Docker engine
...

Proxy n Host OS
Server

Fig. 1. Load balancing architecture for edge computing.


316 Chinese Journal of Electronics 2023

and good scalability. Container can better ensure the and data transmission cost (Cost). The maximum per-
reliability and effectiveness of the flexible supply of fect matching algorithm, i.e., Kuhn-Munkres (KM) al-
cluster resources, so that applications can run almost gorithm in a bipartite graph is optimized to minimize
anywhere in the same way. After receiving the task re- the average response time and energy consumption.
quest, the edge data center selects the appropriate Second, the load balancing phase between contain-
Docker container for processing through the internal ers is performed to determine which Docker container
scheduling algorithm, and finally returns the processing the task will be assigned to process. In this process, we
result to the edge device. The cloud server can provide will first quantitatively describe the makespan and en-
all the services. ergy consumption to keep a balance between them. The
According to the above system architecture, we problem is defined as a bi-objective minimization prob-
have the following assumptions. lem. Then, the feasible solution space of the problem is
1) The edge data center can completely cover the determined according to the particle swarm algorithm
entire network service area of the edge device, so when for fast search. At this point, the Docker container al-
the edge device sends the task request, it can select the location process is over. After getting the specific alloca-
nearby edge data center to process the task. tion result, the cluster schedules the task and allocates
2) For any two edge data centers, network paths the task to a specific container for processing. Finally,
are connecting them. For each edge data center, there is the cluster returns the processed result to the edge
a network path to connect it with the cloud data cen- device.
ter. 1. Load balancing between edge nodes
3) For each task request, if the resources in the In the phase of load balancing between edge nodes,
edge data center are insufficient to process the task, the the task scheduling problem is modeled as a dynamic
task will be sent to the cloud data for processing. weighted bipartite graph maximum perfect matching
4) When the Docker in the edge server receives a problem, and the task in the task queue is modeled
task, it can only process one task at a time. If new tasks with queuing theory model. The load balancing al-
enter the container at this moment, they need to wait gorithm between edge nodes is shown in Fig.2. This sec-
for the previous task to complete. Cloud data center is tion mainly describes the construction of task matching
powerful, so it can perform multiple tasks at the same model based on dynamic weighted bipartite graph, the
time. construction of task queue based on M /M /m/∞, the
calculation of weight between task and edge server, and
IV. Load Balancing Algorithm Based on the maximum weight perfect matching of bipartite
Weighted Bipartite Graph graph. The task matching model based on the dynamic
The proposed load balancing algorithm is based on weighted bipartite graph is dynamic growth, so the
the network architecture designed by Section III, which matching vertex in graph G is deleted after the task is
is divided into two phases: load balancing between edge matched, which means that the vertex is not con-
nodes and load balancing between containers. Among sidered in the next matching. The virtual node is ad-
them, the load balancing between edge nodes is respons- ded to represent the adapted proxy vertex, and the
ible for matching tasks to a specific edge server. The weight between task vertex and virtual node is 0. The
load balancing between containers is responsible for al- construction of task queue based on M /M /m/∞ is to
locating tasks to a specific container. Suppose there are get the optimal task sorting queue into bipartite graph
c edge data centers, which contain m edge servers; In modeling, to reduce the average waiting time of tasks.
addition, there are n tasks waiting to be processed. The weight between task and edge server is obtained by
First, the load balancing phase between edge nodes (sp ), (Sim) and (Cost).
is carried out. After the user publishes the task request, 1) Task matching model based on dynamic
the task will be matched to the appropriate edge server. weighted bipartite graph
In this process, the task matching problem is modeled We assume that the task set is T = {tλ , |λ = 1,
as a dynamic weighted bipartite graph maximum per- 2, . . . , n} and the edge server set is P = {pγ , |γ = 1,
fect matching problem. Combined with the queuing the- 2, . . . , m}, where n ≥ m. We model the matching
ory of multi-server waiting system (M /M /m/∞), the between tasks and edge servers as a dynamic weighted
tasks in the queue are modeled. The average waiting bipartite graph problem. The vertex of one end of bi-
time of the task is minimized, and the optimization al- partite graph is task set T , and the other end is edge
gorithm is used to speed up the convergence speed. The server set P , so weighted bipartite graph G = ⟨V (G),
weight between task and edge server is obtained by task E(G)⟩, where V (G) = T ∪ P , E(G) ={eij , |eij = (tλ , pγ ),
scheduling priority (sp ), task resource similarity (Sim) tλ ∈ T, pγ ∈ P }. To get the best match, weight is ad-
LBA-EC: Load Balancing Algorithm Based on Weighted Bipartite Graph for Edge Computing 317

Edge devices Task Server


t2 10 p4
Task queue
6 Maximum perfect matching
t2 t4 5.6 p1 Task Server
6.2 p1
t4 t3
t1 10.4 p2
tn−1 7 p2
t4
t3 11.5 p3 Matching
8.3 t1 p3
tm
9

...

...

...

...
7.9
t5 tn−1 tn
9.6
...

pn−2 pn−2
10.88
Queue up t2
tn pn−1 pn−1
13.2
tn−2 12 pn

Fig. 2. Load balancing algorithm between edge nodes.


ded between the vertices of bipartite graph. The weight process, the steady state of the queue in any state is as
of each vertex is determined by the priority value of follows:
task scheduling sp , the similarity between task and re-
0 µ1 p1 = λ0 p0
source Sim, and the cost of data transmission Cost.
The specific calculation method of weight is shown in 1 λ0 p0 + µ2 p2 = (λ1 + µ1 )p1
Section IV.1.3). After that, we use the maximum per- 2 λ1 p1 + µ3 p3 = (λ2 + µ2 )p2
fect matching algorithm (KM) to get the maximum ..
.
matching. The number of edge servers can be predicted n λn−1 pn−1 + µn+1 pn+1 = (λn + µn )pn (1)
in advance. However, tasks arrive dynamically, so the
corresponding weighted bipartite graph G grows dy- It can be seen from the above steady-state equa-
namically. In order to get the maximum perfect match tion that
of bipartite graph, we need to satisfy that the number
λ0 p0
of servers in the graph is equal to the number of tasks. 0 p1 =
After the task gets the server matching, it will delete µ1
the matching vertex in graph G, which means that the λ1 λ0
1 p2 = p0
vertex will not be considered in the next matching, and µ1 µ2
the virtual server node will be added to represent the λ2 λ1 λ0
2 p3 = p0
adapted proxy vertex. The weight between task vertex µ1 µ2 µ3
and virtual server node is 0. ..
.
2) Task queue modeling based on M /M /m/∞ λn λn−1 . . . λ0
queuing theory n pn+1 = p0 (2)
µ1 µ2 . . . µn+1
For tasks, its generation follows a negative expo-
λn−1 λn−2 ...λ0
nential distribution with mean value λ, and the pro- Let Cn = µ1 µ2 ...µn , n = 1, 2, 3, . . . , then
cessing time of each task follows a negative exponential
distribution with parameter µ. At time t , the probabil- pn = Cn p0 , n = 1, 2, 3, . . . (3)
ity of system state n is shown by Pn (t). P (t) is the
According to the requirement of probability distri-
probability that the system state is n in steady state. ∑∞ ∑∞
bution: n=0 pn = 1, so [1 + n=1 Cn ]p0 = 1, then
N (T ) is the number of tasks arriving in the period time
[0, t). Suppose there are m edge servers, d = n − |T | rep- 1
p0 = ∑∞ (4)
resents the maximum number of tasks that can be held 1+ Cn
n=1
in the task set, dmax = n. n is the average number of
tasks matching the edge server in the task set, and For m server nodes, record the distribution pn =
pn (n = 0, 1, 2, . . .) is the distribution of the stationary P {N = n} (n = 0, 1, 2, . . . , k) in stationary state,
state of the queuing model. For any state n, the aver-
λn = λ, n = 0, 1, 2, . . . , m (5)
age number of times to enter the state in unit time and
the average number of times to leave the state in unit {
time should be equal, which is called “ birth and death nµ, n = 0, 1, 2, . . . , m
µn = (6)
process.” Therefore, according to the birth and death mµ, n = m, m + 1, . . .
318 Chinese Journal of Electronics 2023
ρ
Let ρ = µλ , because ρm = m = λ
mµ, so when ρm < 1, ObjectiveFunction = min{Wq } (16)
from (3) and (4), we can see that In the PSO algorithm, the fitness function used to
 calculate each particle solution is as follows:
 (λ/µ)n
 , n = 1, 2, . . . , m { }
n! (7) 1∑
Cn = n
 n
 (λ/µ) , n ≥ m Fitness = min W T ti (17)
m!mn−m n i=1

It can be deduced that where W Tti is the average waiting time of the ti task
 n and n is the number of tasks in the queue. When the

 ρ p0 , n = 1, 2, . . . , m PSO algorithm returns the optimal value, we reorder
pn = n! n (8)


ρ
p0 , n ≥ m the task queue according to the value. When there is a
m!mn−m new task to enter the queue, it will first determine
where whether the dynamic bipartite graph has completed a
maximum perfect match. If it is finished, the saturated
[m−1 ]−1
∑ ρn vertices in the bipartite graph will be deleted, and the
ρn
p0 = + (9) top task in the queue will be selected to insert into the
n! m!(1 − ρm )
n=0 bipartite graph. Otherwise, the task will continue to
In the stationary state, if n < m, the new task can wait in the queue. Therefore, the optimized queue can
directly match the dynamic bipartite graph and the maintain a transient stable state in the process of bi-
proxy node without waiting, as shown in (10). partite graph matching.
3) Weight calculation between task and edge server
Pti = 1 (10) In the process of modeling the task matching prob-
lem as the dynamic weighted bipartite graph maximum
Otherwise, if n ≥ m, the new task needs to wait
matching problem, the definition of weight is very im-
after entering the queuing system, as shown in (11).
portant. It determines the advantages and disadvant-

∑ ages of the task allocation algorithm and whether it is
ρm
Pti = pn = p0 (11) effective or not. Here, the weight between task and edge
m!(1 − ρm )
n=s
server is calculated by sp , Sim, and Cost.
Finally, we can get the average queue length Lm, Task scheduling priority value ( sp ) Task
average queue length Lm, average processing time Wm , scheduling priority value sp is determined by the task
and the average waiting time of the task Wq, as shown priority value tpi (where i is the ith task), so spi = tpi.
in (12)–(15). tpi is defined by the user when transferring tasks,
tpi = {b1 , b2 , b3 |b1 < b2 < b3 }.
Lm = Lq + ρ (12) Similarity between task and resource (Sim) A
m
p0 ρ ρm Pt i ρ m task is defined as a row vector tλ = [tcλ , tmλ ], which tcλ
Lq = = (13)
m!(1 − ρm )
2 1 − ρm represents the CPU requirement of the task tλ and tmλ
represents the memory requirement of task tλ. The re-
Lm
Wm = (14) source of edge server is defined as row vector
λ pγ = [pcγ , tmγ ], which pcγ represents the CPU of edge
Lq 1 server and tmγ represents the memory of edge server.
Wq = = Wm − (15)
λe µ So the similarity between tasks and resources is as fol-
lows:
Generally, in the queuing system, the task is
queued according to the first come first served, but this tλ · p γ T
will cause the phenomenon of a long queue. To optim- Sim(tλ , pγ ) = (18)
|tλ ||pγ |
ize the average waiting time and reduce the length of
the task queue, we use PSO algorithm to manage the Data transmission cost ( Cost) The data trans-
task queue. Firstly, the average waiting time of the task mission cost is determined by the network bandwidth
is calculated, then the optimal value returned by PSO and the distance between the task and the edge server,
is the correct order of the task in the queue. The PSO so the data transmission cost is as follows:
algorithm is used to get the optimal queue sequence to
minimize task congestion. Therefore, our goal is to min- Lλ
Costλ,γ = dis (19)
imize the average waiting time, as shown in (16). Band
LBA-EC: Load Balancing Algorithm Based on Weighted Bipartite Graph for Edge Computing 319

where Lλ represents the size of the task, Band repres- Get the unsaturated point of M , Y = {y, y ∈ Ms } , T = Q;
ents the network bandwidth, and dis represents the dis- Initializing the feasible vertex label L in Y according (11);
tance between the task and the edge server. Obtain the equal subgraph EL of G;
So the weight wλ,γ is ∂L − min {L (x) + L (y) − w (xy) |x ∈ X, y ∈ (K − T )} ;
Modify the feasible label of each vertex as
Sim(tλ , pγ ) spλ Costλ,γ 
wλ,γ = a1 · −a2 · − a3 · (20)  l (v) − ∂L , v ∈ S
Sim(tλ , pγ ) spλ Costλ,γ ¯
l (v) = l (v) + ∂L , v ∈ T ;

l (v) , otherwise
where a1, a2 and a3 are the weight coefficients of the Let L = L′ , EL = EL′, give a match M ′ of EL again;
three influence factors, and Sim(tλ , pγ ), sp and Costλ,γ P = (yk ) is the augmented path of M ′ in EL;
are defined as follows: then
M ∗ =M ′ ⊕ P // Execute the Hungarian algorithm until the
 ∑ ∑

 λ γSim(tλ , pγ ) M ∗ of EL is found;

 Sim(tλ , pγ )= W M W = M ∗;

 λ·γ

 ∑ ∑

 Ms = {ms = e.ms, e ∈ W M W } ;
λ γspλ k̄ = {k = e.k, e ∈ W M W } ;
sp = (21)

 λ·γ Ns = {ns = k.sid, k ∈ k̄&e ∈ N S};

 ∑ ∑



 λ γCostλ,γ map (Ms , Ns ) = {ms → ns, ms ∈ Ms , ns ∈ Ns }

Costλ,γ = Ms = Ms − Ms + {m′1 , m′2 , m′3 , . . . , m′c }
λ·γ
k = k − k̄ + {k1′ , k2′ , k3′ , . . . , kc′ }, {k1′ , k2′ , k3′ , . . . , kc′ } ∈ Q
4) Maximum weight perfect matching of bipartite //Update the Ns and k sets so that |Ms | = |k|;
graph map (Ms , Ns )
In our algorithm, we use KM algorithm [23] to get End
the maximum weight perfect match of bipartite graph
and get the best allocation method after getting the So far, the maximum weight perfect matching of
weight according to Section IV.1.3). The main steps of bipartite graph is obtained, that is, the specific match-
the algorithm are as follows: ing scheme of task mapping to edge server is obtained.
a) Select the initial feasible fixed-point label l, de- Algorithm 1 implements the load balancing phase
termine Gl, and select a pair set M in Gl. between edge nodes of the algorithm. The time com-
b) If all the vertices in T are paired by M , then plexity of the KM algorithm is O(n3 ). When a virtual
stop, and M is the most weighted perfect pair set of G; server node is inserted into G, the improved KM al-
Otherwise, take the unpaired vertex u of Gl, let gorithm is only called once, and the waiting time of the
S = {u}, Q = ∅. key node is Wq. Therefore, the time complexity of the
c) If NGl (S) ⊃ Q, go to step d); If NGl (S)=Q , take entire process is O(Wq n3 ), which is O(n3 ).
2. Load balancing between containers
1 minx∈S,y∈Q {l(x) + l(y) − w(xy)}, in which l(v) =
∂ =
 l(v) − ∂1 , v ∈ S Docker container has the characteristics of less re-
l(v) + ∂1 , v ∈ Q , l = ¯l , Gl = Gl̄ , and NGl (S) is the source consumption, fast startup speed, high deploy-

l(v), otherwise ment efficiency and good scalability. It can also ensure
set of adjacent vertices of S in Gl. the reliability and effectiveness of the flexible supply of
cluster resources, so that applications can run in the
Algorithm 1 Load balancing between edge nodes
same way almost anywhere. Compared with virtual ma-
Input: Ms is a server instance, Ns is a task instance, k is the chine (VM), container is a relatively lightweight virtu-
node queue that enters the task instance. alization instance [24]. In a server, there can be many
Output: map (Ms , Ns ) = {ms → ns, ms ∈ Ms , ns ∈ Ns }. containers to manage task scheduling and load balan-
Begin cing in a virtualized environment. Therefore, in terms of
Q′ ← P SO (Q) // Optimize queue sequence; reducing the bandwidth utilization and energy con-
if (Q ̸= θ) sumption, their scheduling and migration are more suit-
Establish a bipartite diagram G (Ms ∪ k, E) for Ms and k able than traditional VMs. As mentioned above, the
according to Section IV.1.1); edge server we use is a cluster based on Docker contain-
calculate ωλ,γ according to (20); er.
initialize matching M ⊆ E (G) In this section, we will discuss the load balancing
if (∃ ms ∈ Ms is saturated and satisfies (10)) phase between containers, which is mainly divided into
{W M W = M ; } the modeling of bi-objective minimization problem and
else the process of container cluster allocation. The bi-ob-
320 Chinese Journal of Electronics 2023

jective minimization problem is modeled by quantitat- energy consumption of an idle state is 60% of that of an
ively describing the makespan and the energy consump- active state. When container cθ is active, the energy
tion to obtain the objective function. In the process of consumed is βθ (Joules/MI); When container cθ is idle,
container cluster allocation and scheduling, a particle the energy consumed is αθ (Joules/MI). Here, βθ = 10−8 ×
swarm optimization algorithm is used to determine the (M IP Sθ )2, αθ = 0.6×βθ Joules/MI. The task size is Lλ ,
feasible solution space of the above modeling problem. and the data processing speed is Vλ , so the task calcula-
The particle swarm algorithm performs a fast search to tion time is CTλ = L Vλ , and each task will correspond to
λ

obtain the approximate optimal value. Finally, the con- a calculation time, so we put it into the ET C matrix,
tainer cluster schedules the tasks according to the res- and the matrix elements are represented by ET Cλ,θ. As
ults, assigns the tasks to a specific container for pro- shown in (26).
cessing, and returns the processed results to the edge
devices. Lλ
ET C λ,θ = CTλ = (26)
1) Modeling of bi-objective optimization problem Vλ
In the process of load balancing of edge nodes,
tasks are matched to each edge server. Then the al- Set χλθ to indicate whether task tλ is executed in
gorithm executes the task allocation process of the con- container cθ. If χλθ =1, task tλ is executed in container
tainer cluster to determine which specific Docker con- cθ; If χλθ =0, it means that task tλ is not executed in
tainer to assign the task to for processing. Suppose a container cθ. So the total service time of cθ is
container set is C = {cθ , |θ = 1, 2, . . . , s}. In this pro- ∑
n
cess, the system first describes the problem quantitat- ETθ = χλθ × ET Cλ,θ (27)
ively according to the makespan and the energy con- λ=1
sumption, and defines the problem as a bi-objective
minimization problem. So the energy consumption of container cθ is
The makespan of a task represents the time re-
E(cθ ) = [ETθ ×βθ +(Makespan−ETθ )]×MIPSθ (28)
quired in the whole process from task input to result
output, so the makespan is mainly determined by task The total energy consumption is
calculation time, task waiting time and task transmis-
sion time. The calculation time CTλ of the task is de- ∑
s

termined by the size of the task and the processing E= E(cθ ) (29)
θ=i
speed, as shown in (22).

Lλ Therefore, the objective function of task allocation


CTλ = (22) optimization among containers is as follows:

where Lλ is the size of the task (in millions of instruc- Min : ΦLoad = λ1 · Makespan + λ2 · E (30)
tions (MI)) and Vλ is the processing speed of the task.
The task waiting time Waitλ is the average waiting where λ1 and λ2 are the weight coefficients between
time W Tti of the task matching phase with the edge Makespan and E . Here, we set λ1 =λ2 =0.5.
server and the service delay Delayλ of the Docker con- 2) Container cluster allocation process
tainer allocation phase, as shown in the (23). After the objective function is obtained, the feas-
ible solution space of the problem is determined accord-
Waitλ = W Tti + Delayλ (23) ing to the PSO algorithm. The PSO algorithm will find
the optimal value of the dual-objective optimization
Task transmission time Tλ is determined by task
problem to complete the final task assignment. PSO al-
size Lλ and network bandwidth, as follows:
gorithm is simple to implement, high efficiency, and few
Lλ parameters. Especially the algorithm with natural real
Tλ = (24)
Band number coding characteristics is more suitable for real-
time optimization problems. The notations and defini-
So the makespan is tions are shown in Table 1.
Makespan = CTλ + Waitλ + Tλ (25) According to the basic formula of PSO algorithm,
we can get the following results:
Energy consumption represents the energy con-
sumed by the edge server. The edge server has two Vik+1 = ω(k)Vik +c1 r1 (Pbest.i
k
− Xik )+c2 r2 (Pglobal,i
k
−Xik )
states: idle state and active state. It is assumed that the (31)
LBA-EC: Load Balancing Algorithm Based on Weighted Bipartite Graph for Edge Computing 321

Xik+1 = Xik + Vik+1 (32) do


for i ← 1 to m //update the position of particle;
Table 1. Notations and definitions of particle swarm //achieve the previous best position of particle;
optimization for j ← 0 to n
Notartions Definitions //ΦLoad is calculated according to the public (30);
( )
cθ Number of containers if(ΦLoad Xij ≤ ΦLoad (Pbest,i ))then
m Number of particles // update the best position for particle;
Xi The position of particle i
Pbest,i = Xij ;
Vi The velocity of particle i
end if
ω Inertia weight ω ∈ [0, 1]
Random number η ∈ [k, kmax ] end for
η
c1 , c 2 Acceleration coefficient equal to 2 if (ΦLoad (Pglobal ) ≤ ΦLoad (Pbest,i )) then
r1 , r2 Pseudo random number r1 , r2 ∈ [0, 1] Pglobal = Pbest,i //achieve the best neighbor particle
Pbest,i The best place in history for particle i end if
Pglobal,i The best position for all particles Vik+1
Xik+1 = Xik + Vik+1
In (31), ω is an important parameter in PSO al- k++
gorithm. It balances the global or local search ability of //the terminal condition
particles. Setting a higher ω will promote global search, while (ΦLoad (Xbest ) ≤ ξ or k ≥ λ)
and a lower ω will promote fast read local search. end while
Therefore, to avoid premature convergence of particles,
we use the exponential decreasing weight formula [25]
to improve the global search ability and search accur- V. Experimental and Performance
acy of particle swarm optimization algorithm. The ex- Evaluation
ponential decreasing weight formula is shown in (33). 1. Experimental environment
When the maximum number of iterations or minimum 1) Edge server
load balancing is achieved, the optimal particle posi- Each edge data center uses four edge servers to
tion can be determined. build a container cluster. In this cluster, there are one
[ ] master node and three slave nodes. The specific config-
k2
ω(k) = (ωmax − ωmin )exp − + ωmin (33) uration information of each server node is shown in
ηkmax
Table 2.
At this point, the Docker container allocation pro-
Table 2. Calculate node configuration information
cess is finished. After getting the specific allocation res-
CPU Intel E5-2680 @2.80 GHz
ult, the cluster schedules the task to a specific contain-
Memory 4 GB
er for processing, and returns the processed result to the
Disk 6300 GB
edge device. The container cluster is responsible for op- OS CentOS 6.5
timally assigning tasks to different containers with min- JVM version Java 1.8.0
imum energy consumption and makespan. Algorithm 2 Docker version Docker 1.5
implements the load balancing phase between the con-
tainers of the algorithm. The input of the algorithm has 2) Network environment
n task requests and θ Docker containers. Therefore, the The edge servers in the edge data center are con-
time complexity of Algorithm 2 is O(θ × n). nected through 56 Gbps high-speed switch, and the
edge servers and external devices are connected through
Algorithm 2 Load balancing between containers the Gigabit Ethernet switch of TP-Link.
Input: λ is the number of iterations, ξ is the minimum bal- 3) Dataset
ance difference, ETC matrix Since there is no standard experimental platform
Output:Allocation result of services to Dockers. and test data set, we generate the experimental data
Begin asynchronously. We assume that the number of incom-
initialization // initialized particle; ing task requests per time unit is fixed, and the num-
for i ← 1 to m ber of available edge servers per request ranges from 2
for j ← 1 to n to 8. Three positive integers are assigned to each task,
0
Xi,j = θΓi (mj ) which are task priority value, task data size and task
end for location. Each task needs three kinds of CPU or
end for memory resources, and the number of each resource is
322 Chinese Journal of Electronics 2023

randomly generated in (2, 5). Each edge server has three Table 3. Parameter setting
kinds of resources, and the available quantity range of Setting 1 2
each resource is 5–10. The processing speed of each edge Number of task requests 60–100 60
server task is randomly generated from 1–5, and the Number of edge servers 5 5–9
data transmission speed between each edge server and
the cloud is 1. The impact of the number of task requests on re-
2. Experiment and analysis sponse time. We set the experimental parameters ac-
1) Response time cording to setting 1 in Table 3, and analyze the impact
We analyze the effect of different parameters on of different task requests per unit time on the response
the task response time. We set two groups of paramet- time of five scheduling algorithms. The results are
ers, which are the number of task requests per unit time shown in Table 4. From the table, we can see that with
and the number of edge servers, as shown in Table 3. In the increase of the number of task requests, the re-
each group, only one parameter changes and the other sponse times of the five scheduling algorithms are in-
remains unchanged. All experiments were repeated 20 creasing. This is because when other parameters are
times and the average value was used as the result. In fixed, with the increase of task requests, more tasks are
addition, we compare the proposed algorithm with assigned to the edge server, which increases the load of
baseline algorithms FCFS, Min-Min and Max-min. The the edge server. As a result, the waiting time of the
number of iterations is set to 1000. task increases and the response time increases.

Table 4. The impact of different number of task requests on response time (ms)
Method 60 70 80 90 100
LBA-EC 26.29 30.14 34.98 38.22 43.16
FCFS 42.38 43.31 47.11 54.98 58
Min-Min 41.97 43.42 49.58 58.95 63.75
Max-Min 46.21 46.14 50.97 60.28 64.71

The impact of the number of edge servers on re- As can be seen from Table 5 , with the increase of
sponse time. We set the experimental parameters ac- edge servers, the response time is decreasing. This is be-
cording to setting 2 in Table 3 , and analyze the influ- cause, with other parameters unchanged, the increase of
ence of a different number of edge servers on the re- edge servers can make more servers process task re-
sponse time of five scheduling algorithms. The results quests, shorten the waiting time of tasks, and further
are shown in Table 5. reduce the response time of tasks.

Table 5. The impact of different number of edge servers on response time (ms)
Method 5 6 7 58 9
LBA-EC 26.29 19.49 17.62 14.90 14.94
FCFS 42.38 41.16 37.26 33.96 25.19
Min-Min 41.97 44.13 39.25 43.79 25.97
Max-Min 46.21 45.13 40.30 35.91 26.57

2) Efficiency evaluation task requests increases, the time for particles to find the
In this part, we conduct two groups of experi- optimal solution becomes longer. However, compared
ments to test the scalability of our proposed algorithm. with FCFS algorithm, the execution time of LBA-EC
Similarly, we analyze the effect of the number of task will be longer. There are two main reasons for this. The
requests and the number of edge servers on the effi- first is that the algorithm proposed in this paper adds
ciency of the algorithm. load balancing operations between the proxy and the
Figs.3 and 4 show the change of execution time of edge server before the load balancing between the con-
our algorithm with the number of task requests and the tainers. Then the particle swarm algorithm needs to go
number of edge servers, respectively. Among them, blue through multiple iterations to converge to the minim-
represents LBA-EC algorithm and red represents FCFS um and complete the scheduling between tasks and vir-
algorithm. As can be seen from Fig.3, as the number of tual machines. As can be seen from Fig.4, with the in-
task requests increases, the execution time of our al- crease of the number of edge servers, the execution time
gorithm also increases. This is because as the number of of LBA-EC increases slightly. This is because the in-
LBA-EC: Load Balancing Algorithm Based on Weighted Bipartite Graph for Edge Computing 323

crease of edge servers makes the algorithm schedule for Compared with other baseline load balancing al-
more edge servers in the scheduling process. Since the gorithms, our proposed load balancing algorithm for
number of edge servers can not affect the iteration of edge computing has improved the response time.
the algorithm, the execution time of the algorithm will However, because the algorithm increases the load bal-
not increase sharply. ancing operation between tasks and edge servers before
the load balancing between containers, the algorithm ef-
Our algorithm ficiency is lower than other algorithms. In the follow-up
Algorithm execution time (ms)

1600 FCFS
study, we can further consider improving the efficiency
1400
of the algorithm.
1200
1000
800 References
600 [1] H. Wang, J. Gong, Y. Zhuang, et al. “ Task scheduling for
400 edge computing with health emergency and human behavi-
200 or consideration in smart homes,” in Proceedings of 2017
0 IEEE International Conference on Big Data, Boston, MA,
60 70 80 90 100 USA, pp.1213–1222, 2017.
Number of task requests
[2] W. Shi and S. Dustdar, “ The promise of edge computing,”
Fig. 3. The impact of task request number on algorithm ex- Computer, vol.49, no.5, pp.78–81, 2016.
ecution time. [3] C. M. Fernández, M. D. Rodríguez, and B. R. Muo, “An
edge computing architecture in the Internet of things,” in
Proceedings of 2018 IEEE 21st International Symposium
600 Our algorithm on Real-Time Distributed Computing, Singapore, pp.99–
Algorithm execution time (ms)

FCFS
500 102, 2018.
[4] G. Li, Y. Yao, J. Wu, et al., “A new load balancing strategy
400 by task allocation in edge computing based on intermediary
nodes,” EURASIP Journal on Wireless Communications
300
and Networking, vol.2020, no.1, pp.1–10, 2020.
200 [5] W. Liu, Y. C. Huang, W. Du, et al., “Resource-constrained
serial task offload strategy in mobile edge computing,”
100 Journal of Software, vol.31, no.6, pp.1889–1908, 2020.
0 [6] H. Lu, C. Gu, F. Luo, et al., “ Optimization of lightweight
5 6 7 8 9 task offloading strategy for mobile edge computing based on
Number of edge servers deep reinforcement learning,” Future Generation Computer
Fig. 4. The impact of edge server number on algorithm exe- Systems, vol.102, pp.847–861, 2020.
cution time. [7] H. Wu, S. Deng, W. Li, et al. “Request dispatching for min-
imizing service response time in edge cloud systems,” in
Proceedings of 2018 27th International Conference on
VI. Conclusions and Future Work Computer Communication and Networks, Hangzhou, China,
pp.1–9, 2018.
In this paper, we propose a load balancing al- [8] K. Kaur, T. Dhand, N. Kumar, et al., “Container-as-a-ser-
gorithm based on weighted bipartite graph for edge vice at the edge: Trade-off between energy efficiency and
computing (LBA-EC). The algorithm is divided into service availability at fog nano data centers,” IEEE Wire-
two phases: load balancing between edge nodes and less Communications, vol.24, no.3, pp.48–56, 2017.
load balancing between containers. In the first phase, [9] H. Ishibuchi, T. Yoshida, and T. Murata, “Balance between
the tasks are matched to different edge servers. In the genetic search and local search in memetic algorithms for
multiobjective permutation flowshop scheduling,” IEEE
second phase, the tasks are optimally allocated to differ-
Transactions on Evolutionary Computation, vol.7, no.2,
ent containers in the edge server according to the two pp.204–223, 2003.
indicators of energy consumption and completion time. [10] M. Dorigo, M. Birattari, and T. Stutzle, “Ant colony optim-
It makes full use of network edge resources, reduces ization,” IEEE Computational Intelligence Magazine , vol.1,
user delay, and improves user service experience. We no.4, pp.28–39, 2006.
conducted experiments on the algorithm and analyzed [11] M. Dai, D. Tang, A. Giret, et al., “Energy-efficient schedul-
ing for a flexible flow shop using an improved genetic-simu-
the impact of task response time and algorithm execu-
lated annealing algorithm,” Robotics and Computer-Integ-
tion time under different number of task requests and
rated Manufacturing, vol.29, no.5, pp.418–429, 2013.
edge servers. The experimental result show that our al- [12] Z. H. Zhan, X. F. Liu, Y. J. Gong, et al., “ Cloud comput-
gorithm can effectively map all tasks to available re- ing resource scheduling and a survey of its evolutionary ap-
sources with a shorter completion time. proaches,” ACM Computing Surveys (CSUR), vol.47, no.4,
324 Chinese Journal of Electronics 2023

pp.1–33, 2015. LIU Shangdong was born in


[13] L. Yang, J. Cao, G. Liang, et al., “Cost aware service place- 1979. He received Ph.D. degree in South-
ment and load dispatching in mobile cloud systems,” IEEE east University. He is a Lecturer at the
School of Computer, Nanjing University
Transactions on Computers, vol.65, no.5, pp.1440–1452,
of Posts and Telecommunications. His
2015.
main research interests include network
[14] L. Guo, S. Zhao, S. Shen, et al., “Task scheduling optimiza- behavior analysis, big data, and AI.
tion in cloud computing based on heuristic algorithm,” (Email: [email protected])
Journal of Networks, vol.7, no.3, article no.547, 2012.
[15] J. Wan, B. Chen, S. Wang, et al., “ Fog computing for en-
ergy-aware load balancing and scheduling in smart factory,”
IEEE Transactions on Industrial Informatics, vol.14, no.10, LI Kui was born in 1988. He is a
pp.4548–4556, 2018. Ph.D. candidate at the School of Inter-
net of Things, Nanjing University of
[16] D. Zeng, L. Gu, S. Guo, et al., “ Joint optimization of task
Posts and Telecommunications. His re-
scheduling and image placement in fog computing suppor-
search interests include high perform-
ted software-defined embedded system,” IEEE Transac-
ance computing, big data theory and
tions on Computers, vol.65, no.12, pp.3702–3712, 2016. technology. (Email: [email protected])
[17] V. B. Souza, X. Masip-Bruin, E. Marín-Tordera, et al., “To-
wards distributed service allocation in fog-to-cloud (f2c)
scenarios,” in Proceedings of 2016 IEEE Global Communic-
ations Conference, Washington, DC, USA, pp.1–6, 2016.
[18] S. K. Mishra, D. Puthal, J. J. P. C. Rodrigues, et al., “Sus- YOU Shuai was born in 1995.
tainable service allocation using a metaheuristic technique He is a Ph.D. candidate at the School of
Internet of Things, Nanjing University of
in a fog server for industrial applications,” IEEE Transac-
Posts and Telecommunications. His re-
tions on Industrial Informatics, vol.14, no.10, pp.4497–4506,
search interests include machine learing,
2018. CV, and edge computing.
[19] J. Liu, Y. Mao, J. Zhang, et al., “ Delay-optimal computa- (Email:[email protected])
tion task scheduling for mobile-edge computing systems,” in
Proceedings of 2016 IEEE International Symposium on In-
formation Theory, Barcelona, Spain, pp.1451–1455, 2016.
[20] X. Li, J. Wan, H. N. Dai, et al., “A hybrid computing solu-
tion and resource scheduling strategy for edge computing in QIU Huajie was born in 1997.
smart manufacturing,” IEEE Transactions on Industrial In- He is an M.S. candidate at the School of
Computer, Nanjing University of Posts
formatics, vol.15, no.7, pp.4225–4234, 2019.
and Telecommunications. His research in-
[21] C. Li, J. Tang, H. Tang, et al., “Collaborative cache alloca-
terests include cloud computing, cloud
tion and task scheduling for data-intensive applications in task scheduling, and reinforcement learn-
edge computing environment,” Future Generation Com- ing. (Email: [email protected])
puter Systems, vol.95, pp.249–264, 2019.
[22] T. Wang, X. Wei, Y. Liang, et al., “Dynamic tasks schedul-
ing based on weighted bi-graph in mobile cloud computing,”
Sustainable Computing: Informatics and Systems, vol.19,
pp.214–222, 2018. YAO Xiaoliang was born in
1999. He is an M.S. candidate at the
[23] S. L. Zhang, C. Liu, Y. B. Han, et al., “DANCE: A service
School of Computer, Nanjing University
adaptation method for cloud-end dynamic integration,”
of Posts and Telecommunications. His
Chinese Journal of Computers, vol.43, no.3, pp.423–439,
main research interests include AI.
2020. (in Chinese) (Email: [email protected])
[24] C. Pahl, “ Containerization and the paas cloud,” IEEE
Cloud Computing, vol.2, no.3, pp.24–31, 2015.
[25] D. Bernstein, “Containers and cloud: From LXC to Docker
to kubernetes,” IEEE Cloud Computing , vol.1, no.3, pp.81–
84, 2014.
JI Yimu (corresponding author)
SHAO Sisi was born in 1997. was born in 1978. He is a Professor at the
She is a Ph.D. candidate at the School of School of Computer, Nanjing University
Internet of Things, Nanjing University of of Posts and Telecommunications. His
Posts and Telecommunications. Her main main research interests include the secur-
research interests include cloud comput- ity and applications in cloud computing,
ing, edge computing task scheduling and bigdata, IoT, and AI.
security. (Email: [email protected]) (Email: [email protected])

You might also like