A method and system for task offloading and task scheduling in an IoT platform based on fog computing.
By establishing a task offloading and scheduling model for an IoT platform based on fog computing, and using an evolutionary algorithm of dominant solutions to optimize task allocation, the multi-objective problem of task completion time and energy consumption is solved. This achieves a non-dominated solution with the shortest task completion time and lowest energy consumption, and provides a variety of allocation schemes to choose from.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- XIDIAN UNIV
- Filing Date
- 2023-02-24
- Publication Date
- 2026-06-02
AI Technical Summary
Existing task offloading models for IoT platforms suffer from unreasonable task scheduling in fog computing and cloud computing environments, making it difficult to simultaneously optimize task completion time and energy consumption, and existing algorithms struggle to obtain globally optimal solutions.
A task offloading and scheduling model for an IoT platform based on fog computing is established. An evolutionary algorithm for dominant solutions is used to iteratively solve the problem. By constructing a metric for task completion time and energy consumption, the task allocation scheme is optimized to achieve a non-dominated solution with the shortest completion time and minimum energy consumption.
It achieves multi-objective optimization of task allocation schemes for IoT platforms, enabling tasks to be completed in the shortest time and with the lowest platform energy consumption on fog computing platforms, and provides a variety of allocation schemes to meet user needs.
Smart Images

Figure CN116302503B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of Internet of Things (IoT) related technology, specifically relating to a task offloading and task scheduling method and system for an IoT platform based on fog computing. Background Technology
[0002] Existing IoT platform task offloading models categorize offloading targets into three types: fog computing platforms, cloud computing platforms, and cloud-fog dual-layer systems. For fog computing platforms, the IoT platform offloads some tasks to fog nodes, i.e., devices located relatively close to the IoT platform. For cloud computing platforms, the IoT platform places some tasks on remote cloud servers for processing. Cloud servers are faster and have larger capacity than fog nodes, but they are farther from the IoT platform, resulting in higher communication latency. For cloud-fog dual-layer systems, the IoT platform makes task offloading decisions, selecting to transmit a portion of the task to the cloud server for processing and another portion to the fog nodes for processing.
[0003] Elaziz et al. proposed an improved artificial ecosystem optimization algorithm for alternative task scheduling techniques for IoT requests in cloud-fog computing environments (Elaziz MA, Abualigah L, Attiya I. Advanced optimization technique for scheduling IoT tasks in cloud-fog computing environments[J]. Future Generation Computer Systems, 2021, 124(9)). This model does not consider divisible tasks, treating tasks as a whole, and can only be processed on fog nodes or locally. To improve the quality of service (QOS) of the platform, Mohamed Abdel-Basset et al. offloaded tasks to the fog computing platform and proposed an energy-aware model based on the marine predator algorithm to solve the task scheduling problem in fog computing (Abdel-Basset, Mohamed, et al. "Energy-Aware Marine Predators Algorithm for Task Scheduling in IoT-Based FogComputing Applications." IEEE Transactions on Industrial Informatics). (PP.99(2020):1-1), however, the algorithm only considers a single-objective optimization problem. It transforms energy consumption, manufacturing span, and flow time into a single objective for solving, ignoring the metric standards between different objectives. Therefore, the algorithm struggles to obtain a good global optimum. Summary of the Invention
[0004] To overcome the shortcomings of the prior art, the present invention aims to provide a task offloading and task scheduling method and system for an IoT platform based on fog computing. A task offloading and task scheduling model is established, and this model is solved using an evolutionary algorithm based on the dominant solution to achieve task offloading and task scheduling. The task offloading and task scheduling model for an IoT platform based on fog computing in this invention obtains task allocation schemes for the IoT platform and the fog computing platform through iterative evolutionary algorithm, thereby obtaining non-dominated solutions for the two desired objectives: the shortest task completion time and the minimum energy consumption of the platform. This enables the implementation of the task offloading and task scheduling method.
[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0006] A method for task offloading and task scheduling in an IoT platform based on fog computing includes the following steps:
[0007] Step 1: Establish a task offloading and task scheduling model for an IoT platform based on fog computing;
[0008] Step 2: Using the evolutionary algorithm of the dominant solution, solve the task offloading and task scheduling model of the IoT platform based on fog computing, and obtain the non-dominated solution with the shortest task completion time and the minimum energy consumption of the platform, thereby realizing the task offloading and task scheduling method.
[0009] Specifically, step 1, the modeling steps are as follows:
[0010] Step 1.1: Measure the energy consumption and task completion time of the platform;
[0011] Step 1.2: Based on the measurement method in Step 1.1, establish a task offloading and task scheduling model for the IoT platform based on fog computing.
[0012] Specifically, step 1.1, which involves constructing a method for measuring the platform's energy consumption and task completion time, follows these steps:
[0013]
[0014]
[0015] in,
[0016] T i local (B) = l i β i v i Formula 3
[0017]
[0018] T fog (B)=o1+a1+ω1α1W Equation 5
[0019]
[0020]
[0021] The Internet of Things (IoT) platform consists of a sensor set S = {s1, s2, s3…s} n The structure is composed of}, where n is the total number of sensors, and s i This represents the i-th sensor; the task set on the sensor is V = {v1, v2, v3…v}. n}, where v i Indicates sensor s i The total workload to be completed; the fog computing platform consists of a fog node set F = {f0, f1, f2, f3…f m The system is composed of nodes f0 (control nodes), other nodes (fog computing nodes), and m (the total number of fog computing nodes); the sensor assigns weights to tasks processed locally in a set B = {β1, β2, ..., β...}. n}, where β i Indicates sensor s i The task processed locally is assigned a weight, namely β. i v i For sensor s i The amount of work to be completed locally; the total number of tasks on the fog computing platform is W, and the set of weights A = {α1, α2, α3…α} is used to assign tasks to each fog computing node. m}, where α i W represents fog node f i The amount of work to be done;
[0022] c i For sensor s i The number of CPU cycles required to process a unit of task, r i Indicates sensor s i Energy consumption per CPU cycle, where K is the frequency band and P is the power consumption per CPU cycle. i For sensor s i The transmit power is M, the noise power is g, and the channel gain is l. i Indicates sensor s i The computation time required per unit of task volume, b i Indicates sensor s i The transfer time required to unload a unit of task volume; i Fog computing node f i The communication startup overhead of the link, z i Fog computing node f iunit task transmission time, a i Fog computing node f i The computational startup overhead, ω i Fog computing node f i The time required to complete a single task is E, where E is the energy consumption of the IoT platform, and T is the total time required to complete all tasks. i local For sensor s i The time spent executing the task locally, T fog T represents the total time spent executing tasks on the fog computing platform. tran The communication time for transmitting tasks from the IoT platform to the fog computing platform.
[0023] Specifically, step 1.2, establishing the task offloading and task scheduling model for the IoT platform based on fog computing, involves the following steps:
[0024]
[0025] The constraints of this model are:
[0026]
[0027] Specifically, step 2, the solution steps for the task offloading and task scheduling model of the IoT platform based on fog computing, are as follows:
[0028] Step 2.1: Set the maximum number of generations t for the population max Given the population size Popsize, the task allocation scheme B = {β1, β2, ..., β} of the IoT platform. n} represents the individual's encoding, and the parent population P(t) is randomly initialized at this time, with generation t = 0;
[0029] Step 2.2: Use the simulated binary crossover operator to generate the offspring population O from the parent population P(t);
[0030] Step 2.3: Use the polynomial mutation operator on the offspring population O to generate the offspring population O';
[0031] Step 2.4: Use the local search algorithm to generate the offspring population O” from the offspring population O’;
[0032] Step 2.5: The offspring population O” is merged with the parent population P(t) to form population R. The non-dominated sorting and crowding distance calculation are used on population R to obtain the new generation population P(t+1) of the parent population P(t).
[0033] Step 2.6: Let t → t+1, if t > t maxThe algorithm terminates and outputs the task allocation scheme of the IoT platform corresponding to the final parent population P(t). The corresponding task completion time and platform energy consumption are calculated according to the scheme using Equations 1 and 2; otherwise, return to step 2.2.
[0034] Specifically, the implementation steps of step 2.2 are as follows:
[0035] Step 2.2.1: Let i = 0, j = n + 1, O = P(t), P c =0.6, η=20;
[0036] Step 2.2.2: i → i+1; if i ≤ Popsize / 2, select two individuals from P(t). and Otherwise, the algorithm terminates and outputs a population size of O.
[0037] Step 2.2.3: Randomly select a real number a between 0 and 1. If a > P c Return to step 2.2.2;
[0038] Step 2.2.4: Let j → j-1; if j < 1, return to step 2.2.2, and randomly select a real number b between 0 and 1, let... yl=0, yu=1, λ=1+2×(y1-yl) / (y2-y1), c=2-λ -(η+1) If b < 0.5, then δ = (c × b) 1 / (1+η) Otherwise, δ=(1 / (2-c×b)) 1 / (1+η) ;
[0039] Step 2.2.5: Calculation calculate Return to step 2.2.4.
[0040] Specifically, the implementation steps of step 2.3 are as follows:
[0041] Step 2.3.1: Let i = 1, j = n+1, O' = O, P m =0.02, η=20;
[0042] Step 2.3.2: i → i+1; if i > Popsize, output O'; otherwise, select an individual from O'.
[0043] Step 2.3.3: Let j → j-1; if j < 1, return to step 2.3.2, and randomly select a real number a between 0 and 1. If a > P m Repeat step 2.3.3;
[0044] Step 2.3.4: Randomly select a real number b between 0 and 1, and set yl = 0 and yu = 1.
[0045] Step 2.3.5: If b < 0.5, v = 2 × b + (1 - 2 × b) * (1 - λ1) η+1 Δ=v 1 / (η+1) -1; otherwise, v = 2 × (1 - b) + 2 × (b - 0.5) * (1 - λ²) η+1 Δ=1-v 1 / (η+1) ;
[0046] Step 2.3.6: Calculation Return to step 2.3.3.
[0047] Specifically, the implementation steps of step 2.4 are as follows:
[0048] Step 2.4.1: Let i = 1, j = n + 1, O” = O';
[0049] Step 2.4.2: Let i → i+1; if i > Popsize, output O”; otherwise, select an individual from O’.
[0050] Step 2.4.3: Let j → j-1; if j < 1, return to step 2.4.2; if otherwise,
[0051] Step 2.4.4: Randomly select an integer q from 1 to n; calculate
[0052] Step 2.4.5: P' = O', P” = O', if and make Calculate the task completion time of P' according to Equation 2; if and make Calculate the task completion time of P” according to Equation 2; compare the task completion times of P’, P”, and O’, copy the individual corresponding to the minimum value to O”, and return to step 2.4.3.
[0053] Specifically, the implementation steps of step 2.5 are as follows:
[0054] Step 2.5.1: Combine P(t) and O” to obtain R, and calculate the energy consumption value of R according to Equations 1 and 2. and task completion time Initialize the two-dimensional set sortp to empty; let i = 0, j = 0, y = 1, and initialize the set x;
[0055] Step 2.5.2: Let i → i+1. If i > 2 * Popsize, proceed to step 2.5.5; set set G. i If it is empty, let x be empty. i =0;
[0056] Step 2.5.3: Let j → j+1. If j > 2*Popsize, proceed to step 2.5.4; if i = j, repeat step 2.5.3; otherwise, if && Add j to set G. i In the middle; if && Let x i →x i +1; Repeat step 2.5.3;
[0057] Step 2.5.4: If x i =0, add i to the set sortp1 of the two-dimensional set sortp; return to step 2.5.2;
[0058] Step 2.5.5: If the set sortp y If empty, proceed to step 2.5.8; otherwise, set an empty set Q; let ii = 0, jj = 0;
[0059] Step 2.5.6: Let ii → ii+1; if ii > size(sortp) y Let y→y+1, sortp m =Q; Return to step 2.5.5;
[0060] Step 2.5.7: Let jj→jj+1, if Return to step 2.5.6; otherwise, let x j →x j -1; if x j =0, put j into set Q; repeat step 2.5.7;
[0061] Step 2.5.8: Let z = 0, sum = 0;
[0062] Step 2.5.9: Let z → z+1, if sum + size(sortp) z If iii > Popsize, proceed to step 2.5.11; otherwise, set iii = 1.
[0063] Step 2.5.10: If iii > size(sortp) z If the sum is positive, return to step 2.5.9; otherwise, let sum → sum + 1. iii→iii+1, repeat step 2.5.10;
[0064] Step 2.5.11: Calculate according to Equations 1 and 2 The corresponding individual's energy consumption value I f1 and task completion time value I f2 ;initialization Distance of the corresponding individual's crowding v =0, v=1,2,3,...,size(sortp z );
[0065] Step 2.5.12: For According to I f1 Sort by size from smallest to largest, and let Dis1 = ∞. x = 2;
[0066] Step 2.5.13: If x > size(sortp) z If the above steps are incorrect, proceed to step 2.5.14; otherwise, calculate... For x→x+1, repeat step 2.5.13;
[0067] Step 2.5.14: For According to I f2 Sort by size from smallest to largest, and let Dis1 = ∞. x = 2;
[0068] Step 2.5.15: If x > size(sortp) z If necessary, proceed to step 2.5.16; otherwise, calculate... For x→x+1, repeat step 2.5.15;
[0069] Step 2.5.16: For Sort the values of Dis in ascending order, and set iii = 0;
[0070] Step 2.5.17: Let sum → sum+1, iii → iii+1; if sum > Popsize, the algorithm terminates and outputs P(t+1); otherwise, Repeat step 2.5.17.
[0071] The present invention also provides a system for implementing a task offloading and task scheduling method for a fog computing-based Internet of Things (IoT) platform, comprising a task offloading and task scheduling model establishment module and a task offloading and task scheduling model solving module for a fog computing-based IoT platform connected in sequence.
[0072] The task offloading and task scheduling model building module of the fog computing-based IoT platform is used to: construct the measurement method of energy consumption and task completion time of the platform and establish the task offloading and task scheduling model of the fog computing-based IoT platform.
[0073] The task offloading and task scheduling model solving module of the fog computing-based IoT platform is used to: solve the task offloading and task scheduling model of the fog computing-based IoT platform, obtain the task allocation scheme of the IoT platform and the task allocation scheme of the fog computing platform, and thus obtain the non-dominated solution (Pareto Front, PF) with the shortest task completion time and the minimum energy consumption of the platform.
[0074] Compared with the prior art, the present invention has the following technical effects:
[0075] 1. This invention addresses the task offloading and scheduling problem of IoT platforms based on fog computing. It uses fog computing to perform divisible task offloading and scheduling on the IoT platform. By minimizing the task completion time on the fog computing platform, a task allocation scheme for the fog computing platform is derived. A method for measuring task completion time and platform energy consumption is constructed. A task offloading and scheduling model with the goal of minimizing task completion time and platform energy consumption is established. Compared with existing technologies, this model is more reasonable and effective.
[0076] 2. This invention addresses the task offloading and task scheduling model of the proposed fog computing-based IoT platform by designing an evolutionary algorithm based on dominant solutions to solve the model. This algorithm can effectively solve multi-objective problems, obtaining task allocation schemes for both the IoT platform and the fog computing platform. This yields the non-dominated solution (Pareto Front, PF) with the shortest task completion time and the lowest platform energy consumption, allowing users and the system to choose from a wider range of allocation schemes to meet their specific needs. Attached Figure Description
[0077] Figure 1 This is a schematic diagram of an IoT platform based on fog computing that satisfies the problem description of the present invention.
[0078] Figure 2 This is the task scheduling diagram for fog nodes that satisfy the constraints of this invention.
[0079] Figure 3 This is a flowchart of the task unloading and task scheduling method of the present invention.
[0080] Figure 4 The diagrams are PF images for different fog nodes according to the present invention; wherein: Figure 4 (a) is a PF diagram of the fog computing platform of the present invention with 10 fog computing nodes; Figure 4(b) is a PF diagram of the fog computing platform of the present invention with 12 fog computing nodes; Figure 4 (c) is a PF diagram of the fog computing platform of the present invention with 15 fog computing nodes; Figure 4 (d) is the PF diagram of the fog computing platform of the present invention with 20 fog computing nodes.
[0081] Figure 5 These are PF diagrams for different sensors used in this invention; wherein: Figure 5 (a) is a PF diagram of the IoT platform of the present invention with 10 sensors; Figure 5 (b) is a PF diagram of the IoT platform of the present invention with 12 sensors; Figure 5 (c) is a PF diagram of the IoT platform of the present invention with 15 sensors; Figure 5 (d) is the PF diagram of the Internet of Things platform of the present invention with 20 sensors.
[0082] Figure 6 These are the PF diagrams for different workloads in this invention; where: Figure 6 (a) is a PF diagram for sensor task quantity of 1000 to 1500 in the IoT platform of the present invention; Figure 6 (b) is a PF diagram for sensor task volume of 1500 to 2000 in the IoT platform of the present invention; Figure 6 (c) is a PF diagram for the number of sensor tasks in the IoT platform of the present invention, which is between 2000 and 2500. Figure 6 (d) is a PF diagram for the number of sensor tasks in the IoT platform of this invention, which is between 2500 and 3000. Detailed Implementation
[0083] The present invention will be further explained and described in detail below with reference to the accompanying drawings and embodiments.
[0084] Example 1
[0085] Following the above technical solution, the task offloading and task scheduling method of the IoT platform based on fog computing in this embodiment specifically includes the following steps:
[0086] See Figure 3 Step 1: Establish a task offloading and task scheduling model for an IoT platform based on fog computing.
[0087] See Figure 1 , Figure 2 Let the IoT platform consist of a sensor set S = {s1, s2, s3…s} n The structure is composed of}, where n is the total number of sensors, and s i This represents the i-th sensor; the task set on the sensor is V = {v1, v2, v3…v}. n}, where v iIndicates sensor s i The total workload to be completed; the fog computing platform consists of a fog node set F = {f0, f1, f2, f3…f m The system is composed of nodes f0 (control nodes), other nodes (fog computing nodes), and m (the total number of fog computing nodes); the sensor assigns weights to tasks processed locally in a set B = {β1, β2, ..., β...}. n}, where β i Indicates sensor s i Assign weights to tasks processed locally; that is, β. i v i For sensor s i The amount of work to be completed locally; the total number of tasks on the fog computing platform is W, and the set of weights A = {α1, α2, α3...α} is used to assign tasks to each fog computing node. m}, where α i W represents fog node f i The amount of work to be done; c i For sensor s i The number of CPU cycles required to process a unit of task, r i Indicates sensor s i Energy consumption per CPU cycle; K is the frequency band, P i For sensor s i The transmit power is M, the noise power is g, and the channel gain is l; i Indicates sensor s i The computation time required per unit of task volume; b i Indicates sensor s i The transfer time required to unload a unit of task volume; a i Fog computing node f i The computational startup overhead, ω i Fog computing node f i The time required to complete a single task is E, where E is the energy consumption of the IoT platform, and T is the total time required to complete all tasks. i local For sensor s i The time spent executing the task locally, T fog T represents the total time spent executing tasks on the fog computing platform. tran The communication time for transmitting tasks from the IoT platform to the fog computing platform.
[0088] Step 1.1: Develop a method for measuring the platform's energy consumption and task completion time.
[0089] Step 1.1.1, the energy consumption calculation process includes two parts: task offloading from the IoT platform and task scheduling from the fog computing platform. Since fog nodes are generally powered by power supply equipment, the energy consumption on the fog computing platform is not considered. The energy consumption on the IoT platform includes the computational energy consumption of the sensors and the transmission energy consumption required for the sensors to be offloaded to the control node. i The formula for calculating energy consumption is as follows:
[0090]
[0091] According to formula (1.1), the sum of the computational energy consumption of n sensors is:
[0092]
[0093] Sensors i Will (1-β) i )v i The workload is offloaded to the control node, and the sensors s i The formula for transmission energy consumption is as follows:
[0094]
[0095] The sum of the transmission energy consumption of n sensors is
[0096]
[0097] The formula for calculating the total energy consumption of the sensor is as follows:
[0098] E(B)=E com (B)+E tran (B) (1.5)
[0099] Substituting formulas (1.2) and (1.4) into formula (1.5), we get:
[0100]
[0101] Step 1.1.2: The task completion time consists of two parts: the time spent by the sensor executing the task locally, and the time spent by the sensor unloading to the control node plus the total task completion time on the fog computing platform. The longest time among the two parts is the total task completion time. The time spent by the sensor executing the task locally refers to the period from the start of the sensor executing the task to the end of the period when all sensors have completed their local tasks.
[0102] Sensors i The formula for calculating the completion time locally is as follows:
[0103] T i local(B) = l i β i v i (1.7)
[0104] Sensors i The time spent executing the task locally is:
[0105]
[0106] Sensors i Remaining (1-β) i )v i The workload is offloaded to the control node, and the sensors s i The time spent unloading the task to the control node is:
[0107] T i tran (B)=b i (1-β i )v i (1.9)
[0108] Since only one sensor can offload a task to the control node at a time, the total time for the sensor to offload the task to the control node is:
[0109]
[0110] See Figure 2 Observation reveals that:
[0111] o1+a1+ω1α1W=o1+z1α1W+o2+a2+ω2α2W (1.11)
[0112] By proceeding sequentially, we can obtain:
[0113] a i +ω i α i W = z i α i W+o i+1 +a i+1 +ω i+1 α i+1 W (1.12)
[0114] Rearrange formula (1.12), α i+1 Can be derived from α i To express it, that is:
[0115]
[0116] Where i∈[1,m-1], let k i =(ω i -zi ) / ω i+1 And h i =(o i+1 +a i+1 -a i ) / ω i+1 W, simplifying formula (1.13) yields:
[0117]
[0118] Where i∈[2,m], since α i Fog computing node f i The task allocation weights are such that:
[0119]
[0120] Substituting formula (1.14) into (1.15) yields the following equation:
[0121]
[0122] Rearranging formula (1.16) yields the value of α1:
[0123]
[0124] The task completion time of the fog node can be calculated based on α1:
[0125]
[0126] The total completion time of the task can be obtained from formulas (1.8), (1.10), and (1.18):
[0127]
[0128] Therefore, the task completion time and platform energy consumption can be represented by task allocation scheme B of the IoT platform as follows:
[0129]
[0130]
[0131] in,
[0132] T i local (B) = l i β i v i Formula 3
[0133]
[0134] T fog(B)=o1+a1+ω1α1W Equation 5
[0135]
[0136]
[0137] Step 1.2, based on the measurement method in Step 1.1 above, establish the task offloading and task scheduling model of the IoT platform based on fog computing as follows:
[0138]
[0139] The constraints of this model are:
[0140]
[0141] Step 2: Using the evolutionary algorithm of the dominant solution, solve the task offloading and task scheduling model of the IoT platform based on fog computing to obtain the non-dominated solution (Pareto Front, PF) with the shortest task completion time and the minimum energy consumption of the platform. That is, obtain the task allocation scheme of the IoT platform and the task allocation scheme of the fog computing platform, thereby realizing the task offloading and task scheduling method.
[0142] Step 2.1: Set the maximum number of generations t for the population max =500, Popsize = 500, Task allocation scheme B of IoT platform = {β1,β2,...,β...} n} represents the individual's encoding, and the parent population P(t) is randomly initialized at this time, with the generation number t = 0.
[0143] Step 2.2: Generate offspring population O from the parent population P(t) using the simulated binary crossover operator:
[0144] Step 2.2.1: Let i = 0, j = n + 1, O = P(t), P c =0.6, η=20;
[0145] Step 2.2.2: i → i+1; if i ≤ Popsize / 2, select two individuals from P(t). and Otherwise, the algorithm terminates and outputs a population size of O.
[0146] Step 2.2.3: Randomly select a real number a between 0 and 1. If a > P c Return to step 2.2.2;
[0147] Step 2.2.4: Let j → j-1; if j < 1, return to step 2.2.2, and randomly select a real number b between 0 and 1, let... yl=0, yu=1, λ=1+2×(y1-yl) / (y2-y1), c=2-λ -(η+1) If b < 0.5, then δ = (c × b) 1 / (1+η) Otherwise, δ=(1 / (2-c×b)) 1 / (1+η) ;
[0148] Step 2.2.5: Calculation calculate Return to step 2.2.4.
[0149] Step 2.3: Use the polynomial mutation operator on the offspring population O to generate the offspring population O':
[0150] Step 2.3.1: Let i = 1, j = n+1, O' = O, P m =0.02, η=20;
[0151] Step 2.3.2: i → i+1; if i > Popsize, output O'; otherwise, select an individual from O'.
[0152] Step 2.3.3: Let j → j-1; if j < 1, return to step 2.3.2, and randomly select a real number a between 0 and 1. If a > P m Repeat step 2.3.3;
[0153] Step 2.3.4: Randomly select a real number b between 0 and 1, and set yl = 0 and yu = 1.
[0154] Step 2.3.5: If b < 0.5, v = 2 × b + (1 - 2 × b) * (1 - λ1) η+1 Δ=v 1 / (η+1) -1; otherwise, v = 2 × (1 - b) + 2 × (b - 0.5) * (1 - λ²) η+1 Δ=1-v 1 / (η+1) ;
[0155] Step 2.3.6: Calculation Return to step 2.3.3.
[0156] Step 2.4: Use a local search algorithm to generate the offspring population O” from the offspring population O’:
[0157] Step 2.4.1: Let i = 1, j = n + 1, O” = O';
[0158] Step 2.4.2: Let i → i+1; if i > Popsize, output O”; otherwise, select an individual from O’.
[0159] Step 2.4.3: Let j → j-1; if j < 1, return to step 2.4.2; if otherwise,
[0160] Step 2.4.4: Randomly select an integer q from 1 to n; calculate
[0161] Step 2.4.5: P' = O', P” = O', if and make Calculate the task completion time of P' according to Equation 2; if and make Calculate the task completion time of P” according to Equation 2; compare the task completion times of P’, P”, and O’, copy the individual corresponding to the minimum value to O”, and return to step 2.4.3.
[0162] Step 2.5: Merge the offspring population O” with the parent population P(t) to form population R. Apply non-dominated sorting and crowding distance calculations to population R to obtain the next generation population P(t+1) of the parent population P(t):
[0163] Step 2.5.1: Combine P(t) and O” to obtain R, and calculate the energy consumption value of R according to Equations 1 and 2. and task completion time Initialize the two-dimensional set sortp to empty; let i = 0, j = 0, y = 1, and initialize the set x;
[0164] Step 2.5.2: Let i → i+1. If i > 2 * Popsize, proceed to step 2.5.5; set set G. i If it is empty, let x be empty. i =0;
[0165] Step 2.5.3: Let j → j+1. If j > 2*Popsize, proceed to step 2.5.4; if i = j, repeat step 2.5.3; otherwise, if && Add j to set G. i In the middle; if && Let x i →x i +1; Repeat step 2.5.3;
[0166] Step 2.5.4: If x i =0, add i to the set sortp1 of the two-dimensional set sortp; return to step 2.5.2;
[0167] Step 2.5.5: If the set sortp y If empty, proceed to step 2.5.8; otherwise, set an empty set Q; let ii = 0, jj = 0;
[0168] Step 2.5.6: Let ii → ii+1; if ii > size(sortp) y Let y→y+1, sortp m =Q; Return to step 2.5.5;
[0169] Step 2.5.7: Let jj→jj+1, if Return to step 2.5.6; otherwise, let x j →x j -1; if x j =0, put j into set Q; repeat step 2.5.7;
[0170] Step 2.5.8: Let z = 0, sum = 0;
[0171] Step 2.5.9: Let z → z+1, if sum + size(sortp) z If iii > Popsize, proceed to step 2.5.11; otherwise, set iii = 1.
[0172] Step 2.5.10: If iii > size(sortp) z If the sum is positive, return to step 2.5.9; otherwise, let sum → sum + 1. iii→iii+1, repeat step 2.5.10;
[0173] Step 2.5.11: Calculate according to Equations 1 and 2 The corresponding individual's energy consumption value I f1 and task completion time value I f2 ;initialization Distance of the corresponding individual's crowding v =0, v=1,2,3,...,size(sortp z );
[0174] Step 2.5.12: For According to I f1 Sort by size from smallest to largest, and let Dis1 = ∞. x = 2;
[0175] Step 2.5.13: If x > size(sortp) z If the above steps are incorrect, proceed to step 2.5.14; otherwise, calculate... For x→x+1, repeat step 2.5.13;
[0176] Step 2.5.14: For According to I f2 Sort by size from smallest to largest, and let Dis1 = ∞. x = 2;
[0177] Step 2.5.15: If x > size(sortp) z If necessary, proceed to step 2.5.16; otherwise, calculate... For x→x+1, repeat step 2.5.15;
[0178] Step 2.5.16: For Sort the values of Dis in ascending order, and set iii = 0;
[0179] Step 2.5.17: Let sum → sum+1, iii → iii+1; if sum > Popsize, the algorithm terminates and outputs P(t+1); otherwise, Repeat step 2.5.17.
[0180] Step 2.6: Let t → t+1, if t > t max The algorithm terminates and outputs the task allocation scheme of the IoT platform corresponding to the final parent population P(t). The corresponding task completion time and platform energy consumption are calculated according to the scheme using Equations 1 and 2; otherwise, return to step 2.2.
[0181] Example 2
[0182] The present invention also provides a system for implementing a task offloading and task scheduling method for a fog computing-based Internet of Things (IoT) platform, comprising a task offloading and task scheduling model establishment module and a task offloading and task scheduling model solving module for a fog computing-based IoT platform, which are connected in sequence.
[0183] The task offloading and task scheduling model building module of the fog computing-based IoT platform is used to: construct a method for measuring the platform's energy consumption and task completion time, and to establish a task offloading and task scheduling model of the fog computing-based IoT platform.
[0184] The task offloading and task scheduling model establishment module of the fog computing-based IoT platform includes submodule 11 and submodule 12, wherein submodule 11 is used to implement the following functions:
[0185] The energy consumption and task completion time of the platform are measured as follows:
[0186]
[0187]
[0188] in,
[0189] T i local (B) = l i β i v i Formula 3
[0190]
[0191] T fog (B)=o1+a1+ω1α1W Equation 5
[0192]
[0193]
[0194] The Internet of Things (IoT) platform consists of a sensor set S = {s1, s2, s3…s} n The structure is composed of}, where n is the total number of sensors, and s i Let i represent the i-th sensor. The task set on the sensor is V = {v1, v2, v3…v…}. n}, where v i Indicates sensor s i The total workload to be completed. The fog computing platform consists of a fog node set F = {f0, f1, f2, f3…f m The system is structured as follows: f0 is the control node, the other nodes are fog computing nodes, and m is the total number of fog computing nodes. The sensor assigns a set of weights to tasks processed locally, B = {β1, β2, ..., β...}. n}, where β i Indicates sensor s i The task processed locally is assigned a weight, namely β. i v i For sensor s i The amount of work to be completed locally. The total number of tasks on the fog computing platform is W, and the set of weights A = {α1, α2, α3...α} is used to assign tasks to each fog computing node. m}, where α i W represents fog node f i The amount of tasks that need to be performed.
[0195] c i For sensor s i The number of CPU cycles required to process a unit of task, r i Indicates sensor s i Energy consumption per CPU cycle, where K is the frequency band and P is the power consumption per CPU cycle. i For sensor s i The transmit power is M, the noise power is g, and the channel gain is l. i Indicates sensor si The computation time required per unit of task volume, b i Indicates sensor s i The time required to unload a unit of task volume, o i Fog computing node f i The communication startup overhead of the link, z i Fog computing node f i unit task transmission time, a i Fog computing node f i The computational startup overhead, ω i Fog computing node f i The time required to complete a single task is E, where E is the energy consumption of the IoT platform, and T is the total time required to complete all tasks. i local For sensor s i The time spent executing the task locally, T fog T represents the total time spent executing tasks on the fog computing platform. tran The communication time for transmitting tasks from the IoT platform to the fog computing platform.
[0196] Submodule 12 is used to implement the following functions:
[0197] The task offloading and task scheduling model for the IoT platform based on fog computing is established as follows:
[0198]
[0199] The constraints of this model are:
[0200]
[0201] The task offloading and task scheduling model solving module of the fog computing-based IoT platform is used to: solve the task offloading and task scheduling model of the fog computing-based IoT platform, obtain the task allocation scheme of the IoT platform and the task allocation scheme of the fog computing platform, and thus obtain the non-dominated solution (Pareto Front, PF) with the shortest task completion time and the minimum energy consumption of the platform.
[0202] Specifically, the task offloading and task scheduling model solving module of the fog computing-based IoT platform includes submodules 21, 22, 23, 24, 25, and 26, wherein:
[0203] The submodule 21 is used to implement the following functions:
[0204] Denote the maximum number of generations t in a population. max=500, Popsize = 500, Task allocation scheme B of IoT platform = {β1,β2,...,β...} n} represents the individual's encoding, and the parent population P(t) is randomly initialized at this time, with generation t = 0;
[0205] The submodule 22 is used to implement the following functions:
[0206] Use a simulated binary crossover operator to generate a child population O from the parent population P(t);
[0207] The submodule 23 is used to implement the following functions:
[0208] Generate a new offspring population O' by applying a polynomial mutation operator to the offspring population O;
[0209] The submodule 24 is used to implement the following functions:
[0210] Use a local search algorithm to generate a new offspring population O” from the offspring population O’;
[0211] The submodule 25 is used to implement the following functions:
[0212] The offspring population O” is merged with the parent population P(t) to form population R. The non-dominated sorting and crowding distance calculation are used to calculate the new generation population P(t+1) of the parent population P(t).
[0213] The submodule 26 is used to implement the following functions:
[0214] Let t→t+1, if t>t max The algorithm terminates and outputs the task allocation scheme of the IoT platform corresponding to the final parent population P(t). The corresponding task completion time and platform energy consumption are calculated according to the scheme using Equations 1 and 2. Otherwise, proceed to submodule 22.
[0215] Specifically, submodule 22 includes submodule 221, submodule 222, submodule 223, submodule 224, and submodule 225, wherein:
[0216] The submodule 221 is used to implement the following functions:
[0217] Let i = 0, j = n + 1, O = P(t), P c =0.6, η=20;
[0218] The submodule 222 is used to implement the following functions:
[0219] i→i+1; if i≤Popsize / 2, select two individuals from P(t). and Otherwise, the algorithm terminates and outputs a population size of O.
[0220] The submodule 223 is used to implement the following functions:
[0221] Given a random real number a between 0 and 1, if a > P c Enter submodule 2.2.2;
[0222] The submodule 224 is used to implement the following functions:
[0223] Let j → j-1; if j < 1, enter submodule 222, and randomly select a real number b between 0 and 1. yl=0, yu=1, λ=1+2×(y1-yl) / (y2-y1), c=2-λ -(η+1) If b < 0.5, then δ = (c × b) 1 / (1+η) Otherwise, δ=(1 / (2-c×b)) 1 / (1+η) ;
[0224] The submodule 225 is used to implement the following functions:
[0225] calculate calculate Enter submodule 224.
[0226] Specifically, submodule 23 includes submodules 231, 232, 233, 234, 235, and 236, wherein:
[0227] The submodule 231 is used to implement the following functions:
[0228] Let i = 1, j = n + 1, O' = O, P m =0.02, η=20;
[0229] The submodule 232 is used to implement the following functions:
[0230] i→i+1; if i>Popsize, output O'; otherwise, select an individual from O'.
[0231] The submodule 233 is used to implement the following functions:
[0232] Let j → j-1; if j < 1, enter submodule 232, and randomly select a real number a between 0 and 1. If a > P m Repeatedly enter submodule 233;
[0233] The submodule 234 is used to implement the following functions:
[0234] Give a random real number b between 0 and 1, and let yl = 0 and yu = 1.
[0235] The submodule 235 is used to implement the following functions:
[0236] If b<0.5, v=2×b+(1-2×b)*(1-λ1) η+1 Δ=v 1 / (η+1) -1; otherwise, v = 2 × (1 - b) + 2 × (b - 0.5) * (1 - λ²) η+1 Δ=1-v 1 / (η+1) ;
[0237] The submodule 236 is used to implement the following functions:
[0238] calculate Enter submodule 233.
[0239] Specifically, the submodule 24 includes submodules 241, 242, 243, 244, and 245, wherein:
[0240] The submodule 241 is used to implement the following functions:
[0241] Let i=1, j=n+1, O”=O’;
[0242] The submodule 242 is used to implement the following functions:
[0243] Let i → i+1; if i > Popsize, output O”; otherwise, select an individual from O’.
[0244] The submodule 243 is used to implement the following functions:
[0245] Let j → j-1; if j < 1, proceed to submodule 242; if otherwise,
[0246] The submodule 244 is used to implement the following functions:
[0247] Given a random integer q between 1 and n; calculate
[0248]
[0249] The submodule 245 is used to implement the following functions:
[0250] P' = O', P” = O', if and make Calculate the task completion time of P' according to Equation 2; if and make Calculate the task completion time of P” according to Equation 2; compare the task completion times of P’, P”, and O’, and copy the individual corresponding to the minimum value to O”, then enter submodule 243.
[0251] Specifically, submodule 25 includes submodules 251, 252, 253, 254, 255, 256, 257, 258, 259, 2510, 2511, 2512, 2513, 2514, 2515, 2516, and 2517, wherein:
[0252] The submodule 251 is used to implement the following functions:
[0253] Combining P(t) and O”, we obtain R. The energy consumption value of R is then calculated using Equations 1 and 2. and task completion time Initialize the two-dimensional set sortp to empty; let i = 0, j = 0, y = 1, and initialize the set x;
[0254] The submodule 252 is used to implement the following functions:
[0255] Let i → i+1. If i > 2 * Popsize, proceed with submodule 255; set set G. i If it is empty, let x be empty. i =0;
[0256] The submodule 253 is used to implement the following functions:
[0257] Let j → j + 1. If j > 2 * Popsize, proceed with submodule 254; if i = j, repeat submodule 253; otherwise, if && Add j to set G. i In the middle; if && Let x i →x i +1; Repeated submodule 253;
[0258] The submodule 254 is used to implement the following functions:
[0259] If x i =0, add i to the set sortp1 of the two-dimensional set sortp; enter submodule 252;
[0260] The submodule 255 is used to implement the following functions:
[0261] If the set sortp y If empty, proceed with submodule 258; otherwise, set an empty set Q; let ii = 0, jj = 0;
[0262] The submodule 256 is used to implement the following functions:
[0263] Let ii → ii + 1; if ii > size(sortp) y Let y→y+1, sortp m =Q; Enter submodule 255;
[0264] The submodule 257 is used to implement the following functions:
[0265] Let jj→jj+1, if Enter submodule 256; otherwise, let x j →x j -1; if x j =0, put j into set Q; repeat submodule 257;
[0266] The submodule 258 is used to implement the following functions:
[0267] Let z = 0, sum = 0;
[0268] The submodule 259 is used to implement the following functions:
[0269] Let z → z+1, if sum + size(sortp) z If iii > Popsize, proceed with submodule 2511; otherwise, set iii = 1.
[0270] The submodule 2510 is used to implement the following functions:
[0271] If iii > size(sortp) z If the sum is positive, proceed to submodule 259; otherwise, let sum → sum + 1. iii→iii+1, repeating submodule 2510;
[0272] The submodule 2511 is used to implement the following functions:
[0273] Calculate according to Equations 1 and 2 The corresponding individual's energy consumption value I f1 and task completion time value I f2 ;initialization Distance of the corresponding individual's crowding v =0, v=1,2,3,...,size(sortp z );
[0274] The submodule 2512 is used to implement the following functions:
[0275] right According to I f1 Sort by size from smallest to largest, and let Dis1 = ∞. x = 2;
[0276] The submodule 2513 is used to implement the following functions:
[0277] If x > size(sortp) z If necessary, proceed with submodule 2514; otherwise, calculate... x→x+1, repeating submodule 2513;
[0278] The submodule 2514 is used to implement the following functions:
[0279] right According to I f2 Sort by size from smallest to largest, and let Dis1 = ∞. x = 2;
[0280] The submodule 2515 is used to implement the following functions:
[0281] If x > size(sortp) z If necessary, proceed with submodule 2516; otherwise, calculate... x→x+1, repeating submodule 2515;
[0282] The submodule 2516 is used to implement the following functions:
[0283] For R sortpz Sort the values of Dis in ascending order, and set iii = 0;
[0284] The submodule 2517 is used to implement the following functions:
[0285] Let sum → sum + 1, iii → iii + 1; if sum > Popsize, the algorithm terminates and outputs P(t + 1); otherwise, Repeating submodule 2517.
[0286] Experimental results
[0287] The experiment randomly generated sensor networks and fog computing nodes, and conducted multiple sets of comparative experiments. The experimental parameters were set as follows: the number of sensor networks was set to n=12, and the number of fog computing nodes was set to m=10; the IoT task allocation scheme of this invention uses individual encoding, the population size of individuals is set to 500, and the number of iterations is set to 500; the probability P of selecting crossover in the crossover operator is... c =0.6, the probability P of the mutation operator choosing to mutate.m =0.02; sensor s i Task size is randomly generated (v) i ∈[1500,2000]. Then, the sensor-related parameters are randomly generated and set c. i ∈[1 / K log2(1+P i g / KM), 15],r i =1, P i =0.5, K=n, g=1.5, M=1024, b i ∈[1,l i ], l i ∈[1,15]; where c i The purpose of this setting is to ensure that the sensor's unit computational energy consumption is greater than its transmission energy consumption; e i This setting is to ensure that the sensor can complete its task within the remaining battery power; b i The purpose of this setting is to ensure that the time required for computation per unit of sensor workload is longer than the time required for transmission; the relevant parameters for the fog computing node are randomly generated and set with o. i ∈[1,15], a i ∈[1,10],ω i ∈[20,30],z i ∈[0,1]; where ω i Much larger than z i Ensure that the time required for a computing node to perform a unit of task is longer than the transmission time.
[0288] The experiment used the controlled variable method to test the performance of the algorithm of this invention compared with other algorithms under different data. The algorithm of this invention is abbreviated as DLSA.
[0289] See Figure 4 The experiment used 12 sensors, with the workload set between 1500 and 2000. The task completion time and energy consumption of the proposed algorithm and a comparative algorithm were then presented under different numbers of fog computing nodes. Figure 4 (a) to Figure 4 (d) The data on the x-axis is decreasing continuously, while the data on the y-axis remains unchanged. This indicates that the energy consumption required for the task does not change significantly with different numbers of computing nodes, and the completion time decreases as the number of computing nodes increases. At the same time, the feasible solutions of the AEOSSA and IMMPA algorithms fall above those of the DLSA algorithm, indicating that the PF curve of the DLSA algorithm has covered the other algorithms and is superior to them. Furthermore, between AEOSSA and IMMPA, the former has an advantage in time performance, while the latter has an advantage in energy consumption.
[0290] See Figure 5The experiment considers the PF plots for different numbers of sensors, with a fog node count of 10 and a task load of 1500-2000. Firstly, looking at the coordinates... Figure 5 (a) to Figure 5 (d) The data on both the x-axis and y-axis are gradually increasing; this indicates that as the number of sensors increases, the workload also increases, leading to a continuous increase in the energy consumption and completion time required to complete the task, which is consistent with the previous analysis; at the same time, Figure 5 In (d), the PF curve of the DLSA algorithm is significantly lower than that of the AEPSSA algorithm, which indicates that the time performance and energy consumption performance of the DLSA algorithm are better than those of the AEOSSA algorithm.
[0291] See Figure 6 The experiment considers PF plots for different workloads with 12 controlled sensors and 10 fog nodes; from the coordinate axes, Figure 6 (a) to Figure 6 (d) The data on both the x-axis and y-axis are gradually increasing; this indicates that as the workload on each sensor increases, the energy consumption and completion time required to complete the task also increase; in addition, as the workload increases, the feasible solutions of other algorithms are still on the DLSA algorithm curve, which shows that the PF curve of the algorithm of this invention has covered other algorithms, has a dominant trend, and has not been affected by the workload.
[0292] Overall, when testing the experimental results of the proposed algorithm using the controlled variable method against other algorithms, the power factor (PF) curves of the proposed algorithm were generally below or included the feasible solutions of other algorithms. This indicates that the DLSA algorithm outperforms other algorithms in terms of time performance and energy consumption in multi-objective optimization models. Furthermore, compared to the other two algorithms, DLSA obtained more non-dominated solutions and covered a larger area in the regional objective space, regardless of the size of the sensor network structure. In other words, DLSA can obtain more solutions more effectively. Therefore, the algorithm proposed in this invention is more efficient than existing algorithms in solving the task offloading and task scheduling problem of IoT platforms based on fog computing.
Claims
1. A method for task offloading and task scheduling of a fog computing based Internet of Things platform, characterized in that, Includes the following steps: Step 1: Establish a task offloading and task scheduling model for an IoT platform based on fog computing; The modeling steps are as follows: Step 1.1: Measure the energy consumption and task completion time of the platform; The steps are as follows: Formula 1 Formula 2 in, Formula 3 Formula 4 Formula 5 Formula 6 Formula 7 The Internet of Things (IoT) platform consists of a collection of sensors. Composition, in which It is the total number of sensors. Indicates the first One sensor; a set of tasks on the sensor ,in Indicates sensor The total amount of tasks to be completed; the fog computing platform consists of a set of fog nodes. Composition, in which The node is the control node; the other nodes are fog computing nodes. It represents the total number of fog computing nodes; the set of weights assigned to tasks processed locally by the sensors. ,in Indicates sensor Assign weights to tasks processed locally, i.e. For sensors The amount of tasks to be completed locally; the total amount of tasks on the fog computing platform. The set of weights assigned to each fog computing node by the control node to divide the task. ,in Indicates fog node The amount of work to be done; For sensors The number of CPU cycles required to process a unit of task volume. Indicates sensor Energy consumption per CPU cycle For frequency band, For sensors The transmission power, For noise power, For channel gain, Indicates sensor The computation time required per unit of task volume. Indicates sensor The transmission time required to unload a unit of task volume Fog computing node The communication startup overhead of the link, Fog computing node Unit task transmission time, Fog computing node The computational startup overhead, Fog computing node The time required to calculate a unit of task. The energy consumption required for an IoT platform The total time for all tasks to be completed. For sensors Calculate the time spent executing the task locally. This represents the total time spent executing tasks on the fog computing platform. The communication time for the IoT platform to transmit tasks to the fog computing platform; Step 1.2: Based on the measurement method in Step 1.1, establish a task offloading and task scheduling model for the IoT platform based on fog computing; Step 2: Using the evolutionary algorithm of the dominant solution, solve the task offloading and task scheduling model of the IoT platform based on fog computing, and obtain the non-dominated solution with the shortest task completion time and the minimum energy consumption of the platform, thereby realizing task offloading and task scheduling.
2. The task offloading and task scheduling method for an IoT platform based on fog computing according to claim 1, characterized in that, Step 1.2, establishing the task offloading and task scheduling model for the IoT platform based on fog computing, involves the following steps: The constraints of this model are: 。 3. The task offloading and task scheduling method for an IoT platform based on fog computing according to claim 1, characterized in that, Step 2, the solution steps for the task offloading and task scheduling model of the IoT platform based on fog computing, are as follows: Step 2.1: Set the maximum number of generations for the population and population size Task allocation scheme for IoT platforms Encode each individual and randomly initialize the parent population. This era ; Step 2.2: Analyze the parent population Use a simulated binary crossover operator to generate the offspring population. ; Step 2.3: Analyze the offspring population Use the polynomial mutation operator to generate offspring populations. ; Step 2.4: Analyze the offspring population A local search algorithm is used to generate the offspring population. ; Step 2.5: Offspring Population Merging parent populations For population For the population The parent population was obtained by using non-dominated sorting and crowding distance calculation. The new generation of population ; Step 2.6: Let ,like The algorithm terminates and outputs the final parent population. The corresponding task allocation scheme of the IoT platform is used to calculate the corresponding task completion time and platform energy consumption according to Equations 1 and 2. Otherwise, return to step 2.
2.
4. The task offloading and task scheduling method for an IoT platform based on fog computing according to claim 3, characterized in that, The specific implementation steps of step 2.2 are as follows: Step 2.2.1: Let , , , , ; Step 2.2.2: ;like ,from Select two individuals and Otherwise, the algorithm terminates and outputs the offspring population. ; Step 2.2.3: Randomly select a real number between 0 and 1. ,like Return to step 2.2.2; Step 2.2.4: Let ;like Return to step 2.2.2 and randomly select a real number between 0 and 1. ,make , , , , , ,like , ; otherwise, ; Step 2.2.5: Calculation ,calculate ; Return to step 2.2.
4.
5. The task offloading and task scheduling method for an IoT platform based on fog computing according to claim 3, characterized in that, The specific implementation steps of step 2.3 are as follows: Step 2.3.1: Let , , , , ; Step 2.3.2: ;like Output Otherwise, from Choose an individual ; Step 2.3.3: Let ;like Return to step 2.3.2 and randomly select a real number between 0 and 1. ,like Repeat step 2.3.3; Step 2.3.4: Randomly select a real number between 0 and 1. ,make , , , ; Step 2.3.5: If , , ; otherwise, , ; Step 2.3.6: Calculation ; Return to step 2.3.
3.
6. The task offloading and task scheduling method for an IoT platform based on fog computing according to claim 3, characterized in that, The specific implementation steps of step 2.4 are as follows: Step 2.4.1: Let , , ; Step 2.4.2: Let ;like Output Otherwise, from Choose an individual ; Step 2.4.3: Let ;like Return to step 2.4.2; if , ; otherwise, ; Step 2.4.4: Randomly select a number from 1 to... integers ;calculate ; Step 2.4.5: , ,like and ,make , Calculate according to Equation 2 Task completion time; if and ,make , Calculate according to Equation 2 Task completion time; Compare The task completion time will be used to copy the individual corresponding to the minimum value to... Return to step 2.4.
3.
7. The task offloading and task scheduling method for an IoT platform based on fog computing according to claim 3, characterized in that, The specific implementation steps of step 2.5 are as follows: Step 2.5.1: Merge and get Calculated according to Equations 1 and 2 Energy consumption value and task completion time , Initialize a two-dimensional set Empty; let , , Initialize the collection ; Step 2.5.2: Let ,like Proceed to step 2.5.5; Set up the set. If it is empty, let =0; Step 2.5.3: Let ,like Turn to step 2.5.4; if Repeat step 2.5.3; otherwise, if ,Will Add to collection In the middle; if ,make Repeat step 2.5.3; Step 2.5.4: If ,Will Add to a two-dimensional set set Return to step 2.5.2; Step 2.5.5: If set If empty, proceed to step 2.5.8; otherwise, set an empty set. ; make , ; Step 2.5.6: Let ;like ,make , ; Return to step 2.5.5; Step 2.5.7: Let ,like If yes, return to step 2.5.6; otherwise, let... ;like ,Will Add to collection In the middle; repeat step 2.5.7; Step 2.5.8: Let , ; Step 2.5.9: Let ,like Proceed to step 2.5.11; otherwise, let ; Step 2.5.10: If If yes, return to step 2.5.9; otherwise, let... , , Repeat step 2.5.10; Step 2.5.11: Calculate according to Equations 1 and 2 The corresponding individual's energy consumption value and task completion time value ;initialization Crowding distance corresponding to individuals , ; Step 2.5.12: For according to Sort by size from smallest to largest. , , ; Step 2.5.13: If Proceed to step 2.5.14; otherwise, calculate... , Repeat step 2.5.13; Step 2.5.14: For according to Sort by size from smallest to largest. , , ; Step 2.5.15: If Proceed to step 2.5.16; otherwise, calculate... , Repeat step 2.5.15; Step 2.5.16: For according to Sort the values of in ascending order, let ; Step 2.5.17: Let , ;like The algorithm terminates and outputs... ; otherwise, Repeat step 2.5.
17.
8. A system for implementing the task offloading and task scheduling method of an IoT platform based on fog computing as described in any one of claims 1 to 7, characterized in that: It includes a task offloading and task scheduling model establishment module and a task offloading and task scheduling model solving module for a fog computing-based IoT platform, which are connected in sequence. The task offloading and task scheduling model building module of the fog computing-based IoT platform is used to construct the measurement method of energy consumption and task completion time of the platform, and to build the task offloading and task scheduling model of the fog computing-based IoT platform. The task offloading and task scheduling model solving module of the fog computing-based IoT platform is used to solve the task offloading and task scheduling model of the fog computing-based IoT platform, obtain the task allocation scheme of the IoT platform and the task allocation scheme of the fog computing platform, and thus obtain the non-dominated solution with the shortest task completion time and the minimum energy consumption of the platform.