A Multi-Objective Task Scheduling Strategy for Intelligent Production Line Based on Cloud-Fog Computing

With the widespread use of industrial Internet technology in intelligent production lines, the number of task requests generated by smart terminals is growing exponentially. Achieving rapid response to these massive tasks becomes crucial. In this paper we focus on the multi-objective task scheduling problem of intelligent production lines and propose a task scheduling strategy based on task priority. First, we set up a cloud-fog computing architecture for intelligent production lines and built the multi-objective function for task scheduling, which minimizes the service delay and energy consumption of the tasks. In addition, the improved hybrid monarch butterfly optimization and improved ant colony optimization algorithm (HMA) are used to search for the optimal task scheduling scheme. Finally, HMA is evaluated by rigorous simulation experiments, showing that HMA outperformed other algorithms in terms of task completion rate. When the number of nodes exceeds 10, the completion rate of all tasks is greater than 90%, which well meets the real-time requirements of the corresponding tasks in the intelligent production lines. In addition, the algorithm outperforms other algorithms in terms of maximum completion rate and power consumption.


Introduction
With the development of information and communication technologies, such as wireless sensor networks [1], industrial Internet of Things (IIoT) [2,3], and cloud computing [4], the transformation and upgrading of manufacturing technology has been promoted, which makes traditional manufacturing shift to intelligent manufacturing. The production equipment, transmission devices, sensors, and other terminal devices in the intelligent production lines have been connected based on various heterogeneous communication networks, making the traditional information islands evolve to the interconnection model. Meanwhile, the extensive use of intelligent devices has generated large amounts of tasks requiring real-time processing [5]. Cloud computing was initially considered the primary enabler capable of 1.
We present a multi-objective task scheduling optimization problem in intelligent production lines. A multi-priority task scheduling strategy based on a cloud-fog computing architecture is used to solve this problem, achieving a fast response to intelligent production line tasks and reducing energy consumption.

2.
A new task scheduling algorithm hybridizing the MBO and ACO is implemented in our study. The improved MBO and ACO more easily converge. More importantly, this is the first time that MBO has been applied to task scheduling scenarios in intelligent production lines.  3. We establish an intelligent production line simulation experiment platform based on C++ and evaluate the proposed algorithm. The results show that it is superior to other strategies in terms of average delay and power consumption.
The remainder of the paper is organized as follows. In Section 2, we describe the related work. In Section 3, we introduce the system model and problem formulation. In Section 4, we propose a task scheduling algorithm. Section 5 discusses the performance evaluation. Finally, in Section 6, we give a brief conclusion.

Related Work
In recent years, with the continuous development of fog computing and the requirements of terminal equipment for real-time performance and energy consumption, cloud-fog computing has become a trend, and task scheduling under cloud-fog computing has become a necessary research hotspot. We reviewed many studies on task scheduling for cloud and fog computing and listed them below.

Cloud Computing Task Scheduling
Cloud computing provides rich computing, storage, and other application services for industrial production, bringing huge energy consumption. With increasing attention being paid to carbon neutrality [15], it is imperative to improve the task allocation efficiency of cloud computing and reduce energy consumption in the industry. To obtain the best performance of task scheduling in cloud computing, Rajakumari et al. [16] proposed a fuzzy hybrid particle swarm parallel ant colony algorithm. This algorithm improved task scheduling with the objectives of minimizing execution and waiting time, increasing system throughput, and maximizing resource utilization. However, the study did not consider energy efficiency. Under the premise of ensuring cloud computing service quality, Rao et al. [17] completed the coordination and energy consumption minimization of data center scheduling. Lin et al. [18] proposed two IoT-Aware multi-resource task scheduling algorithms to reorder tasks based on priority, and task scheduling using heuristic algorithms. The simulation results showed that this method could reduce energy consumption as much as possible while ensuring the response time and load balancing results of IoT tasks. Although the above two studies guide task allocation, the difference in power consumption of the computing unit itself was not considered for task scheduling.

Fog Computing Task Scheduling
Fog nodes have differences in distribution and computing capacity. Effectively scheduling tasks requested by terminal devices can reduce service delay and energy consumption [19]. In the field of intelligent manufacturing, Mithun et al. [20] proposed a solution to the fog computing task offloading problem. This solution modelled the optimization problem mathematically and used quadratic constraint quadratic programming to solve the de-weighting problem, and finally solved the optimization problem by the semideterministic relaxation method. Chekired et al. [21] proposed a self-adaptive fog computing multi-objective optimization task scheduling method, which solved the multi-objective optimization problem of fog computing task scheduling with the total execution time and resource cost of tasks as the optimization objectives. Both studies provided excellent ideas for reducing task processing and waiting time, but neither reduced the task processing power consumption. In the research of Hang et al. [22], a joint computing offloading and wireless resource allocation algorithm based on Lyapunov optimization was proposed to minimize system delay, energy consumption, MDs weighting, and other associated costs. However, the study ignored the interaction between the cloud center and fog nodes and only divided the main problem into several sub-problems in each time slot and then allocated them to different fog nodes for calculation. Suppose we encounter a task that requires a large number of computing resources and is not divided, such as intelligent production line image processing. In that case, the resource-constrained fog node cannot process it, resulting in the task being unable to be completed. For the task offloading problem in fog computing, Keshavarznejad et al. [23] proposed a multi-objective optimization problem of energy consumption and delay, which was solved using a hybrid heuristic algorithm. The results showed that the best trade-off was obtained between the probability of offloading and the energy consumption required for data transmission. Regrettably, this approach did not categorize tasks to respond to urgent tasks quickly.

Cloud-Fog Computing Environment Task Scheduling
In cloud-fog computing, scheduling IoT tasks to reduce the delay and energy of timesensitive tasks has attracted the attention of researchers [24]. Abdelmoneem et al. [25] proposed a mobile-aware task scheduling and allocation method under the cloud-fog computing paradigm, which greatly reduced the energy consumption of task processing and task delay. This method effectively solved the task assignment of the sensing device in the mobile scene. However, it was unsuitable for intelligent production lines, etc., where the sensors were mostly fixed. Mokney et al. [26] studied IoT tasks with dependencies under cloud-fog computing, proposed modeling workflow planning as a multi-objective optimization problem, and designed a compromise solution regarding response time, cost, and maximum completion time. The proposed algorithm was superior in solving the scheduling problem that depended on task flow. However, it did not solve the scheduling problem of independent tasks. The algorithm obtained the Pareto optimal solution, which could not meet the urgent tasks that require ultra-low time response. Bisht et al. [27] studied the problem of rapid task response in the cloud-fog computing environment. They proposed a workflow scheduling method with the smallest maximum completion time and energy consumption. The research was based on task length for scheduling, and could not respond quickly to urgent and complex tasks.
Based on the above studies, we find that the task scheduling problem in the cloud-fog computing environment is a research hotspot in the IoT field, and the existing research cannot meet the requirements of low latency and low power consumption for multi-priority task scheduling in intelligent production lines.

Heuristic Algorithm to Solve the Task Scheduling Problem
Heuristic algorithms are a subset of the artificial intelligence field, which is popular in solving different optimization problems and is often used to solve task scheduling problems [28,29]. Common heuristic algorithms include ant colony optimization (ACO) [30], genetic algorithm (GA) [31], particle swarm optimization (PSO) [32], simulated annealing algorithm (SAA) [33], Grey Wolf Optimizer (GWO) [34], monarch butterfly optimization algorithm (MBO) [35], and so on. The MBO, with simple computational procedures and fewer parameters, is more easily to implement in these algorithms. MBO is suitable for solving small-scale search problems and is widely used in many fields [36]. The ACO can search on a large scale. To improve its search process, it can have excellent exploration and development capabilities at the stage of generating the optimal solution [28].
Many scholars have proposed that multiple single heuristics should be combined into a hybrid algorithm to obtain better task scheduling performance. In [37], a meta-heuristicbased service allocation framework was designed to schedule edge service requests using three meta-heuristic techniques, PSO, binary PSO, and Bat algorithm (Bat). The experimental results showed that the framework solved the dual objective minimization problem of energy consumption and maximum completion time. Ref et al. [38] proposed a hybrid bionic algorithm for cloud computing task scheduling and resource management. Fu et al. [39] improved the service quality of cloud computing by adopting the task scheduling optimization algorithm of hybrid PSO and GA. There are many documents on cloud computing task scheduling algorithms, but few studies on hybrid heuristic scheduling algorithms for task scheduling under cloud-fog computing.
Inspired by the above studies, we use a hybrid heuristic algorithm of MBO and ACO to solve the intelligent production line task scheduling problem.

System Model and Problem Formulation
In this section, we present the mathematical description of the task scheduling problem for intelligent production lines under cloud-fog computing.

System Architecture
We built a cloud-fog computing architecture to solve the increasing problems of delay-sensitive and computationally intensive tasks in intelligent production lines. The system architecture is given in Figure 1; it consists of three layers: infrastructure layer, fog computing layer, and cloud computing layer.

System Model and Problem Formulation
In this section, we present the mathematical description of the task scheduling problem for intelligent production lines under cloud-fog computing.

System Architecture
We built a cloud-fog computing architecture to solve the increasing problems of delay-sensitive and computationally intensive tasks in intelligent production lines. The system architecture is given in Figure 1; it consists of three layers: infrastructure layer, fog computing layer, and cloud computing layer.  Infrastructure layer: The infrastructure layer consists of terminal devices with different functions, such as various sensors, processing devices and various smart terminals. Smart terminals handle simple tasks locally but are unable to perform complex tasks in real time.
Fog computing layer: The fog computing layer is mainly composed of fog nodes. These are servers with certain computing, communication, and storage capabilities in intelligent production lines, such as smart sensors, smart processing devices, and intelligent multimedia devices. This layer can sense the requests of intelligent production line terminals and provide various services in real time, which can greatly reduce the delay of task processing and ensure the quality of service of real-time applications.
Cloud computing layer: The cloud computing layer consists of clusters with huge computing and storage capacity, providing remote services for intelligent production lines to handle complex computing tasks.

Description of System Model
In fields that require high real-time task processing, such as intelligent production lines and smart hospitals, ensuring the task processing reliability has always been a crucial issue [40]. It is necessary to analyze and process various data tasks in real time, such as material information reading and multi-axis robot posture analysis, when the intelligent production line is running. For example, the intelligent production line for personalized production of candy packaging realizes any combination of different shapes, colors and quantities of candy packaging. The machine vision-based candy sorting system is the key to complete the candy packaging, and the data uploaded by its image acquisition module Infrastructure layer: The infrastructure layer consists of terminal devices with different functions, such as various sensors, processing devices and various smart terminals. Smart terminals handle simple tasks locally but are unable to perform complex tasks in real time.
Fog computing layer: The fog computing layer is mainly composed of fog nodes. These are servers with certain computing, communication, and storage capabilities in intelligent production lines, such as smart sensors, smart processing devices, and intelligent multimedia devices. This layer can sense the requests of intelligent production line terminals and provide various services in real time, which can greatly reduce the delay of task processing and ensure the quality of service of real-time applications.
Cloud computing layer: The cloud computing layer consists of clusters with huge computing and storage capacity, providing remote services for intelligent production lines to handle complex computing tasks.

Description of System Model
In fields that require high real-time task processing, such as intelligent production lines and smart hospitals, ensuring the task processing reliability has always been a crucial issue [40]. It is necessary to analyze and process various data tasks in real time, such as material information reading and multi-axis robot posture analysis, when the intelligent production line is running. For example, the intelligent production line for personalized production of candy packaging realizes any combination of different shapes, colors and quantities of candy packaging. The machine vision-based candy sorting system is the key to complete the candy packaging, and the data uploaded by its image acquisition module need to be analyzed and processed in real time during the operation. Figure 2 depicts the flow of image processing. , x FOR PEER REVIEW 6 of 21 need to be analyzed and processed in real time during the operation. Figure 2 depicts the flow of image processing.  However, the processing and analysis capabilities of fog nodes are limited. With the increasing number of tasks to be processed, an unreasonable task allocation mechanism often leads to an increase in task delay, a decrease in completion and an increase in energy consumption. Consequently, we propose a task scheduling algorithm based on cloud-fog computing. The proposed algorithm uses a hybrid heuristic scheduling algorithm to reasonably allocate tasks to fog nodes and cloud servers, and thus solves the above problems. The tasks generated by the terminals of the intelligent production line are processed in the cloud-fog computing environment as shown in Figure 3. We classify the tasks generated by the terminal device according to their urgency and sort them according to their priority. The scheduling algorithm distributes the sorted tasks to the fog nodes and cloud servers to ensure that the tasks will be served as much as possible.

Latency Model and Energy Consumption Mode
First, we assume that there are tasks = {T 1 , 2 , … , }, the priority of each task is = { 1 , 2 , … }, and they are independent of each other. Among them, each task can be expressed as a three tuple = {D ( ), ( ), ( )}. D ( ) represents the input data volume of the task, in kbit, ( ) defines the load of the task, in MIPS, and ( ) indicates the output of the task, in kbit. Denote as the number of service nodes = { 1 , 2 , . . . , }, which includes fog nodes and a cloud service. For the convenience of numbering, we let denote the cloud service. We define a non-negative integer variable , to indicate whether the node can handle service request number , such as: Since fog nodes have heterogeneous resources, they provide different types of computing services for terminal devices. To allow each task to be served, we ensure that at least one node can serve each task when setting up the nodes. Formally, we have: However, the processing and analysis capabilities of fog nodes are limited. With the increasing number of tasks to be processed, an unreasonable task allocation mechanism often leads to an increase in task delay, a decrease in completion and an increase in energy consumption. Consequently, we propose a task scheduling algorithm based on cloudfog computing. The proposed algorithm uses a hybrid heuristic scheduling algorithm to reasonably allocate tasks to fog nodes and cloud servers, and thus solves the above problems. The tasks generated by the terminals of the intelligent production line are processed in the cloud-fog computing environment as shown in Figure 3. We classify the tasks generated by the terminal device according to their urgency and sort them according to their priority. The scheduling algorithm distributes the sorted tasks to the fog nodes and cloud servers to ensure that the tasks will be served as much as possible.
need to be analyzed and processed in real time during the operation. Figure 2 depicts the flow of image processing.  However, the processing and analysis capabilities of fog nodes are limited. With the increasing number of tasks to be processed, an unreasonable task allocation mechanism often leads to an increase in task delay, a decrease in completion and an increase in energy consumption. Consequently, we propose a task scheduling algorithm based on cloud-fog computing. The proposed algorithm uses a hybrid heuristic scheduling algorithm to reasonably allocate tasks to fog nodes and cloud servers, and thus solves the above problems. The tasks generated by the terminals of the intelligent production line are processed in the cloud-fog computing environment as shown in Figure 3. We classify the tasks generated by the terminal device according to their urgency and sort them according to their priority. The scheduling algorithm distributes the sorted tasks to the fog nodes and cloud servers to ensure that the tasks will be served as much as possible.  T1 T2 T3 T4 T5   T5  T4  T3 T2 T1   Task

Latency Model and Energy Consumption Mode
First, we assume that there are tasks = {T 1 , 2 , … , }, the priority of each task is = { 1 , 2 , … }, and they are independent of each other. Among them, each task can be expressed as a three tuple = {D ( ), ( ), ( )}. D ( ) represents the input data volume of the task, in kbit, ( ) defines the load of the task, in MIPS, and ( ) indicates the output of the task, in kbit. Denote as the number of service nodes = { 1 , 2 , . . . , }, which includes fog nodes and a cloud service. For the convenience of numbering, we let denote the cloud service. We define a non-negative integer variable , to indicate whether the node can handle service request number , such as: Since fog nodes have heterogeneous resources, they provide different types of computing services for terminal devices. To allow each task to be served, we ensure that at least one node can serve each task when setting up the nodes. Formally, we have:

Latency Model and Energy Consumption Mode
First, we assume that there are k tasks T = {T 1 , T 2 , . . . , T k }, the priority of each task is PList = {λ 1 , λ 2 , . . . , λ k }, and they are independent of each other. Among them, each task T i can be expressed as a three tuple the input data volume of the task, in kbit, Y(i) defines the load of the task, in MIPS, and D out (i) indicates the output of the task, in kbit. Denote n as the number of service nodes F = {F 1 , F 2 , . . . , F n }, which includes fog nodes and a cloud service. For the convenience of numbering, we let F n denote the cloud service. We define a non-negative integer variable X i,j to indicate whether the node i can handle service request number j, such as: Since fog nodes have heterogeneous resources, they provide different types of computing services for terminal devices. To allow each task to be served, we ensure that at least one node can serve each task when setting up the nodes. Formally, we have: Data transmission in the task from the terminal device to the node is often limited by the transmission speed, and the transmission rate is usually defined as follows: where p i is the transmission power of the fog node, N 0 is the Gaussian noise power in the channel, C is the bandwidth provided by the access network, and H is the channel gain parameter between the fog nodes. In this study, we assume that the information gain parameters between all fog nodes are the same. In addition, it can be seen from Equation (3) that when a channel is used at the same time, the data transmission rate will be reduced. Then, the total transmission time of the node F i receiving the task and sending the task after processing is expressed as: . . , f n } to define the ability of each node to process tasks, and the unit is MPIS. The time to complete a process in the node should be the time it is served, so we can obtain this formula: Since all tasks are served in the allocated order, the subsequent tasks in each node must wait for the previous processing to be completed before being served. Therefore, the queuing time of task j in each node i is: Then, the total queue time of each node task is: Obviously, we can find from Equations (4)-(7) that the total time for each node to complete all scheduled tasks can be expressed as: It should be noted here that since the work of each node is independent of each other, the time for all tasks to complete is equivalent to the longest time the task takes. The maximum delay can be expressed as: In this study, we use p trans = p trans 1 , p trans 2 , . . . , p trans n to represent the transmission power of the node. Combined with Equation (4), we can obtain the transmission energy consumption of each node as: As above, p deal = p deal 1 , p deal 2 , . . . , p deal n represents the service power of node i. Taking into account Equation (5), the energy consumption of each node when providing services is: The power consumption generated by the task in queuing is extremely small, and we do not calculate the energy consumption when the task is waiting. Then, the total energy consumption of each node is: From Equations (10)- (12), we can easily know that the total energy consumption generated by nodes in the entire task scheduling cycle can be expressed as:

Time Delay and Power Consumption Evaluation Model Based on Task Priority
In intelligent production lines, tasks with different degrees of urgency have different response time requirements, yet usually the time tolerance for urgent tasks is low. To ensure that urgent tasks are processed quickly, we classify the tasks in the buffer list according to their time tolerance. We simply classify the tasks into two categories: the tasks with lower time delay requirements are considered high-priority tasks, and the others are considered low-priority tasks. The priority of a task is denoted by λ, The delay and power consumption of different nodes in the fog computing layer differ when processing the same task. When using heuristics to search for potentially good solutions, the search direction should be adaptively adjusted according to the priority of the task. For high-priority tasks, lower service latency should be the main search direction, while for low-priority tasks with lower latency requirements, lower power consumption should be the search target. Therefore, we construct a latency-power evaluation model based on the different requirements of latency and power consumption for the two priority tasks using the properties of the exponential function.
The evaluation formula is: From the formula, we can find that when it is a high-priority task, the value of the evaluation function is affected by the time delay. In the opposite case, it is affected by energy consumption parameters. Among them, ϑ and µ represent the coefficients of latency and energy consumption, respectively.
Through the description of the above formula, our goal formula becomes clear, including the completion time of all tasks and the energy consumption of all nodes. Our goal is to ensure that all are completed on time while minimizing energy consumption, namely: where we use constraints (c1) and (c2) to ensure that each task can be served, and each node will provide at least one service. In (c3), que i,j represents the correspondence between node i and task j after scheduling, and we constrain each task to be served by only one node. (c4) and (c5) constrain the latency and energy consumption, respectively.

Task Scheduling Algorithm Design
The task scheduling problem in cloud-fog computing has difficulty obtaining the optimal solution in polynomial time due to the many variables and constraints in the objective function [41]. To minimize the delay of all tasks and reduce the energy consumption of nodes, we combined the advantages of the MBO and ACO to design a hybrid heuristic algorithm. It solves the optimal task scheduling problem in the cloud-fog computing environment.

Task Rescheduling Strategy
The traditional task scheduling sequence usually adopts the first-come, first-served method, which is suitable for tasks with the same priority. However, this is generally not feasible for time-sensitive tasks because the sequential service will cause time-sensitive tasks to be ranked after non-sensitive jobs. We use a merge sorting algorithm to prioritize the tasks to avoid this problem. The sorted sequence ensures that the high-priority tasks can be served first. We take Figure 4 as an example. The blue stripes denote the priority of each task, and the service order of their initial jobs is T1 → T2 → T3 → T4 → T5 . After the task rescheduling strategy is adjusted, the order assigned to the cloud before computing is changed to T5 → T3 → T2 → T1 → T4 . where we use constraints ( 1) and ( 2) to ensure that each task can be served, and each node will provide at least one service. In ( 3), , represents the correspondence between node and task after scheduling, and we constrain each task to be served by only one node. ( 4) and ( 5) constrain the latency and energy consumption, respectively.

Task Scheduling Algorithm Design
The task scheduling problem in cloud-fog computing has difficulty obtaining the optimal solution in polynomial time due to the many variables and constraints in the objective function [41]. To minimize the delay of all tasks and reduce the energy consumption of nodes, we combined the advantages of the MBO and ACO to design a hybrid heuristic algorithm. It solves the optimal task scheduling problem in the cloud-fog computing environment.

Task Rescheduling Strategy
The traditional task scheduling sequence usually adopts the first-come, first-served method, which is suitable for tasks with the same priority. However, this is generally not feasible for time-sensitive tasks because the sequential service will cause time-sensitive tasks to be ranked after non-sensitive jobs. We use a merge sorting algorithm to prioritize the tasks to avoid this problem. The sorted sequence ensures that the high-priority tasks can be served first. We take Figure 4 as an example. The blue stripes denote the priority of each task, and the service order of their initial jobs is T1 → T2 → T3 → T4 → T5. After the task rescheduling strategy is adjusted, the order assigned to the cloud before computing is changed to T5 → T3 → T2 → T1 → T4.

Monarch Butterfly Optimization
The MBO algorithm [35] is a novel population intelligence algorithm that simulates the migration process of monarch butterflies in nature. The MBO algorithm is often used to solve some optimal solution problems with small solution spaces [42]. Based on these studies, we improve the MBO algorithm to address small-scale task scheduling problems to improve efficiency. The implementation process of the improved monarch butterfly is shown in Algorithm 1. Set an initial value for each monarch butterfly. 5: end 6: for t = 1; t <= Τ; t++ do

Monarch Butterfly Optimization
The MBO algorithm [35] is a novel population intelligence algorithm that simulates the migration process of monarch butterflies in nature. The MBO algorithm is often used to solve some optimal solution problems with small solution spaces [42]. Based on these studies, we improve the MBO algorithm to address small-scale task scheduling problems to improve efficiency. The implementation process of the improved monarch butterfly is shown in Algorithm 1.

19:
Use the two elites to replace the worst two. 20: end

Differential Mutation Transfer Operator
The differential evolution algorithm [43] was proposed by American scholars Storn and Price in 1995. It uses mutation, crossover, and selection operations to simulate gene mutation behavior during biological evolution. Generally, heuristic algorithms searching near the better solution can have a greater chance of finding the optimal global solution. Inspired by this, we propose replacing the original migration operator of MBO with a differential mutation migration operator. Using this strategy, we can perform differential evolution mutation operations on the better individuals in the population to achieve the search near the better solution. The differential mutation migration operator (DMMO) can be expressed as: where γ = [0, 2] represents the coefficient of variation, s t best,k is the position of the best individual in each round of iteration, and ∆ represents the difference vector, which is expressed as: where s t q 1 ,k , s t q 2 ,k represent the positions of two monarch butterflies randomly selected, and the constraints are: From Equation (21), the fitness value of the mutation position and the fitness values corresponding to the other three different parts can be calculated according to the difference to obtain the mutation vector, and the weight of the mutation vector is added to a randomly selected monarch butterfly position. In terms of the fitness value, a mutation fitness value carrying diversified information is generated so that the mutation location accepts the mutation fitness value, increasing the diversity of the population and significantly improving the ability of the algorithm to search globally.

Hybrid Encoding
The MO and BAO operators in the MBO algorithm are similar to the calculation of the continuous problem. However, each feasible solution to the task scheduling problem corresponds to a set of positive integers representing node numbers. Then, it is not possible to directly apply the basic MBO algorithm to solve such problems.
We design a simple and effective hybrid coding mechanism based on the task requirements in cloud-fog computing. We represent each candidate solution as a two-tuple X, Y . Among them, ln(X) ∈ [−a, a] n is a real-valued vector, which constitutes the search space. In this paper, the parameter a takes a value of 5.0. Y ∈ [1, N] represents the solution space of the problem and is a vector of positive integers, and N denotes the number of nodes. We construct a mapping relationship from continuous space to discrete space: where sig(x) = 1/(1 + e −x ) is the sigmoid function. Therefore, the candidate solution S = {s 1 , s 2 , · · · , s M } can be evaluated by the objective function Γ.

Improved Ant Colony Algorithm
The probabilistic algorithm ACO was designed by Marco Dorigo to find an optimal path, inspired by the behavior of ants in the process of searching for food. The ACO algorithm has many excellent properties and is mainly used to solve task scheduling problems with complex solution set [28,30]. We improved the ACO algorithm to address large-scale task scheduling problems, and it is convenient to obtain the optimal task service strategy faster. The implementation of the improved ACO algorithm is shown in Algorithm 2.

11:
Calculate the probability based on Equation (21). 12: Determine the node and record the route. 13: Update local information based on Equation (26). 14: end 15: Select the current optimal path. 17: end 18: Update global information according to Equation (23). 19: Select the optimal path. 20: end

Path Construction
In the ACO algorithm, each artificial ant randomly selects a position as the starting point before leaving and maintains a path memory vector to store the positions that the artificial ant passes in turn. The position here refers to cloud and fog nodes. In each step of constructing the path, the artificial ant chooses the following location to reach according to the rule of random proportion. The random probability is calculated according to the following formula: where P k ij (t) represents the probability that node j needs to provide services when node i provides services at time t. ι ij (t) denotes the intensity of the pheromone from node i to j at time t, η ij (t) indicates the visibility from node i to j at time t, allowed k represents the set of nodes that have not been visited, and α and β are two constants, that represent the weighted value of pheromone and visibility, respectively. η ij (t) is determined by Equation (14): where τ ij (t) represents the time spent from nodes i to j at time t, and π ij (t) represents energy consumption. λ is the priority of the task mentioned in Equation (13), where the multi-objective task scheduling is the denominator of Equation (22), and the larger the value of the fitness function is, the better the solution.

Pheromone Update
The pheromone update method is the key to the colony ant algorithm. A certain amount of pheromone is assigned to each route at the beginning of the algorithm. The pheromone is an incentive that encourages ants to explore close to the optimal solution, and the management of pheromones directly affects the algorithm's efficiency. If there are too many pheromones in the current best path, the result may not jump out of the local optimum. In contrast, it might cause the algorithm to converge too slowly. In the following, we introduce the pheromone update strategy we adopted, which can obtain the global optimal solution and accelerate the convergence speed of the algorithm.

Global Pheromone Update
When each generation of artificial ants completes the iteration, all trajectories will be updated globally as follows: where ρ is the proportion of disappearing pheromones, and ∆ϕ k ij is the newly generated pheromones in the trajectory from node i to j. The generation of a new pheromone depends on whether it is the trajectory of the optimal solution, namely: where χ represents the length of the path.

Local Pheromone Update
After each artificial ant chooses a path, the pheromones of the two targets will evaporate in a particular proportion to prevent premature convergence. The local update procedure is as follows: where ρ is the evaporation rate of the pheromone set in advance, and ϕ 0 is the initial pheromone concentration. With the local renewal of pheromones, artificial ants tend to seldom untraveled paths, thereby potentially increasing the diversity of solutions.

Hybrid Heuristic Task Scheduling Algorithm
The MBO algorithm and the ACO algorithm are introduced in detail above, and we improved these two algorithms. However, each algorithm has its shortcomings in solving the task scheduling problem. For example, when a large number of tasks must be scheduled, although the search speed of the MBO algorithm is relatively fast, the global search capability becomes weaker, and the search accuracy also decreases. However, for the ACO algorithm, although it has high accuracy, the search speed is low. To obtain critical values for the performance of the two algorithms, we conduct several comparison experiments and find that better scheduling is obtained using the improved MBO algorithm when the number of tasks is less than or equal to 30, while the ACO algorithm performs well in other cases. Based on this, we design a new hybrid MBO-ACO (HMA) algorithm to fully utilize the performance of both algorithms. The threshold is set to 30, and the improved MBO (IMBO) algorithm is used for task scheduling when the number of tasks is less than or equal, and the improved ACO (IACO) algorithm is used when it is greater than. This enables adaptive selection of the optimal scheduling algorithm based on the number of tasks. The flowchart of the HMA algorithm is shown in Figure 5. number of tasks is less than or equal to 30, while the ACO algorithm performs well in other cases. Based on this, we design a new hybrid MBO-ACO (HMA) algorithm to fully utilize the performance of both algorithms. The threshold is set to 30, and the improved MBO (IMBO) algorithm is used for task scheduling when the number of tasks is less than or equal, and the improved ACO (IACO) algorithm is used when it is greater than. This enables adaptive selection of the optimal scheduling algorithm based on the number of tasks. The flowchart of the HMA algorithm is shown in Figure 5.

Number of tasks 30
Use Algorithm 1. Use Algorithm 2.
Output the optimal task scheduling strategy.

End
Yes No

Time Complexity Analysis
The time complexity of our strategy depends on: • The time complexity of the task classification strategy. Task sorting is performed by the merge sort algorithm, so the average time complexity of task sorting is ( * log ).
• The time complexity of task scheduling. The task scheduling strategy is based on MBO and ACO, whose complexity is usually measured in terms of average convergence and is influenced by the number of populations and the number of iterations. However, the randomness and group nature of these algorithms lead to complex and variable stochastic processes, which adds difficulties to the time complexity analysis of the algorithms [44]. We can only approximate the time complexity. The time complexity of the MBO algorithm is approximately ( × × × ), and the ACO is approximately (( − 1) × × × ). Here, n represents the number of tasks, m is the number of populations, and T denotes the number of iterations.

Performance Evaluation
In this section, we perform simulations to verify the feasibility of the proposed

Time Complexity Analysis
The time complexity of our strategy depends on:

•
The time complexity of the task classification strategy.
Task sorting is performed by the merge sort algorithm, so the average time complexity of task sorting is O(n * log n).

•
The time complexity of task scheduling.
The task scheduling strategy is based on MBO and ACO, whose complexity is usually measured in terms of average convergence and is influenced by the number of populations and the number of iterations. However, the randomness and group nature of these algorithms lead to complex and variable stochastic processes, which adds difficulties to the time complexity analysis of the algorithms [44]. We can only approximate the time complexity. The time complexity of the MBO algorithm is approximately O(m × n × m × T), and the ACO is approximately O((n − 1) × n × m × T). Here, n represents the number of tasks, m is the number of populations, and T denotes the number of iterations.

Performance Evaluation
In this section, we perform simulations to verify the feasibility of the proposed method. We present the simulation environment and compare its performance with that of the conventional method. The results further validate the effectiveness of the proposed strategy.

Simulation Settings
The experiment is conducted on a computer with a 3.7 GHz AMD Ryzen 5, 3400 G CPU and 16 G memory storage space. We build a cloud-fog computing architecture and task scheduling model simulation platform using C++ based on a task scheduling scenario in the intelligent production line. To facilitate the performance comparison between algorithms, we set the transmission rate between fog nodes as 3 M/s and that between cloud nodes and fog nodes as 10 M/s. The simulation parameters are shown in Table 1. The parameter settings in Algorithm 1 and Algorithm 2 are shown in Table 2.

Performance Evaluations
To highlight our proposed HMA task scheduling algorithm, we compare two existing scheduling methods: first-come-first-served (FCFS) scheduling [45] and only cloud service methods [18]. We also compare the performance of the IMBO algorithm or the IACO algorithm running alone. Finally, we experiment with a priority-based task reordering strategy. We execute all the algorithms 30 times and average the results to reduce the error due to randomness.
We summarize the results of previous studies and identify three evaluation indicators to evaluate the experimental results. The first is the maximum completion time [37,[46][47][48][49], which is the time required to complete the last task. The second is energy consumption [37,47,48], which is the sum of energy required in completing all tasks. The third is the task completion rate (CR), which is the number of tasks successfully completed within the maximum tolerance time divided by the total tasks, and can be expressed by the following formula: Next, we compare five algorithms under three performance indicators. The number of fog nodes is set to 5, 10 and 20, and the task amount is set to 10, 20, 30, 40, 50, 60, 70, 80, 90, and 100.

Maximum Completion Time
For each experiment, before the task scheduling is completed without execution, we set a timer for each cloud/fog node that starts when the first task arrives and stops when the last task is completed. At the end of a task cycle, we compare the times recorded by each node and select the largest one as the maximum completion time for that task scheduling method. Figure 6 illustrates the performance comparison of the maximum completion time between the five task scheduling strategies. Here, Figure 6A-C are the result of sorting tasks, and Figure 6D-F are before sorting. As the number of tasks increases, the task completion time increases. In contrast, as the number of fog nodes increases, it decreases. Furthermore, the cloud has the highest completion time, which may be due to network congestion caused by long-distance transmission between the cloud and the terminal device. While the cloud server has the most robust processing performance, it takes the most time. The remaining algorithms can reduce the huge latency caused by communication by offloading the tasks to the fog nodes. The cloud-fog computing architecture is an effective way to reduce the latency of intelligent production line tasks. When our proposed task rescheduling strategy is used, the latency of IMBO, IACO, and HMA is lower than that of the unused strategy. This shows that the task rushing sequencing strategy based on task priority can reduce the time-sensitive task latency. The proposed HMA can ensure that all tasks can be completed within the maximum tolerance time when the number of tasks is less than or equal to 30 after the tasks are sorted. Furthermore, FCFS scheduling ignores the performance differences between different nodes, resulting in the second-highest delay cost. unused strategy. This shows that the task rushing sequencing strategy based on task priority can reduce the time-sensitive task latency. The proposed HMA can ensure that all tasks can be completed within the maximum tolerance time when the number of tasks is less than or equal to 30 after the tasks are sorted. Furthermore, FCFS scheduling ignores the performance differences between different nodes, resulting in the second-highest delay cost.

Energy Consumption
During the experiment, when the task starts to execute, we calculate the energy consumption required to process each task according to Equation (12). After the task is completed, we use Equation (13) to obtain the energy consumed by all tasks to complete in one task cycle. Figure 7 compares the energy consumption performance between the five task scheduling strategies. Similarly, Figure 7A-C are the result of sorting tasks, and Figure 7D-F are before sorting. We can clearly understand that energy consumption increases with the number of tasks and fog nodes. Here, only the running power consumption of cloud processing tasks is calculated, and the static power consumption of the server is ignored, so the energy consumption brought by cloud services is the lowest. Generally, energy consumption is related to power and running time and decreases as the completion time shortens. The energy consumption of Figure 7A-C is much lower than that of Figure 7D-F, which shows that our proposed task reordering strategy reduces the overall execution time of tasks. It is also worth noting that the energy consumption of HMA is significantly lower than that of FCFS. Traditional scheduling strategies such as FCFS do not consider the load of the fog nodes in the task allocation process, resulting in unbalanced load distribution and higher energy consumption. Equation (14) enables the HMA to adaptively adjust the search direction according to the priority of the task, thus reducing energy consumption. The energy consumption of HMA is less than that of IACO but more than that of IMBO. This shows that in large-scale search problems, HMA has more vital searchability than IMBO. The results obtained better balance time constraints and power consumption, resulting in a slight increase in energy consumption. We believe this is acceptable.
higher energy consumption. Equation (14) enables the HMA to adaptively adjust the search direction according to the priority of the task, thus reducing energy consumption. The energy consumption of HMA is less than that of IACO but more than that of IMBO. This shows that in large-scale search problems, HMA has more vital searchability than IMBO. The results obtained better balance time constraints and power consumption, resulting in a slight increase in energy consumption. We believe this is acceptable.

Task Completion Rate
In our experiments, we set a timer for each task to keep track of the time it takes from being assigned to completion. We set a counter that counts the number of tasks that can be completed within after all tasks are completed. If the task completion time is less than , then the counter is incremented by one. is different for tasks with different priorities, which are listed in Table 1. Finally, we calculate the task completion rate using Equation (26). Figure 8 shows the completion rate of all tasks within the task tolerance time. We still use A-C to indicate the performance results after sorting the tasks, and D-F to indicate the results before sorting. According to Equation (26), we

Task Completion Rate
In our experiments, we set a timer for each task to keep track of the time it takes from being assigned to completion. We set a counter that counts the number of tasks that can be completed within MaxTime after all tasks are completed. If the task completion time is less than MaxTime, then the counter is incremented by one. MaxTime is different for tasks with different priorities, which are listed in Table 1. Finally, we calculate the task completion rate using Equation (26). Figure 8 shows the completion rate of all tasks within the task tolerance time. We still use Figure 8A-C to indicate the performance results after sorting the tasks, and Figure 8D-F to indicate the results before sorting. According to Equation (26), we know that the trend of the task completion rate is consistent with the maximum completion time. In other words, as the number of tasks increases, the completion rate decreases again, and as the number of fog nodes increases, the task completion rate increases. Whether the task reschedule strategy is adopted, the task completion rate of HMA is always the highest. This is because HMA balances time and task delay through task priority when processing task scheduling, ensuring the priority execution of time-sensitive tasks. When the number of tasks exceeds 30, the completion rate of the IMBO strategy is ranked behind FCFS. As the solution set space increases, the IMBO algorithm is prone to poor performance caused by falling into suboptimal solutions. IACO is the same as HMA in terms of completion rate. Cloud computing is ranked last due to large latency, which results in a low completion rate.
We compared the completion rates of high-priority tasks to show the responsiveness of different algorithms to urgent tasks, as shown in Figure 9. Comparing Figure 9A-C and Figure 9D-F, we find that the task rescheduling strategy can improve the completion rate of high-priority tasks, which ensures the requirements of the intelligent production line for time-sensitive tasks. From the information of Figure 9A-C, we can conclude that when the number of tasks is less than 60, the HMA algorithm ensures that all high-priority tasks are completed within the fault tolerance time. This verifies that the task priority-based strategy takes time delay and energy consumption as the optimization goal and converges to the optimal solution better than other algorithms. When the number of fog nodes is 20, all high-priority tasks within 100 are completed. For large-scale tasks, adding a certain number of service nodes can effectively improve the task success rate. The task completion rate of nodes 5 and 10 proves that HMA is superior under the limitation of the number of service nodes. Similar to the total completion rate, IACO ranks second, FCFS leads IMBO when the number of tasks is large, and cloud always ranks last.
ways the highest. This is because HMA balances time and task delay through task priority when processing task scheduling, ensuring the priority execution of time-sensitive tasks. When the number of tasks exceeds 30, the completion rate of the IMBO strategy is ranked behind FCFS. As the solution set space increases, the IMBO algorithm is prone to poor performance caused by falling into suboptimal solutions. IACO is the same as HMA in terms of completion rate. Cloud computing is ranked last due to large latency, which results in a low completion rate. We compared the completion rates of high-priority tasks to show the responsiveness of different algorithms to urgent tasks, as shown in Figure 9. Comparing A-C and D-F, we find that the task rescheduling strategy can improve the completion rate of high-priority tasks, which ensures the requirements of the intelligent production line for timesensitive tasks. From the information of A-C, we can conclude that when the number of tasks is less than 60, the HMA algorithm ensures that all high-priority tasks are completed within the fault tolerance time. This verifies that the task priority-based strategy takes time delay and energy consumption as the optimization goal and converges to the optimal solution better than other algorithms. When the number of fog nodes is 20, all high-priority tasks within 100 are completed. For large-scale tasks, adding a certain number of service nodes can effectively improve the task success rate. The task completion rate of nodes 5 and 10 proves that HMA is superior under the limitation of the number of service nodes. Similar to the total completion rate, IACO ranks second, FCFS leads IMBO when the number of tasks is large, and cloud always ranks last. In this paper, the proposed HMA scheduling strategy reduces energy consumption as much as possible by reducing the task delay and increasing the completion rate. The experimental results in terms of completion time, energy consumption, and task completion rate show the same trend, proving the feasibility of the proposed strategy in task scheduling. In summary, the experimental results show that the proposed cloud-fog computing architecture and the HMA algorithm based on task priority can provide a rapid response in the intelligent production line. The energy consumption of the intelligent production line system was also reduced.

Conclusions
This paper highlights the task scheduling problem in intelligent production lines. For the requirement of ultra-low latency, we establish a mathematical model for intelligent production line task scheduling to achieve ultra-low latency and low power consumption of time-sensitive tasks. We transform it into a multi-objective optimization of time delay In this paper, the proposed HMA scheduling strategy reduces energy consumption as much as possible by reducing the task delay and increasing the completion rate. The experimental results in terms of completion time, energy consumption, and task completion rate show the same trend, proving the feasibility of the proposed strategy in task scheduling. In summary, the experimental results show that the proposed cloud-fog computing architecture and the HMA algorithm based on task priority can provide a rapid response in the intelligent production line. The energy consumption of the intelligent production line system was also reduced.

Conclusions
This paper highlights the task scheduling problem in intelligent production lines. For the requirement of ultra-low latency, we establish a mathematical model for intelligent production line task scheduling to achieve ultra-low latency and low power consumption of time-sensitive tasks. We transform it into a multi-objective optimization of time delay and energy consumption. Combining the advantages of cloud computing and fog computing, we propose a cloud-fog computing architecture for intelligent production lines and develop a priority-based task rescheduling strategy to ensure that time-sensitive tasks are prioritized services. In addition, we propose the HMA algorithm with a mixture of IMBO and IACO algorithms to solve the optimization problem. This is the first time that the MBO algorithm is used to solve the task scheduling problem of intelligent production lines. We evaluate the performance of HMA in a simulation environment. We find that as the number of tasks increases, the performance improvement also increases. When the number of tasks is 100 and the number of nodes is 10, the maximum completion time is only 37.8% of cloud, 59.6% of IMBO, and 69.9% of FCFS, while the power consumption is 82.9% of FCFS, and the task completion rate is 5.3 times better than cloud, 1.5 times better than IMBO, and 1.25 times better than FCFS. The experimental results show that our proposed strategy can respond quickly to tasks and reduce energy consumption. In the future, we will enhance the proposed task scheduling strategy in the cloud-fog computing architecture to solve the task flow scheduling problem of intelligent production lines.

Data Availability Statement:
The data presented in this study are available on request from the corresponding author. They are restricted to experimental results.