Design and Analysis of Real-Time Task Scheduling Algorithm for Fog-Cloud Computing

Click the blue text to follow us

Real-Time Task Scheduling for Fog-Cloud Computing

Algorithm Design and Analysis

Design and analysis of real-time

task scheduling algorithm

for fog-cloud computing

Author Affiliation

ZHANG Yannian, WU Hao, ZHANG Yun

College of Electronic and Information

Engineering, Nanjing Vocational

Institute of Transport Technology,

Nanjing 211188, China

Author Introduction:

ZHANG Yannian (1977—), male, from Liaocheng, Shandong, Master, Associate Professor, research direction includes big data and artificial intelligence.

Below is the structure of this article

Design and Analysis of Real-Time Task Scheduling Algorithm for Fog-Cloud Computing
Design and Analysis of Real-Time Task Scheduling Algorithm for Fog-Cloud Computing

Click the image to view the full size

Abstract

Compared with cloud computing, fog computing satisfies the delay and response time requirements by shifting the computing, storage and networking services closer to Internet of Things devices. Therefore, fuzzy logic-based real-time task scheduling (FLTS) is proposed in this paper. In FLTS, the tasks between the fog and cloud layers are distributed. Then, FLTS selects appropriate virtual machines to execute the submitted tasks in fog layer by exploiting computation, storage and bandwidth of the task, and their deadline and data size. Simulation experiments demonstrate the efficacy of the proposed algorithm and its superior performance as compared to other existing algorithms in terms of success ratio of the tasks, completion time and average turnaround time.

Keywords: cloud computing; fog computing; fuzzy logic;

task scheduling; virtual machine

Key words: cloud computing;

fog computing; fuzzy logic;

task scheduling; virtual machine

Proceed to the full text reading

Since cloud computing platforms have powerful computing and data storage capabilities, they are widely used in the Internet of Things. However, as IoT services continue to expand, some IoT services have stringent latency requirements. Due to the long latency in communication between cloud data centers and IoT devices, cloud computing is no longer suitable for latency-sensitive IoT services.

Compared to cloud computing, fog computing resources are closer to terminal devices, which can reduce latency and improve service quality. However, the resources of the fog computing platform are limited and cannot process the large amounts of data generated by IoT devices. Therefore, effectively allocating tasks to cloud servers or fog servers for processing can meet the latency requirements of the tasks.

For the task scheduling problem, researchers have proposed scheduling algorithms based on different performance metrics, such as task execution time and deadline, task length, task security, etc. However, these scheduling algorithms do not adequately consider the resources required for executing tasks, and it is also difficult to accurately estimate the resources required for executing the task at the task submission stage.

Additionally, fuzzy logic algorithms can effectively allocate resources between fog and cloud computing and reasonably assign tasks to them, thereby reducing task latency, which is the main focus of this research. Due to the low complexity of fuzzy logic algorithms and their low requirements for computer processing power, they have been widely used in various fields.

However, due to the variability of task characteristics and the dynamics of the fog-cloud environment, scheduling tasks still faces challenges. Moreover, the diverse requirements of tasks and the varying resources available at fog nodes also affect the processing time of tasks. Therefore, how to allocate suitable tasks to nodes in the fog layer is crucial.

Research has confirmed that effectively selecting virtual machines (VMs) for tasks in a fog computing environment can improve task execution efficiency. Additionally, based on the resource requirements and acceptable latency, fog brokers (FBs) can manage resources and allocate tasks.

Literature proposed a three-way clustering optimal scheduling programming (TWOCP) algorithm, which clusters tasks using a three-way clustering algorithm and prioritizes scheduling core tasks of the cluster to reduce task completion time. However, this algorithm only focuses on task completion time and does not consider the correlation between tasks and service quality. Similarly, literature also proposed a task clustering algorithm based on three-way clustering, but this algorithm only emphasizes resource utilization and does not consider task completion time.

Literature proposed an improved particle swarm optimization (IPSO) algorithm for task scheduling, which decomposes tasks to reduce the continuous working time on each virtual machine. Although the IPSO algorithm can shorten completion time, it increases operational costs and energy consumption.

Based on the above research, this paper adopts a communication framework that combines fog and cloud layers. Compared to the cloud layer, the fog layer is closer to users. Therefore, executing some tasks in the fog-cloud can reduce task completion time. To this end, a fuzzy logic-based real-time task scheduling (FLTS) algorithm is proposed for the fog-cloud environment. The FLTS algorithm schedules tasks by considering the deadline, resource requirements of tasks, and resources accessible to fog nodes along with load information. The main work of this paper includes: ① proposing a fuzzy logic-based decision algorithm for the fog-cloud framework, thereby allocating tasks between the fog and cloud layers; ② adopting an improved task scheduling strategy to schedule tasks for heterogeneous fog nodes; ③ finally establishing a simulation system to analyze the performance of the algorithm.

1 System Model and Problem Description

1.1 Fog-Cloud Computing Architecture

Consider the three-layer fog-cloud computing network architecture shown in Figure 1. The bottom layer consists of terminal devices; the fog layer consists of fog brokers (FBs), fog servers, and virtual machines (VMs); the top layer is the cloud data center. IoT devices submit tasks to the fog layer; fog layer servers forward the received tasks to FB. FB manages the resources of fog servers and schedules tasks.

Design and Analysis of Real-Time Task Scheduling Algorithm for Fog-Cloud Computing

Figure 1 Fog-Cloud Computing Network Architecture

Since FBs are closer to fog servers, their communication latency is shorter. FB allocates tasks to the fog and cloud layers and selects suitable nodes to execute the assigned tasks.

Assuming the tasks received by the fog layer are independent. Let

Design and Analysis of Real-Time Task Scheduling Algorithm for Fog-Cloud Computing

represent the task set received by FB. Let ti=(tid, in, ds, rs, dl, ct, st, bt) represent the ith task, where tid represents the task ID; in represents the instruction count; ds represents the data size of the task; rs represents the data size of the task result; dl represents the deadline of the task; ct, st, and bt represent the CPU rate, storage space, and bandwidth required to process the task, respectively.

Each fog server has multiple heterogeneous VMs and utilizes these VMs to execute tasks. Let V represent the set of all VMs in the fog layer. Let vj=(vid, type, mc, cc, sc, bc) represent the jth VM, where vid represents the VM ID; type represents the VM type; mc, cc, sc, and bc represent the memory, CPU rate, storage space, and bandwidth of the VM, respectively.

1.2 Problem Description

The purpose of the proposed FLTS algorithm is to minimize the total latency of processing task ti. Let Tproc(ti) represent the total latency of processing task ti:

Design and Analysis of Real-Time Task Scheduling Algorithm for Fog-Cloud Computing

Where: if the fog layer (or cloud layer) executes the task, then Ttrans(ti) represents the transmission latency incurred when forwarding the task from the device to the fog layer (or cloud layer). The value of Ttrans(ti) is calculated using the ratio of the task’s data size ds to the data transmission rate. Texec(ti) represents the time consumed by the selected VM to execute the task (execution time); Tqueue(ti) represents the waiting time incurred when accessing the VM; Trep(ti) represents the time required for the terminal device to obtain the processing result, which is equal to the ratio of the result size rs to the transmission rate. Furthermore, the total latency Tproc(ti) for processing task ti should be less than dl(ti).

Once a task is received, FB decides whether to execute the task in the fog layer or forward it to the cloud layer for execution. If executed in the fog layer, FB assigns the task to an appropriate VM. To this end, a mapping function is constructed:

Design and Analysis of Real-Time Task Scheduling Algorithm for Fog-Cloud Computing

Where: Cloud represents the cloud layer; Fog represents the fog layer.

Then, an optimization problem is constructed to select a VM from the fog layer:

Design and Analysis of Real-Time Task Scheduling Algorithm for Fog-Cloud Computing

Where: g(ti, vj) represents the turnaround time for directing task ti to VM vj.

2 FLTS Algorithm

FLTS algorithm consists of two phases: the first phase involves using fuzzy logic to allocate tasks between the fog and cloud layers (task scheduling); the second phase involves selecting the optimal VM to execute the task (task execution).

2.1 Fuzzy Logic-Based Task Scheduling

When scheduling tasks, consider four factors: the resource requirements of the task, the latency requirements of the task, the maximum resource rate accessible in the fog layer, and the latency between the fog and cloud layers. To this end, if task ti is allocated to the fog layer, the required CPU utilization rate, storage space utilization rate, and bandwidth utilization rate for executing the task are calculated as normalized values, defined as in Equation (4):

Design and Analysis of Real-Time Task Scheduling Algorithm for Fog-Cloud Computing

The CPU utilization rate, storage space utilization rate, bandwidth utilization rate, task deadline, and network latency are used as inputs to the fuzzy logic system. The output of the fuzzy logic system is the decision opinion. Let the Boolean variable Ddecision represent the decision opinion. If Ddecision=1, it indicates that task ti is executed by the cloud layer; if Ddecision=0, it indicates that task ti is executed by the fog layer, as shown in Figure 2.

Design and Analysis of Real-Time Task Scheduling Algorithm for Fog-Cloud Computing

Figure 2 Fuzzy Logic-Based Task Scheduling Framework

Using the membership functions shown in Figure 3, the CPU utilization rate, storage space utilization rate, bandwidth utilization rate, task deadline, and network latency are fuzzified to form a fuzzy logic set, as shown in Table 1. For example, the normalized value of CPU utilization rate cmin(ti) is fuzzified into three levels {Low, Medium, High}. Additionally, the output variable is fuzzified into two levels {Fog Layer, Cloud Layer}.

Design and Analysis of Real-Time Task Scheduling Algorithm for Fog-Cloud Computing

Figure 3 Membership Functions of Five Input Variables

Design and Analysis of Real-Time Task Scheduling Algorithm for Fog-Cloud Computing

The fuzzy logic system adopts the rule base shown in Table 2 to generate output variables. Since there are 243 rules in total, only a portion of the rules is listed in Table 2.

Design and Analysis of Real-Time Task Scheduling Algorithm for Fog-Cloud Computing

2.2 Task Execution

Section 2.1 generates the value of Ddecision. Ddecision=1 indicates that task ti is executed by the cloud layer; Ddecision=0 indicates that task ti is executed by the fog layer. Once task ti is executed by the fog layer, it is added to the fog queue (fog queue, FQ). The tasks in queue FQ are then sorted in ascending order based on their deadlines dl(ti), prioritizing tasks with earlier deadlines. In other words, urgent tasks are given priority.

Algorithm 1: Constructing Available VM Set V and Task Execution:

Design and Analysis of Real-Time Task Scheduling Algorithm for Fog-Cloud Computing

Then, by confirming the availability of each VM, an available VM set is constructed. Let V’ represent the available VM set. Initially, V’ is empty, i.e., V’=∅. The process of constructing V’ is shown in Algorithm 1. First, the CPU rate ct(ti), storage space st(ti), and bandwidth bt(ti) required by the task are compared with the available CPU rate cc(vj), storage space sc(vj), and bandwidth bc(vj) of the virtual machine. If ct(ti) is less than cc(vj), and st(ti) is less than sc(vj), and bt(ti) is less than bc(vj), then vj is added to V’.

After constructing V’, the resource utilization rates of each VM in V’ are calculated, as shown in Equation (5).

Design and Analysis of Real-Time Task Scheduling Algorithm for Fog-Cloud Computing

In the fourth step, select the VM with the lowest resource utilization rate from V’ and assign that VM to task ti:

Design and Analysis of Real-Time Task Scheduling Algorithm for Fog-Cloud Computing

In the fifth step, transfer task ti to v’. If v’ is busy, insert task ti into the queue and wait for processing; otherwise, process the task directly, as shown in Algorithm 1.

3 Simulation and Performance Analysis

3.1 Simulation Environment

The experiments were simulated on a PC with Windows 7 operating system, 8 GB RAM, and Core i7 CPU. The iFogSim software was used to construct the cloud simulation framework. The resource configuration of the fog-cloud architecture is shown in Table 3. Additionally, fuzzy logic was used to implement the fuzzy logic strategy. The transmission delay between the fog and cloud layers was randomly generated between 300 and 800 ms.

Design and Analysis of Real-Time Task Scheduling Algorithm for Fog-Cloud Computing

Table 4 presents the task characteristic parameters in the simulation, including instruction count, deadline, required storage space, and bandwidth.

Design and Analysis of Real-Time Task Scheduling Algorithm for Fog-Cloud Computing

3.2 Performance Metrics

To thoroughly analyze the performance of the FLTS algorithm, completion time (Makespan), latency rate, and success rate were selected as performance metrics.

Completion time refers to the total time required to complete all tasks, defined as in Equation (7):

Design and Analysis of Real-Time Task Scheduling Algorithm for Fog-Cloud Computing

Where: N represents the number of tasks; K represents the total number of virtual machines in the system.

Latency rate refers to the ratio of the actual latency incurred in executing tasks to the expected latency for executing those tasks. The expected latency refers to the minimum time required for processing the task. The definition of latency rate is as shown in Equation (8):

Design and Analysis of Real-Time Task Scheduling Algorithm for Fog-Cloud Computing

Where: ∑turnRound represents the latency incurred in executing tasks; ∑length represents the expected latency for executing tasks.

Success rate refers to the ratio of the number of tasks completed within the deadline to the total number of tasks.

3.3 Performance Analysis

Literature proposed real-time task processing (RTTP) algorithm, TWOCP algorithm, and IPSO algorithm as references for performance comparison analysis, considering the impact of task count and virtual machine count on the performance of each scheduling algorithm.

3.3.1 Impact of Task Count on Performance

First, the impact of task count on completion time, latency rate, success rate, and average turnaround time was analyzed, with task counts varying from 27 to 510, while the number of virtual machines was fixed at 12.

The variation of completion time with task count is shown in Figure 4. It can be seen that completion time increases with the number of tasks. This is expected: the more tasks there are, the heavier the processing load, requiring more resources, thereby increasing the time consumed in processing tasks. Compared to RTTP, IPSO, and TWOCP algorithms, the FLTS algorithm shortened completion time. This is attributed to the FLTS algorithm selecting the least loaded virtual machine in the fog layer to execute tasks, thus reducing the latency for processing tasks.

Design and Analysis of Real-Time Task Scheduling Algorithm for Fog-Cloud Computing

Figure 4 Variation of Completion Time with Task Count

Figure 5 shows the variation of latency rate with task count. It can be seen that the latency rates of TWOCP, IPSO, RTTP, and FLTS algorithms all increase with the number of tasks, but the rate of increase varies. Compared to TWOCP, IPSO, and RTTP algorithms, the FLTS algorithm controlled the rate of increase of latency as the number of tasks increased. In heavier task environments (task counts of 300 and 500), the latency rate of the FLTS algorithm is much lower than that of TWOCP, IPSO, and RTTP algorithms.

Design and Analysis of Real-Time Task Scheduling Algorithm for Fog-Cloud Computing

Figure 5 Variation of Latency Rate with Task Count

Figure 6 presents the success rates of FLTS algorithm, RTTP, and IPSO, TWOCP algorithms. It can be seen that the success rate decreases with the increase in task count. The reason is that as the number of tasks increases, the system load becomes heavier, resource competition intensifies, reducing the number of tasks successfully completed within the deadline, ultimately decreasing the success rate.

Design and Analysis of Real-Time Task Scheduling Algorithm for Fog-Cloud Computing

Figure 6 Variation of Success Rate with Task Count

Moreover, compared to RTTP and IPSO algorithms, the FLTS algorithm still maintains a high success rate. The FLTS algorithm considers not only the task deadlines during task scheduling but also the transmission latency, optimizing the task scheduling strategy. However, in heavy task environments, the success rate of the FLTS algorithm is lower than that of the TWOCP algorithm. This is because the TWOCP algorithm uses clustering algorithms for task clustering. The more tasks there are, the more evident the performance advantages of clustering algorithms.

3.3.2 Impact of Virtual Machine Count on Performance

This section analyzes the impact of virtual machine count on completion time, latency rate, and success rate, with the number of tasks fixed at 60; the number of virtual machines varying from 12 to 120. The simulation results are shown in Figures 7 and 8.

The number of resources accessible in the fog layer is directly proportional to the number of virtual machines. In other words, the more virtual machines there are, the more resources available for processing tasks, improving task processing efficiency. Therefore, completion time and latency rate decrease as the number of virtual machines increases, as shown in Figures 7 and 8.

Design and Analysis of Real-Time Task Scheduling Algorithm for Fog-Cloud Computing

Figure 7 Variation of Completion Time with Virtual Machine Count

Design and Analysis of Real-Time Task Scheduling Algorithm for Fog-Cloud Computing

Figure 8 Variation of Latency Rate with Virtual Machine Count

Additionally, since the FLTS algorithm uses fuzzy logic to select some tasks for execution in the cloud layer, the number of tasks executed in the fog layer is less than that of RTTP, IPSO, and TWOCP algorithms. Therefore, the performance of the FLTS algorithm is superior to that of RTTP, IPSO, and TWOCP algorithms.

Finally, the impact of virtual machine count on success rate is analyzed, as shown in Figure 9. It can be seen that the success rate of the FLTS algorithm is better than that of RTTP, IPSO, and TWOCP algorithms. Furthermore, when the number of virtual machines is low, the advantage of the FLTS algorithm in terms of success rate performance is more significant. The fewer the virtual machines, the more tasks assigned to each virtual machine, but this increases waiting time.

Design and Analysis of Real-Time Task Scheduling Algorithm for Fog-Cloud Computing

Figure 9 Variation of Success Rate with Virtual Machine Count

4 Conclusion

This paper addresses the task scheduling problem between the fog and cloud layers, proposing a fuzzy logic-based task scheduling algorithm. This algorithm considers the computational capacity, storage space, bandwidth requirements for executing tasks, as well as the latency requirements of tasks. By optimally selecting virtual machines to execute tasks in the fog layer, the efficiency of task execution is improved. Simulation results indicate that the proposed FLTS algorithm enhances the success rate of task execution and reduces the latency of task completion.

This paper considers the requirements and constraints of tasks during scheduling. Future work will continue to address security and privacy issues and expand the FLTS algorithm to larger network environments.

References

[1] WEI Chuanjiang, ZHUANG Yi. Adaptive virtual machine scheduling algorithm for mobile cloud computing [J]. Small and Microcomputer Systems, 2021, 42(1): 96–104.

[2] HAO Bin, LI Wei. Construction of remote data processing system for large-scale instrument public platform based on virtual machine technology [J]. Laboratory Research and Exploration, 2022, 41(2): 278–281.

[3] BELLAVISTA P, BERROCAL J, CORRADI A, et al. A survey on fog computing for the Internet of Things [J]. Pervasive and Mobile Computing, 2019(52): 71–99.

[4] QIAO Jiali, ZHENG Xiaoyan, GAO Jinhui. Research on intelligent traffic signal control algorithm based on fog computing [J]. Experimental Technology and Management, 2018, 35(10): 79–83.

[5] WANG Tian, SHEN Xuewei, LUO Hao, et al. Research progress on trusted sensing cloud based on fog computing [J]. Journal of Communications, 2019, 383(3): 174–185.

[6] TANG Bei, ZHENG Yimin, CHEN Siguang, et al. Energy-efficient fog computing migration research based on deep learning [J]. Journal of Nanjing University of Posts and Telecommunications (Natural Science Edition), 2020, 187(2): 104–110.

[7] LI L, GUAN Q, JIN L, et al. Resource allocation and task offloading for heterogeneous real-time tasks with uncertain duration time in a fog queueing system [J]. IEEE Access, 2019(7): 9912–9925.

[8] YIN S, BAO J, LI J, et al. Real-time task processing method based on edge computing for spinning cps [J]. Frontiers of Mechanical Engineering, 2019, 14(3): 320–331.

[9] AULUCK N, RANA O, NEPAL S, et al. Scheduling real time security aware tasks in fog networks [J]. IEEE Transactions on Services Computing, 2019, 14(8): 12–21.

[10] CHEN Z J, ZHU Y C, DI Y Q, et al. A dynamic resource scheduling method based on fuzzy control theory in cloud environment [J]. Journal of Control Science and Engineering, 2015, 1(6): 1–10.

[11] ROUT R R, VEMIREDDY S, RAUL S K, et al. Fuzzy logic-based emergency vehicle routing: An IoT system development for smart city applications [J]. Computers and Electrical Engineering, 2020, 88(4): 106839–106843.

[12] HOSSAIN M D, SULTANA T, NGUYEN V, et al. Fuzzy based collaborative task offloading scheme in the densely deployed small-cell networks multi-access edge computing [J]. Applied Sciences, 2020, 10(9): 3115–3120.

[13] NGUYEN B M, BINH H T, SON B D, et al. Fuzzy based collaborative task offloading scheme in the densely deployed small-cell networks multi-access edge computing [J]. Applied Sciences, 2019, 9(9): 1730–1741.

[14] MA Xinyu, JIANG Chunmao, HUANG Chunmei. Cloud task optimization scheduling based on three-way clustering [J]. Computer Science, 2022, 49(Supplement 2): 875–881.

[15] WU J W, JIANG C M. Load-aware score scheduling of three-way clustering for cloud task [J]. CAAI Transactions on Intelligent System, 2019, 14(2): 316–322.

[16] ZHANG Sihao, TIAN Jianyu, LIU Yinliang, et al. An improved task scheduling algorithm in cloud computing environment [J]. Firepower and Command Control, 2022, 47(6): 1076–1082.

[17] LI X, WAN J, DAI H N, et al. A hybrid computing solution and resource scheduling strategy for edge computing in smart manufacturing [J]. IEEE Transactions on Industrial Informatics, 2019, 15(7): 4225–4234.

[18] GUPTA H, DASTJERDI A V, GHOSH S K, et al. iFogSim: A toolkit for modeling and simulation of resource management techniques in the Internet of Things, Edge and Fog computing environments [J]. Software: Practice and Experience, 2017, 47(9): 1275–1296.

[19] LIU Q, WEI Y, LENG S, et al. Task scheduling in fog enabled Internet of Things for smart cities [C]//2017 IEEE 17th International Conference on Communication Technology (ICCT). Chengdu, China, 2017: 975–980.

Citation Format: ZHANG Y N, WU H, ZHANG Y. Design and analysis of real-time task scheduling algorithm for fog-cloud computing [J]. Experimental Technology and Management, 2023, 40(5): 130-135.

Cite this article: ZHANG Y N, WU H, ZHANG Y. Design and analysis of real-time task scheduling algorithm for fog-cloud computing [J]. Experimental Technology and Management, 2023, 40(5): 130-135. (in Chinese)

Experimental Technology and Management, 2023, Issue 5, P130-135

DOI: 10.16791/j.cnki.sjg.2023.05.021

Design and Analysis of Real-Time Task Scheduling Algorithm for Fog-Cloud Computing

Experimental Technology and Management

Comprehensive Scientific and Technological Journal · Journal of the Laboratory Management Branch of the Chinese Higher Education Association

Core Chinese Journal · RCCSE Chinese Authoritative Academic Journal (A+)

Excellent Scientific and Technological Journal of Chinese Universities · First Excellent Journal Implementing “CAJ-CD Standard”

Journal Website · Online Submission

http://syjl.cbpt.cnki.net

http://syjl.chinajournal.net.cn

Contact & Subscription

Editorial Office Phone: 010-62783005 or 010-62797828

Email: [email protected]

Subscription and Distribution Phone: 010-62792635

Email: [email protected]

Click

To download the full text, please click Read the original text

Leave a Comment