Micro-service scaling method and device, computer device, readable storage medium and program product
By filtering and predicting load monitoring data for microservice architecture applications, and using load elastic scaling rules and predictive models for scaling up and down, the problem of poor scalability in microservice architecture systems is solved, and the availability and resource utilization of application systems are improved.
Patent Information
- Application Number
- CN202411329728.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-24
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2044-09-24
AI Technical Summary
Existing microservice architectures have poor system scalability, which affects the availability of application systems.
By acquiring load monitoring data from microservice architecture applications, filtering and predicting using preset load elastic scaling rules and load prediction models, average load change trend indicators are obtained, and scaling decisions and processing are based on these indicators.
It enables rapid and accurate service deployment and adjustment, improves the scalability of microservice architecture applications, ensures the availability of application systems, and enhances resource utilization and operational efficiency.
Smart Images

Figure CN119276719B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, in particular to a micro-service scaling method and device, computer equipment, computer readable storage medium and computer program product. BACKGROUND
[0002] With the rapid development of Internet technology, application programs based on micro-service architecture have gradually become popular. Micro-service is a software architecture pattern that divides an application into a series of independent services, each of which can be developed, deployed and scaled independently. With the development of cloud computing and container technology, micro-service architecture has gradually become the mainstream choice for building scalable and easy-to-maintain application systems.
[0003] Currently, there are various micro-service deployment solutions, such as traditional virtual machine management systems, Docker-based container technology, and Kubernetes-based container orchestration systems. Docker focuses on lightweight containerization technology, simplifying the packaging and distribution of application programs, and Kubernetes provides powerful capabilities for automated deployment, scaling and management of containerized applications. However, the current micro-service solution has poor system scalability, which affects the availability of the entire application system. SUMMARY
[0004] Therefore, it is necessary to provide a micro-service scaling method, device, computer equipment, computer readable storage medium and computer program product that can effectively improve the system scalability to solve the above technical problems.
[0005] In a first aspect, the present application provides a micro-service scaling method, comprising:
[0006] obtaining load monitoring data of a micro-service architecture application;
[0007] filtering and processing the load monitoring data through a preset load elasticity scaling rule 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 to obtain an average load change trend index of the micro-service architecture application, and the preset load prediction model is trained based on historical load change data;
[0009] performing scaling decision processing based on the average load change trend index to obtain a scaling mode and scaling parameters;
[0010] scaling the micro-service architecture application according to the scaling mode and the scaling parameters.
[0011] In one embodiment, the method further comprises:
[0012] obtaining rule configuration data by the elastic scaling micro-service component;
[0013] performing parameter verification processing on rule parameters in the rule configuration data by the resource management micro-service component;
[0014] in a case where the parameter verification passes, generating a preset load elasticity scaling rule based on the rule configuration data, and saving the preset load elasticity scaling rule.
[0015] In one embodiment, the generating, in a case where the parameter verification passes, a preset load elasticity scaling rule based on the rule configuration data, and saving the preset load elasticity scaling rule comprises:
[0016] in a case where the parameter verification passes, generating a preset load elasticity scaling rule based on the rule configuration data;
[0017] identifying start-stop state information of the scaling rule;
[0018] in a case where the start-stop state information indicates that the scaling rule is started, saving the preset load elasticity scaling rule to a rule database;
[0019] filtering the load monitoring data based on the preset load elasticity scaling rule to obtain rule filtered data;
[0020] loading, from a rule database, a preset load elasticity scaling rule of the micro-service architecture application;
[0021] filtering the load monitoring data based on the loaded preset load elasticity scaling rule to obtain rule filtered data.
[0022] In one embodiment, the method further comprises:
[0023] obtaining deployment group binding data by the elastic scaling micro-service component;
[0024] performing parameter verification processing on binding parameters in the deployment group binding data by the resource management micro-service component;
[0025] in a case where the verification processing passes, updating the saved preset load elasticity scaling rule based on the deployment group binding data.
[0026] In one embodiment, the filtering the load monitoring data based on the preset load elasticity scaling rule to obtain rule filtered data comprises:
[0027] finding, by a rule control micro-service component, a preset load elasticity scaling rule of the micro-service architecture application in a rule database;
[0028] The load monitoring data is filtered by traversing the preset load elasticity scaling rule to obtain rule filtered data.
[0029] In one of the embodiments, the scaling processing of the micro-service architecture application according to the scaling mode and the scaling parameter includes:
[0030] Based on the scaling mode and the scaling parameter, a scaling task is generated by a rule control micro-service component;
[0031] The scaling task is sent to a host computer to perform scaling processing on the micro-service architecture application by the host computer.
[0032] In a second aspect, the present application further provides a micro-service scaling device, which includes:
[0033] A data acquisition module is configured to acquire load monitoring data of a micro-service architecture application.
[0034] A rule filtering module is configured to filter the load monitoring data by a preset load elasticity scaling rule to obtain rule filtered data.
[0035] An index prediction module is configured to input the rule filtered data into a preset load prediction model, perform load prediction processing by the load prediction model, and obtain an average load change trend index of the micro-service architecture application, wherein the preset load prediction model is trained based on historical load change data.
[0036] A scaling determination module is configured to perform scaling determination processing based on the average load change trend index to obtain a scaling mode and a scaling parameter.
[0037] A scaling processing module is configured to perform scaling processing on the micro-service architecture application according to the scaling mode and the scaling parameter.
[0038] In a third aspect, the present application further provides a computer device, which includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0039] Load monitoring data of a micro-service architecture application is acquired.
[0040] The load monitoring data is filtered by a preset load elasticity scaling rule to obtain rule filtered data.
[0041] 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 index of the micro-service architecture application, the preset load prediction model being obtained based on historical load change data;
[0042] perform diffusion capacity determination processing based on the average load change trend index, and obtain a scaling mode and diffusion capacity parameters;
[0043] perform scaling processing on the micro-service architecture application according to the scaling mode 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, the computer program being executed by a processor to implement the following steps:
[0045] obtain load monitoring data of a micro-service architecture application;
[0046] perform filtering processing on the load monitoring data through a preset load elasticity scaling rule, and obtain rule filtered data;
[0047] 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 index of the micro-service architecture application, the preset load prediction model being obtained based on historical load change data;
[0048] perform diffusion capacity determination processing based on the average load change trend index, and obtain a scaling mode and diffusion capacity parameters;
[0049] perform scaling processing on the micro-service architecture application according to the scaling mode and the diffusion capacity parameters.
[0050] In a fifth aspect, the present application further provides a computer program product, comprising a computer program, the computer program being executed by a processor to implement the following steps:
[0051] obtain load monitoring data of a micro-service architecture application;
[0052] perform filtering processing on the load monitoring data through a preset load elasticity scaling rule, and obtain rule filtered data;
[0053] 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 index of the micro-service architecture application, the preset load prediction model being obtained based on historical load change data;
[0054] perform diffusion capacity determination processing based on the average load change trend index, and obtain a scaling mode and diffusion capacity parameters;
[0055] perform scaling processing on the micro-service architecture application according to the scaling mode and the diffusion capacity parameter.
[0056] The micro-service scaling method, device, computer equipment, computer readable storage medium and computer program product filter the load monitoring data through a preset load elasticity scaling rule to obtain rule filtered data, input the rule filtered data into a preset load prediction model, perform load prediction processing through the load prediction model to obtain an average load change trend index of the micro-service architecture application, perform diffusion capacity determination processing based on the average load change trend index to obtain a scaling mode and a diffusion capacity parameter, and perform scaling processing on the micro-service architecture application according to the scaling mode and the diffusion capacity parameter. The application collects load monitoring data of a micro-service architecture application, filters the load monitoring data through a load elasticity rule to screen usable rule filtered data, predicts a load change trend through a preset load prediction model to obtain an average load change trend index, and determines and processes scaling according to the average load change trend index, which can realize fast and accurate service deployment and adjustment according to real-time business load and resource usage, thereby improving the expansibility of the micro-service architecture application and ensuring the availability of the application system. BRIEF DESCRIPTION OF DRAWINGS
[0057] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the drawings needed to be used in the description of the embodiments of the present application or the related art will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other related drawings can be obtained by those skilled in the art without creative labor.
[0058] Figure 1 An application environment diagram of the micro-service scaling method in one embodiment;
[0059] Figure 2 A flowchart of the micro-service scaling method in one embodiment;
[0060] Figure 3 A flowchart of the rule checking and rule storing steps in one embodiment;
[0061] Figure 4 A timing flowchart of the micro-service scaling method in one embodiment;
[0062] Figure 5 A structural block diagram of the micro-service scaling device in one embodiment;
[0063] Figure 6 Fig. 1 is a schematic diagram of an internal structure of a computer device in an embodiment. DETAILED DESCRIPTION
[0064] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and should not be used to limit the present application.
[0065] The microservice scaling method provided by the embodiments of the present application can be applied to an application environment as shown in Figure 1 Fig. 1. The terminal 102 communicates with the server 104 through a network. The data storage system can store data required to be processed by the server 104. The data storage system can be integrated on the server 104, or placed on a cloud or other network server. The terminal 102 communicates with the server 104 through an application program on the terminal 102. When a user of the terminal 102 needs to run a virtual machine management system on the server 104 to package and distribute a microservice architecture application and automatically deploy the microservice architecture application on the virtual machine management system through a container technology, the microservice scaling method of the present application can be used to perform scaling processing on the microservice architecture application, so as to maintain the stability of the application running. The server 104 obtains load monitoring data of the microservice architecture application, filters the load monitoring data through a preset load elasticity scaling rule to obtain rule filtered data, inputs the rule filtered data into a preset load prediction model to perform load prediction processing through the load prediction model to obtain an average load change trend index of the microservice architecture application, the preset load prediction model being trained based on historical load change data, performs scaling judgment processing based on the average load change trend index to obtain a scaling mode and a scaling parameter, and performs scaling processing on the microservice architecture application according to the scaling mode and the scaling parameter. The terminal 102 can be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things device can be a smart speaker, a smart television, a smart air conditioner, a smart vehicle device, a projection device, etc. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device, etc. The head-mounted device can be a virtual reality (VR) device, an augmented reality (AR) device, smart glasses, etc. The server 104 can be a standalone physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.
[0066] In an exemplary embodiment, as shown in Figure 2 Fig. 2, a microservice scaling method is provided. The method is applied to Figure 1The terminal 102 in the system 100 is taken as an example for illustration, including the following steps 201 to 207. Among them:
[0067] Step 201, obtaining load monitoring data of the micro-service architecture application.
[0068] Step 203, filtering the load monitoring data by using a preset load elasticity scaling rule to obtain rule filtered data.
[0069] The micro-service architecture application refers to an application program written based on a micro-service architecture. The micro-service is a software architecture pattern, which divides an application program into a series of independent services, each of which can be independently developed, deployed and expanded. In the scheme of the present application, each processing process of the micro-service scaling processing is split into a service component, and then the scaling processing of the micro-service architecture application is performed through the components. The load monitoring data refers to the detection data obtained by detecting the load related data related to the application during the application running process, including CPU utilization, memory occupation, network bandwidth, response time and call chain, etc. These data can be stored in a time series database and saved according to time sequence. The preset load elasticity scaling rule refers to the rule data used for determining the application load occupation rule. Since the collected load monitoring data may not completely meet the analysis requirements of the specific application, the preset load elasticity scaling rule can be set in advance, and then the load monitoring data is filtered by using the rule to obtain the available rule filtered data.
[0070] For example, when a user needs to deploy an application through a virtual machine by using a container technology such as Docker or Kubernetes, the micro-service scaling method of the present application can be used to determine the resource occupation trend of the micro-service application by detecting the running micro-service application. During the application running process, the server 104 can synchronously obtain the load monitoring data of the micro-service architecture application running in the container, and determine the CPU utilization, memory occupation, network bandwidth, response time and call chain of each application. Then, in order to improve the usability of the data, the load monitoring data can be filtered by using the preset load elasticity scaling rule to obtain rule filtered data matched with the current micro-service architecture application, and the scaling of the micro-service is determined based on the rule filtered data. The rule filtered data can be filtered to obtain rule filtered data suitable for load prediction and meeting the time period and type requirements.
[0071] Step 205, inputting the rule filtered data into a preset load prediction model to perform load prediction processing by using the load prediction model, and obtaining an average load change trend index of the micro-service architecture application, the preset load prediction model being trained based on historical load change data.
[0072] Exemplarily, the preset load prediction model refers to a model for predicting load based on rule filtering data. The preset load prediction model can be a model for predicting based on time sequence, for example, a model based on long short-term memory neural network or a time sequence prediction model based on Prophet. The preset load prediction model can be specifically trained based on historical load change data. The data of early load change is intercepted as a sample, and the sample is labeled by subsequent load change results to obtain labeled model training data. Then, the model training data is used to complete the training of the load prediction model. The average load change trend index is an index value of the load change 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 running process and needs higher load. Expansion is needed to ensure the stability of application running. If the index value is low, it means that the monitored application instance will occupy less resources in the subsequent running process and can be scaled down.
[0073] In step 207, expansion determination processing is performed based on the average load change trend index to obtain an expansion and scaling mode and expansion parameters.
[0074] In step 209, the microservice architecture application is scaled up or down according to the expansion and scaling mode and the expansion parameters.
[0075] The expansion and scaling mode refers to the processing mode of whether the microservice architecture application should be scaled up or scaled down, and the expansion and scaling parameters refer to the amount of resources to be scaled up or scaled down in the expansion and scaling process.
[0076] Exemplarily, after obtaining the average load change trend index, expansion determination processing is performed based on the average load change trend index to determine the expansion and scaling mode and the expansion parameters in the expansion and scaling process. Then, the microservice architecture application deployed on the container is scaled up or down according to the expansion and scaling mode and the expansion parameters. In one specific embodiment, control instructions can be generated according to the expansion and scaling mode and the expansion parameters, and then the control instructions are sent to the host of the container to realize the corresponding expansion and scaling processing.
[0077] The microservice scaling method obtains load monitoring data of the microservice architecture application, filters the load monitoring data based on a preset load elasticity scaling rule to obtain rule filtered data, inputs the rule filtered data into a preset load prediction model, performs load prediction processing through the load prediction model to obtain an average load change trend index of the microservice architecture application, performs scaling judgment processing based on the average load change trend index to obtain a scaling mode and a scaling parameter, and performs scaling processing on the microservice architecture application according to the scaling mode and the scaling parameter. The application collects load monitoring data of the microservice architecture application, filters the load monitoring data through a load elasticity rule, screens out usable rule filtered data, predicts a load change trend through a preset load prediction model, obtains an average load change trend index, and performs scaling judgment and processing according to the average load change trend index. The application can realize rapid and accurate service deployment and adjustment according to real-time business load and resource usage, improve the expansibility of the microservice architecture application, and ensure the availability of the application system. Meanwhile, the scaling processing effectively improves the resource utilization rate in the system and reduces operating costs. While improving the system expansibility, the application can support high concurrency and large-scale service deployment, and further improve the system operation and maintenance efficiency by simplifying microservice management.
[0078] In one example embodiment, as shown in Figure 3 the method further includes:
[0079] In step 302, the rule configuration data is obtained by the elastic scaling microservice component.
[0080] In step 304, the rule parameters in the rule configuration data are subjected to parameter verification processing by the resource management microservice component.
[0081] In step 306, when the parameter verification is passed, the preset load elasticity scaling rule is generated based on the rule configuration data, and the preset load elasticity scaling rule is saved.
[0082] The elastic scaling microservice component (Scalable) refers to a component for operation and processing of the elastic scaling rule. The related operations involved in the microservice scaling process can be divided into a service, and the corresponding rule processing is performed by the elastic scaling microservice component. The rule configuration data refers to the setting data of the rule formulated by the staff responsible for application scaling management. The staff can create a load elasticity scaling rule according to the actual scaling needs, and submit the 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 the application deployment group, and supports two environments of virtual machines and containers.
[0083] Exemplarily, before the filtering processing of data by rules, the configuration work of rules also needs to be completed. The rule configuration can be implemented by the elastic scaling microservice component and the resource management microservice component. After the staff creates rules based on the actual scaling demand, the staff can submit the rule configuration data to the elastic scaling microservice component through the console, and the elastic scaling microservice component submits the rule configuration data to the resource management microservice component. The resource management microservice component performs parameter verification processing on the rule parameters in the rule configuration data. The parameter verification processing mainly verifies the application parameters and group parameters in the rules. The resource management microservice component feeds back the verification result to the resource management microservice component, and then performs storage and other processing of the rules based on the verification result. If the parameter verification passes, the preset load elastic scaling rule can be generated based on the rule configuration data, and the preset load elastic scaling rule is saved. In particular, in one embodiment, for the saving process of the preset load elastic scaling rule, the preset load elastic scaling rule needs to be generated based on the rule configuration data in the case where the parameter verification passes. Then, the start-stop state information of the scaling rule is identified, that is, it is judged whether the elastic scaling rule is started to balance the load. Only in the case where the start-stop state information indicates that the scaling rule is started, the preset load elastic scaling rule is saved to the rule database SQL specially used for rule data storage. Step 203 includes: loading the preset load elastic scaling rule of the microservice architecture application from the rule database; filtering the load monitoring data by the loaded preset load elastic scaling rule to obtain rule filtering data. That is, the preset load elastic scaling rule is read from the rule database, and the filtering processing is performed by the read rule to ensure the efficiency and accuracy of the rule filtering process. In this embodiment, the elastic scaling microservice component and the resource management microservice component are used to implement the rule data management and verification process, so as to obtain the available load elastic scaling rule, ensure the accuracy of the rule verification process, and improve the reliability and security of the system.
[0084] In one exemplary embodiment, the method further includes: obtaining deployment group binding data by the elastic scaling microservice component; performing parameter verification processing on the binding parameters in the deployment group binding data by the resource management microservice component; and in the case where the verification processing passes, updating the saved preset load elastic scaling rule based on the deployment group binding data.
[0085] Exemplarily, for the specific application deployment process, the worker who deploys the application can issue the instruction of deploying the application under the console, and submit the deployment group binding data to the elastic scaling microservice component, so as to bind the preset load elasticity scaling rule to the deployed application. For the binding process, the binding parameters in the deployment group binding data also need to be subjected to parameter checking processing by the resource management microservice component, and the binding parameters that need to be checked include the application parameter and the group parameter. If the checking processing passes, the preset load elasticity scaling rule that is saved can be updated based on the deployment group binding data, which means that the preset load elasticity scaling rule is bound to the deployment group, and the binding information can also be issued to the intelligent elastic scaling microservice of the controller. In the embodiment, the preset load elasticity scaling rule is bound through the deployment group binding data, so that the scaling processing of the application deployed by the application deployment group can be performed through the preset load elasticity scaling rule, and the efficiency of the scaling processing of the microservice architecture application is ensured.
[0086] In an exemplary embodiment, step 203 comprises: finding the preset load elasticity scaling rule of the microservice architecture application in the rule database through the rule control microservice component; and filtering the load monitoring data to obtain rule filtering data by traversing the preset load elasticity scaling rule.
[0087] Exemplarily, for the rule filtering process, it can be implemented through the rule control microservice component (Controller). When the scaling processing is needed, the rule control microservice component can first find the preset load elasticity scaling rule bound by the microservice architecture application according to the microservice architecture application that needs to be processed in the rule database, and then filter the load monitoring data by traversing the preset load elasticity scaling rule to obtain rule filtering data. In the filtering process, the time sequence data related to the load monitoring data is saved in the Prometheus time sequence database. Therefore, for this process, the load monitoring data stored in the Prometheus time sequence database can be filtered according to the read preset load elasticity scaling rule to obtain rule filtering data. In the embodiment, the filtering efficiency and accuracy of the load monitoring data can be effectively ensured by reading the preset load elasticity scaling rule and then traversing the rule.
[0088] In an exemplary embodiment, the scaling processing of the microservice architecture application according to the scaling mode and the scaling parameter comprises: generating a scaling task by the rule control microservice component based on the scaling mode and the scaling parameter; and sending the scaling task to the host machine to perform the scaling processing of the microservice architecture application through the host machine.
[0089] Exemplarily, for the process of the scaling processing, the micro-service component needs to be controlled by the rule to generate a scaling task first. Then the scaling task is sent to the host master to perform the scaling processing on the micro-service architecture application by the host master. For the scaling processing process of the host master, it mainly calls the underlying IAAS (Infrastructure as a Service) to perform the scaling operation on the actual application service, so as to automatically trigger the expansion of the service when the business load of the application increases, quickly start a new service instance, and evenly distribute the requests to each instance through the intelligent load balancing mechanism. When the business load decreases, the service is automatically contracted to release the excess resources to reduce the cost. In the embodiment, the scaling task is generated to complete the scaling processing on the deployed micro-service architecture application through the scaling task, which can effectively guarantee the efficiency and accuracy of the scaling processing process.
[0090] In one embodiment, the timing flow chart of the micro-service scaling method of the present application can refer to Figure 4As shown, the method comprises: a user submitting data related to a dynamic elastic scaling rule for rule configuration through a console, a scalable micro-service component Scalable obtaining the rule configuration data; a resource management micro-service component Resource performing parameter verification processing on rule parameters in the rule configuration data; in the case where the parameter verification passes, generating a preset load elastic scaling rule based on the rule configuration data; then identifying start-stop state information of the scaling rule submitted by the user to the elastic scaling micro-service component; in the case where the start-stop state information indicates that the scaling rule is started, saving the preset load elastic scaling rule to a rule database MySQL. The user can also submit deployment group binding data to the elastic scaling micro-service component; and the resource management micro-service component needs to perform parameter verification processing on binding parameters in the deployment group binding data; in the case where the verification processing passes, submitting a request to a host based on the deployment group binding data, so as to update the preset load elastic scaling rule saved in the database. In the process of scaling, a rule control micro-service component Controller obtains load monitoring data of the micro-service architecture application from a time sequence database Prometheus, and then searches the rule database for the preset load elastic scaling rule of the micro-service architecture application; the preset load elastic scaling rule is traversed to filter the load monitoring data, and rule filtering data is obtained. The rule filtering data is input into a preset load prediction model, load prediction processing is performed through the load prediction model, average load change trend indicators of the micro-service architecture application are obtained, scaling judgment processing is performed based on the average load change trend indicators, and a scaling mode and scaling parameters are obtained; based on the scaling mode and the scaling parameters, a scaling task is generated by the rule control micro-service component; and the scaling task is sent to a host master, so as to perform scaling processing on the micro-service architecture application through the host.
[0091] It should be understood that, although each step in the flowchart involved in the above embodiments is shown in sequence according to the arrow, these steps are not necessarily executed in the order indicated by the arrow. Unless otherwise specified herein, the execution of these steps is not strictly limited in sequence, and these steps can be executed in other orders. Moreover, at least part of the steps in the flowchart involved in the above embodiments can include multiple steps or stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution sequence of these steps or stages is not necessarily sequential, but can be executed in rotation or alternation with at least part of other steps or steps or stages in other steps.
[0092] Based on the same inventive concept, the embodiments of the present application also provide a microservice scaling device for implementing the microservice scaling method described above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described 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 described above, which will not be repeated here.
[0093] In one exemplary embodiment, as shown in Figure 5 A microservice scaling device is provided, comprising:
[0094] The data acquisition module 502 is configured to acquire load monitoring data of the microservice architecture application.
[0095] The rule filtering module 504 is configured to filter the load monitoring data based on the preset load elasticity scaling rule to obtain rule filtering data.
[0096] The index prediction module 506 is configured to input the rule filtering data into a preset load prediction model, perform load prediction processing based on the load prediction model, and obtain an average load change trend index of the microservice architecture application. The preset load prediction model is trained based on historical load change data.
[0097] The scaling determination module 508 is configured to perform scaling determination processing based on the average load change trend index to obtain a scaling mode and scaling parameters.
[0098] The scaling processing module 510 is configured to perform scaling processing on the microservice architecture application according to the scaling mode and the scaling parameters.
[0099] In one embodiment, the rule generation module is further configured to: acquire rule configuration data through the elasticity scaling microservice component; perform parameter verification processing on rule parameters in the rule configuration data through the resource management microservice component; in the case where the parameter verification is passed, generate the preset load elasticity scaling rule based on the rule configuration data, and save the preset load elasticity scaling rule.
[0100] In one embodiment, the rule generation module is further configured to: in the case where the parameter verification is passed, generate the preset load elasticity scaling rule based on the rule configuration data; identify start-stop state information of the scaling rule; in the case where the start-stop state information indicates that the scaling rule is started, save the preset load elasticity scaling rule to a rule database. The rule filtering module 504 is specifically configured to: load the preset load elasticity scaling rule of the microservice architecture application from the rule database; filter the load monitoring data based on the loaded preset load elasticity scaling rule to obtain rule filtering data.
[0101] In an embodiment, the deployment group binding module is further configured to: acquire deployment group binding data by the elastic scaling microservice component; perform parameter checking processing on the binding parameters in the deployment group binding data by the resource management microservice component; and update the saved preset load elastic scaling rule based on the deployment group binding data in a case where the checking processing is passed.
[0102] In an embodiment, the rule filtering module 504 is further configured to: find the preset load elastic scaling rule of the microservice architecture application by the rule control microservice component in a rule database; and perform filtering processing on the load monitoring data to obtain rule filtering data by traversing the preset load elastic scaling rule.
[0103] In an embodiment, the scaling processing module 510 is specifically configured to: generate a scaling task by the rule control microservice component based on the scaling mode and the scaling parameter; and send the scaling task to the host machine to perform scaling processing on the microservice architecture application by the host machine.
[0104] The above modules in the microservice scaling device can be all or partially implemented by software, hardware, and combinations thereof. The above modules can be embedded in or independent of a processor in a computer device in a hardware form, or can be stored in a memory in a computer device in a software form, so as to call and execute the operations corresponding to the above modules by a processor.
[0105] In an exemplary embodiment, a computer device, which can be a server, is provided, and an internal structure diagram of the computer device can be as shown in Figure 6 The computer device includes a processor, a memory, an input / output interface, and a communication interface. 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. The processor of the computer device is configured 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 running the operating system and the computer program in the non-volatile storage medium. The database of the computer device is configured to store microservice scaling related data. The input / output interface of the computer device is configured to exchange information between the processor and external devices. The communication interface of the computer device is configured to communicate with external terminals through a network connection. The computer program is executed by the processor to implement a microservice scaling method.
[0106] Those skilled in the art can understand that, Figure 6The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0107] In an embodiment, a computer device is also provided, including a memory and a processor. The memory stores a computer program. The processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0108] In an embodiment, a computer readable storage medium is provided, which stores a computer program. The computer program is executed by a processor to implement the steps in the above-mentioned method embodiments.
[0109] In an embodiment, a computer program product or computer program is provided, which includes computer instructions stored in a computer readable storage medium. A processor of a computer device reads the computer instructions from the computer readable storage medium. 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 for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant regulations.
[0111] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when executed, can include the processes of the above-mentioned embodiment methods. Any reference to 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. The non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. The volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration but not limitation, the RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., without being limited thereto.
[0112] The technical features of the above embodiments can be combined in any manner. To make the description concise, not all possible combinations of the technical features in the above embodiments are described, but as long as the combinations of the technical features do not exist contradictions, they should be considered as the scope of the present application.
[0113] The above-described embodiments are merely illustrative of several embodiments of the present application, and the description is relatively specific and detailed, but should not be understood as a limitation on the scope of the patent. It should be noted that for those skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are all within the scope of the present application. Therefore, the scope of protection of the present application should be subject to the appended claims.
Claims
1. A method for scaling up and down microservices, characterized in that, The method comprises: obtaining load monitoring data of a microservice architecture application; obtaining rule configuration data through an elastic scaling microservice component; performing parameter verification processing on rule parameters in the rule configuration data through a resource management microservice component; 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; obtaining deployment group binding data through an elastic scaling microservice component; performing parameter verification processing on binding parameters in the deployment group binding data through a resource management microservice component; in the case where the verification processing passes, updating the saved preset load elastic scaling rule based on the deployment group binding data; performing filtering processing on the load monitoring data through the preset load elastic scaling rule to obtain rule filtering data; inputting the rule filtering data into a preset load prediction model, performing load prediction processing through the load prediction model to obtain an average load change trend index of the microservice architecture application, and the preset load prediction model is trained based on historical load change data; performing diffusion capacity judgment processing based on the average load change trend index to obtain a scaling mode and diffusion capacity parameters; performing scaling processing on the microservice architecture application according to the scaling mode and the diffusion capacity parameters.
2. The method of claim 1, wherein, The method comprises: in the case where the parameter verification passes, generating a preset load elastic scaling rule based on the rule configuration data; identifying start-stop state information of the scaling rule; in the case where the start-stop state information indicates that the scaling rule is started, saving the preset load elastic scaling rule to a rule database; The method comprises: loading a preset load elastic scaling rule of the microservice architecture application from a rule database; performing filtering processing on the load monitoring data through the loaded preset load elastic scaling rule to obtain rule filtering data.
3. The method according to any one of claims 1 to 2, characterized in that, The method comprises: finding a preset load elastic scaling rule of the microservice architecture application in a rule database through a rule control microservice component; performing filtering processing on the load monitoring data through the preset load elastic scaling rule to obtain rule filtering data.
4. The method of claim 1, wherein, The method comprises: based on the scaling mode and the diffusion capacity parameters, generating a scaling task through a rule control microservice component; sending the scaling task to a host computer to perform scaling processing on the microservice architecture application through the host computer.
5. A microservice scaling device, comprising: The device comprises: a data acquisition module configured to obtain load monitoring data of a microservice architecture application; The rule generation module is configured to acquire rule configuration data through the elastic scaling micro-service component, perform parameter verification processing on rule parameters in the rule configuration data through the resource management micro-service component, and generate a preset load elasticity scaling rule based on the rule configuration data and save the preset load elasticity scaling rule in a case where the parameter verification passes. The deployment group binding module is configured to acquire deployment group binding data through the elastic scaling micro-service component, perform parameter verification processing on binding parameters in the deployment group binding data through the resource management micro-service component, and update the saved preset load elasticity scaling rule based on the deployment group binding data in a case where the verification processing passes. The rule filtering module is configured to perform filtering processing on the load monitoring data through the preset load elasticity scaling rule to obtain rule filtering data. The index prediction module is configured to input the rule filtering data into a preset load prediction model, perform load prediction processing through the load prediction model, and obtain an average load change trend index of the micro-service architecture application, the preset load prediction model being trained based on historical load change data. The scaling determination module is configured to perform scaling determination processing based on the average load change trend index to obtain a scaling mode and scaling parameters. The scaling processing module is configured to perform scaling processing on the micro-service architecture application according to the scaling mode and the scaling parameters.
6. The apparatus of claim 5, wherein, The rule generation module is further configured to generate a preset load elasticity scaling rule based on the rule configuration data in a case where the parameter verification passes, identify start-stop state information of the scaling rule, and save the preset load elasticity scaling rule to a rule database in a case where the start-stop state information indicates that the scaling rule is started. The rule filtering module is specifically configured to load a preset load elasticity scaling rule of the micro-service architecture application from a rule database, and perform filtering processing on the load monitoring data through the loaded preset load elasticity scaling rule to obtain rule filtering data.
7. The apparatus of any one of claims 5 to 6, wherein, The rule filtering module is further configured to find the preset load elasticity scaling rule of the micro-service architecture application in the rule database through a rule control micro-service component, and perform filtering processing on the load monitoring data through traversal of the preset load elasticity scaling rule to obtain rule filtering data.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that, The processor executes the computer program to implement the steps of the method in any one of claims 1 to 4.
9. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 4.
10. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 4.
Citation Information
Patent Citations
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