Container management method and device and computer program product

By introducing a target model into the container management system to predict future access volume and dynamically adjust the number of containers, the problem of low container management efficiency is solved, and more efficient resource utilization and system stability are achieved.

CN120994309APending Publication Date: 2025-11-21TRAVELSKY TECHNOLOGY LIMITED
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511112366.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-08
Publication Date
2025-11-21

AI Technical Summary

Technical Problem

Existing technologies for container management are inefficient, especially when dealing with sudden surges in concurrent requests, which can lead to response delays, resulting in a degraded user experience and the risk of service interruption.

Method used

By collecting access volume of the target system at preset intervals, using the target model to predict future access volume, and determining container adjustment strategies based on the predicted access volume and current access volume, the number of containers is dynamically adjusted, including expansion or reduction.

Benefits of technology

It improves the efficiency of container management, enhances the system's real-time response and self-optimization capabilities, and ensures efficient resource utilization and stable system operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120994309A_ABST
    Figure CN120994309A_ABST
Patent Text Reader

Abstract

The invention discloses a container management method and device and a computer program product. The method relates to the field of artificial intelligence, and comprises the following steps: acquiring the page view of a target system in each time period in a preset period every preset period to obtain a page view set; the page view set is input into a target model, the predicted page view of the next time period adjacent to the preset period is obtained, the target model is obtained through training of multiple sets of training samples, and each set of training samples comprises a historical page view set in one historical period and the historical page view of the next time period adjacent to the historical period; determining the page view of the target system in the current time period, obtaining the current page view, and determining a container adjustment strategy of the target system based on a comparison result of the current page view and a preset page view threshold value and a comparison result of the predicted page view and the preset page view threshold value; and adjusting the container number of the target system based on the container adjustment strategy. Through the method and the device, the problem of low container management efficiency in related technologies is solved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of artificial intelligence, and in particular, to a container management method, device and computer program product. BACKGROUND

[0002] With the accelerated promotion of digital transformation, cloud-native technology has become the first choice for many enterprises to build information technology infrastructure. Agile development, continuous delivery, and microservices, containerization and other practices of cloud-native technology bring unprecedented flexibility and efficiency to enterprises. Container cluster management system can realize the automatic deployment, expansion and management of containers. In high concurrency scenarios, the automatic scaler provides strong support for enterprise systems. The automatic scaler can automatically increase or decrease the number of containers by monitoring the central processing unit and memory usage of the application, so as to respond to the changing user demand and ensure the stability and response speed of the service.

[0003] However, the container scaling mechanism in the related art is not perfect. When handling sudden large concurrent requests, its response mechanism is based on the real-time consumption of current resources, and there is a certain lag. For example, when the system load suddenly rises, although the automatic scaler can sense the resource pressure and start the expansion process, since the startup, initialization and preheating of the container all need a certain time, the system may still be in an overload state during this period, resulting in a decline in user experience, and even the risk of service interruption. This phenomenon is particularly evident during business peak periods, posing a major challenge to business continuity and performance guarantee.

[0004] At present, there is no effective solution to the problem of low container management efficiency in the related art. SUMMARY

[0005] The main purpose of the present application is to provide a container management method, device and computer program product to solve the problem of low container management efficiency in the related art.

[0006] In order to achieve the above object, according to one aspect of the present application, a container management method is provided. The method comprises: collecting access amounts of a target system in each time period in a preset period every preset period to obtain an access amount set, wherein the preset period comprises a plurality of time periods; inputting the access amount set into a target model to obtain a predicted access amount of a next time period adjacent to the preset period, wherein the target model is trained by a plurality of training samples, and each training sample comprises a historical access amount set in a historical period and a historical access amount of a next time period adjacent to the historical period; determining an access amount of a current time period of the target system to obtain a current access amount, determining a container adjustment strategy of the target system based on a comparison result of the current access amount and a preset access amount threshold and a comparison result of the predicted access amount and the preset access amount threshold; and adjusting a container quantity of the target system based on the container adjustment strategy.

[0007] Optionally, determining the container adjustment strategy of the target system based on the comparison result of the predicted access amount and the preset access amount threshold comprises: determining whether the predicted access amount is greater than a first access amount threshold; in a case where the predicted access amount is greater than the first access amount threshold, calculating a first copy quantity of expanded containers based on the predicted access amount, and determining a first expansion strategy as the container adjustment strategy, wherein the first expansion strategy is to expand the target system by the first copy quantity of containers; in a case where the predicted access amount is less than or equal to the first access amount threshold, determining whether the predicted access amount is less than a second access amount threshold, wherein the second access amount threshold is less than the first access amount threshold; and in a case where the predicted access amount is less than the second access amount threshold, calculating a second copy quantity of reduced containers based on the predicted access amount, and determining a first reduction strategy as the container adjustment strategy, wherein the first reduction strategy is to reduce the target system by the second copy quantity of containers.

[0008] Optionally, calculating the first copy quantity of the expanded containers based on the predicted access amount comprises: determining an expected access amount and a current container quantity of the target system; calculating a ratio of the predicted access amount to the expected access amount, and calculating a product of the current container quantity and the ratio to obtain a first target value, and obtaining the first copy quantity by rounding up the first target value; and calculating the second copy quantity of the reduced containers based on the predicted access amount comprises: calculating a ratio of the predicted access amount to the expected access amount, and calculating a product of the current container quantity and the ratio to obtain a second target value, and obtaining the second copy quantity by rounding up the second target value.

[0009] Optionally, after determining whether the predicted access amount is less than the second access amount threshold, determining the container adjustment strategy of the target system based on the comparison result of the current access amount and the preset access amount threshold comprises: in a case where the predicted access amount is greater than or equal to the second access amount threshold and the predicted access amount is less than or equal to the first access amount threshold, determining whether the current access amount is greater than a third access amount threshold, wherein the third access amount threshold is greater than the second access amount threshold and less than the first access amount threshold; in a case where the current access amount is greater than the third access amount threshold, calculating a third copy number of the expanded container based on the current access amount, and determining a second expansion strategy as the container adjustment strategy, wherein the second expansion strategy is to expand the target system by the third copy number of the container; in a case where the current access amount is less than or equal to the third access amount threshold, calculating a fourth copy number of the contracted container based on the current access amount, and determining a second contraction strategy as the container adjustment strategy, wherein the second contraction strategy is to contract the target system by the fourth copy number of the container.

[0010] Optionally, calculating the third copy number of the expanded container based on the current access amount comprises: determining an expected access amount and a current container number of the target system; calculating a ratio of the current access amount to the expected access amount, and calculating a product of the current container number and the ratio to obtain a third target value, and rounding up the third target value to obtain the third copy number; calculating the fourth copy number of the contracted container based on the current access amount comprises: calculating a ratio of the current access amount to the expected access amount, and calculating a product of the current container number and the ratio to obtain a fourth target value, and rounding up the fourth target value to obtain the fourth copy number.

[0011] Optionally, before inputting the access amount set into the target model, the method further comprises: determining whether the current time reaches a preset model training time; in a case where the current time reaches the preset model training time, obtaining historical access data of the target system in a target period; determining a plurality of historical periods from the historical access data, and extracting a historical access amount set of each historical period and historical access amount of a next period adjacent to the historical period; determining the historical access amount set of each historical period and the historical access amount of the next period adjacent to the historical period as a group of training samples to obtain a plurality of groups of training samples; training the neural network model based on the plurality of groups of training samples to obtain the target model; in a case where the current time does not reach the preset model training time, performing the step of inputting the access amount set into the target model.

[0012] Optionally, before adjusting the number of containers of the target system based on the container adjustment strategy, the method further comprises: in a case where the container adjustment strategy is to expand the first target number of containers, determining a total number of replicas after expansion of the target system, and judging whether the total number of replicas is greater than the maximum number of containers; in a case where the total number of replicas is greater than the maximum number of containers, adjusting the first target number in the container adjustment strategy until the total number of replicas is less than the maximum number of containers; in a case where the total number of replicas is less than or equal to the maximum number of containers, performing the step of adjusting the number of containers of the target system based on the container adjustment strategy.

[0013] Optionally, before adjusting the number of containers of the target system based on the container adjustment strategy, the method further comprises: in a case where the container adjustment strategy is to shrink the second target number of containers, determining a total number of replicas after shrinkage of the target system, and judging whether the total number of replicas is less than the minimum number of containers; in a case where the total number of replicas is less than the minimum number of containers, adjusting the second target number in the container adjustment strategy until the total number of replicas is greater than or equal to the minimum number of containers; in a case where the total number of replicas is greater than or equal to the minimum number of containers, performing the step of adjusting the number of containers of the target system based on the container adjustment strategy.

[0014] To achieve the above object, according to another aspect of the present application, a container management apparatus is provided. The apparatus comprises: a collection unit configured to collect, every preset period, an access amount of a target system in each time period within the preset period to obtain an access amount set, wherein the preset period comprises a plurality of time periods; an input unit configured to input the access amount set into a target model to obtain a predicted access amount of a next time period adjacent to the preset period, wherein the target model is trained by a plurality of training samples, and each training sample comprises a historical access amount set in a historical period and a historical access amount of a next time period adjacent to the historical period; a first determination unit configured to determine an access amount of a current time period of the target system to obtain a current access amount, and determine a container adjustment strategy of the target system based on a comparison result of the current access amount and a preset access amount threshold and a comparison result of the predicted access amount and the preset access amount threshold; and an adjustment unit configured to adjust the number of containers of the target system based on the container adjustment strategy.

[0015] To achieve the above object, according to another aspect of the present application, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the steps of the container management method described in various embodiments of the present application.

[0016] By the present application, the following steps are adopted: collecting access amounts of the target system at each time period in a preset period every preset period to obtain an access amount set, wherein the preset period contains multiple time periods; inputting the access amount set into a target model to obtain a predicted access amount of a next time period adjacent to the preset period, wherein the target model is trained by multiple groups of training samples, and each group of training samples includes a historical access amount set in a historical period and a historical access amount of a next time period adjacent to the historical period; determining an access amount of a current time period of the target system to obtain a current access amount, and determining a container adjustment strategy of the target system based on a comparison result of the current access amount and a preset access amount threshold and a comparison result of the predicted access amount and the preset access amount threshold; and adjusting the number of containers of the target system based on the container adjustment strategy, thereby solving the problem of low container management efficiency in the related art. By introducing an intelligent prediction mechanism based on the target model and combining a dynamic container adjustment strategy, the intelligent level of resource utilization is improved, and the real-time response capability and self-optimization capability of the system are enhanced, thereby achieving the effect of improving the container management efficiency. BRIEF DESCRIPTION OF DRAWINGS

[0017] The accompanying drawings, which form a part of the present application, are intended to provide further understanding of the present application, and are used to interpret the illustrative embodiments of the present application and their descriptions, and do not constitute improper limitations to the present application. In the drawings:

[0018] Figure 1 is a flowchart of a container management method provided according to an embodiment of the present application;

[0019] Figure 2 is a schematic diagram of calculating an expected replica number according to an embodiment of the present application;

[0020] Figure 3 is a schematic diagram of a neural network model provided according to an embodiment of the present application;

[0021] Figure 4 is a schematic diagram of a cloud-native service governance architecture provided according to an embodiment of the present application;

[0022] Figure 5 is a schematic diagram of a container management apparatus provided according to an embodiment of the present application;

[0023] Figure 6 is a schematic diagram of an electronic device provided according to an embodiment of the present application. DETAILED DESCRIPTION

[0024] It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0025] In the following, the technical solutions in the embodiments of the present application will be described clearly and completely in conjunction with the drawings in the embodiments of the present application, so that those skilled in the art can better understand the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work should fall within the scope of protection of the present application.

[0026] It should be noted that the terms "first", "second" and the like in the description and claims of the present application and the above drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device that includes a series of steps or units does not necessarily limit to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0027] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for display, analyzed data, etc.) involved in the present disclosure are all information and data authorized by the user or authorized by all parties.

[0028] It should be noted that the collected information is information and data authorized by the user or authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of related data comply with relevant laws, regulations and standards in relevant regions, necessary security measures are taken, public order and good customs are not violated, and appropriate operation entrances are provided for users to choose authorization or refusal.

[0029] The present application will be described below in conjunction with preferred implementation steps, Figure 1 The flow chart of the container management method provided by the embodiments of the present application is shown in Figure 1 The method comprises the following steps:

[0030] In step S101, the access amount of the target system in each time period within a preset period is collected every preset period to obtain an access amount set, wherein the preset period contains multiple time periods.

[0031] In step S101, the target system is collected by the timing polling method to expose the index data through the HTTP (Hypertext Transfer Protocol) interface, that is, the access volume. The access volume index data will be generated in equal time intervals (that is, a time period) in order, and the timestamp is extracted as the basis for timing. The extracted access volume set needs to process missing values, that is, when the time series data is missing, the missing values are filled in the linear interpolation manner; the access volume set is arranged into the time series index data of the structure of {<t1, CL1>…<t2, CL>…<tn, CLn>} through the format standardization. After the range normalization operation, the data distribution is controlled in the [-1, 1] interval.

[0032] In step S102, the access volume set is input into the target model to obtain the predicted access volume of the next time period adjacent to the preset period, wherein the target model is trained by a plurality of training samples, and each training sample includes a historical access volume set in a historical period and a historical access volume adjacent to the next time period of the historical period.

[0033] In step S102, the preprocessed access volume set is judged whether to reach the set timing training period. If the timing training period is reached, the historical data is trained using the stacked LSTM (Long Short-Term Memory) model, and the model evaluation and parameter optimization are performed. The historical data is divided into a training set (about 70%-80%), a validation set (10%-15%) and a test set (10%-15%) in time sequence, and the time continuity of the data of each subset is ensured. Next, the LSTM model is constructed, the appropriate input sequence length is selected to capture the periodic characteristics of the access mode, and a sufficient number of LSTM units (such as 64 or 128) are set to process the complex time dependence relationship.

[0034] The mean square error is used as the loss function when compiling the model, and the Adam (Adaptive Moment Estimation) optimizer is used for parameter update. The early stopping method is implemented to avoid overfitting. In terms of hyperparameter adjustment, the learning rate (for example, starting from 0.001) and batch size (such as 32 or 64) are optimized through grid search or random search. During the parameter adjustment process, the performance on the validation set is closely monitored, and the set of hyperparameters that minimizes the validation error is finally selected. After the training is completed, the saved model is used to evaluate the generalization ability of the model on an independent test set by the developer, to ensure that the prediction accuracy meets the requirements, and to make a decision on whether to pass the evaluation. If the model evaluation fails, the model training and evaluation module is returned to retrain; if it passes, the model is registered in the model repository, the trained target model is obtained, and the target model is managed, a new version is generated and labeled to identify different development stages. The model file is handed over to the model inference service for management and real-time inference.

[0035] The access volume set will be inferred in real time by the model inference service, and the data will be written to a csv (Comma-Separated Values) file after the model inference, and the table will be stored by Prometheus (an open source monitoring and alarm system and time series database). For timestamps that do not yet have corresponding actual observation values, a special placeholder (such as null or a specific marker value) is pre-filled in the table to indicate that the data at that position is temporarily missing. Once the actual observation value arrives, the placeholder is immediately replaced with the real data. Table 1 is the structure table of the access volume inference result.

[0036] Table 1

[0037] Name Field Name Data Type Allow Null Auto Increment ID NUMBER(18, 0) NO Time TIME TIMESTAMP NO Current Value CURRENT_VALUE FLOAT NO Predict Value PREDICT_VALUE FLOAT NO

[0038] In step S103, the access volume of the target system in the current period is determined to obtain a current access volume, and a container adjustment strategy of the target system is determined based on a comparison result of the current access volume and a preset access volume threshold and a comparison result of the predicted access volume and the preset access volume threshold.

[0039] In step S103, upper and lower threshold values of the access amount are defined, which can be determined based on historical data, business requirements and system performance index analysis. The setting of the threshold values directly affects the triggering conditions and decision logic of container adjustment. When the current access amount monitored approaches or exceeds the preset access amount threshold value, the container adjustment strategy is triggered. If the access amount is lower than the lower threshold value, it may be considered to scale down to save resources; if it is higher than the upper threshold value, it may need to be scaled up to cope with higher load requirements. The prediction result is compared with the preset access amount threshold value. If the predicted access amount exceeds the threshold value range, even if the current access amount is still within a reasonable range, the system can make a scaling decision in advance to cope with the upcoming access amount change. In combination with the comparison result of the current access amount and the predicted access amount, and the relationship with the preset access amount threshold value, the specific container adjustment strategy is determined. For example, if the predicted access amount is significantly higher than the upper threshold value, the system will calculate the number of container replicas that need to be increased and trigger scaling up; conversely, if the predicted access amount is continuously lower than the lower threshold value, the system will calculate the number of container replicas that need to be reduced for scaling down.

[0040] In step S104, the number of containers of the target system is adjusted based on the container adjustment strategy.

[0041] In step S104, the number of containers in the container management cluster is adjusted according to the container adjustment strategy of the elastic scaling component, thereby completing the entire elastic scaling process. After determining the adjustment strategy, the system will calculate the new number of container replicas, and then issue an instruction through an interface or a dedicated scaling controller to trigger the scaling up or down action.

[0042] The container management method provided by the embodiment of the present application collects the access amount of the target system in each time period within a preset period every preset period to obtain an access amount set, wherein the preset period includes multiple time periods; inputs the access amount set into a target model to obtain a predicted access amount of a next time period adjacent to the preset period, wherein the target model is trained by multiple groups of training samples, and each group of training samples includes a historical access amount set in a historical period and a historical access amount of a next time period adjacent to the historical period; determines the access amount of the current time period of the target system to obtain a current access amount, determines a container adjustment strategy of the target system based on the comparison result of the current access amount and the preset access amount threshold value and the comparison result of the predicted access amount and the preset access amount threshold value; and adjusts the number of containers of the target system based on the container adjustment strategy, thereby solving the problem of low container management efficiency in related technologies. By introducing an intelligent prediction mechanism based on a target model and combining a dynamic container adjustment strategy, the intelligent level of resource utilization is improved, the real-time response capability and self-optimization capability of the system are enhanced, and the effect of improving the container management efficiency is achieved.

[0043] To avoid the low response efficiency of the container adjustment strategy, the container adjustment strategy can be determined based on a comparison result of the predicted access amount and a preset access amount threshold. Optionally, in the container management method provided in the embodiments of the present application, determining the container adjustment strategy of the target system based on the comparison result of the predicted access amount and the preset access amount threshold comprises: determining whether the predicted access amount is greater than a first access amount threshold; in the case where the predicted access amount is greater than the first access amount threshold, calculating a first replica number of the expanded container based on the predicted access amount, and determining the first expansion strategy as the container adjustment strategy, wherein the first expansion strategy is to expand the target system by the first replica number of the container; in the case where the predicted access amount is less than or equal to the first access amount threshold, determining whether the predicted access amount is less than a second access amount threshold, wherein the second access amount threshold is less than the first access amount threshold; in the case where the predicted access amount is less than the second access amount threshold, calculating a second replica number of the shrunk container based on the predicted access amount, and determining the first shrink strategy as the container adjustment strategy, wherein the first shrink strategy is to shrink the target system by the second replica number of the container.

[0044] In some embodiments, the elastic scaling component determines the expansion or shrink type based on the obtained elastic scaling load expectation threshold, the maximum replica number, the minimum replica number, the current access amount and the predicted access amount of the next period. For example, set the tolerance T to 0.2, then when the expected access amount is 0.5, the threshold range is [0.3, 0.7]. That is, the first access amount threshold is 0.7 and the second access amount threshold is 0.3. When the predicted access amount is outside the threshold tolerance range, that is, when the predicted access amount is greater than the upper threshold 0.7, the expected first replica number of the expansion is calculated and output, and the expansion strategy is executed; the shrink strategy: when the predicted access amount is less than the lower threshold 0.3, the expected second replica number of the shrink is calculated and output, and the system will execute the shrink strategy. When the predicted access amount is within the threshold range, the current access amount is obtained, and the expected replica number of the expansion or shrink is calculated by judging the size of the current access amount and the set expected access amount. After the replica number is output, the output replica number of the next period is determined.

[0045] For example, Figure 2 is a schematic diagram for calculating the expected replica number according to the embodiments of the present application, as Figure 2 shown, the predicted index value (that is, the predicted access amount) is obtained, it is judged whether the predicted index is greater than or equal to the upper threshold, if greater than or equal to, the expected replica number of the expansion is calculated, if less than the upper threshold, it is judged whether the predicted index value is less than or equal to the lower threshold, if less than or equal to the lower threshold, the expected replica number of the shrink is calculated, if greater than the lower threshold, the current index value (that is, the current access amount) is obtained, it is judged whether the current index value is greater than or equal to the third access amount threshold, if greater than or equal to, the expected replica number of the expansion is calculated, if less than, the expected replica number of the shrink is calculated, the expected replica number is output, and the next period is executed.

[0046] The embodiment is based on dynamic scaling of predicted access volume and current access volume, improves the traditional container adjustment strategy, and determines the adjustment of the number of container replicas not only according to the current load condition but also in combination with the predicted value of future access volume. The fluctuation of access volume can be more accurately coped with, and efficient use of resources and stable operation of the system can be realized.

[0047] The number of replicas for scaling up or down can be calculated based on the expected access volume. Optionally, in the container management method provided in the embodiment of the application, calculating the first number of replicas of the scaled-up container based on the predicted access volume comprises: determining the expected access volume of the target system and the current number of containers; calculating the ratio of the predicted access volume to the expected access volume, and calculating the product of the current number of containers and the ratio to obtain a first target value, and rounding up the first target value to obtain the first number of replicas; calculating the second number of replicas of the scaled-down container based on the predicted access volume comprises: calculating the ratio of the predicted access volume to the expected access volume, and calculating the product of the current number of containers and the ratio to obtain a second target value, and rounding up the second target value to obtain the second number of replicas.

[0048] In some embodiments, the expected access volume is the number of containers in the case where the target system normally operates without load pressure and waste of resources. For the first scaling-up strategy or the first scaling-down strategy, the calculation method of the number of replicas for scaling up or down, i.e., the first target value or the second target value, is: expected number of replicas for scaling up or down = ceil[current number of containers*(predicted access volume / expected access volume)], and ceil represents rounding up. Within the globally configurable tolerance range, it can be set to 0.1, i.e., the result of predicted access volume / expected access volume is considered to be within an acceptable range if it is in the interval [0.9, 1.1], and no scaling-up or scaling-down operation is performed. After the number of replicas is output, the output number of replicas in the next cycle is determined.

[0049] The embodiment calculates the number of replicas of the scaled-up and scaled-down containers based on the access volume prediction, so that the cloud-native application can more accurately match the business demand and system resources, and realize automatic and efficient service scaling.

[0050] If it is determined that no expansion or contraction is needed through the comparison result of the predicted access amount and the preset access amount threshold, further judgment is performed based on the comparison result of the current access amount and the preset access amount threshold. Optionally, in the container management method provided in the embodiments of the present application, after it is determined whether the predicted access amount is less than the second access amount threshold, the container adjustment strategy of the target system is determined based on the comparison result of the current access amount and the preset access amount threshold, including: in the case that the predicted access amount is greater than or equal to the second access amount threshold and the predicted access amount is less than or equal to the first access amount threshold, it is determined whether the current access amount is greater than a third access amount threshold, wherein the third access amount threshold is greater than the second access amount threshold and less than the first access amount threshold; in the case that the current access amount is greater than the third access amount threshold, a third copy number of expanded containers is calculated based on the current access amount, and a second expansion strategy is determined as the container adjustment strategy, wherein the second expansion strategy is to expand the target system by the third copy number of containers; in the case that the current access amount is less than or equal to the third access amount threshold, a fourth copy number of contracted containers is calculated based on the current access amount, and a second contraction strategy is determined as the container adjustment strategy, wherein the second contraction strategy is to contract the target system by the fourth copy number of containers.

[0051] In some embodiments, the predicted access amount is greater than or equal to the second access amount threshold, and the predicted access amount is less than or equal to the first access amount threshold: it indicates that the predicted access amount is in a medium-high load interval, but has not reached the highest load. At this time, the decision basis is switched from the predicted value to the current access amount. The third access amount threshold is located between the second access amount threshold and the first access amount threshold. It represents the boundary from preparing to expand to actually performing expansion. The current access amount is greater than the third access amount threshold: the system considers that the current load is high, and needs to be expanded immediately to cope with it. The third copy number is calculated based on the current access amount, and the second expansion strategy is executed. The current access amount is less than or equal to the third access amount threshold: the system considers that the current load is relatively low, and should consider contraction to improve resource utilization efficiency. The fourth copy number is calculated based on the current access amount, and the second contraction strategy is executed.

[0052] By implementing the container adjustment strategy based on multiple access amount thresholds, the cloud-native application can more flexibly and efficiently manage resources to achieve the best match between business requirements and system performance.

[0053] The number of replicas for scaling out or scaling in can be calculated based on the expected access amount and the current access amount. Optionally, in the container management method provided in the embodiments of the present application, calculating the third number of replicas of the scaled-out container based on the current access amount comprises: determining the expected access amount and the current number of containers of the target system; calculating the ratio of the current access amount to the expected access amount, and calculating the product of the current number of containers and the ratio to obtain a third target value, and rounding up the third target value to obtain the third number of replicas; calculating the fourth number of replicas of the scaled-in container based on the current access amount comprises: calculating the ratio of the current access amount to the expected access amount, and calculating the product of the current number of containers and the ratio to obtain a fourth target value, and rounding up the fourth target value to obtain the fourth number of replicas.

[0054] In some embodiments, for the second scaling-out strategy or the second scaling-in strategy, the calculation method of the number of replicas for scaling out or scaling in, i.e., the third target value or the fourth target value, is: expected number of replicas for scaling out or scaling in = ceil[current number of containers*(current access amount / expected access amount)], and ceil represents rounding up.

[0055] Through the above strategy of calculating the number of replicas for scaling out or scaling in of the container based on the current access amount, the cloud-native application can respond to the change of the access amount in real time, optimize resource allocation, and at the same time maintain the stability and efficiency of the service.

[0056] The target model deployed by the target system for predicting the access amount is periodically iteratively updated. Optionally, in the container management method provided in the embodiments of the present application, before the access amount set is input into the target model, the method further comprises: determining whether the current time reaches a preset model training time; in the case where the current time reaches the preset model training time, obtaining historical access data of the target system in a target period; determining a plurality of historical periods from the historical access data, extracting a historical access amount set of each historical period and a historical access amount of a next time period adjacent to the historical period; determining the historical access amount set of each historical period and the historical access amount of the next time period adjacent to the historical period as a set of training samples to obtain a plurality of sets of training samples; training a neural network model based on the plurality of sets of training samples to obtain the target model; and in the case where the current time does not reach the preset model training time, performing the step of inputting the access amount set into the target model.

[0057] In some embodiments, the neural network model can be an LSTM model, and the LSTM model is obtained by stacking the neural network structure of the base model, Figure 3 is a schematic diagram of the neural network model according to the embodiments of the present application, as Figure 3As shown, input data xt enters the model at each time step t, is processed by the first LSTM layer, generating a new hidden state, which is passed to the second LSTM layer, and so on, until the last LSTM layer. The output from the three LSTM layers is then processed by a fully connected layer, and the final prediction yt is obtained at the output layer. This process repeats at each time step t until all input data is processed and the corresponding output is generated.

[0058] First, check if the current time matches the preset model training time. The preset time is selected based on the periodic characteristics of the business and the access volume change pattern to ensure that the model can be updated and adapted to new data trends in a timely manner. When the current time matches the model training time, the system begins to extract historical access data within the target period (such as the last week, month) from the target system or its monitoring components. From the historical access data, determine multiple historical periods, each of which can be any selected time period, such as each hour within a day, or each day within a week. Extract the historical access volume set of each historical period and the historical access volume of the next period adjacent to the historical period as part of the training sample. Combine the historical access volume set of each historical period and its immediately following next period historical access volume into a set of training samples. For example, the access volume at 10 am on Monday as input, and the access volume at 11 am as output label. In this way, multiple sets of training samples can be constructed for model training.

[0059] Based on the constructed multiple sets of training samples, use a deep learning framework to train a neural network model, such as a stacked LSTM model. The training process may include hyperparameter tuning, application of regularization techniques, etc. to improve the accuracy of the prediction. After training is complete, save the new version of the target model, which replaces the old model or is marked as a more advanced version. This model will become the main tool for access volume prediction in the future period. In the case of not reaching the model training time, the system continues to use the current latest target model for real-time prediction. This ensures that even during the model training gap, the system can make reasonable access volume predictions based on the existing model to guide resource adjustments.

[0060] This embodiment, through the combination of model timing training and real-time prediction cycle process, enables cloud-native applications to achieve automation and continuous optimization of access volume prediction, thereby better responding to access volume fluctuations and maintaining stable operation and optimal performance of the system. By introducing the stacked LSTM model, which is good at handling long time series problems in the field of deep learning, it can more accurately predict future access volumes. This model structure enhances the ability to understand complex time series data and improves prediction accuracy, providing reliable data support for subsequent resource management.

[0061] When the container adjustment strategy is executed, the upper limit of the number of containers of the target system needs to be avoided. Optionally, in the container management method provided in the embodiments of the present application, before the number of containers of the target system is adjusted based on the container adjustment strategy, the method further comprises: in the case that the container adjustment strategy is to expand the first target number of containers, determining the total number of replicas after expansion of the target system, and judging whether the total number of replicas is greater than the maximum number of containers; in the case that the total number of replicas is greater than the maximum number of containers, adjusting the first target number in the container adjustment strategy until the total number of replicas is less than the maximum number of containers; in the case that the total number of replicas is less than or equal to the maximum number of containers, executing the step of adjusting the number of containers of the target system based on the container adjustment strategy.

[0062] In some embodiments, when the intelligent analysis component suggests expanding the first target number of containers according to the predicted access volume, the total number of replicas after expansion is first calculated. The total number of replicas = the current number of containers + the first target number. If the total number of replicas is greater than the maximum number of containers, directly executing the expansion strategy will cause resource overload and unstable system operation. In order to comply with resource restrictions, the first target number needs to be adjusted to ensure that the total number of replicas does not exceed the maximum number of containers. If the initially calculated total number of replicas exceeds the maximum number of containers, the system needs to recalculate the first target number. The principle of adjustment can be to gradually reduce the first target number until the total number of replicas meets the resource restrictions.

[0063] If the total number of replicas is less than or equal to the maximum number of containers: At this time, the adjustment strategy has been confirmed to comply with the resource restrictions. The step of adjusting the number of containers of the target system based on the adjusted container adjustment strategy can be safely executed, that is, the actual expansion of the containers is performed. The container number adjustment process should ensure the continuity of the service and the user experience, for example, a rolling update strategy can be used to avoid stopping all services at once to add containers.

[0064] The embodiments of the present application can effectively comply with resource restrictions when the cloud-native application performs container expansion, avoid system instability caused by resource overload, ensure that the service is always in the best state, and maximize resource utilization efficiency.

[0065] When performing the container adjustment strategy, it is necessary to avoid scaling down to the lower limit of the number of containers of the target system. Optionally, in the container management method provided in the embodiments of the present application, before adjusting the number of containers of the target system based on the container adjustment strategy, the method further comprises: in the case that the container adjustment strategy is to scale down the second target number of containers, determining the total number of replicas after scaling down of the target system, and judging whether the total number of replicas is less than the minimum number of containers; in the case that the total number of replicas is less than the minimum number of containers, adjusting the second target number in the container adjustment strategy until the total number of replicas is greater than or equal to the minimum number of containers; in the case that the total number of replicas is greater than or equal to the minimum number of containers, performing the step of adjusting the number of containers of the target system based on the container adjustment strategy.

[0066] In some embodiments, when the intelligent analysis component suggests scaling down the second target number of containers, the total number of replicas after scaling down is first calculated. The calculation formula is: total number of replicas = current number of containers-second target number. If the total number of replicas is less than the minimum number of containers, it indicates that the scaling down operation may cause the system to be unable to effectively handle the expected access volume, and the scaling down strategy needs to be adjusted. If the preliminary scaling down operation makes the total number of replicas lower than the minimum number of containers, the system needs to recalculate the second target number. The principle of adjustment is to gradually increase the second target number until the total number of replicas after scaling down is not lower than the minimum number of containers. This can be achieved through an incremental loop, gradually increasing the second target number (for example, increasing by one unit each time), recalculating the total number of replicas, until the total number of replicas is greater than or equal to the minimum number of containers. If the total number of replicas is greater than or equal to the minimum number of containers, at this time, the adjustment strategy meets the minimum resource requirement. The step of adjusting the number of containers of the target system based on the adjusted container adjustment strategy can be performed, that is, the scaling down is implemented.

[0067] When performing the scaling down operation, ensuring the continuity of the service and the user experience is the primary consideration. Scaling down can adopt a rolling update strategy and be performed container by container to avoid service interruption. Before scaling down, load balancing adjustment can be performed first to direct requests to more containers to ensure that the remaining containers can carry sufficient access volume and avoid resource shortage or service degradation after scaling down.

[0068] The embodiments of the present application can effectively comply with the resource lower limit when the cloud native application performs container scaling down, ensuring that the minimum running requirement of the system is met, and realizing the reasonable optimization of resources.

[0069] According to another embodiment of the present application, a cloud native service governance architecture is also provided, Figure 4 is a schematic diagram of the cloud native service governance architecture provided by the embodiments of the present application, like Figure 4As shown, the open source monitoring system Prometheus is mainly responsible for continuously collecting and storing various indicators in the system. It collects the indicator data exposed through the HTTP interface in the target system by periodic polling, extracts specific indicators, i.e., access data, from Prometheus using the built-in query language PromQL, and sends these data to the data preprocessing module.

[0070] The data in the data preprocessing module is subjected to reading, missing value processing, format standardization and data normalization operations. The preprocessed data is judged whether it meets the set timing training period. If the condition is met, the data is transmitted to the model training and evaluation module. In the model training and evaluation module, the historical data is trained using a stacked LSTM model, and model evaluation and parameter tuning are performed. The saved model is compared with the model algorithm parameters and results of each training shown by the developer to decide whether to pass the evaluation. If the model evaluation fails, return to the model training and evaluation module for retraining; if it passes, perform model registration in the model repository and manage the model, generate a new version and label different development stages. The model file is handed over to the model inference service management for real-time inference. When the data received from the data preprocessing module does not meet the timing training period, the processed data will be subjected to real-time inference by the model inference service, and the inference results will be stored in Prometheus. The container management cluster extracts the predicted indicator values and current indicator values from Prometheus for calculation to determine the number of container replicas that need to be adjusted, and the corresponding scaling mechanism modifies the application replica number by different response mechanisms. Finally, the resource scheduler adjusts the number of containers in the container management cluster according to the decision of the elastic scaling component, thereby completing the entire elastic scaling process.

[0071] The embodiment realizes the full-process automation from data collection to model training to scaling, including data collection by Prometheus, data preparation by the preprocessing module, LSTM model training and evaluation, and dynamic adjustment of the number of container replicas in the container management cluster. It guarantees the real-time response capability of the system, realizes self-optimization based on the latest data, reduces the need for manual intervention, and improves the operation and maintenance efficiency.

[0072] 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 herein can be executed in an order different from that shown.

[0073] The container management apparatus provided in the embodiments of the present application can be used to implement the container management method provided in the embodiments of the present application. The container management apparatus provided in the embodiments of the present application is described below.

[0074] Figure 5 is a schematic diagram of the container management apparatus provided in the embodiments of the present application. As shown in the figure, Figure 5 the apparatus comprises:

[0075] The collection unit 501 is configured to collect, every preset period, the access amount of the target system in each time period within the preset period, to obtain an access amount set, wherein the preset period comprises a plurality of time periods.

[0076] The input unit 502 is configured to input the access amount set into a target model, to obtain a predicted access amount of a next time period adjacent to the preset period, wherein the target model is trained by a plurality of training samples, and each training sample comprises a historical access amount set in a historical period and a historical access amount of a next time period adjacent to the historical period.

[0077] The first determination unit 503 is configured to determine the access amount of the current time period of the target system, to obtain a current access amount, and determine a container adjustment strategy of the target system based on a comparison result of the current access amount and a preset access amount threshold and a comparison result of the predicted access amount and the preset access amount threshold.

[0078] The adjustment unit 504 is configured to adjust the number of containers of the target system based on the container adjustment strategy.

[0079] The container management apparatus provided in the embodiments of the present application collects, every preset period, the access amount of the target system in each time period within the preset period, to obtain an access amount set, wherein the preset period comprises a plurality of time periods. The input unit 502 inputs the access amount set into a target model, to obtain a predicted access amount of a next time period adjacent to the preset period, wherein the target model is trained by a plurality of training samples, and each training sample comprises a historical access amount set in a historical period and a historical access amount of a next time period adjacent to the historical period. The first determination unit 503 determines the access amount of the current time period of the target system, to obtain a current access amount, and determines a container adjustment strategy of the target system based on a comparison result of the current access amount and a preset access amount threshold and a comparison result of the predicted access amount and the preset access amount threshold. The adjustment unit 504 adjusts the number of containers of the target system based on the container adjustment strategy, thereby solving the problem of low container management efficiency in the related art. By introducing an intelligent prediction mechanism based on a target model and combining a dynamic container adjustment strategy, the intelligent level of resource utilization is improved, and the real-time response capability and self-optimization capability of the system are enhanced, thereby achieving the effect of improving the container management efficiency.

[0080] Optionally, in the container management apparatus provided by the embodiments of the present application, the first determining unit 503 comprises: a first judging module, configured to judge whether the predicted access amount is greater than a first access amount threshold; a first calculating module, configured to, in the case that the predicted access amount is greater than the first access amount threshold, calculate a first copy number of the expanded container based on the predicted access amount, and determine the first expansion strategy as the container adjustment strategy, wherein the first expansion strategy is to expand the target system by the container of the first copy number; a second judging module, configured to, in the case that the predicted access amount is less than or equal to the first access amount threshold, judge whether the predicted access amount is less than a second access amount threshold, wherein the second access amount threshold is less than the first access amount threshold; and a second calculating module, configured to, in the case that the predicted access amount is less than the second access amount threshold, calculate a second copy number of the shrunk container based on the predicted access amount, and determine the first shrinking strategy as the container adjustment strategy, wherein the first shrinking strategy is to shrink the target system by the container of the second copy number.

[0081] Optionally, in the container management apparatus provided by the embodiments of the present application, the first calculating module comprises: a first determining submodule, configured to determine the expected access amount and the current container number of the target system; and a first calculating submodule, configured to calculate a ratio of the predicted access amount to the expected access amount, and calculate a product of the current container number and the ratio to obtain a first target value, and obtain the first copy number by rounding up the first target value; and the second calculating module comprises: a second calculating submodule, configured to calculate a ratio of the predicted access amount to the expected access amount, and calculate a product of the current container number and the ratio to obtain a second target value, and obtain the second copy number by rounding up the second target value.

[0082] Optionally, in the container management apparatus provided by the embodiments of the present application, the first determining unit 503 comprises: a third judging module, configured to, in the case that the predicted access amount is greater than or equal to the second access amount threshold and the predicted access amount is less than or equal to the first access amount threshold, judge whether the current access amount is greater than a third access amount threshold, wherein the third access amount threshold is greater than the second access amount threshold and less than the first access amount threshold; a third calculating module, configured to, in the case that the current access amount is greater than the third access amount threshold, calculate a third copy number of the expanded container based on the current access amount, and determine the second expansion strategy as the container adjustment strategy, wherein the second expansion strategy is to expand the target system by the container of the third copy number; and a fourth calculating module, configured to, in the case that the current access amount is less than or equal to the third access amount threshold, calculate a fourth copy number of the shrunk container based on the current access amount, and determine the second shrinking strategy as the container adjustment strategy, wherein the second shrinking strategy is to shrink the target system by the container of the fourth copy number.

[0083] Optionally, in the container management apparatus provided by the embodiment of the present application, the third calculation module comprises: a second determination submodule, configured to determine the expected access amount and the current container quantity of the target system; and a third calculation submodule, configured to calculate a ratio of the current access amount to the expected access amount, and calculate a product of the current container quantity and the ratio to obtain a third target value, and obtain a third copy quantity by rounding up the third target value.

[0084] Optionally, in the container management apparatus provided by the embodiment of the present application, the apparatus further comprises: a judgment unit, configured to judge whether the current time reaches a preset model training time; an acquisition unit, configured to acquire historical access data of the target system in a target period in a case where the current time reaches the preset model training time; an extraction unit, configured to determine a plurality of historical periods from the historical access data, and extract a historical access amount set of each historical period and a historical access amount of a next period adjacent to the historical period; a second determination unit, configured to determine the historical access amount set of each historical period and the historical access amount of the next period adjacent to the historical period as a group of training samples to obtain a plurality of groups of training samples; a training unit, configured to train the neural network model based on the plurality of groups of training samples to obtain a target model; and a first execution unit, configured to execute the step of inputting the access amount set into the target model in a case where the current time does not reach the preset model training time.

[0085] Optionally, in the container management apparatus provided by the embodiment of the present application, the apparatus further comprises: a third determination unit, configured to determine a total copy quantity of the target system after expansion in a case where the container adjustment strategy is to expand the first target quantity of containers, and judge whether the total copy quantity is greater than the maximum container quantity; a first container adjustment unit, configured to adjust the first target quantity in the container adjustment strategy in a case where the total copy quantity is greater than the maximum container quantity, until the total copy quantity is less than the maximum container quantity; and a second execution unit, configured to execute the step of adjusting the container quantity of the target system based on the container adjustment strategy in a case where the total copy quantity is less than or equal to the maximum container quantity.

[0086] Optionally, in the container management apparatus provided by the embodiment of the present application, the apparatus further comprises: a fourth determination unit, configured to, in the case that the container adjustment strategy is to reduce the second target number of containers, determine a total number of replicas after the target system is reduced, and judge whether the total number of replicas is less than the minimum number of containers; a second container adjustment unit, configured to, in the case that the total number of replicas is less than the minimum number of containers, adjust the second target number in the container adjustment strategy until the total number of replicas is greater than or equal to the minimum number of containers; and a third execution unit, configured to, in the case that the total number of replicas is greater than or equal to the minimum number of containers, execute the step of adjusting the number of containers of the target system based on the container adjustment strategy.

[0087] The container management apparatus comprises a processor and a memory, and the above acquisition unit 501, input unit 502, first determination unit 503 and adjustment unit 504 are all stored in the memory as program units, and the corresponding functions are realized by the processor executing the above program units stored in the memory.

[0088] The processor comprises a core, and the core retrieves the corresponding program units from the memory. The core can be one or more, and the container management efficiency can be improved by adjusting the core parameters.

[0089] The memory can comprise a 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 memory (flash RAM), and the memory comprises at least one memory chip.

[0090] The embodiment of the present application provides a computer readable storage medium, which stores a program, and the program is executed by a processor to realize the container management method.

[0091] The embodiment of the present application provides a processor, which is used for running a program, and the program is executed to realize the container management method.

[0092] Figure 6 FIG. 1 is a schematic diagram of an electronic device according to the embodiment of the present application. As shown in FIG. 1, the electronic device comprises a processor 100 and a memory 200. Figure 6As shown, the electronic device 601 comprises a processor, a memory, and a program stored on the memory and executable on the processor, and the processor implements the following steps when executing the program: collecting access amounts of the target system in each time period in a preset period every preset period to obtain an access amount set, wherein the preset period contains multiple time periods; inputting the access amount set into a target model to obtain a predicted access amount of a next time period adjacent to the preset period, wherein the target model is trained by multiple sets of training samples, and each set of training samples comprises a historical access amount set in a historical period and a historical access amount of a next time period adjacent to the historical period; determining an access amount of a current time period of the target system to obtain a current access amount, determining a container adjustment strategy of the target system based on a comparison result of the current access amount and a preset access amount threshold and a comparison result of the predicted access amount and the preset access amount threshold; and adjusting the number of containers of the target system based on the container adjustment strategy. The device in the present application can be a server, a PC, a PAD, a mobile phone, etc.

[0093] The present application also provides a computer program product adapted to execute a program that initializes the following method steps when executed on a data processing device: collecting access amounts of the target system in each time period in a preset period every preset period to obtain an access amount set, wherein the preset period contains multiple time periods; inputting the access amount set into a target model to obtain a predicted access amount of a next time period adjacent to the preset period, wherein the target model is trained by multiple sets of training samples, and each set of training samples comprises a historical access amount set in a historical period and a historical access amount of a next time period adjacent to the historical period; determining an access amount of a current time period of the target system to obtain a current access amount, determining a container adjustment strategy of the target system based on a comparison result of the current access amount and a preset access amount threshold and a comparison result of the predicted access amount and the preset access amount threshold; and adjusting the number of containers of the target system based on the container adjustment strategy.

[0094] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage, etc.) containing computer-usable program code.

[0095] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flow or blocks Figure 1 means for functionally implementing the steps listed in the flowchart block or blocks.

[0096] These computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture including instructions which implement the function specified in the flowchart block or blocks. Figure 1 one or more flow or blocks Figure 1 means for functionally implementing the steps listed in the flowchart block or blocks.

[0097] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flow or blocks Figure 1 means for functionally implementing the steps listed in the flowchart block or blocks.

[0098] In one typical configuration, the computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.

[0099] The memory can include non-persistent memory and / or persistent memory, such as flash memory, read-only memory (ROM), and / or volatile or non-volatile random access memory (RAM), among others. The memory is an example of computer readable media.

[0100] Computer-readable media includes permanent and non-permanent, movable and non-movable media that can be implemented by any method or technology to store information. The 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 technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic tape disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible to a computing device. According to the definition herein, computer-readable media does not include transitory media such as modulated data signals and carriers.

[0101] It should also be noted that the terms "comprising", "containing", or any other variant thereof are intended to cover non-exclusive inclusions, such that a process, method, article or apparatus that comprises a list of elements does not only include those elements, but can also include other elements not expressly listed or inherent to such process, method, article or apparatus. Without more limitations, the element defined by the phrase "comprising a" does not exclude the presence of additional identical elements in the process, method, article or apparatus that includes the element.

[0102] Those skilled in the art will appreciate that embodiments of the present application can be provided as a method, system or computer program product. Accordingly, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage devices, etc.) containing computer usable program code.

[0103] The above merely provides embodiments of the present application and is not intended to limit the present application. Various modifications and changes can be made to the present application by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application shall be included in the scope of the claims of the present application.

Claims

1. A container management method, characterized in that, include: Every preset period, the access volume of the target system is collected for each time period within the preset period to obtain an access volume set, wherein the preset period includes multiple time periods; The access volume set is input into the target model to obtain the predicted access volume of the next time period adjacent to the preset period. The target model is trained by multiple sets of training samples. Each set of training samples includes the historical access volume set within a historical period and the historical access volume of the next time period adjacent to the historical period. Determine the current access volume of the target system in the current time period to obtain the current access volume. Based on the comparison result of the current access volume with a preset access volume threshold and the comparison result of the predicted access volume with the preset access volume threshold, determine the container adjustment strategy of the target system. The number of containers in the target system is adjusted based on the container adjustment strategy.

2. The method according to claim 1, characterized in that, The container adjustment strategy for the target system is determined based on the comparison between the predicted access volume and the preset access volume threshold, including: Determine whether the predicted access volume is greater than the first access volume threshold; If the predicted access volume is greater than the first access volume threshold, the first number of replicas of the expanded container is calculated based on the predicted access volume, and the first expansion strategy is determined as the container adjustment strategy, wherein the first expansion strategy is to expand the target system to include the first number of replicas of the container. If the predicted access volume is less than or equal to the first access volume threshold, it is determined whether the predicted access volume is less than the second access volume threshold, wherein the second access volume threshold is less than the first access volume threshold. If the predicted access volume is less than the second access volume threshold, the second number of replicas of the container is calculated based on the predicted access volume, and the first scaling-down strategy is determined as the container adjustment strategy, wherein the first scaling-down strategy is to scale down the target system to the second number of replicas of the container.

3. The method according to claim 2, characterized in that, Calculating the number of first replicas of the expanded container based on the predicted access volume includes: Determine the expected access volume and current number of containers for the target system; Calculate the ratio of the predicted access volume to the expected access volume, and calculate the product of the current container number and the ratio to obtain a first target value. Round the first target value up to the integer to obtain the first number of replicas. Calculating the number of second replicas of the shrinking container based on the predicted access volume includes: Calculate the ratio of the predicted access volume to the expected access volume, and calculate the product of the current container number and the ratio to obtain the second target value. Round the second target value up to the integer to obtain the second replica number.

4. The method according to claim 2, characterized in that, After determining whether the predicted access volume is less than the second access volume threshold, the container adjustment strategy for the target system is determined based on the comparison result between the current access volume and the preset access volume threshold, including: If the predicted access volume is greater than or equal to the second access volume threshold and the predicted access volume is less than or equal to the first access volume threshold, it is determined whether the current access volume is greater than the third access volume threshold, wherein the third access volume threshold is greater than the second access volume threshold and less than the first access volume threshold. If the current access volume is greater than the third access volume threshold, the third number of replicas of the expanded container is calculated based on the current access volume, and the second expansion strategy is determined as the container adjustment strategy, wherein the second expansion strategy is to expand the target system by the third number of replicas of the container. If the current access volume is less than or equal to the third access volume threshold, the fourth number of replicas of the container is calculated based on the current access volume, and the second scaling-down strategy is determined as the container adjustment strategy, wherein the second scaling-down strategy is to scale down the fourth number of replicas of the container in the target system.

5. The method according to claim 4, characterized in that, The calculation of the number of third replicas of the expanded container based on the current access volume includes: Determine the expected access volume and current number of containers for the target system; Calculate the ratio of the current number of visits to the expected number of visits, and calculate the product of the current number of containers and the ratio to obtain the third target value. Round the third target value up to the integer to obtain the third number of replicas. The calculation of the fourth replica number of the shrinking container based on the current access volume includes: Calculate the ratio of the current number of visits to the expected number of visits, and calculate the product of the current number of containers and the ratio to obtain the fourth target value. Round the fourth target value up to the integer to obtain the fourth number of replicas.

6. The method according to any one of claims 1-5, characterized in that, Before inputting the access volume set into the target model, the method further includes: Determine whether the current time has reached the preset model training time; If the current time reaches the preset model training time, obtain the historical access data of the target system within the target period; Multiple historical periods are determined from the historical access data, and the historical access volume set of each historical period and the historical access volume of the next time period adjacent to the historical period are extracted. The historical access volume set of each historical period and the historical access volume of the next time period adjacent to the historical period are determined as a set of training samples, and multiple sets of training samples are obtained. The target model is obtained by training a neural network model based on the multiple sets of training samples. If the current time has not reached the preset model training time, the step of inputting the access volume set into the target model is performed.

7. The method according to any one of claims 1-5, characterized in that, Before adjusting the number of containers in the target system based on the container adjustment strategy, the method further includes: When the container adjustment strategy is to expand the number of containers to a first target number, determine the total number of replicas of the target system after expansion, and determine whether the total number of replicas is greater than the maximum number of containers; If the total number of replicas is greater than the maximum number of containers, adjust the first target number in the container adjustment strategy until the total number of replicas is less than the maximum number of containers. If the total number of replicas is less than or equal to the maximum number of containers, the step of adjusting the number of containers in the target system based on the container adjustment strategy is performed.

8. The method according to any one of claims 1-5, characterized in that, Before adjusting the number of containers in the target system based on the container adjustment strategy, the method further includes: When the container adjustment strategy is to reduce the number of containers to a second target number, determine the total number of replicas of the target system after reduction, and determine whether the total number of replicas is less than the minimum number of containers; If the total number of replicas is less than the minimum number of containers, adjust the second target number in the container adjustment strategy until the total number of replicas is greater than or equal to the minimum number of containers. If the total number of replicas is greater than or equal to the minimum number of containers, the step of adjusting the number of containers in the target system based on the container adjustment strategy is performed.

9. A container management device, characterized in that, include: The acquisition unit is used to acquire the access volume of the target system in each time period within the preset period every preset period to obtain an access volume set, wherein the preset period includes multiple time periods. The input unit is used to input the access volume set into the target model to obtain the predicted access volume of the next time period adjacent to the preset period. The target model is trained by multiple sets of training samples. Each set of training samples includes a set of historical access volumes within a historical period and the historical access volume of the next time period adjacent to the historical period. The first determining unit is used to determine the access volume of the target system in the current time period, obtain the current access volume, and determine the container adjustment strategy of the target system based on the comparison result of the current access volume and the preset access volume threshold, and the comparison result of the predicted access volume and the preset access volume threshold. An adjustment unit is used to adjust the number of containers in the target system based on the container adjustment strategy.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the container management method according to any one of claims 1 to 8.