CN-122019105-A - Cloud computing task scheduling method and system based on quantum cobra search mechanism
Abstract
The invention provides a cloud computing task scheduling method and system based on a quantum cobra search mechanism, and belongs to the field of cloud computing. The method for scheduling the cloud computing task is dependent on an initial group, has limitation, and solves the problems that the traditional evolution strategy causes difficult parameter setting and poor robustness. The method comprises the steps of constructing a cloud computing task scheduling model, initializing individual quantum positions in a cobra search mechanism, setting parameters, dividing all cobras into a male part and a female part, respectively calculating optimal quantum positions and minimum fitness values of the cobras, generating quantum rotation angles according to the cobra search mechanism, updating the quantum positions of the cobras by using a simplified quantum rotation gate, determining the cobras quantum positions by applying a greedy strategy, judging whether the maximum iteration times are reached, and outputting a final task scheduling strategy or iterating again to the maximum iteration times. The invention effectively shortens the task response time, reduces the search space, improves the throughput of the system and can effectively reduce the energy consumption and the running cost.
Inventors
- WU XINGYU
- GAO HONGYUAN
- LIU QINGLING
- CHEN SHIQI
- CHEN MEIQI
- CHU YIFAN
- HAN RONGHUA
- LI SHIRUI
- HE YIQIU
Assignees
- 哈尔滨工程大学
Dates
- Publication Date
- 20260512
- Application Date
- 20260210
Claims (8)
- 1. A cloud computing task scheduling method based on a quantum cobra search mechanism is characterized by comprising the following steps: s100, establishing a cloud computing task scheduling model, wherein the cloud computing task scheduling model is established based on an execution time matrix and an execution cost matrix of a task on a virtual machine which are established according to an allocation matrix of the task and the virtual machine; s200, initializing quantum positions of individuals in a cobra search mechanism and setting parameters; S300, calculating the actual position of the cobra, mapping the actual position of the cobra into a distribution matrix of a task and a virtual machine, and then calculating the optimal quantum position and the minimum fitness value of the cobra; s400, generating a quantum rotation angle according to a cobra search mechanism, and updating the quantum position of the cobra by using a simplified quantum rotation gate, wherein the cobra search mechanism is used for selecting predation, fight or mating according to the environmental temperature, selecting predation when the environmental temperature is higher than a temperature threshold, selecting fight when the environmental temperature is lower than the temperature threshold and the uniform random number is higher than the fight threshold, and selecting mating when the environmental temperature is lower than the temperature threshold and the uniform random number is lower than the fight threshold; s500, determining quantum positions of a new generation cobra individual by applying a greedy strategy; And S600, judging whether the maximum iteration times are reached, if not, returning to the step S400 to continue iteration, and if so, terminating the iteration loop, and obtaining a final task scheduling strategy according to the task corresponding to the optimal position in the last generation and the allocation matrix of the virtual machine.
- 2. The cloud computing task scheduling method based on the quantum cobra search mechanism according to claim 1, wherein in step S100, comprising, S110, constructing an allocation matrix of tasks and virtual machines; the method comprises the steps of designating U independent tasks, V independent virtual machines, distributing one task to be executed on one virtual machine, and defining a distribution matrix of the task and the virtual machine as Wherein Representing virtual machines Executing tasks If the task is Not assigned to virtual machines Execute on, then ; S120, constructing an execution time matrix of the task on the virtual machine; Task setting Is of the instruction length of Virtual machine The execution speed vector of (a) is as follows Time matrix for task execution on virtual machine In which the task In the virtual machine The execution time is as follows , Execution time vector of each virtual machine Virtual machine The execution time of (2) is ; Total execution time of task , ; Define the deadline as The task should be performed before the deadline, where, To assign all tasks running on this virtual machine to the time available for running on the virtual machine with the highest running speed, To assign all tasks running on this virtual machine to the time available for running on the virtual machine with the lowest running speed, Is that A uniform random number therebetween; s130, constructing an execution cost matrix of the task on the virtual machine; The input cost matrix of the cloud computing service provider on each virtual machine is as follows In which the task In the virtual machine The input cost is as follows , Is a virtual machine Cost per unit time, total cost required to be input after all tasks are executed All tasks execute the total cost invested on the virtual machine Should not exceed the budget The calculation formula of the budget is I.e. meeting constraints Wherein Representing the highest cost obtained by assigning all tasks to the most costly virtual machine, Representing the lowest cost achieved by assigning all tasks to the least costly virtual machine, Is that A uniform random number therebetween; s140, constructing a cloud computing task scheduling model based on the steps S110 to S130; under the constraint condition of cost, the total completion time calculation formula of the task is the objective function with punishment mechanism 。
- 3. The cloud computing task scheduling method based on the quantum cobra search mechanism as set forth in claim 2, wherein in step S200, the population size of cobra is set to be The maximum iteration number is The iteration number is , First, the Second iteration (a) Cobra strip Quantum position in the dimensional search space is , When in the first generation, let =1, Each dimension of the cobra quantum position is initialized to A uniform random number therebetween.
- 4. The cloud computing task scheduling method based on the quantum cobra search mechanism according to claim 3, wherein in step S300, comprising, S310, calculating the actual position of the cobra and mapping the actual position of the cobra into an allocation matrix of tasks and virtual machines; First, the Second iteration (a) The actual position of the cobra is The mapping formula is Wherein Is the first Second iteration (a) Actual position of cobra The dimensions of the dimensions, Is the first Second iteration (a) Quantum position of cobra The dimensions of the dimensions, Is the actual position of cobra The upper limit of the dimensional variable is set, Is the actual position of cobra The lower limit of the dimensional variable is set, Representing a nearest rounding function; the value of each dimension of the actual position coordinates of the cobra is Integer within range, mapping each cobra position into task and virtual machine allocation matrix Wherein the mapping mode is as follows: In the first place Second iteration (a) Position of cobra The value of dimension is I.e. , , , Representing tasks Assigned to virtual machines On the other hand, the allocation matrix of the task and the virtual machine In the process, the And distribute matrix Is the first of (2) Element removal of columns The values of the other elements outside the column are 0; s320, calculating the optimal quantum position and the minimum fitness value of the cobra; First, the Second iteration (a) The fitness function of the actual position of the cobra is that Wherein F () represents the task completion time corresponding to the calculated task scheduling matrix Z, and the first is obtained by using the fitness function Second iteration (a) The adaptability value of the cobra position is , Specifying the quantum position of cobra with the minimum fitness as the optimal quantum position, the first The optimal quantum position in all cobras iterated for a time is The corresponding minimum fitness value is ; S330, dividing all cobras into equal male and female parts, respectively calculating fitness values of the male and female cobras, and sequencing to obtain optimal quantum positions and minimum fitness values corresponding to the male and female cobras; First, the Second iteration (a) Male cobra in strip Quantum position in the dimensional search space is , The optimal quantum position of male cobra is The corresponding minimum fitness value is First, a third step Second iteration (a) Strip female cobra Quantum position in the dimensional search space is , The female cobra has the optimal quantum position of The corresponding minimum fitness value is The quantum positions of the male cobra and the female cobra are respectively ordered from small to large according to fitness values.
- 5. The cloud computing task scheduling method based on the quantum cobra search mechanism according to claim 4, wherein in step S400, comprising, First, the Second iteration (a) Actual position of cobra Selecting predation, combat or mating actions by determining the temperature of the environment, where the temperature in the environment , Is an exponential function; Food amount in the environment Wherein Is that A constant therebetween; First, the Battle ability of male cobra Wherein Is the first The fitness value corresponding to the quantum position of the male cobra, First, a third step Battle ability of strip female cobra Wherein Is the first Fitness value corresponding to quantum position of strip female cobra, ; First, the Mating ability of male cobra , First, the Mating ability of strip female cobra , ; First, the The quantum position of the updated male cobra individuals is , Of which the first is The first quantum rotation angle calculation formula is as follows , As a threshold value for the ambient temperature, Is the battle threshold value, the first The quantum position of the strip female cobra after updating is , Of which the first is The first quantum rotation angle calculation formula is as follows ; Wherein the method comprises the steps of Is the first Optimal quantum position of the next iteration The dimensions of the dimensions, , , And Is that A uniform random number between the two, Is that A constant value in between, Takes the value of-1 or 1 as the direction variable; First, the The quantum position of the cobra is expressed as an updated formula according to the first quantum rotation angle The first of the group The quantum rotation angle vector corresponding to the update quantum position of the cobra is as follows , Wherein the first Quantum rotation angle of cobra Dimension is , , Is that Constant in between, update the first with simplified quantum turnstile of the simulation Quantum position of cobra Wherein the first Quantum position of cobra Dimension is , , All of the population The quantum position of the cobra is determined according to the rule Updates are made within the dimensional search space.
- 6. The cloud computing task scheduling method based on the quantum cobra search mechanism according to claim 5, wherein in step S500, comprising, Mapping the updated cobra quantum position into an actual position, wherein the actual position represents an allocation matrix of the task and the virtual machine, and calculating an adaptability function corresponding to the allocation matrix; Sequencing the quantum positions of the updated male cobras from small to large according to the fitness value, and sequencing the first Quantum position of cobra And The corresponding fitness value is respectively corresponding to the first generation of the previous generation Quantum position of cobra Comparing the corresponding fitness values, and selecting the quantum position of male cobra with small fitness value as the first quantum position In the second iteration Quantum position of cobra , Eliminating other quantum positions against selection, selecting the first The optimal quantum position of the male cobra with small fitness value is The corresponding minimum fitness value is ; Selection of The female cobra with small fitness value has the optimal quantum position of The corresponding minimum fitness value is The optimal quantum position in all cobras is The corresponding minimum fitness value is 。
- 7. The cloud computing task scheduling system based on the quantum cobra search mechanism is characterized by comprising a program module corresponding to the steps of any one of claims 1-6, and the steps in the cloud computing task scheduling method based on the quantum cobra search mechanism are executed in the running process.
- 8. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program configured to implement the steps of the quantum cobra search mechanism-based cloud computing task scheduling method of any one of claims 1-6 when called by a processor.
Description
Cloud computing task scheduling method and system based on quantum cobra search mechanism Technical Field The invention relates to the technical field of cloud computing, in particular to a cloud computing task scheduling method and system based on a quantum cobra search mechanism. Background The cloud computing adopts a large amount of high-computation-power, elastic and virtualized computing resources, stores, processes and delivers various network services in a distributed mode, and is a dynamic extensible network composed of a large number of cloud servers with storage, operation and scheduling capabilities. The core of the method is that scattered computing resources such as servers, storage devices, application programs and the like are integrated into an elastic service pool through a network, and a user can acquire computing capacity, storage space or software service according to needs without paying attention to an underlying hardware architecture. The mode breaks the limitation of the traditional localization deployment, realizes the efficient allocation and flexible scheduling of resources in a service mode, and is suitable for scenes such as big data processing, enterprise digital transformation, edge computing cooperation and the like. The high concurrent access pressure, large-scale data migration, dynamic resource scheduling, security privacy protection and other challenges in the cloud computing at the present stage restrict the high efficiency of the centralized management architecture in the cloud computing. Specifically, resource preemption, delay bottleneck of cross-region data transmission and service consistency maintenance during elastic expansion in a multi-tenant environment all put higher requirements on dynamic allocation of computing resources and service reliability. Meanwhile, due to the complexity of data encryption and compliance supervision, the traditional management mode based on a single central node is difficult to adapt to the real-time response requirements of diversified business scenes, and the efficient coordination of resources is realized by an intelligent optimization method so as to shorten the task completion time to the greatest extent and reduce the cost. Through the search of the existing literature, hatem Aziza et al, in "Ahybrid genetic algorithm for scientific work flow scheduling incloud environment" propose a hybrid genetic algorithm for cloud environment science workflow scheduling. The genetic algorithm is improved to a certain extent and is used for solving the problem of cloud computing task scheduling, a certain effect is achieved, but the genetic algorithm itself has the problem that a global optimal solution can not be found, the searching process of the genetic algorithm can fall into a local optimal solution area, the performance of the genetic algorithm depends on the quality and parameter setting of an initial population to a great extent, and for some complex cloud computing task scheduling problems, the optimal solution can not be found all the time. Chen Pan et al, "cloud computing task scheduling algorithm based on improved particle swarm", published in science, technology and engineering (2025,25 (12): 50-45), improved the traditional particle swarm algorithm through reverse learning, sine and cosine strategy fusion and average fitness guidance, but parameter tuning complexity is high, and engineering practicability is limited. In summary, the existing cloud computing task scheduling method is improved in early classical methods, and the method is severely dependent on the initial population and has certain limitation. Meanwhile, the traditional evolution strategy brings the problems of difficult parameter setting and poor robustness. Disclosure of Invention The invention aims to solve the technical problems that: the method aims to solve the problems that an existing cloud computing task scheduling method is severely dependent on an initial group, has limitation, and is difficult in parameter setting and poor in robustness due to a traditional evolution strategy. The invention adopts the technical scheme for solving the technical problems: The invention provides a cloud computing task scheduling method based on a quantum cobra search mechanism, which comprises the following steps: s100, establishing a cloud computing task scheduling model, wherein the cloud computing task scheduling model is established based on an execution time matrix and an execution cost matrix of a task on a virtual machine which are established according to an allocation matrix of the task and the virtual machine; s200, initializing quantum positions of individuals in a cobra search mechanism and setting parameters; S300, calculating the actual position of the cobra, mapping the actual position of the cobra into a distribution matrix of a task and a virtual machine, and then calculating the optimal quantum position and the minimum fitness value of the cobra; s400