CN113360275A - Resource scheduling method, device, equipment and medium - Google Patents

Resource scheduling method, device, equipment and medium Download PDF

Info

Publication number
CN113360275A
CN113360275A CN202010150550.7A CN202010150550A CN113360275A CN 113360275 A CN113360275 A CN 113360275A CN 202010150550 A CN202010150550 A CN 202010150550A CN 113360275 A CN113360275 A CN 113360275A
Authority
CN
China
Prior art keywords
particle
fitness function
current
resource scheduling
current position
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
Application number
CN202010150550.7A
Other languages
Chinese (zh)
Inventor
盛硕
王晓蕾
张婷
张晓语
冯冉升
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Communications Group Co Ltd
China Mobile Shanghai ICT Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Shanghai ICT Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by China Mobile Communications Group Co Ltd, China Mobile Shanghai ICT Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN202010150550.7A priority Critical patent/CN113360275A/en
Publication of CN113360275A publication Critical patent/CN113360275A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • G06F9/5077Logical partitioning of resources; Management or configuration of virtualized resources
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/004Artificial life, i.e. computing arrangements simulating life
    • G06N3/006Artificial 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]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Computational Linguistics (AREA)
  • Biophysics (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Biomedical Technology (AREA)
  • Artificial Intelligence (AREA)
  • Mathematical Physics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a resource scheduling method, a resource scheduling device, resource scheduling equipment and a resource scheduling medium. The method comprises the following steps: obtaining the current position of each particle in the particle swarm, wherein the current position of each particle is used for representing m1A resource scheduling scheme of tasks on n computing resources; calculating a fitness function value corresponding to the current position of each particle; determining a global optimal position of a particle swarm; judging whether the iteration times are larger than a first preset threshold value or not to obtain a first judgment result; if the first judgment result is negative, for each particle, if the obtained current inertia weight of the particle is in a preset weight interval and the current position of the particle meets a preset condition, adjusting the current inertia weight by using a random number in a preset range, updating the current position of the particle, and continuously obtaining the current position of each particle in the particle swarm; and if the first judgment result is yes, determining a resource scheduling result based on the global optimal position. According to the embodiment of the invention, the resource scheduling is improvedEfficiency and accuracy of the degree.

Description

Resource scheduling method, device, equipment and medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a medium for resource scheduling.
Background
In order to meet the arrival of the world of everything interconnection, the fifth generation mobile communication technology can adapt to the requirements of new services. The occurrence of cloud computing can partially or completely migrate a local computing task to a cloud end to be executed to a certain extent, and the condition that the resources of the terminal equipment are insufficient is released.
The mobile edge calculation is characterized by having key technologies of ultra-low time delay, ultra-high energy efficiency and ultra-high reliability. With the development of resource on-demand scheduling service, dynamic and resource deployment strategies according to user service requirements are needed in a mobile edge computing scene, and a service mechanism for a differentiated scene is further deepened. That is, an Infrastructure As A Service (IAAS) layer is virtualized and divided into different network slices according to a scene, so As to satisfy Quality of Service (Qos) requirements, such As bandwidth, delay, network packet loss rate, and the like.
The efficiency and accuracy of the current resource scheduling method are low, so that a resource scheduling method with high efficiency and accuracy is urgently needed to be provided.
Disclosure of Invention
Embodiments of the present invention provide a method, an apparatus, a device, and a medium for resource scheduling, which can improve efficiency and accuracy of resource scheduling.
In a first aspect, an embodiment of the present invention provides a resource scheduling method, including:
obtaining the current position of each particle in the particle swarm, wherein the current position of each particle is used for representing m1A resource scheduling scheme of tasks on n computing resources; wherein m is1N is a positive integer;
calculating a fitness function value corresponding to the current position of each particle based on a preset target fitness function;
determining a global optimal position of the particle swarm according to the fitness function value corresponding to the current position of each particle;
judging whether the iteration times are larger than a first preset threshold value or not to obtain a first judgment result;
under the condition that the first judgment result is negative, for each particle, if the obtained current inertia weight of the particle is in a preset weight interval and the current position of the particle meets a preset condition, adjusting the current inertia weight by using a random number in a preset range, updating the current position of the particle through the adjusted current inertia weight, and continuing to obtain the current position of each particle in the particle swarm;
and determining a resource scheduling result based on the global optimal position under the condition that the first judgment result is yes.
In a second aspect, an embodiment of the present invention provides a resource scheduling apparatus, including:
a position obtaining module, configured to obtain a current position of each particle in the particle swarm, where the current position of the particle is used to represent m1A resource scheduling scheme of tasks on n computing resources; wherein m is1N is a positive integer;
the fitness value calculation module is used for calculating a fitness function value corresponding to the current position of each particle based on a preset target fitness function;
the global optimal position determining module is used for determining a global optimal position of the particle swarm according to the fitness function value corresponding to the current position of each particle;
the judging module is used for judging whether the iteration times are larger than a first preset threshold value or not to obtain a first judging result;
an updating module, configured to, if the first determination result is negative, for each particle, if the obtained current inertia weight of the particle is within a preset weight interval and the current position of the particle meets a preset condition, adjust the current inertia weight by using a random number within a preset range, update the current position of the particle by using the adjusted current inertia weight, and send the updated current position of the particle to the position obtaining module;
and the resource scheduling result determining module is used for determining a resource scheduling result based on the global optimal position under the condition that the first judgment result is yes.
In a third aspect, an embodiment of the present invention provides a resource scheduling apparatus, where the apparatus includes: a processor and a memory storing computer program instructions;
the processor, when executing the computer program instructions, implements the resource scheduling method as provided by embodiments of the present invention.
In a fourth aspect, an embodiment of the present invention provides a computer storage medium, where computer program instructions are stored on the computer storage medium, and when the computer program instructions are executed by a processor, the computer program instructions implement the resource scheduling method provided in the embodiment of the present invention.
In the embodiment of the invention, under the condition that the current inertia weight of the particle is in the preset weight interval and the current position of the particle meets the preset condition, the current inertia weight is adjusted by utilizing the random number in the preset range, and then the current position of the particle is updated by the adjusted current inertia weight, so that the particle group can be prevented from falling into local optimum, the particle group has more accurate global search capability, the resource scheduling efficiency is improved, the optimal resource scheduling result can be obtained, and the resource scheduling precision is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required to be used in the embodiments of the present invention will be briefly described below, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart illustrating a resource scheduling method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram illustrating the encoding and decoding of particles provided by an embodiment of the present invention;
fig. 3 is a flowchart illustrating a resource scheduling method according to another embodiment of the present invention;
FIG. 4 shows m under different resource scheduling mechanisms according to an embodiment of the present invention1A total execution time for the subtasks to execute on the n computing resources;
FIG. 5 shows m under different resource scheduling mechanisms according to an embodiment of the present invention1A total cost for the sub-tasks to execute on the n computing resources;
FIG. 6 shows m under different resource scheduling mechanisms according to an embodiment of the present invention1The total load balance when the subtasks are executed on the n computing resources;
fig. 7 is a schematic structural diagram illustrating a resource scheduling apparatus according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram illustrating a resource scheduling apparatus according to an embodiment of the present invention.
Detailed Description
Features and exemplary embodiments of various aspects of the present invention will be described in detail below, and in order to make objects, technical solutions and advantages of the present invention more apparent, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not to be construed as limiting the invention. It will be apparent to one skilled in the art that the present invention may be practiced without some of these specific details. The following description of the embodiments is merely intended to provide a better understanding of the present invention by illustrating examples of the present invention.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
In the Edge Computing scenario, a Mobile Edge Computing (MEC) server has multiple nodes. At the MEC server level, similar to a cloud platform, it is roughly divided into three levels: software as a Service (SaaS), Platform as a Service (PaaS), and Infrastructure as a Service (IaaS). At present, a PaaS layer has an existing resource scheduling mechanism, for example, a resource scheduling mechanism such as service orchestration of a container cluster management system (kurbernets, K8S). The scheduler (scheduler) in the control (Master) Node is mainly responsible for scheduling the container group (Pod) and allocating the Pod to the designated Node (Node). In the scheduler level, the Pod is scheduled to a proper Node based on the resource scheduling method, the scheduler will take out each Pod from the Pod list to be scheduled, and select a most proper Node from the Node list for binding according to the resource scheduling result.
The K8S scheduling algorithm is mainly divided into two stages: a pre-selection stage and a preferred stage. A pre-selection stage: nodes that do not meet Predicates Policies are filtered according to configured pre-selection Policies (Predicates Policies), with the remaining Nodes as preferred inputs. The preferred stage is as follows: and (4) carrying out weight scoring on preselected Nodes according to configured preference strategies (Priorities Policies), and binding the Pod with the highest weight score to the Node.
However, in the current resource scheduling method based on the pre-selection strategy and the preferred strategy, the delay of binding the Pod to the Node is long, the algorithm complexity is high, and important indexes such as the cost of resource scheduling and the total load balance degree are not considered, so the efficiency and the accuracy of resource scheduling are low.
Based on this, the embodiment of the present invention provides a resource scheduling method based on a particle swarm algorithm, which can improve the efficiency of resource scheduling because the algorithm involves few parameters and has a simple algorithm structure, and can avoid the particles from falling into local optima at a later stage by adjusting the inertial weight of the particles by using random numbers in a preset range, so as to obtain an optimal resource scheduling result, thereby improving the precision of resource scheduling.
Particle swarm optimization is an advanced evolutionary computing technique. The algorithm updates its optimal location and speed through each individual's own experience and the transfer and communication of information between individuals. The algorithm randomly generates a feasible search space and assigns an initial position and initial velocity to each particle. During each iteration, the particle updates itself according to two extrema, including an individual extremum (i.e., a locally optimal position) and a global extremum (i.e., a globally optimal position).
In the standard particle swarm optimization, the updating formulas of the speed and the position of the particles are as follows:
vi,t+1=ωi,t*vi,t+c1*r1*(pi,t-xi,t)+c2*r2*(pg,t-xi,t) (1)
xi,t+1=xi,t+vi,t+1 (2)
Figure BDA0002402292170000051
wherein v isi,tIs the velocity, v, of the ith particle at the t-th iterationi,t+1Is the velocity of the ith particle at the t +1 th iteration. x is the number ofi,tIs the position of the ith particle at the time of the t iteration, xi,t+1Is the position of the ith particle at the t +1 th iteration. Omegai,tThe inertial weight of the ith particle at the t-th iteration. p is a radical ofi,tIs the local optimal position of the ith particle in the previous t iterations. p is a radical ofg,tIs the global maximum in the previous t iterationsAnd (4) a good position.
Wherein, tmaxIs a preset maximum number of iterations. OmegamaxIs the maximum value of the inertial weight, ωminIs the minimum value of the inertial weight. r is1And r2Is a random number between 0 and 1. c. C1And c2Is a learning factor, also known as an acceleration constant.
Fig. 1 shows a flowchart of a resource scheduling method according to an embodiment of the present invention. As shown in fig. 1, a resource scheduling method 100 in the embodiment of the present invention includes the following steps:
s110, obtaining the current position of each particle in the particle swarm, wherein the current position of each particle is used for representing m1A resource scheduling scheme for each task over n computing resources. Wherein m is1And n is a positive integer.
And S120, calculating a fitness function value corresponding to the current position of each particle based on a preset target fitness function.
And S130, determining the global optimal position of the particle swarm according to the fitness function value corresponding to the current position of each particle.
S140, judging whether the iteration times is larger than a first preset threshold value or not, and obtaining a first judgment result.
If the first determination result is yes, S150 is executed, and if the first determination result is no, S160 is executed.
S150, for each particle, if the obtained current inertia weight of the particle is in a preset weight interval and the current position of the particle meets a preset condition, adjusting the current inertia weight by using a random number in a preset range, updating the current position of the particle through the adjusted current inertia weight, and returning to the S110.
And S160, determining a resource scheduling result based on the global optimal position.
In the embodiment of the invention, under the condition that the current inertia weight of the particle is in the preset weight interval and the current position of the particle meets the preset condition, the current inertia weight is adjusted by utilizing the random number in the preset range, and then the current position of the particle is updated by the adjusted current inertia weight, so that the particle group can be prevented from falling into local optimum, the particle group has more accurate global search capability, the resource scheduling efficiency is improved, the optimal resource scheduling result can be obtained, and the resource scheduling precision is improved.
In the embodiment of the invention, the resource scheduling in the MEC multi-node environment is to decompose a complete task into a plurality of subtasks and distribute the subtasks to each computing node. Since the problem in the cloud computing task scheduling is the dispersion problem, when the particle swarm algorithm is applied, discrete numerical values are used for encoding the particles. In the embodiment of the invention, the task coding mode adopts an indirect coding mode, namely a coding mode is adopted for computing resources corresponding to the subtasks, and the coding length can be embodied by the length of the subtasks.
Suppose a complete task is divided into m1Subtask, n number of compute nodes, i.e. number of virtual machines. Depending on the coding scheme, a large task is divided into several smaller subtasks. Suppose m1N, i.e. the total number of sub-tasks after the task is divided is assumed to be larger than the number of computing resources. Wherein m is also a positive integer.
In the embodiment of the invention, the serial number of the virtual machine is used as the encoding plan of the particle, and the number of the subtasks determines the encoding length. The position of one particle corresponds to m on n computing resources1An assigned sequence of subtasks.
Assuming that the population size of the particle population is C, C particles are randomly generated by the system. Position x of ith particle in t iteration in all particlesi,tExpressed as: { xi1,xi2,......,xim1}t
Wherein i is more than or equal to 1 and less than or equal to C. x is the number ofijIs [1, n ]]An integer within the range. x is the number ofijIndicating that subtask j is assigned to the xthijNumber computation resource. j is [1, m ]1]An integer within the range. In the particle population, the position of each particle represents m1A resource scheduling scheme for tasks on n computing resources. During the first iteration, the bits of each particleIs set to be initialized, where xijCan be initialized to [1, n]An integer within the range.
As an example, assume that the task number m is 5, and the subtask number m 116, the number n of the cloud resource computing nodes is 8, that is, 5 tasks are divided into 16 subtasks and distributed to 8 computing nodes. The position of the particle may be encoded as (8,1,6,4,2,3,8,7,7,5,1,4,2,6,3, 5). Fig. 2 shows a schematic illustration of a position encoding of a particle.
With continued reference to FIG. 2, it can be seen from the particle decoding that subtask 2 and subtask 11 are distributed to compute node 1, subtask 5, subtask 9, and subtask 13 are distributed to compute node 2, subtask 6 and subtask 15 are distributed to compute node 3, and so on, and subtask 1 and subtask 7 are distributed to compute node 8.
Wherein the velocity v of the ith particle at t iterationsi,tExpressed as: { vi1,vi2,.......,vim1}t. Wherein v isijCan be [ -n, n [ -n]An integer within the range. V when the velocity of each particle is initializedijCan be initialized to [1-n, n-1 ]]An integer within the range.
It should be noted that, in S110, if the current iteration number is the 1 st time, the current position and the current velocity of each particle are obtained through initialization.
And if the current inertia weight corresponding to the particles in the current t-th iteration is in the preset weight interval and the current position of the particles meets the preset condition, adjusting the current inertia weight by using the random number in the preset range. And then calculating the corresponding speed of the particle in the t +1 th iteration by using the adjusted inertia weight corresponding to the particle and the expression (1), and calculating the corresponding position of the particle in the t +1 th iteration by using the corresponding speed of the particle in the t +1 th iteration and the expression (2).
In some embodiments of the present invention, in S120, the target fitness function includes a first fitness function and a second fitness function. The first fitness function is used for representing a resource scheduling scheme execution m1The total time and cost of the individual tasks. For the second fitness functionPerforming m in characterizing a resource scheduling scheme1Load balancing of individual tasks. Then in S120, the fitness function value corresponding to the current position of the particle includes a first fitness function value corresponding to the current position of the particle and a second fitness function value corresponding to the current position of the particle.
Wherein the first fitness function F1This can be expressed by the following expression:
Figure BDA0002402292170000081
wherein Tcost is executing m according to a resource scheduling scheme1The total cost required for the subtasks. TimemaxThe maximum task execution time is represented, that is, the time consumed by the computing resource with the longest working time when the n computing resources execute the task simultaneously in one resource scheduling scheme. Alpha is more than or equal to 0 and less than or equal to 1, beta is more than or equal to 0 and less than or equal to 1, and alpha + beta is equal to 1. As one example, the computing resource may be a virtual machine.
That is, for a position of a particle, the larger the first fitness function corresponding to the position is, the better the resource scheduling scheme corresponding to the position of the particle is.
Wherein Tcost may be calculated using the following expression:
Figure BDA0002402292170000082
in the formula, Rcost (Vm)k) The kth virtual machine VmkThe running cost required per unit time. The matrix Rcost represents the running cost per unit time required on each virtual machine node.
Time(Taskj,Vmk) Indicating the jth subtask TaskjAt the kth virtual machine VmkThe execution time of.
Figure BDA0002402292170000083
Represents m1Each of the subtasks is inThe sum of the execution times on the kth virtual machine. If a certain subtask is not executed on the kth virtual machine, the execution time of the task on the kth virtual machine is 0.
Tcost represents the total cost of the task, and the smaller the value, the lower the cost of consuming resources, the better the resource scheduling scheme.
Wherein, Time (Task)j,Vmk) The calculation can be made using the following expression:
Figure BDA0002402292170000091
wherein v is_vm=Num_vm_cpu*v_vm_mips;v_vmBw being the processing power of the virtual machine_vmIs the bandwidth of the virtual machine; num_vm_cpuThe number of Central Processing Units (CPUs) of the virtual machine; tdatajTask for the jth subtaskjThe amount of data that needs to be transmitted; tlengthjTask for the jth subtaskjLength of (d); v. of_vm_mipsIs the processing power of a single CPU in a virtual machine.
Wherein, TimemaxThe calculation can be made using the following expression:
Figure BDA0002402292170000092
in an embodiment of the invention, the second fitness function F2This can be expressed by the following expression:
Figure BDA0002402292170000093
wherein, F2I.e. the total load balance of the task, UkFor the resource utilization of the kth virtual machine,
Figure BDA0002402292170000094
is an averageResource utilization.
Wherein, UkThe calculation can be made using the following expression:
Figure BDA0002402292170000101
wherein the content of the first and second substances,
Figure BDA0002402292170000102
the calculation can be made using the following expression:
Figure BDA0002402292170000103
in the embodiment of the invention, three optimization indexes are customized: time, cost and load balance degree, and two fitness functions are set, so that the minimum comprehensive index of the task mapping distribution from the user terminal to each computing resource can be ensured under the scene of multiple nodes of the MEC server, namely the minimum time delay, load and cost of each computing resource processing task.
In some embodiments of the present invention, the target fitness function may be customized according to at least one of the three indexes, i.e., the time delay, the load, and the cost, which is not specifically limited herein.
In an embodiment of the present invention, the current position x of the ith particle may be calculated using a first fitness functioni,tCorresponding first fitness function value, i.e. F1(xi,t). Calculating the current position x of the ith particle by using a second fitness functioni,tCorresponding second fitness function value, i.e. F2(xi,t)。
In an embodiment of the present invention, S130 includes S1301 and S1302. And S1301, updating the local optimal position of each particle based on the fitness function value corresponding to the current position of the particle. S1302, determining the global optimal position based on the updated local optimal position of each particle.
In the targetThe response function includes a first fitness function F1And a second fitness function F2In the case of (3), S1301 includes: performing step a and step B for each of the particles.
And step A, calculating a first fitness function value corresponding to the local optimal position of the particle and a second fitness function value corresponding to the local optimal position of the particle based on the first fitness function and the second fitness function.
As an example, the current iteration is the t-th iteration, and the ith particle has a local optimal position p in the previous t-1 iterationsi,t-1Is shown as
Figure BDA0002402292170000104
Globally optimal position p in the entire population in the first t-1 iterationsg,t-1Is shown as
Figure BDA0002402292170000111
In an embodiment of the invention, p is calculated using a first fitness functioni,t-1Corresponding first fitness function value, i.e. F1(pi,t-1). Calculating p using the second fitness functioni,t-1Corresponding second fitness function value, i.e. F2(pi,t-1)。
Next, F is judged1(pi,t-1) Whether or not greater than F1(xi,t) That is, whether the first fitness function value corresponding to the historical optimal position (local optimal position) of the ith particle is larger than the first fitness function value corresponding to the current position of the ith particle is judged.
And step B, under the condition that the first fitness function value corresponding to the local optimal position of the particle is smaller than the first fitness function value corresponding to the current position of the particle, updating the current position of the particle to be the local optimal position of the particle.
If F1(pi,t-1) Greater than F1(xi,t) Then the historical optimal position of the ith particle remains unchanged, i.e. p with a larger value of the first fitness function is still selectedi,t-1As the local optimum position of the ith particle, i.e. the local optimum position of the ith particle in the previous t iterations, i.e. pi,t=pi,t-1
If F1(pi,t-1) Less than F1(xi,t) That is, the first fitness function value corresponding to the local optimal position of the ith particle is smaller than the first fitness function value corresponding to the current position of the ith particle, the current position of the ith particle is updated to the local optimal position of the ith particle, that is, the local optimal position of the ith particle in the previous t iterations, that is, pi,t=xi,t
In some embodiments of the invention, S1301 further comprises performing step C and step D for each particle.
And step C, under the condition that the first fitness function value corresponding to the local optimal position of the particle is equal to the first fitness function value corresponding to the current position of the particle, judging whether a second fitness function value corresponding to the local optimal position of the particle is larger than or equal to the second fitness function value corresponding to the current position of the particle, and obtaining a second judgment result.
In some embodiments of the invention, if F1(pi,t-1) Is equal to F1(xi,t) Then enter the second level screening to balance the fitness function F with the total load2Is the screening standard.
Next, F is judged2(pi,t-1) Whether or not it is greater than or equal to F2(xi,t) And obtaining a second judgment result. That is, whether the second fitness function value corresponding to the local optimal position of the ith particle is greater than or equal to the second fitness function value corresponding to the current position of the ith particle is determined.
And D, updating the current position of the particle to be the local optimal position of the particle under the condition that the second judgment result is yes.
In case the second determination result is yes, then xi,tUpdating to the local optimal position of the ith particle, namely the local optimal position of the ith particle in the previous t iterations, namely pi,t=xi,t
If the second judgment result is negative, p with smaller second fitness function value is still selectedi,t-1As the local optimum position of the ith particle, i.e. the local optimum position of the ith particle in the previous t iterations, i.e. pi,t=pi,t-1
In some embodiments of the present invention, S1302 comprises: step E, step F and step G.
And E, judging whether the number of the targets at the local optimal position of the first target is equal to 1.
And the first target local optimal position is a local optimal position corresponding to the target first fitness function value. The target first fitness function value is a maximum value of the first fitness function values corresponding to the updated local optimal position of each particle.
It is to be noted that if pi,t=pi,t-1Then the updated local optimum position of the ith particle is still pi,t-1
As an example, if the particle population includes C particles, each particle has a corresponding local optimal position, i.e., p, during the previous t iterations1,t、p2,t、……、pC,t。
Wherein the target first fitness function value F1Max (t) is F1(p1,t)、F1(p2,t)、……、F1(pC,t) Maximum value of (2). Wherein, F1Max (t) may be expressed by the following expression:
F1Max(t)=Max{F1(p1,t),F1(p2,t),......,F1(pC,t)} (11)
where Max () is a maximum value calculation.
However, in F1(p1,t)、F1(p2,t)、……、F1(pC,t) May be present with F1Max (t) the same first fitness function value.
Wherein, the local optimal position of the first target is: at F1(p1,t)、F1(p2,t)、……、F1(pC,t) The C first fitness function values are summed with F1Max (t) the local optimum positions corresponding to the same first fitness function values.
And F, if the number of the targets is equal to 1, taking the local optimal position of the first target as the global optimal position.
If at F1(p1,t)、F1(p2,t)、……、F1(pC,t) The C first fitness function values are summed with F1(Max) if only one first fitness function value is provided, the local optimal position corresponding to the fitness function value is taken as the global optimal position, namely pg,t
G, if the number of the targets is not equal to 1, taking the local optimal position of the second target as the global optimal position pg,t. The second target local optimal position is a first target local optimal position corresponding to a target second fitness function value, and the target second fitness function value is the minimum value in the second fitness function values corresponding to each first target local optimal position.
If the target number is not equal to 1, namely the target number is more than 1, calculating a target second fitness function value F2Max(t)。
And the target second fitness function value is the minimum value in the second fitness function values corresponding to the local optimal position of each first target.
In the embodiment of the invention, the resource scheduling scheme with the lowest time, cost and system balance load can be obtained by synthesizing the first fitness function and the second fitness function for secondary screening.
In the embodiment of the invention, the inertia weight has a reasonable interval, the convergence of the particle swarm is facilitated in the interval, and the over-large or over-small inertia weight for a long time can enhance the global exploration capability or the local convergence, so that the convergence rate is smaller or falls into a local extreme value. The important factor influencing the particle swarm optimization is the inertia weight, and the interval of the inertia weight with the most suitable particle motion can change the motion track of the particles to a great extent and avoid the particles from being gathered in a local optimal area.
Although the particle swarm optimization improves the execution efficiency to a certain extent and enhances the global search capability, the particle swarm optimization is nonlinear and has a complex motion track in the actual search process. When a particle finds the best position, a guiding tendency is created, and other particles gather quickly toward the area, and when the area is locally optimal, local optimization occurs. In order to make the particle swarm jump out of the extreme particle area as much as possible and search other unknown areas, the value of the inertial weight needs to be dynamically changed.
In the embodiment of the invention, in the current iteration process, if the first judgment result is negative, the current inertia weight ω of the particle is calculated based on the expression (3)i,t. If the obtained current inertia weight omegai,tWhen the current inertia weight omega is within the range of 0.75-0.85, the current inertia weight omega of the particle can be adjusted by using the expression (12)i,t. Namely, a disturbance constant σ of 0.1 is introduced in the formula (3). When the particle cannot find the optimal solution, σ is 0.1, and σ is 0 in other cases.
Figure BDA0002402292170000141
As shown in expression (12), in the case where the particle group falls into local optimum, the current inertial weight ω is increased with a certain probabilityi,tAnd (4) exploring an unknown solution space and searching for a more excellent solution.
However, in the later period of iteration, the particles are gathered at a certain local optimal position with a large probability, global search is carried out in order to jump out a local extreme value, and if the current inertia weight ω is obtainedi,tUnder the condition that the particle is located in the interval of 0.85-0.95 and the current position of the particle meets the preset condition, the random number in the preset range can be used for adjusting omegai,tI.e. using dynamic disturbance coefficients to adjust the inertial weight ωi,t. As aAs an example, the predetermined range is 0.95 to 1.15.
As an example, referring to expression (13), the random number in the interval 0.95 ~ 1.15 can be multiplied by the inertia weight ω of the particlei,tAnd adding the disturbance constant to adjust the inertia weight omega of the particlei,tObtaining the adjusted inertia weight omega ″' of the particlei,t. As an example, the preset condition includes that a ratio of n 'to n is smaller than a second preset threshold, where n' is a total number of computing resources allocated with tasks in the resource scheduling scheme corresponding to the current position of the particle.
As an example, the second preset threshold is 40%. As an example, if 16 subtasks in the resource scheduling scheme corresponding to the current position of the ith particle are allocated to 3 compute nodes, that is, n' is 3. Since 3/8 is less than 40%, the current inertial weight ω of the ith particle is adjusted using expression (13)i,tTo utilize the adjusted current inertia weight ω ″)i,tThe position and velocity of the particle is updated.
Figure BDA0002402292170000142
Wherein the value range of alpha is 0.95-1.15.
The inertia weight ω of the particle is adjusted by using equation (13), i.e., using a random number of a preset rangei,t. Random particles are introduced, so that local extreme values can be eliminated, unknown areas can be explored in a particle swarm solution space, and the solution precision is improved.
In the embodiment of the invention, the iterative process of the particle swarm is divided into two stages: early stage and late stage. And adjusting the inertia weight of the particles in different modes at each stage to avoid the particles from falling into local optimum so as to improve the precision of solving the resource scheduling result.
In the early stage of iteration, if the current inertia weight omega is obtainedi,tUnder the condition that the inertia weight is within the interval of 0.75-0.85, updating the inertia weight by using an expression (3), and adding a constant disturbance sigma when an optimal solution cannot be found all the time, namely adjusting the current inertia weight according to an expression (12)Heavy omegai,t
In the later iteration stage, once the algorithm is trapped in the local optimum, the current inertia weight omegai,tWithin the interval of 0.85-0.95, and the position of the particle meets the preset condition, the inertia weight omega is dynamically and adaptively changed by using the expression (13)i,t. Meanwhile, in order to ensure the diversity of the population, the convergence trend of the particles is not influenced by the small-probability addition of random particles. If the load on each virtual machine is found to be very close during the iteration, some random particles may be generated and replaced with the particles updated with expression (13).
The resource scheduling method provided by the embodiment of the invention not only considers that the inertia weight value is in a reasonable interval range, but also can keep the superiority of the particle swarm algorithm, and the problem that the convergence rate is slow and the particle is trapped in local optimization is solved to a certain extent by adopting the expression (13) to adjust the current inertia weight of the particles.
In the embodiment of the present invention, in S150, in the current t-th iteration process, for each particle, when the current inertia weight ω of the particle is calculated by using expression (3)i,tThen, if the current inertia weight ω is equal toi,tWithin the interval of 0.85-0.95, the current inertia weight omega of the particle is adjusted by using the dynamic disturbance coefficienti,t. When the current inertia weight omega corresponding to the particle is adjustedi,tAfter this time, ω ″', is obtainedi,tThen ω in expression (1)i,tSubstitution to ω ″)i,tTo update the current velocity of the particle, i.e., the velocity of the particle during the t +1 th iteration.
For each particle, updating a current position of the particle based on the updated current velocity of the particle. Namely, the position of the particle in the t +1 th iteration process, namely the updated current position of the particle, is calculated by using the expression (2) and the velocity of the particle in the t +1 th iteration process.
In S160, after obtaining the global optimal position, m can be obtained by using the particle decoding method in fig. 21And (4) an optimal resource scheduling scheme of the tasks on the n computing resources.
Fig. 3 is a flowchart illustrating a resource scheduling method according to another embodiment of the present invention. As shown in fig. 3, when the user terminal needs to perform a large amount of data processing, in order to improve the data processing efficiency, the user terminal may offload part or all of the data processing tasks to the MEC server for processing.
First, in the first iteration process, the MEC server needs to initialize parameters in the improved particle swarm algorithm provided by the embodiment of the present invention.
And then, the MEC server encodes the particles by adopting an indirect encoding mode according to the task amount sent by the user terminal and the number of the computing nodes. Next, the position and velocity of each particle in the population of particles is initialized, i.e., the current velocity and current position of each particle is determined.
Then, a fitness function value corresponding to the current position of each particle is calculated by using a preset fitness function F1 and a fitness function F2. And then, updating the local optimal position of each particle based on the fitness function value corresponding to the current position of each particle, and updating the global optimal position based on the updated local optimal position of each particle. Reference may be made to the description of S130, which is not repeated herein.
And after the local optimal position and the global optimal position of each particle are updated, judging whether the iteration times are greater than a first preset threshold value. And if the iteration times are greater than a first preset threshold value, decoding the global optimal position to obtain a final resource scheduling result.
And if the iteration times are not greater than the first preset threshold, adjusting the current inertia weight of the particles, updating the positions and the speeds of the particles by using the adjusted current inertia weight, and then entering next iteration until the iteration times are greater than the first preset threshold to obtain a final resource scheduling result.
In the scene of resource scheduling of MEC, simulation results obtained by performing simulation experiments using the resource scheduling mechanism based on the improved particle Swarm Optimization provided by the embodiment of the present invention, the resource scheduling mechanism based on the original Particle Swarm Optimization (PSO), and the K8S scheduling method are described below, and detailed experimental parameter settings are shown in table 1.
TABLE 1
Figure BDA0002402292170000161
Figure BDA0002402292170000171
FIG. 4 shows the total task execution Time Time under different resource scheduling methodsmaxSchematic diagram of comparison. As shown in fig. 4, the abscissa represents the number of different tasks and the ordinate represents the total task execution time in milliseconds.
The five vertical bars are the total task execution time respectively corresponding to the K8S-based resource scheduling mechanism when the number of subtasks is 100, 200, 300, 400, and 500.
The five horizontal stripes are the total task execution time corresponding to the resource scheduling mechanism based on the original PSO algorithm when the number of the subtasks is 100, 200, 300, 400, and 500, respectively.
The five diagonal stripes are total task execution times respectively corresponding to the resource scheduling mechanism based on the improved PSO algorithm provided by the embodiment of the invention when the number of the subtasks is 100, 200, 300, 400, and 500.
For the total task completion time, compared with the original PSO algorithm and the K8S resource scheduling mechanism, the improved PSO algorithm provided by the embodiment of the present invention reduces the time delay by 4.253% on average under the custom index and the screening mechanism.
Fig. 5 shows a comparison diagram of the total load balancing LB under different resource scheduling methods. As shown in fig. 5, the abscissa represents the number of different tasks, and the ordinate represents the total load balancing degree.
The dotted line is a variation curve of the total load balancing degree with the increase of the number of the subtasks based on the resource scheduling mechanism of K8S. The dotted line is a curve of the total load balance with the increase of the number of subtasks, which is obtained based on the original PSO algorithm. The solid line is a change curve of the total load balance degree obtained by the resource scheduling mechanism based on the improved PSO algorithm provided by the embodiment of the present invention along with the increase of the number of the subtasks.
Compared with the original PSO algorithm and the K8S resource scheduling mechanism, the improved PSO algorithm reduces the total load balance by about 4.38% under the custom index and the screening mechanism.
Fig. 6 shows a comparison diagram of the total cost Tcost under different resource scheduling methods. As shown in fig. 6, the abscissa represents the number of different tasks and the ordinate represents the total cost.
The five dotted stripes are total costs corresponding to the K8S-based resource scheduling mechanism when the number of subtasks is 100, 200, 300, 400, and 500, respectively.
Wherein, the five diagonal stripes are total costs respectively corresponding to the resource scheduling mechanism based on the original PSO algorithm when the number of the subtasks is 100, 200, 300, 400 and 500.
The five well stripes are total costs respectively corresponding to the resource scheduling mechanism based on the improved PSO algorithm provided by the embodiment of the invention when the number of the subtasks is 100, 200, 300, 400, and 500.
Compared with the original PSO algorithm and the K8S resource scheduling mechanism, the improved PSO algorithm reduces the total task cost by about 2.851% under the custom indexes and the screening mechanism. Namely, under the multi-objective dynamic scheduling mechanism, the resource scheduling method provided by the embodiment of the invention can effectively improve time delay, load and cost.
Fig. 7 is a schematic structural diagram illustrating a resource scheduling apparatus according to an embodiment of the present invention. As shown in fig. 7, the resource scheduling apparatus 700 includes:
a position obtaining module 710, configured to obtain a current position of each particle in the particle swarm, where the current position of the particle is used to represent m1A resource scheduling scheme for each task over n computing resources. Wherein m is1And n is a positive integer.
And the fitness value calculating module 720 is configured to calculate a fitness function value corresponding to the current position of each particle based on a preset target fitness function.
A global optimal position determining module 730, configured to determine a global optimal position of the particle swarm according to the fitness function value corresponding to the current position of each particle.
The determining module 740 is configured to determine whether the iteration number is greater than a first preset threshold, so as to obtain a first determination result.
An updating module 750, configured to, if the first determination result is negative, for each particle, if the obtained current inertia weight of the particle is within a preset weight interval and the current position of the particle meets a preset condition, adjust the current inertia weight by using a random number within a preset range, update the current position of the particle by using the adjusted current inertia weight, and send the updated current position of the particle to the position obtaining module 710.
A resource scheduling result determining module 760, configured to determine a resource scheduling result based on the global optimal position if the first determination result is yes.
In the embodiment of the invention, under the condition that the current inertia weight of the particle is in the preset weight interval and the current position of the particle meets the preset condition, the current inertia weight is adjusted by utilizing the random number in the preset range, and then the current position of the particle is updated by the adjusted current inertia weight, so that the particle group can be prevented from falling into local optimum, the particle group has more accurate global search capability, the resource scheduling efficiency is improved, the optimal resource scheduling result can be obtained, and the resource scheduling precision is improved.
In some embodiments of the invention, the global optimal position determination module 730 comprises:
and the local optimal position determining unit is used for updating the local optimal position of the particle based on the fitness function value corresponding to the current position of the particle for each particle.
A global optimal location determining unit, configured to determine the global optimal location based on the updated local optimal location of each particle.
In some embodiments of the invention, the target fitness function comprises a first fitness function and a second fitness function; the first fitness function is used for characterizing a resource scheduling scheme to execute the m1Total time and total cost for an individual task; the second fitness function is used for characterizing a resource scheduling scheme to execute the m1The load balance degree of each task, wherein the fitness function value corresponding to the current position of the particle comprises a first fitness function value corresponding to the current position of the particle and a second fitness function value corresponding to the current position of the particle;
wherein the locally optimal position determination unit is configured to perform the following steps for each of the particles:
calculating a first fitness function value corresponding to the local optimal position of the particle and a second fitness function value corresponding to the local optimal position of the particle based on the first fitness function and the second fitness function;
and under the condition that the first fitness function value corresponding to the local optimal position of the particle is smaller than the first fitness function value corresponding to the current position of the particle, updating the current position of the particle to be the local optimal position of the particle.
In some embodiments of the invention, the local optimal position determination unit is further configured to:
under the condition that the first fitness function value corresponding to the local optimal position of the particle is equal to the first fitness function value corresponding to the current position of the particle, judging whether a second fitness function value corresponding to the local optimal position of the particle is larger than or equal to a second fitness function value corresponding to the current position of the particle, and obtaining a second judgment result;
and if the second judgment result is yes, updating the current position of the particle to be the local optimal position of the particle.
In some embodiments of the invention, the global optimal location determination unit is configured to:
judging whether the target number of a first target local optimal position is equal to 1, wherein the first target local optimal position is a local optimal position corresponding to a target first fitness function value, and the target first fitness function value is the maximum value in the first fitness function value corresponding to the local optimal position after each particle is updated;
if the number of the targets is equal to 1, taking the local optimal position of the first target as the global optimal position;
and if the number of the targets is not equal to 1, taking a second target local optimal position as the global optimal position, wherein the second target local optimal position is a first target local optimal position corresponding to a target second fitness function value, and the target second fitness function value is the minimum value in the second fitness function values corresponding to each first target local optimal position.
In some embodiments of the present invention, the predetermined weight range is 0.85-0.95.
In some embodiments of the present invention, the preset condition includes that a ratio of n 'to n is smaller than a second preset threshold, and n' is a total number of computing resources allocated with tasks in the resource scheduling scheme corresponding to the current position of the particle.
In some embodiments of the present invention, the update module 750 is specifically configured to: and multiplying the random number in a preset range by the current inertia weight corresponding to the particle to obtain the adjusted current inertia weight of the particle.
In some embodiments of the present invention, the predetermined range is 0.95 to 1.15.
In some embodiments of the present invention, the update module 750 is specifically configured to:
for each particle, updating the current velocity of the particle by using the adjusted current inertia weight corresponding to the particle;
for each of the particles, updating a current location of the particle based on the updated current velocity of the particle.
Other details of the resource scheduling apparatus according to the embodiment of the present invention are similar to the method according to the embodiment of the present invention described above with reference to fig. 1 to 6, and are not repeated herein.
The resource scheduling method and apparatus according to the embodiments of the present invention described in conjunction with fig. 1 to 7 may be implemented by a resource scheduling device. Fig. 8 is a diagram illustrating a hardware structure 800 of a resource scheduling apparatus according to an embodiment of the present invention.
As shown in fig. 8, the resource scheduling apparatus 800 in this embodiment includes: the system comprises a processor 801, a memory 802, a communication interface 803 and a bus 810, wherein the processor 801, the memory 802 and the communication interface 803 are connected through the bus 810 and complete mutual communication.
In particular, the processor 801 described above may include a Central Processing Unit (CPU), or A Specific Integrated Circuit (ASIC), or may be configured as one or more integrated circuits implementing embodiments of the present invention.
Memory 802 may include mass storage for data or instructions. By way of example, and not limitation, memory 802 may include an HDD, floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or a Universal Serial Bus (USB) drive or a combination of two or more of these. Memory 802 may include removable or non-removable (or fixed) media, where appropriate. The memory 802 may be internal or external to the resource scheduling device 800, where appropriate. In a particular embodiment, the memory 802 is a non-volatile solid-state memory. In a particular embodiment, the memory 802 includes Read Only Memory (ROM). Where appropriate, the ROM may be mask-programmed ROM, Programmable ROM (PROM), Erasable PROM (EPROM), Electrically Erasable PROM (EEPROM), electrically rewritable ROM (EAROM), or flash memory or a combination of two or more of these.
The communication interface 803 is mainly used for implementing communication between modules, apparatuses, units and/or devices in the embodiments of the present invention.
The bus 810 comprises hardware, software, or both coupling the components of the resource scheduling device 800 to each other. By way of example, and not limitation, a bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hypertransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an infiniband interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a video electronics standards association local (VLB) bus, or other suitable bus or a combination of two or more of these. Bus 810 may include one or more buses, where appropriate. Although specific buses have been described and shown in the embodiments of the invention, any suitable buses or interconnects are contemplated by the invention.
That is, the resource scheduling apparatus 800 shown in fig. 8 may be implemented to include: a processor 801, a memory 802, a communication interface 803, and a bus 810. The processor 801, memory 802, and communication interface 803 are coupled via bus 810 and communicate with each other. The memory 802 is used to store program code; the processor 801 reads the executable program code stored in the memory 802 to run a program corresponding to the executable program code, so as to execute the resource scheduling method in any embodiment of the present invention, thereby implementing the resource scheduling method and apparatus described in conjunction with fig. 1 to 7.
The embodiment of the invention also provides a computer storage medium, wherein the computer storage medium is stored with computer program instructions; the computer program instructions, when executed by a processor, implement the resource scheduling method provided by the embodiments of the present invention.
The functional blocks shown in the above structural block diagrams may be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, it may be, for example, an electronic circuit, an Application Specific Integrated Circuit (ASIC), suitable firmware, plug-in, function card, or the like. When implemented in software, the elements of the invention are the programs or code segments used to perform the required tasks. The program or code segments may be stored in a machine-readable medium or transmitted by a data signal carried in a carrier wave over a transmission medium or a communication link. A "machine-readable medium" may include any medium that can store or transfer information. Examples of a machine-readable medium include electronic circuits, semiconductor memory devices, ROM, flash memory, Erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, Radio Frequency (RF) links, and so forth. The code segments may be downloaded via computer networks such as the internet, intranet, etc.
It should also be noted that the exemplary embodiments mentioned in this patent describe some methods or systems based on a series of steps or devices. However, the present invention is not limited to the order of the above-described steps, that is, the steps may be performed in the order mentioned in the embodiments, may be performed in an order different from the order in the embodiments, or may be performed simultaneously.
As will be apparent to those skilled in the art, for convenience and brevity of description, the specific working processes of the systems, modules and units described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again. It should be understood that the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive various equivalent modifications or substitutions within the technical scope of the present invention, and these modifications or substitutions should be covered within the scope of the present invention.

Claims (13)

1. A method for scheduling resources, the method comprising:
obtaining the current position of each particle in the particle swarm, wherein the current position of each particle is used for representing m1A resource scheduling scheme of tasks on n computing resources; wherein m is1N is a positive integer;
calculating a fitness function value corresponding to the current position of each particle based on a preset target fitness function;
determining a global optimal position of the particle swarm according to the fitness function value corresponding to the current position of each particle;
judging whether the iteration times are larger than a first preset threshold value or not to obtain a first judgment result;
under the condition that the first judgment result is negative, for each particle, if the obtained current inertia weight of the particle is in a preset weight interval and the current position of the particle meets a preset condition, adjusting the current inertia weight by using a random number in a preset range, updating the current position of the particle through the adjusted current inertia weight, and continuing to obtain the current position of each particle in the particle swarm;
and determining a resource scheduling result based on the global optimal position under the condition that the first judgment result is yes.
2. The method of claim 1, wherein said determining a global optimal position for the population of particles based on the fitness function value corresponding to the current position of each of the particles comprises:
for each particle, updating the local optimal position of the particle based on the fitness function value corresponding to the current position of the particle;
determining the global optimal location based on the updated locally optimal location for each of the particles.
3. The method of claim 2, wherein the target fitness function comprises a first fitness function and a second fitness function; the first fitness function is used for characterizing a resource scheduling scheme to execute the m1Total time and total cost for an individual task; the second fitness function is used for characterizing a resource scheduling scheme to execute the m1The load balance degree of each task, wherein the fitness function value corresponding to the current position of the particle comprises a first fitness function value corresponding to the current position of the particle and a second fitness function value corresponding to the current position of the particle;
wherein, for each particle, updating the local optimal position of the particle based on the fitness function value corresponding to the current position of the particle includes:
for each of said particles, performing the steps of:
calculating a first fitness function value corresponding to the local optimal position of the particle and a second fitness function value corresponding to the local optimal position of the particle based on the first fitness function and the second fitness function;
and under the condition that the first fitness function value corresponding to the local optimal position of the particle is smaller than the first fitness function value corresponding to the current position of the particle, updating the current position of the particle to be the local optimal position of the particle.
4. The method of claim 3, further comprising:
under the condition that the first fitness function value corresponding to the local optimal position of the particle is equal to the first fitness function value corresponding to the current position of the particle, judging whether a second fitness function value corresponding to the local optimal position of the particle is larger than or equal to a second fitness function value corresponding to the current position of the particle, and obtaining a second judgment result;
and if the second judgment result is yes, updating the current position of the particle to be the local optimal position of the particle.
5. The method of claim 3, wherein determining the global optimal location based on the updated local optimal location for each of the particles comprises:
judging whether the target number of a first target local optimal position is equal to 1, wherein the first target local optimal position is a local optimal position corresponding to a target first fitness function value, and the target first fitness function value is the maximum value in the first fitness function value corresponding to the local optimal position after each particle is updated;
if the number of the targets is equal to 1, taking the local optimal position of the first target as the global optimal position;
and if the number of the targets is not equal to 1, taking a second target local optimal position as the global optimal position, wherein the second target local optimal position is a first target local optimal position corresponding to a target second fitness function value, and the target second fitness function value is the minimum value in the second fitness function values corresponding to each first target local optimal position.
6. The method of claim 1, wherein the predetermined weight interval is 0.85-0.95.
7. The method according to any one of claims 1 or 6, wherein the preset condition includes that a ratio of n 'to n is smaller than a second preset threshold, and n' is a total number of computing resources allocated with tasks in a resource scheduling scheme corresponding to the current position of the particle.
8. The method of claim 1, wherein the adjusting the current inertial weight by a random number within a preset range comprises:
and multiplying the random number in a preset range by the current inertia weight corresponding to the particle to obtain the adjusted current inertia weight of the particle.
9. The method of claim 7, wherein the predetermined range is 0.95-1.15.
10. The method of claim 1, wherein updating the current position of the particle with the adjusted current inertial weight comprises:
for each particle, updating the current velocity of the particle by using the adjusted current inertia weight corresponding to the particle;
for each of the particles, updating a current location of the particle based on the updated current velocity of the particle.
11. An apparatus for scheduling resources, the apparatus comprising:
a position acquisition module for acquiringA current location of each particle in the population of particles, the current location of the particle being used to characterize m1A resource scheduling scheme of tasks on n computing resources; wherein m is1N is a positive integer;
the fitness value calculation module is used for calculating a fitness function value corresponding to the current position of each particle based on a preset target fitness function;
the global optimal position determining module is used for determining a global optimal position of the particle swarm according to the fitness function value corresponding to the current position of each particle;
the judging module is used for judging whether the iteration times are larger than a first preset threshold value or not to obtain a first judging result;
an updating module, configured to, if the first determination result is negative, for each particle, if the obtained current inertia weight of the particle is within a preset weight interval and the current position of the particle meets a preset condition, adjust the current inertia weight by using a random number within a preset range, update the current position of the particle by using the adjusted current inertia weight, and send the updated current position of the particle to the position obtaining module;
and the resource scheduling result determining module is used for determining a resource scheduling result based on the global optimal position under the condition that the first judgment result is yes.
12. A resource scheduling apparatus, characterized in that the apparatus comprises: a processor and a memory storing computer program instructions;
the processor, when executing the computer program instructions, implements the resource scheduling method of any of claims 1-10.
13. A computer storage medium having computer program instructions stored thereon, which when executed by a processor implement the resource scheduling method of any one of claims 1-10.
CN202010150550.7A 2020-03-06 2020-03-06 Resource scheduling method, device, equipment and medium Pending CN113360275A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010150550.7A CN113360275A (en) 2020-03-06 2020-03-06 Resource scheduling method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010150550.7A CN113360275A (en) 2020-03-06 2020-03-06 Resource scheduling method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN113360275A true CN113360275A (en) 2021-09-07

Family

ID=77523963

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010150550.7A Pending CN113360275A (en) 2020-03-06 2020-03-06 Resource scheduling method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN113360275A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114489228A (en) * 2022-01-26 2022-05-13 四川大学 MPPT device and method based on improved PSO algorithm

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107203412A (en) * 2017-05-04 2017-09-26 电子科技大学 A kind of cloud resource method for optimizing scheduling that particle cluster algorithm is improved based on membranous system
CN107491341A (en) * 2017-08-31 2017-12-19 福州大学 A kind of virtual machine distribution method based on particle group optimizing
CN109067834A (en) * 2018-06-29 2018-12-21 南京邮电大学 Discrete particle cluster dispatching algorithm based on oscillatory type inertia weight
CN110598941A (en) * 2019-09-18 2019-12-20 河海大学常州校区 Bionic strategy-based dual-target scheduling method for particle swarm optimization manufacturing system
CN110599068A (en) * 2019-09-29 2019-12-20 哈尔滨理工大学 Cloud resource scheduling method based on particle swarm optimization algorithm

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107203412A (en) * 2017-05-04 2017-09-26 电子科技大学 A kind of cloud resource method for optimizing scheduling that particle cluster algorithm is improved based on membranous system
CN107491341A (en) * 2017-08-31 2017-12-19 福州大学 A kind of virtual machine distribution method based on particle group optimizing
CN109067834A (en) * 2018-06-29 2018-12-21 南京邮电大学 Discrete particle cluster dispatching algorithm based on oscillatory type inertia weight
CN110598941A (en) * 2019-09-18 2019-12-20 河海大学常州校区 Bionic strategy-based dual-target scheduling method for particle swarm optimization manufacturing system
CN110599068A (en) * 2019-09-29 2019-12-20 哈尔滨理工大学 Cloud resource scheduling method based on particle swarm optimization algorithm

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
娄建峰等: "基于改进粒子群算法的云计算任务调度算法", 《微电子学与计算机》 *
盛硕: "云环境下粒子群优化算法的资源调度研究", 《中国优秀硕士学位论文全文数据库》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114489228A (en) * 2022-01-26 2022-05-13 四川大学 MPPT device and method based on improved PSO algorithm
CN114489228B (en) * 2022-01-26 2022-11-01 四川大学 MPPT device and method based on improved PSO algorithm

Similar Documents

Publication Publication Date Title
Alkayal et al. Efficient task scheduling multi-objective particle swarm optimization in cloud computing
CN112380008B (en) Multi-user fine-grained task unloading scheduling method for mobile edge computing application
CN111711666B (en) Internet of vehicles cloud computing resource optimization method based on reinforcement learning
CN112286677B (en) Resource-constrained edge cloud-oriented Internet of things application optimization deployment method
CN109829332B (en) Joint calculation unloading method and device based on energy collection technology
CN113708972B (en) Service function chain deployment method and device, electronic equipment and storage medium
CN110971706A (en) Approximate optimization and reinforcement learning-based task unloading method in MEC
CN112882815A (en) Multi-user edge calculation optimization scheduling method based on deep reinforcement learning
CN112988345A (en) Dependency task unloading method and device based on mobile edge calculation
CN111813506A (en) Resource sensing calculation migration method, device and medium based on particle swarm algorithm
CN109656713B (en) Container scheduling method based on edge computing framework
CN112784362A (en) Hybrid optimization method and system for unmanned aerial vehicle-assisted edge calculation
CN114585006B (en) Edge computing task unloading and resource allocation method based on deep learning
CN110570075A (en) Power business edge calculation task allocation method and device
CN113692021A (en) 5G network slice intelligent resource allocation method based on intimacy
CN113867843B (en) Mobile edge computing task unloading method based on deep reinforcement learning
CN113138848A (en) Method, device, equipment and storage medium for acquiring resource allocation strategy
CN111988787A (en) Method and system for selecting network access and service placement positions of tasks
Dai et al. A learning algorithm for real-time service in vehicular networks with mobile-edge computing
CN113573363A (en) MEC calculation unloading and resource allocation method based on deep reinforcement learning
CN113139639B (en) MOMBI-oriented smart city application multi-target computing migration method and device
CN113360275A (en) Resource scheduling method, device, equipment and medium
CN113194031B (en) User clustering method and system combining interference suppression in fog wireless access network
CN117202264A (en) 5G network slice oriented computing and unloading method in MEC environment
CN117436485A (en) Multi-exit point end-edge-cloud cooperative system and method based on trade-off time delay and precision

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