A Workflow Scheduling Optimization Method Based on Reliability Constraints
By adopting a workflow scheduling optimization method based on reliability constraints in the mobile edge computing environment, using elite strategies and other operations of genetic algorithms, the problem of low reliability of task scheduling in mobile edge computing is solved, and efficient and robust task scheduling and system cost reduction is achieved.
Patent Information
- Application Number
- CN202210512009.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-11
- Publication Date
- 2025-06-03
- Estimated Expiration
- 2042-05-11
AI Technical Summary
The prior art is difficult to achieve fully reliable task scheduling in a mobile edge computing environment, especially in the event of edge server failure, where the reliability of task scheduling is affected.
A workflow scheduling optimization method based on reliability constraints is proposed. By adopting elite strategies, selection, crossover and mutant operations in the genetic algorithm, the global optimization and local search capabilities of the algorithm are enhanced, and the system cost is defined as the weighted sum of time and energy, in order to find the optimal scheduling solution that balances task processing delay and energy consumption.
It improves the success rate of workflow task unloading, reduces the waste of time and energy caused by task failure, and reduces system costs by finding the optimal scheduling solution, significantly improving the robustness and efficiency of scheduling.
Smart Images

Figure CN114791853B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of mobile edge computing environments, and particularly to a workflow scheduling optimization method based on reliability constraints. Background Art
[0002] With the rapid development of wireless network and Internet of Things technologies, mobile devices have become an important part of modern life. Under such circumstances, the amount of data generated by mobile user devices at the network edge is growing rapidly. The server system structure based on the cloud computing model can no longer meet the requirements of latency, energy consumption, etc. in the current network environment. In response to the above problems, mobile edge computing has become an effective solution as a new computing model. Although mobile edge computing transfers computing to the edge network and significantly improves the performance of mobile devices through technologies such as task partitioning and offloading, the mobile edge system still faces many challenges in actual scenarios. Although the central processing unit resources of the edge server are shared for mobile device use, the server will inevitably encounter failures during operation, and server failures greatly affect the reliability of task scheduling, but such problems are rarely noticed.
[0003] The reliability requirement is a key factor in the workflow scheduling and QoS guarantee of mobile devices. For example, in scenarios such as the Internet of Vehicles, meeting the reliability requirements of the workflow is of primary importance, but the existing scheduling algorithms cannot easily achieve completely reliable task scheduling. If the scheduling strategy can meet the reliability requirement target of the workflow, then the task scheduling strategy can also be considered highly reliable. Meeting the reliability requirement of workflow task scheduling is also one of the crucial goals of workflow scheduling.
[0004] In view of the above situation, aiming at the reliability constraint problem of workflow scheduling, the algorithm of the present invention proposes a workflow scheduling optimization method based on reliability constraints to solve the technical problems existing in the prior art. Summary of the Invention
[0005] An object of the present invention is to solve the defects in the existing workflow scheduling algorithms, and proposes a workflow scheduling optimization method based on reliability constraints. By satisfying the reliability constraints, the success rate of workflow task offloading is improved. The elite strategy is adopted in the genetic algorithm, and selection and mutation operations are performed through iteration to enhance the global optimization and local search capabilities of the algorithm. At the same time, the system cost in the scheduling problem of workflow applications is defined as the weighted sum of time and energy, and the optimal solution of workflow scheduling can be found under the condition of balancing task processing delay and energy consumption.
[0006] In order to solve the existing technical problems, the technical solution of the present invention is as follows:
[0007] A workflow scheduling optimization method based on reliability constraints, comprising the following steps:
[0008] Step S1: Model the application programs executed by the mobile device as a workflow;
[0009] Step S2: Process the workflow and generate a workflow scheduling scheme that meets the constraints;
[0010] Step S3: Decode the scheduling scheme generated in Step S2 and schedule tasks to the corresponding server nodes for execution;
[0011] Among them, in Step S1, a workflow model is constructed for the workflow structure to determine the execution order of subtasks; a reliability model for workflow execution is constructed according to the server failure rate; it includes the following steps:
[0012] Step (1.1). Establish a workflow model; represent the workflow with a directed acyclic graph, and the workflow task with reliability constraints is defined as w = {V, E, RD}; where, V = {t 0 , t 1 , …, t n}, i ∈ n is the set of workflow subtasks, E = {(t k , t l , td k,l ) | t k , t l ∈ V} is the dependency relationship between subtasks, t k and t l are the predecessor-successor relationship, td k,l is the data received by t l from t k ; RD is the reliability requirement coefficient of this workflow;
[0013] At the same time, the edge server can only execute one task for the same mobile device. Before task scheduling on the mobile device, the execution order of workflow subtasks must be determined, and the basis for determining the execution sequence is the priority of the tasks. If a task t i has no predecessor task, then the priority of task t i :
[0014] rank(t i ) = 0
[0015] If task t i has a predecessor task, pre(t i ) is the set of predecessor tasks of task t i , then the priority of task t i can be expressed as:
[0016]
[0017] The execution sequence of workflow subtasks is sorted in ascending order according to the priority size;
[0018] Step (1.2). Establish a reliability model; the probability of the server having a hardware failure is represented by a Poisson distribution. Let λ i represent the failure rate of server s i per unit time, then the execution reliability of task t j executed on server s i can be expressed as:
[0019]
[0020] where τ represents the execution time of task t j executed on server s i ;
[0021] For workflow w, assuming that the scheduling positions of each task in its subtask execution sequence V = {t 0 , t 1 ,..., t n} are known, the execution reliability of workflow w can be calculated as:
[0022]
[0023] As a further improvement scheme, step S2 further includes the following steps:
[0024] Step (2.1): Scheduling scheme encoding; encoding, regarding the task number and the server number as a corresponding relationship. Each chromosome represents a workflow scheduling scheme. Assume that the number of subtasks of workflow w is n and the number of servers in the mobile edge environment is m. The chromosome can be represented by a one-dimensional matrix X. Let x i represent the allocation position of the i-th task. The scheduling scheme can be expressed as:
[0025] X = [x 0 x 1 x 2 ... x n
[0026] Step (2.2): Population initialization; the quality of the initial scheduling scheme directly affects the speed of the algorithm to find the optimal scheduling result. Therefore, it is necessary to optimize the initial population. A high-quality initial population can effectively reduce the algorithm search time and improve the search efficiency of the workflow scheduling scheme. When initializing, use a greedy strategy to generate the initial population to ensure the reliability requirements of the workflow scheduling scheme. The specific steps include: First, generate a random integer r i in the range of [0, m], and use r i As the device number unloaded for task i, assuming that all subsequent tasks are unloaded to the server with the highest reliability, and then calculate the execution reliability of workflow w. If this solution meets the reliability requirements, retain the current scheduling position r i , and repeat the above steps for the next task position; if the current solution is unreliable, re-initialize the current position. Finally, after determining the task scheduling positions for all tasks, obtain the chromosome individual X. Let N be the population size, then initialize the population as P k = {X 1 , X 2 , X 3 ,..., X N}.
[0027] Step (2.3): Calculate the fitness; the fitness can show the quality of each individual; the specific steps are as follows:
[0028] Step (2.4): Time calculation; during the workflow scheduling process, the mobile device can calculate the task transmission and execution time based on relevant information.
[0029] Step (2.4.1): Calculate the transmission rate; in the mobile edge environment, the mobile device communicates with the edge server through the wireless cellular network, and the transmission rate of the mobile device affects the data transmission time of the mobile device. Let the mobile device number be 0, B be the transmission bandwidth of the mobile device in the cellular mode, be the transmission signal-to-noise ratio between the mobile device and the edge server at time τ, then the transmission rate between the mobile device and edge server server-j can be expressed as:
[0030]
[0031] Let f local (t i ) be the computing frequency allocated by the mobile device to task t i , cn i be the task computing requirement, then the local execution computing time can be expressed as:
[0032]
[0033] The transmission time of the workflow subtask t i from the device to the edge server is calculated as follows:
[0034]
[0035] where and are the data upload and result download times of the mobile device respectively, The transmission rate for receiving data from the server.
[0036] The execution time of a task on a server node is related to the node performance and the task's computing requirements. The execution time of a task on a server node is defined as:
[0037]
[0038] where f j (t i ) is the computing frequency provided by server node server-j for task t i
[0039] The total execution time of workflow w can be expressed as:
[0040]
[0041] where O represents the set of workflow subtasks executed locally. Q represents the set of workflow subtasks executed on server nodes.
[0042] Step (2.4.2): Energy consumption calculation; The energy consumption of a mobile device in the workflow scheduling model mainly consists of the computing energy consumption during local execution and the transmission energy consumption generated by task offloading.
[0043] When a task is executed locally on a mobile device, the computing energy consumption of the mobile device is:
[0044]
[0045] where P i c is the device power during local computing. Let the data transmission power of the local device to the server be The transmission energy consumption generated by the communication of workflow w is:
[0046]
[0047] The total device energy consumption can be expressed as:
[0048] E = E ex (w) + E trs (w)
[0049] Step (2.4.3): Fitness calculation; The calculation method for particle fitness is as follows:
[0050] f(X) = αE + (1 - α)T
[0051] where E is the device energy consumption, T is the workflow execution time, and α is the weight factor, representing the preference degree of the target optimization function for device energy consumption and execution delay. A higher α generally represents an energy consumption sensitive user, and a lower α generally represents a delay sensitive user.
[0052] Step (2.5): Generate the offspring population Q k : The specific steps are as follows;
[0053] Step (2.5.1): Selection operation; The selection operation can screen individuals so that excellent individuals enter the next iteration, ensuring that the scheduling scheme remains consistent before and after scheduling. The selection operation first calculates the fitness f of individual X i , then takes its reciprocal, let f i r = 1 / f i , calculates the sum sum(f i r ) of all f r , and regards the ratio of f i r in sum(f r ) as the selection probability. Then randomly select individuals through a random function.
[0054] Step (2.5.2): Crossover operation; The crossover operation simulates the process of chromosome crossover and pairing, making the chromosome solutions more diverse. The specific steps are as follows: This operator first randomly selects l discontinuous genes on the parent individuals, exchanges the genes at the same positions of another crossover individual, and then obtains the offspring individuals. The discontinuity of the genes makes the difference between the parent chromosomes and the offspring chromosomes greater, resulting in a larger solution space.
[0055] Step (2.5.3): Mutation operation; The randomness of the mutation operation can expand the sampling space of the workflow scheduling solutions. Set the mutation probability value to θ, calculate a random number through a random function, and then determine whether to mutate by judging whether it is greater than the mutation probability. If mutation is required, mutate a random position of the chromosome.
[0056] Step (2.6): Elite strategy; The elite strategy ensures that excellent individuals can be preserved during the process of generating the workflow scheduling scheme. The specific steps of the elite strategy are as follows:
[0057] Step (2.6.1): Mix the k-th generation population R k with the offspring population Q k to obtain the mixed population R k , and the scale of R k is 2N.
[0058] Step (2.6.2): Perform non-dominated sorting on the population R k ; Let np i represent the number of individuals dominated by other individuals; F j represents the set of individuals in different non-dominated levels; First, set np iIndividuals with =0 are put into the current set F 1 , and the first non-dominated order is denoted as nd=1; then F 1 The dominated individuals are added to the set S 1 , and the individuals in S 1 perform np i =np i -1, and then the individuals with np i =0 are put into the set F 2 , and the set F 2 is denoted as the second non-dominated order nd=2; and so on until each individual is partitioned; the individuals are added to the new population P k+1 layer by layer in ascending order of non-dominated levels until the l-th non-dominated layer is added, and the size of the population P k+1 just does not exceed N
[0059] Step (2.6.3): Calculate the crowding degree i l for individuals at the same level in F . Let i d represent d the density of the surrounding individuals . The specific calculation formula is:
[0060] i d =|E(X k i+1 )-E(X k i-1 )|+|T(X k i+1 )-T(X k i-1 )|
[0061] where is the energy consumption generated by the scheduling under the individual , is the task delay generated by the scheduling under the individual , i-1 and i+1 represent the previous and next individuals respectively; for the individual and the individual if then is ranked before, and sorted according to the crowding degree i d in the l-th non-dominated layer; let num(l) represent the number of individuals in the l-th non-dominated layer, and num(P k+1 ) represent the current number of individuals in the population P k+1 , and take the first num(l)-[num(P k+1 )-N] individuals and add them to the population P k+1 , so that the size of the population P k+1 becomes N, and finally the workflow scheduling scheme Pk+1 .
[0062] Step (2.7): Judgment termination; if the number of iterations reaches the maximum number of iterations, stop the iteration and output the optimal individual;
[0063] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0064] Robustness: The present invention adopts an improved genetic algorithm to find the optimal solution through iteration. In the genetic algorithm, operations such as selection, crossover, and mutation are used to obtain a new generation of offspring population, and the elite strategy is used to retain the excellent individuals in the parent and offspring populations, improving the iteration efficiency and accelerating the chromosome optimization process.
[0065] High efficiency: The algorithm of the present invention takes into account the workflow offloading of mobile devices to the edge server, maximizing the utilization of resources. And considering the execution reliability of the workflow and the system cost, it meets the reliability requirements of the workflow when generating the scheduling scheme, and seeks the optimal scheduling solution during the iteration process. On the one hand, it improves the success rate of workflow execution, reduces the time and energy waste caused by task failure, and on the other hand, it reduces the system cost by finding the optimal scheduling solution. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] Figure 1 It is a system framework diagram of a workflow scheduling optimization method based on reliability constraints provided by the present invention;
[0067] Figure 2 It is an algorithm flowchart of a workflow scheduling optimization method based on reliability constraints provided by the present invention;
[0068] Figure 3 It is a workflow structure diagram provided by the present invention;
[0069] Figure 4 It is a comparison diagram of the present invention and the other three algorithms under different numbers of tasks;
[0070] Figure 5 It is a comparison diagram of the present invention and the other three algorithms under different numbers of server nodes;
[0071] Figure 6 It is a comparison diagram of the offloading success rate of the present invention and the other three algorithms; DETAILED DESCRIPTION OF THE INVENTION
[0072] The following specific embodiments will further illustrate the present invention in conjunction with the above-mentioned drawings.
[0073] The present invention proposes a workflow scheduling optimization method based on reliability constraints, including the following steps:
[0074] Step S1: Model the application executed by the mobile device as a workflow;
[0075] Step S2: Process the workflow and generate a workflow scheduling scheme that meets the constraints;
[0076] Step S3: Decode the scheduling scheme generated in Step S2 and schedule tasks to the corresponding server nodes for execution.
[0077] Figure 1 It is a system framework diagram of a workflow scheduling optimization method based on reliability constraints in the mobile edge. First, the mobile device executes an application, which is modeled as a workflow, and the work can be divided into subtasks. Second, calculate the execution order of tasks according to task priorities to generate an execution queue. Then, use the workflow scheduling algorithm of the present invention to generate a workflow scheduling scheme that meets the constraints. Finally, decode the scheduling scheme and schedule tasks to the corresponding server nodes for execution.
[0078] See Figure 2 , which shows a flowchart of a workflow scheduling optimization method based on reliability constraints in an edge computing environment according to the present invention,
[0079] Specifically, it includes the following steps:
[0080] Step (1): Establish a model; construct a workflow model for the workflow structure to determine the execution order of subtasks; construct a reliability model for workflow execution according to the server failure rate; the steps are as follows:
[0081] Step (1.1). Establish a workflow model; represent the workflow as a directed acyclic graph, and the workflow task with reliability constraints is defined as w = {V, E, RD}; where, V = {t 0 , t 1 , …, t n}, i ∈ n is the set of workflow subtasks, E = {(t k , t l , td k,l ) | t k , t l ∈ V} is the dependency relationship between subtasks, t k and t l are the predecessor-successor relationships, td k,l is the data received by t l from t k ; RD is the reliability requirement coefficient of this work;
[0082] At the same time, the edge server can only execute one task for the same mobile device, and the execution order of workflow subtasks must be determined before the mobile device performs task scheduling. The basis for determining the execution sequence is the priority of the task. If a task t iIf there is no prerequisite task, then for task t i the priority is:
[0083] rank(t i ) = 0
[0084] If task t i has prerequisite tasks, and pre(t i ) is the set of prerequisite tasks of task t i , then the priority of task t i can be expressed as:
[0085]
[0086] The execution sequence of workflow subtasks is sorted in ascending order according to the priority. In the case of the same priority, it is sorted in ascending order according to the maximum task start time. Figure 3 is a specific workflow instance w, and the execution sequence generated by this workflow is {1, 6, 2, 5, 3, 4, 7, 8, 9, 10}.
[0087] Step (1.2). Establish a reliability model; there are random hardware failures in the servers in the mobile edge environment. When a random failure occurs on the server side, users often need to re - transmit and calculate tasks, resulting in a large waste of time and energy consumption. In this model, the probability of a server hardware failure is represented by a Poisson distribution, which is defined as the probability that the server works normally within a given time interval. Different servers have different failure rates. Let λ i represent the failure rate of server s i per unit time, then the execution reliability of task t j executed on server s i can be expressed as:
[0088]
[0089] where τ represents the execution time of task t j on server s i .
[0090] For workflow w, assuming that the scheduling positions of each task in its subtask execution sequence V = {t 0 , t 1 , …, t n} are known, then the execution reliability of workflow w can be calculated as:
[0091]
[0092] In a preferred embodiment, step S2 further includes the following steps:
[0093] Step (2.1): Scheduling scheme encoding; Encoding, regarding the task number and the server number as a corresponding relationship. Each chromosome represents a workflow scheduling scheme. Assume that the workflow w has n subtasks and there are m servers in the mobile edge environment. The chromosome can be represented by a one-dimensional matrix X. Let x i represent the allocation position of the i-th task. The scheduling scheme can be expressed as:
[0094] X = [x 0 x 1 x 2 ...x n
[0095] Step (2.2): Population initialization; The quality of the initial scheduling scheme directly affects the speed of the algorithm to find the optimal scheduling result. Therefore, it is necessary to optimize the initial population. A high-quality initial population can effectively reduce the algorithm search time and improve the search efficiency of the workflow scheduling scheme. When initializing, use the greedy strategy to generate the initial population to ensure the reliability requirements of the workflow scheduling scheme. The specific steps include: First, generate a random integer r i in the range of [0, m], and use r i as the device number to which task i is offloaded. Assume that all subsequent tasks are offloaded to the server with the highest reliability, and then calculate the execution reliability of the workflow w. If this scheme meets the reliability requirements, retain the current scheduling position r i , and repeat the above steps for the next task position; if the current scheme is unreliable, re-initialize the current position. Finally, after all tasks have determined their task scheduling positions, the chromosome individual X is obtained. Let N be the population size, then the initial population is P k = {X 1 , X 2 , X 3 ,..., X N}.
[0096] Step (2.3): Calculate fitness; Fitness can show the quality of each individual; The specific steps are:
[0097] Step (2.4): Time calculation; During the workflow scheduling process, the mobile device can calculate the task transmission and execution time according to relevant information.
[0098] Step (2.4.1): Calculate the transmission rate; In the mobile edge environment, the mobile device communicates with the edge server through the wireless cellular network. The transmission rate of the mobile device affects the data transmission time of the mobile device. Let the mobile device number be 0, B be the transmission bandwidth of the mobile device in the cellular mode, Let $\gamma_{\tau}$ be the transmission signal-to-noise ratio between the mobile device and the edge server at time $\tau$. Then the transmission rate between the mobile device and edge server server-j can be expressed as: It can be expressed as:
[0099]
[0100] Let $f$ local (t i ) be the computing frequency allocated by the mobile device to task $t$ i . If $c_n$ i is the task computing requirement, then the local execution computing time can be expressed as:
[0101]
[0102] The transmission time of workflow subtask $t$ i from the device to the edge server is calculated as follows: The calculation is as follows:
[0103]
[0104] Where and are the times for the mobile device to upload data and download results respectively, and is the transmission rate for receiving data from the server.
[0105] The execution time of a task on a server node is related to the node performance and the task computing requirement. The task execution time on the server node is defined as:
[0106]
[0107] Where $f$ j (t i ) is the computing frequency provided by server node server-j for task $t$ i .
[0108] The total execution time of workflow $w$ can be expressed as:
[0109]
[0110] Where $O$ represents the set of workflow subtasks executed locally. $Q$ represents the set of workflow subtasks executed on the server node.
[0111] Step (2.4.2): Energy consumption calculation; The energy consumption of the mobile device in the workflow scheduling model mainly consists of the computing energy consumption during local execution and the transmission energy consumption generated by task offloading.
[0112] When the task is executed locally on the mobile device, the mobile device computing energy consumption is:
[0113]
[0114] where P i c is the device power during local calculation. Assume that the data transmission power from the local device to the server is The transmission energy consumption generated by the communication of workflow w is:
[0115]
[0116] The total device energy consumption can be expressed as:
[0117] E = E ex (w) + E trs (w)
[0118] Step (2.4.3): Fitness calculation; The calculation method of particle fitness is as follows:
[0119] f(X) = αE + (1 - α)T
[0120] where E is the device energy consumption, T is the workflow execution time, and α is the weight factor, representing the preference degree of the objective optimization function for device energy consumption and execution delay. A higher α generally represents an energy consumption-sensitive user, and a lower α generally represents a delay-sensitive user.
[0121] Step (2.5): Generate the offspring population Q k : The specific steps are as follows;
[0122] Step (2.5.1): Selection operation; The selection operation can screen individuals, enabling excellent individuals to enter the next iteration and ensuring that the scheduling scheme remains consistent before and after scheduling. The selection operation first calculates the fitness f of individual X i , then takes its reciprocal, and let f i r = 1 / f i , calculates the sum sum(f i r ) of all f r , and regards the ratio of f i r in sum(f r ) as the selection probability. Then randomly select individuals through a random function.
[0123] Step (2.5.2): Crossover operation; The crossover operation simulates the process of chromosome crossover and pairing, making the chromosome solutions more diverse. The specific steps are as follows: This operator first randomly selects l discontinuous genes on the parent individuals, exchanges the genes at the same positions of another crossover individual, and then obtains the offspring individuals. The discontinuity of the genes makes the difference between the parent chromosomes and the offspring chromosomes greater, resulting in a larger solution space.
[0124] Step (2.5.3): Mutation operation; the randomness of the mutation operation can expand the sampling space of the workflow scheduling solution. Set the mutation probability value to θ, calculate a random number through a random function, and then determine whether to mutate by checking if it is greater than the mutation probability. If mutation is required, mutate a random position in the chromosome.
[0125] Step (2.6): Elite strategy; the elite strategy ensures that excellent individuals can be preserved during the process of generating the workflow scheduling scheme. The specific steps of the elite strategy are as follows:
[0126] Step (2.6.1): Mix the k-th generation population R k with the offspring population Q k to obtain a mixed population R k , and the size of R k is 2N.
[0127] Step (2.6.2): Perform non-dominated sorting on the population R k . Let np i represent the number of individuals dominated by other individuals; F j represent the set of individuals in different non-dominated levels; first, put the individuals with np i =0 into the current set F 1 , denoted as the first non-dominated order nd = 1; then add the individuals dominated by F 1 to the set S 1 , and for the individuals in S 1 , execute np i = np i -1. Then, put the individuals with np i =0 into the set F 2 , and denote the set F 2 as the second non-dominated order nd = 2; and so on until each individual is classified; add the individuals to the new population P k+1 layer by layer in ascending order of the non-dominated levels until adding to the l-th non-dominated layer, and the size of the population P k+1 just does not exceed N.
[0128] Step (2.6.3): Calculate the crowding degree i l for the individuals at the same level in F . Let i d represent d the density of the individuals around . The specific calculation formula is:
[0129] i d = |E(X k i+1 ) - E(Xk i-1 )|+|T(X k i+1 )-T(X k i-1 )|
[0130] where is the energy consumption generated by the scheduler under individual , is the task delay generated by the scheduler under individual , i - 1 and i + 1 respectively represent the previous and next individuals; for individual and individual if then is ranked before, and sorted according to the crowding degree i of individuals in the l-th non-dominated layer d ; let num(l) represent the number of individuals in the l-th non-dominated layer, and num(P k+1 ) represent the current number of individuals in population P k+1 , take the first num(l) - [num(P k+1 ) - N] individuals to join population P k+1 , so that the size of population P k+1 becomes N, and finally the workflow scheduling scheme P k+1 is obtained.
[0131] Step (2.7): Judge termination; if the number of iterations reaches the maximum number of iterations, stop the iteration and output the optimal individual;
[0132] To demonstrate the effectiveness of the method of the present invention, it is respectively compared with the round-robin task scheduling algorithm RR, the scheduling algorithm Greedy based on the greedy strategy, and the workflow scheduling method PSO based on the particle swarm algorithm in terms of system cost and execution success rate.
[0133] The experiment uses the IntelliJ IDEA platform as the simulation platform and runs on a desktop computer configured with AMD-3600, 16GB, win10 64-bit. The DAG simulator is used to generate the workflow, and the number of tasks in the workflow follows a Poisson distribution with a parameter of 50. The transmission bandwidth of the mobile device B = 10MHz, the transmission rate is 5Mbps, the data transmission power is 100mW, the data reception power is 50mW, the default CPU frequency is 1500MHz, and the running power consumption of the mobile device during calculation is 0.5W. The CPU computing power of the edge server is 5000MHZ, and the number of edge servers ranges from [5, 25]. The failure rate follows a Poisson distribution with a parameter of 2. The population size of the algorithm of the present invention is set to 50, the number of iterations is set to 800, the mutation probability θ = 0.5, ρ = 0.3, the weight coefficient α = 0.6, and l = 3 in the crossover operation.
[0134] To explore the comparison of the system costs of the algorithm of the present invention under different conditions, this experiment compared the performance of the algorithm of the present invention with other algorithms in terms of the number of workflows, the number of edge service nodes, etc.
[0135] Figure 4 The differences in the system costs of each algorithm were compared when the number of workflow tasks changed. In this experiment, the number of subtasks of the workflow was 20 - 100, and the number of servers was fixed at 15. When the number of tasks was 20, there was little difference among the RR, PSO, Greedy algorithms and the algorithm of the present invention. As the number of tasks increased, the advantages of the algorithm of the present invention gradually emerged. Since the task has a reliability constraint, incorrect offloading may result in the task being offloaded to a server with a lower reliability coefficient. Once the server fails, task retransmission will cause extremely long time consumption and extend the execution time of the task. The present invention meets the reliability requirements during the initialization of the task scheduling scheme, schedules tasks to high-reliability servers, and reduces the possibility of task failures. When scheduling tasks, the algorithm of the present invention is more inclined to offload computationally intensive tasks to edge servers while retaining data-intensive tasks for local execution, and tasks without dependency relationships can be processed in parallel on different servers through scheduling, thereby maintaining a relatively lower workflow execution time compared to other algorithms. And when scheduling, the energy consumption cost is considered, and the system cost is reduced by optimizing the fitness.
[0136] Figure 5 The changes in the system costs of the four algorithms under different server nodes are shown. It can be seen from the figure that when the number of nodes of all algorithms is small, the difference in system costs is small. When the number of nodes increases, compared with the other algorithms, PSO and the algorithm of the present invention show lower system costs. This is because PSO and the algorithm of the present invention find more suitable solutions through iterative search during the scheduling process. The reason why the algorithm of the present invention has the best performance is that it generates sufficiently excellent scheduling solutions through means such as gene mutation and elite strategy, so that tasks are assigned to appropriate base stations, ensuring that tasks meet the reliability while reducing energy consumption and task execution time, so as to achieve the optimal energy and time weighting.
[0137] Figure 6 The changes in the offloading success rates of the four algorithms under different task numbers are shown. It can be seen from the figure that as the number of tasks increases, the offloading success rates of the four algorithms all decrease. This is because the reliability of workflow execution is the product of the reliability coefficients of each subtask and the reliability coefficient is less than 1. The increase in the number of workflows will inevitably lead to a decrease in the reliability of workflow execution. However, compared with the other three algorithms, the present invention can meet the reliability requirements when generating the initial scheduling solution, maximize the reliability of the initial scheduling solution, and obtain the optimal scheduling solution through iterative learning.
[0138] The description of the above embodiments is only used to help understand the method and its core idea of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the protection scope of the claims of the present invention.
[0139] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to these embodiments shown herein, but rather to the broadest scope consistent with the principles and novel features disclosed herein.
Claims
1. A workflow scheduling optimization method based on reliability constraints, characterized in that, it includes the following steps: Step S1: Model the application programs executed by the mobile device as a workflow; Step S2: Process the workflow and generate a workflow scheduling scheme that meets the constraints; Step S3: Decode the scheduling scheme generated in Step S2 and schedule tasks to the corresponding server nodes for execution; Among them, in Step S1, a workflow model is constructed for the workflow structure to determine the execution order of subtasks; a reliability model for workflow execution is constructed according to the server failure rate; it includes the following steps: Step (1.1). Establish a workflow model; represent the workflow as a directed acyclic graph, and define the workflow task with reliability constraints as w = {V, E, RD}; where, V = {t 0 , t 1 , …, t n}, i ∈ n is the set of workflow subtasks, E = {(t k , t l , td k,l ) | t k , t l ∈ V} is the dependency relationship between subtasks, t k and t l are the predecessor-successor relationship, td k,l is the data received by t l from t k ; RD is the reliability requirement coefficient of this work; At the same time, the edge server can only execute one task for the same mobile device. Before the mobile device performs task scheduling, it must determine the execution order of the workflow subtasks. The basis for determining the execution sequence is the priority of the tasks. If a task t i has no prerequisite tasks, then the priority of task t i is: rank(t i ) = 0 If task t i has a prerequisite task, pre(t i ) is the set of prerequisite tasks for task t i , then the priority of task t i can be expressed as: The execution sequence of workflow subtasks is sorted in ascending order according to the priority size; Step (1.2). Establish a reliability model; the probability of the server having a hardware failure is represented by a Poisson distribution. Let λ i represent the failure rate of server s i per unit time, then the execution reliability of task t j executed on server s i can be expressed as: where τ represents the task t j executed on the server s i and the execution time; For workflow w, assume that for the execution sequence V = {t 0 , t 1 ,..., t n} of its subtasks, the scheduling positions of each task are known. Then, the execution reliability of workflow w can be calculated as: Step S2 includes the following steps: Step (2.1): Scheduling scheme encoding; during encoding, the task number and the server number are regarded as a corresponding relationship; each chromosome represents a workflow scheduling scheme; assume that the number of subtasks of workflow w is n, and the number of servers in the mobile edge environment is m; the chromosome is represented by a one-dimensional matrix X, and let x i represent the allocation position of the i-th task; the scheduling scheme can be expressed as: X = [x 0 x 1 x 2 ...x n Step (2.2): Population initialization; Generate the initial population using the greedy strategy, including the following steps: First, generate a random integer r in the range [0, m]. i , and use r i as the device number to which task i is offloaded. Assume that all subsequent tasks are offloaded to the server with the highest reliability, and then calculate the execution reliability of workflow w; if this solution meets the reliability requirements, then retain the current scheduling position r i , and repeat the above steps for the next task position; if the current solution is unreliable, then re-initialize the current position; finally, after determining the task scheduling positions for all tasks, obtain the chromosome individual X; Let N be the population size, then the initial population is P k = {X 1 , X 2 , X 3 ,..., X N}; Step (2.3): Calculate the fitness; among them, it includes: Step (2.4): Time calculation; During the workflow scheduling process, the mobile device can calculate the task transmission and execution time according to relevant information; Step (2.4.1): Calculate the transmission rate; Let the mobile device number be 0, B be the transmission bandwidth of the mobile device in the cellular mode, be the transmission signal-to-noise ratio between the mobile device and the edge server at time τ, then the transmission rate between the mobile device and edge server server-j can be expressed as: Let f local (t i ) be the computing frequency allocated by the mobile device to task t i , and cn i be the computing requirement of the task. Then the local execution computing time can be expressed as: Workflow sub-task t i Transfer time from device to edge server The calculation method is as follows: wherein and are the times for data upload and result download of the mobile device respectively, is the transmission rate for receiving data from the server; The execution time of a task on a server node is related to the node performance and the task calculation requirements. The execution time of a task on a server node is defined as: Among them, f j (t i ) is the computing frequency provided by server node server-j for task t i ; The total execution time of workflow w can be expressed as: Among them, O represents the set of workflow subtasks executed locally; Q represents the set of workflow subtasks executed on the server node; Step (2.4.2): Energy consumption calculation; When a task is executed locally on the mobile device, the mobile device calculates the energy consumption as: Among them is the device power during local calculation; assume the data transmission power from the local device to the server is The transmission energy consumption generated by the communication of workflow w is: The total device energy consumption can be expressed as: E = E ex (w) + E trs (w) Step (2.4.3): Fitness calculation; The calculation method of particle fitness is as follows: f(X) = αE+(1 - α)T Where E is the device energy consumption, T is the workflow execution time, and α is the weight factor, representing the preference degree of the target optimization function for device energy consumption and execution delay; a higher α generally represents an energy consumption-sensitive user, and a lower α generally represents a delay-sensitive user; Step (2.5): Generate the offspring population Q k : The specific steps are as follows; Step (2.5.1): Select an operation; first calculate the fitness f of individual X i , then take its reciprocal, let f i r = 1 / f i , calculate the sum sum(f ) of all r , and regard the ratio that occupies in sum(f r ) as the selection probability; then randomly select an individual through a random function; Step (2.5.2): Crossover operation; The specific steps are as follows: The operator first randomly selects l discontinuous genes on the parent individual and exchanges the genes at the same position of another crossover individual, and then obtains the offspring individual; The discontinuity of the genes makes the difference between the parent chromosome and the offspring chromosome larger, making the solution space larger; Step (2.5.3): Mutation operation; Set the mutation probability value to θ, calculate a random number through a random function, and then judge whether it is greater than the mutation probability to determine whether mutation is needed; If mutation is needed, mutate a random position of the chromosome; Step (2.6): Elite strategy; The specific steps of the elite strategy are as follows: Step (2.6.1): Mix the k-th generation population R k with the offspring population Q k to obtain the mixed population R k , and the size of R k is 2N; Step (2.6.2): For population R k perform non-dominated sorting; let np i represent the number of individuals dominated by other individuals; F j represent the set of individuals in different non-dominated levels; first, put the individuals with np i = 0 into the current set F 1 , denoted as the first non-dominated order nd = 1; then add the individuals dominated by F 1 to the set S 1 , and perform np 1 = np i - 1 for the individuals in S i , and then put the individuals with np i = 0 into the set F 2 , and denote the set F 2 as the second non-dominated order nd = 2; and so on until each individual is classified; add the individuals layer by layer in ascending order of non-dominated levels to the new population P k+1 , until adding to the l-th non-dominated level, and the size of the population P k+1 just does not exceed N; Step (2.6.3): For F l individuals at the same level calculate the crowding degree i d ; Let i d represent the density of surrounding individuals; the specific calculation formula is: Among them is the energy consumption generated by the scheduler under individual . is the task delay generated by the scheduler under individual . i - 1 and i + 1 respectively represent the previous and next individuals; for individual and individual If then will be ranked before. Sort according to the crowding degree i of individuals in the l-th non-dominated layer d . Let num(l) represent the number of individuals in the l-th non-dominated layer, and num(P k+1 ) represent the current number of individuals in population P k+1 . Select the first num(l) - [num(P k+1 ) - N] individuals to join population P k+1 , so that the size of population P k+1 becomes N, and finally obtain the workflow scheduling scheme P k+1 . Step (2.7): Judgment of termination; If the number of iterations reaches the maximum number of iterations, stop the iteration and output the optimal individual.