Search

CN-122019188-A - Resource allocation method, apparatus, electronic device, storage medium and computer program product

CN122019188ACN 122019188 ACN122019188 ACN 122019188ACN-122019188-A

Abstract

The application provides a resource allocation method, a device, electronic equipment, a storage medium and a computer program product, and relates to the technical field of cloud computing big data edge computing, wherein the method comprises the steps of acquiring a plurality of tasks, carrying out iterative updating on particle swarms of the plurality of tasks based on a particle swarm optimization algorithm, and determining individual optimal position characteristics of each particle after each iteration and global optimal position characteristics of the particle swarm; the method comprises the steps of determining a particle group, determining a total optimal position characteristic and a final allocation scheme of the characterization, wherein the allocation scheme of the resources corresponding to the individual optimal position characteristic is optimal in resource use cost in the individual dimension of particles, the allocation scheme of the resources corresponding to the total optimal position characteristic is optimal in resource use cost in the dimension of particle groups, and performing the next iteration of the particle group after the particles to be mutated are mutated based on mutation strength determined by the stagnation number of each particle in the iteration process until the preset iteration number is reached, and determining the final global optimal position characteristic and the final allocation scheme of the characterization.

Inventors

  • PAN HUITING

Assignees

  • 中移(苏州)软件技术有限公司
  • 中国移动通信集团有限公司

Dates

Publication Date
20260512
Application Date
20260408

Claims (10)

  1. 1. A method for resource allocation, comprising: Acquiring a plurality of tasks, carrying out iterative updating on particle swarms of the tasks based on a particle swarm optimization algorithm, and determining individual optimal position characteristics of each particle after each iteration and global optimal position characteristics of the particle swarm, wherein an allocation scheme of resources corresponding to the individual optimal position characteristics is optimal in resource use cost in the individual dimension of the particles, and an allocation scheme of resources corresponding to the global optimal position characteristics is optimal in resource use cost in the dimension of the particle swarm; And carrying out the next iteration of the particle swarm after the particles to be mutated are mutated based on the mutation strength determined by the stagnation times of each particle in the iteration process, stopping iteration until the preset iteration times are reached, and determining a final global optimal position characteristic and a final distribution scheme of characterization, wherein the single stagnation of the particles is used for characterizing that the improvement amplitude of the individual optimal position characteristic of the particles in the iteration process is smaller than a first preset threshold value.
  2. 2. The method for allocating resources according to claim 1, wherein determining the final global optimal position feature based on the variance strength determined by the number of stalls of each particle in the iterative process, performing the next iteration of the particle swarm after the variance of the particles to be mutated until the predetermined number of iterations is reached, comprises: determining the stagnation times of each particle based on the difference value of the individual optimal position characteristics corresponding to two adjacent iterations of each particle in the iteration process; determining the particles to be mutated in the particle swarm based on the stagnation times; On the basis of the stagnation times corresponding to the particles to be mutated, mutating the position characteristics of the particles to be mutated to obtain the position characteristics corresponding to each particle in the particle group after the nth iteration, wherein N is an integer greater than 1; And carrying out n+1st iteration update on the particle swarm based on the resource use cost information and the speed characteristic of the position characteristic representation allocation scheme of each particle, determining the individual optimal position characteristic of each particle after the n+1st iteration and the global optimal position characteristic of the particle swarm, stopping iteration until the preset iteration times are reached, and determining the final global optimal position characteristic, wherein the speed characteristic is used for indicating the searching direction of the allocation scheme in the particle iteration process.
  3. 3. The method of claim 2, wherein determining the number of stalls for each of the particles based on a difference in the individual optimal location features for two adjacent iterations of each of the particles in an iterative process comprises: after each iteration in the N iteration processes is counted, the difference value between the individual optimal position features corresponding to each two adjacent iterations of each particle is counted; Based on the magnitude relation between the average value of the difference values after each iteration and the first preset threshold value, whether the individual optimal position characteristic of each particle is stagnant after each iteration is determined, and then the stagnation times of each particle in N iteration processes are determined.
  4. 4. The method for allocating resources according to claim 2, wherein said mutating the position characteristics of the particles to be mutated based on the number of stalls corresponding to the particles to be mutated, to obtain the position characteristics corresponding to each of the particles in the particle group after the nth iteration, includes: Determining mutation probability based on the stagnation times corresponding to the particles to be mutated, wherein the mutation probability is positively correlated with the corresponding stagnation times; And mutating the position features of the particles to be mutated based on the mutation amplitude of the position features represented by the mutation probability, so as to obtain the position features corresponding to each particle in the particle group after the nth iteration.
  5. 5. The method according to any one of claims 1 to 4, wherein the iterative updating of the particle swarm for a plurality of the tasks based on the particle swarm optimization algorithm determines an individual optimal position feature for each particle after each iteration, and a global optimal position feature for the particle swarm, comprising: determining initial resource use cost information of an allocation scheme corresponding to each particle based on resource allocation node information of a corresponding task represented by each element in initial position characteristics, wherein the initial position characteristics are determined based on resource requirements and resource constraints of the task; determining an initial individual optimal location feature for each particle, and an initial global optimal location feature for the particle swarm, based on a comparison between the initial resource usage cost information for each particle; performing a first iteration and determining the position features and the speed features of the particles based on the difference between the initial individual optimal position features and the initial global optimal position features and the initial position features respectively, and under the action of a search direction indicated by an initial speed feature; Determining the resource use cost information of the allocation scheme corresponding to each particle after the first iteration based on the resource allocation node information of the corresponding task represented by each element in the position features; determining the individual optimal location features based on a comparison between the resource usage cost information in the individual dimensions of the particles, and determining the global optimal location features based on a comparison between the resource usage cost information in the dimensions of the particle swarm; And based on the difference value between the individual optimal position feature and the global optimal position feature and the position feature, and under the action of the search direction indicated by the speed feature, carrying out subsequent iteration, and determining the individual optimal position feature of each particle and the global optimal position feature of the particle swarm after each iteration.
  6. 6. The resource allocation method according to claim 5, wherein said performing subsequent iterations based on differences between the individual optimal position features and the global optimal position features and the position features, respectively, and under the search direction indicated by the speed features, comprises: Updating the velocity characteristics of the population of particles based on the difference between the individual optimal location characteristics and the location characteristics, the difference between the global optimal location characteristics and the location characteristics, and the product of the velocity characteristics and velocity inertia weights, wherein the velocity inertia weight of each particle is determined based on the number of times that the resource usage cost information of a last iteration is better than that of a previous iteration among a plurality of iterations of each particle; updating the position features of the population of particles based on a combination of the updated velocity features and the position features of a previous iteration.
  7. 7. A resource allocation apparatus, comprising: The system comprises an iteration updating unit, a particle swarm optimization unit and a particle swarm optimization unit, wherein the iteration updating unit is used for acquiring a plurality of tasks, carrying out iteration updating on particle swarms of the plurality of tasks based on a particle swarm optimization algorithm, and determining individual optimal position characteristics of each particle after each iteration and global optimal position characteristics of the particle swarm; And the iteration updating unit is used for carrying out the next iteration of the particle swarm after the particles to be mutated are mutated based on the mutation intensity determined by the stagnation times of each particle in the iteration process, stopping iteration until the preset iteration times are reached, and determining the final global optimal position characteristic and the final characteristic allocation scheme, wherein the single stagnation of the particles is used for representing that the individual optimal position characteristic improvement amplitude of the particles in the iteration process is smaller than a first preset threshold value.
  8. 8. An electronic device comprising a memory, a processor, the memory storing a computer program executable on the processor, the processor implementing the steps of the method of any one of claims 1 to 6 when the computer program is executed.
  9. 9. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.
  10. 10. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, realizes the steps in the method of any one of claims 1 to 6.

Description

Resource allocation method, apparatus, electronic device, storage medium and computer program product Technical Field The present application relates to the field of cloud computing big data edge computing technology, and in particular, to a resource allocation method, apparatus, electronic device, storage medium, and computer program product. Background In the related art, the cloud resource allocation method mainly focuses on how to improve the accuracy, the utilization rate and the response speed of resource allocation. With the increasing demand for cloud computing and large-scale data processing, how to efficiently schedule and allocate cloud resources becomes a critical issue. The current cloud resource allocation scheme determines requirements by receiving request information and selects the best matched target resource from the cloud storage resource pool based on a scoring strategy, so that the accuracy of resource allocation is improved. However, although the scoring strategy of the method can optimize resource matching, the scoring standard is a preset fixed rule, and the method cannot dynamically adapt to the real-time changing requirements and resource conditions. Therefore, when facing complex and changeable scenes, the matching effect of resources may be limited, and it is difficult to flexibly cope with diversified actual use demands. Disclosure of Invention The embodiment of the application provides a resource allocation method, a resource allocation device, electronic equipment, a storage medium and a computer program product. The technical scheme of the application is realized as follows: The embodiment of the application provides a resource allocation method, which comprises the following steps: Acquiring a plurality of tasks, carrying out iterative updating on particle swarms of the tasks based on a particle swarm optimization algorithm, and determining individual optimal position characteristics of each particle after each iteration and global optimal position characteristics of the particle swarm, wherein an allocation scheme of resources corresponding to the individual optimal position characteristics is optimal in resource use cost in the individual dimension of the particles, and an allocation scheme of resources corresponding to the global optimal position characteristics is optimal in resource use cost in the dimension of the particle swarm; And carrying out the next iteration of the particle swarm after the particles to be mutated are mutated based on the mutation strength determined by the stagnation times of each particle in the iteration process, stopping iteration until the preset iteration times are reached, and determining a final global optimal position characteristic and a final distribution scheme of characterization, wherein the single stagnation of the particles is used for characterizing that the improvement amplitude of the individual optimal position characteristic of the particles in the iteration process is smaller than a first preset threshold value. In the above solution, the determining the final global optimal position feature based on the variance strength determined by the number of stagnation times of each particle in the iteration process, performing the next iteration of the particle swarm after the variance of the particles to be mutated, until reaching the predetermined number of iterations, includes: determining the stagnation times of each particle based on the difference value of the individual optimal position characteristics corresponding to two adjacent iterations of each particle in the iteration process; determining the particles to be mutated in the particle swarm based on the stagnation times; On the basis of the stagnation times corresponding to the particles to be mutated, mutating the position characteristics of the particles to be mutated to obtain the position characteristics corresponding to each particle in the particle group after the nth iteration, wherein N is an integer greater than 1; And carrying out n+1st iteration update on the particle swarm based on the resource use cost information and the speed characteristic of the position characteristic representation allocation scheme of each particle, determining the individual optimal position characteristic of each particle after the n+1st iteration and the global optimal position characteristic of the particle swarm, stopping iteration until the preset iteration times are reached, and determining the final global optimal position characteristic, wherein the speed characteristic is used for indicating the searching direction of the allocation scheme in the particle iteration process. In the above solution, the determining the number of stagnation times of each particle based on the difference value of the individual optimal position features corresponding to two adjacent iterations of each particle in the iteration process includes: after each iteration in the N iteration processes i