Intelligent scheduling method, device, medium, and equipment for microservice applications

By using the particle swarm optimization algorithm in the cloud-edge cluster to balance load balancing and communication costs, the scheduling challenges of microservice applications are solved, efficient communication and resource utilization are achieved, and latency and resource waste are reduced.

CN119854372BActive Publication Date: 2025-09-26SHANDONG LANGCHAO YUNTOU INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510006664.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-03
Publication Date
2025-09-26
Estimated Expiration
2045-01-03

AI Technical Summary

Technical Problem

The high cost of cloud-edge network communication and uneven resource utilization pose challenges to the effective scheduling of microservice applications.

Method used

The particle swarm optimization algorithm is used, combined with the resource status information of the cloud-edge cluster and the resource demand information of the microservice application, to optimize the objective function to balance the total load balancing index and the total communication cost, determine the optimal scheduling node, deploy the microservice application through the container image, and collect service request information to optimize the particle swarm algorithm.

Benefits of technology

It reduces the communication delay between microservice applications in the cloud-edge collaborative environment, achieves good load-balanced resource utilization, reduces resource waste, and optimizes the deployment and communication efficiency of microservice applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119854372B_ABST
    Figure CN119854372B_ABST
Patent Text Reader

Abstract

The present invention provides an intelligent scheduling method, device, medium, and equipment for microservice applications. The method includes: periodically collecting resource status information of each node in a cloud-edge cluster; determining the resource demand information of each microservice application; using a particle swarm optimization algorithm to solve a global optimal scheduling solution; determining the architecture information of each optimal scheduling node, packaging the microservice application corresponding to the optimal scheduling node into a container image corresponding to the architecture information, and deploying the container image on the optimal scheduling node to achieve the deployment of the corresponding microservice application; collecting service request information of each microservice application when running on its respective optimal scheduling node, and calculating the current total load balancing index of the cloud-edge cluster; and optimizing the particle swarm optimization algorithm. The present invention can reduce the communication delay between microservice applications in a cloud-edge collaborative environment and improve the load balancing of the cloud-edge cluster.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of microservice application scheduling technology, and in particular to an intelligent scheduling method, device, medium, and equipment for microservice applications. Background Art

[0002] With the rise of cloud-edge collaborative computing, microservices architecture has been widely used in distributed systems to improve scalability, flexibility, and fault tolerance. However, the high cost of cloud-edge network communication and uneven resource utilization pose challenges to the effective scheduling of microservice applications. Summary of the Invention

[0003] In response to at least one of the above technical problems, embodiments of the present invention provide a method, apparatus, medium, and device for intelligent scheduling of microservice applications.

[0004] According to a first aspect, an embodiment of the present invention provides an intelligent scheduling method for microservice applications, including:

[0005] Periodically collect resource status information of each node in the cloud-edge cluster;

[0006] Determine the resource requirements of each microservice application;

[0007] Based on the resource status information of each node in the edge cloud cluster, the resource demand information of each microservice application, and a pre-set objective function, a particle swarm optimization algorithm is used to solve the global optimal scheduling solution; wherein, the global optimal scheduling solution includes the optimal scheduling node corresponding to each microservice application in the edge cloud cluster; the objective function takes balancing the total load balancing index of the edge cloud cluster and the total communication cost between microservice applications as the optimization goal;

[0008] Determine the architecture information of each optimal scheduling node, package the microservice application corresponding to the optimal scheduling node into a container image corresponding to the architecture information, and deploy the container image on the optimal scheduling node to implement the deployment of the corresponding microservice application;

[0009] Collect service request information of each microservice application when it runs on its own optimal scheduling node, and calculate the current total load balancing index of the cloud-edge cluster;

[0010] The particle swarm optimization algorithm is optimized according to the service request information and the current total load balancing index of the cloud-edge cluster.

[0011] In one embodiment, the objective function includes:

[0012] T=λ*B+(1-λ)*D

[0013] Wherein, T is the objective function, λ is the balance ratio between the total load balancing index and the total communication cost, D is the total communication cost, and B is the total load balancing index.

[0014] In one embodiment, the total load balancing index is calculated as follows:

[0015]

[0016] Wherein, B is the total load balancing index, is the resource utilization of the i-th node, is the average resource utilization, u is the number of nodes in the cloud-edge cluster, and resourcej is the type of resource.

[0017] In one embodiment, the total communication cost is calculated as follows:

[0018]

[0019] Wherein, D is the total communication cost, m is the number of microservice applications, and n is the number of microservice applications that have dependencies on the j-th microservice application; t(i, j) is the communication cost between the i-th microservice application and the j-th microservice application; if the i-th microservice application and the j-th microservice application are on the same node, then t(i, j) is 0; if the i-th microservice application and the j-th microservice application are not on the same node, then t(i, j) is the communication delay between the i-th microservice application and the j-th microservice application.

[0020] In one embodiment, the method of solving the global optimal scheduling solution using a particle swarm optimization algorithm based on the resource status information of each node in the cloud edge cluster, the resource demand information of each microservice application, and a preset objective function includes:

[0021] S1. Set an initial global optimal solution, which includes initial position vectors corresponding to m particles. The position vector of each particle includes u elements, each element is 0 or 1; in each particle's position vector, only one element is 1, and the rest are 0; the node corresponding to the position with element 1 is the node corresponding to the microservice application corresponding to the particle; u is the number of nodes in the cloud edge cluster, and m is the number of microservice applications;

[0022] S2. Update the velocity vector and position vector of each particle based on the dependencies between microservice applications, the current position vector, and the current velocity vector of each particle.

[0023] S3. Determine the current global optimal solution based on the updated velocity vector, position vector and the objective function;

[0024] S4, judging whether the iterative process meets the exit condition;

[0025] S5. If yes, output the current global optimal solution as the global optimal scheduling solution; otherwise, increase the number of iterations by 1 and return to S2.

[0026] In one embodiment, updating the velocity vector and position vector of the particle includes: updating the dth element in the velocity vector and the dth element in the position vector of the i-th particle using the following formula during the t-th iteration:

[0027]

[0028]

[0029] in, is the updated value of the dth element in the velocity vector of the i-th particle, λ is the balance ratio between the total load balancing index and the total communication cost, is the dth element in the velocity vector of the i-th particle, c1 is the degree of dependence of the microservice application corresponding to the i-th particle on other microservice applications, is the dth element in the local optimal position vector of the i-th particle, c2 is the degree of dependence of other microservice applications on the microservice application corresponding to the i-th particle, is the dth element in the global optimal position vector of the i-th particle, is the updated value of the dth element in the position vector of the i-th particle, is the dth element in the position vector of the i-th particle, depend(i,j) is the dependency relationship between the i-th microservice application and the j-th microservice application. If there is a dependency relationship between the i-th microservice application and the j-th microservice application, depend(i,j) is 1, otherwise it is 0.

[0030] In one embodiment, the method of solving a global optimal scheduling solution using a particle swarm optimization algorithm based on the resource status information of each node in the cloud edge cluster, the resource demand information of each microservice application, and a preset objective function further includes:

[0031] After each position update, the node corresponding to the microservice application corresponding to each particle is determined based on the position vector corresponding to the particle, and based on the resource demand information of the microservice application corresponding to the particle and the resource status information of the node corresponding to the microservice application, it is determined whether the resource upper limit that the node corresponding to the microservice application corresponding to the particle can accommodate meets the resource demand of the microservice application; if so, the position vector corresponding to the particle is determined to be available, otherwise the position vector corresponding to the particle is updated again.

[0032] According to a second aspect, an intelligent scheduling device for microservice applications provided by an embodiment of the present invention includes:

[0033] The status collection module is used to periodically collect resource status information of each node in the cloud-edge cluster;

[0034] Demand determination module, used to determine the resource demand information of each microservice application;

[0035] A solution solving module is used to solve a global optimal scheduling solution based on the resource status information of each node in the cloud edge cluster, the resource demand information of each microservice application, and a pre-set objective function, and adopt a particle swarm optimization algorithm; wherein the global optimal scheduling solution includes the optimal scheduling node corresponding to each microservice application in the cloud edge cluster; the objective function is to balance the total load balancing index of the cloud edge cluster and the total communication cost between microservice applications as the optimization goal;

[0036] An application deployment module is used to determine the architecture information of each optimal scheduling node, package the microservice application corresponding to the optimal scheduling node into a container image corresponding to the architecture information, and deploy the container image on the optimal scheduling node to implement the deployment of the corresponding microservice application;

[0037] An information collection module is used to collect service request information of each microservice application when it runs on its respective optimal scheduling node, and calculate the current total load balancing index of the cloud-edge cluster;

[0038] The algorithm optimization module is used to optimize the particle swarm optimization algorithm according to the service request information and the current total load balancing index of the cloud-edge cluster.

[0039] According to a third aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute the method provided in the first aspect.

[0040] According to a fourth aspect, an embodiment of the present invention provides a computing device, comprising a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method provided in the first aspect is implemented.

[0041] The intelligent scheduling method, apparatus, medium, and device for microservice applications provided in embodiments of the present invention utilize a particle swarm optimization algorithm to solve a global optimal scheduling solution based on the resource status information of each node in a cloud-edge cluster, the resource demand information of each microservice application, and a pre-set objective function. The objective function optimizes the solution by balancing the total load balancing index of the cloud-edge cluster and the total communication cost between microservice applications. Subsequently, based on the architecture information of each optimal scheduling node, the corresponding microservice application is packaged into a container image corresponding to the architecture information, and the container image is deployed on the optimal scheduling node to achieve the deployment of the corresponding microservice application. During the operation of the microservice application, service request information of each microservice application when running on its respective optimal scheduling node is collected, and the current total load balancing index of the cloud-edge cluster is calculated. The particle swarm optimization algorithm is optimized based on the service request information and the current total load balancing index of the cloud-edge cluster. Thus, in embodiments of the present invention, balancing the total load balancing index of the cloud-edge cluster and the total communication cost between microservice applications is optimized. Therefore, the resulting global optimal scheduling solution can reduce communication delays between microservice applications in a cloud-edge collaborative environment, achieving efficient communication between microservice applications. Moreover, the load balancing of the cloud-edge cluster is better, which can optimize the resource utilization of the cloud-edge cluster and reduce resource waste. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 Schematic diagram of a flow chart of an intelligent scheduling method for microservice applications in one embodiment of the present invention;

[0043] Figure 2 This is a structural block diagram of an intelligent scheduling device for microservice applications in one embodiment of the present invention. DETAILED DESCRIPTION

[0044] In the first aspect, the embodiment of the present invention provides an intelligent scheduling method for microservice applications, see Figure 1 The method includes the following steps S110 to S160:

[0045] S110, periodically collect resource status information of each node in the cloud edge cluster;

[0046] Among them, the cloud-edge cluster refers to the cluster formed by cloud nodes and edge nodes.

[0047] Among them, resources include CPU, memory, disk and other resources.

[0048] Specifically, an intelligent agent component can be installed on each node, and the intelligent agent component can periodically collect the CPU core number cpu_cor, CPU utilization cpu_util, CPU architecture cpu_architecture, memory usage mem_util, total memory space size mem_total, remaining memory space size mem_free, total disk space size disk_total, remaining disk space size disk_free, etc. of the node.

[0049] S120: Determine the resource requirement information of each microservice application;

[0050] It is understandable that each microservice application requires certain resources to run, so the resource requirement information of the microservice application is determined based on the characteristics of the microservice application.

[0051] S130. Based on the resource status information of each node in the cloud edge cluster, the resource demand information of each microservice application, and a pre-set objective function, a particle swarm optimization algorithm is used to solve a global optimal scheduling solution; wherein the global optimal scheduling solution includes the optimal scheduling node corresponding to each microservice application in the cloud edge cluster; the objective function takes balancing the total load balancing index of the cloud edge cluster and the total communication cost between microservice applications as the optimization goal;

[0052] It can be seen that the objective function is to minimize the total communication cost and maximize the load balancing.

[0053] In one embodiment, the objective function may include:

[0054] T=λ*B+(1-λ)*D

[0055] Wherein, T is the objective function, λ is the balance ratio between the total load balancing index and the total communication cost, D is the total communication cost, and B is the total load balancing index.

[0056] It can be seen that the smaller the objective function value of a solution is, the better the solution is.

[0057] The calculation formula of the total load balancing index may be:

[0058]

[0059] Wherein, B is the total load balancing index, is the resource utilization of the i-th node, is the average resource utilization, u is the number of nodes in the cloud-edge cluster, and resourcej is the type of resource.

[0060] Among them, resource types include CPU, memory, and disk.

[0061] The calculation formula for the total communication cost may be:

[0062]

[0063] Wherein, D is the total communication cost, m is the number of microservice applications, and n is the number of microservice applications that have dependencies on the j-th microservice application; t(i, j) is the communication cost between the i-th microservice application and the j-th microservice application; if the i-th microservice application and the j-th microservice application are on the same node, then t(i, j) is 0; if the i-th microservice application and the j-th microservice application are not on the same node, then t(i, j) is the communication delay between the i-th microservice application and the j-th microservice application.

[0064] S140: Determine the architecture information of each optimal scheduling node, package the microservice application corresponding to the optimal scheduling node into a container image corresponding to the architecture information, and deploy the container image on the optimal scheduling node to implement deployment of the corresponding microservice application;

[0065] Among them, architecture information, for example, ARM, X86 and other architectures.

[0066] It can be seen that S140 can use container technologies such as Docker to package the data packets of the microservice application and its dependencies into a container image corresponding to the architecture of the optimal scheduling node corresponding to the microservice application, and then deploy the container image on the optimal scheduling node to realize the deployment and installation of the microservice application. Only after the deployment and installation are completed can the microservice application run on the optimal scheduling node.

[0067] S150: Collect service request information of each microservice application when it runs on its own optimal scheduling node, and calculate the current total load balancing index of the cloud-edge cluster;

[0068] S160: Optimize the particle swarm optimization algorithm according to the service request information and the current total load balancing index of the cloud-edge cluster.

[0069] As can be seen, as each microservice application runs on its optimal scheduling node, service request information for each microservice application, such as response time and number of requests, is collected. Furthermore, the cloud-edge cluster's current total load balancing index is calculated, as shown in the calculation formula in B above. Based on this service request information and the total load balancing index, the particle swarm optimization algorithm is optimized, for example, by adjusting the weights within the algorithm.

[0070] In one embodiment, the step S130 of solving the global optimal scheduling solution using a particle swarm optimization algorithm based on the resource status information of each node in the cloud-edge cluster, the resource demand information of each microservice application, and a preset objective function may include S1 to S5:

[0071] S1. Set an initial global optimal solution, which includes initial position vectors corresponding to m particles. The position vector of each particle includes u elements, each element is 0 or 1; in each particle's position vector, only one element is 1, and the rest are 0; the node corresponding to the position with element 1 is the node corresponding to the microservice application corresponding to the particle; u is the number of nodes in the cloud edge cluster, and m is the number of microservice applications;

[0072] For example, in the position vector of a particle, if the second element is 1, it means that the node corresponding to the microservice application corresponding to the particle is the second node in the cloud edge cluster.

[0073] S2. Update the velocity vector and position vector of each particle based on the dependencies between microservice applications, the current position vector, and the current velocity vector of each particle.

[0074] The updating of the velocity vector and position vector of the particle in S2 may include: updating the dth element in the velocity vector and the dth element in the position vector of the i-th particle using the following formula during the t-th iteration:

[0075]

[0076] in, is the updated value of the dth element in the velocity vector of the i-th particle, λ is the balance ratio between the total load balancing index and the total communication cost, is the dth element in the velocity vector of the i-th particle, c1 is the degree of dependence of the microservice application corresponding to the i-th particle on other microservice applications, is the dth element in the local optimal position vector of the i-th particle, c2 is the degree of dependence of other microservice applications on the microservice application corresponding to the i-th particle, is the dth element in the global optimal position vector of the i-th particle, is the updated value of the dth element in the position vector of the i-th particle, is the dth element in the position vector of the i-th particle, depend(i,j) is the dependency relationship between the i-th microservice application and the j-th microservice application. If there is a dependency relationship between the i-th microservice application and the j-th microservice application, depend(i,j) is 1, otherwise it is 0.

[0077] It can be seen that speed and position are two variables that affect each other.

[0078] Among them, the value range of d is [1, 2, ..., u].

[0079] Among them, λ controls the global search ability and local search ability of the particle swarm optimization algorithm and its value is a constant.

[0080] It can be seen that in the t-th iteration, after using the above formula to update the d-th element in the velocity vector of the ith particle and the d-th element in the position vector, what is obtained is the d-th element in the velocity vector and the d-th element in the position vector in the t+1-th iteration.

[0081] Furthermore, to ensure the availability of the solution, S130 may further include:

[0082] After each position update, the node corresponding to the microservice application corresponding to each particle is determined based on the position vector corresponding to the particle, and based on the resource demand information of the microservice application corresponding to the particle and the resource status information of the node corresponding to the microservice application, it is determined whether the resource upper limit that the node corresponding to the microservice application corresponding to the particle can accommodate meets the resource demand of the microservice application; if so, the position vector corresponding to the particle is determined to be available, otherwise the position vector corresponding to the particle is updated again.

[0083] For example, if the resource limit that the node corresponding to the microservice application corresponding to a particle can accommodate meets the resource requirements of the microservice application, it can be expressed as follows:

[0084]

[0085]

[0086] Where w is the number of microservice applications on the j-th node, request_cpu(i) is the CPU demand of the i-th microservice application on the j-th node, cpu_core(node(j)) is the number of CPU cores of the j-th node, cpu_util(node(j)) is the CPU utilization of the j-th node, request_mem(i) is the memory demand of the i-th microservice application on the j-th node, mem_free(node(j)) is the memory capacity of the j-th node; request_dis(k)i is the disk demand of the i-th microservice application on the j-th node, disk_free(node(j))mem_free(node(j)) is the disk capacity of the j-th node.

[0087] S3. Determine the current global optimal solution based on the updated velocity vector, position vector and the objective function;

[0088] It can be seen that after each speed and position update, it is determined whether the current global optimal solution needs to be updated.

[0089] For example, if the objective function value of the solution after the speed and position are updated is less than the objective function value of the current global optimal solution, the current global optimal solution is updated to the solution after the speed and position are updated. If the objective function value of the solution after the speed and position are updated is greater than or equal to the objective function value of the current global optimal solution, the current global optimal solution is not updated.

[0090] S4, judging whether the iterative process meets the exit condition;

[0091] The exit condition may be that the number of iterations reaches a certain number, the objective function value reaches a certain value, or other conditions.

[0092] S5. If yes, output the current global optimal solution as the global optimal scheduling solution; otherwise, increase the number of iterations by 1 and return to S2.

[0093] It can be seen that in S130, based on the node resource status and the characteristics of the microservice application, the particle swarm optimization algorithm is used to formulate the global optimal scheduling plan.

[0094] In an embodiment of the present invention, the optimization goal is to balance the total load balancing index of the cloud-edge cluster and the total communication cost between microservice applications. Therefore, the final global optimal scheduling solution can reduce the communication delay between microservice applications in the cloud-edge collaborative environment and achieve efficient communication between microservice applications. Moreover, the load balancing of the cloud-edge cluster is better, which can optimize the resource utilization of the cloud-edge cluster and reduce resource waste. In addition, in an embodiment of the present invention, containerization technology is used to achieve rapid, consistent and flexible deployment of microservice applications, ensure environmental consistency, and simplify the migration and expansion of microservice applications in different computing nodes at the cloud-edge, that is, to achieve containerized delivery of microservice applications.

[0095] In the second aspect, the embodiment of the present invention provides an intelligent scheduling device for microservice applications, see Figure 2 , the apparatus 100 comprises:

[0096] The status collection module 110 is used to periodically collect resource status information of each node in the cloud edge cluster;

[0097] Demand determination module 120, used to determine the resource demand information of each microservice application;

[0098] The solution solving module 130 is configured to solve a global optimal scheduling solution using a particle swarm optimization algorithm based on the resource status information of each node in the cloud edge cluster, the resource demand information of each microservice application, and a pre-set objective function. The global optimal scheduling solution includes the optimal scheduling node corresponding to each microservice application in the cloud edge cluster. The objective function is to optimize the balance between the total load balancing index of the cloud edge cluster and the total communication cost between microservice applications.

[0099] The application deployment module 140 is used to determine the architecture information of each optimal scheduling node, package the microservice application corresponding to the optimal scheduling node into a container image corresponding to the architecture information, and deploy the container image on the optimal scheduling node to implement the deployment of the corresponding microservice application;

[0100] The information collection module 150 is used to collect service request information of each microservice application when it runs on its own optimal scheduling node, and calculate the current total load balancing index of the cloud-edge cluster;

[0101] The algorithm optimization module 160 is configured to optimize the particle swarm optimization algorithm according to the service request information and the current total load balancing index of the cloud-edge cluster.

[0102] In one embodiment, the objective function includes:

[0103] T=λ*B+(1-λ)*D

[0104] Wherein, T is the objective function, λ is the balance ratio between the total load balancing index and the total communication cost, D is the total communication cost, and B is the total load balancing index.

[0105] In one embodiment, the total load balancing index is calculated as follows:

[0106]

[0107] Wherein, B is the total load balancing index, is the resource utilization of the i-th node, is the average resource utilization, u is the number of nodes in the cloud-edge cluster, and resourcej is the type of resource.

[0108] In one embodiment, the total communication cost is calculated as follows:

[0109]

[0110] Wherein, D is the total communication cost, m is the number of microservice applications, and n is the number of microservice applications that have dependencies on the j-th microservice application; t(i, j) is the communication cost between the i-th microservice application and the j-th microservice application; if the i-th microservice application and the j-th microservice application are on the same node, then t(i, j) is 0; if the i-th microservice application and the j-th microservice application are not on the same node, then t(i, j) is the communication delay between the i-th microservice application and the j-th microservice application.

[0111] In one embodiment, the solution-solving module 130 is specifically configured to perform the following steps:

[0112] S1. Set an initial global optimal solution, which includes initial position vectors corresponding to m particles. The position vector of each particle includes u elements, each element is 0 or 1; in each particle's position vector, only one element is 1, and the rest are 0; the node corresponding to the position with element 1 is the node corresponding to the microservice application corresponding to the particle; u is the number of nodes in the cloud edge cluster, and m is the number of microservice applications;

[0113] S2. Update the velocity vector and position vector of each particle based on the dependencies between microservice applications, the current position vector, and the current velocity vector of each particle.

[0114] S3. Determine the current global optimal solution based on the updated velocity vector, position vector and the objective function;

[0115] S4, judging whether the iterative process meets the exit condition;

[0116] S5. If yes, output the current global optimal solution as the global optimal scheduling solution; otherwise, increase the number of iterations by 1 and return to S2.

[0117] In one embodiment, the process of updating the velocity vector and position vector of the particle in the solution solving module 130 may include: updating the dth element in the velocity vector and the dth element in the position vector of the i-th particle using the following formula in the t-th iteration:

[0118]

[0119] in, is the updated value of the dth element in the velocity vector of the i-th particle, λ is the balance ratio between the total load balancing index and the total communication cost, is the dth element in the velocity vector of the i-th particle, c1 is the degree of dependence of the microservice application corresponding to the i-th particle on other microservice applications, is the dth element in the local optimal position vector of the i-th particle, c2 is the degree of dependence of other microservice applications on the microservice application corresponding to the i-th particle, is the dth element in the global optimal position vector of the i-th particle, is the updated value of the dth element in the position vector of the i-th particle, is the dth element in the position vector of the i-th particle, depend(i,j) is the dependency relationship between the i-th microservice application and the j-th microservice application. If there is a dependency relationship between the i-th microservice application and the j-th microservice application, depend(i,j) is 1, otherwise it is 0.

[0120] In one embodiment, the solution-solving module 130 may also be configured to: determine the node corresponding to the microservice application corresponding to each particle based on the position vector corresponding to the particle after each position update, and determine whether the resource upper limit that the node corresponding to the microservice application corresponding to the particle can accommodate meets the resource demand of the microservice application based on the resource demand information of the microservice application corresponding to the particle and the resource status information of the node corresponding to the microservice application; if so, determine that the position vector corresponding to the particle is available; otherwise, update the position vector corresponding to the particle again.

[0121] It is understandable that the explanation, specific implementation, beneficial effects, examples, etc. of the relevant contents in the device provided by the embodiment of the present invention can be found in the corresponding parts of the method provided in the first aspect, and will not be repeated here.

[0122] In a third aspect, an embodiment of the present invention provides a computer-readable medium having computer instructions stored thereon. When the computer instructions are executed by a processor, the processor executes the method provided in the first aspect.

[0123] Specifically, a system or device equipped with a storage medium can be provided, on which software program codes that implement the functions of any of the above-mentioned embodiments are stored, and a computer (or CPU or MPU) of the system or device can be enabled to read and execute the program codes stored in the storage medium.

[0124] In this case, the program code itself read from the storage medium can realize the function of any one of the above-mentioned embodiments, and thus the program code and the storage medium storing the program code constitute part of the present invention.

[0125] Examples of storage media for providing program code include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), magnetic tapes, non-volatile memory cards, and ROMs. Alternatively, the program code can be downloaded from a server computer via a communication network.

[0126] In addition, it should be clear that the functions of any of the above embodiments can be achieved not only by executing the program code read by the computer, but also by enabling the operating system operating on the computer to complete part or all of the actual operations based on the instructions of the program code.

[0127] In addition, it can be understood that the program code read from the storage medium is written into a memory provided in an expansion board inserted into the computer or into a memory provided in an expansion module connected to the computer, and then based on the instructions of the program code, a CPU installed on the expansion board or expansion module is enabled to perform part or all of the actual operations, thereby realizing the functions of any of the above embodiments.

[0128] It is understandable that the explanation, specific implementation methods, beneficial effects, examples, etc. of the relevant contents in the computer-readable medium provided in the embodiment of the present invention can be found in the corresponding parts of the method provided in the first aspect, and will not be repeated here.

[0129] In a fourth aspect, an embodiment of this specification provides a computing device, comprising a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, it implements the method in any one of the embodiments in the specification.

[0130] It is understandable that the explanation, specific implementation, beneficial effects, examples, etc. of the relevant contents in the computing device provided by the embodiment of the present invention can be found in the corresponding parts of the method provided in the first aspect, and will not be repeated here.

[0131] The various embodiments in this specification are described in a progressive manner. Similar parts between the various embodiments can be referred to in conjunction with each other. Each embodiment focuses on the differences from other embodiments. In particular, the device embodiments are generally similar to the method embodiments, so the description is relatively simple. For relevant parts, refer to the description of the method embodiments.

[0132] Those skilled in the art will appreciate that in one or more of the above examples, the functions described in the present invention may be implemented using hardware, software, widgets, or any combination thereof. When implemented using software, these functions may be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium.

[0133] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent replacements, improvements, etc. made on the basis of the technical solution of the present invention should be included in the scope of protection of the present invention.

Claims

1. An intelligent scheduling method for microservice applications, characterized in that: include: Periodically collect resource status information of each node in the cloud-edge cluster; Determine the resource requirements of each microservice application; Based on the resource status information of each node in the edge cloud cluster, the resource demand information of each microservice application, and a pre-set objective function, a particle swarm optimization algorithm is used to solve the global optimal scheduling solution; wherein, the global optimal scheduling solution includes the optimal scheduling node corresponding to each microservice application in the edge cloud cluster; the objective function takes balancing the total load balancing index of the edge cloud cluster and the total communication cost between microservice applications as the optimization goal; Determine the architecture information of each optimal scheduling node, package the microservice application corresponding to the optimal scheduling node into a container image corresponding to the architecture information, and deploy the container image on the optimal scheduling node to implement the deployment of the corresponding microservice application; Collect service request information of each microservice application when it runs on its own optimal scheduling node, and calculate the current total load balancing index of the cloud-edge cluster; The particle swarm optimization algorithm is optimized according to the service request information and the current total load balancing index of the cloud-edge cluster.

2. The method according to claim 1, characterized in that The objective function includes: T=λ*B+(1-λ)*D Wherein, T is the objective function, λ is the balance ratio between the total load balancing index and the total communication cost, D is the total communication cost, and B is the total load balancing index.

3. The method according to claim 1, characterized in that The calculation formula of the total load balancing index is: Wherein, B is the total load balancing index, is the resource utilization of the i-th node, is the average resource utilization, u is the number of nodes in the cloud-edge cluster, and resourcej is the type of resource.

4. The method according to claim 1, wherein The calculation formula of the total communication cost is: Wherein, D is the total communication cost, m is the number of microservice applications, and n is the number of microservice applications that have dependencies on the j-th microservice application; t(i, j) is the communication cost between the i-th microservice application and the j-th microservice application; if the i-th microservice application and the j-th microservice application are on the same node, then t(i, j) is 0; if the i-th microservice application and the j-th microservice application are not on the same node, then t(i, j) is the communication delay between the i-th microservice application and the j-th microservice application.

5. The method according to claim 1, wherein The method uses a particle swarm optimization algorithm to solve a global optimal scheduling solution based on the resource status information of each node in the cloud edge cluster, the resource demand information of each microservice application, and a preset objective function, including: S1. Set an initial global optimal solution, which includes initial position vectors corresponding to m particles. The position vector of each particle includes u elements, each element is 0 or 1; in each particle's position vector, only one element is 1, and the rest are 0; the node corresponding to the position with element 1 is the node corresponding to the microservice application corresponding to the particle; u is the number of nodes in the cloud edge cluster, and m is the number of microservice applications; S2. Update the velocity vector and position vector of each particle based on the dependencies between microservice applications, the current position vector, and the current velocity vector of each particle. S3. Determine the current global optimal solution based on the updated velocity vector, position vector and the objective function; S4, judging whether the iterative process meets the exit condition; S5. If yes, output the current global optimal solution as the global optimal scheduling solution; otherwise, increase the number of iterations by 1 and return to S2.

6. The method according to claim 5, characterized in that The updating of the velocity vector and the position vector of the particle includes: updating the dth element in the velocity vector and the dth element in the position vector of the i-th particle using the following formula in the t-th iteration process: in, is the updated value of the dth element in the velocity vector of the i-th particle, λ is the balance ratio between the total load balancing index and the total communication cost, is the dth element in the velocity vector of the i-th particle, c1 is the degree of dependence of the microservice application corresponding to the i-th particle on other microservice applications, is the dth element in the local optimal position vector of the i-th particle, c2 is the degree of dependence of other microservice applications on the microservice application corresponding to the i-th particle, is the dth element in the global optimal position vector of the i-th particle, is the updated value of the dth element in the position vector of the i-th particle, is the dth element in the position vector of the i-th particle, depend(i,j) is the dependency relationship between the i-th microservice application and the j-th microservice application. If there is a dependency relationship between the i-th microservice application and the j-th microservice application, depend(i,j) is 1, otherwise it is 0.

7. The method according to claim 5, characterized in that The method further includes: solving a global optimal scheduling solution based on the resource status information of each node in the cloud edge cluster, the resource demand information of each microservice application, and a preset objective function, and using a particle swarm optimization algorithm to solve the global optimal scheduling solution. After each position update, the node corresponding to the microservice application corresponding to each particle is determined based on the position vector corresponding to the particle, and based on the resource demand information of the microservice application corresponding to the particle and the resource status information of the node corresponding to the microservice application, it is determined whether the resource upper limit that the node corresponding to the microservice application corresponding to the particle can accommodate meets the resource demand of the microservice application; if so, the position vector corresponding to the particle is determined to be available, otherwise the position vector corresponding to the particle is updated again.

8. An intelligent scheduling device for microservice applications, characterized in that: include: The status collection module is used to periodically collect resource status information of each node in the cloud-edge cluster; Demand determination module, used to determine the resource demand information of each microservice application; A solution solving module is used to solve a global optimal scheduling solution based on the resource status information of each node in the cloud edge cluster, the resource demand information of each microservice application, and a pre-set objective function, and adopt a particle swarm optimization algorithm; wherein the global optimal scheduling solution includes the optimal scheduling node corresponding to each microservice application in the cloud edge cluster; the objective function is to balance the total load balancing index of the cloud edge cluster and the total communication cost between microservice applications as the optimization goal; An application deployment module is used to determine the architecture information of each optimal scheduling node, package the microservice application corresponding to the optimal scheduling node into a container image corresponding to the architecture information, and deploy the container image on the optimal scheduling node to implement the deployment of the corresponding microservice application; An information collection module is used to collect service request information of each microservice application when it runs on its respective optimal scheduling node, and calculate the current total load balancing index of the cloud-edge cluster; The algorithm optimization module is used to optimize the particle swarm optimization algorithm according to the service request information and the current total load balancing index of the cloud-edge cluster.

9. A computer-readable storage medium, characterized in that A computer program is stored thereon, and when the computer program is executed in a computer, the computer is caused to execute the method according to any one of claims 1 to 7.

10. A computing device, characterized in that The method comprises a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Distributed task scheduling method and device and electronic equipment

    CN115509715A

  • Resource allocation method and system

    CN118051331A