CN116405498A - Container scheduling method and system based on entropy weight method and multi-strategy particle swarm algorithm - Google Patents
Container scheduling method and system based on entropy weight method and multi-strategy particle swarm algorithm Download PDFInfo
- Publication number
- CN116405498A CN116405498A CN202310293481.9A CN202310293481A CN116405498A CN 116405498 A CN116405498 A CN 116405498A CN 202310293481 A CN202310293481 A CN 202310293481A CN 116405498 A CN116405498 A CN 116405498A
- Authority
- CN
- China
- Prior art keywords
- swarm algorithm
- particle swarm
- container
- container scheduling
- strategy
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 239000002245 particle Substances 0.000 title claims abstract description 158
- 238000000034 method Methods 0.000 title claims abstract description 95
- 230000006870 function Effects 0.000 claims abstract description 57
- 239000011159 matrix material Substances 0.000 claims abstract description 22
- 239000013598 vector Substances 0.000 claims description 53
- 230000003044 adaptive effect Effects 0.000 claims description 8
- 230000008569 process Effects 0.000 claims description 5
- 238000004364 calculation method Methods 0.000 claims description 4
- 238000010276 construction Methods 0.000 claims description 4
- 230000000694 effects Effects 0.000 abstract description 6
- 238000004891 communication Methods 0.000 abstract description 4
- 230000002028 premature Effects 0.000 abstract description 3
- 238000005457 optimization Methods 0.000 description 10
- 238000005516 engineering process Methods 0.000 description 4
- 230000009286 beneficial effect Effects 0.000 description 3
- 238000011161 development Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000001133 acceleration Effects 0.000 description 1
- 238000003339 best practice Methods 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 230000008878 coupling Effects 0.000 description 1
- 238000010168 coupling process Methods 0.000 description 1
- 238000005859 coupling reaction Methods 0.000 description 1
- 238000013501 data transformation Methods 0.000 description 1
- 230000003247 decreasing effect Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 230000001627 detrimental effect Effects 0.000 description 1
- 238000005315 distribution function Methods 0.000 description 1
- 238000011156 evaluation Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000012804 iterative process Methods 0.000 description 1
- 238000002386 leaching Methods 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 238000007726 management method Methods 0.000 description 1
- 230000005012 migration Effects 0.000 description 1
- 238000013508 migration Methods 0.000 description 1
- 230000035772 mutation Effects 0.000 description 1
- 239000004575 stone Substances 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1001—Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
- H04L67/1004—Server selection for load balancing
- H04L67/1008—Server selection for load balancing based on parameters of servers, e.g. available memory or workload
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/004—Artificial life, i.e. computing arrangements simulating life
- G06N3/006—Artificial life, i.e. computing arrangements simulating life based on simulated virtual individual or collective life forms, e.g. social simulations or particle swarm optimisation [PSO]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1001—Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
- H04L67/1004—Server selection for load balancing
- H04L67/1012—Server selection for load balancing based on compliance of requirements or conditions with available server resources
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1001—Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
- H04L67/1004—Server selection for load balancing
- H04L67/1025—Dynamic adaptation of the criteria on which the server selection is based
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02T—CLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
- Y02T10/00—Road transport of goods or passengers
- Y02T10/10—Internal combustion engine [ICE] based vehicles
- Y02T10/40—Engine management systems
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Biophysics (AREA)
- Evolutionary Computation (AREA)
- Artificial Intelligence (AREA)
- Biomedical Technology (AREA)
- Health & Medical Sciences (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- Life Sciences & Earth Sciences (AREA)
- General Health & Medical Sciences (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Computer Hardware Design (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The invention discloses a container scheduling method and a system based on an entropy weight method and a multi-strategy particle swarm algorithm, wherein the method comprises the following steps: constructing a multi-objective container scheduling model by taking minimized data exchange rate among different servers and server average load unbalance as objective functions; acquiring server set, container set and historical scheduling instance data, constructing a target priority matrix by combining a multi-target container scheduling model, and determining the weight of each target function; the multi-objective of the container scheduling model is converted into a single objective by using a linear weighting method, and the multi-strategy particle swarm algorithm is used for carrying out iterative solution according to the container scheduling model of the single objective to obtain the final optimal solution of the container scheduling, so that the problems of easy premature and insufficient population diversity of the objective balancing problem and the basic particle swarm algorithm are solved, the load of a server is more balanced, the network communication load is lower, and the optimal balancing effect is achieved.
Description
Technical Field
The invention relates to the technical field of container scheduling, in particular to a container scheduling method and system based on an entropy weight method and a multi-strategy particle swarm algorithm.
Background
Cloud computing is an information infrastructure in the Internet age and is also an important foundation stone for industrial Internet development, and can powerfully push the step of data transformation of enterprises in China to become a new engine for accelerating new and old kinetic energy conversion and creating high-quality development.
The container technology is essentially a virtualization technology, encapsulates programs and the running environment of the programs, and because the running environments are encapsulated together, the container enables the programs to be more easily migrated, avoids the difference caused by the underlying operating system, and is convenient to manage and deploy. The cloud primary technology represented by the container, the microservice and the DevOps provides the best practice path for fully playing the cloud efficiency, helps enterprises to construct the application system which is reliable in elasticity, loose in coupling, easy to manage and observable, improves the delivery efficiency and reduces the operation and maintenance complexity. The cloud primordial well meets the essential requirement of cloud computing development, greatly improves cloud efficiency for enterprises, and is becoming a next generation cloud technology kernel for driving traditional cloud computing to improve the efficiency. From the aspect of industrial utility, cloud protogenesis greatly releases cloud bonus and becomes a powerful engine for driving digital infrastructure.
However, when a large number of containers exist in the container cloud platform, server load imbalance, network communication load overload and the like frequently occur in the operation process, the flexible expansion capability of container cluster scheduling and management is insufficient, and the requirements of large-scale cloud service deployment load sensing and dynamic migration are difficult to meet.
Container scheduling belongs to the NP-hard problem, which is usually solved by using a swarm intelligence algorithm. The container scheduling is converted into a multi-objective optimization problem, and more factors are considered through a multi-objective container scheduling scheme, so that more optimal scheduling is realized. However, the existing multi-objective container scheduling scheme has the problem that objective weights are difficult to balance, and the objective weights influence the optimization effect of the final scheduling scheme. The particle swarm algorithm is a popular swarm intelligent algorithm and has the advantages of few parameters, rapid convergence and the like. However, the basic particle swarm algorithm has the problems of easy premature, insufficient population diversity and the like, so that the optimal effect of the finally solved multi-target container scheduling scheme is poor.
Disclosure of Invention
In order to solve the defects in the prior art, the invention provides a container scheduling method and a system based on an entropy weight method and a multi-strategy particle swarm algorithm, wherein the entropy weight method is utilized to analyze the information quantity of each objective function value in a scheduling instance, and weights are reasonably distributed according to the entropy values of the multi-objective function, so that the objective balance problem is solved; the method comprises the steps of adopting a multi-strategy particle swarm algorithm, encoding a scheduling scheme into a position vector of particles, analyzing the historical position characteristics of individual particles by utilizing a mutual information method, balancing global search and local search by combining with Lewy disturbance, self-adaptive inertia weight and learning factors, solving the problems of easiness in maturing and insufficient population diversity existing in the basic particle swarm algorithm, realizing an optimal container scheduling scheme, and realizing more balanced server load and lower network communication load.
In a first aspect, the present invention provides a container scheduling method based on an entropy weight method and a multi-policy particle swarm algorithm.
A container scheduling method based on an entropy weight method and a multi-strategy particle swarm algorithm comprises the following steps:
constructing a multi-objective container scheduling model by taking minimized data exchange rate among different servers and server average load unbalance as objective functions;
acquiring server set, container set and historical scheduling instance data, constructing a target priority matrix by combining a multi-target container scheduling model, determining entropy values of all target functions, and further determining weights of all target functions;
and converting the multiple targets of the container scheduling model into single targets by using a linear weighting method, and carrying out iterative solution by using a multi-strategy particle swarm algorithm according to the container scheduling model of the single targets to obtain a final optimal solution of container scheduling.
Further technical solution, constraints of the multi-objective container scheduling model include:
each container is deployed on only one server;
the resources required by all containers in each server do not exceed the capacity of the server in which they are located.
According to a further technical scheme, the multi-strategy particle swarm algorithm is as follows:
based on a basic particle swarm algorithm, a particle swarm algorithm improved by a particle Lewy disturbance strategy, an adaptive weight and an adaptive learning factor strategy based on a mutual information method is utilized.
According to a further technical scheme, the iterative solving process by utilizing the multi-strategy particle swarm algorithm comprises the following steps:
taking an objective function of a container scheduling model as an adaptability function of a particle swarm algorithm, carrying out particle coding, randomly initializing a position vector and a speed vector of particles, setting related parameters, and starting iteration;
based on the difference of iteration times, self-adaptively adjusting and calculating inertia weight and learning factor of the current iteration;
updating the velocity vector and the position vector of the particle based on the inertia weight and the learning factor of the current iteration;
calculating the similarity of the updated position vector and the position vector before updating aiming at each particle, if the similarity is larger than a set threshold value, updating the updated particle position vector by using the Lewy disturbance, otherwise, not performing any operation;
judging whether the maximum iteration times are reached, if so, outputting the optimal fitness and all updated particle position vectors, otherwise, carrying out loop iteration.
According to a further technical scheme, the similarity between the updated position vector and the position vector before updating is calculated as follows: based on the mutual information method, calculating the mutual information value of the updated position vector and the position vector before updating, and taking the mutual information value as a similarity value.
Further technical proposal, inertia weight omega and learning factor lambda 1 And lambda (lambda) 2 The calculation formula of (2) is as follows:
in the above, t and t max The current iteration number and the maximum iteration number, omega 1 Representing the minimum value of inertial weight, ω 2 Represents the maximum value of inertial weight, gamma 1 、γ 2 、γ 3 Is a preset coefficient.
In a second aspect, the invention provides a container scheduling system based on an entropy weight method and a multi-strategy particle swarm algorithm.
A container scheduling system based on an entropy weight method and a multi-strategy particle swarm algorithm, comprising:
the data acquisition module is used for acquiring server set, container set and historical scheduling instance data;
the container scheduling model construction module is used for constructing a multi-target container scheduling model by taking the minimized data exchange rate among different servers and the average server load unbalance degree as objective functions;
the modeling and simplifying module is used for constructing a target optimal attribute matrix according to the acquired data and combining a multi-target container scheduling model, determining the entropy value of each target function, further determining the weight of each target function, and converting the multi-target of the container scheduling model into a single target by using a linear weighting method;
and the model solving module is used for carrying out iterative solving by utilizing a multi-strategy particle swarm algorithm according to the single-target container scheduling model to obtain a final container scheduling optimal solution.
According to a further technical scheme, the multi-strategy particle swarm algorithm is as follows:
based on a basic particle swarm algorithm, a particle swarm algorithm improved by a particle Lewy disturbance strategy, an adaptive weight and an adaptive learning factor strategy based on a mutual information method is utilized.
In a third aspect, the invention also provides an electronic device comprising a memory and a processor and computer instructions stored on the memory and running on the processor, which when executed by the processor, perform the steps of the method of the first aspect.
In a fourth aspect, the present invention also provides a computer readable storage medium storing computer instructions which, when executed by a processor, perform the steps of the method of the first aspect.
The one or more of the above technical solutions have the following beneficial effects:
1. the invention provides a container scheduling method and a system based on an entropy weight method and a multi-strategy particle swarm algorithm, which are characterized in that the information quantity of each objective function value in a scheduling example is analyzed by using the entropy weight method, the weight of the objective function is determined according to the information quantity of the objective function value, the weight is reasonably distributed for the objective function, the objective balance problem is solved, the load of a server is more balanced, the network communication load is lower, and the optimal balance effect is achieved.
2. The invention adopts a multi-strategy particle swarm algorithm to encode a container scheduling scheme into a position vector of particles, analyzes the historical position characteristics of individual particles by utilizing a mutual information method, combines the Lewy disturbance, the self-adaptive inertia weight and the learning factor, balances the global search and the local search, solves the problems of easy precocity and insufficient population diversity existing in the basic particle swarm algorithm, and realizes faster and more accurate solving of the optimal container scheduling scheme.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the invention.
FIG. 1 is a general flow chart of a container scheduling method based on an entropy weight method and a multi-strategy particle swarm algorithm according to an embodiment of the invention;
FIG. 2 is an algorithm flow chart of a container scheduling method based on an entropy weight method and a multi-strategy particle swarm algorithm according to an embodiment of the invention;
fig. 3 is a flowchart of a method for solving a container scheduling optimal solution by using a multi-strategy particle swarm algorithm according to an embodiment of the present invention.
Detailed Description
It should be noted that the following detailed description is exemplary and is intended to provide further explanation of the invention. Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
It is noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of exemplary embodiments according to the present invention. As used herein, the singular is also intended to include the plural unless the context clearly indicates otherwise, and furthermore, it is to be understood that the terms "comprises" and/or "comprising" when used in this specification are taken to specify the presence of stated features, steps, operations, devices, components, and/or combinations thereof.
Example 1
Aiming at the problem that the objective weights in the multi-objective container scheduling are difficult to balance, the information quantity of each objective function value in a scheduling instance is analyzed by utilizing the concept of entropy in the information theory, and the objective function weights are determined according to the information quantity of the objective function values; aiming at the problems that a container scheduling scheme is solved by utilizing a basic particle swarm algorithm, the algorithm is easy to be matured and has insufficient population diversity, a mutual information method is utilized to analyze the historical position characteristics of individual particles, the Lev disturbance is added to get rid of local optimum, and self-adaptive inertia weight and learning factors are designed to balance global search and local search. That is, in combination with the entropy weight method and the multi-strategy particle swarm algorithm, the embodiment provides a container scheduling method based on the entropy weight method and the multi-strategy particle swarm algorithm, on one hand, the entropy weight method is utilized to determine the objective function weight, on the other hand, the container scheduling scheme is encoded into the position vector of the particle, and the multi-strategy particle swarm algorithm is utilized to solve the optimal container scheduling scheme.
A container scheduling method based on an entropy weight method and a multi-strategy particle swarm algorithm is shown in fig. 1, and comprises the following steps:
s1, constructing a multi-objective container scheduling model by taking minimized data exchange rate among different servers and server average load unbalance as objective functions;
step S2, acquiring server set, container set and historical scheduling instance data, combining a multi-objective container scheduling model, constructing a target membership matrix, determining entropy values of all target functions, and further determining weights of all target functions;
and S3, converting the multiple targets of the container scheduling model into single targets by using a linear weighting method, and carrying out iterative solution by using a multi-strategy particle swarm algorithm according to the container scheduling model of the single targets to obtain a final optimal solution of container scheduling.
First, the physical server provides the hardware resources, such as CPU, mem (i.e., memory), etc., required for the container to run. In this embodiment, a physical server set S and a container set C are provided, and parameters and meanings thereof in the physical servers and containers are shown in table 1 below.
Table 1 parameters and meanings of parameters involved in container and server models
In step S1, a multi-objective container scheduling model is constructed with the objective function of minimizing the data exchange rate between different servers and the server average load imbalance.
Based on data exchange matrix between containersThe sum of the data exchanges between the construction containers is:
the data exchange between different containers in the same server does not affect the data exchange between servers, and the data exchange between different containers in different servers occupies the network bandwidth of the respective servers. Thus, the total data exchange rate F between different servers 1 Can be expressed as:
the resource utilization conditions of different servers are different, and the CPU average utilization rate of all the servers is determinedMem flat for all serversAverage utilization ratio->The method comprises the following steps:
the different containers deployed on the servers cause the different loads of the servers, and the average load imbalance F of the servers 2 Expressed as:
meanwhile, the fact that the containers are not detachable is considered, namely each container can only be deployed on a certain server; and the resources of a single server are limited, namely, the resources required by all containers in a certain server cannot exceed the capacity of the container, so that two constraint conditions are constructed, namely:
by the scheme, the data exchange rate between different servers and the average load unbalance degree of the servers are minimized as objective functions, and the constraint conditions are combined to construct a multi-objective container scheduling model.
In this embodiment, the container scheduling is a multi-objective optimization problem, and the container scheduling considers both server load balancing and data exchange among servers, so as to facilitate solving of the container scheduling model, and allocate different objects to the multi-objectiveThe weight is converted into a single-target optimization problem by using a linear weighting method, and the proportion of each of the two targets needs to be considered. Entropy was first introduced by aroma concentration into the information theory, and entropy values can be used to quantify the information amount size. The embodiment uses the data exchange rate F between different servers 1 Average load imbalance with server F 2 As two indexes of decision matrix in entropy weight method, obtaining weight of objective function by entropy weight method, wherein the basic idea of using entropy weight method is according to objective F 1 Target F 2 And the magnitude of variability of their corresponding values. In general, target F 1 Or object F 2 The smaller the entropy value of (c) is, the greater the degree of variation of the target value is, the greater the amount of information provided is, the greater the effect that can be played in the comprehensive evaluation is, and the greater the weight of the objective function is.
In step S2, first, in order to determine the weight of the objective function, a massive historical scheduling instance of the server and the container is obtained under the condition that the server resource constraint is satisfied. As shown in fig. 2, in this embodiment, Q scheduling instances are obtained, and target values of two targets are calculated based on the Q scheduling instances, where the target values of 2 targets in the Q scheduling instances form a decision matrix F, which is:
wherein F is 1,q Index value F representing data exchange rate between different servers obtained by scheduling instance q 2,q An index value indicating the average load imbalance of the server obtained by the scheduling instance q.
The decision matrix F is converted into a target membership matrix by the following formula:
the target membership matrix obtained is:
the entropy value of each objective function is expressed as:
then, the objective weights of the respective objective functions are:
the objective weight vector for each objective function is:
w=(w 1 ,w 2 ) (10)
in step S3, in order to reduce the average load unbalance of the servers and reduce the data exchange rate between the servers, a weight vector (w 1 ,w 2 ) The two targets of the container scheduling model are combined into one target by using a linear weighting method, namely, the multi-target optimization problem is converted into a single-target optimization problem, and the container scheduling model at the moment is as follows:
based on the above, step S4 is executed, and according to the single-target container scheduling model, iterative solution is carried out by utilizing a multi-strategy particle swarm algorithm, so that a final optimal solution of container scheduling is obtained.
Specifically, in the iterative process of the particle swarm algorithm, the particles exchange signals with each otherAll particles are close to the global optimal particles, so that the convergence speed can be greatly increased, but the population diversity is lost. The basic particle swarm algorithm learns the factor lambda 1 、λ 2 Setting the inertia weight ω to a fixed value is detrimental to adjusting parameters at different stages of the iteration to balance the global search with the local search. In the particle swarm algorithm, the linearly decreasing inertia weight omega is adopted to obtain a better optimizing result than the fixed inertia weight omega.
Therefore, in order to further optimize the optimizing result, the embodiment provides an improved particle swarm algorithm, namely a multi-strategy particle swarm algorithm, wherein the container scheduling scheme is encoded into the positions of particles, the parameters of the basic particle swarm algorithm are fixed, the premature and the local optimization are easy to fall into, and the mutual information method, the Lewy disturbance, the self-adaptive weight and the learning factor are fused with the particle swarm algorithm, so that the improved particle swarm algorithm is used for solving.
The particle Lewy disturbance strategy based on the mutual information method is as follows: the disturbance is added for the speed update of the particle swarm algorithm, so that the movement track of particles is more disordered, the probability of finding a better solution is improved, and a large number of disturbance operators are added to the speed update of the particle swarm algorithm, such as Gaussian disturbance operators, lewy disturbance operators, mutation disturbance operators and the like. However, adding too many disturbance operators not only increases the calculated amount, but also may affect the flight trajectory of the particles, reduce the influence of the global optimal particle position and the historical optimal position of the particles, and weaken the convergence rate of the algorithm. Therefore, the position vector of the particles is analyzed, and the disturbance factor is added to the particles at proper time, so that the performance of the whole algorithm is improved.
In the probability theory and the information theory, the mutual information MI of two random variables is a measure of the interdependence between the two variables, formally, the mutual information of two discrete random variables a and B is defined as:
wherein p (a, b) is a joint probability function of a and b, and p (a) and p (b) are marginal probability distribution functions of a and b, respectively. I (A; B) is a non-negative number, i.e. I (A; B) is not less than 0, and p (a, B), p (a) and p (B) can be obtained based on a mutual information method only by obtaining two discrete random variables A and B. To facilitate comparison of the magnitude of mutual information values, they are typically normalized to a specified numerical interval, as follows:
wherein lambda is the normalized mutual information value, and when the mutual information value I (A; B) is very large, the lambda value is close to 1. When the value of I (A; B) is close to 0, lambda is also close to 0.
Therefore, in the present embodiment, the mutual information value of two adjacent generation position vectors of a certain particle is used to evaluate the similarity of the two adjacent generation position vectors, so as to determine whether the particle falls into a local optimum. If the lambda value of the position vector of the front and rear generation of the particle exceeds a specified threshold, the Lewy disturbance is added for the position vector of the particle with a certain probability.
Wherein, the self-adaptive weight and self-adaptive learning factor strategy refers to: the fixed inertia weight and learning factor in the basic particle swarm algorithm are not beneficial to global searching and local searching of balance particles, and the inertia weight and learning factor of the particle swarm algorithm are adaptively processed, so that the inertia weight and learning factor are automatically adjusted along with the increase of iteration times, and the probability of searching for a better position vector can be improved.
Let lambda in the first half of the search 1 Take larger value lambda 2 The particle has higher self-learning ability and lower group learning ability by taking smaller values, so that the particle is beneficial to traversing the surrounding space of the particle; let lambda in the second half of the search 1 Take on smaller values, lambda 2 And the larger value is taken, so that the particles have stronger global searching capability. The inertia weight ω reflects the influence of the previous generation particle velocity on the current generation particle velocity, and in the initial stage of iteration, ω is made larger in order to enable the current generation particle to inherit the velocity information of the previous generation particle as much as possible; in the latter stage of the iteration,in order to reduce the influence of the previous generation particle velocity on the current generation particle velocity, ω is made smaller.
And according to the particle Leaching strategy, the self-adaptive weight and the self-adaptive learning factor strategy based on the mutual information method, improving a particle swarm algorithm, and carrying out iterative solution by utilizing the improved multi-strategy particle swarm algorithm to obtain the final optimal solution of the container scheduling. The process of solving by using the multi-strategy particle swarm algorithm, as shown in FIG. 3, comprises:
step1, setting a fitness function and a particle coding mode, randomly initializing a position vector and a speed vector of particles, setting related parameters, and starting iteration. The related parameters comprise parameters such as particle swarm size, particle dimension, iteration times, inertia weight, learning factors and the like.
Specifically, the objective function in the formula (11) (i.e., min: f=w 1 F 1 +w 2 F 2 ) As the fitness function of the particle swarm algorithm, the particle encoding adopts real number encoding, the position vector and the speed vector of the particle are initialized randomly, the particle flies at a certain speed in the search space, the flying speed is adjusted according to the historical experience of the particle and other particles, and finally, a position with the optimal fitness value is found in the solution space, and at the moment, the position of the particle is the scheduling solution for optimizing the value of the objective function.
Step2, according to the self-adaptive weight and self-adaptive learning factor strategy, based on the difference of iteration times, self-adaptively adjusting and calculating the inertia weight omega and learning factor lambda of the current iteration 1 And lambda (lambda) 2 The method comprises the steps of carrying out a first treatment on the surface of the Wherein, the inertia weight omega and the learning factor lambda 1 And lambda (lambda) 2 The calculation formula of (2) is as follows:
wherein t and t max The current iteration number and the maximum iteration number, omega 1 Is omega min Representing the minimum value of inertial weight, ω 2 Is omega max Represents the maximum value of inertial weight, gamma 1 、γ 2 、γ 3 The preset coefficient can be adjusted according to experimental conditions.
The algorithm dynamically adjusts the sizes of three parameters according to algebra where iteration is located in the iteration process, and the inertia weight and the learning factor of the particle swarm algorithm are adaptively processed, so that the algorithm is automatically adjusted along with the increase of iteration times, and the probability of searching for a better position vector is improved.
Step3, based on the inertia weight and the learning factor of the current iteration, calculating according to formulas (17) - (18), and updating the velocity vector and the position vector of the particle.
v k,d (t+1)=ω×v k,d (t)+λ 1 rand(p k,d (t)-x k,d (t))+λ 2 rand(p g,d (t)-x k,d (t)) (17)
x k,d (t+1)=x k,d (t)+v k,d (t+1) (18)
Wherein lambda is 1 、λ 2 For learning factors, also called acceleration constants, rand is a random number between 0 and 1, ω is the inertial weight, t is the current number of iterations, p g,d (t) is the value of the d-th dimension in the overall historical optimal position vector of the population, p k,d (t) is the value of the d-th dimension in the historic optimal position vector of the kth particle.
Step4, calculating the similarity between the updated position vector and the position vector before updating for each particle, if the similarity is greater than a set threshold value, updating the position vector of the updated particle by using the Lev disturbance, otherwise, not performing any operation, namely, maintaining the position and the speed of the updated particle obtained in Step 3.
Specifically, for each particle, based on the mutual information method, calculating the mutual information value of the updated position vector and the position vector before updating, using the mutual information value lambda as a similarity value to evaluate the similarity of two adjacent generation position vectors of the particle, judging whether the particle falls into local optimum, if lambda is greater than a set threshold epsilon, updating the particle by using the Lev disturbance with a certain probability (random number generated by rand 0-1), namely, a formula (19) is:
in the above, f levy And (beta) is a function conforming to the Laevice distribution, and by adjusting the parameter beta, the Laevice step length meeting the requirement can be obtained, and the rand is a random number between 0 and 1, and has randomness.
Step5, judging whether the maximum iteration times are reached, if so, outputting the optimal fitness and all updated particle position vectors, otherwise, turning to Step2, and carrying out loop iteration. The fitness values (fitness values) are values of an optimization objective function, and are used for evaluating the degree of the position of the particles, determining whether to update the historical optimal position of the individual particles and the historical optimal position of the population, and ensuring that the particles search towards the optimal solution.
Through the steps, the position vectors of all particles which enable the objective function value to be optimal are obtained, namely, the optimal solution of the container scheduling is obtained.
The embodiment considers both the average load balancing of the servers and the data exchange between the servers. And when disturbance is added to the particle swarm algorithm, the judgment of the similarity of the position vectors of the particles is added, so that the particles are prevented from being trapped into local optimum.
To further verify the superiority of the solution described in this example, 4 samples and 5 algorithms (including Random, spread, pack, BP-HP, EWM-MSPSO) were used to verify each. Setting parameters of a multi-strategy particle swarm algorithm (MSPSO, multiple Objective Particle Swarm Optimization), comprising: setting gamma 1 =-8,γ 2 =γ 3 =2,ω max =0.9,ω min =0.6,ε=0.999,size=30。
Container sample data as shown in table 2 below and server sample data as shown in table 3 below are obtained. In Table 2, the parameter w represents a matrixThe proportion of elements other than 0, matrix->The number of non-0 elements is n x w.
Table 2 4 container samples
Table 3 server samples
The container scheduling requires that the weights of the respective objective functions be determined in advance so as to ensure that both load balancing and data exchange are better optimized. Through the scheme of the embodiment, when the weight of the objective function is determined by adopting the entropy weight method (EWM, entropy weight method), massive scheduling examples are required to be generated in advance to obtain a decision matrix, and then the weight is calculated. Taking the container sample 1 as an example, the decision matrix obtained in advance is shown in table 4 below.
Table 4 decision matrix for container sample 1
After the decision matrix is obtained, the decision matrix F is converted to a target membership matrix as shown in table 5 below.
TABLE 5 target membership matrix for container sample 1
According to the obtained target membership matrix, the weights of two target functions are calculated, wherein the weights are respectively as follows: w (w) 1 =0.1508,w 2 =0.8492。
The weights of the objective functions in the other 4 samples were calculated in the same manner as described above, as shown in table 6 below.
TABLE 6 weights of objective functions in container samples
Based on the calculation results, 4 container samples were optimized using different algorithms, resulting in final optimized objective function values as shown in table 7 below, due to objective F 1 With target F 2 None of the 5 algorithms can minimize both targets and can therefore be analyzed by ranking. After the average value and the variance of the ranking information are taken into consideration, the EWM-MSPSO (entropy weight method-multi-strategy particle swarm algorithm) provided by the embodiment is optimal, and can uniformly consider the target F 1 With target F 2 So that both target optimization effects are as good as possible.
Table 7 4 samples optimized objective function values using different algorithms
Example two
The embodiment provides a container scheduling system based on an entropy weight method and a multi-strategy particle swarm algorithm, which comprises the following steps:
the data acquisition module is used for acquiring server set, container set and historical scheduling instance data;
the container scheduling model construction module is used for constructing a multi-target container scheduling model by taking the minimized data exchange rate among different servers and the average server load unbalance degree as objective functions;
the modeling and simplifying module is used for constructing a target optimal attribute matrix according to the acquired data and combining a multi-target container scheduling model, determining the entropy value of each target function, further determining the weight of each target function, and converting the multi-target of the container scheduling model into a single target by using a linear weighting method;
and the model solving module is used for carrying out iterative solving by utilizing a multi-strategy particle swarm algorithm according to the single-target container scheduling model to obtain a final container scheduling optimal solution.
Example III
The embodiment provides an electronic device, which comprises a memory, a processor and computer instructions stored on the memory and running on the processor, wherein the computer instructions complete the steps in the container scheduling method based on the entropy weight method and the multi-strategy particle swarm algorithm.
Example IV
The present embodiment also provides a computer readable storage medium storing computer instructions that, when executed by a processor, perform the steps in a container scheduling method based on an entropy weight method and a multi-policy particle swarm algorithm as described above.
The steps involved in the second to fourth embodiments correspond to the first embodiment of the method, and the detailed description of the second embodiment refers to the relevant description of the first embodiment. The term "computer-readable storage medium" should be taken to include a single medium or multiple media including one or more sets of instructions; but should also be construed to include any medium, any medium can store, encode, or carry a set of instructions for execution by a processor and cause the processor to perform any one of the methods of the present invention.
It will be appreciated by those skilled in the art that the modules or steps of the invention described above may be implemented by general-purpose computer means, alternatively they may be implemented by program code executable by computing means, whereby they may be stored in storage means for execution by computing means, or they may be made into individual integrated circuit modules separately, or a plurality of modules or steps in them may be made into a single integrated circuit module. The present invention is not limited to any specific combination of hardware and software.
The above description is only of the preferred embodiments of the present invention and is not intended to limit the present invention, but various modifications and variations can be made to the present invention by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
While the foregoing description of the embodiments of the present invention has been presented in conjunction with the drawings, it should be understood that it is not intended to limit the scope of the invention, but rather, it is intended to cover all modifications or variations within the scope of the invention as defined by the claims of the present invention.
Claims (10)
1. The container scheduling method based on the entropy weight method and the multi-strategy particle swarm algorithm is characterized by comprising the following steps of:
constructing a multi-objective container scheduling model by taking minimized data exchange rate among different servers and server average load unbalance as objective functions;
acquiring server set, container set and historical scheduling instance data, constructing a target priority matrix by combining a multi-target container scheduling model, determining entropy values of all target functions, and further determining weights of all target functions;
and converting the multiple targets of the container scheduling model into single targets by using a linear weighting method, and carrying out iterative solution by using a multi-strategy particle swarm algorithm according to the container scheduling model of the single targets to obtain a final optimal solution of container scheduling.
2. The container scheduling method based on the entropy weight method and the multi-policy particle swarm algorithm according to claim 1, wherein the constraint conditions of the multi-objective container scheduling model include:
each container is deployed on only one server;
the resources required by all containers in each server do not exceed the capacity of the server in which they are located.
3. The container scheduling method based on the entropy weight method and the multi-strategy particle swarm algorithm according to claim 1, wherein the multi-strategy particle swarm algorithm is as follows:
based on a basic particle swarm algorithm, a particle swarm algorithm improved by a particle Lewy disturbance strategy, an adaptive weight and an adaptive learning factor strategy based on a mutual information method is utilized.
4. The container scheduling method based on the entropy weight method and the multi-strategy particle swarm algorithm according to claim 1, wherein the solving process by using the multi-strategy particle swarm algorithm comprises the following steps:
taking an objective function of a container scheduling model as an adaptability function of a particle swarm algorithm, carrying out particle coding, randomly initializing a position vector and a speed vector of particles, setting related parameters, and starting iteration;
based on the difference of iteration times, self-adaptively adjusting and calculating inertia weight and learning factor of the current iteration;
updating the velocity vector and the position vector of the particle based on the inertia weight and the learning factor of the current iteration;
calculating the similarity of the updated position vector and the position vector before updating aiming at each particle, if the similarity is larger than a set threshold value, updating the updated particle position vector by using the Lewy disturbance, otherwise, not performing any operation;
judging whether the maximum iteration times are reached, if so, outputting the optimal fitness and all updated particle position vectors, otherwise, carrying out loop iteration.
5. The method for scheduling containers based on the entropy weight method and the multi-strategy particle swarm algorithm according to claim 4, wherein the inertia weight ω and the learning factor λ 1 And lambda (lambda) 2 The calculation formula of (2) is as follows:
in the above, t and t max The current iteration number and the maximum iteration number, omega 1 Representing the minimum value of inertial weight, ω 2 Represents the maximum value of inertial weight, gamma 1 、γ 2 、γ 3 Is a preset coefficient.
6. The method for scheduling containers based on the entropy weight method and the multi-policy particle swarm algorithm according to claim 4, wherein the calculating the similarity between the updated position vector and the position vector before updating is: based on the mutual information method, calculating the mutual information value of the updated position vector and the position vector before updating, and taking the mutual information value as a similarity value.
7. A container scheduling system based on an entropy weight method and a multi-strategy particle swarm algorithm, comprising:
the data acquisition module is used for acquiring server set, container set and historical scheduling instance data;
the container scheduling model construction module is used for constructing a multi-target container scheduling model by taking the minimized data exchange rate among different servers and the average server load unbalance degree as objective functions;
the modeling and simplifying module is used for constructing a target optimal attribute matrix according to the acquired data and combining a multi-target container scheduling model, determining the entropy value of each target function, further determining the weight of each target function, and converting the multi-target of the container scheduling model into a single target by using a linear weighting method;
and the model solving module is used for carrying out iterative solving by utilizing a multi-strategy particle swarm algorithm according to the single-target container scheduling model to obtain a final container scheduling optimal solution.
8. The container scheduling system based on the entropy weight method and the multi-strategy particle swarm algorithm according to claim 7, wherein the multi-strategy particle swarm algorithm is as follows:
based on a basic particle swarm algorithm, a particle swarm algorithm improved by a particle Lewy disturbance strategy, an adaptive weight and an adaptive learning factor strategy based on a mutual information method is utilized.
9. An electronic device comprising a memory and a processor and computer instructions stored on the memory and running on the processor, which when executed by the processor, perform the steps of a container scheduling method based on an entropy weight method and a multi-policy particle swarm algorithm according to any of claims 1-6.
10. A computer readable storage medium storing computer instructions which, when executed by a processor, perform the steps of a container scheduling method according to any one of claims 1-6, based on an entropy weight method and a multi-policy particle swarm algorithm.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310293481.9A CN116405498A (en) | 2023-03-21 | 2023-03-21 | Container scheduling method and system based on entropy weight method and multi-strategy particle swarm algorithm |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310293481.9A CN116405498A (en) | 2023-03-21 | 2023-03-21 | Container scheduling method and system based on entropy weight method and multi-strategy particle swarm algorithm |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116405498A true CN116405498A (en) | 2023-07-07 |
Family
ID=87017078
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310293481.9A Pending CN116405498A (en) | 2023-03-21 | 2023-03-21 | Container scheduling method and system based on entropy weight method and multi-strategy particle swarm algorithm |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116405498A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118278714A (en) * | 2024-06-03 | 2024-07-02 | 四川大学 | Edge side multi-robot task scheduling method and system |
-
2023
- 2023-03-21 CN CN202310293481.9A patent/CN116405498A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118278714A (en) * | 2024-06-03 | 2024-07-02 | 四川大学 | Edge side multi-robot task scheduling method and system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108182115B (en) | Virtual machine load balancing method in cloud environment | |
CN111353582B (en) | Particle swarm algorithm-based distributed deep learning parameter updating method | |
CN111026549B (en) | Automatic test resource scheduling method for power information communication equipment | |
CN110138612A (en) | A kind of cloud software service resource allocation methods based on QoS model self-correcting | |
CN112286677A (en) | Resource-constrained edge cloud-oriented Internet of things application optimization deployment method | |
CN111611062B (en) | Cloud-edge collaborative hierarchical computing method and cloud-edge collaborative hierarchical computing system | |
CN113515351A (en) | Resource scheduling implementation method based on energy consumption and QoS (quality of service) cooperative optimization | |
CN107273197B (en) | Hadoop task scheduling method based on orthogonal experiment improved spectral clustering genetic algorithm | |
CN112685138B (en) | Multi-workflow scheduling method based on multi-population hybrid intelligent optimization in cloud environment | |
CN113485826B (en) | Load balancing method and system for edge server | |
CN111176784B (en) | Virtual machine integration method based on extreme learning machine and ant colony system | |
CN111813506A (en) | Resource sensing calculation migration method, device and medium based on particle swarm algorithm | |
CN113887748B (en) | Online federal learning task allocation method and device, and federal learning method and system | |
CN116405498A (en) | Container scheduling method and system based on entropy weight method and multi-strategy particle swarm algorithm | |
CN115022926A (en) | Multi-objective optimization container migration method based on resource balance | |
CN117850999A (en) | Heterogeneous computing platform task scheduling method based on graph neural network | |
Niu et al. | Cloud resource scheduling method based on estimation of distirbution shuffled frog leaping algorithm | |
CN113296893B (en) | Cloud platform low-resource-loss virtual machine placement method based on hybrid sine and cosine particle swarm optimization algorithm | |
Yan et al. | Dueling-DDQN Based Virtual Machine Placement Algorithm for Cloud Computing Systems | |
CN112306641B (en) | Training method for virtual machine migration model | |
Gao et al. | Solving Location Problem of Distribution Center Based on Hybrid Particle Swarm Algorithm. | |
Liu et al. | A new task scheduling strategy based on improved ant colony algorithm in IaaS layer | |
CN117528657B (en) | Electric power internet of things task unloading method, system, equipment and medium | |
CN113867960B (en) | Cloud load balancing hybrid model based on file types | |
CN118245809B (en) | Batch size adjustment method in distributed data parallel online asynchronous training |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |