Micro-service deployment method and system in cloud native environment
By combining greedy algorithms and multi-objective genetic algorithms, the deployment of microservices in the cloud native environment is optimized, the deployment of complex dependencies on resource-constrained servers is solved, and efficient and comprehensive system performance improvement is achieved. Reasonable allocation of resources to adapt to complex and changeable environments.
Patent Information
- Application Number
- CN202411306276.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-19
- Publication Date
- 2024-12-06
AI Technical Summary
In a cloud-native environment, it is difficult for the existing technology to efficiently deploy microservices with complex dependencies on resource-constrained servers, and the existing methods have limitations in the diversity convergence speed of optimization goals and the consumption of computing resources. Fully consider the dependency call relationship between microservices.
Adopt a microservice deployment method combining greedy algorithms and multi-objective genetic algorithms to build a multi-optimization deployment model. Through rapid feasible solution optimization algorithms and multi-objective optimization algorithms, the deployment cost and average response time are considered, and multi-instance micro-selected Service deployment, optimize the dependency call relationship between microservices.
It has achieved a more comprehensive system performance improvement, optimized a variety of performance indicators of the deployment solution, significantly improved optimization efficiency, and is suitable for large-scale and complex microservice scenarios, ensuring reasonable resource allocation and load balancing, and having dynamic adaptability.
Smart Images

Figure CN119094309A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of cloud native technology, and in particular to a microservice deployment method and system in a cloud native environment. Background Art
[0002] Cloud native technology has fundamentally changed the way applications are developed and run. Microservice architecture is a design concept that achieves decoupling by breaking down a single application into multiple lightweight microservices. These microservices are usually integrated in the form of containers, which have the advantages of continuous integration, lightweight, and easy deployment. Cloud computing has been widely adopted in scenarios involving IoT devices and mobile devices. It plays an important role in improving performance and reducing energy consumption of local devices by offloading computing tasks from local devices to the cloud. Due to the popularity of cloud native computing, microservice management and orchestration of central and edge clouds have been widely studied in recent years. Although the microservice design pattern is an approach to software and system architecture based on modularity and boundary concepts, requests between microservices make the dependencies between services more complex. In addition, microservice-based applications in a microservice system share the same set of microservices for similar functions. In a microservice-oriented computing platform, a fundamental problem is how to efficiently deploy microservices with complex dependencies on resource-constrained servers to meet the user's Quality of Service (QoS) constraints.
[0003] The Chinese patent document with publication number CN116233262A proposes a microservice deployment and request routing method and system based on edge network architecture, the method includes: determining microservice deployment strategy and routing request strategy based on edge network architecture, the edge network architecture includes multiple base stations and multiple edge servers, any base station is connected to multiple edge servers, and multiple microservices are deployed on any edge server, and determining microservice deployment and request routing method according to microservice deployment strategy and routing request strategy. Compared with the prior art, service deployment and request routing are considered to be two independent parts, which will cause the improvement of service quality to fall into local optimality, which is not conducive to global performance optimization. This method determines microservice deployment strategy and routing request strategy based on edge network architecture, and makes full use of the strong coupling relationship between the two, so that the system can support different types of request services under certain constraints, and respond to massive mobile user requests at the same time, thereby effectively reducing the system's response delay to user requests. However, this method has certain limitations in terms of the diversity convergence speed of optimization targets, computing resource consumption, etc., and does not consider the dependent call relationship between microservices.
[0004] A Chinese patent document with publication number CN115052033A proposes an effective containerized deployment method for microservices based on resource sharing in smart factories. The method establishes a system image pull delay model and communication overhead model based on the hierarchical structure of microservices and microservice chains, models the optimization problem as an integer quadratic programming problem, and can be solved by a commercial solver. This method can achieve the purpose of reducing image pull delay and communication overhead and thus improving the response efficiency of microservices through a microservice deployment solution based on resource sharing. However, this method converts the call dependencies between microservices into function chains, which ignores the resource conflicts between services across different function chains.
[0005] The Chinese patent document with publication number CN117041330A proposes a fine-grained deployment method and system for edge microservices based on reinforcement learning, which includes: constructing sets of edge servers, microservice types, application requests and mobile devices respectively, defining the element information in each set; establishing a microservice access model, and taking minimizing access delay as the optimization goal; constructing a deep deterministic policy gradient algorithm based on reward memory shaping to learn the optimal microservice deployment and routing strategy, and improving learning efficiency and stability based on the replay pool and target network; updating the Actor network through batch sample policy gradient, updating the Critic network with minimum loss function, and updating the target network using exponential smoothing; outputting the final microservice deployment strategy based on the optimization goal of minimum microservice access delay, and updating the microservice deployment status. This method can realize the reasonable allocation of microservice node resources, effectively reduce the communication overhead between microservices, and facilitate the dynamic adjustment of microservice deployment and routing paths. However, the reinforcement learning model of this method needs to learn the optimal strategy through multiple interactions with the environment, which may cause the training process to take a long time, affecting the rapid deployment and response capabilities. Summary of the invention
[0006] The purpose of the present invention is to provide a microservice deployment method and system in a cloud-native environment to address all or part of the above-mentioned problems, so as to deploy microservices more quickly and comprehensively.
[0007] The technical solution adopted by the present invention is as follows:
[0008] A microservice deployment method in a cloud native environment, comprising:
[0009] Build a microservice deployment model that includes multiple optimization goals;
[0010] Optimize an optimization target in the microservice deployment model using a fast feasible solution optimization algorithm;
[0011] A multi-objective optimization algorithm is used to optimize all optimization objectives of the service deployment model. The multi-objective optimization uses the optimization objectives optimized by the fast feasible solution optimization algorithm as initial solutions.
[0012] Furthermore, the optimization objectives in the microservice deployment model include at least deployment solution cost and average response time.
[0013] Furthermore, the deployment solution cost includes deployment cost and communication cost.
[0014] Furthermore, the deployment cost includes the sum of deployment costs of all microservices, and the deployment cost of each microservice is calculated based on the number of microservice instances deployed on each node of the microservice and the amount of resources used by each instance.
[0015] Furthermore, the microservice deployment model takes minimizing the sum of the deployment solution cost and the average response time as the objective function, and takes the computing resource upper limit of each server and the service capacity upper limit of each microservice as the constraint conditions.
[0016] Furthermore, the fast feasible solution optimization algorithm is a greedy algorithm.
[0017] Furthermore, the multi-objective optimization algorithm is a multi-objective genetic algorithm.
[0018] Furthermore, in the algorithm parameters of the genetic algorithm, the crossover rate and the mutation rate are both above 0.3.
[0019] Furthermore, in the algorithm parameters of the genetic algorithm, the population size is 50-300.
[0020] To solve all or part of the above problems, the present invention also provides a microservice deployment system in a cloud-native environment, comprising a processor and a storage medium, wherein the storage medium stores a computer program, and the processor is configured to execute the computer program in the storage medium to execute the above-mentioned microservice deployment method in the cloud-native environment.
[0021] In summary, due to the adoption of the above technical solution, the beneficial effects of the present invention are:
[0022] Compared with the prior art, the present invention has the following advantages in microservice deployment optimization:
[0023] 1. Multi-objective optimization capability: The present invention combines fast feasible solution optimization algorithms such as greedy algorithms and multi-objective optimization algorithms such as multi-objective genetic algorithms, and can further optimize multiple objectives based on a single objective (such as response time or cost). This capability enables the deployment solution to achieve optimization effects on multiple performance indicators (such as average response time, deployment solution cost, resource utilization, etc.), providing a more comprehensive system performance improvement.
[0024] 2. Excellent optimization efficiency and speed: By using the initial solution quickly generated by the greedy algorithm, the present invention accelerates the convergence process of the multi-objective genetic algorithm. This method significantly improves the optimization efficiency and reduces the calculation time. It is particularly suitable for large-scale and complex microservice deployment scenarios and meets the fast requirements of online deployment solution design algorithms.
[0025] 3. Considering microservice dependencies and multi-instance support: The present invention focuses on the dependency call relationship between microservices during the optimization process, constructs a call relationship graph and performs corresponding optimization. This method can effectively reduce the communication overhead between microservices and improve the overall performance of the system. In addition, the present invention supports the deployment optimization of multi-instance microservices to ensure load balancing and reasonable resource allocation between different instances.
[0026] 4. Ability to adapt to complex and changing environments: The method of the present invention is applicable to cloud-edge environments and can adjust microservice deployment plans according to dynamically changing network and resource conditions. This dynamic adaptability enables the system to maintain efficient resource utilization and service quality in complex and changing environments.
[0027] In general, the present invention provides an efficient and comprehensive optimization method for microservice deployment solutions by combining greedy algorithms and multi-objective genetic algorithms. It not only achieves optimization on multiple targets, improves system performance and resource utilization, but also accelerates the optimization process, and is suitable for large-scale and complex microservice scenarios. The method performs well in handling microservice dependencies and multi-instance support, and has the ability to adapt to changes in a dynamic environment, providing a reliable solution for the efficient deployment and operation of microservice systems. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The present invention will now be described by way of example with reference to the accompanying drawings, in which:
[0029] Figure 1 Is a call graph with multiple call graphs.
[0030] Figure 2 It is the user request routing graph.
[0031] Figure 3 It is a performance test chart combining the greedy algorithm with the multi-objective genetic algorithm.
[0032] Figure 4 It is the performance test chart of multi-objective genetic algorithm.
[0033] Figure 5 It is the convergence speed graph of the combination of greedy algorithm and multi-objective genetic algorithm.
[0034] Figure 6 It is the convergence rate graph of the multi-objective genetic algorithm.
[0035] Figure 7 This is a comparison chart of the convergence speed of multiple algorithms.
[0036] Figure 8 It is the convergence speed graph of the multi-objective genetic algorithm when the crossover rate and mutation rate are (0.3, 0.2).
[0037] Fig. 9 It is the convergence speed graph of the multi-objective genetic algorithm when the crossover rate and mutation rate are (0.3, 0.3).
[0038] Fig.10 It is the convergence speed graph of the multi-objective genetic algorithm when the crossover rate and mutation rate are (0.5, 0.5). DETAILED DESCRIPTION
[0039] All features disclosed in this specification, or steps in all methods or processes disclosed, except mutually exclusive features and / or steps, can be combined in any manner.
[0040] Any feature disclosed in this specification (including any additional claims and abstract), unless otherwise stated, may be replaced by other equivalent or alternative features having similar purposes. That is, unless otherwise stated, each feature is only an example of a series of equivalent or similar features.
[0041] Example 1
[0042] With the full adoption of cloud, edge, and fog computing architectures, business logic has become increasingly complex and user needs have become more diversified, which together have led to challenges in DevOps performance. In order to improve the flexibility and efficiency of service management, microservice architecture and container technology have been widely adopted by the industry. They achieve continuous integration and continuous deployment by breaking down traditional monolithic applications into multiple independent, loosely coupled microservices and encapsulating these services in containers. Although microservice architecture is a software design approach based on modularity and clearly defined service boundaries, the interaction and request processing between microservices increase the complexity of service dependencies. In addition, applications in a microservice system often need to reuse the same set of microservices for similar functions, which further exacerbates the interdependence between services and makes management and maintenance more complicated.
[0043] Figure 1 Depicts an example application consisting of eight microservices, showing the dependencies between these services. The original request from the user activates a series of interactions between related microservices, which form the so-called call graph. In an application based on a microservice architecture, each application programming interface (API) may represent different functions and may contain multiple such call graphs, resulting in differences in the application's response time. Figure 1 For example, different user requests may trigger different call graphs, such as call graph A and call graph B. This means that in actual application scenarios, it cannot be ignored that each type of call graph has its unique dependency structure and quality of service (QoS) requirements.
[0044] In the microservice deployment model, there are several key entities involved: users, servers, and services. Figure 2 As shown, users initiate requests, and the base station receives these requests and forwards them to the corresponding edge servers. The servers process these requests based on their current service deployment status. Due to the limitation of computing resources, each edge server can only deploy some services.
[0045] This embodiment introduces a microservice deployment method in a cloud native environment, including:
[0046] 1) Build a microservice deployment model that includes multiple optimization objectives.
[0047] 2) Utilize a fast feasible solution optimization algorithm to optimize an optimization target in the microservice deployment model.
[0048] 3) Utilizing a multi-objective optimization algorithm to optimize all optimization objectives of the service deployment model, wherein the multi-objective optimization uses the optimization objectives optimized by the fast feasible solution optimization algorithm as initial solutions.
[0049] In this embodiment, a call relationship graph is constructed for the dependent call relationships between the selected multiple microservices constituting the application, and a microservice deployment model is constructed based on the call relationship graph. According to Alibaba microservice tracking data request, the optimal deployment solution of a single goal (such as average response time or deployment solution cost, etc.) based on the greedy algorithm of the current call relationship graph is solved, and a multi-objective genetic algorithm for multiple goals is designed and the previous moral greedy solution is used as part of the initial solution for convergence acceleration, and finally the microservice deployment solution obtained by the optimization method under multiple goals is obtained.
[0050] The features involved in each step are described in detail below. In this embodiment, the explanation of the parameters that may be involved is shown in Table 1.
[0051] Table 1 Parameter explanation
[0052]
[0053]
[0054] In step 1), the optimization objectives in the microservice deployment model include at least the deployment solution cost and the average response time. Of course, this does not mean that the optimization objectives are only the deployment solution cost and the average response time, but also other optimization objectives such as resource utilization.
[0055] 1. Deployment solution cost
[0056] The cost of the deployment solution is considered in two parts. The first part is the deployment cost d cost(si) , which is calculated based on the number of microservice instances deployed on each node and the amount of resources used by each instance. Therefore, the microservice deployment cost is:
[0057]
[0058] The total deployment cost of the system includes the sum of the deployment costs of all microservices:
[0059]
[0060] The second part is the communication cost T cost(i,j) ,This part of the invention is specifically set according to the connection relationship between servers. Therefore, the total cost of the system is as follows:
[0061] C=D cost +T cost(i,j) (0.3)
[0062] 2. Average response time
[0063] There are many load balancing algorithms used in microservice systems that support multiple service instances, such as polling, weighted, random, etc. Please note that the present invention considers the commonly used round-robin routing in the formula; the main process of request routing in the microservice system is as follows Figure 2 The transmission between the user and the server is not considered because it depends on many factors outside the system, and the present invention also assumes that the user's request is sent to the nearest server first. Under the round-robin routing algorithm, the service s in the system i All service instances of have the same probability of receiving requests for the service when there are enough requests. In this paper, the present invention assumes that the number of requests is large enough and the probability is the same. According to Table 1, therefore, server n k The probability of processing a request is:
[0064]
[0065] When calculating the average response time, the request processing time after receiving the request is not included to reduce the impact of individual microservice implementations. This article only includes latency and data transfer time. k Nearby users iThe response time of the request is recorded as Ts i,k .Ts i,k The formula is:
[0066]
[0067] Therefore, the average response time of the entire system is described as T i,j :
[0068]
[0069] In some embodiments, the microservice deployment model takes minimizing the sum of the deployment solution cost and the average response time as an objective function.
[0070] Since the microservice deployment model is an optimization problem, there are some constraints. The specific constraint settings are as follows. For computing resources, the resources used by the service instance should not exceed the resources provided by each server, that is, it should not exceed the computing resource upper limit of the server:
[0071]
[0072] Another constraint is the service capacity constraint, which ensures that there are enough service instances to handle requests from users and other services. i The total expected capacity includes the expected capacity of the user. The expected capacity is the capacity of the number of requests that the microservice instance can handle. This embodiment sets the number of requests that each microservice instance can handle, and calculates the number of instances required to deploy the microservice based on the number of requests.
[0073] For step 2), in some embodiments, a greedy algorithm is used as a fast feasible solution optimization algorithm.
[0074] Greedy algorithm is an algorithm strategy for solving optimization problems. Its core idea is to build a global optimal solution through a series of local optimal choices. The design and application of greedy algorithm mainly depends on the following key elements:
[0075] Selection criteria: Each problem requires a clear selection criterion to guide the selection of the local optimal solution at each step. This criterion is usually set according to the specific characteristics of the problem, such as selecting the node with the shortest distance among the unprocessed nodes in the shortest path problem, or selecting the item that can fill the current box first in the greedy packing problem.
[0076] Greedy selection: At each step, the greedy algorithm will make the current best choice, which is the best solution based on local information without considering the possible global impact in the future. The greedy selection process is usually based on simple calculations or sorting operations, which makes the algorithm execute faster.
[0077] Non-retrospective: A notable feature of greedy algorithms is that their choices cannot be reversed. Once a choice is made, the algorithm will not go back and correct it. Although this strategy reduces computational complexity, it also means that greedy algorithms cannot always find the global optimal solution, especially when the solution space of the problem has complex interactions.
[0078] Problem decomposition and gradual construction: Greedy algorithms usually decompose the problem into a series of sub-problems and build a global solution through a series of local optimal solutions. This process relies on each local choice to promote the construction of the overall solution.
[0079] The advantages of greedy algorithms are their execution speed and simple implementation, and they are suitable for scenarios where the problem is large and needs to be solved quickly. For example, greedy algorithms can be effectively applied to problems such as minimum spanning trees in graph theory (such as Prim or Kruskal algorithms), shortest path problems (such as Dijkstra algorithms), interval scheduling, and Huffman coding. However, greedy algorithms are not suitable for all problems, especially when the local optimal solution does not always lead to the global optimal solution. For these problems, greedy algorithms may produce suboptimal solutions, so it is necessary to carefully select the problem type and design the greedy strategy when using it.
[0080] In this embodiment, each service s i Optimal placement and calling of i Services and i The algorithm only considers at least one s i The instance is a server with sufficient computing resources. The algorithm evaluates the average response time and cost according to formula (1.3) and formula (1.6). The server with the smallest average response time and cost is selected as the microservice s i The best deployment server.
[0081] For step 3), in some embodiments, a multi-objective genetic algorithm is used as the multi-objective optimization algorithm.
[0082] The greedy algorithm can only be used for optimization problems under a single objective, and the greedy algorithm still has the problem of being trapped in a local optimum in addition to its advantage of fast execution speed. Therefore, this embodiment introduces a multi-objective genetic algorithm to optimize multiple optimization objectives simultaneously.
[0083] Genetic algorithm is an evolutionary computing method that simulates natural selection and genetics mechanisms and is widely used to solve complex optimization problems. Genetic algorithm simulates the process of biological evolution and gradually improves candidate solutions to find the optimal solution. The following are the main components and operation steps of genetic algorithm:
[0084] Individuals and groups: The basic unit in genetic algorithms is individuals. Each individual represents a solution and is usually represented in the form of chromosomes, which are the coded representation of the solution. A group consists of multiple individuals. In genetic algorithms, multiple groups participate in the evolution process together.
[0085] Initial population: When the genetic algorithm starts, the initial population is generated randomly or by specific rules. The diversity of the initial population has an important impact on the effectiveness of the algorithm and can help avoid local optimality.
[0086] Fitness function: The fitness function is used to evaluate the quality of each individual, that is, the effectiveness of the individual in solving the problem. The higher the fitness value, the better the individual's solution. This function is the core of the algorithm because it determines which individuals are selected for reproduction and evolution.
[0087] Selection: According to the fitness value, excellent individuals are selected for reproduction. Common selection methods include roulette selection, tournament selection and sorting selection. These methods ensure that individuals with high fitness have a greater chance of reproducing offspring.
[0088] Crossover and mutation:
[0089] Crossover: Producing new individuals (offspring) by exchanging parts of the chromosomes of two individuals, imitating the reproduction process in organisms. There are many forms of crossover operations, such as single-point crossover, multi-point crossover, and uniform crossover.
[0090] Mutation: Randomly changing certain genes in individual chromosomes to mimic genetic mutations in organisms. This process increases the diversity of the population, helps explore new areas of the solution space, and avoids falling into local optimality.
[0091] Generate new populations: Generate new populations through selection, crossover and mutation. After multiple generations of evolution, the new population gradually approaches the optimal solution.
[0092] Termination conditions: The termination conditions of genetic algorithms usually include reaching a predetermined number of generations, fitness threshold, or insufficient fitness improvement, etc. When the termination conditions are met, the algorithm stops and outputs the optimal solution.
[0093] The advantages of genetic algorithms are their powerful global search capabilities and adaptability to complex optimization problems, especially in optimization problems with large solution spaces, nonlinearity, and multiple peaks. However, genetic algorithms have high computational costs, especially in fitness evaluation and reproduction operations. At the same time, they are sensitive to parameter settings (such as population size, crossover rate, and mutation rate), which have an important impact on the convergence speed and effect of the algorithm.
[0094] This embodiment combines the greedy algorithm and the multi-objective genetic algorithm to optimize the microservice deployment scheme. Specifically, the greedy algorithm is first used to generate an initial single-objective optimization solution, which is optimized for a specific goal (such as average response time or cost). This stage utilizes the rapidity and directness of the greedy algorithm to quickly generate an initial solution with good performance, providing a good starting point for subsequent multi-objective optimization. Subsequently, the multi-objective genetic algorithm is used to further optimize the deployment scheme to consider multiple goals (such as response time, cost, etc.) at the same time. At this stage, the genetic algorithm starts from the initial solution generated by the greedy algorithm and explores the solution space through evolutionary operations such as crossover, mutation, and selection. In this way, the genetic algorithm not only utilizes the high-quality initial conditions of the greedy solution, but also can weigh and optimize on multiple goals.
[0095] The advantage of this combined approach is that it uses the speed of the greedy algorithm to solve the initial optimization problem, while further improving the comprehensiveness and quality of the optimization solution through the diversity and global search capabilities of the genetic algorithm. This method is particularly suitable for complex multi-objective optimization problems and can effectively improve system performance and resource utilization. This method can be applied in a cloud-edge environment, adapt to changing network and resource conditions, and achieve optimal resource utilization and service quality through dynamic adjustment.
[0096] The microservice deployment method designed in the embodiment of the present application is represented as a Greedy-GA algorithm. Figure 3 and Figure 4 From the comparative analysis, it can be seen that the multi-objective genetic algorithm combined with the greedy algorithm shows faster convergence speed and higher stability in the iteration process than the multi-objective genetic algorithm alone. Especially in the early stage of iteration, the high-quality initial solution provided by the greedy algorithm significantly accelerates the entire search process and reduces the time required to find the optimal solution. In the later iterations, the Greedy-GA algorithm continues to maintain stable performance, which shows that it has high reliability in the quality of the solution. In addition, the Greedy-GA algorithm also has obvious advantages in the quality of the generated solutions, which is reflected in the lower optimal average response time and lower deployment cost. Such an approach may be more adaptable in application scenarios that require fast optimization and efficient resource utilization. Overall, the Greedy-GA algorithm performs well in improving the efficiency and effectiveness of multi-objective optimization tasks, and provides a better solution for complex microservice deployment problems.
[0097] In addition, in this embodiment, the convergence speed and performance of different genetic algorithms are compared. Figure 5 and Figure 6 As shown. Figure 5 and Figure 6 It can be seen that the Greedy-GA algorithm performs better in both average response time and convergence speed.
[0098] In the comparative analysis, the random deployment solution became an infeasible solution because most of the generated solutions did not meet the constraints. In multiple experiments, only after generating 1,000 random deployment initial solutions did a feasible solution appear, and these feasible solutions usually had poor fitness, so they were eliminated in the comparative experiments. Figure 7 The performance of Greedy-GA, MOEA and NSGA in response time and cost is shown. Greedy-GA performs well in both aspects, with the response time always remaining at a low level and no infinity (inf) occurring, which shows that it has obvious advantages in the stability and reliability of the solution. In contrast, MOEA has a higher response time in the early stage and infinite values appear in some generations, suggesting that the algorithm performs poorly at these moments. Although NSGA also performs well in response time and cost control, Greedy-GA is more stable and superior in cost control. Overall, Greedy-GA provides a more stable and high-quality solution while maintaining low response time and cost, making it the best of the three methods. Such performance highlights its advantages in complex microservice deployment problems, especially in application scenarios that require fast response and efficient resource utilization, the Greedy-GA algorithm is particularly suitable.
[0099] Table 2 Comparison of average best fitness
[0100] method Average Best Fitness Random (0.8916054371,2523.1766666666) MOEA (0.7892358559,1822.0059999999) NSGA (0.6157567964,1740.9933333334) Greedy (0.7054126867,2308.0723333334) Greedy_GA (0.5938525594,1587.4130000001)
[0101] In the comparative experiments, the Greedy_GA method performed well in various performance indicators, especially in terms of average best fitness and convergence speed. The average best fitness of the Greedy_GA method is not only better than other optimization methods such as Random, MOEA, and NSGA, but also significantly improves the convergence speed of the genetic algorithm by introducing the greedy strategy as the initial solution. This method not only saves computing time in the process of finding the optimal solution, but also ensures a higher quality solution, giving it a significant advantage in microservice deployment optimization.
[0102] In addition, a sensitivity experiment was conducted in this example to verify the impact of the crossover rate and mutation rate on the performance of the proposed method.
[0103] In evolutionary algorithms, the choice of crossover rate and mutation rate has a significant impact on algorithm performance. The crossover rate determines how many individuals will produce offspring through the crossover operation, while the mutation rate controls the proportion of individuals that produce mutations. Reasonable selection and adjustment of crossover and mutation rates help balance the process of exploration and development, thereby improving the efficiency of the algorithm and the quality of the solution.
[0104] In the crossover and mutation rate sensitivity experiment, it was verified through multiple experiments that the crossover rate and mutation rate have a significant impact on the iterative convergence speed of the population. During the experiment, except for the crossover rate and mutation rate, other parameters such as population size, selection mechanism, generation and fitness function were kept consistent. The experimental results show that when the crossover rate and mutation rate are set to 0.3 or above, the iterative convergence speed of the population tends to be stable, and the convergence curve also shows high stability. This means that under these parameter settings, the algorithm can converge to the area close to the optimal solution more quickly and maintain a small solution set fluctuation during the iteration process. In contrast, when the crossover rate and mutation rate are set low, the convergence may be unstable. For example, when the crossover rate is 0.3 and the mutation rate is 0.2, the convergence curve shows large fluctuations, reflecting the uncertainty or local optimal solution dilemma of the algorithm in the search process.
[0105] Experiments show that when the crossover rate and mutation rate are set to 0.3 or 0.5 respectively, the convergence speed curves of the population are very similar, which indicates that adjusting these two parameters within these ranges has little effect on the final convergence effect and the algorithm exhibits a certain robustness. Figure 8 , Fig. 9 and Fig.10 The convergence curves for different combinations of crossover rate and mutation rate are shown. It can be seen that although there are slight differences, the convergence speed and stability of the algorithm under these settings are relatively consistent.
[0106] In the sensitivity experiment, the present invention deeply studied the influence of crossover rate and mutation rate on the performance of genetic algorithm. By systematically adjusting the crossover mutation rate and monitoring its influence on the optimal fitness of the average response time and deployment cost of the algorithm in each generation, the present invention found a remarkable phenomenon: when the crossover rate and mutation rate exceed 0.3, the performance of the algorithm tends to be stable. This observation reveals that the value of the crossover mutation rate above 0.3 is sufficient for the algorithm to fully explore the solution space and find a high-quality solution. The experimental data show that the average response time and deployment cost gradually decrease with the increase of the number of generations until a balance point is reached, which shows that the algorithm is effective in the optimization problem. In addition, the present invention notes that once the crossover rate and mutation rate exceed 0.3, further increasing the parameter does not bring additional performance improvement, which is particularly important in practical applications because it provides a clear guide for the selection of algorithm parameters. Through these findings, it can be inferred that there may be an optimal crossover mutation rate interval in the parameter adjustment of the genetic algorithm, which helps the algorithm to strike a balance between exploration and exploitation.
[0107] In addition, the present invention conducts a dynamic adjustment experiment of mutation rate and crossover rate. The goal of this experiment is to study the impact of dynamic adjustment of crossover rate and mutation rate on the performance of the optimization algorithm. The present invention adopts a phased adjustment strategy: adjust the crossover rate and mutation rate according to different stages of algorithm evolution. In the initial stage, a higher mutation rate and a lower crossover rate are set to increase population diversity; in the mid-term stage, the two are gradually balanced; in the later stage, the crossover rate is increased to accelerate convergence. The experimental findings are shown in Table 3.
[0108] Table 3 Comparison of dynamic crossover rate and mutation rate experiments
[0109]
[0110] In the experiment, it was found that the dynamic adjustment of the crossover rate and mutation rate did improve the convergence speed for the method using only genetic algorithm, but the effect on the combination of GA and greedy algorithm was not significant. This may be because the two methods have different characteristics and requirements in the optimization process. The combination of GA and Greedy method is essentially a multi-stage optimization strategy, in which Greedy method is usually used to quickly find a good initial solution or solve local problems, while GA is used for global search and optimization. In this combination method, Greedy method has provided a good solution in the initial stage, which may make the role of GA more focused on local refinement optimization rather than extensive exploration of solution space. Therefore, the adjustment of crossover rate and mutation rate within GA has a relatively small effect on the overall convergence speed. And in the experiment, it was found that although the dynamic adjustment of crossover rate and mutation rate has a certain improvement effect on the method using only genetic algorithm (GA), the improvement is not large. This may be due to the fact that factors such as the complexity of the problem, the diversity of the initial population, the design of the adjustment strategy and the parameter setting are not well coordinated, so this improvement may be very limited. When it comes to optimization problems, different optimization strategies and parameter settings often need to be adjusted and adapted to specific problems in order to achieve the best results.
[0111] In addition, this embodiment also conducts a population size experiment to verify the impact of population size on the performance of the proposed method. The results are shown in Table 4.
[0112] Table 4 Population size experimental comparison
[0113] Population size Average Best Fitness The average convergence algebra (approximately) 50 (0.6094966936,1966.2330000002) 200 100 (0.6115356355,1605.4509999998) 90 200 (0.5928532941,1608.5113333333) 120 300 (0.5938525594,1598.442) 75
[0114] Data analysis shows that the population size has a significant impact on the fitness and convergence speed of the optimization algorithm. Smaller population sizes (such as 50) are prone to falling into local optimal solutions, and often require more generations to converge during the experiment. This is because the diversity of small populations is insufficient and the solution space is not fully explored, resulting in the fact that although slightly better solutions can occasionally be found in the crossover mutation operation, the improvement is limited. Therefore, the convergence speed is slow under small population sizes and may stagnate near the local optimal solution. As the population size increases to 100, the fitness improves and the convergence speed accelerates, indicating that appropriately increasing the population size helps to improve the quality of the solution. However, when the population size continues to increase to 200, although the fitness is further improved, the convergence speed decreases, which may be due to the increase in population diversity. When the population size reaches 300, the convergence speed is the fastest and the fitness performance is good, but the computing time and resource consumption also increase significantly. This shows that the choice of population size requires a trade-off between the quality of the solution and the computational cost, especially in large problems. The sensitivity of the population size to the algorithm performance emphasizes the need to experimentally determine the optimal size to avoid unnecessary computational burden while ensuring the quality of the solution. In some embodiments, the population size is configured to be 50-300.
[0115] Example 2
[0116] This embodiment proposes a microservice deployment system in a cloud-native environment, including a processor and a storage medium, in which a computer program is stored. The processor is configured to execute the computer program in the storage medium to execute the microservice deployment method in the cloud-native environment in Example 1.
[0117] The present invention is not limited to the above-mentioned specific embodiments, but extends to any new features or any new combination disclosed in this specification, as well as any new method or process steps or any new combination disclosed.
Claims
1. A microservice deployment method in a cloud native environment, characterized in that: include: Build a microservice deployment model that includes multiple optimization goals; Optimize an optimization target in the microservice deployment model using a fast feasible solution optimization algorithm; A multi-objective optimization algorithm is used to optimize all optimization objectives of the service deployment model. The multi-objective optimization uses the optimization objectives optimized by the fast feasible solution optimization algorithm as initial solutions.
2. The microservice deployment method in a cloud native environment according to claim 1, characterized in that: The optimization objectives in the microservice deployment model include at least deployment solution cost and average response time.
3. The microservice deployment method in a cloud native environment as claimed in claim 2, characterized in that: The deployment solution cost includes deployment cost and communication cost.
4. The microservice deployment method in a cloud native environment as claimed in claim 3, characterized in that: The deployment cost includes the sum of the deployment costs of all microservices. The deployment cost of each microservice is calculated based on the number of microservice instances deployed on each node of the microservice and the amount of resources used by each instance.
5. The microservice deployment method in a cloud native environment as described in any one of claims 2 to 4, characterized in that: The microservice deployment model takes minimizing the sum of the deployment solution cost and the average response time as the objective function, and takes the computing resource upper limit of each server and the service capacity upper limit of each microservice as constraints.
6. The microservice deployment method in a cloud native environment according to claim 1, characterized in that: The fast feasible solution optimization algorithm is a greedy algorithm.
7. The microservice deployment method in a cloud native environment according to claim 1, characterized in that: The multi-objective optimization algorithm is a multi-objective genetic algorithm.
8. The microservice deployment method in a cloud native environment according to claim 7, characterized in that: Among the algorithm parameters of the genetic algorithm, the crossover rate and the mutation rate are both above 0.
3.
9. The microservice deployment method in a cloud native environment according to claim 7 or 8, characterized in that: In the algorithm parameters of the genetic algorithm, the population size is 50-300.
10. A microservice deployment system in a cloud native environment, comprising a processor and a storage medium, characterized in that: The storage medium stores a computer program, and the processor is configured to execute the computer program in the storage medium to perform the microservice deployment method in a cloud native environment as described in any one of claims 1-9.
Citation Information
Cited By
Micro-service deployment method and system in edge cloud environment
CN119922062A
A micro-service deployment method and system in an edge cloud environment
CN119922062B
Micro-service deployment method and device, electronic equipment and storage medium
CN120474928A
Micro-service deployment method and apparatus, electronic device, and storage medium
CN120474928B
