Cloud computing task scheduling method, device and storage medium based on one-dimensional grey wolf algorithm
Through the combination of one-dimensional gray wolf algorithm and greedy strategy, the problems of low efficiency and dimension explosion in cloud computing task scheduling are solved, the global optimal scheduling solution is quickly found, and cloud computing resource allocation and task completion time are optimized.
Patent Information
- Application Number
- CN202210921087.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-02
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2042-08-02
AI Technical Summary
The task scheduling problem in cloud computing suffers from inefficiency and dimensionality explosion. The evolutionary algorithm is complex and the greedy algorithm cannot guarantee global search performance.
A cloud computing task scheduling method based on the one-dimensional gray wolf algorithm is adopted. Through one-dimensional real number encoding and greedy strategy, the search dimension is reduced, the population size hyperparameter setting is eliminated, and the task scheduling scheme with the optimal global fitness value is quickly searched.
It effectively reduces the overall completion time of cloud computing tasks, optimizes resource allocation, speeds up calculations, and combines the high performance of evolutionary algorithms and the high efficiency of greedy algorithms.
Smart Images

Figure CN115145694B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of cloud computing, and in particular to a cloud computing task scheduling method, device and storage medium based on a one-dimensional grey wolf algorithm. Background Art
[0002] With the rapid development of the Internet and the Internet of Things, the amount of data in the network has increased dramatically, and cloud computing has played an increasingly important role. Compared with other distributed computing technologies such as grid computing, cloud computing can provide users with flexible and scalable services. Clouds provide many types of services. The most important services are Infrastructure as a Service (IaaS), Platform as a Service (PaaS), and Software as a Service (SaaS). Users can use computing resources and platforms on a pay-per-use basis through the Internet without having to understand the underlying technology.
[0003] The basic working mechanism of cloud computing is to assign computing tasks to virtual machines (VMs) in a resource pool for execution to meet resource requirements and reduce the time required to complete tasks. Since cloud computing is an application system oriented to market demand, in order to maximize the profits and return on investment of cloud providers and users, it must have advanced resource scheduling strategies that can support software and user applications, tasks and work. In fact, scheduling has a direct impact on system performance, such as resource utilization efficiency and operating costs, so scheduling is crucial to cloud computing.
[0004] Due to the use of virtualization technology, virtual machines can be dynamically configured, allocated and managed, so the scheduling problem in cloud computing can usually be divided into two main levels. The first level is to plan the tasks submitted by users and map them to a set of available VM nodes. The second level is the mapping between VMs and hosts, which allows VMs to be created or migrated on suitable hosts. Scheduling the tasks submitted by users to virtual machines will directly affect the processing power of the cloud computing system, and an optimized scheduling algorithm can effectively improve the processing power of the cloud computing system. An effective task scheduling process needs to be able to reduce the task completion time of the application. Therefore, an algorithm for scheduling tasks is needed in the cloud to allocate tasks to resources in the best way. However, the time required to find a solution varies with the size of the problem, so this problem is an NP-hard optimization problem, and two types of heuristic algorithms, evolutionary algorithms or greedy algorithms, are usually used to solve it. When using evolutionary algorithms to deal with task scheduling problems, although it can be very convenient to represent the mapping of tasks to virtual machine nodes, there are problems of low efficiency and dimensionality explosion. When using greedy algorithms to deal with it, because it uses random search or local search, its global search ability is limited and performance is difficult to guarantee. Summary of the invention
[0005] In view of the above problems in the prior art, the present invention provides a method, device and storage medium for cloud computing task scheduling based on a one-dimensional grey wolf algorithm, so as to reduce the search dimension of the solution space, eliminate the hyperparameter setting of the population size, greatly optimize the cloud scheduling scheme, and improve the operating efficiency of the computer.
[0006] In order to achieve the above object, a method for cloud computing task scheduling based on a one-dimensional grey wolf algorithm is provided, comprising:
[0007] S1, determining that the problem to be solved in cloud computing task scheduling is: assigning N cloud computing tasks to M virtual machines so that the total completion time of the N cloud computing tasks is minimized, where N and M are both natural numbers, and where in the gray wolf algorithm, a combination of scheduling schemes for assigning each of the N cloud computing tasks to a corresponding virtual machine is constructed as a gray wolf population, and the size of the total gray wolf population is N;
[0008] S2, using a one-dimensional real number to encode the gray wolf population and initialize the gray wolf population, wherein each gray wolf individual in the gray wolf population is a one-dimensional integer, representing a scheduling scheme of a computing task to a virtual machine;
[0009] S3, using the total completion time of the N cloud computing tasks as a fitness function to calculate the fitness values of the scheduling schemes represented by all individuals in the gray wolf population;
[0010] S4, determining whether the calculated fitness value or the number of iterations meets the preset termination condition; if so, taking the population code with the smallest fitness value at this time as the final cloud computing task scheduling scheme for the N cloud computing tasks, and ending the process; if not, executing step S5;
[0011] S5, using the preset greedy strategy to update the selected individuals in the current gray wolf population;
[0012] S6, calculate the fitness value of the scheduling scheme represented by the updated population code, and repeat steps S4-S6.
[0013] Furthermore, the initialization step of step S2 includes:
[0014] S21, using a random generation function to generate a population parent in which the number of gray wolf individuals is equal to the number of tasks, where parent is a variable, the dimension of each gray wolf individual in the population parent is 1, and the value range of the gray wolf individual is [1, M];
[0015] S22, applying a rounding function to the individual gray wolf to obtain a neighboring integer value;
[0016] S23, let the fitness values of the population codes α, β and δ corresponding to the three task scheduling schemes representing the optimal fitness values be inf, where inf represents positive infinity, and the position codes alpha_pos, beta_pos and delta_pos corresponding to the population codes α, β and δ are all set to 1xN all-zero vectors.
[0017] Furthermore, the evolutionary adaptability of the population is calculated using a fitness function, where fobj=max(time i ), i∈(1,2,3,……,M), where M is the number of virtual machines, time i It represents the total time taken to complete all cloud computing tasks on virtual machine i.
[0018] Furthermore, the step of updating the individuals selected in the current population in step S5 is: using the population codes α, β and δ corresponding to the three scheduling schemes with the best fitness values to update the individuals in the population, generate the next generation population, and then use the first gray wolf individual in the generated next generation population to randomly update the virtual machine mapping assigned to the selected task in the original scheduling scheme.
[0019] Furthermore, step S5 is to update the random individuals in the current population as follows:
[0020] S51, using the fitness function to calculate the fitness value of the current population parent;
[0021] S52, updating the fitness values of α, β and δ according to the fitness value of the population parent, and updating the corresponding population position codes alpha_pos, beta_pos and delta_pos respectively, so as to keep the fitness values of α, β and δ optimal;
[0022] S53, setting the next generation population as offspring, and initializing the offspring population using the population code of the current parent;
[0023] S54, performing a gray wolf algorithm hunting operation using the offspring, the population size N, the gray wolf individual value range, the gray wolf algorithm weight factor a, and the position codes of α, β, and δ to generate a position code representing a candidate task scheduling solution, represented by candidatePos;
[0024] S55, using the value of the first gray wolf individual in the position code candidatePos of the candidate task scheduling scheme, greedily replace the mapping of the randomly selected task allocation of the offspring population, generate a new candidate scheduling scheme, assign it to the offspring, and delete the first gray wolf individual in the candidatePos population;
[0025] S56, using the fitness function formula to calculate the fitness value of the candidate task scheduling scheme offspring, if the obtained fitness value is less than the fitness value of the parent population, then using offspring to update the parent population and its fitness value, otherwise no operation is performed;
[0026] S57, determine whether candidatePos is empty, if so, end this process; if not, return to step S55.
[0027] Furthermore, in step S54, the weight factor a decreases linearly from 2 to 0 as the number of iterations changes, and the hunting operation is:
[0028] According to the gray wolf population offspring, calculate the value X of all N gray wolf individuals i , forming a candidatePos population representing the candidate task scheduling scheme encoding, where i∈(1,2,3,……,N), the X i The calculation methods include:
[0029] S5401, using a random generation function to generate two random numbers r1 and r2 between [0,1] respectively;
[0030] S5402, using A1=2ar1-a, C1=2r2, calculate the coordination coefficients A1 and C1 of the gray wolf algorithm in the encirclement prey phase α;
[0031] S5403, using formula D α =|C1·X α -X|Calculate the distance between the candidate gray wolf of the i-th dimension of the current offspring population and the gray wolf of the i-th dimension of the α population, where X represents the value of the gray wolf of the i-th dimension of the offspring population, X α represents the value of the gray wolf in the i-th dimension of the α population;
[0032] S5404, using the formula X1 = X α -A1·D α Calculate the candidate solution position X1 of the prey around α;
[0033] S5405, using a random generation function to generate two random numbers r1 and r2 between [0,1] respectively;
[0034] S5406, using A2=2ar1-a, C2=2r2, calculate the coordination coefficients A2 and C2 of the gray wolf algorithm in the encirclement prey phase β;
[0035] S5407, using formula D β =|C2·X β -X|Calculate the distance between the i-th candidate gray wolf in the current offspring population and the i-th gray wolf in the β population, where X represents the value of the i-th gray wolf in the offspring population, X β represents the value of the gray wolf in the i-th dimension of the β population;
[0036] S5408, using the formula X2=X β -A2·D β Calculate the candidate solution position X2 of the prey around β;
[0037] S5409, using a random generation function to generate two random numbers r1 and r2 between [0,1] respectively;
[0038] S5410, using A3=2ar1-a, C3=2r2, calculate the coordination coefficients A3 and C3 of the gray wolf algorithm in the encirclement prey stage δ;
[0039] S5411, using formula D δ =|C3·X δ -X|Calculate the distance between the current i-th dimension candidate gray wolf and the i-th dimension gray wolf of the δ population, where X represents the value of the i-th dimension gray wolf of the offspring population, X δ represents the value of the gray wolf in the i-th dimension of the δ population;
[0040] S5412, using the formula X3 = X δ -A3·D δ , calculate the candidate solution position X3 of the prey around δ;
[0041] S5413, using formula X i =(X1+X2+X3) / 3, update the position value of the gray wolf of the offspring population in the i-th dimension;
[0042] S5414, using the rounding function to i Round the value to an integer between [1, M].
[0043] The present invention also proposes a device for implementing a method for scheduling cloud computing tasks based on a one-dimensional grey wolf algorithm. The device includes a memory and a processor. The memory stores at least one program. The at least one program is executed by the processor to implement the method for scheduling cloud computing tasks based on a one-dimensional grey wolf algorithm described above.
[0044] A computer-readable storage medium stores at least one program, and the at least one program is executed by a processor to implement the method for scheduling cloud computing tasks based on a one-dimensional grey wolf algorithm as described above.
[0045] The above technical solution has the following technical effects:
[0046] Aiming at the task scheduling problem in the cloud computing environment, the present invention uses the characteristic of spatial distribution isomorphism in the allocation mapping of tasks to virtual machines. The present invention provides a method for cloud computing task scheduling based on the one-dimensional gray wolf algorithm. By directly encoding the computing task scheduling in one-dimensional real numbers, each individual in the population represents the mapping of a certain task to a virtual machine, and all individuals together constitute a candidate feasible solution for the task scheduling scheme, thereby not only reducing the search space to 1 dimension, but also eliminating the hyperparameter setting of the population size; on the basis of the one-dimensional real number direct encoding mechanism, the gray wolf population with excellent fitness value is selected in combination with the greedy strategy, and the task scheduling scheme with the best global fitness value can be quickly and effectively searched, overcoming the defects of the poor precision of the gray wolf algorithm and the easy fall into the local optimum of the greedy algorithm. The present invention organically integrates the advantages of the high performance of the evolutionary algorithm and the high efficiency of the greedy algorithm, can effectively reduce the overall completion time of cloud computing tasks, optimize the allocation of cloud computing resources, and speed up the cloud computing speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 A schematic diagram of a process of a cloud computing task scheduling method based on a one-dimensional grey wolf algorithm according to an embodiment of the present invention;
[0048] Figure 2 A schematic diagram of a model of a method for scheduling cloud computing tasks based on a one-dimensional grey wolf algorithm according to an embodiment of the present invention;
[0049] Figure 3 A schematic diagram showing a comparison between one-dimensional real number coding and conventional coding of a gray wolf population in a method for scheduling cloud computing tasks based on a one-dimensional gray wolf algorithm according to an embodiment of the present invention;
[0050] Figure 4 A schematic diagram of a device for implementing a method for scheduling cloud computing tasks based on a one-dimensional grey wolf algorithm according to an embodiment of the present invention; DETAILED DESCRIPTION
[0051] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0052] The present invention will now be further described with reference to the accompanying drawings and specific implementation methods.
[0053] Embodiment 1:
[0054] Figure 1 The following is a flow chart of a method for scheduling cloud computing tasks based on a one-dimensional grey wolf algorithm according to an embodiment of the present invention. The specific method includes:
[0055] S1, determining that the problem to be solved in cloud computing task scheduling is: assigning N cloud computing tasks to M virtual machines so that the total completion time of the N cloud computing tasks is minimized, where N and M are both natural numbers, and where in the gray wolf algorithm, the combination of scheduling schemes for assigning each of the N cloud computing tasks to the corresponding virtual machine is constructed as a gray wolf population, and the size of the total gray wolf population is N;
[0056] Specifically, in the assumption of the cloud computing task scheduling problem: task scheduling in cloud computing refers to assigning or mapping tasks to specific virtual machines. Its purpose is to reasonably allocate the required resources for the tasks submitted by cloud computing users, thereby improving the resource utilization of the system and the operating efficiency of cloud computers. The scheduling result is generally reflected in the mapping relationship between tasks and virtual machine nodes, that is, determining which virtual machine node the task is executed on. Due to the heterogeneous diversity of tasks and virtual machine nodes, it is necessary to study how to assign cloud computing tasks to virtual machine nodes to obtain the shortest task completion time. Specifically, for a given cloud computing task, it is necessary to find the most suitable virtual machine to execute these tasks so as to minimize the task execution time. Here, the task execution time does not include the data transmission time.
[0057] For example, Figure 2 FIG. 1 is a schematic diagram of a model of a method for scheduling cloud computing tasks based on a one-dimensional grey wolf algorithm according to an embodiment of the present invention. For the convenience of research, the present invention makes the following assumptions: Figure 2 As shown:
[0058] (1) Without considering the influence of secondary factors such as communication delay, bandwidth, and data transmission between virtual machine nodes, the execution time of each task is equal to the length of the task divided by the execution speed of the virtual machine node where the task is located;
[0059] (2) The task is abstracted into the number of machine instructions, the unit is MI (million instructions) and the length is randomly selected within a certain range;
[0060] (3) All cloud computing resources are mapped to virtual machines, the performance unit of virtual machines is MIPS (million instructions per second) and the performance of virtual machines is selected within a certain range;
[0061] (4) Each task is independent of each other. When multiple tasks are assigned to the same virtual machine, they are executed on a first-in-first-out basis.
[0062] (5) The number of submitted tasks is greater than or equal to the number of virtual machines;
[0063] Based on the above assumptions, the cloud computing task scheduling problem can be described as: assigning N cloud computing tasks of different lengths to M virtual machines with different performances so that the total task completion time of these N cloud computing tasks is minimized.
[0064] S2, use one-dimensional real numbers to encode the gray wolf population and initialize the gray wolf population. In the gray wolf population, each gray wolf individual is a one-dimensional integer, representing a scheduling plan for one of the computing tasks to the virtual machine; specifically, first, use a random generation function to generate a population parent in which the number of gray wolf individuals is equal to the number of tasks. Parent is a variable, the dimension of each gray wolf individual in the population parent is 1, and the value range of the gray wolf individual is [1,M]; secondly, use the round function for the gray wolf individuals to round off to get the nearest integer value; thirdly, let the fitness values of the population codes α, β and δ corresponding to the three task scheduling plans representing the optimal fitness values be inf, where inf represents positive infinity, and the corresponding position codes alpha_pos, beta_pos and delta_pos are all set to 1xN all-zero vectors.
[0065] like Figure 3 It is a schematic diagram showing the comparison between the one-dimensional real number coding and the conventional coding of the gray wolf population in the cloud computing task scheduling method based on the one-dimensional gray wolf algorithm according to an embodiment of the present invention. Figure 3 In the conventional gray wolf algorithm, the scheduling scheme represented by the gray wolf individual is composed of N parameters, and all scheduling schemes constitute the total group of gray wolves including all gray wolf individuals. In the gray wolf algorithm of the embodiment of the present invention, the gray wolf individual scheduling scheme is a mapping of a task to a certain virtual machine, which is a one-dimensional integer.
[0066] For example, suppose there are N tasks and M virtual machine nodes. The position number of the gray wolf individual in the population represents the number of a task, and the value range is [1, N]. The positive integer value on each 1-dimensional gray wolf individual represents the number of the assigned virtual machine, and the value range is [1, M]. For example, let N = 8, M = 3, and the population code is (2, 3, 1, 3, 2, 3, 1, 1) T , indicating that the first and fifth tasks are scheduled to the second virtual machine, the second, fourth, and sixth tasks are scheduled to the third virtual machine, and the third, seventh, and eighth tasks are scheduled to the first virtual machine.
[0067] S3, taking the total completion time of N cloud computing tasks as the fitness function to calculate the fitness value of the scheduling scheme represented by all individuals in the gray wolf population. The fitness function is fobj = max(time i), i∈(1,2,3,……,M), where M is the number of virtual machines, time i It represents the total time taken to complete all cloud computing tasks on virtual machine i.
[0068] Specifically, in the embodiment of the present invention, the shortest total time to complete the cloud computing task is taken as the optimization goal, so the total time to complete the cloud computing task is used as the fitness function. The smaller the total time to complete the cloud computing task, the better the gray wolf population is. Therefore, the fitness function is set to fobj=max(time i ), i∈(1,2,3,……,M), where time i It represents the time taken to complete all cloud computing tasks on virtual machine i, and M is the number of virtual machines. The fitness of the population depends on the virtual machine node in the cloud that spends the most time processing all cloud tasks on it. In the present invention, the smaller the fitness value, the greater the evolutionary adaptability of the population. In other words, the smaller the total time to complete the cloud computing task, the better the population.
[0069] S4, determine whether the calculation result of the fitness value or the number of iterations meets the preset termination condition; if so, encode the population with the smallest fitness value at this time as the final cloud computing task scheduling solution and end the process; if not, execute step S5.
[0070] Specifically, the termination condition is the minimum threshold of acceptable task scheduling time for the cloud computing user group or the maximum number of iterations pre-set for the scheduling method; when the fitness value of a certain population reaches the minimum threshold of acceptable task scheduling time for the cloud user group, it is considered that it meets the termination condition, and the encoding of the population at this time is the final cloud computing task scheduling encoding scheme; or when the number of iterations reaches the pre-set maximum number of iterations, the encoding of the population with the lowest fitness is the final cloud computing task scheduling scheme.
[0071] Exemplarily, in this embodiment, according to the gray wolf algorithm, the population with the best fitness value is set to α, the population with the second best fitness value is set to β, and the population with the third best fitness value is set to δ. If the fitness value calculation result or the number of iterations meets the preset termination condition, the population with the smaller fitness value between the current parent population and the fitness value of α is used as the final cloud computing task scheduling plan.
[0072] S5, using the preset greedy strategy to update the random individuals in the current gray wolf population, including:
[0073] The population codes α, β and δ corresponding to the three scheduling schemes with the best fitness values are used to update the individuals in the population to generate the next generation of population. Then, the first gray wolf individual in the generated next generation of population is used to randomly update the mapping of selected task allocation in the original scheduling scheme, thereby realizing the organic integration of greedy algorithm and evolutionary algorithm.
[0074] Specifically, the steps to update the current population parent are:
[0075] S51, using the fitness function to calculate the fitness value of the current population parent;
[0076] S52, updating the fitness values of α, β and δ according to the fitness value of the population parent, and updating the corresponding population position codes alpha_pos, beta_pos and delta_pos respectively, so as to keep the fitness values of α, β and δ optimal;
[0077] S53, let the next generation population be offspring, and use the current parent population code to initialize the offspring population;
[0078] S54, using offspring, population size N, gray wolf individual value range, gray wolf algorithm weight factor a and the position codes of α, β and δ to perform gray wolf algorithm hunting operation, and generate position codes representing candidate task scheduling solutions, represented by candidatePos;
[0079] S55, using the first gray wolf individual value in the position code candidatePos of the candidate task scheduling scheme, greedily and randomly replace the mapping of a task allocation of the offspring population, generate a new candidate scheduling scheme, and assign it to the offspring;
[0080] Exemplarily, all the gray wolf individuals in candidatePos can be used to greedily and randomly replace the mapping of all task assignments in the offspring population at one time to obtain a new candidate scheduling solution and assign it to the offspring. At this time, all the individuals in the candidatePos population are greedily and randomly replaced with the offspring population at one time.
[0081] S56, using the fitness function formula to calculate the fitness value of the candidate task scheduling scheme offspring, if the obtained fitness value is less than the fitness value of the parent population, then using offspring to update the parent population and its fitness value, otherwise no operation is performed;
[0082] S57, determine whether candidatePos is empty, if yes, end this process; if no, return to step S55. Exemplarily, this process of updating the random individuals of the parent population can be done only once without looping.
[0083] Specifically, the hunting operation S54 is: for the gray wolf population offspring, calculate the value X of all N gray wolf individuals i , we can get the candidatePos population representing the candidate task scheduling scheme encoding, where i∈(1,2,3,…,N), and the weight factor a decreases linearly from 2 to 0 as the number of iterations changes. i The calculation methods include:
[0084] S5401, using a random generation function to generate two random numbers r1 and r2 between [0,1] respectively;
[0085] S5402, using A1=2ar1-a, C1=2r2, calculate the coordination coefficients A1 and C1 of the gray wolf algorithm in the encirclement prey phase α;
[0086] S5403, using formula D α =|C1·X α -X|Calculate the distance between the current i-th dimension candidate gray wolf and the i-th dimension gray wolf of the α population, where X represents the position value of the i-th dimension gray wolf of the offspring population, X α represents the value of the i-th dimension of the α population;
[0087] S5404, using the formula X1 = X α -A1·D α Calculate the candidate solution position X1 of the prey around α;
[0088] S5405, using a random generation function to generate two random numbers r1 and r2 between [0,1] respectively;
[0089] S5406, using A2=2ar1-a, C2=2r2, calculate the coordination coefficients A2 and C2 of the gray wolf algorithm in the encirclement prey phase β;
[0090] S5407, using formula D β =|C2·X β -X|Calculate the distance between the current i-th dimension candidate gray wolf and the i-th dimension gray wolf of the β population, where X represents the position value of the i-th dimension gray wolf of the offspring population, X β represents the value of the i-th dimension of the β population;
[0091] S5408, using the formula X2=X β -A2·Dβ Calculate the candidate solution position X2 of the prey around β;
[0092] S5409, using a random generation function to generate two random numbers r1 and r2 between [0,1] respectively;
[0093] S5410, using A3=2ar1-a, C3=2r2, calculate the coordination coefficients A3 and C3 of the gray wolf algorithm in the encirclement prey stage δ;
[0094] S5411, using formula D δ =|C3·X δ -X|Calculate the distance between the current i-th dimension candidate gray wolf and the i-th dimension gray wolf of the δ population, where X represents the position value of the i-th dimension gray wolf of the offspring population, X δ represents the value of the i-th dimension of the δ population;
[0095] S5412, using the formula X3 = X δ -A3·D δ , calculate the candidate solution position X3 of the prey around δ;
[0096] S5413, using formula X i =(X1+X2+X3) / 3, update the position value of the gray wolf in dimension i;
[0097] S5414, using the rounding function to i Round the value to an integer between [1, M].
[0098] S6, calculate the fitness value of the scheduling scheme represented by the updated population code, and repeat steps S4-S6.
[0099] Taking advantage of the spatial distribution isomorphism of the mapping of tasks to virtual machines, the embodiment of the present invention provides a method for cloud task scheduling based on a one-dimensional gray wolf algorithm. By directly encoding the task scheduling with one-dimensional real numbers, each individual in the population represents a mapping of a certain task to a virtual machine, and all individuals together constitute a candidate feasible solution for the task scheduling scheme, thereby not only reducing the search space to 1 dimension, but also eliminating the hyperparameter setting of the population size; further, a greedy algorithm is used to assign and update the population updated in the gray wolf algorithm until the end condition is met, and the cloud scheduling scheme with the smallest population fitness value is obtained as the final cloud computing task scheduling scheme. Combined with the greedy strategy, the gray wolf population with excellent fitness value is selected, and the task scheduling scheme with the optimal global fitness value can be searched quickly and effectively, overcoming the defects of the poor precision of the gray wolf algorithm and the easy fall into the local optimum of the greedy algorithm. The present invention combines the advantages of the high performance of the evolutionary algorithm and the high efficiency of the greedy algorithm, optimizes the cloud computing task scheduling scheme, reduces the total running time of the cloud computing task, and greatly improves the computing efficiency of cloud computing when the virtual machine resources are limited and a large number of tasks are scheduled at one time.
[0100] Embodiment 2:
[0101] The present invention also provides a schematic diagram of a device for implementing a method for scheduling cloud computing tasks based on a one-dimensional grey wolf algorithm, such as Figure 4 As shown, the device includes a processor 401, a memory 402, a bus 403, and a computer program stored in the memory 402 and executable on the processor 401. The processor 401 includes one or more processing cores. The memory 402 is connected to the processor 401 via the bus 403. The memory 402 is used to store program instructions. When the processor executes the computer program, the steps in the above method embodiment of the first embodiment of the present invention are implemented.
[0102] Further, as an executable solution, the device for implementing the method for scheduling cloud computing tasks based on the one-dimensional gray wolf algorithm can be a computer unit, and the computer unit can be a computing device such as a desktop computer, a notebook, a handheld computer, and a cloud server. The computer unit may include, but is not limited to, a processor and a memory. Those skilled in the art will understand that the composition structure of the above-mentioned computer unit is only an example of a computer unit and does not constitute a limitation on the computer unit, and may include more or less components than the above, or combine certain components, or different components. For example, the computer unit may also include input and output devices, network access devices, buses, etc., which are not limited in the embodiments of the present invention.
[0103] Further, as an executable solution, the processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the computer unit, and various interfaces and lines are used to connect the various parts of the entire computer unit.
[0104] The memory can be used to store the computer program and / or module, and the processor realizes various functions of the computer unit by running or executing the computer program and / or module stored in the memory, and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system and at least one application required for a function; the data storage area can store data created according to the use of the mobile phone, etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0105] Embodiment three:
[0106] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above method in the embodiment of the present invention are implemented.
[0107] If the module / unit integrated in the computer unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory) and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction.
[0108] Although the present invention has been specifically shown and described in conjunction with the preferred embodiments, it should be understood by those skilled in the art that various changes may be made to the present invention in form and details without departing from the spirit and scope of the present invention as defined by the appended claims, all of which are within the scope of protection of the present invention.
Claims
1. A method for scheduling cloud computing tasks based on a one-dimensional grey wolf algorithm, characterized in that: include: S1, determining that the problem to be solved in cloud computing task scheduling is: assigning N cloud computing tasks to M virtual machines so that the total completion time of the N cloud computing tasks is minimized, where N and M are both natural numbers, and where in the gray wolf algorithm, a combination of scheduling schemes for assigning each of the N cloud computing tasks to a corresponding virtual machine is constructed as a gray wolf population, and the size of the total gray wolf population is N; S2, using a one-dimensional real number to encode the gray wolf population and initialize the gray wolf population, wherein each gray wolf individual in the gray wolf population is a one-dimensional integer, representing a scheduling scheme of a computing task to a virtual machine; S3, using the total completion time of the N cloud computing tasks as a fitness function to calculate the fitness values of the scheduling schemes represented by all individuals in the gray wolf population; S4, determining whether the calculated fitness value or the number of iterations meets the preset termination condition; if so, taking the population code with the smallest fitness value at this time as the final cloud computing task scheduling scheme for the N cloud computing tasks, and ending the process; if not, executing step S5; S5, using the preset greedy strategy to update the random individuals in the current gray wolf population; S6, calculating the fitness value of the scheduling scheme represented by the updated population code, and repeating steps S4-S6; The initialization step of step S2 includes: S21, using a random generation function to generate a population parent in which the number of gray wolf individuals is equal to the number of tasks, where parent is a variable, the dimension of each gray wolf individual in the population parent is 1, and the value range of the gray wolf individual is [1, M]; S22, applying a rounding function to the individual gray wolf to obtain a neighboring integer value; S23, setting the fitness values of the population codes α, β and δ corresponding to the three task scheduling schemes representing the best fitness values to inf, where inf represents positive infinity, and setting the position codes alpha_pos, beta_pos and delta_pos corresponding to the population codes α, β and δ to 1xN all-zero vectors; The fitness function is used to calculate the evolutionary adaptability of the population, and the fitness function is fobj = max(time i ), i∈(1,2,3,……,M), where M is the number of virtual machines, time i represents the total time used to complete all cloud computing tasks on virtual machine i; The step of updating the selected individuals in the current population in step S5 is as follows: using the population codes α, β and δ corresponding to the three scheduling schemes with the best fitness values to update the individuals in the population, generate the next generation population, and then use the first gray wolf individual in the generated next generation population to randomly update the virtual machine mapping assigned to the selected task in the original scheduling scheme; Among them, step S5 is the step of updating the random individuals in the current population: S51, using the fitness function to calculate the fitness value of the current population parent; S52, updating the fitness values of α, β and δ according to the fitness value of the population parent, and updating the corresponding population position codes alpha_pos, beta_pos and delta_pos respectively; S53, setting the next generation population as offspring, and initializing the offspring population using the population code of the current parent; S54, performing a gray wolf algorithm hunting operation using the offspring, the population size N, the gray wolf individual value range, the gray wolf algorithm weight factor a, and the position codes of α, β, and δ to generate a position code representing a candidate task scheduling solution, represented by candidatePos; S55, using the value of the first gray wolf individual in the position code candidatePos of the candidate task scheduling scheme, greedily replace the mapping of the randomly selected task allocation of the offspring population, generate a new candidate scheduling scheme, assign it to the offspring, and delete the first gray wolf individual in the candidatePos population; S56, using the fitness function formula to calculate the fitness value of the candidate task scheduling scheme offspring, if the obtained fitness value is less than the fitness value of the parent population, then using offspring to update the parent population and its fitness value, otherwise no operation is performed; S57, determine whether candidatePos is empty, if so, end this process; if not, return to step S55.
2. The method according to claim 1, characterized in that In step S54, the weight factor a decreases linearly from 2 to 0 as the number of iterations changes. The hunting operation is: According to the gray wolf population offspring, calculate the value X of all N gray wolf individuals i , forming a candidatePos population representing the candidate task scheduling scheme encoding, where i∈(1,2,3,……,N), the X i The calculation methods include: S5401, using a random generation function to generate two random numbers r1 and r2 between [0,1] respectively; S5402, using A1=2ar1-a, C1=2r2, calculate the coordination coefficients A1 and C1 of the gray wolf algorithm in the encirclement prey phase α; S5403, using formula D α =|C1·X α -X|Calculate the distance between the candidate gray wolf of the i-th dimension of the current offspring population and the gray wolf of the i-th dimension of the α population, where X represents the value of the gray wolf of the i-th dimension of the offspring population, X α represents the value of the gray wolf in the i-th dimension of the α population; S5404, using the formula X1 = X α -A1·D α Calculate the candidate solution position X1 of the prey around α; S5405, using a random generation function to generate two random numbers r1 and r2 between [0,1] respectively; S5406, using A2=2ar1-a, C2=2r2, calculate the coordination coefficients A2 and C2 of the gray wolf algorithm in the encirclement prey phase β; S5407, using formula D β =|C2·X β -X|Calculate the distance between the candidate gray wolf of the i-th dimension of the current offspring population and the gray wolf of the i-th dimension of the β population, where X represents the value of the gray wolf of the i-th dimension of the offspring population, X β represents the value of the gray wolf in the i-th dimension of the β population; S5408, using the formula X2=X β -A2·D β Calculate the candidate solution position X2 of the prey around β; S5409, using a random generation function to generate two random numbers r1 and r2 between [0,1] respectively; S5410, using A3=2ar1-a, C3=2r2, calculate the coordination coefficients A3 and C3 of the gray wolf algorithm in the encirclement prey stage δ; S5411, using formula D δ =|C3·X δ -X|Calculate the distance between the current i-th dimension candidate gray wolf and the i-th dimension gray wolf of the δ population, where X represents the value of the i-th dimension gray wolf of the offspring population, X δ represents the value of the gray wolf in the i-th dimension of the δ population; S5412, using the formula X3 = X δ -A3·D δ , calculate the candidate solution position X3 of the prey around δ; S5413, using formula X i =(X1+X2+X3) / 3, update the position value of the gray wolf of the offspring population in the i-dimensional; S5414, using the rounding function to i Round the value to an integer between [1, M].
3. A device for implementing a method for scheduling cloud computing tasks based on a one-dimensional grey wolf algorithm, characterized in that: The device includes a memory and a processor, the memory stores at least one program, and the at least one program is executed by the processor to implement the method for cloud computing task scheduling based on the one-dimensional grey wolf algorithm as described in any one of claims 1 to 2.
4. A computer-readable storage medium, characterized in that: The storage medium stores at least one program, and the at least one program is executed by the processor to implement the method for cloud computing task scheduling based on the one-dimensional grey wolf algorithm as described in any one of claims 1 to 2.
