Micro-service deployment method, system, device, medium and product

By performing load testing on microservices and optimizing genetic algorithms, combined with time series forecasting, and dynamically adjusting resource allocation, the problems of resource waste and substandard performance in microservice deployment were solved, thereby improving deployment efficiency and reliability.

CN122018924APending Publication Date: 2026-05-12CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD
Filing Date
2026-01-28
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Existing microservice deployment solutions struggle to find the globally optimal solution, leading to resource waste or substandard performance, which impacts deployment efficiency and reliability.

Method used

By load testing the target microservices and collecting performance metrics data, the initial container deployment scale is determined in conjunction with the preset service level targets. An improved genetic algorithm is used to optimize the node resource allocation scheme, including selecting the order of crossover or mutation operations based on the fitness values ​​of individuals in the population, predicting node costs in conjunction with time series prediction algorithms, and dynamically adjusting the cluster resource configuration.

Benefits of technology

It achieves globally optimal node resource allocation, improving the efficiency, reliability, and resource utilization of microservice deployment, and ensuring the reasonable allocation and performance stability of container resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122018924A_ABST
    Figure CN122018924A_ABST
Patent Text Reader

Abstract

The invention discloses a micro-service deployment method, system, device, medium and product, and the method comprises the steps: firstly carrying out load testing on an application program of a target micro-service, collecting performance index data, and determining an initial container deployment scale of the application program according to the performance index data and a preset service level target; secondly, optimizing a node resource allocation scheme required by the micro-service for deploying the initial container deployment scale by adopting an improved genetic algorithm; wherein the improved genetic algorithm selects a sequence for executing crossover operation or mutation operation on individuals according to fitness values of the individuals in a population; and finally, based on the optimized node resource allocation scheme, executing container deployment of the target micro-service. According to the invention, the container resource utilization rate and the performance stability of micro-service deployment can be improved, so that the efficiency and the reliability of micro-service deployment are ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of cloud computing and distributed systems technology, and in particular to a microservice deployment method, system, device, medium and product. Background Technology

[0002] Microservices are a software architectural design pattern that decomposes an application into small, autonomous service units. These service units can be deployed, scaled, and maintained independently, and each service unit is itself a microservice. The software architectural style formed by microservices is called microservice architecture. Microservice architecture enables independent development and deployment of services by breaking down complex and cumbersome traditional applications into smaller, more manageable service units. In containerized microservices, container orchestration can automate a large number of operational tasks simultaneously. Therefore, finding an optimal container orchestration solution is crucial for achieving the best resource utilization in microservice deployments.

[0003] Existing solutions primarily optimize container utilization through greedy algorithms and cost modeling. However, greedy algorithms cannot guarantee a globally optimal solution because they aim to reach the global optimum through local optima at each step. In many cases, greedy algorithms easily get trapped in local optima and fail to find the global optimum. Cost modeling, on the other hand, can lead to unstable behavior during training due to the chosen cost model, causing fluctuations in resource allocation and impacting service performance.

[0004] In summary, existing microservice deployment solutions cannot guarantee finding the globally optimal solution for container orchestration, which can easily lead to resource waste or substandard performance, and cannot guarantee the efficiency and reliability of microservice deployment. Summary of the Invention

[0005] The purpose of this invention is to provide a microservice deployment method, system, device, medium, and product to improve the utilization rate and performance stability of container resources in microservice deployment, thereby ensuring the efficiency and reliability of microservice deployment.

[0006] To achieve the above objectives, the present invention provides a microservice deployment method, comprising: Perform load testing on the target microservice application and collect performance metrics data; Based on the performance metrics data and the preset service level targets, determine the initial container deployment scale of the application; An improved genetic algorithm is used to optimize the node resource allocation scheme required for deploying microservices at the initial container deployment scale; wherein, the improved genetic algorithm selects the order in which to perform crossover or mutation operations on individuals based on the fitness values ​​of individuals in the population; Based on the optimized node resource allocation scheme, the container deployment of the target microservice is executed.

[0007] Optionally, the improved genetic algorithm selects the order in which to perform crossover or mutation operations on individuals based on their fitness values ​​in the population, including: Calculate the normalized relative position of the current individual's fitness value within the overall fitness range of the current population; If the normalized relative position is less than or equal to one-half, then the current individual is determined to be a relatively low fitness individual, and a mutation operation is performed on the current individual first; If the normalized relative position is greater than one-half, then the current individual is determined to be a relatively high-fit individual, and crossover operation is performed on the current individual first.

[0008] Optionally, before optimizing the node resource allocation scheme required for deploying the microservices at the initial container deployment scale using an improved genetic algorithm, the method further includes: Using time series forecasting algorithms, the future costs of different types of nodes are predicted based on historical cost data. The predicted future cost of the node is used as one of the input parameters of the improved genetic algorithm.

[0009] Optionally, after executing the container deployment of the target microservice based on the optimized node resource allocation scheme, the method further includes: Monitor the running status of the application in the cluster; When the detected changes in the operating status exceed the preset change threshold, the improved genetic algorithm is re-applied to generate a new node resource allocation scheme based on the current operating status. Adjust the cluster resource configuration according to the new node resource allocation scheme.

[0010] Optionally, determining the initial container deployment scale of the application based on the performance metric data and preset service level targets includes: Based on the performance metrics data, determine the maximum request load that a single container instance can handle; The initial container deployment size is calculated based on the maximum request load and the preset service level target.

[0011] Optionally, the load testing of the target microservice application and the collection of performance metric data include: Use programmable load testing tools to simulate user behavior in order to perform load tests; The test load is adjusted by an automated script based on the performance metrics collected during the load test until the failure rate of the target microservice application reaches a preset threshold, thereby obtaining performance metric data.

[0012] To achieve the above objectives, the present invention also provides a microservice deployment system, comprising: The load testing module is used to perform load testing on the target microservice application and collect performance metrics data. The container deployment scale analysis module is used to determine the initial container deployment scale of the application based on the performance index data and the preset service level target. The resource optimization scheme generation module is used to optimize the node resource allocation scheme required for deploying microservices at the initial container deployment scale using an improved genetic algorithm; wherein, the improved genetic algorithm selects the order in which to perform crossover or mutation operations on individuals based on the fitness values ​​of individuals in the population; The deployment module is used to perform container deployment of the target microservice based on the optimized node resource allocation scheme.

[0013] To achieve the above objectives, the present invention also provides a microservice deployment device, comprising: a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor executes the computer program to implement the microservice deployment method as described above.

[0014] To achieve the above objectives, the present invention also provides a computer-readable storage medium storing a computer program, wherein the computer program, when running, controls the device where the computer-readable storage medium is located to execute the microservice deployment method described in any of the above embodiments.

[0015] To achieve the above objectives, the present invention also provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the microservice deployment method as described in any of the above.

[0016] Compared with existing technologies, the present invention provides a microservice deployment method, system, device, medium and product. The present invention achieves globally optimal node resource allocation by balancing population diversity and convergence through an improved genetic algorithm, ensuring that the initial container deployment scale and resource allocation scheme are in line with the actual application needs. It solves the problems of resource waste or performance failure that are easily caused by existing solutions, and can improve the efficiency, reliability and resource utilization of microservice deployment. Attached Figure Description

[0017] To more clearly illustrate the technical solution of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 This is a flowchart illustrating a microservice deployment method provided in an embodiment of the present invention; Figure 2 This is a flowchart illustrating an improved genetic algorithm execution order according to an embodiment of the present invention; Figure 3 This is a flowchart of a dynamic adjustment process for cluster CPU resources provided in an embodiment of the present invention; Figure 4 This is a structural block diagram of a microservice deployment system provided in an embodiment of the present invention; Figure 5 This is a structural block diagram of a microservice deployment device provided in an embodiment of the present invention. Detailed Implementation

[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0020] See Figure 1 , Figure 1 This is a flowchart illustrating a microservice deployment method provided in an embodiment of the present invention, the microservice deployment method comprising steps S1 to S4: Step S1: Perform load testing on the target microservice application and collect performance metrics data; In practice, the target microservice can be pre-configured based on the configuration information provided by the user, and the necessary network infrastructure can be built, including VPC (Virtual Private Cloud), network interfaces, management nodes and security groups and other related configurations.

[0021] It should be noted that, due to the dynamic nature of different microservice applications, application modeling is indispensable. Its core purpose is to accurately analyze the application's performance characteristics and scientifically determine the number of Pods (replicas) required for container deployment. Before performing application modeling, it is necessary to obtain the performance metrics of the target microservice as a data foundation. Therefore, this embodiment of the invention first performs load testing on the application of the target microservice and collects performance metrics.

[0022] In an optional embodiment, step S1 includes steps S101 to S102: Step S101: Use a programmable load testing tool to simulate user behavior in order to perform load testing; Step S1012: Adjust the test load using an automated script based on the performance metrics collected during the load test until the failure rate of the target microservice application reaches a preset threshold, thereby obtaining performance metric data.

[0023] For example, load testing of microservice applications can be performed using the open-source tool Locust, which simulates real user behavior and traffic through a programmable API. Furthermore, to automate the load testing process, this embodiment of the invention uses an automated script to handle the entire testing process. This script simulates user behavior, including user login, data query, and transaction processing, to more closely resemble real user behavior. It can dynamically adjust the number of concurrent users based on performance metrics (such as response time and throughput) collected during the test, eliminating the need for repeated manual testing. The duration of the load test is determined by the application, and the entire test will run until the failure rate reaches a specific threshold. After the load test is completed, the automated script can generate a detailed test report containing key performance indicators (such as response time, throughput, and failure rate) according to the testing requirements. This tool can automatically output load test reports, thereby further analyzing the application's performance characteristics.

[0024] It is worth noting that by simulating real user behavior, the embodiments of the present invention can make the collected performance indicators more consistent with actual application scenarios and the data has high reliability; the use of automated test scripts can reduce the tedium of testing and improve testing efficiency; testing until the failure rate reaches a preset threshold can help to understand the application performance limits and obtain more comprehensive performance boundary data.

[0025] Step S2: Determine the initial container deployment scale of the application based on the performance index data and the preset service level target; In an optional embodiment, step S2 includes steps S201 to S202: Step S201: Based on the performance index data, determine the maximum request load that a single container instance can handle; Step S202: Calculate the initial container deployment scale based on the maximum request load and the preset service level target.

[0026] It should be noted that the preset service level target refers to the key standards (such as response time limit, minimum throughput requirement, failure rate threshold, service availability percentage, etc.) that are clearly set by the user in advance to measure the quality of microservice operation, so as to ensure that the final microservice deployment and operation can meet the user's expected requirements for service performance and stability.

[0027] For example, an application analytics model can be built using pre-configured data provided by the user and collected performance metrics data. Specifically, the analytics model consists of a metrics analyzer and a Pod (replica) calculator. The metrics analyzer is generated by collecting metrics data from load tests, including CPU utilization, response time, throughput, and failure rate for each load. The goal of the metrics analyzer is to determine the maximum number of requests a single Pod can handle without degrading performance. The Pod calculator is generated by collecting data from the metrics analyzer and service level metrics, and its goal is to output the optimal initial number of Pods for deploying microservices, ensuring that the achieved performance is consistent with the application's resource requirements.

[0028] This invention determines the maximum request load of a single container based on real performance indicators obtained from load testing, and then calculates the initial container deployment scale in combination with the user's preset service level target. This ensures that the initial deployment meets the user's expected requirements for service performance and stability, while avoiding resource waste caused by too many containers or service failure caused by too few containers. It provides a more practical basis for subsequent resource allocation optimization.

[0029] Step S3: An improved genetic algorithm is used to optimize the node resource allocation scheme required for deploying the microservices at the initial container deployment scale; wherein, the improved genetic algorithm selects the order in which to perform crossover or mutation operations on individuals based on the fitness values ​​of individuals in the population; In one alternative embodiment, prior to step S3, the method further includes: Using time series forecasting algorithms, the future costs of different types of nodes are predicted based on historical cost data. The predicted future cost of the node is used as one of the input parameters of the improved genetic algorithm.

[0030] It should be noted that traditional resource allocation optimization methods (especially greedy algorithms and traditional genetic algorithms) cannot efficiently and reliably find the global optimum when solving the complex problem of microservice node configuration, which may lead to resource waste, excessive costs, or substandard performance. In specific implementation, this embodiment of the invention employs an optimization engine, mainly composed of a predictor, an optimizer, and a fitness function, to address the problem that traditional algorithms are prone to getting trapped in local optima. By comparing the resource availability of each node with the resource requirements of the current workload in real time, it ensures that the node's resources are fully utilized.

[0031] Specifically, the predictor's function is to analyze time-series data from the past three months, perform real-time training, and predict the cost of the current node. The predicted future cost of the node is then used as one of the input parameters to the improved genetic algorithm. Since the costs of different types of nodes exhibit significant variability, using a pre-trained model cannot guarantee the timeliness and accuracy of the prediction. Therefore, the predictor can choose a time-series prediction algorithm (such as the Prophet algorithm) instead of a pre-trained model, achieving more accurate real-time predictions. This algorithm is a time-series prediction algorithm based on a point-addition model. With its scalable parameter settings and flexible adaptability, it can effectively predict time-series data containing seasonal characteristics and abrupt changes, perfectly matching the complex changing characteristics of node costs.

[0032] The optimizer's role is to select the optimal node configuration scheme based on a given workload and the predicted current node cost. Traditional optimization schemes often employ brute-force search or greedy algorithms to achieve the optimization objective, but both have significant limitations: brute-force search requires traversing the entire search space, which becomes extremely computationally expensive and time-consuming when the search space is large, making it unsuitable for large-scale optimization scenarios; greedy algorithms, on the other hand, adhere to the principle of "choosing the current best at each step," easily missing better options due to being limited to local decisions and ultimately getting trapped in local optima. To address the shortcomings of these traditional algorithms, this invention proposes an improved genetic algorithm for efficient optimization of node configuration.

[0033] It's important to note that traditional genetic algorithms primarily involve selection, mutation, and crossover. The traditional process always involves crossover before mutation. However, in the early stages, the population is relatively concentrated and has low fitness. Crossover at this point reduces the probability of gene combinations, making it difficult to produce superior individuals. In later stages of evolution, the population is more concentrated and has high fitness. Performing mutation at this stage may disrupt the gene combinations of existing superior individuals, causing the population to lose diversity, leading to a loss of the optimal solution and slow convergence speed.

[0034] Therefore, this invention believes that in the implementation of genetic algorithms, it is necessary to flexibly adjust the ratio and strategy of crossover and mutation according to the characteristics of the population in order to balance the diversity and innovation of the population and thus find a better solution.

[0035] In one alternative embodiment, see Figure 2 , Figure 2 This is a flowchart illustrating an improved genetic algorithm execution order according to an embodiment of the present invention. Figure 2 As shown, The improved genetic algorithm selects the order in which to perform crossover or mutation operations on individuals based on their fitness values ​​in the population, including: Calculate the fitness value of the current individual. Within the current overall fitness range of the population [ , Normalized relative positions in ] ; If the normalized relative position is less than or equal to one-half, that is If the current individual is determined to be a relatively low fitness individual, then a mutation operation is performed on the current individual first, followed by a crossover operation. If the normalized relative position is greater than one-half, the current individual is determined to be a relatively high-fit individual, and a crossover operation is performed on the current individual before a mutation operation.

[0036] in, This represents the minimum fitness value for the entire population. This represents the maximum fitness value for the entire population.

[0037] It is worth noting that in genetic algorithms, individuals with high fitness typically represent successful traits in a specific environment, enabling them to outperform other individuals in competition. However, if the evolutionary process relies solely on these high-fitness individuals, the genetic diversity of the population may be significantly reduced, leading to premature convergence to a local optimum. Therefore, this embodiment of the invention, by first performing a crossover operation on these high-fitness individuals, can effectively preserve their superior traits while introducing new gene combinations, thereby promoting the maintenance of population diversity.

[0038] Individuals with low fitness typically perform poorly, and relying on them for crossbreeding may not produce beneficial offspring. Therefore, this invention argues that in the early stages of evolution, it is more suitable to explore new solution spaces and try different solutions through mutation. By first inducing mutation, individuals with low fitness can generate new gene combinations, which is particularly crucial in the early stages of evolution. Furthermore, more frequent mutation of individuals with low fitness enhances their mutation capacity, helping to break the current local optimum, explore unexplored solution spaces, and find better solutions in a broader range of solutions. This strategy can accelerate convergence to the global optimum, rather than being limited to the current local optimum.

[0039] Step S4: Based on the optimized node resource allocation scheme, execute the container deployment of the target microservice.

[0040] In summary, the service deployment method provided by this invention first performs load testing on the target microservice application and collects performance data. Combined with preset service level targets, the initial container deployment scale is accurately determined. Then, an improved genetic algorithm dynamically selects the order of crossover or mutation operations based on the fitness values ​​of individuals in the population to optimize the node resource allocation scheme. Finally, container deployment is executed based on the optimized scheme. This invention achieves globally optimal node resource allocation by balancing population diversity and convergence through an improved genetic algorithm, ensuring that the initial container deployment scale and resource allocation scheme both meet the actual application needs. This solves the problems of resource waste or performance failure that are easily caused by existing schemes, and can improve the efficiency, reliability, and resource utilization of microservice deployment.

[0041] In an optional embodiment, after step S4, the method further includes: Monitor the running status of the application in the cluster; When the detected changes in the operating status exceed the preset change threshold, the improved genetic algorithm is re-applied to generate a new node resource allocation scheme based on the current operating status. Adjust the cluster resource configuration according to the new node resource allocation scheme.

[0042] For example, see Figure 3 , Figure 3 This is a flowchart illustrating the dynamic adjustment of cluster CPU resources provided in an embodiment of the present invention. Figure 3As shown, first, CPU resources are allocated to the cluster based on the current operating requirements. Then, it is determined whether the current CPU usage has reached 80% or more of the overall CPU resource capacity. If so, the optimization engine is notified to increase the CPU resource amount of the cluster. Otherwise, it is determined whether the current CPU usage is less than 30% of the overall CPU resource capacity. If so, the optimization engine is notified to reduce the CPU resource amount of the cluster. If neither of the first two conditions is met, it is further determined whether the cluster has been adjusted to a stable state. If it is not stable, the above process is repeated until it is adjusted to a stable state.

[0043] It's important to note that microservice applications are dynamically changing, thus requiring efficient management and automated processes to ensure they maintain optimal performance in real time. Container orchestration tools like Kubernetes provide a fundamental and effective solution. Cluster elastic scaling, as a key component of container orchestration, can dynamically maintain service availability and scalability based on the application's real-time needs, which is crucial for reducing deployment costs for users.

[0044] The cluster elastic scaling mechanism in this embodiment of the invention mainly works as follows: after the container deployment of the target microservice is completed based on the optimized node resource allocation scheme, on the one hand, the current cluster configuration is synchronized with the optimization engine periodically to ensure that the cluster can be adjusted in a timely manner according to the application requirements; on the other hand, the running status of the application in the cluster is continuously monitored. When the monitored changes in the running status exceed the preset change threshold, the improved genetic algorithm is used again to generate a new node resource allocation scheme based on the latest running status, and the cluster resource configuration is adjusted according to the new scheme.

[0045] In practical implementation, an elastic scaler can be constructed using two components: an API worker and a scaling engine. The lightweight API worker communicates with the Kubernetes API server, continuously comparing the current configuration with the initial configuration. Once a configuration change is detected, the scaling engine is invoked. The scaling engine collects more relevant data through the API worker, applies heuristic algorithms to determine if the configuration change is significant, and updates the current configuration if a significant change is confirmed. Simultaneously, the optimization engine recommends the optimal node combination to the node allocator, working in conjunction with the regenerated node resource allocation scheme to achieve precise and dynamic adjustment of cluster resources.

[0046] See Figure 4 , Figure 4 This is a structural block diagram of a microservice deployment system provided in an embodiment of the present invention. The microservice deployment system includes: Load testing module 21 is used to perform load testing on the target microservice application and collect performance indicator data; The container deployment scale analysis module 22 is used to determine the initial container deployment scale of the application based on the performance index data and the preset service level target. The resource optimization scheme generation module 23 is used to optimize the node resource allocation scheme required for deploying the microservices at the initial container deployment scale using an improved genetic algorithm; wherein, the improved genetic algorithm selects the order in which to perform crossover or mutation operations on individuals based on the fitness values ​​of individuals in the population; Deployment module 24 is used to perform container deployment of the target microservice based on the optimized node resource allocation scheme.

[0047] In one alternative embodiment, the load testing module 21 is configured to: Use programmable load testing tools to simulate user behavior in order to perform load tests; The test load is adjusted by an automated script based on the performance metrics collected during the load test until the failure rate of the target microservice application reaches a preset threshold, thereby obtaining performance metric data.

[0048] In one optional embodiment, the container deployment scale analysis module 22 is used for: Based on the performance metrics data, determine the maximum request load that a single container instance can handle; The initial container deployment size is calculated based on the maximum request load and the preset service level target.

[0049] In one alternative embodiment, the improved genetic algorithm selects the order in which to perform crossover or mutation operations on individuals based on their fitness values ​​in the population, including: Calculate the normalized relative position of the current individual's fitness value within the overall fitness range of the current population; If the normalized relative position is less than or equal to one-half, then the current individual is determined to be a relatively low fitness individual, and a mutation operation is performed on the current individual first; If the normalized relative position is greater than one-half, then the current individual is determined to be a relatively high-fit individual, and crossover operation is performed on the current individual first.

[0050] In one optional embodiment, the microservice deployment system further includes a node cost prediction module, used for: Using time series forecasting algorithms, the future costs of different types of nodes are predicted based on historical cost data. The predicted future cost of the node is used as one of the input parameters of the improved genetic algorithm.

[0051] In one optional embodiment, the microservice deployment system further includes a cluster elastic scaling module, used for: Monitor the running status of the application in the cluster; When the detected changes in the operating status exceed the preset change threshold, the improved genetic algorithm is re-applied to generate a new node resource allocation scheme based on the current operating status. Adjust the cluster resource configuration according to the new node resource allocation scheme.

[0052] It should be noted that the microservice deployment system provided in this embodiment of the invention is used to execute all the process steps of the microservice deployment method in the above embodiment. The working principles and beneficial effects of the two are one-to-one, so they will not be described again.

[0053] See Figure 5 , Figure 5 This is a structural block diagram of a microservice deployment device provided in an embodiment of the present invention. The microservice deployment device includes a processor 31, a memory 32, and a computer program stored in the memory 32 and executable on the processor 31. When the processor 31 executes the computer program, it implements the steps in the various microservice deployment method embodiments described above, for example...

[0054] For example, the computer program may be divided into one or more modules / units, which are stored in the memory 32 and executed by the processor 31 to complete the present invention. The one or more modules / units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the microservice deployment device.

[0055] The microservice deployment device may include, but is not limited to, processor 31 and memory 32. Those skilled in the art will understand that the schematic diagram is merely an example of a microservice deployment device and does not constitute a limitation on the device. It may include more or fewer components than illustrated, or combine certain components, or different components. For example, the microservice deployment device may also include input / output devices, network access devices, buses, etc.

[0056] The processor 31 can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor. The processor 31 is the control center of the microservice deployment device, connecting various parts of the entire microservice deployment device through various interfaces and lines.

[0057] The memory 32 can be used to store the computer programs and / or modules. The processor 31 implements various functions of the microservice deployment device by running or executing the computer programs and / or modules stored in the memory 32 and calling the data stored in the memory 32. The memory 32 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as audio data, phonebook, etc.). In addition, the memory 32 may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.

[0058] Wherein, if the modules / units integrated by the microservice deployment device are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when the computer program is executed by the processor 31, it can implement the steps of the various method embodiments described above. Wherein, the computer program includes computer program code, which can be in the form of source code, object code, executable file, or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium, etc.

[0059] Furthermore, embodiments of the present invention also provide a computer program product, including a computer program / instruction, which, when executed by a processor, implements the microservice deployment method as described in any of the above embodiments.

[0060] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. A microservice deployment method, characterized in that, include: Perform load testing on the target microservice application and collect performance metrics data; Based on the performance metrics data and the preset service level targets, determine the initial container deployment scale of the application; An improved genetic algorithm is used to optimize the node resource allocation scheme required for deploying microservices at the initial container deployment scale; wherein, the improved genetic algorithm selects the order in which to perform crossover or mutation operations on individuals based on the fitness values ​​of individuals in the population; Based on the optimized node resource allocation scheme, the container deployment of the target microservice is executed.

2. The microservice deployment method as described in claim 1, characterized in that, The improved genetic algorithm selects the order in which to perform crossover or mutation operations on individuals based on their fitness values ​​in the population, including: Calculate the normalized relative position of the current individual's fitness value within the overall fitness range of the current population; If the normalized relative position is less than or equal to one-half, then the current individual is determined to be a relatively low fitness individual, and a mutation operation is performed on the current individual first; If the normalized relative position is greater than one-half, then the current individual is determined to be a relatively high-fit individual, and crossover operation is performed on the current individual first.

3. The microservice deployment method as described in claim 2, characterized in that, Before employing the improved genetic algorithm to optimize the node resource allocation scheme required for deploying the microservices at the initial container deployment scale, the method further includes: Using time series forecasting algorithms, the future costs of different types of nodes are predicted based on historical cost data. The predicted future cost of the node is used as one of the input parameters of the improved genetic algorithm.

4. The microservice deployment method as described in claim 1, characterized in that, After executing the container deployment of the target microservice based on the optimized node resource allocation scheme, the process further includes: Monitor the running status of the application in the cluster; When the detected changes in the operating status exceed the preset change threshold, the improved genetic algorithm is re-applied to generate a new node resource allocation scheme based on the current operating status. Adjust the cluster resource configuration according to the new node resource allocation scheme.

5. The microservice deployment method as described in claim 1, characterized in that, The step of determining the initial container deployment scale of the application based on the performance metric data and preset service level targets includes: Based on the performance metrics data, determine the maximum request load that a single container instance can handle; The initial container deployment size is calculated based on the maximum request load and the preset service level target.

6. The microservice deployment method as described in claim 1, characterized in that, The load testing of the target microservice application and the collection of performance metric data include: Use programmable load testing tools to simulate user behavior in order to perform load tests; The test load is adjusted by an automated script based on the performance metrics collected during the load test until the failure rate of the target microservice application reaches a preset threshold, thereby obtaining performance metric data.

7. A microservice deployment system, characterized in that, include: The load testing module is used to perform load testing on the target microservice application and collect performance metrics data. The container deployment scale analysis module is used to determine the initial container deployment scale of the application based on the performance index data and the preset service level target. The resource optimization scheme generation module is used to optimize the node resource allocation scheme required for deploying microservices at the initial container deployment scale using an improved genetic algorithm; wherein, the improved genetic algorithm selects the order in which to perform crossover or mutation operations on individuals based on the fitness values ​​of individuals in the population; The deployment module is used to perform container deployment of the target microservice based on the optimized node resource allocation scheme.

8. A microservice deployment device, characterized in that, include: A processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor, when executing the computer program, implements the microservice deployment method as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform the microservice deployment method as described in any one of claims 1 to 6.

10. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the method for microservice deployment as described in any one of claims 1 to 6.