Method, device and processor for adjusting the capacity of a container
By predicting future trends in microservices and dynamically adjusting container capacity, the problem of low accuracy in container capacity adjustment is solved, achieving more efficient resource management.
Patent Information
- Application Number
- CN202411843224.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2044-12-13
AI Technical Summary
In existing technologies, container capacity adjustment methods are prone to resource waste or service performance degradation under dynamically changing workloads, and the accuracy of capacity adjustment is low.
By determining the current and historical information of the target microservice, predicting its future change trend, formulating adjustment strategies based on the change trend and thresholds, and dynamically adjusting the container capacity, including scaling up or down.
It improves the accuracy and response speed of container capacity adjustment, reduces resource waste and manual intervention, and achieves more efficient and intelligent resource management.
Smart Images

Figure CN119766656B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of microservice capacity management, and in particular to a method, device, and processor for adjusting the capacity of a container. Background Art
[0002] In a containerized environment, dynamic resource adjustment is a key capability for improving resource utilization and coping with traffic fluctuations. Container capacity adjustment requires accurately predicting the future needs of microservices while taking into account the dynamic changes in container resources and potential performance bottlenecks.
[0003] In related technologies, container capacity adjustment methods often rely on static resource allocation or manual adjustment. This method can easily lead to waste of container resources or degraded service performance under dynamically changing workloads, making it difficult to make accurate decisions about container resource adjustment. Therefore, the technical problem of low accuracy in container capacity adjustment still exists.
[0004] To address the above-mentioned problems, no effective solutions have been proposed so far. Summary of the Invention
[0005] Embodiments of the present invention provide a method, device, and processor for adjusting the capacity of a container, to at least solve the technical problem of low accuracy in adjusting the capacity of a container.
[0006] According to one aspect of an embodiment of the present invention, a method for adjusting the capacity of a container is provided, which may include: determining a target microservice in a container to be adjusted on a microservice management platform; determining current microservice information of the target microservice in a current time period, wherein the current microservice information is at least used to represent the performance and / or resource usage of the target microservice during its operation in the container to be adjusted; determining change trend information of the target microservice based on the current microservice information and historical microservice information of the target microservice in a historical time period, wherein the change trend information is used to represent a change trend of future microservice information of the target microservice in a future time period; determining an adjustment strategy for the container to be adjusted based on the change trend information and a microservice information threshold, and adjusting the capacity of the container to be adjusted according to the adjustment strategy, wherein the adjustment strategy is used to represent a rule for adjusting the capacity.
[0007] Optionally, the method is applied to a capacity adjustment system of a container, the capacity adjustment system includes a rule management component and a data information collection component, wherein the method further includes: controlling the rule management component to obtain the microservice information collection rules entered by the target object, wherein the microservice information collection rules include at least the identification information of the target microservice in the container to be adjusted, and the identification information of the container to be adjusted; determining the target microservice in the container to be adjusted of the microservice management platform, including: based on the identification information of the container to be adjusted in the microservice information collection rules, controlling the data information collection component to determine the container to be adjusted of the capacity to be adjusted from the microservice management platform, and based on the identification information of the target microservice in the microservice information collection rules, controlling the data information collection component to determine the target microservice from the container to be adjusted; determining the current microservice information of the target microservice in the current time period, including: controlling the data information collection component to obtain the current microservice information of the target microservice.
[0008] Optionally, the capacity adjustment system includes a data integration and storage component, wherein, based on the identification information of the container to be adjusted in the microservice information collection rule, the data information collection component is controlled to determine the container to be adjusted whose capacity is to be adjusted from the microservice management platform, and based on the identification information of the target microservice in the microservice information collection rule, the data information collection component is controlled to determine the target microservice from the container to be adjusted. The method also includes: controlling the data integration and storage component to integrate the current microservice information and convert the integrated current microservice information into a target format; controlling the data integration and storage component to store the current microservice information in the target format.
[0009] Optionally, the method further includes: the control rule management component obtains the capacity calculation indicator rule entered by the target object, wherein the calculation indicator rule includes at least the central processing unit and memory usage of the container to be adjusted corresponding to the target microservice.
[0010] Optionally, the capacity adjustment system includes a capacity analysis component, which determines the change trend information of the target microservice based on the current microservice information and the historical microservice information of the target microservice within a historical period, including: controlling the capacity analysis component, calling the historical microservice information of the target microservice, and determining the change trend information based on the historical microservice information and the current microservice information.
[0011] Optionally, after determining the change trend information of the target microservice based on the current microservice information and the historical microservice information of the target microservice within the historical period, the method further includes: controlling the capacity analysis component to at least associate the change trend information with the central processing unit and memory usage in the calculation indicator rules.
[0012] Optionally, the capacity adjustment system includes an indicator warning display component, wherein the method further includes: controlling the indicator warning display component to render the change trend information and microservice information thresholds, and displaying the rendered change trend information and microservice information thresholds.
[0013] Optionally, based on the change trend information and the microservice information threshold, an adjustment strategy for the container to be adjusted is determined, including: in response to the change trend information exceeding the microservice information threshold, sending adjustment prompt information to the target object, wherein the prompt information is used to prompt the target object whether it agrees to start adjusting the capacity; in response to detecting that the target object has issued an adjustment instruction of consent to the prompt information, determining an adjustment strategy for adjusting the container to be adjusted; according to the adjustment strategy, adjusting the capacity of the container to be adjusted, including: expanding or reducing the capacity according to the adjustment instruction corresponding to the adjustment strategy.
[0014] According to another aspect of an embodiment of the present invention, a container capacity adjustment device is also provided, including: a first determination unit, used to determine a target microservice in a container to be adjusted of a microservice management platform; a second determination unit, used to determine current microservice information of the target microservice in a current time period, wherein the current microservice information is at least used to represent the performance and / or resource usage of the target microservice during its operation in the container to be adjusted; a third determination unit, used to determine change trend information of the target microservice based on the current microservice information and historical microservice information of the target microservice in a historical time period, wherein the change trend information is used to represent the change trend of future microservice information of the target microservice in a future time period; an adjustment unit, used to determine an adjustment strategy for the container to be adjusted based on the change trend information and the microservice information threshold, and adjust the capacity of the container to be adjusted according to the adjustment strategy, wherein the adjustment strategy is used to represent a rule for adjusting the capacity.
[0015] According to another aspect of an embodiment of the present invention, a processor is provided for running a program, wherein the program, when run by the processor, executes any one of the above-mentioned methods for adjusting the capacity of a container.
[0016] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is further provided. The computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and executed by any one of the above-mentioned container capacity adjustment methods.
[0017] According to another aspect of an embodiment of the present invention, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute any one of the above-mentioned container capacity adjustment methods.
[0018] According to another aspect of the embodiments of the present application, a computer program product is provided, which includes a computer program that, when executed by a processor, implements the container capacity adjustment method of the embodiments of the present application.
[0019] In an embodiment of the present invention, if the capacity of a container to be adjusted is to be adjusted, the target microservice in the container to be adjusted of the microservice management platform can be determined, the current microservice information of the target microservice in the current period can be determined, the change trend information of the target microservice can be determined based on the current microservice information and the historical microservice information of the target microservice in the historical period, the adjustment strategy of the container to be adjusted can be determined based on the change trend information and the microservice information threshold, and the capacity of the container to be adjusted can be adjusted according to the adjustment strategy. In this embodiment, the capacity of the container is adjusted based on the specific operation status of the microservice and the change trend of the future microservice information of the microservice in the future period, avoiding over-estimation and resource waste, improving the accuracy and response speed of the container capacity adjustment, and reducing resource waste and manual intervention, thereby achieving the purpose of providing a more efficient and intelligent resource management method for microservices in a containerized environment. By estimating the change trend of the future microservice through historical and current microservice information, and judging whether the capacity of the container needs to be expanded or reduced, the technical effect of improving the accuracy of the container capacity adjustment is achieved, and the technical problem of low accuracy of the container capacity adjustment is solved. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0021] Figure 1 is a flow chart of a method for adjusting the capacity of a container according to an embodiment of the present invention;
[0022] Figure 2 1 is a schematic diagram of a microservice capacity management system based on statistical process control for microservice applications according to an embodiment of the present invention;
[0023] Figure 3 is a flow chart of a microservice capacity management method based on statistical process control according to an embodiment of the present invention;
[0024] Figure 4 is a schematic structural diagram of a capacity adjustment device for a container according to an embodiment of the present invention;
[0025] Figure 5 2 is a schematic diagram of an electronic device for a method for adjusting the capacity of a container according to an embodiment of the present invention. DETAILED DESCRIPTION
[0026] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0027] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0028] Example 1
[0029] According to an embodiment of the present invention, an embodiment of a method for adjusting the capacity of a container is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0030] Figure 1 FIG. 1 is a flow chart of a method for adjusting the capacity of a container according to an embodiment of the present invention. Figure 1 As shown, the method includes the following steps:
[0031] Step S102: Determine the target microservice in the container to be adjusted on the microservice management platform.
[0032] In the technical solution provided in the above step S102 of the embodiment of the present invention, the microservice management platform is a software platform for managing and coordinating the operation of multiple independent services under the microservice architecture in a distributed system. It provides a series of tools and services to help developers and operation and maintenance personnel to implement the deployment, monitoring, adjustment and management of microservices to ensure the efficiency, reliability and scalability of the microservice architecture. It can be a cloud platform. The container to be adjusted can be a container that carries the target microservice, a container with tight or underutilized resources, or a container related to changes in microservice demand. In a cloud platform environment, containers are the basic units of resource isolation and scheduling. By analyzing the resource usage in the container, it can be determined whether the microservices in the container need more or less resources.
[0033] In this embodiment, by determining the target microservice in the container to be adjusted on the microservice management platform, a specific microservice requiring capacity adjustment can be identified from among numerous microservices, i.e., the target microservice. The target microservice can be a microservice running in a specific container on the microservice management platform (e.g., a cloud platform) and requiring resource adjustment based on current and historical performance and resource usage.
[0034] For example, operations personnel can select target microservices for analysis based on their needs on the interactive interface of the microservice management platform. Target microservices can also be automatically determined based on resource usage of the microservice's container, including the central processing unit (CPU), memory, disk, and network bandwidth. For example, if a microservice's resource usage consistently approaches or exceeds a preset upper limit (e.g., CPU usage exceeding 80%), the microservice may require additional resource support and can be identified as a target microservice.
[0035] Step S104: Determine the current microservice information of the target microservice in the current time period.
[0036] In the technical solution provided in step S104 of the embodiment of the present invention, after determining the target microservice in the container to be adjusted on the microservice management platform, current microservice information of the target microservice during the current time period can be determined. The microservice information can at least be used to indicate the performance and / or resource usage of the target microservice during its operation in the container to be adjusted, and can include microservice data information, service traffic, operating status, resource consumption, database usage, and other multi-dimensional data.
[0037] In this embodiment, by determining the current microservice information of the target microservice in the current period, performance bottlenecks or resource waste can be discovered in a timely manner, providing data support for subsequent capacity analysis and adjustment strategy formulation.
[0038] Optionally, to determine the current microservice information of the target microservice during the current period, the cloud platform's monitoring system, log analysis, or specialized performance monitoring tools can be used to monitor the current microservice information of the target microservice, for example, monitoring the number of requests per second (TPS), response time, request success rate, etc. Current microservice information can also be determined by monitoring resource indicators of the microservice container, such as CPU usage, memory usage, disk input / output (I / O), and network bandwidth usage.
[0039] It should be noted that the above-mentioned method for determining the current microservice information is only an example and is not specifically limited here. As long as it is a method that can be used to determine the current microservice information of the target microservice in the current time period, it is within the protection scope of the embodiment of the present invention.
[0040] Step S106 : determining the change trend information of the target microservice based on the current microservice information and the historical microservice information of the target microservice within a historical period.
[0041] In the technical solution provided in step S106 of the embodiment of the present invention, after determining the current microservice information of the target microservice in the current time period, change trend information of the target microservice can be determined based on the current microservice information and the historical microservice information of the target microservice in the historical time period. The change trend information can be used to indicate the change trend of the future microservice information of the target microservice in the future time period.
[0042] In this embodiment, historical microservice information within a historical period may include the performance and resource usage of the microservices over different time periods. This historical microservice information may be service traffic data, reflecting the service's service processing capabilities and stability. It may also be resource usage data, reflecting the service's consumption of hardware resources. It may also be database usage data, reflecting the service's demand for and usage of database resources.
[0043] In embodiments of the present invention, historical microservice information can be used to identify microservice usage patterns and periodic changes, providing valuable insights for predicting future trends in microservice information. Microservice information for the current period provides real-time status of microservices, including key metrics such as workload and resource consumption. Combining historical microservice information from the past period with microservice information from the current period improves the accuracy of predicting future trends in microservice information, enabling intelligent capacity management of microservices and ensuring stable operation and efficient resource utilization for diverse business needs.
[0044] Optionally, the current microservice information of the target microservice in the current period is compared and analyzed with the historical microservice information in the historical period. By calculating the mean, median, standard deviation, maximum and minimum statistics of the key indicators of the microservice (such as TPS, response time, CPU and memory usage, etc.), the change trend of the future microservice information of the target microservice in the future period can be determined. Time series analysis methods such as autoregression, moving average, autoregressive integrated sliding average, etc. can be used to model the historical microservice information of the target microservice to predict the microservice information and resource usage in the future period. This is only for example and is not limited to this.
[0045] For example, if historical microservice information shows that TPS increases significantly between 12:00 and 14:00 every day, then combined with current microservice information, the TPS growth trend during this period in the future can be predicted, allowing resource preparation in advance.
[0046] Step S108: Determine an adjustment strategy for the container to be adjusted based on the change trend information and the microservice information threshold, and adjust the capacity of the container to be adjusted according to the adjustment strategy.
[0047] In the technical solution provided in the above step S108 of the embodiment of the present invention, after determining the change trend information of the target microservice based on the current microservice information and the historical microservice information of the target microservice in the historical period, the adjustment strategy of the container to be adjusted can be determined based on the change trend information and the microservice information threshold, and the capacity of the container to be adjusted can be adjusted according to the adjustment strategy, such as expansion or reduction. Among them, the adjustment strategy is used to represent the rules for adjusting the capacity. The microservice information threshold plays a key role in microservice capacity management. It is a series of preset standard values or limit values that can be used to measure and evaluate whether the operating status of the microservice is healthy and whether the resource usage is reasonable, and can trigger corresponding alarms or automatic adjustment mechanisms.
[0048] In this embodiment, the change trend information of the target microservice, such as the prediction of future business traffic and resource consumption, can be compared with the microservice information threshold to identify whether the capacity of the container needs to be adjusted. For example, when the predicted business indicators or resource usage of the microservice are close to or exceed the preset microservice information threshold, an adjustment strategy can be formulated, such as expansion (increasing container instances or resource allocation), reduction (reducing container instances or resource allocation), etc., to achieve reasonable utilization of resources and stable operation of the microservice. The business indicators of microservices are quantitative indicators that evaluate the performance and health of microservices when processing business requests. They can provide the operating status of microservices and provide important data support for capacity management and performance optimization. The business indicators of microservices can include TPS, response time, request success rate, throughput, number of concurrency, number of user connections, table space utilization and resource utilization, etc.
[0049] In this embodiment, after determining the adjustment strategy, corresponding operations can be performed to adjust the capacity of the container to be adjusted. For example, if the TPS is predicted to increase significantly in the next few hours, the number of container instances hosting the microservice can be automatically increased to meet the increased business demand. Conversely, if business demand is predicted to decrease and resource utilization is low, the number of container instances can be reduced to save costs.
[0050] Optionally, the setting of the microservice information threshold can comprehensively consider multiple factors such as the functional characteristics of the microservice, business requirements, resource limitations, and historical microservice information, so as to ensure that the microservice can run stably under resource configuration while avoiding resource waste.
[0051] In steps S102 to S108 of the embodiment of the present invention, if the capacity of the container to be adjusted is to be adjusted, the target microservice in the container to be adjusted of the microservice management platform can be determined, the current microservice information of the target microservice in the current time period can be determined, the change trend information of the target microservice can be determined based on the current microservice information and the historical microservice information of the target microservice in the historical time period, and the adjustment strategy of the container to be adjusted can be determined based on the change trend information and the microservice information threshold, and the capacity of the container to be adjusted can be adjusted according to the adjustment strategy. In this embodiment, the capacity of the container is adjusted based on the specific operation status of the microservice and the change trend of the future microservice information of the microservice in the future time period, avoiding over-estimation and resource waste, improving the accuracy and response speed of the container capacity adjustment, and reducing resource waste and manual intervention, thereby achieving the purpose of providing a more efficient and intelligent resource management method for microservices in a containerized environment. By estimating the future change trend of the microservice through historical and current microservice information, and determining whether the capacity of the container needs to be expanded or reduced, the technical effect of improving the accuracy of the container capacity adjustment is achieved, and the technical problem of low accuracy of the container capacity adjustment is solved.
[0052] The embodiment of the present invention is described in detail below in conjunction with the above steps.
[0053] As an optional embodiment, the method is applied to a capacity adjustment system of a container, the capacity adjustment system includes a rule management component and a data information collection component, wherein the method further includes: controlling the rule management component to obtain the microservice information collection rule entered by the target object, wherein the microservice information collection rule includes at least the identification information of the target microservice in the container to be adjusted, and the identification information of the container to be adjusted; step S102, determining the target microservice in the container to be adjusted of the microservice management platform, including: based on the identification information of the container to be adjusted in the microservice information collection rule, controlling the data information collection component to determine the container to be adjusted of the capacity to be adjusted from the microservice management platform, and based on the identification information of the target microservice in the microservice information collection rule, controlling the data information collection component to determine the target microservice from the container to be adjusted; step S104, determining the current microservice information of the target microservice in the current time period, including: controlling the data information collection component to obtain the current microservice information of the target microservice.
[0054] In this embodiment, in the container capacity adjustment system, the capacity adjustment system may include a rule management component and a data information collection component. The rule management component may be controlled to obtain the microservice information collection rules entered by the target object. To determine the target microservice in the container to be adjusted of the microservice management platform, the data information collection component may be controlled to determine the container to be adjusted whose capacity is to be adjusted from the microservice management platform according to the identification information of the container to be adjusted in the microservice information collection rules, such as the microservice name, microservice cluster identification information, etc., and to control the data information collection component to determine the target microservice from the container to be adjusted based on the identification information of the target microservice in the microservice information collection rules. To determine the current microservice information of the target microservice in the current time period, the data information collection component may be controlled to obtain the current microservice information of the target microservice. The microservice information collection rules may include at least the identification information of the target microservice in the container to be adjusted and the identification information of the container to be adjusted. The target object may be a device user.
[0055] Optionally, the rule management component can provide a portal for device users to enter microservice data collection rules, capacity calculation metric rules, and microservice database metric rules. Microservice data collection rules can include the service name to be collected, the application name to which the service belongs, the cluster, group, business metric thresholds, and the maximum service capacity of a single machine. Capacity calculation metric rules can include CPU and memory usage thresholds for service-related containers. Microservice database metric rules can include tablespace and user connection thresholds.
[0056] Optionally, the data information collection component can collect microservice data information set in the rule management component from multiple dimensions through the microservice data interface. Microservice data information can include business indicator data (such as TPS, response time), information about the application module where the microservice is located, hardware resource data consumed by the container hosting the service (such as CPU, memory, etc.), and database resource data used by the service (such as table space, number of user connections).
[0057] As an optional embodiment, the capacity adjustment system includes a data integration and storage component, wherein, based on the identification information of the container to be adjusted in the microservice information collection rule, the control data information collection component determines the container to be adjusted whose capacity is to be adjusted from the microservice management platform, and based on the identification information of the target microservice in the microservice information collection rule, the control data information collection component determines the target microservice from the container to be adjusted. The method also includes: controlling the data integration and storage component to integrate and process the current microservice information, and converting the integrated current microservice information into a target format; controlling the data integration and storage component to store the current microservice information in the target format.
[0058] In this embodiment, the capacity adjustment system may include a data integration and storage component. Based on the identification information of the container to be adjusted in the microservice information collection rule, the data information collection component is controlled to determine the container to be adjusted whose capacity is to be adjusted from the microservice management platform, and based on the identification information of the target microservice in the microservice information collection rule, the data information collection component is controlled to determine the target microservice from the container to be adjusted. Then, the data integration and storage component can be controlled to integrate the current microservice information and convert the integrated current microservice information into a target format. The target format is a standardized data structure that is convenient for subsequent processing and analysis. For example, it can be a data table format with predefined fields and data types. By converting the data into the target format, the consistency and readability of the data can be ensured during storage and processing, which is convenient for subsequent capacity analysis components and indicator warning display components to use. The data integration and storage component can be controlled to store the current microservice information in the target format.
[0059] Optionally, the data integration and storage component can integrate and process the current microservice information obtained from the microservice management platform, including data cleaning, formatting and standardization of the current microservice information to eliminate noise and outliers in the data of the current microservice information, ensure the consistency and accuracy of the data of the current microservice information, and facilitate subsequent analysis and storage.
[0060] Optionally, the data integration and storage component can perform secondary normalization on the current microservice information collected by the data information collection component, converting it into a unified format (target format) and storing it in the database for use by other components. For example, if other components in the capacity adjustment system require the current microservice information to be input in a specific time series format, the data integration and storage component will need to reorganize and store the current microservice information in this time series format to achieve a unified format.
[0061] As an optional embodiment, the method further includes: the control rule management component obtains the capacity calculation indicator rules entered by the target object, wherein the calculation indicator rules include at least the central processing unit and memory usage of the container to be adjusted corresponding to the target microservice.
[0062] In this embodiment, the target object (usually an operation and maintenance personnel or a system administrator) can enter the capacity calculation indicator rules through the interface of the rule management component. The calculation indicator rules may include the identification information of the target microservice and the CPU and memory usage of the container to be adjusted.
[0063] As an optional embodiment, the capacity adjustment system includes a capacity analysis component, wherein step S106 determines the change trend information of the target microservice based on the current microservice information and the historical microservice information of the target microservice within a historical period, including: controlling the capacity analysis component, calling the historical microservice information of the target microservice, and determining the change trend information based on the historical microservice information and the current microservice information.
[0064] In this embodiment, the capacity adjustment system may include a capacity analysis component. To determine change trend information of a target microservice based on current microservice information and historical microservice information of the target microservice within a historical period, the capacity analysis component may be controlled to retrieve the historical microservice information of the target microservice and determine the change trend information based on the historical microservice information and the current microservice information.
[0065] Optionally, the capacity analysis component can extract current microservice information and combine it with historically collected microservice information to estimate the changing trends of microservice business indicators over the next period of time, providing a scientific basis for advance planning and dynamic adjustment of resources, thereby ensuring the stable and efficient operation of microservices in various business scenarios.
[0066] As an optional embodiment, after determining the change trend information of the target microservice based on the current microservice information and the historical microservice information of the target microservice within the historical period, the method also includes: controlling the capacity analysis component to at least associate the change trend information with the central processing unit and memory usage in the calculation indicator rules.
[0067] In this embodiment, after determining the change trend information of the target microservice based on the current microservice information and the historical microservice information of the target microservice within the historical period, the capacity analysis component can be controlled to at least associate the change trend information with the central processing unit and memory usage in the calculation indicator rule.
[0068] Optionally, when the rule management component receives the capacity calculation indicator rules entered by the target object, it can trigger the data information collection component to start collecting relevant data from the microservice management platform, including the business indicators of the target microservice, the CPU and memory usage of the container, etc. The collected data can be sent to the data integration and storage component for operations such as data cleaning, formatting, and storage. The capacity analysis component can estimate the changing trend of the business indicators of the microservices in the future by extracting the current microservice information and combining it with the historically collected microservice information. At the same time, it can associate the CPU and memory usage trend charts of the container to which the service belongs, as well as the resource usage of the database, to generate resource expansion and contraction recommendations, providing a basis for decision-making for operation and maintenance personnel.
[0069] As an optional embodiment, the capacity adjustment system includes an indicator warning display component, wherein the method further includes: controlling the indicator warning display component, rendering the change trend information and microservice information thresholds, and displaying the rendered change trend information and microservice information thresholds.
[0070] In this embodiment, the capacity adjustment system may include an indicator warning display component and a control indicator warning display component, which can visualize the change trend information and microservice information thresholds.
[0071] Optionally, the indicator warning display component can integrate and display the trend charts of various service business indicators and resource utilization indicator trend charts contained in the software on a software basis, and can also mark the preset microservice information threshold (indicator threshold) boundaries.
[0072] As an optional embodiment, step S108 determines the adjustment strategy of the container to be adjusted based on the change trend information and the microservice information threshold, including: in response to the change trend information exceeding the microservice information threshold, sending a prompt message to the target object, wherein the prompt message is used to prompt the target object whether it agrees to start adjusting the capacity; in response to detecting that the target object has issued an adjustment instruction in response to the prompt message, determining the adjustment strategy for adjusting the container to be adjusted; step S108, adjusting the capacity of the container to be adjusted according to the adjustment strategy, including: expanding or reducing the capacity according to the adjustment instruction corresponding to the adjustment strategy.
[0073] In this embodiment, in the process of determining the adjustment strategy of the container to be adjusted based on the change trend information and the microservice information threshold, a prompt message can be sent to the target object when the change trend information exceeds the microservice information threshold; when the target object detects the consent instruction issued by the prompt message, the adjustment strategy for adjusting the container can be determined. In the process of adjusting the capacity of the container to be adjusted according to the adjustment strategy, the capacity can be expanded or reduced according to the adjustment instruction corresponding to the adjustment strategy. Among them, the prompt information can be used to prompt the target object whether it agrees to start adjusting the capacity, and can explain in detail the current change trend, potential risks and recommended adjustment measures, such as proposing to increase the number of container instances to cope with the expected business peak, or reduce the number of instances to avoid resource waste.
[0074] Optionally, the capacity adjustment system may issue adjustment instructions to the container management platform according to the determined adjustment strategy. The adjustment instructions may include expansion instructions and reduction instructions. Expansion instructions may instruct the container platform to increase the number of container instances of the target microservice and / or increase the resource quota (such as CPU, memory) of a single container to cope with the predicted business growth. Reduction instructions may instruct the container platform to reduce the number of container instances or reduce the resource quota of a single container when the business demand is predicted to decrease or the resource utilization rate is below a certain threshold, so as to save costs and improve resource utilization efficiency.
[0075] Optionally, when the change trend information exceeds the microservice information threshold, an alarm can be generated to remind operation and maintenance personnel to expand resources in a timely manner.
[0076] In an embodiment of the present invention, if the capacity of a container to be adjusted is to be adjusted, the target microservice in the container to be adjusted of the microservice management platform can be determined, the current microservice information of the target microservice in the current period can be determined, the change trend information of the target microservice can be determined based on the current microservice information and the historical microservice information of the target microservice in the historical period, the adjustment strategy of the container to be adjusted can be determined based on the change trend information and the microservice information threshold, and the capacity of the container to be adjusted can be adjusted according to the adjustment strategy. In this embodiment, the capacity of the container is adjusted based on the specific operation status of the microservice and the change trend of the future microservice information of the microservice in the future period, avoiding over-estimation and resource waste, improving the accuracy and response speed of the container capacity adjustment, and reducing resource waste and manual intervention, thereby achieving the purpose of providing a more efficient and intelligent resource management method for microservices in a containerized environment. By estimating the change trend of the future microservice through historical and current microservice information, and judging whether the capacity of the container needs to be expanded or reduced, the technical effect of improving the accuracy of the container capacity adjustment is achieved, and the technical problem of low accuracy of the container capacity adjustment is solved.
[0077] Example 2
[0078] The following describes in detail another optional specific implementation.
[0079] With the rapid development and widespread adoption of cloud services, businesses are proliferating across major cloud platforms, and the number of microservices on these platforms is also rapidly increasing. To support the maintenance and management of numerous microservices on the cloud, data collection and unified capacity management are necessary. Microservices, which evolved from the divide-and-conquer philosophy, are large and comprehensive systems. With the development of the internet, it has become difficult to meet market technological demands. The processing and monitoring of massive amounts of data, including the operational status and resource consumption of numerous microservices, requires a unified approach to integration and management, thereby reducing resource expenditures on microservice maintenance and management.
[0080] The present invention proposes a microservice capacity management method based on statistical process control. This method, based on the functions provided by existing microservice application management systems, uniformly collects and integrates multi-dimensional data such as business traffic monitoring indicators, service operation status, service resource consumption, and database usage of microservices. Guided by statistical process control methods, the data is analyzed and evaluated, thereby implementing a decision-making process based on the multi-dimensional data of microservices and better completing the maintenance and management of cloud platform microservices. The present invention overcomes the existing situation where manual collection, integration, and analysis of the operation data of numerous microservices cannot be carried out uniformly, and scaling recommendations can be provided more conveniently. This achieves the technical effect of improving the accuracy of container capacity adjustment and solves the technical problem of low accuracy of container capacity adjustment.
[0081] The following is a further introduction to this method.
[0082] Figure 2 Schematic diagram of a microservice capacity management system based on statistical process control for microservice applications according to an embodiment of the present invention. Figure 2 As shown, the microservice capacity management system 200 includes: a data information collection component 202 , a data integration and storage component 204 , a rule management component 206 , a capacity analysis component 208 , and an indicator warning display component 210 .
[0083] The data information collection component 202 can collect microservice data information set in the rule management component from multiple dimensions through various data interfaces provided by the service management system. This includes business indicator data (e.g., number of requests per second, response time), information about the application module where the microservice is located, hardware resource data consumed by the container hosting the service (e.g., CPU, memory, etc.), and database resource data used by the service (e.g., table space, number of user connections).
[0084] The data integration and storage component 204 can perform normalized secondary processing on the data collected by the data information collection component, convert it into a unified format and store it in a database for use by other components.
[0085] The rule management component 206 can provide an entry for device users to enter microservice data collection rules (including the service name to be collected, the application name to which the service belongs, the cluster, group, business indicator threshold, the maximum service capacity of a single machine, etc.), capacity calculation indicator rules (including the CPU and memory usage thresholds of service-related containers, etc.), and microservice database indicator rules (for example, table space, user connection number threshold, etc.).
[0086] The capacity analysis component 208 can extract the specified microservice data, combine the historically collected data and the set indicator thresholds, estimate the changing trend of the microservice's business indicators in the future, and at the same time associate the CPU and memory usage trend charts of the container to which the service belongs, as well as the resource usage of the database, to generate resource expansion and contraction suggestions, providing decision-making basis for service maintenance personnel.
[0087] The indicator warning display component 210 can integrate and display the trend charts of various service business indicators and resource utilization indicator trend charts contained in the software on a software basis, and mark the preset indicator threshold limits. When the indicator exceeds the threshold limit, an alarm is generated to remind maintenance personnel to expand resources in time.
[0088] In the embodiment of the present invention, by integrating the functions of multiple components, refined and automated capacity management of cloud platform microservices is achieved, the accuracy of resource adjustment is improved, the automation of early warning and decision-making is achieved, data collation and storage are optimized, flexible rule configuration is provided, service quality and user experience are improved, and operation and maintenance costs are reduced, providing strong support for the efficient and accurate operation of microservices in the cloud platform environment.
[0089] This invention proposes a microservice capacity management method based on statistical process control. It collects dimensional indicator data generated by actual microservices according to preset rules and, through data cleansing, normalizes and stores this multi-dimensional indicator data. Based on historical data and preset indicator thresholds, resource scaling recommendations can be generated based on the correlations between the data, providing a basis for decision-making for service maintenance personnel. It also provides daily service business indicator monitoring and early warning capabilities. This design emphasizes control throughout the entire process, relying on collected data for analysis and decision-making, and emphasizing a data-driven decision-making process. Figure 3 is a flow chart of a microservice capacity management method based on statistical process control according to an embodiment of the present invention. Figure 3 As shown, the following steps are included:
[0090] Step S301: Set microservice items and associated resource indicator items.
[0091] In the technical solution provided in the above step S301 of the embodiment of the present invention, the data information collection component A can collect the microservice data information set in the rule management component from multiple dimensions through the various data interfaces provided by the service management system. Basic information configuration can be performed on the microservices to be included in the capacity management system, and microservice items and associated resource indicator items can be set. For example, service name, application, group, database information, maximum service capacity of a single instance, etc. The above basic information can be used to confirm what information the capacity management system needs to collect, and according to what standards the target service capacity is calculated. Resource indicator items may include computing resources (such as CPU, memory), storage resources (such as disk I / O, file system), network resources (such as bandwidth, number of connections) and database resources (such as database type, table space, number of connections).
[0092] Step S302: Set microservice indicator thresholds.
[0093] In the technical solution provided in the above step S302 of the embodiment of the present invention, threshold configuration may be performed for the microservices to be included in the capacity management system.
[0094] In this embodiment, the microservice indicator threshold can be a resource usage control threshold. By setting a resource usage control threshold, you can monitor resource usage during microservice runtime. For example, you can set a CPU usage exceeding 80% as a high threshold, indicating that the system should consider capacity expansion; and set a memory usage exceeding 90% as a critical threshold, requiring immediate action to prevent service crashes.
[0095] Step S303: Acquire collection item information.
[0096] In the technical solution provided in the above step S303 of the embodiment of the present invention, the data information collection component B can determine the collection items according to the pre-configured service information.
[0097] Step S304: collecting indicator data.
[0098] In the technical solution provided in the above step S304 of the embodiment of the present invention, relevant indicator data can be collected through the numerous interfaces provided by the microservice management platform, including the number of business requests per second, maximum response time, CPU and memory usage, number of database connections, table space usage, etc.
[0099] Step S305: clean and format the indicator data.
[0100] In the technical solution provided in the above step S305 of the embodiment of the present invention, the data integration and storage component C can clean the collected original business indicators, resource usage and other data to complete unified formatting preprocessing.
[0101] Step S306: The threshold value and indicator data are stored in the database.
[0102] In the technical solution provided in step S306 of the embodiment of the present invention, the indicator data can be stored in the database for future use after being cleaned and formatted, and the corresponding service capacity threshold, water level control upper limit, resource cost threshold, etc. can also be configured.
[0103] Step S307: extract the extracted data and estimate the indicator change trend according to the rules.
[0104] In the technical solution provided in the above step S307 of the embodiment of the present invention, the capacity analysis component D can extract the selected service indicator data according to the pre-set capacity indicator calculation rules, form an estimated indicator change trend chart, combine the changes in resource costs and the real data collected historically, analyze and calculate the water level values that the indicators and resource costs may reach in a period of time in the future, and find the changing relationship between the business indicators and resource costs of the selected service.
[0105] Step S308: Generate resource expansion and contraction suggestions to provide a basis for decision-making.
[0106] In the technical solution provided in the above step S308 of the embodiment of the present invention, the accuracy of the preset capacity indicator can be continuously optimized through repeated measurements based on real data, thereby improving the reliability of capacity analysis and prediction.
[0107] Step S309: Display the service indicator trend chart and related resource indicator costs.
[0108] In the technical solution provided in the above step S309 of the embodiment of the present invention, the indicator warning display component E can display the service indicator data in the form of a trend chart, and at the same time provide resource usage information and water level thresholds for reference, which can intuitively reflect the current service capacity status.
[0109] Step S310: alarm notification of abnormal indicators.
[0110] In the technical solution provided in the above step S310 of the embodiment of the present invention, when any indicator of business flow or resource usage exceeds a preset water level threshold, the indicator warning display component E may issue an alarm notification.
[0111] In this embodiment, container capacity is adjusted based on the specific operating conditions of microservices and the changing trends of future microservice information within a future time period. This avoids overestimation and resource waste, improves the accuracy and response speed of container capacity adjustment, and reduces resource waste and manual intervention, achieving the goal of providing a more efficient and intelligent resource management method for microservices in a containerized environment. By estimating future microservice changing trends based on historical and current microservice information and determining whether the container capacity needs to be expanded or reduced, the accuracy of container capacity adjustment is improved, solving the technical problem of low accuracy in container capacity adjustment.
[0112] The following uses cloud platform microservice capacity query as an example to describe the one-stop information retrieval method provided by the present invention, including configuring cloud platform microservice data retrieval rules, collecting microservice indicator data, integrating the data into the database, and querying and displaying service indicators.
[0113] When configuring data retrieval rules for microservices on the cloud platform, the rule management component provides three types of rule data management: service-related metrics management, compute-related metrics management, and database-related metrics management. Service-related rules configure basic service information, including the relationship between the service and its application, the processing capacity of a single service instance, and the service's ideal load. These settings enable the cloud platform to retrieve capacity assessment data for the microservices to be monitored, thereby calculating assessment metrics.
[0114] In the process of collecting microservice indicator data, after obtaining the configured basic service information, you can obtain the service version, number of online instances, service load, CPU and memory usage, associated database information, number of user connections, and table space utilization through the cloud platform based on the information collection component.
[0115] In the process of integrating data into the database, the threshold, water level control upper limit, health status and other extended data can be calculated by integrating and cleaning the actual indicator data of the microservices, and then stored in a unified format for backup.
[0116] In the process of querying and displaying service indicators, in order to display the service load more intuitively, the query interface uses each software as a set and displays the service load under it in categories. The changes in the service water level on the time axis, as well as the upper water level threshold, the historical highest corresponding water level, the response time and the standard response time are displayed in the form of a statistical process control (SPC) control chart. At the same time, the CPU memory and other resource usage of each instance of the service are auxiliary displayed. Each data indicator in the figure has more specific content for reference. You can click on the indicator to jump to the corresponding detailed information page for viewing.
[0117] On the cloud platform, the scalability of cloud services is much stronger and more convenient than that of previous physical machines. Real-time adjustment of service load capacity has become a common demand. So, whether to adjust and how much to adjust is a question that requires maintenance personnel to understand the capacity status of system services. In order to decide whether to expand and how much to expand, estimates can be made in a variety of ways. Taking the capacity prediction of cloud platform microservices as an example, the following describes the present invention using the method of historical maximum value evaluation and proportional measurement to achieve capacity prediction, including historical data extraction, service capacity measurement and measurement result output.
[0118] Data collection and storage components can be used to collect and store data for a specific service. After a long period of data accumulation, a capacity history database can be formed. When a user explicitly requests an increase in the current service's business traffic by several units, a capacity expansion assessment is required to improve the service's performance and capacity to meet user needs. The number of instances and resource quantities configured during the service's historical peak business traffic, as well as the resource utilization ratio at that time, can be retrieved for reference and measurement of capacity assessment. When system services require preventive capacity assessments during periodic holidays or events, historical service data for the same period can be extracted for reference and measurement.
[0119] When calculating the need to increase business traffic by a specific number of units, you can compare the single-instance service capabilities, the difference in the number of deployed instances, the difference in computing resources and database resource utilization between the service version during the historical peak business traffic period and the current service version, and comprehensively calculate the capacity configuration based on the current service water level control rules. When calculating the preventive capacity assessment needs for periodic holidays or events, you can use historical database data to calculate the growth ratio of business traffic for several historical periods. You can calculate the proportional addition based on the current maximum traffic value. Based on the traffic value after the proportional addition, you can comprehensively calculate the capacity configuration according to the resource allocation for the historical period, the current actual number of configured resources, and the current service water level control rules.
[0120] After capacity calculation is completed, each capacity indicator will have a capacity adjustment suggestion. For example, a document report will be generated based on the current configuration value, adjustment value, adjustment suggestion, etc., and provided to maintenance personnel to assist in capacity adjustment decision-making.
[0121] In this embodiment, guided by statistical process control methods, multi-dimensional data is integrated and, through the existing relationships between data, capacity analysis is performed on the overall status of service applications. This design can integrate data from multiple platforms, enabling one-stop access and query. Data indicator rules can be modified at any time, making measurement and calculation convenient and customizable for specific applications, increasing flexibility.
[0122] Example 3
[0123] The embodiment of the present invention provides a device for adjusting the capacity of a container. It should be noted that the device for adjusting the capacity of a container according to the embodiment of the present invention can be used to perform Figure 1 The following describes a method for adjusting the capacity of a container provided by an embodiment of the present invention.
[0124] Figure 4 Schematic diagram of a container capacity adjustment device according to an embodiment of the present invention. Figure 4 As shown, the container capacity adjustment device 400 may include: a first determination unit 402 , a second determination unit 404 , a third determination unit 406 and an adjustment unit 408 .
[0125] The first determining unit 402 is configured to determine a target microservice in a container to be adjusted in the microservice management platform.
[0126] The second determining unit 404 is configured to determine current microservice information of the target microservice in the current period, wherein the current microservice information is at least used to indicate the performance and / or resource usage of the target microservice during operation in the container to be adjusted.
[0127] The third determining unit 406 is configured to determine change trend information of the target microservice based on the current microservice information and historical microservice information of the target microservice in a historical period, wherein the change trend information is used to indicate a change trend of future microservice information of the target microservice in a future period.
[0128] The adjustment unit 408 is configured to determine an adjustment strategy for the container to be adjusted based on the change trend information and the microservice information threshold, and adjust the capacity of the container to be adjusted according to the adjustment strategy, wherein the adjustment strategy is used to represent a rule for adjusting the capacity.
[0129] The container capacity adjustment device provided in an embodiment of the present invention determines a target microservice in a container to be adjusted of a microservice management platform through a first determination unit 402; determines current microservice information of the target microservice in a current time period through a second determination unit 404, wherein the current microservice information is used to at least represent the performance and / or resource usage of the target microservice during its operation in the container to be adjusted; determines change trend information of the target microservice based on the current microservice information and historical microservice information of the target microservice in a historical time period through a third determination unit 406, wherein the change trend information is used to represent a change trend of future microservice information of the target microservice in a future time period; determines an adjustment strategy for the container to be adjusted based on the change trend information and a microservice information threshold through an adjustment unit 408, and adjusts the capacity of the container to be adjusted according to the adjustment strategy, wherein the adjustment strategy is used to represent a rule for adjusting the capacity, thereby achieving the technical effect of improving the accuracy of container capacity adjustment and solving the technical problem of low accuracy of container capacity adjustment.
[0130] The capacity adjustment device of the above-mentioned container may further include a processor and a memory. The above-mentioned units are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize corresponding functions.
[0131] The processor includes a kernel, which retrieves the corresponding program unit from memory. One or more kernels can be configured to gracefully shut down devices of the same device type by adjusting kernel parameters.
[0132] The above-mentioned memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0133] The processor contains a kernel, which retrieves the corresponding program unit from the memory. One or more kernels can be configured, and the kernel parameters can be adjusted to improve the efficiency of traders.
[0134] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0135] Example 4
[0136] According to an embodiment of the present invention, a computer-readable storage medium is further provided, on which a program is stored. When the program is executed by a processor, the method for adjusting the capacity of a container is implemented.
[0137] Example 5
[0138] According to an embodiment of the present invention, a processor is further provided. The processor is configured to run a program, wherein the method for adjusting the capacity of a container is executed when the program is running.
[0139] Example 6
[0140] Figure 5 is a schematic diagram of an electronic device for a method for adjusting the capacity of a container according to an embodiment of the present invention, such as Figure 5 As shown, an embodiment of the present invention further provides an electronic device 500, which includes a processor 501, a memory 502, and a program stored in the memory and executable on the processor 501, and the processor 501 executes the above steps of the embodiment of the present invention.
[0141] Example 7
[0142] The embodiment of the present application further provides a computer program product. Optionally, in this embodiment, the computer program product may include a computer program that, when executed by a processor, implements the container capacity adjustment method of the embodiment of the present application.
[0143] The devices in this article can be servers, PCs, PADs, mobile phones, etc.
[0144] The present invention also provides a computer program product, which, when executed on a data processing device, is suitable for executing the above steps in the embodiments of the present invention.
[0145] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0146] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the steps in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0147] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0148] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0149] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0150] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0151] Computer-readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media (transit media), such as modulated data signals and carrier waves.
[0152] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.
[0153] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0154] The above are merely embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should all be included within the scope of the claims of the present application.
Claims
1. A method for adjusting the capacity of a container, characterized in that: include: Determine the target microservice in the container to be adjusted on the microservice management platform; Determining current microservice information of the target microservice in a current time period, wherein the current microservice information is at least used to indicate performance and / or resource usage of the target microservice during operation in the container to be adjusted; Determining change trend information of the target microservice based on the current microservice information and historical microservice information of the target microservice in a historical period, wherein the change trend information is used to represent a change trend of future microservice information of the target microservice in a future period; An adjustment strategy for the container to be adjusted is determined based on the change trend information and the microservice information threshold, and the capacity of the container to be adjusted is adjusted according to the adjustment strategy, wherein the adjustment strategy is used to represent a rule for adjusting the capacity.
2. The capacity adjustment method according to claim 1, wherein: The method is applied to a container capacity adjustment system, wherein the capacity adjustment system includes a rule management component and a data information collection component, wherein the method further includes: Controlling the rule management component to obtain the microservice information collection rule entered by the target object, wherein the microservice information collection rule includes at least the identification information of the target microservice in the container to be adjusted and the identification information of the container to be adjusted; Determine the target microservices in the container to be adjusted on the microservice management platform, including: Based on the identification information of the container to be adjusted in the microservice information collection rule, control the data information collection component to determine the container to be adjusted whose capacity is to be adjusted from the microservice management platform, and based on the identification information of the target microservice in the microservice information collection rule, control the data information collection component to determine the target microservice from the container to be adjusted; Determining current microservice information of the target microservice in a current time period includes: controlling the data information collection component to obtain the current microservice information of the target microservice.
3. The capacity adjustment method according to claim 2, wherein: The capacity adjustment system includes a data integration and storage component, wherein, after controlling the data information collection component to determine the container to be adjusted whose capacity is to be adjusted from the microservice management platform based on the identification information of the container to be adjusted in the microservice information collection rule, and controlling the data information collection component to determine the target microservice from the container to be adjusted based on the identification information of the target microservice in the microservice information collection rule, the method further includes: Controlling the data integration and storage component to integrate the current microservice information and convert the integrated current microservice information into a target format; Control the data integration and storage component to store the current microservice information in the target format.
4. The capacity adjustment method according to claim 2, wherein: The method further comprises: The rule management component is controlled to obtain the capacity calculation indicator rule entered by the target object, wherein the calculation indicator rule at least includes the central processing unit and memory usage of the container to be adjusted corresponding to the target microservice.
5. The capacity adjustment method according to claim 4, characterized in that: The capacity adjustment system includes a capacity analysis component, wherein, based on the current microservice information and the historical microservice information of the target microservice within a historical period, determining the change trend information of the target microservice includes: The capacity analysis component is controlled to call the historical microservice information of the target microservice, and the change trend information is determined based on the historical microservice information and the current microservice information.
6. The capacity adjustment method according to claim 5, characterized in that: After determining the change trend information of the target microservice based on the current microservice information and the historical microservice information of the target microservice within a historical period, the method further includes: The capacity analysis component is controlled to at least associate the change trend information with the central processing unit and the memory usage in the calculation indicator rule.
7. The capacity adjustment method according to claim 6, characterized in that: The capacity adjustment system includes an indicator warning display component, wherein the method further includes: The indicator warning display component is controlled to render the change trend information and the microservice information threshold, and the rendered change trend information and the microservice information threshold are displayed.
8. The capacity adjustment method according to claim 2, wherein: Determining an adjustment strategy for the container to be adjusted based on the change trend information and the microservice information threshold includes: In response to the change trend information exceeding the microservice information threshold, sending adjustment prompt information to the target object, wherein the adjustment prompt information is used to prompt the target object whether to agree to start adjusting the capacity; In response to detecting that the target object has issued an instruction of consent to the adjustment prompt information, determining the adjustment strategy for adjusting the container to be adjusted; Adjusting the capacity of the container to be adjusted according to the adjustment strategy includes: The capacity is expanded or reduced according to the adjustment instruction corresponding to the adjustment strategy.
9. A container capacity adjustment device, characterized in that: include: A first determining unit is configured to determine a target microservice in a container to be adjusted on a microservice management platform; A second determining unit is configured to determine current microservice information of the target microservice in a current period, wherein the current microservice information is at least used to indicate the performance and / or resource usage of the target microservice during its operation in the container to be adjusted; a third determining unit, configured to determine, based on the current microservice information and historical microservice information of the target microservice within a historical period, change trend information of the target microservice, wherein the change trend information is used to indicate a change trend of future microservice information of the target microservice within a future period; An adjustment unit is configured to determine an adjustment strategy for the container to be adjusted based on the change trend information and the microservice information threshold, and adjust the capacity of the container to be adjusted according to the adjustment strategy, wherein the adjustment strategy is used to represent a rule for adjusting the capacity.
10. A processor, characterized in that: The processor is configured to run a program, wherein the program, when run by the processor, executes the method for adjusting the capacity of a container according to any one of claims 1 to 8.
Citation Information
Patent Citations
Internet of vehicles platform capacity expansion and contraction method and system, and storage medium
CN117221125A
Early warning method and device for service capacity of application system
CN117932438A