Computing power resource scheduling system based on particle swarm optimization algorithm
By adopting the computing resource scheduling system of the particle swarm optimization algorithm in the cloud computing platform, the problem of low computing resource allocation efficiency in the cloud computing platform is solved, and the effects of efficient resource utilization and cost reduction are achieved.
Patent Information
- Application Number
- CN202410954771.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-17
- Publication Date
- 2024-10-22
AI Technical Summary
How to efficiently and reasonably allocate computing resources in cloud computing platforms, improve resource utilization, and reduce operating costs has become an urgent problem to be solved.
A computing resource scheduling system based on the particle swarm optimization algorithm is adopted, including a resource monitoring module, a task management module, a particle swarm optimization algorithm module and a scheduling execution module. The particle swarm optimization algorithm is used to optimize the scheduling of computing resources and the fitness function is used to evaluate The advantages and disadvantages of each scheduling plan are updated, the particle speed and position are updated, iterative optimization is performed, and the optimal scheduling plan is output.
It can quickly find the optimal computing resource scheduling solution, improve scheduling efficiency and resource utilization, reduce operating costs, and is suitable for computing resource scheduling management on cloud computing platforms.
Smart Images

Figure CN118819853A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of cloud computing and artificial intelligence technology, and in particular to a computing resource scheduling system based on a particle swarm optimization algorithm and an implementation method and algorithm thereof. Background Art
[0002] With the rapid development of cloud computing technology, the scheduling and management of computing resources have become a key link in the operation of cloud computing platforms. How to efficiently and reasonably allocate computing resources to meet the needs of different tasks, improve resource utilization, and reduce operating costs has become an urgent problem to be solved. Summary of the invention
[0003] In order to realize the computing power resource scheduling and management of the cloud computing platform more accurately and efficiently, timely and reasonably allocate computing power resources according to different task requirements, improve resource utilization and reduce operating costs, the present invention proposes a new computing power resource scheduling system based on particle swarm optimization algorithm, as well as the specific implementation method and algorithm of the system.
[0004] Specifically, the present invention provides a computing resource scheduling system based on a particle swarm optimization algorithm, such as Figure 1 As shown, the computing resource scheduling system includes a resource monitoring module, a task management module, a particle swarm optimization algorithm module and a scheduling execution module; wherein:
[0005] Resource monitoring module: used to monitor the status information of various computing resources in the cloud computing platform in real time;
[0006] Task management module: used to receive and manage pending computing tasks. Task management includes task submission, queuing, execution, and result return.
[0007] Particle swarm optimization algorithm module: used to optimize the scheduling of computing resources using the particle swarm optimization algorithm based on the information provided by the resource monitoring module and the requirements of the task management module;
[0008] Scheduling execution module: used to execute specific computing resource scheduling operations according to the optimal scheduling plan output by the particle swarm optimization algorithm module.
[0009] Furthermore, in the computing resource scheduling system based on the particle swarm optimization algorithm of the present invention, the status information of various computing resources in the cloud computing platform described in the resource monitoring module includes but is not limited to: CPU usage, memory occupancy, and network bandwidth.
[0010] Furthermore, the computing resource scheduling system based on the particle swarm optimization algorithm of the present invention, the scheduling optimization of computing resources using the particle swarm optimization algorithm described in the particle swarm optimization algorithm module, includes the following steps:
[0011] S1. Initialize particle swarm
[0012] Set the particle swarm size N, where each particle represents a computing resource scheduling scheme. Each computing resource scheduling scheme includes the allocation of various computing resources. Initialize the position and speed of each particle.
[0013] S2. Define the fitness function
[0014] Based on the information provided by the resource monitoring module and the requirements of the task management module, define the fitness function F(x) to evaluate the pros and cons of each particle (i.e., each computing resource scheduling scheme); the fitness function F(x) should be defined in combination with factors such as task completion time, resource utilization, and cost, and its specific form should be selected according to actual needs;
[0015] S3. Calculate fitness value
[0016] According to the fitness function F(x), the fitness value of each particle is calculated; the smaller the fitness value, the better the computing resource scheduling scheme represented by the particle;
[0017] S4. Update individual optimal and global optimal
[0018] Compare the current fitness value of each particle with its historical optimal fitness value. If the current fitness value is better, update the individual optimal position and individual optimal fitness value of the particle. At the same time, compare the individual optimal fitness values of all particles to find the global optimal position and global optimal fitness value.
[0019] S5. Update particle speed and position
[0020] According to the speed and position update formula of the particle swarm optimization algorithm, combined with the individual optimal position and the global optimal position, the speed and position of each particle are updated. The speed and position update formula is as follows:
[0021] (1)
[0022] (2)
[0023] in, represents the velocity of the ith particle at time t, represents the velocity of the ith particle at time t-1, represents the position of the ith particle at time t, represents the position of the i-th particle at time t-1, w is the inertia weight, c1 and c2 are learning factors, rand() is the random number function, pbest[i] is the individual optimal position of the i-th particle, and gbest is the global optimal position;
[0024] S6. Iterative Optimization
[0025] Repeat steps S3-S5 until the termination condition is met; in each iteration, the particle swarm optimization algorithm module will output the optimal scheduling plan under the current number of iterations.
[0026] Furthermore, in the computing resource scheduling system based on the particle swarm optimization algorithm of the present invention, the scheduling optimization of computing resources is performed using the particle swarm optimization algorithm. The initialization of the position and speed of each particle in step S1 includes: the position of each particle is randomly generated, and the speed of each particle is initialized to zero or a small value.
[0027] Furthermore, in the computing resource scheduling system based on the particle swarm optimization algorithm of the present invention, the scheduling optimization of computing resources is performed using the particle swarm optimization algorithm, and the fitness function F(x) described in step S2 is defined as:
[0028] F(x) = w1*task completion time + w2*(1-resource utilization) + w3*cost;
[0029] Among them, w1, w2, and w3 are the weight coefficients of task completion time, resource utilization, and cost, respectively.
[0030] Furthermore, in the computing resource scheduling system based on the particle swarm optimization algorithm of the present invention, the scheduling optimization of computing resources is performed using the particle swarm optimization algorithm, and the termination conditions described in step S6 include but are not limited to: reaching the maximum number of iterations or the fitness value reaching a preset threshold.
[0031] On the other hand, the present invention provides a computing resource scheduling method based on a particle swarm optimization algorithm, such as Figure 2 As shown, the following steps are included:
[0032] S1. Obtain computing power resource status information
[0033] The resource monitoring module monitors and obtains the status information of various computing resources in the cloud computing platform in real time;
[0034] S2. Initialize particle swarm
[0035] Set the particle swarm size N, where each particle represents a computing resource scheduling scheme. Each computing resource scheduling scheme includes the allocation of various computing resources. Initialize the position and speed of each particle.
[0036] S3. Define the fitness function
[0037] According to the status information of various computing resources in the cloud computing platform and the needs of task management, the fitness function F(x) is defined to evaluate the pros and cons of each particle (i.e., each computing resource scheduling scheme); the fitness function F(x) should be defined in combination with factors such as task completion time, resource utilization, and cost, and its specific form should be selected according to actual needs;
[0038] S4. Calculate fitness value
[0039] According to the fitness function F(x), the fitness value of each particle is calculated; the smaller the fitness value, the better the computing resource scheduling scheme represented by the particle;
[0040] S5. Update individual optimal and global optimal
[0041] Compare the current fitness value of each particle with its historical optimal fitness value. If the current fitness value is better, update the individual optimal position and individual optimal fitness value of the particle. At the same time, compare the individual optimal fitness values of all particles to find the global optimal position and global optimal fitness value.
[0042] S6. Update particle speed and position
[0043] According to the speed and position update formula of the particle swarm optimization algorithm, combined with the individual optimal position and the global optimal position, the speed and position of each particle are updated. The speed and position update formula is as follows:
[0044] (1)
[0045] (2)
[0046] in, represents the velocity of the ith particle at time t, represents the velocity of the ith particle at time t-1, represents the position of the ith particle at time t, represents the position of the i-th particle at time t-1, w is the inertia weight, c1 and c2 are learning factors, rand() is the random number function, pbest[i] is the individual optimal position of the i-th particle, and gbest is the global optimal position;
[0047] S7. Iterative Optimization
[0048] Repeat steps S4-S6 until the termination condition is met; in each iteration, the particle swarm optimization algorithm module will output the optimal scheduling solution under the current number of iterations;
[0049] S8. Execute scheduling operation
[0050] When the particle swarm optimization algorithm module outputs the optimal scheduling plan, the scheduling execution module performs specific computing resource scheduling operations according to the plan and allocates appropriate computing resources to each computing task.
[0051] Furthermore, the status information of various computing resources in the cloud computing platform described in step S1 of the computing resource scheduling method based on the particle swarm optimization algorithm of the present invention includes but is not limited to: CPU usage, memory occupancy, network bandwidth;
[0052] Initializing the position and speed of each particle in step S2 includes: the position of each particle is randomly generated, and the speed of each particle is initialized to zero or a smaller value;
[0053] The termination conditions described in step S7 include, but are not limited to: reaching a maximum number of iterations or a fitness value reaching a preset threshold.
[0054] Furthermore, the fitness function F(x) described in step S3 of the computing resource scheduling method based on the particle swarm optimization algorithm of the present invention is defined as:
[0055] F(x) = w1*task completion time + w2*(1-resource utilization) + w3*cost;
[0056] Among them, w1, w2, and w3 are the weight coefficients of task completion time, resource utilization, and cost, respectively.
[0057] In addition, the present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the steps of the above-mentioned computing resource scheduling method based on the particle swarm optimization algorithm are implemented.
[0058] In summary, the computing resource scheduling system and computing resource scheduling method based on the particle swarm optimization algorithm of the present invention can quickly find a better computing resource scheduling solution through a global search optimization algorithm, thereby improving scheduling efficiency and resource utilization, reducing operating costs, and is suitable for computing resource scheduling management of a cloud computing platform. The method and system of the present invention have the following advantages:
[0059] (1) The present invention uses the global search capability of the particle swarm optimization algorithm to quickly find a more optimal computing resource scheduling solution, thereby improving scheduling efficiency and resource utilization.
[0060] (2) The fitness function in the present invention comprehensively considers multiple factors such as task completion time, resource utilization and cost, and can meet the needs of different tasks.
[0061] (3) The system structure of the present invention is clear, the coupling between modules is low, and it is easy to maintain and expand.
[0062] (4) The present invention can also introduce parallel computing technology to simultaneously process the fitness calculation and update operations of multiple particles, further improving the scheduling efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] In order to more clearly illustrate the technical solution of the present invention, the following briefly introduces the drawings required for use in the description of the present invention. Obviously, the following drawings are only some embodiments recorded in the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.
[0064] Figure 1 Schematic diagram of the composition architecture of the computing resource scheduling system of the present invention.
[0065] Figure 2 This is a flow chart for implementing the computing power resource scheduling method of the present invention. DETAILED DESCRIPTION
[0066] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with specific embodiments. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments, and the present invention can also be implemented or applied through other different specific implementation methods. The details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention.
[0067] At the same time, it should be understood that the protection scope of the present invention is not limited to the specific embodiments described below; it should also be understood that the terms used in the embodiments of the present invention are for describing specific embodiments rather than for limiting the protection scope of the present invention.
[0068] Example: A computing resource scheduling method based on particle swarm optimization algorithm (using Python core code as an example)
[0069] The method comprises the following steps:
[0070] 1. Obtaining computing resource status information
[0071] The resource monitoring module monitors and obtains the status information of various computing resources in the cloud computing platform in real time, including: CPU usage, memory occupancy, network bandwidth, etc.
[0072] 2. Initialize the particle swarm
[0073] Set the particle swarm size (N). Each particle represents a computing resource scheduling scheme. Each computing resource scheduling scheme includes the allocation of various computing resources. Initialize the position and speed of each particle. The position of each particle is randomly generated, and the speed of each particle is initialized to zero or a small value.
[0074] import numpy as np
[0075] #Particle swarm size
[0076] N = 30
[0077] #Resource allocation dimensions
[0078] dim=10
[0079] # Randomly initialize particle positions
[0080] positions=np.random.rand(N,dim)
[0081] # Initialize particle speed to zero
[0082] velocities=np.zeros((N,dim))
[0083] 3. Define the fitness function
[0084] According to the status information of various computing resources in the cloud computing platform and the needs of task management, the fitness function F(x) is defined to evaluate the pros and cons of each particle (i.e., each computing resource scheduling scheme); in the process of defining the fitness function F(x), factors such as task completion time, resource utilization, and cost need to be considered, and its specific form should be selected according to actual needs.
[0085] def fitness_function(x,w1=0.5,w2=0.3,w3=0.2):
[0086] #Task completion time is the sum of resource allocation
[0087] task_completion_time=np.sum(x)
[0088] #Resource utilization is the average value of resource allocation
[0089] resource_utilization=np.mean(x)
[0090] #Cost is the sum of squares of resource allocation
[0091] cost = np.sum(x**2)
[0092] return w1*task_completion_time+w2*(1-resource_utilization)+w3*cost
[0093] 4. Calculate the fitness value
[0094] According to the fitness function F(x), the fitness value of each particle is calculated; the smaller the fitness value, the better the computing resource scheduling scheme represented by the particle.
[0095] fitness_values=np.array([fitness_function(pos)for pos in positions])
[0096] 5. Update individual optimality and global optimality
[0097] Individual best (pbest): The current fitness value of each particle is compared with its historical best fitness value. If the current fitness value is better, the individual best position and individual best fitness value of the particle are updated.
[0098] Global Optimum (gbest): Compare the individual optimal fitness values of all particles to find the global optimal position and global optimal fitness value.
[0099] pbest_positions=positions.copy()
[0100] pbest_fitness_values=fitness_values.copy()
[0101] gbest_position=pbest_positions[np.argmin(pbest_fitness_values)]
[0102] gbest_fitness_value=np.min(pbest_fitness_values)
[0103] 6. Update particle speed and position
[0104] According to the speed and position update formula of the particle swarm optimization algorithm, the speed and position of each particle are updated by combining the individual optimal position and the global optimal position.
[0105] #Inertia weight
[0106] w=0.5
[0107] #Learning Factor
[0108] c1=1.5
[0109] c2=1.5
[0110] for i in range(N):
[0111] r1,r2=np.random.rand(),np.random.rand()
[0112] velocities[i]=w*velocities[i]+c1*r1*(pbest_positions[i]-positions[i])+c2*r2*(gbest_position-positions[i])
[0113] positions[i]=positions[i]+velocities[i]
[0114] 7. Iterative Optimization
[0115] Repeat steps 4 to 6 until the termination condition is met (such as reaching the maximum number of iterations or the fitness value reaches the preset threshold); in each iteration, the particle swarm optimization algorithm module will output the optimal scheduling plan under the current number of iterations.
[0116]
[0117] 8. Execute scheduling operations
[0118] When the particle swarm optimization algorithm module outputs the optimal scheduling plan, the scheduling execution module performs specific computing resource scheduling operations according to the plan and allocates appropriate computing resources to each computing task.
[0119] #Optimal scheduling solution
[0120] optimal_schedule=gbest_position
[0121] #Example: Execute scheduling operations to allocate appropriate computing resources to each computing task def execute_schedule(schedule):
[0122] #The specific scheduling logic is implemented here
[0123] print("Executing schedule with resource allocation:",schedule)
[0124] execute_schedule(optimal_schedule)
[0125] Example of specific data calculation process
[0126] Suppose we have the following scenario:
[0127] The resource allocation dimension is 10, which means there are 10 different resources that need to be allocated.
[0128] The particle swarm size is 30.
[0129] The weights of task completion time, resource utilization, and cost are 0.5, 0.3, and 0.2, respectively.
[0130] Through the above steps, we can effectively optimize the scheduling of computing resources, reduce task completion time, improve resource utilization, and control costs. This method can flexibly adjust the fitness function and weight coefficient to adapt to different actual needs and scenarios.
[0131] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Any technician familiar with the profession can make some changes or modifications to the technical contents disclosed above without departing from the scope of the technical solution of the present invention to obtain equivalent embodiments of equivalent changes. However, any simple modification, equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention should be included in the scope of protection of the claims of the present invention.
Claims
1. A computing resource scheduling system based on particle swarm optimization algorithm, characterized in that: The computing resource scheduling system includes a resource monitoring module, a task management module, a particle swarm optimization algorithm module and a scheduling execution module; wherein: Resource monitoring module: used to monitor the status information of various computing resources in the cloud computing platform in real time; Task management module: used to receive and manage pending computing tasks. Task management includes task submission, queuing, execution, and result return. Particle Swarm Optimization Algorithm Module: Used to optimize the scheduling of computing resources using the particle swarm optimization algorithm based on the information provided by the resource monitoring module and the requirements of the task management module; Scheduling execution module: used to execute computing resource scheduling operations based on the optimal scheduling plan output by the particle swarm optimization algorithm module.
2. The computing resource scheduling system based on particle swarm optimization algorithm according to claim 1 is characterized in that: The resource monitoring module monitors the status of various computing resources in the cloud computing platform, including CPU usage, memory usage, and network bandwidth.
3. The computing resource scheduling system based on particle swarm optimization algorithm according to claim 1 is characterized in that: The particle swarm optimization algorithm module uses the particle swarm optimization algorithm to optimize the scheduling of computing resources, including the following steps: S1. Initialize particle swarm Set the particle swarm size, where each particle represents a computing resource scheduling solution; initialize the position and velocity of each particle; S2. Define the fitness function Based on the information provided by the resource monitoring module and the requirements of the task management module, a fitness function F(x) is defined to evaluate the quality of each particle; S3. Calculate fitness value According to the fitness function F(x), the fitness value of each particle is calculated; the smaller the fitness value, the better the computing resource scheduling solution represented by the particle; S4. Update individual optimality and global optimality Compare the current fitness value of each particle with its historical optimal fitness value. If the current fitness value is better, update the individual optimal position and individual optimal fitness value of the particle. At the same time, compare the individual optimal fitness values of all particles to find the global optimal position and global optimal fitness value. S5. Update particle speed and position According to the speed and position update formula of the particle swarm optimization algorithm, combined with the individual optimal position and the global optimal position, the speed and position of each particle are updated. The speed and position update formula is as follows: in, represents the velocity of the i-th particle at time t, represents the velocity of the i-th particle at time t-1, represents the position of the i-th particle at time t, represents the position of the i-th particle at time t-1, w is the inertia weight, c1 and c2 are learning factors, rand() is the random number function, pbest[i] is the individual optimal position of the i-th particle, and gbest is the global optimal position; S6. Iterative Optimization Repeat steps S3-S5 until the termination condition is met; in each iteration, the particle swarm optimization algorithm module will output the optimal scheduling solution under the current number of iterations.
4. The computing resource scheduling system based on particle swarm optimization algorithm according to claim 3 is characterized in that: Initializing the position and velocity of each particle in step S1 includes: randomly generating the position of each particle and initializing the velocity of each particle to zero.
5. The computing resource scheduling system based on particle swarm optimization algorithm according to claim 3 is characterized in that: The fitness function F(x) described in step S2 is defined as: F(x) = w1*task completion time + w2*(1-resource utilization) + w3*cost; Among them, w1, w2, and w3 are the weight coefficients of task completion time, resource utilization, and cost, respectively.
6. The computing resource scheduling system based on particle swarm optimization algorithm according to claim 3 is characterized in that: The termination condition described in step S6 includes: reaching a maximum number of iterations or a fitness value reaching a preset threshold.
7. A computing resource scheduling method based on particle swarm optimization algorithm, characterized in that: The steps include: S1. Obtain computing power resource status information The resource monitoring module monitors and obtains status information of various computing resources in the cloud computing platform in real time; S2. Initialize particle swarm Set the particle swarm size, where each particle represents a computing resource scheduling scheme. Each computing resource scheduling scheme includes the allocation of various computing resources. Initialize the position and velocity of each particle. S3. Define fitness function Based on the status information of various computing resources in the cloud computing platform and the requirements of task management, a fitness function F(x) is defined to evaluate the quality of each particle. S4. Calculate fitness value According to the fitness function F(x), the fitness value of each particle is calculated; the smaller the fitness value, the better the computing resource scheduling solution represented by the particle; S5. Update individual optimality and global optimality Compare the current fitness value of each particle with its historical optimal fitness value. If the current fitness value is better, update the individual optimal position and individual optimal fitness value of the particle. At the same time, compare the individual optimal fitness values of all particles to find the global optimal position and global optimal fitness value. S6. Update particle speed and position According to the speed and position update formula of the particle swarm optimization algorithm, combined with the individual optimal position and the global optimal position, the speed and position of each particle are updated. The speed and position update formula is as follows: in, represents the velocity of the i-th particle at time t, represents the velocity of the i-th particle at time t-1, represents the position of the i-th particle at time t, represents the position of the i-th particle at time t-1, w is the inertia weight, c1 and c2 are learning factors, rand() is the random number function, pbest[i] is the individual optimal position of the i-th particle, and gbest is the global optimal position; S7. Iterative Optimization Repeat steps S4-S6 until the termination condition is met; in each iteration, the particle swarm optimization algorithm module will output the optimal scheduling solution under the current number of iterations; S8. Execute scheduling operations When the particle swarm optimization algorithm module outputs the optimal scheduling plan, the scheduling execution module performs specific computing resource scheduling operations according to the plan and allocates appropriate computing resources to each computing task.
8. The computing resource scheduling method based on particle swarm optimization algorithm according to claim 7 is characterized in that: Status information of various computing resources in the cloud computing platform described in step S1, including: CPU usage, memory occupancy, and network bandwidth; Initializing the position and velocity of each particle in step S2 includes: randomly generating the position of each particle and initializing the velocity of each particle to zero; The termination condition in step S7 includes: reaching a maximum number of iterations or a fitness value reaching a preset threshold.
9. The computing resource scheduling method based on particle swarm optimization algorithm according to claim 7, characterized in that: The fitness function F(x) described in step S3 is defined as: F(x) = w1*task completion time + w2*(1-resource utilization) + w3*cost; Among them, w1, w2, and w3 are the weight coefficients of task completion time, resource utilization, and cost, respectively.
10. A computer-readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the steps of the computing resource scheduling method based on the particle swarm optimization algorithm according to any one of claims 7 to 9 are implemented.
Citation Information
Cited By
Calculation task scheduling method and device in multivariate heterogeneous environment and medium
CN119415240A
Cloud computing resource scheduling method and system based on artificial intelligence
CN120602494A
