A task scheduling method, device, and storage medium for fog computing

The collection competition particle swarm optimization algorithm optimizes task allocation in fog computing systems, addressing inefficiencies in heterogeneous resource scheduling by maximizing system profit and adhering to resource constraints, thereby improving scheduling efficiency and quality.

CN115964144BActive Publication Date: 2025-07-15SOUTH CHINA UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211591219.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-12
Publication Date
2025-07-15
Estimated Expiration
2042-12-12

AI Technical Summary

Technical Problem

In the fog computing system, due to the increase in heterogeneous computing resources, it is more difficult to schedule computing tasks, and it is difficult for the existing technology to design an effective scheduling plan to ensure system benefits.

Method used

A scheduling model for task and computing nodes is established using a collective competition particle swarm algorithm, and the task allocation plan is optimized by using system profit as the objective function, combined with constraints such as cutoff time and memory space.

Benefits of technology

It improves the efficiency and quality of task scheduling, overcomes the local optimization problem of traditional algorithms, and achieves better global optimization results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115964144B_ABST
    Figure CN115964144B_ABST
Patent Text Reader

Abstract

The present invention discloses a task scheduling method, device, and storage medium for fog computing. The method includes: obtaining tasks to be scheduled and information available for computing nodes; using the tasks and the information as parameters to establish a mathematical model for the scheduling scheme of computing tasks and computing nodes, and taking the system profit of the scheduling scheme as the objective function; adopting a set competition particle swarm algorithm, and according to the objective function, calculating the allocation scheme of each task to be allocated to a computing node under the condition of satisfying preset constraint conditions. The present invention uses a set competition particle swarm algorithm to solve the allocation scheduling problem of computing tasks to computing nodes. By considering the total revenue of the system and the constraints of the system in aspects such as task response time and node memory capacity, the scheduling of tasks to nodes is expressed as a global optimization problem, providing better performance and efficiency. The present invention can be widely applied to the technical fields of fog computing and task scheduling.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical fields of fog computing and task scheduling, and particularly to a task scheduling method, device and storage medium for fog computing. Background Art

[0002] With the development of intelligent Internet of Things technology, intelligent terminals provide people with more and more abundant intelligent services. However, there are also problems that small terminals often cannot bear the computing overhead required for intelligent services, and the number of cloud computing nodes is small, the distance is far, and the transmission delay is high. The fog computing system fills the gap between the terminal and the cloud node by deploying a large number of small computing resources at near-terminal positions such as base stations. However, the large number of increased heterogeneous computing resources and the different requirements of computing tasks in terms of computing complexity, response time, memory space, etc. have all increased the difficulty of task scheduling. How to design a satisfactory scheduling scheme to ensure the benefits of the system has gradually become an important and challenging problem. Summary of the Invention

[0003] To solve at least one of the technical problems existing in the prior art to a certain extent, an object of the present invention is to provide a task scheduling method, device and storage medium for fog computing.

[0004] The technical solution adopted by the present invention is as follows:

[0005] A task scheduling method for fog computing includes the following steps:

[0006] Obtain the tasks to be scheduled and the information available for computing nodes;

[0007] Taking the obtained tasks and the information as parameters, establish a mathematical model for the scheduling scheme of computing tasks and computing nodes, and take the system profit of the scheduling scheme as the objective function; the system profit is measured by the net profit after subtracting the total system overhead from the total system commission;

[0008] Adopt a set competitive particle swarm algorithm, and according to the objective function, calculate the allocation scheme of each task to be allocated to a computing node under the condition of meeting the preset constraint conditions.

[0009] Further, the step of adopting a set competitive particle swarm algorithm, and according to the objective function, calculating the allocation scheme of each task to be allocated to a computing node under the condition of meeting the preset constraint conditions includes:

[0010] A1. Taking the scheduling schemes of all tasks as individuals, calculate the values corresponding to the dimensions of the tasks and the dimensions of the computing nodes to which they are allocated, encode the individuals, and initialize the population;

[0011] A2. Evaluate the objective function value of each particle according to the current allocation scheme of the particle;

[0012] A3. Randomly select two unupdated particles from the population repeatedly and update the velocity vectors of the selected particles until all particles have been selected once;

[0013] A4. Update the positions of all particles that lost in the comparison in A3;

[0014] A5. Execute a local search strategy on the particle that is currently the best in the population;

[0015] A6. Iteratively execute steps A2 - A5 until a preset termination condition is reached, and take the best individual in the global scope as the final task scheduling solution.

[0016] Furthermore, in step A1, a greedy initialization including a random process is used for population initialization, specifically including:

[0017] A11. Arrange all tasks to be assigned in descending order of deadline urgency;

[0018] A12. Select the task with the closest current deadline in sequence with a preset probability, otherwise randomly select a task from the remaining unassigned tasks;

[0019] A13. Assign the selected task to the node with the largest net income among all computing nodes that meet the constraint conditions;

[0020] A14. Repeat steps A11 - A13 until all tasks are assigned or no computing node that meets the constraint can be found for all remaining tasks.

[0021] Furthermore, the objective function value in step A2 is obtained by calculating through the following formula:

[0022]

[0023] where I is the total number of tasks, J is the total number of computing devices, a ij is a scheduling variable. When x i = j, a ij = 1, otherwise a ij = 0, R i is the total commission of task i, is the transmission overhead from task i to node j, usually including bandwidth costs, transmission electricity costs, etc., is the computing overhead of task i on node j, usually including computing electricity costs, equipment losses, etc.

[0024] Furthermore, each dimension of the velocity vector in step A3 is defined as a set composed of several node - probability pairs, satisfying the following representation:

[0025]

[0026] Wherein, U i is all the deployable computing nodes for task i, and p(j) is the probability of task i considering node j;

[0027] The velocity vector is updated through the following formula:

[0028]

[0029] Among them, the subscripts win and loss respectively refer to the particle with the larger objective function value and the particle with the smaller objective function value among the two particles; the superscript i represents the dimension, r1 and r2 are random numbers in the interval [0, 1]; c is the acceleration coefficient.

[0030] Furthermore, the operator used in step A3 is based on the following definition:

[0031] (1) Scalar multiplication operation of the velocity set:

[0032]

[0033]

[0034] (2) Difference set operation of the position set:

[0035]

[0036]

[0037] (3) Addition operation of the velocity set:

[0038]

[0039] Furthermore, in step A4, the position of the particle is updated in the following manner:

[0040] A41. Select elements from the probability of each dimension in the velocity set to form a candidate node set node i ={j|j∈U i and p(j)>α}, where α is a random number in the interval [0, 1];

[0041] A42. For each dimension of the particle, arrange the candidate nodes in descending order of revenue, and check in turn whether the constraints during deployment are satisfied. If satisfied, assign task i to this node and end the update of this dimension;

[0042] A43. If there is no feasible node in the candidate node set, check whether the deployment node of task i in the current position of the particle satisfies the constraints during deployment. If satisfied, assign task i to this node and end the update of this dimension;

[0043] A44. If the deployment node of task i at the current position is also infeasible, all deployable nodes U i in the nodes will arrange the candidate nodes in descending order of revenue, and check in turn whether the deployment constraints are met. If they are met, task i will be assigned to this node, and the update of this dimension will end.

[0044] Further, step A5 specifically includes:

[0045] A51. Randomly change the deployment nodes of tasks with a ratio not exceeding a preset ratio in the allocation scheme of the optimal particle in the current population;

[0046] A52. Evaluate the new allocation scheme. If the new scheme is better than the current scheme, replace the scheme of the optimal particle in the current population with the new scheme;

[0047] A53. Repeat steps A51 - A52 until the preset requirements are met.

[0048] Further, the set of constraints includes the deadline constraint of the computing task, the profit constraint of the task, and the memory space constraint of the computing node;

[0049] The task scheduling method is applied to single - cycle computing task scheduling or multi - cycle computing task scheduling; when performing multi - cycle computing task scheduling, the computing tasks not allocated in the current cycle will automatically enter the task list to be allocated in the next cycle until the task is successfully allocated or fails due to timeout.

[0050] Another technical solution adopted by the present invention is:

[0051] A fog computing task scheduling device, comprising:

[0052] At least one processor;

[0053] At least one memory for storing at least one program;

[0054] When the at least one program is executed by the at least one processor, the at least one processor implements the above - mentioned method.

[0055] Another technical solution adopted by the present invention is:

[0056] A computer - readable storage medium, in which a processor - executable program is stored, and the processor - executable program is used to execute the above - mentioned method when executed by a processor.

[0057] The beneficial effects of the present invention are as follows: The present invention uses the collective competitive particle swarm optimization algorithm to solve the allocation and scheduling problem of computing tasks to computing nodes. By considering the total revenue of the system and the constraints of the system in terms of task response time, node memory capacity, etc., the scheduling of tasks to nodes is formulated as a global optimization problem, providing better performance and efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following introduces the relevant technical solution drawings in the embodiments of the present invention or the prior art. It should be understood that the drawings introduced below are only for conveniently and clearly presenting some embodiments of the technical solutions in the present invention. For those skilled in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0059] Figure 1 is a flowchart of the steps of a task scheduling method for fog computing in an embodiment of the present invention;

[0060] Figure 2 is a schematic diagram of the communication topology of fog computing devices adopted in an embodiment of the present invention;

[0061] Figure 3 is a schematic diagram of the particle position encoding method adopted in an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0062] The embodiments of the present invention will be described in detail below. The examples of the embodiments are shown in the drawings, where the same or similar reference numerals represent the same or similar elements or elements with the same or similar functions from beginning to end. The embodiments described below with reference to the drawings are exemplary and are only used to explain the present invention, and should not be construed as a limitation to the present invention. For the step numbers in the following embodiments, they are only set for the convenience of elaboration and explanation, and no limitation is imposed on the order between the steps. The execution order of each step in the embodiments can be adaptively adjusted according to the understanding of those skilled in the art.

[0063] In the description of the present invention, it should be understood that for the orientation description, such as the orientation or positional relationship indicated by up, down, front, back, left, right, etc., is based on the orientation or positional relationship shown in the drawings. It is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be construed as a limitation to the present invention.

[0064] In the description of the present invention, "several" means one or more, "multiple" means more than two, "greater than", "less than", "exceeding", etc. are understood not to include the corresponding number, and "above", "below", "within", etc. are understood to include the corresponding number. If "first" and "second" are described, they are only used to distinguish technical features and cannot be understood as indicating or implying relative importance or implicitly indicating the quantity of the indicated technical features or the sequence relationship of the indicated technical features.

[0065] In the description of the present invention, unless otherwise clearly defined, terms such as "set", "install", "connect", etc. should be understood in a broad sense, and those skilled in the art can reasonably determine the specific meanings of the above terms in the present invention in combination with the specific content of the technical solution.

[0066] The particle swarm optimization algorithm is a kind of global search algorithm that simulates the behavior of bird flocks in nature and has achieved excellent performance in continuous optimization problems. The set competitive particle swarm optimization algorithm is a discretized version of the competitive swarm algorithm using a set-based representation method. By introducing set-based representations and operators, the reasonable migration of the competitive swarm algorithm from continuous optimization problems to discrete optimization problems is realized, and good optimization performance is demonstrated. Using the set competitive particle swarm optimization algorithm can effectively overcome the problem that the traditional greedy algorithm falls into local optimality due to shortsightedness and the problem of long optimization time of the genetic algorithm, providing a new feasible way to further improve the performance and efficiency of fog computing task scheduling.

[0067] As Figure 1 shown, this embodiment provides a task scheduling method for fog computing, aiming to solve the problems of low task scheduling efficiency and poor globality caused by the increase of heterogeneous computing nodes and computing tasks in the prior art. The method specifically includes the following steps:

[0068] S1. Obtain the tasks to be scheduled and the information available for computing nodes.

[0069] In this embodiment, the information available for computing nodes includes the size of the computing task, computing complexity, deadline, task commission, publishing terminal ID, and the computing frequency, memory size, computing power consumption of each computing node, as well as the bandwidth and power of the transmission channel, etc.

[0070] S2. Using the tasks and information as parameters, establish a mathematical model for the scheduling scheme of computing tasks and computing nodes, and use the system profit of the scheduling scheme as the objective function.

[0071] In this embodiment, the system profit is measured by the net profit after subtracting the total system overhead from the total system commission.

[0072] S3. Use the collective competitive particle swarm optimization algorithm to calculate the allocation plan of each task to be allocated to the computing nodes according to the objective function under the condition of meeting the preset constraint conditions.

[0073] In this embodiment, the preset constraint conditions include the deadline constraint of the computing task, the profit constraint of the task, and the memory space constraint of the computing node.

[0074] Among them, step S3 specifically includes steps S31 - S36:

[0075] S31. Take the scheduling plans of all tasks as individuals, calculate the values corresponding to the tasks as dimensions and the computing nodes assigned to as dimensions, encode the individuals, and initialize the population.

[0076] As an optional implementation manner, step S31 specifically includes the following steps S311 - S314:

[0077] S311. Arrange all tasks to be allocated in descending order of deadline.

[0078] S312. Select the task with the closest current deadline in order with a probability of 0.9, otherwise randomly select a task from the remaining unallocated tasks.

[0079] S313. Allocate this task to the node with the largest net income among all computing nodes that meet the constraint conditions.

[0080] S314. Repeat steps S312 - S313 until all tasks are allocated or none of the remaining tasks can find any computing node that meets the constraints.

[0081] S32. Evaluate the objective function value of each particle according to the current allocation plan of the particle.

[0082] As an optional implementation manner, the objective function value of the particle in step S32 is calculated based on the following formula:

[0083]

[0084] Among them, I is the total number of tasks, J is the total number of computing devices, a ij is the scheduling variable. When x i = j, a ij = 1, otherwise a ij = 0, R i is the total commission of task i, is the transmission overhead from task i to node j, usually including bandwidth costs, transmission electricity costs, etc., is the computing overhead of task i on node j, usually including computing electricity costs, equipment losses, etc.

[0085] S33. Randomly select two unupdated particles from the population repeatedly and update the velocities of the selected particles until all particles have been selected once. The velocity update formula is as follows:

[0086]

[0087] where the subscripts win and loss refer to the particle with the larger objective function value and the particle with the smaller objective function value among the two particles respectively; the superscript i represents the dimension, r1 and r2 are random numbers in the interval [0, 1]; c is the acceleration coefficient.

[0088] As an optional implementation, each dimension of the velocity vector in step S33 is defined as a set consisting of several node, probability pairs, which satisfies the following representation:

[0089] v i ={j / p(j)|j∈U i}

[0090] where U i is all the deployable computing nodes for task i, and p(j) is the probability of considering node j for task i.

[0091] Furthermore, as an optional implementation, the operators used in step S33 are based on the following definitions:

[0092] (1) Scalar multiplication operation of the velocity set:

[0093]

[0094]

[0095] (2) Difference set operation of the position set:

[0096]

[0097]

[0098] (3) Addition operation of the velocity set:

[0099]

[0100] S34. Update the positions of all the particles that lost in the comparison in S33.

[0101] As an optional implementation, the position update in step S34 includes the following steps S341 - S345:

[0102] S341. Select elements from the probability of each dimension in the velocity set to form the candidate node set node i ={j|j∈U iand p(j)>α}, where α is a random number in the interval [0, 1].

[0103] S342. For each dimension of the particle, arrange the candidate nodes in descending order of profit, and sequentially check whether the constraints during deployment are satisfied. If satisfied, assign task i to this node and end the update of this dimension.

[0104] S343. If there is no feasible node in the candidate node set, check whether the deployment node of task i in the current position of the particle satisfies the constraints during deployment. If satisfied, assign task i to this node and end the update of this dimension.

[0105] S345. If the deployment node of task i in the current position is also infeasible, arrange the nodes in all deployable node sets U i in the candidate nodes in descending order of profit, and sequentially check whether the constraints during deployment are satisfied. If satisfied, assign task i to this node and end the update of this dimension.

[0106] S35. Execute the local search strategy on the particle that is currently the best in the population.

[0107] As an optional implementation manner, step S35 includes the following steps S351 - S353:

[0108] S351. Randomly change the deployment nodes of no more than 5% of the tasks in the allocation scheme of the currently best particle in the population.

[0109] S352. Evaluate the new allocation scheme. If the new scheme is better than the current scheme, replace the scheme of the currently best particle in the population with the new scheme.

[0110] S353. Repeat steps S351 - S352 until the specified number of times is reached.

[0111] S36. Iteratively execute steps S32 - S35 until the preset maximum number of iterations is reached or it is detected that the globally best individual has converged, and use the globally best individual as the final task scheduling scheme.

[0112] Further as an optional implementation manner, the task scheduling method of this embodiment can be applied to scheduling single - cycle and multi - cycle computing tasks. When performing multi - cycle computing task scheduling, the computing tasks not allocated in the current cycle will automatically enter the task list to be allocated in the next cycle until the tasks are successfully allocated or fail due to timeout.

[0113] The above - mentioned method is explained in detail below in conjunction with the accompanying drawings and specific embodiments.

[0114] This embodiment provides a fog computing task scheduling method based on a set - competition particle swarm algorithm, specifically including the following steps:

[0115] S101. Obtain the information of the tasks to be scheduled and the available computing nodes. The information includes the size, computational complexity, deadline, task commission, publishing terminal ID of the computing tasks, and the computing frequency, memory size, computing power consumption of each computing node, as well as the bandwidth and power of the transmission channel.

[0116] S102. Establish a mathematical model for the scheduling scheme of the computing tasks and computing nodes with the tasks and node information as parameters, and obtain the system profit of the scheduling scheme as the objective function.

[0117] S103. Adopt the set competition particle swarm optimization algorithm. With the maximization of the objective function of the system profit as the optimization goal, and under the constraints of the deadline of the computing tasks, the profit constraint of the tasks, and the memory space constraint of the computing nodes, calculate the allocation scheme of each task to be allocated to the computing nodes.

[0118] See Figure 2 , Figure 2 FIG. is a schematic diagram of the communication topology of the fog computing device adopted in the embodiment of the present invention. A fog computing task scheduling method based on the set competition particle swarm optimization algorithm provided by the present invention is applicable to a fog computing network composed of a cloud server, fog servers, and terminal devices. In this network, computing tasks are generated by terminal devices and can be executed by the local terminal, fog nodes, and cloud nodes. In this network, the computing capabilities of the devices decrease from strong to weak, and the number of devices increases from few to many in the order of cloud nodes, fog nodes, and terminal devices. Fog nodes are often deployed at gateways, base stations, etc. Therefore, computing tasks need to be forwarded to cloud nodes and other fog nodes via the fog node to which their terminal belongs.

[0119] A fog computing task scheduling method based on the set competition particle swarm optimization algorithm provided by the embodiment of the present invention runs on the cloud node acting as the central node. All terminals upload the basic information of the tasks to be allocated generated by them to this node. The information includes the size, computational complexity, deadline, task commission, publishing terminal ID of the computing tasks. This node performs scheduling based on the information of all tasks to be allocated and the current network state according to the fog computing task scheduling method based on the set competition particle swarm optimization algorithm provided by the embodiment of the present invention and gives a scheduling scheme. The scheduling scheme is sent by the cloud node acting as the central node to each terminal node, and each terminal node sends the computing tasks to the corresponding nodes for execution according to the scheduling scheme. Since the content of the basic information of the tasks to be allocated is small, the transmission and collection of this information do not take much time. Global scheduling by the central node ensures the quality of the scheduling solution.

[0120] The purpose of the invention in the embodiment of the present invention is to solve the problem of the allocation and scheduling of computing tasks to computing nodes. In this problem, terminal devices will generate several computing tasks, and the tasks to be allocated in the system are denoted as These tasks can be assigned to different computing nodes for execution. For each computing task, consider the following three constraints:

[0121] (1) Deadline constraint: The sum of the transmission and execution times of a computing task must be less than or equal to the given deadline of the task.

[0122] (2) Device memory constraint: The sum of the memory requirements of all tasks executed on the same device must be less than or equal to the total memory size of the device.

[0123] (3) Profit constraint: The total execution cost of a task must be less than the commission of the task.

[0124] See Figure 3 , Figure 3 which is a schematic diagram of the particle position encoding method adopted in the embodiment of the present invention. The task scheduling scheme can be expressed as the allocation relationship from tasks to nodes, where the first row represents the task numbers, and the second row represents the numbers of the computing nodes to which the tasks are assigned. In particular, 0 indicates that the task is assigned to the cloud node, and -1 indicates that the assignment is unsuccessful. The scheduling scheme should achieve better evaluation indicators as much as possible under the premise of satisfying all the above constraints.

[0125] The present invention evaluates the quality of the allocation scheme based on the total net profit of the system. The calculation formula of the total net profit is as follows:

[0126]

[0127] where I is the total number of tasks, J is the total number of computing devices, a ij is the scheduling variable. When x i = j, a ij = 1, otherwise a ij = 0, R i is the total commission of task i, is the transmission cost from task i to node j, which usually includes bandwidth fees, transmission electricity costs, etc., is the computing cost of task i on node j, which usually includes computing electricity costs, device losses, etc. The scheduling scheme with a higher total net profit is considered better.

[0128] After constructing the mathematical model of the scheduling scheme for computing tasks and computing nodes, using the above three constraints as the constraint conditions of the scheduling scheme, establishing the objective function with the total net profit of the system as the index, and taking the maximization of the total net profit of the system as the optimization goal, the set competition particle swarm algorithm can be used to optimize the task scheduling scheme, and the scheduling scheme that can satisfy both the optimization goal and the constraint conditions is used as the final task scheduling scheme.

[0129] Based on the above task scheduling problem, on the basis of the competitive swarm algorithm, the present invention introduces a set-based representation, operator, and update method, and designs a corresponding initialization strategy and local search strategy. The specific steps of the set competitive particle swarm algorithm are as follows:

[0130] B1. Use the scheduling schemes of all tasks as individuals, calculate the values corresponding to the dimensions of the tasks and the dimensions corresponding to the allocated computing nodes, encode the individuals, and initialize the population.

[0131] B2. Evaluate the objective function value of each particle according to the current allocation scheme of the particle.

[0132] B3. Repeatedly and randomly select two unupdated particles from the population, and update the velocities of the selected particles until all particles have been selected once. The velocity update formula is as follows:

[0133]

[0134] where the subscripts win and loss respectively refer to the particle with the larger objective function value and the particle with the smaller objective function value among the two particles; the superscript i represents the dimension, r1 and r2 are random numbers in the interval [0, 1]; c is the acceleration coefficient.

[0135] B4. Update the positions of all particles that lost in the comparison in B3.

[0136] B5. Execute the local search strategy on the particle that is currently the best in the population.

[0137] B6. Iteratively execute steps B2 - B5 until the preset maximum number of iterations is reached or it is detected that the global best individual has converged. Take the global best individual as the final task scheduling scheme.

[0138] Further as a preferred implementation manner, step B1 specifically includes the following steps:

[0139] B11. Arrange all tasks to be allocated in descending order of deadline urgency.

[0140] B12. Select the task with the closest current deadline in order with a probability of 0.9, otherwise randomly select a task from the remaining unallocated tasks.

[0141] B13. Allocate the task to the node with the largest net benefit among all computing nodes that meet the constraint conditions.

[0142] B14. Repeat steps B12 - B13 until all tasks are allocated or none of the remaining tasks can find any computing node that meets the constraints.

[0143] Further as a preferred embodiment, each dimension of the velocity vector in step B3 is defined as a set composed of a number of nodes and probability pairs, which satisfies the following representation:

[0144] v i ={j / p(j)|j∈U i}

[0145] where U i is all deployable computing nodes for task i, and p(j) is the probability of considering node j for task i. Further as a preferred embodiment, the operator used in step B3 is based on the following definition:

[0146] (1) Scalar multiplication operation of the velocity set:

[0147]

[0148]

[0149] (2) Set difference operation of the position set:

[0150]

[0151]

[0152] (3) Addition operation of the velocity set:

[0153]

[0154] Further as a preferred embodiment, the position update in step B4 includes the following steps:

[0155] B41. Select elements from the probability of each dimension in the velocity set to form a candidate node set node i ={j|j∈U i and p(j)>α}, where α is a random number in the interval [0, 1].

[0156] B42. For each dimension of the particle, arrange the candidate nodes in descending order of revenue, and check in turn whether the constraints at the time of deployment are satisfied. If satisfied, assign task i to this node and end the update of this dimension.

[0157] B43. If there is no feasible node in the candidate node set, check whether the deployment node of task i in the current position of the particle satisfies the constraints at the time of deployment. If satisfied, assign task i to this node and end the update of this dimension.

[0158] B45. If the deployment node of task i in the current position is also not feasible, all deployable nodes U iThe nodes in [it] arrange the candidate nodes in descending order of benefits, and sequentially check whether the constraints during deployment are met. If they are met, task i is assigned to this node, and the update of this dimension ends.

[0159] Further as a preferred embodiment, step B5 includes the following steps:

[0160] B51. Randomly change the deployment nodes of no more than 5% of the tasks in the allocation scheme of the optimal particle in the current population.

[0161] B52. Evaluate the new allocation scheme. If the new scheme is better than the current scheme, replace the scheme of the optimal particle in the current population with the new scheme.

[0162] B53. Repeat steps B351 - B52 for a specified number of times.

[0163] In summary, compared with the prior art, this embodiment has at least the following advantages and beneficial effects:

[0164] (1) A fog computing task scheduling method based on a set competition particle swarm algorithm provided by an embodiment of the present invention takes the obtained task and node information as a mathematical model for establishing a task allocation relationship, and maximizes the total system benefit as the goal, meeting the operation needs of operators.

[0165] (2) The present invention defines the task scheduling problem as a global optimization problem based on the set competition particle swarm algorithm, overcomes the problems of the greedy algorithm being short-sighted and the genetic algorithm having a slow optimization speed, and effectively improves the quality and efficiency of the algorithm.

[0166] (3) The present invention adopts a greedy initialization including randomness, which not only effectively guarantees the diversity of the initial population, preventing the algorithm from premature convergence; but also effectively utilizes the heuristic information of tasks, improves the quality of the initial population, and improves the optimization efficiency of the algorithm.

[0167] (4) The present invention adopts a set-based representation, operator, and position update, providing a discretized application version of a competitive swarm algorithm; while inheriting its good optimization speed and global search ability, ensuring good interpretability of the algorithm in this discretized version; compared with the traditional greedy algorithm that is prone to falling into local optima, the set competition particle swarm algorithm used in the present invention is based on global optimization and finally obtains an approximate global optimal solution, effectively improving the quality and efficiency of the task scheduling system.

[0168] This embodiment also provides a task scheduling device for fog computing, including:

[0169] At least one processor;

[0170] At least one memory for storing at least one program;

[0171] When the at least one program is executed by the at least one processor, the at least one processor implements the above-mentioned method.

[0172] A task scheduling device for fog computing according to this embodiment can execute a task scheduling method for fog computing provided by the method embodiment of the present invention, can execute any combination of implementation steps of the method embodiment, and has the corresponding functions and beneficial effects of the method.

[0173] The embodiment of the present application also discloses a computer program product or a computer program. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device can read the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes Figure 1 the method shown.

[0174] This embodiment also provides a storage medium, which stores instructions or programs that can execute a task scheduling method for fog computing provided by the method embodiment of the present invention. When the instructions or programs are run, any combination of implementation steps of the method embodiment can be executed, and the corresponding functions and beneficial effects of the method are achieved.

[0175] In some alternative embodiments, the functions / operations mentioned in the block diagram may not occur in the order mentioned in the operation diagram. For example, depending on the functions / operations involved, two consecutive blocks shown may actually be executed substantially simultaneously or the blocks can sometimes be executed in the reverse order. In addition, the embodiments presented and described in the flowchart of the present invention are provided by way of example for the purpose of providing a more comprehensive understanding of the technology. The disclosed method is not limited to the operations and logical processes presented herein. Alternative embodiments are contemplated, in which the order of various operations is changed and the sub-operations described as part of a larger operation are executed independently.

[0176] In addition, although the present invention has been described in the context of functional modules, it should be understood that, unless otherwise stated to the contrary, one or more of the described functions and / or features may be integrated in a single physical device and / or software module, or one or more functions and / or features may be implemented in separate physical devices or software modules. It should also be understood that a detailed discussion of the actual implementation of each module is not necessary for an understanding of the present invention. Rather, given the attributes, functions, and internal relationships of the various functional modules in the devices disclosed herein, the actual implementation of such modules would be understood within the ordinary skills of an engineer. Thus, those skilled in the art can implement the present invention as set forth in the claims without undue experimentation. It should also be understood that the particular concepts disclosed are merely illustrative and are not intended to limit the scope of the present invention, which is determined by the full scope of the appended claims and their equivalents.

[0177] If the described functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs that can store program codes.

[0178] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a predefined sequence of executable instructions for implementing logical functions, which can be specifically implemented in any computer-readable medium for use by an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other systems that can fetch and execute instructions from the instruction execution system, apparatus, or device), or in conjunction with such instruction execution systems, apparatuses, or devices. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0179] More specific examples (a non-exhaustive list) of computer-readable media include the following: electrical connections (electronic devices) having one or more wirings, portable computer diskettes (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber devices, and portable compact disc read-only memory (CDROM). Additionally, the computer-readable media can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other media, then editing, interpreting, or otherwise processing it as appropriate, and then storing it in a computer memory.

[0180] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware, or a combination thereof. In the above-described embodiments, the multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, any one or a combination of the following techniques well-known in the art can be used: discrete logic circuits having logic gate circuits for implementing logical functions on data signals, application specific integrated circuits having suitable combinational logic gate circuits, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), and the like.

[0181] In the above description of this specification, the descriptions referring to the terms "one embodiment / example", "another embodiment / example", or "certain embodiments / examples", etc., mean that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.

[0182] Although the embodiments of the present invention have been shown and described, those of ordinary skill in the art can understand that various changes, modifications, substitutions, and variations can be made to these embodiments without departing from the principles and spirit of the present invention, and the scope of the present invention is defined by the claims and their equivalents.

[0183] The above has specifically described the preferred embodiments of the present invention, but the present invention is not limited to the above embodiments. Those skilled in the art can also make various equivalent deformations or substitutions without departing from the spirit of the present invention, and these equivalent deformations or substitutions are all included within the scope defined by the claims of this application.

Claims

1. A task scheduling method for fog computing, characterized in that, It includes the following steps: Obtain the tasks to be scheduled and the information available for computing nodes; Using the tasks and the information as parameters, establish a mathematical model for the scheduling scheme of computing tasks and computing nodes, and take the system profit of the scheduling scheme as the objective function; Adopt the set competitive particle swarm algorithm. According to the objective function, under the condition of meeting the preset constraint conditions, calculate the allocation scheme of each task to be allocated to the computing nodes; The step of adopting the set competitive particle swarm algorithm. According to the objective function, under the condition of meeting the preset constraint conditions, calculate the allocation scheme of each task to be allocated to the computing nodes, including: A1. Take the scheduling schemes of all tasks as individuals, calculate the values corresponding to the dimensions of the tasks and the dimensions of the computing nodes to which they are allocated, encode the individuals, and initialize the population; A2. Evaluate the objective function value of each particle according to the current allocation scheme of the particle; A3. Randomly select two unupdated particles from the population repeatedly and update the velocity vectors of the selected particles until all particles have been selected once; A4. Update the positions of all particles that lost in the comparison in A3; A5. Execute the local search strategy on the particle that is the best in the current population; A6. Iteratively execute steps A2 - A5 until the preset termination condition is reached, and take the best individual in the global as the final task scheduling scheme; Each dimension of the velocity vector in step A3 is defined as a set composed of several node - probability pairs, satisfying the following representation: where U i is all the deployable computing nodes for task i, and p(j) is the probability of task i considering node j; The velocity vector is updated by the following formula: Among them, the subscripts win and loss respectively refer to the particle with the larger objective function value and the particle with the smaller objective function value among the two particles; The superscript i represents the dimension, r1 and r2 are random numbers in the interval [0, 1]; c is the acceleration coefficient.

2. The task scheduling method of fog computing according to claim 1, characterized in that In step A1, a greedy initialization containing a random process is used for population initialization, specifically including: A11. Arrange all tasks to be allocated in descending order of deadline; A12. Select the task with the closest current deadline in order with a preset probability, otherwise randomly select a task from the remaining unallocated tasks; A13. Allocate the selected task to the node with the largest net profit among all computing nodes that meet the constraint conditions; A14. Repeat steps A11 - A13 until all tasks are allocated or none of the remaining tasks can find any computing node that meets the constraints.

3. A task scheduling method for fog computing according to claim 1, characterized in that, The objective function value in step A2 is calculated by the following formula: where I is the total number of tasks, J is the total number of computing devices, and a ij is a scheduling variable. When x i = j, a ij = 1; otherwise a ij = 0. R i is the total commission of task i, is the transmission overhead from task i to node j, and is the computing overhead of task i on node j.

4. A task scheduling method for fog computing according to claim 1, characterized in that, In step A4, the position of the particle is updated in the following way: A41. Select elements from the probabilities of each dimension in the velocity vector to form a candidate node set node i ={j|j∈U i and p(j)>α}, where α is a random number in the interval [0, 1]; A42. For each dimension of the particle, arrange the candidate nodes in descending order of profit, and check in turn whether they meet the constraints during deployment. If they meet, allocate task i to this node and end the update of this dimension; A43. If there is no feasible node in the candidate node set, check whether the deployment node of task i in the current position of the particle meets the constraints during deployment. If it meets, allocate task i to this node and end the update of this dimension; A44. If the deployment node of task i at the current position is also infeasible, arrange the nodes in all deployable nodes U i in descending order of revenue for candidate nodes, and check in turn whether the constraints at the time of deployment are met. If they are met, assign task i to this node and end the update of this dimension.

5. A task scheduling method for fog computing according to claim 1, characterized in that Step A5 specifically includes: A51. Randomly change the deployment nodes of tasks whose proportion does not exceed the preset ratio in the allocation scheme of the best particle in the current population; A52. Evaluate the new allocation scheme. If the new scheme is better than the current one, replace the scheme of the optimal particle in the current population with the new scheme; A53. Repeat steps A51 - A52 until the preset requirements are met.

6. A task scheduling method for fog computing according to claim 1, characterized in that, The set constraints include the deadline constraint of the computing task, the profit constraint of the task, and the memory space constraint of the computing node; The task scheduling method is applied to the single - cycle computing task scheduling or the multi - cycle computing task scheduling; when performing the multi - cycle computing task scheduling, the unallocated computing tasks in the current cycle will automatically enter the task list to be allocated in the next cycle until the task is successfully allocated or fails due to timeout.

7. A task scheduling device for fog computing, characterized in that It includes: At least one processor; At least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the method according to any one of claims 1 - 6.

8. A computer-readable storage medium storing a program executable by a processor, characterized in that, The program executable by the processor is used to execute the method according to any one of claims 1 - 6 when executed by the processor.

Citation Information

Patent Citations

  • Fog computing task unloading time delay optimization method based on improved particle swarm algorithm

    CN112084025A

  • Systems and methods for estimating computation times a-priori in fog computing robotics

    US20180276049A1