Self-adaptive container expansion method, system, equipment and medium

Through the adaptive container expansion method, data acquisition, multimodal data fusion and deep reinforcement learning are used to solve the problems of low container expansion reaction speed and insufficient resource utilization in the existing technology, and more efficient resource management and containerization are achieved Improved application performance.

CN119179552AInactive Publication Date: 2024-12-24STATE GRID ZHEJIANG ELECTRIC POWER CO LTD QUZHOU POWER SUPPLY CO +2
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411679125.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-22
Publication Date
2024-12-24
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing container scaling methods have low response speed and accuracy when dealing with unpredictable workload peaks, making it difficult to ensure real-time data processing, and are difficult to adapt to diverse application needs, resulting in over-configuration or inadequate utilization of resources and difficult to handle multiple applications. Dimensional resource balance.

Method used

Adaptive container expansion method is adopted to predict resource usage and in-depth reinforcement learning decisions through data acquisition, multimodal data fusion, and layered timing attention network models to realize intelligent and automated resource allocation and dynamically adjust resource allocation strategies.

Benefits of technology

It improves the performance, reliability and resource utilization of containerized applications, can comprehensively consider a variety of factors, adapt to diversified application needs, achieve better resource allocation decisions, and improve resource management capabilities in complex and dynamic environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119179552A_ABST
    Figure CN119179552A_ABST
Patent Text Reader

Abstract

The invention discloses a self-adaptive container expansion method, system and device and a medium, and solves the problems that in the prior art, container expansion is low in reliability, does not adapt to diversified application requirements, is low in resource utilization rate and is difficult to process multi-dimensional resource constraints. Comprising the steps of continuously performing data acquisition and preprocessing on data related to a container and an application from a plurality of sources; performing data fusion to obtain a multi-modal data fusion result; predicting a future resource use condition by adopting a hierarchical time sequence attention network model, and generating a prediction result; selecting an optimal extension action based on the prediction result; and applying the extension action to an actual environment, and collecting a feedback calculation reward. According to the method, various factors can be comprehensively considered, diversified application requirements are met, intelligence and automation are achieved, and the performance, reliability and resource utilization rate of containerized application are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of container expansion, and specifically provides an adaptive container expansion method, system, device and medium. Background Art

[0002] Container technology has become an important tool for modern application development, deployment, and management, especially in cloud environments. Compared with traditional virtual machines, containers provide a lighter and more efficient solution that enables more sophisticated resource management and faster startup time. Containerized applications can run consistently in any environment that supports the container runtime, greatly improving the portability and deployment flexibility of applications. However, as applications scale and become more complex, higher requirements are placed on the effective management and intelligent expansion of container systems.

[0003] In a multi-container deployment and dynamically changing workload environment, elastic expansion has become a key capability. Existing expansion methods are mainly rule-based expansion and threshold-based automatic expansion. These methods perform well in some scenarios, but because they rely on historical data and predefined rules, they are difficult to handle unpredictable workload peaks, and their response speed and accuracy are low, making it difficult to ensure real-time data processing and reliability low; a simple single expansion strategy is difficult to adapt to diverse application requirements, which may lead to over-configuration or under-utilization of resources; in addition, container expansion involves not only CPU and memory, but also resource limitations in multiple dimensions such as network bandwidth and storage I / O. Existing methods are often unable to handle multi-dimensional resource balancing. Summary of the invention

[0004] In order to solve the problems in the prior art of low reliability of container expansion, inability to adapt to diverse application requirements, low resource utilization and difficulty in handling multi-dimensional resource constraints, the present invention provides an adaptive container expansion method, system, device and medium, which can comprehensively consider multiple factors, adapt to diverse application requirements, realize intelligence and automation, and improve the performance, reliability and resource utilization of containerized applications.

[0005] The specific scheme of the present invention is as follows.

[0006] In a first aspect, the present invention provides an adaptive container expansion method, comprising: S1. Data collection and preprocessing: Continuously collect and preprocess container and application-related data from multiple sources; S2, multimodal data fusion: perform data fusion on the collected data to obtain multimodal data fusion results; S3. Resource usage prediction: Based on the multimodal data fusion result, a hierarchical temporal attention network model is used to predict future resource usage and generate a prediction result; S4, deep reinforcement learning decision: selecting the optimal expansion action based on the prediction result; S5, execution and feedback: Apply the extended action to the actual environment and collect feedback to calculate rewards.

[0007] The present invention realizes the comprehensive collection, effective preprocessing and deep fusion of multimodal data, fully utilizes the complementarity of data from different sources, and improves the understanding and prediction capabilities of complex scenarios; it uses a hierarchical temporal attention network model to predict future resource usage, providing more accurate and comprehensive resource usage predictions, thereby dynamically adjusting resource allocation strategies and achieving better resource allocation decisions in complex and dynamic environments. The present invention can comprehensively consider multiple factors, adapt to diverse application requirements, achieve intelligence and automation, and improve the performance, reliability and resource utilization of containerized applications.

[0008] Furthermore, the container and application related data described in step S1 include container-level indicators and application-level indicators as well as host-level indicators and container performance parameters. The data collection adopts a distributed data collection architecture, and the data preprocessing includes real-time cleaning and standardization of the collected time series data and outlier processing.

[0009] The system uses a lightweight data collection agent deployed on each container and host, and transmits data to the central processing unit in real time through a message queue. It cleans and standardizes the raw data in real time, handles missing values ​​and outliers, and performs necessary time series alignment.

[0010] Furthermore, the data fusion of the collected data described in step S2 includes: applying a feature extraction function to each data modality to extract features, then using an attention mechanism to calculate attention weights, and weightedly fusing features of different modalities, and then constructing a graph structure based on the relationship between containers and application components, and applying a graph convolutional network to obtain the final multimodal data fusion result.

[0011] When applying the feature extraction function to each data modality for feature extraction, the long short-term memory network is used for time series data, and the multi-layer perceptron is used for feature extraction for structured data. The attention mechanism assigns importance weights to different modalities, and uses the activation function to introduce nonlinearity to enhance the expressiveness of the model. In the graph structure, nodes represent containers or application components, edges represent the dependencies between them, node features include the resource usage of containers and the performance indicators of applications, and the weights of edges represent the communication frequency between components. The fused features are used as the initial features of the graph nodes, and the graph convolutional network is applied for information propagation and updating to obtain the final multimodal data fusion results. A two-layer graph convolutional network is used to capture the high-order interaction between nodes. The final multimodal data fusion results include the node's own features and neighbor node information.

[0012] Through steps S1 and S2, comprehensive collection, effective preprocessing and deep fusion of multimodal data are achieved. The multimodal data fusion results contain important information of each modality and take into account the topological relationship between containers and application components, providing high-quality, high-dimensional input data for subsequent resource usage prediction and intelligent expansion decisions. This fusion method makes full use of the complementarity of data from different sources and improves the understanding and prediction capabilities of complex scenarios.

[0013] Furthermore, the hierarchical temporal attention network model described in step S3 includes an LSTM layer, a multi-head attention layer and an output layer, and simultaneously predicts multiple key resource indicators; the LSTM layer captures the long-term dependencies of the time series, the multi-head attention layer processes information of different time scales, and the output layer generates the final prediction result.

[0014] Furthermore, the training and prediction process of the hierarchical temporal attention network model described in step S3 is as follows: S31: dividing the multimodal data fusion result into training sequences in chronological order; S32: Randomly initialize all learnable parameters of the hierarchical temporal attention network model; S33: For each time step, the prediction result is obtained by sequentially passing through the LSTM layer, the multi-head attention layer and the output layer; S34: Calculate the mean square error between the predicted result and the true value as the loss function; S35: Calculate the gradient using the back propagation algorithm, and use the optimizer to update the parameters of the hierarchical temporal attention network model; S36: Repeat step S35 until the hierarchical temporal attention network model converges or reaches a preset number of training rounds.

[0015] The Hierarchical Temporal Attention Network model continuously receives the latest multimodal data fusion results and generates resource usage forecasts for the next period of time. The forecast results comprehensively consider multimodal data at the container level, application level, and host level, as well as the topological relationship between containers and application components, thereby providing a more accurate and comprehensive resource usage forecast. The system dynamically adjusts the resource allocation strategy based on the forecast results to cope with upcoming load changes, thereby achieving better resource allocation decisions in complex and dynamic environments.

[0016] Furthermore, the step S4 described in selecting the optimal expansion action based on the prediction result using a deep Q network includes: initializing deep Q network parameters and an experience replay buffer, then obtaining the current input state, using an ε-greedy strategy to select and execute an output action, observing new states and rewards and storing experiences in the experience replay buffer, and then randomly sampling a batch of experiences from the experience replay buffer, calculating a target Q value and updating deep Q network parameters and target network parameters; the input state of the deep Q network includes the multimodal data fusion result and the prediction result, and the output action represents a specific adjustment to the container resources.

[0017] Through step S4, the deep Q network can gradually learn the strategy of selecting the optimal expansion action under different states, thereby realizing intelligent resource allocation and container expansion. During the actual deployment process, the system will continue to monitor environmental changes and continuously optimize decision-making strategies based on new observations to adapt to dynamically changing workloads and resource requirements. This adaptive learning mechanism ensures that the system can always maintain efficient resource management capabilities when facing complex and changing environments.

[0018] Furthermore, collecting feedback and calculating rewards in step S5 includes: calculating SLA satisfaction, resource utilization and cost according to the feedback, and substituting them into a reward function to obtain a reward for the extended action.

[0019] Step S5 specifically includes: first, select an action according to the current input state and the deep Q network model, apply the selected action to the target container, and wait for a certain period of time to stabilize, collect various indicators after executing the action, including response time, error rate, usage of various resources, etc., calculate SLA satisfaction, resource utilization and cost according to the collected indicators, substitute these calculation results into the reward function to obtain the reward value of this action, store the state, action, reward and new state in the experience replay buffer, sample from the experience replay buffer regularly, and update the parameters of the deep Q network model.

[0020] The reward function comprehensively considers system performance, resource utilization efficiency and operating costs, aiming to maximize resource utilization and minimize costs while ensuring service quality. The system gradually learns the optimal resource allocation strategy under different states by continuously executing actions, collecting feedback and updating the deep Q network model, so that it can more accurately predict resource requirements and make better expansion decisions, thereby realizing intelligent management of container resources.

[0021] In a second aspect, the present invention further provides an adaptive container expansion system, comprising: Multimodal data collection and preprocessing module, which continuously collects and preprocesses container and application-related data from multiple sources; The multimodal data fusion module performs data fusion on the collected data to obtain the multimodal data fusion result; A resource usage prediction module, based on the multimodal data fusion result, uses a hierarchical temporal attention network model to predict future resource usage and generate a prediction result; A deep reinforcement learning decision module selects the optimal expansion action based on the prediction result; An execution and feedback module applies the extended action to the actual environment and collects feedback to calculate rewards; The system executes the adaptive container expansion method. The system also includes multiple containers, applications and a host.

[0022] In a third aspect, the present invention further provides an electronic device, comprising: one or more processors; Memory; and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the programs implement the adaptive container expansion method when executed by the processors.

[0023] In a fourth aspect, the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the adaptive container expansion method is implemented.

[0024] Therefore, the present invention has the following beneficial effects: The present invention realizes the comprehensive collection, effective preprocessing and deep fusion of multimodal data, fully utilizes the complementarity of data from different sources, and improves the understanding and prediction ability of complex scenarios; adopts a hierarchical temporal attention network model to predict future resource usage, providing a more accurate and comprehensive resource usage prediction, thereby dynamically adjusting the resource allocation strategy and achieving better resource allocation decisions in complex and dynamic environments; the system can more accurately predict resource requirements and make better expansion decisions to adapt to dynamically changing workloads and resource requirements by continuously executing actions, collecting feedback and updating the deep Q network model, thereby realizing intelligent management of container resources. The present invention can comprehensively consider multiple factors, adapt to diverse application requirements, realize intelligence and automation, and improve the performance, reliability and resource utilization of containerized applications. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without creative work.

[0026] Figure 1 The figure is an overall architecture diagram of an adaptive container expansion system of the present invention.

[0027] Figure 2 A schematic diagram of the structure of the present invention using a hierarchical temporal attention network for resource prediction.

[0028] Figure 3 Decision flow chart of the deep reinforcement learning framework of the present invention. DETAILED DESCRIPTION

[0029] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.

[0030] like Figure 1 The figure shows an overall architecture diagram of an adaptive container expansion system of the present invention.

[0031] An embodiment of the present invention provides an adaptive container expansion method, including: S1. Data collection and preprocessing: Continuously collect and preprocess container and application-related data from multiple sources; S2, multimodal data fusion: perform data fusion on the collected data to obtain multimodal data fusion results; S3. Resource usage prediction: Based on the multimodal data fusion results, a hierarchical temporal attention network model is used to predict future resource usage and generate prediction results; S4, deep reinforcement learning decision-making: select the optimal expansion action based on the prediction results; S5, Execution and Feedback: Apply the extended actions to the actual environment and collect feedback to calculate rewards.

[0032] This embodiment also provides an adaptive container expansion system, including: Multimodal data collection and preprocessing module, which continuously collects and preprocesses container and application-related data from multiple sources; The multimodal data fusion module performs data fusion on the collected data to obtain the multimodal data fusion result; The resource usage prediction module uses a hierarchical temporal attention network model to predict future resource usage and generate prediction results based on the multimodal data fusion results; A deep reinforcement learning decision module that selects the optimal expansion action based on the prediction results; The execution and feedback module applies the extended actions to the actual environment and collects feedback to calculate rewards; The system executes the above-mentioned adaptive container expansion method. The system also includes multiple containers, applications and a host.

[0033] This embodiment also provides an electronic device, including: one or more processors; Memory; And one or more programs, the one or more programs are stored in the memory and are configured to be executed by one or more processors, and the programs implement the above-mentioned adaptive container expansion method when executed by the processor.

[0034] This embodiment also provides a computer-readable storage medium, including but not limited to a disk storage, a CD-ROM, an optical storage, etc. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned adaptive container expansion method is implemented.

[0035] Those skilled in the art should understand that the embodiments of the present invention can be provided as methods, systems, devices or computer program products. These computer programs can also be loaded onto computers or other programmable data processing devices, so that a series of operation steps are executed on the computer or other programmable devices to generate computer-implemented processing, and the instructions executed on the computer or other programmable devices are used to implement the above-mentioned adaptive container expansion method.

[0036] This embodiment realizes the comprehensive collection, effective preprocessing and deep fusion of multimodal data, fully utilizes the complementarity of data from different sources, and improves the understanding and prediction capabilities of complex scenarios; it uses a hierarchical temporal attention network model to predict future resource usage, providing more accurate and comprehensive resource usage predictions, thereby dynamically adjusting resource allocation strategies and achieving better resource allocation decisions in complex and dynamic environments. The present invention can comprehensively consider multiple factors, adapt to diverse application requirements, achieve intelligence and automation, and improve the performance, reliability and resource utilization of containerized applications.

[0037] In one embodiment, the data collection in step S1 adopts a distributed data collection architecture. The system uses a lightweight data collection agent deployed on each container and host, and transmits data to the central processing unit in real time through a message queue. The data related to the container and the application include container-level indicators and application-level indicators as well as host-level indicators and container performance parameters. Among them, the container-level indicators include CPU usage, memory usage, network I / O, and disk I / O; the application-level indicators include user request volume (QPS), response time, and error rate; the host-level indicators include host CPU usage, host memory usage, and host disk usage; the container performance parameters include CPU limits, memory limits, and network bandwidth limits.

[0038] Data preprocessing includes collecting time series data Cleaning, standardization and outlier processing are performed in real time. Data cleaning specifically involves removing duplicate data and processing missing values; data standardization specifically involves using formulas Standardization is performed; outlier processing specifically uses the moving median method to identify and process outliers.

[0039] In one embodiment, the data fusion of the collected data in step S2 includes: applying a feature extraction function to each data modality to extract features, then using an attention mechanism to calculate the attention weight, and weightedly fusing the features of different modalities, and then constructing a graph structure based on the relationship between containers and application components, and applying a graph convolutional network to obtain the final multimodal data fusion result.

[0040] When applying the feature extraction function to each data modality for feature extraction, the long short-term memory network is used for time series data, and the multi-layer perceptron is used for feature extraction for structured data. The attention mechanism assigns importance weights to different modalities, and the tanh activation function is used to introduce nonlinearity to enhance the expressiveness of the model. In the graph structure, nodes represent containers or application components, and edges represent the dependencies between them. Node features include the resource usage of containers and the performance indicators of applications, and the weights of edges represent the communication frequency between components. The fused features are used as the initial features of the graph nodes, and the graph convolutional network is applied for information propagation and updating to obtain the final multimodal data fusion results. A two-layer graph convolutional network is used to capture the high-order interaction between nodes. The final multimodal data fusion results contain the node's own features and neighbor node information.

[0041] The specific steps of multimodal data fusion are as follows: S21. Feature extraction: For each data modality Apply feature extraction functions , and get the feature representation . For time series data, long short-term memory network (LSTM) is used for feature extraction. For structured data, multi-layer perceptron (MLP) is used for feature extraction; S22. Attention Mechanism: Calculating Attention Weights ,in and is a learnable parameter matrix. The attention mechanism assigns importance weights to different modalities, and the tanh activation function introduces nonlinearity to enhance the expressiveness of the model; S23. Weighted fusion: using attention weights to obtain fusion representation , the features of different modalities are weighted and combined to obtain a unified representation. The fusion representation H contains important information of each modality; S24. Graph structure construction: Build a graph structure based on the relationship between system components , where the node V represents the container or application component, the edge E represents the dependency relationship between them, the node characteristics include the resource usage of the container and the performance indicators of the application, and the edge weight represents the communication frequency between components; S25. Graph neural network processing: The fused features are used as the initial features of the graph nodes, and the graph convolutional network (GCN) is used for information propagation and update to obtain the final representation. , that is, the result of multimodal data fusion, using two layers of GCN to capture the high-order interaction relationship between nodes, and finally obtained Contains the node's own characteristics and neighbor node information.

[0042] Through this series of steps, the system achieves comprehensive collection, effective preprocessing and deep fusion of multimodal data. The multimodal data fusion results contain important information of each modality and take into account the topological relationship between system components, providing high-quality, high-dimensional input data for subsequent resource usage prediction and intelligent expansion decisions. This fusion method makes full use of the complementarity of data from different sources and improves the system's ability to understand and predict complex scenarios.

[0043] like Figure 2 FIG. 1 is a schematic diagram of a structure for using a hierarchical temporal attention network for resource prediction. In one embodiment, the hierarchical temporal attention network (HTAN) model in step S3 includes an LSTM layer, a multi-head attention layer, and an output layer, and simultaneously predicts multiple key resource indicators.

[0044] The structure and forward propagation process of the hierarchical temporal attention network model are as follows: (1) LSTM layer: used to capture the long-term dependencies of time series. Its calculation formula is: in yes Slice at time t; (2) Multi-head attention layer: processes information at different time scales. Its calculation process is: in, Q, K, V are all After linear transformation, we get: (3) Output layer: Generate the final prediction result. The calculation formula is: In these formulas, is the hidden state of LSTM, To predict the output, , , , , and are all learnable parameters.

[0045] The training and prediction process of the hierarchical temporal attention network model is as follows: S31, data preparation: divide the multimodal data fusion results into training sequences in chronological order; S32, model initialization: randomly initialize all learnable parameters of the hierarchical temporal attention network model; S33, forward propagation: For each time step, it passes through the LSTM layer, the multi-head attention layer and the output layer in turn to obtain the prediction result; S34, loss calculation: calculate the mean square error between the predicted result and the true value as the loss function; S35, Back Propagation: Use the back propagation algorithm to calculate the gradient and use the optimizer (Adam) to update the parameters of the hierarchical temporal attention network model; S36: Repeat step S35 until the hierarchical temporal attention network model converges or reaches a preset number of training rounds.

[0046] These predictions take into account multimodal data at the container, application, and host levels, as well as the topological relationships between containers and application components. , thereby providing more accurate and comprehensive resource usage forecasts.

[0047] When the system is running, the hierarchical temporal attention network model will continue to receive the latest multimodal data fusion results and generate resource usage forecasts for the next period of time (such as the next 5 minutes, 15 minutes, 1 hour, etc.). These forecast results are expressed as: Where T is the prediction time step. The system will dynamically adjust the resource allocation strategy based on these prediction results to cope with the upcoming load changes, thereby achieving better resource allocation decisions in complex and dynamic environments.

[0048] like Figure 3 The figure shows a decision flow chart of the deep reinforcement learning framework. In one embodiment, the deep Q network (DQN) is used to select the optimal expansion action based on the prediction result in step S4, including: initializing the deep Q network parameters and the experience replay buffer, then obtaining the current input state, using the ε-greedy strategy to select and execute the output action, observing the new state and reward and storing the experience in the experience replay buffer, and then randomly sampling a batch of experience from the experience replay buffer, calculating the target Q value and updating the deep Q network parameters and the target network parameters; the input state of the deep Q network includes the multimodal data fusion result and the prediction result, and the output action represents the specific adjustment of the container resources.

[0049] In actual operation, the input state of DQN is Features fused from multimodal data and prediction result Y, including container-level indicators, application-level indicators (current and predicted user request volume, response time, error rate, etc.), host-level indicators (current and predicted host resource usage), graph structure features (from graph Node and edge features extracted from .

[0050] Output Actions of DQN It is a discrete set of actions that represent specific adjustments to container resources. These actions include adding or reducing 1 CPU core, 512MB of memory, 100Mbps of network bandwidth, and 1000 IOPS of storage performance. These actions directly correspond to adjustments to container performance parameters, allowing the system to flexibly adjust resource allocation based on demand.

[0051] In practical applications, the decision-making process of the system is as follows: S41: Initialize DQN network parameters and experience replay buffer; S42: Get current status Select actions using the ε-greedy strategy Execute an action , observe the new state and rewards Experience Store into the experience replay buffer; S43: Randomly sample a batch of experiences from the experience replay buffer; S44: Calculate the target Q value and update the DQN network parameters; S45: Update target network parameters.

[0052] In this way, the deep Q network can gradually learn the strategy of selecting the optimal expansion action under different states, thereby realizing intelligent resource allocation and container expansion. During the actual deployment process, the system will continue to monitor environmental changes and continuously optimize decision-making strategies based on new observations to adapt to dynamically changing workloads and resource requirements. This adaptive learning mechanism ensures that the system can always maintain efficient resource management capabilities when facing complex and changing environments.

[0053] In one embodiment, collecting feedback and calculating rewards in step S5 includes: calculating SLA satisfaction, resource utilization and cost based on the feedback, and substituting them into the reward function to obtain the reward of the extended action. The system applies the action selected by DQN to the actual environment and collects feedback. These feedbacks are used to calculate the reward , defined as: in, , , is the weight coefficient, which is adjusted according to the specific application scenario.

[0054] The specific definitions of each indicator are as follows: SLA satisfaction ( ) is calculated as: Among them, RT is the average response time, is the maximum allowed response time, ER is the error rate, is the maximum allowable error rate.

[0055] Resource utilization (RU) is calculated as follows: Where N is the number of resource types, is the actual usage of the i-th resource, is the total capacity of the i-th type of resources.

[0056] The cost is calculated by the following formula: in, is the unit price of the i-th type of resources.

[0057] In practical applications, the system execution and feedback process is as follows: S51: The system first selects an action based on the current state and the DQN model, such as adding 1 CPU core or adding 512MB of memory; S52: applying the selected action to the target container and waiting for a certain time (e.g., 1 minute) for the system to stabilize; S53: collect various indicators after the execution of the action, including response time, error rate, usage of various resources, etc.; S54: Based on the collected indicators, calculate satisfaction, resource utilization and cost using the above formula; S55: Substitute these calculation results into the reward function to obtain the reward value of this action ; S56: Combine state, action, reward and new state Store in experience replay buffer; S57: Regularly sample from the experience replay buffer and update the parameters of the DQN model.

[0058] The reward function comprehensively considers system performance, resource utilization efficiency and operating costs, aiming to maximize resource utilization and minimize costs while ensuring service quality. The system gradually learns the optimal resource allocation strategy under different states by continuously executing actions, collecting feedback and updating the deep Q network model, so that it can more accurately predict resource requirements and make better expansion decisions, thereby realizing intelligent management of container resources.

[0059] The above-mentioned embodiments of the present invention realize the comprehensive collection, effective preprocessing and deep fusion of multimodal data, make full use of the complementarity of data from different sources, and improve the understanding and prediction ability of complex scenarios; adopt a hierarchical temporal attention network model to predict future resource usage, provide more accurate and comprehensive resource usage prediction, so as to dynamically adjust the resource allocation strategy and achieve better resource allocation decisions in complex and dynamic environments; the system can more accurately predict resource requirements and make better expansion decisions to adapt to dynamically changing workloads and resource requirements by continuously executing actions, collecting feedback and updating the deep Q network model, thereby realizing intelligent management of container resources. The present invention can comprehensively consider multiple factors, adapt to diverse application requirements, realize intelligence and automation, and improve the performance, reliability and resource utilization of containerized applications.

[0060] In response to the problem of limited resources, the system significantly improves resource utilization, enhances system stability, and improves application performance and user experience. At the same time, it reduces operation and maintenance costs and improves the flexibility and scalability of the system. Through continuous learning and optimization, the system can adapt to different types of applications and environments and continuously improve the accuracy of resource allocation decisions. This intelligent resource management method provides strong support for the efficient operation of large-scale container clusters and represents the cutting-edge development direction of the combination of container technology and artificial intelligence.

[0061] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any way. Any simple modification, change and equivalent structural transformation made to the above embodiment based on the technical essence of the present invention still falls within the protection scope of the technical solution of the present invention.

Claims

1. An adaptive container expansion method, characterized in that: include: S1. Data collection and preprocessing: Continuously collect and preprocess container and application-related data from multiple sources; S2, multimodal data fusion: perform data fusion on the collected data to obtain multimodal data fusion results; S3. Resource usage prediction: Based on the multimodal data fusion result, a hierarchical temporal attention network model is used to predict future resource usage and generate a prediction result; S4, deep reinforcement learning decision: selecting the optimal expansion action based on the prediction result; S5, execution and feedback: Apply the extended action to the actual environment and collect feedback to calculate rewards.

2. The adaptive container expansion method according to claim 1, characterized in that: The container and application related data described in step S1 include container-level indicators, application-level indicators, host-level indicators and container performance parameters. The data collection adopts a distributed data collection architecture, and the data preprocessing includes real-time cleaning and standardization of the collected time series data and outlier processing.

3. The adaptive container expansion method according to claim 2, characterized in that: The data fusion of the collected data described in step S2 includes: applying a feature extraction function to each data modality to extract features, then using an attention mechanism to calculate the attention weight, and weightedly fusing the features of different modalities, and then constructing a graph structure based on the relationship between containers and application components, and applying a graph convolutional network to obtain the final multimodal data fusion result.

4. The adaptive container expansion method according to claim 1, characterized in that: The hierarchical temporal attention network model described in step S3 includes an LSTM layer, a multi-head attention layer and an output layer, and simultaneously predicts multiple key resource indicators; the LSTM layer captures the long-term dependencies of the time series, the multi-head attention layer processes information of different time scales, and the output layer generates the final prediction result.

5. The adaptive container expansion method according to claim 4, characterized in that: The training and prediction process of the hierarchical temporal attention network model described in step S3 is as follows: S31: dividing the multimodal data fusion result into training sequences in chronological order; S32: Randomly initialize all learnable parameters of the hierarchical temporal attention network model; S33: For each time step, the prediction result is obtained by sequentially passing through the LSTM layer, the multi-head attention layer and the output layer; S34: Calculate the mean square error between the predicted result and the true value as the loss function; S35: Calculate the gradient using the back propagation algorithm, and use the optimizer to update the parameters of the hierarchical temporal attention network model; S36: Repeat step S35 until the hierarchical temporal attention network model converges or reaches a preset number of training rounds.

6. The adaptive container expansion method according to claim 1, characterized in that: The step S4 described in which the optimal expansion action based on the prediction result is selected using a deep Q network includes: initializing deep Q network parameters and an experience replay buffer, then obtaining the current input state, using an ε-greedy strategy to select and execute an output action, observing new states and rewards and storing experience in the experience replay buffer, and then randomly sampling a batch of experience from the experience replay buffer, calculating a target Q value and updating deep Q network parameters and target network parameters; the input state of the deep Q network includes the multimodal data fusion result and the prediction result, and the output action represents a specific adjustment to the container resources.

7. The adaptive container expansion method according to claim 1, characterized in that: The step S5 of collecting feedback and calculating rewards includes: calculating SLA satisfaction, resource utilization and cost according to the feedback, and substituting them into a reward function to obtain a reward for the extended action.

8. An adaptive container expansion system, characterized in that: include: Multimodal data collection and preprocessing module, which continuously collects and preprocesses container and application-related data from multiple sources; The multimodal data fusion module performs data fusion on the collected data to obtain the multimodal data fusion result; A resource usage prediction module, based on the multimodal data fusion result, uses a hierarchical temporal attention network model to predict future resource usage and generate a prediction result; A deep reinforcement learning decision module selects the optimal expansion action based on the prediction result; An execution and feedback module applies the extended action to the actual environment and collects feedback to calculate rewards; The system executes an adaptive container expansion method according to any one of claims 1 to 7.

9. An electronic device, characterized in that: include: one or more processors; Memory; And one or more programs, the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and when the programs are executed by the processors, an adaptive container expansion method as described in any one of claims 1-7 is implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the computer program implements an adaptive container expansion method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Network integrated dynamic resource routing management system and method

    CN118590430A

  • Dynamic load balancing method and system of optical communication device

    CN118660014A

  • Energy consumption monitoring and optimizing method and system based on large model and multiple agents

    CN118916778A