Markov chain and information entropy particle swarm task scheduling method and system in cloud and fog environment

By using Markov chain load prediction and information entropy particle swarm optimization, the problems of load prediction and uneven distribution in cloud computing environments are solved, achieving efficient and stable task scheduling and resource utilization.

CN123178103APending Publication Date: 2026-11-27GUIZHOU UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611698908.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-30
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

In cloud computing environments, traditional scheduling strategies struggle to predict future load trends, leading to node overload and uneven load distribution. Existing methods also struggle to achieve global load balancing and efficient scheduling in high-dimensional solution spaces.

Method used

A load prediction model is constructed using Markov chains to screen candidate resources. Combined with the information entropy particle swarm optimization algorithm, global load balancing and efficient scheduling are achieved by quantifying the load distribution balance and optimizing the task mapping scheme.

Benefits of technology

It effectively reduces task completion time, improves resource utilization and system stability, avoids node overload, shortens task queuing time, and maintains low latency and high resource utilization under large-scale tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123178103A_ABST
    Figure CN123178103A_ABST
Patent Text Reader

Abstract

The present application relates to cloud computing and Internet of Things task scheduling technical field, disclose cloud fog environment under Markov chain and information entropy particle swarm task scheduling method and system, method with the expected execution time of task and the queuing waiting time quantization each virtual machine's load state, build Markov state transition matrix predict virtual machine future in high load state's probability, according to this screening virtual machine and determine candidate resource set;With particle position vector indicates the mapping scheme of task to virtual machine, initialize particle swarm in the range of candidate resource set, the information entropy of load distribution is together into fitness function with total completion time, total energy consumption, iteratively update particle speed and position, output global optimal position corresponding task scheduling scheme;The present application can avoid the virtual machine that will be overloaded before task allocation, reduce the particle swarm search range, be favorable for reducing task completion time and algorithm execution time consuming, and make load distribution tend to be balanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of cloud computing and Internet of Things task scheduling technology, specifically to a method and system for scheduling Markov chains and information entropy particle swarm optimization tasks in a cloud and fog environment. Background Technology

[0002] With the explosive growth of IoT technology, the digitization of the physical world is accelerating, building a complex network that fully interconnects people, machines, and things. While cloud computing, a crucial support for IoT, provides powerful massive data processing capabilities, its centralized architecture leads to high transmission latency, making it difficult to meet the real-time requirements of latency-sensitive applications such as autonomous driving and industrial control. Fog computing, as an extension of cloud computing, has emerged to address this need. By offloading computing and storage resources to the network edge, it effectively reduces service response time, and cloud-fog collaborative computing has become a key architecture supporting IoT applications.

[0003] However, with the elastic scaling of fog node size and the exponential growth of task flow, the cloud and fog computing environment exhibits high dynamism and randomness. In such complex systems, traditional static scheduling strategies struggle to effectively cope with instantaneous load fluctuations, and heterogeneous resource management faces greater challenges, specifically in the following two aspects: First, load imbalance. Most algorithms schedule based solely on the current state, failing to predict future load trends and easily leading to tasks being assigned to nodes that are about to become overloaded. Second, the single dimension of load measurement. Existing methods typically measure node load only using indicators such as resource utilization, failing to fully characterize the structural features and degree of imbalance in the load distribution within the system, making it difficult to effectively guide global scheduling optimization.

[0004] In the existing technology, some studies have attempted to use metaheuristic algorithms to solve the task scheduling problem, which has reduced the task completion time to some extent. However, these methods have the following drawbacks: (1) They lack the ability to predict the future load state, and the scheduling decision lags behind the actual changes in the load, which can easily cause the chain of overhead of node overload and task migration; (2) The load balancing measurement means are singular and it is difficult to characterize the structural imbalance of load distribution among multidimensional heterogeneous resources; (3) Swarm intelligence algorithms such as particle swarm are prone to getting trapped in local optima in high-dimensional solution space, and it is difficult to balance convergence speed and scheduling accuracy.

[0005] Therefore, there is an urgent need for a task scheduling method for cloud and fog environments that can make forward-looking predictions of future load trends, quantitatively measure the load distribution balance, and efficiently search for the optimal scheduling decision. Summary of the Invention

[0006] To address the shortcomings of existing technologies, this invention proposes a Markov chain and information entropy particle swarm optimization task scheduling method and system for cloud and fog environments. By constructing a Markov chain-based load prediction model to predict the future load trend of virtual machines, available resources are screened before scheduling, reducing the risk of overload. Simultaneously, an information entropy-based load balancing metric strategy is used to quantify the load distribution balance and embed it into a multi-objective fitness function optimized by particle swarm optimization. This ensures scheduling accuracy while accelerating convergence and achieving global load balancing, thereby reducing task completion time and improving resource utilization and system stability in cloud and fog environments.

[0007] To achieve the above objectives, the following technical solution is adopted:

[0008] In a first aspect, the present invention provides a method for scheduling Markov chains and information entropy particle swarm optimization tasks in a cloud and fog environment, comprising the following steps:

[0009] S1. Obtain the task set and virtual machine set in the cloud and fog environment, and quantify the load status of each virtual machine at the current moment; the load status is determined based on the estimated execution time and queuing waiting time of the tasks assigned on each virtual machine.

[0010] S2. Divide the load state of the virtual machine into a state space that includes high load state and low load state. Construct a state transition matrix based on the load state history of each virtual machine, and calculate the probability that each virtual machine will be in a high load state in the future based on the state transition matrix.

[0011] S3. Based on the probability that each virtual machine will be in a high-load state at a future time, the set of virtual machines is filtered to determine a set of candidate resources for task scheduling.

[0012] S4. The particle position vector represents the mapping scheme from task to virtual machine. The particle swarm is initialized within the candidate resource set. The information entropy of the load distribution is calculated based on the load status of each virtual machine. The fitness of the mapping scheme represented by each particle is evaluated using a fitness function that includes the total completion time, total energy consumption and the information entropy.

[0013] S5. Update the individual historical best position and global best position according to the fitness of each particle, iteratively update the velocity and position of each particle, and after reaching the preset iteration termination condition, use the mapping scheme corresponding to the global best position as the task scheduling scheme, and distribute the task to the corresponding virtual machine for execution.

[0014] As a preferred implementation, the process of quantifying the load state of each virtual machine at the current moment in S1 includes: computing task i at time... load characteristic value The expression is as follows:

[0015] ;

[0016] Calculate virtual machine j at time 10:00 Load status value The expression is as follows:

[0017] ;

[0018] in, For task i at time The load characteristic value, Let be the estimated execution time of task i. Let be the queuing time for task i on virtual machine j. This represents the load status value of virtual machine j. and is the weighting coefficient, and n is the number of tasks already assigned on virtual machine j.

[0019] In a preferred embodiment, the state space in S2 further includes a stable state, and the load state of each virtual machine is determined based on the comparison result between the load state value and the load threshold: when the load state value is less than the low load threshold, the virtual machine is in a low load state; when the load state value is greater than or equal to the low load threshold and less than or equal to the normal load threshold, the virtual machine is in a stable state; when the load state value is greater than the overload threshold, the virtual machine is in a high load state.

[0020] As a preferred embodiment, the elements of the state transition matrix in S2 Indicates the virtual machine at time The transition probability from state r to state s is expressed as follows:

[0021] ;

[0022] in, Let be a probability function. For virtual machines at time Load status, For virtual machines at time Load status, For virtual machines at time The transition probability from state r to state s; N is the total number of states;

[0023] The state transition matrix satisfies the following constraints:

[0024] ;

[0025] The transition probability at step t is calculated based on the state transition matrix, as shown in the following expression:

[0026] ;

[0027] Where t is the number of transition steps, Let be the transition probability of the virtual machine from state r to state s in t steps. For virtual machines at time The load status is predicted based on the transition probability of each virtual machine being in a high-load state at a future time.

[0028] In a preferred implementation, the process of filtering the set of virtual machines in S3 based on the probability that each virtual machine will be in a high-load state at a future time includes: when the overload probability of virtual machine j... When the load exceeds the overload threshold, virtual machine j is marked as unavailable and no new tasks are assigned to it; when the underload probability of virtual machine j... When the load is less than the underload threshold, the virtual machine j is marked as priority; the virtual machines marked as unavailable are removed from the candidate resource set; and the tasks already assigned on the virtual machines marked as unavailable are migrated to the remaining virtual machines in the candidate resource set.

[0029] In a preferred implementation, the process of calculating the information entropy of the load distribution based on the load status of each virtual machine in S4 includes: calculating the load percentage of the j-th virtual machine. The expression is as follows:

[0030] ;

[0031] The information entropy H of the load distribution is calculated using the following expression:

[0032] ;

[0033] in, H represents the proportion of the total load to the load of the j-th virtual machine. Let p be the information entropy of the load distribution, and p be the probability vector of the load distribution. It is the logarithm to the base 2. M represents the total number of virtual machines, M represents the number of virtual machines in the candidate resource set, and k represents the virtual machine number used when summing the denominator.

[0034] As a preferred embodiment, the fitness function expression in S4 is as follows:

[0035] ;

[0036] in, Let X represent the fitness of the mapping scheme, and let X be the task-to-virtual machine mapping scheme. The total completion time of the mapping scheme, The total energy consumption of the mapping scheme, This is the normalized baseline value for the total completion time. This is the normalized baseline value for total energy consumption. The theoretical maximum entropy of the load distribution is and , , and The weight coefficient is denoted by , and a smaller fitness value indicates a better mapping scheme.

[0037] In a preferred embodiment, the particle velocity is updated in S5, as expressed below:

[0038] ;

[0039] The expression for updating the particle's position is as follows:

[0040] ;

[0041] in, Let z be the velocity of particle z in the d-th dimension. Let g be the position of particle z in the d-th dimension, and g be the current iteration number. Let z be the velocity of particle z in the d-th dimension and the (g+1)-th iteration. Let z be the velocity of particle z in the d-th dimension and the g-th iteration. Let z be the position of particle z in the d-th dimension at the g-th iteration. Let z be the position of particle z in the d-th dimension at the (g+1)-th iteration. Let z be the individual historical best position of particle z. This represents the global optimal position of the particle swarm. For inertial weights, The first acceleration coefficient, The second acceleration coefficient, The first random number, d is the second random number, z is the particle number, and d is the dimension number;

[0042] The inertial weight It decreases linearly with the number of iterations, as shown in the following expression:

[0043] ;

[0044] in, As the initial inertia weight, To terminate the inertia weight, This represents the maximum number of iterations.

[0045] In a preferred embodiment, the cloud and fog environment includes a fog layer and a cloud layer. The fog layer deploys multiple fog nodes, and the cloud layer includes at least one cloud data center, hosts in the cloud data center, and virtual machines running on the hosts. In S5, distributing tasks to the corresponding virtual machines for execution includes: when a task can be completed by the fog layer, distributing the task to a fog node for execution; when a task cannot be completed by the fog layer, distributing the task to a virtual machine in the cloud layer for execution.

[0046] Secondly, embodiments of the present invention also provide a Markov chain and information entropy particle swarm task scheduling system for cloud and fog environments, used to implement the method described in the first aspect, the system comprising:

[0047] The load assessment module is used to obtain the task set and virtual machine set in the cloud and fog environment, and quantify the load status of each virtual machine at the current moment.

[0048] The load prediction module is used to divide the load state of virtual machines into a state space that includes high load state and low load state, construct a state transition matrix based on the load state history of each virtual machine, and calculate the probability that each virtual machine will be in a high load state at a future time.

[0049] The resource filtering module is used to filter the set of virtual machines based on the probability that each virtual machine will be in a high-load state at a future time, and determine the candidate resource set;

[0050] The fitness evaluation module is used to calculate the information entropy of the load distribution based on the load status of each virtual machine, and evaluate the fitness of the mapping scheme represented by each particle using a fitness function that includes the total completion time, total energy consumption and the information entropy.

[0051] The particle swarm optimization module is used to represent the mapping scheme from the task to the virtual machine using the position vector of the particles, initialize the particle swarm within the range of the candidate resource set, iteratively update the velocity and position of each particle, and record the global optimal position.

[0052] The scheduling and execution module is used to take the mapping scheme corresponding to the global optimal position as the task scheduling scheme and distribute the task to the corresponding virtual machine for execution.

[0053] Compared with the prior art, the present invention achieves the following beneficial effects:

[0054] (1) This application predicts the future load state of virtual machines through Markov state transition matrix and selects candidate resources based on the prediction results before particle swarm optimization, so that tasks can avoid virtual machines that are about to be overloaded before allocation, which is beneficial to reduce task queuing and task migration.

[0055] (2) This application quantifies the distribution structure of the load among virtual machines by information entropy and incorporates information entropy into the fitness function, so that the particle swarm tends to the load-balanced mapping scheme during the optimization process, which is beneficial to reduce resource tilt and local overload.

[0056] (3) Before the particle swarm optimization, this application first reduces the candidate resource set and limits the value range of the particle position to the available resources, so that the search space of the particle swarm shrinks as overloaded resources are eliminated, which is conducive to speeding up convergence and reducing the execution time of the algorithm.

[0057] (4) The fitness function of this application includes total completion time, total energy consumption and load distribution information entropy, so that the scheduling scheme takes into account execution efficiency, energy consumption level and load balance, and avoids system imbalance caused by optimization of a single index.

[0058] It should be understood that the description in the Summary of the Invention is not intended to limit the key or essential features of the embodiments of the present invention, nor is it intended to restrict the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0059] The above and other features, advantages, and aspects of the various embodiments of the present invention will become more apparent from the accompanying drawings and the following detailed description. The drawings are provided for a better understanding of the invention and are not intended to limit the invention. In the drawings, the same or similar reference numerals denote the same or similar elements, wherein:

[0060] Figure 1 This is a flowchart illustrating the Markov chain and information entropy particle swarm task scheduling method in a cloud and fog environment according to an embodiment of the present invention.

[0061] Figure 2 This is a comparison chart of the completion time of this invention and other algorithms on 500 tasks;

[0062] Figure 3 This is a comparison chart of the completion time of this invention and other algorithms on 1000 tasks;

[0063] Figure 4 This is a comparison chart of the completion time of this invention and other algorithms on 1500 tasks;

[0064] Figure 5 This is a comparison chart of the PIR of this invention with other algorithms on 500 tasks;

[0065] Figure 6 This is a comparison chart of the PIR of this invention with other algorithms on 1000 tasks;

[0066] Figure 7 This is a comparison chart of the PIR of this invention with other algorithms on 1500 tasks;

[0067] Figure 8 This is a comparison chart of the running time of this invention and other algorithms on 500 tasks;

[0068] Figure 9 This is a comparison chart of the running time of this invention and other algorithms on 1000 tasks;

[0069] Figure 10 This is a comparison chart of the running time of this invention and other algorithms on 1500 tasks;

[0070] Figure 11 This is a schematic diagram of the module of the Markov chain and information entropy particle swarm task scheduling system in a cloud and fog environment according to an embodiment of the present invention. Detailed Implementation

[0071] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0072] Furthermore, the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.

[0073] Figure 1 This is a flowchart illustrating the Markov chain and information entropy particle swarm task scheduling method in a cloud and fog environment, according to an embodiment of the present invention. Figure 1 As shown, the Markov chain and information entropy particle swarm optimization task scheduling method in a cloud and fog environment includes the following steps:

[0074] S1. Obtain the task set and virtual machine set in the cloud environment, and quantify the load status of each virtual machine at the current moment; the load status is determined based on the estimated execution time and queuing waiting time of the tasks assigned on each virtual machine.

[0075] Before building the load prediction model, we first quantify the real-time load status of the virtual machines. For task i, we define its load at time... The load characteristic value is the weighted sum of the expected execution time and queuing time of task i, expressed as follows:

[0076] ;

[0077] in, For task i at time The load characteristic value; Let be the estimated execution time of task i; Queueing time for task i; and The weight parameters are and satisfy the following conditions: ; i is the task number; For a moment.

[0078] The overall load state value of virtual machine j is represented as the sum of the load characteristic values ​​of all assigned tasks at that moment, as shown in the following expression:

[0079] ;

[0080] in, Let be the load status value of virtual machine j; j is the virtual machine number; n is the number of tasks assigned to virtual machine j. The load characteristic value reflects both the task's execution time requirement and its waiting time in the queue, enabling the virtual machine's load status to simultaneously reflect both task execution and queuing dimensions.

[0081] S2. Divide the load state of the virtual machine into a state space that includes high load state and low load state. Construct a state transition matrix based on the load state history of each virtual machine, and calculate the probability that each virtual machine will be in a high load state in the future based on the state transition matrix.

[0082] S2.1 Load status division.

[0083] By abstracting the resource utilization of virtual machines into a series of discrete random states, the system sets three load thresholds, and the load state of the virtual machine is determined according to the rules corresponding to the following expression:

[0084] ;

[0085] in, This represents the load status of virtual machine j; Low load threshold; This is the normal load threshold. This is the overload threshold. When... Less than At this time, the virtual machine is under low load and has sufficient remaining computing power to accept new tasks; when Greater than or equal to and less than or equal to At this time, the virtual machine is in a stable state and is processing tasks normally; when Greater than When a virtual machine is under high load, its task processing speed slows down, necessitating task migration. In practical predictive applications, to improve scheduling efficiency, the normal state and low load state are merged, simplifying the virtual machine state into two core predictive states: high load and low load.

[0086] S2.2 Establishment of the state transition matrix.

[0087] The core of Markov models lies in state transition probabilities, which represent the likelihood that the system will transition from its current state to another state in the next time step. The elements of the state transition matrix... The expression is as follows:

[0088] ;

[0089] in, For virtual machines at time The probability of transitioning from state r to state s; P is the probability function; For virtual machines at time state, For virtual machines at time The load state; r and s are indices of different states in the system, where r is the current state and s is the next state; N is the total number of states in the system; the resulting state transition matrix satisfies the mathematical constraints of the following expression:

[0090] ;

[0091] That is, each transition probability is non-negative, and the sum of the transition probabilities of each row is 1.

[0092] S2.3, Multi-step transition probability and fully connected adjacency matrix.

[0093] The scheduler combines multiple tasks into a unified resource pool, using multi-step transition probabilities to calculate the fully connected adjacency matrix, thereby predicting the future load trend of the virtual machine. The virtual machine at time... The multi-step transition probability from state r to state s is given by the following expression:

[0094] ;

[0095] in, Let be the probability that the virtual machine transitions from state r to state s in t steps, and let represent the conditional probability distribution of the state space. For virtual machines at time The load status; t is the number of transition steps.

[0096] Since the access probability of a link is proportional to the sum of the non-step transition probabilities between states r and s, it can be rewritten as follows: The fully connected adjacency matrix defines the connections and transitions between nodes in the system:

[0097] ;

[0098] in, Let be the adjacency weight between state r and state s in the fully connected adjacency matrix; Let be the probability that a virtual machine transitions from state s to state r in t steps, and h be the number of historical observation steps. Based on the state transition matrix and the fully connected adjacency matrix, the probability that each virtual machine will be in a high-load state at future times can be obtained.

[0099] S3. Based on the probability that each virtual machine will be in a high-load state at a future time, the set of virtual machines is filtered to determine a set of candidate resources for task scheduling.

[0100] The scheduler is a unified resource for combining multiple tasks in a task set. When a virtual machine is overloaded, it will not accept new tasks for processing. Based on the above prediction model, virtual machines are marked according to the following rules: when... When virtual machine j is about to be overloaded, it is marked as unavailable. Unavailable virtual machines will not accept new tasks, and the reconcilable tasks already assigned to them will be migrated to other virtual machines. When virtual machine j is about to become underloaded, it is marked as priority and given priority to accept new tasks. Let be the probability of virtual machine j being overloaded at a future time. Let be the probability of virtual machine j being underloaded at a future time. The overload determination threshold; This is the threshold for determining underload. This is the threshold parameter for virtual machines. Virtual machines marked as unavailable are removed from the candidate resource set, while those marked as priority are retained. The resulting candidate resource set serves as the value range for particle swarm optimization. By predicting the future load state of virtual machines (high or low load), scheduling decisions can proactively allocate tasks to virtual machines with lower expected loads, thereby minimizing latency and avoiding resource bottlenecks. When a virtual machine is predicted to experience high load, its tasks can be transferred to underutilized virtual machines or fog nodes, maintaining a uniform workload distribution and preventing resource congestion.

[0101] S4. The particle position vector represents the mapping scheme from task to virtual machine. The particle swarm is initialized within the candidate resource set. The information entropy of the load distribution is calculated based on the load status of each virtual machine. The fitness of the mapping scheme represented by each particle is evaluated using a fitness function that includes the total completion time, total energy consumption and the information entropy.

[0102] S4.1 Matrix representation of scheduling schemes.

[0103] For a given scheduling scheme, the mapping from tasks to virtual machines is represented by a scheduling matrix X, as shown in the following expression.

[0104] ;

[0105] in, For a matrix with i rows and j columns, the matrix elements are... This represents the allocation relationship between task i and virtual machine j.

[0106] S4.2, Information entropy of load distribution.

[0107] In probability theory, information entropy is used to measure the uncertainty or uniformity of a system's distribution. For a resource set consisting of virtual machines, let the current load of the j-th virtual machine (calculated using the load characteristics defined in step S1) account for the proportion of the total system load. Define the probability vector of load distribution. The expression for the load share of the j-th virtual machine is as follows:

[0108] ;

[0109] in, This represents the proportion of the total load to the load of the j-th virtual machine. is the total number of virtual machines; k is the virtual machine number used in the summation of the denominator. The sum of the load percentages of each virtual machine is 1, i.e. .

[0110] Based on the current system load distribution, its information entropy is calculated using the following formula:

[0111] ;

[0112] in, Let p be the information entropy of the load distribution; p is the probability vector of the load distribution, i.e., composed of each... The vector composed of M and M represents the number of virtual machines in the candidate resource set. The values ​​are consistent; log2 is the logarithm to the base 2. If all virtual machines have the same load percentage, that is... This indicates that the load is completely uniformly distributed, at which point the information entropy reaches its theoretical maximum. Entropy is minimized when the load is concentrated on a single virtual machine. The system has the highest degree of order but is extremely unbalanced. Therefore, one of the goals of scheduling optimization is to maximize the entropy H(p).

[0113] S4.3, Entropy-weighted multi-objective fitness function.

[0114] Traditional Particle Swarm Optimization (PSO) algorithms only consider time and cost, making them prone to getting trapped in local optima and causing load skew. This embodiment introduces information entropy into the objective function. Since the objective function aims to find the minimum value, and the information entropy of the load distribution needs to be maximized, a negative correlation term of information entropy is introduced, forming a multi-objective weighted sum, as expressed below:

[0115] ;

[0116] in, X represents the fitness of the mapping scheme; X is the task-to-virtual machine mapping scheme, i.e., the scheduling matrix. This represents the total completion time of the current scheduling plan; H(p) represents the total energy consumption of the current scheduling scheme; H(p) is the measured entropy value of the current load distribution, used to measure the degree of load balancing. This is the normalized baseline value for the total completion time; This is the normalized baseline value for total energy consumption; It represents the theoretical maximum entropy; , and For the weighting coefficients, satisfying This function enables the PSO algorithm to not only find the fastest solution during the search process, but also the solution that maximizes the system entropy; the smaller the fitness, the better the mapping scheme.

[0117] S5. Update the individual historical best position and global best position according to the fitness of each particle, iteratively update the velocity and position of each particle, and after reaching the preset iteration termination condition, use the mapping scheme corresponding to the global best position as the task scheduling scheme, and distribute the task to the corresponding virtual machine for execution.

[0118] S5.1, Particle Coding.

[0119] Particle Swarm Optimization (PSO) is a metaheuristic algorithm that simulates the foraging behavior of bird flocks. Each particle represents a task-to-resource mapping scheme, and the particle's position vector... The task allocation decision is encoded, where D is the total number of tasks. This represents the virtual machine number assigned to task i. The value of each dimension of the particle is limited to the range of the candidate resource set obtained in step S3. PSO tracks the historical optimal position of an individual. and the global optimal position To guide the search process.

[0120] S5.2, Speed ​​and Position Update.

[0121] The particle's velocity is updated according to the following expression:

[0122] ;

[0123] The particle's position is updated according to the following expression:

[0124] ;

[0125] in, Let z be the velocity of particle z in the d-th dimension. Let g be the position of particle z in the d-th dimension, and g be the current iteration number. Let z be the velocity of particle z in the d-th dimension and the (g+1)-th iteration. Let z be the velocity of particle z in the d-th dimension and the g-th iteration. Let z be the position of particle z in the d-th dimension at the g-th iteration. Let z be the position of particle z in the d-th dimension at the (g+1)-th iteration. Let z be the individual historical best position of particle z. This represents the global optimal position of the particle swarm. For inertial weights, The first acceleration coefficient, The second acceleration coefficient, The first random number, The second random number, z is the particle number, and d is the dimension number;

[0126] S5.3, Inertia weight decreases linearly.

[0127] To balance global exploration and local development, the inertia weight adopts a linear decreasing strategy, as shown in the following expression:

[0128] ;

[0129] in, The inertia weight at the g-th iteration; This is the initial inertia weight, i.e., the upper limit of the inertia weight; The inertia weight is to be terminated, i.e., the lower limit of the inertia weight; This represents the maximum number of iterations. In this embodiment, =0.9, =0.4, first acceleration coefficient With the second acceleration coefficient Values .

[0130] S5.4 Iterative optimization process.

[0131] Set particle swarm size Maximum number of iterations In each iteration, the total completion time is calculated for each mapping scheme in the population. Total energy consumption Calculate the load percentage of each virtual machine. The algorithm calculates the information entropy of the load distribution, calculates the fitness, updates the individual's historical best position and global best position, and then updates the speed, position, and inertia weights. It terminates after reaching the maximum number of iterations and returns the mapping scheme corresponding to the global best position, which is then used as the task scheduling scheme.

[0132] S5.5, Task Distribution.

[0133] When tasks are distributed to corresponding virtual machines for execution, if a task can be completed by the fog layer, it is distributed to a fog node for execution; if a task cannot be completed by the fog layer, it is distributed to a virtual machine in the cloud layer for execution. Dynamic task migration and reallocation are achieved through Markov chain prediction, accelerating convergence while maintaining scheduling accuracy and achieving global load balancing to reduce task completion time.

[0134] Experimental verification:

[0135] The simulation experiments of the proposed method and comparison algorithm were all completed in the MATLAB R2022b software environment. The experimental platform was a Mac laptop, configured with: Apple Silicon M1 chip, 16GB unified memory, 8-core central processing unit (CPU) and 8-core graphics processing unit (GPU).

[0136] 1. Parameter definition;

[0137] To implement the method presented in this paper, the PSO algorithm and system parameters are configured as follows: the PSO population size is 10, the iterations are 30, and the experiment is repeated 50 times with the average value taken. The system architecture includes a cloud layer and a fog layer: the cloud layer consists of 2 data centers and 4 hosts, each host containing 10 virtual machines with a processing capacity of 3000–5000 MIPS, 1GB of main memory, 20GB of secondary storage, and a bandwidth of 0.5GB / s. The fog layer deploys 15 nodes, each with a CPU processing capacity of 100–2800 MIPS, 0.5GB of memory, 10GB of main memory, and a transmission rate of 1GB / s. This configuration is used to simulate a heterogeneous fog-cloud environment and verify scheduling performance.

[0138] 2. Completion Time (Makespan) Comparative Analysis;

[0139] To verify the performance of Markov Chain and Information-entropy Particle Swarm Optimization (MCIPSO) under different loads, simulations were conducted with 500, 1000, and 1500 tasks. Figure 2 It can be seen that when the task size is small (500), MCIPSO's completion time is 22s, significantly better than Differential Evolution (DE) (43s), Whale Optimization Algorithm (WOA) (39s), Genetic Algorithm (GA) (60s), and Harris Hawks Optimization (HHO) (37s). When the workload increases to 1000, as the task size increases, MCIPSO's completion time increases to 37s, while the best-performing algorithm in the same category, WOA, takes 54s, and GA takes as long as 131s. Figure 3 As shown. Furthermore, with 1500 tasks, MCIPSO still maintains its lead, completing in just 62 seconds, a reduction of approximately 74% compared to the worst-performing GA (243 seconds). Figure 4 As shown in the figure, experimental data demonstrates that MCIPSO exhibits the shortest completion time across various scales. This is attributed to the Markov chain prediction mechanism, which preemptively eliminates potentially high-load nodes, allowing tasks to be allocated to virtual machines with more abundant computing resources, thereby effectively reducing queuing time.

[0140] 3. Analysis of PIR performance improvement rate;

[0141] The PIR metric is used to measure the performance improvement of MCIPSO compared to traditional metaheuristic algorithms. According to... Figure 5 , Figure 6 and Figure 7Data analysis shows that at a task scale of 500, MCIPSO achieves the highest PIR improvement rate compared to DE, reaching 31.7%, and also shows improvements of 24.1% and 18.3% compared to GA and PSO, respectively. At a task scale of 1000, although the overall improvement percentage fluctuates, MCIPSO's improvement over the native PSO remains significant, reaching 12.5%. When the task scale increases to 1500, MCIPSO achieves an improvement rate of 23.1% over HHO, and maintains improvements of over 12.5% ​​for GA and DE. The analysis indicates that MCIPSO enhances the global search capability of PSO by introducing an information entropy strategy, avoiding the problem of traditional algorithms easily getting trapped in local optima in multidimensional solution spaces, thus achieving a better resource mapping scheme in complex load balancing tasks.

[0142] 4. Execution Time Metric Analysis;

[0143] The difference in algorithm runtime directly reflects the computational overhead of different scheduling strategies. Figure 8 , Figure 9 , Figure 10 The relevant experimental results are presented. From a computational efficiency perspective, when the number of tasks is small (e.g., 500), [the results are shown]. Figure 8 The proposed algorithm MCIPSO has the shortest execution time of 15.711 compared to other comparison algorithms; however, when the task size increases to 1000 (e.g., ... Figure 9 MCIPSO's decision-making runtime is 19.373 seconds, significantly lower than all other compared algorithms. HHO has the longest runtime at 37.743 seconds. In terms of scalability, when the number of tasks increases to 1500, MCIPSO's runtime rises to 22.170 seconds, still better than DE's 25.259 seconds, GA's 32.184 seconds, and WOA's 40.586 seconds. Therefore, the experimental results demonstrate that hybrid models do not necessarily lead to high computational costs. The Markov chain's prediction mechanism reduces the candidate resource set before the particle swarm optimization search, thus accelerating the particle swarm convergence process. MCIPSO maintains low computational time while ensuring scheduling accuracy. In summary, the MCIPSO framework, by predicting load trends using Markov and combining information entropy to quantify load balancing, successfully achieves the goals of low latency and high resource utilization in heterogeneous foggy cloud environments. Especially in large-scale task scenarios, the algorithm demonstrates excellent stability in terms of completion time, performance improvement rate, and running efficiency.

[0144] like Figure 11 The diagram shows a module schematic of a Markov chain and information entropy particle swarm task scheduling system under cloud and fog conditions according to an embodiment of the present invention. The system includes:

[0145] The load assessment module 101 is used to obtain the task set and virtual machine set in the cloud and fog environment, and quantify the load status of each virtual machine at the current moment.

[0146] The load prediction module 102 is used to divide the load state of virtual machines into a state space that includes high load state and low load state, construct a state transition matrix based on the load state history of each virtual machine, and calculate the probability that each virtual machine will be in a high load state at a future time.

[0147] The resource filtering module 103 is used to filter the set of virtual machines based on the probability that each virtual machine will be in a high-load state at a future time, and determine the candidate resource set;

[0148] The fitness evaluation module 104 is used to calculate the information entropy of the load distribution based on the load status of each virtual machine, and evaluate the fitness of the mapping scheme represented by each particle using a fitness function that includes the total completion time, total energy consumption and the information entropy.

[0149] The particle swarm optimization module 105 is used to represent the mapping scheme from the task to the virtual machine using the position vector of the particles, initialize the particle swarm within the range of the candidate resource set, iteratively update the velocity and position of each particle, and record the global optimal position.

[0150] The scheduling and execution module 106 is used to take the mapping scheme corresponding to the global optimal position as the task scheduling scheme and distribute the task to the corresponding virtual machine for execution.

[0151] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the described module can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0152] It should also be noted that, in the embodiments of this application, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0153] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined in the embodiments of this application may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown in this application, but is to be accorded the widest scope consistent with the principles and novel features disclosed in the embodiments of this application.

Claims

1. A task scheduling method based on Markov chains and information entropy particle swarm optimization in a cloud and fog environment, characterized in that... Includes the following steps: S1. Obtain the task set and virtual machine set in the cloud and fog environment, and quantify the load status of each virtual machine at the current moment; the load status is determined based on the estimated execution time and queuing waiting time of the tasks assigned on each virtual machine. S2. Divide the load state of the virtual machine into a state space that includes high load state and low load state. Construct a state transition matrix based on the load state history of each virtual machine, and calculate the probability that each virtual machine will be in a high load state in the future based on the state transition matrix. S3. Based on the probability that each virtual machine will be in a high-load state at a future time, the set of virtual machines is filtered to determine a set of candidate resources for task scheduling. S4. The particle position vector represents the mapping scheme from task to virtual machine. The particle swarm is initialized within the candidate resource set. The information entropy of the load distribution is calculated based on the load status of each virtual machine. The fitness of the mapping scheme represented by each particle is evaluated using a fitness function that includes the total completion time, total energy consumption and the information entropy. S5. Update the individual historical best position and global best position according to the fitness of each particle, iteratively update the velocity and position of each particle, and after reaching the preset iteration termination condition, use the mapping scheme corresponding to the global best position as the task scheduling scheme, and distribute the task to the corresponding virtual machine for execution.

2. The method according to claim 1, characterized in that, The process of quantifying the load state of each virtual machine at the current moment in S1 includes: computing task i at time... load characteristic value The expression is as follows: ; Calculate virtual machine j at time 10:00 Load status value The expression is as follows: ; in, For task i at time The load characteristic value, Let be the estimated execution time of task i. Let be the queuing time for task i on virtual machine j. This represents the load status value of virtual machine j. and is the weighting coefficient, and n is the number of tasks already assigned on virtual machine j.

3. The method according to claim 1, characterized in that, The state space described in S2 also includes a stable state. The load state of each virtual machine is determined based on the comparison between the load state value and the load threshold: when the load state value is less than the low load threshold, the virtual machine is in a low load state; when the load state value is greater than or equal to the low load threshold and less than or equal to the normal load threshold, the virtual machine is in a stable state; when the load state value is greater than the overload threshold, the virtual machine is in a high load state.

4. The method according to claim 1, characterized in that, Elements of the state transition matrix described in S2 Indicates the virtual machine at time The transition probability from state r to state s is expressed as follows: ; in, Let be a probability function. For virtual machines at time Load status, For virtual machines at time The load states, where N is the total number of states; The state transition matrix satisfies the following constraints: ; The transition probability at step t is calculated based on the state transition matrix, as shown in the following expression: ; Where t is the number of transition steps, Let be the transition probability of the virtual machine from state r to state s in t steps. For virtual machines at time The load status is predicted based on the transition probability of each virtual machine being in a high-load state at a future time.

5. The method according to claim 1, characterized in that, The process of filtering the set of virtual machines in S3 based on the probability that each virtual machine will be in a high-load state at a future time includes: when the overload probability of virtual machine j... When the load exceeds the overload threshold, virtual machine j is marked as unavailable and no new tasks are assigned to it; when the underload probability of virtual machine j... When the load is less than the underload threshold, the virtual machine j is marked as priority; the virtual machines marked as unavailable are removed from the candidate resource set; and the tasks already assigned on the virtual machines marked as unavailable are migrated to the remaining virtual machines in the candidate resource set.

6. The method according to claim 2, characterized in that, The process of calculating the information entropy of load distribution based on the load status of each virtual machine in S4 includes: calculating the load percentage of the j-th virtual machine. The expression is as follows: ; The information entropy H of the load distribution is calculated using the following expression: ; in, H represents the proportion of the total load to the load of the j-th virtual machine. Let p be the information entropy of the load distribution, and p be the probability vector of the load distribution. It is the logarithm to the base 2. M represents the total number of virtual machines, M represents the number of virtual machines in the candidate resource set, and k represents the virtual machine number used when summing the denominator.

7. The method according to claim 6, characterized in that, The fitness function expression described in S4 is as follows: ; in, Let X represent the fitness of the mapping scheme, and let X be the task-to-virtual machine mapping scheme. The total completion time of the mapping scheme, The total energy consumption of the mapping scheme, This is the normalized baseline value for the total completion time. This is the normalized baseline value for total energy consumption. The theoretical maximum entropy of the load distribution and , , and The weight coefficient is denoted by , and a smaller fitness value indicates a better mapping scheme.

8. The method according to claim 1, characterized in that, The velocity of particles is updated in S5 using the following expression: ; The expression for updating the particle's position is as follows: ; in, Let z be the velocity of particle z in the d-th dimension. Let g be the position of particle z in the d-th dimension, and g be the current iteration number. Let z be the velocity of particle z in the d-th dimension and the (g+1)-th iteration. Let z be the velocity of particle z in the d-th dimension and the g-th iteration. Let z be the position of particle z in the d-th dimension at the g-th iteration. Let z be the position of particle z in the d-th dimension at the (g+1)-th iteration. Let z be the individual historical best position of particle z. This represents the globally optimal position of the particle swarm. For inertial weights, The first acceleration coefficient, The second acceleration coefficient, The first random number, is the second random number, z is the particle number, and d is the dimension number; The inertial weight It decreases linearly with the number of iterations, as shown in the following expression: ; in, As the initial inertia weight, To terminate the inertia weight, This represents the maximum number of iterations.

9. The method according to claim 1, characterized in that, The cloud and fog environment includes a fog layer and a cloud layer. The fog layer deploys multiple fog nodes, and the cloud layer includes at least one cloud data center, hosts in the cloud data center, and virtual machines running on the hosts. In S5, distributing tasks to the corresponding virtual machines for execution includes: when a task can be completed by the fog layer, distributing the task to a fog node for execution; when a task cannot be completed by the fog layer, distributing the task to a virtual machine in the cloud layer for execution.

10. A Markov chain and information entropy particle swarm task scheduling system for cloud and fog environments, used to implement the method as described in any one of claims 1-9, characterized in that, The system includes: The load assessment module is used to obtain the task set and virtual machine set in the cloud and fog environment, and quantify the load status of each virtual machine at the current moment. The load prediction module is used to divide the load state of virtual machines into a state space that includes high load state and low load state, construct a state transition matrix based on the load state history of each virtual machine, and calculate the probability that each virtual machine will be in a high load state at a future time. The resource filtering module is used to filter the set of virtual machines based on the probability that each virtual machine will be in a high-load state at a future time, and to determine the candidate resource set; The fitness evaluation module is used to calculate the information entropy of the load distribution based on the load status of each virtual machine, and evaluate the fitness of the mapping scheme represented by each particle using a fitness function that includes the total completion time, total energy consumption and the information entropy. The particle swarm optimization module is used to represent the mapping scheme from the task to the virtual machine using the position vector of the particles, initialize the particle swarm within the range of the candidate resource set, iteratively update the velocity and position of each particle, and record the global optimal position. The scheduling and execution module is used to take the mapping scheme corresponding to the global optimal position as the task scheduling scheme and distribute the task to the corresponding virtual machine for execution.