Multi-container runtime adaptive evaluation and selection method

Through multi-index comprehensive weighted scoring and machine learning technology, dynamic selection of container runtime has solved the problem of lack of dynamic adaptability in the existing technology, and achieved resource optimization and performance improvement.

CN119537028AInactive Publication Date: 2025-02-28NANJING INFORMATION HIGH-SPEED RAILWAY RES INST OF SCI AND TECH

Patent Information

Application Number
CN202510073407.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-17
Publication Date
2025-02-28
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing container runtime selection mechanism lacks dynamic adaptability and cannot dynamically adjust container runtime selection based on real-time task performance and resource utilization, resulting in resource waste and performance bottlenecks.

Method used

A decision model with multi-index comprehensive weighted score is adopted, combined with machine learning technology, and the optimal container runtime is automatically selected according to task characteristics and performance requirements, and the decision model is optimized through historical monitoring data.

Benefits of technology

It realizes automated selection of the optimal container runtime, reduces manual configuration complexity, optimizes resource utilization, improves performance, and meets the needs of modern applications for dynamic adaptation and efficient optimization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119537028A_ABST
    Figure CN119537028A_ABST
Patent Text Reader

Abstract

The invention discloses a multi-container runtime adaptive evaluation and selection method, which comprises the following steps of: calculating the current score of each container during runtime by utilizing a decision model based on multi-index comprehensive weighted scoring according to the index requirement of a submitted task, and taking the runtime of the container with the highest current score and a normal state as the runtime of a container to be run; converting the data of the submitted task into a target parameter when the container to be operated is operated, calling a corresponding container engine to operate the task, monitoring the whole process of task operation, and collecting monitoring data; training the random forest model by using the collected index data, extracting the importance score of each feature, updating the weight of the decision model according to the importance score, calculating the current score of each container during operation by using the decision model after the weight is updated, and selecting the container to be operated during operation. According to the method, the optimal container runtime of the task is selected from two aspects of giving an initial decision weight and continuously performing machine learning to optimize the weight.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of cloud computing and virtualization, and specifically relates to a multi-container runtime adaptive evaluation and selection method. Background Art

[0002] With the rapid development of cloud computing and microservice architecture, containerization technology has become a core component of current software development and deployment. Containers enable applications to run efficiently in different computing environments by providing a lightweight, portable, and consistent operating environment. As the earliest widely used container engine, Docker has promoted the development of container technology. With the increasing prosperity of the container ecosystem, container runtimes such as Containerd and CRI-O have gradually gained attention. In actual application, different container runtimes have their own unique advantages and applicable scenarios. Due to the diversity and complexity of application requirements, a single container runtime can no longer meet the needs of all scenarios. At present, the selection of container runtimes mainly depends on the user's static configuration or pre-set policies.

[0003] Although these methods have solved the problem of container runtime selection to a certain extent, they still have limitations. First, manual configuration is required. In a multi-container runtime environment, manually managing and configuring the usage rules of different container runtimes is complex and error-prone. Second, there is a lack of dynamic adaptability, and the container runtime selection cannot be dynamically adjusted according to real-time task performance and resource utilization, resulting in resource waste and performance bottlenecks. Finally, it is difficult to optimize the container runtime selection, and it is extremely dependent on experience and preset rules, and it is impossible to optimize the selection strategy. In view of the above background, the existing container runtime selection mechanism cannot meet the needs of modern applications for dynamic adaptation, efficient optimization, and ease of use. Summary of the invention

[0004] The object of the present invention is to provide a multi-container runtime adaptive evaluation and selection method to achieve highly adaptive selection of the optimal container runtime and optimize the decision model through machine learning.

[0005] The technical solution to achieve the purpose of the present invention is: a multi-container runtime adaptive evaluation and selection method, which specifically includes the following steps:

[0006] Step S1, according to the indicator requirements of the submitted task, the current score of each container runtime is calculated using a decision model based on multi-indicator comprehensive weighted scoring, and the container runtime with the highest current score and normal status is used as the container runtime to be run;

[0007] Step S2, converting the data of the submitted task into the target parameters of the container runtime to be run, calling the corresponding container engine to run the task, monitoring the entire process of the task running, and collecting monitoring data;

[0008] Step S3, use the collected indicator data to train the random forest model, extract the importance score of each feature, update the weight of the decision model according to the importance score, use the decision model with updated weight to calculate the current score of each container runtime, and select the container runtime to be run.

[0009] Compared with the prior art, the present invention has the following significant advantages:

[0010] (1) The present invention automatically selects the optimal container runtime based on task characteristics and performance requirements, eliminating complex manual configuration and reducing time costs.

[0011] (2) The present invention automatically optimizes the decision model based on historical monitoring indicator data through machine learning, and continuously trains and optimizes the decision model based on historical data of task operation through machine learning to ensure the correctness of the rule model. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] Figure 1 This is a flow chart of the multi-container runtime adaptive evaluation and selection method of the present invention. DETAILED DESCRIPTION

[0013] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments.

[0014] Combination Figure 1 The multi-container runtime adaptive evaluation and selection method of the present invention comprises the following steps:

[0015] Step S1, construct a decision model based on multi-indicator comprehensive weighted scoring, and calculate the current score of each container runtime using the decision model based on multi-indicator comprehensive weighted scoring according to the indicator requirements of the submitted task, and use the container runtime with the highest current score as the optimal container runtime;

[0016] In a further embodiment, the indicators in the decision model based on multi-indicator comprehensive weighted scoring include: CPU performance, memory overhead, network performance, I / O performance, startup speed, resource isolation, compatibility and stability (numbered 1, 2, ..., 8 respectively). The container runtimes that may be used are numbered 1, 2, 3, 4, 5 respectively, and the container runtime supports the Open Container Initiative image format.

[0017] CPU performance is the performance of the CPU executing tasks in a specific container runtime environment; the CPU performance score is obtained by running CPU-intensive benchmarks. The highest score is , the minimum score is .

[0018] Memory overhead refers to the additional memory required by different containers to maintain their own operating environment. By running a fixed number of identical lightweight container images and recording the total memory usage through system monitoring tools, the memory overhead of the container runtime is calculated using the following formula: ,in is the initial memory usage, and n is the number of containers running at runtime. , is the memory usage after running n i-th containers; the maximum memory overhead is , the minimum memory cost is .

[0019] The network performance is the network bandwidth when different containers are running. , the maximum network bandwidth is , the minimum is .

[0020] I / O performance is the I / O throughput, which is the amount of data successfully transmitted per unit time. The throughput of each container during runtime tested using fio is , the highest is , the minimum is .

[0021] The startup speed is the delay from when a container is created to when the container is successfully started during runtime. , the highest is , the minimum is .

[0022] Resource isolation refers to the degree to which the container is isolated from the host system and other containers in terms of resources and security when the container is running; the isolation level ranges from 1 to 10, with 1 to 3 being low isolation levels, 4 to 6 being medium isolation levels, 7 to 8 being high isolation levels, and 9 to 10 being very high isolation levels; the isolation level of each container is , the highest is , the minimum is .

[0023] Compatibility refers to the compatibility of each container runtime with the existing container image; the compatibility score is 1 to 10, 1 to 3 is low compatibility, 4 to 6 is medium compatibility, 7 to 8 is high compatibility, and 9 to 10 is extremely high compatibility; the compatibility score of each container is , the highest is , the minimum is .

[0024] Stability refers to the reliability and maturity of the container when it is running. The stability score is 1 to 10, with 1 to 3 being low stability, 4 to 6 being medium stability, 7 to 8 being high stability, and 9 to 10 being extremely high stability. The stability score of each container is , the highest is , the minimum is .

[0025] These indicators are divided into two categories: positive indicators (CPU performance, network performance, I / O performance, resource isolation, compatibility and stability) and negative indicators (memory overhead, startup speed). The larger the value of the positive indicator, the better, and the smaller the value of the negative indicator, the better. Then, the two types of indicators are normalized (ranging from 0 to 1) through standardization. The normalization calculation formula for positive indicators is: , the normalized calculation formula of the reverse indicator is: ,in is the standardized score of the jth indicator when the i-th container is running (ranging from 0 to 1), is the original value of the jth indicator when the i-th container is running. and are the original minimum and maximum values ​​of the jth indicator in all container runtimes. Finally, the weighted total score is calculated, that is, the decision model based on the comprehensive weighted scoring of multiple indicators is as follows:

[0026] ,

[0027] In the formula, is the total score of the i-th container runtime, is the weight of the jth indicator (ranging from 0 to 1), satisfying , n is the total number of indicators . The initial weight is: (CPU performance), (memory overhead), (Network Performance), (I / O performance), (startup speed), (resource isolation), (compatibility), (Stability); The rule engine calculates the default total score of each container when it is running, and uses it as the default value to facilitate the direct running of tasks without defined weights.

[0028] Furthermore, the current score of each container runtime is calculated using a decision model based on multi-indicator comprehensive weighted scoring, and the specific method of taking the container runtime with the highest current score as the optimal container runtime is as follows:

[0029] When a user submits a task, he or she can customize the weights of the various indicators required for the task, and automatically normalize all weights so that the sum is 1. If you need to ignore an indicator, you can set the weight of the indicator to 0; if the weight of a specific indicator is not set, the default weight will be used. The automatic normalization formula is: ,in The weight is entered by the user or the default weight if no input is given. is the corresponding weight after normalization;

[0030] Substitute the new weights into the weighted score calculation formula in step S1 to replace the default weights of each indicator, and recalculate the runtime scores of each container of the current task in real time.

[0031] The container runtime with the highest score is selected, and the current container runtime status is verified. If there is an exception, the container runtime with a lower score is cyclically selected for status verification. If successful, step S2 is performed, and the container runtime after the successful verification is used as the container runtime to be run.

[0032] Step S2, based on the judgment result of step S1, convert the data of the submitted task into the target parameters of the container runtime to be run, call the corresponding container engine to run the task, monitor the entire process of the task running, and collect indicators and save them in the timing monitoring system. The specific process is as follows:

[0033] Step S201, pre-parameter conversion and container runtime:

[0034] The task running parameters and the optimal container runtime are obtained through step S1. Due to the differences in the running parameters of each container, it is necessary to convert the task running parameters into the adaptation target parameters of the container runtime through a pre-conversion function, pull the image, and then call the corresponding container engine to create a container and run the task, and send the data (weights of each indicator) to the timing monitoring system gateway.

[0035] Step S202, monitoring data collection and storage:

[0036] Deploy container consultants on all nodes, and let them collect the resource usage of containers (CPU usage, memory usage, network throughput, I / O disk read and write volume) and record them in the timing monitoring system. At the same time, deploy the timing monitoring system gateway to run event monitoring for each container runtime (record a time point for each container creation and container startup event), and push the startup time (the time difference between container creation and container startup events) to the timing monitoring system gateway.

[0037] Step S3, through machine learning, refine the monitoring data for training, extract the feature importance, and optimize the weights, so that the weighted scoring model can more accurately reflect the task execution effect.

[0038] Step S301, cleaning and converting the monitoring data:

[0039] A large amount of historical monitoring data is accumulated by step S202, including resource usage (CPU usage, memory usage, network throughput, I / O disk read / write volume), task data (startup time) and weight data. The system will pull the monitoring data of the last 7 days from the time series monitoring system and label the above 5 types of data (CPU usage, memory usage, network throughput, I / O disk read / write volume, startup time) as ) for cleaning, and the data with missing values ​​less than 2 (CPU usage, memory usage, network throughput, I / O disk read / write volume, and startup time data of the same record, if 2 or more are missing, will be directly filtered) are filled with the mean (the average value of all previous values ​​of this type of data when the same container is running): ,in is the missing value, N is the number of known values, is a known value (the previous value of this data when the same container is running). Then, based on the five types of data, the task execution effect score is calculated. First, the five types of data are standardized, and the formula is: ,in is the serial number of historical monitoring data, is the data type, It is the standardized No. data, It is No. The original value of the data, and They are Then calculate the task execution effect score, the formula is: ,in is the serial number of historical monitoring data, The above five types of data, are the weights corresponding to the five types of data, For the The task execution effect score of the data is calculated.

[0040] Step S302: The random forest model is trained and feature importance is extracted:

[0041] First, data preparation and sample generation are performed. The cleaned monitoring data set is obtained from step S301 for sample construction, which includes five monitoring indicators (CPU usage, memory usage, network throughput, I / O disk read and write volume, and startup time, which are marked as ) and the corresponding task execution effect score; the five monitoring indicators are used as characteristic variables ( ), and the task execution effect score is used as the target variable ( ), and use time series to divide the data set into training set and test set according to 8:2. Then configure the parameters of the random forest model: the number of decision trees, the maximum depth of each tree, the minimum number of samples for sample segmentation, and initialize the model; then use the training set data to train the random forest model, and generate multiple training subsets by random sampling with replacement, each subset is used to train a decision tree. Then perform model evaluation, use the test set to predict the trained random forest model, and evaluate the model's performance indicators (mean square error and determination coefficient). Finally, by evaluating the split contribution of each feature in the decision tree, calculate the importance score of each feature:

[0042] ,in is the total number of decision trees, is the tth decision tree The importance score of an indicator.

[0043] Step S303, update decision weights:

[0044] The feature importance, i.e., the weights of the eight indicators, is obtained from step S302. Dynamic weight adjustment: ,in is the latest indicator weight, is the indicator weight being used, is the smoothing parameter for weight adjustment, is the final indicator weight. Replace the default decision weight with the following calculation formula: , is the total score of the i-th container runtime, is the weight of the jth indicator (ranging from 0 to 1), satisfying , n is the total number of indicators Subsequent scoring will use this new calculation formula to determine the optimal container runtime.

[0045] When faced with the diversity and complexity of application requirements, such as CPU-intensive tasks such as numerical calculations and image processing, I / O-intensive tasks such as file reading and writing, big data processing, as well as mixed tasks, short-term tasks, long-term tasks, etc., especially when there are high requirements on performance, resources and other aspects, the present invention can select the optimal container runtime for the current application from many container runtimes, on the one hand, eliminating complex manual configuration and reducing time costs; on the other hand, it can continuously train and optimize the decision model through machine learning according to the historical data of task operation, so as to ensure the correctness of the rule model.

[0046] The present invention selects the optimal container runtime for a task from two aspects: a given initial decision weight and a continuous machine learning optimization weight. This eliminates the need for complicated user configurations and provides a certain amount of customization space, allowing many applications to adaptively select the optimal container runtime. Through machine learning, the weights are continuously adjusted, allowing the weighted scoring model to be continuously optimized, and the selection of task container runtime is more accurate.

Claims

1. A multi-container runtime adaptive evaluation and selection method, characterized in that: The specific steps include: Step S1, according to the indicator requirements of the submitted task, the current score of each container runtime is calculated using a decision model based on multi-indicator comprehensive weighted scoring, and the container runtime with the highest current score and normal status is used as the container runtime to be run; Step S2, converting the data of the submitted task into the target parameters of the container runtime to be run, calling the corresponding container engine to run the task, monitoring the entire process of the task running, and collecting monitoring data; Step S3, use the collected indicator data to train the random forest model, extract the importance score of each feature, update the weight of the decision model according to the importance score, use the decision model with updated weight to calculate the current score of each container runtime, and select the container runtime to be run.

2. The multi-container runtime adaptive evaluation and selection method according to claim 1 is characterized in that: The decision-making model based on multi-index comprehensive weighted scoring is as follows: , In the formula, is the weight of the jth indicator, n is the total number of indicators, The normalized indicator value is For the i A comprehensive weighted score of multiple indicators when a container is running.

3. The multi-container runtime adaptive evaluation and selection method according to claim 2 is characterized in that: The indicators are divided into positive indicators and negative indicators. The normalized formula of the positive indicator is: , The normalized formula of the reverse indicator is: , In the formula, is the normalized score of the jth metric when the i-th container is running, is the original value of the jth indicator when the i-th container is running. and are the raw minimum and raw maximum values ​​of the jth metric in all container runtimes, respectively.

4. The multi-container runtime adaptive evaluation and selection method according to claim 1, characterized in that: The indicators used in the decision model based on multi-indicator comprehensive weighted scoring are the CPU performance score, memory overhead, network bandwidth, I / O throughput, startup speed, resource isolation score, compatibility score and stability score of each container during runtime.

5. The multi-container runtime adaptive evaluation and selection method according to claim 4 is characterized in that: The calculation formula for memory overhead is: , In the formula, is the initial memory usage, n is the number of running containers at runtime, Memory usage after running n i-th containers.

6. The multi-container runtime adaptive evaluation and selection method according to claim 1, characterized in that: The specific process of converting the submitted task data into the target parameters of the container runtime to be run, calling the corresponding container engine to run the task, monitoring the entire process of the task running, and collecting indicators is as follows: The task running parameters are converted into the adaptation target parameters when the container is running through the pre-conversion function, and the image is pulled; Call the corresponding container engine, create a container and run the task, and send the weight of each indicator to the time series monitoring system gateway; Deploy container consultants on all nodes to collect container resource usage and record it in the time series monitoring system. At the same time, deploy the timing monitoring system gateway, run the event monitoring of each container runtime, and push the startup time to the timing monitoring system gateway.

7. The multi-container runtime adaptive evaluation and selection method according to claim 1, characterized in that: The monitoring data includes CPU usage, memory usage, network throughput, I / O disk read and write volume, and startup time.

8. The multi-container runtime adaptive evaluation and selection method according to claim 1, characterized in that: The specific process of training the random forest model using the collected indicator data and extracting the importance score of each feature is as follows: Step S301, cleaning and converting the collected indicator data, specifically: Clean the indicator data collected at set times, and fill in the missing values ​​of the collected indicator data with values ​​less than the set number with mean value; Based on the filled indicator data, the task execution effect score is calculated, specifically: , in is the serial number of historical monitoring data, is the data type, It is the standardized No. data, It is No. The original value of the data, and They are The mean and standard deviation of the data; Calculate the task execution effect score. The specific formula is: , In the formula, is the weight corresponding to the data, For the The task execution effect score of the number; Step S302: The random forest model is trained and feature importance is extracted: The cleaned monitoring data set is used as the feature variable and the task execution effect score is used as the target variable to construct the training set; Configure the parameters of the random forest model and initialize the random forest model; Use the training set data to train the random forest model. Generate multiple training subsets by random sampling with replacement. Each subset is used to train a decision tree. The importance score of each feature is calculated by evaluating its contribution to the split in the decision tree: , in, is the total number of decision trees, is the tth decision tree The importance score of an indicator.

9. The multi-container runtime adaptive evaluation and selection method according to claim 1, characterized in that: The specific formula for updating the weight of the decision model according to the importance score is: , in, is the latest indicator weight, is the indicator weight being used, is the smoothing parameter for weight adjustment, is the final indicator weight.

Citation Information

Patent Citations

  • A quantitative risk assessment system and method using pipelined data

    CN111738843A

  • Weighted load balancing method and system based on container cluster performance

    CN114253716A

  • Resource scheduling method and device based on Kubernetes, electronic equipment and medium

    CN116126466A

  • Industrial enterprise energy storage installation potential layering identification method under user side view angle

    CN117522207A

  • K8S container scheduling method and system based on monitoring perception

    CN117729204A

Cited By

  • Optimization method for equipment state prediction model and equipment state prediction method and system

    CN120068312A