Micro-service capacity expansion and contraction method and device, computer equipment, readable storage medium and program product

By predicting and filtering the load monitoring data of microservice architecture applications, scaling processing based on load prediction is realized, solving the problem of insufficient expansion of microservice architecture system and improving the availability and resource utilization of application systems.

CN119276719AActive Publication Date: 2025-01-07SHENZHEN COMTOP INFORMATION TECH

Patent Information

Application Number
CN202411329728.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-24
Publication Date
2025-01-07
Estimated Expiration
2044-09-24

AI Technical Summary

Technical Problem

The existing microservice architecture has shortcomings in system expansion, which affects the availability of application systems.

Method used

By obtaining load monitoring data for microservice architecture applications, using preset load elastic scaling rules to filter the data, and input it into the preset load prediction model for load prediction, scaling and scaling judgment and processing based on the prediction results, achieving rapid , precise service deployment and adjustment.

Benefits of technology

Improve the expansion of microservice architecture applications, ensure the availability of application systems, and improve resource utilization in the system through scaling processing, reduce operational costs, support high concurrency and large-scale service deployment, and simplify microservice management , improve operation and maintenance efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119276719A_ABST
    Figure CN119276719A_ABST
Patent Text Reader

Abstract

The invention relates to a micro-service capacity expansion and contraction method and device, computer equipment, a computer readable storage medium and a computer program product. The method comprises the following steps: acquiring load monitoring data of a micro-service architecture application; carrying out filtering processing on the load monitoring data through a preset load elastic expansion rule to obtain rule filtering data; inputting the rule filtering data into a preset load prediction model to carry out load prediction processing to obtain an average load change trend index of the micro-service architecture application; carrying out diffusion capacity judgment processing to obtain a capacity expansion and contraction mode and diffusion capacity parameters; and the micro-service architecture application is subjected to capacity expansion and shrinkage processing. According to the method, capacity expansion and shrinkage are judged and processed according to the average load change trend index, and rapid and accurate service deployment and adjustment can be realized according to the real-time service load and the resource use condition, so that the expansibility of the micro-service architecture application is improved, and the availability of an application system is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a microservice scaling method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art

[0002] With the rapid development of Internet technology, applications based on microservice architecture are becoming more and more popular. Microservice is a software architecture model that divides applications into a series of independent services, each of which can be independently developed, deployed and expanded. With the development of cloud computing and container technology, microservice architecture has gradually become the mainstream choice for building scalable and easy-to-maintain application systems.

[0003] Currently, there are many microservice deployment solutions, such as those based on traditional virtual machine management systems, container technology based on Docker, and container orchestration systems based on Kubernetes. Docker focuses on lightweight containerization technology, which simplifies the packaging and distribution of applications, and Kubernetes provides powerful capabilities for automated deployment, expansion, and management of containerized applications. However, the current microservice solution has poor system scalability, which affects the availability of the entire application system. Summary of the invention

[0004] Based on this, it is necessary to provide a microservice scaling method, device, computer equipment, computer-readable storage medium and computer program product that can effectively improve the scalability of the system in response to the above technical problems.

[0005] In a first aspect, the present application provides a microservice scaling method, including:

[0006] Obtain load monitoring data for microservice architecture applications;

[0007] The load monitoring data is filtered by using preset load elastic scaling rules to obtain rule-filtered data;

[0008] Inputting the rule-filtered data into a preset load prediction model, performing load prediction processing through the load prediction model, and obtaining an average load change trend indicator of the microservice architecture application, wherein the preset load prediction model is trained based on historical load change data;

[0009] Perform diffusion capacity determination processing based on the average load change trend indicator to obtain a capacity expansion and contraction method and diffusion capacity parameters;

[0010] The microservice architecture application is scaled up or down according to the scaling method and the diffusion capacity parameters.

[0011] In one embodiment, the method further comprises:

[0012] Obtain rule configuration data through elastic scaling microservice components;

[0013] Perform parameter verification processing on the rule parameters in the rule configuration data through the resource management microservice component;

[0014] When the parameter verification passes, a preset load elastic scaling rule is generated based on the rule configuration data, and the preset load elastic scaling rule is saved.

[0015] In one embodiment, when the parameter verification passes, generating a preset load elastic scaling rule based on the rule configuration data, and saving the preset load elastic scaling rule includes:

[0016] If the parameter verification passes, generating a preset load elastic scaling rule based on the rule configuration data;

[0017] Identify the start and stop status information of the scaling rule;

[0018] When the start / stop status information indicates that the scaling rule is enabled, the preset load elastic scaling rule is saved in a rule database;

[0019] The load monitoring data is filtered by using preset load elastic scaling rules to obtain rule-filtered data;

[0020] Loading preset load elastic scaling rules of the microservice architecture application from a rule database;

[0021] The load monitoring data is filtered by using the loaded preset load elastic scaling rule to obtain rule-filtered data.

[0022] In one embodiment, the method further comprises:

[0023] Obtain deployment group binding data through the elastic scaling microservice component;

[0024] Perform parameter verification processing on the binding parameters in the deployment group binding data through the resource management microservice component;

[0025] If the verification process passes, the saved preset load elastic scaling rule is updated based on the deployment group binding data.

[0026] In one embodiment, filtering the load monitoring data by using a preset load elastic scaling rule to obtain rule-filtered data includes:

[0027] Control the microservice component through rules to search the rule database for preset load elastic scaling rules for the microservice architecture application;

[0028] By traversing the preset load elastic scaling rules, the load monitoring data is filtered to obtain rule-filtered data.

[0029] In one embodiment, the scaling of the microservice architecture application according to the scaling mode and the diffusion capacity parameter includes:

[0030] Based on the scaling mode and the diffusion capacity parameters, the microservice component is controlled by rules to generate scaling tasks;

[0031] The scaling task is sent to a host machine so that the microservice architecture application is scaled up or down through the host machine.

[0032] In a second aspect, the present application also provides a microservice scaling device, including:

[0033] Data acquisition module, used to obtain load monitoring data of microservice architecture applications;

[0034] A rule filtering module is used to filter the load monitoring data according to preset load elastic scaling rules to obtain rule filtered data;

[0035] An indicator prediction module, used to input the rule-filtered data into a preset load prediction model, perform load prediction processing through the load prediction model, and obtain an average load change trend indicator of the microservice architecture application, wherein the preset load prediction model is trained based on historical load change data;

[0036] A capacity expansion and contraction determination module, used to perform diffusion capacity determination processing based on the average load change trend indicator to obtain a capacity expansion and contraction mode and diffusion capacity parameters;

[0037] The expansion and contraction processing module is used to perform expansion and contraction processing on the microservice architecture application according to the expansion and contraction method and the diffusion capacity parameters.

[0038] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0039] Obtain load monitoring data for microservice architecture applications;

[0040] The load monitoring data is filtered by using preset load elastic scaling rules to obtain rule-filtered data;

[0041] Inputting the rule-filtered data into a preset load prediction model, performing load prediction processing through the load prediction model, and obtaining an average load change trend indicator of the microservice architecture application, wherein the preset load prediction model is trained based on historical load change data;

[0042] Perform diffusion capacity determination processing based on the average load change trend indicator to obtain a capacity expansion and contraction method and diffusion capacity parameters;

[0043] The microservice architecture application is scaled up or down according to the scaling method and the diffusion capacity parameters.

[0044] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:

[0045] Obtain load monitoring data for microservice architecture applications;

[0046] The load monitoring data is filtered by using preset load elastic scaling rules to obtain rule-filtered data;

[0047] Inputting the rule-filtered data into a preset load prediction model, performing load prediction processing through the load prediction model, and obtaining an average load change trend indicator of the microservice architecture application, wherein the preset load prediction model is trained based on historical load change data;

[0048] Perform diffusion capacity determination processing based on the average load change trend indicator to obtain a capacity expansion and contraction method and diffusion capacity parameters;

[0049] The microservice architecture application is scaled up or down according to the scaling method and the diffusion capacity parameters.

[0050] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:

[0051] Obtain load monitoring data for microservice architecture applications;

[0052] The load monitoring data is filtered by using preset load elastic scaling rules to obtain rule-filtered data;

[0053] Inputting the rule-filtered data into a preset load prediction model, performing load prediction processing through the load prediction model, and obtaining an average load change trend indicator of the microservice architecture application, wherein the preset load prediction model is trained based on historical load change data;

[0054] Perform diffusion capacity determination processing based on the average load change trend indicator to obtain a capacity expansion and contraction method and diffusion capacity parameters;

[0055] The microservice architecture application is scaled up or down according to the scaling method and the diffusion capacity parameters.

[0056] The above-mentioned microservice scaling method, device, computer equipment, computer-readable storage medium and computer program product obtain the load monitoring data of the microservice architecture application; and filter the load monitoring data through preset load elastic scaling rules to obtain rule filtering data; input the rule filtering data into a preset load prediction model, perform load prediction processing through the load prediction model, and obtain the average load change trend index of the microservice architecture application; perform diffusion capacity determination processing based on the average load change trend index to obtain the scaling method and diffusion capacity parameters; and perform scaling processing on the microservice architecture application according to the scaling method and diffusion capacity parameters. The present application collects the load monitoring data of the microservice architecture application, and filters the load monitoring data through load elasticity rules to screen out available rule filtering, and predicts the load change trend through a preset load prediction model to obtain the average load change trend index, and performs scaling determination and processing based on the average load change trend index. It can realize fast and accurate service deployment and adjustment according to the real-time business load and resource usage, thereby improving the scalability of the microservice architecture application and ensuring the availability of the application system. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments of the present application or the related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0058] FIG1 is an application environment diagram of a microservice scaling method in one embodiment;

[0059] FIG2 is a schematic diagram of a process of a microservice scaling method in one embodiment;

[0060] FIG3 is a schematic diagram of a flow chart of rule verification and rule storage steps in one embodiment;

[0061] FIG4 is a schematic diagram of a timing flow of a microservice scaling method in one embodiment;

[0062] FIG5 is a structural block diagram of a microservice expansion and contraction device in one embodiment;

[0063] FIG. 6 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0064] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0065] The microservice scaling method provided in the embodiment of the present application can be applied to the application environment shown in Figure 1. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. The terminal 102 communicates with the server 104 through the application on the terminal 102. When the user of the terminal 102 needs to run the virtual machine management system on the server 104, so as to package and distribute the microservice architecture application and automatically deploy it through the container technology on the virtual machine management system, the microservice scaling of the present application can be used to perform the scaling of the microservice architecture, thereby maintaining the stability of the application operation. The server 104 obtains the load monitoring data of the microservice architecture application; filters the load monitoring data through the preset load elastic scaling rules to obtain the rule filtering data; inputs the rule filtering data into the preset load prediction model, performs load prediction processing through the load prediction model, and obtains the average load change trend index of the microservice architecture application, and the preset load prediction model is trained based on the historical load change data; performs diffusion capacity determination processing based on the average load change trend index to obtain the expansion and contraction mode and diffusion capacity parameters; performs expansion and contraction processing on the microservice architecture application according to the expansion and contraction mode and diffusion capacity parameters. Among them, the terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices, and the Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car devices, projection devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. Head-mounted devices can be virtual reality (VR) devices, augmented reality (AR) devices, smart glasses, etc. The server 104 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services.

[0066] In an exemplary embodiment, as shown in FIG2 , a microservice scaling method is provided, which is described by taking the method applied to the terminal 102 in FIG1 as an example, and includes the following steps 201 to 207. Among them:

[0067] Step 201, obtain load monitoring data of the microservice architecture application.

[0068] Step 203: filter the load monitoring data using preset load elastic scaling rules to obtain rule-filtered data.

[0069] Among them, microservice architecture application refers to an application written based on the microservice architecture. Microservice is a software architecture model that divides the application into a series of independent services, each of which can be independently developed, deployed and expanded. In the solution of the present application, the various processing processes of microservice expansion and contraction processing are split into service components, and then the expansion and contraction processing of the microservice architecture application is performed through these components. Load monitoring data refers to the detection data obtained from the load-related data related to the application during the operation of the application, including CPU utilization, memory occupancy, network bandwidth, response time and call chain, etc. These data can be stored in a time series database and saved in time series. The preset load elastic scaling rule refers to the rule data used to determine the application load occupancy law. Since the collected load monitoring data may not fully meet the analysis requirements of the specific application, the preset load elastic scaling rules can be set in advance, and then the load monitoring data is filtered and processed through these rules to obtain the available rule filtering data.

[0070] Exemplarily, when a user needs to deploy an application in a virtual machine through container technology, such as Docker or Kubernetes, the microservice expansion and contraction method of the present application can be used to detect the running microservice applications to determine the resource occupancy change trend of these microservice applications. During the application operation process, the server 104 can synchronously obtain the load monitoring data of the microservice architecture applications running in the container, and determine the CPU utilization, memory usage, network bandwidth, response time, call chain and other data of each application. Then, in order to improve the availability of the data, the load monitoring data can be filtered through the preset load elastic scaling rules to obtain the rule filtering data that matches the current microservice architecture application, and then the expansion and contraction determination processing of the microservice is performed based on these rule filtering data. The rule filtering data can be used to filter out the rule filtering data that is suitable for load prediction and meets the time period and type requirements.

[0071] Step 205, input the rule-filtered data into a preset load prediction model, perform load prediction processing through the load prediction model, and obtain an average load change trend indicator of the microservice architecture application. The preset load prediction model is trained based on historical load change data.

[0072] Exemplarily, the preset load prediction model refers to a model for load prediction based on rule-filtered data. The preset load prediction model can be a model for prediction based on time series, such as a model based on long short-term memory neural network or a time series prediction model based on Prophet. The preset load prediction model can be specifically obtained based on historical load change data training, by intercepting the previous load change data as samples, and annotating the samples through subsequent load change results to obtain annotated model training data. Then, the training process of the load prediction model is completed through these model training data. The average load change trend index is the load change index value of the application instance predicted by the machine learning model. If the index value is high, it means that the monitored application instance will occupy more resources in the subsequent operation process, requiring a higher load, and needs to be expanded to ensure the stability of the application operation. If the index value is low, it means that the monitored application instance will occupy less resources in the subsequent operation process, and it can be reduced in capacity.

[0073] Step 207 , performing diffusion capacity determination processing based on the average load change trend indicator to obtain a capacity expansion / contraction method and diffusion capacity parameters.

[0074] Step 209: scaling the microservice architecture application according to the scaling method and the diffusion capacity parameters.

[0075] The scaling method refers to whether the microservice architecture application should be expanded or reduced in capacity, while the scaling parameters refer to the amount of resources that need to be expanded or reduced in capacity during the scaling process.

[0076] Exemplarily, after obtaining the average load change trend indicator, the diffusion capacity determination process can be performed based on the average load change trend indicator, thereby determining the capacity expansion and contraction method and diffusion capacity parameters that need to be implemented during the capacity expansion and contraction process. Then, based on the capacity expansion and contraction method and diffusion capacity parameters, the microservice architecture application deployed on the container is expanded and contracted. In one specific embodiment, a control instruction can be generated based on the capacity expansion and contraction method and diffusion capacity parameters, and then the control instruction can be sent to the host machine of the container to implement the corresponding capacity expansion and contraction process.

[0077] The above-mentioned microservice scaling method obtains the load monitoring data of the microservice architecture application; then filters the load monitoring data based on the preset load elastic scaling rules to obtain the rule filtering data; inputs the rule filtering data into the preset load prediction model, performs load prediction processing through the load prediction model, and obtains the average load change trend index of the microservice architecture application; performs diffusion capacity determination processing based on the average load change trend index to obtain the scaling method and diffusion capacity parameters; and performs scaling processing on the microservice architecture application according to the scaling method and diffusion capacity parameters. This application collects the load monitoring data of the microservice architecture application, and filters the load monitoring data through the load elasticity rules, thereby screening out the available rule filtering, and predicts the load change trend through the preset load prediction model, thereby obtaining the average load change trend index, and performs scaling determination and processing based on the average load change trend index, which can realize fast and accurate service deployment and adjustment according to the real-time business load and resource usage, thereby improving the scalability of the microservice architecture application and ensuring the availability of the application system. At the same time, through the scaling processing, the resource utilization rate in the system is effectively improved and the operating cost is reduced. While improving the scalability of the system, it can support high concurrency and large-scale service deployment, and by simplifying microservice management, it can further improve the system's operation and maintenance efficiency.

[0078] In an exemplary embodiment, as shown in FIG3 , the method further includes:

[0079] Step 302: Obtain rule configuration data through the elastic scaling microservice component.

[0080] Step 304: perform parameter verification processing on the rule parameters in the rule configuration data through the resource management microservice component.

[0081] Step 306: if the parameter verification passes, generate a preset load elastic scaling rule based on the rule configuration data, and save the preset load elastic scaling rule.

[0082] Among them, the elastic scaling microservice component (Scalable) refers to the component for processing the operation of elastic scaling rules. It can divide the relevant operations involving rule processing in the process of microservice expansion and contraction into a service, and use the elastic scaling microservice component to perform corresponding rule processing. The rule configuration data refers to the setting data corresponding to the rules formulated by the staff responsible for application expansion and contraction management. The staff can create load elastic scaling rules according to the actual expansion and contraction needs, and submit these data to the elastic scaling microservice component through the console for rule creation processing. The resource management microservice component (Resource) is mainly responsible for the creation of application deployment groups, supporting both virtual machine and container environments.

[0083] Exemplarily, before filtering data through rules, the configuration of rules needs to be completed. The rule configuration can be implemented specifically through the elastic scaling microservice component and the resource management microservice component. After the staff creates the rules based on the actual expansion and contraction requirements, they can submit the rule configuration data to the elastic scaling microservice component through the console. The elastic scaling microservice component submits this component to the resource management microservice component, and the resource management microservice component performs parameter verification on the rule parameters in the rule configuration data. The parameter verification mainly verifies the application parameters and group parameters in the rules. The resource management microservice component will feedback the verification results to the resource management microservice component, and then perform processing such as storage of the rules based on the verification results. If the parameter verification passes, the preset load elastic scaling rules can be directly generated based on the rule configuration data, and the preset load elastic scaling rules can be saved. In particular, in one of the embodiments, for the saving process of the preset load elastic scaling rules, it is necessary to generate the preset load elastic scaling rules based on the rule configuration data first when the parameter verification passes. Then identify the start and stop status information of the scaling rules; that is, determine whether the elastic scaling rules are turned on to balance the load. Only when the start and stop status information indicates that the scaling rules are turned on, the preset load elastic scaling rules are saved to the rule database SQL specifically used for rule data storage. Step 203 includes: loading the preset load elastic scaling rules of the microservice architecture application from the rule database; filtering the load monitoring data through the loaded preset load elastic scaling rules to obtain rule filtering data. That is, by reading the preset load elastic scaling rules from the rule database, filtering through the read rules, the efficiency and accuracy of the rule filtering process are guaranteed. In this embodiment, the management and verification of rule data are implemented through the elastic scaling microservice component and the resource management microservice component, so as to obtain the available load elastic scaling rules, ensure the accuracy of the rule verification process, and improve the reliability and security of the system.

[0084] In an exemplary embodiment, the method also includes: obtaining deployment group binding data through an elastic scaling microservice component; performing parameter verification processing on the binding parameters in the deployment group binding data through a resource management microservice component; and if the verification processing passes, updating the saved preset load elastic scaling rules based on the deployment group binding data.

[0085] Exemplarily, for a specific application deployment process, the staff who deploys the application can issue instructions for deploying the application in the console, and submit the deployment group binding data to the elastic scaling microservice component, thereby binding the preset load elastic scaling rules to the deployed application. For the binding process, it is also necessary to perform parameter verification on the binding parameters in the deployment group binding data through the resource management microservice component, and the binding parameters that need to be verified include application parameters and group parameters. If the verification process passes, the saved preset load elastic scaling rules can be updated based on the deployment group binding data, which means binding the preset load elastic scaling rules to the deployment group, and the binding information can also be sent to the controller's intelligent elastic scaling microservice. In this embodiment, the preset load elastic scaling rules are bound through the deployment group binding data, so that the expansion and contraction processing of the application deployed by the application deployment group can be performed through the preset load elastic scaling rules, thereby ensuring the expansion and contraction processing efficiency of the microservice architecture application.

[0086] In an exemplary embodiment, step 203 includes: controlling the microservice component through rules to search the rule database for preset load elastic scaling rules for the microservice architecture application; filtering the load monitoring data by traversing the preset load elastic scaling rules to obtain rule filtering data.

[0087] Exemplarily, the rule filtering process can be specifically implemented by a rule-controlled microservice component (Controller). When expansion and contraction processing is required, the rule-controlled microservice component can first search the preset load elastic scaling rules bound to the microservice architecture application in the rule database according to the microservice architecture application that needs to be processed, and then filter the load monitoring data by traversing the preset load elastic scaling rules to obtain rule-filtered data. During the filtering process, since the time series data related to the load monitoring data is stored in the Prometheus time series database. Therefore, for this process, the load monitoring data stored in the Prometheus time series database can be filtered according to the read preset load elastic scaling rules to obtain rule-filtered data. In this embodiment, by reading the preset load elastic scaling rules and then filtering the load monitoring data by traversing the rules, the efficiency and accuracy of the filtering can be effectively guaranteed.

[0088] In an exemplary embodiment, scaling a microservice architecture application according to scaling methods and diffusion parameters includes: based on the scaling methods and diffusion parameters, controlling the microservice components through rules to generate scaling tasks; sending the scaling tasks to a host machine to scale the microservice architecture application through the host machine.

[0089] Exemplarily, for the process of scaling up and down, it is necessary to control the microservice components through rules and generate scaling tasks first. Then the scaling tasks are sent to the host master to perform scaling processing on the microservice architecture application through the host. For the host scaling processing, it mainly calls the underlying IAAS (Infrastructure as a Service) to expand or shrink the actual application service, so that when the business load of the application increases, it automatically triggers the expansion of the service, quickly starts a new service instance, and evenly distributes the request to each instance through an intelligent load balancing mechanism. When the business load decreases, the service is automatically shrunk to release excess resources to reduce costs. In this embodiment, by generating scaling tasks and then completing the scaling of the deployed microservice architecture application through the scaling tasks, the efficiency and accuracy of the scaling process can be effectively guaranteed.

[0090] In one embodiment, the timing flow chart of the microservice scaling method of the present application can be shown as in FIG4 , including: the user submits data related to the dynamic elastic scaling rules for rule configuration through the console, and the elastic scaling microservice component Scalable obtains the rule configuration data; the resource management microservice component Resource performs parameter verification on the rule parameters in the rule configuration data; if the parameter verification passes, the preset load elastic scaling rules are generated based on the rule configuration data; then the start and stop status information of the scaling rules submitted by the user to the elastic scaling microservice component is identified; if the start and stop status information indicates that the scaling rules are turned on, the preset load elastic scaling rules are saved to the rule database MySQL. The user can also submit deployment group binding data to the elastic scaling microservice component; and the resource management microservice component needs to perform parameter verification on the binding parameters in the deployment group binding data; if the verification passes, a request is submitted to the host machine based on the deployment group binding data, thereby updating the preset load elastic scaling rules saved in the database. During the scaling process, the rule-controlled microservice component Controller obtains the load monitoring data of the microservice architecture application from the time series database Prometheus, and then searches the preset load elastic scaling rules of the microservice architecture application in the rule database; by traversing the preset load elastic scaling rules, the load monitoring data is filtered to obtain the rule-filtered data. Then the rule-filtered data is input into the preset load prediction model, and the load prediction is performed through the load prediction model to obtain the average load change trend index of the microservice architecture application, and the diffusion capacity determination is performed based on the average load change trend index to obtain the scaling method and diffusion capacity parameters; based on the scaling method and diffusion capacity parameters, the rule-controlled microservice component generates scaling tasks; the scaling tasks are sent to the host master to scale the microservice architecture application through the host.

[0091] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0092] Based on the same inventive concept, the embodiment of the present application also provides a microservice scaling device for implementing the microservice scaling method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in one or more microservice scaling device embodiments provided below can refer to the limitations of the microservice scaling method above, and will not be repeated here.

[0093] In an exemplary embodiment, as shown in FIG5 , a microservice scaling device is provided, including:

[0094] The data acquisition module 502 is used to obtain load monitoring data of the microservice architecture application.

[0095] The rule filtering module 504 is used to filter the load monitoring data according to the preset load elastic scaling rules to obtain rule filtered data.

[0096] The indicator prediction module 506 is used to input the rule-filtered data into a preset load prediction model, perform load prediction processing through the load prediction model, and obtain the average load change trend indicator of the microservice architecture application. The preset load prediction model is trained based on historical load change data.

[0097] The expansion and contraction determination module 508 is used to perform diffusion capacity determination processing based on the average load change trend indicator to obtain the expansion and contraction mode and diffusion capacity parameters.

[0098] The expansion and contraction processing module 510 is used to perform expansion and contraction processing on the microservice architecture application according to the expansion and contraction method and diffusion capacity parameters.

[0099] In one embodiment, it also includes a rule generation module, which is used to: obtain rule configuration data through the elastic scaling microservice component; perform parameter verification on the rule parameters in the rule configuration data through the resource management microservice component; if the parameter verification passes, generate a preset load elastic scaling rule based on the rule configuration data, and save the preset load elastic scaling rule.

[0100] In one embodiment, the rule generation module is further used to: generate a preset load elastic scaling rule based on the rule configuration data when the parameter verification passes; identify the start and stop status information of the scaling rule; and save the preset load elastic scaling rule to the rule database when the start and stop status information indicates that the scaling rule is turned on. The rule filtering module 504 is specifically used to: load the preset load elastic scaling rule of the microservice architecture application from the rule database; filter the load monitoring data through the loaded preset load elastic scaling rule to obtain rule filtering data.

[0101] In one embodiment, it also includes a deployment group binding module, which is used to: obtain deployment group binding data through the elastic scaling microservice component; perform parameter verification processing on the binding parameters in the deployment group binding data through the resource management microservice component; if the verification processing passes, update the saved preset load elastic scaling rules based on the deployment group binding data.

[0102] In one embodiment, the rule filtering module 504 is also used to: control the microservice component through rules to search the preset load elastic scaling rules of the microservice architecture application in the rule database; filter the load monitoring data by traversing the preset load elastic scaling rules to obtain rule filtering data.

[0103] In one embodiment, the scaling processing module 510 is specifically used to: based on the scaling method and diffusion capacity parameters, control the microservice components through rules to generate scaling tasks; send the scaling tasks to the host machine to perform scaling processing on the microservice architecture application through the host machine.

[0104] Each module in the above-mentioned microservice expansion and contraction device can be implemented in whole or in part by software, hardware and their combination. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0105] In an exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG6. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data related to microservice expansion and contraction. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a microservice expansion and contraction method is implemented.

[0106] Those skilled in the art will understand that the structure shown in FIG. 6 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0107] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

[0108] In one embodiment, a computer-readable storage medium is provided, storing a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0109] In one embodiment, a computer program product or computer program is provided, the computer program product or computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps in the above-mentioned method embodiments.

[0110] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0111] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0112] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0113] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A microservice expansion and contraction method, characterized in that: The method comprises: Obtain load monitoring data for microservice architecture applications; The load monitoring data is filtered by using preset load elastic scaling rules to obtain rule-filtered data; Inputting the rule-filtered data into a preset load prediction model, performing load prediction processing through the load prediction model, and obtaining an average load change trend indicator of the microservice architecture application, wherein the preset load prediction model is trained based on historical load change data; Perform diffusion capacity determination processing based on the average load change trend indicator to obtain a capacity expansion and contraction method and diffusion capacity parameters; The microservice architecture application is scaled up or down according to the scaling method and the diffusion capacity parameters.

2. The method according to claim 1, characterized in that The method further comprises: Obtain rule configuration data through elastic scaling microservice components; Perform parameter verification processing on the rule parameters in the rule configuration data through the resource management microservice component; When the parameter verification passes, a preset load elastic scaling rule is generated based on the rule configuration data, and the preset load elastic scaling rule is saved.

3. The method according to claim 2, characterized in that In the case where the parameter verification passes, generating a preset load elastic scaling rule based on the rule configuration data, and saving the preset load elastic scaling rule includes: If the parameter verification passes, generating a preset load elastic scaling rule based on the rule configuration data; Identify the start and stop status information of the scaling rule; When the start / stop status information indicates that the scaling rule is enabled, the preset load elastic scaling rule is saved in a rule database; The filtering of the load monitoring data by using the preset load elastic scaling rule to obtain the rule-filtered data includes: Loading preset load elastic scaling rules of the microservice architecture application from a rule database; The load monitoring data is filtered by using the loaded preset load elastic scaling rule to obtain rule-filtered data.

4. The method according to claim 2, characterized in that: The method further comprises: Obtain deployment group binding data through the elastic scaling microservice component; Perform parameter verification processing on the binding parameters in the deployment group binding data through the resource management microservice component; If the verification process passes, the saved preset load elastic scaling rule is updated based on the deployment group binding data.

5. The method according to any one of claims 1 to 4, characterized in that: The filtering of the load monitoring data by using the preset load elastic scaling rule to obtain the rule-filtered data includes: Control the microservice component through rules to search the rule database for preset load elastic scaling rules for the microservice architecture application; By traversing the preset load elastic scaling rules, the load monitoring data is filtered to obtain rule-filtered data.

6. The method according to claim 1, characterized in that The scaling of the microservice architecture application according to the scaling mode and the diffusion capacity parameter includes: Based on the scaling mode and the diffusion capacity parameters, the microservice component is controlled by rules to generate scaling tasks; The scaling task is sent to a host machine so that the microservice architecture application is scaled up or down through the host machine.

7. A microservice expansion and contraction device, characterized in that: The device comprises: Data acquisition module, used to obtain load monitoring data of microservice architecture applications; A rule filtering module is used to filter the load monitoring data according to preset load elastic scaling rules to obtain rule filtered data; An indicator prediction module, used to input the rule-filtered data into a preset load prediction model, perform load prediction processing through the load prediction model, and obtain an average load change trend indicator of the microservice architecture application, wherein the preset load prediction model is trained based on historical load change data; A capacity expansion and contraction determination module, used to perform diffusion capacity determination processing based on the average load change trend indicator to obtain a capacity expansion and contraction mode and diffusion capacity parameters; The expansion and contraction processing module is used to perform expansion and contraction processing on the microservice architecture application according to the expansion and contraction method and the diffusion capacity parameters.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Dynamic perception rescheduling method for large-scale micro-service application and application

    CN114518948A

  • Micro-service instance dynamic horizontal expansion and contraction method and system based on trend prediction

    CN115391048A

  • Micro-service intelligent elastic scaling method and system

    CN118301206A

  • Elastic load balancing prioritization

    US20200167189A1

  • Container cloud autoscaling method, and cluster server

    WO2022257347A1

Cited By

  • CPU (Central Processing Unit) resource allocation method for DPU (Distributed Processing Unit) centralized service grid

    CN120295789A

  • Micro-service elastic scaling decision-making method and device based on time sequence data driving

    CN120434143A

  • Micro-service and low-code platform application autonomous extension method

    CN121233339A