Task scheduling method and device, storage medium and electronic equipment

By generating the honey source matrix and scheduling matrix, using a random sequence and the first random number to determine the candidate honey source, update the target honey source, and determine the selected honey source based on the honey source probability value, and finally schedule the target job to be executed in the target virtual machine, solving the problem of low resource scheduling efficiency in the existing technology and achieving more efficient resource scheduling.

CN120045323APending Publication Date: 2025-05-27JINAN INSPUR DATA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510120971.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-24
Publication Date
2025-05-27

AI Technical Summary

Technical Problem

In the prior art, resource scheduling efficiency is low, and artificial bee colony algorithms have the disadvantages of slow convergence speed and easy to fall into local optimality.

Method used

By generating the honey source matrix and the scheduling matrix, the candidate honey source is determined using a random sequence and the first random number, the target honey source is updated, and the selected honey source is determined based on the honey source probability value, and the target job is finally scheduled to the target virtual machine for execution.

Benefits of technology

The resource scheduling efficiency is improved, the problem of initial solution gathering near the local optimal solution is avoided, the ability to explore global optimal solutions is enhanced, and the efficiency and effect of resource scheduling is ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120045323A_ABST
    Figure CN120045323A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a task scheduling method and device, a storage medium and electronic equipment, and the method comprises the steps: generating a nectar source matrix based on a received job list and a virtual machine list; generating a scheduling matrix based on the random sequence; target operation is executed for each target nectar source included in the scheduling matrix so as to determine candidate nectar sources of the target nectar sources, multiple candidate nectar sources are obtained, and the target operation comprises the steps that the candidate nectar sources of the target nectar sources are determined based on the first random number and the target nectar sources; updating the target nectar source based on the candidate nectar source to obtain an updated nectar source; determining a selected nectar source based on the updated nectar source; and based on the target position of the selected nectar source in the scheduling matrix, scheduling a target job corresponding to the target position to a target virtual machine corresponding to the target position for execution. Through the resource scheduling method and device, the problem of low resource scheduling efficiency is solved, and the effect of improving the resource scheduling efficiency is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computers. Specifically, the embodiments of the present application relate to a task scheduling method, apparatus, storage medium, and electronic device. Background Art

[0002] In the related art, the artificial bee colony algorithm is usually used for resource scheduling. However, the artificial bee colony algorithm has disadvantages such as slow convergence speed and easy to fall into local optimum, resulting in low resource scheduling efficiency.

[0003] It can be seen that there is a problem of low resource scheduling efficiency in the related art.

[0004] In view of the above problems in the related art, no effective solution has been proposed yet. Summary of the Invention

[0005] The embodiments of the present application provide a task scheduling method, apparatus, storage medium, and electronic device to at least solve the problem of low resource scheduling efficiency in the related art.

[0006] According to an embodiment of the present application, a task scheduling method is provided, including: generating a nectar source matrix based on a received job list and a virtual machine list, where the job list includes jobs to be executed by virtual machines included in the virtual machine list, and the element in the nth row and mth column of the nectar source matrix represents the execution time required for the nth virtual machine included in the virtual machine list to execute the mth job included in the job list; generating a scheduling matrix based on a random sequence; performing a target operation on each target nectar source included in the scheduling matrix to determine a candidate nectar source of the target nectar source, and obtaining a plurality of candidate nectar sources, where the target nectar source is any nectar source included in the scheduling matrix, and the target operation includes: determining the candidate nectar source of the target nectar source based on a first random number and the target nectar source; updating the target nectar source based on the candidate nectar source to obtain an updated nectar source, where the updated nectar source includes the updated target nectar source and the reserved target nectar source; determining an elected nectar source based on the updated nectar source; and scheduling the target job corresponding to the target position in the scheduling matrix to the target virtual machine corresponding to the target position for execution.

[0007] In an exemplary embodiment, determining the candidate nectar source based on the first random number and the target nectar source includes: determining a first difference between the target nectar source and the neighboring nectar sources of the target nectar source; a first product of the first random number and the first difference; determining a first sum value of the first product and the target nectar source; determining the floor value of the first sum value; in the case where the floor value is greater than a first constant, determining the first constant as the candidate nectar source; in the case where the floor value is less than a second constant, determining the second constant as the candidate nectar source.

[0008] In an exemplary embodiment, updating the target nectar source based on the candidate nectar source includes: determining a first benefit value of each candidate nectar source; in the case where the first benefit value is greater than a second benefit value of the target nectar source, retaining the target nectar source; in the case where the first benefit value is less than the second benefit value of the target nectar source, updating the target nectar source to the candidate nectar source.

[0009] In an exemplary embodiment, determining the elected nectar source based on the updated nectar source includes: determining a nectar source probability value of the updated nectar source; determining a target updated nectar source of the target quantity included in the updated nectar source based on the nectar source probability value, where the nectar source probability value of the target updated nectar source is greater than the nectar source probability values of other nectar sources included in the updated nectar source, and the other nectar sources are the nectar sources included in the updated nectar source except the target updated nectar source; determining the elected nectar source based on the target updated nectar source.

[0010] In an exemplary embodiment, determining the nectar source probability value of the updated nectar source includes: determining the reciprocal of the third benefit value of each updated nectar source to obtain a plurality of first reciprocals; determining a second sum value of the plurality of first reciprocals; for each updated sub-nectar source included in the updated nectar source, performing the following operations to determine the nectar source probability value of the updated sub-nectar source, where the updated sub-nectar source is any one of the nectar sources included in the updated nectar source: determining the second reciprocal of the third benefit value of the updated sub-nectar source; determining the ratio of the second reciprocal to the second sum value as the nectar source probability value.

[0011] In an exemplary embodiment, determining the elected nectar source based on the target updated nectar source includes: randomly generating a second random number within a preset range; randomly determining a target sub-updated nectar source from the target updated nectar source; when the second random number is less than the nectar source probability value corresponding to the target sub-updated nectar source, performing the target operation on the target sub-updated nectar source to determine a candidate nectar source; updating the target sub-updated nectar source based on the candidate nectar source; determining the elected nectar source from the updated candidate nectar source; determining the elected nectar source based on the updated nectar source; when the second random number is greater than or equal to the nectar source probability value corresponding to the target sub-updated nectar source, determining the target sub-updated nectar source as the elected nectar source.

[0012] In an exemplary embodiment, generating a scheduling matrix based on a random sequence includes: mapping the values included in the random sequence into a matrix to obtain the scheduling matrix; wherein, the random sequence is generated by performing the following operations for each first position included in the sequence to obtain a first value for the first position, and determining the sequence with the first values for each first position determined as the random sequence, where the first position is any position included in the random sequence: when there is a second position adjacent to and before the first position in the random sequence, determining a second value of the second position included in the random sequence; determining a second product of the second value and a control parameter; determining a second difference between a third constant and the first value; determining a third product of the second difference and the second product; when the third product is greater than or equal to a fourth constant, updating the third product to a fifth constant; when the third product is less than the fourth constant, updating the third product to a sixth constant; determining the updated third product as the first value of the first position; when there is no second position adjacent to and before the first position in the random sequence, determining the first value of the first position as a random parameter.

[0013] According to another embodiment of the present application, a task scheduling device is provided, including: a first generation module, configured to generate a honeypot matrix based on a received job list and a virtual machine list, where the job list includes jobs to be executed by virtual machines included in the virtual machine list, and the element in the n-th row and m-th column of the honeypot matrix represents the execution time required for the n-th virtual machine included in the virtual machine list to execute the m-th job included in the job list; a second generation module, configured to generate a scheduling matrix based on a random sequence; an execution module, configured to perform a target operation for each target honeypot included in the scheduling matrix to determine a candidate honeypot for the target honeypot, and obtain a plurality of the candidate honeypots, where the target honeypot is any honeypot included in the scheduling matrix, and the target operation includes: determining the candidate honeypot for the target honeypot based on a first random number and the target honeypot; an update module, configured to update the target honeypot based on the candidate honeypot to obtain an updated honeypot, where the updated honeypot includes the updated target honeypot and the reserved target honeypot; a determination module, configured to determine an elected honeypot based on the updated honeypot; a scheduling module, configured to schedule the target job corresponding to the target position in the scheduling matrix to be executed in the target virtual machine corresponding to the target position based on the target position of the elected honeypot in the scheduling matrix.

[0014] According to yet another embodiment of the present application, a computer-readable storage medium is further provided, where a computer program is stored in the computer-readable storage medium, and the computer program is configured to execute the steps in any one of the above method embodiments when running.

[0015] According to yet another embodiment of the present application, an electronic device is further provided, including a memory and a processor, where a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0016] According to yet another embodiment of the present application, a computer program product is further provided, including a computer program, and the computer program implements the steps in any one of the above method embodiments when executed by a processor.

[0017] Through this application, a honeypot matrix can be generated according to the job list of the virtual machine jobs to be executed and the virtual machine list received. Among them, the nth row and the mth column of the honeypot matrix can represent the execution time required for the nth virtual machine to execute the mth job. After the honeypot matrix is established, a scheduling matrix generated by a random sequence can be used to display the current scheduling scheme. For any target honeypot in the scheduling matrix, a candidate honeypot can be determined through the first random number and the target honeypot. After the candidate honeypot is determined, the target honeypot can be updated through the candidate honeypot to obtain an updated honeypot, that is, the updated honeypot can include the target honeypot that has been updated and the original target honeypot to be retained after the update. After the updated honeypot is determined, the elected honeypot and the target position of the elected honeypot in the scheduling matrix can be determined through the updated honeypot, and then the target job can be scheduled to the target virtual machine corresponding to the target position, so that the target virtual machine executes the target job. Since the scheduling matrix is generated by a random sequence, the problem that the initial solution aggregates near a certain local optimal solution is avoided, the population distribution can be made more uniform, and thus the global optimal solution can be explored better. In addition, determining the candidate honeypot through the first random number and the target honeypot can make the execution time of the tasks corresponding to the selected honeypot as small as possible. Therefore, the problem of low resource scheduling efficiency in the related art can be solved, and the effect of improving the resource scheduling efficiency can be achieved. Description of the Drawings

[0018] Figure 1 is a hardware structure block diagram of a server device for a task scheduling method according to an embodiment of the present application;

[0019] Figure 2 is a flowchart of a task scheduling method according to an embodiment of the present application;

[0020] Figure 3 is a flowchart of a task scheduling method according to a specific embodiment of the present application;

[0021] Figure 4 is a block diagram of the structure of a task scheduling device according to an embodiment of the present application. Detailed Embodiments

[0022] In the following, embodiments of the present application will be described in detail with reference to the drawings and in conjunction with the embodiments.

[0023] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above drawings are used to distinguish similar objects, and do not necessarily need to describe a specific order or sequence.

[0024] The method embodiments provided in the embodiments of the present application can be executed on a server device or a similar computing device. Taking running on a server device as an example, Figure 1It is a hardware block diagram of a server device for a task scheduling method according to an embodiment of the present application. As Figure 1 shown, the server device may include one or more ( Figure 1 only one is shown in the figure) processors 102 (the processor 102 may include, but is not limited to, processing devices such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. Among them, the above server device may further include a transmission device 106 for communication functions and an input / output device 108. Those of ordinary skill in the art can understand that Figure 1 the structure shown is only schematic and does not limit the structure of the above server device. For example, the server device may further include more or fewer components than Figure 1 shown in the figure, or have a different configuration from Figure 1 shown in the figure.

[0025] The memory 104 can be used to store computer programs. For example, software programs and modules of application software, such as the computer program corresponding to the task scheduling method in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, implements the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some instances, the memory 104 may further include a memory remotely set relative to the processor 102, and these remote memories can be connected to the server device through a network. Examples of the above network include, but are not limited to, the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.

[0026] The transmission device 106 is used to receive or send data via a network. Specific examples of the above network may include a wireless network provided by a communication provider of the server device. In one instance, the transmission device 106 includes a network adapter (Network Interface Controller, abbreviated as NIC), which can be connected to other network devices through a base station and thus can communicate with the Internet. In one instance, the transmission device 106 may be a radio frequency (Radio Frequency, abbreviated as RF) module, which is used to communicate with the Internet wirelessly.

[0027] In this embodiment, a task scheduling method is provided. Figure 2 It is a flowchart of the task scheduling method according to an embodiment of the present application. As Figure 2 shown, the process includes the following steps:

[0028] Step S202: Generate a honeypot matrix based on the received job list and virtual machine list. Among them, the job list includes the jobs to be executed by the virtual machines included in the virtual machine list. The element in the n-th row and m-th column of the honeypot matrix represents the execution time required for the n-th virtual machine included in the virtual machine list to execute the m-th job included in the job list.

[0029] Step S204: Generate a scheduling matrix based on a random sequence.

[0030] Step S206: Perform a target operation on each target honeypot included in the scheduling matrix to determine the candidate honeypots for the target honeypot, obtaining multiple candidate honeypots. Among them, the target honeypot is any honeypot included in the scheduling matrix, and the target operation includes: determining the candidate honeypot for the target honeypot based on a first random number and the target honeypot.

[0031] Step S208: Update the target honeypot based on the candidate honeypots to obtain updated honeypots, where the updated honeypots include the updated target honeypots and the retained target honeypots.

[0032] Step S210: Determine the elected honeypots based on the updated honeypots.

[0033] Step S212: Based on the target position of the elected honeypot in the scheduling matrix, schedule the target job corresponding to the target position to the target virtual machine corresponding to the target position for execution.

[0034] In the above embodiments, within the cloud computing resource platform, in order to symbolize and formulate the job scheduling process and sort out and analyze its scheduling objectives, the job scheduling process can be abstracted, which may include the following steps: user job submission, collection and processing of resource information required for the job, algorithm for formulating a scheduling plan, execution of the scheduling, and return of the execution result. Among them, a series of independent jobs can be submitted by the user to a single control center (scheduler) for centralized scheduling at the same moment. The scheduler can allocate the jobs to different executors (i.e., the above-mentioned target virtual machines) according to the scheduling scheme and wait to be executed. Among them, the target virtual machine is single-core, that is, the target virtual machine cannot utilize redundant processors to execute other jobs. Therefore, the target virtual machine resources can adopt a time-sharing exclusive mechanism, and only one job is executed on each target virtual machine at any moment. The target virtual machine group and the host group are both within the same data center and adopt a good topology structure, which can make the communication time between target virtual machines and between the main control unit and the target virtual machine almost zero. In the later scheduling optimization, the internal communication time and the resulting energy consumption can be ignored. In addition, at the stage of user job submission, all target virtual machines have been created and accurately placed on the corresponding hosts and instantiated and run on the hosts. Therefore, the impact of the migration strategy on job execution can be ignored.

[0035] In the above embodiments, when the scheduling algorithm makes scheduling analysis and decisions, the job queue is known, that is, all job information to be scheduled can be obtained, such as the number of jobs waiting for scheduling, job length (the time required to execute the job), job type, etc. The jobs submitted by the user can be divided into non-divisible jobs with the smallest granularity, which are independent of each other and have no dependencies. The resource amounts required by each job are known and do not exceed the resources contained in any one target virtual machine in the platform. Since all the jobs statically submitted by the user at the same moment are in large quantities and the number of jobs is much larger than the number of target virtual machines, all jobs can be aggregated into a job list Job List. Given the length and number of jobs in the known job list, the scheduler can make a global scheduling plan according to the job information and virtual machine information and allocate the jobs to different target virtual machines. In addition, the jobs are set to be executed non-preemptively, that is, after a job enters the waiting queue of a target virtual machine, the job must wait for all the previous jobs to be executed before it can be executed.

[0036] In the above embodiments, the artificial bee colony algorithm mainly selects the optimal nectar source in the value range of a continuous function. It can randomly combine two adjacent nectar sources in the continuous domain, or select excellent nectar sources for pheromone-sensitivity cross-selection to obtain nectar sources. However, for the job scheduling problem, the execution of jobs on virtual machines is a finite set, and the original nectar source selection and exchange strategies are not applicable to the discrete environment of job scheduling. Therefore, the method of using a nectar source matrix instead of the value range can be adopted, which can be determined by the number of virtual machines (i.e., the above virtual machine list) and the number of submitted jobs (i.e., the above job list). Among them, the number of rows of the nectar source matrix can represent the number of virtual machines m, and the number of columns can represent the number of jobs m. As shown in the nectar source matrix N in Table 1, each point can represent a certain job T j The expected benefit value b(T i executed on a certain virtual machine V j , V i ). The magnitude of the benefit value b(T j , V i ) can be used to measure the job execution time. That is, the nth row and mth column of the nectar source matrix can represent the execution time required for the nth virtual machine to execute the mth job, which can be expressed by the following formula: where length(T j ) can be understood as the time required to execute job T j , and V(V i ) can be understood as the execution speed of virtual machine V i . Then the ultimate goal of job scheduling can be understood as minimizing the comprehensive task execution time, that is where the artificial bee colony algorithm can be divided into the following four steps: Initialization stage: Determine basic parameters such as population size and solution space dimension, and randomly generate the initial food source position through a specific formula. Employed bee stage: Each employed bee corresponds to a food source, searches for a new food source position in the neighborhood according to the search equation, and determines whether to update the original food source position according to the fitness value. Observation bee stage: Observation bees probabilistically select to follow the food source corresponding to a certain employed bee through the roulette method according to the information transmitted by the employed bees, and then transform into employed bees to continue mining. Scout bee stage: If a food source is not updated after multiple neighborhood searches, the scout bee will randomly generate a new food source according to the formula. By continuously iterating these stages, the artificial bee colony algorithm attempts to find the optimal food source position, that is, the optimal solution, in the solution space to solve optimization problems such as cloud resource scheduling problems and achieve the goal of minimizing the task completion time.

[0037] Table 1 Nectar source matrix N

[0038]

[0039] In the above embodiments, after establishing the nectar source matrix, a scheduling matrix can be generated through a random sequence. Any nectar source in the scheduling matrix can be the target nectar source. The corresponding candidate nectar source can be determined by the first random number and the target nectar source, and the candidate nectar source can be used to update the target nectar source, that is, the updated nectar source can be obtained by comparing the benefit value of the candidate nectar source with the benefit value of the target nectar source. Among them, the updated nectar source can include the new target nectar source after update, and can also include the original target nectar source retained after update. After obtaining the updated nectar source, the final elected nectar source and the target position of the elected nectar source in the scheduling matrix can be determined according to the updated nectar source, and the target job can be scheduled to the target virtual machine corresponding to the target position, so that the target virtual machine can execute the target job with the highest efficiency.

[0040] Through the present application, a nectar source matrix can be generated according to the job list of the virtual machine to be executed and the virtual machine list received. Among them, the nth row and the mth column of the nectar source matrix can represent the execution time required for the nth virtual machine to execute the mth job. After the nectar source matrix is established, the scheduling matrix generated by the random sequence can be used to display the current scheduling scheme. For any target nectar source in the scheduling matrix, the candidate nectar source can be determined by the first random number and the target nectar source. After determining the candidate nectar source, the target nectar source can also be updated through the candidate nectar source to obtain the updated nectar source, that is, the updated nectar source can include the target nectar source that has been updated and the original target nectar source to be retained after update. After determining the updated nectar source, the elected nectar source and the target position of the elected nectar source in the scheduling matrix can be determined through the updated nectar source, and the target job can be scheduled to the target virtual machine corresponding to the target position, so that the target virtual machine executes the target job. Since the scheduling matrix is generated by a random sequence, the problem that the initial solution aggregates near a certain local optimal solution is avoided, the population distribution can be made more uniform, and thus the global optimal solution can be explored better. In addition, determining the candidate nectar source by the first random number and the target nectar source can make the execution time of the task corresponding to the selected nectar source as small as possible. Therefore, the problem of low resource scheduling efficiency in the related art can be solved, and the effect of improving the resource scheduling efficiency can be achieved.

[0041] Among them, the execution subject of the above steps can be a scheduler, or any device with a scheduling function, but not limited thereto.

[0042] In an exemplary embodiment, determining the candidate nectar source based on the first random number and the target nectar source includes: determining a first difference between the target nectar source and the neighboring nectar sources of the target nectar source; a first product of the first random number and the first difference; determining a first sum value of the first product and the target nectar source; determining the floor value of the first sum value; in the case where the floor value is greater than a first constant, determining the first constant as the candidate nectar source; in the case where the floor value is less than a second constant, determining the second constant as the candidate nectar source.

[0043] In the above embodiment, the traditional artificial bee colony algorithm may include an employed bee stage, that is, each employed bee corresponds to a food source, searches for a new food source position in the neighborhood according to the search equation, and determines whether to update the original food source position according to the fitness value. Since the cloud computing scheduling problem belongs to the 0-1 knapsack problem, it can be understood as a binary optimization problem, and the value of the target nectar source x ij is either 0 or 1. Therefore, the employed bee can find a new nectar source (i.e., the above candidate nectar source) through a discretized formula: where x kj can be understood as the neighboring nectar source, and k is not equal to i; can be understood as the first random number, which can randomly take values between [-1, 1]. After obtaining the candidate nectar source, the greedy algorithm can be used to compare the fitness values of the candidate nectar source and the target nectar source, and select the better one. In addition, considering that the value of the target nectar source x ij is either 0 or 1, the above formula can be modified as follows: where can be understood as the floor function, that is, can be understood as the floor value of the first sum value. If then If then where is the integer part of. Since can only take values of 0 or 1, when is not 0 or 1, it can be made such that that is, when the floor value is greater than the first constant 1, can be determined as the candidate nectar source; when the floor value is less than the second constant 0, can be determined as the candidate nectar source.

[0044] In the above embodiments, the artificial bee colony algorithm mainly searches in a continuous space, while the cloud computing scheduling problem can be regarded as a discrete optimization problem. By introducing a binary coding method to solve the cloud computing scheduling problem and using a binary artificial bee colony algorithm, the algorithm can directly handle discrete optimization problems. By calculating the difference between the target nectar source and the neighboring nectar sources and multiplying it by a random number, it helps the algorithm to explore the solution space with a finer granularity during the search process, increases the local search ability of the algorithm, and helps to jump out of the local optimal solution. Through floor processing and setting thresholds, it can ensure that the generated candidate nectar sources are within a reasonable range, avoid unrealistic resource allocation schemes, and improve the practicality of the algorithm.

[0045] In an exemplary embodiment, updating the target nectar source based on the candidate nectar sources includes: determining a first benefit value of each candidate nectar source; retaining the target nectar source when the first benefit value is greater than the second benefit value of the target nectar source; and updating the target nectar source to the candidate nectar source when the first benefit value is less than the second benefit value of the target nectar source.

[0046] In the above embodiments, after determining the candidate nectar sources it is possible to calculate the first benefit value of the candidate nectar sources and the second benefit value f(x ij ) of the target nectar source. If it is possible to set the nectar source parameter trial to 0, that is, the target nectar source can be updated to the candidate nectar source; if the first benefit value > the second benefit value f(x ij ), then the target nectar source is retained and the nectar source parameter trial is = 1. Through the nectar source parameter trial, the number of times a nectar source has been updated can be counted. Among them, the benefit value f(x ij ) can be calculated by the following formula: f(x ij ) = NX T , where N represents the nectar source matrix, and X T can represent the transpose of the scheduling matrix. Different from the original method of randomly combining neighboring nectar source values, the positions of some values in the scheduling matrix can be exchanged to recalculate the overall benefit value of the nectar source. The nectar sources selected by the above method can, while balancing the different demands of various jobs for heterogeneous resources as much as possible, also ensure that the overall benefit value of the nectar source is as small as possible.

[0047] In an exemplary embodiment, determining the elected nectar source based on the updated nectar sources includes: determining the nectar source probability value of the updated nectar sources; determining a target number of target updated nectar sources included in the updated nectar sources based on the nectar source probability value, where the nectar source probability value of the target updated nectar sources is greater than the nectar source probability values of other nectar sources included in the updated nectar sources, and the other nectar sources are the nectar sources included in the updated nectar sources except the target updated nectar sources; and determining the elected nectar source based on the target updated nectar sources.

[0048] In the above embodiment, the artificial bee colony algorithm may further include a follower bee phase, that is, after the employed bee phase ends, the follower bee phase begins. In the follower bee phase, the employed bees can share nectar source information in the dance area, and the follower bees can analyze this information. An improved roulette wheel strategy can be used to select nectar sources for tracking and exploitation to ensure a greater probability of exploiting nectar sources with higher fitness values. Among them, the improved roulette wheel strategy can be understood as screening a target number of target updated nectar sources with the highest nectar source probability values. The elected nectar source can be determined from the screened target updated nectar sources. The target number can be 5, or it can be 6, but is not limited thereto. Using the improved roulette wheel strategy (only screening the top 5 nectar sources with the highest nectar source probability values) to select nectar sources for tracking and exploitation can significantly improve the selection accuracy, especially when the number of tasks is large.

[0049] In an exemplary embodiment, determining the nectar source probability value of the updated nectar sources includes: determining the reciprocal of the third benefit value of each of the updated nectar sources to obtain a plurality of first reciprocals; determining the second sum value of the plurality of first reciprocals; for each updated sub-nectar source included in the updated nectar sources, the following operations are performed to determine the nectar source probability value of the updated sub-nectar source, where the updated sub-nectar source is any one of the nectar sources included in the updated nectar sources: determining the second reciprocal of the third benefit value of the updated sub-nectar source; and determining the ratio of the second reciprocal to the second sum value as the nectar source probability value.

[0050] In the above embodiment, the nectar source probability value can be calculated by the following formula: where can be understood as the second reciprocal of the third benefit value of any one updated sub-nectar source included in the updated nectar sources, can be understood as the second sum value of the first reciprocals of the third benefit values of each updated nectar source. The ratio of the second reciprocal to the second sum value is the nectar source probability value. Combining the randomly generated numbers with the nectar source probability values can ensure that the algorithm maintains randomness during the search process and follows probability guidance, which helps to balance global search and local refinement. By performing the target operations and updating the target sub-updated nectar sources, it helps to further optimize the scheduling scheme, and the finally determined elected nectar source is one of the optimal solutions after multiple rounds of iteration and comparison.

[0051] In an exemplary embodiment, determining the elected nectar source based on the target updated nectar source includes: randomly generating a second random number within a preset range; randomly determining a target sub-updated nectar source from the target updated nectar sources; when the second random number is less than the nectar source probability value corresponding to the target sub-updated nectar source, performing the target operation on the target sub-updated nectar source to determine a candidate nectar source; updating the target sub-updated nectar source based on the candidate nectar source; determining the elected nectar source from the updated candidate nectar sources; determining the elected nectar source based on the updated nectar source; and when the second random number is greater than or equal to the nectar source probability value corresponding to the target sub-updated nectar source, determining the target sub-updated nectar source as the elected nectar source.

[0052] In the above embodiment, during the follower bee stage, a second random number rand is also randomly generated. If the second random number rand is less than the nectar source probability value of the target sub-updated nectar source, then the above formula is used to generate a new candidate nectar source, and the benefit value of the new candidate nectar source is calculated, where the second random number rand ∈ (0, 1) within the preset range. If the benefit value of the new candidate nectar source is less than the benefit value of the target sub-updated nectar source, then the target sub-updated nectar source can be updated based on the candidate nectar source, and the elected nectar source can be determined from the updated nectar sources, and at the same time, the nectar source parameter trial is 0; if the benefit value of the new candidate nectar source is greater than the benefit value of the target sub-updated nectar source, then the target sub-updated nectar source is retained, that is, the target sub-updated nectar source is the elected nectar source, and at the same time, the nectar source parameter trial is 1.

[0053] In the above embodiment, the artificial bee colony algorithm may further include an exploration bee stage. If the number of times of the nectar source parameter trial is greater than the number of times Limit when the nectar source is determined to be abandoned, then a new nectar source can be generated through a chaotic mapping function to replace the target nectar source. If the number of cycles is greater than the preset iteration termination number Maxcycle value, then the calculation is stopped, and the optimal nectar source and the optimal value are output; if the number of cycles is less than the preset Maxcycle value, then the generation stage of the scheduling matrix is performed again. By introducing a probability-based update strategy, not only the search efficiency of the algorithm in the cloud resource scheduling problem is improved, but also its ability to jump out of the local optimal solution is enhanced, ensuring that the algorithm can find a global optimal or near-optimal resource scheduling scheme more quickly and accurately, thereby improving the resource utilization rate and job processing efficiency of the cloud computing platform.

[0054] In an exemplary embodiment, generating a scheduling matrix based on a random sequence includes: mapping the values included in the random sequence into a matrix to obtain the scheduling matrix; wherein, the random sequence is generated in the following manner: for each first position included in the sequence, the following operations are performed to obtain a first value of the first position, and the sequence in which the first value of each first position is determined is determined as the random sequence, where the first position is any position included in the random sequence: in the case where there is a second position adjacent to and before the first position in the random sequence, determining a second value of the second position included in the random sequence; determining a second product of the second value and a control parameter; determining a second difference between a third constant and the first value; determining a third product of the second difference and the second product; in the case where the third product is greater than or equal to a fourth constant, updating the third product to a fifth constant; in the case where the third product is less than the fourth constant, updating the third product to a sixth constant; determining the updated third product as the first value of the first position; in the case where there is no second position adjacent to and before the first position in the random sequence, determining the first value of the first position as a random parameter.

[0055] In the above embodiment, the artificial bee colony algorithm may further include an initialization phase, that is, determining basic parameters such as population size and solution space dimension, and randomly generating the initial food source position through a specific formula. After establishing the nectar source matrix, the scheduling matrix X = [x ij can be used to display the current scheduling scheme, and the scheduling matrix X = [x ii can be expressed as wherein, when the i-th virtual machine in the scheduling matrix executes the j-th job included in the job list, the corresponding x ii = 1. Since the cloud computing scheduling problem belongs to a binary optimization problem, and the basic artificial bee colony algorithm was initially designed for continuous function optimization problems. In addition, in order to prevent the algorithm from falling into a local optimal solution, a chaotic factor can be introduced in the initialization phase to generate a random number sequence, making the population distribution more uniform, so as to better explore the global optimal solution. That is, in the initialization phase after inputting the task queue ListT and the virtual machine queue ListV, the parameters of LBABC (Artificial Bee Colony Algorithm) can be initialized, and the scheduling matrix X, x ij = y ij , can be generated by using the classical chaotic mapping function Logistic, that is, mapping the y ij value in the random sequence to x ij , to obtain the scheduling matrix X, where yij It can be understood as a logical mapping variable. When there is a second position adjacent to and before the first position in the random sequence, the first value at the first position in the random sequence can be calculated by the following formula: y i+1,j = uy ij (1 - y ij ), where u can be understood as a control parameter, u ∈ (0, 4], y ∈ (0, 1), and y ij can be understood as the second value at the second position. When the third product uy ij (1 - y ij ) is greater than the fourth constant 0.5, the first value at the first position can be determined as the fifth constant 1; when the third product uy ij (1 - y ij ) is less than the fourth constant 0.5, the second value at the second position can be determined as the sixth constant 0, that is When there is no second position adjacent to and before the first position in the random sequence, the first value at the first position can be determined as a random parameter. In the initialization stage and the exploration bee stage, generating the initial population through the chaotic mapping function can improve the diversity of the population and reduce the risk of falling into local optima. By introducing the chaotic mapping function to improve the initialization of the original algorithm, the initial solution can be made more uniform, ensuring the search breadth of the algorithm, and it can also optimize the convergence speed and convergence accuracy of the scheduling algorithm, improving the utilization rate of cluster resources.

[0056] In an exemplary embodiment, a first target operation is performed for each target nectar source included in the scheduling matrix to determine the elected nectar source of the target nectar source. The first target operation includes: generating a chaotic variable based on a chaotic mapping, where generating the chaotic variable based on the chaotic mapping includes: determining a third difference between the basic chaotic variable and a seventh constant, determining a fourth product of the basic chaotic variable and the third difference, determining a fifth product of the fourth product and a control parameter of the chaotic mapping, and determining the fifth product as the chaotic variable; mapping the chaotic variable to a first decision variable based on the chaotic variable and the current position of the target nectar source, where the first decision variable represents a solution generated by the chaotic variable; linearly combining the chaotic variable and the current position of the target nectar source to obtain a second decision variable, where the second decision variable is the updated decision variable of the first decision variable; determining a first fitness value of the first decision variable and a second fitness value of the second decision variable; in the case where the second fitness value is greater than the first fitness value, determining the second decision variable as the elected nectar source; and in the case where the second fitness value is less than the first fitness value, determining the first decision variable as the elected nectar source.

[0057] In the above embodiment, the employed bee stage can be optimized based on chaotic search: First, a chaotic variable can be generated through the Logistic chaotic mapping and can be calculated by the following formula: Yn+1 = r * Yn * (1 - Yn), where Yn can be understood as the above basic chaotic variable and r is the control parameter of the above chaotic mapping to ensure that the system is in a chaotic state, and the initial value of the basic chaotic variable Yn is between [0 - 1]. The chaotic variable can be mapped to a first decision variable through the chaotic variable and the current position of the target nectar source. By linearly combining the chaotic variable and the current position of the target nectar source, a new second decision variable can be obtained. The fitness values of the first decision variable and the second decision variable are calculated respectively, and the obtained first fitness value and second fitness value can be compared. If the second fitness value is greater than the first fitness value, the position of the target nectar source can be updated, that is, the second decision variable corresponding to the second fitness value can be determined as the elected nectar source; if the second fitness value is less than the first fitness value, no update is performed, that is, the elected nectar source is the first decision variable.

[0058] The scheduling method of the task will be described below in conjunction with specific embodiments:

[0059] Figure 3 is a flowchart of the scheduling method of the task according to a specific embodiment of the present application. As Figure 3 shown, the process includes the following steps:

[0060] Step S302, Input: Task queue ListT, virtual machine queue;

[0061] Step S304, Initialization phase: Initialize the parameters of the LBABC algorithm; Initialize the parameters of the LBABC algorithm, and use the classical chaotic mapping function Logistic to generate a scheduling matrix X, x ij = y ij where y ij is the logical mapping variable, y i+1,j = uy ij (1 - y ij ), u is the control parameter, u ∈ (0, 4], y ∈ (0, 1) and it is stipulated that And calculate the corresponding nectar source benefit value benefit. Determine the number of times limit and the iteration termination number that the nectar source is discarded.

[0062] Step S306, Employed bee phase: Mine better feasible solutions; In the employed bee phase, the employed bees use the following formula to find new nectar sources. Since the solution x ij takes values of 0 or 1, the formula for finding the new nectar source after discretization is: where x kj represents the neighborhood nectar source, k is not equal to i, is a random number taking values in [-1, 1]. After obtaining the new nectar source through the above formula, use the greedy algorithm to compare the fitness values of the new and old nectar sources and select the better one. In addition, since x ij takes values of 0 or 1, the above formula is modified as follows where represents the integer part function, and if then if then is the integer part of. Because the decision variable can only take values of 0 or 1, so when is not 0 or 1, there is Generate a new candidate solution After that, calculate the benefit value benefit: If then let The nectar source has a parameter trial. When the nectar source update is retained, trail is 0; otherwise, trail is incremented by 1. Thus, trial can count the number of times a nectar source has not been updated. Then calculate the nectar source probability value through the formula .

[0063] Step S308, Scout Bee Phase: The solutions in the solution set are screened using an improved roulette wheel strategy to improve the solution quality; the employed bee phase ends and the scout bee phase begins. In this phase, the employed bees share nectar source information in the dance area. The scout bees analyze this information and use an improved roulette wheel strategy (only screening the top 5 nectar sources with the highest nectar source probability values) to select nectar sources for tracking and exploitation, so as to ensure that the nectar sources with higher fitness values have a greater probability of being exploited. Randomly generate a random number rand ∈ (0, 1). If rand < p ij , then generate a new candidate solution and calculate If then let trail = 0, otherwise trail = trail + 1.

[0064] Step S310, Explore Bee Phase: Generate a new solution; if trail > Limit, generate a new solution through a classical chaotic mapping function to replace x ii .

[0065] Step S312, Calculation stops, output the optimal individual and the optimal value. If the number of loops > Maxcycle, the calculation stops, and the optimal individual and the optimal value are output.

[0066] In the above embodiment, in cloud resource scheduling, the artificial bee colony algorithm can regard cloud resources as food sources and the resource scheduling scheme as the location of the food sources searched by bees. By simulating the foraging behavior of bees, the algorithm can search for the optimal resource scheduling scheme in the cloud resource pool. However, in the traditional artificial bee colony algorithm, the initial solution is usually created by a simple random number generator, which may lead to a non-uniform spatial distribution of the solutions. This application optimizes the solution process by introducing a chaotic mapping function to improve the initialization equation of the artificial bee colony algorithm, that is, the coordinates of each solution are determined by the chaotic sequence generated by the chaotic mapping function. In this way, the initial position of each solution can be affected by the chaotic sequence, so that it can be more evenly distributed in the entire solution space, which can ensure that the algorithm can widely explore different regions of the solution space at an early stage, increasing the possibility of finding the global optimal solution.

[0067] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases, the former is a better implementation. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions for causing a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of the present application.

[0068] In this embodiment, a task scheduling device is further provided. This device is used to implement the above embodiments and preferred embodiments, and those that have been described will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that can achieve a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.

[0069] Figure 4 is a structural block diagram of a task scheduling device according to an embodiment of the present application. As Figure 4 shown, the device includes:

[0070] A first generation module 402, configured to generate a honey source matrix based on a received job list and a virtual machine list. Among them, the job list includes the jobs to be executed by the virtual machines included in the virtual machine list, and the element in the nth row and mth column of the honey source matrix represents the execution time required for the nth virtual machine included in the virtual machine list to execute the mth job included in the job list;

[0071] A second generation module 404, configured to generate a scheduling matrix based on a random sequence;

[0072] An execution module 406, configured to perform a target operation on each target honey source included in the scheduling matrix to determine a candidate honey source for the target honey source, and obtain a plurality of the candidate honey sources. Among them, the target honey source is any honey source included in the scheduling matrix, and the target operation includes: determining the candidate honey source of the target honey source based on a first random number and the target honey source;

[0073] An update module 408, configured to update the target honey source based on the candidate honey source to obtain an updated honey source. Among them, the updated honey source includes the updated target honey source and the reserved target honey source;

[0074] A determination module 410, configured to determine an elected honey source based on the updated honey source;

[0075] A scheduling module 412, configured to schedule a target job corresponding to the target position to a target virtual machine corresponding to the target position based on the target position of the elected nectar source in the scheduling matrix.

[0076] In an exemplary embodiment, the execution module 406 may implement determining the candidate nectar source based on the first random number and the target nectar source in the following manner: determining a first difference between the target nectar source and the neighboring nectar sources of the target nectar source; a first product of the first random number and the first difference; determining a first sum value of the first product and the target nectar source; determining a floor value of the first sum value; in a case where the floor value is greater than a first constant, determining the first constant as the candidate nectar source; in a case where the floor value is less than a second constant, determining the second constant as the candidate nectar source.

[0077] In an exemplary embodiment, the updating module 408 may implement updating the target nectar source based on the candidate nectar source in the following manner: determining a first benefit value of each candidate nectar source; in a case where the first benefit value is greater than a second benefit value of the target nectar source, retaining the target nectar source; in a case where the first benefit value is less than the second benefit value of the target nectar source, updating the target nectar source to the candidate nectar source.

[0078] In an exemplary embodiment, the determining module 410 may implement determining the elected nectar source based on the updated nectar source in the following manner: determining a nectar source probability value of the updated nectar source; determining a target number of target updated nectar sources included in the updated nectar source based on the nectar source probability value, where the nectar source probability value of the target updated nectar source is greater than the nectar source probability values of other nectar sources included in the updated nectar source, and the other nectar sources are the nectar sources included in the updated nectar source except the target updated nectar source; determining the elected nectar source based on the target updated nectar source.

[0079] In an exemplary embodiment, the determining module 410 may implement determining the nectar source probability value of the updated nectar source in the following manner: determining a reciprocal of a third benefit value of each updated nectar source to obtain a plurality of first reciprocals; determining a second sum value of the plurality of first reciprocals; for each updated sub-nectar source included in the updated nectar source, performing the following operations to determine the nectar source probability value of the updated sub-nectar source, where the updated sub-nectar source is any one of the nectar sources included in the updated nectar source: determining a second reciprocal of the third benefit value of the updated sub-nectar source; determining a ratio of the second reciprocal to the second sum value as the nectar source probability value.

[0080] In an exemplary embodiment, the determining module 410 may implement determining the elected honeypot based on the target updated honeypot in the following manner: randomly generate a second random number within a preset range; randomly determine a target sub-updated honeypot from the target updated honeypots; when the second random number is less than the honeypot probability value corresponding to the target sub-updated honeypot, perform the target operation on the target sub-updated honeypot to determine a candidate honeypot; update the target sub-updated honeypot based on the candidate honeypot; determine the elected honeypot from the updated candidate honeypot; determine the elected honeypot based on the updated honeypot; when the second random number is greater than or equal to the honeypot probability value corresponding to the target sub-updated honeypot, determine the target sub-updated honeypot as the elected honeypot.

[0081] In an exemplary embodiment, the second generating module 404 may implement generating a scheduling matrix based on a random sequence in the following manner: map the values included in the random sequence into a matrix to obtain the scheduling matrix; wherein, the random sequence is generated in the following manner: for each first position included in the sequence, perform the following operations to obtain the first value of the first position, and determine the sequence in which the first values of each first position are determined as the random sequence, where the first position is any position included in the random sequence: when there is a second position adjacent to and before the first position in the random sequence, determine the second value of the second position included in the random sequence; determine the second product of the second value and a control parameter; determine the second difference between a third constant and the first value; determine the third product of the second difference and the second product; when the third product is greater than or equal to a fourth constant, update the third product to a fifth constant; when the third product is less than the fourth constant, update the third product to a sixth constant; determine the updated third product as the first value of the first position; when there is no second position adjacent to and before the first position in the random sequence, determine the first value of the first position as a random parameter.

[0082] It should be noted that the above-mentioned various modules may be implemented by software or hardware. For the latter, it may be implemented in the following ways, but not limited thereto: the above-mentioned modules are all located in the same processor; or, the above-mentioned various modules are respectively located in different processors in any combination form.

[0083] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, and the computer program is configured to execute the steps in any one of the above method embodiments when running.

[0084] In an exemplary embodiment, the above computer-readable storage medium may include, but is not limited to: various media capable of storing computer programs such as USB flash drives, read-only memory (ROM for short), random access memory (RAM for short), external hard drives, magnetic disks, or optical discs.

[0085] An embodiment of the present application also provides an electronic device, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any of the above method embodiments.

[0086] In an exemplary embodiment, the above electronic device may further include a transmission device and an input / output device. Among them, the transmission device is connected to the above processor, and the input / output device is connected to the above processor.

[0087] An embodiment of the present application also provides a computer program product. The above computer program product includes a computer program, and when the computer program is executed by a processor, it implements the steps in any of the above method embodiments.

[0088] Specific examples in this embodiment may refer to the examples described in the above embodiments and exemplary embodiments, and will not be repeated here.

[0089] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general-purpose computing device. They can be concentrated on a single computing device or distributed on a network composed of multiple computing devices. They can be implemented by program codes executable by the computing device, so that they can be stored in a storage device and executed by the computing device. And in some cases, the steps shown or described can be executed in a different order than here, or they can be separately made into individual integrated circuit modules, or multiple of them can be made into a single integrated circuit module to implement. In this way, the present application is not limited to any specific combination of hardware and software.

[0090] The above are only the preferred embodiments of the present application and are not used to limit the present application. For those skilled in the art, the present application can have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the principle of the present application shall be included in the protection scope of the present application.

Claims

1. A task scheduling method, characterized in that: include: Generate a honey source matrix based on the received job list and virtual machine list, wherein the job list includes jobs to be executed by the virtual machines included in the virtual machine list, and the nth row and mth column of the honey source matrix represent the execution time required for the nth virtual machine included in the virtual machine list to execute the mth job included in the job list; Generate a scheduling matrix based on a random sequence; A target operation is performed for each target honey source included in the scheduling matrix to determine a candidate honey source of the target honey source, and a plurality of the candidate honey sources are obtained, wherein the target honey source is any honey source included in the scheduling matrix, and the target operation includes: determining the candidate honey source of the target honey source based on a first random number and the target honey source; updating the target honey source based on the candidate honey source to obtain an updated honey source, wherein the updated honey source includes the updated target honey source and the retained target honey source; Determining a selected nectar source based on the updated nectar source; Based on the target position of the selected honey source in the scheduling matrix, the target job corresponding to the target position is scheduled to be executed in the target virtual machine corresponding to the target position.

2. The method according to claim 1, characterized in that The determining the candidate nectar source based on the first random number and the target nectar source includes: Determine a first difference between the target nectar source and a neighboring nectar source of the target nectar source; a first product of the first random number and the first difference; Determine a first sum value of the first product and the target nectar source; Determine a floor value of the first sum value; When the rounded-down value is greater than a first constant, determining the first constant as the candidate nectar source; When the rounded-down value is smaller than a second constant, the second constant is determined as the candidate nectar source.

3. The method according to claim 1, characterized in that The updating of the target nectar source based on the candidate nectar source comprises: Determining a first benefit value of each of the candidate nectar sources; When the first benefit value is greater than the second benefit value of the target nectar source, retaining the target nectar source; When the first benefit value is less than the second benefit value of the target nectar source, the target nectar source is updated to the candidate nectar source.

4. The method according to claim 1, characterized in that: The determining of the selected nectar source based on the updated nectar source includes: Determining a nectar source probability value of the updated nectar source; Determining a target number of target updated nectar sources included in the updated nectar source based on the nectar source probability value, wherein the nectar source probability value of the target updated nectar source is greater than the nectar source probability values ​​of other nectar sources included in the updated nectar source, and the other nectar sources are nectar sources included in the updated nectar source except the target updated nectar source; The selected nectar source is determined based on the target updated nectar source.

5. The method according to claim 4, characterized in that The determining of the nectar source probability value of the updated nectar source includes: Determine the inverse of the third benefit value of each of the updated nectar sources to obtain a plurality of first inverses; determining a second sum of a plurality of said first inverses; For each update sub-nectar source included in the update nectar source, the following operations are performed to determine the nectar source probability value of the update sub-nectar source, wherein the update sub-nectar source is any nectar source included in the update nectar source: Determining a second reciprocal of the third benefit value of the updated sub-nectar source; The ratio of the second reciprocal to the second sum is determined as the nectar source probability value.

6. The method according to claim 4, characterized in that The step of updating the honey source based on the target to determine the selected honey source includes: Randomly generate a second random number in a preset range; Randomly determine a target sub-update nectar source from the target update nectar source; When the second random number is smaller than the honey source probability value corresponding to the target sub-update honey source, performing the target operation on the target sub-update honey source to determine a honey source to be selected; Update the target sub-update nectar source based on the candidate nectar source; Determining the selected nectar source from the updated candidate nectar sources; Determining the selected nectar source based on the updated nectar source; When the second random number is greater than or equal to the nectar source probability value corresponding to the target sub-updated nectar source, the target sub-updated nectar source is determined as the selected nectar source.

7. The method according to claim 1, characterized in that The generating of the scheduling matrix based on the random sequence comprises: Mapping the numerical values ​​included in the random sequence into a matrix to obtain the scheduling matrix; The random sequence is generated in the following way: The following operations are performed for each first position included in the sequence to obtain a first value of the first position, and a sequence in which the first value of each first position is determined is determined as the random sequence, wherein the first position is any position included in the random sequence: In a case where there is a second position in the random sequence that is adjacent to the first position and located before the first position, determining a second value of the second position included in the random sequence; determining a second product of the second value and a control parameter; determining a second difference between the third constant and the first value; determining a third product of the second difference and the second product; When the third product is greater than or equal to a fourth constant, updating the third product to a fifth constant; When the third product is less than the fourth constant, updating the third product to a sixth constant; Determine the updated third product as the first value of the first position; When there is no second position adjacent to the first position and located before the first position in the random sequence, the first value of the first position is determined as a random parameter.

8. A task scheduling device, characterized in that: include: A first generating module is used to generate a honey source matrix based on the received job list and virtual machine list, wherein the job list includes jobs to be executed by the virtual machines included in the virtual machine list, and the nth row and mth column of the honey source matrix represent the execution time required for the nth virtual machine included in the virtual machine list to execute the mth job included in the job list; A second generation module, used for generating a scheduling matrix based on a random sequence; An execution module is used to perform a target operation for each target honey source included in the scheduling matrix to determine a candidate honey source of the target honey source and obtain a plurality of the candidate honey sources, wherein the target honey source is any one of the honey sources included in the scheduling matrix, and the target operation includes: determining the candidate honey source of the target honey source based on a first random number and the target honey source; An updating module, configured to update the target nectar source based on the candidate nectar source to obtain an updated nectar source, wherein the updated nectar source includes the updated target nectar source and the retained target nectar source; A determination module, used to determine a selected nectar source based on the updated nectar source; The scheduling module is used to schedule the target job corresponding to the target position to the target virtual machine corresponding to the target position for execution based on the target position of the selected honey source in the scheduling matrix.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method described in any one of claims 1 to 7 when executed by a processor.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method described in any one of claims 1 to 7 are implemented.