A resource scheduling method

By combining artificial bee colony algorithm and Q-learning algorithm, the fitness function of the service request model is constructed, which solves the problems of low convergence accuracy and slow speed of resource scheduling in the cloud computing environment, and achieves efficient resource scheduling and load balancing.

CN116033026BActive Publication Date: 2024-12-17GUANGDONG UNIV OF TECH +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211564395.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-07
Publication Date
2024-12-17
Estimated Expiration
2042-12-07

AI Technical Summary

Technical Problem

The existing resource scheduling methods have problems such as low convergence accuracy, slow convergence speed, high time complexity and easy to fall into local optimal solutions in cloud computing environments, especially in the case of multi-user concurrency, which is difficult to effectively manage service resource conflicts.

Method used

Using the combination of artificial bee colony algorithm and Q-learning algorithm, by building a fitness function of the service request model, optimize resource scheduling based on service execution time and service execution cost, and quickly find suitable services using swarm search and Q table update mechanisms. Component resource scheduling scheme.

Benefits of technology

It realizes efficient convergence of resource scheduling, with high rapid convergence accuracy and low time complexity, and can effectively balance the service component load in multi-user concurrency scenarios and determine the appropriate service sequence and scheduling scheme.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116033026B_ABST
    Figure CN116033026B_ABST
Patent Text Reader

Abstract

The present invention discloses a resource scheduling method, which obtains a service request proposed by a user and establishes a service request model according to the service request; constructs a fitness function of the service request model according to evaluation indicators and constraints, calculates the fitness value of each service in the service component based on the service execution time and service execution cost, selects a suitable service component, creates load balancing between service components, and adopts an artificial bee colony algorithm and a Q-learning algorithm to solve the resource scheduling problem of service components under multi-user concurrency in cloud computing, which can help the artificial bee colony algorithm converge faster, help determine the service order of a suitable available resource environment, and simply and efficiently determine the most suitable service scheduling scheme, and the embodiment of the present invention also has the beneficial effects of high convergence accuracy, fast convergence speed, low time complexity, and high exploration degree. The embodiment of the present invention can be widely applied to the field of resource scheduling technology.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of resource scheduling, and in particular to a resource scheduling method. Background Art

[0002] Industrial cyber-physical systems support componentized services. From the perspective of industrial cloud computing, software components should be dynamically combined across heterogeneous edge devices to perform various functions. An important application in industrial cyber-physical systems is service scheduling. The ultimate goal of multi-service scheduling is to achieve sustainable services. However, when multiple users send multiple service request commands to the service manager at the same time, some service resource conflicts will occur, namely resource conflict management problems, which require resource scheduling of service components.

[0003] At present, there are heuristic algorithms, metaheuristic algorithms, hybrid metaheuristic algorithms and even machine learning methods to solve the service scheduling and load balancing problems in cloud computing environments. Jena proposed a method based on artificial bee colony algorithm for energy efficiency, processing time, cost and computing resource utilization in cloud computing environments. The multi-objective artificial bee colony algorithm is used to allocate services to data centers. However, the heuristic algorithm has low convergence accuracy, slow convergence speed and high time complexity. Some machine learning methods have weak exploratory behavior and are prone to local optimal solution problems. Summary of the invention

[0004] In view of this, an embodiment of the present invention provides a resource scheduling method with high efficiency and fast convergence.

[0005] An embodiment of the present invention provides a resource scheduling method, comprising: obtaining a service request proposed by a user, and establishing a service request model according to the service request; constructing a fitness function of the service request model according to evaluation indicators and constraint conditions; wherein the evaluation indicators are service execution time and service execution cost; the constraint conditions are resource utilization and service execution timeout rate; using an artificial bee colony algorithm and a Q-learning algorithm in combination to solve the fitness function, and determining a scheduling scheme whose value of the fitness function meets an error condition as an optimization target; and scheduling service component resources according to the optimization target.

[0006] Optionally, obtaining a service request proposed by a user and establishing a service request model based on the service request includes: obtaining a service request proposed by a user; obtaining a service component set and a service set based on a service name of the service request; and constructing a service request model based on the service component set and the service set.

[0007] Optionally, constructing the fitness function of the service request model based on evaluation indicators and constraints includes: constructing a fitness function of the service execution time based on the service execution time; constructing a fitness function of the service execution cost based on the service execution cost; calculating resource utilization and timeout rate; constructing the fitness function of the service request model based on the fitness function of the service execution time, the fitness function of the service execution cost, the resource utilization and the timeout rate.

[0008] Optionally, constructing a fitness function of the service execution time based on the service execution time includes: calculating the total service execution time in each service component; determining the maximum total execution time in all components and the minimum completion time required to complete all services based on the total service execution time; and constructing a fitness function of the service execution time in the service request model based on the service execution time and the minimum completion time.

[0009] Optionally, constructing a fitness function of the service execution cost based on the service execution cost includes: calculating the sum of the service execution costs of all services processed on each service component; determining the minimum value of the service execution cost processed by the service component based on the sum of the service execution costs; and constructing a fitness function of the service execution cost in the service request model based on the sum of the service execution costs and the minimum value of the service execution cost.

[0010] Optionally, the calculation formula for calculating the total service execution time in each service component is:

[0011]

[0012] Among them, the v i represents the i-th service component; the s jki Represents the service s of the jth user jk Assigned to service component v i Execute; the ExtTime(s jki ) Representative Services jk In v i The execution time of the processing service; the length (s jk ) Representative Services jk The length of the CPU (v i ) represents processing services jk The CPU speed.

[0013] Optionally, calculating the sum of service execution costs of all services processed on each service component includes: calculating a single service execution cost when executing a single service in a service component; and calculating the sum of all services executed on all components based on the single service execution cost as the sum of service execution costs.

[0014] Optionally, the calculation formula for calculating the single service execution cost when executing a single service in the service component is:

[0015] Cost(s jki )=(c1·ExtTime(s jki ))+(c2·ExtTime(s jki ))+(c3·ExtTime(s jki ))

[0016] Among them, s jki Represents the service s of the jth user jk Assigned to service component v i Execution; Cost(s jki ) represents the service execution cost of the jkth service in the i-th service component; c1 represents the cost of executing the jkth service in the v i The CPU usage cost per unit time in v i The memory usage cost per unit time in v i The bandwidth usage cost per unit time in ExtTime(s jki ) represents jk In v i Processing service execution time;

[0017] The calculation formula for calculating the sum of all services executed on all components according to the single service execution cost is:

[0018]

[0019] Where TCost represents the total cost of service execution; m represents the total number of service components; i represents the i-th service component; n represents the total number of users; j represents the j-th user; p represents the total number of services; k represents the k-th service; s jki Represents the service s of the jth user jk Assigned to service component v i Execution; Cost(s jki ) Representative Services jk The cost of service execution in the ith service component.

[0020] Optionally, the artificial bee colony algorithm and the Q-learning algorithm are combined to solve the fitness function, and the scheduling scheme whose value of the fitness function satisfies the error condition is determined as the optimization target, including: initializing the bee colony, the food source and configuring the algorithm parameters; constructing a Q table according to the Q-learning algorithm; wherein the Q table is used to store all expected states, actions and Q values; and the Q value is determined by the combination of the state and the action.

[0021] In the employed bee stage, the employed bees determine the positions of the adjacent food sources of the current food source, and update the Q table according to the positions of the adjacent food sources; in the follower bee stage, the follower bees randomly select an employed bee food source from the Q table according to the roulette method; obtain a new food source according to the selected employed bee food source; replace the selected employed bee food source with the new food source; when the fitness value of the new food source exceeds the selected employed bee food source, the Q value is updated; in the scout bee stage, when the number of failures to obtain the new food source whose fitness value exceeds the selected employed bee food source exceeds a predetermined threshold, a new food source is randomly searched and the Q table is updated; wherein the fitness value is calculated by a fitness function; repeat the steps of: in the employed bee stage, the employed bees determine the positions of the adjacent food sources of the current food source, and update the Q table according to the positions of the adjacent food sources, until the maximum number of iterations is reached or the fitness value of the action plan in the Q table meets the error condition; and the final action plan in the Q table is determined as the optimal service component resource scheduling plan.

[0022] Optionally, the Q value is determined by the state and the action combination, including: the calculation formula of the Q value is:

[0023]

[0024] Among them, Q t+1 (b t , a t ) is the Q value at time t+1; α is the learning rate; a t is the action at time t; á t is the optimal action at time t; γ is the discount factor; r t is in state b t The penalty or reward obtained by executing the action; δ is the transition function; is an estimate of the optimal value.

[0025] The embodiments of the present invention have the following beneficial effects: when a user makes a service request to a target system, a service request model is established for the service request; a fitness function of the service request model is constructed according to evaluation indicators and constraints, the fitness value of each service in the service component is calculated based on the service execution time and the service execution cost, and a suitable service component is selected, a load balance is created between the service components, and an artificial bee colony algorithm and a Q-learning algorithm are used to solve the resource scheduling problem of service components under multi-user concurrency in cloud computing, which can help the artificial bee colony algorithm to converge faster, help determine the service order of a suitable available resource environment, and simply and efficiently determine the most suitable service scheduling plan. The embodiments of the present invention also have the beneficial effects of high convergence accuracy, fast convergence speed, low time complexity, and high exploration degree. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0027] Figure 1 It is a flow chart of the method steps provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0028] 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 intended to limit the present invention.

[0029] In view of the resource conflict management problem existing in the existing resource scheduling technology, an embodiment of the present invention provides a resource scheduling method, including: obtaining a service request proposed by a user, and establishing a service request model according to the service request; constructing a fitness function of the service request model according to evaluation indicators and constraint conditions; wherein the evaluation indicators are service execution time and service execution cost; the constraint conditions are resource utilization and service execution timeout rate; using an artificial bee colony algorithm and a Q-learning algorithm in combination to solve the fitness function, and determining a scheduling scheme whose value of the fitness function meets an error condition as an optimization target; and scheduling service component resources according to the optimization target.

[0030] Specifically, in the embodiment of the present invention, the target system is an industrial cyber-physical system, and the software components in the industrial cyber-physical system are dynamically combined across heterogeneous surface source devices and can perform various functions. Figure 1 , Figure 1 1 is a flowchart of the method steps provided by an embodiment of the present invention. The embodiment of the present invention includes the following steps S100 to S400:

[0031] S100: Obtain a service request proposed by a user, and establish a service request model according to the service request.

[0032] Specifically, step S100 includes the following steps S110 to S130:

[0033] S110: Obtain a service request from a user.

[0034] Specifically, a service request proposed by a user is obtained, wherein the service information sequence in the service request includes the service name, the number of service instructions, the memory required for the service, the CPU resources required for the service, the latest execution time of the service, and the like.

[0035] S120. Obtain a service component set and a service set according to the service name of the service request.

[0036] Specifically, available components in the service component library are queried by service name classification to obtain a service component set, and all service requests are taken as a service set.

[0037] S130. Construct a service request model according to the service component set and the service set.

[0038] According to the service component set and the service set, the expression of the service component set in the embodiment of the present invention can be:

[0039] V={v1,v2,…,v i ,…,v m}

[0040] Where V represents the set of service components; m represents the total number of available service components in the cloud network; v i Represents the i-th component node.

[0041] Each service component in the service component library has its own service resources, such as CPU (central processing unit), RAM (random access memory) and bandwidth.

[0042] The expression for user set can be:

[0043] U={u1,u2,...,u j , ..., u n}

[0044] Among them, U represents the user set; n represents the total number of users; u j represents the jth user.

[0045] u j Contains the service sequence required by the user, such as u j ={s j1 ,s j2 , ..., s jp}; where p is the total number of services for a single user. The total service set is S, and the number of service requests that need to be processed is q; where user u j Medium Services jk is assigned to component v i By jki So the service of the i-th service component can be represented by v i ={s abi ,s cdi , ..., s yzi} indicates that the service set is S. The service component set and the service set are constructed as a service request model.

[0046] S200. Constructing a fitness function of a service request model according to evaluation indicators and constraint conditions; wherein the evaluation indicators are service execution time and service execution cost; and the constraint conditions are resource utilization and service execution timeout rate.

[0047] Specifically, the service execution time is the time when the target system completes the last service. Each service component has a different service execution time to complete the service determined by the service execution time; the service execution cost can be determined based on the CPU usage cost, memory usage cost, and bandwidth usage cost; the resource utilization rate is determined based on the difference between the resource load rate sent to different service nodes and the system average load rate; the timeout rate is determined by the number of services that exceed the latest completion time and the total number of services in the service set. Step S200 includes the following steps S210-S280:

[0048] S210: Calculate the total service execution time in each service component.

[0049] The expression for calculating the total service execution time in each service component in the embodiment of the present invention is:

[0050]

[0051] Among them, ET(v i ) is the total service execution time of each component; ExtTime(s jki ) Representative Services jk In component v i The execution time of the process. length(s jk ) Representative Services jk The length of the service is determined by the number of instructions; CPU (v i ) is the processing service jk The CPU speed of the component.

[0052] S220: Determine the maximum total execution time of all components and the minimum completion time required to complete all services according to the total service execution time.

[0053] Specifically, the maximum total execution time of all components and the minimum completion time required to complete all services are determined according to the total service execution time. The expression of the maximum total execution time can be:

[0054] Makespan=Max(ET(v i )), 1≤i≤m

[0055] Among them, Makespan represents the maximum total execution time; ET(v i ) represents the total service execution time of each component; m represents the total number of available service components in the cloud network; vi Represents the i-th component node.

[0056] The above minimum completion time is the lower limit of the maximum total execution time, which represents the shortest time required for the target system to complete all services. The expression of the minimum completion time can be:

[0057] MinMakespan=Min(ET(v i )), 1≤i≤m

[0058] Among them, MinMakespan represents the minimum completion time; ET(v i ) represents the total service execution time of each component; m represents the total number of available service components in the cloud network; v i Represents the i-th component node.

[0059] S230: Construct a fitness function of the service execution time in the service request model according to the service execution time and the minimum completion time.

[0060] Specifically, a fitness function of the service execution time in the service request model can be constructed according to the service execution time and the minimum completion time. The fitness function expression of the service execution time in the embodiment of the present invention can be:

[0061]

[0062] Among them, F1 represents the fitness function value of the service execution time; Makespan represents the maximum total execution time; MinMakespan represents the minimum completion time.

[0063] S240: Calculate the sum of service execution costs of all services processed on each service component.

[0064] Specifically, the service execution cost sum expression of all services processed on each service component in the embodiment of the present invention can be:

[0065] Cost(s jki )=(c1·ExtTime(s jki ))+(c2·ExtTime(s jki ))+(c3·ExtTime(s jki ))

[0066] Among them, Cost(s jki ) represents the total cost of service execution on each service component; c1 represents the CPU usage cost per time unit; c2 represents the memory usage cost per time unit; c3 represents the bandwidth usage cost per time unit.

[0067] The sum of the costs of processing all services on all components is calculated based on the sum of the service execution costs on each service component. The expression is:

[0068]

[0069] Among them, TCost represents the sum of the service execution costs of all components; Cost(s jki ) represents the sum of the service execution costs on each service component; m represents the total number of all service components on the cloud network; n represents the total number of users; and p represents the number of services for a single user.

[0070] S250: Determine the minimum value of the service execution cost processed by the service component according to the total service execution cost.

[0071] Specifically, the minimum value of the service execution cost processed by the service component is determined according to the total service execution cost, and its expression can be:

[0072]

[0073] Among them, MinTCost represents the minimum service execution cost; Cost(s jki ) represents the service execution cost on each service component; m represents the total number of service components on the cloud network; v i Represents the fth component node.

[0074] S260: Construct a fitness function of the service execution cost in the service request model according to the total service execution cost and the minimum service execution cost.

[0075] Specifically, a fitness function of the service execution cost in the service request model is constructed according to the total service execution cost and the minimum service execution cost. The fitness function can be expressed as:

[0076]

[0077] Among them, F2 represents the fitness function value of the service execution cost; MinTCost represents the minimum service execution cost; Cost represents the sum of the service execution costs of all components.

[0078] S270: Calculate resource utilization and timeout rate.

[0079] Specifically, resource utilization is determined based on the difference between the resource load rate sent to different service nodes and the system average load rate. i The node load rate L i The expression can be:

[0080]

[0081] Among them, L i Represents the service component node v i Node load rate; TC i Represents the service component node v i Total CPU resources available on RC i Represents the service component node v i CPU resources required to process the assigned services; TM i Represents the service component node v i Total memory available on the system; RM i Represents the service component node v i The memory required for processing the assigned services; ω1 represents the weight of the CPU, ω2 represents the weight of the memory, ω1+ω2=1.

[0082] The expression of the average load rate AL of the target system can be:

[0083]

[0084] Where AL represents the average load rate of the target system; m is the total number of service components in the cloud network; L i Represents the service component node v i The node load rate.

[0085] According to the above expression, the resource utilization expression of the embodiment of the present invention is:

[0086]

[0087] Among them, G1 represents resource utilization; AL represents the average load rate of the target system; L i Represents the service component node v i The node load rate.

[0088] The timeout rate is determined by the number of services that exceed the latest completion time and the total number of services in the service set. When resource allocation exceeds the latest completion time, a fault will occur, that is, the service allocation fails. In an embodiment of the present invention, the expression of the resource allocation timeout rate can be:

[0089]

[0090] Among them, G2 is the timeout rate; l is the number of services that exceed the latest completion time, and q is the total number of services in the service set S.

[0091] S280: Construct a fitness function of the service request model according to the fitness function of the service execution time, the fitness function of the service execution cost, the resource utilization rate, and the timeout rate.

[0092] Specifically, the fitness function of the service request model is constructed according to the fitness function of the service execution time, the fitness function of the service execution cost, the resource utilization rate, and the timeout rate. The fitness function of the service request model can be:

[0093] F=γ1·F1+γ2·F2

[0094] G1<μ

[0095] G2<σ

[0096] Among them, F is the fitness function of the service request, γ1 and γ2 are the balance coefficients between execution time and total cost, and μ and σ are the constraint function coefficients.

[0097] By solving the fitness function of the service request model, a better service component resource scheduling sequence can be obtained by maximizing the fitness function F under constraints.

[0098] S300, using an artificial bee colony algorithm and a Q-learning algorithm to solve a fitness function, and determining a scheduling scheme whose value of the fitness function satisfies an error condition as an optimization target.

[0099] Specifically, step S300 includes the following steps S310 to S390:

[0100] S310, initialize the bee colony, food source and configure algorithm parameters.

[0101] Specifically, the bee colony is initialized, the food source is generated, and the algorithm parameters are configured; the algorithm parameters include the total number of bee colonies, the number of employed bees, the number of follower bees, and the maximum number of iterations. The food source is randomly generated, and its random generation expression is:

[0102]

[0103] in, is the lower bound of the jth optimization parameter, is the upper bound of the jth optimization parameter.

[0104] S320, constructing a Q table according to the Q-learning algorithm; wherein the Q table is used to store all expected states, actions, and Q values; and the Q value is determined by the combination of states and actions.

[0105] Specifically, the main purpose of the Q-learning algorithm is to learn through trial and error between the agent and the environment. The agent can receive the environmental conditions through the state, choose the action that affects the environment to obtain the best return, and learn from past mistakes. Due to the uncertainty of the environment, the agent chooses to perform the same operation on the same situation or state, but may not get the same result. In this embodiment of the present invention, the state set B in the environment = {b1, b2, ..., b m}, then each state has an action set A = {a1, a2, ..., a m}, the agent is in state b t At time t, choose action a t , enter the next state b through the transition process t+1 , through the transition process, obtain the reward r from the environment t+1 ; where b t ∈B,a t ∈A,b t+1 ∈B.

[0106] A Q table is created to store all expected states, actions, and Q values; the Q value is determined by the combination of states and actions. To process these services, appropriate operations must be selected to maximize the Q value of each state, and the Q value function depends on the choice of action in the state. The Q value calculation formula in the embodiment of the present invention can be:

[0107]

[0108] Among them, Q t+1 (b t , a t ) is the Q value at time t+1; α is the learning rate, which is given by α=1 / (1+visit state b t The total number of times) is calculated; a t is the learning rate at time t; γ (0 < γ < 1) is the discount factor, that is, the impact of the previous action on the next state; r t is in state b t The penalty or reward obtained by executing the action; δ is the transition function; is an estimate of the future optimal value, which is obtained by adjusting the value of a so that Q(b t+1 , a) Maximization.

[0109] The initial value of the Q table is configured as 0, and the swarm updates the Q table value using the Q value calculation formula.

[0110] S330: In the employed bee stage, the employed bees determine the locations of the adjacent food sources of the current food source and update the Q table according to the locations of the adjacent food sources.

[0111] Specifically, in the hired bee stage, the hired bees find the current food source by calculating Adjacent food sources The calculation formula for the employed bees in the embodiment of the present invention to calculate the position of the adjacent food source of the current food source is:

[0112]

[0113] in, yes The jth optimization parameter; Current food source is the jth optimization parameter of ; k is the index of the food source.

[0114] If new food source The returned fitness value is greater than the current food source Right now The hired bees replace the current food source with a new one, and update the Q table by rewarding the selected food source and penalizing the current food source; where F is the service request model fitness function. When the new food source cannot provide a better fitness value, the new food source is penalized and the current food source is rewarded. When the hired bees find a suitable food source, the Q table is updated.

[0115] S340. In the follower bee stage, the follower bees randomly select hired bee food sources from the Q table according to the roulette method; and obtain new food sources according to the selected hired bee food sources.

[0116] Specifically, in the follower bee stage, the follower bee randomly selects the food source of the employed bee from the Q table according to the roulette wheel method, and the food source with a larger Q value in the Q table has a higher probability of being selected.

[0117] In the embodiment of the present invention, the roulette method means that the larger the Q value of the food source is, the larger the roulette area is, and the higher the probability of being selected is.

[0118] S350, replacing the selected food source for employed bees with a new food source.

[0119] S360: When the fitness value of the new food source exceeds the selected hired bee food source, the Q value is updated.

[0120] Specifically, for S350 to S360, the follower bee searches for a new food source and replaces the current food source with the new food source. When the new food source has a higher fitness value, the Q value is updated. In the embodiment of the present invention, the calculation formula for the follower bee to search for a food source is:

[0121]

[0122] in, Is near a food source Optimization parameters of Current food source The kth optimization parameter of is a random number in the interval [-1, 1], is the optimization parameter of the best food source caused by random selection.

[0123] S370. In the scout bee stage, when the number of failures to obtain a new food source whose fitness value exceeds the selected hired bee food source exceeds a predetermined threshold, a new food source is randomly searched and the Q table is updated; wherein the fitness value is calculated by a fitness function.

[0124] S380, repeating in the hired bee stage, the hired bees determine the location of the adjacent food sources of the current food source, and update the Q table according to the location of the adjacent food sources until the maximum number of iterations is reached or the fitness value of the action plan in the Q table meets the error condition.

[0125] Specifically, steps S330 to S370 are repeated until the maximum number of iterations is reached or the fitness value of the action plan in the Q table meets the error condition.

[0126] S390. Determine the final action plan in the Q table as the optimal service component resource scheduling plan.

[0127] S400: Scheduling service component resources according to optimization goals.

[0128] The embodiments of the present invention have the following beneficial effects: the fitness value of each service in the service component is calculated based on the service execution time and the service execution cost, and the appropriate service component is selected, and load balancing is created between the service components. The artificial bee colony algorithm and the Q-learning algorithm are used to solve the resource scheduling problem of service components under multi-user concurrency in cloud computing, which can help the artificial bee colony algorithm to converge faster, help determine the service order of the appropriate available resource environment, and simply and efficiently determine the most appropriate service scheduling plan. The embodiments of the present invention also have the beneficial effects of high convergence accuracy, fast convergence speed, low time complexity, and high exploration degree.

[0129] The following is an application scenario provided by an embodiment of the present invention:

[0130] In this application scenario, there are service component set V = {v1, v2, v3, v4}, user set U = {u1, u2, u3}, service set S = {s 11 ,s 12 ,s 13 ,s 21 ,s 22 ,s 31 ,s 32}.

[0131] The fitness function of the service request model constructed according to the evaluation indicators and constraints is:

[0132] F=γ1·F1+γ2·F2

[0133] in,

[0134]

[0135] Makespan=Max(ET(v i )), 1≤i≤m

[0136] MinMakespan=Min(ET(v i )), 1≤i≤m

[0137]

[0138]

[0139]

[0140]

[0141] Cost(s jki )=(c1·ExtTime(s jki ))+(c2·ExtTime(s jki ))+(c3·ExtTime(s jki ))

[0142] Among them, F is the fitness function of the service request, γ1 and γ2 are the balance coefficients between execution time and total cost. jki ) is the service jk In v i The execution time of the processing, ET(v i ) is v i The total execution time of the service processing. length(s jk ) is the service jk The length of the service is determined by the number of instructions, CPU (v i ) is used to process services jk The CPU rate of the service component. Makespan is the maximum execution time of all service components, MinMakespan is the lower limit of Makespan, which is the shortest time required for the system to complete all services. c1, c2, and c3 are v iThe CPU usage cost per time unit, the memory usage cost per time unit, and the bandwidth usage cost per time unit are calculated. The total cost TCost is calculated as the sum of the execution costs of all services processed on all service components, and MinTCost represents the minimum service execution cost.

[0143] The constraints are:

[0144]

[0145]

[0146] Among them, L i is the load rate between each component node, AL is the average load rate of the system, m is the total number of components in the system, l is the number of services that exceed the latest completion time, q is the total number of services in the service set S, and μ and σ are the constraint function coefficients.

[0147] In this application scenario, the artificial bee colony algorithm and the Q-learning algorithm are combined to solve the fitness function, and the solution in which the fitness function satisfies the error condition is determined as the optimization target. According to step S300 of the embodiment of the present invention, specifically:

[0148] Use the artificial bee colony algorithm and Q-learning algorithm to solve the optimization problem, initialize the bee colony and food source, and randomly generate food sources, as shown in the following formula. Set the initial value of the Q table to 0.

[0149]

[0150] Hired bees use the following formula to find the current food source Adjacent food sources location.

[0151]

[0152] in, yes is the jth optimization parameter of , and k is the index of the food source.

[0153] If a new food source The returned fitness value is greater than the current food source The hired bees replace the current food with a new food source and update the Q table value by rewarding the selected new food source and penalizing the current food source.

[0154] On the contrary, if the new food source does not provide a better fitness value, the new food source will be penalized and the current food source will be rewarded. Whenever the hired bee finds a suitable food source, the Q table is updated. The Q table value is updated by the following formula:

[0155]

[0156] In the follower bee stage, the follower bee selects the food source of the employed bee from the Q value in the Q table according to the roulette method, searches for a new food source using the following formula, and replaces the current food source with the new food source. If the new food source has a higher fitness value, the Q value will also be updated.

[0157]

[0158] in Is near a food source The optimization parameters of is a random number in the interval [-1, 1], is the optimization parameter of the best food source caused by random selection.

[0159] Scouting bee stage: If multiple attempts to find a better nearby food source fail, the food source will be discarded, and the hired bees will become scout bees to randomly search for new food sources again and update the Q table.

[0160] The test is terminated, and the fitness value of the optimal solution obtained by the best bee colony in this iteration is obtained to determine whether the error condition is met; if the condition is met, the optimal solution is output; otherwise, go to step S4. The termination condition is that the maximum number of iterations is reached or the fitness value of the optimal solution meets the error condition. The solution that meets the maximum fitness value is the optimal service component resource scheduling solution sought.

[0161] Provide component services for user requests according to the maximum value of the fitness function and its corresponding global optimal service component scheduling plan. where t a Indicates services jki Execution time.

[0162] In some selectable embodiments, the function / operation mentioned in the block diagram may not occur in the order mentioned in the operation diagram. For example, depending on the function / operation involved, the two boxes shown in succession can actually be executed substantially simultaneously or the boxes can sometimes be executed in reverse order. In addition, the embodiment presented and described in the flow chart of the present invention is provided by way of example, for the purpose of providing a more comprehensive understanding of technology. The disclosed method is not limited to the operation and logic flow presented herein. Selectable embodiments are expected, wherein the order of various operations is changed and the sub-operation of a part for which is described as a larger operation is performed independently.

[0163] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0164] Although the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.

[0165] The above is a specific description of the preferred implementation of the present invention, but the present invention is not limited to the described embodiments. Those skilled in the art may make various equivalent modifications or substitutions without violating the spirit of the present invention. These equivalent modifications or substitutions are all included in the scope defined by the claims of the present invention.

Claims

1. A resource scheduling method, characterized in that: include: Obtaining a service request from a user, and establishing a service request model according to the service request; Constructing the fitness function of the service request model according to the evaluation index and the constraint condition; wherein the evaluation index is the service execution time and the service execution cost; and the constraint condition is the resource utilization rate and the service execution timeout rate; The fitness function is solved by combining an artificial bee colony algorithm and a Q-leaming algorithm, and a scheduling scheme whose value of the fitness function satisfies an error condition is determined as an optimization target; Performing service component resource scheduling according to the optimization goal; The fitness function of the service request model is constructed according to the evaluation index and the constraint conditions, including: Construct a fitness function of the service execution time according to the service execution time; Constructing a fitness function of the service execution cost according to the service execution cost; Calculate resource utilization and timeout rate; Constructing a fitness function of the service request model according to the fitness function of the service execution time, the fitness function of the service execution cost, the resource utilization rate, and the timeout rate; The step of constructing a fitness function of the service execution time according to the service execution time includes: Calculate the total service execution time in each service component; Determine the maximum value of the total execution time of the services in all components and the minimum completion time required to complete all services according to the total execution time of the services; Constructing a fitness function of the service execution time in the service request model according to the maximum value of the total service execution time and the minimum completion time; Wherein, constructing a fitness function of the service execution cost according to the service execution cost includes: Calculate the sum of service execution costs for all services processed on each service component; Determining a minimum value of the service execution cost processed by the service component according to the sum of the service execution costs; Constructing a fitness function of the service execution cost in the service request model according to the total service execution cost and the minimum service execution cost; The calculation formula for calculating the total service execution time in each service component is: Among them, the v i represents the i-th service component; the s jki Represents the service s of the jth user jk Assigned to service component v i Execute; the ExtTime(s jki ) Representative Services jk In v i The execution time of the processing service; the length (s jk ) represents the length of the service sjk; the CPU (v i ) represents processing services jk CPU speed; The step of calculating the sum of service execution costs of all services processed on each service component includes: Calculate the single service execution cost when executing a single service in the service component; Calculate the sum of executing all services on all components according to the single service execution cost as the sum of service execution costs; The calculation formula for calculating the single service execution cost when executing a single service in the service component is: Cost(s jki )=(c1·ExtTime(s jki ))+(c2·ExtTime(s jki ))+(c3·ExtTime(s jki )) Among them, s jki Represents the service s of the jth user jk Assigned to service component v i Execution; Cost(s jki ) Representative Services jk The service execution cost in the i-th service component; c1 represents the service execution cost in v i The CPU usage cost per unit time in v i The memory usage cost per unit time in v i The bandwidth usage cost per unit time in ExtTime(s jki ) Representative Services jk In v i The execution time of the processing service; The calculation formula for calculating the sum of all services executed on all components according to the single service execution cost is: Among them, TCost represents the total cost of service execution; m represents the total number of service components; i represents the serial number of service components; n represents the total number of users; j represents the serial number of users; p represents the total number of services; k represents the serial number of services; s jki Represents the service s of the jth user jk Assigned to service component v i Execution; Cost(s jki ) Representative Services jk The cost of service execution in the ith service component.

2. A resource scheduling method according to claim 1, characterized in that: The obtaining of the service request proposed by the user and establishing a service request model according to the service request includes: Obtain service requests from users; Acquire a service component set and a service set according to the service name of the service request; A service request model is constructed according to the service component set and the service set.

3. A resource scheduling method according to claim 1, characterized in that: The method of solving the fitness function by combining the artificial bee colony algorithm and the Q-learning algorithm and determining the scheduling scheme whose value of the fitness function satisfies the error condition as the optimization target includes: Initialize the bee colony, food source and configure algorithm parameters; Constructing a Q-table according to a Q-learning algorithm; wherein the Q-table is used to store all expected states, actions, and Q values; and the Q value is determined by a combination of the state and the action; In the employed bee stage, the employed bees determine the positions of the adjacent food sources of the current food source, and update the Q table according to the positions of the adjacent food sources; In the follower bee stage, the follower bee randomly selects the employed bee food source from the Q table according to the roulette method; obtains a new food source according to the selected employed bee food source; Substituting the selected employed bee food source with the new food source; When the fitness value of the new food source exceeds the selected hired bee food source, the Q value is updated; In the scout bee stage, when the number of failures to obtain the new food source whose fitness value exceeds the selected hired bee food source exceeds a predetermined threshold, a new food source is randomly searched and the Q table is updated; wherein the fitness value is calculated by a fitness function; Repeating the process in the employed bee stage, the employed bees determine the location of the adjacent food source of the current food source, and updating the Q table according to the location of the adjacent food source until the maximum number of iterations is reached or the fitness value of the action plan in the Q table meets the error condition; The final action plan in the Q table is determined as the optimal service component resource scheduling plan.

4. A resource scheduling method according to claim 3, characterized in that: The Q value is determined by the state and the action combination, including: The calculation formula of the Q value is: Among them, Q t+1 (b t , a t ) is the Q value at time t+1; α is the learning rate; a t is the action at time t; is the optimal action at time t; γ is the discount factor; r t is in state b t The penalty or reward obtained by executing the action; δ is the transition function; is an estimate of the optimal value.